function f7(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(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 a of r)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();var zm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Dre(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var h7={exports:{}},PT={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ore=Symbol.for("react.transitional.element"),Ire=Symbol.for("react.fragment");function d7(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:Ore,type:t,key:i,ref:e!==void 0?e:null,props:n}}PT.Fragment=Ire;PT.jsx=d7;PT.jsxs=d7;h7.exports=PT;var D=h7.exports;const Nre=Rc(D),Lre=f7({__proto__:null,default:Nre},[D]);var p7={exports:{}},UT={},m7={exports:{}},g7={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){function e(F,H){var V=F.length;F.push(H);e:for(;0<V;){var W=V-1>>>1,B=F[W];if(0<r(B,H))F[W]=H,F[V]=B,V=W;else break e}}function n(F){return F.length===0?null:F[0]}function i(F){if(F.length===0)return null;var H=F[0],V=F.pop();if(V!==H){F[0]=V;e:for(var W=0,B=F.length,Y=B>>>1;W<Y;){var Z=2*(W+1)-1,G=F[Z],de=Z+1,oe=F[de];if(0>r(G,V))de<B&&0>r(oe,G)?(F[W]=oe,F[de]=V,W=de):(F[W]=G,F[Z]=V,W=Z);else if(de<B&&0>r(oe,V))F[W]=oe,F[de]=V,W=de;else break e}}return H}function r(F,H){var V=F.sortIndex-H.sortIndex;return V!==0?V:F.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,d=!1,g=!1,b=!1,y=!1,p=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function w(F){for(var H=n(c);H!==null;){if(H.callback===null)i(c);else if(H.startTime<=F)i(c),H.sortIndex=H.expirationTime,e(l,H);else break;H=n(c)}}function M(F){if(b=!1,w(F),!g)if(n(l)!==null)g=!0,S||(S=!0,P());else{var H=n(c);H!==null&&X(M,H.startTime-F)}}var S=!1,A=-1,C=5,k=-1;function R(){return y?!0:!(t.unstable_now()-k<C)}function N(){if(y=!1,S){var F=t.unstable_now();k=F;var H=!0;try{e:{g=!1,b&&(b=!1,x(A),A=-1),d=!0;var V=h;try{t:{for(w(F),f=n(l);f!==null&&!(f.expirationTime>F&&R());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var B=W(f.expirationTime<=F);if(F=t.unstable_now(),typeof B=="function"){f.callback=B,w(F),H=!0;break t}f===n(l)&&i(l),w(F)}else i(l);f=n(l)}if(f!==null)H=!0;else{var Y=n(c);Y!==null&&X(M,Y.startTime-F),H=!1}}break e}finally{f=null,h=V,d=!1}H=void 0}}finally{H?P():S=!1}}}var P;if(typeof _=="function")P=function(){_(N)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,z=j.port2;j.port1.onmessage=N,P=function(){z.postMessage(null)}}else P=function(){p(N,0)};function X(F,H){A=p(function(){F(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(F){switch(h){case 1:case 2:case 3:var H=3;break;default:H=h}var V=h;h=H;try{return F()}finally{h=V}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(F,H){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var V=h;h=F;try{return H()}finally{h=V}},t.unstable_scheduleCallback=function(F,H,V){var W=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?W+V:W):V=W,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=V+B,F={id:u++,callback:H,priorityLevel:F,startTime:V,expirationTime:B,sortIndex:-1},V>W?(F.sortIndex=V,e(c,F),n(l)===null&&F===n(c)&&(b?(x(A),A=-1):b=!0,X(M,V-W))):(F.sortIndex=B,e(l,F),g||d||(g=!0,S||(S=!0,P()))),F},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(F){var H=h;return function(){var V=h;h=H;try{return F.apply(this,arguments)}finally{h=V}}}})(g7);m7.exports=g7;var Pre=m7.exports,b7={exports:{}},fi={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vN=Symbol.for("react.transitional.element"),Ure=Symbol.for("react.portal"),Fre=Symbol.for("react.fragment"),Bre=Symbol.for("react.strict_mode"),zre=Symbol.for("react.profiler"),jre=Symbol.for("react.consumer"),Hre=Symbol.for("react.context"),Vre=Symbol.for("react.forward_ref"),Gre=Symbol.for("react.suspense"),Wre=Symbol.for("react.memo"),v7=Symbol.for("react.lazy"),Q9=Symbol.iterator;function Xre(t){return t===null||typeof t!="object"?null:(t=Q9&&t[Q9]||t["@@iterator"],typeof t=="function"?t:null)}var y7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x7=Object.assign,_7={};function wv(t,e,n){this.props=t,this.context=e,this.refs=_7,this.updater=n||y7}wv.prototype.isReactComponent={};wv.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};wv.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function S7(){}S7.prototype=wv.prototype;function yN(t,e,n){this.props=t,this.context=e,this.refs=_7,this.updater=n||y7}var xN=yN.prototype=new S7;xN.constructor=yN;x7(xN,wv.prototype);xN.isPureReactComponent=!0;var eF=Array.isArray,$r={H:null,A:null,T:null,S:null,V:null},w7=Object.prototype.hasOwnProperty;function _N(t,e,n,i,r,a){return n=a.ref,{$$typeof:vN,type:t,key:e,ref:n!==void 0?n:null,props:a}}function qre(t,e){return _N(t.type,e,void 0,void 0,void 0,t.props)}function SN(t){return typeof t=="object"&&t!==null&&t.$$typeof===vN}function Kre(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var tF=/\/+/g;function QR(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Kre(""+t.key):e.toString(36)}function nF(){}function Yre(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(nF,nF):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Ub(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(a){case"bigint":case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case vN:case Ure:s=!0;break;case v7:return s=t._init,Ub(s(t._payload),e,n,i,r)}}if(s)return r=r(t),s=i===""?"."+QR(t,0):i,eF(r)?(n="",s!=null&&(n=s.replace(tF,"$&/")+"/"),Ub(r,e,n,"",function(c){return c})):r!=null&&(SN(r)&&(r=qre(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(tF,"$&/")+"/")+s)),e.push(r)),1;s=0;var o=i===""?".":i+":";if(eF(t))for(var l=0;l<t.length;l++)i=t[l],a=o+QR(i,l),s+=Ub(i,e,n,a,r);else if(l=Xre(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,a=o+QR(i,l++),s+=Ub(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return Ub(Yre(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return s}function US(t,e,n){if(t==null)return t;var i=[],r=0;return Ub(t,i,"","",function(a){return e.call(n,a,r++)}),i}function Jre(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var iF=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function $re(){}fi.Children={map:US,forEach:function(t,e,n){US(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return US(t,function(){e++}),e},toArray:function(t){return US(t,function(e){return e})||[]},only:function(t){if(!SN(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};fi.Component=wv;fi.Fragment=Fre;fi.Profiler=zre;fi.PureComponent=yN;fi.StrictMode=Bre;fi.Suspense=Gre;fi.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$r;fi.__COMPILER_RUNTIME={__proto__:null,c:function(t){return $r.H.useMemoCache(t)}};fi.cache=function(t){return function(){return t.apply(null,arguments)}};fi.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=x7({},t.props),r=t.key,a=void 0;if(e!=null)for(s in e.ref!==void 0&&(a=void 0),e.key!==void 0&&(r=""+e.key),e)!w7.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(i[s]=e[s]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];i.children=o}return _N(t.type,r,void 0,void 0,a,i)};fi.createContext=function(t){return t={$$typeof:Hre,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:jre,_context:t},t};fi.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)w7.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];r.children=o}if(t&&t.defaultProps)for(i in s=t.defaultProps,s)r[i]===void 0&&(r[i]=s[i]);return _N(t,a,void 0,void 0,null,r)};fi.createRef=function(){return{current:null}};fi.forwardRef=function(t){return{$$typeof:Vre,render:t}};fi.isValidElement=SN;fi.lazy=function(t){return{$$typeof:v7,_payload:{_status:-1,_result:t},_init:Jre}};fi.memo=function(t,e){return{$$typeof:Wre,type:t,compare:e===void 0?null:e}};fi.startTransition=function(t){var e=$r.T,n={};$r.T=n;try{var i=t(),r=$r.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then($re,iF)}catch(a){iF(a)}finally{$r.T=e}};fi.unstable_useCacheRefresh=function(){return $r.H.useCacheRefresh()};fi.use=function(t){return $r.H.use(t)};fi.useActionState=function(t,e,n){return $r.H.useActionState(t,e,n)};fi.useCallback=function(t,e){return $r.H.useCallback(t,e)};fi.useContext=function(t){return $r.H.useContext(t)};fi.useDebugValue=function(){};fi.useDeferredValue=function(t,e){return $r.H.useDeferredValue(t,e)};fi.useEffect=function(t,e,n){var i=$r.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};fi.useId=function(){return $r.H.useId()};fi.useImperativeHandle=function(t,e,n){return $r.H.useImperativeHandle(t,e,n)};fi.useInsertionEffect=function(t,e){return $r.H.useInsertionEffect(t,e)};fi.useLayoutEffect=function(t,e){return $r.H.useLayoutEffect(t,e)};fi.useMemo=function(t,e){return $r.H.useMemo(t,e)};fi.useOptimistic=function(t,e){return $r.H.useOptimistic(t,e)};fi.useReducer=function(t,e,n){return $r.H.useReducer(t,e,n)};fi.useRef=function(t){return $r.H.useRef(t)};fi.useState=function(t){return $r.H.useState(t)};fi.useSyncExternalStore=function(t,e,n){return $r.H.useSyncExternalStore(t,e,n)};fi.useTransition=function(){return $r.H.useTransition()};fi.version="19.1.1";b7.exports=fi;var I=b7.exports;const Ee=Rc(I),E7=f7({__proto__:null,default:Ee},[I]);var M7={exports:{}},Co={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Zre=I;function T7(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Gh(){}var Mo={d:{f:Gh,r:function(){throw Error(T7(522))},D:Gh,C:Gh,L:Gh,m:Gh,X:Gh,S:Gh,M:Gh},p:0,findDOMNode:null},Qre=Symbol.for("react.portal");function eae(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qre,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Ux=Zre.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function FT(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Co.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mo;Co.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(T7(299));return eae(t,e,null,n)};Co.flushSync=function(t){var e=Ux.T,n=Mo.p;try{if(Ux.T=null,Mo.p=2,t)return t()}finally{Ux.T=e,Mo.p=n,Mo.d.f()}};Co.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Mo.d.C(t,e))};Co.prefetchDNS=function(t){typeof t=="string"&&Mo.d.D(t)};Co.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=FT(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Mo.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Mo.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Co.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=FT(e.as,e.crossOrigin);Mo.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Mo.d.M(t)};Co.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=FT(n,e.crossOrigin);Mo.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Co.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=FT(e.as,e.crossOrigin);Mo.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Mo.d.m(t)};Co.requestFormReset=function(t){Mo.d.r(t)};Co.unstable_batchedUpdates=function(t,e){return t(e)};Co.useFormState=function(t,e,n){return Ux.H.useFormState(t,e,n)};Co.useFormStatus=function(){return Ux.H.useHostTransitionStatus()};Co.version="19.1.1";function A7(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A7)}catch(t){console.error(t)}}A7(),M7.exports=Co;var u_=M7.exports;const xx=Rc(u_);/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var za=Pre,C7=I,tae=u_;function It(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function R7(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f_(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function k7(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function rF(t){if(f_(t)!==t)throw Error(It(188))}function nae(t){var e=t.alternate;if(!e){if(e=f_(t),e===null)throw Error(It(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return rF(r),t;if(a===i)return rF(r),e;a=a.sibling}throw Error(It(188))}if(n.return!==i.return)n=r,i=a;else{for(var s=!1,o=r.child;o;){if(o===n){s=!0,n=r,i=a;break}if(o===i){s=!0,i=r,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,i=r;break}if(o===i){s=!0,i=a,n=r;break}o=o.sibling}if(!s)throw Error(It(189))}}if(n.alternate!==i)throw Error(It(190))}if(n.tag!==3)throw Error(It(188));return n.stateNode.current===n?t:e}function D7(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=D7(t),e!==null)return e;t=t.sibling}return null}var Gr=Object.assign,iae=Symbol.for("react.element"),FS=Symbol.for("react.transitional.element"),_x=Symbol.for("react.portal"),Xb=Symbol.for("react.fragment"),O7=Symbol.for("react.strict_mode"),C8=Symbol.for("react.profiler"),rae=Symbol.for("react.provider"),I7=Symbol.for("react.consumer"),qf=Symbol.for("react.context"),wN=Symbol.for("react.forward_ref"),R8=Symbol.for("react.suspense"),k8=Symbol.for("react.suspense_list"),EN=Symbol.for("react.memo"),od=Symbol.for("react.lazy"),D8=Symbol.for("react.activity"),aae=Symbol.for("react.memo_cache_sentinel"),aF=Symbol.iterator;function Ay(t){return t===null||typeof t!="object"?null:(t=aF&&t[aF]||t["@@iterator"],typeof t=="function"?t:null)}var sae=Symbol.for("react.client.reference");function O8(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===sae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Xb:return"Fragment";case C8:return"Profiler";case O7:return"StrictMode";case R8:return"Suspense";case k8:return"SuspenseList";case D8:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _x:return"Portal";case qf:return(t.displayName||"Context")+".Provider";case I7:return(t._context.displayName||"Context")+".Consumer";case wN:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case EN:return e=t.displayName||null,e!==null?e:O8(t.type)||"Memo";case od:e=t._payload,t=t._init;try{return O8(t(e))}catch{}}return null}var Sx=Array.isArray,Bn=C7.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ir=tae.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,wm={pending:!1,data:null,method:null,action:null},I8=[],qb=-1;function mf(t){return{current:t}}function ss(t){0>qb||(t.current=I8[qb],I8[qb]=null,qb--)}function Zr(t,e){qb++,I8[qb]=t.current,t.current=e}var Zu=mf(null),_1=mf(null),Cd=mf(null),kM=mf(null);function DM(t,e){switch(Zr(Cd,e),Zr(_1,t),Zr(Zu,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?uB(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=uB(e),t=JX(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ss(Zu),Zr(Zu,t)}function L0(){ss(Zu),ss(_1),ss(Cd)}function N8(t){t.memoizedState!==null&&Zr(kM,t);var e=Zu.current,n=JX(e,t.type);e!==n&&(Zr(_1,t),Zr(Zu,n))}function OM(t){_1.current===t&&(ss(Zu),ss(_1)),kM.current===t&&(ss(kM),D1._currentValue=wm)}var L8=Object.prototype.hasOwnProperty,MN=za.unstable_scheduleCallback,e3=za.unstable_cancelCallback,oae=za.unstable_shouldYield,lae=za.unstable_requestPaint,Qu=za.unstable_now,cae=za.unstable_getCurrentPriorityLevel,N7=za.unstable_ImmediatePriority,L7=za.unstable_UserBlockingPriority,IM=za.unstable_NormalPriority,uae=za.unstable_LowPriority,P7=za.unstable_IdlePriority,fae=za.log,hae=za.unstable_setDisableYieldValue,h_=null,_l=null;function xd(t){if(typeof fae=="function"&&hae(t),_l&&typeof _l.setStrictMode=="function")try{_l.setStrictMode(h_,t)}catch{}}var Sl=Math.clz32?Math.clz32:mae,dae=Math.log,pae=Math.LN2;function mae(t){return t>>>=0,t===0?32:31-(dae(t)/pae|0)|0}var BS=256,zS=4194304;function Kp(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 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 t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function BT(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var o=i&134217727;return o!==0?(i=o&~a,i!==0?r=Kp(i):(s&=o,s!==0?r=Kp(s):n||(n=o&~t,n!==0&&(r=Kp(n))))):(o=i&~a,o!==0?r=Kp(o):s!==0?r=Kp(s):n||(n=i&~t,n!==0&&(r=Kp(n)))),r===0?0:e!==0&&e!==r&&!(e&a)&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function d_(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function gae(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U7(){var t=BS;return BS<<=1,!(BS&4194048)&&(BS=256),t}function F7(){var t=zS;return zS<<=1,!(zS&62914560)&&(zS=4194304),t}function t3(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function p_(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function bae(t,e,n,i,r,a){var s=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var o=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=s&~n;0<n;){var u=31-Sl(n),f=1<<u;o[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var d=h[u];d!==null&&(d.lane&=-536870913)}n&=~f}i!==0&&B7(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(s&~e))}function B7(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-Sl(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function z7(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-Sl(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function TN(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function AN(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function j7(){var t=ir.p;return t!==0?t:(t=window.event,t===void 0?32:sq(t.type))}function vae(t,e){var n=ir.p;try{return ir.p=t,e()}finally{ir.p=n}}var Yd=Math.random().toString(36).slice(2),no="__reactFiber$"+Yd,Go="__reactProps$"+Yd,Ev="__reactContainer$"+Yd,P8="__reactEvents$"+Yd,yae="__reactListeners$"+Yd,xae="__reactHandles$"+Yd,sF="__reactResources$"+Yd,m_="__reactMarker$"+Yd;function CN(t){delete t[no],delete t[Go],delete t[P8],delete t[yae],delete t[xae]}function Kb(t){var e=t[no];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ev]||n[no]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=dB(t);t!==null;){if(n=t[no])return n;t=dB(t)}return e}t=n,n=t.parentNode}return null}function Mv(t){if(t=t[no]||t[Ev]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function wx(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(It(33))}function u0(t){var e=t[sF];return e||(e=t[sF]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function is(t){t[m_]=!0}var H7=new Set,V7={};function ig(t,e){P0(t,e),P0(t+"Capture",e)}function P0(t,e){for(V7[t]=e,t=0;t<e.length;t++)H7.add(e[t])}var _ae=RegExp("^[: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]*$"),oF={},lF={};function Sae(t){return L8.call(lF,t)?!0:L8.call(oF,t)?!1:_ae.test(t)?lF[t]=!0:(oF[t]=!0,!1)}function XE(t,e,n){if(Sae(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function jS(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Of(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var n3,cF;function Fb(t){if(n3===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);n3=e&&e[1]||"",cF=-1<n.stack.indexOf(`
    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+n3+t+cF}var i3=!1;function r3(t,e){if(!t||i3)return"";i3=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){var h=d}Reflect.construct(t,[],f)}else{try{f.call()}catch(d){h=d}t.call(f.prototype)}}else{try{throw Error()}catch(d){h=d}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(d){if(d&&h&&typeof d.stack=="string")return[d.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split(`
`),c=o.split(`
`);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||l[i]!==c[r]){var u=`
`+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{i3=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Fb(n):""}function wae(t){switch(t.tag){case 26:case 27:case 5:return Fb(t.type);case 16:return Fb("Lazy");case 13:return Fb("Suspense");case 19:return Fb("SuspenseList");case 0:case 15:return r3(t.type,!1);case 11:return r3(t.type.render,!1);case 1:return r3(t.type,!0);case 31:return Fb("Activity");default:return""}}function uF(t){try{var e="";do e+=wae(t),t=t.return;while(t);return e}catch(n){return`
Error generating stack: `+n.message+`
`+n.stack}}function sc(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function G7(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Eae(t){var e=G7(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function NM(t){t._valueTracker||(t._valueTracker=Eae(t))}function W7(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=G7(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function LM(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Mae=/[\n"\\]/g;function fc(t){return t.replace(Mae,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function U8(t,e,n,i,r,a,s,o){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+sc(e)):t.value!==""+sc(e)&&(t.value=""+sc(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?F8(t,s,sc(e)):n!=null?F8(t,s,sc(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+sc(o):t.removeAttribute("name")}function X7(t,e,n,i,r,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null))return;n=n!=null?""+sc(n):"",e=e!=null?""+sc(e):n,o||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=o?t.checked:!!i,t.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s)}function F8(t,e,n){e==="number"&&LM(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function f0(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+sc(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function q7(t,e,n){if(e!=null&&(e=""+sc(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+sc(n):""}function K7(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(It(92));if(Sx(i)){if(1<i.length)throw Error(It(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=sc(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function U0(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Tae=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function fF(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||Tae.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Y7(t,e,n){if(e!=null&&typeof e!="object")throw Error(It(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&fF(t,r,i)}else for(var a in e)e.hasOwnProperty(a)&&fF(t,a,e[a])}function RN(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Aae=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qE(t){return Cae.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var B8=null;function kN(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Yb=null,h0=null;function hF(t){var e=Mv(t);if(e&&(t=e.stateNode)){var n=t[Go]||null;e:switch(t=e.stateNode,e.type){case"input":if(U8(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+fc(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Go]||null;if(!r)throw Error(It(90));U8(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&W7(i)}break e;case"textarea":q7(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&f0(t,!!n.multiple,e,!1)}}}var a3=!1;function J7(t,e,n){if(a3)return t(e,n);a3=!0;try{var i=t(e);return i}finally{if(a3=!1,(Yb!==null||h0!==null)&&(YT(),Yb&&(e=Yb,t=h0,h0=Yb=null,hF(e),t)))for(e=0;e<t.length;e++)hF(t[e])}}function S1(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Go]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(It(231,e,typeof n));return n}var fh=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),z8=!1;if(fh)try{var Cy={};Object.defineProperty(Cy,"passive",{get:function(){z8=!0}}),window.addEventListener("test",Cy,Cy),window.removeEventListener("test",Cy,Cy)}catch{z8=!1}var _d=null,DN=null,KE=null;function $7(){if(KE)return KE;var t,e=DN,n=e.length,i,r="value"in _d?_d.value:_d.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var s=n-t;for(i=1;i<=s&&e[n-i]===r[a-i];i++);return KE=r.slice(t,1<i?1-i:void 0)}function YE(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function HS(){return!0}function dF(){return!1}function qo(t){function e(n,i,r,a,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?HS:dF,this.isPropagationStopped=dF,this}return Gr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=HS)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=HS)},persist:function(){},isPersistent:HS}),e}var rg={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zT=qo(rg),g_=Gr({},rg,{view:0,detail:0}),Rae=qo(g_),s3,o3,Ry,jT=Gr({},g_,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ON,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ry&&(Ry&&t.type==="mousemove"?(s3=t.screenX-Ry.screenX,o3=t.screenY-Ry.screenY):o3=s3=0,Ry=t),s3)},movementY:function(t){return"movementY"in t?t.movementY:o3}}),pF=qo(jT),kae=Gr({},jT,{dataTransfer:0}),Dae=qo(kae),Oae=Gr({},g_,{relatedTarget:0}),l3=qo(Oae),Iae=Gr({},rg,{animationName:0,elapsedTime:0,pseudoElement:0}),Nae=qo(Iae),Lae=Gr({},rg,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Pae=qo(Lae),Uae=Gr({},rg,{data:0}),mF=qo(Uae),Fae={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bae={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},zae={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jae(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=zae[t])?!!e[t]:!1}function ON(){return jae}var Hae=Gr({},g_,{key:function(t){if(t.key){var e=Fae[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=YE(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Bae[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ON,charCode:function(t){return t.type==="keypress"?YE(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?YE(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Vae=qo(Hae),Gae=Gr({},jT,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gF=qo(Gae),Wae=Gr({},g_,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ON}),Xae=qo(Wae),qae=Gr({},rg,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kae=qo(qae),Yae=Gr({},jT,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Jae=qo(Yae),$ae=Gr({},rg,{newState:0,oldState:0}),Zae=qo($ae),Qae=[9,13,27,32],IN=fh&&"CompositionEvent"in window,Fx=null;fh&&"documentMode"in document&&(Fx=document.documentMode);var ese=fh&&"TextEvent"in window&&!Fx,Z7=fh&&(!IN||Fx&&8<Fx&&11>=Fx),bF=" ",vF=!1;function Q7(t,e){switch(t){case"keyup":return Qae.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eW(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jb=!1;function tse(t,e){switch(t){case"compositionend":return eW(e);case"keypress":return e.which!==32?null:(vF=!0,bF);case"textInput":return t=e.data,t===bF&&vF?null:t;default:return null}}function nse(t,e){if(Jb)return t==="compositionend"||!IN&&Q7(t,e)?(t=$7(),KE=DN=_d=null,Jb=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Z7&&e.locale!=="ko"?null:e.data;default:return null}}var ise={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function yF(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!ise[t.type]:e==="textarea"}function tW(t,e,n,i){Yb?h0?h0.push(i):h0=[i]:Yb=i,e=QM(e,"onChange"),0<e.length&&(n=new zT("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Bx=null,w1=null;function rse(t){qX(t,0)}function HT(t){var e=wx(t);if(W7(e))return t}function xF(t,e){if(t==="change")return e}var nW=!1;if(fh){var c3;if(fh){var u3="oninput"in document;if(!u3){var _F=document.createElement("div");_F.setAttribute("oninput","return;"),u3=typeof _F.oninput=="function"}c3=u3}else c3=!1;nW=c3&&(!document.documentMode||9<document.documentMode)}function SF(){Bx&&(Bx.detachEvent("onpropertychange",iW),w1=Bx=null)}function iW(t){if(t.propertyName==="value"&&HT(w1)){var e=[];tW(e,w1,t,kN(t)),J7(rse,e)}}function ase(t,e,n){t==="focusin"?(SF(),Bx=e,w1=n,Bx.attachEvent("onpropertychange",iW)):t==="focusout"&&SF()}function sse(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return HT(w1)}function ose(t,e){if(t==="click")return HT(e)}function lse(t,e){if(t==="input"||t==="change")return HT(e)}function cse(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Cl=typeof Object.is=="function"?Object.is:cse;function E1(t,e){if(Cl(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!L8.call(e,r)||!Cl(t[r],e[r]))return!1}return!0}function wF(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function EF(t,e){var n=wF(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wF(n)}}function rW(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?rW(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function aW(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=LM(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=LM(t.document)}return e}function NN(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var use=fh&&"documentMode"in document&&11>=document.documentMode,$b=null,j8=null,zx=null,H8=!1;function MF(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;H8||$b==null||$b!==LM(i)||(i=$b,"selectionStart"in i&&NN(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}),zx&&E1(zx,i)||(zx=i,i=QM(j8,"onSelect"),0<i.length&&(e=new zT("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=$b)))}function Mp(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Zb={animationend:Mp("Animation","AnimationEnd"),animationiteration:Mp("Animation","AnimationIteration"),animationstart:Mp("Animation","AnimationStart"),transitionrun:Mp("Transition","TransitionRun"),transitionstart:Mp("Transition","TransitionStart"),transitioncancel:Mp("Transition","TransitionCancel"),transitionend:Mp("Transition","TransitionEnd")},f3={},sW={};fh&&(sW=document.createElement("div").style,"AnimationEvent"in window||(delete Zb.animationend.animation,delete Zb.animationiteration.animation,delete Zb.animationstart.animation),"TransitionEvent"in window||delete Zb.transitionend.transition);function ag(t){if(f3[t])return f3[t];if(!Zb[t])return t;var e=Zb[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in sW)return f3[t]=e[n];return t}var oW=ag("animationend"),lW=ag("animationiteration"),cW=ag("animationstart"),fse=ag("transitionrun"),hse=ag("transitionstart"),dse=ag("transitioncancel"),uW=ag("transitionend"),fW=new Map,V8="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");V8.push("scrollEnd");function wu(t,e){fW.set(t,e),ig(e,[t])}var TF=new WeakMap;function hc(t,e){if(typeof t=="object"&&t!==null){var n=TF.get(t);return n!==void 0?n:(e={value:t,source:e,stack:uF(e)},TF.set(t,e),e)}return{value:t,source:e,stack:uF(e)}}var nc=[],Qb=0,LN=0;function VT(){for(var t=Qb,e=LN=Qb=0;e<t;){var n=nc[e];nc[e++]=null;var i=nc[e];nc[e++]=null;var r=nc[e];nc[e++]=null;var a=nc[e];if(nc[e++]=null,i!==null&&r!==null){var s=i.pending;s===null?r.next=r:(r.next=s.next,s.next=r),i.pending=r}a!==0&&hW(n,r,a)}}function GT(t,e,n,i){nc[Qb++]=t,nc[Qb++]=e,nc[Qb++]=n,nc[Qb++]=i,LN|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function PN(t,e,n,i){return GT(t,e,n,i),PM(t)}function Tv(t,e){return GT(t,null,null,e),PM(t)}function hW(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=!0)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-Sl(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function PM(t){if(50<Jx)throw Jx=0,uO=null,Error(It(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var e0={};function pse(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=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 bl(t,e,n,i){return new pse(t,e,n,i)}function UN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ih(t,e){var n=t.alternate;return n===null?(n=bl(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function dW(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function JE(t,e,n,i,r,a){var s=0;if(i=t,typeof t=="function")UN(t)&&(s=1);else if(typeof t=="string")s=goe(t,n,Zu.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case D8:return t=bl(31,n,e,r),t.elementType=D8,t.lanes=a,t;case Xb:return Em(n.children,r,a,e);case O7:s=8,r|=24;break;case C8:return t=bl(12,n,e,r|2),t.elementType=C8,t.lanes=a,t;case R8:return t=bl(13,n,e,r),t.elementType=R8,t.lanes=a,t;case k8:return t=bl(19,n,e,r),t.elementType=k8,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case rae:case qf:s=10;break e;case I7:s=9;break e;case wN:s=11;break e;case EN:s=14;break e;case od:s=16,i=null;break e}s=29,n=Error(It(130,t===null?"null":typeof t,"")),i=null}return e=bl(s,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function Em(t,e,n,i){return t=bl(7,t,i,e),t.lanes=n,t}function h3(t,e,n){return t=bl(6,t,null,e),t.lanes=n,t}function d3(t,e,n){return e=bl(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var t0=[],n0=0,UM=null,FM=0,oc=[],lc=0,Mm=null,Kf=1,Yf="";function Yp(t,e){t0[n0++]=FM,t0[n0++]=UM,UM=t,FM=e}function pW(t,e,n){oc[lc++]=Kf,oc[lc++]=Yf,oc[lc++]=Mm,Mm=t;var i=Kf;t=Yf;var r=32-Sl(i)-1;i&=~(1<<r),n+=1;var a=32-Sl(e)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Kf=1<<32-Sl(e)+r|n<<r|i,Yf=a+t}else Kf=1<<a|n<<r|i,Yf=t}function FN(t){t.return!==null&&(Yp(t,1),pW(t,1,0))}function BN(t){for(;t===UM;)UM=t0[--n0],t0[n0]=null,FM=t0[--n0],t0[n0]=null;for(;t===Mm;)Mm=oc[--lc],oc[lc]=null,Yf=oc[--lc],oc[lc]=null,Kf=oc[--lc],oc[lc]=null}var So=null,pa=null,er=!1,Tm=null,Gu=!1,G8=Error(It(519));function jm(t){var e=Error(It(418,""));throw M1(hc(e,t)),G8}function AF(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[no]=t,e[Go]=i,n){case"dialog":Ci("cancel",e),Ci("close",e);break;case"iframe":case"object":case"embed":Ci("load",e);break;case"video":case"audio":for(n=0;n<C1.length;n++)Ci(C1[n],e);break;case"source":Ci("error",e);break;case"img":case"image":case"link":Ci("error",e),Ci("load",e);break;case"details":Ci("toggle",e);break;case"input":Ci("invalid",e),X7(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),NM(e);break;case"select":Ci("invalid",e);break;case"textarea":Ci("invalid",e),K7(e,i.value,i.defaultValue,i.children),NM(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||YX(e.textContent,n)?(i.popover!=null&&(Ci("beforetoggle",e),Ci("toggle",e)),i.onScroll!=null&&Ci("scroll",e),i.onScrollEnd!=null&&Ci("scrollend",e),i.onClick!=null&&(e.onclick=ZT),e=!0):e=!1,e||jm(t)}function CF(t){for(So=t.return;So;)switch(So.tag){case 5:case 13:Gu=!1;return;case 27:case 3:Gu=!0;return;default:So=So.return}}function ky(t){if(t!==So)return!1;if(!er)return CF(t),er=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||gO(t.type,t.memoizedProps)),n=!n),n&&pa&&jm(t),CF(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(It(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){pa=gu(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}pa=null}}else e===27?(e=pa,Jd(t.type)?(t=yO,yO=null,pa=t):pa=e):pa=So?gu(t.stateNode.nextSibling):null;return!0}function b_(){pa=So=null,er=!1}function RF(){var t=Tm;return t!==null&&(Fo===null?Fo=t:Fo.push.apply(Fo,t),Tm=null),t}function M1(t){Tm===null?Tm=[t]:Tm.push(t)}var W8=mf(null),sg=null,Jf=null;function dd(t,e,n){Zr(W8,e._currentValue),e._currentValue=n}function rh(t){t._currentValue=W8.current,ss(W8)}function X8(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function q8(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var s=r.child;a=a.firstContext;e:for(;a!==null;){var o=a;a=r;for(var l=0;l<e.length;l++)if(o.context===e[l]){a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),X8(a.return,n,t),i||(s=null);break e}a=o.next}}else if(r.tag===18){if(s=r.return,s===null)throw Error(It(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),X8(s,n,t),s=null}else s=r.child;if(s!==null)s.return=r;else for(s=r;s!==null;){if(s===t){s=null;break}if(r=s.sibling,r!==null){r.return=s.return,s=r;break}s=s.return}r=s}}function v_(t,e,n,i){t=null;for(var r=e,a=!1;r!==null;){if(!a){if(r.flags&524288)a=!0;else if(r.flags&262144)break}if(r.tag===10){var s=r.alternate;if(s===null)throw Error(It(387));if(s=s.memoizedProps,s!==null){var o=r.type;Cl(r.pendingProps.value,s.value)||(t!==null?t.push(o):t=[o])}}else if(r===kM.current){if(s=r.alternate,s===null)throw Error(It(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(D1):t=[D1])}r=r.return}t!==null&&q8(e,t,n,i),e.flags|=262144}function BM(t){for(t=t.firstContext;t!==null;){if(!Cl(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Hm(t){sg=t,Jf=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function io(t){return mW(sg,t)}function VS(t,e){return sg===null&&Hm(t),mW(t,e)}function mW(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Jf===null){if(t===null)throw Error(It(308));Jf=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Jf=Jf.next=e;return n}var mse=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},gse=za.unstable_scheduleCallback,bse=za.unstable_NormalPriority,Fa={$$typeof:qf,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zN(){return{controller:new mse,data:new Map,refCount:0}}function y_(t){t.refCount--,t.refCount===0&&gse(bse,function(){t.controller.abort()})}var jx=null,K8=0,F0=0,d0=null;function vse(t,e){if(jx===null){var n=jx=[];K8=0,F0=cL(),d0={status:"pending",value:void 0,then:function(i){n.push(i)}}}return K8++,e.then(kF,kF),e}function kF(){if(--K8===0&&jx!==null){d0!==null&&(d0.status="fulfilled");var t=jx;jx=null,F0=0,d0=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function yse(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var DF=Bn.S;Bn.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&vse(t,e),DF!==null&&DF(t,e)};var Am=mf(null);function jN(){var t=Am.current;return t!==null?t:Lr.pooledCache}function $E(t,e){e===null?Zr(Am,Am.current):Zr(Am,e.pool)}function gW(){var t=jN();return t===null?null:{parent:Fa._currentValue,pool:t}}var x_=Error(It(460)),bW=Error(It(474)),WT=Error(It(542)),Y8={then:function(){}};function OF(t){return t=t.status,t==="fulfilled"||t==="rejected"}function GS(){}function vW(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(GS,GS),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,NF(t),t;default:if(typeof e.status=="string")e.then(GS,GS);else{if(t=Lr,t!==null&&100<t.shellSuspendCounter)throw Error(It(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,NF(t),t}throw Hx=e,x_}}var Hx=null;function IF(){if(Hx===null)throw Error(It(459));var t=Hx;return Hx=null,t}function NF(t){if(t===x_||t===WT)throw Error(It(483))}var ld=!1;function HN(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function J8(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Rd(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function kd(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,gr&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=PM(t),hW(t,null,n),e}return GT(t,i,e,n),PM(t)}function Vx(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,z7(t,n)}}function p3(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?r=a=e:a=a.next=e}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var $8=!1;function Gx(){if($8){var t=d0;if(t!==null)throw t}}function Wx(t,e,n,i){$8=!1;var r=t.updateQueue;ld=!1;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==s&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=r.baseState;s=0,u=c=l=null,o=a;do{var h=o.lane&-536870913,d=h!==o.lane;if(d?(ji&h)===h:(i&h)===h){h!==0&&h===F0&&($8=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var g=t,b=o;h=e;var y=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(y,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(y,f,h):g,h==null)break e;f=Gr({},f,h);break e;case 2:ld=!0}}h=o.callback,h!==null&&(t.flags|=64,d&&(t.flags|=8192),d=r.callbacks,d===null?r.callbacks=[h]:d.push(h))}else d={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=d,l=f):u=u.next=d,s|=h;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;d=o,o=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);u===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,a===null&&(r.shared.lanes=0),jd|=s,t.lanes=s,t.memoizedState=f}}function yW(t,e){if(typeof t!="function")throw Error(It(191,t));t.call(e)}function xW(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)yW(n[t],e)}var B0=mf(null),zM=mf(0);function LF(t,e){t=ph,Zr(zM,t),Zr(B0,e),ph=t|e.baseLanes}function Z8(){Zr(zM,ph),Zr(B0,B0.current)}function VN(){ph=zM.current,ss(B0),ss(zM)}var Bd=0,yi=null,_r=null,Ca=null,jM=!1,p0=!1,Vm=!1,HM=0,T1=0,m0=null,xse=0;function va(){throw Error(It(321))}function GN(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Cl(t[n],e[n]))return!1;return!0}function WN(t,e,n,i,r,a){return Bd=a,yi=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Bn.H=t===null||t.memoizedState===null?$W:ZW,Vm=!1,a=n(i,r),Vm=!1,p0&&(a=SW(e,n,i,r)),_W(t),a}function _W(t){Bn.H=VM;var e=_r!==null&&_r.next!==null;if(Bd=0,Ca=_r=yi=null,jM=!1,T1=0,m0=null,e)throw Error(It(300));t===null||rs||(t=t.dependencies,t!==null&&BM(t)&&(rs=!0))}function SW(t,e,n,i){yi=t;var r=0;do{if(p0&&(m0=null),T1=0,p0=!1,25<=r)throw Error(It(301));if(r+=1,Ca=_r=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Bn.H=Ase,a=e(n,i)}while(p0);return a}function _se(){var t=Bn.H,e=t.useState()[0];return e=typeof e.then=="function"?__(e):e,t=t.useState()[0],(_r!==null?_r.memoizedState:null)!==t&&(yi.flags|=1024),e}function XN(){var t=HM!==0;return HM=0,t}function qN(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function KN(t){if(jM){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}jM=!1}Bd=0,Ca=_r=yi=null,p0=!1,T1=HM=0,m0=null}function Po(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ca===null?yi.memoizedState=Ca=t:Ca=Ca.next=t,Ca}function ka(){if(_r===null){var t=yi.alternate;t=t!==null?t.memoizedState:null}else t=_r.next;var e=Ca===null?yi.memoizedState:Ca.next;if(e!==null)Ca=e,_r=t;else{if(t===null)throw yi.alternate===null?Error(It(467)):Error(It(310));_r=t,t={memoizedState:_r.memoizedState,baseState:_r.baseState,baseQueue:_r.baseQueue,queue:_r.queue,next:null},Ca===null?yi.memoizedState=Ca=t:Ca=Ca.next=t}return Ca}function YN(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function __(t){var e=T1;return T1+=1,m0===null&&(m0=[]),t=vW(m0,t,e),e=yi,(Ca===null?e.memoizedState:Ca.next)===null&&(e=e.alternate,Bn.H=e===null||e.memoizedState===null?$W:ZW),t}function XT(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return __(t);if(t.$$typeof===qf)return io(t)}throw Error(It(438,String(t)))}function JN(t){var e=null,n=yi.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=yi.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=YN(),yi.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=aae;return e.index++,n}function hh(t,e){return typeof e=="function"?e(t):e}function ZE(t){var e=ka();return $N(e,_r,t)}function $N(t,e,n){var i=t.queue;if(i===null)throw Error(It(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var s=r.next;r.next=a.next,a.next=s}e.baseQueue=r=a,i.pending=null}if(a=t.baseState,r===null)t.memoizedState=a;else{e=r.next;var o=s=null,l=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(ji&f)===f:(Bd&f)===f){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===F0&&(u=!0);else if((Bd&h)===h){c=c.next,h===F0&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=f,s=a):l=l.next=f,yi.lanes|=h,jd|=h;f=c.action,Vm&&n(a,f),a=c.hasEagerState?c.eagerState:n(a,f)}else h={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=h,s=a):l=l.next=h,yi.lanes|=f,jd|=f;c=c.next}while(c!==null&&c!==e);if(l===null?s=a:l.next=o,!Cl(a,t.memoizedState)&&(rs=!0,u&&(n=d0,n!==null)))throw n;t.memoizedState=a,t.baseState=s,t.baseQueue=l,i.lastRenderedState=a}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function m3(t){var e=ka(),n=e.queue;if(n===null)throw Error(It(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do a=t(a,s.action),s=s.next;while(s!==r);Cl(a,e.memoizedState)||(rs=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,i]}function wW(t,e,n){var i=yi,r=ka(),a=er;if(a){if(n===void 0)throw Error(It(407));n=n()}else n=e();var s=!Cl((_r||r).memoizedState,n);s&&(r.memoizedState=n,rs=!0),r=r.queue;var o=TW.bind(null,i,r,t);if(S_(2048,8,o,[t]),r.getSnapshot!==e||s||Ca!==null&&Ca.memoizedState.tag&1){if(i.flags|=2048,z0(9,qT(),MW.bind(null,i,r,n,e),null),Lr===null)throw Error(It(349));a||Bd&124||EW(i,e,n)}return n}function EW(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=yi.updateQueue,e===null?(e=YN(),yi.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function MW(t,e,n,i){e.value=n,e.getSnapshot=i,AW(e)&&CW(t)}function TW(t,e,n){return n(function(){AW(e)&&CW(t)})}function AW(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Cl(t,n)}catch{return!0}}function CW(t){var e=Tv(t,2);e!==null&&El(e,t,2)}function Q8(t){var e=Po();if(typeof t=="function"){var n=t;if(t=n(),Vm){xd(!0);try{n()}finally{xd(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:t},e}function RW(t,e,n,i){return t.baseState=n,$N(t,_r,typeof i=="function"?i:hh)}function Sse(t,e,n,i,r){if(KT(t))throw Error(It(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){a.listeners.push(s)}};Bn.T!==null?n(!0):a.isTransition=!1,i(a),n=e.pending,n===null?(a.next=e.pending=a,kW(e,a)):(a.next=n.next,e.pending=n.next=a)}}function kW(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Bn.T,s={};Bn.T=s;try{var o=n(r,i),l=Bn.S;l!==null&&l(s,o),PF(t,e,o)}catch(c){eO(t,e,c)}finally{Bn.T=a}}else try{a=n(r,i),PF(t,e,a)}catch(c){eO(t,e,c)}}function PF(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){UF(t,e,i)},function(i){return eO(t,e,i)}):UF(t,e,n)}function UF(t,e,n){e.status="fulfilled",e.value=n,DW(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,kW(t,n)))}function eO(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,DW(e),e=e.next;while(e!==i)}t.action=null}function DW(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function OW(t,e){return e}function FF(t,e){if(er){var n=Lr.formState;if(n!==null){e:{var i=yi;if(er){if(pa){t:{for(var r=pa,a=Gu;r.nodeType!==8;){if(!a){r=null;break t}if(r=gu(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){pa=gu(r.nextSibling),i=r.data==="F!";break e}}jm(i)}i=!1}i&&(e=n[0])}}return n=Po(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:OW,lastRenderedState:e},n.queue=i,n=KW.bind(null,yi,i),i.dispatch=n,i=Q8(!1),a=tL.bind(null,yi,!1,i.queue),i=Po(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=Sse.bind(null,yi,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function BF(t){var e=ka();return IW(e,_r,t)}function IW(t,e,n){if(e=$N(t,e,OW)[0],t=ZE(hh)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=__(e)}catch(s){throw s===x_?WT:s}else i=e;e=ka();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(yi.flags|=2048,z0(9,qT(),wse.bind(null,r,n),null)),[i,a,t]}function wse(t,e){t.action=e}function zF(t){var e=ka(),n=_r;if(n!==null)return IW(e,n,t);ka(),e=e.memoizedState,n=ka();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function z0(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=yi.updateQueue,e===null&&(e=YN(),yi.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function qT(){return{destroy:void 0,resource:void 0}}function NW(){return ka().memoizedState}function QE(t,e,n,i){var r=Po();i=i===void 0?null:i,yi.flags|=t,r.memoizedState=z0(1|e,qT(),n,i)}function S_(t,e,n,i){var r=ka();i=i===void 0?null:i;var a=r.memoizedState.inst;_r!==null&&i!==null&&GN(i,_r.memoizedState.deps)?r.memoizedState=z0(e,a,n,i):(yi.flags|=t,r.memoizedState=z0(1|e,a,n,i))}function jF(t,e){QE(8390656,8,t,e)}function LW(t,e){S_(2048,8,t,e)}function PW(t,e){return S_(4,2,t,e)}function UW(t,e){return S_(4,4,t,e)}function FW(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function BW(t,e,n){n=n!=null?n.concat([t]):null,S_(4,4,FW.bind(null,e,t),n)}function ZN(){}function zW(t,e){var n=ka();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&GN(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function jW(t,e){var n=ka();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&GN(e,i[1]))return i[0];if(i=t(),Vm){xd(!0);try{t()}finally{xd(!1)}}return n.memoizedState=[i,e],i}function QN(t,e,n){return n===void 0||Bd&1073741824?t.memoizedState=e:(t.memoizedState=n,t=DX(),yi.lanes|=t,jd|=t,n)}function HW(t,e,n,i){return Cl(n,e)?n:B0.current!==null?(t=QN(t,n,i),Cl(t,e)||(rs=!0),t):Bd&42?(t=DX(),yi.lanes|=t,jd|=t,e):(rs=!0,t.memoizedState=n)}function VW(t,e,n,i,r){var a=ir.p;ir.p=a!==0&&8>a?a:8;var s=Bn.T,o={};Bn.T=o,tL(t,!1,e,n);try{var l=r(),c=Bn.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=yse(l,i);Xx(t,e,u,wl(t))}else Xx(t,e,i,wl(t))}catch(f){Xx(t,e,{then:function(){},status:"rejected",reason:f},wl())}finally{ir.p=a,Bn.T=s}}function Ese(){}function tO(t,e,n,i){if(t.tag!==5)throw Error(It(476));var r=GW(t).queue;VW(t,r,e,wm,n===null?Ese:function(){return WW(t),n(i)})}function GW(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:wm,baseState:wm,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:wm},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function WW(t){var e=GW(t).next.queue;Xx(t,e,{},wl())}function eL(){return io(D1)}function XW(){return ka().memoizedState}function qW(){return ka().memoizedState}function Mse(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=wl();t=Rd(n);var i=kd(e,t,n);i!==null&&(El(i,e,n),Vx(i,e,n)),e={cache:zN()},t.payload=e;return}e=e.return}}function Tse(t,e,n){var i=wl();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},KT(t)?YW(e,n):(n=PN(t,e,n,i),n!==null&&(El(n,t,i),JW(n,e,i)))}function KW(t,e,n){var i=wl();Xx(t,e,n,i)}function Xx(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(KT(t))YW(e,r);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,n);if(r.hasEagerState=!0,r.eagerState=o,Cl(o,s))return GT(t,e,r,0),Lr===null&&VT(),!1}catch{}finally{}if(n=PN(t,e,r,i),n!==null)return El(n,t,i),JW(n,e,i),!0}return!1}function tL(t,e,n,i){if(i={lane:2,revertLane:cL(),action:i,hasEagerState:!1,eagerState:null,next:null},KT(t)){if(e)throw Error(It(479))}else e=PN(t,n,i,2),e!==null&&El(e,t,2)}function KT(t){var e=t.alternate;return t===yi||e!==null&&e===yi}function YW(t,e){p0=jM=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function JW(t,e,n){if(n&4194048){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,z7(t,n)}}var VM={readContext:io,use:XT,useCallback:va,useContext:va,useEffect:va,useImperativeHandle:va,useLayoutEffect:va,useInsertionEffect:va,useMemo:va,useReducer:va,useRef:va,useState:va,useDebugValue:va,useDeferredValue:va,useTransition:va,useSyncExternalStore:va,useId:va,useHostTransitionStatus:va,useFormState:va,useActionState:va,useOptimistic:va,useMemoCache:va,useCacheRefresh:va},$W={readContext:io,use:XT,useCallback:function(t,e){return Po().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:jF,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,QE(4194308,4,FW.bind(null,e,t),n)},useLayoutEffect:function(t,e){return QE(4194308,4,t,e)},useInsertionEffect:function(t,e){QE(4,2,t,e)},useMemo:function(t,e){var n=Po();e=e===void 0?null:e;var i=t();if(Vm){xd(!0);try{t()}finally{xd(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Po();if(n!==void 0){var r=n(e);if(Vm){xd(!0);try{n(e)}finally{xd(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=Tse.bind(null,yi,t),[i.memoizedState,t]},useRef:function(t){var e=Po();return t={current:t},e.memoizedState=t},useState:function(t){t=Q8(t);var e=t.queue,n=KW.bind(null,yi,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ZN,useDeferredValue:function(t,e){var n=Po();return QN(n,t,e)},useTransition:function(){var t=Q8(!1);return t=VW.bind(null,yi,t.queue,!0,!1),Po().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=yi,r=Po();if(er){if(n===void 0)throw Error(It(407));n=n()}else{if(n=e(),Lr===null)throw Error(It(349));ji&124||EW(i,e,n)}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,jF(TW.bind(null,i,a,t),[t]),i.flags|=2048,z0(9,qT(),MW.bind(null,i,a,n,e),null),n},useId:function(){var t=Po(),e=Lr.identifierPrefix;if(er){var n=Yf,i=Kf;n=(i&~(1<<32-Sl(i)-1)).toString(32)+n,e="«"+e+"R"+n,n=HM++,0<n&&(e+="H"+n.toString(32)),e+="»"}else n=xse++,e="«"+e+"r"+n.toString(32)+"»";return t.memoizedState=e},useHostTransitionStatus:eL,useFormState:FF,useActionState:FF,useOptimistic:function(t){var e=Po();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=tL.bind(null,yi,!0,n),n.dispatch=e,[t,e]},useMemoCache:JN,useCacheRefresh:function(){return Po().memoizedState=Mse.bind(null,yi)}},ZW={readContext:io,use:XT,useCallback:zW,useContext:io,useEffect:LW,useImperativeHandle:BW,useInsertionEffect:PW,useLayoutEffect:UW,useMemo:jW,useReducer:ZE,useRef:NW,useState:function(){return ZE(hh)},useDebugValue:ZN,useDeferredValue:function(t,e){var n=ka();return HW(n,_r.memoizedState,t,e)},useTransition:function(){var t=ZE(hh)[0],e=ka().memoizedState;return[typeof t=="boolean"?t:__(t),e]},useSyncExternalStore:wW,useId:XW,useHostTransitionStatus:eL,useFormState:BF,useActionState:BF,useOptimistic:function(t,e){var n=ka();return RW(n,_r,t,e)},useMemoCache:JN,useCacheRefresh:qW},Ase={readContext:io,use:XT,useCallback:zW,useContext:io,useEffect:LW,useImperativeHandle:BW,useInsertionEffect:PW,useLayoutEffect:UW,useMemo:jW,useReducer:m3,useRef:NW,useState:function(){return m3(hh)},useDebugValue:ZN,useDeferredValue:function(t,e){var n=ka();return _r===null?QN(n,t,e):HW(n,_r.memoizedState,t,e)},useTransition:function(){var t=m3(hh)[0],e=ka().memoizedState;return[typeof t=="boolean"?t:__(t),e]},useSyncExternalStore:wW,useId:XW,useHostTransitionStatus:eL,useFormState:zF,useActionState:zF,useOptimistic:function(t,e){var n=ka();return _r!==null?RW(n,_r,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:JN,useCacheRefresh:qW},g0=null,A1=0;function WS(t){var e=A1;return A1+=1,g0===null&&(g0=[]),vW(g0,t,e)}function Dy(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function XS(t,e){throw e.$$typeof===iae?Error(It(525)):(t=Object.prototype.toString.call(e),Error(It(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function HF(t){var e=t._init;return e(t._payload)}function QW(t){function e(p,x){if(t){var _=p.deletions;_===null?(p.deletions=[x],p.flags|=16):_.push(x)}}function n(p,x){if(!t)return null;for(;x!==null;)e(p,x),x=x.sibling;return null}function i(p){for(var x=new Map;p!==null;)p.key!==null?x.set(p.key,p):x.set(p.index,p),p=p.sibling;return x}function r(p,x){return p=ih(p,x),p.index=0,p.sibling=null,p}function a(p,x,_){return p.index=_,t?(_=p.alternate,_!==null?(_=_.index,_<x?(p.flags|=67108866,x):_):(p.flags|=67108866,x)):(p.flags|=1048576,x)}function s(p){return t&&p.alternate===null&&(p.flags|=67108866),p}function o(p,x,_,w){return x===null||x.tag!==6?(x=h3(_,p.mode,w),x.return=p,x):(x=r(x,_),x.return=p,x)}function l(p,x,_,w){var M=_.type;return M===Xb?u(p,x,_.props.children,w,_.key):x!==null&&(x.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===od&&HF(M)===x.type)?(x=r(x,_.props),Dy(x,_),x.return=p,x):(x=JE(_.type,_.key,_.props,null,p.mode,w),Dy(x,_),x.return=p,x)}function c(p,x,_,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==_.containerInfo||x.stateNode.implementation!==_.implementation?(x=d3(_,p.mode,w),x.return=p,x):(x=r(x,_.children||[]),x.return=p,x)}function u(p,x,_,w,M){return x===null||x.tag!==7?(x=Em(_,p.mode,w,M),x.return=p,x):(x=r(x,_),x.return=p,x)}function f(p,x,_){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=h3(""+x,p.mode,_),x.return=p,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case FS:return _=JE(x.type,x.key,x.props,null,p.mode,_),Dy(_,x),_.return=p,_;case _x:return x=d3(x,p.mode,_),x.return=p,x;case od:var w=x._init;return x=w(x._payload),f(p,x,_)}if(Sx(x)||Ay(x))return x=Em(x,p.mode,_,null),x.return=p,x;if(typeof x.then=="function")return f(p,WS(x),_);if(x.$$typeof===qf)return f(p,VS(p,x),_);XS(p,x)}return null}function h(p,x,_,w){var M=x!==null?x.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return M!==null?null:o(p,x,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case FS:return _.key===M?l(p,x,_,w):null;case _x:return _.key===M?c(p,x,_,w):null;case od:return M=_._init,_=M(_._payload),h(p,x,_,w)}if(Sx(_)||Ay(_))return M!==null?null:u(p,x,_,w,null);if(typeof _.then=="function")return h(p,x,WS(_),w);if(_.$$typeof===qf)return h(p,x,VS(p,_),w);XS(p,_)}return null}function d(p,x,_,w,M){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return p=p.get(_)||null,o(x,p,""+w,M);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case FS:return p=p.get(w.key===null?_:w.key)||null,l(x,p,w,M);case _x:return p=p.get(w.key===null?_:w.key)||null,c(x,p,w,M);case od:var S=w._init;return w=S(w._payload),d(p,x,_,w,M)}if(Sx(w)||Ay(w))return p=p.get(_)||null,u(x,p,w,M,null);if(typeof w.then=="function")return d(p,x,_,WS(w),M);if(w.$$typeof===qf)return d(p,x,_,VS(x,w),M);XS(x,w)}return null}function g(p,x,_,w){for(var M=null,S=null,A=x,C=x=0,k=null;A!==null&&C<_.length;C++){A.index>C?(k=A,A=null):k=A.sibling;var R=h(p,A,_[C],w);if(R===null){A===null&&(A=k);break}t&&A&&R.alternate===null&&e(p,A),x=a(R,x,C),S===null?M=R:S.sibling=R,S=R,A=k}if(C===_.length)return n(p,A),er&&Yp(p,C),M;if(A===null){for(;C<_.length;C++)A=f(p,_[C],w),A!==null&&(x=a(A,x,C),S===null?M=A:S.sibling=A,S=A);return er&&Yp(p,C),M}for(A=i(A);C<_.length;C++)k=d(A,p,C,_[C],w),k!==null&&(t&&k.alternate!==null&&A.delete(k.key===null?C:k.key),x=a(k,x,C),S===null?M=k:S.sibling=k,S=k);return t&&A.forEach(function(N){return e(p,N)}),er&&Yp(p,C),M}function b(p,x,_,w){if(_==null)throw Error(It(151));for(var M=null,S=null,A=x,C=x=0,k=null,R=_.next();A!==null&&!R.done;C++,R=_.next()){A.index>C?(k=A,A=null):k=A.sibling;var N=h(p,A,R.value,w);if(N===null){A===null&&(A=k);break}t&&A&&N.alternate===null&&e(p,A),x=a(N,x,C),S===null?M=N:S.sibling=N,S=N,A=k}if(R.done)return n(p,A),er&&Yp(p,C),M;if(A===null){for(;!R.done;C++,R=_.next())R=f(p,R.value,w),R!==null&&(x=a(R,x,C),S===null?M=R:S.sibling=R,S=R);return er&&Yp(p,C),M}for(A=i(A);!R.done;C++,R=_.next())R=d(A,p,C,R.value,w),R!==null&&(t&&R.alternate!==null&&A.delete(R.key===null?C:R.key),x=a(R,x,C),S===null?M=R:S.sibling=R,S=R);return t&&A.forEach(function(P){return e(p,P)}),er&&Yp(p,C),M}function y(p,x,_,w){if(typeof _=="object"&&_!==null&&_.type===Xb&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case FS:e:{for(var M=_.key;x!==null;){if(x.key===M){if(M=_.type,M===Xb){if(x.tag===7){n(p,x.sibling),w=r(x,_.props.children),w.return=p,p=w;break e}}else if(x.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===od&&HF(M)===x.type){n(p,x.sibling),w=r(x,_.props),Dy(w,_),w.return=p,p=w;break e}n(p,x);break}else e(p,x);x=x.sibling}_.type===Xb?(w=Em(_.props.children,p.mode,w,_.key),w.return=p,p=w):(w=JE(_.type,_.key,_.props,null,p.mode,w),Dy(w,_),w.return=p,p=w)}return s(p);case _x:e:{for(M=_.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===_.containerInfo&&x.stateNode.implementation===_.implementation){n(p,x.sibling),w=r(x,_.children||[]),w.return=p,p=w;break e}else{n(p,x);break}else e(p,x);x=x.sibling}w=d3(_,p.mode,w),w.return=p,p=w}return s(p);case od:return M=_._init,_=M(_._payload),y(p,x,_,w)}if(Sx(_))return g(p,x,_,w);if(Ay(_)){if(M=Ay(_),typeof M!="function")throw Error(It(150));return _=M.call(_),b(p,x,_,w)}if(typeof _.then=="function")return y(p,x,WS(_),w);if(_.$$typeof===qf)return y(p,x,VS(p,_),w);XS(p,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,x!==null&&x.tag===6?(n(p,x.sibling),w=r(x,_),w.return=p,p=w):(n(p,x),w=h3(_,p.mode,w),w.return=p,p=w),s(p)):n(p,x)}return function(p,x,_,w){try{A1=0;var M=y(p,x,_,w);return g0=null,M}catch(A){if(A===x_||A===WT)throw A;var S=bl(29,A,null,p.mode);return S.lanes=w,S.return=p,S}finally{}}}var j0=QW(!0),eX=QW(!1),Sc=mf(null),ef=null;function pd(t){var e=t.alternate;Zr(Ba,Ba.current&1),Zr(Sc,t),ef===null&&(e===null||B0.current!==null||e.memoizedState!==null)&&(ef=t)}function tX(t){if(t.tag===22){if(Zr(Ba,Ba.current),Zr(Sc,t),ef===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(ef=t)}}else md()}function md(){Zr(Ba,Ba.current),Zr(Sc,Sc.current)}function $f(t){ss(Sc),ef===t&&(ef=null),ss(Ba)}var Ba=mf(0);function GM(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||vO(n)))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===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function g3(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Gr({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var nO={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=wl(),r=Rd(i);r.payload=e,n!=null&&(r.callback=n),e=kd(t,r,i),e!==null&&(El(e,t,i),Vx(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=wl(),r=Rd(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=kd(t,r,i),e!==null&&(El(e,t,i),Vx(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=wl(),i=Rd(n);i.tag=2,e!=null&&(i.callback=e),e=kd(t,i,n),e!==null&&(El(e,t,n),Vx(e,t,n))}};function VF(t,e,n,i,r,a,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,s):e.prototype&&e.prototype.isPureReactComponent?!E1(n,i)||!E1(r,a):!0}function GF(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&nO.enqueueReplaceState(e,e.state,null)}function Gm(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Gr({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var WM=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function nX(t){WM(t)}function iX(t){console.error(t)}function rX(t){WM(t)}function XM(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function WF(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function iO(t,e,n){return n=Rd(n),n.tag=3,n.payload={element:null},n.callback=function(){XM(t,e)},n}function aX(t){return t=Rd(t),t.tag=3,t}function sX(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){WF(e,n,i)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){WF(e,n,i),typeof r!="function"&&(Dd===null?Dd=new Set([this]):Dd.add(this));var o=i.stack;this.componentDidCatch(i.value,{componentStack:o!==null?o:""})})}function Cse(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&v_(e,n,r,!0),n=Sc.current,n!==null){switch(n.tag){case 13:return ef===null?fO():n.alternate===null&&ma===0&&(ma=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Y8?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),A3(t,i,r)),!1;case 22:return n.flags|=65536,i===Y8?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),A3(t,i,r)),!1}throw Error(It(435,n.tag))}return A3(t,i,r),fO(),!1}if(er)return e=Sc.current,e!==null?(!(e.flags&65536)&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==G8&&(t=Error(It(422),{cause:i}),M1(hc(t,n)))):(i!==G8&&(e=Error(It(423),{cause:i}),M1(hc(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=hc(i,n),r=iO(t.stateNode,i,r),p3(t,r),ma!==4&&(ma=2)),!1;var a=Error(It(520),{cause:i});if(a=hc(a,n),Yx===null?Yx=[a]:Yx.push(a),ma!==4&&(ma=2),e===null)return!0;i=hc(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=iO(n.stateNode,i,t),p3(n,t),!1;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Dd===null||!Dd.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=aX(r),sX(r,t,n,i),p3(n,r),!1}n=n.return}while(n!==null);return!1}var oX=Error(It(461)),rs=!1;function Ms(t,e,n,i){e.child=t===null?eX(e,null,n,i):j0(e,t.child,n,i)}function XF(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}else s=i;return Hm(e),i=WN(t,e,n,s,a,r),o=XN(),t!==null&&!rs?(qN(t,e,r),dh(t,e,r)):(er&&o&&FN(e),e.flags|=1,Ms(t,e,i,r),e.child)}function qF(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!UN(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,lX(t,e,a,i,r)):(t=JE(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!nL(t,r)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:E1,n(s,i)&&t.ref===e.ref)return dh(t,e,r)}return e.flags|=1,t=ih(a,i),t.ref=e.ref,t.return=e,e.child=t}function lX(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(E1(a,i)&&t.ref===e.ref)if(rs=!1,e.pendingProps=i=a,nL(t,r))t.flags&131072&&(rs=!0);else return e.lanes=t.lanes,dh(t,e,r)}return rO(t,e,n,i,r)}function cX(t,e,n){var i=e.pendingProps,r=i.children,a=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if(e.flags&128){if(i=a!==null?a.baseLanes|n:n,t!==null){for(r=e.child=t.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;e.childLanes=a&~i}else e.childLanes=0,e.child=null;return KF(t,e,i,n)}if(n&536870912)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&$E(e,a!==null?a.cachePool:null),a!==null?LF(e,a):Z8(),tX(e);else return e.lanes=e.childLanes=536870912,KF(t,e,a!==null?a.baseLanes|n:n,n)}else a!==null?($E(e,a.cachePool),LF(e,a),md(),e.memoizedState=null):(t!==null&&$E(e,null),Z8(),md());return Ms(t,e,r,n),e.child}function KF(t,e,n,i){var r=jN();return r=r===null?null:{parent:Fa._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&$E(e,null),Z8(),tX(e),t!==null&&v_(t,e,i,!0),null}function eM(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(It(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function rO(t,e,n,i,r){return Hm(e),n=WN(t,e,n,i,void 0,r),i=XN(),t!==null&&!rs?(qN(t,e,r),dh(t,e,r)):(er&&i&&FN(e),e.flags|=1,Ms(t,e,n,r),e.child)}function YF(t,e,n,i,r,a){return Hm(e),e.updateQueue=null,n=SW(e,i,n,r),_W(t),i=XN(),t!==null&&!rs?(qN(t,e,a),dh(t,e,a)):(er&&i&&FN(e),e.flags|=1,Ms(t,e,n,a),e.child)}function JF(t,e,n,i,r){if(Hm(e),e.stateNode===null){var a=e0,s=n.contextType;typeof s=="object"&&s!==null&&(a=io(s)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=nO,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},HN(e),s=n.contextType,a.context=typeof s=="object"&&s!==null?io(s):e0,a.state=e.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(g3(e,n,s,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&nO.enqueueReplaceState(a,a.state,null),Wx(e,i,a,r),Gx(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){a=e.stateNode;var o=e.memoizedProps,l=Gm(n,o);a.props=l;var c=a.context,u=n.contextType;s=e0,typeof u=="object"&&u!==null&&(s=io(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",o=e.pendingProps!==o,u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o||c!==s)&&GF(e,a,i,s),ld=!1;var h=e.memoizedState;a.state=h,Wx(e,i,a,r),Gx(),c=e.memoizedState,o||h!==c||ld?(typeof f=="function"&&(g3(e,n,f,i),c=e.memoizedState),(l=ld||VF(e,n,l,i,h,c,s))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),a.props=i,a.state=c,a.context=s,i=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,J8(t,e),s=e.memoizedProps,u=Gm(n,s),a.props=u,f=e.pendingProps,h=a.context,c=n.contextType,l=e0,typeof c=="object"&&c!==null&&(l=io(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||h!==l)&&GF(e,a,i,l),ld=!1,h=e.memoizedState,a.state=h,Wx(e,i,a,r),Gx();var d=e.memoizedState;s!==f||h!==d||ld||t!==null&&t.dependencies!==null&&BM(t.dependencies)?(typeof o=="function"&&(g3(e,n,o,i),d=e.memoizedState),(u=ld||VF(e,n,u,i,h,d,l)||t!==null&&t.dependencies!==null&&BM(t.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,d,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,d,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),a.props=i,a.state=d,a.context=l,i=u):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return a=i,eM(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=j0(e,t.child,null,r),e.child=j0(e,null,n,r)):Ms(t,e,n,r),e.memoizedState=a.state,t=e.child):t=dh(t,e,r),t}function $F(t,e,n,i){return b_(),e.flags|=256,Ms(t,e,n,i),e.child}var b3={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function v3(t){return{baseLanes:t,cachePool:gW()}}function y3(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=mc),t}function uX(t,e,n){var i=e.pendingProps,r=!1,a=(e.flags&128)!==0,s;if((s=a)||(s=t!==null&&t.memoizedState===null?!1:(Ba.current&2)!==0),s&&(r=!0,e.flags&=-129),s=(e.flags&32)!==0,e.flags&=-33,t===null){if(er){if(r?pd(e):md(),er){var o=pa,l;if(l=o){e:{for(l=o,o=Gu;l.nodeType!==8;){if(!o){o=null;break e}if(l=gu(l.nextSibling),l===null){o=null;break e}}o=l}o!==null?(e.memoizedState={dehydrated:o,treeContext:Mm!==null?{id:Kf,overflow:Yf}:null,retryLane:536870912,hydrationErrors:null},l=bl(18,null,null,0),l.stateNode=o,l.return=e,e.child=l,So=e,pa=null,l=!0):l=!1}l||jm(e)}if(o=e.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return vO(o)?e.lanes=32:e.lanes=536870912,null;$f(e)}return o=i.children,i=i.fallback,r?(md(),r=e.mode,o=qM({mode:"hidden",children:o},r),i=Em(i,r,n,null),o.return=e,i.return=e,o.sibling=i,e.child=o,r=e.child,r.memoizedState=v3(n),r.childLanes=y3(t,s,n),e.memoizedState=b3,i):(pd(e),aO(e,o))}if(l=t.memoizedState,l!==null&&(o=l.dehydrated,o!==null)){if(a)e.flags&256?(pd(e),e.flags&=-257,e=x3(t,e,n)):e.memoizedState!==null?(md(),e.child=t.child,e.flags|=128,e=null):(md(),r=i.fallback,o=e.mode,i=qM({mode:"visible",children:i.children},o),r=Em(r,o,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,j0(e,t.child,null,n),i=e.child,i.memoizedState=v3(n),i.childLanes=y3(t,s,n),e.memoizedState=b3,e=r);else if(pd(e),vO(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var c=s.dgst;s=c,i=Error(It(419)),i.stack="",i.digest=s,M1({value:i,source:null,stack:null}),e=x3(t,e,n)}else if(rs||v_(t,e,n,!1),s=(n&t.childLanes)!==0,rs||s){if(s=Lr,s!==null&&(i=n&-n,i=i&42?1:TN(i),i=i&(s.suspendedLanes|n)?0:i,i!==0&&i!==l.retryLane))throw l.retryLane=i,Tv(t,i),El(s,t,i),oX;o.data==="$?"||fO(),e=x3(t,e,n)}else o.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,pa=gu(o.nextSibling),So=e,er=!0,Tm=null,Gu=!1,t!==null&&(oc[lc++]=Kf,oc[lc++]=Yf,oc[lc++]=Mm,Kf=t.id,Yf=t.overflow,Mm=e),e=aO(e,i.children),e.flags|=4096);return e}return r?(md(),r=i.fallback,o=e.mode,l=t.child,c=l.sibling,i=ih(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?r=ih(c,r):(r=Em(r,o,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,o=t.child.memoizedState,o===null?o=v3(n):(l=o.cachePool,l!==null?(c=Fa._currentValue,l=l.parent!==c?{parent:c,pool:c}:l):l=gW(),o={baseLanes:o.baseLanes|n,cachePool:l}),r.memoizedState=o,r.childLanes=y3(t,s,n),e.memoizedState=b3,i):(pd(e),n=t.child,t=n.sibling,n=ih(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(s=e.deletions,s===null?(e.deletions=[t],e.flags|=16):s.push(t)),e.child=n,e.memoizedState=null,n)}function aO(t,e){return e=qM({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function qM(t,e){return t=bl(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function x3(t,e,n){return j0(e,t.child,null,n),t=aO(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function ZF(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),X8(t.return,e,n)}function _3(t,e,n,i,r){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r)}function fX(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;if(Ms(t,e,i.children,n),i=Ba.current,i&2)i=i&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ZF(t,n,e);else if(t.tag===19)ZF(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}switch(Zr(Ba,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&GM(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),_3(e,!1,r,n,a);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&GM(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}_3(e,!0,n,null,a);break;case"together":_3(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function dh(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),jd|=e.lanes,!(n&e.childLanes))if(t!==null){if(v_(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(It(153));if(e.child!==null){for(t=e.child,n=ih(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ih(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function nL(t,e){return t.lanes&e?!0:(t=t.dependencies,!!(t!==null&&BM(t)))}function Rse(t,e,n){switch(e.tag){case 3:DM(e,e.stateNode.containerInfo),dd(e,Fa,t.memoizedState.cache),b_();break;case 27:case 5:N8(e);break;case 4:DM(e,e.stateNode.containerInfo);break;case 10:dd(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(pd(e),e.flags|=128,null):n&e.child.childLanes?uX(t,e,n):(pd(e),t=dh(t,e,n),t!==null?t.sibling:null);pd(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(v_(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return fX(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Zr(Ba,Ba.current),i)break;return null;case 22:case 23:return e.lanes=0,cX(t,e,n);case 24:dd(e,Fa,t.memoizedState.cache)}return dh(t,e,n)}function hX(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)rs=!0;else{if(!nL(t,n)&&!(e.flags&128))return rs=!1,Rse(t,e,n);rs=!!(t.flags&131072)}else rs=!1,er&&e.flags&1048576&&pW(e,FM,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")UN(i)?(t=Gm(i,t),e.tag=1,e=JF(null,e,i,t,n)):(e.tag=0,e=rO(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===wN){e.tag=11,e=XF(null,e,i,t,n);break e}else if(r===EN){e.tag=14,e=qF(null,e,i,t,n);break e}}throw e=O8(i)||i,Error(It(306,e,""))}}return e;case 0:return rO(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Gm(i,e.pendingProps),JF(t,e,i,r,n);case 3:e:{if(DM(e,e.stateNode.containerInfo),t===null)throw Error(It(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,J8(t,e),Wx(e,i,null,n);var s=e.memoizedState;if(i=s.cache,dd(e,Fa,i),i!==a.cache&&q8(e,[Fa],n,!0),Gx(),i=s.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:s.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=$F(t,e,i,n);break e}else if(i!==r){r=hc(Error(It(424)),e),M1(r),e=$F(t,e,i,n);break e}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(pa=gu(t.firstChild),So=e,er=!0,Tm=null,Gu=!0,n=eX(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(b_(),i===r){e=dh(t,e,n);break e}Ms(t,e,i,n)}e=e.child}return e;case 26:return eM(t,e),t===null?(n=mB(e.type,null,e.pendingProps,null))?e.memoizedState=n:er||(n=e.type,t=e.pendingProps,i=e2(Cd.current).createElement(n),i[no]=e,i[Go]=t,Os(i,n,t),is(i),e.stateNode=i):e.memoizedState=mB(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return N8(e),t===null&&er&&(i=e.stateNode=ZX(e.type,e.pendingProps,Cd.current),So=e,Gu=!0,r=pa,Jd(e.type)?(yO=r,pa=gu(i.firstChild)):pa=r),Ms(t,e,e.pendingProps.children,n),eM(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&er&&((r=i=pa)&&(i=ioe(i,e.type,e.pendingProps,Gu),i!==null?(e.stateNode=i,So=e,pa=gu(i.firstChild),Gu=!1,r=!0):r=!1),r||jm(e)),N8(e),r=e.type,a=e.pendingProps,s=t!==null?t.memoizedProps:null,i=a.children,gO(r,a)?i=null:s!==null&&gO(r,s)&&(e.flags|=32),e.memoizedState!==null&&(r=WN(t,e,_se,null,null,n),D1._currentValue=r),eM(t,e),Ms(t,e,i,n),e.child;case 6:return t===null&&er&&((t=n=pa)&&(n=roe(n,e.pendingProps,Gu),n!==null?(e.stateNode=n,So=e,pa=null,t=!0):t=!1),t||jm(e)),null;case 13:return uX(t,e,n);case 4:return DM(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=j0(e,null,i,n):Ms(t,e,i,n),e.child;case 11:return XF(t,e,e.type,e.pendingProps,n);case 7:return Ms(t,e,e.pendingProps,n),e.child;case 8:return Ms(t,e,e.pendingProps.children,n),e.child;case 12:return Ms(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,dd(e,e.type,i.value),Ms(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Hm(e),r=io(r),i=i(r),e.flags|=1,Ms(t,e,i,n),e.child;case 14:return qF(t,e,e.type,e.pendingProps,n);case 15:return lX(t,e,e.type,e.pendingProps,n);case 19:return fX(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=qM(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=ih(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return cX(t,e,n);case 24:return Hm(e),i=io(Fa),t===null?(r=jN(),r===null&&(r=Lr,a=zN(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},HN(e),dd(e,Fa,r)):(t.lanes&n&&(J8(t,e),Wx(e,null,null,n),Gx()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),dd(e,Fa,i)):(i=a.cache,dd(e,Fa,i),i!==r.cache&&q8(e,[Fa],n,!0))),Ms(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(It(156,e.tag))}function If(t){t.flags|=4}function QF(t,e){if(e.type!=="stylesheet"||e.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!tq(e)){if(e=Sc.current,e!==null&&((ji&4194048)===ji?ef!==null:(ji&62914560)!==ji&&!(ji&536870912)||e!==ef))throw Hx=Y8,bW;t.flags|=8192}}function qS(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?F7():536870912,t.lanes|=e,H0|=e)}function Oy(t,e){if(!er)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ra(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function kse(t,e,n){var i=e.pendingProps;switch(BN(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ra(e),null;case 1:return ra(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),rh(Fa),L0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ky(e)?If(e):t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,RF())),ra(e),null;case 26:return n=e.memoizedState,t===null?(If(e),n!==null?(ra(e),QF(e,n)):(ra(e),e.flags&=-16777217)):n?n!==t.memoizedState?(If(e),ra(e),QF(e,n)):(ra(e),e.flags&=-16777217):(t.memoizedProps!==i&&If(e),ra(e),e.flags&=-16777217),null;case 27:OM(e),n=Cd.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&If(e);else{if(!i){if(e.stateNode===null)throw Error(It(166));return ra(e),null}t=Zu.current,ky(e)?AF(e):(t=ZX(r,i,n),e.stateNode=t,If(e))}return ra(e),null;case 5:if(OM(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&If(e);else{if(!i){if(e.stateNode===null)throw Error(It(166));return ra(e),null}if(t=Zu.current,ky(e))AF(e);else{switch(r=e2(Cd.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[no]=e,t[Go]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(Os(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&If(e)}}return ra(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&If(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(It(166));if(t=Cd.current,ky(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=So,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[no]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||YX(t.nodeValue,n)),t||jm(e)}else t=e2(t).createTextNode(i),t[no]=e,e.stateNode=t}return ra(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=ky(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(It(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(It(317));r[no]=e}else b_(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ra(e),r=!1}else r=RF(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?($f(e),e):($f(e),null)}if($f(e),e.flags&128)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var a=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),qS(e,e.updateQueue),ra(e),null;case 4:return L0(),t===null&&uL(e.stateNode.containerInfo),ra(e),null;case 10:return rh(e.type),ra(e),null;case 19:if(ss(Ba),r=e.memoizedState,r===null)return ra(e),null;if(i=(e.flags&128)!==0,a=r.rendering,a===null)if(i)Oy(r,!1);else{if(ma!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=GM(t),a!==null){for(e.flags|=128,Oy(r,!1),t=a.updateQueue,e.updateQueue=t,qS(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)dW(n,t),n=n.sibling;return Zr(Ba,Ba.current&1|2),e.child}t=t.sibling}r.tail!==null&&Qu()>YM&&(e.flags|=128,i=!0,Oy(r,!1),e.lanes=4194304)}else{if(!i)if(t=GM(a),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,qS(e,t),Oy(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!er)return ra(e),null}else 2*Qu()-r.renderingStartTime>YM&&n!==536870912&&(e.flags|=128,i=!0,Oy(r,!1),e.lanes=4194304);r.isBackwards?(a.sibling=e.child,e.child=a):(t=r.last,t!==null?t.sibling=a:e.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Qu(),e.sibling=null,t=Ba.current,Zr(Ba,i?t&1|2:t&1),e):(ra(e),null);case 22:case 23:return $f(e),VN(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?n&536870912&&!(e.flags&128)&&(ra(e),e.subtreeFlags&6&&(e.flags|=8192)):ra(e),n=e.updateQueue,n!==null&&qS(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ss(Am),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),rh(Fa),ra(e),null;case 25:return null;case 30:return null}throw Error(It(156,e.tag))}function Dse(t,e){switch(BN(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return rh(Fa),L0(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return OM(e),null;case 13:if($f(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(It(340));b_()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ss(Ba),null;case 4:return L0(),null;case 10:return rh(e.type),null;case 22:case 23:return $f(e),VN(),t!==null&&ss(Am),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return rh(Fa),null;case 25:return null;default:return null}}function dX(t,e){switch(BN(e),e.tag){case 3:rh(Fa),L0();break;case 26:case 27:case 5:OM(e);break;case 4:L0();break;case 13:$f(e);break;case 19:ss(Ba);break;case 10:rh(e.type);break;case 22:case 23:$f(e),VN(),t!==null&&ss(Am);break;case 24:rh(Fa)}}function w_(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,s=n.inst;i=a(),s.destroy=i}n=n.next}while(n!==r)}}catch(o){Tr(e,e.return,o)}}function zd(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var s=i.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,r=e;var l=n,c=o;try{c()}catch(u){Tr(r,l,u)}}}i=i.next}while(i!==a)}}catch(u){Tr(e,e.return,u)}}function pX(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{xW(e,n)}catch(i){Tr(t,t.return,i)}}}function mX(t,e,n){n.props=Gm(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Tr(t,e,i)}}function qx(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){Tr(t,e,r)}}function Yu(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Tr(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Tr(t,e,r)}else n.current=null}function gX(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Tr(t,t.return,r)}}function S3(t,e,n){try{var i=t.stateNode;Zse(i,t.type,n,e),i[Go]=e}catch(r){Tr(t,t.return,r)}}function bX(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Jd(t.type)||t.tag===4}function w3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||bX(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Jd(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sO(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ZT));else if(i!==4&&(i===27&&Jd(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(sO(t,e,n),t=t.sibling;t!==null;)sO(t,e,n),t=t.sibling}function KM(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Jd(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(KM(t,e,n),t=t.sibling;t!==null;)KM(t,e,n),t=t.sibling}function vX(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);Os(e,i,n),e[no]=t,e[Go]=n}catch(a){Tr(t,t.return,a)}}var Wf=!1,xa=!1,E3=!1,eB=typeof WeakSet=="function"?WeakSet:Set,ts=null;function Ose(t,e){if(t=t.containerInfo,pO=r2,t=aW(t),NN(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||r!==0&&f.nodeType!==3||(o=s+r),f!==a||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===r&&(o=s),h===a&&++u===i&&(l=s),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(mO={focusedElem:t,selectionRange:n},r2=!1,ts=e;ts!==null;)if(e=ts,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,ts=t;else for(;ts!==null;){switch(e=ts,a=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var g=Gm(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(g,a),i.__reactInternalSnapshotBeforeUpdate=t}catch(b){Tr(n,n.return,b)}}break;case 3:if(t&1024){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)bO(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bO(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(It(163))}if(t=e.sibling,t!==null){t.return=e.return,ts=t;break}ts=e.return}}function yX(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Wh(t,n),i&4&&w_(5,n);break;case 1:if(Wh(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(s){Tr(n,n.return,s)}else{var r=Gm(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(s){Tr(n,n.return,s)}}i&64&&pX(n),i&512&&qx(n,n.return);break;case 3:if(Wh(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{xW(t,e)}catch(s){Tr(n,n.return,s)}}break;case 27:e===null&&i&4&&vX(n);case 26:case 5:Wh(t,n),e===null&&i&4&&gX(n),i&512&&qx(n,n.return);break;case 12:Wh(t,n);break;case 13:Wh(t,n),i&4&&SX(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=jse.bind(null,n),aoe(t,n))));break;case 22:if(i=n.memoizedState!==null||Wf,!i){e=e!==null&&e.memoizedState!==null||xa,r=Wf;var a=xa;Wf=i,(xa=e)&&!a?ad(t,n,(n.subtreeFlags&8772)!==0):Wh(t,n),Wf=r,xa=a}break;case 30:break;default:Wh(t,n)}}function xX(t){var e=t.alternate;e!==null&&(t.alternate=null,xX(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&CN(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Kr=null,Uo=!1;function Nf(t,e,n){for(n=n.child;n!==null;)_X(t,e,n),n=n.sibling}function _X(t,e,n){if(_l&&typeof _l.onCommitFiberUnmount=="function")try{_l.onCommitFiberUnmount(h_,n)}catch{}switch(n.tag){case 26:xa||Yu(n,e),Nf(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:xa||Yu(n,e);var i=Kr,r=Uo;Jd(n.type)&&(Kr=n.stateNode,Uo=!1),Nf(t,e,n),$x(n.stateNode),Kr=i,Uo=r;break;case 5:xa||Yu(n,e);case 6:if(i=Kr,r=Uo,Kr=null,Nf(t,e,n),Kr=i,Uo=r,Kr!==null)if(Uo)try{(Kr.nodeType===9?Kr.body:Kr.nodeName==="HTML"?Kr.ownerDocument.body:Kr).removeChild(n.stateNode)}catch(a){Tr(n,e,a)}else try{Kr.removeChild(n.stateNode)}catch(a){Tr(n,e,a)}break;case 18:Kr!==null&&(Uo?(t=Kr,hB(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),N1(t)):hB(Kr,n.stateNode));break;case 4:i=Kr,r=Uo,Kr=n.stateNode.containerInfo,Uo=!0,Nf(t,e,n),Kr=i,Uo=r;break;case 0:case 11:case 14:case 15:xa||zd(2,n,e),xa||zd(4,n,e),Nf(t,e,n);break;case 1:xa||(Yu(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&mX(n,e,i)),Nf(t,e,n);break;case 21:Nf(t,e,n);break;case 22:xa=(i=xa)||n.memoizedState!==null,Nf(t,e,n),xa=i;break;default:Nf(t,e,n)}}function SX(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{N1(t)}catch(n){Tr(e,e.return,n)}}function Ise(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new eB),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new eB),e;default:throw Error(It(435,t.tag))}}function M3(t,e){var n=Ise(t);e.forEach(function(i){var r=Hse.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function ll(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,s=e,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Jd(o.type)){Kr=o.stateNode,Uo=!1;break e}break;case 5:Kr=o.stateNode,Uo=!1;break e;case 3:case 4:Kr=o.stateNode.containerInfo,Uo=!0;break e}o=o.return}if(Kr===null)throw Error(It(160));_X(a,s,r),Kr=null,Uo=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)wX(e,t),e=e.sibling}var Qc=null;function wX(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ll(e,t),cl(t),i&4&&(zd(3,t,t.return),w_(3,t),zd(5,t,t.return));break;case 1:ll(e,t),cl(t),i&512&&(xa||n===null||Yu(n,n.return)),i&64&&Wf&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Qc;if(ll(e,t),cl(t),i&512&&(xa||n===null||Yu(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":a=r.getElementsByTagName("title")[0],(!a||a[m_]||a[no]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),Os(a,i,n),a[no]=t,is(a),i=a;break e;case"link":var s=bB("link","href",r).get(i+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(a=s[o],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}a=r.createElement(i),Os(a,i,n),r.head.appendChild(a);break;case"meta":if(s=bB("meta","content",r).get(i+(n.content||""))){for(o=0;o<s.length;o++)if(a=s[o],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}a=r.createElement(i),Os(a,i,n),r.head.appendChild(a);break;default:throw Error(It(468,i))}a[no]=t,is(a),i=a}t.stateNode=i}else vB(r,t.type,t.stateNode);else t.stateNode=gB(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?vB(r,t.type,t.stateNode):gB(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&S3(t,t.memoizedProps,n.memoizedProps)}break;case 27:ll(e,t),cl(t),i&512&&(xa||n===null||Yu(n,n.return)),n!==null&&i&4&&S3(t,t.memoizedProps,n.memoizedProps);break;case 5:if(ll(e,t),cl(t),i&512&&(xa||n===null||Yu(n,n.return)),t.flags&32){r=t.stateNode;try{U0(r,"")}catch(d){Tr(t,t.return,d)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,S3(t,r,n!==null?n.memoizedProps:r)),i&1024&&(E3=!0);break;case 6:if(ll(e,t),cl(t),i&4){if(t.stateNode===null)throw Error(It(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){Tr(t,t.return,d)}}break;case 3:if(iM=null,r=Qc,Qc=t2(e.containerInfo),ll(e,t),Qc=r,cl(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{N1(e.containerInfo)}catch(d){Tr(t,t.return,d)}E3&&(E3=!1,EX(t));break;case 4:i=Qc,Qc=t2(t.stateNode.containerInfo),ll(e,t),cl(t),Qc=i;break;case 12:ll(e,t),cl(t);break;case 13:ll(e,t),cl(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(oL=Qu()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,M3(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Wf,u=xa;if(Wf=c||r,xa=u||l,ll(e,t),xa=u,Wf=c,cl(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||Wf||xa||Jp(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(a=l.stateNode,r)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var f=l.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(d){Tr(l,l.return,d)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(d){Tr(l,l.return,d)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,M3(t,n))));break;case 19:ll(e,t),cl(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,M3(t,i)));break;case 30:break;case 21:break;default:ll(e,t),cl(t)}}function cl(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(bX(i)){n=i;break}i=i.return}if(n==null)throw Error(It(160));switch(n.tag){case 27:var r=n.stateNode,a=w3(t);KM(t,a,r);break;case 5:var s=n.stateNode;n.flags&32&&(U0(s,""),n.flags&=-33);var o=w3(t);KM(t,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,c=w3(t);sO(t,c,l);break;default:throw Error(It(161))}}catch(u){Tr(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function EX(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;EX(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Wh(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)yX(t,e.alternate,e),e=e.sibling}function Jp(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:zd(4,e,e.return),Jp(e);break;case 1:Yu(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&mX(e,e.return,n),Jp(e);break;case 27:$x(e.stateNode);case 26:case 5:Yu(e,e.return),Jp(e);break;case 22:e.memoizedState===null&&Jp(e);break;case 30:Jp(e);break;default:Jp(e)}t=t.sibling}}function ad(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,s=a.flags;switch(a.tag){case 0:case 11:case 15:ad(r,a,n),w_(4,a);break;case 1:if(ad(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Tr(i,i.return,c)}if(i=a,r=i.updateQueue,r!==null){var o=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)yW(l[r],o)}catch(c){Tr(i,i.return,c)}}n&&s&64&&pX(a),qx(a,a.return);break;case 27:vX(a);case 26:case 5:ad(r,a,n),n&&i===null&&s&4&&gX(a),qx(a,a.return);break;case 12:ad(r,a,n);break;case 13:ad(r,a,n),n&&s&4&&SX(r,a);break;case 22:a.memoizedState===null&&ad(r,a,n),qx(a,a.return);break;case 30:break;default:ad(r,a,n)}e=e.sibling}}function iL(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&y_(n))}function rL(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&y_(t))}function Nu(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)MX(t,e,n,i),e=e.sibling}function MX(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Nu(t,e,n,i),r&2048&&w_(9,e);break;case 1:Nu(t,e,n,i);break;case 3:Nu(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&y_(t)));break;case 12:if(r&2048){Nu(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,s=a.id,o=a.onPostCommit;typeof o=="function"&&o(s,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){Tr(e,e.return,l)}}else Nu(t,e,n,i);break;case 13:Nu(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,s=e.alternate,e.memoizedState!==null?a._visibility&2?Nu(t,e,n,i):Kx(t,e):a._visibility&2?Nu(t,e,n,i):(a._visibility|=2,Bb(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&iL(s,e);break;case 24:Nu(t,e,n,i),r&2048&&rL(e.alternate,e);break;default:Nu(t,e,n,i)}}function Bb(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var a=t,s=e,o=n,l=i,c=s.flags;switch(s.tag){case 0:case 11:case 15:Bb(a,s,o,l,r),w_(8,s);break;case 23:break;case 22:var u=s.stateNode;s.memoizedState!==null?u._visibility&2?Bb(a,s,o,l,r):Kx(a,s):(u._visibility|=2,Bb(a,s,o,l,r)),r&&c&2048&&iL(s.alternate,s);break;case 24:Bb(a,s,o,l,r),r&&c&2048&&rL(s.alternate,s);break;default:Bb(a,s,o,l,r)}e=e.sibling}}function Kx(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Kx(n,i),r&2048&&iL(i.alternate,i);break;case 24:Kx(n,i),r&2048&&rL(i.alternate,i);break;default:Kx(n,i)}e=e.sibling}}var Ex=8192;function Vg(t){if(t.subtreeFlags&Ex)for(t=t.child;t!==null;)TX(t),t=t.sibling}function TX(t){switch(t.tag){case 26:Vg(t),t.flags&Ex&&t.memoizedState!==null&&voe(Qc,t.memoizedState,t.memoizedProps);break;case 5:Vg(t);break;case 3:case 4:var e=Qc;Qc=t2(t.stateNode.containerInfo),Vg(t),Qc=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Ex,Ex=16777216,Vg(t),Ex=e):Vg(t));break;default:Vg(t)}}function AX(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Iy(t){var e=t.deletions;if(t.flags&16){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ts=i,RX(i,t)}AX(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)CX(t),t=t.sibling}function CX(t){switch(t.tag){case 0:case 11:case 15:Iy(t),t.flags&2048&&zd(9,t,t.return);break;case 3:Iy(t);break;case 12:Iy(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,tM(t)):Iy(t);break;default:Iy(t)}}function tM(t){var e=t.deletions;if(t.flags&16){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ts=i,RX(i,t)}AX(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:zd(8,e,e.return),tM(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,tM(e));break;default:tM(e)}t=t.sibling}}function RX(t,e){for(;ts!==null;){var n=ts;switch(n.tag){case 0:case 11:case 15:zd(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:y_(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ts=i;else e:for(n=t;ts!==null;){i=ts;var r=i.sibling,a=i.return;if(xX(i),i===n){ts=null;break e}if(r!==null){r.return=a,ts=r;break e}ts=a}}}var Nse={getCacheForType:function(t){var e=io(Fa),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},Lse=typeof WeakMap=="function"?WeakMap:Map,gr=0,Lr=null,Ri=null,ji=0,mr=0,ml=null,Sd=!1,Av=!1,aL=!1,ph=0,ma=0,jd=0,Cm=0,sL=0,mc=0,H0=0,Yx=null,Fo=null,oO=!1,oL=0,YM=1/0,JM=null,Dd=null,Rs=0,Od=null,V0=null,b0=0,lO=0,cO=null,kX=null,Jx=0,uO=null;function wl(){if(gr&2&&ji!==0)return ji&-ji;if(Bn.T!==null){var t=F0;return t!==0?t:cL()}return j7()}function DX(){mc===0&&(mc=!(ji&536870912)||er?U7():536870912);var t=Sc.current;return t!==null&&(t.flags|=32),mc}function El(t,e,n){(t===Lr&&(mr===2||mr===9)||t.cancelPendingCommit!==null)&&(G0(t,0),wd(t,ji,mc,!1)),p_(t,n),(!(gr&2)||t!==Lr)&&(t===Lr&&(!(gr&2)&&(Cm|=n),ma===4&&wd(t,ji,mc,!1)),gf(t))}function OX(t,e,n){if(gr&6)throw Error(It(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||d_(t,e),r=i?Fse(t,e):T3(t,e,!0),a=i;do{if(r===0){Av&&!i&&wd(t,e,0,!1);break}else{if(n=t.current.alternate,a&&!Pse(n)){r=T3(t,e,!1),a=!1;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var s=0;else s=t.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){e=s;e:{var o=t;r=Yx;var l=o.current.memoizedState.isDehydrated;if(l&&(G0(o,s).flags|=256),s=T3(o,s,!1),s!==2){if(aL&&!l){o.errorRecoveryDisabledLanes|=a,Cm|=a,r=4;break e}a=Fo,Fo=r,a!==null&&(Fo===null?Fo=a:Fo.push.apply(Fo,a))}r=s}if(a=!1,r!==2)continue}}if(r===1){G0(t,0),wd(t,e,0,!0);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(It(345));case 4:if((e&4194048)!==e)break;case 6:wd(i,e,mc,!Sd);break e;case 2:Fo=null;break;case 3:case 5:break;default:throw Error(It(329))}if((e&62914560)===e&&(r=oL+300-Qu(),10<r)){if(wd(i,e,mc,!Sd),BT(i,0,!0)!==0)break e;i.timeoutHandle=$X(tB.bind(null,i,n,Fo,JM,oO,e,mc,Cm,H0,Sd,a,2,-0,0),r);break e}tB(i,n,Fo,JM,oO,e,mc,Cm,H0,Sd,a,0,-0,0)}}break}while(!0);gf(t)}function tB(t,e,n,i,r,a,s,o,l,c,u,f,h,d){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(k1={stylesheets:null,count:0,unsuspend:boe},TX(e),f=yoe(),f!==null)){t.cancelPendingCommit=f(iB.bind(null,t,e,a,n,i,r,s,o,l,u,1,h,d)),wd(t,a,s,!c);return}iB(t,e,a,n,i,r,s,o,l)}function Pse(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!Cl(a(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function wd(t,e,n,i){e&=~sL,e&=~Cm,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-Sl(r),s=1<<a;i[a]=-1,r&=~s}n!==0&&B7(t,n,e)}function YT(){return gr&6?!0:(E_(0),!1)}function lL(){if(Ri!==null){if(mr===0)var t=Ri.return;else t=Ri,Jf=sg=null,KN(t),g0=null,A1=0,t=Ri;for(;t!==null;)dX(t.alternate,t),t=t.return;Ri=null}}function G0(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,eoe(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),lL(),Lr=t,Ri=n=ih(t.current,null),ji=e,mr=0,ml=null,Sd=!1,Av=d_(t,e),aL=!1,H0=mc=sL=Cm=jd=ma=0,Fo=Yx=null,oO=!1,e&8&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-Sl(i),a=1<<r;e|=t[r],i&=~a}return ph=e,VT(),n}function IX(t,e){yi=null,Bn.H=VM,e===x_||e===WT?(e=IF(),mr=3):e===bW?(e=IF(),mr=4):mr=e===oX?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,ml=e,Ri===null&&(ma=1,XM(t,hc(e,t.current)))}function NX(){var t=Bn.H;return Bn.H=VM,t===null?VM:t}function LX(){var t=Bn.A;return Bn.A=Nse,t}function fO(){ma=4,Sd||(ji&4194048)!==ji&&Sc.current!==null||(Av=!0),!(jd&134217727)&&!(Cm&134217727)||Lr===null||wd(Lr,ji,mc,!1)}function T3(t,e,n){var i=gr;gr|=2;var r=NX(),a=LX();(Lr!==t||ji!==e)&&(JM=null,G0(t,e)),e=!1;var s=ma;e:do try{if(mr!==0&&Ri!==null){var o=Ri,l=ml;switch(mr){case 8:lL(),s=6;break e;case 3:case 2:case 9:case 6:Sc.current===null&&(e=!0);var c=mr;if(mr=0,ml=null,i0(t,o,l,c),n&&Av){s=0;break e}break;default:c=mr,mr=0,ml=null,i0(t,o,l,c)}}Use(),s=ma;break}catch(u){IX(t,u)}while(!0);return e&&t.shellSuspendCounter++,Jf=sg=null,gr=i,Bn.H=r,Bn.A=a,Ri===null&&(Lr=null,ji=0,VT()),s}function Use(){for(;Ri!==null;)PX(Ri)}function Fse(t,e){var n=gr;gr|=2;var i=NX(),r=LX();Lr!==t||ji!==e?(JM=null,YM=Qu()+500,G0(t,e)):Av=d_(t,e);e:do try{if(mr!==0&&Ri!==null){e=Ri;var a=ml;t:switch(mr){case 1:mr=0,ml=null,i0(t,e,a,1);break;case 2:case 9:if(OF(a)){mr=0,ml=null,nB(e);break}e=function(){mr!==2&&mr!==9||Lr!==t||(mr=7),gf(t)},a.then(e,e);break e;case 3:mr=7;break e;case 4:mr=5;break e;case 7:OF(a)?(mr=0,ml=null,nB(e)):(mr=0,ml=null,i0(t,e,a,7));break;case 5:var s=null;switch(Ri.tag){case 26:s=Ri.memoizedState;case 5:case 27:var o=Ri;if(!s||tq(s)){mr=0,ml=null;var l=o.sibling;if(l!==null)Ri=l;else{var c=o.return;c!==null?(Ri=c,JT(c)):Ri=null}break t}}mr=0,ml=null,i0(t,e,a,5);break;case 6:mr=0,ml=null,i0(t,e,a,6);break;case 8:lL(),ma=6;break e;default:throw Error(It(462))}}Bse();break}catch(u){IX(t,u)}while(!0);return Jf=sg=null,Bn.H=i,Bn.A=r,gr=n,Ri!==null?0:(Lr=null,ji=0,VT(),ma)}function Bse(){for(;Ri!==null&&!oae();)PX(Ri)}function PX(t){var e=hX(t.alternate,t,ph);t.memoizedProps=t.pendingProps,e===null?JT(t):Ri=e}function nB(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=YF(n,e,e.pendingProps,e.type,void 0,ji);break;case 11:e=YF(n,e,e.pendingProps,e.type.render,e.ref,ji);break;case 5:KN(e);default:dX(n,e),e=Ri=dW(e,ph),e=hX(n,e,ph)}t.memoizedProps=t.pendingProps,e===null?JT(t):Ri=e}function i0(t,e,n,i){Jf=sg=null,KN(e),g0=null,A1=0;var r=e.return;try{if(Cse(t,r,e,n,ji)){ma=1,XM(t,hc(n,t.current)),Ri=null;return}}catch(a){if(r!==null)throw Ri=r,a;ma=1,XM(t,hc(n,t.current)),Ri=null;return}e.flags&32768?(er||i===1?t=!0:Av||ji&536870912?t=!1:(Sd=t=!0,(i===2||i===9||i===3||i===6)&&(i=Sc.current,i!==null&&i.tag===13&&(i.flags|=16384))),UX(e,t)):JT(e)}function JT(t){var e=t;do{if(e.flags&32768){UX(e,Sd);return}t=e.return;var n=kse(e.alternate,e,ph);if(n!==null){Ri=n;return}if(e=e.sibling,e!==null){Ri=e;return}Ri=e=t}while(e!==null);ma===0&&(ma=5)}function UX(t,e){do{var n=Dse(t.alternate,t);if(n!==null){n.flags&=32767,Ri=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ri=t;return}Ri=t=n}while(t!==null);ma=6,Ri=null}function iB(t,e,n,i,r,a,s,o,l){t.cancelPendingCommit=null;do $T();while(Rs!==0);if(gr&6)throw Error(It(327));if(e!==null){if(e===t.current)throw Error(It(177));if(a=e.lanes|e.childLanes,a|=LN,bae(t,n,a,s,o,l),t===Lr&&(Ri=Lr=null,ji=0),V0=e,Od=t,b0=n,lO=a,cO=r,kX=i,e.subtreeFlags&10256||e.flags&10256?(t.callbackNode=null,t.callbackPriority=0,Vse(IM,function(){return HX(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,e.subtreeFlags&13878||i){i=Bn.T,Bn.T=null,r=ir.p,ir.p=2,s=gr,gr|=4;try{Ose(t,e,n)}finally{gr=s,ir.p=r,Bn.T=i}}Rs=1,FX(),BX(),zX()}}function FX(){if(Rs===1){Rs=0;var t=Od,e=V0,n=(e.flags&13878)!==0;if(e.subtreeFlags&13878||n){n=Bn.T,Bn.T=null;var i=ir.p;ir.p=2;var r=gr;gr|=4;try{wX(e,t);var a=mO,s=aW(t.containerInfo),o=a.focusedElem,l=a.selectionRange;if(s!==o&&o&&o.ownerDocument&&rW(o.ownerDocument.documentElement,o)){if(l!==null&&NN(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var f=o.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var d=h.getSelection(),g=o.textContent.length,b=Math.min(l.start,g),y=l.end===void 0?b:Math.min(l.end,g);!d.extend&&b>y&&(s=y,y=b,b=s);var p=EF(o,b),x=EF(o,y);if(p&&x&&(d.rangeCount!==1||d.anchorNode!==p.node||d.anchorOffset!==p.offset||d.focusNode!==x.node||d.focusOffset!==x.offset)){var _=f.createRange();_.setStart(p.node,p.offset),d.removeAllRanges(),b>y?(d.addRange(_),d.extend(x.node,x.offset)):(_.setEnd(x.node,x.offset),d.addRange(_))}}}}for(f=[],d=o;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<f.length;o++){var w=f[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}r2=!!pO,mO=pO=null}finally{gr=r,ir.p=i,Bn.T=n}}t.current=e,Rs=2}}function BX(){if(Rs===2){Rs=0;var t=Od,e=V0,n=(e.flags&8772)!==0;if(e.subtreeFlags&8772||n){n=Bn.T,Bn.T=null;var i=ir.p;ir.p=2;var r=gr;gr|=4;try{yX(t,e.alternate,e)}finally{gr=r,ir.p=i,Bn.T=n}}Rs=3}}function zX(){if(Rs===4||Rs===3){Rs=0,lae();var t=Od,e=V0,n=b0,i=kX;e.subtreeFlags&10256||e.flags&10256?Rs=5:(Rs=0,V0=Od=null,jX(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Dd=null),AN(n),e=e.stateNode,_l&&typeof _l.onCommitFiberRoot=="function")try{_l.onCommitFiberRoot(h_,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Bn.T,r=ir.p,ir.p=2,Bn.T=null;try{for(var a=t.onRecoverableError,s=0;s<i.length;s++){var o=i[s];a(o.value,{componentStack:o.stack})}}finally{Bn.T=e,ir.p=r}}b0&3&&$T(),gf(t),r=t.pendingLanes,n&4194090&&r&42?t===uO?Jx++:(Jx=0,uO=t):Jx=0,E_(0)}}function jX(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,y_(e)))}function $T(t){return FX(),BX(),zX(),HX()}function HX(){if(Rs!==5)return!1;var t=Od,e=lO;lO=0;var n=AN(b0),i=Bn.T,r=ir.p;try{ir.p=32>n?32:n,Bn.T=null,n=cO,cO=null;var a=Od,s=b0;if(Rs=0,V0=Od=null,b0=0,gr&6)throw Error(It(331));var o=gr;if(gr|=4,CX(a.current),MX(a,a.current,s,n),gr=o,E_(0,!1),_l&&typeof _l.onPostCommitFiberRoot=="function")try{_l.onPostCommitFiberRoot(h_,a)}catch{}return!0}finally{ir.p=r,Bn.T=i,jX(t,e)}}function rB(t,e,n){e=hc(n,e),e=iO(t.stateNode,e,2),t=kd(t,e,2),t!==null&&(p_(t,2),gf(t))}function Tr(t,e,n){if(t.tag===3)rB(t,t,n);else for(;e!==null;){if(e.tag===3){rB(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Dd===null||!Dd.has(i))){t=hc(n,t),n=aX(2),i=kd(e,n,2),i!==null&&(sX(n,i,e,t),p_(i,2),gf(i));break}}e=e.return}}function A3(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new Lse;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(n)||(aL=!0,r.add(n),t=zse.bind(null,t,e,n),e.then(t,t))}function zse(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Lr===t&&(ji&n)===n&&(ma===4||ma===3&&(ji&62914560)===ji&&300>Qu()-oL?!(gr&2)&&G0(t,0):sL|=n,H0===ji&&(H0=0)),gf(t)}function VX(t,e){e===0&&(e=F7()),t=Tv(t,e),t!==null&&(p_(t,e),gf(t))}function jse(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),VX(t,n)}function Hse(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(It(314))}i!==null&&i.delete(e),VX(t,n)}function Vse(t,e){return MN(t,e)}var $M=null,zb=null,hO=!1,ZM=!1,C3=!1,Rm=0;function gf(t){t!==zb&&t.next===null&&(zb===null?$M=zb=t:zb=zb.next=t),ZM=!0,hO||(hO=!0,Wse())}function E_(t,e){if(!C3&&ZM){C3=!0;do for(var n=!1,i=$M;i!==null;){if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else{var s=i.suspendedLanes,o=i.pingedLanes;a=(1<<31-Sl(42|t)+1)-1,a&=r&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,aB(i,a))}else a=ji,a=BT(i,i===Lr?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(a&3)||d_(i,a)||(n=!0,aB(i,a));i=i.next}while(n);C3=!1}}function Gse(){GX()}function GX(){ZM=hO=!1;var t=0;Rm!==0&&(Qse()&&(t=Rm),Rm=0);for(var e=Qu(),n=null,i=$M;i!==null;){var r=i.next,a=WX(i,e);a===0?(i.next=null,n===null?$M=r:n.next=r,r===null&&(zb=n)):(n=i,(t!==0||a&3)&&(ZM=!0)),i=r}E_(t)}function WX(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var s=31-Sl(a),o=1<<s,l=r[s];l===-1?(!(o&n)||o&i)&&(r[s]=gae(o,e)):l<=e&&(t.expiredLanes|=o),a&=~o}if(e=Lr,n=ji,n=BT(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(mr===2||mr===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&e3(i),t.callbackNode=null,t.callbackPriority=0;if(!(n&3)||d_(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&e3(i),AN(n)){case 2:case 8:n=L7;break;case 32:n=IM;break;case 268435456:n=P7;break;default:n=IM}return i=XX.bind(null,t),n=MN(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&e3(i),t.callbackPriority=2,t.callbackNode=null,2}function XX(t,e){if(Rs!==0&&Rs!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if($T()&&t.callbackNode!==n)return null;var i=ji;return i=BT(t,t===Lr?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(OX(t,i,e),WX(t,Qu()),t.callbackNode!=null&&t.callbackNode===n?XX.bind(null,t):null)}function aB(t,e){if($T())return null;OX(t,e,!0)}function Wse(){toe(function(){gr&6?MN(N7,Gse):GX()})}function cL(){return Rm===0&&(Rm=U7()),Rm}function sB(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:qE(""+t)}function oB(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function Xse(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=sB((r[Go]||null).action),s=i.submitter;s&&(e=(e=s[Go]||null)?sB(e.formAction):s.getAttribute("formAction"),e!==null&&(a=e,s=null));var o=new zT("action","action",null,i,r);t.push({event:o,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Rm!==0){var l=s?oB(r,s):new FormData(r);tO(n,{pending:!0,data:l,method:r.method,action:a},null,l)}}else typeof a=="function"&&(o.preventDefault(),l=s?oB(r,s):new FormData(r),tO(n,{pending:!0,data:l,method:r.method,action:a},a,l))},currentTarget:r}]})}}for(var R3=0;R3<V8.length;R3++){var k3=V8[R3],qse=k3.toLowerCase(),Kse=k3[0].toUpperCase()+k3.slice(1);wu(qse,"on"+Kse)}wu(oW,"onAnimationEnd");wu(lW,"onAnimationIteration");wu(cW,"onAnimationStart");wu("dblclick","onDoubleClick");wu("focusin","onFocus");wu("focusout","onBlur");wu(fse,"onTransitionRun");wu(hse,"onTransitionStart");wu(dse,"onTransitionCancel");wu(uW,"onTransitionEnd");P0("onMouseEnter",["mouseout","mouseover"]);P0("onMouseLeave",["mouseout","mouseover"]);P0("onPointerEnter",["pointerout","pointerover"]);P0("onPointerLeave",["pointerout","pointerover"]);ig("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ig("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ig("onBeforeInput",["compositionend","keypress","textInput","paste"]);ig("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ig("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ig("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var C1="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Yse=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(C1));function qX(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var s=i.length-1;0<=s;s--){var o=i[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){WM(u)}r.currentTarget=null,a=l}else for(s=0;s<i.length;s++){if(o=i[s],l=o.instance,c=o.currentTarget,o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){WM(u)}r.currentTarget=null,a=l}}}}function Ci(t,e){var n=e[P8];n===void 0&&(n=e[P8]=new Set);var i=t+"__bubble";n.has(i)||(KX(e,t,2,!1),n.add(i))}function D3(t,e,n){var i=0;e&&(i|=4),KX(n,t,i,e)}var KS="_reactListening"+Math.random().toString(36).slice(2);function uL(t){if(!t[KS]){t[KS]=!0,H7.forEach(function(n){n!=="selectionchange"&&(Yse.has(n)||D3(n,!1,t),D3(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[KS]||(e[KS]=!0,D3("selectionchange",!1,e))}}function KX(t,e,n,i){switch(sq(e)){case 2:var r=Soe;break;case 8:r=woe;break;default:r=pL}n=r.bind(null,e,n,t),r=void 0,!z8||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function O3(t,e,n,i,r){var a=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var o=i.stateNode.containerInfo;if(o===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===r)return;s=s.return}for(;o!==null;){if(s=Kb(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){i=a=s;continue e}o=o.parentNode}}i=i.return}J7(function(){var c=a,u=kN(n),f=[];e:{var h=fW.get(t);if(h!==void 0){var d=zT,g=t;switch(t){case"keypress":if(YE(n)===0)break e;case"keydown":case"keyup":d=Vae;break;case"focusin":g="focus",d=l3;break;case"focusout":g="blur",d=l3;break;case"beforeblur":case"afterblur":d=l3;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=pF;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=Dae;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=Xae;break;case oW:case lW:case cW:d=Nae;break;case uW:d=Kae;break;case"scroll":case"scrollend":d=Rae;break;case"wheel":d=Jae;break;case"copy":case"cut":case"paste":d=Pae;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=gF;break;case"toggle":case"beforetoggle":d=Zae}var b=(e&4)!==0,y=!b&&(t==="scroll"||t==="scrollend"),p=b?h!==null?h+"Capture":null:h;b=[];for(var x=c,_;x!==null;){var w=x;if(_=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||_===null||p===null||(w=S1(x,p),w!=null&&b.push(R1(x,w,_))),y)break;x=x.return}0<b.length&&(h=new d(h,g,null,n,u),f.push({event:h,listeners:b}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==B8&&(g=n.relatedTarget||n.fromElement)&&(Kb(g)||g[Ev]))break e;if((d||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,d?(g=n.relatedTarget||n.toElement,d=c,g=g?Kb(g):null,g!==null&&(y=f_(g),b=g.tag,g!==y||b!==5&&b!==27&&b!==6)&&(g=null)):(d=null,g=c),d!==g)){if(b=pF,w="onMouseLeave",p="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(b=gF,w="onPointerLeave",p="onPointerEnter",x="pointer"),y=d==null?h:wx(d),_=g==null?h:wx(g),h=new b(w,x+"leave",d,n,u),h.target=y,h.relatedTarget=_,w=null,Kb(u)===c&&(b=new b(p,x+"enter",g,n,u),b.target=_,b.relatedTarget=y,w=b),y=w,d&&g)t:{for(b=d,p=g,x=0,_=b;_;_=Gg(_))x++;for(_=0,w=p;w;w=Gg(w))_++;for(;0<x-_;)b=Gg(b),x--;for(;0<_-x;)p=Gg(p),_--;for(;x--;){if(b===p||p!==null&&b===p.alternate)break t;b=Gg(b),p=Gg(p)}b=null}else b=null;d!==null&&lB(f,h,d,b,!1),g!==null&&y!==null&&lB(f,y,g,b,!0)}}e:{if(h=c?wx(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var M=xF;else if(yF(h))if(nW)M=lse;else{M=sse;var S=ase}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&RN(c.elementType)&&(M=xF):M=ose;if(M&&(M=M(t,c))){tW(f,M,n,u);break e}S&&S(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&F8(h,"number",h.value)}switch(S=c?wx(c):window,t){case"focusin":(yF(S)||S.contentEditable==="true")&&($b=S,j8=c,zx=null);break;case"focusout":zx=j8=$b=null;break;case"mousedown":H8=!0;break;case"contextmenu":case"mouseup":case"dragend":H8=!1,MF(f,n,u);break;case"selectionchange":if(use)break;case"keydown":case"keyup":MF(f,n,u)}var A;if(IN)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Jb?Q7(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Z7&&n.locale!=="ko"&&(Jb||C!=="onCompositionStart"?C==="onCompositionEnd"&&Jb&&(A=$7()):(_d=u,DN="value"in _d?_d.value:_d.textContent,Jb=!0)),S=QM(c,C),0<S.length&&(C=new mF(C,t,null,n,u),f.push({event:C,listeners:S}),A?C.data=A:(A=eW(n),A!==null&&(C.data=A)))),(A=ese?tse(t,n):nse(t,n))&&(C=QM(c,"onBeforeInput"),0<C.length&&(S=new mF("onBeforeInput","beforeinput",null,n,u),f.push({event:S,listeners:C}),S.data=A)),Xse(f,t,c,n,u)}qX(f,e)})}function R1(t,e,n){return{instance:t,listener:e,currentTarget:n}}function QM(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=S1(t,n),r!=null&&i.unshift(R1(t,r,a)),r=S1(t,e),r!=null&&i.push(R1(t,r,a))),t.tag===3)return i;t=t.return}return[]}function Gg(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function lB(t,e,n,i,r){for(var a=e._reactName,s=[];n!==null&&n!==i;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===i)break;o!==5&&o!==26&&o!==27||c===null||(l=c,r?(c=S1(n,a),c!=null&&s.unshift(R1(n,c,l))):r||(c=S1(n,a),c!=null&&s.push(R1(n,c,l)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var Jse=/\r\n?/g,$se=/\u0000|\uFFFD/g;function cB(t){return(typeof t=="string"?t:""+t).replace(Jse,`
`).replace($se,"")}function YX(t,e){return e=cB(e),cB(t)===e}function ZT(){}function xr(t,e,n,i,r,a){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||U0(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&U0(t,""+i);break;case"className":jS(t,"class",i);break;case"tabIndex":jS(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":jS(t,n,i);break;case"style":Y7(t,i,a);break;case"data":if(e!=="object"){jS(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=qE(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(e!=="input"&&xr(t,e,"name",r.name,r,null),xr(t,e,"formEncType",r.formEncType,r,null),xr(t,e,"formMethod",r.formMethod,r,null),xr(t,e,"formTarget",r.formTarget,r,null)):(xr(t,e,"encType",r.encType,r,null),xr(t,e,"method",r.method,r,null),xr(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=qE(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=ZT);break;case"onScroll":i!=null&&Ci("scroll",t);break;case"onScrollEnd":i!=null&&Ci("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(It(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(It(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=qE(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":Ci("beforetoggle",t),Ci("toggle",t),XE(t,"popover",i);break;case"xlinkActuate":Of(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Of(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Of(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Of(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Of(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Of(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Of(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Of(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Of(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":XE(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Aae.get(n)||n,XE(t,n,i))}}function dO(t,e,n,i,r,a){switch(n){case"style":Y7(t,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(It(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(It(60));t.innerHTML=n}}break;case"children":typeof i=="string"?U0(t,i):(typeof i=="number"||typeof i=="bigint")&&U0(t,""+i);break;case"onScroll":i!=null&&Ci("scroll",t);break;case"onScrollEnd":i!=null&&Ci("scrollend",t);break;case"onClick":i!=null&&(t.onclick=ZT);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!V7.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Go]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):XE(t,n,i)}}}function Os(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ci("error",t),Ci("load",t);var i=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(It(137,e));default:xr(t,e,a,s,n,null)}}r&&xr(t,e,"srcSet",n.srcSet,n,null),i&&xr(t,e,"src",n.src,n,null);return;case"input":Ci("invalid",t);var o=a=s=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":s=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":a=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(It(137,e));break;default:xr(t,e,i,u,n,null)}}X7(t,a,o,l,c,s,r,!1),NM(t);return;case"select":Ci("invalid",t),i=s=a=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":a=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:xr(t,e,r,o,n,null)}e=a,n=s,t.multiple=!!i,e!=null?f0(t,!!i,e,!1):n!=null&&f0(t,!!i,n,!0);return;case"textarea":Ci("invalid",t),a=r=i=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":i=o;break;case"defaultValue":r=o;break;case"children":a=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(It(91));break;default:xr(t,e,s,o,n,null)}K7(t,i,r,a),NM(t);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(i=n[l],i!=null))switch(l){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:xr(t,e,l,i,n,null)}return;case"dialog":Ci("beforetoggle",t),Ci("toggle",t),Ci("cancel",t),Ci("close",t);break;case"iframe":case"object":Ci("load",t);break;case"video":case"audio":for(i=0;i<C1.length;i++)Ci(C1[i],t);break;case"image":Ci("error",t),Ci("load",t);break;case"details":Ci("toggle",t);break;case"embed":case"source":case"link":Ci("error",t),Ci("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(It(137,e));default:xr(t,e,c,i,n,null)}return;default:if(RN(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&dO(t,e,u,i,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(i=n[o],i!=null&&xr(t,e,o,i,n,null))}function Zse(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,s=null,o=null,l=null,c=null,u=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":l=f;default:i.hasOwnProperty(d)||xr(t,e,d,null,i,f)}}for(var h in i){var d=i[h];if(f=n[h],i.hasOwnProperty(h)&&(d!=null||f!=null))switch(h){case"type":a=d;break;case"name":r=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":s=d;break;case"defaultValue":o=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(It(137,e));break;default:d!==f&&xr(t,e,h,d,i,f)}}U8(t,s,o,l,c,u,a,r);return;case"select":d=s=o=h=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":d=l;default:i.hasOwnProperty(a)||xr(t,e,a,null,i,l)}for(r in i)if(a=i[r],l=n[r],i.hasOwnProperty(r)&&(a!=null||l!=null))switch(r){case"value":h=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:a!==l&&xr(t,e,r,a,i,l)}e=o,n=s,i=d,h!=null?f0(t,!!n,h,!1):!!i!=!!n&&(e!=null?f0(t,!!n,e,!0):f0(t,!!n,n?[]:"",!1));return;case"textarea":d=h=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!i.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:xr(t,e,o,null,i,r)}for(s in i)if(r=i[s],a=n[s],i.hasOwnProperty(s)&&(r!=null||a!=null))switch(s){case"value":h=r;break;case"defaultValue":d=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(It(91));break;default:r!==a&&xr(t,e,s,r,i,a)}q7(t,h,d);return;case"option":for(var g in n)if(h=n[g],n.hasOwnProperty(g)&&h!=null&&!i.hasOwnProperty(g))switch(g){case"selected":t.selected=!1;break;default:xr(t,e,g,null,i,h)}for(l in i)if(h=i[l],d=n[l],i.hasOwnProperty(l)&&h!==d&&(h!=null||d!=null))switch(l){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:xr(t,e,l,h,i,d)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!=null&&!i.hasOwnProperty(b)&&xr(t,e,b,null,i,h);for(c in i)if(h=i[c],d=n[c],i.hasOwnProperty(c)&&h!==d&&(h!=null||d!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(It(137,e));break;default:xr(t,e,c,h,i,d)}return;default:if(RN(e)){for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!==void 0&&!i.hasOwnProperty(y)&&dO(t,e,y,void 0,i,h);for(u in i)h=i[u],d=n[u],!i.hasOwnProperty(u)||h===d||h===void 0&&d===void 0||dO(t,e,u,h,i,d);return}}for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!i.hasOwnProperty(p)&&xr(t,e,p,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||xr(t,e,f,h,i,d)}var pO=null,mO=null;function e2(t){return t.nodeType===9?t:t.ownerDocument}function uB(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function JX(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function gO(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var I3=null;function Qse(){var t=window.event;return t&&t.type==="popstate"?t===I3?!1:(I3=t,!0):(I3=null,!1)}var $X=typeof setTimeout=="function"?setTimeout:void 0,eoe=typeof clearTimeout=="function"?clearTimeout:void 0,fB=typeof Promise=="function"?Promise:void 0,toe=typeof queueMicrotask=="function"?queueMicrotask:typeof fB<"u"?function(t){return fB.resolve(null).then(t).catch(noe)}:$X;function noe(t){setTimeout(function(){throw t})}function Jd(t){return t==="head"}function hB(t,e){var n=e,i=0,r=0;do{var a=n.nextSibling;if(t.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<i&&8>i){n=i;var s=t.ownerDocument;if(n&1&&$x(s.documentElement),n&2&&$x(s.body),n&4)for(n=s.head,$x(n),s=n.firstChild;s;){var o=s.nextSibling,l=s.nodeName;s[m_]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=o}}if(r===0){t.removeChild(a),N1(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);N1(e)}function bO(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":bO(n),CN(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function ioe(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[m_])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=gu(t.nextSibling),t===null)break}return null}function roe(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=gu(t.nextSibling),t===null))return null;return t}function vO(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function aoe(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function gu(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var yO=null;function dB(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function ZX(t,e,n){switch(e=e2(n),t){case"html":if(t=e.documentElement,!t)throw Error(It(452));return t;case"head":if(t=e.head,!t)throw Error(It(453));return t;case"body":if(t=e.body,!t)throw Error(It(454));return t;default:throw Error(It(451))}}function $x(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);CN(t)}var wc=new Map,pB=new Set;function t2(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var _h=ir.d;ir.d={f:soe,r:ooe,D:loe,C:coe,L:uoe,m:foe,X:doe,S:hoe,M:poe};function soe(){var t=_h.f(),e=YT();return t||e}function ooe(t){var e=Mv(t);e!==null&&e.tag===5&&e.type==="form"?WW(e):_h.r(t)}var Cv=typeof document>"u"?null:document;function QX(t,e,n){var i=Cv;if(i&&typeof e=="string"&&e){var r=fc(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),pB.has(r)||(pB.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),Os(e,"link",t),is(e),i.head.appendChild(e)))}}function loe(t){_h.D(t),QX("dns-prefetch",t,null)}function coe(t,e){_h.C(t,e),QX("preconnect",t,e)}function uoe(t,e,n){_h.L(t,e,n);var i=Cv;if(i&&t&&e){var r='link[rel="preload"][as="'+fc(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+fc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+fc(n.imageSizes)+'"]')):r+='[href="'+fc(t)+'"]';var a=r;switch(e){case"style":a=W0(t);break;case"script":a=Rv(t)}wc.has(a)||(t=Gr({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),wc.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(M_(a))||e==="script"&&i.querySelector(T_(a))||(e=i.createElement("link"),Os(e,"link",t),is(e),i.head.appendChild(e)))}}function foe(t,e){_h.m(t,e);var n=Cv;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+fc(i)+'"][href="'+fc(t)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Rv(t)}if(!wc.has(a)&&(t=Gr({rel:"modulepreload",href:t},e),wc.set(a,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(T_(a)))return}i=n.createElement("link"),Os(i,"link",t),is(i),n.head.appendChild(i)}}}function hoe(t,e,n){_h.S(t,e,n);var i=Cv;if(i&&t){var r=u0(i).hoistableStyles,a=W0(t);e=e||"default";var s=r.get(a);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(M_(a)))o.loading=5;else{t=Gr({rel:"stylesheet",href:t,"data-precedence":e},n),(n=wc.get(a))&&fL(t,n);var l=s=i.createElement("link");is(l),Os(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,nM(s,e,i)}s={type:"stylesheet",instance:s,count:1,state:o},r.set(a,s)}}}function doe(t,e){_h.X(t,e);var n=Cv;if(n&&t){var i=u0(n).hoistableScripts,r=Rv(t),a=i.get(r);a||(a=n.querySelector(T_(r)),a||(t=Gr({src:t,async:!0},e),(e=wc.get(r))&&hL(t,e),a=n.createElement("script"),is(a),Os(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function poe(t,e){_h.M(t,e);var n=Cv;if(n&&t){var i=u0(n).hoistableScripts,r=Rv(t),a=i.get(r);a||(a=n.querySelector(T_(r)),a||(t=Gr({src:t,async:!0,type:"module"},e),(e=wc.get(r))&&hL(t,e),a=n.createElement("script"),is(a),Os(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function mB(t,e,n,i){var r=(r=Cd.current)?t2(r):null;if(!r)throw Error(It(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=W0(n.href),n=u0(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=W0(n.href);var a=u0(r).hoistableStyles,s=a.get(t);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,s),(a=r.querySelector(M_(t)))&&!a._p&&(s.instance=a,s.state.loading=5),wc.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wc.set(t,n),a||moe(r,t,n,s.state))),e&&i===null)throw Error(It(528,""));return s}if(e&&i!==null)throw Error(It(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Rv(n),n=u0(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(It(444,t))}}function W0(t){return'href="'+fc(t)+'"'}function M_(t){return'link[rel="stylesheet"]['+t+"]"}function eq(t){return Gr({},t,{"data-precedence":t.precedence,precedence:null})}function moe(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),Os(e,"link",n),is(e),t.head.appendChild(e))}function Rv(t){return'[src="'+fc(t)+'"]'}function T_(t){return"script[async]"+t}function gB(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+fc(n.href)+'"]');if(i)return e.instance=i,is(i),i;var r=Gr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),is(i),Os(i,"style",r),nM(i,n.precedence,t),e.instance=i;case"stylesheet":r=W0(n.href);var a=t.querySelector(M_(r));if(a)return e.state.loading|=4,e.instance=a,is(a),a;i=eq(n),(r=wc.get(r))&&fL(i,r),a=(t.ownerDocument||t).createElement("link"),is(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),Os(a,"link",i),e.state.loading|=4,nM(a,n.precedence,t),e.instance=a;case"script":return a=Rv(n.src),(r=t.querySelector(T_(a)))?(e.instance=r,is(r),r):(i=n,(r=wc.get(a))&&(i=Gr({},n),hL(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),is(r),Os(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(It(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(i=e.instance,e.state.loading|=4,nM(i,n.precedence,t));return e.instance}function nM(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,s=0;s<i.length;s++){var o=i[s];if(o.dataset.precedence===e)a=o;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function fL(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function hL(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var iM=null;function bB(t,e,n){if(iM===null){var i=new Map,r=iM=new Map;r.set(n,i)}else r=iM,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[m_]||a[no]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(e)||"";s=t+s;var o=i.get(s);o?o.push(a):i.set(s,[a])}}return i}function vB(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function goe(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function tq(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var k1=null;function boe(){}function voe(t,e,n){if(k1===null)throw Error(It(475));var i=k1;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var r=W0(n.href),a=t.querySelector(M_(r));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=n2.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=a,is(a);return}a=t.ownerDocument||t,n=eq(n),(r=wc.get(r))&&fL(n,r),a=a.createElement("link"),is(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),Os(a,"link",n),e.instance=a}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&!(e.state.loading&3)&&(i.count++,e=n2.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function yoe(){if(k1===null)throw Error(It(475));var t=k1;return t.stylesheets&&t.count===0&&xO(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&xO(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function n2(){if(this.count--,this.count===0){if(this.stylesheets)xO(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var i2=null;function xO(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,i2=new Map,e.forEach(xoe,t),i2=null,n2.call(t))}function xoe(t,e){if(!(e.state.loading&4)){var n=i2.get(t);if(n)var i=n.get(null);else{n=new Map,i2.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var s=r[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}r=e.instance,s=r.getAttribute("data-precedence"),a=n.get(s)||i,a===i&&n.set(null,r),n.set(s,r),this.count++,i=n2.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var D1={$$typeof:qf,Provider:null,Consumer:null,_currentValue:wm,_currentValue2:wm,_threadCount:0};function _oe(t,e,n,i,r,a,s,o){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=t3(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=t3(0),this.hiddenUpdates=t3(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function nq(t,e,n,i,r,a,s,o,l,c,u,f){return t=new _oe(t,e,n,s,o,l,c,f),e=1,a===!0&&(e|=24),a=bl(3,null,null,e),t.current=a,a.stateNode=t,e=zN(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},HN(a),t}function iq(t){return t?(t=e0,t):e0}function rq(t,e,n,i,r,a){r=iq(r),i.context===null?i.context=r:i.pendingContext=r,i=Rd(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=kd(t,i,e),n!==null&&(El(n,t,e),Vx(n,t,e))}function yB(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function dL(t,e){yB(t,e),(t=t.alternate)&&yB(t,e)}function aq(t){if(t.tag===13){var e=Tv(t,67108864);e!==null&&El(e,t,67108864),dL(t,67108864)}}var r2=!0;function Soe(t,e,n,i){var r=Bn.T;Bn.T=null;var a=ir.p;try{ir.p=2,pL(t,e,n,i)}finally{ir.p=a,Bn.T=r}}function woe(t,e,n,i){var r=Bn.T;Bn.T=null;var a=ir.p;try{ir.p=8,pL(t,e,n,i)}finally{ir.p=a,Bn.T=r}}function pL(t,e,n,i){if(r2){var r=_O(i);if(r===null)O3(t,e,i,a2,n),xB(t,i);else if(Moe(r,t,e,n,i))i.stopPropagation();else if(xB(t,i),e&4&&-1<Eoe.indexOf(t)){for(;r!==null;){var a=Mv(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=Kp(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-Sl(s);o.entanglements[1]|=l,s&=~l}gf(a),!(gr&6)&&(YM=Qu()+500,E_(0))}}break;case 13:o=Tv(a,2),o!==null&&El(o,a,2),YT(),dL(a,2)}if(a=_O(i),a===null&&O3(t,e,i,a2,n),a===r)break;r=a}r!==null&&i.stopPropagation()}else O3(t,e,i,null,n)}}function _O(t){return t=kN(t),mL(t)}var a2=null;function mL(t){if(a2=null,t=Kb(t),t!==null){var e=f_(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=k7(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return a2=t,null}function sq(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(cae()){case N7:return 2;case L7:return 8;case IM:case uae:return 32;case P7:return 268435456;default:return 32}default:return 32}}var SO=!1,Id=null,Nd=null,Ld=null,O1=new Map,I1=new Map,gd=[],Eoe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function xB(t,e){switch(t){case"focusin":case"focusout":Id=null;break;case"dragenter":case"dragleave":Nd=null;break;case"mouseover":case"mouseout":Ld=null;break;case"pointerover":case"pointerout":O1.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":I1.delete(e.pointerId)}}function Ny(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=Mv(e),e!==null&&aq(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Moe(t,e,n,i,r){switch(e){case"focusin":return Id=Ny(Id,t,e,n,i,r),!0;case"dragenter":return Nd=Ny(Nd,t,e,n,i,r),!0;case"mouseover":return Ld=Ny(Ld,t,e,n,i,r),!0;case"pointerover":var a=r.pointerId;return O1.set(a,Ny(O1.get(a)||null,t,e,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,I1.set(a,Ny(I1.get(a)||null,t,e,n,i,r)),!0}return!1}function oq(t){var e=Kb(t.target);if(e!==null){var n=f_(e);if(n!==null){if(e=n.tag,e===13){if(e=k7(n),e!==null){t.blockedOn=e,vae(t.priority,function(){if(n.tag===13){var i=wl();i=TN(i);var r=Tv(n,i);r!==null&&El(r,n,i),dL(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function rM(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=_O(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);B8=i,n.target.dispatchEvent(i),B8=null}else return e=Mv(n),e!==null&&aq(e),t.blockedOn=n,!1;e.shift()}return!0}function _B(t,e,n){rM(t)&&n.delete(e)}function Toe(){SO=!1,Id!==null&&rM(Id)&&(Id=null),Nd!==null&&rM(Nd)&&(Nd=null),Ld!==null&&rM(Ld)&&(Ld=null),O1.forEach(_B),I1.forEach(_B)}function YS(t,e){t.blockedOn===e&&(t.blockedOn=null,SO||(SO=!0,za.unstable_scheduleCallback(za.unstable_NormalPriority,Toe)))}var JS=null;function SB(t){JS!==t&&(JS=t,za.unstable_scheduleCallback(za.unstable_NormalPriority,function(){JS===t&&(JS=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(mL(i||n)===null)continue;break}var a=Mv(n);a!==null&&(t.splice(e,3),e-=3,tO(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function N1(t){function e(l){return YS(l,t)}Id!==null&&YS(Id,t),Nd!==null&&YS(Nd,t),Ld!==null&&YS(Ld,t),O1.forEach(e),I1.forEach(e);for(var n=0;n<gd.length;n++){var i=gd[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<gd.length&&(n=gd[0],n.blockedOn===null);)oq(n),n.blockedOn===null&&gd.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],s=r[Go]||null;if(typeof a=="function")s||SB(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[Go]||null)o=s.formAction;else if(mL(r)!==null)continue}else o=s.action;typeof o=="function"?n[i+1]=o:(n.splice(i,3),i-=3),SB(n)}}}function gL(t){this._internalRoot=t}QT.prototype.render=gL.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(It(409));var n=e.current,i=wl();rq(n,i,t,e,null,null)};QT.prototype.unmount=gL.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;rq(t.current,2,null,t,null,null),YT(),e[Ev]=null}};function QT(t){this._internalRoot=t}QT.prototype.unstable_scheduleHydration=function(t){if(t){var e=j7();t={blockedOn:null,target:t,priority:e};for(var n=0;n<gd.length&&e!==0&&e<gd[n].priority;n++);gd.splice(n,0,t),n===0&&oq(t)}};var wB=C7.version;if(wB!=="19.1.1")throw Error(It(527,wB,"19.1.1"));ir.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(It(188)):(t=Object.keys(t).join(","),Error(It(268,t)));return t=nae(e),t=t!==null?D7(t):null,t=t===null?null:t.stateNode,t};var Aoe={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Bn,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $S=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$S.isDisabled&&$S.supportsFiber)try{h_=$S.inject(Aoe),_l=$S}catch{}}UT.createRoot=function(t,e){if(!R7(t))throw Error(It(299));var n=!1,i="",r=nX,a=iX,s=rX,o=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(s=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(o=e.unstable_transitionCallbacks)),e=nq(t,1,!1,null,null,n,i,r,a,s,o,null),t[Ev]=e.current,uL(t),new gL(e)};UT.hydrateRoot=function(t,e,n){if(!R7(t))throw Error(It(299));var i=!1,r="",a=nX,s=iX,o=rX,l=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=nq(t,1,!0,e,n??null,i,r,a,s,o,l,c),e.context=iq(null),n=e.current,i=wl(),i=TN(i),r=Rd(i),r.callback=null,kd(n,r,i),n=i,e.current.lanes=n,p_(e,n),gf(e),t[Ev]=e.current,uL(t),new QT(e)};UT.version="19.1.1";function lq(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lq)}catch(t){console.error(t)}}lq(),p7.exports=UT;var cq=p7.exports;const Coe=Rc(cq);var wO=new Map,ZS=new WeakMap,EB=0,Roe=void 0;function koe(t){return t?(ZS.has(t)||(EB+=1,ZS.set(t,EB.toString())),ZS.get(t)):"0"}function Doe(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?koe(t.root):t[e]}`).toString()}function Ooe(t){const e=Doe(t);let n=wO.get(e);if(!n){const i=new Map;let r;const a=new IntersectionObserver(s=>{s.forEach(o=>{var l;const c=o.isIntersecting&&r.some(u=>o.intersectionRatio>=u);t.trackVisibility&&typeof o.isVisible>"u"&&(o.isVisible=c),(l=i.get(o.target))==null||l.forEach(u=>{u(c,o)})})},t);r=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:i},wO.set(e,n)}return n}function Ioe(t,e,n={},i=Roe){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const l=t.getBoundingClientRect();return e(i,{isIntersecting:i,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:r,observer:a,elements:s}=Ooe(n),o=s.get(t)||[];return s.has(t)||s.set(t,o),o.push(e),a.observe(t),function(){o.splice(o.indexOf(e),1),o.length===0&&(s.delete(t),a.unobserve(t)),s.size===0&&(a.disconnect(),wO.delete(r))}}function Noe({threshold:t,delay:e,trackVisibility:n,rootMargin:i,root:r,triggerOnce:a,skip:s,initialInView:o,fallbackInView:l,onChange:c}={}){var u;const[f,h]=I.useState(null),d=I.useRef(c),[g,b]=I.useState({inView:!!o,entry:void 0});d.current=c,I.useEffect(()=>{if(s||!f)return;let _;return _=Ioe(f,(w,M)=>{b({inView:w,entry:M}),d.current&&d.current(w,M),M.isIntersecting&&a&&_&&(_(),_=void 0)},{root:r,rootMargin:i,threshold:t,trackVisibility:n,delay:e},l),()=>{_&&_()}},[Array.isArray(t)?t.toString():t,f,r,i,a,s,n,l,e]);const y=(u=g.entry)==null?void 0:u.target,p=I.useRef(void 0);!f&&y&&!a&&!s&&p.current!==y&&(p.current=y,b({inView:!!o,entry:void 0}));const x=[h,g.inView,g.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}function gc(t,e,n){return e===void 0&&n===void 0?t:e!==void 0&&n===void 0?Math.max(t,e):Math.min(e===void 0&&n!==void 0?t:Math.max(t,e),n)}function s2(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function Loe(t,e){if(t===e||Number.isNaN(t)&&Number.isNaN(e))return!0;if(!(t instanceof Object)||!(e instanceof Object))return!1;const n=Object.keys(t),{length:i}=n;if(i!==Object.keys(e).length)return!1;for(let r=0;r<i;r+=1){const a=n[r];if(!(a in e)||t[a]!==e[a]&&!(Number.isNaN(t[a])&&Number.isNaN(e[a])))return!1}return!0}function im(t){const e=I.useRef(t);return I.useEffect(()=>{e.current=t}),I.useMemo(()=>(...n)=>e.current?.(...n),[])}function eA(t,e){const{delay:n,flushOnUnmount:i,leading:r}=typeof e=="number"?{delay:e,flushOnUnmount:!1,leading:!1}:e,a=im(t),s=I.useRef(0),o=I.useMemo(()=>{const l=Object.assign((...c)=>{window.clearTimeout(s.current);const u=l._isFirstCall;l._isFirstCall=!1;function f(){window.clearTimeout(s.current),s.current=0,l._isFirstCall=!0}if(r&&u){a(...c);const g=()=>{f()},b=()=>{s.current!==0&&(f(),a(...c))},y=()=>{f()};l.flush=b,l.cancel=y,s.current=window.setTimeout(g,n);return}if(r&&!u){const g=()=>{s.current!==0&&(f(),a(...c))},b=()=>{f()};l.flush=g,l.cancel=b;const y=()=>{f()};s.current=window.setTimeout(y,n);return}const h=()=>{s.current!==0&&(f(),a(...c))},d=()=>{f()};l.flush=h,l.cancel=d,s.current=window.setTimeout(h,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return l},[a,n,r]);return I.useEffect(()=>()=>{i?o.flush():o.cancel()},[o,i]),o}const Poe=["mousedown","touchstart"];function Uoe(t,e,n){const i=I.useRef(null),r=e||Poe;return I.useEffect(()=>{const a=s=>{const{target:o}=s??{};if(Array.isArray(n)){const l=!document.body.contains(o)&&o?.tagName!=="HTML";n.every(u=>!!u&&!s.composedPath().includes(u))&&!l&&t(s)}else i.current&&!i.current.contains(o)&&t(s)};return r.forEach(s=>document.addEventListener(s,a)),()=>{r.forEach(s=>document.removeEventListener(s,a))}},[i,t,n]),i}function Foe(t={timeout:2e3}){const[e,n]=I.useState(null),[i,r]=I.useState(!1),[a,s]=I.useState(null),o=u=>{window.clearTimeout(a),s(window.setTimeout(()=>r(!1),t.timeout)),r(u)};return{copy:u=>{"clipboard"in navigator?navigator.clipboard.writeText(u).then(()=>o(!0)).catch(f=>n(f)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{r(!1),n(null),window.clearTimeout(a)},error:e,copied:i}}function Boe(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function zoe(t,e){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function bL(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[i,r]=I.useState(n?e:zoe(t));return I.useEffect(()=>{try{const a=window.matchMedia(t);return r(a.matches),Boe(a,s=>r(s.matches))}catch{return}},[t]),i||!1}function joe(t,e){return bL("(prefers-color-scheme: dark)",t==="dark",e)?"dark":"light"}const kv=typeof document<"u"?I.useLayoutEffect:I.useEffect;function _c(t,e){const n=I.useRef(!1);I.useEffect(()=>()=>{n.current=!1},[]),I.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function uq({opened:t,shouldReturnFocus:e=!0}){const n=I.useRef(null),i=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return _c(()=>{let r=-1;const a=s=>{s.key==="Tab"&&window.clearTimeout(r)};return document.addEventListener("keydown",a),t?n.current=document.activeElement:e&&(r=window.setTimeout(i,10)),()=>{window.clearTimeout(r),document.removeEventListener("keydown",a)}},[t,e]),i}const Hoe=/input|select|textarea|button|object/,fq="a, input, select, textarea, button, object, [tabindex]";function Voe(t){return t.style.display==="none"}function Goe(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let n=t;for(;n&&!(n===document.body||n.nodeType===11);){if(Voe(n))return!1;n=n.parentNode}return!0}function hq(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function EO(t){const e=t.nodeName.toLowerCase(),n=!Number.isNaN(hq(t));return(Hoe.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&Goe(t)}function dq(t){const e=hq(t);return(Number.isNaN(e)||e>=0)&&EO(t)}function Woe(t){return Array.from(t.querySelectorAll(fq)).filter(dq)}function Xoe(t,e){const n=Woe(t);if(!n.length){e.preventDefault();return}const i=n[e.shiftKey?0:n.length-1],r=t.getRootNode();let a=i===r.activeElement||t===r.activeElement;const s=r.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(a=n.filter(u=>u.getAttribute("type")==="radio"&&u.getAttribute("name")===s.getAttribute("name")).includes(i)),!a)return;e.preventDefault();const l=n[e.shiftKey?n.length-1:0];l&&l.focus()}function qoe(t=!0){const e=I.useRef(null),n=r=>{let a=r.querySelector("[data-autofocus]");if(!a){const s=Array.from(r.querySelectorAll(fq));a=s.find(dq)||s.find(EO)||null,!a&&EO(r)&&(a=r)}a&&a.focus({preventScroll:!0})},i=I.useCallback(r=>{t&&r!==null&&e.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),e.current=r):e.current=null)},[t]);return I.useEffect(()=>{if(!t)return;e.current&&setTimeout(()=>n(e.current));const r=a=>{a.key==="Tab"&&e.current&&Xoe(e.current,a)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t]),i}const Koe=t=>(t+1)%1e6;function Yoe(){const[,t]=I.useReducer(Koe,0);return t}const Joe=Ee.useId||(()=>{});function $oe(){const t=Joe();return t?`mantine-${t.replace(/:/g,"")}`:""}function Eu(t){const e=$oe(),[n,i]=I.useState(e);return kv(()=>{i(s2())},[]),typeof t=="string"?t:typeof window>"u"?e:n}function Zoe(t,e,n){I.useEffect(()=>(window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)),[t,e])}function o2(t,e){if(typeof t=="function")return t(e);typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function pq(...t){const e=new Map;return n=>{if(t.forEach(i=>{const r=o2(i,n);r&&e.set(i,r)}),e.size>0)return()=>{t.forEach(i=>{const r=e.get(i);r&&typeof r=="function"?r():o2(i,null)}),e.clear()}}}function Va(...t){return I.useCallback(pq(...t),t)}function mq(t){return{x:gc(t.x,0,1),y:gc(t.y,0,1)}}function vL(t,e,n="ltr"){const i=I.useRef(!1),r=I.useRef(!1),a=I.useRef(0),[s,o]=I.useState(!1),l=I.useRef(null);return I.useEffect(()=>{i.current=!0},[]),{ref:I.useCallback(u=>{if(l.current&&(l.current(),l.current=null),!u)return;const f=({x:w,y:M})=>{cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{if(i.current&&u){u.style.userSelect="none";const S=u.getBoundingClientRect();if(S.width&&S.height){const A=gc((w-S.left)/S.width,0,1);t({x:n==="ltr"?A:1-A,y:gc((M-S.top)/S.height,0,1)})}}})},h=()=>{document.addEventListener("mousemove",p),document.addEventListener("mouseup",b),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("touchend",b)},d=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",b)},g=()=>{!r.current&&i.current&&(r.current=!0,typeof e?.onScrubStart=="function"&&e.onScrubStart(),o(!0),h())},b=()=>{r.current&&i.current&&(r.current=!1,o(!1),d(),setTimeout(()=>{typeof e?.onScrubEnd=="function"&&e.onScrubEnd()},0))},y=w=>{g(),w.preventDefault(),p(w)},p=w=>f({x:w.clientX,y:w.clientY}),x=w=>{w.cancelable&&w.preventDefault(),g(),_(w)},_=w=>{w.cancelable&&w.preventDefault(),f({x:w.changedTouches[0].clientX,y:w.changedTouches[0].clientY})};u.addEventListener("mousedown",y),u.addEventListener("touchstart",x,{passive:!1}),l.current=()=>{u.removeEventListener("mousedown",y),u.removeEventListener("touchstart",x)}},[n,t]),active:s}}function Wo({value:t,defaultValue:e,finalValue:n,onChange:i=()=>{}}){const[r,a]=I.useState(e!==void 0?e:n),s=(o,...l)=>{a(o),i?.(o,...l)};return t!==void 0?[t,i,!0]:[r,s,!1]}function tA(t,e){return bL("(prefers-reduced-motion: reduce)",t,e)}const Qoe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function gq(t){const e=I.useRef(0),n=I.useRef(null),[i,r]=I.useState(Qoe),a=I.useMemo(()=>typeof window<"u"?new ResizeObserver(s=>{const o=s[0];o&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{if(n.current){const l=o.borderBoxSize?.[0]||o.contentBoxSize?.[0];if(l){const c=l.inlineSize,u=l.blockSize;r({width:c,height:u,x:o.contentRect.x,y:o.contentRect.y,top:o.contentRect.top,left:o.contentRect.left,bottom:o.contentRect.bottom,right:o.contentRect.right})}else r(o.contentRect)}}))}):null,[]);return I.useEffect(()=>(n.current&&a?.observe(n.current,t),()=>{a?.disconnect(),e.current&&cancelAnimationFrame(e.current)}),[n.current]),[n,i]}function bq(t){const[e,{width:n,height:i}]=gq(t);return{ref:e,width:n,height:i}}function ele(t,e){if(!t||!e)return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(!Loe(t[n],e[n]))return!1;return!0}function tle(t){const e=I.useRef([]),n=I.useRef(0);return ele(e.current,t)||(e.current=t,n.current+=1),[n.current]}function nle(t,e){I.useEffect(t,tle(e))}function Ec(t=!1,e={}){const[n,i]=I.useState(t),r=I.useCallback(()=>{i(o=>o||(e.onOpen?.(),!0))},[e.onOpen]),a=I.useCallback(()=>{i(o=>o&&(e.onClose?.(),!1))},[e.onClose]),s=I.useCallback(()=>{n?a():r()},[a,r,n]);return[n,{open:r,close:a,toggle:s}]}function ile(t,e,n={autoInvoke:!1}){const i=I.useRef(null),r=I.useCallback((...s)=>{i.current||(i.current=window.setTimeout(()=>{t(s),i.current=null},e))},[e]),a=I.useCallback(()=>{i.current&&(window.clearTimeout(i.current),i.current=null)},[]);return I.useEffect(()=>(n.autoInvoke&&r(),a),[a,r]),{start:r,clear:a}}function rle(t){const e=I.useRef(void 0);return I.useEffect(()=>{e.current=t},[t]),e.current}function ale(){const[t,e]=I.useState(!1);kv(()=>{e(typeof window<"u"&&!sle()&&"EyeDropper"in window)},[]);const n=I.useCallback((i={})=>t?new window.EyeDropper().open(i):Promise.resolve(void 0),[t]);return{supported:t,open:n}}function sle(){return navigator.userAgent.includes("OPR")}function ole(t,e,n){const i=I.useRef(null),r=I.useRef(null);return I.useEffect(()=>{const a=typeof n=="function"?n():n;return(a||r.current)&&(i.current=new MutationObserver(t),i.current.observe(a||r.current,e)),()=>{i.current?.disconnect()}},[t,e]),r}function lle(){const[t,e]=I.useState(!1);return I.useEffect(()=>e(!0),[]),t}function cle(t){let e=t,n=!1;const i=new Set;return{getState(){return e},updateState(r){e=typeof r=="function"?r(e):r},setState(r){this.updateState(r),i.forEach(a=>a(e))},initialize(r){n||(e=r,n=!0)},subscribe(r){return i.add(r),()=>i.delete(r)}}}function ule(t){return I.useSyncExternalStore(t.subscribe,()=>t.getState(),()=>t.getState())}function fle(t,e,n){const i=[],r=[],a={};for(const s of t){const o=s.position||e;a[o]=a[o]||0,a[o]+=1,a[o]<=n?r.push(s):i.push(s)}return{notifications:r,queue:i}}const hle=()=>cle({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),og=hle(),dle=(t=og)=>ule(t);function Dv(t,e){const n=t.getState(),i=e([...n.notifications,...n.queue]),r=fle(i,n.defaultPosition,n.limit);t.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function ple(t,e=og){const n=t.id||s2();return Dv(e,i=>t.id&&i.some(r=>r.id===t.id)?i:[...i,{...t,id:n}]),n}function vq(t,e=og){return Dv(e,n=>n.filter(i=>i.id===t?(i.onClose?.(i),!1):!0)),t}function mle(t,e=og){return Dv(e,n=>n.map(i=>i.id===t.id?{...i,...t}:i)),t.id}function gle(t=og){Dv(t,()=>[])}function ble(t=og){Dv(t,e=>e.slice(0,t.getState().limit))}const Is={show:ple,hide:vq,update:mle,clean:gle,cleanQueue:ble,updateState:Dv};function Ls(){return Ls=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ls.apply(null,arguments)}function yL(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}function MO(t,e){return MO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},MO(t,e)}function yq(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,MO(t,e)}var xq={exports:{}},vle="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",yle=vle,xle=yle;function _q(){}function Sq(){}Sq.resetWarningCache=_q;var _le=function(){function t(i,r,a,s,o,l){if(l!==xle){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Sq,resetWarningCache:_q};return n.PropTypes=n,n};xq.exports=_le();var wq=xq.exports;const MB={disabled:!1},l2=Ee.createContext(null);var Sle=function(e){return e.scrollTop},Mx="unmounted",$p="exited",Zp="entering",jb="entered",TO="exiting",Sh=function(t){yq(e,t);function e(i,r){var a;a=t.call(this,i,r)||this;var s=r,o=s&&!s.isMounting?i.enter:i.appear,l;return a.appearStatus=null,i.in?o?(l=$p,a.appearStatus=Zp):l=jb:i.unmountOnExit||i.mountOnEnter?l=Mx:l=$p,a.state={status:l},a.nextCallback=null,a}e.getDerivedStateFromProps=function(r,a){var s=r.in;return s&&a.status===Mx?{status:$p}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var a=null;if(r!==this.props){var s=this.state.status;this.props.in?s!==Zp&&s!==jb&&(a=Zp):(s===Zp||s===jb)&&(a=TO)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,a,s,o;return a=s=o=r,r!=null&&typeof r!="number"&&(a=r.exit,s=r.enter,o=r.appear!==void 0?r.appear:s),{exit:a,enter:s,appear:o}},n.updateStatus=function(r,a){if(r===void 0&&(r=!1),a!==null)if(this.cancelNextCallback(),a===Zp){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:xx.findDOMNode(this);s&&Sle(s)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===$p&&this.setState({status:Mx})},n.performEnter=function(r){var a=this,s=this.props.enter,o=this.context?this.context.isMounting:r,l=this.props.nodeRef?[o]:[xx.findDOMNode(this),o],c=l[0],u=l[1],f=this.getTimeouts(),h=o?f.appear:f.enter;if(!r&&!s||MB.disabled){this.safeSetState({status:jb},function(){a.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Zp},function(){a.props.onEntering(c,u),a.onTransitionEnd(h,function(){a.safeSetState({status:jb},function(){a.props.onEntered(c,u)})})})},n.performExit=function(){var r=this,a=this.props.exit,s=this.getTimeouts(),o=this.props.nodeRef?void 0:xx.findDOMNode(this);if(!a||MB.disabled){this.safeSetState({status:$p},function(){r.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:TO},function(){r.props.onExiting(o),r.onTransitionEnd(s.exit,function(){r.safeSetState({status:$p},function(){r.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,a){a=this.setNextCallback(a),this.setState(r,a)},n.setNextCallback=function(r){var a=this,s=!0;return this.nextCallback=function(o){s&&(s=!1,a.nextCallback=null,r(o))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(r,a){this.setNextCallback(a);var s=this.props.nodeRef?this.props.nodeRef.current:xx.findDOMNode(this),o=r==null&&!this.props.addEndListener;if(!s||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===Mx)return null;var a=this.props,s=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var o=yL(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ee.createElement(l2.Provider,{value:null},typeof s=="function"?s(r,o):Ee.cloneElement(Ee.Children.only(s),o))},e}(Ee.Component);Sh.contextType=l2;Sh.propTypes={};function Wg(){}Sh.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Wg,onEntering:Wg,onEntered:Wg,onExit:Wg,onExiting:Wg,onExited:Wg};Sh.UNMOUNTED=Mx;Sh.EXITED=$p;Sh.ENTERING=Zp;Sh.ENTERED=jb;Sh.EXITING=TO;function wle(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xL(t,e){var n=function(a){return e&&I.isValidElement(a)?e(a):a},i=Object.create(null);return t&&I.Children.map(t,function(r){return r}).forEach(function(r){i[r.key]=n(r)}),i}function Ele(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var i=Object.create(null),r=[];for(var a in t)a in e?r.length&&(i[a]=r,r=[]):r.push(a);var s,o={};for(var l in e){if(i[l])for(s=0;s<i[l].length;s++){var c=i[l][s];o[i[l][s]]=n(c)}o[l]=n(l)}for(s=0;s<r.length;s++)o[r[s]]=n(r[s]);return o}function lm(t,e,n){return n[e]!=null?n[e]:t.props[e]}function Mle(t,e){return xL(t.children,function(n){return I.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:lm(n,"appear",t),enter:lm(n,"enter",t),exit:lm(n,"exit",t)})})}function Tle(t,e,n){var i=xL(t.children),r=Ele(e,i);return Object.keys(r).forEach(function(a){var s=r[a];if(I.isValidElement(s)){var o=a in e,l=a in i,c=e[a],u=I.isValidElement(c)&&!c.props.in;l&&(!o||u)?r[a]=I.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:lm(s,"exit",t),enter:lm(s,"enter",t)}):!l&&o&&!u?r[a]=I.cloneElement(s,{in:!1}):l&&o&&I.isValidElement(c)&&(r[a]=I.cloneElement(s,{onExited:n.bind(null,s),in:c.props.in,exit:lm(s,"exit",t),enter:lm(s,"enter",t)}))}}),r}var Ale=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},Cle={component:"div",childFactory:function(e){return e}},cd=function(t){yq(e,t);function e(i,r){var a;a=t.call(this,i,r)||this;var s=a.handleExited.bind(wle(a));return a.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},a}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(r,a){var s=a.children,o=a.handleExited,l=a.firstRender;return{children:l?Mle(r,o):Tle(r,s,o),firstRender:!1}},n.handleExited=function(r,a){var s=xL(this.props.children);r.key in s||(r.props.onExited&&r.props.onExited(a),this.mounted&&this.setState(function(o){var l=Ls({},o.children);return delete l[r.key],{children:l}}))},n.render=function(){var r=this.props,a=r.component,s=r.childFactory,o=yL(r,["component","childFactory"]),l=this.state.contextValue,c=Ale(this.state.children).map(s);return delete o.appear,delete o.enter,delete o.exit,a===null?Ee.createElement(l2.Provider,{value:l},c):Ee.createElement(l2.Provider,{value:l},Ee.createElement(a,o,c))},e}(Ee.Component);cd.propTypes={};cd.defaultProps=Cle;var Wu=function(){return Wu=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Wu.apply(this,arguments)};function Eq(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function Rle(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,a;i<r;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}var aM="right-scroll-bar-position",sM="width-before-scroll-bar",kle="with-scroll-bars-hidden",Dle="--removed-body-scroll-bar-size";function N3(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Ole(t,e){var n=I.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var Ile=typeof window<"u"?I.useLayoutEffect:I.useEffect,TB=new WeakMap;function Nle(t,e){var n=Ole(null,function(i){return t.forEach(function(r){return N3(r,i)})});return Ile(function(){var i=TB.get(n);if(i){var r=new Set(i),a=new Set(t),s=n.current;r.forEach(function(o){a.has(o)||N3(o,null)}),a.forEach(function(o){r.has(o)||N3(o,s)})}TB.set(n,t)},[t]),n}function Lle(t){return t}function Ple(t,e){e===void 0&&(e=Lle);var n=[],i=!1,r={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(a){var s=e(a,i);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(i=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){i=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var l=function(){var u=s;s=[],u.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return r}function Ule(t){t===void 0&&(t={});var e=Ple(null);return e.options=Wu({async:!0,ssr:!1},t),e}var Mq=function(t){var e=t.sideCar,n=Eq(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return I.createElement(i,Wu({},n))};Mq.isSideCarExport=!0;function Fle(t,e){return t.useMedium(e),Mq}var Tq=Ule(),L3=function(){},nA=I.forwardRef(function(t,e){var n=I.useRef(null),i=I.useState({onScrollCapture:L3,onWheelCapture:L3,onTouchMoveCapture:L3}),r=i[0],a=i[1],s=t.forwardProps,o=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,d=t.noRelative,g=t.noIsolation,b=t.inert,y=t.allowPinchZoom,p=t.as,x=p===void 0?"div":p,_=t.gapMode,w=Eq(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=h,S=Nle([n,e]),A=Wu(Wu({},w),r);return I.createElement(I.Fragment,null,u&&I.createElement(M,{sideCar:Tq,removeScrollBar:c,shards:f,noRelative:d,noIsolation:g,inert:b,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:_}),s?I.cloneElement(I.Children.only(o),Wu(Wu({},A),{ref:S})):I.createElement(x,Wu({},A,{className:l,ref:S}),o))});nA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nA.classNames={fullWidth:sM,zeroRight:aM};var Ble=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zle(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Ble();return e&&t.setAttribute("nonce",e),t}function jle(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Hle(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Vle=function(){var t=0,e=null;return{add:function(n){t==0&&(e=zle())&&(jle(e,n),Hle(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Gle=function(){var t=Vle();return function(e,n){I.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Aq=function(){var t=Gle(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},Wle={left:0,top:0,right:0,gap:0},P3=function(t){return parseInt(t||"",10)||0},Xle=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[P3(n),P3(i),P3(r)]},qle=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Wle;var e=Xle(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},Kle=Aq(),v0="data-scroll-locked",Yle=function(t,e,n,i){var r=t.left,a=t.top,s=t.right,o=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(kle,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(o,"px ").concat(i,`;
  }
  body[`).concat(v0,`] {
    overflow: hidden `).concat(i,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(i,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(i,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(aM,` {
    right: `).concat(o,"px ").concat(i,`;
  }
  
  .`).concat(sM,` {
    margin-right: `).concat(o,"px ").concat(i,`;
  }
  
  .`).concat(aM," .").concat(aM,` {
    right: 0 `).concat(i,`;
  }
  
  .`).concat(sM," .").concat(sM,` {
    margin-right: 0 `).concat(i,`;
  }
  
  body[`).concat(v0,`] {
    `).concat(Dle,": ").concat(o,`px;
  }
`)},AB=function(){var t=parseInt(document.body.getAttribute(v0)||"0",10);return isFinite(t)?t:0},Jle=function(){I.useEffect(function(){return document.body.setAttribute(v0,(AB()+1).toString()),function(){var t=AB()-1;t<=0?document.body.removeAttribute(v0):document.body.setAttribute(v0,t.toString())}},[])},$le=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;Jle();var a=I.useMemo(function(){return qle(r)},[r]);return I.createElement(Kle,{styles:Yle(a,!e,r,n?"":"!important")})},AO=!1;if(typeof window<"u")try{var QS=Object.defineProperty({},"passive",{get:function(){return AO=!0,!0}});window.addEventListener("test",QS,QS),window.removeEventListener("test",QS,QS)}catch{AO=!1}var Xg=AO?{passive:!1}:!1,Zle=function(t){return t.tagName==="TEXTAREA"},Cq=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zle(t)&&n[e]==="visible")},Qle=function(t){return Cq(t,"overflowY")},ece=function(t){return Cq(t,"overflowX")},CB=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=Rq(t,i);if(r){var a=kq(t,i),s=a[1],o=a[2];if(s>o)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},tce=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},nce=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},Rq=function(t,e){return t==="v"?Qle(e):ece(e)},kq=function(t,e){return t==="v"?tce(e):nce(e)},ice=function(t,e){return t==="h"&&e==="rtl"?-1:1},rce=function(t,e,n,i,r){var a=ice(t,window.getComputedStyle(e).direction),s=a*i,o=n.target,l=e.contains(o),c=!1,u=s>0,f=0,h=0;do{if(!o)break;var d=kq(t,o),g=d[0],b=d[1],y=d[2],p=b-y-a*g;(g||p)&&Rq(t,o)&&(f+=p,h+=g);var x=o.parentNode;o=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(c=!0),c},ew=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},RB=function(t){return[t.deltaX,t.deltaY]},kB=function(t){return t&&"current"in t?t.current:t},ace=function(t,e){return t[0]===e[0]&&t[1]===e[1]},sce=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},oce=0,qg=[];function lce(t){var e=I.useRef([]),n=I.useRef([0,0]),i=I.useRef(),r=I.useState(oce++)[0],a=I.useState(Aq)[0],s=I.useRef(t);I.useEffect(function(){s.current=t},[t]),I.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Rle([t.lockRef.current],(t.shards||[]).map(kB),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var o=I.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var p=ew(b),x=n.current,_="deltaX"in b?b.deltaX:x[0]-p[0],w="deltaY"in b?b.deltaY:x[1]-p[1],M,S=b.target,A=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in b&&A==="h"&&S.type==="range")return!1;var C=CB(A,S);if(!C)return!0;if(C?M=A:(M=A==="v"?"h":"v",C=CB(A,S)),!C)return!1;if(!i.current&&"changedTouches"in b&&(_||w)&&(i.current=M),!M)return!0;var k=i.current||M;return rce(k,y,b,k==="h"?_:w)},[]),l=I.useCallback(function(b){var y=b;if(!(!qg.length||qg[qg.length-1]!==a)){var p="deltaY"in y?RB(y):ew(y),x=e.current.filter(function(M){return M.name===y.type&&(M.target===y.target||y.target===M.shadowParent)&&ace(M.delta,p)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var _=(s.current.shards||[]).map(kB).filter(Boolean).filter(function(M){return M.contains(y.target)}),w=_.length>0?o(y,_[0]):!s.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),c=I.useCallback(function(b,y,p,x){var _={name:b,delta:y,target:p,should:x,shadowParent:cce(p)};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(w){return w!==_})},1)},[]),u=I.useCallback(function(b){n.current=ew(b),i.current=void 0},[]),f=I.useCallback(function(b){c(b.type,RB(b),b.target,o(b,t.lockRef.current))},[]),h=I.useCallback(function(b){c(b.type,ew(b),b.target,o(b,t.lockRef.current))},[]);I.useEffect(function(){return qg.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Xg),document.addEventListener("touchmove",l,Xg),document.addEventListener("touchstart",u,Xg),function(){qg=qg.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,Xg),document.removeEventListener("touchmove",l,Xg),document.removeEventListener("touchstart",u,Xg)}},[]);var d=t.removeScrollBar,g=t.inert;return I.createElement(I.Fragment,null,g?I.createElement(a,{styles:sce(r)}):null,d?I.createElement($le,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function cce(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const uce=Fle(Tq,lce);var c2=I.forwardRef(function(t,e){return I.createElement(nA,Wu({},t,{ref:e,sideCar:uce}))});c2.classNames=nA.classNames;function tf(t){return Object.keys(t)}function U3(t){return t&&typeof t=="object"&&!Array.isArray(t)}function _L(t,e){const n={...t},i=e;return U3(t)&&U3(e)&&Object.keys(e).forEach(r=>{U3(i[r])&&r in t?n[r]=_L(n[r],i[r]):n[r]=i[r]}),n}function fce(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function hce(t){return typeof t!="string"||!t.includes("var(--mantine-scale)")?t:t.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function dce(t){const e=hce(t);return typeof e=="number"?e:typeof e=="string"?e.includes("calc")||e.includes("var")?e:e.includes("px")?Number(e.replace("px","")):e.includes("rem")?Number(e.replace("rem",""))*16:e.includes("em")?Number(e.replace("em",""))*16:Number(e):NaN}function DB(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function Dq(t,{shouldScale:e=!1}={}){function n(i){if(i===0||i==="0")return`0${t}`;if(typeof i=="number"){const r=`${i/16}${t}`;return e?DB(r):r}if(typeof i=="string"){if(i===""||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(a=>n(a)).join(",");if(i.includes(" "))return i.split(" ").map(a=>n(a)).join(" ");const r=i.replace("px","");if(!Number.isNaN(Number(r))){const a=`${Number(r)/16}${t}`;return e?DB(a):a}}return i}return n}const Et=Dq("rem",{shouldScale:!0}),CO=Dq("em");function iA(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function Oq(t){if(typeof t=="number")return!0;if(typeof t=="string"){if(t.startsWith("calc(")||t.startsWith("var(")||t.includes(" ")&&t.trim()!=="")return!0;const e=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return t.trim().split(/\s+/).every(i=>e.test(i))}return!1}function lg(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==I.Fragment:!1}function Mu(t){const e=I.createContext(null);return[({children:r,value:a})=>D.jsx(e.Provider,{value:a,children:r}),()=>{const r=I.useContext(e);if(r===null)throw new Error(t);return r}]}function A_(t=null){const e=I.createContext(t);return[({children:r,value:a})=>D.jsx(e.Provider,{value:a,children:r}),()=>I.useContext(e)]}function OB(t,e){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(e);return`${t}-${n}`}}function RO(t,e){let n=t;for(;(n=n.parentElement)&&!n.matches(e););return n}function pce(t,e,n){for(let i=t-1;i>=0;i-=1)if(!e[i].disabled)return i;if(n){for(let i=e.length-1;i>-1;i-=1)if(!e[i].disabled)return i}return t}function mce(t,e,n){for(let i=t+1;i<e.length;i+=1)if(!e[i].disabled)return i;if(n){for(let i=0;i<e.length;i+=1)if(!e[i].disabled)return i}return t}function gce(t,e,n){return RO(t,n)===RO(e,n)}function bce({parentSelector:t,siblingSelector:e,onKeyDown:n,loop:i=!0,activateOnFocus:r=!1,dir:a="rtl",orientation:s}){return o=>{n?.(o);const l=Array.from(RO(o.currentTarget,t)?.querySelectorAll(e)||[]).filter(g=>gce(o.currentTarget,g,t)),c=l.findIndex(g=>o.currentTarget===g),u=mce(c,l,i),f=pce(c,l,i),h=a==="rtl"?f:u,d=a==="rtl"?u:f;switch(o.key){case"ArrowRight":{s==="horizontal"&&(o.stopPropagation(),o.preventDefault(),l[h].focus(),r&&l[h].click());break}case"ArrowLeft":{s==="horizontal"&&(o.stopPropagation(),o.preventDefault(),l[d].focus(),r&&l[d].click());break}case"ArrowUp":{s==="vertical"&&(o.stopPropagation(),o.preventDefault(),l[f].focus(),r&&l[f].click());break}case"ArrowDown":{s==="vertical"&&(o.stopPropagation(),o.preventDefault(),l[u].focus(),r&&l[u].click());break}case"Home":{o.stopPropagation(),o.preventDefault(),!l[0].disabled&&l[0].focus();break}case"End":{o.stopPropagation(),o.preventDefault();const g=l.length-1;!l[g].disabled&&l[g].focus();break}}}}const vce={app:100,modal:200,popover:300,overlay:400,max:9999};function bf(t){return vce[t]}const u2=()=>{};function yce(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||u2:n=>{n.key==="Escape"&&(t(n),e.onTrigger?.())}}function ci(t,e="size",n=!0){if(t!==void 0)return Oq(t)?n?Et(t):t:`var(--${e}-${t})`}function Hd(t){return ci(t,"mantine-spacing")}function ta(t){return t===void 0?"var(--mantine-radius-default)":ci(t,"mantine-radius")}function os(t){return ci(t,"mantine-font-size")}function Iq(t){return ci(t,"mantine-line-height",!1)}function SL(t){if(t)return ci(t,"mantine-shadow",!1)}var xce={};function Nq(){return typeof process<"u"&&xce?"production":"development"}function IB(t,e){return e.length===0?t:e.reduce((n,i)=>Math.abs(i-t)<Math.abs(n-t)?i:n)}function rA(t){const e=Ee.version;return typeof Ee.version!="string"||e.startsWith("18.")?t?.ref:t?.props?.ref}function Lq(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=Lq(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function us(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=Lq(t))&&(i&&(i+=" "),i+=e);return i}const _ce={};function Sce(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([i,r])=>{e[i]?e[i]=us(e[i],r):e[i]=r})}),e}function aA({theme:t,classNames:e,props:n,stylesCtx:i}){const a=(Array.isArray(e)?e:[e]).map(s=>typeof s=="function"?s(t,n,i):s||_ce);return Sce(a)}function f2({theme:t,styles:e,props:n,stylesCtx:i}){return(Array.isArray(e)?e:[e]).reduce((a,s)=>typeof s=="function"?{...a,...s(t,n,i)}:{...a,...s},{})}const wL=I.createContext(null);function $d(){const t=I.useContext(wL);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function wce(){return $d().cssVariablesResolver}function Ece(){return $d().classNamesPrefix}function sA(){return $d().getStyleNonce}function Mce(){return $d().withStaticClasses}function Tce(){return $d().headless}function Ace(){return $d().stylesTransform?.sx}function Cce(){return $d().stylesTransform?.styles}function oA(){return $d().env||"default"}function Rce(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function kce(t){let e=t.replace("#","");if(e.length===3){const s=e.split("");e=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}if(e.length===8){const s=parseInt(e.slice(6,8),16)/255;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:s}}const n=parseInt(e,16),i=n>>16&255,r=n>>8&255,a=n&255;return{r:i,g:r,b:a,a:1}}function Dce(t){const[e,n,i,r]=t.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:e,g:n,b:i,a:r===void 0?1:r}}function Oce(t){const e=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=t.match(e);if(!n)return{r:0,g:0,b:0,a:1};const i=parseInt(n[1],10),r=parseInt(n[2],10)/100,a=parseInt(n[3],10)/100,s=n[5]?parseFloat(n[5]):void 0,o=(1-Math.abs(2*a-1))*r,l=i/60,c=o*(1-Math.abs(l%2-1)),u=a-o/2;let f,h,d;return l>=0&&l<1?(f=o,h=c,d=0):l>=1&&l<2?(f=c,h=o,d=0):l>=2&&l<3?(f=0,h=o,d=c):l>=3&&l<4?(f=0,h=c,d=o):l>=4&&l<5?(f=c,h=0,d=o):(f=o,h=0,d=c),{r:Math.round((f+u)*255),g:Math.round((h+u)*255),b:Math.round((d+u)*255),a:s||1}}function EL(t){return Rce(t)?kce(t):t.startsWith("rgb")?Dce(t):t.startsWith("hsl")?Oce(t):{r:0,g:0,b:0,a:1}}function tw(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:i,b:r,a}=EL(t),s=1-e,o=l=>Math.round(l*s);return`rgba(${o(n)}, ${o(i)}, ${o(r)}, ${a})`}function L1(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function F3(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Ice(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function Pq(t){if(t.startsWith("oklch("))return(Ice(t)||0)/100;const{r:e,g:n,b:i}=EL(t),r=e/255,a=n/255,s=i/255,o=F3(r),l=F3(a),c=F3(s);return .2126*o+.7152*l+.0722*c}function Ly(t,e=.179){return t.startsWith("var(")?!1:Pq(t)>e}function mh({color:t,theme:e,colorScheme:n}){if(typeof t!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof t}`);if(t==="bright")return{color:t,value:n==="dark"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:Ly(n==="dark"?e.white:e.black,e.luminanceThreshold),variable:"--mantine-color-bright"};if(t==="dimmed")return{color:t,value:n==="dark"?e.colors.dark[2]:e.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Ly(n==="dark"?e.colors.dark[2]:e.colors.gray[6],e.luminanceThreshold),variable:"--mantine-color-dimmed"};if(t==="white"||t==="black")return{color:t,value:t==="white"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:Ly(t==="white"?e.white:e.black,e.luminanceThreshold),variable:`--mantine-color-${t}`};const[i,r]=t.split("."),a=r?Number(r):void 0,s=i in e.colors;if(s){const o=a!==void 0?e.colors[i][a]:e.colors[i][L1(e,n||"light")];return{color:i,value:o,shade:a,isThemeColor:s,isLight:Ly(o,e.luminanceThreshold),variable:r?`--mantine-color-${i}-${a}`:`--mantine-color-${i}-filled`}}return{color:t,value:t,isThemeColor:s,isLight:Ly(t,e.luminanceThreshold),shade:a,variable:void 0}}function ea(t,e){const n=mh({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function kO(t,e){const n={from:t?.from||e.defaultGradient.from,to:t?.to||e.defaultGradient.to,deg:t?.deg??e.defaultGradient.deg??0},i=ea(n.from,e),r=ea(n.to,e);return`linear-gradient(${n.deg}deg, ${i} 0%, ${r} 100%)`}function ic(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(t.startsWith("var(")){const a=(1-e)*100;return`color-mix(in srgb, ${t}, transparent ${a}%)`}if(t.startsWith("oklch"))return t.includes("/")?t.replace(/\/\s*[\d.]+\s*\)/,`/ ${e})`):t.replace(")",` / ${e})`);const{r:n,g:i,b:r}=EL(t);return`rgba(${n}, ${i}, ${r}, ${e})`}const Kg=ic,Nce=({color:t,theme:e,variant:n,gradient:i,autoContrast:r})=>{const a=mh({color:t,theme:e}),s=typeof r=="boolean"?r:e.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const o=s&&a.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${t}-filled)`,hover:`var(--mantine-color-${t}-filled-hover)`,color:o,border:`${Et(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:o,border:`${Et(1)} solid transparent`}:{background:t,hover:tw(t,.1),color:o,border:`${Et(1)} solid transparent`}}if(n==="light"){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${t}-light)`,hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Et(1)} solid transparent`};const o=e.colors[a.color][a.shade];return{background:ic(o,.1),hover:ic(o,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}}return{background:ic(t,.1),hover:ic(t,.12),color:t,border:`${Et(1)} solid transparent`}}if(n==="outline")return a.isThemeColor?a.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${t}-outline-hover)`,color:`var(--mantine-color-${t}-outline)`,border:`${Et(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:ic(e.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${Et(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:"transparent",hover:ic(t,.05),color:t,border:`${Et(1)} solid ${t}`};if(n==="subtle"){if(a.isThemeColor){if(a.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Et(1)} solid transparent`};const o=e.colors[a.color][a.shade];return{background:"transparent",hover:ic(o,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}}return{background:"transparent",hover:ic(t,.12),color:t,border:`${Et(1)} solid transparent`}}return n==="transparent"?a.isThemeColor?a.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${Et(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${Et(1)} solid transparent`}:n==="white"?a.isThemeColor?a.shade===void 0?{background:"var(--mantine-color-white)",hover:tw(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${Et(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:tw(e.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${Et(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:tw(e.white,.01),color:t,border:`${Et(1)} solid transparent`}:n==="gradient"?{background:kO(i,e),hover:kO(i,e),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${Et(1)} solid var(--mantine-color-default-border)`}:{}},Lce={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},NB="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",lA={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:Lce,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:Nce,autoContrast:!1,luminanceThreshold:.3,fontFamily:NB,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:NB,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:Et(34),lineHeight:"1.3"},h2:{fontSize:Et(26),lineHeight:"1.35"},h3:{fontSize:Et(22),lineHeight:"1.4"},h4:{fontSize:Et(18),lineHeight:"1.45"},h5:{fontSize:Et(16),lineHeight:"1.5"},h6:{fontSize:Et(14),lineHeight:"1.5"}}},fontSizes:{xs:Et(12),sm:Et(14),md:Et(16),lg:Et(18),xl:Et(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:Et(2),sm:Et(4),md:Et(8),lg:Et(16),xl:Et(32)},spacing:{xs:Et(10),sm:Et(12),md:Et(16),lg:Et(20),xl:Et(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), 0 ${Et(1)} ${Et(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(10)} ${Et(15)} ${Et(-5)}, rgba(0, 0, 0, 0.04) 0 ${Et(7)} ${Et(7)} ${Et(-5)}`,md:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(20)} ${Et(25)} ${Et(-5)}, rgba(0, 0, 0, 0.04) 0 ${Et(10)} ${Et(10)} ${Et(-5)}`,lg:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(28)} ${Et(23)} ${Et(-7)}, rgba(0, 0, 0, 0.04) 0 ${Et(12)} ${Et(12)} ${Et(-7)}`,xl:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(36)} ${Et(28)} ${Et(-7)}, rgba(0, 0, 0, 0.04) 0 ${Et(17)} ${Et(17)} ${Et(-7)}`},other:{},components:{}};function LB(t){return t==="auto"||t==="dark"||t==="light"}function Pce({key:t="mantine-color-scheme-value"}={}){let e;return{get:n=>{if(typeof window>"u")return n;try{const i=window.localStorage.getItem(t);return LB(i)?i:n}catch{return n}},set:n=>{try{window.localStorage.setItem(t,n)}catch(i){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",i)}},subscribe:n=>{e=i=>{i.storageArea===window.localStorage&&i.key===t&&LB(i.newValue)&&n(i.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}const Uce="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",PB="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function B3(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function UB(t){if(!(t.primaryColor in t.colors))throw new Error(Uce);if(typeof t.primaryShade=="object"&&(!B3(t.primaryShade.dark)||!B3(t.primaryShade.light)))throw new Error(PB);if(typeof t.primaryShade=="number"&&!B3(t.primaryShade))throw new Error(PB)}function Uq(t,e){if(!e)return UB(t),t;const n=_L(t,e);return e.fontFamily&&!e.headings?.fontFamily&&(n.headings.fontFamily=e.fontFamily),UB(n),n}const ML=I.createContext(null),Fce=()=>I.useContext(ML)||lA;function ba(){const t=I.useContext(ML);if(!t)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return t}function Fq({theme:t,children:e,inherit:n=!0}){const i=Fce(),r=I.useMemo(()=>Uq(n?i:lA,t),[t,i,n]);return D.jsx(ML.Provider,{value:r,children:e})}Fq.displayName="@mantine/core/MantineThemeProvider";function Bce(){const t=ba(),e=sA(),n=tf(t.breakpoints).reduce((i,r)=>{const a=t.breakpoints[r].includes("px"),s=dce(t.breakpoints[r]),o=a?`${s-.1}px`:CO(s-.1),l=a?`${s}px`:CO(s);return`${i}@media (max-width: ${o}) {.mantine-visible-from-${r} {display: none !important;}}@media (min-width: ${l}) {.mantine-hidden-from-${r} {display: none !important;}}`},"");return D.jsx("style",{"data-mantine-styles":"classes",nonce:e?.(),dangerouslySetInnerHTML:{__html:n}})}function z3(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function Py(t,e){return(Array.isArray(t)?t:[t]).reduce((i,r)=>`${r}{${i}}`,e)}function zce(t,e){const n=z3(t.variables),i=n?Py(e,n):"",r=z3(t.dark),a=z3(t.light),s=r?Py(e===":host"?`${e}([data-mantine-color-scheme="dark"])`:`${e}[data-mantine-color-scheme="dark"]`,r):"",o=a?Py(e===":host"?`${e}([data-mantine-color-scheme="light"])`:`${e}[data-mantine-color-scheme="light"]`,a):"";return`${i}

${s}

${o}`}function Ov({color:t,theme:e,autoContrast:n}){return(typeof n=="boolean"?n:e.autoContrast)&&mh({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function FB(t,e){return Ov({color:t.colors[t.primaryColor][L1(t,e)],theme:t,autoContrast:null})}function nw({theme:t,color:e,colorScheme:n,name:i=e,withColorValues:r=!0}){if(!t.colors[e])return{};if(n==="light"){const o=L1(t,"light"),l={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${o===9?8:o+1})`,[`--mantine-color-${i}-light`]:Kg(t.colors[e][o],.1),[`--mantine-color-${i}-light-hover`]:Kg(t.colors[e][o],.12),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-outline-hover`]:Kg(t.colors[e][o],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...l}:l}const a=L1(t,"dark"),s={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${a})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${a===9?8:a+1})`,[`--mantine-color-${i}-light`]:Kg(t.colors[e][Math.max(0,a-2)],.15),[`--mantine-color-${i}-light-hover`]:Kg(t.colors[e][Math.max(0,a-2)],.2),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-${Math.max(a-5,0)})`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(a-4,0)})`,[`--mantine-color-${i}-outline-hover`]:Kg(t.colors[e][Math.max(a-4,0)],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...s}:s}function jce(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function Yg(t,e,n){tf(e).forEach(i=>Object.assign(t,{[`--mantine-${n}-${i}`]:e[i]}))}const Bq=t=>{const e=L1(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:Et(t.defaultRadius),i={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":t.scale.toString(),"--mantine-cursor-type":t.cursorType,"--mantine-webkit-font-smoothing":t.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":t.fontSmoothing?"grayscale":"unset","--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-line-height":t.lineHeights.md,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":t.headings.fontWeight,"--mantine-heading-text-wrap":t.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${t.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${t.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${t.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${t.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${t.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":FB(t,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":t.black,"--mantine-color-body":t.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-${e})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":FB(t,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};Yg(i.variables,t.breakpoints,"breakpoint"),Yg(i.variables,t.spacing,"spacing"),Yg(i.variables,t.fontSizes,"font-size"),Yg(i.variables,t.lineHeights,"line-height"),Yg(i.variables,t.shadows,"shadow"),Yg(i.variables,t.radius,"radius"),t.colors[t.primaryColor].forEach((a,s)=>{i.variables[`--mantine-primary-color-${s}`]=`var(--mantine-color-${t.primaryColor}-${s})`}),tf(t.colors).forEach(a=>{const s=t.colors[a];if(jce(s)){Object.assign(i.light,nw({theme:t,name:s.name,color:s.light,colorScheme:"light",withColorValues:!0})),Object.assign(i.dark,nw({theme:t,name:s.name,color:s.dark,colorScheme:"dark",withColorValues:!0}));return}s.forEach((o,l)=>{i.variables[`--mantine-color-${a}-${l}`]=o}),Object.assign(i.light,nw({theme:t,color:a,colorScheme:"light",withColorValues:!1})),Object.assign(i.dark,nw({theme:t,color:a,colorScheme:"dark",withColorValues:!1}))});const r=t.headings.sizes;return tf(r).forEach(a=>{i.variables[`--mantine-${a}-font-size`]=r[a].fontSize,i.variables[`--mantine-${a}-line-height`]=r[a].lineHeight,i.variables[`--mantine-${a}-font-weight`]=r[a].fontWeight||t.headings.fontWeight}),i};function Hce({theme:t,generator:e}){const n=Bq(t),i=e?.(t);return i?_L(n,i):n}const j3=Bq(lA);function Vce(t){const e={variables:{},light:{},dark:{}};return tf(t.variables).forEach(n=>{j3.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),tf(t.light).forEach(n=>{j3.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),tf(t.dark).forEach(n=>{j3.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function Gce(t){return`
  ${t}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
  ${t}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
`}function zq({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=ba(),i=sA(),r=wce(),a=Hce({theme:n,generator:r}),s=t===":root"&&e,o=s?Vce(a):a,l=zce(o,t);return l?D.jsx("style",{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${l}${s?"":Gce(t)}`}}):null}zq.displayName="@mantine/CssVariables";function Jg(t,e){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,i=t!=="auto"?t:n?"dark":"light";e()?.setAttribute("data-mantine-color-scheme",i)}function Wce({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:i}){const r=I.useRef(null),[a,s]=I.useState(()=>t.get(e)),o=i||a,l=I.useCallback(u=>{i||(Jg(u,n),s(u),t.set(u))},[t.set,o,i]),c=I.useCallback(()=>{s(e),Jg(e,n),t.clear()},[t.clear,e]);return I.useEffect(()=>(t.subscribe(l),t.unsubscribe),[t.subscribe,t.unsubscribe]),kv(()=>{Jg(t.get(e),n)},[]),I.useEffect(()=>{if(i)return Jg(i,n),()=>{};i===void 0&&Jg(a,n),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const u=f=>{a==="auto"&&Jg(f.matches?"dark":"light",n)};return r.current?.addEventListener("change",u),()=>r.current?.removeEventListener("change",u)},[a,i]),{colorScheme:o,setColorScheme:l,clearColorScheme:c}}function Xce({respectReducedMotion:t,getRootElement:e}){kv(()=>{t&&e()?.setAttribute("data-respect-reduced-motion","true")},[t])}function jq({theme:t,children:e,getStyleNonce:n,withStaticClasses:i=!0,withGlobalClasses:r=!0,deduplicateCssVariables:a=!0,withCssVariables:s=!0,cssVariablesSelector:o=":root",classNamesPrefix:l="mantine",colorSchemeManager:c=Pce(),defaultColorScheme:u="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:d,stylesTransform:g,env:b}){const{colorScheme:y,setColorScheme:p,clearColorScheme:x}=Wce({defaultColorScheme:u,forceColorScheme:d,manager:c,getRootElement:f});return Xce({respectReducedMotion:t?.respectReducedMotion||!1,getRootElement:f}),D.jsx(wL.Provider,{value:{colorScheme:y,setColorScheme:p,clearColorScheme:x,getRootElement:f,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:o,withStaticClasses:i,stylesTransform:g,env:b},children:D.jsxs(Fq,{theme:t,children:[s&&D.jsx(zq,{cssVariablesSelector:o,deduplicateCssVariables:a}),r&&D.jsx(Bce,{}),e]})})}jq.displayName="@mantine/core/MantineProvider";function Iv({classNames:t,styles:e,props:n,stylesCtx:i}){const r=ba();return{resolvedClassNames:aA({theme:r,classNames:t,props:n,stylesCtx:i||void 0}),resolvedStyles:f2({theme:r,styles:e,props:n,stylesCtx:i||void 0})}}const qce={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function Kce({theme:t,options:e,unstyled:n}){return us(e?.focusable&&!n&&(t.focusClassName||qce[t.focusRing]),e?.active&&!n&&t.activeClassName)}function Yce({selector:t,stylesCtx:e,options:n,props:i,theme:r}){return aA({theme:r,classNames:n?.classNames,props:n?.props||i,stylesCtx:e})[t]}function BB({selector:t,stylesCtx:e,theme:n,classNames:i,props:r}){return aA({theme:n,classNames:i,props:r,stylesCtx:e})[t]}function Jce({rootSelector:t,selector:e,className:n}){return t===e?n:void 0}function $ce({selector:t,classes:e,unstyled:n}){return n?void 0:e[t]}function Zce({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:i}){return i===!1?[]:t.map(r=>`${e}-${r}-${n}`)}function Qce({themeName:t,theme:e,selector:n,props:i,stylesCtx:r}){return t.map(a=>aA({theme:e,classNames:e.components[a]?.classNames,props:i,stylesCtx:r})?.[n])}function eue({options:t,classes:e,selector:n,unstyled:i}){return t?.variant&&!i?e[`${n}--${t.variant}`]:void 0}function tue({theme:t,options:e,themeName:n,selector:i,classNamesPrefix:r,classNames:a,classes:s,unstyled:o,className:l,rootSelector:c,props:u,stylesCtx:f,withStaticClasses:h,headless:d,transformedStyles:g}){return us(Kce({theme:t,options:e,unstyled:o||d}),Qce({theme:t,themeName:n,selector:i,props:u,stylesCtx:f}),eue({options:e,classes:s,selector:i,unstyled:o}),BB({selector:i,stylesCtx:f,theme:t,classNames:a,props:u}),BB({selector:i,stylesCtx:f,theme:t,classNames:g,props:u}),Yce({selector:i,stylesCtx:f,options:e,props:u,theme:t}),Jce({rootSelector:c,selector:i,className:l}),$ce({selector:i,classes:s,unstyled:o||d}),h&&!d&&Zce({themeName:n,classNamesPrefix:r,selector:i,withStaticClass:e?.withStaticClass}),e?.className)}function nue({theme:t,themeName:e,props:n,stylesCtx:i,selector:r}){return e.map(a=>f2({theme:t,styles:t.components[a]?.styles,props:n,stylesCtx:i})[r]).reduce((a,s)=>({...a,...s}),{})}function DO({style:t,theme:e}){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...DO({style:i,theme:e})}),{}):typeof t=="function"?t(e):t??{}}function iue(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(i=>{e[i]={...e[i],...iA(n[i])}}),e),{})}function rue({vars:t,varsResolver:e,theme:n,props:i,stylesCtx:r,selector:a,themeName:s,headless:o}){return iue([o?{}:e?.(n,i,r),...s.map(l=>n.components?.[l]?.vars?.(n,i,r)),t?.(n,i,r)])?.[a]}function aue({theme:t,themeName:e,selector:n,options:i,props:r,stylesCtx:a,rootSelector:s,styles:o,style:l,vars:c,varsResolver:u,headless:f,withStylesTransform:h}){return{...!h&&nue({theme:t,themeName:e,props:r,stylesCtx:a,selector:n}),...!h&&f2({theme:t,styles:o,props:r,stylesCtx:a})[n],...!h&&f2({theme:t,styles:i?.styles,props:i?.props||r,stylesCtx:a})[n],...rue({theme:t,props:r,stylesCtx:a,vars:c,varsResolver:u,selector:n,themeName:e,headless:f}),...s===n?DO({style:l,theme:t}):null,...DO({style:i?.style,theme:t})}}function sue({props:t,stylesCtx:e,themeName:n}){const i=ba(),r=Cce()?.();return{getTransformedStyles:s=>r?[...s.map(l=>r(l,{props:t,theme:i,ctx:e})),...n.map(l=>r(i.components[l]?.styles,{props:t,theme:i,ctx:e}))].filter(Boolean):[],withStylesTransform:!!r}}function En({name:t,classes:e,props:n,stylesCtx:i,className:r,style:a,rootSelector:s="root",unstyled:o,classNames:l,styles:c,vars:u,varsResolver:f,attributes:h}){const d=ba(),g=Ece(),b=Mce(),y=Tce(),p=(Array.isArray(t)?t:[t]).filter(w=>w),{withStylesTransform:x,getTransformedStyles:_}=sue({props:n,stylesCtx:i,themeName:p});return(w,M)=>({className:tue({theme:d,options:M,themeName:p,selector:w,classNamesPrefix:g,classNames:l,classes:e,unstyled:o,className:r,rootSelector:s,props:n,stylesCtx:i,withStaticClasses:b,headless:y,transformedStyles:_([M?.styles,c])}),style:aue({theme:d,themeName:p,selector:w,options:M,props:n,stylesCtx:i,rootSelector:s,styles:c,style:a,vars:u,varsResolver:f,headless:y,withStylesTransform:x}),...h?.[w]})}function cA(t,e){return typeof t=="boolean"?t:e.autoContrast}function zB(t){const e=document.createElement("style");return e.setAttribute("data-mantine-styles","inline"),e.innerHTML="*, *::before, *::after {transition: none !important;}",e.setAttribute("data-mantine-disable-transition","true"),t&&e.setAttribute("nonce",t),document.head.appendChild(e),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(i=>i.remove())}function Vd({keepTransitions:t}={}){const e=I.useRef(u2),n=I.useRef(-1),i=I.useContext(wL),r=sA(),a=I.useRef(r?.());if(!i)throw new Error("[@mantine/core] MantineProvider was not found in tree");const s=f=>{i.setColorScheme(f),e.current=t?()=>{}:zB(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{e.current?.()},10)},o=()=>{i.clearColorScheme(),e.current=t?()=>{}:zB(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{e.current?.()},10)},l=joe("light",{getInitialValueInEffect:!1}),c=i.colorScheme==="auto"?l:i.colorScheme,u=I.useCallback(()=>s(c==="light"?"dark":"light"),[s,c]);return I.useEffect(()=>()=>{e.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:i.colorScheme,setColorScheme:s,clearColorScheme:o,toggleColorScheme:u}}function Pt(t,e,n){const i=ba(),r=i.components[t]?.defaultProps,a=typeof r=="function"?r(i):r;return{...e,...a,...iA(n)}}function H3(t){return tf(t).reduce((e,n)=>t[n]!==void 0?`${e}${fce(n)}:${t[n]};`:e,"").trim()}function oue({selector:t,styles:e,media:n,container:i}){const r=e?H3(e):"",a=Array.isArray(n)?n.map(o=>`@media${o.query}{${t}{${H3(o.styles)}}}`):[],s=Array.isArray(i)?i.map(o=>`@container ${o.query}{${t}{${H3(o.styles)}}}`):[];return`${r?`${t}{${r}}`:""}${a.join("")}${s.join("")}`.trim()}function Hq(t){const e=sA();return D.jsx("style",{"data-mantine-styles":"inline",nonce:e?.(),dangerouslySetInnerHTML:{__html:oue(t)}})}function C_(t){const{m:e,mx:n,my:i,mt:r,mb:a,ml:s,mr:o,me:l,ms:c,p:u,px:f,py:h,pt:d,pb:g,pl:b,pr:y,pe:p,ps:x,bd:_,bdrs:w,bg:M,c:S,opacity:A,ff:C,fz:k,fw:R,lts:N,ta:P,lh:j,fs:z,tt:X,td:F,w:H,miw:V,maw:W,h:B,mih:Y,mah:Z,bgsz:G,bgp:de,bgr:oe,bga:le,pos:ue,top:Se,left:Te,bottom:Pe,right:je,inset:He,display:pe,flex:ze,hiddenFrom:Ie,visibleFrom:Xe,lightHidden:we,darkHidden:Ae,sx:Re,...Ne}=t;return{styleProps:iA({m:e,mx:n,my:i,mt:r,mb:a,ml:s,mr:o,me:l,ms:c,p:u,px:f,py:h,pt:d,pb:g,pl:b,pr:y,pe:p,ps:x,bd:_,bg:M,c:S,opacity:A,ff:C,fz:k,fw:R,lts:N,ta:P,lh:j,fs:z,tt:X,td:F,w:H,miw:V,maw:W,h:B,mih:Y,mah:Z,bgsz:G,bgp:de,bgr:oe,bga:le,pos:ue,top:Se,left:Te,bottom:Pe,right:je,inset:He,display:pe,flex:ze,bdrs:w,hiddenFrom:Ie,visibleFrom:Xe,lightHidden:we,darkHidden:Ae,sx:Re}),rest:Ne}}const lue={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function TL(t,e){const n=mh({color:t,theme:e});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function cue(t,e){const n=mh({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:TL(t,e)}function uue(t,e){if(typeof t=="number")return Et(t);if(typeof t=="string"){const[n,i,...r]=t.split(" ").filter(s=>s.trim()!=="");let a=`${Et(n)}`;return i&&(a+=` ${i}`),r.length>0&&(a+=` ${TL(r.join(" "),e)}`),a.trim()}return t}const jB={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function fue(t){return typeof t=="string"&&t in jB?jB[t]:t}const hue=["h1","h2","h3","h4","h5","h6"];function due(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&hue.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?Et(t):t}function pue(t){return t}const mue=["h1","h2","h3","h4","h5","h6"];function gue(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&mue.includes(t)?`var(--mantine-${t}-line-height)`:t}function bue(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?Et(t):t}function vue(t){return typeof t=="number"?Et(t):t}function yue(t,e){if(typeof t=="number")return Et(t);if(typeof t=="string"){const n=t.replace("-","");if(!(n in e.spacing))return Et(t);const i=`--mantine-spacing-${n}`;return t.startsWith("-")?`calc(var(${i}) * -1)`:`var(${i})`}return t}const V3={color:TL,textColor:cue,fontSize:due,spacing:yue,radius:bue,identity:pue,size:vue,lineHeight:gue,fontFamily:fue,border:uue};function HB(t){return t.replace("(min-width: ","").replace("em)","")}function xue({media:t,...e}){const i=Object.keys(t).sort((r,a)=>Number(HB(r))-Number(HB(a))).map(r=>({query:r,styles:t[r]}));return{...e,media:i}}function _ue(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function Sue(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function wue(t){return typeof t=="object"&&t!==null?tf(t).filter(e=>e!=="base"):[]}function Eue(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function Vq({styleProps:t,data:e,theme:n}){return xue(tf(t).reduce((i,r)=>{if(r==="hiddenFrom"||r==="visibleFrom"||r==="sx")return i;const a=e[r],s=Array.isArray(a.property)?a.property:[a.property],o=Sue(t[r]);if(!_ue(t[r]))return s.forEach(c=>{i.inlineStyles[c]=V3[a.type](o,n)}),i;i.hasResponsiveStyles=!0;const l=wue(t[r]);return s.forEach(c=>{o!=null&&(i.styles[c]=V3[a.type](o,n)),l.forEach(u=>{const f=`(min-width: ${n.breakpoints[u]})`;i.media[f]={...i.media[f],[c]:V3[a.type](Eue(t[r],u),n)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Gq(){return`__m__-${I.useId().replace(/[:«»]/g,"")}`}function AL(t,e){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...AL(i,e)}),{}):typeof t=="function"?t(e):t??{}}function Wq(t){return t.startsWith("data-")?t:`data-${t}`}function Mue(t){return Object.keys(t).reduce((e,n)=>{const i=t[n];return i===void 0||i===""||i===!1||i===null||(e[Wq(n)]=t[n]),e},{})}function Xq(t){return t?typeof t=="string"?{[Wq(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,...Xq(n)}),{}):Mue(t):null}function OO(t,e){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...OO(i,e)}),{}):typeof t=="function"?t(e):t??{}}function Tue({theme:t,style:e,vars:n,styleProps:i}){const r=OO(e,t),a=OO(n,t);return{...r,...a,...i}}const qq=I.forwardRef(({component:t,style:e,__vars:n,className:i,variant:r,mod:a,size:s,hiddenFrom:o,visibleFrom:l,lightHidden:c,darkHidden:u,renderRoot:f,__size:h,...d},g)=>{const b=ba(),y=t||"div",{styleProps:p,rest:x}=C_(d),w=Ace()?.()?.(p.sx),M=Gq(),S=Vq({styleProps:p,theme:b,data:lue}),A={ref:g,style:Tue({theme:b,style:e,vars:n,styleProps:S.inlineStyles}),className:us(i,w,{[M]:S.hasResponsiveStyles,"mantine-light-hidden":c,"mantine-dark-hidden":u,[`mantine-hidden-from-${o}`]:o,[`mantine-visible-from-${l}`]:l}),"data-variant":r,"data-size":Oq(s)?void 0:s||void 0,size:h,...Xq(a),...x};return D.jsxs(D.Fragment,{children:[S.hasResponsiveStyles&&D.jsx(Hq,{selector:`.${M}`,styles:S.styles,media:S.media}),typeof f=="function"?f(A):D.jsx(y,{...A})]})});qq.displayName="@mantine/core/Box";const st=qq;function Kq(t){return t}function Zt(t){const e=I.forwardRef(t);return e.extend=Kq,e.withProps=n=>{const i=I.forwardRef((r,a)=>D.jsx(e,{...n,...r,ref:a}));return i.extend=e.extend,i.displayName=`WithProps(${e.displayName})`,i},e}function Dl(t){const e=I.forwardRef(t);return e.withProps=n=>{const i=I.forwardRef((r,a)=>D.jsx(e,{...n,...r,ref:a}));return i.extend=e.extend,i.displayName=`WithProps(${e.displayName})`,i},e.extend=Kq,e}const Aue=I.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Nv(){return I.useContext(Aue)}function Cue(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function G3(t){return t?.current?t.current.scrollHeight:"auto"}const Uy=typeof window<"u"&&window.requestAnimationFrame,VB=0,Rue=t=>({height:0,overflow:"hidden",...t?{}:{display:"none"}});function kue({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n=()=>{},opened:i,keepMounted:r=!1}){const a=I.useRef(null),s=Rue(r),[o,l]=I.useState(i?{}:s),c=g=>{u_.flushSync(()=>l(g))},u=g=>{c(b=>({...b,...g}))};function f(g){const b=t||Cue(g);return{transition:`height ${b}ms ${e}, opacity ${b}ms ${e}`}}_c(()=>{typeof Uy=="function"&&Uy(i?()=>{u({willChange:"height",display:"block",overflow:"hidden"}),Uy(()=>{const g=G3(a);u({...f(g),height:g})})}:()=>{const g=G3(a);u({...f(g),willChange:"height",height:g}),Uy(()=>u({height:VB,overflow:"hidden"}))})},[i]);const h=g=>{if(!(g.target!==a.current||g.propertyName!=="height"))if(i){const b=G3(a);b===o.height?c({}):u({height:b}),n()}else o.height===VB&&(c(s),n())};function d({style:g={},refKey:b="ref",...y}={}){const p=y[b],x={"aria-hidden":!i,...y,[b]:pq(a,p),onTransitionEnd:h,style:{boxSizing:"border-box",...g,...o}};return Ee.version.startsWith("18")?i||(x.inert=""):x.inert=!i,x}return d}const Due={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},gh=Zt((t,e)=>{const{children:n,in:i,transitionDuration:r,transitionTimingFunction:a,style:s,onTransitionEnd:o,animateOpacity:l,keepMounted:c,...u}=Pt("Collapse",Due,t),f=ba(),h=tA(),g=(f.respectReducedMotion?h:!1)?0:r,b=kue({opened:i,transitionDuration:g,transitionTimingFunction:a,onTransitionEnd:o,keepMounted:c});return g===0?i?D.jsx(st,{...u,children:n}):null:D.jsx(st,{...b({style:{opacity:i||!l?1:0,transition:l?`opacity ${g}ms ${a}`:"none",...AL(s,f)},ref:e,...u}),children:n})});gh.displayName="@mantine/core/Collapse";function uA(){return typeof window<"u"}function Lv(t){return Yq(t)?(t.nodeName||"").toLowerCase():"#document"}function Ho(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function vf(t){var e;return(e=(Yq(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Yq(t){return uA()?t instanceof Node||t instanceof Ho(t).Node:!1}function jr(t){return uA()?t instanceof Element||t instanceof Ho(t).Element:!1}function Rl(t){return uA()?t instanceof HTMLElement||t instanceof Ho(t).HTMLElement:!1}function IO(t){return!uA()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ho(t).ShadowRoot}const Oue=new Set(["inline","contents"]);function R_(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Mc(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!Oue.has(r)}const Iue=new Set(["table","td","th"]);function Nue(t){return Iue.has(Lv(t))}const Lue=[":popover-open",":modal"];function fA(t){return Lue.some(e=>{try{return t.matches(e)}catch{return!1}})}const Pue=["transform","translate","scale","rotate","perspective"],Uue=["transform","translate","scale","rotate","perspective","filter"],Fue=["paint","layout","strict","content"];function CL(t){const e=hA(),n=jr(t)?Mc(t):t;return Pue.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Uue.some(i=>(n.willChange||"").includes(i))||Fue.some(i=>(n.contain||"").includes(i))}function Bue(t){let e=bh(t);for(;Rl(e)&&!ah(e);){if(CL(e))return e;if(fA(e))return null;e=bh(e)}return null}function hA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zue=new Set(["html","body","#document"]);function ah(t){return zue.has(Lv(t))}function Mc(t){return Ho(t).getComputedStyle(t)}function dA(t){return jr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bh(t){if(Lv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||IO(t)&&t.host||vf(t);return IO(e)?e.host:e}function Jq(t){const e=bh(t);return ah(e)?t.ownerDocument?t.ownerDocument.body:t.body:Rl(e)&&R_(e)?e:Jq(e)}function sh(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jq(t),a=r===((i=t.ownerDocument)==null?void 0:i.body),s=Ho(r);if(a){const o=NO(s);return e.concat(s,s.visualViewport||[],R_(r)?r:[],o&&n?sh(o):[])}return e.concat(r,sh(r,[],n))}function NO(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const jue=["top","right","bottom","left"],yu=Math.min,eo=Math.max,h2=Math.round,iw=Math.floor,nf=t=>({x:t,y:t}),Hue={left:"right",right:"left",bottom:"top",top:"bottom"},Vue={start:"end",end:"start"};function LO(t,e,n){return eo(t,yu(e,n))}function cf(t,e){return typeof t=="function"?t(e):t}function xu(t){return t.split("-")[0]}function Pv(t){return t.split("-")[1]}function RL(t){return t==="x"?"y":"x"}function kL(t){return t==="y"?"height":"width"}const Gue=new Set(["top","bottom"]);function fu(t){return Gue.has(xu(t))?"y":"x"}function DL(t){return RL(fu(t))}function Wue(t,e,n){n===void 0&&(n=!1);const i=Pv(t),r=DL(t),a=kL(r);let s=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=d2(s)),[s,d2(s)]}function Xue(t){const e=d2(t);return[PO(t),e,PO(e)]}function PO(t){return t.replace(/start|end/g,e=>Vue[e])}const GB=["left","right"],WB=["right","left"],que=["top","bottom"],Kue=["bottom","top"];function Yue(t,e,n){switch(t){case"top":case"bottom":return n?e?WB:GB:e?GB:WB;case"left":case"right":return e?que:Kue;default:return[]}}function Jue(t,e,n,i){const r=Pv(t);let a=Yue(xu(t),n==="start",i);return r&&(a=a.map(s=>s+"-"+r),e&&(a=a.concat(a.map(PO)))),a}function d2(t){return t.replace(/left|right|bottom|top/g,e=>Hue[e])}function $ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function OL(t){return typeof t!="number"?$ue(t):{top:t,right:t,bottom:t,left:t}}function X0(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function Zue(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function Que(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:i}=e;return n+"/"+i}).join(" "):navigator.userAgent}function efe(){return/apple/i.test(navigator.vendor)}function tfe(){return Zue().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function nfe(){return Que().includes("jsdom/")}const XB="data-floating-ui-focusable",ife="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function qB(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function P1(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&IO(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Hb(t){return"composedPath"in t?t.composedPath()[0]:t.target}function W3(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function rfe(t){return t.matches("html,body")}function cm(t){return t?.ownerDocument||document}function afe(t){return Rl(t)&&t.matches(ife)}function sfe(t){if(!t||nfe())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function ofe(t){return t?t.hasAttribute(XB)?t:t.querySelector("["+XB+"]")||t:null}function oM(t,e,n){return n===void 0&&(n=!0),t.filter(r=>{var a;return r.parentId===e&&(!n||((a=r.context)==null?void 0:a.open))}).flatMap(r=>[r,...oM(t,r.id,n)])}function lfe(t){return"nativeEvent"in t}function UO(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var cfe=typeof document<"u",ufe=function(){},rf=cfe?I.useLayoutEffect:ufe;const ffe={...E7};function rw(t){const e=I.useRef(t);return rf(()=>{e.current=t}),e}const hfe=ffe.useInsertionEffect,dfe=hfe||(t=>t());function Xu(t){const e=I.useRef(()=>{});return dfe(()=>{e.current=t}),I.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.current==null?void 0:e.current(...i)},[])}function KB(t,e,n){let{reference:i,floating:r}=t;const a=fu(e),s=DL(e),o=kL(s),l=xu(e),c=a==="y",u=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[o]/2-r[o]/2;let d;switch(l){case"top":d={x:u,y:i.y-r.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-r.width,y:f};break;default:d={x:i.x,y:i.y}}switch(Pv(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1);break}return d}const pfe=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=KB(c,i,l),h=i,d={},g=0;for(let b=0;b<o.length;b++){const{name:y,fn:p}=o[b],{x,y:_,data:w,reset:M}=await p({x:u,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:e}});u=x??u,f=_??f,d={...d,[y]:{...d[y],...w}},M&&g<=50&&(g++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(c=M.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):M.rects),{x:u,y:f}=KB(c,h,l)),b=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:d}};async function U1(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:a,rects:s,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=cf(e,t),g=OL(d),y=o[h?f==="floating"?"reference":"floating":f],p=X0(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),x=f==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),w=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},M=X0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:_,strategy:l}):x);return{top:(p.top-M.top+g.top)/w.y,bottom:(M.bottom-p.bottom+g.bottom)/w.y,left:(p.left-M.left+g.left)/w.x,right:(M.right-p.right+g.right)/w.x}}const mfe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=cf(t,e)||{};if(c==null)return{};const f=OL(u),h={x:n,y:i},d=DL(r),g=kL(d),b=await s.getDimensions(c),y=d==="y",p=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",w=a.reference[g]+a.reference[d]-h[d]-a.floating[g],M=h[d]-a.reference[d],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=S?S[_]:0;(!A||!await(s.isElement==null?void 0:s.isElement(S)))&&(A=o.floating[_]||a.floating[g]);const C=w/2-M/2,k=A/2-b[g]/2-1,R=yu(f[p],k),N=yu(f[x],k),P=R,j=A-b[g]-N,z=A/2-b[g]/2+C,X=LO(P,z,j),F=!l.arrow&&Pv(r)!=null&&z!==X&&a.reference[g]/2-(z<P?R:N)-b[g]/2<0,H=F?z<P?z-P:z-j:0;return{[d]:h[d]+H,data:{[d]:X,centerOffset:z-X-H,...F&&{alignmentOffset:H}},reset:F}}}),gfe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:a,rects:s,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...y}=cf(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const p=xu(r),x=fu(o),_=xu(o)===o,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=h||(_||!b?[d2(o)]:Xue(o)),S=g!=="none";!h&&S&&M.push(...Jue(o,b,g,w));const A=[o,...M],C=await U1(e,y),k=[];let R=((i=a.flip)==null?void 0:i.overflows)||[];if(u&&k.push(C[p]),f){const z=Wue(r,s,w);k.push(C[z[0]],C[z[1]])}if(R=[...R,{placement:r,overflows:k}],!k.every(z=>z<=0)){var N,P;const z=(((N=a.flip)==null?void 0:N.index)||0)+1,X=A[z];if(X&&(!(f==="alignment"?x!==fu(X):!1)||R.every(V=>fu(V.placement)===x?V.overflows[0]>0:!0)))return{data:{index:z,overflows:R},reset:{placement:X}};let F=(P=R.filter(H=>H.overflows[0]<=0).sort((H,V)=>H.overflows[1]-V.overflows[1])[0])==null?void 0:P.placement;if(!F)switch(d){case"bestFit":{var j;const H=(j=R.filter(V=>{if(S){const W=fu(V.placement);return W===x||W==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(W=>W>0).reduce((W,B)=>W+B,0)]).sort((V,W)=>V[1]-W[1])[0])==null?void 0:j[0];H&&(F=H);break}case"initialPlacement":F=o;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function YB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function JB(t){return jue.some(e=>t[e]>=0)}const bfe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=cf(t,e);switch(i){case"referenceHidden":{const a=await U1(e,{...r,elementContext:"reference"}),s=YB(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:JB(s)}}}case"escaped":{const a=await U1(e,{...r,altBoundary:!0}),s=YB(a,n.floating);return{data:{escapedOffsets:s,escaped:JB(s)}}}default:return{}}}}};function $q(t){const e=yu(...t.map(a=>a.left)),n=yu(...t.map(a=>a.top)),i=eo(...t.map(a=>a.right)),r=eo(...t.map(a=>a.bottom));return{x:e,y:n,width:i-e,height:r-n}}function vfe(t){const e=t.slice().sort((r,a)=>r.y-a.y),n=[];let i=null;for(let r=0;r<e.length;r++){const a=e[r];!i||a.y-i.y>i.height/2?n.push([a]):n[n.length-1].push(a),i=a}return n.map(r=>X0($q(r)))}const yfe=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:r,platform:a,strategy:s}=e,{padding:o=2,x:l,y:c}=cf(t,e),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(i.reference))||[]),f=vfe(u),h=X0($q(u)),d=OL(o);function g(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&c!=null)return f.find(y=>l>y.left-d.left&&l<y.right+d.right&&c>y.top-d.top&&c<y.bottom+d.bottom)||h;if(f.length>=2){if(fu(n)==="y"){const R=f[0],N=f[f.length-1],P=xu(n)==="top",j=R.top,z=N.bottom,X=P?R.left:N.left,F=P?R.right:N.right,H=F-X,V=z-j;return{top:j,bottom:z,left:X,right:F,width:H,height:V,x:X,y:j}}const y=xu(n)==="left",p=eo(...f.map(R=>R.right)),x=yu(...f.map(R=>R.left)),_=f.filter(R=>y?R.left===x:R.right===p),w=_[0].top,M=_[_.length-1].bottom,S=x,A=p,C=A-S,k=M-w;return{top:w,bottom:M,left:S,right:A,width:C,height:k,x:S,y:w}}return h}const b=await a.getElementRects({reference:{getBoundingClientRect:g},floating:i.floating,strategy:s});return r.reference.x!==b.reference.x||r.reference.y!==b.reference.y||r.reference.width!==b.reference.width||r.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},Zq=new Set(["left","top"]);async function xfe(t,e){const{placement:n,platform:i,elements:r}=t,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),s=xu(n),o=Pv(n),l=fu(n)==="y",c=Zq.has(s)?-1:1,u=a&&l?-1:1,f=cf(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof g=="number"&&(d=o==="end"?g*-1:g),l?{x:d*u,y:h*c}:{x:h*c,y:d*u}}const _fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:a,placement:s,middlewareData:o}=e,l=await xfe(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:s}}}}},Sfe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:y=>{let{x:p,y:x}=y;return{x:p,y:x}}},...l}=cf(t,e),c={x:n,y:i},u=await U1(e,l),f=fu(xu(r)),h=RL(f);let d=c[h],g=c[f];if(a){const y=h==="y"?"top":"left",p=h==="y"?"bottom":"right",x=d+u[y],_=d-u[p];d=LO(x,d,_)}if(s){const y=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+u[y],_=g-u[p];g=LO(x,g,_)}const b=o.fn({...e,[h]:d,[f]:g});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[h]:a,[f]:s}}}}}},wfe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=cf(t,e),u={x:n,y:i},f=fu(r),h=RL(f);let d=u[h],g=u[f];const b=cf(o,e),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=h==="y"?"height":"width",w=a.reference[h]-a.floating[_]+y.mainAxis,M=a.reference[h]+a.reference[_]-y.mainAxis;d<w?d=w:d>M&&(d=M)}if(c){var p,x;const _=h==="y"?"width":"height",w=Zq.has(xu(r)),M=a.reference[f]-a.floating[_]+(w&&((p=s.offset)==null?void 0:p[f])||0)+(w?0:y.crossAxis),S=a.reference[f]+a.reference[_]+(w?0:((x=s.offset)==null?void 0:x[f])||0)-(w?y.crossAxis:0);g<M?g=M:g>S&&(g=S)}return{[h]:d,[f]:g}}}},Efe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:a,platform:s,elements:o}=e,{apply:l=()=>{},...c}=cf(t,e),u=await U1(e,c),f=xu(r),h=Pv(r),d=fu(r)==="y",{width:g,height:b}=a.floating;let y,p;f==="top"||f==="bottom"?(y=f,p=h===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(p=f,y=h==="end"?"top":"bottom");const x=b-u.top-u.bottom,_=g-u.left-u.right,w=yu(b-u[y],x),M=yu(g-u[p],_),S=!e.middlewareData.shift;let A=w,C=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=_),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(A=x),S&&!h){const R=eo(u.left,0),N=eo(u.right,0),P=eo(u.top,0),j=eo(u.bottom,0);d?C=g-2*(R!==0||N!==0?R+N:eo(u.left,u.right)):A=b-2*(P!==0||j!==0?P+j:eo(u.top,u.bottom))}await l({...e,availableWidth:C,availableHeight:A});const k=await s.getDimensions(o.floating);return g!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}};function Qq(t){const e=Mc(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Rl(t),a=r?t.offsetWidth:n,s=r?t.offsetHeight:i,o=h2(n)!==a||h2(i)!==s;return o&&(n=a,i=s),{width:n,height:i,$:o}}function IL(t){return jr(t)?t:t.contextElement}function y0(t){const e=IL(t);if(!Rl(e))return nf(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:a}=Qq(e);let s=(a?h2(n.width):n.width)/i,o=(a?h2(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const Mfe=nf(0);function eK(t){const e=Ho(t);return!hA()||!e.visualViewport?Mfe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Tfe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ho(t)?!1:e}function Wm(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),a=IL(t);let s=nf(1);e&&(i?jr(i)&&(s=y0(i)):s=y0(t));const o=Tfe(a,n,i)?eK(a):nf(0);let l=(r.left+o.x)/s.x,c=(r.top+o.y)/s.y,u=r.width/s.x,f=r.height/s.y;if(a){const h=Ho(a),d=i&&jr(i)?Ho(i):i;let g=h,b=NO(g);for(;b&&i&&d!==g;){const y=y0(b),p=b.getBoundingClientRect(),x=Mc(b),_=p.left+(b.clientLeft+parseFloat(x.paddingLeft))*y.x,w=p.top+(b.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=_,c+=w,g=Ho(b),b=NO(g)}}return X0({width:u,height:f,x:l,y:c})}function pA(t,e){const n=dA(t).scrollLeft;return e?e.left+n:Wm(vf(t)).left+n}function tK(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-pA(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function Afe(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const a=r==="fixed",s=vf(i),o=e?fA(e.floating):!1;if(i===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},c=nf(1);const u=nf(0),f=Rl(i);if((f||!f&&!a)&&((Lv(i)!=="body"||R_(s))&&(l=dA(i)),Rl(i))){const d=Wm(i);c=y0(i),u.x=d.x+i.clientLeft,u.y=d.y+i.clientTop}const h=s&&!f&&!a?tK(s,l):nf(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function Cfe(t){return Array.from(t.getClientRects())}function Rfe(t){const e=vf(t),n=dA(t),i=t.ownerDocument.body,r=eo(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=eo(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+pA(t);const o=-n.scrollTop;return Mc(i).direction==="rtl"&&(s+=eo(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:s,y:o}}const $B=25;function kfe(t,e){const n=Ho(t),i=vf(t),r=n.visualViewport;let a=i.clientWidth,s=i.clientHeight,o=0,l=0;if(r){a=r.width,s=r.height;const u=hA();(!u||u&&e==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}const c=pA(i);if(c<=0){const u=i.ownerDocument,f=u.body,h=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(i.clientWidth-f.clientWidth-d);g<=$B&&(a-=g)}else c<=$B&&(a+=c);return{width:a,height:s,x:o,y:l}}const Dfe=new Set(["absolute","fixed"]);function Ofe(t,e){const n=Wm(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,a=Rl(t)?y0(t):nf(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=r*a.x,c=i*a.y;return{width:s,height:o,x:l,y:c}}function ZB(t,e,n){let i;if(e==="viewport")i=kfe(t,n);else if(e==="document")i=Rfe(vf(t));else if(jr(e))i=Ofe(e,n);else{const r=eK(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return X0(i)}function nK(t,e){const n=bh(t);return n===e||!jr(n)||ah(n)?!1:Mc(n).position==="fixed"||nK(n,e)}function Ife(t,e){const n=e.get(t);if(n)return n;let i=sh(t,[],!1).filter(o=>jr(o)&&Lv(o)!=="body"),r=null;const a=Mc(t).position==="fixed";let s=a?bh(t):t;for(;jr(s)&&!ah(s);){const o=Mc(s),l=CL(s);!l&&o.position==="fixed"&&(r=null),(a?!l&&!r:!l&&o.position==="static"&&!!r&&Dfe.has(r.position)||R_(s)&&!l&&nK(t,s))?i=i.filter(u=>u!==s):r=o,s=bh(s)}return e.set(t,i),i}function Nfe(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const s=[...n==="clippingAncestors"?fA(e)?[]:Ife(e,this._c):[].concat(n),i],o=s[0],l=s.reduce((c,u)=>{const f=ZB(e,u,r);return c.top=eo(f.top,c.top),c.right=yu(f.right,c.right),c.bottom=yu(f.bottom,c.bottom),c.left=eo(f.left,c.left),c},ZB(e,o,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Lfe(t){const{width:e,height:n}=Qq(t);return{width:e,height:n}}function Pfe(t,e,n){const i=Rl(e),r=vf(e),a=n==="fixed",s=Wm(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=nf(0);function c(){l.x=pA(r)}if(i||!i&&!a)if((Lv(e)!=="body"||R_(r))&&(o=dA(e)),i){const d=Wm(e,!0,a,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else r&&c();a&&!i&&r&&c();const u=r&&!i&&!a?tK(r,o):nf(0),f=s.left+o.scrollLeft-l.x-u.x,h=s.top+o.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function X3(t){return Mc(t).position==="static"}function QB(t,e){if(!Rl(t)||Mc(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return vf(t)===n&&(n=n.ownerDocument.body),n}function iK(t,e){const n=Ho(t);if(fA(t))return n;if(!Rl(t)){let r=bh(t);for(;r&&!ah(r);){if(jr(r)&&!X3(r))return r;r=bh(r)}return n}let i=QB(t,e);for(;i&&Nue(i)&&X3(i);)i=QB(i,e);return i&&ah(i)&&X3(i)&&!CL(i)?n:i||Bue(t)||n}const Ufe=async function(t){const e=this.getOffsetParent||iK,n=this.getDimensions,i=await n(t.floating);return{reference:Pfe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Ffe(t){return Mc(t).direction==="rtl"}const Bfe={convertOffsetParentRelativeRectToViewportRelativeRect:Afe,getDocumentElement:vf,getClippingRect:Nfe,getOffsetParent:iK,getElementRects:Ufe,getClientRects:Cfe,getDimensions:Lfe,getScale:y0,isElement:jr,isRTL:Ffe};function rK(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zfe(t,e){let n=null,i;const r=vf(t);function a(){var o;clearTimeout(i),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:d}=c;if(o||e(),!h||!d)return;const g=iw(f),b=iw(r.clientWidth-(u+h)),y=iw(r.clientHeight-(f+d)),p=iw(u),_={rootMargin:-g+"px "+-b+"px "+-y+"px "+-p+"px",threshold:eo(0,yu(1,l))||1};let w=!0;function M(S){const A=S[0].intersectionRatio;if(A!==l){if(!w)return s();A?s(!1,A):i=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!rK(c,t.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(M,{..._,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,_)}n.observe(t)}return s(!0),a}function FO(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=IL(t),u=r||a?[...c?sh(c):[],...sh(e)]:[];u.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),a&&p.addEventListener("resize",n)});const f=c&&o?zfe(c,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(p=>{let[x]=p;x&&x.target===c&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=d)==null||_.observe(e)})),n()}),c&&!l&&d.observe(c),d.observe(e));let g,b=l?Wm(t):null;l&&y();function y(){const p=Wm(t);b&&!rK(b,p)&&n(),b=p,g=requestAnimationFrame(y)}return n(),()=>{var p;u.forEach(x=>{r&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f?.(),(p=d)==null||p.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const jfe=_fe,Hfe=Sfe,Vfe=gfe,Gfe=Efe,Wfe=bfe,ez=mfe,Xfe=yfe,qfe=wfe,Kfe=(t,e,n)=>{const i=new Map,r={platform:Bfe,...n},a={...r.platform,_c:i};return pfe(t,e,{...r,platform:a})};var Yfe=typeof document<"u",Jfe=function(){},lM=Yfe?I.useLayoutEffect:Jfe;function p2(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!p2(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const a=r[i];if(!(a==="_owner"&&t.$$typeof)&&!p2(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function aK(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function tz(t,e){const n=aK(t);return Math.round(e*n)/n}function q3(t){const e=I.useRef(t);return lM(()=>{e.current=t}),e}function $fe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:c}=t,[u,f]=I.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,d]=I.useState(i);p2(h,i)||d(i);const[g,b]=I.useState(null),[y,p]=I.useState(null),x=I.useCallback(V=>{V!==S.current&&(S.current=V,b(V))},[]),_=I.useCallback(V=>{V!==A.current&&(A.current=V,p(V))},[]),w=a||g,M=s||y,S=I.useRef(null),A=I.useRef(null),C=I.useRef(u),k=l!=null,R=q3(l),N=q3(r),P=q3(c),j=I.useCallback(()=>{if(!S.current||!A.current)return;const V={placement:e,strategy:n,middleware:h};N.current&&(V.platform=N.current),Kfe(S.current,A.current,V).then(W=>{const B={...W,isPositioned:P.current!==!1};z.current&&!p2(C.current,B)&&(C.current=B,u_.flushSync(()=>{f(B)}))})},[h,e,n,N,P]);lM(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(V=>({...V,isPositioned:!1})))},[c]);const z=I.useRef(!1);lM(()=>(z.current=!0,()=>{z.current=!1}),[]),lM(()=>{if(w&&(S.current=w),M&&(A.current=M),w&&M){if(R.current)return R.current(w,M,j);j()}},[w,M,j,R,k]);const X=I.useMemo(()=>({reference:S,floating:A,setReference:x,setFloating:_}),[x,_]),F=I.useMemo(()=>({reference:w,floating:M}),[w,M]),H=I.useMemo(()=>{const V={position:n,left:0,top:0};if(!F.floating)return V;const W=tz(F.floating,u.x),B=tz(F.floating,u.y);return o?{...V,transform:"translate("+W+"px, "+B+"px)",...aK(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:B}},[n,o,F.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:j,refs:X,elements:F,floatingStyles:H}),[u,j,X,F,H])}const Zfe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:r}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?ez({element:i.current,padding:r}).fn(n):{}:i?ez({element:i,padding:r}).fn(n):{}}}},sK=(t,e)=>({...jfe(t),options:[t,e]}),NL=(t,e)=>({...Hfe(t),options:[t,e]}),nz=(t,e)=>({...qfe(t),options:[t,e]}),m2=(t,e)=>({...Vfe(t),options:[t,e]}),Qfe=(t,e)=>({...Gfe(t),options:[t,e]}),ehe=(t,e)=>({...Wfe(t),options:[t,e]}),Zx=(t,e)=>({...Xfe(t),options:[t,e]}),oK=(t,e)=>({...Zfe(t),options:[t,e]});function lK(t){const e=I.useRef(void 0),n=I.useCallback(i=>{const r=t.map(a=>{if(a!=null){if(typeof a=="function"){const s=a,o=s(i);return typeof o=="function"?o:()=>{s(null)}}return a.current=i,()=>{a.current=null}}});return()=>{r.forEach(a=>a?.())}},t);return I.useMemo(()=>t.every(i=>i==null)?null:i=>{e.current&&(e.current(),e.current=void 0),i!=null&&(e.current=n(i))},t)}const the="data-floating-ui-focusable",iz="active",rz="selected",nhe={...E7};let az=!1,ihe=0;const sz=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ihe++;function rhe(){const[t,e]=I.useState(()=>az?sz():void 0);return rf(()=>{t==null&&e(sz())},[]),I.useEffect(()=>{az=!0},[]),t}const ahe=nhe.useId,cK=ahe||rhe;function she(){const t=new Map;return{emit(e,n){var i;(i=t.get(e))==null||i.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var i;(i=t.get(e))==null||i.delete(n)}}}const ohe=I.createContext(null),lhe=I.createContext(null),LL=()=>{var t;return((t=I.useContext(ohe))==null?void 0:t.id)||null},PL=()=>I.useContext(lhe);function UL(t){return"data-floating-ui-"+t}function Zl(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const oz=UL("safe-polygon");function cM(t,e,n){if(n&&!UO(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const i=t();return typeof i=="number"?i:i?.[e]}return t?.[e]}function K3(t){return typeof t=="function"?t():t}function che(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,dataRef:r,events:a,elements:s}=t,{enabled:o=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:h=!0}=e,d=PL(),g=LL(),b=rw(c),y=rw(l),p=rw(n),x=rw(f),_=I.useRef(),w=I.useRef(-1),M=I.useRef(),S=I.useRef(-1),A=I.useRef(!0),C=I.useRef(!1),k=I.useRef(()=>{}),R=I.useRef(!1),N=Xu(()=>{var H;const V=(H=r.current.openEvent)==null?void 0:H.type;return V?.includes("mouse")&&V!=="mousedown"});I.useEffect(()=>{if(!o)return;function H(V){let{open:W}=V;W||(Zl(w),Zl(S),A.current=!0,R.current=!1)}return a.on("openchange",H),()=>{a.off("openchange",H)}},[o,a]),I.useEffect(()=>{if(!o||!b.current||!n)return;function H(W){N()&&i(!1,W,"hover")}const V=cm(s.floating).documentElement;return V.addEventListener("mouseleave",H),()=>{V.removeEventListener("mouseleave",H)}},[s.floating,n,i,o,b,N]);const P=I.useCallback(function(H,V,W){V===void 0&&(V=!0),W===void 0&&(W="hover");const B=cM(y.current,"close",_.current);B&&!M.current?(Zl(w),w.current=window.setTimeout(()=>i(!1,H,W),B)):V&&(Zl(w),i(!1,H,W))},[y,i]),j=Xu(()=>{k.current(),M.current=void 0}),z=Xu(()=>{if(C.current){const H=cm(s.floating).body;H.style.pointerEvents="",H.removeAttribute(oz),C.current=!1}}),X=Xu(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);I.useEffect(()=>{if(!o)return;function H(Z){if(Zl(w),A.current=!1,u&&!UO(_.current)||K3(x.current)>0&&!cM(y.current,"open"))return;const G=cM(y.current,"open",_.current);G?w.current=window.setTimeout(()=>{p.current||i(!0,Z,"hover")},G):n||i(!0,Z,"hover")}function V(Z){if(X()){z();return}k.current();const G=cm(s.floating);if(Zl(S),R.current=!1,b.current&&r.current.floatingContext){n||Zl(w),M.current=b.current({...r.current.floatingContext,tree:d,x:Z.clientX,y:Z.clientY,onClose(){z(),j(),X()||P(Z,!0,"safe-polygon")}});const oe=M.current;G.addEventListener("mousemove",oe),k.current=()=>{G.removeEventListener("mousemove",oe)};return}(_.current==="touch"?!P1(s.floating,Z.relatedTarget):!0)&&P(Z)}function W(Z){X()||r.current.floatingContext&&(b.current==null||b.current({...r.current.floatingContext,tree:d,x:Z.clientX,y:Z.clientY,onClose(){z(),j(),X()||P(Z)}})(Z))}function B(){Zl(w)}function Y(Z){X()||P(Z,!1)}if(jr(s.domReference)){const Z=s.domReference,G=s.floating;return n&&Z.addEventListener("mouseleave",W),h&&Z.addEventListener("mousemove",H,{once:!0}),Z.addEventListener("mouseenter",H),Z.addEventListener("mouseleave",V),G&&(G.addEventListener("mouseleave",W),G.addEventListener("mouseenter",B),G.addEventListener("mouseleave",Y)),()=>{n&&Z.removeEventListener("mouseleave",W),h&&Z.removeEventListener("mousemove",H),Z.removeEventListener("mouseenter",H),Z.removeEventListener("mouseleave",V),G&&(G.removeEventListener("mouseleave",W),G.removeEventListener("mouseenter",B),G.removeEventListener("mouseleave",Y))}}},[s,o,t,u,h,P,j,z,i,n,p,d,y,b,r,X,x]),rf(()=>{var H;if(o&&n&&(H=b.current)!=null&&(H=H.__options)!=null&&H.blockPointerEvents&&N()){C.current=!0;const W=s.floating;if(jr(s.domReference)&&W){var V;const B=cm(s.floating).body;B.setAttribute(oz,"");const Y=s.domReference,Z=d==null||(V=d.nodesRef.current.find(G=>G.id===g))==null||(V=V.context)==null?void 0:V.elements.floating;return Z&&(Z.style.pointerEvents=""),B.style.pointerEvents="none",Y.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{B.style.pointerEvents="",Y.style.pointerEvents="",W.style.pointerEvents=""}}}},[o,n,g,s,d,b,N]),rf(()=>{n||(_.current=void 0,R.current=!1,j(),z())},[n,j,z]),I.useEffect(()=>()=>{j(),Zl(w),Zl(S),z()},[o,s.domReference,j,z]);const F=I.useMemo(()=>{function H(V){_.current=V.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(V){const{nativeEvent:W}=V;function B(){!A.current&&!p.current&&i(!0,W,"hover")}u&&!UO(_.current)||n||K3(x.current)===0||R.current&&V.movementX**2+V.movementY**2<2||(Zl(S),_.current==="touch"?B():(R.current=!0,S.current=window.setTimeout(B,K3(x.current))))}}},[u,i,n,p,x]);return I.useMemo(()=>o?{reference:F}:{},[o,F])}const BO=()=>{},uK=I.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:BO,setState:BO,isInstantPhase:!1}),uhe=()=>I.useContext(uK);function fhe(t){const{children:e,delay:n,timeoutMs:i=0}=t,[r,a]=I.useReducer((l,c)=>({...l,...c}),{delay:n,timeoutMs:i,initialDelay:n,currentId:null,isInstantPhase:!1}),s=I.useRef(null),o=I.useCallback(l=>{a({currentId:l})},[]);return rf(()=>{r.currentId?s.current===null?s.current=r.currentId:r.isInstantPhase||a({isInstantPhase:!0}):(r.isInstantPhase&&a({isInstantPhase:!1}),s.current=null)},[r.currentId,r.isInstantPhase]),D.jsx(uK.Provider,{value:I.useMemo(()=>({...r,setState:a,setCurrentId:o}),[r,o]),children:e})}function hhe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,floatingId:r}=t,{id:a,enabled:s=!0}=e,o=a??r,l=uhe(),{currentId:c,setCurrentId:u,initialDelay:f,setState:h,timeoutMs:d}=l;return rf(()=>{s&&c&&(h({delay:{open:1,close:cM(f,"close")}}),c!==o&&i(!1))},[s,o,i,h,c,f]),rf(()=>{function g(){i(!1),h({delay:f,currentId:null})}if(s&&c&&!n&&c===o){if(d){const b=window.setTimeout(g,d);return()=>{clearTimeout(b)}}g()}},[s,n,h,c,o,i,f,d]),rf(()=>{s&&(u===BO||!n||u(o))},[s,n,u,o]),l}const dhe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},phe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},lz=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function mhe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,elements:r,dataRef:a}=t,{enabled:s=!0,escapeKey:o=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:g}=e,b=PL(),y=Xu(typeof l=="function"?l:()=>!1),p=typeof l=="function"?y:l,x=I.useRef(!1),{escapeKey:_,outsidePress:w}=lz(d),{escapeKey:M,outsidePress:S}=lz(g),A=I.useRef(!1),C=Xu(z=>{var X;if(!n||!s||!o||z.key!=="Escape"||A.current)return;const F=(X=a.current.floatingContext)==null?void 0:X.nodeId,H=b?oM(b.nodesRef.current,F):[];if(!_&&(z.stopPropagation(),H.length>0)){let V=!0;if(H.forEach(W=>{var B;if((B=W.context)!=null&&B.open&&!W.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}i(!1,lfe(z)?z.nativeEvent:z,"escape-key")}),k=Xu(z=>{var X;const F=()=>{var H;C(z),(H=Hb(z))==null||H.removeEventListener("keydown",F)};(X=Hb(z))==null||X.addEventListener("keydown",F)}),R=Xu(z=>{var X;const F=a.current.insideReactTree;a.current.insideReactTree=!1;const H=x.current;if(x.current=!1,c==="click"&&H||F||typeof p=="function"&&!p(z))return;const V=Hb(z),W="["+UL("inert")+"]",B=cm(r.floating).querySelectorAll(W);let Y=jr(V)?V:null;for(;Y&&!ah(Y);){const oe=bh(Y);if(ah(oe)||!jr(oe))break;Y=oe}if(B.length&&jr(V)&&!rfe(V)&&!P1(V,r.floating)&&Array.from(B).every(oe=>!P1(Y,oe)))return;if(Rl(V)&&j){const oe=ah(V),le=Mc(V),ue=/auto|scroll/,Se=oe||ue.test(le.overflowX),Te=oe||ue.test(le.overflowY),Pe=Se&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,je=Te&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,He=le.direction==="rtl",pe=je&&(He?z.offsetX<=V.offsetWidth-V.clientWidth:z.offsetX>V.clientWidth),ze=Pe&&z.offsetY>V.clientHeight;if(pe||ze)return}const Z=(X=a.current.floatingContext)==null?void 0:X.nodeId,G=b&&oM(b.nodesRef.current,Z).some(oe=>{var le;return W3(z,(le=oe.context)==null?void 0:le.elements.floating)});if(W3(z,r.floating)||W3(z,r.domReference)||G)return;const de=b?oM(b.nodesRef.current,Z):[];if(de.length>0){let oe=!0;if(de.forEach(le=>{var ue;if((ue=le.context)!=null&&ue.open&&!le.context.dataRef.current.__outsidePressBubbles){oe=!1;return}}),!oe)return}i(!1,z,"outside-press")}),N=Xu(z=>{var X;const F=()=>{var H;R(z),(H=Hb(z))==null||H.removeEventListener(c,F)};(X=Hb(z))==null||X.addEventListener(c,F)});I.useEffect(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=_,a.current.__outsidePressBubbles=w;let z=-1;function X(B){i(!1,B,"ancestor-scroll")}function F(){window.clearTimeout(z),A.current=!0}function H(){z=window.setTimeout(()=>{A.current=!1},hA()?5:0)}const V=cm(r.floating);o&&(V.addEventListener("keydown",M?k:C,M),V.addEventListener("compositionstart",F),V.addEventListener("compositionend",H)),p&&V.addEventListener(c,S?N:R,S);let W=[];return h&&(jr(r.domReference)&&(W=sh(r.domReference)),jr(r.floating)&&(W=W.concat(sh(r.floating))),!jr(r.reference)&&r.reference&&r.reference.contextElement&&(W=W.concat(sh(r.reference.contextElement)))),W=W.filter(B=>{var Y;return B!==((Y=V.defaultView)==null?void 0:Y.visualViewport)}),W.forEach(B=>{B.addEventListener("scroll",X,{passive:!0})}),()=>{o&&(V.removeEventListener("keydown",M?k:C,M),V.removeEventListener("compositionstart",F),V.removeEventListener("compositionend",H)),p&&V.removeEventListener(c,S?N:R,S),W.forEach(B=>{B.removeEventListener("scroll",X)}),window.clearTimeout(z)}},[a,r,o,p,c,n,i,h,s,_,w,C,M,k,R,S,N]),I.useEffect(()=>{a.current.insideReactTree=!1},[a,p,c]);const P=I.useMemo(()=>({onKeyDown:C,...u&&{[dhe[f]]:z=>{i(!1,z.nativeEvent,"reference-press")},...f!=="click"&&{onClick(z){i(!1,z.nativeEvent,"reference-press")}}}}),[C,i,u,f]),j=I.useMemo(()=>({onKeyDown:C,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[phe[c]]:()=>{a.current.insideReactTree=!0}}),[C,c,a]);return I.useMemo(()=>s?{reference:P,floating:j}:{},[s,P,j])}function ghe(t){const{open:e=!1,onOpenChange:n,elements:i}=t,r=cK(),a=I.useRef({}),[s]=I.useState(()=>she()),o=LL()!=null,[l,c]=I.useState(i.reference),u=Xu((d,g,b)=>{a.current.openEvent=d?g:void 0,s.emit("openchange",{open:d,event:g,reason:b,nested:o}),n?.(d,g,b)}),f=I.useMemo(()=>({setPositionReference:c}),[]),h=I.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return I.useMemo(()=>({dataRef:a,open:e,onOpenChange:u,elements:h,events:s,floatingId:r,refs:f}),[e,u,h,s,r,f])}function FL(t){t===void 0&&(t={});const{nodeId:e}=t,n=ghe({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||n,r=i.elements,[a,s]=I.useState(null),[o,l]=I.useState(null),u=r?.domReference||a,f=I.useRef(null),h=PL();rf(()=>{u&&(f.current=u)},[u]);const d=$fe({...t,elements:{...r,...o&&{reference:o}}}),g=I.useCallback(_=>{const w=jr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;l(w),d.refs.setReference(w)},[d.refs]),b=I.useCallback(_=>{(jr(_)||_===null)&&(f.current=_,s(_)),(jr(d.refs.reference.current)||d.refs.reference.current===null||_!==null&&!jr(_))&&d.refs.setReference(_)},[d.refs]),y=I.useMemo(()=>({...d.refs,setReference:b,setPositionReference:g,domReference:f}),[d.refs,b,g]),p=I.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),x=I.useMemo(()=>({...d,...i,refs:y,elements:p,nodeId:e}),[d,y,p,e,i]);return rf(()=>{i.dataRef.current.floatingContext=x;const _=h?.nodesRef.current.find(w=>w.id===e);_&&(_.context=x)}),I.useMemo(()=>({...d,context:x,refs:y,elements:p}),[d,y,p,x])}function Y3(){return tfe()&&efe()}function bhe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,events:r,dataRef:a,elements:s}=t,{enabled:o=!0,visibleOnly:l=!0}=e,c=I.useRef(!1),u=I.useRef(-1),f=I.useRef(!0);I.useEffect(()=>{if(!o)return;const d=Ho(s.domReference);function g(){!n&&Rl(s.domReference)&&s.domReference===qB(cm(s.domReference))&&(c.current=!0)}function b(){f.current=!0}function y(){f.current=!1}return d.addEventListener("blur",g),Y3()&&(d.addEventListener("keydown",b,!0),d.addEventListener("pointerdown",y,!0)),()=>{d.removeEventListener("blur",g),Y3()&&(d.removeEventListener("keydown",b,!0),d.removeEventListener("pointerdown",y,!0))}},[s.domReference,n,o]),I.useEffect(()=>{if(!o)return;function d(g){let{reason:b}=g;(b==="reference-press"||b==="escape-key")&&(c.current=!0)}return r.on("openchange",d),()=>{r.off("openchange",d)}},[r,o]),I.useEffect(()=>()=>{Zl(u)},[]);const h=I.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(d){if(c.current)return;const g=Hb(d.nativeEvent);if(l&&jr(g)){if(Y3()&&!d.relatedTarget){if(!f.current&&!afe(g))return}else if(!sfe(g))return}i(!0,d.nativeEvent,"focus")},onBlur(d){c.current=!1;const g=d.relatedTarget,b=d.nativeEvent,y=jr(g)&&g.hasAttribute(UL("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var p;const x=qB(s.domReference?s.domReference.ownerDocument:document);!g&&x===s.domReference||P1((p=a.current.floatingContext)==null?void 0:p.refs.floating.current,x)||P1(s.domReference,x)||y||i(!1,b,"focus")})}}),[a,s.domReference,i,l]);return I.useMemo(()=>o?{reference:h}:{},[o,h])}function J3(t,e,n){const i=new Map,r=n==="item";let a=t;if(r&&t){const{[iz]:s,[rz]:o,...l}=t;a=l}return{...n==="floating"&&{tabIndex:-1,[the]:""},...a,...e.map(s=>{const o=s?s[n]:null;return typeof o=="function"?t?o(t):null:o}).concat(t).reduce((s,o)=>(o&&Object.entries(o).forEach(l=>{let[c,u]=l;if(!(r&&[iz,rz].includes(c)))if(c.indexOf("on")===0){if(i.has(c)||i.set(c,[]),typeof u=="function"){var f;(f=i.get(c))==null||f.push(u),s[c]=function(){for(var h,d=arguments.length,g=new Array(d),b=0;b<d;b++)g[b]=arguments[b];return(h=i.get(c))==null?void 0:h.map(y=>y(...g)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function vhe(t){t===void 0&&(t=[]);const e=t.map(o=>o?.reference),n=t.map(o=>o?.floating),i=t.map(o=>o?.item),r=I.useCallback(o=>J3(o,t,"reference"),e),a=I.useCallback(o=>J3(o,t,"floating"),n),s=I.useCallback(o=>J3(o,t,"item"),i);return I.useMemo(()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:s}),[r,a,s])}const yhe=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function xhe(t,e){var n,i;e===void 0&&(e={});const{open:r,elements:a,floatingId:s}=t,{enabled:o=!0,role:l="dialog"}=e,c=cK(),u=((n=a.domReference)==null?void 0:n.id)||c,f=I.useMemo(()=>{var x;return((x=ofe(a.floating))==null?void 0:x.id)||s},[a.floating,s]),h=(i=yhe.get(l))!=null?i:l,g=LL()!=null,b=I.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?f:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":r?f:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:u},...h==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,f,g,r,u,l]),y=I.useMemo(()=>{const x={id:f,...h&&{role:h}};return h==="tooltip"||l==="label"?x:{...x,...h==="menu"&&{"aria-labelledby":u}}},[h,f,u,l]),p=I.useCallback(x=>{let{active:_,selected:w}=x;const M={role:"option",..._&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...M,"aria-selected":w}}return{}},[f,l]);return I.useMemo(()=>o?{reference:b,floating:y,item:p}:{},[o,b,y,p])}const[_he,kc]=Mu("ScrollArea.Root component was not found in tree");function q0(t,e){const n=im(e);kv(()=>{let i=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(i),r.unobserve(t)}}},[t,n])}const She=I.forwardRef((t,e)=>{const{style:n,...i}=t,r=kc(),[a,s]=I.useState(0),[o,l]=I.useState(0),c=!!(a&&o);return q0(r.scrollbarX,()=>{const u=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(u),l(u)}),q0(r.scrollbarY,()=>{const u=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(u),s(u)}),c?D.jsx("div",{...i,ref:e,style:{...n,width:a,height:o}}):null}),whe=I.forwardRef((t,e)=>{const n=kc(),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?D.jsx(She,{...t,ref:e}):null}),Ehe={scrollHideDelay:1e3,type:"hover"},fK=I.forwardRef((t,e)=>{const{type:n,scrollHideDelay:i,scrollbars:r,getStyles:a,...s}=Pt("ScrollAreaRoot",Ehe,t),[o,l]=I.useState(null),[c,u]=I.useState(null),[f,h]=I.useState(null),[d,g]=I.useState(null),[b,y]=I.useState(null),[p,x]=I.useState(0),[_,w]=I.useState(0),[M,S]=I.useState(!1),[A,C]=I.useState(!1),k=Va(e,R=>l(R));return D.jsx(_he,{value:{type:n,scrollHideDelay:i,scrollArea:o,viewport:c,onViewportChange:u,content:f,onContentChange:h,scrollbarX:d,onScrollbarXChange:g,scrollbarXEnabled:M,onScrollbarXEnabledChange:S,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:C,onCornerWidthChange:x,onCornerHeightChange:w,getStyles:a},children:D.jsx(st,{...s,ref:k,__vars:{"--sa-corner-width":r!=="xy"?"0px":`${p}px`,"--sa-corner-height":r!=="xy"?"0px":`${_}px`}})})});fK.displayName="@mantine/core/ScrollAreaRoot";function hK(t,e){const n=t/e;return Number.isNaN(n)?0:n}function mA(t){const e=hK(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function dK(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function Mhe(t,[e,n]){return Math.min(n,Math.max(e,t))}function cz(t,e,n="ltr"){const i=mA(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-r,s=e.content-e.viewport,o=a-i,l=n==="ltr"?[0,s]:[s*-1,0],c=Mhe(t,l);return dK([0,s],[0,o])(c)}function The(t,e,n,i="ltr"){const r=mA(n),a=r/2,s=e||a,o=r-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-o,u=n.content-n.viewport,f=i==="ltr"?[0,u]:[u*-1,0];return dK([l,c],f)(t)}function pK(t,e){return t>0&&t<e}function Ed(t){return t?parseInt(t,10):0}function km(t,e,{checkForDefaultPrevented:n=!0}={}){return i=>{t?.(i),(n===!1||!i.defaultPrevented)&&e?.(i)}}const[Ahe,mK]=Mu("ScrollAreaScrollbar was not found in tree"),gK=I.forwardRef((t,e)=>{const{sizes:n,hasThumb:i,onThumbChange:r,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:o,onDragScroll:l,onWheelScroll:c,onResize:u,...f}=t,h=kc(),[d,g]=I.useState(null),b=Va(e,C=>g(C)),y=I.useRef(null),p=I.useRef(""),{viewport:x}=h,_=n.content-n.viewport,w=im(c),M=im(o),S=eA(u,10),A=C=>{if(y.current){const k=C.clientX-y.current.left,R=C.clientY-y.current.top;l({x:k,y:R})}};return I.useEffect(()=>{const C=k=>{const R=k.target;d?.contains(R)&&w(k,_)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[x,d,_,w]),I.useEffect(M,[n,M]),q0(d,S),q0(h.content,S),D.jsx(Ahe,{value:{scrollbar:d,hasThumb:i,onThumbChange:im(r),onThumbPointerUp:im(a),onThumbPositionChange:M,onThumbPointerDown:im(s)},children:D.jsx("div",{...f,ref:b,"data-mantine-scrollbar":!0,style:{position:"absolute",...f.style},onPointerDown:km(t.onPointerDown,C=>{C.preventDefault(),C.button===0&&(C.target.setPointerCapture(C.pointerId),y.current=d.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(C))}),onPointerMove:km(t.onPointerMove,A),onPointerUp:km(t.onPointerUp,C=>{const k=C.target;k.hasPointerCapture(C.pointerId)&&(C.preventDefault(),k.releasePointerCapture(C.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=p.current,y.current=null}})})}),bK=I.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,style:r,...a}=t,s=kc(),[o,l]=I.useState(),c=I.useRef(null),u=Va(e,c,s.onScrollbarXChange);return I.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),D.jsx(gK,{"data-orientation":"horizontal",...a,ref:u,sizes:n,style:{...r,"--sa-thumb-width":`${mA(n)}px`},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const d=s.viewport.scrollLeft+f.deltaX;t.onWheelScroll(d),pK(d,h)&&f.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Ed(o.paddingLeft),paddingEnd:Ed(o.paddingRight)}})}})});bK.displayName="@mantine/core/ScrollAreaScrollbarX";const vK=I.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,style:r,...a}=t,s=kc(),[o,l]=I.useState(),c=I.useRef(null),u=Va(e,c,s.onScrollbarYChange);return I.useEffect(()=>{c.current&&l(window.getComputedStyle(c.current))},[]),D.jsx(gK,{...a,"data-orientation":"vertical",ref:u,sizes:n,style:{"--sa-thumb-height":`${mA(n)}px`,...r},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const d=s.viewport.scrollTop+f.deltaY;t.onWheelScroll(d),pK(d,h)&&f.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Ed(o.paddingTop),paddingEnd:Ed(o.paddingBottom)}})}})});vK.displayName="@mantine/core/ScrollAreaScrollbarY";const gA=I.forwardRef((t,e)=>{const{orientation:n="vertical",...i}=t,{dir:r}=Nv(),a=kc(),s=I.useRef(null),o=I.useRef(0),[l,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=hK(l.viewport,l.content),f={...i,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>{s.current=d},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:d=>{o.current=d}},h=(d,g)=>The(d,o.current,l,g);return n==="horizontal"?D.jsx(bK,{...f,ref:e,onThumbPositionChange:()=>{if(a.viewport&&s.current){const d=a.viewport.scrollLeft,g=cz(d,l,r);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:d=>{a.viewport&&(a.viewport.scrollLeft=d)},onDragScroll:d=>{a.viewport&&(a.viewport.scrollLeft=h(d,r))}}):n==="vertical"?D.jsx(vK,{...f,ref:e,onThumbPositionChange:()=>{if(a.viewport&&s.current){const d=a.viewport.scrollTop,g=cz(d,l);l.scrollbar.size===0?s.current.style.setProperty("--thumb-opacity","0"):s.current.style.setProperty("--thumb-opacity","1"),s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:d=>{a.viewport&&(a.viewport.scrollTop=d)},onDragScroll:d=>{a.viewport&&(a.viewport.scrollTop=h(d))}}):null});gA.displayName="@mantine/core/ScrollAreaScrollbarVisible";const BL=I.forwardRef((t,e)=>{const n=kc(),{forceMount:i,...r}=t,[a,s]=I.useState(!1),o=t.orientation==="horizontal",l=eA(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(o?c:u)}},10);return q0(n.viewport,l),q0(n.content,l),i||a?D.jsx(gA,{"data-state":a?"visible":"hidden",...r,ref:e}):null});BL.displayName="@mantine/core/ScrollAreaScrollbarAuto";const yK=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kc(),[a,s]=I.useState(!1);return I.useEffect(()=>{const{scrollArea:o}=r;let l=0;if(o){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),r.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",u)}}},[r.scrollArea,r.scrollHideDelay]),n||a?D.jsx(BL,{"data-state":a?"visible":"hidden",...i,ref:e}):null});yK.displayName="@mantine/core/ScrollAreaScrollbarHover";const Che=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kc(),a=t.orientation==="horizontal",[s,o]=I.useState("hidden"),l=eA(()=>o("idle"),100);return I.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>o("hidden"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,r.scrollHideDelay]),I.useEffect(()=>{const{viewport:c}=r,u=a?"scrollLeft":"scrollTop";if(c){let f=c[u];const h=()=>{const d=c[u];f!==d&&(o("scrolling"),l()),f=d};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[r.viewport,a,l]),n||s!=="hidden"?D.jsx(gA,{"data-state":s==="hidden"?"hidden":"visible",...i,ref:e,onPointerEnter:km(t.onPointerEnter,()=>o("interacting")),onPointerLeave:km(t.onPointerLeave,()=>o("idle"))}):null}),zO=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kc(),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=r,o=t.orientation==="horizontal";return I.useEffect(()=>(o?a(!0):s(!0),()=>{o?a(!1):s(!1)}),[o,a,s]),r.type==="hover"?D.jsx(yK,{...i,ref:e,forceMount:n}):r.type==="scroll"?D.jsx(Che,{...i,ref:e,forceMount:n}):r.type==="auto"?D.jsx(BL,{...i,ref:e,forceMount:n}):r.type==="always"?D.jsx(gA,{...i,ref:e}):null});zO.displayName="@mantine/core/ScrollAreaScrollbar";function Rhe(t,e=()=>{}){let n={left:t.scrollLeft,top:t.scrollTop},i=0;return function r(){const a={left:t.scrollLeft,top:t.scrollTop},s=n.left!==a.left,o=n.top!==a.top;(s||o)&&e(),n=a,i=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(i)}const xK=I.forwardRef((t,e)=>{const{style:n,...i}=t,r=kc(),a=mK(),{onThumbPositionChange:s}=a,o=Va(e,u=>a.onThumbChange(u)),l=I.useRef(void 0),c=eA(()=>{l.current&&(l.current(),l.current=void 0)},100);return I.useEffect(()=>{const{viewport:u}=r;if(u){const f=()=>{if(c(),!l.current){const h=Rhe(u,s);l.current=h,s()}};return s(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[r.viewport,c,s]),D.jsx("div",{"data-state":a.hasThumb?"visible":"hidden",...i,ref:o,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:km(t.onPointerDownCapture,u=>{const h=u.target.getBoundingClientRect(),d=u.clientX-h.left,g=u.clientY-h.top;a.onThumbPointerDown({x:d,y:g})}),onPointerUp:km(t.onPointerUp,a.onThumbPointerUp)})});xK.displayName="@mantine/core/ScrollAreaThumb";const jO=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=mK();return n||r.hasThumb?D.jsx(xK,{ref:e,...i}):null});jO.displayName="@mantine/core/ScrollAreaThumb";const _K=I.forwardRef(({children:t,style:e,...n},i)=>{const r=kc(),a=Va(i,r.onViewportChange);return D.jsx(st,{...n,ref:a,style:{overflowX:r.scrollbarXEnabled?"scroll":"hidden",overflowY:r.scrollbarYEnabled?"scroll":"hidden",...e},children:D.jsx("div",{...r.getStyles("content"),ref:r.onContentChange,children:t})})});_K.displayName="@mantine/core/ScrollAreaViewport";var zL={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const SK={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},khe=(t,{scrollbarSize:e,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":Et(e),"--scrollarea-over-scroll-behavior":n}}),Dc=Zt((t,e)=>{const n=Pt("ScrollArea",SK,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,scrollbarSize:l,vars:c,type:u,scrollHideDelay:f,viewportProps:h,viewportRef:d,onScrollPositionChange:g,children:b,offsetScrollbars:y,scrollbars:p,onBottomReached:x,onTopReached:_,overscrollBehavior:w,attributes:M,...S}=n,[A,C]=I.useState(!1),[k,R]=I.useState(!1),[N,P]=I.useState(!1),j=En({name:"ScrollArea",props:n,classes:zL,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:M,vars:c,varsResolver:khe}),z=I.useRef(null),X=lK([d,z]);return I.useEffect(()=>{if(!z.current||y!=="present")return;const F=z.current,H=new ResizeObserver(()=>{const{scrollHeight:V,clientHeight:W,scrollWidth:B,clientWidth:Y}=F;R(V>W),P(B>Y)});return H.observe(F),()=>H.disconnect()},[z,y]),D.jsxs(fK,{getStyles:j,type:u==="never"?"always":u,scrollHideDelay:f,ref:e,scrollbars:p,...j("root"),...S,children:[D.jsx(_K,{...h,...j("viewport",{style:h?.style}),ref:X,"data-offset-scrollbars":y===!0?"xy":y||void 0,"data-scrollbars":p||void 0,"data-horizontal-hidden":y==="present"&&!N?"true":void 0,"data-vertical-hidden":y==="present"&&!k?"true":void 0,onScroll:F=>{h?.onScroll?.(F),g?.({x:F.currentTarget.scrollLeft,y:F.currentTarget.scrollTop});const{scrollTop:H,scrollHeight:V,clientHeight:W}=F.currentTarget;H-(V-W)>=-.6&&x?.(),H===0&&_?.()},children:b}),(p==="xy"||p==="x")&&D.jsx(zO,{...j("scrollbar"),orientation:"horizontal","data-hidden":u==="never"||y==="present"&&!N?!0:void 0,forceMount:!0,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:D.jsx(jO,{...j("thumb")})}),(p==="xy"||p==="y")&&D.jsx(zO,{...j("scrollbar"),orientation:"vertical","data-hidden":u==="never"||y==="present"&&!k?!0:void 0,forceMount:!0,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:D.jsx(jO,{...j("thumb")})}),D.jsx(whe,{...j("corner"),"data-hovered":A||void 0,"data-hidden":u==="never"||void 0})]})});Dc.displayName="@mantine/core/ScrollArea";const jL=Zt((t,e)=>{const{children:n,classNames:i,styles:r,scrollbarSize:a,scrollHideDelay:s,type:o,dir:l,offsetScrollbars:c,viewportRef:u,onScrollPositionChange:f,unstyled:h,variant:d,viewportProps:g,scrollbars:b,style:y,vars:p,onBottomReached:x,onTopReached:_,onOverflowChange:w,...M}=Pt("ScrollAreaAutosize",SK,t),S=I.useRef(null),A=lK([u,S]),[C,k]=I.useState(!1),R=I.useRef(!1);return I.useEffect(()=>{if(!w)return;const N=S.current;if(!N)return;const P=()=>{const z=N.scrollHeight>N.clientHeight;z!==C&&(R.current?w?.(z):(R.current=!0,z&&w?.(!0)),k(z))};P();const j=new ResizeObserver(P);return j.observe(N),()=>j.disconnect()},[w,C]),D.jsx(st,{...M,ref:e,style:[{display:"flex",overflow:"hidden"},y],children:D.jsx(st,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...b==="y"&&{minWidth:0},...b==="x"&&{minHeight:0},...b==="xy"&&{minWidth:0,minHeight:0},...b===!1&&{minWidth:0,minHeight:0}},children:D.jsx(Dc,{classNames:i,styles:r,scrollHideDelay:s,scrollbarSize:a,type:o,dir:l,offsetScrollbars:c,viewportRef:A,onScrollPositionChange:f,unstyled:h,variant:d,viewportProps:g,vars:p,scrollbars:b,onBottomReached:x,onTopReached:_,"data-autosize":"true",children:n})})})});Dc.classes=zL;jL.displayName="@mantine/core/ScrollAreaAutosize";jL.classes=zL;Dc.Autosize=jL;var wK={root:"m_87cf2631"};const Dhe={__staticSelector:"UnstyledButton"},uf=Dl((t,e)=>{const n=Pt("UnstyledButton",Dhe,t),{className:i,component:r="button",__staticSelector:a,unstyled:s,classNames:o,styles:l,style:c,attributes:u,...f}=n,h=En({name:a,props:n,classes:wK,className:i,style:c,classNames:o,styles:l,unstyled:s,attributes:u});return D.jsx(st,{...h("root",{focusable:!0}),component:r,ref:e,type:r==="button"?"button":void 0,...f})});uf.classes=wK;uf.displayName="@mantine/core/UnstyledButton";var EK={root:"m_515a97f8"};const HL=Zt((t,e)=>{const n=Pt("VisuallyHidden",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,attributes:c,...u}=n,f=En({name:"VisuallyHidden",classes:EK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:c});return D.jsx(st,{component:"span",ref:e,...f("root"),...u})});HL.classes=EK;HL.displayName="@mantine/core/VisuallyHidden";var MK={root:"m_1b7284a3"};const Ohe=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:ta(e),"--paper-shadow":SL(n)}}),Ps=Dl((t,e)=>{const n=Pt("Paper",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,withBorder:l,vars:c,radius:u,shadow:f,variant:h,mod:d,attributes:g,...b}=n,y=En({name:"Paper",props:n,classes:MK,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:c,varsResolver:Ohe});return D.jsx(st,{ref:e,mod:[{"data-with-border":l},d],...y("root"),variant:h,...b})});Ps.classes=MK;Ps.displayName="@mantine/core/Paper";function uz(t,e,n,i){return t==="center"||i==="center"?{top:e}:t==="end"?{bottom:n}:t==="start"?{top:n}:{}}function fz(t,e,n,i,r){return t==="center"||i==="center"?{left:e}:t==="end"?{[r==="ltr"?"right":"left"]:n}:t==="start"?{[r==="ltr"?"left":"right"]:n}:{}}const Ihe={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function Nhe({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,arrowX:a,arrowY:s,dir:o}){const[l,c="center"]=t.split("-"),u={width:e,height:e,transform:"rotate(45deg)",position:"absolute",[Ihe[l]]:i},f=-e/2;return l==="left"?{...u,...uz(c,s,n,r),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:l==="right"?{...u,...uz(c,s,n,r),left:f,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:l==="top"?{...u,...fz(c,a,n,r,o),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:l==="bottom"?{...u,...fz(c,a,n,r,o),top:f,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const g2=I.forwardRef(({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,visible:a,arrowX:s,arrowY:o,style:l,...c},u)=>{const{dir:f}=Nv();return a?D.jsx("div",{...c,ref:u,style:{...l,...Nhe({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,dir:f,arrowX:s,arrowY:o})}}):null});g2.displayName="@mantine/core/FloatingArrow";function TK(t,e){if(t==="rtl"&&(e.includes("right")||e.includes("left"))){const[n,i]=e.split("-"),r=n==="right"?"left":"right";return i===void 0?r:`${r}-${i}`}return e}var AK={root:"m_9814e45f"};const Lhe={zIndex:bf("modal")},Phe=(t,{gradient:e,color:n,backgroundOpacity:i,blur:r,radius:a,zIndex:s})=>({root:{"--overlay-bg":e||(n!==void 0||i!==void 0)&&ic(n||"#000",i??.6)||void 0,"--overlay-filter":r?`blur(${Et(r)})`:void 0,"--overlay-radius":a===void 0?void 0:ta(a),"--overlay-z-index":s?.toString()}}),bA=Dl((t,e)=>{const n=Pt("Overlay",Lhe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,fixed:c,center:u,children:f,radius:h,zIndex:d,gradient:g,blur:b,color:y,backgroundOpacity:p,mod:x,attributes:_,...w}=n,M=En({name:"Overlay",props:n,classes:AK,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:_,vars:l,varsResolver:Phe});return D.jsx(st,{ref:e,...M("root"),mod:[{center:u,fixed:c},x],...w,children:f})});bA.classes=AK;bA.displayName="@mantine/core/Overlay";function $3(t){const e=document.createElement("div");return e.setAttribute("data-portal","true"),typeof t.className=="string"&&e.classList.add(...t.className.split(" ").filter(Boolean)),typeof t.style=="object"&&Object.assign(e.style,t.style),typeof t.id=="string"&&e.setAttribute("id",t.id),e}function Uhe({target:t,reuseTargetNode:e,...n}){if(t)return typeof t=="string"?document.querySelector(t)||$3(n):t;if(e){const i=document.querySelector("[data-mantine-shared-portal-node]");if(i)return i;const r=$3(n);return r.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(r),r}return $3(n)}const Fhe={reuseTargetNode:!0},VL=Zt((t,e)=>{const{children:n,target:i,reuseTargetNode:r,...a}=Pt("Portal",Fhe,t),[s,o]=I.useState(!1),l=I.useRef(null);return kv(()=>(o(!0),l.current=Uhe({target:i,reuseTargetNode:r,...a}),o2(e,l.current),!i&&!r&&l.current&&document.body.appendChild(l.current),()=>{!i&&!r&&l.current&&document.body.removeChild(l.current)}),[i]),!s||!l.current?null:u_.createPortal(D.jsx(D.Fragment,{children:n}),l.current)});VL.displayName="@mantine/core/Portal";const Gd=Zt(({withinPortal:t=!0,children:e,...n},i)=>oA()==="test"||!t?D.jsx(D.Fragment,{children:e}):D.jsx(VL,{ref:i,...n,children:e}));Gd.displayName="@mantine/core/OptionalPortal";const Fy=t=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${t==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),aw={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Fy("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Fy("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Fy("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Fy("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Fy("top"),common:{transformOrigin:"top right"}}},hz={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function Bhe({transition:t,state:e,duration:n,timingFunction:i}){const r={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:i};return typeof t=="string"?t in aw?{transitionProperty:aw[t].transitionProperty,...r,...aw[t].common,...aw[t][hz[e]]}:{}:{transitionProperty:t.transitionProperty,...r,...t.common,...t[hz[e]]}}function zhe({duration:t,exitDuration:e,timingFunction:n,mounted:i,onEnter:r,onExit:a,onEntered:s,onExited:o,enterDelay:l,exitDelay:c}){const u=ba(),f=tA(),h=u.respectReducedMotion?f:!1,[d,g]=I.useState(h?0:t),[b,y]=I.useState(i?"entered":"exited"),p=I.useRef(-1),x=I.useRef(-1),_=I.useRef(-1);function w(){window.clearTimeout(p.current),window.clearTimeout(x.current),cancelAnimationFrame(_.current)}const M=A=>{w();const C=A?r:a,k=A?s:o,R=h?0:A?t:e;g(R),R===0?(typeof C=="function"&&C(),typeof k=="function"&&k(),y(A?"entered":"exited")):_.current=requestAnimationFrame(()=>{xx.flushSync(()=>{y(A?"pre-entering":"pre-exiting")}),_.current=requestAnimationFrame(()=>{typeof C=="function"&&C(),y(A?"entering":"exiting"),p.current=window.setTimeout(()=>{typeof k=="function"&&k(),y(A?"entered":"exited")},R)})})},S=A=>{if(w(),typeof(A?l:c)!="number"){M(A);return}x.current=window.setTimeout(()=>{M(A)},A?l:c)};return _c(()=>{S(i)},[i]),I.useEffect(()=>()=>{w()},[]),{transitionDuration:d,transitionStatus:b,transitionTimingFunction:n||"ease"}}function Tc({keepMounted:t,transition:e="fade",duration:n=250,exitDuration:i=n,mounted:r,children:a,timingFunction:s="ease",onExit:o,onEntered:l,onEnter:c,onExited:u,enterDelay:f,exitDelay:h}){const d=oA(),{transitionDuration:g,transitionStatus:b,transitionTimingFunction:y}=zhe({mounted:r,exitDuration:i,duration:n,timingFunction:s,onExit:o,onEntered:l,onEnter:c,onExited:u,enterDelay:f,exitDelay:h});return g===0||d==="test"?r?D.jsx(D.Fragment,{children:a({})}):t?a({display:"none"}):null:b==="exited"?t?a({display:"none"}):null:D.jsx(D.Fragment,{children:a(Bhe({transition:e,duration:g,state:b,timingFunction:y}))})}Tc.displayName="@mantine/core/Transition";const[jhe,CK]=Mu("Popover component was not found in the tree");function vA({children:t,active:e=!0,refProp:n="ref",innerRef:i}){const r=qoe(e),a=Va(r,i);return lg(t)?I.cloneElement(t,{[n]:a}):t}function RK(t){return D.jsx(HL,{tabIndex:-1,"data-autofocus":!0,...t})}vA.displayName="@mantine/core/FocusTrap";RK.displayName="@mantine/core/FocusTrapInitialFocus";vA.InitialFocus=RK;var kK={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const GL=Zt((t,e)=>{const n=Pt("PopoverDropdown",null,t),{className:i,style:r,vars:a,children:s,onKeyDownCapture:o,variant:l,classNames:c,styles:u,...f}=n,h=CK(),d=uq({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},b=Va(e,h.floating);return h.disabled?null:D.jsx(Gd,{...h.portalProps,withinPortal:h.withinPortal,children:D.jsx(Tc,{mounted:h.opened,...h.transitionProps,transition:h.transitionProps?.transition||"fade",duration:h.transitionProps?.duration??150,keepMounted:h.keepMounted,exitDuration:typeof h.transitionProps?.exitDuration=="number"?h.transitionProps.exitDuration:h.transitionProps?.duration,children:y=>D.jsx(vA,{active:h.trapFocus&&h.opened,innerRef:b,children:D.jsxs(st,{...g,...f,variant:l,onKeyDownCapture:yce(()=>{h.onClose?.(),h.onDismiss?.()},{active:h.closeOnEscape,onTrigger:d,onKeyDown:o}),"data-position":h.placement,"data-fixed":h.floatingStrategy==="fixed"||void 0,...h.getStyles("dropdown",{className:i,props:n,classNames:c,styles:u,style:[{...y,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:Et(h.width),...h.referenceHidden?{display:"none"}:null},h.resolvedStyles.dropdown,u?.dropdown,r]}),children:[s,D.jsx(g2,{ref:h.arrowRef,arrowX:h.arrowX,arrowY:h.arrowY,visible:h.withArrow,position:h.placement,arrowSize:h.arrowSize,arrowRadius:h.arrowRadius,arrowOffset:h.arrowOffset,arrowPosition:h.arrowPosition,...h.getStyles("arrow",{props:n,classNames:c,styles:u})})]})})})})});GL.classes=kK;GL.displayName="@mantine/core/PopoverDropdown";const Hhe={refProp:"ref",popupType:"dialog"},DK=Zt((t,e)=>{const{children:n,refProp:i,popupType:r,...a}=Pt("PopoverTarget",Hhe,t);if(!lg(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=a,o=CK(),l=Va(o.reference,rA(n),e),c=o.withRoles?{"aria-haspopup":r,"aria-expanded":o.opened,"aria-controls":o.getDropdownId(),id:o.getTargetId()}:{};return I.cloneElement(n,{...s,...c,...o.targetProps,className:us(o.targetProps.className,s.className,n.props.className),[i]:l,...o.controlled?null:{onClick:()=>{o.onToggle(),n.props.onClick?.()}}})});DK.displayName="@mantine/core/PopoverTarget";function Vhe(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function Ghe(t,e,n){const i=Vhe(t.middlewares),r=[sK(t.offset),ehe()];return t.dropdownVisible&&n!=="test"&&t.preventPositionChangeWhenVisible&&(i.flip=!1),i.shift&&r.push(NL(typeof i.shift=="boolean"?{limiter:nz(),padding:5}:{limiter:nz(),padding:5,...i.shift})),i.flip&&r.push(typeof i.flip=="boolean"?m2():m2(i.flip)),i.inline&&r.push(typeof i.inline=="boolean"?Zx():Zx(i.inline)),r.push(oK({element:t.arrowRef,padding:t.arrowOffset})),(i.size||t.width==="target")&&r.push(Qfe({...typeof i.size=="boolean"?{}:i.size,apply({rects:a,availableWidth:s,availableHeight:o,...l}){const u=e().refs.floating.current?.style??{};i.size&&(typeof i.size=="object"&&i.size.apply?i.size.apply({rects:a,availableWidth:s,availableHeight:o,...l}):Object.assign(u,{maxWidth:`${s}px`,maxHeight:`${o}px`})),t.width==="target"&&Object.assign(u,{width:`${a.reference.width}px`})}})),r}function Whe(t){const e=oA(),[n,i]=Wo({value:t.opened,defaultValue:t.defaultOpened,finalValue:!1,onChange:t.onChange}),r=I.useRef(n),a=()=>{n&&!t.disabled&&i(!1)},s=()=>{t.disabled||i(!n)},o=FL({strategy:t.strategy,placement:t.preventPositionChangeWhenVisible?t.positionRef.current:t.position,middleware:Ghe(t,()=>o,e),whileElementsMounted:t.keepMounted?void 0:FO});return I.useEffect(()=>{if(!(!o.refs.reference.current||!o.refs.floating.current)&&n)return FO(o.refs.reference.current,o.refs.floating.current,o.update)},[n,o.update]),_c(()=>{t.onPositionChange?.(o.placement),t.positionRef.current=o.placement},[o.placement,t.preventPositionChangeWhenVisible]),_c(()=>{n!==r.current&&(n?t.onOpen?.():t.onClose?.()),r.current=n},[n,t.onClose,t.onOpen]),_c(()=>{let l=-1;return n&&(l=window.setTimeout(()=>t.setDropdownVisible(!0),4)),()=>{window.clearTimeout(l)}},[n,t.position]),{floating:o,controlled:typeof t.opened=="boolean",opened:n,onClose:a,onToggle:s}}const Xhe={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:bf("popover"),__staticSelector:"Popover",width:"max-content"},qhe=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:ta(e),"--popover-shadow":SL(n)}});function Vo(t){const e=Pt("Popover",Xhe,t),{children:n,position:i,offset:r,onPositionChange:a,positionDependencies:s,opened:o,transitionProps:l,onExitTransitionEnd:c,onEnterTransitionEnd:u,width:f,middlewares:h,withArrow:d,arrowSize:g,arrowOffset:b,arrowRadius:y,arrowPosition:p,unstyled:x,classNames:_,styles:w,closeOnClickOutside:M,withinPortal:S,portalProps:A,closeOnEscape:C,clickOutsideEvents:k,trapFocus:R,onClose:N,onDismiss:P,onOpen:j,onChange:z,zIndex:X,radius:F,shadow:H,id:V,defaultOpened:W,__staticSelector:B,withRoles:Y,disabled:Z,returnFocus:G,variant:de,keepMounted:oe,vars:le,floatingStrategy:ue,withOverlay:Se,overlayProps:Te,hideDetached:Pe,attributes:je,preventPositionChangeWhenVisible:He,...pe}=e,ze=En({name:B,props:e,classes:kK,classNames:_,styles:w,unstyled:x,attributes:je,rootSelector:"dropdown",vars:le,varsResolver:qhe}),{resolvedStyles:Ie}=Iv({classNames:_,styles:w,props:e}),[Xe,we]=I.useState(o??W??!1),Ae=I.useRef(i),Re=I.useRef(null),[Ne,Fe]=I.useState(null),[Qe,ae]=I.useState(null),{dir:K}=Nv(),ce=oA(),he=Eu(V),me=Whe({middlewares:h,width:f,position:TK(K,i),offset:typeof r=="number"?r+(d?g/2:0):r,arrowRef:Re,arrowOffset:b,onPositionChange:a,positionDependencies:s,opened:o,defaultOpened:W,onChange:z,onOpen:j,onClose:N,onDismiss:P,strategy:ue,dropdownVisible:Xe,setDropdownVisible:we,positionRef:Ae,disabled:Z,preventPositionChangeWhenVisible:He,keepMounted:oe});Uoe(()=>{M&&(me.onClose(),P?.())},k,[Ne,Qe]);const $=I.useCallback(Ge=>{Fe(Ge),me.floating.refs.setReference(Ge)},[me.floating.refs.setReference]),Ve=I.useCallback(Ge=>{ae(Ge),me.floating.refs.setFloating(Ge)},[me.floating.refs.setFloating]),qe=I.useCallback(()=>{l?.onExited?.(),c?.(),we(!1),He||(Ae.current=i)},[l?.onExited,c,He,i]),mt=I.useCallback(()=>{l?.onEntered?.(),u?.()},[l?.onEntered,u]);return D.jsxs(jhe,{value:{returnFocus:G,disabled:Z,controlled:me.controlled,reference:$,floating:Ve,x:me.floating.x,y:me.floating.y,arrowX:me.floating?.middlewareData?.arrow?.x,arrowY:me.floating?.middlewareData?.arrow?.y,opened:me.opened,arrowRef:Re,transitionProps:{...l,onExited:qe,onEntered:mt},width:f,withArrow:d,arrowSize:g,arrowOffset:b,arrowRadius:y,arrowPosition:p,placement:me.floating.placement,trapFocus:R,withinPortal:S,portalProps:A,zIndex:X,radius:F,shadow:H,closeOnEscape:C,onDismiss:P,onClose:me.onClose,onToggle:me.onToggle,getTargetId:()=>`${he}-target`,getDropdownId:()=>`${he}-dropdown`,withRoles:Y,targetProps:pe,__staticSelector:B,classNames:_,styles:w,unstyled:x,variant:de,keepMounted:oe,getStyles:ze,resolvedStyles:Ie,floatingStrategy:ue,referenceHidden:Pe&&ce!=="test"?me.floating.middlewareData.hide?.referenceHidden:!1},children:[n,Se&&D.jsx(Tc,{transition:"fade",mounted:me.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:Ge=>D.jsx(Gd,{withinPortal:S,children:D.jsx(bA,{...Te,...ze("overlay",{className:Te?.className,style:[Ge,Te?.style]})})})})]})}Vo.Target=DK;Vo.Dropdown=GL;Vo.displayName="@mantine/core/Popover";Vo.extend=t=>t;var hu={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const OK=I.forwardRef(({className:t,...e},n)=>D.jsxs(st,{component:"span",className:us(hu.barsLoader,t),...e,ref:n,children:[D.jsx("span",{className:hu.bar}),D.jsx("span",{className:hu.bar}),D.jsx("span",{className:hu.bar})]}));OK.displayName="@mantine/core/Bars";const IK=I.forwardRef(({className:t,...e},n)=>D.jsxs(st,{component:"span",className:us(hu.dotsLoader,t),...e,ref:n,children:[D.jsx("span",{className:hu.dot}),D.jsx("span",{className:hu.dot}),D.jsx("span",{className:hu.dot})]}));IK.displayName="@mantine/core/Dots";const NK=I.forwardRef(({className:t,...e},n)=>D.jsx(st,{component:"span",className:us(hu.ovalLoader,t),...e,ref:n}));NK.displayName="@mantine/core/Oval";const LK={bars:OK,oval:NK,dots:IK},Khe={loaders:LK,type:"oval"},Yhe=(t,{size:e,color:n})=>({root:{"--loader-size":ci(e,"loader-size"),"--loader-color":n?ea(n,t):void 0}}),Zd=Zt((t,e)=>{const n=Pt("Loader",Khe,t),{size:i,color:r,type:a,vars:s,className:o,style:l,classNames:c,styles:u,unstyled:f,loaders:h,variant:d,children:g,attributes:b,...y}=n,p=En({name:"Loader",props:n,classes:hu,className:o,style:l,classNames:c,styles:u,unstyled:f,attributes:b,vars:s,varsResolver:Yhe});return g?D.jsx(st,{...p("root"),ref:e,...y,children:g}):D.jsx(st,{...p("root"),ref:e,component:h[a],variant:d,size:i,...y})});Zd.defaultLoaders=LK;Zd.classes=hu;Zd.displayName="@mantine/core/Loader";var Uv={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const dz={orientation:"horizontal"},Jhe=(t,{borderWidth:e})=>({group:{"--ai-border-width":Et(e)}}),WL=Zt((t,e)=>{const n=Pt("ActionIconGroup",dz,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,orientation:l,vars:c,borderWidth:u,variant:f,mod:h,attributes:d,...g}=Pt("ActionIconGroup",dz,t),b=En({name:"ActionIconGroup",props:n,classes:Uv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:c,varsResolver:Jhe,rootSelector:"group"});return D.jsx(st,{...b("group"),ref:e,variant:f,mod:[{"data-orientation":l},h],role:"group",...g})});WL.classes=Uv;WL.displayName="@mantine/core/ActionIconGroup";const $he=(t,{radius:e,color:n,gradient:i,variant:r,autoContrast:a,size:s})=>{const o=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":ci(s,"section-height"),"--section-padding-x":ci(s,"section-padding-x"),"--section-fz":os(s),"--section-radius":e===void 0?void 0:ta(e),"--section-bg":n||r?o.background:void 0,"--section-color":o.color,"--section-bd":n||r?o.border:void 0}}},XL=Zt((t,e)=>{const n=Pt("ActionIconGroupSection",null,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,vars:l,variant:c,gradient:u,radius:f,autoContrast:h,attributes:d,...g}=n,b=En({name:"ActionIconGroupSection",props:n,classes:Uv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:$he,rootSelector:"groupSection"});return D.jsx(st,{...b("groupSection"),ref:e,variant:c,...g})});XL.classes=Uv;XL.displayName="@mantine/core/ActionIconGroupSection";const Zhe=(t,{size:e,radius:n,variant:i,gradient:r,color:a,autoContrast:s})=>{const o=t.variantColorResolver({color:a||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:s});return{root:{"--ai-size":ci(e,"ai-size"),"--ai-radius":n===void 0?void 0:ta(n),"--ai-bg":a||i?o.background:void 0,"--ai-hover":a||i?o.hover:void 0,"--ai-hover-color":a||i?o.hoverColor:void 0,"--ai-color":o.color,"--ai-bd":a||i?o.border:void 0}}},Ol=Dl((t,e)=>{const n=Pt("ActionIcon",null,t),{className:i,unstyled:r,variant:a,classNames:s,styles:o,style:l,loading:c,loaderProps:u,size:f,color:h,radius:d,__staticSelector:g,gradient:b,vars:y,children:p,disabled:x,"data-disabled":_,autoContrast:w,mod:M,attributes:S,...A}=n,C=En({name:["ActionIcon",g],props:n,className:i,style:l,classes:Uv,classNames:s,styles:o,unstyled:r,attributes:S,vars:y,varsResolver:Zhe});return D.jsxs(uf,{...C("root",{active:!x&&!c&&!_}),...A,unstyled:r,variant:a,size:f,disabled:x||c,ref:e,mod:[{loading:c,disabled:x||_},M],children:[typeof c=="boolean"&&D.jsx(Tc,{mounted:c,transition:"slide-down",duration:150,children:k=>D.jsx(st,{component:"span",...C("loader",{style:k}),"aria-hidden":!0,children:D.jsx(Zd,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...u})})}),D.jsx(st,{component:"span",mod:{loading:c},...C("icon"),children:p})]})});Ol.classes=Uv;Ol.displayName="@mantine/core/ActionIcon";Ol.Group=WL;Ol.GroupSection=XL;const PK=I.forwardRef(({size:t="var(--cb-icon-size, 70%)",style:e,...n},i)=>D.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:t,height:t},ref:i,...n,children:D.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));PK.displayName="@mantine/core/CloseIcon";var UK={root:"m_86a44da5","root--subtle":"m_220c80f2"};const Qhe={variant:"subtle"},ede=(t,{size:e,radius:n,iconSize:i})=>({root:{"--cb-size":ci(e,"cb-size"),"--cb-radius":n===void 0?void 0:ta(n),"--cb-icon-size":Et(i)}}),k_=Dl((t,e)=>{const n=Pt("CloseButton",Qhe,t),{iconSize:i,children:r,vars:a,radius:s,className:o,classNames:l,style:c,styles:u,unstyled:f,"data-disabled":h,disabled:d,variant:g,icon:b,mod:y,attributes:p,__staticSelector:x,..._}=n,w=En({name:x||"CloseButton",props:n,className:o,style:c,classes:UK,classNames:l,styles:u,unstyled:f,attributes:p,vars:a,varsResolver:ede});return D.jsxs(uf,{ref:e,..._,unstyled:f,variant:g,disabled:d,mod:[{disabled:d||h},y],...w("root",{variant:g,active:!d&&!h}),children:[b||D.jsx(PK,{}),r]})});k_.classes=UK;k_.displayName="@mantine/core/CloseButton";function tde(t){return I.Children.toArray(t).filter(Boolean)}var FK={root:"m_4081bf90"};const nde={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},ide=(t,{grow:e,preventGrowOverflow:n,gap:i,align:r,justify:a,wrap:s},{childWidth:o})=>({root:{"--group-child-width":e&&n?o:void 0,"--group-gap":Hd(i),"--group-align":r,"--group-justify":a,"--group-wrap":s}}),K0=Zt((t,e)=>{const n=Pt("Group",nde,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,children:l,gap:c,align:u,justify:f,wrap:h,grow:d,preventGrowOverflow:g,vars:b,variant:y,__size:p,mod:x,attributes:_,...w}=n,M=tde(l),S=M.length,A=Hd(c??"md"),k={childWidth:`calc(${100/S}% - (${A} - ${A} / ${S}))`},R=En({name:"Group",props:n,stylesCtx:k,className:r,style:a,classes:FK,classNames:i,styles:s,unstyled:o,attributes:_,vars:b,varsResolver:ide});return D.jsx(st,{...R("root"),ref:e,variant:y,mod:[{grow:d},x],size:p,...w,children:M})});K0.classes=FK;K0.displayName="@mantine/core/Group";const[rde,wh]=Mu("ModalBase component was not found in tree");function ade({opened:t,transitionDuration:e}){const[n,i]=I.useState(t),r=I.useRef(-1),s=tA()?0:e;return I.useEffect(()=>(t?(i(!0),window.clearTimeout(r.current)):s===0?i(!1):r.current=window.setTimeout(()=>i(!1),s),()=>window.clearTimeout(r.current)),[t,s]),n}function sde({id:t,transitionProps:e,opened:n,trapFocus:i,closeOnEscape:r,onClose:a,returnFocus:s}){const o=Eu(t),[l,c]=I.useState(!1),[u,f]=I.useState(!1),h=typeof e?.duration=="number"?e?.duration:200,d=ade({opened:n,transitionDuration:h});return Zoe("keydown",g=>{g.key==="Escape"&&r&&!g.isComposing&&n&&g.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&a()},{capture:!0}),uq({opened:n,shouldReturnFocus:i&&s}),{_id:o,titleMounted:l,bodyMounted:u,shouldLockScroll:d,setTitleMounted:c,setBodyMounted:f}}const BK=I.forwardRef(({keepMounted:t,opened:e,onClose:n,id:i,transitionProps:r,onExitTransitionEnd:a,onEnterTransitionEnd:s,trapFocus:o,closeOnEscape:l,returnFocus:c,closeOnClickOutside:u,withinPortal:f,portalProps:h,lockScroll:d,children:g,zIndex:b,shadow:y,padding:p,__vars:x,unstyled:_,removeScrollProps:w,...M},S)=>{const{_id:A,titleMounted:C,bodyMounted:k,shouldLockScroll:R,setTitleMounted:N,setBodyMounted:P}=sde({id:i,transitionProps:r,opened:e,trapFocus:o,closeOnEscape:l,onClose:n,returnFocus:c}),{key:j,...z}=w||{};return D.jsx(Gd,{...h,withinPortal:f,children:D.jsx(rde,{value:{opened:e,onClose:n,closeOnClickOutside:u,onExitTransitionEnd:a,onEnterTransitionEnd:s,transitionProps:{...r,keepMounted:t},getTitleId:()=>`${A}-title`,getBodyId:()=>`${A}-body`,titleMounted:C,bodyMounted:k,setTitleMounted:N,setBodyMounted:P,trapFocus:o,closeOnEscape:l,zIndex:b,unstyled:_},children:D.jsx(c2,{enabled:R&&d,...z,children:D.jsx(st,{ref:S,...M,__vars:{...x,"--mb-z-index":(b||bf("modal")).toString(),"--mb-shadow":SL(y),"--mb-padding":Hd(p)},children:g})},j)})})});BK.displayName="@mantine/core/ModalBase";function ode(){const t=wh();return I.useEffect(()=>(t.setBodyMounted(!0),()=>t.setBodyMounted(!1)),[]),t.getBodyId()}var Y0={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const zK=I.forwardRef(({className:t,...e},n)=>{const i=ode(),r=wh();return D.jsx(st,{ref:n,...e,id:i,className:us({[Y0.body]:!r.unstyled},t)})});zK.displayName="@mantine/core/ModalBaseBody";const jK=I.forwardRef(({className:t,onClick:e,...n},i)=>{const r=wh();return D.jsx(k_,{ref:i,...n,onClick:a=>{r.onClose(),e?.(a)},className:us({[Y0.close]:!r.unstyled},t),unstyled:r.unstyled})});jK.displayName="@mantine/core/ModalBaseCloseButton";const HK=I.forwardRef(({transitionProps:t,className:e,innerProps:n,onKeyDown:i,style:r,...a},s)=>{const o=wh();return D.jsx(Tc,{mounted:o.opened,transition:"pop",...o.transitionProps,onExited:()=>{o.onExitTransitionEnd?.(),o.transitionProps?.onExited?.()},onEntered:()=>{o.onEnterTransitionEnd?.(),o.transitionProps?.onEntered?.()},...t,children:l=>D.jsx("div",{...n,className:us({[Y0.inner]:!o.unstyled},n.className),children:D.jsx(vA,{active:o.opened&&o.trapFocus,innerRef:s,children:D.jsx(Ps,{...a,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":o.bodyMounted?o.getBodyId():void 0,"aria-labelledby":o.titleMounted?o.getTitleId():void 0,style:[r,l],className:us({[Y0.content]:!o.unstyled},e),unstyled:o.unstyled,children:a.children})})})})});HK.displayName="@mantine/core/ModalBaseContent";const VK=I.forwardRef(({className:t,...e},n)=>{const i=wh();return D.jsx(st,{component:"header",ref:n,className:us({[Y0.header]:!i.unstyled},t),...e})});VK.displayName="@mantine/core/ModalBaseHeader";const lde={duration:200,timingFunction:"ease",transition:"fade"};function cde(t){const e=wh();return{...lde,...e.transitionProps,...t}}const GK=I.forwardRef(({onClick:t,transitionProps:e,style:n,visible:i,...r},a)=>{const s=wh(),o=cde(e);return D.jsx(Tc,{mounted:i!==void 0?i:s.opened,...o,transition:"fade",children:l=>D.jsx(bA,{ref:a,fixed:!0,style:[n,l],zIndex:s.zIndex,unstyled:s.unstyled,onClick:c=>{t?.(c),s.closeOnClickOutside&&s.onClose()},...r})})});GK.displayName="@mantine/core/ModalBaseOverlay";function ude(){const t=wh();return I.useEffect(()=>(t.setTitleMounted(!0),()=>t.setTitleMounted(!1)),[]),t.getTitleId()}const WK=I.forwardRef(({className:t,...e},n)=>{const i=ude(),r=wh();return D.jsx(st,{component:"h2",ref:n,className:us({[Y0.title]:!r.unstyled},t),...e,id:i})});WK.displayName="@mantine/core/ModalBaseTitle";function fde({children:t}){return D.jsx(D.Fragment,{children:t})}const[hde,dde]=A_({size:"sm"}),XK=Zt((t,e)=>{const n=Pt("InputClearButton",null,t),{size:i,variant:r,vars:a,classNames:s,styles:o,...l}=n,c=dde(),{resolvedClassNames:u,resolvedStyles:f}=Iv({classNames:s,styles:o,props:n});return D.jsx(k_,{variant:r||"transparent",ref:e,size:i||c?.size||"sm",classNames:u,styles:f,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});XK.displayName="@mantine/core/InputClearButton";const pde={xs:7,sm:8,md:10,lg:12,xl:15};function mde({__clearable:t,__clearSection:e,rightSection:n,__defaultRightSection:i,size:r="sm"}){const a=t&&e;return a&&(n||i)?D.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:pde[r]},children:[a,n||i]}):n||a||i}const[gde,D_]=A_({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Oc={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const bde=(t,{size:e})=>({description:{"--input-description-size":e===void 0?void 0:`calc(${os(e)} - ${Et(2)})`}}),yA=Zt((t,e)=>{const n=Pt("InputDescription",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,size:c,__staticSelector:u,__inheritStyles:f=!0,attributes:h,variant:d,...g}=Pt("InputDescription",null,n),b=D_(),y=En({name:["InputWrapper",u],props:n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:h,rootSelector:"description",vars:l,varsResolver:bde}),p=f&&b?.getStyles||y;return D.jsx(st,{component:"p",ref:e,variant:d,size:c,...p("description",b?.getStyles?{className:r,style:a}:void 0),...g})});yA.classes=Oc;yA.displayName="@mantine/core/InputDescription";const vde=(t,{size:e})=>({error:{"--input-error-size":e===void 0?void 0:`calc(${os(e)} - ${Et(2)})`}}),xA=Zt((t,e)=>{const n=Pt("InputError",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,size:c,attributes:u,__staticSelector:f,__inheritStyles:h=!0,variant:d,...g}=n,b=En({name:["InputWrapper",f],props:n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:u,rootSelector:"error",vars:l,varsResolver:vde}),y=D_(),p=h&&y?.getStyles||b;return D.jsx(st,{component:"p",ref:e,variant:d,size:c,...p("error",y?.getStyles?{className:r,style:a}:void 0),...g})});xA.classes=Oc;xA.displayName="@mantine/core/InputError";const pz={labelElement:"label"},yde=(t,{size:e})=>({label:{"--input-label-size":os(e),"--input-asterisk-color":void 0}}),_A=Zt((t,e)=>{const n=Pt("InputLabel",pz,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,labelElement:c,size:u,required:f,htmlFor:h,onMouseDown:d,children:g,__staticSelector:b,variant:y,mod:p,attributes:x,..._}=Pt("InputLabel",pz,n),w=En({name:["InputWrapper",b],props:n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:x,rootSelector:"label",vars:l,varsResolver:yde}),M=D_(),S=M?.getStyles||w;return D.jsxs(st,{...S("label",M?.getStyles?{className:r,style:a}:void 0),component:c,variant:y,size:u,ref:e,htmlFor:c==="label"?h:void 0,mod:[{required:f},p],onMouseDown:A=>{d?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},..._,children:[g,f&&D.jsx("span",{...S("required"),"aria-hidden":!0,children:" *"})]})});_A.classes=Oc;_A.displayName="@mantine/core/InputLabel";const qL=Zt((t,e)=>{const n=Pt("InputPlaceholder",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,__staticSelector:c,variant:u,error:f,mod:h,attributes:d,...g}=n,b=En({name:["InputPlaceholder",c],props:n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,rootSelector:"placeholder"});return D.jsx(st,{...b("placeholder"),mod:[{error:!!f},h],component:"span",variant:u,ref:e,...g})});qL.classes=Oc;qL.displayName="@mantine/core/InputPlaceholder";function xde(t,{hasDescription:e,hasError:n}){const i=t.findIndex(l=>l==="input"),r=t.slice(0,i),a=t.slice(i+1),s=e&&r.includes("description")||n&&r.includes("error");return{offsetBottom:e&&a.includes("description")||n&&a.includes("error"),offsetTop:s}}const _de={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},Sde=(t,{size:e})=>({label:{"--input-label-size":os(e),"--input-asterisk-color":void 0},error:{"--input-error-size":e===void 0?void 0:`calc(${os(e)} - ${Et(2)})`},description:{"--input-description-size":e===void 0?void 0:`calc(${os(e)} - ${Et(2)})`}}),KL=Zt((t,e)=>{const n=Pt("InputWrapper",_de,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,size:c,variant:u,__staticSelector:f,inputContainer:h,inputWrapperOrder:d,label:g,error:b,description:y,labelProps:p,descriptionProps:x,errorProps:_,labelElement:w,children:M,withAsterisk:S,id:A,required:C,__stylesApiProps:k,mod:R,attributes:N,...P}=n,j=En({name:["InputWrapper",f],props:k||n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:N,vars:l,varsResolver:Sde}),z={size:c,variant:u,__staticSelector:f},X=Eu(A),F=typeof S=="boolean"?S:C,H=_?.id||`${X}-error`,V=x?.id||`${X}-description`,W=X,B=!!b&&typeof b!="boolean",Y=!!y,Z=`${B?H:""} ${Y?V:""}`,G=Z.trim().length>0?Z.trim():void 0,de=p?.id||`${X}-label`,oe=g&&D.jsx(_A,{labelElement:w,id:de,htmlFor:W,required:F,...z,...p,children:g},"label"),le=Y&&D.jsx(yA,{...x,...z,size:x?.size||z.size,id:x?.id||V,children:y},"description"),ue=D.jsx(I.Fragment,{children:h(M)},"input"),Se=B&&I.createElement(xA,{..._,...z,size:_?.size||z.size,key:"error",id:_?.id||H},b),Te=d.map(Pe=>{switch(Pe){case"label":return oe;case"input":return ue;case"description":return le;case"error":return Se;default:return null}});return D.jsx(gde,{value:{getStyles:j,describedBy:G,inputId:W,labelId:de,...xde(d,{hasDescription:Y,hasError:B})},children:D.jsx(st,{ref:e,variant:u,size:c,mod:[{error:!!b},R],...j("root"),...P,children:Te})})});KL.classes=Oc;KL.displayName="@mantine/core/InputWrapper";const wde={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},Ede=(t,e,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":ci(e.size,"input-height"),"--input-fz":os(e.size),"--input-radius":e.radius===void 0?void 0:ta(e.radius),"--input-left-section-width":e.leftSectionWidth!==void 0?Et(e.leftSectionWidth):void 0,"--input-right-section-width":e.rightSectionWidth!==void 0?Et(e.rightSectionWidth):void 0,"--input-padding-y":e.multiline?ci(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),ga=Dl((t,e)=>{const n=Pt("Input",wde,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,required:l,__staticSelector:c,__stylesApiProps:u,size:f,wrapperProps:h,error:d,disabled:g,leftSection:b,leftSectionProps:y,leftSectionWidth:p,rightSection:x,rightSectionProps:_,rightSectionWidth:w,rightSectionPointerEvents:M,leftSectionPointerEvents:S,variant:A,vars:C,pointer:k,multiline:R,radius:N,id:P,withAria:j,withErrorStyles:z,mod:X,inputSize:F,attributes:H,__clearSection:V,__clearable:W,__defaultRightSection:B,...Y}=n,{styleProps:Z,rest:G}=C_(Y),de=D_(),oe={offsetBottom:de?.offsetBottom,offsetTop:de?.offsetTop},le=En({name:["Input",c],props:u||n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:H,stylesCtx:oe,rootSelector:"wrapper",vars:C,varsResolver:Ede}),ue=j?{required:l,disabled:g,"aria-invalid":!!d,"aria-describedby":de?.describedBy,id:de?.inputId||P}:{},Se=mde({__clearable:W,__clearSection:V,rightSection:x,__defaultRightSection:B,size:f});return D.jsx(hde,{value:{size:f||"sm"},children:D.jsxs(st,{...le("wrapper"),...Z,...h,mod:[{error:!!d&&z,pointer:k,disabled:g,multiline:R,"data-with-right-section":!!Se,"data-with-left-section":!!b},X],variant:A,size:f,children:[b&&D.jsx("div",{...y,"data-position":"left",...le("section",{className:y?.className,style:y?.style}),children:b}),D.jsx(st,{component:"input",...G,...ue,ref:e,required:l,mod:{disabled:g,error:!!d&&z},variant:A,__size:F,...le("input")}),Se&&D.jsx("div",{..._,"data-position":"right",...le("section",{className:_?.className,style:_?.style}),children:Se})]})})});ga.classes=Oc;ga.Wrapper=KL;ga.Label=_A;ga.Error=xA;ga.Description=yA;ga.Placeholder=qL;ga.ClearButton=XK;ga.displayName="@mantine/core/Input";function qK(t,e,n){const i=Pt(t,e,n),{label:r,description:a,error:s,required:o,classNames:l,styles:c,className:u,unstyled:f,__staticSelector:h,__stylesApiProps:d,errorProps:g,labelProps:b,descriptionProps:y,wrapperProps:p,id:x,size:_,style:w,inputContainer:M,inputWrapperOrder:S,withAsterisk:A,variant:C,vars:k,mod:R,attributes:N,...P}=i,{styleProps:j,rest:z}=C_(P),X={label:r,description:a,error:s,required:o,classNames:l,className:u,__staticSelector:h,__stylesApiProps:d||i,errorProps:g,labelProps:b,descriptionProps:y,unstyled:f,styles:c,size:_,style:w,inputContainer:M,inputWrapperOrder:S,withAsterisk:A,variant:C,id:x,mod:R,attributes:N,...p};return{...z,classNames:l,styles:c,unstyled:f,wrapperProps:{...X,...j},inputProps:{required:o,classNames:l,styles:c,unstyled:f,size:_,__staticSelector:h,__stylesApiProps:d||i,error:s,variant:C,id:x,attributes:N}}}const Mde={__staticSelector:"InputBase",withAria:!0,size:"sm"},Tu=Dl((t,e)=>{const{inputProps:n,wrapperProps:i,...r}=qK("InputBase",Mde,t);return D.jsx(ga.Wrapper,{...i,children:D.jsx(ga,{...n,...r,ref:e})})});Tu.classes={...ga.classes,...ga.Wrapper.classes};Tu.displayName="@mantine/core/InputBase";const Tde={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var KK={root:"m_8bffd616"};const ff=Dl((t,e)=>{const n=Pt("Flex",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,gap:c,rowGap:u,columnGap:f,align:h,justify:d,wrap:g,direction:b,attributes:y,...p}=n,x=En({name:"Flex",classes:KK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l}),_=ba(),w=Gq(),M=Vq({styleProps:{gap:c,rowGap:u,columnGap:f,align:h,justify:d,wrap:g,direction:b},theme:_,data:Tde});return D.jsxs(D.Fragment,{children:[M.hasResponsiveStyles&&D.jsx(Hq,{selector:`.${w}`,styles:M.styles,media:M.media}),D.jsx(st,{ref:e,...x("root",{className:w,style:iA(M.inlineStyles)}),...p})]})});ff.classes=KK;ff.displayName="@mantine/core/Flex";function Ade(t,e){if(!e||!t)return!1;let n=e.parentNode;for(;n!=null;){if(n===t)return!0;n=n.parentNode}return!1}function Cde({target:t,parent:e,ref:n,displayAfterTransitionEnd:i}){const r=I.useRef(-1),[a,s]=I.useState(!1),[o,l]=I.useState(typeof i=="boolean"?i:!1),c=()=>{if(!t||!e||!n.current)return;const d=t.getBoundingClientRect(),g=e.getBoundingClientRect(),b=window.getComputedStyle(t),y=window.getComputedStyle(e),p=Ed(b.borderTopWidth)+Ed(y.borderTopWidth),x=Ed(b.borderLeftWidth)+Ed(y.borderLeftWidth),_={top:d.top-g.top-p,left:d.left-g.left-x,width:d.width,height:d.height};n.current.style.transform=`translateY(${_.top}px) translateX(${_.left}px)`,n.current.style.width=`${_.width}px`,n.current.style.height=`${_.height}px`},u=()=>{window.clearTimeout(r.current),n.current&&(n.current.style.transitionDuration="0ms"),c(),r.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},f=I.useRef(null),h=I.useRef(null);return I.useEffect(()=>{if(c(),t)return f.current=new ResizeObserver(u),f.current.observe(t),e&&(h.current=new ResizeObserver(u),h.current.observe(e)),()=>{f.current?.disconnect(),h.current?.disconnect()}},[e,t]),I.useEffect(()=>{if(e){const d=g=>{Ade(g.target,e)&&(u(),l(!1))};return e.addEventListener("transitionend",d),()=>{e.removeEventListener("transitionend",d)}}},[e]),ile(()=>{Nq()!=="test"&&s(!0)},20,{autoInvoke:!0}),ole(d=>{d.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&u()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:a,hidden:o}}var YK={root:"m_96b553a6"};const Rde=(t,{transitionDuration:e})=>({root:{"--transition-duration":typeof e=="number"?`${e}ms`:e}}),YL=Zt((t,e)=>{const n=Pt("FloatingIndicator",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,target:c,parent:u,transitionDuration:f,mod:h,displayAfterTransitionEnd:d,attributes:g,...b}=n,y=En({name:"FloatingIndicator",classes:YK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:Rde}),p=I.useRef(null),{initialized:x,hidden:_}=Cde({target:c,parent:u,ref:p,displayAfterTransitionEnd:d}),w=Va(e,p);return!c||!u?null:D.jsx(st,{ref:w,mod:[{initialized:x,hidden:_},h],...y("root"),...b})});YL.displayName="@mantine/core/FloatingIndicator";YL.classes=YK;var JK={root:"m_b6d8b162"};function kde(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const Dde={inherit:!1},Ode=(t,{variant:e,lineClamp:n,gradient:i,size:r,color:a})=>({root:{"--text-fz":os(r),"--text-lh":Iq(r),"--text-gradient":e==="gradient"?kO(i,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":a?ea(a,t):void 0}}),bu=Dl((t,e)=>{const n=Pt("Text",Dde,t),{lineClamp:i,truncate:r,inline:a,inherit:s,gradient:o,span:l,__staticSelector:c,vars:u,className:f,style:h,classNames:d,styles:g,unstyled:b,variant:y,mod:p,size:x,attributes:_,...w}=n,M=En({name:["Text",c],props:n,classes:JK,className:f,style:h,classNames:d,styles:g,unstyled:b,attributes:_,vars:u,varsResolver:Ode});return D.jsx(st,{...M("root",{focusable:!0}),ref:e,component:l?"span":"p",variant:y,mod:[{"data-truncate":kde(r),"data-line-clamp":typeof i=="number","data-inline":a,"data-inherit":s},p],size:x,...w})});bu.classes=JK;bu.displayName="@mantine/core/Text";var $K={root:"m_849cf0da"};const Ide={underline:"hover"},Dm=Dl((t,e)=>{const{underline:n,className:i,unstyled:r,mod:a,...s}=Pt("Anchor",Ide,t);return D.jsx(bu,{component:"a",ref:e,className:us({[$K.root]:!r},i),...s,mod:[{underline:n},a],__staticSelector:"Anchor",unstyled:r})});Dm.classes=$K;Dm.displayName="@mantine/core/Anchor";function ZK(t){return typeof t=="string"?{value:t,label:t}:"value"in t&&!("label"in t)?{value:t.value,label:t.value,disabled:t.disabled}:typeof t=="number"?{value:t.toString(),label:t.toString()}:"group"in t?{group:t.group,items:t.items.map(e=>ZK(e))}:t}function Nde(t){return t?t.map(e=>ZK(e)):[]}function QK(t){return t.reduce((e,n)=>"group"in n?{...e,...QK(n.items)}:(e[n.value]=n,e),{})}var Xo={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const Lde={error:null},Pde=(t,{size:e,color:n})=>({chevron:{"--combobox-chevron-size":ci(e,"combobox-chevron-size"),"--combobox-chevron-color":n?ea(n,t):void 0}}),JL=Zt((t,e)=>{const n=Pt("ComboboxChevron",Lde,t),{size:i,error:r,style:a,className:s,classNames:o,styles:l,unstyled:c,vars:u,mod:f,...h}=n,d=En({name:"ComboboxChevron",classes:Xo,props:n,style:a,className:s,classNames:o,styles:l,unstyled:c,vars:u,varsResolver:Pde,rootSelector:"chevron"});return D.jsx(st,{component:"svg",...h,...d("chevron"),size:i,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:r},f],ref:e,children:D.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});JL.classes=Xo;JL.displayName="@mantine/core/ComboboxChevron";const[Ude,Ic]=Mu("Combobox component was not found in tree"),eY=I.forwardRef(({size:t,onMouseDown:e,onClick:n,onClear:i,...r},a)=>D.jsx(ga.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:s=>{s.preventDefault(),e?.(s)},onClick:s=>{i(),n?.(s)}}));eY.displayName="@mantine/core/ComboboxClearButton";const $L=Zt((t,e)=>{const{classNames:n,styles:i,className:r,style:a,hidden:s,...o}=Pt("ComboboxDropdown",null,t),l=Ic();return D.jsx(Vo.Dropdown,{...o,ref:e,role:"presentation","data-hidden":s||void 0,...l.getStyles("dropdown",{className:r,style:a,classNames:n,styles:i})})});$L.classes=Xo;$L.displayName="@mantine/core/ComboboxDropdown";const Fde={refProp:"ref"},tY=Zt((t,e)=>{const{children:n,refProp:i}=Pt("ComboboxDropdownTarget",Fde,t);if(Ic(),!lg(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return D.jsx(Vo.Target,{ref:e,refProp:i,children:n})});tY.displayName="@mantine/core/ComboboxDropdownTarget";const ZL=Zt((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ComboboxEmpty",null,t),l=Ic();return D.jsx(st,{ref:e,...l.getStyles("empty",{className:i,classNames:n,styles:a,style:r}),...o})});ZL.classes=Xo;ZL.displayName="@mantine/core/ComboboxEmpty";function QL({onKeyDown:t,withKeyboardNavigation:e,withAriaAttributes:n,withExpandedAttribute:i,targetType:r,autoComplete:a}){const s=Ic(),[o,l]=I.useState(null),c=f=>{if(t?.(f),!s.readOnly&&e){if(f.nativeEvent.isComposing)return;if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown("keyboard"),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown("keyboard"),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){if(f.nativeEvent.keyCode===229)return;const h=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&h!==-1?(f.preventDefault(),s.store.clickSelectedOption()):r==="button"&&(f.preventDefault(),s.store.openDropdown("keyboard"))}f.key==="Escape"&&s.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&r==="button"&&(f.preventDefault(),s.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&o||void 0,autoComplete:a,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},onKeyDown:c}}const Bde={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},nY=Zt((t,e)=>{const{children:n,refProp:i,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:s,targetType:o,autoComplete:l,...c}=Pt("ComboboxEventsTarget",Bde,t);if(!lg(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=Ic(),f=QL({targetType:o,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:l});return I.cloneElement(n,{...f,...c,[i]:Va(e,u.store.targetRef,rA(n))})});nY.displayName="@mantine/core/ComboboxEventsTarget";const eP=Zt((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ComboboxFooter",null,t),l=Ic();return D.jsx(st,{ref:e,...l.getStyles("footer",{className:i,classNames:n,style:r,styles:a}),...o,onMouseDown:c=>{c.preventDefault()}})});eP.classes=Xo;eP.displayName="@mantine/core/ComboboxFooter";const tP=Zt((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,children:o,label:l,id:c,...u}=Pt("ComboboxGroup",null,t),f=Ic(),h=Eu(c);return D.jsxs(st,{ref:e,role:"group","aria-labelledby":l?h:void 0,...f.getStyles("group",{className:i,classNames:n,style:r,styles:a}),...u,children:[l&&D.jsx("div",{id:h,...f.getStyles("groupLabel",{classNames:n,styles:a}),children:l}),o]})});tP.classes=Xo;tP.displayName="@mantine/core/ComboboxGroup";const nP=Zt((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ComboboxHeader",null,t),l=Ic();return D.jsx(st,{ref:e,...l.getStyles("header",{className:i,classNames:n,style:r,styles:a}),...o,onMouseDown:c=>{c.preventDefault()}})});nP.classes=Xo;nP.displayName="@mantine/core/ComboboxHeader";function iY({value:t,valuesDivider:e=",",...n}){return D.jsx("input",{type:"hidden",value:Array.isArray(t)?t.join(e):t||"",...n})}iY.displayName="@mantine/core/ComboboxHiddenInput";const iP=Zt((t,e)=>{const n=Pt("ComboboxOption",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,onClick:l,id:c,active:u,onMouseDown:f,onMouseOver:h,disabled:d,selected:g,mod:b,...y}=n,p=Ic(),x=I.useId(),_=c||x;return D.jsx(st,{...p.getStyles("option",{className:r,classNames:i,styles:s,style:a}),...y,ref:e,id:_,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":d,"combobox-selected":g},b],role:"option",onClick:w=>{d?w.preventDefault():(p.onOptionSubmit?.(n.value,n),l?.(w))},onMouseDown:w=>{w.preventDefault(),f?.(w)},onMouseOver:w=>{p.resetSelectionOnOptionHover&&p.store.resetSelectedOption(),h?.(w)}})});iP.classes=Xo;iP.displayName="@mantine/core/ComboboxOption";const rP=Zt((t,e)=>{const n=Pt("ComboboxOptions",null,t),{classNames:i,className:r,style:a,styles:s,id:o,onMouseDown:l,labelledBy:c,...u}=n,f=Ic(),h=Eu(o);return I.useEffect(()=>{f.store.setListId(h)},[h]),D.jsx(st,{ref:e,...f.getStyles("options",{className:r,style:a,classNames:i,styles:s}),...u,id:h,role:"listbox","aria-labelledby":c,onMouseDown:d=>{d.preventDefault(),l?.(d)}})});rP.classes=Xo;rP.displayName="@mantine/core/ComboboxOptions";const zde={withAriaAttributes:!0,withKeyboardNavigation:!0},aP=Zt((t,e)=>{const n=Pt("ComboboxSearch",zde,t),{classNames:i,styles:r,unstyled:a,vars:s,withAriaAttributes:o,onKeyDown:l,withKeyboardNavigation:c,size:u,...f}=n,h=Ic(),d=h.getStyles("search"),g=QL({targetType:"input",withAriaAttributes:o,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return D.jsx(ga,{ref:Va(e,h.store.searchRef),classNames:[{input:d.className},i],styles:[{input:d.style},r],size:u||h.size,...g,...f,__staticSelector:"Combobox"})});aP.classes=Xo;aP.displayName="@mantine/core/ComboboxSearch";const jde={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},rY=Zt((t,e)=>{const{children:n,refProp:i,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:s,targetType:o,autoComplete:l,...c}=Pt("ComboboxTarget",jde,t);if(!lg(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=Ic(),f=QL({targetType:o,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:l}),h=I.cloneElement(n,{...f,...c});return D.jsx(Vo.Target,{ref:Va(e,u.store.targetRef),children:h})});rY.displayName="@mantine/core/ComboboxTarget";function Hde(t,e,n){for(let i=t-1;i>=0;i-=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=e.length-1;i>-1;i-=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i}return t}function Vde(t,e,n){for(let i=t+1;i<e.length;i+=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=0;i<e.length;i+=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i}return t}function Gde(t){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute("data-combobox-disabled"))return e;return-1}function aY({defaultOpened:t,opened:e,onOpenedChange:n,onDropdownClose:i,onDropdownOpen:r,loop:a=!0,scrollBehavior:s="instant"}={}){const[o,l]=Wo({value:e,defaultValue:t,finalValue:!1,onChange:n}),c=I.useRef(null),u=I.useRef(-1),f=I.useRef(null),h=I.useRef(null),d=I.useRef(-1),g=I.useRef(-1),b=I.useRef(-1),y=I.useCallback((F="unknown")=>{o||(l(!0),r?.(F))},[l,r,o]),p=I.useCallback((F="unknown")=>{o&&(l(!1),i?.(F))},[l,i,o]),x=I.useCallback((F="unknown")=>{o?p(F):y(F)},[p,y,o]),_=I.useCallback(()=>{const F=document.querySelector(`#${c.current} [data-combobox-selected]`);F?.removeAttribute("data-combobox-selected"),F?.removeAttribute("aria-selected")},[]),w=I.useCallback(F=>{const V=document.getElementById(c.current)?.querySelectorAll("[data-combobox-option]");if(!V)return null;const W=F>=V.length?0:F<0?V.length-1:F;return u.current=W,V?.[W]&&!V[W].hasAttribute("data-combobox-disabled")?(_(),V[W].setAttribute("data-combobox-selected","true"),V[W].setAttribute("aria-selected","true"),V[W].scrollIntoView({block:"nearest",behavior:s}),V[W].id):null},[s,_]),M=I.useCallback(()=>{const F=document.querySelector(`#${c.current} [data-combobox-active]`);if(F){const H=document.querySelectorAll(`#${c.current} [data-combobox-option]`),V=Array.from(H).findIndex(W=>W===F);return w(V)}return w(0)},[w]),S=I.useCallback(()=>w(Vde(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),a)),[w,a]),A=I.useCallback(()=>w(Hde(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),a)),[w,a]),C=I.useCallback(()=>w(Gde(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[w]),k=I.useCallback((F="selected",H)=>{b.current=window.setTimeout(()=>{const V=document.querySelectorAll(`#${c.current} [data-combobox-option]`),W=Array.from(V).findIndex(B=>B.hasAttribute(`data-combobox-${F}`));u.current=W,H?.scrollIntoView&&V[W]?.scrollIntoView({block:"nearest",behavior:s})},0)},[]),R=I.useCallback(()=>{u.current=-1,_()},[_]),N=I.useCallback(()=>{document.querySelectorAll(`#${c.current} [data-combobox-option]`)?.[u.current]?.click()},[]),P=I.useCallback(F=>{c.current=F},[]),j=I.useCallback(()=>{d.current=window.setTimeout(()=>f.current?.focus(),0)},[]),z=I.useCallback(()=>{g.current=window.setTimeout(()=>h.current?.focus(),0)},[]),X=I.useCallback(()=>u.current,[]);return I.useEffect(()=>()=>{window.clearTimeout(d.current),window.clearTimeout(g.current),window.clearTimeout(b.current)},[]),{dropdownOpened:o,openDropdown:y,closeDropdown:p,toggleDropdown:x,selectedOptionIndex:u.current,getSelectedOptionIndex:X,selectOption:w,selectFirstOption:C,selectActiveOption:M,selectNextOption:S,selectPreviousOption:A,resetSelectedOption:R,updateSelectedOptionIndex:k,listId:c.current,setListId:P,clickSelectedOption:N,searchRef:f,focusSearchInput:j,targetRef:h,focusTarget:z}}const Wde={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},Xde=(t,{size:e,dropdownPadding:n})=>({options:{"--combobox-option-fz":os(e),"--combobox-option-padding":ci(e,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:Et(n),"--combobox-option-fz":os(e),"--combobox-option-padding":ci(e,"combobox-option-padding")}});function Sr(t){const e=Pt("Combobox",Wde,t),{classNames:n,styles:i,unstyled:r,children:a,store:s,vars:o,onOptionSubmit:l,onClose:c,size:u,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:d,readOnly:g,attributes:b,...y}=e,p=aY(),x=s||p,_=En({name:d||"Combobox",classes:Xo,props:e,classNames:n,styles:i,unstyled:r,attributes:b,vars:o,varsResolver:Xde}),w=()=>{c?.(),x.closeDropdown()};return D.jsx(Ude,{value:{getStyles:_,store:x,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:h,readOnly:g},children:D.jsx(Vo,{opened:x.dropdownOpened,preventPositionChangeWhenVisible:!0,...y,onChange:M=>!M&&w(),withRoles:!1,unstyled:r,children:a})})}const qde=t=>t;Sr.extend=qde;Sr.classes=Xo;Sr.displayName="@mantine/core/Combobox";Sr.Target=rY;Sr.Dropdown=$L;Sr.Options=rP;Sr.Option=iP;Sr.Search=aP;Sr.Empty=ZL;Sr.Chevron=JL;Sr.Footer=eP;Sr.Header=nP;Sr.EventsTarget=nY;Sr.DropdownTarget=tY;Sr.Group=tP;Sr.ClearButton=eY;Sr.HiddenInput=iY;var sY={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const oY=sY,sP=I.forwardRef(({__staticSelector:t,__stylesApiProps:e,className:n,classNames:i,styles:r,unstyled:a,children:s,label:o,description:l,id:c,disabled:u,error:f,size:h,labelPosition:d="left",bodyElement:g="div",labelElement:b="label",variant:y,style:p,vars:x,mod:_,attributes:w,...M},S)=>{const A=En({name:t,props:e,className:n,style:p,classes:sY,classNames:i,styles:r,unstyled:a,attributes:w});return D.jsx(st,{...A("root"),ref:S,__vars:{"--label-fz":os(h),"--label-lh":ci(h,"label-lh")},mod:[{"label-position":d},_],variant:y,size:h,...M,children:D.jsxs(st,{component:g,htmlFor:g==="label"?c:void 0,...A("body"),children:[s,D.jsxs("div",{...A("labelWrapper"),"data-disabled":u||void 0,children:[o&&D.jsx(st,{component:b,htmlFor:b==="label"?c:void 0,...A("label"),"data-disabled":u||void 0,children:o}),l&&D.jsx(ga.Description,{size:h,__inheritStyles:!1,...A("description"),children:l}),f&&typeof f!="boolean"&&D.jsx(ga.Error,{size:h,__inheritStyles:!1,...A("error"),children:f})]})]})})});sP.displayName="@mantine/core/InlineInput";const lY=I.createContext(null),Kde=lY.Provider,cY=()=>I.useContext(lY),[Yde,Jde]=A_();var uY={card:"m_26775b0a"};const $de={withBorder:!0},Zde=(t,{radius:e})=>({card:{"--card-radius":ta(e)}}),oP=Zt((t,e)=>{const n=Pt("CheckboxCard",$de,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,checked:c,mod:u,withBorder:f,value:h,onClick:d,defaultChecked:g,onChange:b,attributes:y,...p}=n,x=En({name:"CheckboxCard",classes:uY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:Zde,rootSelector:"card"}),_=cY(),w=typeof c=="boolean"?c:_?_.value.includes(h||""):void 0,[M,S]=Wo({value:w,defaultValue:g,finalValue:!1,onChange:b});return D.jsx(Yde,{value:{checked:M},children:D.jsx(uf,{ref:e,mod:[{"with-border":f,checked:M},u],...x("card"),...p,role:"checkbox","aria-checked":M,onClick:A=>{d?.(A),_?.onChange(h||""),S(!M)}})})});oP.displayName="@mantine/core/CheckboxCard";oP.classes=uY;function fY({children:t,role:e}){const n=D_();return n?D.jsx("div",{role:e,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:t}):D.jsx(D.Fragment,{children:t})}const lP=Zt((t,e)=>{const{value:n,defaultValue:i,onChange:r,size:a,wrapperProps:s,children:o,readOnly:l,...c}=Pt("CheckboxGroup",null,t),[u,f]=Wo({value:n,defaultValue:i,finalValue:[],onChange:r}),h=d=>{const g=typeof d=="string"?d:d.currentTarget.value;!l&&f(u.includes(g)?u.filter(b=>b!==g):[...u,g])};return D.jsx(Kde,{value:{value:u,onChange:h,size:a},children:D.jsx(ga.Wrapper,{size:a,ref:e,...s,...c,labelElement:"div",__staticSelector:"CheckboxGroup",children:D.jsx(fY,{role:"group",children:o})})})});lP.classes=ga.Wrapper.classes;lP.displayName="@mantine/core/CheckboxGroup";function cP({size:t,style:e,...n}){const i=t!==void 0?{width:Et(t),height:Et(t),...e}:e;return D.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:i,"aria-hidden":!0,...n,children:D.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function hY({indeterminate:t,...e}){return t?D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...e,children:D.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):D.jsx(cP,{...e})}var dY={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const Qde={icon:hY,variant:"filled"},epe=(t,{radius:e,color:n,size:i,iconColor:r,variant:a,autoContrast:s})=>{const o=mh({color:n||t.primaryColor,theme:t}),l=o.isThemeColor&&o.shade===void 0?`var(--mantine-color-${o.color}-outline)`:o.color;return{indicator:{"--checkbox-size":ci(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:ta(e),"--checkbox-color":a==="outline"?l:ea(n,t),"--checkbox-icon-color":r?ea(r,t):cA(s,t)?Ov({color:n,theme:t,autoContrast:s}):void 0}}},uP=Zt((t,e)=>{const n=Pt("CheckboxIndicator",Qde,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,icon:c,indeterminate:u,radius:f,color:h,iconColor:d,autoContrast:g,checked:b,mod:y,variant:p,disabled:x,attributes:_,...w}=n,M=En({name:"CheckboxIndicator",classes:dY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:_,vars:l,varsResolver:epe,rootSelector:"indicator"}),S=Jde(),A=typeof b=="boolean"||typeof u=="boolean"?b||u:S?.checked||!1;return D.jsx(st,{ref:e,...M("indicator",{variant:p}),variant:p,mod:[{checked:A,disabled:x},y],...w,children:D.jsx(c,{indeterminate:u,...M("icon")})})});uP.displayName="@mantine/core/CheckboxIndicator";uP.classes=dY;var pY={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const tpe={labelPosition:"right",icon:hY,variant:"filled"},npe=(t,{radius:e,color:n,size:i,iconColor:r,variant:a,autoContrast:s})=>{const o=mh({color:n||t.primaryColor,theme:t}),l=o.isThemeColor&&o.shade===void 0?`var(--mantine-color-${o.color}-outline)`:o.color;return{root:{"--checkbox-size":ci(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:ta(e),"--checkbox-color":a==="outline"?l:ea(n,t),"--checkbox-icon-color":r?ea(r,t):cA(s,t)?Ov({color:n,theme:t,autoContrast:s}):void 0}}},vh=Zt((t,e)=>{const n=Pt("Checkbox",tpe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,label:u,id:f,size:h,radius:d,wrapperProps:g,checked:b,labelPosition:y,description:p,error:x,disabled:_,variant:w,indeterminate:M,icon:S,rootRef:A,iconColor:C,onChange:k,autoContrast:R,mod:N,attributes:P,...j}=n,z=cY(),X=h||z?.size,F=En({name:"Checkbox",props:n,classes:pY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:P,vars:l,varsResolver:npe}),{styleProps:H,rest:V}=C_(j),W=Eu(f),B=z?{checked:z.value.includes(V.value),onChange:G=>{z.onChange(G),k?.(G)}}:{},Y=I.useRef(null),Z=e||Y;return I.useEffect(()=>{Z&&"current"in Z&&Z.current&&(Z.current.indeterminate=M||!1)},[M,Z]),D.jsx(sP,{...F("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:W,size:X,labelPosition:y,label:u,description:p,error:x,disabled:_,classNames:i,styles:s,unstyled:o,"data-checked":B.checked||b||void 0,variant:w,ref:A,mod:N,...H,...g,children:D.jsxs(st,{...F("inner"),mod:{"data-label-position":y},children:[D.jsx(st,{component:"input",id:W,ref:Z,checked:b,disabled:_,mod:{error:!!x,indeterminate:M},...F("input",{focusable:!0,variant:w}),onChange:k,...V,...B,type:"checkbox"}),D.jsx(S,{indeterminate:M,...F("icon")})]})})});vh.classes={...pY,...oY};vh.displayName="@mantine/core/Checkbox";vh.Group=lP;vh.Indicator=uP;vh.Card=oP;function F1(t){return"group"in t}function mY({options:t,search:e,limit:n}){const i=e.trim().toLowerCase(),r=[];for(let a=0;a<t.length;a+=1){const s=t[a];if(r.length===n)return r;F1(s)&&r.push({group:s.group,items:mY({options:s.items,search:e,limit:n-r.length})}),F1(s)||s.label.toLowerCase().includes(i)&&r.push(s)}return r}function ipe(t){if(t.length===0)return!0;for(const e of t)if(!("group"in e)||e.items.length>0)return!1;return!0}function gY(t,e=new Set){if(Array.isArray(t))for(const n of t)if(F1(n))gY(n.items,e);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(e.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);e.add(n.value)}}function rpe(t,e){return Array.isArray(t)?t.includes(e):t===e}function bY({data:t,withCheckIcon:e,value:n,checkIconPosition:i,unstyled:r,renderOption:a}){if(!F1(t)){const o=rpe(n,t.value),l=e&&o&&D.jsx(cP,{className:Xo.optionsDropdownCheckIcon}),c=D.jsxs(D.Fragment,{children:[i==="left"&&l,D.jsx("span",{children:t.label}),i==="right"&&l]});return D.jsx(Sr.Option,{value:t.value,disabled:t.disabled,className:us({[Xo.optionsDropdownOption]:!r}),"data-reverse":i==="right"||void 0,"data-checked":o||void 0,"aria-selected":o,active:o,children:typeof a=="function"?a({option:t,checked:o}):c})}const s=t.items.map(o=>D.jsx(bY,{data:o,value:n,unstyled:r,withCheckIcon:e,checkIconPosition:i,renderOption:a},o.value));return D.jsx(Sr.Group,{label:t.group,children:s})}function ape({data:t,hidden:e,hiddenWhenEmpty:n,filter:i,search:r,limit:a,maxDropdownHeight:s,withScrollArea:o=!0,filterOptions:l=!0,withCheckIcon:c=!1,value:u,checkIconPosition:f,nothingFoundMessage:h,unstyled:d,labelId:g,renderOption:b,scrollAreaProps:y,"aria-label":p}){gY(t);const _=typeof r=="string"?(i||mY)({options:t,search:l?r:"",limit:a??1/0}):t,w=ipe(_),M=_.map(S=>D.jsx(bY,{data:S,withCheckIcon:c,value:u,checkIconPosition:f,unstyled:d,renderOption:b},F1(S)?S.group:S.value));return D.jsx(Sr.Dropdown,{hidden:e||n&&w,"data-composed":!0,children:D.jsxs(Sr.Options,{labelledBy:g,"aria-label":p,children:[o?D.jsx(Dc.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...y,children:M}):M,w&&h&&D.jsx(Sr.Empty,{children:h})]})})}var vY={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const spe={iconSize:48},ope=(t,{color:e,iconSize:n,radius:i})=>{const r=mh({color:e||t.primaryColor,theme:t,colorScheme:"dark"}),a=mh({color:e||t.primaryColor,theme:t,colorScheme:"light"});return{root:{"--bq-bg-light":ic(a.value,.07),"--bq-bg-dark":ic(r.value,.06),"--bq-bd":ea(e,t),"--bq-icon-size":Et(n),"--bq-radius":ta(i)}}},fP=Zt((t,e)=>{const n=Pt("Blockquote",spe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,children:c,icon:u,iconSize:f,cite:h,attributes:d,...g}=n,b=En({name:"Blockquote",classes:vY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:ope});return D.jsxs(st,{component:"blockquote",ref:e,...b("root"),...g,children:[u&&D.jsx("span",{...b("icon"),children:u}),c,h&&D.jsx("cite",{...b("cite"),children:h})]})});fP.classes=vY;fP.displayName="@mantine/core/Blockquote";var yY={root:"m_fea6bf1a",burger:"m_d4fb9cad"};const lpe=(t,{color:e,size:n,lineSize:i,transitionDuration:r,transitionTimingFunction:a})=>({root:{"--burger-color":e?ea(e,t):void 0,"--burger-size":ci(n,"burger-size"),"--burger-line-size":i?Et(i):void 0,"--burger-transition-duration":r===void 0?void 0:`${r}ms`,"--burger-transition-timing-function":a}}),hP=Zt((t,e)=>{const n=Pt("Burger",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,opened:c,children:u,transitionDuration:f,transitionTimingFunction:h,lineSize:d,attributes:g,...b}=n,y=En({name:"Burger",classes:yY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:lpe});return D.jsxs(uf,{...y("root"),ref:e,...b,children:[D.jsx(st,{mod:["reduce-motion",{opened:c}],...y("burger")}),u]})});hP.classes=yY;hP.displayName="@mantine/core/Burger";var Fv={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const mz={orientation:"horizontal"},cpe=(t,{borderWidth:e})=>({group:{"--button-border-width":Et(e)}}),dP=Zt((t,e)=>{const n=Pt("ButtonGroup",mz,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,orientation:l,vars:c,borderWidth:u,variant:f,mod:h,attributes:d,...g}=Pt("ButtonGroup",mz,t),b=En({name:"ButtonGroup",props:n,classes:Fv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:c,varsResolver:cpe,rootSelector:"group"});return D.jsx(st,{...b("group"),ref:e,variant:f,mod:[{"data-orientation":l},h],role:"group",...g})});dP.classes=Fv;dP.displayName="@mantine/core/ButtonGroup";const upe=(t,{radius:e,color:n,gradient:i,variant:r,autoContrast:a,size:s})=>{const o=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":ci(s,"section-height"),"--section-padding-x":ci(s,"section-padding-x"),"--section-fz":s?.includes("compact")?os(s.replace("compact-","")):os(s),"--section-radius":e===void 0?void 0:ta(e),"--section-bg":n||r?o.background:void 0,"--section-color":o.color,"--section-bd":n||r?o.border:void 0}}},pP=Zt((t,e)=>{const n=Pt("ButtonGroupSection",null,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,vars:l,variant:c,gradient:u,radius:f,autoContrast:h,attributes:d,...g}=n,b=En({name:"ButtonGroupSection",props:n,classes:Fv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:upe,rootSelector:"groupSection"});return D.jsx(st,{...b("groupSection"),ref:e,variant:c,...g})});pP.classes=Fv;pP.displayName="@mantine/core/ButtonGroupSection";const fpe={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${Et(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},hpe=(t,{radius:e,color:n,gradient:i,variant:r,size:a,justify:s,autoContrast:o})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:o});return{root:{"--button-justify":s,"--button-height":ci(a,"button-height"),"--button-padding-x":ci(a,"button-padding-x"),"--button-fz":a?.includes("compact")?os(a.replace("compact-","")):os(a),"--button-radius":e===void 0?void 0:ta(e),"--button-bg":n||r?l.background:void 0,"--button-hover":n||r?l.hover:void 0,"--button-color":l.color,"--button-bd":n||r?l.border:void 0,"--button-hover-color":n||r?l.hoverColor:void 0}}},ks=Dl((t,e)=>{const n=Pt("Button",null,t),{style:i,vars:r,className:a,color:s,disabled:o,children:l,leftSection:c,rightSection:u,fullWidth:f,variant:h,radius:d,loading:g,loaderProps:b,gradient:y,classNames:p,styles:x,unstyled:_,"data-disabled":w,autoContrast:M,mod:S,attributes:A,...C}=n,k=En({name:"Button",props:n,classes:Fv,className:a,style:i,classNames:p,styles:x,unstyled:_,attributes:A,vars:r,varsResolver:hpe}),R=!!c,N=!!u;return D.jsxs(uf,{ref:e,...k("root",{active:!o&&!g&&!w}),unstyled:_,variant:h,disabled:o||g,mod:[{disabled:o||w,loading:g,block:f,"with-left-section":R,"with-right-section":N},S],...C,children:[typeof g=="boolean"&&D.jsx(Tc,{mounted:g,transition:fpe,duration:150,children:P=>D.jsx(st,{component:"span",...k("loader",{style:P}),"aria-hidden":!0,children:D.jsx(Zd,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...b})})}),D.jsxs("span",{...k("inner"),children:[c&&D.jsx(st,{component:"span",...k("section"),mod:{position:"left"},children:c}),D.jsx(st,{component:"span",mod:{loading:g},...k("label"),children:l}),u&&D.jsx(st,{component:"span",...k("section"),mod:{position:"right"},children:u})]})]})});ks.classes=Fv;ks.displayName="@mantine/core/Button";ks.Group=dP;ks.GroupSection=pP;var xY={root:"m_b183c0a2"};const dpe=(t,{color:e})=>({root:{"--code-bg":e?ea(e,t):void 0}}),mP=Zt((t,e)=>{const n=Pt("Code",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,block:u,variant:f,mod:h,attributes:d,...g}=n,b=En({name:"Code",props:n,classes:xY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:dpe});return D.jsx(st,{component:u?"pre":"code",variant:f,ref:e,mod:[{block:u},h],...b("root"),...g,dir:"ltr"})});mP.classes=xY;mP.displayName="@mantine/core/Code";var _Y={root:"m_de3d2490",colorOverlay:"m_862f3d1b",shadowOverlay:"m_98ae7f22",alphaOverlay:"m_95709ac0",childrenOverlay:"m_93e74e3"};const gz={withShadow:!0},ppe=(t,{radius:e,size:n})=>({root:{"--cs-radius":e===void 0?void 0:ta(e),"--cs-size":Et(n)}}),O_=Dl((t,e)=>{const n=Pt("ColorSwatch",gz,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,size:u,radius:f,withShadow:h,children:d,variant:g,attributes:b,...y}=Pt("ColorSwatch",gz,n),p=En({name:"ColorSwatch",props:n,classes:_Y,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:l,varsResolver:ppe});return D.jsxs(st,{ref:e,variant:g,size:u,...p("root",{focusable:!0}),...y,children:[D.jsx("span",{...p("alphaOverlay")}),h&&D.jsx("span",{...p("shadowOverlay")}),D.jsx("span",{...p("colorOverlay",{style:{backgroundColor:c}})}),D.jsx("span",{...p("childrenOverlay"),children:d})]})});O_.classes=_Y;O_.displayName="@mantine/core/ColorSwatch";const[mpe,gP]=A_(null),bP=I.forwardRef(({position:t,...e},n)=>D.jsx(st,{ref:n,__vars:{"--thumb-y-offset":`${t.y*100}%`,"--thumb-x-offset":`${t.x*100}%`},...e}));bP.displayName="@mantine/core/ColorPickerThumb";var vP={wrapper:"m_fee9c77",preview:"m_9dddfbac",body:"m_bffecc3e",sliders:"m_3283bb96",thumb:"m_40d572ba",swatch:"m_d8ee6fd8",swatches:"m_5711e686",saturation:"m_202a296e",saturationOverlay:"m_11b3db02",slider:"m_d856d47d",sliderOverlay:"m_8f327113"};const yP=Zt((t,e)=>{const n=Pt("ColorSlider",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,onChange:c,onChangeEnd:u,maxValue:f,round:h,size:d="md",focusable:g=!0,value:b,overlays:y,thumbColor:p="transparent",onScrubStart:x,onScrubEnd:_,__staticSelector:w="ColorPicker",attributes:M,...S}=n,A=En({name:w,classes:vP,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:M}),k=gP()?.getStyles||A,R=ba(),[N,P]=I.useState({y:0,x:b/f}),j=I.useRef(N),z=W=>h?Math.round(W*f):W*f,{ref:X}=vL(({x:W,y:B})=>{j.current={x:W,y:B},c?.(z(W))},{onScrubEnd:()=>{const{x:W}=j.current;u?.(z(W)),_?.()},onScrubStart:x});_c(()=>{P({y:0,x:b/f})},[b]);const F=(W,B)=>{W.preventDefault();const Y=mq(B);c?.(z(Y.x)),u?.(z(Y.x))},H=W=>{switch(W.key){case"ArrowRight":{F(W,{x:N.x+.05,y:N.y});break}case"ArrowLeft":{F(W,{x:N.x-.05,y:N.y});break}}},V=y.map((W,B)=>I.createElement("div",{...k("sliderOverlay"),style:W,key:B}));return D.jsxs(st,{...S,ref:Va(X,e),...k("slider"),role:"slider","aria-valuenow":b,"aria-valuemax":f,"aria-valuemin":0,tabIndex:g?0:-1,onKeyDown:H,"data-focus-ring":R.focusRing,__vars:{"--cp-thumb-size":`var(--cp-thumb-size-${d})`},children:[V,D.jsx(bP,{position:N,...k("thumb",{style:{top:Et(1),background:p}})})]})});yP.displayName="@mantine/core/ColorSlider";function bc(t,e=0,n=10**e){return Math.round(n*t)/n}function gpe({h:t,s:e,l:n,a:i}){const r=e*((n<50?n:100-n)/100);return{h:t,s:r>0?2*r/(n+r)*100:0,v:n+r,a:i}}const bpe={grad:360/400,turn:360,rad:360/(Math.PI*2)};function vpe(t,e="deg"){return Number(t)*(bpe[e]||1)}const ype=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function bz(t){const e=ype.exec(t);return e?gpe({h:vpe(e[1],e[2]),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)}):{h:0,s:0,v:0,a:1}}function HO({r:t,g:e,b:n,a:i}){const r=Math.max(t,e,n),a=r-Math.min(t,e,n),s=a?r===t?(e-n)/a:r===e?2+(n-t)/a:4+(t-e)/a:0;return{h:bc(60*(s<0?s+6:s),3),s:bc(r?a/r*100:0,3),v:bc(r/255*100,3),a:i}}function VO(t){const e=t[0]==="#"?t.slice(1):t;return e.length===3?HO({r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}):HO({r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:1})}function xpe(t){const e=t[0]==="#"?t.slice(1):t,n=s=>bc(parseInt(s,16)/255,3);if(e.length===4){const s=e.slice(0,3),o=n(e[3]+e[3]);return{...VO(s),a:o}}const i=e.slice(0,6),r=n(e.slice(6,8));return{...VO(i),a:r}}const _pe=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function vz(t){const e=_pe.exec(t);return e?HO({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):{h:0,s:0,v:0,a:1}}const SY={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},Spe={hex:VO,hexa:xpe,rgb:vz,rgba:vz,hsl:bz,hsla:bz};function Tx(t){for(const[,e]of Object.entries(SY))if(e.test(t))return!0;return!1}function um(t){if(typeof t!="string")return{h:0,s:0,v:0,a:1};if(t==="transparent")return{h:0,s:0,v:0,a:0};const e=t.trim();for(const[n,i]of Object.entries(SY))if(i.test(e))return Spe[n](e);return{h:0,s:0,v:0,a:1}}const wY=I.forwardRef((t,e)=>{const{value:n,onChange:i,onChangeEnd:r,color:a,...s}=Pt("AlphaSlider",null,t);return D.jsx(yP,{...s,ref:e,value:n,onChange:o=>i?.(bc(o,2)),onChangeEnd:o=>r?.(bc(o,2)),maxValue:1,round:!1,"data-alpha":!0,overlays:[{backgroundImage:"linear-gradient(45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--slider-checkers) 75%), linear-gradient(-45deg, var(--mantine-color-body) 75%, var(--slider-checkers) 75%)",backgroundSize:`${Et(8)} ${Et(8)}`,backgroundPosition:`0 0, 0 ${Et(4)}, ${Et(4)} ${Et(-4)}, ${Et(-4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${a})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${Et(1)} inset, rgb(0, 0, 0, .15) 0 0 ${Et(4)} inset`}]})});wY.displayName="@mantine/core/AlphaSlider";function EY({h:t,s:e,v:n,a:i}){const r=t/360*6,a=e/100,s=n/100,o=Math.floor(r),l=s*(1-a),c=s*(1-(r-o)*a),u=s*(1-(1-r+o)*a),f=o%6;return{r:bc([s,c,l,l,u,s][f]*255),g:bc([u,s,s,c,l,l][f]*255),b:bc([l,l,u,s,s,c][f]*255),a:bc(i,2)}}function yz(t,e){const{r:n,g:i,b:r,a}=EY(t);return e?`rgba(${n}, ${i}, ${r}, ${bc(a,2)})`:`rgb(${n}, ${i}, ${r})`}function xz({h:t,s:e,v:n,a:i},r){const a=(200-e)*n/100,s={h:Math.round(t),s:Math.round(a>0&&a<200?e*n/100/(a<=100?a:200-a)*100:0),l:Math.round(a/2)};return r?`hsla(${s.h}, ${s.s}%, ${s.l}%, ${bc(i,2)})`:`hsl(${s.h}, ${s.s}%, ${s.l}%)`}function uM(t){const e=t.toString(16);return e.length<2?`0${e}`:e}function MY(t){const{r:e,g:n,b:i}=EY(t);return`#${uM(e)}${uM(n)}${uM(i)}`}function wpe(t){const e=Math.round(t.a*255);return`${MY(t)}${uM(e)}`}const Z3={hex:MY,hexa:t=>wpe(t),rgb:t=>yz(t,!1),rgba:t=>yz(t,!0),hsl:t=>xz(t,!1),hsla:t=>xz(t,!0)};function eu(t,e){return e?t in Z3?Z3[t](e):Z3.hex(e):"#000000"}const TY=I.forwardRef((t,e)=>{const{value:n,onChange:i,onChangeEnd:r,color:a,...s}=Pt("HueSlider",{},t);return D.jsx(yP,{...s,ref:e,value:n,onChange:i,onChangeEnd:r,maxValue:360,thumbColor:`hsl(${n}, 100%, 50%)`,round:!0,"data-hue":!0,overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${Et(1)} inset, rgb(0, 0, 0, .15) 0 0 ${Et(4)} inset`}]})});TY.displayName="@mantine/core/HueSlider";function AY({className:t,onChange:e,onChangeEnd:n,value:i,saturationLabel:r,focusable:a=!0,size:s,color:o,onScrubStart:l,onScrubEnd:c,...u}){const{getStyles:f}=gP(),[h,d]=I.useState({x:i.s/100,y:1-i.v/100}),g=I.useRef(h),{ref:b}=vL(({x,y:_})=>{g.current={x,y:_},e({s:Math.round(x*100),v:Math.round((1-_)*100)})},{onScrubEnd:()=>{const{x,y:_}=g.current;n({s:Math.round(x*100),v:Math.round((1-_)*100)}),c?.()},onScrubStart:l});I.useEffect(()=>{d({x:i.s/100,y:1-i.v/100})},[i.s,i.v]);const y=(x,_)=>{x.preventDefault();const w=mq(_);e({s:Math.round(w.x*100),v:Math.round((1-w.y)*100)}),n({s:Math.round(w.x*100),v:Math.round((1-w.y)*100)})},p=x=>{switch(x.key){case"ArrowUp":{y(x,{y:h.y-.05,x:h.x});break}case"ArrowDown":{y(x,{y:h.y+.05,x:h.x});break}case"ArrowRight":{y(x,{x:h.x+.05,y:h.y});break}case"ArrowLeft":{y(x,{x:h.x-.05,y:h.y});break}}};return D.jsxs(st,{...f("saturation"),ref:b,...u,role:"slider","aria-label":r,"aria-valuenow":h.x,"aria-valuetext":eu("rgba",i),tabIndex:a?0:-1,onKeyDown:p,children:[D.jsx("div",{...f("saturationOverlay",{style:{backgroundColor:`hsl(${i.h}, 100%, 50%)`}})}),D.jsx("div",{...f("saturationOverlay",{style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}})}),D.jsx("div",{...f("saturationOverlay",{style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}})}),D.jsx(bP,{position:h,...f("thumb",{style:{backgroundColor:o}})})]})}AY.displayName="@mantine/core/Saturation";const CY=I.forwardRef(({className:t,datatype:e,setValue:n,onChangeEnd:i,size:r,focusable:a,data:s,swatchesPerRow:o,value:l,...c},u)=>{const f=gP(),h=s.map((d,g)=>I.createElement(O_,{...f.getStyles("swatch"),unstyled:f.unstyled,component:"button",type:"button",color:d,key:g,radius:"sm",onClick:()=>{n(d),i?.(d)},"aria-label":d,tabIndex:a?0:-1,"data-swatch":!0},l===d&&D.jsx(cP,{size:"35%",color:Pq(d)<.5?"white":"black"})));return D.jsx(st,{...f.getStyles("swatches"),ref:u,...c,children:h})});CY.displayName="@mantine/core/Swatches";const Epe={swatchesPerRow:7,withPicker:!0,focusable:!0,size:"md",__staticSelector:"ColorPicker"},Mpe=(t,{size:e,swatchesPerRow:n})=>({wrapper:{"--cp-preview-size":ci(e,"cp-preview-size"),"--cp-width":ci(e,"cp-width"),"--cp-body-spacing":Hd(e),"--cp-swatch-size":`${100/n}%`,"--cp-thumb-size":ci(e,"cp-thumb-size"),"--cp-saturation-height":ci(e,"cp-saturation-height")}}),xP=Zt((t,e)=>{const n=Pt("ColorPicker",Epe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,format:c="hex",value:u,defaultValue:f,onChange:h,onChangeEnd:d,withPicker:g,size:b,saturationLabel:y,hueLabel:p,alphaLabel:x,focusable:_,swatches:w,swatchesPerRow:M,fullWidth:S,onColorSwatchClick:A,__staticSelector:C,mod:k,attributes:R,...N}=n,P=En({name:C,props:n,classes:vP,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:R,rootSelector:"wrapper",vars:l,varsResolver:Mpe}),j=I.useRef(c||"hex"),z=I.useRef(""),X=I.useRef(-1),F=I.useRef(!1),H=c==="hexa"||c==="rgba"||c==="hsla",[V,W,B]=Wo({value:u,defaultValue:f,finalValue:"#FFFFFF",onChange:h}),[Y,Z]=I.useState(um(V)),G=()=>{window.clearTimeout(X.current),F.current=!0},de=()=>{window.clearTimeout(X.current),X.current=window.setTimeout(()=>{F.current=!1},200)},oe=le=>{Z(ue=>{const Se={...ue,...le};return z.current=eu(j.current,Se),Se}),W(z.current)};return _c(()=>{typeof u=="string"&&Tx(u)&&!F.current&&Z(um(u))},[u]),_c(()=>{j.current=c||"hex",W(eu(j.current,Y))},[c]),D.jsx(mpe,{value:{getStyles:P,unstyled:o},children:D.jsxs(st,{ref:e,...P("wrapper"),size:b,mod:[{"full-width":S},k],...N,children:[g&&D.jsxs(D.Fragment,{children:[D.jsx(AY,{value:Y,onChange:oe,onChangeEnd:({s:le,v:ue})=>d?.(eu(j.current,{...Y,s:le,v:ue})),color:V,size:b,focusable:_,saturationLabel:y,onScrubStart:G,onScrubEnd:de}),D.jsxs("div",{...P("body"),children:[D.jsxs("div",{...P("sliders"),children:[D.jsx(TY,{value:Y.h,onChange:le=>oe({h:le}),onChangeEnd:le=>d?.(eu(j.current,{...Y,h:le})),size:b,focusable:_,"aria-label":p,onScrubStart:G,onScrubEnd:de}),H&&D.jsx(wY,{value:Y.a,onChange:le=>oe({a:le}),onChangeEnd:le=>{d?.(eu(j.current,{...Y,a:le}))},size:b,color:eu("hex",Y),focusable:_,"aria-label":x,onScrubStart:G,onScrubEnd:de})]}),H&&D.jsx(O_,{color:V,radius:"sm",size:"var(--cp-preview-size)",...P("preview")})]})]}),Array.isArray(w)&&D.jsx(CY,{data:w,swatchesPerRow:M,focusable:_,setValue:W,value:V,onChangeEnd:le=>{const ue=eu(c,um(le));A?.(ue),d?.(ue),B||Z(um(le))}})]})})});xP.classes=vP;xP.displayName="@mantine/core/ColorPicker";function Tpe({style:t,...e}){return D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--ci-eye-dropper-icon-size)",height:"var(--ci-eye-dropper-icon-size)",...t},viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[D.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),D.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),D.jsx("path",{d:"M12 3l0 4"}),D.jsx("path",{d:"M12 21l0 -3"}),D.jsx("path",{d:"M3 12l4 0"}),D.jsx("path",{d:"M21 12l-3 0"}),D.jsx("path",{d:"M12 12l0 .01"})]})}var _z={eyeDropperIcon:"m_b077c2bc",colorPreview:"m_c5ccdcab",dropdown:"m_5ece2cd7"};const Sz={format:"hex",fixOnBlur:!0,withPreview:!0,swatchesPerRow:7,withPicker:!0,popoverProps:{transitionProps:{transition:"fade",duration:0}},withEyeDropper:!0},Ape=(t,{size:e})=>({eyeDropperIcon:{"--ci-eye-dropper-icon-size":ci(e,"ci-eye-dropper-icon-size")},colorPreview:{"--ci-preview-size":ci(e,"ci-preview-size")}}),Bv=Zt((t,e)=>{const n=Pt("ColorInput",Sz,t),{classNames:i,styles:r,unstyled:a,disallowInput:s,fixOnBlur:o,popoverProps:l,withPreview:c,withEyeDropper:u,eyeDropperIcon:f,closeOnColorSwatchClick:h,eyeDropperButtonProps:d,value:g,defaultValue:b,onChange:y,onChangeEnd:p,onClick:x,onFocus:_,onBlur:w,inputProps:M,format:S="hex",wrapperProps:A,readOnly:C,withPicker:k,swatches:R,disabled:N,leftSection:P,rightSection:j,swatchesPerRow:z,...X}=qK("ColorInput",Sz,t),F=En({name:"ColorInput",props:n,classes:_z,classNames:i,styles:r,unstyled:a,rootSelector:"wrapper",vars:n.vars,varsResolver:Ape}),{resolvedClassNames:H,resolvedStyles:V}=Iv({classNames:i,styles:r,props:n}),[W,B]=I.useState(!1),[Y,Z]=I.useState(""),[G,de]=Wo({value:g,defaultValue:b,finalValue:"",onChange:y}),{supported:oe,open:le}=ale(),ue=D.jsx(Ol,{...d,...F("eyeDropperButton",{className:d?.className,style:d?.style}),variant:"subtle",color:"gray",size:M.size,unstyled:a,onClick:()=>le().then(je=>{if(je?.sRGBHex){const He=eu(S,um(je.sRGBHex));de(He),p?.(He)}}).catch(()=>{}),children:f||D.jsx(Tpe,{...F("eyeDropperIcon")})}),Se=je=>{_?.(je),B(!0)},Te=je=>{o&&de(Y),w?.(je),B(!1)},Pe=je=>{x?.(je),B(!0)};return I.useEffect(()=>{(Tx(G)||G.trim()==="")&&Z(G)},[G]),_c(()=>{Tx(G)&&de(eu(S,um(G)))},[S]),D.jsx(ga.Wrapper,{...A,classNames:H,styles:V,__staticSelector:"ColorInput",children:D.jsxs(Vo,{__staticSelector:"ColorInput",position:"bottom-start",offset:5,opened:W,...l,classNames:H,styles:V,unstyled:a,withRoles:!1,disabled:C||k===!1&&(!Array.isArray(R)||R.length===0),children:[D.jsx(Vo.Target,{children:D.jsx(ga,{autoComplete:"off",...X,...M,classNames:H,styles:V,disabled:N,ref:e,__staticSelector:"ColorInput",onFocus:Se,onBlur:Te,onClick:Pe,spellCheck:!1,value:G,onChange:je=>{const He=je.currentTarget.value;de(He),Tx(He)&&p?.(eu(S,um(He)))},leftSection:P||(c?D.jsx(O_,{color:Tx(G)?G:"#fff",size:"var(--ci-preview-size)",...F("colorPreview")}):null),readOnly:s||C,pointer:s,unstyled:a,rightSection:j||(u&&!N&&!C&&oe?ue:null)})}),D.jsx(Vo.Dropdown,{onMouseDown:je=>je.preventDefault(),className:_z.dropdown,children:D.jsx(xP,{__staticSelector:"ColorInput",value:G,onChange:de,onChangeEnd:p,format:S,swatches:R,swatchesPerRow:z,withPicker:k,size:M.size,focusable:!1,unstyled:a,styles:V,classNames:H,onColorSwatchClick:()=>h&&B(!1),attributes:A.attributes})})]})})});Bv.classes=Tu.classes;Bv.displayName="@mantine/core/ColorInput";var RY={root:"m_7485cace"};const Cpe=(t,{size:e,fluid:n})=>({root:{"--container-size":n?void 0:ci(e,"container-size")}}),_P=Zt((t,e)=>{const n=Pt("Container",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,fluid:c,mod:u,attributes:f,strategy:h,...d}=n,g=En({name:"Container",classes:RY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:f,vars:l,varsResolver:Cpe});return D.jsx(st,{ref:e,mod:[{fluid:c,strategy:h||"block"},u],...g("root"),...d})});_P.classes=RY;_P.displayName="@mantine/core/Container";const Rpe={timeout:1e3};function kY(t){const{children:e,timeout:n,value:i,...r}=Pt("CopyButton",Rpe,t),a=Foe({timeout:n}),s=()=>a.copy(i);return D.jsx(D.Fragment,{children:e({copy:s,copied:a.copied,...r})})}kY.displayName="@mantine/core/CopyButton";var DY={root:"m_3eebeb36",label:"m_9e365f20"};const kpe={orientation:"horizontal"},Dpe=(t,{color:e,variant:n,size:i})=>({root:{"--divider-color":e?ea(e,t):void 0,"--divider-border-style":n,"--divider-size":ci(i,"divider-size")}}),cg=Zt((t,e)=>{const n=Pt("Divider",kpe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,orientation:u,label:f,labelPosition:h,mod:d,attributes:g,...b}=n,y=En({name:"Divider",classes:DY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:Dpe});return D.jsx(st,{ref:e,mod:[{orientation:u,"with-label":!!f},d],...y("root"),...b,role:"separator",children:f&&D.jsx(st,{component:"span",mod:{position:h},...y("label"),children:f})})});cg.classes=DY;cg.displayName="@mantine/core/Divider";var OY={root:"m_9e117634"};const Ope=(t,{radius:e,fit:n})=>({root:{"--image-radius":e===void 0?void 0:ta(e),"--image-object-fit":n}}),I_=Dl((t,e)=>{const n=Pt("Image",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,onError:c,src:u,radius:f,fit:h,fallbackSrc:d,mod:g,attributes:b,...y}=n,[p,x]=I.useState(!u);I.useEffect(()=>x(!u),[u]);const _=En({name:"Image",classes:OY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:l,varsResolver:Ope});return p&&d?D.jsx(st,{component:"img",ref:e,src:d,..._("root"),onError:c,mod:["fallback",g],...y}):D.jsx(st,{component:"img",ref:e,..._("root"),src:u,onError:w=>{c?.(w),x(!0)},mod:g,...y})});I_.classes=OY;I_.displayName="@mantine/core/Image";var Ipe=I.useLayoutEffect,Npe=function(e){var n=Ee.useRef(e);return Ipe(function(){n.current=e}),n},wz=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},Lpe=function(e,n){var i=Ee.useRef();return Ee.useCallback(function(r){e.current=r,i.current&&wz(i.current,null),i.current=n,n&&wz(n,r)},[n])},Ez={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},Ppe=function(e){Object.keys(Ez).forEach(function(n){e.style.setProperty(n,Ez[n],"important")})},Mz=Ppe,mo=null,Tz=function(e,n){var i=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?i+n.borderSize:i-n.paddingSize};function Upe(t,e,n,i){n===void 0&&(n=1),i===void 0&&(i=1/0),mo||(mo=document.createElement("textarea"),mo.setAttribute("tabindex","-1"),mo.setAttribute("aria-hidden","true"),Mz(mo)),mo.parentNode===null&&document.body.appendChild(mo);var r=t.paddingSize,a=t.borderSize,s=t.sizingStyle,o=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;mo.style[d]=s[d]}),Mz(mo),mo.value=e;var l=Tz(mo,t);mo.value=e,l=Tz(mo,t),mo.value="x";var c=mo.scrollHeight-r,u=c*n;o==="border-box"&&(u=u+r+a),l=Math.max(u,l);var f=c*i;return o==="border-box"&&(f=f+r+a),l=Math.min(f,l),[l,c]}var Az=function(){},Fpe=function(e,n){return e.reduce(function(i,r){return i[r]=n[r],i},{})},Bpe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],zpe=!!document.documentElement.currentStyle,jpe=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var i=Fpe(Bpe,n),r=i.boxSizing;if(r==="")return null;zpe&&r==="border-box"&&(i.width=parseFloat(i.width)+parseFloat(i.borderRightWidth)+parseFloat(i.borderLeftWidth)+parseFloat(i.paddingRight)+parseFloat(i.paddingLeft)+"px");var a=parseFloat(i.paddingBottom)+parseFloat(i.paddingTop),s=parseFloat(i.borderBottomWidth)+parseFloat(i.borderTopWidth);return{sizingStyle:i,paddingSize:a,borderSize:s}},Hpe=jpe;function SP(t,e,n){var i=Npe(n);I.useLayoutEffect(function(){var r=function(s){return i.current(s)};if(t)return t.addEventListener(e,r),function(){return t.removeEventListener(e,r)}},[])}var Vpe=function(e,n){SP(document.body,"reset",function(i){e.current.form===i.target&&n(i)})},Gpe=function(e){SP(window,"resize",e)},Wpe=function(e){SP(document.fonts,"loadingdone",e)},Xpe=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],qpe=function(e,n){var i=e.cacheMeasurements,r=e.maxRows,a=e.minRows,s=e.onChange,o=s===void 0?Az:s,l=e.onHeightChange,c=l===void 0?Az:l,u=yL(e,Xpe),f=u.value!==void 0,h=I.useRef(null),d=Lpe(h,n),g=I.useRef(0),b=I.useRef(),y=function(){var _=h.current,w=i&&b.current?b.current:Hpe(_);if(w){b.current=w;var M=Upe(w,_.value||_.placeholder||"x",a,r),S=M[0],A=M[1];g.current!==S&&(g.current=S,_.style.setProperty("height",S+"px","important"),c(S,{rowHeight:A}))}},p=function(_){f||y(),o(_)};return I.useLayoutEffect(y),Vpe(h,function(){if(!f){var x=h.current.value;requestAnimationFrame(function(){var _=h.current;_&&x!==_.value&&y()})}}),Gpe(y),Wpe(y),I.createElement("textarea",Ls({},u,{onChange:p,ref:d}))},Kpe=I.forwardRef(qpe);const Ype={size:"sm"},SA=Zt((t,e)=>{const{autosize:n,maxRows:i,minRows:r,__staticSelector:a,resize:s,...o}=Pt("Textarea",Ype,t),l=n&&Nq()!=="test",c=l?{maxRows:i,minRows:r}:{};return D.jsx(Tu,{component:l?Kpe:"textarea",ref:e,...o,__staticSelector:a||"Textarea",multiline:!0,"data-no-overflow":n&&i===void 0||void 0,__vars:{"--input-resize":s},...c})});SA.classes=Tu.classes;SA.displayName="@mantine/core/Textarea";const[Jpe,$pe]=Mu("List component was not found in tree");var wP={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const EP=Zt((t,e)=>{const n=Pt("ListItem",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,icon:l,children:c,mod:u,...f}=n,h=$pe(),d=l||h.icon,g={classNames:i,styles:s};return D.jsx(st,{...h.getStyles("item",{...g,className:r,style:a}),component:"li",mod:[{"with-icon":!!d,centered:h.center},u],ref:e,...f,children:D.jsxs("div",{...h.getStyles("itemWrapper",g),children:[d&&D.jsx("span",{...h.getStyles("itemIcon",g),children:d}),D.jsx("span",{...h.getStyles("itemLabel",g),children:c})]})})});EP.classes=wP;EP.displayName="@mantine/core/ListItem";const Zpe={type:"unordered"},Qpe=(t,{size:e,spacing:n})=>({root:{"--list-fz":os(e),"--list-lh":Iq(e),"--list-spacing":Hd(n)}}),J0=Zt((t,e)=>{const n=Pt("List",Zpe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,children:c,type:u,withPadding:f,icon:h,spacing:d,center:g,listStyleType:b,mod:y,attributes:p,...x}=n,_=En({name:"List",classes:wP,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:p,vars:l,varsResolver:Qpe});return D.jsx(Jpe,{value:{center:g,icon:h,getStyles:_},children:D.jsx(st,{..._("root",{style:{listStyleType:b}}),component:u==="unordered"?"ul":"ol",mod:[{"with-padding":f},y],ref:e,...x,children:c})})});J0.classes=wP;J0.displayName="@mantine/core/List";J0.Item=EP;const[eme,zv]=Mu("Modal component was not found in tree");var Eh={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const wA=Zt((t,e)=>{const n=Pt("ModalBody",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=zv();return D.jsx(zK,{ref:e,...c.getStyles("body",{classNames:i,style:a,styles:s,className:r}),...l})});wA.classes=Eh;wA.displayName="@mantine/core/ModalBody";const EA=Zt((t,e)=>{const n=Pt("ModalCloseButton",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=zv();return D.jsx(jK,{ref:e,...c.getStyles("close",{classNames:i,style:a,styles:s,className:r}),...l})});EA.classes=Eh;EA.displayName="@mantine/core/ModalCloseButton";const MA=Zt((t,e)=>{const n=Pt("ModalContent",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,children:l,__hidden:c,...u}=n,f=zv(),h=f.scrollAreaComponent||fde;return D.jsx(HK,{...f.getStyles("content",{className:r,style:a,styles:s,classNames:i}),innerProps:f.getStyles("inner",{className:r,style:a,styles:s,classNames:i}),"data-full-screen":f.fullScreen||void 0,"data-modal-content":!0,"data-hidden":c||void 0,ref:e,...u,children:D.jsx(h,{style:{maxHeight:f.fullScreen?"100dvh":`calc(100dvh - (${Et(f.yOffset)} * 2))`},children:l})})});MA.classes=Eh;MA.displayName="@mantine/core/ModalContent";const TA=Zt((t,e)=>{const n=Pt("ModalHeader",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=zv();return D.jsx(VK,{ref:e,...c.getStyles("header",{classNames:i,style:a,styles:s,className:r}),...l})});TA.classes=Eh;TA.displayName="@mantine/core/ModalHeader";const AA=Zt((t,e)=>{const n=Pt("ModalOverlay",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=zv();return D.jsx(GK,{ref:e,...c.getStyles("overlay",{classNames:i,style:a,styles:s,className:r}),...l})});AA.classes=Eh;AA.displayName="@mantine/core/ModalOverlay";const tme={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:bf("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},nme=(t,{radius:e,size:n,yOffset:i,xOffset:r})=>({root:{"--modal-radius":e===void 0?void 0:ta(e),"--modal-size":ci(n,"modal-size"),"--modal-y-offset":Et(i),"--modal-x-offset":Et(r)}}),CA=Zt((t,e)=>{const n=Pt("ModalRoot",tme,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,yOffset:c,scrollAreaComponent:u,radius:f,fullScreen:h,centered:d,xOffset:g,__staticSelector:b,attributes:y,...p}=n,x=En({name:b,classes:Eh,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:nme});return D.jsx(eme,{value:{yOffset:c,scrollAreaComponent:u,getStyles:x,fullScreen:h},children:D.jsx(BK,{ref:e,...x("root"),"data-full-screen":h||void 0,"data-centered":d||void 0,"data-offset-scrollbars":u===Dc.Autosize||void 0,unstyled:o,...p})})});CA.classes=Eh;CA.displayName="@mantine/core/ModalRoot";const[ime,rme]=A_();function IY({children:t}){const[e,n]=I.useState([]),[i,r]=I.useState(bf("modal"));return D.jsx(ime,{value:{stack:e,addModal:(a,s)=>{n(o=>[...new Set([...o,a])]),r(o=>typeof s=="number"&&typeof o=="number"?Math.max(o,s):o)},removeModal:a=>n(s=>s.filter(o=>o!==a)),getZIndex:a=>`calc(${i} + ${e.indexOf(a)} + 1)`,currentId:e[e.length-1],maxZIndex:i},children:t})}IY.displayName="@mantine/core/ModalStack";const RA=Zt((t,e)=>{const n=Pt("ModalTitle",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=zv();return D.jsx(WK,{ref:e,...c.getStyles("title",{classNames:i,style:a,styles:s,className:r}),...l})});RA.classes=Eh;RA.displayName="@mantine/core/ModalTitle";const ame={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:bf("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Ro=Zt((t,e)=>{const{title:n,withOverlay:i,overlayProps:r,withCloseButton:a,closeButtonProps:s,children:o,radius:l,opened:c,stackId:u,zIndex:f,...h}=Pt("Modal",ame,t),d=rme(),g=!!n||a,b=d&&u?{closeOnEscape:d.currentId===u,trapFocus:d.currentId===u,zIndex:d.getZIndex(u)}:{},y=i===!1?!1:u&&d?d.currentId===u:c;return I.useEffect(()=>{d&&u&&(c?d.addModal(u,f||bf("modal")):d.removeModal(u))},[c,u,f]),D.jsxs(CA,{ref:e,radius:l,opened:c,zIndex:d&&u?d.getZIndex(u):f,...h,...b,children:[i&&D.jsx(AA,{visible:y,transitionProps:d&&u?{duration:0}:void 0,...r}),D.jsxs(MA,{radius:l,__hidden:d&&u&&c?u!==d.currentId:!1,children:[g&&D.jsxs(TA,{children:[n&&D.jsx(RA,{children:n}),a&&D.jsx(EA,{...s})]}),D.jsx(wA,{children:o})]})]})});Ro.classes=Eh;Ro.displayName="@mantine/core/Modal";Ro.Root=CA;Ro.Overlay=AA;Ro.Content=MA;Ro.Body=wA;Ro.Header=TA;Ro.Title=RA;Ro.CloseButton=EA;Ro.Stack=IY;var NY={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const sme={withCloseButton:!0},ome=(t,{radius:e,color:n})=>({root:{"--notification-radius":e===void 0?void 0:ta(e),"--notification-color":n?ea(n,t):void 0}}),MP=Zt((t,e)=>{const n=Pt("Notification",sme,t),{className:i,color:r,radius:a,loading:s,withCloseButton:o,withBorder:l,title:c,icon:u,children:f,onClose:h,closeButtonProps:d,classNames:g,style:b,styles:y,unstyled:p,variant:x,vars:_,mod:w,loaderProps:M,role:S,attributes:A,...C}=n,k=En({name:"Notification",classes:NY,props:n,className:i,style:b,classNames:g,styles:y,unstyled:p,attributes:A,vars:_,varsResolver:ome});return D.jsxs(st,{...k("root"),mod:[{"data-with-icon":!!u||s,"data-with-border":l},w],ref:e,variant:x,role:S||"alert",...C,children:[u&&!s&&D.jsx("div",{...k("icon"),children:u}),s&&D.jsx(Zd,{size:28,color:r,...M,...k("loader")}),D.jsxs("div",{...k("body"),children:[c&&D.jsx("div",{...k("title"),children:c}),D.jsx(st,{...k("description"),mod:{"data-with-title":!!c},children:f})]}),o&&D.jsx(k_,{iconSize:16,color:"gray",...d,unstyled:p,onClick:h,...k("closeButton")})]})});MP.classes=NY;MP.displayName="@mantine/core/Notification";function LY(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}var B1;(function(t){t.event="event",t.props="prop"})(B1||(B1={}));function bd(){}function lme(t){var e,n=void 0;return function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e&&i.length===e.length&&i.every(function(a,s){return a===e[s]})||(e=i,n=t.apply(void 0,i)),n}}function z1(t){return!!(t||"").match(/\d/)}function x0(t){return t==null}function cme(t){return typeof t=="number"&&isNaN(t)}function PY(t){return x0(t)||cme(t)||typeof t=="number"&&!isFinite(t)}function UY(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function ume(t){switch(t){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function fme(t,e,n){var i=ume(n),r=t.search(/[1-9]/);return r=r===-1?t.length:r,t.substring(0,r)+t.substring(r,t.length).replace(i,"$1"+e)}function hme(t){var e=I.useRef(t);e.current=t;var n=I.useRef(function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e.current.apply(e,i)});return n.current}function TP(t,e){e===void 0&&(e=!0);var n=t[0]==="-",i=n&&e;t=t.replace("-","");var r=t.split("."),a=r[0],s=r[1]||"";return{beforeDecimal:a,afterDecimal:s,hasNegation:n,addNegation:i}}function dme(t){if(!t)return t;var e=t[0]==="-";e&&(t=t.substring(1,t.length));var n=t.split("."),i=n[0].replace(/^0+/,"")||"0",r=n[1]||"";return(e?"-":"")+i+(r?"."+r:"")}function FY(t,e,n){for(var i="",r=n?"0":"",a=0;a<=e-1;a++)i+=t[a]||r;return i}function Cz(t,e){return Array(e+1).join(t)}function BY(t){var e=t+"",n=e[0]==="-"?"-":"";n&&(e=e.substring(1));var i=e.split(/[eE]/g),r=i[0],a=i[1];if(a=Number(a),!a)return n+r;r=r.replace(".","");var s=1+a,o=r.length;return s<0?r="0."+Cz("0",Math.abs(s))+r:s>=o?r=r+Cz("0",s-o):r=(r.substring(0,s)||"0")+"."+r.substring(s),n+r}function Rz(t,e,n){if(["","-"].indexOf(t)!==-1)return t;var i=(t.indexOf(".")!==-1||n)&&e,r=TP(t),a=r.beforeDecimal,s=r.afterDecimal,o=r.hasNegation,l=parseFloat("0."+(s||"0")),c=s.length<=e?"0."+s:l.toFixed(e),u=c.split("."),f=a;a&&Number(u[0])&&(f=a.split("").reverse().reduce(function(b,y,p){return b.length>p?(Number(b[0])+Number(y)).toString()+b.substring(1,b.length):y+b},u[0]));var h=FY(u[1]||"",e,n),d=o?"-":"",g=i?".":"";return""+d+f+g+h}function rm(t,e){if(t.value=t.value,t!==null){if(t.createTextRange){var n=t.createTextRange();return n.move("character",e),n.select(),!0}return t.selectionStart||t.selectionStart===0?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}}var zY=lme(function(t,e){for(var n=0,i=0,r=t.length,a=e.length;t[n]===e[n]&&n<r;)n++;for(;t[r-1-i]===e[a-1-i]&&a-i>n&&r-i>n;)i++;return{from:{start:n,end:r-i},to:{start:n,end:a-i}}}),pme=function(t,e){var n=Math.min(t.selectionStart,e);return{from:{start:n,end:t.selectionEnd},to:{start:n,end:e}}};function mme(t,e,n){return Math.min(Math.max(t,e),n)}function Q3(t){return Math.max(t.selectionStart,t.selectionEnd)}function gme(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function bme(t){return{from:{start:0,end:0},to:{start:0,end:t.length},lastValue:""}}function vme(t){var e=t.currentValue,n=t.formattedValue,i=t.currentValueIndex,r=t.formattedValueIndex;return e[i]===n[r]}function yme(t,e,n,i,r,a,s){s===void 0&&(s=vme);var o=r.findIndex(function(w){return w}),l=t.slice(0,o);!e&&!n.startsWith(l)&&(e=l,n=l+n,i=i+l.length);for(var c=n.length,u=t.length,f={},h=new Array(c),d=0;d<c;d++){h[d]=-1;for(var g=0,b=u;g<b;g++){var y=s({currentValue:n,lastValue:e,formattedValue:t,currentValueIndex:d,formattedValueIndex:g});if(y&&f[g]!==!0){h[d]=g,f[g]=!0;break}}}for(var p=i;p<c&&(h[p]===-1||!a(n[p]));)p++;var x=p===c||h[p]===-1?u:h[p];for(p=i-1;p>0&&h[p]===-1;)p--;var _=p===-1||h[p]===-1?0:h[p]+1;return _>x?x:i-_<x-i?_:x}function kz(t,e,n,i){var r=t.length;if(e=mme(e,0,r),i==="left"){for(;e>=0&&!n[e];)e--;e===-1&&(e=n.indexOf(!0))}else{for(;e<=r&&!n[e];)e++;e>r&&(e=n.lastIndexOf(!0))}return e===-1&&(e=r),e}function xme(t){for(var e=Array.from({length:t.length+1}).map(function(){return!0}),n=0,i=e.length;n<i;n++)e[n]=!!(z1(t[n])||z1(t[n-1]));return e}function jY(t,e,n,i,r,a){a===void 0&&(a=bd);var s=hme(function(g,b){var y,p;return PY(g)?(p="",y=""):typeof g=="number"||b?(p=typeof g=="number"?BY(g):g,y=i(p)):(p=r(g,void 0),y=i(p)),{formattedValue:y,numAsString:p}}),o=I.useState(function(){return s(x0(t)?e:t,n)}),l=o[0],c=o[1],u=function(g,b){g.formattedValue!==l.formattedValue&&c({formattedValue:g.formattedValue,numAsString:g.value}),a(g,b)},f=t,h=n;x0(t)&&(f=l.numAsString,h=!0);var d=s(f,h);return I.useMemo(function(){c(d)},[d.formattedValue]),[l,u]}function _me(t){return t.replace(/[^0-9]/g,"")}function Sme(t){return t}function wme(t){var e=t.type;e===void 0&&(e="text");var n=t.displayType;n===void 0&&(n="input");var i=t.customInput,r=t.renderText,a=t.getInputRef,s=t.format;s===void 0&&(s=Sme);var o=t.removeFormatting;o===void 0&&(o=_me);var l=t.defaultValue,c=t.valueIsNumericString,u=t.onValueChange,f=t.isAllowed,h=t.onChange;h===void 0&&(h=bd);var d=t.onKeyDown;d===void 0&&(d=bd);var g=t.onMouseUp;g===void 0&&(g=bd);var b=t.onFocus;b===void 0&&(b=bd);var y=t.onBlur;y===void 0&&(y=bd);var p=t.value,x=t.getCaretBoundary;x===void 0&&(x=xme);var _=t.isValidInputCharacter;_===void 0&&(_=z1);var w=t.isCharacterSame,M=LY(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),S=jY(p,l,!!c,s,o,u),A=S[0],C=A.formattedValue,k=A.numAsString,R=S[1],N=I.useRef(),P=I.useRef({formattedValue:C,numAsString:k}),j=function(we,Ae){P.current={formattedValue:we.formattedValue,numAsString:we.value},R(we,Ae)},z=I.useState(!1),X=z[0],F=z[1],H=I.useRef(null),V=I.useRef({setCaretTimeout:null,focusTimeout:null});I.useEffect(function(){return F(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var W=s,B=function(we,Ae){var Re=parseFloat(Ae);return{formattedValue:we,value:Ae,floatValue:isNaN(Re)?void 0:Re}},Y=function(we,Ae,Re){we.selectionStart===0&&we.selectionEnd===we.value.length||(rm(we,Ae),V.current.setCaretTimeout=setTimeout(function(){we.value===Re&&we.selectionStart!==Ae&&rm(we,Ae)},0))},Z=function(we,Ae,Re){return kz(we,Ae,x(we),Re)},G=function(we,Ae,Re){var Ne=x(Ae),Fe=yme(Ae,C,we,Re,Ne,_,w);return Fe=kz(Ae,Fe,Ne),Fe},de=function(we){var Ae=we.formattedValue;Ae===void 0&&(Ae="");var Re=we.input,Ne=we.source,Fe=we.event,Qe=we.numAsString,ae;if(Re){var K=we.inputValue||Re.value,ce=Q3(Re);Re.value=Ae,ae=G(K,Ae,ce),ae!==void 0&&Y(Re,ae,Ae)}Ae!==C&&j(B(Ae,Qe),{event:Fe,source:Ne})};I.useEffect(function(){var we=P.current,Ae=we.formattedValue,Re=we.numAsString;(C!==Ae||k!==Re)&&j(B(C,k),{event:void 0,source:B1.props})},[C,k]);var oe=H.current?Q3(H.current):void 0,le=typeof window<"u"?I.useLayoutEffect:I.useEffect;le(function(){var we=H.current;if(C!==P.current.formattedValue&&we){var Ae=G(P.current.formattedValue,C,oe);we.value=C,Y(we,Ae,C)}},[C]);var ue=function(we,Ae,Re){var Ne=Ae.target,Fe=N.current?pme(N.current,Ne.selectionEnd):zY(C,we),Qe=Object.assign(Object.assign({},Fe),{lastValue:C}),ae=o(we,Qe),K=W(ae);if(ae=o(K,void 0),f&&!f(B(K,ae))){var ce=Ae.target,he=Q3(ce),me=G(we,C,he);return ce.value=C,Y(ce,me,C),!1}return de({formattedValue:K,numAsString:ae,inputValue:we,event:Ae,source:Re,input:Ae.target}),!0},Se=function(we,Ae){Ae===void 0&&(Ae=0);var Re=we.selectionStart,Ne=we.selectionEnd;N.current={selectionStart:Re,selectionEnd:Ne+Ae}},Te=function(we){var Ae=we.target,Re=Ae.value,Ne=ue(Re,we,B1.event);Ne&&h(we),N.current=void 0},Pe=function(we){var Ae=we.target,Re=we.key,Ne=Ae.selectionStart,Fe=Ae.selectionEnd,Qe=Ae.value;Qe===void 0&&(Qe="");var ae;Re==="ArrowLeft"||Re==="Backspace"?ae=Math.max(Ne-1,0):Re==="ArrowRight"?ae=Math.min(Ne+1,Qe.length):Re==="Delete"&&(ae=Ne);var K=0;Re==="Delete"&&Ne===Fe&&(K=1);var ce=Re==="ArrowLeft"||Re==="ArrowRight";if(ae===void 0||Ne!==Fe&&!ce){d(we),Se(Ae,K);return}var he=ae;if(ce){var me=Re==="ArrowLeft"?"left":"right";he=Z(Qe,ae,me),he!==ae&&we.preventDefault()}else Re==="Delete"&&!_(Qe[ae])?he=Z(Qe,ae,"right"):Re==="Backspace"&&!_(Qe[ae])&&(he=Z(Qe,ae,"left"));he!==ae&&Y(Ae,he,Qe),d(we),Se(Ae,K)},je=function(we){var Ae=we.target,Re=function(){var Ne=Ae.selectionStart,Fe=Ae.selectionEnd,Qe=Ae.value;if(Qe===void 0&&(Qe=""),Ne===Fe){var ae=Z(Qe,Ne);ae!==Ne&&Y(Ae,ae,Qe)}};Re(),requestAnimationFrame(function(){Re()}),g(we),Se(Ae)},He=function(we){we.persist&&we.persist();var Ae=we.target,Re=we.currentTarget;H.current=Ae,V.current.focusTimeout=setTimeout(function(){var Ne=Ae.selectionStart,Fe=Ae.selectionEnd,Qe=Ae.value;Qe===void 0&&(Qe="");var ae=Z(Qe,Ne);ae!==Ne&&!(Ne===0&&Fe===Qe.length)&&Y(Ae,ae,Qe),b(Object.assign(Object.assign({},we),{currentTarget:Re}))},0)},pe=function(we){H.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),y(we)},ze=X&&gme()?"numeric":void 0,Ie=Object.assign({inputMode:ze},M,{type:e,value:C,onChange:Te,onKeyDown:Pe,onMouseUp:je,onFocus:He,onBlur:pe});if(n==="text")return r?Ee.createElement(Ee.Fragment,null,r(C,M)||null):Ee.createElement("span",Object.assign({},M,{ref:a}),C);if(i){var Xe=i;return Ee.createElement(Xe,Object.assign({},Ie,{ref:a}))}return Ee.createElement("input",Object.assign({},Ie,{ref:a}))}function Dz(t,e){var n=e.decimalScale,i=e.fixedDecimalScale,r=e.prefix;r===void 0&&(r="");var a=e.suffix;a===void 0&&(a="");var s=e.allowNegative,o=e.thousandsGroupStyle;if(o===void 0&&(o="thousand"),t===""||t==="-")return t;var l=kA(e),c=l.thousandSeparator,u=l.decimalSeparator,f=n!==0&&t.indexOf(".")!==-1||n&&i,h=TP(t,s),d=h.beforeDecimal,g=h.afterDecimal,b=h.addNegation;return n!==void 0&&(g=FY(g,n,!!i)),c&&(d=fme(d,c,o)),r&&(d=r+d),a&&(g=g+a),b&&(d="-"+d),t=d+(f&&u||"")+g,t}function kA(t){var e=t.decimalSeparator;e===void 0&&(e=".");var n=t.thousandSeparator,i=t.allowedDecimalSeparators;return n===!0&&(n=","),i||(i=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:i}}function Eme(t,e){t===void 0&&(t="");var n=new RegExp("(-)"),i=new RegExp("(-)(.)*(-)"),r=n.test(t),a=i.test(t);return t=t.replace(/-/g,""),r&&!a&&e&&(t="-"+t),t}function Mme(t,e){return new RegExp("(^-)|[0-9]|"+UY(t),"g")}function Tme(t,e,n){return t===""?!0:!e?.match(/\d/)&&!n?.match(/\d/)&&typeof t=="string"&&!isNaN(Number(t))}function Ame(t,e,n){var i;e===void 0&&(e=bme(t));var r=n.allowNegative,a=n.prefix;a===void 0&&(a="");var s=n.suffix;s===void 0&&(s="");var o=n.decimalScale,l=e.from,c=e.to,u=c.start,f=c.end,h=kA(n),d=h.allowedDecimalSeparators,g=h.decimalSeparator,b=t[f]===g;if(z1(t)&&(t===a||t===s)&&e.lastValue==="")return t;if(f-u===1&&d.indexOf(t[u])!==-1){var y=o===0?"":g;t=t.substring(0,u)+y+t.substring(u+1,t.length)}var p=function(H,V,W){var B=!1,Y=!1;a.startsWith("-")?B=!1:H.startsWith("--")?(B=!1,Y=!0):s.startsWith("-")&&H.length===s.length?B=!1:H[0]==="-"&&(B=!0);var Z=B?1:0;return Y&&(Z=2),Z&&(H=H.substring(Z),V-=Z,W-=Z),{value:H,start:V,end:W,hasNegation:B}},x=p(t,u,f),_=x.hasNegation;i=x,t=i.value,u=i.start,f=i.end;var w=p(e.lastValue,l.start,l.end),M=w.start,S=w.end,A=w.value,C=t.substring(u,f);t.length&&A.length&&(M>A.length-s.length||S<a.length)&&!(C&&s.startsWith(C))&&(t=A);var k=0;t.startsWith(a)?k+=a.length:u<a.length&&(k=u),t=t.substring(k),f-=k;var R=t.length,N=t.length-s.length;t.endsWith(s)?R=N:(f>N||f>t.length-s.length)&&(R=f),t=t.substring(0,R),t=Eme(_?"-"+t:t,r),t=(t.match(Mme(g))||[]).join("");var P=t.indexOf(g);t=t.replace(new RegExp(UY(g),"g"),function(H,V){return V===P?".":""});var j=TP(t,r),z=j.beforeDecimal,X=j.afterDecimal,F=j.addNegation;return c.end-c.start<l.end-l.start&&z===""&&b&&!parseFloat(X)&&(t=F?"-":""),t}function Cme(t,e){var n=e.prefix;n===void 0&&(n="");var i=e.suffix;i===void 0&&(i="");var r=Array.from({length:t.length+1}).map(function(){return!0}),a=t[0]==="-";r.fill(!1,0,n.length+(a?1:0));var s=t.length;return r.fill(!1,s-i.length+1,s+1),r}function Rme(t){var e=kA(t),n=e.thousandSeparator,i=e.decimalSeparator,r=t.prefix;r===void 0&&(r="");var a=t.allowNegative;if(a===void 0&&(a=!0),n===i)throw new Error(`
        Decimal separator can't be same as thousand separator.
        thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
        decimalSeparator: `+i+` (default value for decimalSeparator is .)
     `);return r.startsWith("-")&&a&&(console.error(`
      Prefix can't start with '-' when allowNegative is true.
      prefix: `+r+`
      allowNegative: `+a+`
    `),a=!1),Object.assign(Object.assign({},t),{allowNegative:a})}function kme(t){t=Rme(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,i=t.allowLeadingZeros,r=t.onKeyDown;r===void 0&&(r=bd);var a=t.onBlur;a===void 0&&(a=bd);var s=t.thousandSeparator,o=t.decimalScale,l=t.fixedDecimalScale,c=t.prefix;c===void 0&&(c="");var u=t.defaultValue,f=t.value,h=t.valueIsNumericString,d=t.onValueChange,g=LY(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=kA(t),y=b.decimalSeparator,p=b.allowedDecimalSeparators,x=function(F){return Dz(F,t)},_=function(F,H){return Ame(F,H,t)},w=x0(f)?u:f,M=h??Tme(w,c,e);x0(f)?x0(u)||(M=M||typeof u=="number"):M=M||typeof f=="number";var S=function(F){return PY(F)?F:(typeof F=="number"&&(F=BY(F)),M&&typeof o=="number"?Rz(F,o,!!l):F)},A=jY(S(f),S(u),!!M,x,_,d),C=A[0],k=C.numAsString,R=C.formattedValue,N=A[1],P=function(F){var H=F.target,V=F.key,W=H.selectionStart,B=H.selectionEnd,Y=H.value;if(Y===void 0&&(Y=""),(V==="Backspace"||V==="Delete")&&B<c.length){F.preventDefault();return}if(W!==B){r(F);return}V==="Backspace"&&Y[0]==="-"&&W===c.length+1&&n&&rm(H,1),o&&l&&(V==="Backspace"&&Y[W-1]===y?(rm(H,W-1),F.preventDefault()):V==="Delete"&&Y[W]===y&&F.preventDefault()),p?.includes(V)&&Y[W]===y&&rm(H,W+1);var Z=s===!0?",":s;V==="Backspace"&&Y[W-1]===Z&&rm(H,W-1),V==="Delete"&&Y[W]===Z&&rm(H,W+1),r(F)},j=function(F){var H=k;if(H.match(/\d/g)||(H=""),i||(H=dme(H)),l&&o&&(H=Rz(H,o,l)),H!==k){var V=Dz(H,t);N({formattedValue:V,value:H,floatValue:parseFloat(H)},{event:F,source:B1.event})}a(F)},z=function(F){return F===y?!0:z1(F)},X=function(F){var H=F.currentValue,V=F.lastValue,W=F.formattedValue,B=F.currentValueIndex,Y=F.formattedValueIndex,Z=H[B],G=W[Y],de=zY(V,H),oe=de.to,le=function(ue){return _(ue).indexOf(".")+c.length};return f===0&&l&&o&&H[oe.start]===y&&le(H)<B&&le(W)>Y?!1:B>=oe.start&&B<oe.end&&p&&p.includes(Z)&&G===y?!0:Z===G};return Object.assign(Object.assign({},g),{value:R,valueIsNumericString:!1,isValidInputCharacter:z,isCharacterSame:X,onValueChange:N,format:x,removeFormatting:_,getCaretBoundary:function(F){return Cme(F,t)},onKeyDown:P,onBlur:j})}function Dme(t){var e=kme(t);return Ee.createElement(wme,Object.assign({},e))}function Oz({direction:t,style:e,...n}){return D.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:t==="up"?"rotate(180deg)":void 0,...e},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:D.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var GO={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const Ome=/^(0\.0*|-0(\.0*)?)$/,Ime=/^-?0\d+(\.\d+)?\.?$/,Nme=/\.\d*0$/;function WO(t){return typeof t=="string"&&t!==""&&!Number.isNaN(Number(t))}function ek(t){return typeof t=="number"?t<Number.MAX_SAFE_INTEGER:t===""||WO(t)&&Number(t)<Number.MAX_SAFE_INTEGER}function Lme(t){return t.toString().replace(".","").length}function Pme(t,e){return(typeof t=="number"?t<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(t)))&&!Number.isNaN(t)&&Lme(e)<14&&e!==""}function Iz(t,e,n){if(t===void 0)return!0;const i=e===void 0||t>=e,r=n===void 0||t<=n;return i&&r}const Ume={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},Fme=(t,{size:e})=>({controls:{"--ni-chevron-size":ci(e,"ni-chevron-size")}});function Bme(t,e,n){const i=t.toString().replace(/^0+/,""),r=parseFloat(i);return Number.isNaN(r)?i:r>Number.MAX_SAFE_INTEGER?e!==void 0?e:i:gc(r,n,e)}const ug=Zt((t,e)=>{const n=Pt("NumberInput",Ume,t),{className:i,classNames:r,styles:a,unstyled:s,vars:o,onChange:l,onValueChange:c,value:u,defaultValue:f,max:h,min:d,step:g,hideControls:b,rightSection:y,isAllowed:p,clampBehavior:x,onBlur:_,allowDecimal:w,decimalScale:M,onKeyDown:S,onKeyDownCapture:A,handlersRef:C,startValue:k,disabled:R,rightSectionPointerEvents:N,allowNegative:P,readOnly:j,size:z,rightSectionWidth:X,stepHoldInterval:F,stepHoldDelay:H,allowLeadingZeros:V,withKeyboardEvents:W,trimLeadingZeroesOnBlur:B,attributes:Y,...Z}=n,G=En({name:"NumberInput",classes:GO,props:n,classNames:r,styles:a,unstyled:s,attributes:Y,vars:o,varsResolver:Fme}),{resolvedClassNames:de,resolvedStyles:oe}=Iv({classNames:r,styles:a,props:n}),[le,ue]=Wo({value:u,defaultValue:f,finalValue:"",onChange:l}),Se=H!==void 0&&F!==void 0,Te=I.useRef(null),Pe=I.useRef(null),je=I.useRef(0),He=(ce,he)=>{he.source==="event"&&ue(Pme(ce.floatValue,ce.value)&&!Ome.test(ce.value)&&!(V&&Ime.test(ce.value))&&!Nme.test(ce.value)?ce.floatValue:ce.value),c?.(ce,he)},pe=ce=>{const he=String(ce).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return he?Math.max(0,(he[1]?he[1].length:0)-(he[2]?+he[2]:0)):0},ze=ce=>{Te.current&&typeof ce<"u"&&Te.current.setSelectionRange(ce,ce)},Ie=I.useRef(u2);Ie.current=()=>{if(!ek(le))return;let ce;const he=pe(le),me=pe(g),$=Math.max(he,me),Ve=10**$;if(!WO(le)&&(typeof le!="number"||Number.isNaN(le)))ce=gc(k,d,h);else if(h!==void 0){const mt=(Math.round(Number(le)*Ve)+Math.round(g*Ve))/Ve;ce=mt<=h?mt:h}else ce=(Math.round(Number(le)*Ve)+Math.round(g*Ve))/Ve;const qe=ce.toFixed($);ue(parseFloat(qe)),c?.({floatValue:parseFloat(qe),formattedValue:qe,value:qe},{source:"increment"}),setTimeout(()=>ze(Te.current?.value.length),0)};const Xe=I.useRef(u2);Xe.current=()=>{if(!ek(le))return;let ce;const he=d!==void 0?d:P?Number.MIN_SAFE_INTEGER:0,me=pe(le),$=pe(g),Ve=Math.max(me,$),qe=10**Ve;if(!WO(le)&&typeof le!="number"||Number.isNaN(le))ce=gc(k,he,h);else{const Ge=(Math.round(Number(le)*qe)-Math.round(g*qe))/qe;ce=he!==void 0&&Ge<he?he:Ge}const mt=ce.toFixed(Ve);ue(parseFloat(mt)),c?.({floatValue:parseFloat(mt),formattedValue:mt,value:mt},{source:"decrement"}),setTimeout(()=>ze(Te.current?.value.length),0)};const we=ce=>{S?.(ce),!(j||!W)&&(ce.key==="ArrowUp"&&(ce.preventDefault(),Ie.current?.()),ce.key==="ArrowDown"&&(ce.preventDefault(),Xe.current?.()))},Ae=ce=>{if(A?.(ce),ce.key==="Backspace"){const he=Te.current;he&&he.selectionStart===0&&he.selectionStart===he.selectionEnd&&(ce.preventDefault(),window.setTimeout(()=>ze(0),0))}},Re=ce=>{let he=le;x==="blur"&&typeof he=="number"&&(he=gc(he,d,h)),B&&typeof he=="string"&&pe(he)<15&&(he=Bme(he,h,d)),le!==he&&ue(he),_?.(ce)};o2(C,{increment:Ie.current,decrement:Xe.current});const Ne=ce=>{ce?Ie.current?.():Xe.current?.(),je.current+=1},Fe=ce=>{if(Ne(ce),Se){const he=typeof F=="number"?F:F(je.current);Pe.current=window.setTimeout(()=>Fe(ce),he)}},Qe=(ce,he)=>{ce.preventDefault(),Te.current?.focus(),Ne(he),Se&&(Pe.current=window.setTimeout(()=>Fe(he),H))},ae=()=>{Pe.current&&window.clearTimeout(Pe.current),Pe.current=null,je.current=0},K=D.jsxs("div",{...G("controls"),children:[D.jsx(uf,{...G("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof le=="number"&&h!==void 0&&le>=h,mod:{direction:"up"},onMouseDown:ce=>ce.preventDefault(),onPointerDown:ce=>{Qe(ce,!0)},onPointerUp:ae,onPointerLeave:ae,children:D.jsx(Oz,{direction:"up"})}),D.jsx(uf,{...G("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof le=="number"&&d!==void 0&&le<=d,mod:{direction:"down"},onMouseDown:ce=>ce.preventDefault(),onPointerDown:ce=>{Qe(ce,!1)},onPointerUp:ae,onPointerLeave:ae,children:D.jsx(Oz,{direction:"down"})})]});return D.jsx(Tu,{component:Dme,allowNegative:P,className:us(GO.root,i),size:z,...Z,readOnly:j,disabled:R,value:le,getInputRef:Va(e,Te),onValueChange:He,rightSection:b||j||!ek(le)?y:y||K,classNames:de,styles:oe,unstyled:s,__staticSelector:"NumberInput",decimalScale:w?M:0,onKeyDown:we,onKeyDownCapture:Ae,rightSectionPointerEvents:N??(R?"none":void 0),rightSectionWidth:X??`var(--ni-right-section-width-${z||"sm"})`,allowLeadingZeros:V,onBlur:Re,attributes:Y,isAllowed:ce=>x==="strict"?p?p(ce)&&Iz(ce.floatValue,d,h):Iz(ce.floatValue,d,h):p?p(ce):!0})});ug.classes={...Tu.classes,...GO};ug.displayName="@mantine/core/NumberInput";const[zme,HY]=Mu("Progress.Root component was not found in tree");var N_={root:"m_db6d6462",section:"m_2242eb65","stripes-animation":"m_81a374bd","stripes-animation-vertical":"m_e0fb7a86",label:"m_91e40b74"};const AP=Zt((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ProgressLabel",null,t),l=HY();return D.jsx(st,{ref:e,...l.getStyles("label",{className:i,style:r,classNames:n,styles:a}),...o})});AP.classes=N_;AP.displayName="@mantine/core/ProgressLabel";const jme=(t,{size:e,radius:n,transitionDuration:i})=>({root:{"--progress-size":ci(e,"progress-size"),"--progress-radius":n===void 0?void 0:ta(n),"--progress-transition-duration":typeof i=="number"?`${i}ms`:void 0}}),DA=Zt((t,e)=>{const n=Pt("ProgressRoot",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,autoContrast:c,transitionDuration:u,orientation:f,attributes:h,mod:d,...g}=n,b=En({name:"Progress",classes:N_,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:h,vars:l,varsResolver:jme});return D.jsx(zme,{value:{getStyles:b,autoContrast:c},children:D.jsx(st,{ref:e,mod:[{orientation:f},d],...b("root"),...g})})});DA.classes=N_;DA.displayName="@mantine/core/ProgressRoot";const Hme={withAria:!0},OA=Zt((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,value:o,withAria:l,color:c,striped:u,animated:f,mod:h,...d}=Pt("ProgressSection",Hme,t),g=HY(),b=ba(),y=l?{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":o,"aria-valuetext":`${o}%`}:{};return D.jsx(st,{ref:e,...g.getStyles("section",{className:i,classNames:n,styles:a,style:r}),...d,...y,mod:[{striped:u||f,animated:f},h],__vars:{"--progress-section-size":`${o}%`,"--progress-section-color":ea(c,b),"--progress-label-color":cA(g.autoContrast,b)?Ov({color:c,theme:b,autoContrast:g.autoContrast}):void 0}})});OA.classes=N_;OA.displayName="@mantine/core/ProgressSection";const hf=Zt((t,e)=>{const n=Pt("Progress",null,t),{value:i,classNames:r,styles:a,vars:s,color:o,striped:l,animated:c,"aria-label":u,...f}=n,{resolvedClassNames:h,resolvedStyles:d}=Iv({classNames:r,styles:a,props:n});return D.jsx(DA,{ref:e,classNames:h,styles:d,vars:s,...f,children:D.jsx(OA,{value:i,color:o,striped:l,animated:c,"aria-label":u})})});hf.classes=N_;hf.displayName="@mantine/core/Progress";hf.Section=OA;hf.Root=DA;hf.Label=AP;const Vme={duration:100,transition:"fade"};function Nz(t,e){return{...Vme,...e,...t}}function Gme({offset:t,position:e,defaultOpened:n}){const[i,r]=I.useState(n),a=I.useRef(null),{x:s,y:o,elements:l,refs:c,update:u,placement:f}=FL({placement:e,middleware:[NL({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=f.includes("right")?t:e.includes("left")?t*-1:0,d=f.includes("bottom")?t:e.includes("top")?t*-1:0,g=I.useCallback(({clientX:b,clientY:y})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:b,y,left:b+h,top:y+d,right:b,bottom:y}}})},[l.reference]);return I.useEffect(()=>{if(c.floating.current){const b=a.current;b.addEventListener("mousemove",g);const y=sh(c.floating.current);return y.forEach(p=>{p.addEventListener("scroll",u)}),()=>{b.removeEventListener("mousemove",g),y.forEach(p=>{p.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,g,i]),{handleMouseMove:g,x:s,y:o,opened:i,setOpened:r,boundaryRef:a,floating:c.setFloating}}var IA={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Wme={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:bf("popover")},Xme=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:ta(e),"--tooltip-bg":n?ea(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),CP=Zt((t,e)=>{const n=Pt("TooltipFloating",Wme,t),{children:i,refProp:r,withinPortal:a,style:s,className:o,classNames:l,styles:c,unstyled:u,radius:f,color:h,label:d,offset:g,position:b,multiline:y,zIndex:p,disabled:x,defaultOpened:_,variant:w,vars:M,portalProps:S,attributes:A,...C}=n,k=ba(),R=En({name:"TooltipFloating",props:n,classes:IA,className:o,style:s,classNames:l,styles:c,unstyled:u,attributes:A,rootSelector:"tooltip",vars:M,varsResolver:Xme}),{handleMouseMove:N,x:P,y:j,opened:z,boundaryRef:X,floating:F,setOpened:H}=Gme({offset:g,position:b,defaultOpened:_});if(!lg(i))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const V=Va(X,rA(i),e),W=i.props,B=Z=>{W.onMouseEnter?.(Z),N(Z),H(!0)},Y=Z=>{W.onMouseLeave?.(Z),H(!1)};return D.jsxs(D.Fragment,{children:[D.jsx(Gd,{...S,withinPortal:a,children:D.jsx(st,{...C,...R("tooltip",{style:{...AL(s,k),zIndex:p,display:!x&&z?"block":"none",top:(j&&Math.round(j))??"",left:(P&&Math.round(P))??""}}),variant:w,ref:F,mod:{multiline:y},children:d})}),I.cloneElement(i,{...W,[r]:V,onMouseEnter:B,onMouseLeave:Y})]})});CP.classes=IA;CP.displayName="@mantine/core/TooltipFloating";const VY=I.createContext(!1),qme=VY.Provider,Kme=()=>I.useContext(VY),Yme={openDelay:0,closeDelay:0};function RP(t){const{openDelay:e,closeDelay:n,children:i}=Pt("TooltipGroup",Yme,t);return D.jsx(qme,{value:!0,children:D.jsx(fhe,{delay:{open:e,close:n},children:i})})}RP.displayName="@mantine/core/TooltipGroup";RP.extend=t=>t;function Jme(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function $me(t){const e=Jme(t.middlewares),n=[sK(t.offset)];return e.shift&&n.push(NL(typeof e.shift=="boolean"?{padding:8}:{padding:8,...e.shift})),e.flip&&n.push(typeof e.flip=="boolean"?m2():m2(e.flip)),n.push(oK({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?Zx():Zx(e.inline)):t.inline&&n.push(Zx()),n}function Zme(t){const[e,n]=I.useState(t.defaultOpened),r=typeof t.opened=="boolean"?t.opened:e,a=Kme(),s=Eu(),o=I.useCallback(M=>{n(M),M&&p(s)},[s]),{x:l,y:c,context:u,refs:f,placement:h,middlewareData:{arrow:{x:d,y:g}={}}}=FL({strategy:t.strategy,placement:t.position,open:r,onOpenChange:o,middleware:$me(t),whileElementsMounted:FO}),{delay:b,currentId:y,setCurrentId:p}=hhe(u,{id:s}),{getReferenceProps:x,getFloatingProps:_}=vhe([che(u,{enabled:t.events?.hover,delay:a?b:{open:t.openDelay,close:t.closeDelay},mouseOnly:!t.events?.touch}),bhe(u,{enabled:t.events?.focus,visibleOnly:!0}),xhe(u,{role:"tooltip"}),mhe(u,{enabled:typeof t.opened>"u"})]);_c(()=>{t.onPositionChange?.(h)},[h]);const w=r&&y&&y!==s;return{x:l,y:c,arrowX:d,arrowY:g,reference:f.setReference,floating:f.setFloating,getFloatingProps:_,getReferenceProps:x,isGroupPhase:w,opened:r,placement:h}}const Lz={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:bf("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Qme=(t,{radius:e,color:n,variant:i,autoContrast:r})=>{const a=t.variantColorResolver({theme:t,color:n||t.primaryColor,autoContrast:r,variant:i||"filled"});return{tooltip:{"--tooltip-radius":e===void 0?void 0:ta(e),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}},Pr=Zt((t,e)=>{const n=Pt("Tooltip",Lz,t),{children:i,position:r,refProp:a,label:s,openDelay:o,closeDelay:l,onPositionChange:c,opened:u,defaultOpened:f,withinPortal:h,radius:d,color:g,classNames:b,styles:y,unstyled:p,style:x,className:_,withArrow:w,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,offset:k,transitionProps:R,multiline:N,events:P,zIndex:j,disabled:z,positionDependencies:X,onClick:F,onMouseEnter:H,onMouseLeave:V,inline:W,variant:B,keepMounted:Y,vars:Z,portalProps:G,mod:de,floatingStrategy:oe,middlewares:le,autoContrast:ue,attributes:Se,target:Te,...Pe}=Pt("Tooltip",Lz,n),{dir:je}=Nv(),He=I.useRef(null),pe=Zme({position:TK(je,r),closeDelay:l,openDelay:o,onPositionChange:c,opened:u,defaultOpened:f,events:P,arrowRef:He,arrowOffset:S,offset:typeof k=="number"?k+(w?M/2:0):k,positionDependencies:[...X,Te??i],inline:W,strategy:oe,middlewares:le});I.useEffect(()=>{const Re=Te instanceof HTMLElement?Te:typeof Te=="string"?document.querySelector(Te):Te?.current||null;Re&&pe.reference(Re)},[Te,pe]);const ze=En({name:"Tooltip",props:n,classes:IA,className:_,style:x,classNames:b,styles:y,unstyled:p,attributes:Se,rootSelector:"tooltip",vars:Z,varsResolver:Qme});if(!Te&&!lg(i))return null;if(Te){const Re=Nz(R,{duration:100,transition:"fade"});return D.jsx(D.Fragment,{children:D.jsx(Gd,{...G,withinPortal:h,children:D.jsx(Tc,{...Re,keepMounted:Y,mounted:!z&&!!pe.opened,duration:pe.isGroupPhase?10:Re.duration,children:Ne=>D.jsxs(st,{...Pe,"data-fixed":oe==="fixed"||void 0,variant:B,mod:[{multiline:N},de],...pe.getFloatingProps({ref:pe.floating,className:ze("tooltip").className,style:{...ze("tooltip").style,...Ne,zIndex:j,top:pe.y??0,left:pe.x??0}}),children:[s,D.jsx(g2,{ref:He,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,...ze("arrow")})]})})})})}const Ie=i,Xe=Ie.props,we=Va(pe.reference,rA(Ie),e),Ae=Nz(R,{duration:100,transition:"fade"});return D.jsxs(D.Fragment,{children:[D.jsx(Gd,{...G,withinPortal:h,children:D.jsx(Tc,{...Ae,keepMounted:Y,mounted:!z&&!!pe.opened,duration:pe.isGroupPhase?10:Ae.duration,children:Re=>D.jsxs(st,{...Pe,"data-fixed":oe==="fixed"||void 0,variant:B,mod:[{multiline:N},de],...pe.getFloatingProps({ref:pe.floating,className:ze("tooltip").className,style:{...ze("tooltip").style,...Re,zIndex:j,top:pe.y??0,left:pe.x??0}}),children:[s,D.jsx(g2,{ref:He,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,...ze("arrow")})]})})}),I.cloneElement(Ie,pe.getReferenceProps({onClick:F,onMouseEnter:H,onMouseLeave:V,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:us(_,Xe.className),...Xe,[a]:we}))]})});Pr.classes=IA;Pr.displayName="@mantine/core/Tooltip";Pr.Floating=CP;Pr.Group=RP;var GY={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const ege={withItemsBorders:!0},tge=(t,{radius:e,color:n,transitionDuration:i,size:r,transitionTimingFunction:a})=>({root:{"--sc-radius":e===void 0?void 0:ta(e),"--sc-color":n?ea(n,t):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":i===void 0?void 0:`${i}ms`,"--sc-transition-timing-function":a,"--sc-padding":ci(r,"sc-padding"),"--sc-font-size":os(r)}}),kP=Zt((t,e)=>{const n=Pt("SegmentedControl",ege,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,data:c,value:u,defaultValue:f,onChange:h,size:d,name:g,disabled:b,readOnly:y,fullWidth:p,orientation:x,radius:_,color:w,transitionDuration:M,transitionTimingFunction:S,variant:A,autoContrast:C,withItemsBorders:k,mod:R,attributes:N,...P}=n,j=En({name:"SegmentedControl",props:n,classes:GY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:N,vars:l,varsResolver:tge}),z=ba(),X=c.map(Te=>typeof Te=="string"?{label:Te,value:Te}:Te),F=lle(),[H,V]=I.useState(s2()),[W,B]=I.useState(null),[Y,Z]=I.useState({}),G=(Te,Pe)=>{Y[Pe]=Te,Z(Y)},[de,oe]=Wo({value:u,defaultValue:f,finalValue:Array.isArray(c)?X.find(Te=>!Te.disabled)?.value??c[0]?.value??null:null,onChange:h}),le=Eu(g),ue=X.map(Te=>I.createElement(st,{...j("control"),mod:{active:de===Te.value,orientation:x},key:Te.value},I.createElement("input",{...j("input"),disabled:b||Te.disabled,type:"radio",name:le,value:Te.value,id:`${le}-${Te.value}`,checked:de===Te.value,onChange:()=>!y&&oe(Te.value),"data-focus-ring":z.focusRing,key:`${Te.value}-input`}),I.createElement(st,{component:"label",...j("label"),mod:{active:de===Te.value&&!(b||Te.disabled),disabled:b||Te.disabled,"read-only":y},htmlFor:`${le}-${Te.value}`,ref:Pe=>G(Pe,Te.value),__vars:{"--sc-label-color":w!==void 0?Ov({color:w,theme:z,autoContrast:C}):void 0},key:`${Te.value}-label`},D.jsx("span",{...j("innerLabel"),children:Te.label})))),Se=Va(e,Te=>B(Te));return nle(()=>{V(s2())},[c.length]),c.length===0?null:D.jsxs(st,{...j("root"),variant:A,size:d,ref:Se,mod:[{"full-width":p,orientation:x,initialized:F,"with-items-borders":k},R],...P,role:"radiogroup","data-disabled":b,children:[typeof de=="string"&&D.jsx(YL,{target:Y[de],parent:W,component:"span",transitionDuration:"var(--sc-transition-duration)",...j("indicator")},H),ue]})});kP.classes=GY;kP.displayName="@mantine/core/SegmentedControl";const nge={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},jv=Zt((t,e)=>{const n=Pt("Select",nge,t),{classNames:i,styles:r,unstyled:a,vars:s,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:u,onFocus:f,onBlur:h,onClick:d,onChange:g,data:b,value:y,defaultValue:p,selectFirstOptionOnChange:x,onOptionSubmit:_,comboboxProps:w,readOnly:M,disabled:S,filter:A,limit:C,withScrollArea:k,maxDropdownHeight:R,size:N,searchable:P,rightSection:j,checkIconPosition:z,withCheckIcon:X,nothingFoundMessage:F,name:H,form:V,searchValue:W,defaultSearchValue:B,onSearchChange:Y,allowDeselect:Z,error:G,rightSectionPointerEvents:de,id:oe,clearable:le,clearButtonProps:ue,hiddenInputProps:Se,renderOption:Te,onClear:Pe,autoComplete:je,scrollAreaProps:He,__defaultRightSection:pe,__clearSection:ze,__clearable:Ie,chevronColor:Xe,autoSelectOnBlur:we,attributes:Ae,...Re}=n,Ne=I.useMemo(()=>Nde(b),[b]),Fe=I.useRef({}),Qe=I.useMemo(()=>QK(Ne),[Ne]),ae=Eu(oe),[K,ce,he]=Wo({value:y,defaultValue:p,finalValue:null,onChange:g}),me=typeof K=="string"?K in Qe?Qe[K]:Fe.current[K]:void 0,$=rle(me),[Ve,qe,mt]=Wo({value:W,defaultValue:B,finalValue:me?me.label:"",onChange:Y}),Ge=aY({opened:o,defaultOpened:l,onDropdownOpen:()=>{u?.(),Ge.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Ge.resetSelectedOption,0)}}),Je=kt=>{qe(kt),Ge.resetSelectedOption()},{resolvedClassNames:Ye,resolvedStyles:vt}=Iv({props:n,styles:r,classNames:i});I.useEffect(()=>{x&&Ge.selectFirstOption()},[x,Ve]),I.useEffect(()=>{y===null&&Je(""),typeof y=="string"&&me&&($?.value!==me.value||$?.label!==me.label)&&Je(me.label)},[y,me]),I.useEffect(()=>{!he&&!mt&&Je(typeof K=="string"?K in Qe?Qe[K]?.label:Fe.current[K]?.label||"":"")},[Qe,K]),I.useEffect(()=>{K&&K in Qe&&(Fe.current[K]=Qe[K])},[Qe,K]);const Mt=D.jsx(Sr.ClearButton,{...ue,onClear:()=>{ce(null,null),Je(""),Pe?.()}}),gt=le&&!!K&&!S&&!M;return D.jsxs(D.Fragment,{children:[D.jsxs(Sr,{store:Ge,__staticSelector:"Select",classNames:Ye,styles:vt,unstyled:a,readOnly:M,size:N,attributes:Ae,keepMounted:we,onOptionSubmit:kt=>{_?.(kt);const ke=Z&&Qe[kt].value===K?null:Qe[kt],Le=ke?ke.value:null;Le!==K&&ce(Le,ke),!he&&Je(typeof Le=="string"&&ke?.label||""),Ge.closeDropdown()},...w,children:[D.jsx(Sr.Target,{targetType:P?"input":"button",autoComplete:je,children:D.jsx(Tu,{id:ae,ref:e,__defaultRightSection:D.jsx(Sr.Chevron,{size:N,error:G,unstyled:a,color:Xe}),__clearSection:Mt,__clearable:gt,rightSection:j,rightSectionPointerEvents:de||"none",...Re,size:N,__staticSelector:"Select",disabled:S,readOnly:M||!P,value:Ve,onChange:kt=>{Je(kt.currentTarget.value),Ge.openDropdown(),x&&Ge.selectFirstOption()},onFocus:kt=>{P&&Ge.openDropdown(),f?.(kt)},onBlur:kt=>{we&&Ge.clickSelectedOption(),P&&Ge.closeDropdown();const ke=typeof K=="string"&&(K in Qe?Qe[K]:Fe.current[K]);Je(ke&&ke.label||""),h?.(kt)},onClick:kt=>{P?Ge.openDropdown():Ge.toggleDropdown(),d?.(kt)},classNames:Ye,styles:vt,unstyled:a,pointer:!P,error:G,attributes:Ae})}),D.jsx(ape,{data:Ne,hidden:M||S,filter:A,search:Ve,limit:C,hiddenWhenEmpty:!F,withScrollArea:k,maxDropdownHeight:R,filterOptions:!!P&&me?.label!==Ve,value:K,checkIconPosition:z,withCheckIcon:X,nothingFoundMessage:F,unstyled:a,labelId:Re.label?`${ae}-label`:void 0,"aria-label":Re.label?void 0:Re["aria-label"],renderOption:Te,scrollAreaProps:He})]}),D.jsx(Sr.HiddenInput,{value:K,name:H,form:V,disabled:S,...Se})]})});jv.classes={...Tu.classes,...Sr.classes};jv.displayName="@mantine/core/Select";const[ige,NA]=Mu("SliderProvider was not found in tree"),WY=I.forwardRef(({size:t,disabled:e,variant:n,color:i,thumbSize:r,radius:a,...s},o)=>{const{getStyles:l}=NA();return D.jsx(st,{tabIndex:-1,variant:n,size:t,ref:o,...l("root"),...s})});WY.displayName="@mantine/core/SliderRoot";const XY=I.forwardRef(({max:t,min:e,value:n,position:i,label:r,dragging:a,onMouseDown:s,onKeyDownCapture:o,labelTransitionProps:l,labelAlwaysOn:c,thumbLabel:u,onFocus:f,onBlur:h,showLabelOnHover:d,isHovered:g,children:b=null,disabled:y},p)=>{const{getStyles:x}=NA(),[_,w]=I.useState(!1),M=c||a||_||d&&g;return D.jsxs(st,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":t,"aria-valuemin":e,"aria-valuenow":n,ref:p,__vars:{"--slider-thumb-offset":`${i}%`},...x("thumb",{focusable:!0}),mod:{dragging:a,disabled:y},onFocus:S=>{w(!0),typeof f=="function"&&f(S)},onBlur:S=>{w(!1),typeof h=="function"&&h(S)},onTouchStart:s,onMouseDown:s,onKeyDownCapture:o,onClick:S=>S.stopPropagation(),children:[b,D.jsx(Tc,{mounted:r!=null&&!!M,transition:"fade",duration:0,...l,children:S=>D.jsx("div",{...x("label",{style:S}),children:r})})]})});XY.displayName="@mantine/core/SliderThumb";function qY({value:t,min:e,max:n}){const i=(t-e)/(n-e)*100;return Math.min(Math.max(i,0),100)}function rge({mark:t,offset:e,value:n,inverted:i=!1}){return i?typeof e=="number"&&t.value<=e||t.value>=n:typeof e=="number"?t.value>=e&&t.value<=n:t.value<=n}function KY({marks:t,min:e,max:n,disabled:i,value:r,offset:a,inverted:s}){const{getStyles:o}=NA();if(!t)return null;const l=t.map((c,u)=>I.createElement(st,{...o("markWrapper"),__vars:{"--mark-offset":`${qY({value:c.value,min:e,max:n})}%`},key:u},D.jsx(st,{...o("mark"),mod:{filled:rge({mark:c,value:r,offset:a,inverted:s}),disabled:i}}),c.label&&D.jsx("div",{...o("markLabel"),children:c.label})));return D.jsx("div",{children:l})}KY.displayName="@mantine/core/SliderMarks";function YY({filled:t,children:e,offset:n,disabled:i,marksOffset:r,inverted:a,containerProps:s,...o}){const{getStyles:l}=NA();return D.jsx(st,{...l("trackContainer"),mod:{disabled:i},...s,children:D.jsxs(st,{...l("track"),mod:{inverted:a,disabled:i},children:[D.jsx(st,{mod:{inverted:a,disabled:i},__vars:{"--slider-bar-width":`calc(${t}% + 2 * var(--slider-size))`,"--slider-bar-offset":`calc(${n}% - var(--slider-size))`},...l("bar")}),e,D.jsx(KY,{...o,offset:r,disabled:i,inverted:a})]})})}YY.displayName="@mantine/core/SliderTrack";function age({value:t,containerWidth:e,min:n,max:i,step:r,precision:a}){const o=(e?Math.min(Math.max(t,0),e)/e:t)*(i-n),l=(o!==0?Math.round(o/r)*r:0)+n,c=Math.max(l,n);return a!==void 0?Number(c.toFixed(a)):c}function sw(t,e){return parseFloat(t.toFixed(e))}function sge(t){if(!t)return 0;const e=t.toString().split(".");return e.length>1?e[1].length:0}function tk(t,e){const i=[...e].sort((r,a)=>r.value-a.value).find(r=>r.value>t);return i?i.value:t}function nk(t,e){const i=[...e].sort((r,a)=>a.value-r.value).find(r=>r.value<t);return i?i.value:t}function Pz(t){const e=[...t].sort((n,i)=>n.value-i.value);return e.length>0?e[0].value:0}function Uz(t){const e=[...t].sort((n,i)=>n.value-i.value);return e.length>0?e[e.length-1].value:100}var JY={root:"m_dd36362e",label:"m_c9357328",thumb:"m_c9a9a60a",trackContainer:"m_a8645c2",track:"m_c9ade57f",bar:"m_38aeed47",markWrapper:"m_b7b0423a",mark:"m_dd33bc19",markLabel:"m_68c77a5b"};const oge={radius:"xl",min:0,max:100,step:1,marks:[],label:t=>t,labelTransitionProps:{transition:"fade",duration:0},thumbLabel:"",showLabelOnHover:!0,scale:t=>t,size:"md"},lge=(t,{size:e,color:n,thumbSize:i,radius:r})=>({root:{"--slider-size":ci(e,"slider-size"),"--slider-color":n?ea(n,t):void 0,"--slider-radius":r===void 0?void 0:ta(r),"--slider-thumb-size":i!==void 0?Et(i):"calc(var(--slider-size) * 2)"}}),LA=Zt((t,e)=>{const n=Pt("Slider",oge,t),{classNames:i,styles:r,value:a,onChange:s,onChangeEnd:o,size:l,min:c,max:u,domain:f,step:h,precision:d,defaultValue:g,name:b,marks:y,label:p,labelTransitionProps:x,labelAlwaysOn:_,thumbLabel:w,showLabelOnHover:M,thumbChildren:S,disabled:A,unstyled:C,scale:k,inverted:R,className:N,style:P,vars:j,hiddenInputProps:z,restrictToMarks:X,thumbProps:F,attributes:H,...V}=n,W=En({name:"Slider",props:n,classes:JY,classNames:i,className:N,styles:r,style:P,attributes:H,vars:j,varsResolver:lge,unstyled:C}),{dir:B}=Nv(),[Y,Z]=I.useState(!1),[G,de]=Wo({value:typeof a=="number"?gc(a,c,u):a,defaultValue:typeof g=="number"?gc(g,c,u):g,finalValue:gc(0,c,u),onChange:s}),oe=I.useRef(G),le=I.useRef(o);I.useEffect(()=>{le.current=o},[o]);const ue=I.useRef(null),Se=I.useRef(null),[Te,Pe]=f||[c,u],je=qY({value:G,min:Te,max:Pe}),He=k(G),pe=typeof p=="function"?p(He):p,ze=d??sge(h),Ie=I.useCallback(({x:Fe})=>{if(!A){const Qe=age({value:Fe,min:Te,max:Pe,step:h,precision:ze}),ae=gc(Qe,c,u);de(X&&y?.length?IB(ae,y.map(K=>K.value)):ae),oe.current=ae}},[A,c,u,Te,Pe,h,ze,de,y,X]),Xe=I.useCallback(()=>{if(!A&&le.current){const Fe=X&&y?.length?IB(oe.current,y.map(Qe=>Qe.value)):oe.current;le.current(Fe)}},[A,y,X]),{ref:we,active:Ae}=vL(Ie,{onScrubEnd:Xe},B),Re=I.useCallback(Fe=>{!A&&le.current&&le.current(Fe)},[A]),Ne=Fe=>{if(!A)switch(Fe.key){case"ArrowUp":{if(Fe.preventDefault(),Se.current?.focus(),X&&y){const ae=tk(G,y);de(ae),Re(ae);break}const Qe=sw(Math.min(Math.max(G+h,c),u),ze);de(Qe),Re(Qe);break}case"ArrowRight":{if(Fe.preventDefault(),Se.current?.focus(),X&&y){const ae=B==="rtl"?nk(G,y):tk(G,y);de(ae),Re(ae);break}const Qe=sw(Math.min(Math.max(B==="rtl"?G-h:G+h,c),u),ze);de(Qe),Re(Qe);break}case"ArrowDown":{if(Fe.preventDefault(),Se.current?.focus(),X&&y){const ae=nk(G,y);de(ae),Re(ae);break}const Qe=sw(Math.min(Math.max(G-h,c),u),ze);de(Qe),Re(Qe);break}case"ArrowLeft":{if(Fe.preventDefault(),Se.current?.focus(),X&&y){const ae=B==="rtl"?tk(G,y):nk(G,y);de(ae),Re(ae);break}const Qe=sw(Math.min(Math.max(B==="rtl"?G+h:G-h,c),u),ze);de(Qe),Re(Qe);break}case"Home":{if(Fe.preventDefault(),Se.current?.focus(),X&&y){de(Pz(y)),Re(Pz(y));break}de(c),Re(c);break}case"End":{if(Fe.preventDefault(),Se.current?.focus(),X&&y){de(Uz(y)),Re(Uz(y));break}de(u),Re(u);break}}};return D.jsx(ige,{value:{getStyles:W},children:D.jsxs(WY,{...V,ref:Va(e,ue),onKeyDownCapture:Ne,onMouseDownCapture:()=>ue.current?.focus(),size:l,disabled:A,children:[D.jsx(YY,{inverted:R,offset:0,filled:je,marks:y,min:Te,max:Pe,value:He,disabled:A,containerProps:{ref:we,onMouseEnter:M?()=>Z(!0):void 0,onMouseLeave:M?()=>Z(!1):void 0},children:D.jsx(XY,{max:Pe,min:Te,value:He,position:je,dragging:Ae,label:pe,ref:Se,labelTransitionProps:x,labelAlwaysOn:_,thumbLabel:w,showLabelOnHover:M,isHovered:Y,disabled:A,...F,children:S})}),D.jsx("input",{type:"hidden",name:b,value:He,...z})]})})});LA.classes=JY;LA.displayName="@mantine/core/Slider";var $Y={root:"m_6d731127"};const cge={gap:"md",align:"stretch",justify:"flex-start"},uge=(t,{gap:e,align:n,justify:i})=>({root:{"--stack-gap":Hd(e),"--stack-align":n,"--stack-justify":i}}),Pd=Zt((t,e)=>{const n=Pt("Stack",cge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,align:c,justify:u,gap:f,variant:h,attributes:d,...g}=n,b=En({name:"Stack",props:n,classes:$Y,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:uge});return D.jsx(st,{ref:e,...b("root"),variant:h,...g})});Pd.classes=$Y;Pd.displayName="@mantine/core/Stack";const ZY=I.createContext(null),fge=ZY.Provider,hge=()=>I.useContext(ZY),DP=Zt((t,e)=>{const{value:n,defaultValue:i,onChange:r,size:a,wrapperProps:s,children:o,readOnly:l,...c}=Pt("SwitchGroup",null,t),[u,f]=Wo({value:n,defaultValue:i,finalValue:[],onChange:r}),h=d=>{const g=d.currentTarget.value;!l&&f(u.includes(g)?u.filter(b=>b!==g):[...u,g])};return D.jsx(fge,{value:{value:u,onChange:h,size:a},children:D.jsx(ga.Wrapper,{size:a,ref:e,...s,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:D.jsx(fY,{role:"group",children:o})})})});DP.classes=ga.Wrapper.classes;DP.displayName="@mantine/core/SwitchGroup";var QY={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const dge={labelPosition:"right",withThumbIndicator:!0},pge=(t,{radius:e,color:n,size:i})=>({root:{"--switch-radius":e===void 0?void 0:ta(e),"--switch-height":ci(i,"switch-height"),"--switch-width":ci(i,"switch-width"),"--switch-thumb-size":ci(i,"switch-thumb-size"),"--switch-label-font-size":ci(i,"switch-label-font-size"),"--switch-track-label-padding":ci(i,"switch-track-label-padding"),"--switch-color":n?ea(n,t):void 0}}),vd=Zt((t,e)=>{const n=Pt("Switch",dge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,label:u,offLabel:f,onLabel:h,id:d,size:g,radius:b,wrapperProps:y,thumbIcon:p,checked:x,defaultChecked:_,onChange:w,labelPosition:M,description:S,error:A,disabled:C,variant:k,rootRef:R,mod:N,withThumbIndicator:P,attributes:j,...z}=n,X=hge(),F=g||X?.size,H=En({name:"Switch",props:n,classes:QY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:j,vars:l,varsResolver:pge}),{styleProps:V,rest:W}=C_(z),B=Eu(d),Y=X?{checked:X.value.includes(W.value),onChange:X.onChange}:{},[Z,G]=Wo({value:Y.checked??x,defaultValue:_,finalValue:!1});return D.jsxs(sP,{...H("root"),__staticSelector:"Switch",__stylesApiProps:n,id:B,size:F,labelPosition:M,label:u,description:S,error:A,disabled:C,bodyElement:"label",labelElement:"span",classNames:i,styles:s,unstyled:o,"data-checked":Y.checked||x||void 0,variant:k,ref:R,mod:N,...V,...y,children:[D.jsx("input",{...W,disabled:C,checked:Z,"data-checked":Y.checked||x||void 0,onChange:de=>{X?Y.onChange?.(de):w?.(de),G(de.currentTarget.checked)},id:B,ref:e,type:"checkbox",role:"switch",...H("input")}),D.jsxs(st,{"aria-hidden":"true",component:"span",mod:{error:A,"label-position":M,"without-labels":!h&&!f},...H("track"),children:[D.jsx(st,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":P&&!p},...H("thumb"),children:p}),D.jsx("span",{...H("trackLabel"),children:Z?h:f})]})]})});vd.classes={...QY,...oY};vd.displayName="@mantine/core/Switch";vd.Group=DP;const[mge,gge]=Mu("Table component was not found in the tree");var L_={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function bge(t,e){if(!e)return;const n={};return e.columnBorder&&t.withColumnBorders&&(n["data-with-column-border"]=!0),e.rowBorder&&t.withRowBorders&&(n["data-with-row-border"]=!0),e.striped&&t.striped&&(n["data-striped"]=t.striped),e.highlightOnHover&&t.highlightOnHover&&(n["data-hover"]=!0),e.captionSide&&t.captionSide&&(n["data-side"]=t.captionSide),e.stickyHeader&&t.stickyHeader&&(n["data-sticky"]=!0),n}function fg(t,e){const n=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,i=Zt((r,a)=>{const s=Pt(n,{},r),{classNames:o,className:l,style:c,styles:u,...f}=s,h=gge();return D.jsx(st,{component:t,ref:a,...bge(h,e),...h.getStyles(t,{className:l,classNames:o,style:c,styles:u,props:s}),...f})});return i.displayName=`@mantine/core/${n}`,i.classes=L_,i}const XO=fg("th",{columnBorder:!0}),eJ=fg("td",{columnBorder:!0}),fM=fg("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),tJ=fg("thead",{stickyHeader:!0}),nJ=fg("tbody"),iJ=fg("tfoot"),rJ=fg("caption",{captionSide:!0});function OP({data:t}){return D.jsxs(D.Fragment,{children:[t.caption&&D.jsx(rJ,{children:t.caption}),t.head&&D.jsx(tJ,{children:D.jsx(fM,{children:t.head.map((e,n)=>D.jsx(XO,{children:e},n))})}),t.body&&D.jsx(nJ,{children:t.body.map((e,n)=>D.jsx(fM,{children:e.map((i,r)=>D.jsx(eJ,{children:i},r))},n))}),t.foot&&D.jsx(iJ,{children:D.jsx(fM,{children:t.foot.map((e,n)=>D.jsx(XO,{children:e},n))})})]})}OP.displayName="@mantine/core/TableDataRenderer";const vge={type:"scrollarea"},yge=(t,{minWidth:e,maxHeight:n,type:i})=>({scrollContainer:{"--table-min-width":Et(e),"--table-max-height":Et(n),"--table-overflow":i==="native"?"auto":void 0}}),IP=Zt((t,e)=>{const n=Pt("TableScrollContainer",vge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,children:c,minWidth:u,maxHeight:f,type:h,scrollAreaProps:d,attributes:g,...b}=n,y=En({name:"TableScrollContainer",classes:L_,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:yge,rootSelector:"scrollContainer"});return D.jsx(st,{component:h==="scrollarea"?Dc:"div",...h==="scrollarea"?f?{offsetScrollbars:"xy",...d}:{offsetScrollbars:"x",...d}:{},ref:e,...y("scrollContainer"),...b,children:D.jsx("div",{...y("scrollContainerInner"),children:c})})});IP.classes=L_;IP.displayName="@mantine/core/TableScrollContainer";const xge={withRowBorders:!0,verticalSpacing:7},_ge=(t,{layout:e,captionSide:n,horizontalSpacing:i,verticalSpacing:r,borderColor:a,stripedColor:s,highlightOnHoverColor:o,striped:l,highlightOnHover:c,stickyHeaderOffset:u,stickyHeader:f})=>({table:{"--table-layout":e,"--table-caption-side":n,"--table-horizontal-spacing":Hd(i),"--table-vertical-spacing":Hd(r),"--table-border-color":a?ea(a,t):void 0,"--table-striped-color":l&&s?ea(s,t):void 0,"--table-highlight-on-hover-color":c&&o?ea(o,t):void 0,"--table-sticky-header-offset":f?Et(u):void 0}}),Nc=Zt((t,e)=>{const n=Pt("Table",xge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,horizontalSpacing:c,verticalSpacing:u,captionSide:f,stripedColor:h,highlightOnHoverColor:d,striped:g,highlightOnHover:b,withColumnBorders:y,withRowBorders:p,withTableBorder:x,borderColor:_,layout:w,variant:M,data:S,children:A,stickyHeader:C,stickyHeaderOffset:k,mod:R,tabularNums:N,attributes:P,...j}=n,z=En({name:"Table",props:n,className:r,style:a,classes:L_,classNames:i,styles:s,unstyled:o,attributes:P,rootSelector:"table",vars:l,varsResolver:_ge});return D.jsx(mge,{value:{getStyles:z,stickyHeader:C,striped:g===!0?"odd":g||void 0,highlightOnHover:b,withColumnBorders:y,withRowBorders:p,captionSide:f||"bottom"},children:D.jsx(st,{component:"table",variant:M,ref:e,mod:[{"data-with-table-border":x,"data-tabular-nums":N},R],...z("table"),...j,children:A||!!S&&D.jsx(OP,{data:S})})})});Nc.classes=L_;Nc.displayName="@mantine/core/Table";Nc.Td=eJ;Nc.Th=XO;Nc.Tr=fM;Nc.Thead=tJ;Nc.Tbody=nJ;Nc.Tfoot=iJ;Nc.Caption=rJ;Nc.ScrollContainer=IP;Nc.DataRenderer=OP;const[Sge,NP]=Mu("Tabs component was not found in the tree");var P_={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const LP=Zt((t,e)=>{const n=Pt("TabsList",null,t),{children:i,className:r,grow:a,justify:s,classNames:o,styles:l,style:c,mod:u,...f}=n,h=NP();return D.jsx(st,{...f,...h.getStyles("list",{className:r,style:c,classNames:o,styles:l,props:n,variant:h.variant}),ref:e,role:"tablist",variant:h.variant,mod:[{grow:a,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},u],"aria-orientation":h.orientation,__vars:{"--tabs-justify":s},children:i})});LP.classes=P_;LP.displayName="@mantine/core/TabsList";const PP=Zt((t,e)=>{const n=Pt("TabsPanel",null,t),{children:i,className:r,value:a,classNames:s,styles:o,style:l,mod:c,keepMounted:u,...f}=n,h=NP(),d=h.value===a,g=h.keepMounted||u||d?i:null;return D.jsx(st,{...h.getStyles("panel",{className:r,classNames:s,styles:o,style:[l,d?void 0:{display:"none"}],props:n}),ref:e,mod:[{orientation:h.orientation},c],role:"tabpanel",id:h.getPanelId(a),"aria-labelledby":h.getTabId(a),...f,children:g})});PP.classes=P_;PP.displayName="@mantine/core/TabsPanel";const UP=Zt((t,e)=>{const n=Pt("TabsTab",null,t),{className:i,children:r,rightSection:a,leftSection:s,value:o,onClick:l,onKeyDown:c,disabled:u,color:f,style:h,classNames:d,styles:g,vars:b,mod:y,tabIndex:p,...x}=n,_=ba(),{dir:w}=Nv(),M=NP(),S=o===M.value,A=k=>{M.onChange(M.allowTabDeactivation&&o===M.value?null:o),l?.(k)},C={classNames:d,styles:g,props:n};return D.jsxs(uf,{...M.getStyles("tab",{className:i,style:h,variant:M.variant,...C}),disabled:u,unstyled:M.unstyled,variant:M.variant,mod:[{active:S,disabled:u,orientation:M.orientation,inverted:M.inverted,placement:M.orientation==="vertical"&&M.placement},y],ref:e,role:"tab",id:M.getTabId(o),"aria-selected":S,tabIndex:p!==void 0?p:S||M.value===null?0:-1,"aria-controls":M.getPanelId(o),onClick:A,__vars:{"--tabs-color":f?ea(f,_):void 0},onKeyDown:bce({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:M.activateTabWithKeyboard,loop:M.loop,orientation:M.orientation||"horizontal",dir:w,onKeyDown:c}),...x,children:[s&&D.jsx("span",{...M.getStyles("tabSection",C),"data-position":"left",children:s}),r&&D.jsx("span",{...M.getStyles("tabLabel",C),children:r}),a&&D.jsx("span",{...M.getStyles("tabSection",C),"data-position":"right",children:a})]})});UP.classes=P_;UP.displayName="@mantine/core/TabsTab";const Fz="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",wge={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},Ege=(t,{radius:e,color:n,autoContrast:i})=>({root:{"--tabs-radius":ta(e),"--tabs-color":ea(n,t),"--tabs-text-color":cA(i,t)?Ov({color:n,theme:t,autoContrast:i}):void 0}}),Zf=Zt((t,e)=>{const n=Pt("Tabs",wge,t),{defaultValue:i,value:r,onChange:a,orientation:s,children:o,loop:l,id:c,activateTabWithKeyboard:u,allowTabDeactivation:f,variant:h,color:d,radius:g,inverted:b,placement:y,keepMounted:p,classNames:x,styles:_,unstyled:w,className:M,style:S,vars:A,autoContrast:C,mod:k,attributes:R,...N}=n,P=Eu(c),[j,z]=Wo({value:r,defaultValue:i,finalValue:null,onChange:a}),X=En({name:"Tabs",props:n,classes:P_,className:M,style:S,classNames:x,styles:_,unstyled:w,attributes:R,vars:A,varsResolver:Ege});return D.jsx(Sge,{value:{placement:y,value:j,orientation:s,id:P,loop:l,activateTabWithKeyboard:u,getTabId:OB(`${P}-tab`,Fz),getPanelId:OB(`${P}-panel`,Fz),onChange:z,allowTabDeactivation:f,variant:h,color:d,radius:g,inverted:b,keepMounted:p,unstyled:w,getStyles:X},children:D.jsx(st,{ref:e,id:P,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&b,placement:s==="vertical"&&y},k],...X("root"),...N,children:o})})});Zf.classes=P_;Zf.displayName="@mantine/core/Tabs";Zf.Tab=UP;Zf.Panel=PP;Zf.List=LP;const hg=Zt((t,e)=>{const n=Pt("TextInput",null,t);return D.jsx(Tu,{component:"input",ref:e,...n,__staticSelector:"TextInput"})});hg.classes=Tu.classes;hg.displayName="@mantine/core/TextInput";const Mge=["h1","h2","h3","h4","h5","h6"],Tge=["xs","sm","md","lg","xl"];function Age(t,e){const n=e!==void 0?e:`h${t}`;return Mge.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:Tge.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${t}-font-weight)`,lineHeight:`var(--mantine-h${t}-line-height)`}:{fontSize:Et(n),fontWeight:`var(--mantine-h${t}-font-weight)`,lineHeight:`var(--mantine-h${t}-line-height)`}}var aJ={root:"m_8a5d1357"};const Cge={order:1},Rge=(t,{order:e,size:n,lineClamp:i,textWrap:r})=>{const a=Age(e||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof i=="number"?i.toString():void 0,"--title-text-wrap":r}}},PA=Zt((t,e)=>{const n=Pt("Title",Cge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,order:l,vars:c,size:u,variant:f,lineClamp:h,textWrap:d,mod:g,attributes:b,...y}=n,p=En({name:"Title",props:n,classes:aJ,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:c,varsResolver:Rge});return[1,2,3,4,5,6].includes(l)?D.jsx(st,{...p("root"),component:`h${l}`,variant:f,ref:e,mod:[{order:l,"data-line-clamp":typeof h=="number"},g],size:u,...y}):null});PA.classes=aJ;PA.displayName="@mantine/core/Title";const sJ=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function kge(t,e){return t.reduce((n,i)=>(n[i.position||e].push(i),n),sJ.reduce((n,i)=>(n[i]=[],n),{}))}const Bz={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Dge={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Oge({state:t,maxHeight:e,position:n,transitionDuration:i}){const[r,a]=n.split("-"),s=a==="center"?`${r}-center`:a,o={opacity:0,maxHeight:e,transform:Bz[s],transitionDuration:`${i}ms, ${i}ms, ${i}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},l={opacity:1,transform:Dge[s]},c={opacity:0,maxHeight:0,transform:Bz[s]};return{...o,...{entering:l,entered:l,exiting:c,exited:c}[t]}}function Ige(t,e){return typeof e=="number"?e:e===!1||t===!1?!1:t}const oJ=I.forwardRef(({data:t,onHide:e,autoClose:n,...i},r)=>{const{autoClose:a,message:s,...o}=t,l=Ige(n,t.autoClose),c=I.useRef(-1),u=()=>window.clearTimeout(c.current),f=()=>{e(t.id),u()},h=()=>{typeof l=="number"&&(c.current=window.setTimeout(f,l))};return I.useEffect(()=>{t.onOpen?.(t)},[]),I.useEffect(()=>(h(),u),[l]),D.jsx(MP,{...i,...o,onClose:f,ref:r,onMouseEnter:u,onMouseLeave:h,children:s})});oJ.displayName="@mantine/notifications/NotificationContainer";var lJ={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Nge=Sh,Lge={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:bf("overlay"),store:og,withinPortal:!0},Pge=(t,{zIndex:e,containerWidth:n})=>({root:{"--notifications-z-index":e?.toString(),"--notifications-container-width":Et(n)}}),Mh=Zt((t,e)=>{const n=Pt("Notifications",Lge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,position:c,autoClose:u,transitionDuration:f,containerWidth:h,notificationMaxHeight:d,limit:g,zIndex:b,store:y,portalProps:p,withinPortal:x,..._}=n,w=ba(),M=dle(y),S=Yoe(),A=tA(),C=I.useRef({}),k=I.useRef(0),N=(w.respectReducedMotion?A:!1)?1:f,P=En({name:"Notifications",classes:lJ,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,vars:l,varsResolver:Pge});I.useEffect(()=>{y?.updateState(X=>({...X,limit:g||5,defaultPosition:c}))},[g,c]),_c(()=>{M.notifications.length>k.current&&setTimeout(()=>S(),0),k.current=M.notifications.length},[M.notifications]);const j=kge(M.notifications,c),z=sJ.reduce((X,F)=>(X[F]=j[F].map(({style:H,...V})=>D.jsx(Nge,{timeout:N,onEnter:()=>C.current[V.id].offsetHeight,nodeRef:{current:C.current[V.id]},children:W=>D.jsx(oJ,{ref:B=>{B&&(C.current[V.id]=B)},data:V,onHide:B=>vq(B,y),autoClose:u,...P("notification",{style:{...Oge({state:W,position:F,transitionDuration:N,maxHeight:d}),...H}})})},V.id)),X),{});return D.jsxs(Gd,{withinPortal:x,...p,children:[D.jsx(st,{...P("root"),"data-position":"top-center",ref:e,..._,children:D.jsx(cd,{children:z["top-center"]})}),D.jsx(st,{...P("root"),"data-position":"top-left",..._,children:D.jsx(cd,{children:z["top-left"]})}),D.jsx(st,{...P("root",{className:c2.classNames.fullWidth}),"data-position":"top-right",..._,children:D.jsx(cd,{children:z["top-right"]})}),D.jsx(st,{...P("root",{className:c2.classNames.fullWidth}),"data-position":"bottom-right",..._,children:D.jsx(cd,{children:z["bottom-right"]})}),D.jsx(st,{...P("root"),"data-position":"bottom-left",..._,children:D.jsx(cd,{children:z["bottom-left"]})}),D.jsx(st,{...P("root"),"data-position":"bottom-center",..._,children:D.jsx(cd,{children:z["bottom-center"]})})]})});Mh.classes=lJ;Mh.displayName="@mantine/notifications/Notifications";Mh.show=Is.show;Mh.hide=Is.hide;Mh.update=Is.update;Mh.clean=Is.clean;Mh.cleanQueue=Is.cleanQueue;Mh.updateState=Is.updateState;/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const Hv="179",Uge={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Fge={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cJ=0,qO=1,uJ=2,Bge=3,fJ=0,UA=1,Qx=2,Zc=3,_u=0,Da=1,Jr=2,af=0,Om=1,KO=2,YO=3,JO=4,hJ=5,yd=100,dJ=101,pJ=102,mJ=103,gJ=104,bJ=200,vJ=201,yJ=202,xJ=203,b2=204,v2=205,_J=206,SJ=207,wJ=208,EJ=209,MJ=210,TJ=211,AJ=212,CJ=213,RJ=214,y2=0,x2=1,_2=2,Xm=3,S2=4,w2=5,E2=6,M2=7,U_=0,kJ=1,DJ=2,sf=0,OJ=1,IJ=2,NJ=3,FP=4,LJ=5,PJ=6,UJ=7,j1="attached",BP="detached",Wd=300,df=301,Xd=302,$0=303,H1=304,Vv=306,qd=1e3,_a=1001,Z0=1002,ls=1003,FA=1004,zge=1004,fm=1005,jge=1005,Vi=1006,_0=1007,Hge=1007,vc=1008,$O=1008,Ao=1009,BA=1010,zA=1011,Q0=1012,Gv=1013,Ac=1014,wr=1015,as=1016,jA=1017,HA=1018,ev=1020,zP=35902,jP=1021,HP=1022,Qr=1023,tv=1026,nv=1027,Th=1028,Wv=1029,VA=1030,F_=1031,Vge=1032,Xv=1033,e1=33776,t1=33777,n1=33778,i1=33779,T2=35840,A2=35841,C2=35842,R2=35843,k2=36196,D2=37492,O2=37496,I2=37808,N2=37809,L2=37810,P2=37811,U2=37812,F2=37813,B2=37814,z2=37815,j2=37816,H2=37817,V2=37818,G2=37819,W2=37820,X2=37821,r1=36492,q2=36494,K2=36495,VP=36283,Y2=36284,J2=36285,$2=36286,FJ=2200,BJ=2201,zJ=2202,iv=2300,rv=2301,hM=2302,hm=2400,dm=2401,V1=2402,GA=2500,GP=2501,jJ=0,WP=1,Z2=2,HJ=3200,XP=3201,Gge=3202,Wge=3203,Qd=0,VJ=1,su="",As="srgb",Su="srgb-linear",G1="linear",pr="srgb",Xge=0,Qp=7680,qge=7681,Kge=7682,Yge=7683,Jge=34055,$ge=34056,Zge=5386,Qge=512,ebe=513,tbe=514,nbe=515,ibe=516,rbe=517,abe=518,ZO=519,GJ=512,WJ=513,XJ=514,qP=515,qJ=516,KJ=517,YJ=518,JJ=519,W1=35044,X1=35048,sbe=35040,obe=35045,lbe=35049,cbe=35041,ube=35046,fbe=35050,hbe=35042,dbe="100",QO="300 es",yl=2e3,av=2001,pbe={COMPUTE:"compute",RENDER:"render"},mbe={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},gbe={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};let yf=class{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const a=r.indexOf(n);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,s=r.length;a<s;a++)r[a].call(this,e);e.target=null}}};const $s=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let zz=1234567;const Im=Math.PI/180,sv=180/Math.PI;function Ml(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return($s[t&255]+$s[t>>8&255]+$s[t>>16&255]+$s[t>>24&255]+"-"+$s[e&255]+$s[e>>8&255]+"-"+$s[e>>16&15|64]+$s[e>>24&255]+"-"+$s[n&63|128]+$s[n>>8&255]+"-"+$s[n>>16&255]+$s[n>>24&255]+$s[i&255]+$s[i>>8&255]+$s[i>>16&255]+$s[i>>24&255]).toLowerCase()}function Pn(t,e,n){return Math.max(e,Math.min(n,t))}function KP(t,e){return(t%e+e)%e}function bbe(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function vbe(t,e,n){return t!==e?(n-t)/(e-t):0}function a1(t,e,n){return(1-n)*t+n*e}function ybe(t,e,n,i){return a1(t,e,1-Math.exp(-n*i))}function xbe(t,e=1){return e-Math.abs(KP(t,e*2)-e)}function _be(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Sbe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function wbe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Ebe(t,e){return t+Math.random()*(e-t)}function Mbe(t){return t*(.5-Math.random())}function Tbe(t){t!==void 0&&(zz=t);let e=zz+=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 Abe(t){return t*Im}function Cbe(t){return t*sv}function Rbe(t){return(t&t-1)===0&&t!==0}function kbe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Dbe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Obe(t,e,n,i,r){const a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),c=a((e+i)/2),u=s((e+i)/2),f=a((e-i)/2),h=s((e-i)/2),d=a((i-e)/2),g=s((i-e)/2);switch(r){case"XYX":t.set(o*u,l*f,l*h,o*c);break;case"YZY":t.set(l*h,o*u,l*f,o*c);break;case"ZXZ":t.set(l*f,l*h,o*u,o*c);break;case"XZX":t.set(o*u,l*g,l*d,o*c);break;case"YXY":t.set(l*d,o*u,l*g,o*c);break;case"ZYZ":t.set(l*g,l*d,o*u,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function wo(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function ti(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const yc={DEG2RAD:Im,RAD2DEG:sv,generateUUID:Ml,clamp:Pn,euclideanModulo:KP,mapLinear:bbe,inverseLerp:vbe,lerp:a1,damp:ybe,pingpong:xbe,smoothstep:_be,smootherstep:Sbe,randInt:wbe,randFloat:Ebe,randFloatSpread:Mbe,seededRandom:Tbe,degToRad:Abe,radToDeg:Cbe,isPowerOfTwo:Rbe,ceilPowerOfTwo:kbe,floorPowerOfTwo:Dbe,setQuaternionFromProperEuler:Obe,normalize:ti,denormalize:wo};class wt{constructor(e=0,n=0){wt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+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,n){return this.x=Pn(this.x,e.x,n.x),this.y=Pn(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=Pn(this.x,e,n),this.y=Pn(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Pn(i,e,n))}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 n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Pn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*i-s*r+e.x,this.y=a*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Xn{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,a,s,o){let l=i[r+0],c=i[r+1],u=i[r+2],f=i[r+3];const h=a[s+0],d=a[s+1],g=a[s+2],b=a[s+3];if(o===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(o===1){e[n+0]=h,e[n+1]=d,e[n+2]=g,e[n+3]=b;return}if(f!==b||l!==h||c!==d||u!==g){let y=1-o;const p=l*h+c*d+u*g+f*b,x=p>=0?1:-1,_=1-p*p;if(_>Number.EPSILON){const M=Math.sqrt(_),S=Math.atan2(M,p*x);y=Math.sin(y*S)/M,o=Math.sin(o*S)/M}const w=o*x;if(l=l*y+h*w,c=c*y+d*w,u=u*y+g*w,f=f*y+b*w,y===1-o){const M=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=M,c*=M,u*=M,f*=M}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,i,r,a,s){const o=i[r],l=i[r+1],c=i[r+2],u=i[r+3],f=a[s],h=a[s+1],d=a[s+2],g=a[s+3];return e[n]=o*g+u*f+l*d-c*h,e[n+1]=l*g+u*h+c*f-o*d,e[n+2]=c*g+u*d+o*h-l*f,e[n+3]=u*g-o*f-l*h-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,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,n=!0){const i=e._x,r=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,c=o(i/2),u=o(r/2),f=o(a/2),h=l(i/2),d=l(r/2),g=l(a/2);switch(s){case"XYZ":this._x=h*u*f+c*d*g,this._y=c*d*f-h*u*g,this._z=c*u*g+h*d*f,this._w=c*u*f-h*d*g;break;case"YXZ":this._x=h*u*f+c*d*g,this._y=c*d*f-h*u*g,this._z=c*u*g-h*d*f,this._w=c*u*f+h*d*g;break;case"ZXY":this._x=h*u*f-c*d*g,this._y=c*d*f+h*u*g,this._z=c*u*g+h*d*f,this._w=c*u*f-h*d*g;break;case"ZYX":this._x=h*u*f-c*d*g,this._y=c*d*f+h*u*g,this._z=c*u*g-h*d*f,this._w=c*u*f+h*d*g;break;case"YZX":this._x=h*u*f+c*d*g,this._y=c*d*f+h*u*g,this._z=c*u*g-h*d*f,this._w=c*u*f-h*d*g;break;case"XZY":this._x=h*u*f-c*d*g,this._y=c*d*f-h*u*g,this._z=c*u*g+h*d*f,this._w=c*u*f+h*d*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/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 n=e.elements,i=n[0],r=n[4],a=n[8],s=n[1],o=n[5],l=n[9],c=n[2],u=n[6],f=n[10],h=i+o+f;if(h>0){const d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(a-c)*d,this._z=(s-r)*d}else if(i>o&&i>f){const d=2*Math.sqrt(1+i-o-f);this._w=(u-l)/d,this._x=.25*d,this._y=(r+s)/d,this._z=(a+c)/d}else if(o>f){const d=2*Math.sqrt(1+o-i-f);this._w=(a-c)/d,this._x=(r+s)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+f-i-o);this._w=(s-r)/d,this._x=(a+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Pn(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/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,n){const i=e._x,r=e._y,a=e._z,s=e._w,o=n._x,l=n._y,c=n._z,u=n._w;return this._x=i*u+s*o+r*c-a*l,this._y=r*u+s*l+a*o-i*c,this._z=a*u+s*c+i*l-r*o,this._w=s*u-i*o-r*l-a*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const i=this._x,r=this._y,a=this._z,s=this._w;let o=s*e._w+i*e._x+r*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=r,this._z=a,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-n;return this._w=d*s+n*this._w,this._x=d*i+n*this._x,this._y=d*r+n*this._y,this._z=d*a+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,o),f=Math.sin((1-n)*u)/c,h=Math.sin(n*u)/c;return this._w=s*f+this._w*h,this._x=i*f+this._x*h,this._y=r*f+this._y*h,this._z=a*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(n),a*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),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 te{constructor(e=0,n=0,i=0){te.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(jz.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(jz.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[3]*i+a[6]*r,this.y=a[1]*n+a[4]*i+a[7]*r,this.z=a[2]*n+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,a=e.elements,s=1/(a[3]*n+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*n+a[4]*i+a[8]*r+a[12])*s,this.y=(a[1]*n+a[5]*i+a[9]*r+a[13])*s,this.z=(a[2]*n+a[6]*i+a[10]*r+a[14])*s,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,a=e.x,s=e.y,o=e.z,l=e.w,c=2*(s*r-o*i),u=2*(o*n-a*r),f=2*(a*i-s*n);return this.x=n+l*c+s*f-o*u,this.y=i+l*u+o*c-a*f,this.z=r+l*f+a*u-s*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[4]*i+a[8]*r,this.y=a[1]*n+a[5]*i+a[9]*r,this.z=a[2]*n+a[6]*i+a[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,n){return this.x=Pn(this.x,e.x,n.x),this.y=Pn(this.y,e.y,n.y),this.z=Pn(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=Pn(this.x,e,n),this.y=Pn(this.y,e,n),this.z=Pn(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Pn(i,e,n))}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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=r*l-a*o,this.y=a*s-i*l,this.z=i*o-r*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return ik.copy(this).projectOnVector(e),this.sub(ik)}reflect(e){return this.sub(ik.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Pn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+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,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ik=new te,jz=new Xn;class $n{constructor(e,n,i,r,a,s,o,l,c){$n.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,a,s,o,l,c)}set(e,n,i,r,a,s,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=n,u[4]=a,u[5]=l,u[6]=i,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[3],l=i[6],c=i[1],u=i[4],f=i[7],h=i[2],d=i[5],g=i[8],b=r[0],y=r[3],p=r[6],x=r[1],_=r[4],w=r[7],M=r[2],S=r[5],A=r[8];return a[0]=s*b+o*x+l*M,a[3]=s*y+o*_+l*S,a[6]=s*p+o*w+l*A,a[1]=c*b+u*x+f*M,a[4]=c*y+u*_+f*S,a[7]=c*p+u*w+f*A,a[2]=h*b+d*x+g*M,a[5]=h*y+d*_+g*S,a[8]=h*p+d*w+g*A,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*o*c-i*a*u+i*o*l+r*a*c-r*s*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=u*s-o*c,h=o*l-u*a,d=c*a-s*l,g=n*f+i*h+r*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/g;return e[0]=f*b,e[1]=(r*c-u*i)*b,e[2]=(o*i-r*s)*b,e[3]=h*b,e[4]=(u*n-r*l)*b,e[5]=(r*a-o*n)*b,e[6]=d*b,e[7]=(i*l-c*n)*b,e[8]=(s*n-i*a)*b,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,a,s,o){const l=Math.cos(a),c=Math.sin(a);return this.set(i*l,i*c,-i*(l*s+c*o)+s+e,-r*c,r*l,-r*(-c*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(rk.makeScale(e,n)),this}rotate(e){return this.premultiply(rk.makeRotation(-e)),this}translate(e,n){return this.premultiply(rk.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const rk=new $n;function $J(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Ibe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function r0(t,e){return new Ibe[t](e)}function q1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function ZJ(){const t=q1("canvas");return t.style.display="block",t}const Hz={};function S0(t){t in Hz||(Hz[t]=!0,console.warn(t))}function Nbe(t,e,n){return new Promise(function(i,r){function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}}setTimeout(a,n)})}const Vz=new $n().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Gz=new $n().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Lbe(){const t={enabled:!0,workingColorSpace:Su,spaces:{},convert:function(r,a,s){return this.enabled===!1||a===s||!a||!s||(this.spaces[a].transfer===pr&&(r.r=oh(r.r),r.g=oh(r.g),r.b=oh(r.b)),this.spaces[a].primaries!==this.spaces[s].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[s].fromXYZ)),this.spaces[s].transfer===pr&&(r.r=w0(r.r),r.g=w0(r.g),r.b=w0(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===su?G1:this.spaces[r].transfer},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,s){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[s].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return S0("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return S0("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,a)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Su]:{primaries:e,whitePoint:i,transfer:G1,toXYZ:Vz,fromXYZ:Gz,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:As},outputColorSpaceConfig:{drawingBufferColorSpace:As}},[As]:{primaries:e,whitePoint:i,transfer:pr,toXYZ:Vz,fromXYZ:Gz,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:As}}}),t}const bi=Lbe();function oh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function w0(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let $g;class QJ{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{$g===void 0&&($g=q1("canvas")),$g.width=e.width,$g.height=e.height;const r=$g.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=$g}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=q1("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let s=0;s<a.length;s++)a[s]=oh(a[s]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(oh(n[i]/255)*255):n[i]=oh(n[i]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Pbe=0;class Md{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Pbe++}),this.uuid=Ml(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let s=0,o=r.length;s<o;s++)r[s].isDataTexture?a.push(ak(r[s].image)):a.push(ak(r[s]))}else a=ak(r);i.url=a}return n||(e.images[this.uuid]=i),i}}function ak(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?QJ.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Ube=0;const sk=new te;class nr extends yf{constructor(e=nr.DEFAULT_IMAGE,n=nr.DEFAULT_MAPPING,i=_a,r=_a,a=Vi,s=vc,o=Qr,l=Ao,c=nr.DEFAULT_ANISOTROPY,u=su){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ube++}),this.uuid=Ml(),this.name="",this.source=new Md(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=a,this.minFilter=s,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new wt(0,0),this.repeat=new wt(1,1),this.center=new wt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $n,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(sk).x}get height(){return this.source.getSize(sk).y}get depth(){return this.source.getSize(sk).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Wd)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case qd:e.x=e.x-Math.floor(e.x);break;case _a:e.x=e.x<0?0:1;break;case Z0: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 qd:e.y=e.y-Math.floor(e.y);break;case _a:e.y=e.y<0?0:1;break;case Z0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}nr.DEFAULT_IMAGE=null;nr.DEFAULT_MAPPING=Wd;nr.DEFAULT_ANISOTROPY=1;class ni{constructor(e=0,n=0,i=0,r=1){ni.prototype.isVector4=!0,this.x=e,this.y=n,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,n,i,r){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,i=this.y,r=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r+s[12]*a,this.y=s[1]*n+s[5]*i+s[9]*r+s[13]*a,this.z=s[2]*n+s[6]*i+s[10]*r+s[14]*a,this.w=s[3]*n+s[7]*i+s[11]*r+s[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,a;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],g=l[9],b=l[2],y=l[6],p=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-b)<.01&&Math.abs(g-y)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+b)<.1&&Math.abs(g+y)<.1&&Math.abs(c+d+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const _=(c+1)/2,w=(d+1)/2,M=(p+1)/2,S=(u+h)/4,A=(f+b)/4,C=(g+y)/4;return _>w&&_>M?_<.01?(i=0,r=.707106781,a=.707106781):(i=Math.sqrt(_),r=S/i,a=A/i):w>M?w<.01?(i=.707106781,r=0,a=.707106781):(r=Math.sqrt(w),i=S/r,a=C/r):M<.01?(i=.707106781,r=.707106781,a=0):(a=Math.sqrt(M),i=A/a,r=C/a),this.set(i,r,a,n),this}let x=Math.sqrt((y-g)*(y-g)+(f-b)*(f-b)+(h-u)*(h-u));return Math.abs(x)<.001&&(x=1),this.x=(y-g)/x,this.y=(f-b)/x,this.z=(h-u)/x,this.w=Math.acos((c+d+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Pn(this.x,e.x,n.x),this.y=Pn(this.y,e.y,n.y),this.z=Pn(this.z,e.z,n.z),this.w=Pn(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=Pn(this.x,e,n),this.y=Pn(this.y,e,n),this.z=Pn(this.z,e,n),this.w=Pn(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Pn(i,e,n))}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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 YP extends yf{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new ni(0,0,e,n),this.scissorTest=!1,this.viewport=new ni(0,0,e,n);const r={width:e,height:n,depth:i.depth},a=new nr(r);this.textures=[];const s=i.count;for(let o=0;o<s;o++)this.textures[o]=a.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const n={minFilter:Vi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,this.textures[r].image.depth=i,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new Md(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Cc extends YP{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class WA extends nr{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=ls,this.minFilter=ls,this.wrapR=_a,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Fbe extends Cc{constructor(e=1,n=1,i=1,r={}){super(e,n,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new WA(null,e,n,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class XA extends nr{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=ls,this.minFilter=ls,this.wrapR=_a,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Bbe extends Cc{constructor(e=1,n=1,i=1,r={}){super(e,n,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new XA(null,e,n,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class rr{constructor(e=new te(1/0,1/0,1/0),n=new te(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(Wc.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(Wc.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Wc.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const a=i.getAttribute("position");if(n===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let s=0,o=a.count;s<o;s++)e.isMesh===!0?e.getVertexPosition(s,Wc):Wc.fromBufferAttribute(a,s),Wc.applyMatrix4(e.matrixWorld),this.expandByPoint(Wc);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ow.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),ow.copy(i.boundingBox)),ow.applyMatrix4(e.matrixWorld),this.union(ow)}const r=e.children;for(let a=0,s=r.length;a<s;a++)this.expandByObject(r[a],n);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Wc),Wc.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(By),lw.subVectors(this.max,By),Zg.subVectors(e.a,By),Qg.subVectors(e.b,By),eb.subVectors(e.c,By),Xh.subVectors(Qg,Zg),qh.subVectors(eb,Qg),Tp.subVectors(Zg,eb);let n=[0,-Xh.z,Xh.y,0,-qh.z,qh.y,0,-Tp.z,Tp.y,Xh.z,0,-Xh.x,qh.z,0,-qh.x,Tp.z,0,-Tp.x,-Xh.y,Xh.x,0,-qh.y,qh.x,0,-Tp.y,Tp.x,0];return!ok(n,Zg,Qg,eb,lw)||(n=[1,0,0,0,1,0,0,0,1],!ok(n,Zg,Qg,eb,lw))?!1:(cw.crossVectors(Xh,qh),n=[cw.x,cw.y,cw.z],ok(n,Zg,Qg,eb,lw))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Wc).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Wc).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:(Lf[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Lf[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Lf[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Lf[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Lf[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Lf[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Lf[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Lf[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Lf),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Lf=[new te,new te,new te,new te,new te,new te,new te,new te],Wc=new te,ow=new rr,Zg=new te,Qg=new te,eb=new te,Xh=new te,qh=new te,Tp=new te,By=new te,lw=new te,cw=new te,Ap=new te;function ok(t,e,n,i,r){for(let a=0,s=t.length-3;a<=s;a+=3){Ap.fromArray(t,a);const o=r.x*Math.abs(Ap.x)+r.y*Math.abs(Ap.y)+r.z*Math.abs(Ap.z),l=e.dot(Ap),c=n.dot(Ap),u=i.dot(Ap);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const zbe=new rr,zy=new te,lk=new te;class Ur{constructor(e=new te,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):zbe.setFromPoints(e).getCenter(i);let r=0;for(let a=0,s=e.length;a<s;a++)r=Math.max(r,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;zy.subVectors(e,this.center);const n=zy.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(zy,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):(lk.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(zy.copy(e.center).add(lk)),this.expandByPoint(zy.copy(e.center).sub(lk))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Pf=new te,ck=new te,uw=new te,Kh=new te,uk=new te,fw=new te,fk=new te;class xf{constructor(e=new te,n=new te(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.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,Pf)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Pf.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Pf.copy(this.origin).addScaledVector(this.direction,n),Pf.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){ck.copy(e).add(n).multiplyScalar(.5),uw.copy(n).sub(e).normalize(),Kh.copy(this.origin).sub(ck);const a=e.distanceTo(n)*.5,s=-this.direction.dot(uw),o=Kh.dot(this.direction),l=-Kh.dot(uw),c=Kh.lengthSq(),u=Math.abs(1-s*s);let f,h,d,g;if(u>0)if(f=s*l-o,h=s*o-l,g=a*u,f>=0)if(h>=-g)if(h<=g){const b=1/u;f*=b,h*=b,d=f*(f+s*h+2*o)+h*(s*f+h+2*l)+c}else h=a,f=Math.max(0,-(s*h+o)),d=-f*f+h*(h+2*l)+c;else h=-a,f=Math.max(0,-(s*h+o)),d=-f*f+h*(h+2*l)+c;else h<=-g?(f=Math.max(0,-(-s*a+o)),h=f>0?-a:Math.min(Math.max(-a,-l),a),d=-f*f+h*(h+2*l)+c):h<=g?(f=0,h=Math.min(Math.max(-a,-l),a),d=h*(h+2*l)+c):(f=Math.max(0,-(s*a+o)),h=f>0?a:Math.min(Math.max(-a,-l),a),d=-f*f+h*(h+2*l)+c);else h=s>0?-a:a,f=Math.max(0,-(s*h+o)),d=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(ck).addScaledVector(uw,h),d}intersectSphere(e,n){Pf.subVectors(e.center,this.origin);const i=Pf.dot(this.direction),r=Pf.dot(Pf)-i*i,a=e.radius*e.radius;if(r>a)return null;const s=Math.sqrt(a-r),o=i-s,l=i+s;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,a,s,o,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(a=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(a=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),i>s||a>r||((a>i||isNaN(i))&&(i=a),(s<r||isNaN(r))&&(r=s),f>=0?(o=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(o=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,Pf)!==null}intersectTriangle(e,n,i,r,a){uk.subVectors(n,e),fw.subVectors(i,e),fk.crossVectors(uk,fw);let s=this.direction.dot(fk),o;if(s>0){if(r)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Kh.subVectors(this.origin,e);const l=o*this.direction.dot(fw.crossVectors(Kh,fw));if(l<0)return null;const c=o*this.direction.dot(uk.cross(Kh));if(c<0||l+c>s)return null;const u=-o*Kh.dot(fk);return u<0?null:this.at(u/s,a)}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 Dt{constructor(e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y){Dt.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,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y)}set(e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y){const p=this.elements;return p[0]=e,p[4]=n,p[8]=i,p[12]=r,p[1]=a,p[5]=s,p[9]=o,p[13]=l,p[2]=c,p[6]=u,p[10]=f,p[14]=h,p[3]=d,p[7]=g,p[11]=b,p[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 Dt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,i=e.elements,r=1/tb.setFromMatrixColumn(e,0).length(),a=1/tb.setFromMatrixColumn(e,1).length(),s=1/tb.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*a,n[5]=i[5]*a,n[6]=i[6]*a,n[7]=0,n[8]=i[8]*s,n[9]=i[9]*s,n[10]=i[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,a=e.z,s=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){const h=s*u,d=s*f,g=o*u,b=o*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=d+g*c,n[5]=h-b*c,n[9]=-o*l,n[2]=b-h*c,n[6]=g+d*c,n[10]=s*l}else if(e.order==="YXZ"){const h=l*u,d=l*f,g=c*u,b=c*f;n[0]=h+b*o,n[4]=g*o-d,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-o,n[2]=d*o-g,n[6]=b+h*o,n[10]=s*l}else if(e.order==="ZXY"){const h=l*u,d=l*f,g=c*u,b=c*f;n[0]=h-b*o,n[4]=-s*f,n[8]=g+d*o,n[1]=d+g*o,n[5]=s*u,n[9]=b-h*o,n[2]=-s*c,n[6]=o,n[10]=s*l}else if(e.order==="ZYX"){const h=s*u,d=s*f,g=o*u,b=o*f;n[0]=l*u,n[4]=g*c-d,n[8]=h*c+b,n[1]=l*f,n[5]=b*c+h,n[9]=d*c-g,n[2]=-c,n[6]=o*l,n[10]=s*l}else if(e.order==="YZX"){const h=s*l,d=s*c,g=o*l,b=o*c;n[0]=l*u,n[4]=b-h*f,n[8]=g*f+d,n[1]=f,n[5]=s*u,n[9]=-o*u,n[2]=-c*u,n[6]=d*f+g,n[10]=h-b*f}else if(e.order==="XZY"){const h=s*l,d=s*c,g=o*l,b=o*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=h*f+b,n[5]=s*u,n[9]=d*f-g,n[2]=g*f-d,n[6]=o*u,n[10]=b*f+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(jbe,e,Hbe)}lookAt(e,n,i){const r=this.elements;return ul.subVectors(e,n),ul.lengthSq()===0&&(ul.z=1),ul.normalize(),Yh.crossVectors(i,ul),Yh.lengthSq()===0&&(Math.abs(i.z)===1?ul.x+=1e-4:ul.z+=1e-4,ul.normalize(),Yh.crossVectors(i,ul)),Yh.normalize(),hw.crossVectors(ul,Yh),r[0]=Yh.x,r[4]=hw.x,r[8]=ul.x,r[1]=Yh.y,r[5]=hw.y,r[9]=ul.y,r[2]=Yh.z,r[6]=hw.z,r[10]=ul.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[4],l=i[8],c=i[12],u=i[1],f=i[5],h=i[9],d=i[13],g=i[2],b=i[6],y=i[10],p=i[14],x=i[3],_=i[7],w=i[11],M=i[15],S=r[0],A=r[4],C=r[8],k=r[12],R=r[1],N=r[5],P=r[9],j=r[13],z=r[2],X=r[6],F=r[10],H=r[14],V=r[3],W=r[7],B=r[11],Y=r[15];return a[0]=s*S+o*R+l*z+c*V,a[4]=s*A+o*N+l*X+c*W,a[8]=s*C+o*P+l*F+c*B,a[12]=s*k+o*j+l*H+c*Y,a[1]=u*S+f*R+h*z+d*V,a[5]=u*A+f*N+h*X+d*W,a[9]=u*C+f*P+h*F+d*B,a[13]=u*k+f*j+h*H+d*Y,a[2]=g*S+b*R+y*z+p*V,a[6]=g*A+b*N+y*X+p*W,a[10]=g*C+b*P+y*F+p*B,a[14]=g*k+b*j+y*H+p*Y,a[3]=x*S+_*R+w*z+M*V,a[7]=x*A+_*N+w*X+M*W,a[11]=x*C+_*P+w*F+M*B,a[15]=x*k+_*j+w*H+M*Y,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],a=e[12],s=e[1],o=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],d=e[14],g=e[3],b=e[7],y=e[11],p=e[15];return g*(+a*l*f-r*c*f-a*o*h+i*c*h+r*o*d-i*l*d)+b*(+n*l*d-n*c*h+a*s*h-r*s*d+r*c*u-a*l*u)+y*(+n*c*f-n*o*d-a*s*f+i*s*d+a*o*u-i*c*u)+p*(-r*o*u-n*l*f+n*o*h+r*s*f-i*s*h+i*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,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]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],g=e[12],b=e[13],y=e[14],p=e[15],x=f*y*c-b*h*c+b*l*d-o*y*d-f*l*p+o*h*p,_=g*h*c-u*y*c-g*l*d+s*y*d+u*l*p-s*h*p,w=u*b*c-g*f*c+g*o*d-s*b*d-u*o*p+s*f*p,M=g*f*l-u*b*l-g*o*h+s*b*h+u*o*y-s*f*y,S=n*x+i*_+r*w+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/S;return e[0]=x*A,e[1]=(b*h*a-f*y*a-b*r*d+i*y*d+f*r*p-i*h*p)*A,e[2]=(o*y*a-b*l*a+b*r*c-i*y*c-o*r*p+i*l*p)*A,e[3]=(f*l*a-o*h*a-f*r*c+i*h*c+o*r*d-i*l*d)*A,e[4]=_*A,e[5]=(u*y*a-g*h*a+g*r*d-n*y*d-u*r*p+n*h*p)*A,e[6]=(g*l*a-s*y*a-g*r*c+n*y*c+s*r*p-n*l*p)*A,e[7]=(s*h*a-u*l*a+u*r*c-n*h*c-s*r*d+n*l*d)*A,e[8]=w*A,e[9]=(g*f*a-u*b*a-g*i*d+n*b*d+u*i*p-n*f*p)*A,e[10]=(s*b*a-g*o*a+g*i*c-n*b*c-s*i*p+n*o*p)*A,e[11]=(u*o*a-s*f*a-u*i*c+n*f*c+s*i*d-n*o*d)*A,e[12]=M*A,e[13]=(u*b*r-g*f*r+g*i*h-n*b*h-u*i*y+n*f*y)*A,e[14]=(g*o*r-s*b*r-g*i*l+n*b*l+s*i*y-n*o*y)*A,e[15]=(s*f*r-u*o*r+u*i*l-n*f*l-s*i*h+n*o*h)*A,this}scale(e){const n=this.elements,i=e.x,r=e.y,a=e.z;return n[0]*=i,n[4]*=r,n[8]*=a,n[1]*=i,n[5]*=r,n[9]*=a,n[2]*=i,n[6]*=r,n[10]*=a,n[3]*=i,n[7]*=r,n[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,i,r))}makeTranslation(e,n,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,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),a=1-i,s=e.x,o=e.y,l=e.z,c=a*s,u=a*o;return this.set(c*s+i,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+i,u*l-r*s,0,c*l-r*o,u*l+r*s,a*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,a,s){return this.set(1,i,a,0,e,1,s,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,c=a+a,u=s+s,f=o+o,h=a*c,d=a*u,g=a*f,b=s*u,y=s*f,p=o*f,x=l*c,_=l*u,w=l*f,M=i.x,S=i.y,A=i.z;return r[0]=(1-(b+p))*M,r[1]=(d+w)*M,r[2]=(g-_)*M,r[3]=0,r[4]=(d-w)*S,r[5]=(1-(h+p))*S,r[6]=(y+x)*S,r[7]=0,r[8]=(g+_)*A,r[9]=(y-x)*A,r[10]=(1-(h+b))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;let a=tb.set(r[0],r[1],r[2]).length();const s=tb.set(r[4],r[5],r[6]).length(),o=tb.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),e.x=r[12],e.y=r[13],e.z=r[14],Xc.copy(this);const c=1/a,u=1/s,f=1/o;return Xc.elements[0]*=c,Xc.elements[1]*=c,Xc.elements[2]*=c,Xc.elements[4]*=u,Xc.elements[5]*=u,Xc.elements[6]*=u,Xc.elements[8]*=f,Xc.elements[9]*=f,Xc.elements[10]*=f,n.setFromRotationMatrix(Xc),i.x=a,i.y=s,i.z=o,this}makePerspective(e,n,i,r,a,s,o=yl,l=!1){const c=this.elements,u=2*a/(n-e),f=2*a/(i-r),h=(n+e)/(n-e),d=(i+r)/(i-r);let g,b;if(l)g=a/(s-a),b=s*a/(s-a);else if(o===yl)g=-(s+a)/(s-a),b=-2*s*a/(s-a);else if(o===av)g=-s/(s-a),b=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=f,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=b,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,i,r,a,s,o=yl,l=!1){const c=this.elements,u=2/(n-e),f=2/(i-r),h=-(n+e)/(n-e),d=-(i+r)/(i-r);let g,b;if(l)g=1/(s-a),b=s/(s-a);else if(o===yl)g=-2/(s-a),b=-(s+a)/(s-a);else if(o===av)g=-1/(s-a),b=-a/(s-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=h,c[1]=0,c[5]=f,c[9]=0,c[13]=d,c[2]=0,c[6]=0,c[10]=g,c[14]=b,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const tb=new te,Xc=new Dt,jbe=new te(0,0,0),Hbe=new te(1,1,1),Yh=new te,hw=new te,ul=new te,Wz=new Dt,Xz=new Xn;class vi{constructor(e=0,n=0,i=0,r=vi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,i,r=this._order){return this._x=e,this._y=n,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,n=this._order,i=!0){const r=e.elements,a=r[0],s=r[4],o=r[8],l=r[1],c=r[5],u=r[9],f=r[2],h=r[6],d=r[10];switch(n){case"XYZ":this._y=Math.asin(Pn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Pn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,a),this._z=0);break;case"ZXY":this._x=Math.asin(Pn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Pn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Pn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Pn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return Wz.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Wz,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return Xz.setFromEuler(this),this.setFromQuaternion(Xz,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}vi.DEFAULT_ORDER="XYZ";class ov{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Vbe=0;const qz=new te,nb=new Xn,Uf=new Dt,dw=new te,jy=new te,Gbe=new te,Wbe=new Xn,Kz=new te(1,0,0),Yz=new te(0,1,0),Jz=new te(0,0,1),$z={type:"added"},Xbe={type:"removed"},ib={type:"childadded",child:null},hk={type:"childremoved",child:null};class Pi extends yf{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Vbe++}),this.uuid=Ml(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pi.DEFAULT_UP.clone();const e=new te,n=new vi,i=new Xn,r=new te(1,1,1);function a(){i.setFromEuler(n,!1)}function s(){n.setFromQuaternion(i,void 0,!1)}n._onChange(a),i._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Dt},normalMatrix:{value:new $n}}),this.matrix=new Dt,this.matrixWorld=new Dt,this.matrixAutoUpdate=Pi.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Pi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ov,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return nb.setFromAxisAngle(e,n),this.quaternion.multiply(nb),this}rotateOnWorldAxis(e,n){return nb.setFromAxisAngle(e,n),this.quaternion.premultiply(nb),this}rotateX(e){return this.rotateOnAxis(Kz,e)}rotateY(e){return this.rotateOnAxis(Yz,e)}rotateZ(e){return this.rotateOnAxis(Jz,e)}translateOnAxis(e,n){return qz.copy(e).applyQuaternion(this.quaternion),this.position.add(qz.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(Kz,e)}translateY(e){return this.translateOnAxis(Yz,e)}translateZ(e){return this.translateOnAxis(Jz,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Uf.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?dw.copy(e):dw.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),jy.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Uf.lookAt(jy,dw,this.up):Uf.lookAt(dw,jy,this.up),this.quaternion.setFromRotationMatrix(Uf),r&&(Uf.extractRotation(r.matrixWorld),nb.setFromRotationMatrix(Uf),this.quaternion.premultiply(nb.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent($z),ib.child=e,this.dispatchEvent(ib),ib.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Xbe),hk.child=e,this.dispatchEvent(hk),hk.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Uf.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Uf.multiply(e.parent.matrixWorld)),e.applyMatrix4(Uf),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent($z),ib.child=e,this.dispatchEvent(ib),ib.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const s=this.children[i].getObjectByProperty(e,n);if(s!==void 0)return s}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let a=0,s=r.length;a<s;a++)r[a].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(jy,e,Gbe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(jy,Wbe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const r=this.children;for(let a=0,s=r.length;a<s;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(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.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(o,l){return o[l.uuid]===void 0&&(o[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=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const f=l[c];a(e.shapes,f)}else a(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(a(e.materials,this.material[l]));r.material=o}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(a(e.animations,l))}}if(n){const o=s(e.geometries),l=s(e.materials),c=s(e.textures),u=s(e.images),f=s(e.shapes),h=s(e.skeletons),d=s(e.animations),g=s(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),d.length>0&&(i.animations=d),g.length>0&&(i.nodes=g)}return i.object=r,i;function s(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!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)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}Pi.DEFAULT_UP=new te(0,1,0);Pi.DEFAULT_MATRIX_AUTO_UPDATE=!0;Pi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const qc=new te,Ff=new te,dk=new te,Bf=new te,rb=new te,ab=new te,Zz=new te,pk=new te,mk=new te,gk=new te,bk=new ni,vk=new ni,yk=new ni;class Bo{constructor(e=new te,n=new te,i=new te){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),qc.subVectors(e,n),r.cross(qc);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,n,i,r,a){qc.subVectors(r,n),Ff.subVectors(i,n),dk.subVectors(e,n);const s=qc.dot(qc),o=qc.dot(Ff),l=qc.dot(dk),c=Ff.dot(Ff),u=Ff.dot(dk),f=s*c-o*o;if(f===0)return a.set(0,0,0),null;const h=1/f,d=(c*l-o*u)*h,g=(s*u-o*l)*h;return a.set(1-d-g,g,d)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Bf)===null?!1:Bf.x>=0&&Bf.y>=0&&Bf.x+Bf.y<=1}static getInterpolation(e,n,i,r,a,s,o,l){return this.getBarycoord(e,n,i,r,Bf)===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(a,Bf.x),l.addScaledVector(s,Bf.y),l.addScaledVector(o,Bf.z),l)}static getInterpolatedAttribute(e,n,i,r,a,s){return bk.setScalar(0),vk.setScalar(0),yk.setScalar(0),bk.fromBufferAttribute(e,n),vk.fromBufferAttribute(e,i),yk.fromBufferAttribute(e,r),s.setScalar(0),s.addScaledVector(bk,a.x),s.addScaledVector(vk,a.y),s.addScaledVector(yk,a.z),s}static isFrontFacing(e,n,i,r){return qc.subVectors(i,n),Ff.subVectors(e,n),qc.cross(Ff).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),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 qc.subVectors(this.c,this.b),Ff.subVectors(this.a,this.b),qc.cross(Ff).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Bo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Bo.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,a){return Bo.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}containsPoint(e){return Bo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Bo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,a=this.c;let s,o;rb.subVectors(r,i),ab.subVectors(a,i),pk.subVectors(e,i);const l=rb.dot(pk),c=ab.dot(pk);if(l<=0&&c<=0)return n.copy(i);mk.subVectors(e,r);const u=rb.dot(mk),f=ab.dot(mk);if(u>=0&&f<=u)return n.copy(r);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(i).addScaledVector(rb,s);gk.subVectors(e,a);const d=rb.dot(gk),g=ab.dot(gk);if(g>=0&&d<=g)return n.copy(a);const b=d*c-l*g;if(b<=0&&c>=0&&g<=0)return o=c/(c-g),n.copy(i).addScaledVector(ab,o);const y=u*g-d*f;if(y<=0&&f-u>=0&&d-g>=0)return Zz.subVectors(a,r),o=(f-u)/(f-u+(d-g)),n.copy(r).addScaledVector(Zz,o);const p=1/(y+b+h);return s=b*p,o=h*p,n.copy(i).addScaledVector(rb,s).addScaledVector(ab,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const e$={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},Jh={h:0,s:0,l:0},pw={h:0,s:0,l:0};function xk(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let Ut=class{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===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,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=As){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,bi.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=bi.workingColorSpace){return this.r=e,this.g=n,this.b=i,bi.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=bi.workingColorSpace){if(e=KP(e,1),n=Pn(n,0,1),i=Pn(i,0,1),n===0)this.r=this.g=this.b=i;else{const a=i<=.5?i*(1+n):i+n-i*n,s=2*i-a;this.r=xk(s,a,e+1/3),this.g=xk(s,a,e),this.b=xk(s,a,e-1/3)}return bi.colorSpaceToWorking(this,r),this}setStyle(e,n=As){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const s=r[1],o=r[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=r[1],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(a,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=As){const i=e$[e.toLowerCase()];return i!==void 0?this.setHex(i,n):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=oh(e.r),this.g=oh(e.g),this.b=oh(e.b),this}copyLinearToSRGB(e){return this.r=w0(e.r),this.g=w0(e.g),this.b=w0(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=As){return bi.workingToColorSpace(Zs.copy(this),e),Math.round(Pn(Zs.r*255,0,255))*65536+Math.round(Pn(Zs.g*255,0,255))*256+Math.round(Pn(Zs.b*255,0,255))}getHexString(e=As){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=bi.workingColorSpace){bi.workingToColorSpace(Zs.copy(this),n);const i=Zs.r,r=Zs.g,a=Zs.b,s=Math.max(i,r,a),o=Math.min(i,r,a);let l,c;const u=(o+s)/2;if(o===s)l=0,c=0;else{const f=s-o;switch(c=u<=.5?f/(s+o):f/(2-s-o),s){case i:l=(r-a)/f+(r<a?6:0);break;case r:l=(a-i)/f+2;break;case a:l=(i-r)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,n=bi.workingColorSpace){return bi.workingToColorSpace(Zs.copy(this),n),e.r=Zs.r,e.g=Zs.g,e.b=Zs.b,e}getStyle(e=As){bi.workingToColorSpace(Zs.copy(this),e);const n=Zs.r,i=Zs.g,r=Zs.b;return e!==As?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(Jh),this.setHSL(Jh.h+e,Jh.s+n,Jh.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(Jh),e.getHSL(pw);const i=a1(Jh.h,pw.h,n),r=a1(Jh.s,pw.s,n),a=a1(Jh.l,pw.l,n);return this.setHSL(i,r,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,a=e.elements;return this.r=a[0]*n+a[3]*i+a[6]*r,this.g=a[1]*n+a[4]*i+a[7]*r,this.b=a[2]*n+a[5]*i+a[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Zs=new Ut;Ut.NAMES=e$;let qbe=0;class Oa extends yf{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:qbe++}),this.uuid=Ml(),this.name="",this.type="Material",this.blending=Om,this.side=_u,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=b2,this.blendDst=v2,this.blendEquation=yd,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ut(0,0,0),this.blendAlpha=0,this.depthFunc=Xm,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ZO,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qp,this.stencilZFail=Qp,this.stencilZPass=Qp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Material: '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Om&&(i.blending=this.blending),this.side!==_u&&(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!==b2&&(i.blendSrc=this.blendSrc),this.blendDst!==v2&&(i.blendDst=this.blendDst),this.blendEquation!==yd&&(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!==Xm&&(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!==ZO&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Qp&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Qp&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Qp&&(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(a){const s=[];for(const o in a){const l=a[o];delete l.metadata,s.push(l)}return s}if(n){const a=r(e.textures),s=r(e.images);a.length>0&&(i.textures=a),s.length>0&&(i.images=s)}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 n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let a=0;a!==r;++a)i[a]=n[a].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 Ds extends Oa{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ut(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 vi,this.combine=U_,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 Xf=Kbe();function Kbe(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,a[l]=c|u}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}function No(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Pn(t,-65504,65504),Xf.floatView[0]=t;const e=Xf.uint32View[0],n=e>>23&511;return Xf.baseTable[n]+((e&8388607)>>Xf.shiftTable[n])}function Ax(t){const e=t>>10;return Xf.uint32View[0]=Xf.mantissaTable[Xf.offsetTable[e]+(t&1023)]+Xf.exponentTable[e],Xf.floatView[0]}class pm{static toHalfFloat(e){return No(e)}static fromHalfFloat(e){return Ax(e)}}const Ma=new te,mw=new wt;let Ybe=0;class In{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Ybe++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=W1,this.updateRanges=[],this.gpuType=wr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}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,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)mw.fromBufferAttribute(this,n),mw.applyMatrix3(e),this.setXY(n,mw.x,mw.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.applyMatrix3(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.applyMatrix4(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.applyNormalMatrix(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.transformDirection(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=wo(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=ti(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=wo(n,this.array)),n}setX(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=wo(n,this.array)),n}setY(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=wo(n,this.array)),n}setZ(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=wo(n,this.array)),n}setW(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,a){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array),a=ti(a,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==W1&&(e.usage=this.usage),e}}class Jbe extends In{constructor(e,n,i){super(new Int8Array(e),n,i)}}class $be extends In{constructor(e,n,i){super(new Uint8Array(e),n,i)}}class Zbe extends In{constructor(e,n,i){super(new Uint8ClampedArray(e),n,i)}}class Qbe extends In{constructor(e,n,i){super(new Int16Array(e),n,i)}}class JP extends In{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class e0e extends In{constructor(e,n,i){super(new Int32Array(e),n,i)}}class $P extends In{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class t$ extends In{constructor(e,n,i){super(new Uint16Array(e),n,i),this.isFloat16BufferAttribute=!0}getX(e){let n=Ax(this.array[e*this.itemSize]);return this.normalized&&(n=wo(n,this.array)),n}setX(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize]=No(n),this}getY(e){let n=Ax(this.array[e*this.itemSize+1]);return this.normalized&&(n=wo(n,this.array)),n}setY(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+1]=No(n),this}getZ(e){let n=Ax(this.array[e*this.itemSize+2]);return this.normalized&&(n=wo(n,this.array)),n}setZ(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+2]=No(n),this}getW(e){let n=Ax(this.array[e*this.itemSize+3]);return this.normalized&&(n=wo(n,this.array)),n}setW(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+3]=No(n),this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array)),this.array[e+0]=No(n),this.array[e+1]=No(i),this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array)),this.array[e+0]=No(n),this.array[e+1]=No(i),this.array[e+2]=No(r),this}setXYZW(e,n,i,r,a){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array),a=ti(a,this.array)),this.array[e+0]=No(n),this.array[e+1]=No(i),this.array[e+2]=No(r),this.array[e+3]=No(a),this}}class mn extends In{constructor(e,n,i){super(new Float32Array(e),n,i)}}let t0e=0;const ql=new Dt,_k=new Pi,sb=new te,fl=new rr,Hy=new rr,Qa=new te;class On extends yf{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:t0e++}),this.uuid=Ml(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new($J(e)?$P:JP)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const a=new $n().getNormalMatrix(e);i.applyNormalMatrix(a),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ql.makeRotationFromQuaternion(e),this.applyMatrix4(ql),this}rotateX(e){return ql.makeRotationX(e),this.applyMatrix4(ql),this}rotateY(e){return ql.makeRotationY(e),this.applyMatrix4(ql),this}rotateZ(e){return ql.makeRotationZ(e),this.applyMatrix4(ql),this}translate(e,n,i){return ql.makeTranslation(e,n,i),this.applyMatrix4(ql),this}scale(e,n,i){return ql.makeScale(e,n,i),this.applyMatrix4(ql),this}lookAt(e){return _k.lookAt(e),_k.updateMatrix(),this.applyMatrix4(_k.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(sb).negate(),this.translate(sb.x,sb.y,sb.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,a=e.length;r<a;r++){const s=e[r];i.push(s.x,s.y,s.z||0)}this.setAttribute("position",new mn(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const a=e[r];n.setXYZ(r,a.x,a.y,a.z||0)}e.length>n.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const a=n[i];fl.setFromBufferAttribute(a),this.morphTargetsRelative?(Qa.addVectors(this.boundingBox.min,fl.min),this.boundingBox.expandByPoint(Qa),Qa.addVectors(this.boundingBox.max,fl.max),this.boundingBox.expandByPoint(Qa)):(this.boundingBox.expandByPoint(fl.min),this.boundingBox.expandByPoint(fl.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ur);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new te,1/0);return}if(e){const i=this.boundingSphere.center;if(fl.setFromBufferAttribute(e),n)for(let a=0,s=n.length;a<s;a++){const o=n[a];Hy.setFromBufferAttribute(o),this.morphTargetsRelative?(Qa.addVectors(fl.min,Hy.min),fl.expandByPoint(Qa),Qa.addVectors(fl.max,Hy.max),fl.expandByPoint(Qa)):(fl.expandByPoint(Hy.min),fl.expandByPoint(Hy.max))}fl.getCenter(i);let r=0;for(let a=0,s=e.count;a<s;a++)Qa.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(Qa));if(n)for(let a=0,s=n.length;a<s;a++){const o=n[a],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)Qa.fromBufferAttribute(o,c),l&&(sb.fromBufferAttribute(e,c),Qa.add(sb)),r=Math.max(r,i.distanceToSquared(Qa))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,a=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new In(new Float32Array(4*i.count),4));const s=this.getAttribute("tangent"),o=[],l=[];for(let C=0;C<i.count;C++)o[C]=new te,l[C]=new te;const c=new te,u=new te,f=new te,h=new wt,d=new wt,g=new wt,b=new te,y=new te;function p(C,k,R){c.fromBufferAttribute(i,C),u.fromBufferAttribute(i,k),f.fromBufferAttribute(i,R),h.fromBufferAttribute(a,C),d.fromBufferAttribute(a,k),g.fromBufferAttribute(a,R),u.sub(c),f.sub(c),d.sub(h),g.sub(h);const N=1/(d.x*g.y-g.x*d.y);isFinite(N)&&(b.copy(u).multiplyScalar(g.y).addScaledVector(f,-d.y).multiplyScalar(N),y.copy(f).multiplyScalar(d.x).addScaledVector(u,-g.x).multiplyScalar(N),o[C].add(b),o[k].add(b),o[R].add(b),l[C].add(y),l[k].add(y),l[R].add(y))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let C=0,k=x.length;C<k;++C){const R=x[C],N=R.start,P=R.count;for(let j=N,z=N+P;j<z;j+=3)p(e.getX(j+0),e.getX(j+1),e.getX(j+2))}const _=new te,w=new te,M=new te,S=new te;function A(C){M.fromBufferAttribute(r,C),S.copy(M);const k=o[C];_.copy(k),_.sub(M.multiplyScalar(M.dot(k))).normalize(),w.crossVectors(S,k);const N=w.dot(l[C])<0?-1:1;s.setXYZW(C,_.x,_.y,_.z,N)}for(let C=0,k=x.length;C<k;++C){const R=x[C],N=R.start,P=R.count;for(let j=N,z=N+P;j<z;j+=3)A(e.getX(j+0)),A(e.getX(j+1)),A(e.getX(j+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new In(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let h=0,d=i.count;h<d;h++)i.setXYZ(h,0,0,0);const r=new te,a=new te,s=new te,o=new te,l=new te,c=new te,u=new te,f=new te;if(e)for(let h=0,d=e.count;h<d;h+=3){const g=e.getX(h+0),b=e.getX(h+1),y=e.getX(h+2);r.fromBufferAttribute(n,g),a.fromBufferAttribute(n,b),s.fromBufferAttribute(n,y),u.subVectors(s,a),f.subVectors(r,a),u.cross(f),o.fromBufferAttribute(i,g),l.fromBufferAttribute(i,b),c.fromBufferAttribute(i,y),o.add(u),l.add(u),c.add(u),i.setXYZ(g,o.x,o.y,o.z),i.setXYZ(b,l.x,l.y,l.z),i.setXYZ(y,c.x,c.y,c.z)}else for(let h=0,d=n.count;h<d;h+=3)r.fromBufferAttribute(n,h+0),a.fromBufferAttribute(n,h+1),s.fromBufferAttribute(n,h+2),u.subVectors(s,a),f.subVectors(r,a),u.cross(f),i.setXYZ(h+0,u.x,u.y,u.z),i.setXYZ(h+1,u.x,u.y,u.z),i.setXYZ(h+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)Qa.fromBufferAttribute(e,n),Qa.normalize(),e.setXYZ(n,Qa.x,Qa.y,Qa.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,f=o.normalized,h=new c.constructor(l.length*u);let d=0,g=0;for(let b=0,y=l.length;b<y;b++){o.isInterleavedBufferAttribute?d=l[b]*o.data.stride+o.offset:d=l[b]*u;for(let p=0;p<u;p++)h[g++]=c[d++]}return new In(h,u,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new On,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);n.setAttribute(o,c)}const a=this.morphAttributes;for(const o in a){const l=[],c=a[o];for(let u=0,f=c.length;u<f;u++){const h=c[u],d=e(h,i);l.push(d)}n.morphAttributes[o]=l}n.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let o=0,l=s.length;o<l;o++){const c=s[o];n.addGroup(c.start,c.count,c.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let a=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f<h;f++){const d=c[f];u.push(d.toJSON(e.data))}u.length>0&&(r[l]=u,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const a=e.morphAttributes;for(const c in a){const u=[],f=a[c];for(let h=0,d=f.length;h<d;h++)u.push(f[h].clone(n));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let c=0,u=s.length;c<u;c++){const f=s[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Qz=new Dt,Cp=new xf,gw=new Ur,ej=new te,bw=new te,vw=new te,yw=new te,Sk=new te,xw=new te,tj=new te,_w=new te;class _i extends Pi{constructor(e=new On,n=new Ds){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=r.length;a<s;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,a=i.morphAttributes.position,s=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(a&&o){xw.set(0,0,0);for(let l=0,c=a.length;l<c;l++){const u=o[l],f=a[l];u!==0&&(Sk.fromBufferAttribute(f,e),s?xw.addScaledVector(Sk,u):xw.addScaledVector(Sk.sub(n),u))}n.add(xw)}return n}raycast(e,n){const i=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),gw.copy(i.boundingSphere),gw.applyMatrix4(a),Cp.copy(e.ray).recast(e.near),!(gw.containsPoint(Cp.origin)===!1&&(Cp.intersectSphere(gw,ej)===null||Cp.origin.distanceToSquared(ej)>(e.far-e.near)**2))&&(Qz.copy(a).invert(),Cp.copy(e.ray).applyMatrix4(Qz),!(i.boundingBox!==null&&Cp.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Cp)))}_computeIntersections(e,n,i){let r;const a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,c=a.attributes.uv,u=a.attributes.uv1,f=a.attributes.normal,h=a.groups,d=a.drawRange;if(o!==null)if(Array.isArray(s))for(let g=0,b=h.length;g<b;g++){const y=h[g],p=s[y.materialIndex],x=Math.max(y.start,d.start),_=Math.min(o.count,Math.min(y.start+y.count,d.start+d.count));for(let w=x,M=_;w<M;w+=3){const S=o.getX(w),A=o.getX(w+1),C=o.getX(w+2);r=Sw(this,p,e,i,c,u,f,S,A,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const g=Math.max(0,d.start),b=Math.min(o.count,d.start+d.count);for(let y=g,p=b;y<p;y+=3){const x=o.getX(y),_=o.getX(y+1),w=o.getX(y+2);r=Sw(this,s,e,i,c,u,f,x,_,w),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}else if(l!==void 0)if(Array.isArray(s))for(let g=0,b=h.length;g<b;g++){const y=h[g],p=s[y.materialIndex],x=Math.max(y.start,d.start),_=Math.min(l.count,Math.min(y.start+y.count,d.start+d.count));for(let w=x,M=_;w<M;w+=3){const S=w,A=w+1,C=w+2;r=Sw(this,p,e,i,c,u,f,S,A,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const g=Math.max(0,d.start),b=Math.min(l.count,d.start+d.count);for(let y=g,p=b;y<p;y+=3){const x=y,_=y+1,w=y+2;r=Sw(this,s,e,i,c,u,f,x,_,w),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}}}function n0e(t,e,n,i,r,a,s,o){let l;if(e.side===Da?l=i.intersectTriangle(s,a,r,!0,o):l=i.intersectTriangle(r,a,s,e.side===_u,o),l===null)return null;_w.copy(o),_w.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(_w);return c<n.near||c>n.far?null:{distance:c,point:_w.clone(),object:t}}function Sw(t,e,n,i,r,a,s,o,l,c){t.getVertexPosition(o,bw),t.getVertexPosition(l,vw),t.getVertexPosition(c,yw);const u=n0e(t,e,n,i,bw,vw,yw,tj);if(u){const f=new te;Bo.getBarycoord(tj,bw,vw,yw,f),r&&(u.uv=Bo.getInterpolatedAttribute(r,o,l,c,f,new wt)),a&&(u.uv1=Bo.getInterpolatedAttribute(a,o,l,c,f,new wt)),s&&(u.normal=Bo.getInterpolatedAttribute(s,o,l,c,f,new te),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a:o,b:l,c,normal:new te,materialIndex:0};Bo.getNormal(bw,vw,yw,h.normal),u.face=h,u.barycoord=f}return u}class ep extends On{constructor(e=1,n=1,i=1,r=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:s};const o=this;r=Math.floor(r),a=Math.floor(a),s=Math.floor(s);const l=[],c=[],u=[],f=[];let h=0,d=0;g("z","y","x",-1,-1,i,n,e,s,a,0),g("z","y","x",1,-1,i,n,-e,s,a,1),g("x","z","y",1,1,e,i,n,r,s,2),g("x","z","y",1,-1,e,i,-n,r,s,3),g("x","y","z",1,-1,e,n,i,r,a,4),g("x","y","z",-1,-1,e,n,-i,r,a,5),this.setIndex(l),this.setAttribute("position",new mn(c,3)),this.setAttribute("normal",new mn(u,3)),this.setAttribute("uv",new mn(f,2));function g(b,y,p,x,_,w,M,S,A,C,k){const R=w/A,N=M/C,P=w/2,j=M/2,z=S/2,X=A+1,F=C+1;let H=0,V=0;const W=new te;for(let B=0;B<F;B++){const Y=B*N-j;for(let Z=0;Z<X;Z++){const G=Z*R-P;W[b]=G*x,W[y]=Y*_,W[p]=z,c.push(W.x,W.y,W.z),W[b]=0,W[y]=0,W[p]=S>0?1:-1,u.push(W.x,W.y,W.z),f.push(Z/A),f.push(1-B/C),H+=1}}for(let B=0;B<C;B++)for(let Y=0;Y<A;Y++){const Z=h+Y+X*B,G=h+Y+X*(B+1),de=h+(Y+1)+X*(B+1),oe=h+(Y+1)+X*B;l.push(Z,G,oe),l.push(G,de,oe),V+=6}o.addGroup(d,V,k),d+=V,h+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ep(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function lv(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function vo(t){const e={};for(let n=0;n<t.length;n++){const i=lv(t[n]);for(const r in i)e[r]=i[r]}return e}function i0e(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function n$(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:bi.workingColorSpace}const cv={clone:lv,merge:vo};var r0e=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,a0e=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class fs extends Oa{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=r0e,this.fragmentShader=a0e,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=lv(e.uniforms),this.uniformsGroups=i0e(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 n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const r in this.uniforms){const s=this.uniforms[r].value;s&&s.isTexture?n.uniforms[r]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?n.uniforms[r]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[r]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[r]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[r]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[r]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[r]={type:"m4",value:s.toArray()}:n.uniforms[r]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class qA extends Pi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dt,this.projectionMatrix=new Dt,this.projectionMatrixInverse=new Dt,this.coordinateSystem=yl,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),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,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const $h=new te,nj=new wt,ij=new wt;class sa extends qA{constructor(e=50,n=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=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=sv*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Im*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return sv*2*Math.atan(Math.tan(Im*.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,n,i){$h.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set($h.x,$h.y).multiplyScalar(-e/$h.z),$h.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set($h.x,$h.y).multiplyScalar(-e/$h.z)}getViewSize(e,n){return this.getViewBounds(e,nj,ij),n.subVectors(ij,nj)}setViewOffset(e,n,i,r,a,s){this.aspect=e/n,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=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Im*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,a=-.5*r;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;a+=s.offsetX*r/l,n-=s.offsetY*i/c,r*=s.width/l,i*=s.height/c}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,n,n-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const ob=-90,lb=1;class i$ extends Pi{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new sa(ob,lb,e,n);r.layers=this.layers,this.add(r);const a=new sa(ob,lb,e,n);a.layers=this.layers,this.add(a);const s=new sa(ob,lb,e,n);s.layers=this.layers,this.add(s);const o=new sa(ob,lb,e,n);o.layers=this.layers,this.add(o);const l=new sa(ob,lb,e,n);l.layers=this.layers,this.add(l);const c=new sa(ob,lb,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,r,a,s,o,l]=n;for(const c of n)this.remove(c);if(e===yl)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===av)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const b=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,a),e.setRenderTarget(i,1,r),e.render(n,s),e.setRenderTarget(i,2,r),e.render(n,o),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,c),i.texture.generateMipmaps=b,e.setRenderTarget(i,5,r),e.render(n,u),e.setRenderTarget(f,h,d),e.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class B_ extends nr{constructor(e=[],n=df,i,r,a,s,o,l,c,u){super(e,n,i,r,a,s,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ZP extends Cc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new B_(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},r=new ep(5,5,5),a=new fs({name:"CubemapFromEquirect",uniforms:lv(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Da,blending:af});a.uniforms.tEquirect.value=n;const s=new _i(r,a),o=n.minFilter;return n.minFilter===vc&&(n.minFilter=Vi),new i$(1,10,this).update(e,s),n.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,n=!0,i=!0,r=!0){const a=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,i,r);e.setRenderTarget(a)}}class xl extends Pi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const s0e={type:"move"};class dM{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new xl,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 xl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new xl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te),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 n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,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,n,i){let r=null,a=null,s=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const b of e.hand.values()){const y=n.getJointPose(b,i),p=this._getHandJoint(c,b);y!==null&&(p.matrix.fromArray(y.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=y.radius),p.visible=y!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,g=.005;c.inputState.pinching&&h>d+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=d-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=n.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&a!==null&&(r=a),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(s0e)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=a!==null),c!==null&&(c.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new xl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class KA{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ut(e),this.density=n}clone(){return new KA(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class YA{constructor(e,n=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ut(e),this.near=n,this.far=i}clone(){return new YA(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class qv extends Pi{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 vi,this.environmentIntensity=1,this.environmentRotation=new vi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class z_{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=W1,this.updateRanges=[],this.version=0,this.uuid=Ml()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}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,n,i){e*=this.stride,i*=n.stride;for(let r=0,a=this.stride;r<a;r++)this.array[e+r]=n.array[i+r];return this}set(e,n=0){return this.array.set(e,n),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ml()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const n=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(n,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ml()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const go=new te;class zo{constructor(e,n,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=n,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let n=0,i=this.data.count;n<i;n++)go.fromBufferAttribute(this,n),go.applyMatrix4(e),this.setXYZ(n,go.x,go.y,go.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)go.fromBufferAttribute(this,n),go.applyNormalMatrix(e),this.setXYZ(n,go.x,go.y,go.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)go.fromBufferAttribute(this,n),go.transformDirection(e),this.setXYZ(n,go.x,go.y,go.z);return this}getComponent(e,n){let i=this.array[e*this.data.stride+this.offset+n];return this.normalized&&(i=wo(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=ti(i,this.array)),this.data.array[e*this.data.stride+this.offset+n]=i,this}setX(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset]=n,this}setY(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset+1]=n,this}setZ(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset+2]=n,this}setW(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset+3]=n,this}getX(e){let n=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(n=wo(n,this.array)),n}getY(e){let n=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(n=wo(n,this.array)),n}getZ(e){let n=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(n=wo(n,this.array)),n}getW(e){let n=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(n=wo(n,this.array)),n}setXY(e,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this}setXYZ(e,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,n,i,r,a){return e=e*this.data.stride+this.offset,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array),a=ti(a,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=a,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)n.push(this.data.array[r+a])}return new In(new this.array.constructor(n),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new zo(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)n.push(this.data.array[r+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:n,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class QP extends Oa{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ut(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let cb;const Vy=new te,ub=new te,fb=new te,hb=new wt,Gy=new wt,r$=new Dt,ww=new te,Wy=new te,Ew=new te,rj=new wt,wk=new wt,aj=new wt;class a$ extends Pi{constructor(e=new QP){if(super(),this.isSprite=!0,this.type="Sprite",cb===void 0){cb=new On;const n=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new z_(n,5);cb.setIndex([0,1,2,0,2,3]),cb.setAttribute("position",new zo(i,3,0,!1)),cb.setAttribute("uv",new zo(i,2,3,!1))}this.geometry=cb,this.material=e,this.center=new wt(.5,.5),this.count=1}raycast(e,n){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ub.setFromMatrixScale(this.matrixWorld),r$.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),fb.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&ub.multiplyScalar(-fb.z);const i=this.material.rotation;let r,a;i!==0&&(a=Math.cos(i),r=Math.sin(i));const s=this.center;Mw(ww.set(-.5,-.5,0),fb,s,ub,r,a),Mw(Wy.set(.5,-.5,0),fb,s,ub,r,a),Mw(Ew.set(.5,.5,0),fb,s,ub,r,a),rj.set(0,0),wk.set(1,0),aj.set(1,1);let o=e.ray.intersectTriangle(ww,Wy,Ew,!1,Vy);if(o===null&&(Mw(Wy.set(-.5,.5,0),fb,s,ub,r,a),wk.set(0,1),o=e.ray.intersectTriangle(ww,Ew,Wy,!1,Vy),o===null))return;const l=e.ray.origin.distanceTo(Vy);l<e.near||l>e.far||n.push({distance:l,point:Vy.clone(),uv:Bo.getInterpolation(Vy,ww,Wy,Ew,rj,wk,aj,new wt),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Mw(t,e,n,i,r,a){hb.subVectors(t,n).addScalar(.5).multiply(i),r!==void 0?(Gy.x=a*hb.x-r*hb.y,Gy.y=r*hb.x+a*hb.y):Gy.copy(hb),t.copy(e),t.x+=Gy.x,t.y+=Gy.y,t.applyMatrix4(r$)}const Tw=new te,sj=new te;class s$ extends Pi{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,n=0,i=0){n=Math.abs(n);const r=this.levels;let a;for(a=0;a<r.length&&!(n<r[a].distance);a++);return r.splice(a,0,{distance:n,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){const n=this.levels;for(let i=0;i<n.length;i++)if(n[i].distance===e){const r=n.splice(i,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const n=this.levels;if(n.length>0){let i,r;for(i=1,r=n.length;i<r;i++){let a=n[i].distance;if(n[i].object.visible&&(a-=a*n[i].hysteresis),e<a)break}return n[i-1].object}return null}raycast(e,n){if(this.levels.length>0){Tw.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Tw);this.getObjectForDistance(r).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Tw.setFromMatrixPosition(e.matrixWorld),sj.setFromMatrixPosition(this.matrixWorld);const i=Tw.distanceTo(sj)/e.zoom;n[0].object.visible=!0;let r,a;for(r=1,a=n.length;r<a;r++){let s=n[r].distance;if(n[r].object.visible&&(s-=s*n[r].hysteresis),i>=s)n[r-1].object.visible=!1,n[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<a;r++)n[r].object.visible=!1}}toJSON(e){const n=super.toJSON(e);this.autoUpdate===!1&&(n.object.autoUpdate=!1),n.object.levels=[];const i=this.levels;for(let r=0,a=i.length;r<a;r++){const s=i[r];n.object.levels.push({object:s.object.uuid,distance:s.distance,hysteresis:s.hysteresis})}return n}}const oj=new te,lj=new ni,cj=new ni,o0e=new te,uj=new Dt,Aw=new te,Ek=new Ur,fj=new Dt,Mk=new xf;let JA=class extends _i{constructor(e,n){super(e,n),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=j1,this.bindMatrix=new Dt,this.bindMatrixInverse=new Dt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new rr),this.boundingBox.makeEmpty();const n=e.getAttribute("position");for(let i=0;i<n.count;i++)this.getVertexPosition(i,Aw),this.boundingBox.expandByPoint(Aw)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ur),this.boundingSphere.makeEmpty();const n=e.getAttribute("position");for(let i=0;i<n.count;i++)this.getVertexPosition(i,Aw),this.boundingSphere.expandByPoint(Aw)}copy(e,n){return super.copy(e,n),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,n){const i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ek.copy(this.boundingSphere),Ek.applyMatrix4(r),e.ray.intersectsSphere(Ek)!==!1&&(fj.copy(r).invert(),Mk.copy(e.ray).applyMatrix4(fj),!(this.boundingBox!==null&&Mk.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,n,Mk)))}getVertexPosition(e,n){return super.getVertexPosition(e,n),this.applyBoneTransform(e,n),n}bind(e,n){this.skeleton=e,n===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.copy(n).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new ni,n=this.geometry.attributes.skinWeight;for(let i=0,r=n.count;i<r;i++){e.fromBufferAttribute(n,i);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),n.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===j1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===BP?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,n){const i=this.skeleton,r=this.geometry;lj.fromBufferAttribute(r.attributes.skinIndex,e),cj.fromBufferAttribute(r.attributes.skinWeight,e),oj.copy(n).applyMatrix4(this.bindMatrix),n.set(0,0,0);for(let a=0;a<4;a++){const s=cj.getComponent(a);if(s!==0){const o=lj.getComponent(a);uj.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),n.addScaledVector(o0e.copy(oj).applyMatrix4(uj),s)}}return n.applyMatrix4(this.bindMatrixInverse)}};class j_ extends Pi{constructor(){super(),this.isBone=!0,this.type="Bone"}}class cs extends nr{constructor(e=null,n=1,i=1,r,a,s,o,l,c=ls,u=ls,f,h){super(null,s,o,l,c,u,r,a,f,h),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const hj=new Dt,l0e=new Dt;class Kv{constructor(e=[],n=[]){this.uuid=Ml(),this.bones=e.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,n=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),n.length===0)this.calculateInverses();else if(e.length!==n.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Dt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,n=this.bones.length;e<n;e++){const i=new Dt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,n=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let a=0,s=e.length;a<s;a++){const o=e[a]?e[a].matrixWorld:l0e;hj.multiplyMatrices(o,n[a]),hj.toArray(i,a*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Kv(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4);n.set(this.boneMatrices);const i=new cs(n,e,e,Qr,wr);return i.needsUpdate=!0,this.boneMatrices=n,this.boneTexture=i,this}getBoneByName(e){for(let n=0,i=this.bones.length;n<i;n++){const r=this.bones[n];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,n){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const a=e.bones[i];let s=n[a];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",a),s=new j_),this.bones.push(s),this.boneInverses.push(new Dt().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const n=this.bones,i=this.boneInverses;for(let r=0,a=n.length;r<a;r++){const s=n[r];e.bones.push(s.uuid);const o=i[r];e.boneInverses.push(o.toArray())}return e}}class pf extends In{constructor(e,n,i,r=1){super(e,n,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const db=new Dt,dj=new Dt,Cw=[],pj=new rr,c0e=new Dt,Xy=new _i,qy=new Ur;class $A extends _i{constructor(e,n,i){super(e,n),this.isInstancedMesh=!0,this.instanceMatrix=new pf(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,c0e)}computeBoundingBox(){const e=this.geometry,n=this.count;this.boundingBox===null&&(this.boundingBox=new rr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,db),pj.copy(e.boundingBox).applyMatrix4(db),this.boundingBox.union(pj)}computeBoundingSphere(){const e=this.geometry,n=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ur),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,db),qy.copy(e.boundingSphere).applyMatrix4(db),this.boundingSphere.union(qy)}copy(e,n){return super.copy(e,n),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,n){n.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,n){n.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,n){const i=n.morphTargetInfluences,r=this.morphTexture.source.data.data,a=i.length+1,s=e*a+1;for(let o=0;o<i.length;o++)i[o]=r[s+o]}raycast(e,n){const i=this.matrixWorld,r=this.count;if(Xy.geometry=this.geometry,Xy.material=this.material,Xy.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),qy.copy(this.boundingSphere),qy.applyMatrix4(i),e.ray.intersectsSphere(qy)!==!1))for(let a=0;a<r;a++){this.getMatrixAt(a,db),dj.multiplyMatrices(i,db),Xy.matrixWorld=dj,Xy.raycast(e,Cw);for(let s=0,o=Cw.length;s<o;s++){const l=Cw[s];l.instanceId=a,l.object=this,n.push(l)}Cw.length=0}}setColorAt(e,n){this.instanceColor===null&&(this.instanceColor=new pf(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),n.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,n){n.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,n){const i=n.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new cs(new Float32Array(r*this.count),r,this.count,Th,wr));const a=this.morphTexture.source.data.data;let s=0;for(let c=0;c<i.length;c++)s+=i[c];const o=this.geometry.morphTargetsRelative?1:1-s,l=r*e;a[l]=o,a.set(i,l+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Tk=new te,u0e=new te,f0e=new $n;class nu{constructor(e=new te(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Tk.subVectors(i,n).cross(u0e.subVectors(e,n)).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,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Tk),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:n.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>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,n){const i=n||f0e.getNormalMatrix(e),r=this.coplanarPoint(Tk).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(a),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 Rp=new Ur,h0e=new wt(.5,.5),Rw=new te;class tp{constructor(e=new nu,n=new nu,i=new nu,r=new nu,a=new nu,s=new nu){this.planes=[e,n,i,r,a,s]}set(e,n,i,r,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(i),o[3].copy(r),o[4].copy(a),o[5].copy(s),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=yl,i=!1){const r=this.planes,a=e.elements,s=a[0],o=a[1],l=a[2],c=a[3],u=a[4],f=a[5],h=a[6],d=a[7],g=a[8],b=a[9],y=a[10],p=a[11],x=a[12],_=a[13],w=a[14],M=a[15];if(r[0].setComponents(c-s,d-u,p-g,M-x).normalize(),r[1].setComponents(c+s,d+u,p+g,M+x).normalize(),r[2].setComponents(c+o,d+f,p+b,M+_).normalize(),r[3].setComponents(c-o,d-f,p-b,M-_).normalize(),i)r[4].setComponents(l,h,y,w).normalize(),r[5].setComponents(c-l,d-h,p-y,M-w).normalize();else if(r[4].setComponents(c-l,d-h,p-y,M-w).normalize(),n===yl)r[5].setComponents(c+l,d+h,p+y,M+w).normalize();else if(n===av)r[5].setComponents(l,h,y,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Rp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Rp.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Rp)}intersectsSprite(e){Rp.center.set(0,0,0);const n=h0e.distanceTo(e.center);return Rp.radius=.7071067811865476+n,Rp.applyMatrix4(e.matrixWorld),this.intersectsSphere(Rp)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let a=0;a<6;a++)if(n[a].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(Rw.x=r.normal.x>0?e.max.x:e.min.x,Rw.y=r.normal.y>0?e.max.y:e.min.y,Rw.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Rw)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Lu=new Dt,Pu=new tp;class ZA{constructor(){this.coordinateSystem=yl}intersectsObject(e,n){if(!n.isArrayCamera||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Pu.setFromProjectionMatrix(Lu,r.coordinateSystem,r.reversedDepth),Pu.intersectsObject(e))return!0}return!1}intersectsSprite(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Pu.setFromProjectionMatrix(Lu,r.coordinateSystem,r.reversedDepth),Pu.intersectsSprite(e))return!0}return!1}intersectsSphere(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Pu.setFromProjectionMatrix(Lu,r.coordinateSystem,r.reversedDepth),Pu.intersectsSphere(e))return!0}return!1}intersectsBox(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Pu.setFromProjectionMatrix(Lu,r.coordinateSystem,r.reversedDepth),Pu.intersectsBox(e))return!0}return!1}containsPoint(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Lu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Pu.setFromProjectionMatrix(Lu,r.coordinateSystem,r.reversedDepth),Pu.containsPoint(e))return!0}return!1}clone(){return new ZA}}function Ak(t,e){return t-e}function d0e(t,e){return t.z-e.z}function p0e(t,e){return e.z-t.z}class m0e{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,n,i,r){const a=this.pool,s=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];s.push(o),this.index++,o.start=e,o.count=n,o.z=i,o.index=r}reset(){this.list.length=0,this.index=0}}const Oo=new Dt,g0e=new Ut(1,1,1),mj=new tp,b0e=new ZA,kw=new rr,kp=new Ur,Ky=new te,gj=new te,v0e=new te,Ck=new m0e,Qs=new _i,Dw=[];function y0e(t,e,n=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const r=t.count;for(let a=0;a<r;a++)for(let s=0;s<i;s++)e.setComponent(a+n,s,t.getComponent(a,s))}else e.array.set(t.array,n*i);e.needsUpdate=!0}function Dp(t,e){if(t.constructor!==e.constructor){const n=Math.min(t.length,e.length);for(let i=0;i<n;i++)e[i]=t[i]}else{const n=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,n))}}let o$=class extends _i{constructor(e,n,i=n*2,r){super(new On,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=n,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4),i=new cs(n,e,e,Qr,wr);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Uint32Array(e*e),i=new cs(n,e,e,Wv,Ac);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Float32Array(e*e*4).fill(1),i=new cs(n,e,e,Qr,wr);i.colorSpace=bi.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const n=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const s=e.getAttribute(a),{array:o,itemSize:l,normalized:c}=s,u=new o.constructor(i*l),f=new In(u,l,c);n.setAttribute(a,f)}if(e.getIndex()!==null){const a=i>65535?new Uint32Array(r):new Uint16Array(r);n.setIndex(new In(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in n.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),a=n.getAttribute(i);if(r.itemSize!==a.itemSize||r.normalized!==a.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const n=this._instanceInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const n=this._geometryInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.boundingBox,n=this._instanceInfo;e.makeEmpty();for(let i=0,r=n.length;i<r;i++){if(n[i].active===!1)continue;const a=n[i].geometryIndex;this.getMatrixAt(i,Oo),this.getBoundingBoxAt(a,kw).applyMatrix4(Oo),e.union(kw)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ur);const e=this.boundingSphere,n=this._instanceInfo;e.makeEmpty();for(let i=0,r=n.length;i<r;i++){if(n[i].active===!1)continue;const a=n[i].geometryIndex;this.getMatrixAt(i,Oo),this.getBoundingSphereAt(a,kp).applyMatrix4(Oo),e.union(kp)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Ak),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const a=this._matricesTexture;Oo.identity().toArray(a.image.data,r*16),a.needsUpdate=!0;const s=this._colorsTexture;return s&&(g0e.toArray(s.image.data,r*4),s.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,n=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=n===-1?e.getAttribute("position").count:n;const s=e.getIndex();if(s!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?s.count:i),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Ak),l=this._availableGeometryIds.shift(),a[l]=r):(l=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(l,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,l}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const i=this.geometry,r=i.getIndex()!==null,a=i.getIndex(),s=n.getIndex(),o=this._geometryInfo[e];if(r&&s.count>o.reservedIndexCount||n.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=n.getAttribute("position").count;for(const u in i.attributes){const f=n.getAttribute(u),h=i.getAttribute(u);y0e(f,h,l);const d=f.itemSize;for(let g=f.count,b=c;g<b;g++){const y=l+g;for(let p=0;p<d;p++)h.setComponent(y,p,0)}h.needsUpdate=!0,h.addUpdateRange(l*d,c*d)}if(r){const u=o.indexStart,f=o.reservedIndexCount;o.indexCount=n.getIndex().count;for(let h=0;h<s.count;h++)a.setX(u+h,l+s.getX(h));for(let h=s.count,d=f;h<d;h++)a.setX(u+h,l);a.needsUpdate=!0,a.addUpdateRange(u,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,n.boundingBox!==null&&(o.boundingBox=n.boundingBox.clone()),o.boundingSphere=null,n.boundingSphere!==null&&(o.boundingSphere=n.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const n=this._geometryInfo;if(e>=n.length||n[e].active===!1)return this;const i=this._instanceInfo;for(let r=0,a=i.length;r<a;r++)i[r].active&&i[r].geometryIndex===e&&this.deleteInstance(r);return n[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,n=0;const i=this._geometryInfo,r=i.map((s,o)=>o).sort((s,o)=>i[s].vertexStart-i[o].vertexStart),a=this.geometry;for(let s=0,o=i.length;s<o;s++){const l=r[s],c=i[l];if(c.active!==!1){if(a.index!==null){if(c.indexStart!==n){const{indexStart:u,vertexStart:f,reservedIndexCount:h}=c,d=a.index,g=d.array,b=e-f;for(let y=u;y<u+h;y++)g[y]=g[y]+b;d.array.copyWithin(n,u,u+h),d.addUpdateRange(n,h),c.indexStart=n}n+=c.reservedIndexCount}if(c.vertexStart!==e){const{vertexStart:u,reservedVertexCount:f}=c,h=a.attributes;for(const d in h){const g=h[d],{array:b,itemSize:y}=g;b.copyWithin(e*y,u*y,(u+f)*y),g.addUpdateRange(e*y,f*y)}c.vertexStart=e}e+=c.reservedVertexCount,c.start=a.index?c.indexStart:c.vertexStart,this._nextIndexStart=a.index?c.indexStart+c.reservedIndexCount:0,this._nextVertexStart=c.vertexStart+c.reservedVertexCount}}return this}getBoundingBoxAt(e,n){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const a=new rr,s=i.index,o=i.attributes.position;for(let l=r.start,c=r.start+r.count;l<c;l++){let u=l;s&&(u=s.getX(u)),a.expandByPoint(Ky.fromBufferAttribute(o,u))}r.boundingBox=a}return n.copy(r.boundingBox),n}getBoundingSphereAt(e,n){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const a=new Ur;this.getBoundingBoxAt(e,kw),kw.getCenter(a.center);const s=i.index,o=i.attributes.position;let l=0;for(let c=r.start,u=r.start+r.count;c<u;c++){let f=c;s&&(f=s.getX(f)),Ky.fromBufferAttribute(o,f),l=Math.max(l,a.center.distanceToSquared(Ky))}a.radius=Math.sqrt(l),r.boundingSphere=a}return n.copy(r.boundingSphere),n}setMatrixAt(e,n){this.validateInstanceId(e);const i=this._matricesTexture,r=this._matricesTexture.image.data;return n.toArray(r,e*16),i.needsUpdate=!0,this}getMatrixAt(e,n){return this.validateInstanceId(e),n.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,n){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),n.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,n){return this.validateInstanceId(e),n.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,n){return this.validateInstanceId(e),this._instanceInfo[e].visible===n?this:(this._instanceInfo[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,n){return this.validateInstanceId(e),this.validateGeometryId(n),this._instanceInfo[e].geometryIndex=n,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,n={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return n.vertexStart=i.vertexStart,n.vertexCount=i.vertexCount,n.reservedVertexCount=i.reservedVertexCount,n.indexStart=i.indexStart,n.indexCount=i.indexCount,n.reservedIndexCount=i.reservedIndexCount,n.start=i.start,n.count=i.count,n}setInstanceCount(e){const n=this._availableInstanceIds,i=this._instanceInfo;for(n.sort(Ak);n[n.length-1]===i.length-1;)i.pop(),n.pop();if(e<i.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const r=new Int32Array(e),a=new Int32Array(e);Dp(this._multiDrawCounts,r),Dp(this._multiDrawStarts,a),this._multiDrawCounts=r,this._multiDrawStarts=a,this._maxInstanceCount=e;const s=this._indirectTexture,o=this._matricesTexture,l=this._colorsTexture;s.dispose(),this._initIndirectTexture(),Dp(s.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Dp(o.image.data,this._matricesTexture.image.data),l&&(l.dispose(),this._initColorsTexture(),Dp(l.image.data,this._colorsTexture.image.data))}setGeometrySize(e,n){const i=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${n}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>n)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${n}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new On,this._initializeGeometry(a));const s=this.geometry;a.index&&Dp(a.index.array,s.index.array);for(const o in a.attributes)Dp(a.attributes[o].array,s.attributes[o].array)}raycast(e,n){const i=this._instanceInfo,r=this._geometryInfo,a=this.matrixWorld,s=this.geometry;Qs.material=this.material,Qs.geometry.index=s.index,Qs.geometry.attributes=s.attributes,Qs.geometry.boundingBox===null&&(Qs.geometry.boundingBox=new rr),Qs.geometry.boundingSphere===null&&(Qs.geometry.boundingSphere=new Ur);for(let o=0,l=i.length;o<l;o++){if(!i[o].visible||!i[o].active)continue;const c=i[o].geometryIndex,u=r[c];Qs.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(o,Qs.matrixWorld).premultiply(a),this.getBoundingBoxAt(c,Qs.geometry.boundingBox),this.getBoundingSphereAt(c,Qs.geometry.boundingSphere),Qs.raycast(e,Dw);for(let f=0,h=Dw.length;f<h;f++){const d=Dw[f];d.object=this,d.batchId=o,n.push(d)}Dw.length=0}Qs.material=null,Qs.geometry.index=null,Qs.geometry.attributes={},Qs.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(n=>({...n,boundingBox:n.boundingBox!==null?n.boundingBox.clone():null,boundingSphere:n.boundingSphere!==null?n.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(n=>({...n})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,n,i,r,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=r.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,g=d.image.data,b=i.isArrayCamera?b0e:mj;h&&!i.isArrayCamera&&(Oo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),mj.setFromProjectionMatrix(Oo,i.coordinateSystem,i.reversedDepth));let y=0;if(this.sortObjects){Oo.copy(this.matrixWorld).invert(),Ky.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Oo),gj.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Oo);for(let _=0,w=l.length;_<w;_++)if(l[_].visible&&l[_].active){const M=l[_].geometryIndex;this.getMatrixAt(_,Oo),this.getBoundingSphereAt(M,kp).applyMatrix4(Oo);let S=!1;if(h&&(S=!b.intersectsSphere(kp,i)),!S){const A=f[M],C=v0e.subVectors(kp.center,Ky).dot(gj);Ck.push(A.start,A.count,C,_)}}const p=Ck.list,x=this.customSort;x===null?p.sort(a.transparent?p0e:d0e):x.call(this,p,i);for(let _=0,w=p.length;_<w;_++){const M=p[_];c[y]=M.start*o,u[y]=M.count,g[y]=M.index,y++}Ck.reset()}else for(let p=0,x=l.length;p<x;p++)if(l[p].visible&&l[p].active){const _=l[p].geometryIndex;let w=!1;if(h&&(this.getMatrixAt(p,Oo),this.getBoundingSphereAt(_,kp).applyMatrix4(Oo),w=!b.intersectsSphere(kp,i)),!w){const M=f[_];c[y]=M.start*o,u[y]=M.count,g[y]=p,y++}}d.needsUpdate=!0,this._multiDrawCount=y,this._visibilityChanged=!1}onBeforeShadow(e,n,i,r,a,s){this.onBeforeRender(e,null,r,a,s)}};class Us extends Oa{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ut(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Q2=new te,eT=new te,bj=new Dt,Yy=new xf,Ow=new Ur,Rk=new te,vj=new te;let yh=class extends Pi{constructor(e=new On,n=new Us){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[0];for(let r=1,a=n.count;r<a;r++)Q2.fromBufferAttribute(n,r-1),eT.fromBufferAttribute(n,r),i[r]=i[r-1],i[r]+=Q2.distanceTo(eT);e.setAttribute("lineDistance",new mn(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const i=this.geometry,r=this.matrixWorld,a=e.params.Line.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ow.copy(i.boundingSphere),Ow.applyMatrix4(r),Ow.radius+=a,e.ray.intersectsSphere(Ow)===!1)return;bj.copy(r).invert(),Yy.copy(e.ray).applyMatrix4(bj);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,u=i.index,h=i.attributes.position;if(u!==null){const d=Math.max(0,s.start),g=Math.min(u.count,s.start+s.count);for(let b=d,y=g-1;b<y;b+=c){const p=u.getX(b),x=u.getX(b+1),_=Iw(this,e,Yy,l,p,x,b);_&&n.push(_)}if(this.isLineLoop){const b=u.getX(g-1),y=u.getX(d),p=Iw(this,e,Yy,l,b,y,g-1);p&&n.push(p)}}else{const d=Math.max(0,s.start),g=Math.min(h.count,s.start+s.count);for(let b=d,y=g-1;b<y;b+=c){const p=Iw(this,e,Yy,l,b,b+1,b);p&&n.push(p)}if(this.isLineLoop){const b=Iw(this,e,Yy,l,g-1,d,g-1);b&&n.push(b)}}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=r.length;a<s;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}};function Iw(t,e,n,i,r,a,s){const o=t.geometry.attributes.position;if(Q2.fromBufferAttribute(o,r),eT.fromBufferAttribute(o,a),n.distanceSqToSegment(Q2,eT,Rk,vj)>i)return;Rk.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(Rk);if(!(c<e.near||c>e.far))return{distance:c,point:vj.clone().applyMatrix4(t.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:t}}const yj=new te,xj=new te;let Lc=class extends yh{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[];for(let r=0,a=n.count;r<a;r+=2)yj.fromBufferAttribute(n,r),xj.fromBufferAttribute(n,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+yj.distanceTo(xj);e.setAttribute("lineDistance",new mn(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}};class eU extends yh{constructor(e,n){super(e,n),this.isLineLoop=!0,this.type="LineLoop"}}class QA extends Oa{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ut(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const _j=new Dt,eI=new xf,Nw=new Ur,Lw=new te;class tU extends Pi{constructor(e=new On,n=new QA){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,n){const i=this.geometry,r=this.matrixWorld,a=e.params.Points.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Nw.copy(i.boundingSphere),Nw.applyMatrix4(r),Nw.radius+=a,e.ray.intersectsSphere(Nw)===!1)return;_j.copy(r).invert(),eI.copy(e.ray).applyMatrix4(_j);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=i.index,f=i.attributes.position;if(c!==null){const h=Math.max(0,s.start),d=Math.min(c.count,s.start+s.count);for(let g=h,b=d;g<b;g++){const y=c.getX(g);Lw.fromBufferAttribute(f,y),Sj(Lw,y,l,r,e,n,this)}}else{const h=Math.max(0,s.start),d=Math.min(f.count,s.start+s.count);for(let g=h,b=d;g<b;g++)Lw.fromBufferAttribute(f,g),Sj(Lw,g,l,r,e,n,this)}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=r.length;a<s;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function Sj(t,e,n,i,r,a,s){const o=eI.distanceSqToPoint(t);if(o<n){const l=new te;eI.closestPointToPoint(t,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;a.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class l$ extends nr{constructor(e,n,i,r,a=Vi,s=Vi,o,l,c){super(e,n,i,r,a,s,o,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const u=this;function f(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(f))}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)}dispose(){this._requestVideoFrameCallbackId!==0&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}}class x0e extends l${constructor(e,n,i,r,a,s,o,l){super({},e,n,i,r,a,s,o,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class _0e extends nr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=ls,this.minFilter=ls,this.generateMipmaps=!1,this.needsUpdate=!0}}class eC extends nr{constructor(e,n,i,r,a,s,o,l,c,u,f,h){super(null,s,o,l,c,u,r,a,f,h),this.isCompressedTexture=!0,this.image={width:n,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class S0e extends eC{constructor(e,n,i,r,a,s){super(e,n,i,a,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=_a,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class w0e extends eC{constructor(e,n,i){super(void 0,e[0].width,e[0].height,n,i,df),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class E0e extends nr{constructor(e,n,i,r,a,s,o,l,c){super(e,n,i,r,a,s,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class nU extends nr{constructor(e,n,i=Ac,r,a,s,o=ls,l=ls,c,u=tv,f=1){if(u!==tv&&u!==nv)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const h={width:e,height:n,depth:f};super(h,r,a,s,o,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Md(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class tC extends On{constructor(e=1,n=1,i=4,r=8,a=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:n,capSegments:i,radialSegments:r,heightSegments:a},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),a=Math.max(1,Math.floor(a));const s=[],o=[],l=[],c=[],u=n/2,f=Math.PI/2*e,h=n,d=2*f+h,g=i*2+a,b=r+1,y=new te,p=new te;for(let x=0;x<=g;x++){let _=0,w=0,M=0,S=0;if(x<=i){const k=x/i,R=k*Math.PI/2;w=-u-e*Math.cos(R),M=e*Math.sin(R),S=-e*Math.cos(R),_=k*f}else if(x<=i+a){const k=(x-i)/a;w=-u+k*n,M=e,S=0,_=f+k*h}else{const k=(x-i-a)/i,R=k*Math.PI/2;w=u+e*Math.sin(R),M=e*Math.cos(R),S=e*Math.sin(R),_=f+h+k*f}const A=Math.max(0,Math.min(1,_/d));let C=0;x===0?C=.5/r:x===g&&(C=-.5/r);for(let k=0;k<=r;k++){const R=k/r,N=R*Math.PI*2,P=Math.sin(N),j=Math.cos(N);p.x=-M*j,p.y=w,p.z=M*P,o.push(p.x,p.y,p.z),y.set(-M*j,S,M*P),y.normalize(),l.push(y.x,y.y,y.z),c.push(R+C,A)}if(x>0){const k=(x-1)*b;for(let R=0;R<r;R++){const N=k+R,P=k+R+1,j=x*b+R,z=x*b+R+1;s.push(N,P,j),s.push(P,z,j)}}}this.setIndex(s),this.setAttribute("position",new mn(o,3)),this.setAttribute("normal",new mn(l,3)),this.setAttribute("uv",new mn(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tC(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class nC extends On{constructor(e=1,n=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:n,thetaStart:i,thetaLength:r},n=Math.max(3,n);const a=[],s=[],o=[],l=[],c=new te,u=new wt;s.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let f=0,h=3;f<=n;f++,h+=3){const d=i+f/n*r;c.x=e*Math.cos(d),c.y=e*Math.sin(d),s.push(c.x,c.y,c.z),o.push(0,0,1),u.x=(s[h]/e+1)/2,u.y=(s[h+1]/e+1)/2,l.push(u.x,u.y)}for(let f=1;f<=n;f++)a.push(f,f+1,0);this.setIndex(a),this.setAttribute("position",new mn(s,3)),this.setAttribute("normal",new mn(o,3)),this.setAttribute("uv",new mn(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nC(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class qm extends On{constructor(e=1,n=1,i=1,r=32,a=1,s=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:i,radialSegments:r,heightSegments:a,openEnded:s,thetaStart:o,thetaLength:l};const c=this;r=Math.floor(r),a=Math.floor(a);const u=[],f=[],h=[],d=[];let g=0;const b=[],y=i/2;let p=0;x(),s===!1&&(e>0&&_(!0),n>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new mn(f,3)),this.setAttribute("normal",new mn(h,3)),this.setAttribute("uv",new mn(d,2));function x(){const w=new te,M=new te;let S=0;const A=(n-e)/i;for(let C=0;C<=a;C++){const k=[],R=C/a,N=R*(n-e)+e;for(let P=0;P<=r;P++){const j=P/r,z=j*l+o,X=Math.sin(z),F=Math.cos(z);M.x=N*X,M.y=-R*i+y,M.z=N*F,f.push(M.x,M.y,M.z),w.set(X,A,F).normalize(),h.push(w.x,w.y,w.z),d.push(j,1-R),k.push(g++)}b.push(k)}for(let C=0;C<r;C++)for(let k=0;k<a;k++){const R=b[k][C],N=b[k+1][C],P=b[k+1][C+1],j=b[k][C+1];(e>0||k!==0)&&(u.push(R,N,j),S+=3),(n>0||k!==a-1)&&(u.push(N,P,j),S+=3)}c.addGroup(p,S,0),p+=S}function _(w){const M=g,S=new wt,A=new te;let C=0;const k=w===!0?e:n,R=w===!0?1:-1;for(let P=1;P<=r;P++)f.push(0,y*R,0),h.push(0,R,0),d.push(.5,.5),g++;const N=g;for(let P=0;P<=r;P++){const z=P/r*l+o,X=Math.cos(z),F=Math.sin(z);A.x=k*F,A.y=y*R,A.z=k*X,f.push(A.x,A.y,A.z),h.push(0,R,0),S.x=X*.5+.5,S.y=F*.5*R+.5,d.push(S.x,S.y),g++}for(let P=0;P<r;P++){const j=M+P,z=N+P;w===!0?u.push(z,z+1,j):u.push(z+1,z,j),C+=3}c.addGroup(p,C,w===!0?1:2),p+=C}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qm(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class H_ extends qm{constructor(e=1,n=1,i=32,r=1,a=!1,s=0,o=Math.PI*2){super(0,e,n,i,r,a,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:s,thetaLength:o}}static fromJSON(e){return new H_(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class np extends On{constructor(e=[],n=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:n,radius:i,detail:r};const a=[],s=[];o(r),c(i),u(),this.setAttribute("position",new mn(a,3)),this.setAttribute("normal",new mn(a.slice(),3)),this.setAttribute("uv",new mn(s,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(x){const _=new te,w=new te,M=new te;for(let S=0;S<n.length;S+=3)d(n[S+0],_),d(n[S+1],w),d(n[S+2],M),l(_,w,M,x)}function l(x,_,w,M){const S=M+1,A=[];for(let C=0;C<=S;C++){A[C]=[];const k=x.clone().lerp(w,C/S),R=_.clone().lerp(w,C/S),N=S-C;for(let P=0;P<=N;P++)P===0&&C===S?A[C][P]=k:A[C][P]=k.clone().lerp(R,P/N)}for(let C=0;C<S;C++)for(let k=0;k<2*(S-C)-1;k++){const R=Math.floor(k/2);k%2===0?(h(A[C][R+1]),h(A[C+1][R]),h(A[C][R])):(h(A[C][R+1]),h(A[C+1][R+1]),h(A[C+1][R]))}}function c(x){const _=new te;for(let w=0;w<a.length;w+=3)_.x=a[w+0],_.y=a[w+1],_.z=a[w+2],_.normalize().multiplyScalar(x),a[w+0]=_.x,a[w+1]=_.y,a[w+2]=_.z}function u(){const x=new te;for(let _=0;_<a.length;_+=3){x.x=a[_+0],x.y=a[_+1],x.z=a[_+2];const w=y(x)/2/Math.PI+.5,M=p(x)/Math.PI+.5;s.push(w,1-M)}g(),f()}function f(){for(let x=0;x<s.length;x+=6){const _=s[x+0],w=s[x+2],M=s[x+4],S=Math.max(_,w,M),A=Math.min(_,w,M);S>.9&&A<.1&&(_<.2&&(s[x+0]+=1),w<.2&&(s[x+2]+=1),M<.2&&(s[x+4]+=1))}}function h(x){a.push(x.x,x.y,x.z)}function d(x,_){const w=x*3;_.x=e[w+0],_.y=e[w+1],_.z=e[w+2]}function g(){const x=new te,_=new te,w=new te,M=new te,S=new wt,A=new wt,C=new wt;for(let k=0,R=0;k<a.length;k+=9,R+=6){x.set(a[k+0],a[k+1],a[k+2]),_.set(a[k+3],a[k+4],a[k+5]),w.set(a[k+6],a[k+7],a[k+8]),S.set(s[R+0],s[R+1]),A.set(s[R+2],s[R+3]),C.set(s[R+4],s[R+5]),M.copy(x).add(_).add(w).divideScalar(3);const N=y(M);b(S,R+0,x,N),b(A,R+2,_,N),b(C,R+4,w,N)}}function b(x,_,w,M){M<0&&x.x===1&&(s[_]=x.x-1),w.x===0&&w.z===0&&(s[_]=M/2/Math.PI+.5)}function y(x){return Math.atan2(x.z,-x.x)}function p(x){return Math.atan2(-x.y,Math.sqrt(x.x*x.x+x.z*x.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new np(e.vertices,e.indices,e.radius,e.details)}}class iC extends np{constructor(e=1,n=0){const i=(1+Math.sqrt(5))/2,r=1/i,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],s=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(a,s,e,n),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new iC(e.radius,e.detail)}}const Pw=new te,Uw=new te,kk=new te,Fw=new Bo;class c$ extends On{constructor(e=null,n=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:n},e!==null){const r=Math.pow(10,4),a=Math.cos(Im*n),s=e.getIndex(),o=e.getAttribute("position"),l=s?s.count:o.count,c=[0,0,0],u=["a","b","c"],f=new Array(3),h={},d=[];for(let g=0;g<l;g+=3){s?(c[0]=s.getX(g),c[1]=s.getX(g+1),c[2]=s.getX(g+2)):(c[0]=g,c[1]=g+1,c[2]=g+2);const{a:b,b:y,c:p}=Fw;if(b.fromBufferAttribute(o,c[0]),y.fromBufferAttribute(o,c[1]),p.fromBufferAttribute(o,c[2]),Fw.getNormal(kk),f[0]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,f[1]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,f[2]=`${Math.round(p.x*r)},${Math.round(p.y*r)},${Math.round(p.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let x=0;x<3;x++){const _=(x+1)%3,w=f[x],M=f[_],S=Fw[u[x]],A=Fw[u[_]],C=`${w}_${M}`,k=`${M}_${w}`;k in h&&h[k]?(kk.dot(h[k].normal)<=a&&(d.push(S.x,S.y,S.z),d.push(A.x,A.y,A.z)),h[k]=null):C in h||(h[C]={index0:c[x],index1:c[_],normal:kk.clone()})}}for(const g in h)if(h[g]){const{index0:b,index1:y}=h[g];Pw.fromBufferAttribute(o,b),Uw.fromBufferAttribute(o,y),d.push(Pw.x,Pw.y,Pw.z),d.push(Uw.x,Uw.y,Uw.z)}this.setAttribute("position",new mn(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Au{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,n){const i=this.getUtoTmapping(e);return this.getPoint(i,n)}getPoints(e=5){const n=[];for(let i=0;i<=e;i++)n.push(this.getPoint(i/e));return n}getSpacedPoints(e=5){const n=[];for(let i=0;i<=e;i++)n.push(this.getPointAt(i/e));return n}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 n=[];let i,r=this.getPoint(0),a=0;n.push(0);for(let s=1;s<=e;s++)i=this.getPoint(s/e),a+=i.distanceTo(r),n.push(a),r=i;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n=null){const i=this.getLengths();let r=0;const a=i.length;let s;n?s=n:s=e*i[a-1];let o=0,l=a-1,c;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),c=i[r]-s,c<0)o=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===s)return r/(a-1);const u=i[r],h=i[r+1]-u,d=(s-u)/h;return(r+d)/(a-1)}getTangent(e,n){let r=e-1e-4,a=e+1e-4;r<0&&(r=0),a>1&&(a=1);const s=this.getPoint(r),o=this.getPoint(a),l=n||(s.isVector2?new wt:new te);return l.copy(o).sub(s).normalize(),l}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new te,r=[],a=[],s=[],o=new te,l=new Dt;for(let d=0;d<=e;d++){const g=d/e;r[d]=this.getTangentAt(g,new te)}a[0]=new te,s[0]=new te;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),f=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),h<=c&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),a[0].crossVectors(r[0],o),s[0].crossVectors(r[0],a[0]);for(let d=1;d<=e;d++){if(a[d]=a[d-1].clone(),s[d]=s[d-1].clone(),o.crossVectors(r[d-1],r[d]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(Pn(r[d-1].dot(r[d]),-1,1));a[d].applyMatrix4(l.makeRotationAxis(o,g))}s[d].crossVectors(r[d],a[d])}if(n===!0){let d=Math.acos(Pn(a[0].dot(a[e]),-1,1));d/=e,r[0].dot(o.crossVectors(a[0],a[e]))>0&&(d=-d);for(let g=1;g<=e;g++)a[g].applyMatrix4(l.makeRotationAxis(r[g],d*g)),s[g].crossVectors(r[g],a[g])}return{tangents:r,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class rC extends Au{constructor(e=0,n=0,i=1,r=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(e,n=new wt){const i=n,r=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(s?a=0:a=r),this.aClockwise===!0&&!s&&(a===r?a=-r:a=a-r);const o=this.aStartAngle+e*a;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const u=Math.cos(this.aRotation),f=Math.sin(this.aRotation),h=l-this.aX,d=c-this.aY;l=h*u-d*f+this.aX,c=h*f+d*u+this.aY}return i.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class u$ extends rC{constructor(e,n,i,r,a,s){super(e,n,i,i,r,a,s),this.isArcCurve=!0,this.type="ArcCurve"}}function iU(){let t=0,e=0,n=0,i=0;function r(a,s,o,l){t=a,e=o,n=-3*a+3*s-2*o-l,i=2*a-2*s+o+l}return{initCatmullRom:function(a,s,o,l,c){r(s,o,c*(o-a),c*(l-s))},initNonuniformCatmullRom:function(a,s,o,l,c,u,f){let h=(s-a)/c-(o-a)/(c+u)+(o-s)/u,d=(o-s)/u-(l-s)/(u+f)+(l-o)/f;h*=u,d*=u,r(s,o,h,d)},calc:function(a){const s=a*a,o=s*a;return t+e*a+n*s+i*o}}}const Bw=new te,Dk=new iU,Ok=new iU,Ik=new iU;class rU extends Au{constructor(e=[],n=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=n,this.curveType=i,this.tension=r}getPoint(e,n=new te){const i=n,r=this.points,a=r.length,s=(a-(this.closed?0:1))*e;let o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let c,u;this.closed||o>0?c=r[(o-1)%a]:(Bw.subVectors(r[0],r[1]).add(r[0]),c=Bw);const f=r[o%a],h=r[(o+1)%a];if(this.closed||o+2<a?u=r[(o+2)%a]:(Bw.subVectors(r[a-1],r[a-2]).add(r[a-1]),u=Bw),this.curveType==="centripetal"||this.curveType==="chordal"){const d=this.curveType==="chordal"?.5:.25;let g=Math.pow(c.distanceToSquared(f),d),b=Math.pow(f.distanceToSquared(h),d),y=Math.pow(h.distanceToSquared(u),d);b<1e-4&&(b=1),g<1e-4&&(g=b),y<1e-4&&(y=b),Dk.initNonuniformCatmullRom(c.x,f.x,h.x,u.x,g,b,y),Ok.initNonuniformCatmullRom(c.y,f.y,h.y,u.y,g,b,y),Ik.initNonuniformCatmullRom(c.z,f.z,h.z,u.z,g,b,y)}else this.curveType==="catmullrom"&&(Dk.initCatmullRom(c.x,f.x,h.x,u.x,this.tension),Ok.initCatmullRom(c.y,f.y,h.y,u.y,this.tension),Ik.initCatmullRom(c.z,f.z,h.z,u.z,this.tension));return i.set(Dk.calc(l),Ok.calc(l),Ik.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,i=this.points.length;n<i;n++){const r=this.points[n];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(new te().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function wj(t,e,n,i,r){const a=(i-e)*.5,s=(r-n)*.5,o=t*t,l=t*o;return(2*n-2*i+a+s)*l+(-3*n+3*i-2*a-s)*o+a*t+n}function M0e(t,e){const n=1-t;return n*n*e}function T0e(t,e){return 2*(1-t)*t*e}function A0e(t,e){return t*t*e}function s1(t,e,n,i){return M0e(t,e)+T0e(t,n)+A0e(t,i)}function C0e(t,e){const n=1-t;return n*n*n*e}function R0e(t,e){const n=1-t;return 3*n*n*t*e}function k0e(t,e){return 3*(1-t)*t*t*e}function D0e(t,e){return t*t*t*e}function o1(t,e,n,i,r){return C0e(t,e)+R0e(t,n)+k0e(t,i)+D0e(t,r)}class aU extends Au{constructor(e=new wt,n=new wt,i=new wt,r=new wt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=n,this.v2=i,this.v3=r}getPoint(e,n=new wt){const i=n,r=this.v0,a=this.v1,s=this.v2,o=this.v3;return i.set(o1(e,r.x,a.x,s.x,o.x),o1(e,r.y,a.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class sU extends Au{constructor(e=new te,n=new te,i=new te,r=new te){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=n,this.v2=i,this.v3=r}getPoint(e,n=new te){const i=n,r=this.v0,a=this.v1,s=this.v2,o=this.v3;return i.set(o1(e,r.x,a.x,s.x,o.x),o1(e,r.y,a.y,s.y,o.y),o1(e,r.z,a.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class oU extends Au{constructor(e=new wt,n=new wt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=n}getPoint(e,n=new wt){const i=n;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new wt){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class f$ extends Au{constructor(e=new te,n=new te){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=n}getPoint(e,n=new te){const i=n;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new te){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class lU extends Au{constructor(e=new wt,n=new wt,i=new wt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=n,this.v2=i}getPoint(e,n=new wt){const i=n,r=this.v0,a=this.v1,s=this.v2;return i.set(s1(e,r.x,a.x,s.x),s1(e,r.y,a.y,s.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class cU extends Au{constructor(e=new te,n=new te,i=new te){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=n,this.v2=i}getPoint(e,n=new te){const i=n,r=this.v0,a=this.v1,s=this.v2;return i.set(s1(e,r.x,a.x,s.x),s1(e,r.y,a.y,s.y),s1(e,r.z,a.z,s.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uU extends Au{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,n=new wt){const i=n,r=this.points,a=(r.length-1)*e,s=Math.floor(a),o=a-s,l=r[s===0?s:s-1],c=r[s],u=r[s>r.length-2?r.length-1:s+1],f=r[s>r.length-3?r.length-1:s+2];return i.set(wj(o,l.x,c.x,u.x,f.x),wj(o,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,i=this.points.length;n<i;n++){const r=this.points[n];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(new wt().fromArray(r))}return this}}var tT=Object.freeze({__proto__:null,ArcCurve:u$,CatmullRomCurve3:rU,CubicBezierCurve:aU,CubicBezierCurve3:sU,EllipseCurve:rC,LineCurve:oU,LineCurve3:f$,QuadraticBezierCurve:lU,QuadraticBezierCurve3:cU,SplineCurve:uU});class h$ extends Au{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(n)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new tT[i](n,e))}return this}getPoint(e,n){const i=e*this.getLength(),r=this.getCurveLengths();let a=0;for(;a<r.length;){if(r[a]>=i){const s=r[a]-i,o=this.curves[a],l=o.getLength(),c=l===0?0:1-s/l;return o.getPointAt(c,n)}a++}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 n=0;for(let i=0,r=this.curves.length;i<r;i++)n+=this.curves[i].getLength(),e.push(n);return this.cacheLengths=e,e}getSpacedPoints(e=40){const n=[];for(let i=0;i<=e;i++)n.push(this.getPoint(i/e));return this.autoClose&&n.push(n[0]),n}getPoints(e=12){const n=[];let i;for(let r=0,a=this.curves;r<a.length;r++){const s=a[r],o=s.isEllipseCurve?e*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,l=s.getPoints(o);for(let c=0;c<l.length;c++){const u=l[c];i&&i.equals(u)||(n.push(u),i=u)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n<i;n++){const r=e.curves[n];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let n=0,i=this.curves.length;n<i;n++){const r=this.curves[n];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let n=0,i=e.curves.length;n<i;n++){const r=e.curves[n];this.curves.push(new tT[r.type]().fromJSON(r))}return this}}class nT extends h${constructor(e){super(),this.type="Path",this.currentPoint=new wt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let n=1,i=e.length;n<i;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){return this.currentPoint.set(e,n),this}lineTo(e,n){const i=new oU(this.currentPoint.clone(),new wt(e,n));return this.curves.push(i),this.currentPoint.set(e,n),this}quadraticCurveTo(e,n,i,r){const a=new lU(this.currentPoint.clone(),new wt(e,n),new wt(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this}bezierCurveTo(e,n,i,r,a,s){const o=new aU(this.currentPoint.clone(),new wt(e,n),new wt(i,r),new wt(a,s));return this.curves.push(o),this.currentPoint.set(a,s),this}splineThru(e){const n=[this.currentPoint.clone()].concat(e),i=new uU(n);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,n,i,r,a,s){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,n+l,i,r,a,s),this}absarc(e,n,i,r,a,s){return this.absellipse(e,n,i,i,r,a,s),this}ellipse(e,n,i,r,a,s,o,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,n+u,i,r,a,s,o,l),this}absellipse(e,n,i,r,a,s,o,l){const c=new rC(e,n,i,r,a,s,o,l);if(this.curves.length>0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),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 Nm extends nT{constructor(e){super(e),this.uuid=Ml(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,r=this.holes.length;i<r;i++)n[i]=this.holes[i].getPoints(e);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let n=0,i=e.holes.length;n<i;n++){const r=e.holes[n];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let n=0,i=this.holes.length;n<i;n++){const r=this.holes[n];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let n=0,i=e.holes.length;n<i;n++){const r=e.holes[n];this.holes.push(new nT().fromJSON(r))}return this}}function O0e(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let a=d$(t,0,r,n,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,c;if(i&&(a=U0e(t,e,a,n)),t.length>80*n){o=1/0,l=1/0;let u=-1/0,f=-1/0;for(let h=n;h<r;h+=n){const d=t[h],g=t[h+1];d<o&&(o=d),g<l&&(l=g),d>u&&(u=d),g>f&&(f=g)}c=Math.max(u-o,f-l),c=c!==0?32767/c:0}return K1(a,s,n,o,l,c,0),s}function d$(t,e,n,i,r){let a;if(r===K0e(t,e,n,i)>0)for(let s=e;s<n;s+=i)a=Ej(s/i|0,t[s],t[s+1],a);else for(let s=n-i;s>=e;s-=i)a=Ej(s/i|0,t[s],t[s+1],a);return a&&uv(a,a.next)&&(J1(a),a=a.next),a}function Km(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(uv(n,n.next)||oa(n.prev,n,n.next)===0)){if(J1(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function K1(t,e,n,i,r,a,s){if(!t)return;!s&&a&&H0e(t,i,r,a);let o=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?N0e(t,i,r,a):I0e(t)){e.push(l.i,t.i,c.i),J1(t),t=c.next,o=c.next;continue}if(t=c,t===o){s?s===1?(t=L0e(Km(t),e),K1(t,e,n,i,r,a,2)):s===2&&P0e(t,e,n,i,r,a):K1(Km(t),e,n,i,r,a,1);break}}}function I0e(t){const e=t.prev,n=t,i=t.next;if(oa(e,n,i)>=0)return!1;const r=e.x,a=n.x,s=i.x,o=e.y,l=n.y,c=i.y,u=Math.min(r,a,s),f=Math.min(o,l,c),h=Math.max(r,a,s),d=Math.max(o,l,c);let g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=h&&g.y>=f&&g.y<=d&&Cx(r,o,a,l,s,c,g.x,g.y)&&oa(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function N0e(t,e,n,i){const r=t.prev,a=t,s=t.next;if(oa(r,a,s)>=0)return!1;const o=r.x,l=a.x,c=s.x,u=r.y,f=a.y,h=s.y,d=Math.min(o,l,c),g=Math.min(u,f,h),b=Math.max(o,l,c),y=Math.max(u,f,h),p=tI(d,g,e,n,i),x=tI(b,y,e,n,i);let _=t.prevZ,w=t.nextZ;for(;_&&_.z>=p&&w&&w.z<=x;){if(_.x>=d&&_.x<=b&&_.y>=g&&_.y<=y&&_!==r&&_!==s&&Cx(o,u,l,f,c,h,_.x,_.y)&&oa(_.prev,_,_.next)>=0||(_=_.prevZ,w.x>=d&&w.x<=b&&w.y>=g&&w.y<=y&&w!==r&&w!==s&&Cx(o,u,l,f,c,h,w.x,w.y)&&oa(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;_&&_.z>=p;){if(_.x>=d&&_.x<=b&&_.y>=g&&_.y<=y&&_!==r&&_!==s&&Cx(o,u,l,f,c,h,_.x,_.y)&&oa(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=x;){if(w.x>=d&&w.x<=b&&w.y>=g&&w.y<=y&&w!==r&&w!==s&&Cx(o,u,l,f,c,h,w.x,w.y)&&oa(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function L0e(t,e){let n=t;do{const i=n.prev,r=n.next.next;!uv(i,r)&&m$(i,n,n.next,r)&&Y1(i,r)&&Y1(r,i)&&(e.push(i.i,n.i,r.i),J1(n),J1(n.next),n=t=r),n=n.next}while(n!==t);return Km(n)}function P0e(t,e,n,i,r,a){let s=t;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&W0e(s,o)){let l=g$(s,o);s=Km(s,s.next),l=Km(l,l.next),K1(s,e,n,i,r,a,0),K1(l,e,n,i,r,a,0);return}o=o.next}s=s.next}while(s!==t)}function U0e(t,e,n,i){const r=[];for(let a=0,s=e.length;a<s;a++){const o=e[a]*i,l=a<s-1?e[a+1]*i:t.length,c=d$(t,o,l,i,!1);c===c.next&&(c.steiner=!0),r.push(G0e(c))}r.sort(F0e);for(let a=0;a<r.length;a++)n=B0e(r[a],n);return n}function F0e(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=i-r}return n}function B0e(t,e){const n=z0e(t,e);if(!n)return e;const i=g$(n,t);return Km(i,i.next),Km(n,n.next)}function z0e(t,e){let n=e;const i=t.x,r=t.y;let a=-1/0,s;if(uv(t,n))return n;do{if(uv(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const f=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=i&&f>a&&(a=f,s=n.x<n.next.x?n:n.next,f===i))return s}n=n.next}while(n!==e);if(!s)return null;const o=s,l=s.x,c=s.y;let u=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&p$(r<c?i:a,r,l,c,r<c?a:i,r,n.x,n.y)){const f=Math.abs(r-n.y)/(i-n.x);Y1(n,t)&&(f<u||f===u&&(n.x>s.x||n.x===s.x&&j0e(s,n)))&&(s=n,u=f)}n=n.next}while(n!==o);return s}function j0e(t,e){return oa(t.prev,t,e.prev)<0&&oa(e.next,t,t.next)<0}function H0e(t,e,n,i){let r=t;do r.z===0&&(r.z=tI(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,V0e(r)}function V0e(t){let e,n=1;do{let i=t,r;t=null;let a=null;for(e=0;i;){e++;let s=i,o=0;for(let c=0;c<n&&(o++,s=s.nextZ,!!s);c++);let l=n;for(;o>0||l>0&&s;)o!==0&&(l===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;i=s}a.nextZ=null,n*=2}while(e>1);return t}function tI(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function G0e(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function p$(t,e,n,i,r,a,s,o){return(r-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(i-o)>=(n-s)*(e-o)&&(n-s)*(a-o)>=(r-s)*(i-o)}function Cx(t,e,n,i,r,a,s,o){return!(t===s&&e===o)&&p$(t,e,n,i,r,a,s,o)}function W0e(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!X0e(t,e)&&(Y1(t,e)&&Y1(e,t)&&q0e(t,e)&&(oa(t.prev,t,e.prev)||oa(t,e.prev,e))||uv(t,e)&&oa(t.prev,t,t.next)>0&&oa(e.prev,e,e.next)>0)}function oa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function uv(t,e){return t.x===e.x&&t.y===e.y}function m$(t,e,n,i){const r=jw(oa(t,e,n)),a=jw(oa(t,e,i)),s=jw(oa(n,i,t)),o=jw(oa(n,i,e));return!!(r!==a&&s!==o||r===0&&zw(t,n,e)||a===0&&zw(t,i,e)||s===0&&zw(n,t,i)||o===0&&zw(n,e,i))}function zw(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function jw(t){return t>0?1:t<0?-1:0}function X0e(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&m$(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Y1(t,e){return oa(t.prev,t,t.next)<0?oa(t,e,t.next)>=0&&oa(t,t.prev,e)>=0:oa(t,e,t.prev)<0||oa(t,t.next,e)<0}function q0e(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,a=(t.y+e.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function g$(t,e){const n=nI(t.i,t.x,t.y),i=nI(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function Ej(t,e,n,i){const r=nI(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function J1(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function nI(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function K0e(t,e,n,i){let r=0;for(let a=e,s=n-i;a<n;a+=i)r+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return r}class Y0e{static triangulate(e,n,i=2){return O0e(e,n,i)}}class du{static area(e){const n=e.length;let i=0;for(let r=n-1,a=0;a<n;r=a++)i+=e[r].x*e[a].y-e[a].x*e[r].y;return i*.5}static isClockWise(e){return du.area(e)<0}static triangulateShape(e,n){const i=[],r=[],a=[];Mj(e),Tj(i,e);let s=e.length;n.forEach(Mj);for(let l=0;l<n.length;l++)r.push(s),s+=n[l].length,Tj(i,n[l]);const o=Y0e.triangulate(i,r);for(let l=0;l<o.length;l+=3)a.push(o.slice(l,l+3));return a}}function Mj(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Tj(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class aC extends On{constructor(e=new Nm([new wt(.5,.5),new wt(-.5,.5),new wt(-.5,-.5),new wt(.5,-.5)]),n={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:n},e=Array.isArray(e)?e:[e];const i=this,r=[],a=[];for(let o=0,l=e.length;o<l;o++){const c=e[o];s(c)}this.setAttribute("position",new mn(r,3)),this.setAttribute("uv",new mn(a,2)),this.computeVertexNormals();function s(o){const l=[],c=n.curveSegments!==void 0?n.curveSegments:12,u=n.steps!==void 0?n.steps:1,f=n.depth!==void 0?n.depth:1;let h=n.bevelEnabled!==void 0?n.bevelEnabled:!0,d=n.bevelThickness!==void 0?n.bevelThickness:.2,g=n.bevelSize!==void 0?n.bevelSize:d-.1,b=n.bevelOffset!==void 0?n.bevelOffset:0,y=n.bevelSegments!==void 0?n.bevelSegments:3;const p=n.extrudePath,x=n.UVGenerator!==void 0?n.UVGenerator:J0e;let _,w=!1,M,S,A,C;p&&(_=p.getSpacedPoints(u),w=!0,h=!1,M=p.computeFrenetFrames(u,!1),S=new te,A=new te,C=new te),h||(y=0,d=0,g=0,b=0);const k=o.extractPoints(c);let R=k.shape;const N=k.holes;if(!du.isClockWise(R)){R=R.reverse();for(let ze=0,Ie=N.length;ze<Ie;ze++){const Xe=N[ze];du.isClockWise(Xe)&&(N[ze]=Xe.reverse())}}function j(ze){const Xe=10000000000000001e-36;let we=ze[0];for(let Ae=1;Ae<=ze.length;Ae++){const Re=Ae%ze.length,Ne=ze[Re],Fe=Ne.x-we.x,Qe=Ne.y-we.y,ae=Fe*Fe+Qe*Qe,K=Math.max(Math.abs(Ne.x),Math.abs(Ne.y),Math.abs(we.x),Math.abs(we.y)),ce=Xe*K*K;if(ae<=ce){ze.splice(Re,1),Ae--;continue}we=Ne}}j(R),N.forEach(j);const z=N.length,X=R;for(let ze=0;ze<z;ze++){const Ie=N[ze];R=R.concat(Ie)}function F(ze,Ie,Xe){return Ie||console.error("THREE.ExtrudeGeometry: vec does not exist"),ze.clone().addScaledVector(Ie,Xe)}const H=R.length;function V(ze,Ie,Xe){let we,Ae,Re;const Ne=ze.x-Ie.x,Fe=ze.y-Ie.y,Qe=Xe.x-ze.x,ae=Xe.y-ze.y,K=Ne*Ne+Fe*Fe,ce=Ne*ae-Fe*Qe;if(Math.abs(ce)>Number.EPSILON){const he=Math.sqrt(K),me=Math.sqrt(Qe*Qe+ae*ae),$=Ie.x-Fe/he,Ve=Ie.y+Ne/he,qe=Xe.x-ae/me,mt=Xe.y+Qe/me,Ge=((qe-$)*ae-(mt-Ve)*Qe)/(Ne*ae-Fe*Qe);we=$+Ne*Ge-ze.x,Ae=Ve+Fe*Ge-ze.y;const Je=we*we+Ae*Ae;if(Je<=2)return new wt(we,Ae);Re=Math.sqrt(Je/2)}else{let he=!1;Ne>Number.EPSILON?Qe>Number.EPSILON&&(he=!0):Ne<-Number.EPSILON?Qe<-Number.EPSILON&&(he=!0):Math.sign(Fe)===Math.sign(ae)&&(he=!0),he?(we=-Fe,Ae=Ne,Re=Math.sqrt(K)):(we=Ne,Ae=Fe,Re=Math.sqrt(K/2))}return new wt(we/Re,Ae/Re)}const W=[];for(let ze=0,Ie=X.length,Xe=Ie-1,we=ze+1;ze<Ie;ze++,Xe++,we++)Xe===Ie&&(Xe=0),we===Ie&&(we=0),W[ze]=V(X[ze],X[Xe],X[we]);const B=[];let Y,Z=W.concat();for(let ze=0,Ie=z;ze<Ie;ze++){const Xe=N[ze];Y=[];for(let we=0,Ae=Xe.length,Re=Ae-1,Ne=we+1;we<Ae;we++,Re++,Ne++)Re===Ae&&(Re=0),Ne===Ae&&(Ne=0),Y[we]=V(Xe[we],Xe[Re],Xe[Ne]);B.push(Y),Z=Z.concat(Y)}let G;if(y===0)G=du.triangulateShape(X,N);else{const ze=[],Ie=[];for(let Xe=0;Xe<y;Xe++){const we=Xe/y,Ae=d*Math.cos(we*Math.PI/2),Re=g*Math.sin(we*Math.PI/2)+b;for(let Ne=0,Fe=X.length;Ne<Fe;Ne++){const Qe=F(X[Ne],W[Ne],Re);Te(Qe.x,Qe.y,-Ae),we===0&&ze.push(Qe)}for(let Ne=0,Fe=z;Ne<Fe;Ne++){const Qe=N[Ne];Y=B[Ne];const ae=[];for(let K=0,ce=Qe.length;K<ce;K++){const he=F(Qe[K],Y[K],Re);Te(he.x,he.y,-Ae),we===0&&ae.push(he)}we===0&&Ie.push(ae)}}G=du.triangulateShape(ze,Ie)}const de=G.length,oe=g+b;for(let ze=0;ze<H;ze++){const Ie=h?F(R[ze],Z[ze],oe):R[ze];w?(A.copy(M.normals[0]).multiplyScalar(Ie.x),S.copy(M.binormals[0]).multiplyScalar(Ie.y),C.copy(_[0]).add(A).add(S),Te(C.x,C.y,C.z)):Te(Ie.x,Ie.y,0)}for(let ze=1;ze<=u;ze++)for(let Ie=0;Ie<H;Ie++){const Xe=h?F(R[Ie],Z[Ie],oe):R[Ie];w?(A.copy(M.normals[ze]).multiplyScalar(Xe.x),S.copy(M.binormals[ze]).multiplyScalar(Xe.y),C.copy(_[ze]).add(A).add(S),Te(C.x,C.y,C.z)):Te(Xe.x,Xe.y,f/u*ze)}for(let ze=y-1;ze>=0;ze--){const Ie=ze/y,Xe=d*Math.cos(Ie*Math.PI/2),we=g*Math.sin(Ie*Math.PI/2)+b;for(let Ae=0,Re=X.length;Ae<Re;Ae++){const Ne=F(X[Ae],W[Ae],we);Te(Ne.x,Ne.y,f+Xe)}for(let Ae=0,Re=N.length;Ae<Re;Ae++){const Ne=N[Ae];Y=B[Ae];for(let Fe=0,Qe=Ne.length;Fe<Qe;Fe++){const ae=F(Ne[Fe],Y[Fe],we);w?Te(ae.x,ae.y+_[u-1].y,_[u-1].x+Xe):Te(ae.x,ae.y,f+Xe)}}}le(),ue();function le(){const ze=r.length/3;if(h){let Ie=0,Xe=H*Ie;for(let we=0;we<de;we++){const Ae=G[we];Pe(Ae[2]+Xe,Ae[1]+Xe,Ae[0]+Xe)}Ie=u+y*2,Xe=H*Ie;for(let we=0;we<de;we++){const Ae=G[we];Pe(Ae[0]+Xe,Ae[1]+Xe,Ae[2]+Xe)}}else{for(let Ie=0;Ie<de;Ie++){const Xe=G[Ie];Pe(Xe[2],Xe[1],Xe[0])}for(let Ie=0;Ie<de;Ie++){const Xe=G[Ie];Pe(Xe[0]+H*u,Xe[1]+H*u,Xe[2]+H*u)}}i.addGroup(ze,r.length/3-ze,0)}function ue(){const ze=r.length/3;let Ie=0;Se(X,Ie),Ie+=X.length;for(let Xe=0,we=N.length;Xe<we;Xe++){const Ae=N[Xe];Se(Ae,Ie),Ie+=Ae.length}i.addGroup(ze,r.length/3-ze,1)}function Se(ze,Ie){let Xe=ze.length;for(;--Xe>=0;){const we=Xe;let Ae=Xe-1;Ae<0&&(Ae=ze.length-1);for(let Re=0,Ne=u+y*2;Re<Ne;Re++){const Fe=H*Re,Qe=H*(Re+1),ae=Ie+we+Fe,K=Ie+Ae+Fe,ce=Ie+Ae+Qe,he=Ie+we+Qe;je(ae,K,ce,he)}}}function Te(ze,Ie,Xe){l.push(ze),l.push(Ie),l.push(Xe)}function Pe(ze,Ie,Xe){He(ze),He(Ie),He(Xe);const we=r.length/3,Ae=x.generateTopUV(i,r,we-3,we-2,we-1);pe(Ae[0]),pe(Ae[1]),pe(Ae[2])}function je(ze,Ie,Xe,we){He(ze),He(Ie),He(we),He(Ie),He(Xe),He(we);const Ae=r.length/3,Re=x.generateSideWallUV(i,r,Ae-6,Ae-3,Ae-2,Ae-1);pe(Re[0]),pe(Re[1]),pe(Re[3]),pe(Re[1]),pe(Re[2]),pe(Re[3])}function He(ze){r.push(l[ze*3+0]),r.push(l[ze*3+1]),r.push(l[ze*3+2])}function pe(ze){a.push(ze.x),a.push(ze.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes,i=this.parameters.options;return $0e(n,i,e)}static fromJSON(e,n){const i=[];for(let a=0,s=e.shapes.length;a<s;a++){const o=n[e.shapes[a]];i.push(o)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new tT[r.type]().fromJSON(r)),new aC(i,e.options)}}const J0e={generateTopUV:function(t,e,n,i,r){const a=e[n*3],s=e[n*3+1],o=e[i*3],l=e[i*3+1],c=e[r*3],u=e[r*3+1];return[new wt(a,s),new wt(o,l),new wt(c,u)]},generateSideWallUV:function(t,e,n,i,r,a){const s=e[n*3],o=e[n*3+1],l=e[n*3+2],c=e[i*3],u=e[i*3+1],f=e[i*3+2],h=e[r*3],d=e[r*3+1],g=e[r*3+2],b=e[a*3],y=e[a*3+1],p=e[a*3+2];return Math.abs(o-u)<Math.abs(s-c)?[new wt(s,1-l),new wt(c,1-f),new wt(h,1-g),new wt(b,1-p)]:[new wt(o,1-l),new wt(u,1-f),new wt(d,1-g),new wt(y,1-p)]}};function $0e(t,e,n){if(n.shapes=[],Array.isArray(t))for(let i=0,r=t.length;i<r;i++){const a=t[i];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return n.options=Object.assign({},e),e.extrudePath!==void 0&&(n.options.extrudePath=e.extrudePath.toJSON()),n}class Yv extends np{constructor(e=1,n=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,a,e,n),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new Yv(e.radius,e.detail)}}class sC extends On{constructor(e=[new wt(0,-.5),new wt(.5,0),new wt(0,.5)],n=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:i,phiLength:r},n=Math.floor(n),r=Pn(r,0,Math.PI*2);const a=[],s=[],o=[],l=[],c=[],u=1/n,f=new te,h=new wt,d=new te,g=new te,b=new te;let y=0,p=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:y=e[x+1].x-e[x].x,p=e[x+1].y-e[x].y,d.x=p*1,d.y=-y,d.z=p*0,b.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(b.x,b.y,b.z);break;default:y=e[x+1].x-e[x].x,p=e[x+1].y-e[x].y,d.x=p*1,d.y=-y,d.z=p*0,g.copy(d),d.x+=b.x,d.y+=b.y,d.z+=b.z,d.normalize(),l.push(d.x,d.y,d.z),b.copy(g)}for(let x=0;x<=n;x++){const _=i+x*u*r,w=Math.sin(_),M=Math.cos(_);for(let S=0;S<=e.length-1;S++){f.x=e[S].x*w,f.y=e[S].y,f.z=e[S].x*M,s.push(f.x,f.y,f.z),h.x=x/n,h.y=S/(e.length-1),o.push(h.x,h.y);const A=l[3*S+0]*w,C=l[3*S+1],k=l[3*S+0]*M;c.push(A,C,k)}}for(let x=0;x<n;x++)for(let _=0;_<e.length-1;_++){const w=_+x*e.length,M=w,S=w+e.length,A=w+e.length+1,C=w+1;a.push(M,S,C),a.push(A,C,S)}this.setIndex(a),this.setAttribute("position",new mn(s,3)),this.setAttribute("uv",new mn(o,2)),this.setAttribute("normal",new mn(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sC(e.points,e.segments,e.phiStart,e.phiLength)}}class V_ extends np{constructor(e=1,n=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,n),this.type="OctahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new V_(e.radius,e.detail)}}class Il extends On{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const a=e/2,s=n/2,o=Math.floor(i),l=Math.floor(r),c=o+1,u=l+1,f=e/o,h=n/l,d=[],g=[],b=[],y=[];for(let p=0;p<u;p++){const x=p*h-s;for(let _=0;_<c;_++){const w=_*f-a;g.push(w,-x,0),b.push(0,0,1),y.push(_/o),y.push(1-p/l)}}for(let p=0;p<l;p++)for(let x=0;x<o;x++){const _=x+c*p,w=x+c*(p+1),M=x+1+c*(p+1),S=x+1+c*p;d.push(_,w,S),d.push(w,M,S)}this.setIndex(d),this.setAttribute("position",new mn(g,3)),this.setAttribute("normal",new mn(b,3)),this.setAttribute("uv",new mn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Il(e.width,e.height,e.widthSegments,e.heightSegments)}}class oC extends On{constructor(e=.5,n=1,i=32,r=1,a=0,s=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:n,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:s},i=Math.max(3,i),r=Math.max(1,r);const o=[],l=[],c=[],u=[];let f=e;const h=(n-e)/r,d=new te,g=new wt;for(let b=0;b<=r;b++){for(let y=0;y<=i;y++){const p=a+y/i*s;d.x=f*Math.cos(p),d.y=f*Math.sin(p),l.push(d.x,d.y,d.z),c.push(0,0,1),g.x=(d.x/n+1)/2,g.y=(d.y/n+1)/2,u.push(g.x,g.y)}f+=h}for(let b=0;b<r;b++){const y=b*(i+1);for(let p=0;p<i;p++){const x=p+y,_=x,w=x+i+1,M=x+i+2,S=x+1;o.push(_,w,S),o.push(w,M,S)}}this.setIndex(o),this.setAttribute("position",new mn(l,3)),this.setAttribute("normal",new mn(c,3)),this.setAttribute("uv",new mn(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new oC(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class lC extends On{constructor(e=new Nm([new wt(0,.5),new wt(-.5,-.5),new wt(.5,-.5)]),n=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:n};const i=[],r=[],a=[],s=[];let o=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let u=0;u<e.length;u++)c(e[u]),this.addGroup(o,l,u),o+=l,l=0;this.setIndex(i),this.setAttribute("position",new mn(r,3)),this.setAttribute("normal",new mn(a,3)),this.setAttribute("uv",new mn(s,2));function c(u){const f=r.length/3,h=u.extractPoints(n);let d=h.shape;const g=h.holes;du.isClockWise(d)===!1&&(d=d.reverse());for(let y=0,p=g.length;y<p;y++){const x=g[y];du.isClockWise(x)===!0&&(g[y]=x.reverse())}const b=du.triangulateShape(d,g);for(let y=0,p=g.length;y<p;y++){const x=g[y];d=d.concat(x)}for(let y=0,p=d.length;y<p;y++){const x=d[y];r.push(x.x,x.y,0),a.push(0,0,1),s.push(x.x,x.y)}for(let y=0,p=b.length;y<p;y++){const x=b[y],_=x[0]+f,w=x[1]+f,M=x[2]+f;i.push(_,w,M),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes;return Z0e(n,e)}static fromJSON(e,n){const i=[];for(let r=0,a=e.shapes.length;r<a;r++){const s=n[e.shapes[r]];i.push(s)}return new lC(i,e.curveSegments)}}function Z0e(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,i=t.length;n<i;n++){const r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}class Jv extends On{constructor(e=1,n=32,i=16,r=0,a=Math.PI*2,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:n,heightSegments:i,phiStart:r,phiLength:a,thetaStart:s,thetaLength:o},n=Math.max(3,Math.floor(n)),i=Math.max(2,Math.floor(i));const l=Math.min(s+o,Math.PI);let c=0;const u=[],f=new te,h=new te,d=[],g=[],b=[],y=[];for(let p=0;p<=i;p++){const x=[],_=p/i;let w=0;p===0&&s===0?w=.5/n:p===i&&l===Math.PI&&(w=-.5/n);for(let M=0;M<=n;M++){const S=M/n;f.x=-e*Math.cos(r+S*a)*Math.sin(s+_*o),f.y=e*Math.cos(s+_*o),f.z=e*Math.sin(r+S*a)*Math.sin(s+_*o),g.push(f.x,f.y,f.z),h.copy(f).normalize(),b.push(h.x,h.y,h.z),y.push(S+w,1-_),x.push(c++)}u.push(x)}for(let p=0;p<i;p++)for(let x=0;x<n;x++){const _=u[p][x+1],w=u[p][x],M=u[p+1][x],S=u[p+1][x+1];(p!==0||s>0)&&d.push(_,w,S),(p!==i-1||l<Math.PI)&&d.push(w,M,S)}this.setIndex(d),this.setAttribute("position",new mn(g,3)),this.setAttribute("normal",new mn(b,3)),this.setAttribute("uv",new mn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jv(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class cC extends np{constructor(e=1,n=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,n),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new cC(e.radius,e.detail)}}class uC extends On{constructor(e=1,n=.4,i=12,r=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:n,radialSegments:i,tubularSegments:r,arc:a},i=Math.floor(i),r=Math.floor(r);const s=[],o=[],l=[],c=[],u=new te,f=new te,h=new te;for(let d=0;d<=i;d++)for(let g=0;g<=r;g++){const b=g/r*a,y=d/i*Math.PI*2;f.x=(e+n*Math.cos(y))*Math.cos(b),f.y=(e+n*Math.cos(y))*Math.sin(b),f.z=n*Math.sin(y),o.push(f.x,f.y,f.z),u.x=e*Math.cos(b),u.y=e*Math.sin(b),h.subVectors(f,u).normalize(),l.push(h.x,h.y,h.z),c.push(g/r),c.push(d/i)}for(let d=1;d<=i;d++)for(let g=1;g<=r;g++){const b=(r+1)*d+g-1,y=(r+1)*(d-1)+g-1,p=(r+1)*(d-1)+g,x=(r+1)*d+g;s.push(b,y,x),s.push(y,p,x)}this.setIndex(s),this.setAttribute("position",new mn(o,3)),this.setAttribute("normal",new mn(l,3)),this.setAttribute("uv",new mn(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new uC(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class fC extends On{constructor(e=1,n=.4,i=64,r=8,a=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:n,tubularSegments:i,radialSegments:r,p:a,q:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],c=[],u=[],f=new te,h=new te,d=new te,g=new te,b=new te,y=new te,p=new te;for(let _=0;_<=i;++_){const w=_/i*a*Math.PI*2;x(w,a,s,e,d),x(w+.01,a,s,e,g),y.subVectors(g,d),p.addVectors(g,d),b.crossVectors(y,p),p.crossVectors(b,y),b.normalize(),p.normalize();for(let M=0;M<=r;++M){const S=M/r*Math.PI*2,A=-n*Math.cos(S),C=n*Math.sin(S);f.x=d.x+(A*p.x+C*b.x),f.y=d.y+(A*p.y+C*b.y),f.z=d.z+(A*p.z+C*b.z),l.push(f.x,f.y,f.z),h.subVectors(f,d).normalize(),c.push(h.x,h.y,h.z),u.push(_/i),u.push(M/r)}}for(let _=1;_<=i;_++)for(let w=1;w<=r;w++){const M=(r+1)*(_-1)+(w-1),S=(r+1)*_+(w-1),A=(r+1)*_+w,C=(r+1)*(_-1)+w;o.push(M,S,C),o.push(S,A,C)}this.setIndex(o),this.setAttribute("position",new mn(l,3)),this.setAttribute("normal",new mn(c,3)),this.setAttribute("uv",new mn(u,2));function x(_,w,M,S,A){const C=Math.cos(_),k=Math.sin(_),R=M/w*_,N=Math.cos(R);A.x=S*(2+N)*.5*C,A.y=S*(2+N)*k*.5,A.z=S*Math.sin(R)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fC(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class hC extends On{constructor(e=new cU(new te(-1,-1,0),new te(-1,1,0),new te(1,1,0)),n=64,i=1,r=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:n,radius:i,radialSegments:r,closed:a};const s=e.computeFrenetFrames(n,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new te,l=new te,c=new wt;let u=new te;const f=[],h=[],d=[],g=[];b(),this.setIndex(g),this.setAttribute("position",new mn(f,3)),this.setAttribute("normal",new mn(h,3)),this.setAttribute("uv",new mn(d,2));function b(){for(let _=0;_<n;_++)y(_);y(a===!1?n:0),x(),p()}function y(_){u=e.getPointAt(_/n,u);const w=s.normals[_],M=s.binormals[_];for(let S=0;S<=r;S++){const A=S/r*Math.PI*2,C=Math.sin(A),k=-Math.cos(A);l.x=k*w.x+C*M.x,l.y=k*w.y+C*M.y,l.z=k*w.z+C*M.z,l.normalize(),h.push(l.x,l.y,l.z),o.x=u.x+i*l.x,o.y=u.y+i*l.y,o.z=u.z+i*l.z,f.push(o.x,o.y,o.z)}}function p(){for(let _=1;_<=n;_++)for(let w=1;w<=r;w++){const M=(r+1)*(_-1)+(w-1),S=(r+1)*_+(w-1),A=(r+1)*_+w,C=(r+1)*(_-1)+w;g.push(M,S,C),g.push(S,A,C)}}function x(){for(let _=0;_<=n;_++)for(let w=0;w<=r;w++)c.x=_/n,c.y=w/r,d.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new hC(new tT[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class fU extends On{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const n=[],i=new Set,r=new te,a=new te;if(e.index!==null){const s=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,u=l.length;c<u;++c){const f=l[c],h=f.start,d=f.count;for(let g=h,b=h+d;g<b;g+=3)for(let y=0;y<3;y++){const p=o.getX(g+y),x=o.getX(g+(y+1)%3);r.fromBufferAttribute(s,p),a.fromBufferAttribute(s,x),Aj(r,a,i)===!0&&(n.push(r.x,r.y,r.z),n.push(a.x,a.y,a.z))}}}else{const s=e.attributes.position;for(let o=0,l=s.count/3;o<l;o++)for(let c=0;c<3;c++){const u=3*o+c,f=3*o+(c+1)%3;r.fromBufferAttribute(s,u),a.fromBufferAttribute(s,f),Aj(r,a,i)===!0&&(n.push(r.x,r.y,r.z),n.push(a.x,a.y,a.z))}}this.setAttribute("position",new mn(n,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Aj(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return n.has(i)===!0||n.has(r)===!0?!1:(n.add(i),n.add(r),!0)}var Cj=Object.freeze({__proto__:null,BoxGeometry:ep,CapsuleGeometry:tC,CircleGeometry:nC,ConeGeometry:H_,CylinderGeometry:qm,DodecahedronGeometry:iC,EdgesGeometry:c$,ExtrudeGeometry:aC,IcosahedronGeometry:Yv,LatheGeometry:sC,OctahedronGeometry:V_,PlaneGeometry:Il,PolyhedronGeometry:np,RingGeometry:oC,ShapeGeometry:lC,SphereGeometry:Jv,TetrahedronGeometry:cC,TorusGeometry:uC,TorusKnotGeometry:fC,TubeGeometry:hC,WireframeGeometry:fU});class dg extends Oa{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ut(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class b$ extends fs{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class $v extends Oa{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ut(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new vi,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Pc extends $v{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new wt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Pn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ut(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ut(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ut(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class v$ extends Oa{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ut(16777215),this.specular=new Ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new vi,this.combine=U_,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 iT extends Oa{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ut(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qd,this.normalScale=new wt(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 y$ extends Oa{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qd,this.normalScale=new wt(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 x$ extends Oa{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new vi,this.combine=U_,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 dC extends Oa{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=HJ,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 pC extends Oa{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class _$ extends Oa{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ut(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Qd,this.normalScale=new wt(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 S$ extends Us{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 mm(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function w$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function E$(t){function e(r,a){return t[r]-t[a]}const n=t.length,i=new Array(n);for(let r=0;r!==n;++r)i[r]=r;return i.sort(e),i}function iI(t,e,n){const i=t.length,r=new t.constructor(i);for(let a=0,s=0;s!==i;++a){const o=n[a]*e;for(let l=0;l!==e;++l)r[s++]=t[o+l]}return r}function hU(t,e,n,i){let r=1,a=t[0];for(;a!==void 0&&a[i]===void 0;)a=t[r++];if(a===void 0)return;let s=a[i];if(s!==void 0)if(Array.isArray(s))do s=a[i],s!==void 0&&(e.push(a.time),n.push(...s)),a=t[r++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[i],s!==void 0&&(e.push(a.time),s.toArray(n,n.length)),a=t[r++];while(a!==void 0);else do s=a[i],s!==void 0&&(e.push(a.time),n.push(s)),a=t[r++];while(a!==void 0)}function Q0e(t,e,n,i,r=30){const a=t.clone();a.name=e;const s=[];for(let l=0;l<a.tracks.length;++l){const c=a.tracks[l],u=c.getValueSize(),f=[],h=[];for(let d=0;d<c.times.length;++d){const g=c.times[d]*r;if(!(g<n||g>=i)){f.push(c.times[d]);for(let b=0;b<u;++b)h.push(c.values[d*u+b])}}f.length!==0&&(c.times=mm(f,c.times.constructor),c.values=mm(h,c.values.constructor),s.push(c))}a.tracks=s;let o=1/0;for(let l=0;l<a.tracks.length;++l)o>a.tracks[l].times[0]&&(o=a.tracks[l].times[0]);for(let l=0;l<a.tracks.length;++l)a.tracks[l].shift(-1*o);return a.resetDuration(),a}function eve(t,e=0,n=t,i=30){i<=0&&(i=30);const r=n.tracks.length,a=e/i;for(let s=0;s<r;++s){const o=n.tracks[s],l=o.ValueTypeName;if(l==="bool"||l==="string")continue;const c=t.tracks.find(function(p){return p.name===o.name&&p.ValueTypeName===l});if(c===void 0)continue;let u=0;const f=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=f/3);let h=0;const d=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);const g=o.times.length-1;let b;if(a<=o.times[0]){const p=u,x=f-u;b=o.values.slice(p,x)}else if(a>=o.times[g]){const p=g*f+u,x=p+f-u;b=o.values.slice(p,x)}else{const p=o.createInterpolant(),x=u,_=f-u;p.evaluate(a),b=p.resultBuffer.slice(x,_)}l==="quaternion"&&new Xn().fromArray(b).normalize().conjugate().toArray(b);const y=c.times.length;for(let p=0;p<y;++p){const x=p*d+h;if(l==="quaternion")Xn.multiplyQuaternionsFlat(c.values,x,b,0,c.values,x);else{const _=d-h*2;for(let w=0;w<_;++w)c.values[x+w]-=b[w]}}}return t.blendMode=GP,t}class tve{static convertArray(e,n){return mm(e,n)}static isTypedArray(e){return w$(e)}static getKeyframeOrder(e){return E$(e)}static sortedArray(e,n,i){return iI(e,n,i)}static flattenJSON(e,n,i,r){hU(e,n,i,r)}static subclip(e,n,i,r,a=30){return Q0e(e,n,i,r,a)}static makeClipAdditive(e,n=0,i=e,r=30){return eve(e,n,i,r)}}class Zv{constructor(e,n,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new n.constructor(i),this.sampleValues=n,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let i=this._cachedIndex,r=n[i],a=n[i-1];e:{t:{let s;n:{i:if(!(e<r)){for(let o=i+2;;){if(r===void 0){if(e<a)break i;return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(a=r,r=n[++i],e<r)break t}s=n.length;break n}if(!(e>=a)){const o=n[1];e<o&&(i=2,a=o);for(let l=i-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=a,a=n[--i-1],e>=a)break t}s=i,i=0;break n}break e}for(;i<s;){const o=i+s>>>1;e<n[o]?s=o:i=o+1}if(r=n[i],a=n[i-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,a,r)}return this.interpolate_(i,a,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const n=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r;for(let s=0;s!==r;++s)n[s]=i[a+s];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class M$ extends Zv{constructor(e,n,i,r){super(e,n,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hm,endingEnd:hm}}intervalChanged_(e,n,i){const r=this.parameterPositions;let a=e-2,s=e+1,o=r[a],l=r[s];if(o===void 0)switch(this.getSettings_().endingStart){case dm:a=e,o=2*n-i;break;case V1:a=r.length-2,o=n+r[a]-r[a+1];break;default:a=e,o=i}if(l===void 0)switch(this.getSettings_().endingEnd){case dm:s=e,l=2*i-n;break;case V1:s=1,l=i+r[1]-r[0];break;default:s=e-1,l=n}const c=(i-n)*.5,u=this.valueSize;this._weightPrev=c/(n-o),this._weightNext=c/(l-i),this._offsetPrev=a*u,this._offsetNext=s*u}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=this._offsetPrev,f=this._offsetNext,h=this._weightPrev,d=this._weightNext,g=(i-n)/(r-n),b=g*g,y=b*g,p=-h*y+2*h*b-h*g,x=(1+h)*y+(-1.5-2*h)*b+(-.5+h)*g+1,_=(-1-d)*y+(1.5+d)*b+.5*g,w=d*y-d*b;for(let M=0;M!==o;++M)a[M]=p*s[u+M]+x*s[c+M]+_*s[l+M]+w*s[f+M];return a}}class dU extends Zv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=(i-n)/(r-n),f=1-u;for(let h=0;h!==o;++h)a[h]=s[c+h]*f+s[l+h]*u;return a}}class T$ extends Zv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Uc{constructor(e,n,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=mm(n,this.TimeBufferType),this.values=mm(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const n=e.constructor;let i;if(n.toJSON!==this.toJSON)i=n.toJSON(e);else{i={name:e.name,times:mm(e.times,Array),values:mm(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new T$(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new dU(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new M$(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case iv:n=this.InterpolantFactoryMethodDiscrete;break;case rv:n=this.InterpolantFactoryMethodLinear;break;case hM:n=this.InterpolantFactoryMethodSmooth;break}if(n===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return iv;case this.InterpolantFactoryMethodLinear:return rv;case this.InterpolantFactoryMethodSmooth:return hM}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const n=this.times;for(let i=0,r=n.length;i!==r;++i)n[i]+=e}return this}scale(e){if(e!==1){const n=this.times;for(let i=0,r=n.length;i!==r;++i)n[i]*=e}return this}trim(e,n){const i=this.times,r=i.length;let a=0,s=r-1;for(;a!==r&&i[a]<e;)++a;for(;s!==-1&&i[s]>n;)--s;if(++s,a!==0||s!==r){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=i.slice(a,s),this.values=this.values.slice(a*o,s*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,a=i.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const l=i[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),e=!1;break}s=l}if(r!==void 0&&w$(r))for(let o=0,l=r.length;o!==l;++o){const c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===hM,a=e.length-1;let s=1;for(let o=1;o<a;++o){let l=!1;const c=e[o],u=e[o+1];if(c!==u&&(o!==1||c!==e[0]))if(r)l=!0;else{const f=o*i,h=f-i,d=f+i;for(let g=0;g!==i;++g){const b=n[f+g];if(b!==n[h+g]||b!==n[d+g]){l=!0;break}}}if(l){if(o!==s){e[s]=e[o];const f=o*i,h=s*i;for(let d=0;d!==i;++d)n[h+d]=n[f+d]}++s}}if(a>0){e[s]=e[a];for(let o=a*i,l=s*i,c=0;c!==i;++c)n[l+c]=n[o+c];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*i)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),i=this.constructor,r=new i(this.name,e,n);return r.createInterpolant=this.createInterpolant,r}}Uc.prototype.ValueTypeName="";Uc.prototype.TimeBufferType=Float32Array;Uc.prototype.ValueBufferType=Float32Array;Uc.prototype.DefaultInterpolation=rv;class pg extends Uc{constructor(e,n,i){super(e,n,i)}}pg.prototype.ValueTypeName="bool";pg.prototype.ValueBufferType=Array;pg.prototype.DefaultInterpolation=iv;pg.prototype.InterpolantFactoryMethodLinear=void 0;pg.prototype.InterpolantFactoryMethodSmooth=void 0;class pU extends Uc{constructor(e,n,i,r){super(e,n,i,r)}}pU.prototype.ValueTypeName="color";class Ym extends Uc{constructor(e,n,i,r){super(e,n,i,r)}}Ym.prototype.ValueTypeName="number";class A$ extends Zv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(i-n)/(r-n);let c=e*o;for(let u=c+o;c!==u;c+=4)Xn.slerpFlat(a,0,s,c-o,s,c,l);return a}}class Jm extends Uc{constructor(e,n,i,r){super(e,n,i,r)}InterpolantFactoryMethodLinear(e){return new A$(this.times,this.values,this.getValueSize(),e)}}Jm.prototype.ValueTypeName="quaternion";Jm.prototype.InterpolantFactoryMethodSmooth=void 0;class mg extends Uc{constructor(e,n,i){super(e,n,i)}}mg.prototype.ValueTypeName="string";mg.prototype.ValueBufferType=Array;mg.prototype.DefaultInterpolation=iv;mg.prototype.InterpolantFactoryMethodLinear=void 0;mg.prototype.InterpolantFactoryMethodSmooth=void 0;class $m extends Uc{constructor(e,n,i,r){super(e,n,i,r)}}$m.prototype.ValueTypeName="vector";class fv{constructor(e="",n=-1,i=[],r=GA){this.name=e,this.tracks=i,this.duration=n,this.blendMode=r,this.uuid=Ml(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],i=e.tracks,r=1/(e.fps||1);for(let s=0,o=i.length;s!==o;++s)n.push(ive(i[s]).scale(r));const a=new this(e.name,e.duration,n,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const n=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,s=i.length;a!==s;++a)n.push(Uc.toJSON(i[a]));return r}static CreateFromMorphTargetSequence(e,n,i,r){const a=n.length,s=[];for(let o=0;o<a;o++){let l=[],c=[];l.push((o+a-1)%a,o,(o+1)%a),c.push(0,1,0);const u=E$(l);l=iI(l,1,u),c=iI(c,1,u),!r&&l[0]===0&&(l.push(a),c.push(c[0])),s.push(new Ym(".morphTargetInfluences["+n[o].name+"]",l,c).scale(1/i))}return new this(e,-1,s)}static findByName(e,n){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===n)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,n,i){const r={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],u=c.name.match(a);if(u&&u.length>1){const f=u[1];let h=r[f];h||(r[f]=h=[]),h.push(c)}}const s=[];for(const o in r)s.push(this.CreateFromMorphTargetSequence(o,r[o],n,i));return s}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,g,b){if(d.length!==0){const y=[],p=[];hU(d,y,p,g),y.length!==0&&b.push(new f(h,y,p))}},r=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f<c.length;f++){const h=c[f].keys;if(!(!h||h.length===0))if(h[0].morphTargets){const d={};let g;for(g=0;g<h.length;g++)if(h[g].morphTargets)for(let b=0;b<h[g].morphTargets.length;b++)d[h[g].morphTargets[b]]=-1;for(const b in d){const y=[],p=[];for(let x=0;x!==h[g].morphTargets.length;++x){const _=h[g];y.push(_.time),p.push(_.morphTarget===b?1:0)}r.push(new Ym(".morphTargetInfluence["+b+"]",y,p))}l=d.length*s}else{const d=".bones["+n[f].name+"]";i($m,d+".position",h,"pos",r),i(Jm,d+".quaternion",h,"rot",r),i($m,d+".scale",h,"scl",r)}}return r.length===0?null:new this(a,l,r,o)}resetDuration(){const e=this.tracks;let n=0;for(let i=0,r=e.length;i!==r;++i){const a=this.tracks[i];n=Math.max(n,a.times[a.times.length-1])}return this.duration=n,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let n=0;n<this.tracks.length;n++)e=e&&this.tracks[n].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function nve(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ym;case"vector":case"vector2":case"vector3":case"vector4":return $m;case"color":return pU;case"quaternion":return Jm;case"bool":case"boolean":return pg;case"string":return mg}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function ive(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=nve(t.type);if(t.times===void 0){const n=[],i=[];hU(t.keys,n,i,"value"),t.times=n,t.values=i}return e.parse!==void 0?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Ju={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class mC{constructor(e,n,i){const r=this;let a=!1,s=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=i,this.abortController=new AbortController,this.itemStart=function(u){o++,a===!1&&r.onStart!==void 0&&r.onStart(u,s,o),a=!0},this.itemEnd=function(u){s++,r.onProgress!==void 0&&r.onProgress(u,s,o),s===o&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,f){return c.push(u,f),this},this.removeHandler=function(u){const f=c.indexOf(u);return f!==-1&&c.splice(f,2),this},this.getHandler=function(u){for(let f=0,h=c.length;f<h;f+=2){const d=c[f],g=c[f+1];if(d.global&&(d.lastIndex=0),d.test(u))return g}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}const C$=new mC;class Fs{constructor(e){this.manager=e!==void 0?e:C$,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const i=this;return new Promise(function(r,a){i.load(e,r,n,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Fs.DEFAULT_MATERIAL_NAME="__DEFAULT";const zf={};class rve extends Error{constructor(e,n){super(e),this.response=n}}class Ns extends Fs{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,n,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=Ju.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(a),this.manager.itemEnd(e)},0),a;if(zf[e]!==void 0){zf[e].push({onLoad:n,onProgress:i,onError:r});return}zf[e]=[],zf[e].push({onLoad:n,onProgress:i,onError:r});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=zf[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=h?parseInt(h):0,g=d!==0;let b=0;const y=new ReadableStream({start(p){x();function x(){f.read().then(({done:_,value:w})=>{if(_)p.close();else{b+=w.byteLength;const M=new ProgressEvent("progress",{lengthComputable:g,loaded:b,total:d});for(let S=0,A=u.length;S<A;S++){const C=u[S];C.onProgress&&C.onProgress(M)}p.enqueue(w),x()}},_=>{p.error(_)})}}});return new Response(y)}else throw new rve(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,o));case"json":return c.json();default:if(o==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),h=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(h);return c.arrayBuffer().then(g=>d.decode(g))}}}).then(c=>{Ju.add(`file:${e}`,c);const u=zf[e];delete zf[e];for(let f=0,h=u.length;f<h;f++){const d=u[f];d.onLoad&&d.onLoad(c)}}).catch(c=>{const u=zf[e];if(u===void 0)throw this.manager.itemError(e),c;delete zf[e];for(let f=0,h=u.length;f<h;f++){const d=u[f];d.onError&&d.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class ave extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new Ns(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),a.manager.itemError(e)}},i,r)}parse(e){const n=[];for(let i=0;i<e.length;i++){const r=fv.parse(e[i]);n.push(r)}return n}}class sve extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=[],o=new eC,l=new Ns(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(a.withCredentials);let c=0;function u(f){l.load(e[f],function(h){const d=a.parse(h,!0);s[f]={width:d.width,height:d.height,format:d.format,mipmaps:d.mipmaps},c+=1,c===6&&(d.mipmapCount===1&&(o.minFilter=Vi),o.image=s,o.format=d.format,o.needsUpdate=!0,n&&n(o))},i,r)}if(Array.isArray(e))for(let f=0,h=e.length;f<h;++f)u(f);else l.load(e,function(f){const h=a.parse(f,!0);if(h.isCubemap){const d=h.mipmaps.length/h.mipmapCount;for(let g=0;g<d;g++){s[g]={mipmaps:[]};for(let b=0;b<h.mipmapCount;b++)s[g].mipmaps.push(h.mipmaps[g*h.mipmapCount+b]),s[g].format=h.format,s[g].width=h.width,s[g].height=h.height}o.image=s}else o.image.width=h.width,o.image.height=h.height,o.mipmaps=h.mipmaps;h.mipmapCount===1&&(o.minFilter=Vi),o.format=h.format,o.needsUpdate=!0,n&&n(o)},i,r);return o}}const pb=new WeakMap;class $1 extends Fs{constructor(e){super(e)}load(e,n,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=Ju.get(`image:${e}`);if(s!==void 0){if(s.complete===!0)a.manager.itemStart(e),setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0);else{let f=pb.get(s);f===void 0&&(f=[],pb.set(s,f)),f.push({onLoad:n,onError:r})}return s}const o=q1("img");function l(){u(),n&&n(this);const f=pb.get(this)||[];for(let h=0;h<f.length;h++){const d=f[h];d.onLoad&&d.onLoad(this)}pb.delete(this),a.manager.itemEnd(e)}function c(f){u(),r&&r(f),Ju.remove(`image:${e}`);const h=pb.get(this)||[];for(let d=0;d<h.length;d++){const g=h[d];g.onError&&g.onError(f)}pb.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function u(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Ju.add(`image:${e}`,o),a.manager.itemStart(e),o.src=e,o}}class R$ extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=new B_;a.colorSpace=As;const s=new $1(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function l(c){s.load(e[c],function(u){a.images[c]=u,o++,o===6&&(a.needsUpdate=!0,n&&n(a))},void 0,r)}for(let c=0;c<e.length;++c)l(c);return a}}class mU extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new cs,o=new Ns(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(a.withCredentials),o.load(e,function(l){let c;try{c=a.parse(l)}catch(u){if(r!==void 0)r(u);else{console.error(u);return}}c.image!==void 0?s.image=c.image:c.data!==void 0&&(s.image.width=c.width,s.image.height=c.height,s.image.data=c.data),s.wrapS=c.wrapS!==void 0?c.wrapS:_a,s.wrapT=c.wrapT!==void 0?c.wrapT:_a,s.magFilter=c.magFilter!==void 0?c.magFilter:Vi,s.minFilter=c.minFilter!==void 0?c.minFilter:Vi,s.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(s.colorSpace=c.colorSpace),c.flipY!==void 0&&(s.flipY=c.flipY),c.format!==void 0&&(s.format=c.format),c.type!==void 0&&(s.type=c.type),c.mipmaps!==void 0&&(s.mipmaps=c.mipmaps,s.minFilter=vc),c.mipmapCount===1&&(s.minFilter=Vi),c.generateMipmaps!==void 0&&(s.generateMipmaps=c.generateMipmaps),s.needsUpdate=!0,n&&n(s,c)},i,r),s}}class hv extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=new nr,s=new $1(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(o){a.image=o,a.needsUpdate=!0,n!==void 0&&n(a)},i,r),a}}class ip extends Pi{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new Ut(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class k$ extends ip{constructor(e,n,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ut(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const Nk=new Dt,Rj=new te,kj=new te;class gU{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new wt(512,512),this.mapType=Ao,this.map=null,this.mapPass=null,this.matrix=new Dt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new tp,this._frameExtents=new wt(1,1),this._viewportCount=1,this._viewports=[new ni(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;Rj.setFromMatrixPosition(e.matrixWorld),n.position.copy(Rj),kj.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(kj),n.updateMatrixWorld(),Nk.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nk,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Nk)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class ove extends gU{constructor(){super(new sa(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=sv*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||n.far;(i!==n.fov||r!==n.aspect||a!==n.far)&&(n.fov=i,n.aspect=r,n.far=a,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class bU extends ip{constructor(e,n,i=0,r=Math.PI/3,a=0,s=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.target=new Pi,this.distance=i,this.angle=r,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new ove}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Dj=new Dt,Jy=new te,Lk=new te;class lve extends gU{constructor(){super(new sa(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new wt(4,2),this._viewportCount=6,this._viewports=[new ni(2,1,1,1),new ni(0,1,1,1),new ni(3,1,1,1),new ni(1,1,1,1),new ni(3,0,1,1),new ni(1,0,1,1)],this._cubeDirections=[new te(1,0,0),new te(-1,0,0),new te(0,0,1),new te(0,0,-1),new te(0,1,0),new te(0,-1,0)],this._cubeUps=[new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,0,1),new te(0,0,-1)]}updateMatrices(e,n=0){const i=this.camera,r=this.matrix,a=e.distance||i.far;a!==i.far&&(i.far=a,i.updateProjectionMatrix()),Jy.setFromMatrixPosition(e.matrixWorld),i.position.copy(Jy),Lk.copy(i.position),Lk.add(this._cubeDirections[n]),i.up.copy(this._cubeUps[n]),i.lookAt(Lk),i.updateMatrixWorld(),r.makeTranslation(-Jy.x,-Jy.y,-Jy.z),Dj.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Dj,i.coordinateSystem,i.reversedDepth)}}class vU extends ip{constructor(e,n,i=0,r=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new lve}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Ah extends qA{constructor(e=-1,n=1,i=1,r=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=r,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,i,r,a,s){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=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=i-e,s=i+e,o=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=c*this.view.offsetX,s=a+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class cve extends gU{constructor(){super(new Ah(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class gC extends ip{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.target=new Pi,this.shadow=new cve}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class D$ extends ip{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class O$ extends ip{constructor(e,n,i=10,r=10){super(e,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class I${constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new te)}set(e){for(let n=0;n<9;n++)this.coefficients[n].copy(e[n]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,n){const i=e.x,r=e.y,a=e.z,s=this.coefficients;return n.copy(s[0]).multiplyScalar(.282095),n.addScaledVector(s[1],.488603*r),n.addScaledVector(s[2],.488603*a),n.addScaledVector(s[3],.488603*i),n.addScaledVector(s[4],1.092548*(i*r)),n.addScaledVector(s[5],1.092548*(r*a)),n.addScaledVector(s[6],.315392*(3*a*a-1)),n.addScaledVector(s[7],1.092548*(i*a)),n.addScaledVector(s[8],.546274*(i*i-r*r)),n}getIrradianceAt(e,n){const i=e.x,r=e.y,a=e.z,s=this.coefficients;return n.copy(s[0]).multiplyScalar(.886227),n.addScaledVector(s[1],2*.511664*r),n.addScaledVector(s[2],2*.511664*a),n.addScaledVector(s[3],2*.511664*i),n.addScaledVector(s[4],2*.429043*i*r),n.addScaledVector(s[5],2*.429043*r*a),n.addScaledVector(s[6],.743125*a*a-.247708),n.addScaledVector(s[7],2*.429043*i*a),n.addScaledVector(s[8],.429043*(i*i-r*r)),n}add(e){for(let n=0;n<9;n++)this.coefficients[n].add(e.coefficients[n]);return this}addScaledSH(e,n){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],n);return this}scale(e){for(let n=0;n<9;n++)this.coefficients[n].multiplyScalar(e);return this}lerp(e,n){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],n);return this}equals(e){for(let n=0;n<9;n++)if(!this.coefficients[n].equals(e.coefficients[n]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,n=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,n+r*3);return this}toArray(e=[],n=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,n+r*3);return e}static getBasisAt(e,n){const i=e.x,r=e.y,a=e.z;n[0]=.282095,n[1]=.488603*r,n[2]=.488603*a,n[3]=.488603*i,n[4]=1.092548*i*r,n[5]=1.092548*r*a,n[6]=.315392*(3*a*a-1),n[7]=1.092548*i*a,n[8]=.546274*(i*i-r*r)}}class N$ extends ip{constructor(e=new I$,n=1){super(void 0,n),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const n=super.toJSON(e);return n.object.sh=this.sh.toArray(),n}}class bC extends Fs{constructor(e){super(e),this.textures={}}load(e,n,i,r){const a=this,s=new Ns(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),a.manager.itemError(e)}},i,r)}parse(e){const n=this.textures;function i(a){return n[a]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",a),n[a]}const r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Ut().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const a in e.uniforms){const s=e.uniforms[a];switch(r.uniforms[a]={},s.type){case"t":r.uniforms[a].value=i(s.value);break;case"c":r.uniforms[a].value=new Ut().setHex(s.value);break;case"v2":r.uniforms[a].value=new wt().fromArray(s.value);break;case"v3":r.uniforms[a].value=new te().fromArray(s.value);break;case"v4":r.uniforms[a].value=new ni().fromArray(s.value);break;case"m3":r.uniforms[a].value=new $n().fromArray(s.value);break;case"m4":r.uniforms[a].value=new Dt().fromArray(s.value);break;default:r.uniforms[a].value=s.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 a in e.extensions)r.extensions[a]=e.extensions[a];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 a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),r.normalScale=new wt().fromArray(a)}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 wt().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}createMaterialFromType(e){return bC.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:dg,SpriteMaterial:QP,RawShaderMaterial:b$,ShaderMaterial:fs,PointsMaterial:QA,MeshPhysicalMaterial:Pc,MeshStandardMaterial:$v,MeshPhongMaterial:v$,MeshToonMaterial:iT,MeshNormalMaterial:y$,MeshLambertMaterial:x$,MeshDepthMaterial:dC,MeshDistanceMaterial:pC,MeshBasicMaterial:Ds,MeshMatcapMaterial:_$,LineDashedMaterial:S$,LineBasicMaterial:Us,Material:Oa};return new n[e]}}class Ud{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}class G_ extends On{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class L$ extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new Ns(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),a.manager.itemError(e)}},i,r)}parse(e){const n={},i={};function r(d,g){if(n[g]!==void 0)return n[g];const y=d.interleavedBuffers[g],p=a(d,y.buffer),x=r0(y.type,p),_=new z_(x,y.stride);return _.uuid=y.uuid,n[g]=_,_}function a(d,g){if(i[g]!==void 0)return i[g];const y=d.arrayBuffers[g],p=new Uint32Array(y).buffer;return i[g]=p,p}const s=e.isInstancedBufferGeometry?new G_:new On,o=e.data.index;if(o!==void 0){const d=r0(o.type,o.array);s.setIndex(new In(d,1))}const l=e.data.attributes;for(const d in l){const g=l[d];let b;if(g.isInterleavedBufferAttribute){const y=r(e.data,g.data);b=new zo(y,g.itemSize,g.offset,g.normalized)}else{const y=r0(g.type,g.array),p=g.isInstancedBufferAttribute?pf:In;b=new p(y,g.itemSize,g.normalized)}g.name!==void 0&&(b.name=g.name),g.usage!==void 0&&b.setUsage(g.usage),s.setAttribute(d,b)}const c=e.data.morphAttributes;if(c)for(const d in c){const g=c[d],b=[];for(let y=0,p=g.length;y<p;y++){const x=g[y];let _;if(x.isInterleavedBufferAttribute){const w=r(e.data,x.data);_=new zo(w,x.itemSize,x.offset,x.normalized)}else{const w=r0(x.type,x.array);_=new In(w,x.itemSize,x.normalized)}x.name!==void 0&&(_.name=x.name),b.push(_)}s.morphAttributes[d]=b}e.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);const f=e.data.groups||e.data.drawcalls||e.data.offsets;if(f!==void 0)for(let d=0,g=f.length;d!==g;++d){const b=f[d];s.addGroup(b.start,b.count,b.materialIndex)}const h=e.data.boundingSphere;return h!==void 0&&(s.boundingSphere=new Ur().fromJSON(h)),e.name&&(s.name=e.name),e.userData&&(s.userData=e.userData),s}}class uve extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=this.path===""?Ud.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new Ns(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(f){r!==void 0&&r(f),console.error("THREE:ObjectLoader: Can't parse "+e+".",f.message);return}const u=c.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}a.parse(c,n)},i,r)}async loadAsync(e,n){const i=this,r=this.path===""?Ud.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const a=new Ns(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);const s=await a.loadAsync(e,n),o=JSON.parse(s),l=o.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(o)}parse(e,n){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,r),s=this.parseImages(e.images,function(){n!==void 0&&n(c)}),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,a,l,o,i),u=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,u),this.bindLightTargets(c),n!==void 0){let f=!1;for(const h in s)if(s[h].data instanceof HTMLImageElement){f=!0;break}f===!1&&n(c)}return c}async parseAsync(e){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),a=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,r,o,s,n),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),this.bindLightTargets(l),l}parseShapes(e){const n={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const a=new Nm().fromJSON(e[i]);n[a.uuid]=a}return n}parseSkeletons(e,n){const i={},r={};if(n.traverse(function(a){a.isBone&&(r[a.uuid]=a)}),e!==void 0)for(let a=0,s=e.length;a<s;a++){const o=new Kv().fromJSON(e[a],r);i[o.uuid]=o}return i}parseGeometries(e,n){const i={};if(e!==void 0){const r=new L$;for(let a=0,s=e.length;a<s;a++){let o;const l=e[a];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(l);break;default:l.type in Cj?o=Cj[l.type].fromJSON(l,n):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}o.uuid=l.uuid,l.name!==void 0&&(o.name=l.name),l.userData!==void 0&&(o.userData=l.userData),i[l.uuid]=o}}return i}parseMaterials(e,n){const i={},r={};if(e!==void 0){const a=new bC;a.setTextures(n);for(let s=0,o=e.length;s<o;s++){const l=e[s];i[l.uuid]===void 0&&(i[l.uuid]=a.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(e){const n={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],a=fv.parse(r);n[a.uuid]=a}return n}parseImages(e,n){const i=this,r={};let a;function s(l){return i.manager.itemStart(l),a.load(l,function(){i.manager.itemEnd(l)},void 0,function(){i.manager.itemError(l),i.manager.itemEnd(l)})}function o(l){if(typeof l=="string"){const c=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return s(u)}else return l.data?{data:r0(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new mC(n);a=new $1(l),a.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c<u;c++){const f=e[c],h=f.url;if(Array.isArray(h)){const d=[];for(let g=0,b=h.length;g<b;g++){const y=h[g],p=o(y);p!==null&&(p instanceof HTMLImageElement?d.push(p):d.push(new cs(p.data,p.width,p.height)))}r[f.uuid]=new Md(d)}else{const d=o(f.url);r[f.uuid]=new Md(d)}}}return r}async parseImagesAsync(e){const n=this,i={};let r;async function a(s){if(typeof s=="string"){const o=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:n.resourcePath+o;return await r.loadAsync(l)}else return s.data?{data:r0(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){r=new $1(this.manager),r.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s<o;s++){const l=e[s],c=l.url;if(Array.isArray(c)){const u=[];for(let f=0,h=c.length;f<h;f++){const d=c[f],g=await a(d);g!==null&&(g instanceof HTMLImageElement?u.push(g):u.push(new cs(g.data,g.width,g.height)))}i[l.uuid]=new Md(u)}else{const u=await a(l.url);i[l.uuid]=new Md(u)}}}return i}parseTextures(e,n){function i(a,s){return typeof a=="number"?a:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a),s[a])}const r={};if(e!==void 0)for(let a=0,s=e.length;a<s;a++){const o=e[a];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),n[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const l=n[o.image],c=l.data;let u;Array.isArray(c)?(u=new B_,c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new cs:u=new nr,c&&(u.needsUpdate=!0)),u.source=l,u.uuid=o.uuid,o.name!==void 0&&(u.name=o.name),o.mapping!==void 0&&(u.mapping=i(o.mapping,fve)),o.channel!==void 0&&(u.channel=o.channel),o.offset!==void 0&&u.offset.fromArray(o.offset),o.repeat!==void 0&&u.repeat.fromArray(o.repeat),o.center!==void 0&&u.center.fromArray(o.center),o.rotation!==void 0&&(u.rotation=o.rotation),o.wrap!==void 0&&(u.wrapS=i(o.wrap[0],Oj),u.wrapT=i(o.wrap[1],Oj)),o.format!==void 0&&(u.format=o.format),o.internalFormat!==void 0&&(u.internalFormat=o.internalFormat),o.type!==void 0&&(u.type=o.type),o.colorSpace!==void 0&&(u.colorSpace=o.colorSpace),o.minFilter!==void 0&&(u.minFilter=i(o.minFilter,Ij)),o.magFilter!==void 0&&(u.magFilter=i(o.magFilter,Ij)),o.anisotropy!==void 0&&(u.anisotropy=o.anisotropy),o.flipY!==void 0&&(u.flipY=o.flipY),o.generateMipmaps!==void 0&&(u.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(u.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(u.compareFunction=o.compareFunction),o.userData!==void 0&&(u.userData=o.userData),r[o.uuid]=u}return r}parseObject(e,n,i,r,a){let s;function o(h){return n[h]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",h),n[h]}function l(h){if(h!==void 0){if(Array.isArray(h)){const d=[];for(let g=0,b=h.length;g<b;g++){const y=h[g];i[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),d.push(i[y])}return d}return i[h]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",h),i[h]}}function c(h){return r[h]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",h),r[h]}let u,f;switch(e.type){case"Scene":s=new qv,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new Ut(e.background):s.background=c(e.background)),e.environment!==void 0&&(s.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?s.fog=new YA(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new KA(e.fog.color,e.fog.density)),e.fog.name!==""&&(s.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(s.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&s.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(s.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&s.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":s=new sa(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(s.focus=e.focus),e.zoom!==void 0&&(s.zoom=e.zoom),e.filmGauge!==void 0&&(s.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(s.filmOffset=e.filmOffset),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new Ah(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(s.zoom=e.zoom),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new D$(e.color,e.intensity);break;case"DirectionalLight":s=new gC(e.color,e.intensity),s.target=e.target||"";break;case"PointLight":s=new vU(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new O$(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new bU(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),s.target=e.target||"";break;case"HemisphereLight":s=new k$(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new N$().fromJSON(e);break;case"SkinnedMesh":u=o(e.geometry),f=l(e.material),s=new JA(u,f),e.bindMode!==void 0&&(s.bindMode=e.bindMode),e.bindMatrix!==void 0&&s.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(s.skeleton=e.skeleton);break;case"Mesh":u=o(e.geometry),f=l(e.material),s=new _i(u,f);break;case"InstancedMesh":u=o(e.geometry),f=l(e.material);const h=e.count,d=e.instanceMatrix,g=e.instanceColor;s=new $A(u,f,h),s.instanceMatrix=new pf(new Float32Array(d.array),16),g!==void 0&&(s.instanceColor=new pf(new Float32Array(g.array),g.itemSize));break;case"BatchedMesh":u=o(e.geometry),f=l(e.material),s=new o$(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,f),s.geometry=u,s.perObjectFrustumCulled=e.perObjectFrustumCulled,s.sortObjects=e.sortObjects,s._drawRanges=e.drawRanges,s._reservedRanges=e.reservedRanges,s._geometryInfo=e.geometryInfo.map(b=>{let y=null,p=null;return b.boundingBox!==void 0&&(y=new rr().fromJSON(b.boundingBox)),b.boundingSphere!==void 0&&(p=new Ur().fromJSON(b.boundingSphere)),{...b,boundingBox:y,boundingSphere:p}}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=c(e.matricesTexture.uuid),s._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(s.boundingSphere=new Ur().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(s.boundingBox=new rr().fromJSON(e.boundingBox));break;case"LOD":s=new s$;break;case"Line":s=new yh(o(e.geometry),l(e.material));break;case"LineLoop":s=new eU(o(e.geometry),l(e.material));break;case"LineSegments":s=new Lc(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":s=new tU(o(e.geometry),l(e.material));break;case"Sprite":s=new a$(l(e.material));break;case"Group":s=new xl;break;case"Bone":s=new j_;break;default:s=new Pi}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let d=0;d<h.length;d++)s.add(this.parseObject(h[d],n,i,r,a))}if(e.animations!==void 0){const h=e.animations;for(let d=0;d<h.length;d++){const g=h[d];s.animations.push(a[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const h=e.levels;for(let d=0;d<h.length;d++){const g=h[d],b=s.getObjectByProperty("uuid",g.object);b!==void 0&&s.addLevel(b,g.distance,g.hysteresis)}}return s}bindSkeletons(e,n){Object.keys(n).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=n[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(n){if(n.isDirectionalLight||n.isSpotLight){const i=n.target,r=e.getObjectByProperty("uuid",i);r!==void 0?n.target=r:n.target=new Pi}})}}const fve={UVMapping:Wd,CubeReflectionMapping:df,CubeRefractionMapping:Xd,EquirectangularReflectionMapping:$0,EquirectangularRefractionMapping:H1,CubeUVReflectionMapping:Vv},Oj={RepeatWrapping:qd,ClampToEdgeWrapping:_a,MirroredRepeatWrapping:Z0},Ij={NearestFilter:ls,NearestMipmapNearestFilter:FA,NearestMipmapLinearFilter:fm,LinearFilter:Vi,LinearMipmapNearestFilter:_0,LinearMipmapLinearFilter:vc},Pk=new WeakMap;class P$ extends Fs{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,n,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=Ju.get(`image-bitmap:${e}`);if(s!==void 0){if(a.manager.itemStart(e),s.then){s.then(c=>{if(Pk.has(s)===!0)r&&r(Pk.get(s)),a.manager.itemError(e),a.manager.itemEnd(e);else return n&&n(c),a.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const l=fetch(e,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(c){return Ju.add(`image-bitmap:${e}`,c),n&&n(c),a.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Pk.set(l,c),Ju.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});Ju.add(`image-bitmap:${e}`,l),a.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let Hw;class yU{static getContext(){return Hw===void 0&&(Hw=new(window.AudioContext||window.webkitAudioContext)),Hw}static setContext(e){Hw=e}}class hve extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new Ns(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const c=l.slice(0);yU.getContext().decodeAudioData(c,function(f){n(f)}).catch(o)}catch(c){o(c)}},i,r);function o(l){r?r(l):console.error(l),a.manager.itemError(e)}}}const Nj=new Dt,Lj=new Dt,Op=new Dt;class dve{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new sa,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new sa,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 n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,Op.copy(e.projectionMatrix);const r=n.eyeSep/2,a=r*n.near/n.focus,s=n.near*Math.tan(Im*n.fov*.5)/n.zoom;let o,l;Lj.elements[12]=-r,Nj.elements[12]=r,o=-s*n.aspect+a,l=s*n.aspect+a,Op.elements[0]=2*n.near/(l-o),Op.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Op),o=-s*n.aspect-a,l=s*n.aspect-a,Op.elements[0]=2*n.near/(l-o),Op.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Op)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Lj),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Nj)}}class U$ extends sa{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class xU{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=performance.now();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}const Ip=new te,Uk=new Xn,pve=new te,Np=new te,Lp=new te;class mve extends Pi{constructor(){super(),this.type="AudioListener",this.context=yU.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new xU}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 n=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ip,Uk,pve),Np.set(0,0,-1).applyQuaternion(Uk),Lp.set(0,1,0).applyQuaternion(Uk),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(Ip.x,i),n.positionY.linearRampToValueAtTime(Ip.y,i),n.positionZ.linearRampToValueAtTime(Ip.z,i),n.forwardX.linearRampToValueAtTime(Np.x,i),n.forwardY.linearRampToValueAtTime(Np.y,i),n.forwardZ.linearRampToValueAtTime(Np.z,i),n.upX.linearRampToValueAtTime(Lp.x,i),n.upY.linearRampToValueAtTime(Lp.y,i),n.upZ.linearRampToValueAtTime(Lp.z,i)}else n.setPosition(Ip.x,Ip.y,Ip.z),n.setOrientation(Np.x,Np.y,Np.z,Lp.x,Lp.y,Lp.z)}}class F$ extends Pi{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 n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,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(e=0){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.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,n){return super.copy(e,n),e.sourceType!=="buffer"?(console.warn("THREE.Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const Pp=new te,Pj=new Xn,gve=new te,Up=new te;class bve extends F${constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,n,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=n,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Pp,Pj,gve),Up.set(0,0,1).applyQuaternion(Pj);const n=this.panner;if(n.positionX){const i=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(Pp.x,i),n.positionY.linearRampToValueAtTime(Pp.y,i),n.positionZ.linearRampToValueAtTime(Pp.z,i),n.orientationX.linearRampToValueAtTime(Up.x,i),n.orientationY.linearRampToValueAtTime(Up.y,i),n.orientationZ.linearRampToValueAtTime(Up.z,i)}else n.setPosition(Pp.x,Pp.y,Pp.z),n.setOrientation(Up.x,Up.y,Up.z)}}class vve{constructor(e,n=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const n=this.getFrequencyData();for(let i=0;i<n.length;i++)e+=n[i];return e/n.length}}class B${constructor(e,n,i){this.binding=e,this.valueSize=i;let r,a,s;switch(n){case"quaternion":r=this._slerp,a=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,a=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,a=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=a,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,n){const i=this.buffer,r=this.valueSize,a=e*r+r;let s=this.cumulativeWeight;if(s===0){for(let o=0;o!==r;++o)i[a+o]=i[o];s=n}else{s+=n;const o=n/s;this._mixBufferRegion(i,a,0,o,r)}this.cumulativeWeight=s}accumulateAdditive(e){const n=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(n,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const n=this.valueSize,i=this.buffer,r=e*n+n,a=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){const l=n*this._origIndex;this._mixBufferRegion(i,r,l,1-a,n)}s>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*n,1,n);for(let l=n,c=n+n;l!==c;++l)if(i[l]!==i[l+n]){o.setValue(i,r);break}}saveOriginalState(){const e=this.binding,n=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(n,r);for(let a=i,s=r;a!==s;++a)n[a]=n[r+a%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,n=e+this.valueSize;for(let i=e;i<n;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,n=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[n+i]=this.buffer[e+i]}_select(e,n,i,r,a){if(r>=.5)for(let s=0;s!==a;++s)e[n+s]=e[i+s]}_slerp(e,n,i,r){Xn.slerpFlat(e,n,e,n,e,i,r)}_slerpAdditive(e,n,i,r,a){const s=this._workIndex*a;Xn.multiplyQuaternionsFlat(e,s,e,n,e,i),Xn.slerpFlat(e,n,e,n,e,s,r)}_lerp(e,n,i,r,a){const s=1-r;for(let o=0;o!==a;++o){const l=n+o;e[l]=e[l]*s+e[i+o]*r}}_lerpAdditive(e,n,i,r,a){for(let s=0;s!==a;++s){const o=n+s;e[o]=e[o]+e[i+s]*r}}}const _U="\\[\\]\\.:\\/",yve=new RegExp("["+_U+"]","g"),SU="[^"+_U+"]",xve="[^"+_U.replace("\\.","")+"]",_ve=/((?:WC+[\/:])*)/.source.replace("WC",SU),Sve=/(WCOD+)?/.source.replace("WCOD",xve),wve=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",SU),Eve=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",SU),Mve=new RegExp("^"+_ve+Sve+wve+Eve+"$"),Tve=["material","materials","bones","map"];class Ave{constructor(e,n,i){const r=i||Bi.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,r)}getValue(e,n){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,n)}setValue(e,n){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=i.length;r!==a;++r)i[r].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].unbind()}}class Bi{constructor(e,n,i){this.path=n,this.parsedPath=i||Bi.parseTrackName(n),this.node=Bi.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new Bi.Composite(e,n,i):new Bi(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(yve,"")}static parseTrackName(e){const n=Mve.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const a=i.nodeName.substring(r+1);Tve.indexOf(a)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=a)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){const i=function(a){for(let s=0;s<a.length;s++){const o=a[s];if(o.name===n||o.uuid===n)return o;const l=i(o.children);if(l)return l}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)e[n++]=i[r]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++]}_setValue_array_setNeedsUpdate(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node;const n=this.parsedPath,i=n.objectName,r=n.propertyName;let a=n.propertyIndex;if(e||(e=Bi.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let c=n.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===c){c=u;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const s=e[r];if(s===void 0){const c=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(a!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Bi.Composite=Ave;Bi.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Bi.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Bi.prototype.GetterByBindingType=[Bi.prototype._getValue_direct,Bi.prototype._getValue_array,Bi.prototype._getValue_arrayElement,Bi.prototype._getValue_toArray];Bi.prototype.SetterByBindingTypeAndVersioning=[[Bi.prototype._setValue_direct,Bi.prototype._setValue_direct_setNeedsUpdate,Bi.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Bi.prototype._setValue_array,Bi.prototype._setValue_array_setNeedsUpdate,Bi.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Bi.prototype._setValue_arrayElement,Bi.prototype._setValue_arrayElement_setNeedsUpdate,Bi.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Bi.prototype._setValue_fromArray,Bi.prototype._setValue_fromArray_setNeedsUpdate,Bi.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Cve{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ml(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}add(){const e=this._objects,n=this._indicesByUUID,i=this._paths,r=this._parsedPaths,a=this._bindings,s=a.length;let o,l=e.length,c=this.nCachedObjects_;for(let u=0,f=arguments.length;u!==f;++u){const h=arguments[u],d=h.uuid;let g=n[d];if(g===void 0){g=l++,n[d]=g,e.push(h);for(let b=0,y=s;b!==y;++b)a[b].push(new Bi(h,i[b],r[b]))}else if(g<c){o=e[g];const b=--c,y=e[b];n[y.uuid]=g,e[g]=y,n[d]=b,e[b]=h;for(let p=0,x=s;p!==x;++p){const _=a[p],w=_[b];let M=_[g];_[g]=w,M===void 0&&(M=new Bi(h,i[p],r[p])),_[b]=M}}else e[g]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,n=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const l=arguments[s],c=l.uuid,u=n[c];if(u!==void 0&&u>=a){const f=a++,h=e[f];n[h.uuid]=u,e[u]=h,n[c]=f,e[f]=l;for(let d=0,g=r;d!==g;++d){const b=i[d],y=b[f],p=b[u];b[u]=y,b[f]=p}}}this.nCachedObjects_=a}uncache(){const e=this._objects,n=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_,s=e.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],u=c.uuid,f=n[u];if(f!==void 0)if(delete n[u],f<a){const h=--a,d=e[h],g=--s,b=e[g];n[d.uuid]=f,e[f]=d,n[b.uuid]=h,e[h]=b,e.pop();for(let y=0,p=r;y!==p;++y){const x=i[y],_=x[h],w=x[g];x[f]=_,x[h]=w,x.pop()}}else{const h=--s,d=e[h];h>0&&(n[d.uuid]=f),e[f]=d,e.pop();for(let g=0,b=r;g!==b;++g){const y=i[g];y[f]=y[h],y.pop()}}}this.nCachedObjects_=a}subscribe_(e,n){const i=this._bindingsIndicesByPath;let r=i[e];const a=this._bindings;if(r!==void 0)return a[r];const s=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);r=a.length,i[e]=r,s.push(e),o.push(n),a.push(f);for(let h=u,d=l.length;h!==d;++h){const g=l[h];f[h]=new Bi(g,e,n)}return f}unsubscribe_(e){const n=this._bindingsIndicesByPath,i=n[e];if(i!==void 0){const r=this._paths,a=this._parsedPaths,s=this._bindings,o=s.length-1,l=s[o],c=e[o];n[c]=i,s[i]=l,s.pop(),a[i]=a[o],a.pop(),r[i]=r[o],r.pop()}}}class z${constructor(e,n,i=null,r=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=i,this.blendMode=r;const a=n.tracks,s=a.length,o=new Array(s),l={endingStart:hm,endingEnd:hm};for(let c=0;c!==s;++c){const u=a[c].createInterpolant(null);o[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=BJ,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,n){return this.loop=e,this.repetitions=n,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,n,i=!1){if(e.fadeOut(n),this.fadeIn(n),i===!0){const r=this._clip.duration,a=e._clip.duration,s=a/r,o=r/a;e.warp(1,s,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,i=!1){return e.crossFadeFrom(this,n,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,n,i){const r=this._mixer,a=r.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=a,l[1]=a+i,c[0]=e/s,c[1]=n/s,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,n,i,r){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const l=(e-a)*i;l<0||i===0?n=0:(this._startTime=null,n=i*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),o=this._updateWeight(e);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case GP:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulateAdditive(o);break;case GA:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulate(r,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];n*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];n*=r,e>i.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,i=this.loop;let r=this.time+e,a=this._loopCount;const s=i===zJ;if(e===0)return a===-1?r:s&&(a&1)===1?n-r:r;if(i===FJ){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=n)r=n;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(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),r>=n||r<0){const o=Math.floor(r/n);r-=n*o,a+=Math.abs(o);const l=this.repetitions-a;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?n:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,s)}else this._setEndings(!1,!1,s);this._loopCount=a,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(s&&(a&1)===1)return n-r}return r}_setEndings(e,n,i){const r=this._interpolantSettings;i?(r.endingStart=dm,r.endingEnd=dm):(e?r.endingStart=this.zeroSlopeAtStart?dm:hm:r.endingStart=V1,n?r.endingEnd=this.zeroSlopeAtEnd?dm:hm:r.endingEnd=V1)}_scheduleFading(e,n,i){const r=this._mixer,a=r.time;let s=this._weightInterpolant;s===null&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,l=s.sampleValues;return o[0]=a,l[0]=n,o[1]=a+e,l[1]=i,this}}const Rve=new Float32Array(1);class j$ extends yf{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const i=e._localRoot||this._root,r=e._clip.tracks,a=r.length,s=e._propertyBindings,o=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==a;++f){const h=r[f],d=h.name;let g=u[d];if(g!==void 0)++g.referenceCount,s[f]=g;else{if(g=s[f],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,d));continue}const b=n&&n._propertyBindings[f].binding.parsedPath;g=new B$(Bi.create(i,d,b),h.ValueTypeName,h.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,d),s[f]=g}o[f].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,a=this._actionsByClip[r];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,r,i)}const n=e._propertyBindings;for(let i=0,r=n.length;i!==r;++i){const a=n[i];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let i=0,r=n.length;i!==r;++i){const a=n[i];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}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 n=e._cacheIndex;return n!==null&&n<this._nActiveActions}_addInactiveAction(e,n,i){const r=this._actions,a=this._actionsByClip;let s=a[n];if(s===void 0)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[n]=s;else{const o=s.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){const n=this._actions,i=n[n.length-1],r=e._cacheIndex;i._cacheIndex=r,n[r]=i,n.pop(),e._cacheIndex=null;const a=e._clip.uuid,s=this._actionsByClip,o=s[a],l=o.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const f=o.actionByRoot,h=(e._localRoot||this._root).uuid;delete f[h],l.length===0&&delete s[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const n=e._propertyBindings;for(let i=0,r=n.length;i!==r;++i){const a=n[i];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){const n=this._actions,i=e._cacheIndex,r=this._nActiveActions++,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_takeBackAction(e){const n=this._actions,i=e._cacheIndex,r=--this._nActiveActions,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_addInactiveBinding(e,n,i){const r=this._bindingsByRootAndName,a=this._bindings;let s=r[n];s===void 0&&(s={},r[n]=s),s[i]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){const n=this._bindings,i=e.binding,r=i.rootNode.uuid,a=i.path,s=this._bindingsByRootAndName,o=s[r],l=n[n.length-1],c=e._cacheIndex;l._cacheIndex=c,n[c]=l,n.pop(),delete o[a],Object.keys(o).length===0&&delete s[r]}_lendBinding(e){const n=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_takeBackBinding(e){const n=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_lendControlInterpolant(){const e=this._controlInterpolants,n=this._nActiveControlInterpolants++;let i=e[n];return i===void 0&&(i=new dU(new Float32Array(2),new Float32Array(2),1,Rve),i.__cacheIndex=n,e[n]=i),i}_takeBackControlInterpolant(e){const n=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,a=n[r];e.__cacheIndex=r,n[r]=e,a.__cacheIndex=i,n[i]=a}clipAction(e,n,i){const r=n||this._root,a=r.uuid;let s=typeof e=="string"?fv.findByName(r,e):e;const o=s!==null?s.uuid:e,l=this._actionsByClip[o];let c=null;if(i===void 0&&(s!==null?i=s.blendMode:i=GA),l!==void 0){const f=l.actionByRoot[a];if(f!==void 0&&f.blendMode===i)return f;c=l.knownActions[0],s===null&&(s=c._clip)}if(s===null)return null;const u=new z$(this,s,n,i);return this._bindAction(u,c),this._addInactiveAction(u,o,a),u}existingAction(e,n){const i=n||this._root,r=i.uuid,a=typeof e=="string"?fv.findByName(i,e):e,s=a?a.uuid:e,o=this._actionsByClip[s];return o!==void 0&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions,n=this._nActiveActions;for(let i=n-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const n=this._actions,i=this._nActiveActions,r=this.time+=e,a=Math.sign(e),s=this._accuIndex^=1;for(let c=0;c!==i;++c)n[c]._update(r,e,a,s);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(s);return this}setTime(e){this.time=0;for(let n=0;n<this._actions.length;n++)this._actions[n].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const n=this._actions,i=e.uuid,r=this._actionsByClip,a=r[i];if(a!==void 0){const s=a.knownActions;for(let o=0,l=s.length;o!==l;++o){const c=s[o];this._deactivateAction(c);const u=c._cacheIndex,f=n[n.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,f._cacheIndex=u,n[u]=f,n.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const n=e.uuid,i=this._actionsByClip;for(const s in i){const o=i[s].actionByRoot,l=o[n];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,a=r[n];if(a!==void 0)for(const s in a){const o=a[s];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,n){const i=this.existingAction(e,n);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class kve extends YP{constructor(e=1,n=1,i=1,r={}){super(e,n,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new XA(null,e,n,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class vC{constructor(e){this.value=e}clone(){return new vC(this.value.clone===void 0?this.value:this.value.clone())}}let Dve=0;class Ove extends yf{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Dve++}),this.name="",this.usage=W1,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const n=this.uniforms.indexOf(e);return n!==-1&&this.uniforms.splice(n,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const n=e.uniforms;this.uniforms.length=0;for(let i=0,r=n.length;i<r;i++){const a=Array.isArray(n[i])?n[i]:[n[i]];for(let s=0;s<a.length;s++)this.uniforms.push(a[s].clone())}return this}clone(){return new this.constructor().copy(this)}}class rT extends z_{constructor(e,n,i=1){super(e,n),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const n=super.clone(e);return n.meshPerAttribute=this.meshPerAttribute,n}toJSON(e){const n=super.toJSON(e);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}class H${constructor(e,n,i,r,a,s=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=n,this.itemSize=i,this.elementSize=r,this.count=a,this.normalized=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,n){return this.type=e,this.elementSize=n,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const Uj=new Dt;class W_{constructor(e,n,i=0,r=1/0){this.ray=new xf(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new ov,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return Uj.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Uj),this}intersectObject(e,n=!0,i=[]){return rI(e,this,i,n),i.sort(Fj),i}intersectObjects(e,n=!0,i=[]){for(let r=0,a=e.length;r<a;r++)rI(e[r],this,i,n);return i.sort(Fj),i}}function Fj(t,e){return t.distance-e.distance}function rI(t,e,n,i){let r=!0;if(t.layers.test(e.layers)&&t.raycast(e,n)===!1&&(r=!1),r===!0&&i===!0){const a=t.children;for(let s=0,o=a.length;s<o;s++)rI(a[s],e,n,!0)}}class Ive{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=Nve.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function Nve(){this._document.hidden===!1&&this.reset()}class V${constructor(e=1,n=0,i=0){this.radius=e,this.phi=n,this.theta=i}set(e,n,i){return this.radius=e,this.phi=n,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Pn(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+n*n+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Pn(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class Lve{constructor(e=1,n=0,i=0){this.radius=e,this.theta=n,this.y=i}set(e,n,i){return this.radius=e,this.theta=n,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=n,this}clone(){return new this.constructor().copy(this)}}class wU{constructor(e,n,i,r){wU.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,n,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,n=0){for(let i=0;i<4;i++)this.elements[i]=e[i+n];return this}set(e,n,i,r){const a=this.elements;return a[0]=e,a[2]=n,a[1]=i,a[3]=r,this}}const Bj=new wt;class Pve{constructor(e=new wt(1/0,1/0),n=new wt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Bj.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bj).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 zj=new te,Vw=new te,mb=new te,gb=new te,Fk=new te,Uve=new te,Fve=new te;class G${constructor(e=new te,n=new te){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){zj.subVectors(e,this.start),Vw.subVectors(this.end,this.start);const i=Vw.dot(Vw);let a=Vw.dot(zj)/i;return n&&(a=Pn(a,0,1)),a}closestPointToPoint(e,n,i){const r=this.closestPointToPointParameter(e,n);return this.delta(i).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,n=Uve,i=Fve){const r=10000000000000001e-32;let a,s;const o=this.start,l=e.start,c=this.end,u=e.end;mb.subVectors(c,o),gb.subVectors(u,l),Fk.subVectors(o,l);const f=mb.dot(mb),h=gb.dot(gb),d=gb.dot(Fk);if(f<=r&&h<=r)return n.copy(o),i.copy(l),n.sub(i),n.dot(n);if(f<=r)a=0,s=d/h,s=Pn(s,0,1);else{const g=mb.dot(Fk);if(h<=r)s=0,a=Pn(-g/f,0,1);else{const b=mb.dot(gb),y=f*h-b*b;y!==0?a=Pn((b*d-g*h)/y,0,1):a=0,s=(b*a+d)/h,s<0?(s=0,a=Pn(-g/f,0,1)):s>1&&(s=1,a=Pn((b-g)/f,0,1))}}return n.copy(o).add(mb.multiplyScalar(a)),i.copy(l).add(gb.multiplyScalar(s)),n.sub(i),n.dot(n)}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 jj=new te;class Bve extends Pi{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const i=new On,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 s=0,o=1,l=32;s<l;s++,o++){const c=s/l*Math.PI*2,u=o/l*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(u),Math.sin(u),1)}i.setAttribute("position",new mn(r,3));const a=new Us({fog:!1,toneMapped:!1});this.cone=new Lc(i,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),jj.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(jj),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Zh=new te,Gw=new Dt,Bk=new Dt;class zve extends Lc{constructor(e){const n=W$(e),i=new On,r=[],a=[];for(let c=0;c<n.length;c++){const u=n[c];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),a.push(0,0,0),a.push(0,0,0))}i.setAttribute("position",new mn(r,3)),i.setAttribute("color",new mn(a,3));const s=new Us({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,s),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=n,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new Ut(255),l=new Ut(65280);this.setColors(o,l)}updateMatrixWorld(e){const n=this.bones,i=this.geometry,r=i.getAttribute("position");Bk.copy(this.root.matrixWorld).invert();for(let a=0,s=0;a<n.length;a++){const o=n[a];o.parent&&o.parent.isBone&&(Gw.multiplyMatrices(Bk,o.matrixWorld),Zh.setFromMatrixPosition(Gw),r.setXYZ(s,Zh.x,Zh.y,Zh.z),Gw.multiplyMatrices(Bk,o.parent.matrixWorld),Zh.setFromMatrixPosition(Gw),r.setXYZ(s+1,Zh.x,Zh.y,Zh.z),s+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,n){const r=this.geometry.getAttribute("color");for(let a=0;a<r.count;a+=2)r.setXYZ(a,e.r,e.g,e.b),r.setXYZ(a+1,n.r,n.g,n.b);return r.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function W$(t){const e=[];t.isBone===!0&&e.push(t);for(let n=0;n<t.children.length;n++)e.push(...W$(t.children[n]));return e}class jve extends _i{constructor(e,n,i){const r=new Jv(n,4,2),a=new Ds({wireframe:!0,fog:!1,toneMapped:!1});super(r,a),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Hve=new te,Hj=new Ut,Vj=new Ut;class Vve extends Pi{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new V_(n);r.rotateY(Math.PI*.5),this.material=new Ds({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const a=r.getAttribute("position"),s=new Float32Array(a.count*3);r.setAttribute("color",new In(s,3)),this.add(new _i(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const n=e.geometry.getAttribute("color");Hj.copy(this.light.color),Vj.copy(this.light.groundColor);for(let i=0,r=n.count;i<r;i++){const a=i<r/2?Hj:Vj;n.setXYZ(i,a.r,a.g,a.b)}n.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(Hve.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Gve extends Lc{constructor(e=10,n=10,i=4473924,r=8947848){i=new Ut(i),r=new Ut(r);const a=n/2,s=e/n,o=e/2,l=[],c=[];for(let h=0,d=0,g=-o;h<=n;h++,g+=s){l.push(-o,0,g,o,0,g),l.push(g,0,-o,g,0,o);const b=h===a?i:r;b.toArray(c,d),d+=3,b.toArray(c,d),d+=3,b.toArray(c,d),d+=3,b.toArray(c,d),d+=3}const u=new On;u.setAttribute("position",new mn(l,3)),u.setAttribute("color",new mn(c,3));const f=new Us({vertexColors:!0,toneMapped:!1});super(u,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Wve extends Lc{constructor(e=10,n=16,i=8,r=64,a=4473924,s=8947848){a=new Ut(a),s=new Ut(s);const o=[],l=[];if(n>1)for(let f=0;f<n;f++){const h=f/n*(Math.PI*2),d=Math.sin(h)*e,g=Math.cos(h)*e;o.push(0,0,0),o.push(d,0,g);const b=f&1?a:s;l.push(b.r,b.g,b.b),l.push(b.r,b.g,b.b)}for(let f=0;f<i;f++){const h=f&1?a:s,d=e-e/i*f;for(let g=0;g<r;g++){let b=g/r*(Math.PI*2),y=Math.sin(b)*d,p=Math.cos(b)*d;o.push(y,0,p),l.push(h.r,h.g,h.b),b=(g+1)/r*(Math.PI*2),y=Math.sin(b)*d,p=Math.cos(b)*d,o.push(y,0,p),l.push(h.r,h.g,h.b)}}const c=new On;c.setAttribute("position",new mn(o,3)),c.setAttribute("color",new mn(l,3));const u=new Us({vertexColors:!0,toneMapped:!1});super(c,u),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Gj=new te,Ww=new te,Wj=new te;class Xve extends Pi{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",n===void 0&&(n=1);let r=new On;r.setAttribute("position",new mn([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));const a=new Us({fog:!1,toneMapped:!1});this.lightPlane=new yh(r,a),this.add(this.lightPlane),r=new On,r.setAttribute("position",new mn([0,0,0,0,0,1],3)),this.targetLine=new yh(r,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Gj.setFromMatrixPosition(this.light.matrixWorld),Ww.setFromMatrixPosition(this.light.target.matrixWorld),Wj.subVectors(Ww,Gj),this.lightPlane.lookAt(Ww),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Ww),this.targetLine.scale.z=Wj.length()}}const Xw=new te,da=new qA;class qve extends Lc{constructor(e){const n=new On,i=new Us({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],a=[],s={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(g,b){l(g),l(b)}function l(g){r.push(0,0,0),a.push(0,0,0),s[g]===void 0&&(s[g]=[]),s[g].push(r.length/3-1)}n.setAttribute("position",new mn(r,3)),n.setAttribute("color",new mn(a,3)),super(n,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const c=new Ut(16755200),u=new Ut(16711680),f=new Ut(43775),h=new Ut(16777215),d=new Ut(3355443);this.setColors(c,u,f,h,d)}setColors(e,n,i,r,a){const o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,n.r,n.g,n.b),o.setXYZ(25,n.r,n.g,n.b),o.setXYZ(26,n.r,n.g,n.b),o.setXYZ(27,n.r,n.g,n.b),o.setXYZ(28,n.r,n.g,n.b),o.setXYZ(29,n.r,n.g,n.b),o.setXYZ(30,n.r,n.g,n.b),o.setXYZ(31,n.r,n.g,n.b),o.setXYZ(32,i.r,i.g,i.b),o.setXYZ(33,i.r,i.g,i.b),o.setXYZ(34,i.r,i.g,i.b),o.setXYZ(35,i.r,i.g,i.b),o.setXYZ(36,i.r,i.g,i.b),o.setXYZ(37,i.r,i.g,i.b),o.setXYZ(38,r.r,r.g,r.b),o.setXYZ(39,r.r,r.g,r.b),o.setXYZ(40,a.r,a.g,a.b),o.setXYZ(41,a.r,a.g,a.b),o.setXYZ(42,a.r,a.g,a.b),o.setXYZ(43,a.r,a.g,a.b),o.setXYZ(44,a.r,a.g,a.b),o.setXYZ(45,a.r,a.g,a.b),o.setXYZ(46,a.r,a.g,a.b),o.setXYZ(47,a.r,a.g,a.b),o.setXYZ(48,a.r,a.g,a.b),o.setXYZ(49,a.r,a.g,a.b),o.needsUpdate=!0,this}update(){const e=this.geometry,n=this.pointMap,i=1,r=1;let a,s;if(da.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,s=0;else if(this.camera.coordinateSystem===yl)a=-1,s=1;else if(this.camera.coordinateSystem===av)a=0,s=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);ya("c",n,e,da,0,0,a),ya("t",n,e,da,0,0,s),ya("n1",n,e,da,-i,-r,a),ya("n2",n,e,da,i,-r,a),ya("n3",n,e,da,-i,r,a),ya("n4",n,e,da,i,r,a),ya("f1",n,e,da,-i,-r,s),ya("f2",n,e,da,i,-r,s),ya("f3",n,e,da,-i,r,s),ya("f4",n,e,da,i,r,s),ya("u1",n,e,da,i*.7,r*1.1,a),ya("u2",n,e,da,-i*.7,r*1.1,a),ya("u3",n,e,da,0,r*2,a),ya("cf1",n,e,da,-i,0,s),ya("cf2",n,e,da,i,0,s),ya("cf3",n,e,da,0,-r,s),ya("cf4",n,e,da,0,r,s),ya("cn1",n,e,da,-i,0,a),ya("cn2",n,e,da,i,0,a),ya("cn3",n,e,da,0,-r,a),ya("cn4",n,e,da,0,r,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ya(t,e,n,i,r,a,s){Xw.set(r,a,s).unproject(i);const o=e[t];if(o!==void 0){const l=n.getAttribute("position");for(let c=0,u=o.length;c<u;c++)l.setXYZ(o[c],Xw.x,Xw.y,Xw.z)}}const qw=new rr;class Kve extends Lc{constructor(e,n=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),a=new On;a.setIndex(new In(i,1)),a.setAttribute("position",new In(r,3)),super(a,new Us({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&qw.setFromObject(this.object),qw.isEmpty())return;const e=qw.min,n=qw.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class aI extends Lc{constructor(e,n=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new On;a.setIndex(new In(i,1)),a.setAttribute("position",new mn(r,3)),super(a,new Us({color:n,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class Yve extends yh{constructor(e,n=1,i=16776960){const r=i,a=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],s=new On;s.setAttribute("position",new mn(a,3)),s.computeBoundingSphere(),super(s,new Us({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=n;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new On;l.setAttribute("position",new mn(o,3)),l.computeBoundingSphere(),this.add(new _i(l,new Ds({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Xj=new te;let Kw,zk;class Jve extends Pi{constructor(e=new te(0,0,1),n=new te(0,0,0),i=1,r=16776960,a=i*.2,s=a*.2){super(),this.type="ArrowHelper",Kw===void 0&&(Kw=new On,Kw.setAttribute("position",new mn([0,0,0,0,1,0],3)),zk=new H_(.5,1,5,1),zk.translate(0,-.5,0)),this.position.copy(n),this.line=new yh(Kw,new Us({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new _i(zk,new Ds({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,a,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Xj.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(Xj,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,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 $ve extends Lc{constructor(e=1){const n=[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 On;r.setAttribute("position",new mn(n,3)),r.setAttribute("color",new mn(i,3));const a=new Us({vertexColors:!0,toneMapped:!1});super(r,a),this.type="AxesHelper"}setColors(e,n,i){const r=new Ut,a=this.geometry.attributes.color.array;return r.set(e),r.toArray(a,0),r.toArray(a,3),r.set(n),r.toArray(a,6),r.toArray(a,9),r.set(i),r.toArray(a,12),r.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Zve{constructor(){this.type="ShapePath",this.color=new Ut,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new nT,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,r){return this.currentPath.quadraticCurveTo(e,n,i,r),this}bezierCurveTo(e,n,i,r,a,s){return this.currentPath.bezierCurveTo(e,n,i,r,a,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(p){const x=[];for(let _=0,w=p.length;_<w;_++){const M=p[_],S=new Nm;S.curves=M.curves,x.push(S)}return x}function i(p,x){const _=x.length;let w=!1;for(let M=_-1,S=0;S<_;M=S++){let A=x[M],C=x[S],k=C.x-A.x,R=C.y-A.y;if(Math.abs(R)>Number.EPSILON){if(R<0&&(A=x[S],k=-k,C=x[M],R=-R),p.y<A.y||p.y>C.y)continue;if(p.y===A.y){if(p.x===A.x)return!0}else{const N=R*(p.x-A.x)-k*(p.y-A.y);if(N===0)return!0;if(N<0)continue;w=!w}}else{if(p.y!==A.y)continue;if(C.x<=p.x&&p.x<=A.x||A.x<=p.x&&p.x<=C.x)return!0}}return w}const r=du.isClockWise,a=this.subPaths;if(a.length===0)return[];let s,o,l;const c=[];if(a.length===1)return o=a[0],l=new Nm,l.curves=o.curves,c.push(l),c;let u=!r(a[0].getPoints());u=e?!u:u;const f=[],h=[];let d=[],g=0,b;h[g]=void 0,d[g]=[];for(let p=0,x=a.length;p<x;p++)o=a[p],b=o.getPoints(),s=r(b),s=e?!s:s,s?(!u&&h[g]&&g++,h[g]={s:new Nm,p:b},h[g].s.curves=o.curves,u&&g++,d[g]=[]):d[g].push({h:o,p:b[0]});if(!h[0])return n(a);if(h.length>1){let p=!1,x=0;for(let _=0,w=h.length;_<w;_++)f[_]=[];for(let _=0,w=h.length;_<w;_++){const M=d[_];for(let S=0;S<M.length;S++){const A=M[S];let C=!0;for(let k=0;k<h.length;k++)i(A.p,h[k].p)&&(_!==k&&x++,C?(C=!1,f[k].push(A)):p=!0);C&&f[_].push(A)}}x>0&&p===!1&&(d=f)}let y;for(let p=0,x=h.length;p<x;p++){l=h[p].s,c.push(l),y=d[p];for(let _=0,w=y.length;_<w;_++)l.holes.push(y[_].h)}return c}}class Qve extends yf{constructor(e,n=null){super(),this.object=e,this.domElement=n,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function eye(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function tye(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function nye(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function sI(t,e,n,i){const r=iye(i);switch(n){case jP:return t*e;case Th:return t*e/r.components*r.byteLength;case Wv:return t*e/r.components*r.byteLength;case VA:return t*e*2/r.components*r.byteLength;case F_:return t*e*2/r.components*r.byteLength;case HP:return t*e*3/r.components*r.byteLength;case Qr:return t*e*4/r.components*r.byteLength;case Xv:return t*e*4/r.components*r.byteLength;case e1:case t1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case n1:case i1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case A2:case R2:return Math.max(t,16)*Math.max(e,8)/4;case T2:case C2:return Math.max(t,8)*Math.max(e,8)/2;case k2:case D2:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case O2:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case I2:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case N2:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case L2:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case P2:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case U2:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case F2:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case B2:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case z2:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case j2:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case H2:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case V2:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case G2:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case W2:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case X2:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case r1:case q2:case K2:return Math.ceil(t/4)*Math.ceil(e/4)*16;case VP:case Y2:return Math.ceil(t/4)*Math.ceil(e/4)*8;case J2:case $2:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function iye(t){switch(t){case Ao:case BA:return{byteLength:1,components:1};case Q0:case zA:case as:return{byteLength:2,components:1};case jA:case HA:return{byteLength:2,components:4};case Ac:case Gv:case wr:return{byteLength:4,components:1};case zP:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}class rye{static contain(e,n){return eye(e,n)}static cover(e,n){return tye(e,n)}static fill(e){return nye(e)}static getByteLength(e,n,i,r){return sI(e,n,i,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Hv}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Hv);/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */function X$(){let t=null,e=!1,n=null,i=null;function r(a,s){n(a,s),i=t.requestAnimationFrame(r)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){n=a},setContext:function(a){t=a}}}function aye(t){const e=new WeakMap;function n(o,l){const c=o.array,u=o.usage,f=c.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,c,u),o.onUploadCallback();let d;if(c instanceof Float32Array)d=t.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)d=t.HALF_FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=t.HALF_FLOAT:d=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=t.SHORT;else if(c instanceof Uint32Array)d=t.UNSIGNED_INT;else if(c instanceof Int32Array)d=t.INT;else if(c instanceof Int8Array)d=t.BYTE;else if(c instanceof Uint8Array)d=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:f}}function i(o,l,c){const u=l.array,f=l.updateRanges;if(t.bindBuffer(c,o),f.length===0)t.bufferSubData(c,0,u);else{f.sort((d,g)=>d.start-g.start);let h=0;for(let d=1;d<f.length;d++){const g=f[h],b=f[d];b.start<=g.start+g.count+1?g.count=Math.max(g.count,b.start+b.count-g.start):(++h,f[h]=b)}f.length=h+1;for(let d=0,g=f.length;d<g;d++){const b=f[d];t.bufferSubData(c,b.start*u.BYTES_PER_ELEMENT,u,b.start,b.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function a(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(t.deleteBuffer(l.buffer),e.delete(o))}function s(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,n(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(c.buffer,o,l),c.version=o.version}}return{get:r,remove:a,update:s}}var sye=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,oye=`#ifdef USE_ALPHAHASH
	const float ALPHA_HASH_SCALE = 0.05;
	float hash2D( vec2 value ) {
		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
	}
	float hash3D( vec3 value ) {
		return hash2D( vec2( hash2D( value.xy ), value.z ) );
	}
	float getAlphaHashThreshold( vec3 position ) {
		float maxDeriv = max(
			length( dFdx( position.xyz ) ),
			length( dFdy( position.xyz ) )
		);
		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
		vec2 pixScales = vec2(
			exp2( floor( log2( pixScale ) ) ),
			exp2( ceil( log2( pixScale ) ) )
		);
		vec2 alpha = vec2(
			hash3D( floor( pixScales.x * position.xyz ) ),
			hash3D( floor( pixScales.y * position.xyz ) )
		);
		float lerpFactor = fract( log2( pixScale ) );
		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
		float a = min( lerpFactor, 1.0 - lerpFactor );
		vec3 cases = vec3(
			x * x / ( 2.0 * a * ( 1.0 - a ) ),
			( x - 0.5 * a ) / ( 1.0 - a ),
			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
		);
		float threshold = ( x < ( 1.0 - a ) )
			? ( ( x < a ) ? cases.x : cases.y )
			: cases.z;
		return clamp( threshold , 1.0e-6, 1.0 );
	}
#endif`,lye=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,cye=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,uye=`#ifdef USE_ALPHATEST
	#ifdef ALPHA_TO_COVERAGE
	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
	if ( diffuseColor.a == 0.0 ) discard;
	#else
	if ( diffuseColor.a < alphaTest ) discard;
	#endif
#endif`,fye=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,hye=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_CLEARCOAT ) 
		clearcoatSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_SHEEN ) 
		sheenSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,dye=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,pye=`#ifdef USE_BATCHING
	#if ! defined( GL_ANGLE_multi_draw )
	#define gl_DrawID _gl_DrawID
	uniform int _gl_DrawID;
	#endif
	uniform highp sampler2D batchingTexture;
	uniform highp usampler2D batchingIdTexture;
	mat4 getBatchingMatrix( const in float i ) {
		int size = textureSize( batchingTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
	float getIndirectIndex( const in int i ) {
		int size = textureSize( batchingIdTexture, 0 ).x;
		int x = i % size;
		int y = i / size;
		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
	}
#endif
#ifdef USE_BATCHING_COLOR
	uniform sampler2D batchingColorTexture;
	vec3 getBatchingColor( const in float i ) {
		int size = textureSize( batchingColorTexture, 0 ).x;
		int j = int( i );
		int x = j % size;
		int y = j / size;
		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
	}
#endif`,mye=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,gye=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,bye=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,vye=`float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
} // validated`,yye=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,xye=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vBumpMapUv );
		vec2 dSTdy = dFdy( vBumpMapUv );
		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,_ye=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#ifdef ALPHA_TO_COVERAGE
		float distanceToPlane, distanceGradient;
		float clipOpacity = 1.0;
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
			distanceGradient = fwidth( distanceToPlane ) / 2.0;
			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			if ( clipOpacity == 0.0 ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			float unionClipOpacity = 1.0;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
				distanceGradient = fwidth( distanceToPlane ) / 2.0;
				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			}
			#pragma unroll_loop_end
			clipOpacity *= 1.0 - unionClipOpacity;
		#endif
		diffuseColor.a *= clipOpacity;
		if ( diffuseColor.a == 0.0 ) discard;
	#else
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			bool clipped = true;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
			}
			#pragma unroll_loop_end
			if ( clipped ) discard;
		#endif
	#endif
#endif`,Sye=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,wye=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,Eye=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,Mye=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,Tye=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,Aye=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,Cye=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
	vColor.xyz *= batchingColor.xyz;
#endif`,Rye=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
	varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,kye=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,Dye=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
	vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
	mat3 bm = mat3( batchingMatrix );
	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
	transformedNormal = bm * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = bm * transformedTangent;
	#endif
#endif
#ifdef USE_INSTANCING
	mat3 im = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
	transformedNormal = im * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = im * transformedTangent;
	#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,Oye=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,Iye=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,Nye=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
		emissiveColor = sRGBTransferEOTF( emissiveColor );
	#endif
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,Lye=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,Pye="gl_FragColor = linearToOutputTexel( gl_FragColor );",Uye=`vec4 LinearTransferOETF( in vec4 value ) {
	return value;
}
vec4 sRGBTransferEOTF( in vec4 value ) {
	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 sRGBTransferOETF( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,Fye=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,Bye=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	uniform mat3 envMapRotation;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,zye=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,jye=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,Hye=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,Vye=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,Gye=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,Wye=`#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`,Xye=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,qye=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,Kye=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,Yye=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,Jye=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,$ye=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
	uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
	if ( cutoffDistance > 0.0 ) {
		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
	}
	return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,Zye=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	#ifdef USE_ANISOTROPY
		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
			#ifdef ENVMAP_TYPE_CUBE_UV
				vec3 bentNormal = cross( bitangent, viewDir );
				bentNormal = normalize( cross( bentNormal, bitangent ) );
				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
				return getIBLRadiance( viewDir, bentNormal, roughness );
			#else
				return vec3( 0.0 );
			#endif
		}
	#endif
#endif`,Qye=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,exe=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,txe=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,nxe=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,ixe=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef USE_SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULAR_COLORMAP
			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
		#endif
		#ifdef USE_SPECULAR_INTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
	material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEEN_COLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEEN_ROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
	#endif
#endif
#ifdef USE_ANISOTROPY
	#ifdef USE_ANISOTROPYMAP
		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
	#else
		vec2 anisotropyV = anisotropyVector;
	#endif
	material.anisotropy = length( anisotropyV );
	if( material.anisotropy == 0.0 ) {
		anisotropyV = vec2( 1.0, 0.0 );
	} else {
		anisotropyV /= material.anisotropy;
		material.anisotropy = saturate( material.anisotropy );
	}
	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,rxe=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	float dispersion;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
		float v = 0.5 / ( gv + gl );
		return saturate(v);
	}
	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
		float a2 = alphaT * alphaB;
		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
		highp float v2 = dot( v, v );
		float w2 = a2 / v2;
		return RECIPROCAL_PI * a2 * pow2 ( w2 );
	}
#endif
#ifdef USE_CLEARCOAT
	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
		vec3 f0 = material.clearcoatF0;
		float f90 = material.clearcoatF90;
		float roughness = material.clearcoatRoughness;
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = F_Schlick( f0, f90, dotVH );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
	vec3 f0 = material.specularColor;
	float f90 = material.specularF90;
	float roughness = material.roughness;
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	#ifdef USE_IRIDESCENCE
		F = mix( F, material.iridescenceFresnel, material.iridescence );
	#endif
	#ifdef USE_ANISOTROPY
		float dotTL = dot( material.anisotropyT, lightDir );
		float dotTV = dot( material.anisotropyT, viewDir );
		float dotTH = dot( material.anisotropyT, halfDir );
		float dotBL = dot( material.anisotropyB, lightDir );
		float dotBV = dot( material.anisotropyB, viewDir );
		float dotBH = dot( material.anisotropyB, halfDir );
		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
	#else
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
	#endif
	return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometryNormal;
		vec3 viewDir = geometryViewDir;
		vec3 position = geometryPosition;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,axe=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
	geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometryPosition, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometryPosition, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	#if defined( USE_LIGHT_PROBES )
		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
	#endif
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,sxe=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometryNormal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,oxe=`#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`,lxe=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,cxe=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,uxe=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,fxe=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,hxe=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,dxe=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,pxe=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	#if defined( USE_POINTS_UV )
		vec2 uv = vUv;
	#else
		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
	#endif
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,mxe=`#if defined( USE_POINTS_UV )
	varying vec2 vUv;
#else
	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
		uniform mat3 uvTransform;
	#endif
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,gxe=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,bxe=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,vxe=`#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`,yxe=`#if defined( USE_MORPHCOLORS )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,xxe=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,_xe=`#ifdef USE_MORPHTARGETS
	#ifndef USE_INSTANCING_MORPH
		uniform float morphTargetBaseInfluence;
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	#endif
	uniform sampler2DArray morphTargetsTexture;
	uniform ivec2 morphTargetsTextureSize;
	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
		int y = texelIndex / morphTargetsTextureSize.x;
		int x = texelIndex - y * morphTargetsTextureSize.x;
		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
		return texelFetch( morphTargetsTexture, morphUV, 0 );
	}
#endif`,Sxe=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,wxe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = dFdx( vViewPosition );
	vec3 fdy = dFdy( vViewPosition );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal *= faceDirection;
	#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
	#ifdef USE_TANGENT
		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn = getTangentFrame( - vViewPosition, normal,
		#if defined( USE_NORMALMAP )
			vNormalMapUv
		#elif defined( USE_CLEARCOAT_NORMALMAP )
			vClearcoatNormalMapUv
		#else
			vUv
		#endif
		);
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn[0] *= faceDirection;
		tbn[1] *= faceDirection;
	#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	#ifdef USE_TANGENT
		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn2[0] *= faceDirection;
		tbn2[1] *= faceDirection;
	#endif
#endif
vec3 nonPerturbedNormal = normal;`,Exe=`#ifdef USE_NORMALMAP_OBJECTSPACE
	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,Mxe=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Txe=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Axe=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,Cxe=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( uv.st );
		vec2 st1 = dFdy( uv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
		return mat3( T * scale, B * scale, N );
	}
#endif`,Rxe=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,kxe=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,Dxe=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif`,Oxe=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,Ixe=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Nxe=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
const float Inv255 = 1. / 255.;
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
vec4 packDepthToRGBA( const in float v ) {
	if( v <= 0.0 )
		return vec4( 0., 0., 0., 0. );
	if( v >= 1.0 )
		return vec4( 1., 1., 1., 1. );
	float vuf;
	float af = modf( v * PackFactors.a, vuf );
	float bf = modf( vuf * ShiftRight8, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
}
vec3 packDepthToRGB( const in float v ) {
	if( v <= 0.0 )
		return vec3( 0., 0., 0. );
	if( v >= 1.0 )
		return vec3( 1., 1., 1. );
	float vuf;
	float bf = modf( v * PackFactors.b, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec3( vuf * Inv255, gf * PackUpscale, bf );
}
vec2 packDepthToRG( const in float v ) {
	if( v <= 0.0 )
		return vec2( 0., 0. );
	if( v >= 1.0 )
		return vec2( 1., 1. );
	float vuf;
	float gf = modf( v * 256., vuf );
	return vec2( vuf * Inv255, gf );
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors4 );
}
float unpackRGBToDepth( const in vec3 v ) {
	return dot( v, UnpackFactors3 );
}
float unpackRGToDepth( const in vec2 v ) {
	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
}
vec4 pack2HalfToRGBA( const in vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( const in vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * depth - far );
}`,Lxe=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,Pxe=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
	mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,Uxe=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,Fxe=`#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`,Bxe=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,zxe=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,jxe=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
		#ifdef USE_REVERSEDEPTHBUF
			return step( depth, compare );
		#else
			return step( compare, depth );
		#endif
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		#ifdef USE_REVERSEDEPTHBUF
			float hard_shadow = step( distribution.x, compare );
		#else
			float hard_shadow = step( compare , distribution.x );
		#endif
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		float shadow = 1.0;
		vec3 lightToPosition = shadowCoord.xyz;
		
		float lightToPositionLength = length( lightToPosition );
		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
			vec3 bd3D = normalize( lightToPosition );
			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
				shadow = (
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
				) * ( 1.0 / 9.0 );
			#else
				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
			#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
#endif`,Hxe=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,Vxe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
	vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
	#if NUM_DIR_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
#endif`,Gxe=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,Wxe=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,Xxe=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	mat4 getBoneMatrix( const in float i ) {
		int size = textureSize( boneTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif`,qxe=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,Kxe=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,Yxe=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,Jxe=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,$xe=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,Zxe=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 CineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
	vec3( 1.6605, - 0.1246, - 0.0182 ),
	vec3( - 0.5876, 1.1329, - 0.1006 ),
	vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
	vec3( 0.6274, 0.0691, 0.0164 ),
	vec3( 0.3293, 0.9195, 0.0880 ),
	vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
	vec3 x2 = x * x;
	vec3 x4 = x2 * x2;
	return + 15.5 * x4 * x2
		- 40.14 * x4 * x
		+ 31.96 * x4
		- 6.868 * x2 * x
		+ 0.4298 * x2
		+ 0.1191 * x
		- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
	const mat3 AgXInsetMatrix = mat3(
		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
	);
	const mat3 AgXOutsetMatrix = mat3(
		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
	);
	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
	color *= toneMappingExposure;
	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
	color = AgXInsetMatrix * color;
	color = max( color, 1e-10 );	color = log2( color );
	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
	color = clamp( color, 0.0, 1.0 );
	color = agxDefaultContrastApprox( color );
	color = AgXOutsetMatrix * color;
	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
	color = clamp( color, 0.0, 1.0 );
	return color;
}
vec3 NeutralToneMapping( vec3 color ) {
	const float StartCompression = 0.8 - 0.04;
	const float Desaturation = 0.15;
	color *= toneMappingExposure;
	float x = min( color.r, min( color.g, color.b ) );
	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
	color -= offset;
	float peak = max( color.r, max( color.g, color.b ) );
	if ( peak < StartCompression ) return color;
	float d = 1. - StartCompression;
	float newPeak = 1. - d * d / ( peak + d - StartCompression );
	color *= newPeak / peak;
	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
	return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,Qxe=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmitted = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,e1e=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	float w0( float a ) {
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
	}
	float w1( float a ) {
		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
	}
	float w2( float a ){
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
	}
	float w3( float a ) {
		return ( 1.0 / 6.0 ) * ( a * a * a );
	}
	float g0( float a ) {
		return w0( a ) + w1( a );
	}
	float g1( float a ) {
		return w2( a ) + w3( a );
	}
	float h0( float a ) {
		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
	}
	float h1( float a ) {
		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
	}
	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
		uv = uv * texelSize.zw + 0.5;
		vec2 iuv = floor( uv );
		vec2 fuv = fract( uv );
		float g0x = g0( fuv.x );
		float g1x = g1( fuv.x );
		float h0x = h0( fuv.x );
		float h1x = h1( fuv.x );
		float h0y = h0( fuv.y );
		float h1y = h1( fuv.y );
		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
	}
	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
		vec2 fLodSizeInv = 1.0 / fLodSize;
		vec2 cLodSizeInv = 1.0 / cLodSize;
		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
		return mix( fSample, cSample, fract( lod ) );
	}
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
	}
	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( isinf( attenuationDistance ) ) {
			return vec3( 1.0 );
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec4 transmittedLight;
		vec3 transmittance;
		#ifdef USE_DISPERSION
			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
			for ( int i = 0; i < 3; i ++ ) {
				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
				vec3 refractedRayExit = position + transmissionRay;
				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
				refractionCoords += 1.0;
				refractionCoords /= 2.0;
				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
				transmittedLight[ i ] = transmissionSample[ i ];
				transmittedLight.a += transmissionSample.a;
				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
			}
			transmittedLight.a /= 3.0;
		#else
			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
			vec3 refractedRayExit = position + transmissionRay;
			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
			refractionCoords += 1.0;
			refractionCoords /= 2.0;
			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		#endif
		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
	}
#endif`,t1e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,n1e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	uniform mat3 mapTransform;
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	uniform mat3 alphaMapTransform;
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	uniform mat3 lightMapTransform;
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	uniform mat3 aoMapTransform;
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	uniform mat3 bumpMapTransform;
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	uniform mat3 normalMapTransform;
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
	uniform mat3 displacementMapTransform;
	varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	uniform mat3 emissiveMapTransform;
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	uniform mat3 metalnessMapTransform;
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	uniform mat3 roughnessMapTransform;
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	uniform mat3 anisotropyMapTransform;
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	uniform mat3 clearcoatMapTransform;
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform mat3 clearcoatNormalMapTransform;
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform mat3 clearcoatRoughnessMapTransform;
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	uniform mat3 sheenColorMapTransform;
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	uniform mat3 sheenRoughnessMapTransform;
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	uniform mat3 iridescenceMapTransform;
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform mat3 iridescenceThicknessMapTransform;
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
	uniform mat3 specularMapTransform;
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	uniform mat3 specularColorMapTransform;
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	uniform mat3 specularIntensityMapTransform;
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,i1e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,r1e=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_BATCHING
		worldPosition = batchingMatrix * worldPosition;
	#endif
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`;const a1e=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,s1e=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,o1e=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,l1e=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,c1e=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,u1e=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
	gl_FragColor = texColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,f1e=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,h1e=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <logdepthbuf_fragment>
	#ifdef USE_REVERSEDEPTHBUF
		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
	#else
		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
	#endif
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#elif DEPTH_PACKING == 3202
		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
	#elif DEPTH_PACKING == 3203
		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
	#endif
}`,d1e=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,p1e=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,m1e=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,g1e=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,b1e=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,v1e=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,y1e=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,x1e=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,_1e=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,S1e=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,w1e=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,E1e=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,M1e=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,T1e=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,A1e=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,C1e=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,R1e=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,k1e=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef USE_SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULAR_COLORMAP
		uniform sampler2D specularColorMap;
	#endif
	#ifdef USE_SPECULAR_INTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
	uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEEN_COLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEEN_ROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
#ifdef USE_ANISOTROPY
	uniform vec2 anisotropyVector;
	#ifdef USE_ANISOTROPYMAP
		uniform sampler2D anisotropyMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,D1e=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,O1e=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,I1e=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
	varying vec2 vUv;
	uniform mat3 uvTransform;
#endif
void main() {
	#ifdef USE_POINTS_UV
		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	#endif
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,N1e=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,L1e=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,P1e=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	#include <logdepthbuf_fragment>
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,U1e=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix[ 3 ];
	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,F1e=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,hn={alphahash_fragment:sye,alphahash_pars_fragment:oye,alphamap_fragment:lye,alphamap_pars_fragment:cye,alphatest_fragment:uye,alphatest_pars_fragment:fye,aomap_fragment:hye,aomap_pars_fragment:dye,batching_pars_vertex:pye,batching_vertex:mye,begin_vertex:gye,beginnormal_vertex:bye,bsdfs:vye,iridescence_fragment:yye,bumpmap_pars_fragment:xye,clipping_planes_fragment:_ye,clipping_planes_pars_fragment:Sye,clipping_planes_pars_vertex:wye,clipping_planes_vertex:Eye,color_fragment:Mye,color_pars_fragment:Tye,color_pars_vertex:Aye,color_vertex:Cye,common:Rye,cube_uv_reflection_fragment:kye,defaultnormal_vertex:Dye,displacementmap_pars_vertex:Oye,displacementmap_vertex:Iye,emissivemap_fragment:Nye,emissivemap_pars_fragment:Lye,colorspace_fragment:Pye,colorspace_pars_fragment:Uye,envmap_fragment:Fye,envmap_common_pars_fragment:Bye,envmap_pars_fragment:zye,envmap_pars_vertex:jye,envmap_physical_pars_fragment:Zye,envmap_vertex:Hye,fog_vertex:Vye,fog_pars_vertex:Gye,fog_fragment:Wye,fog_pars_fragment:Xye,gradientmap_pars_fragment:qye,lightmap_pars_fragment:Kye,lights_lambert_fragment:Yye,lights_lambert_pars_fragment:Jye,lights_pars_begin:$ye,lights_toon_fragment:Qye,lights_toon_pars_fragment:exe,lights_phong_fragment:txe,lights_phong_pars_fragment:nxe,lights_physical_fragment:ixe,lights_physical_pars_fragment:rxe,lights_fragment_begin:axe,lights_fragment_maps:sxe,lights_fragment_end:oxe,logdepthbuf_fragment:lxe,logdepthbuf_pars_fragment:cxe,logdepthbuf_pars_vertex:uxe,logdepthbuf_vertex:fxe,map_fragment:hxe,map_pars_fragment:dxe,map_particle_fragment:pxe,map_particle_pars_fragment:mxe,metalnessmap_fragment:gxe,metalnessmap_pars_fragment:bxe,morphinstance_vertex:vxe,morphcolor_vertex:yxe,morphnormal_vertex:xxe,morphtarget_pars_vertex:_xe,morphtarget_vertex:Sxe,normal_fragment_begin:wxe,normal_fragment_maps:Exe,normal_pars_fragment:Mxe,normal_pars_vertex:Txe,normal_vertex:Axe,normalmap_pars_fragment:Cxe,clearcoat_normal_fragment_begin:Rxe,clearcoat_normal_fragment_maps:kxe,clearcoat_pars_fragment:Dxe,iridescence_pars_fragment:Oxe,opaque_fragment:Ixe,packing:Nxe,premultiplied_alpha_fragment:Lxe,project_vertex:Pxe,dithering_fragment:Uxe,dithering_pars_fragment:Fxe,roughnessmap_fragment:Bxe,roughnessmap_pars_fragment:zxe,shadowmap_pars_fragment:jxe,shadowmap_pars_vertex:Hxe,shadowmap_vertex:Vxe,shadowmask_pars_fragment:Gxe,skinbase_vertex:Wxe,skinning_pars_vertex:Xxe,skinning_vertex:qxe,skinnormal_vertex:Kxe,specularmap_fragment:Yxe,specularmap_pars_fragment:Jxe,tonemapping_fragment:$xe,tonemapping_pars_fragment:Zxe,transmission_fragment:Qxe,transmission_pars_fragment:e1e,uv_pars_fragment:t1e,uv_pars_vertex:n1e,uv_vertex:i1e,worldpos_vertex:r1e,background_vert:a1e,background_frag:s1e,backgroundCube_vert:o1e,backgroundCube_frag:l1e,cube_vert:c1e,cube_frag:u1e,depth_vert:f1e,depth_frag:h1e,distanceRGBA_vert:d1e,distanceRGBA_frag:p1e,equirect_vert:m1e,equirect_frag:g1e,linedashed_vert:b1e,linedashed_frag:v1e,meshbasic_vert:y1e,meshbasic_frag:x1e,meshlambert_vert:_1e,meshlambert_frag:S1e,meshmatcap_vert:w1e,meshmatcap_frag:E1e,meshnormal_vert:M1e,meshnormal_frag:T1e,meshphong_vert:A1e,meshphong_frag:C1e,meshphysical_vert:R1e,meshphysical_frag:k1e,meshtoon_vert:D1e,meshtoon_frag:O1e,points_vert:I1e,points_frag:N1e,shadow_vert:L1e,shadow_frag:P1e,sprite_vert:U1e,sprite_frag:F1e},tn={common:{diffuse:{value:new Ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new $n},alphaMap:{value:null},alphaMapTransform:{value:new $n},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new $n}},envmap:{envMap:{value:null},envMapRotation:{value:new $n},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new $n}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new $n}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new $n},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new $n},normalScale:{value:new wt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new $n},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new $n}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new $n}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new $n}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ut(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new $n},alphaTest:{value:0},uvTransform:{value:new $n}},sprite:{diffuse:{value:new Ut(16777215)},opacity:{value:1},center:{value:new wt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new $n},alphaMap:{value:null},alphaMapTransform:{value:new $n},alphaTest:{value:0}}},iu={basic:{uniforms:vo([tn.common,tn.specularmap,tn.envmap,tn.aomap,tn.lightmap,tn.fog]),vertexShader:hn.meshbasic_vert,fragmentShader:hn.meshbasic_frag},lambert:{uniforms:vo([tn.common,tn.specularmap,tn.envmap,tn.aomap,tn.lightmap,tn.emissivemap,tn.bumpmap,tn.normalmap,tn.displacementmap,tn.fog,tn.lights,{emissive:{value:new Ut(0)}}]),vertexShader:hn.meshlambert_vert,fragmentShader:hn.meshlambert_frag},phong:{uniforms:vo([tn.common,tn.specularmap,tn.envmap,tn.aomap,tn.lightmap,tn.emissivemap,tn.bumpmap,tn.normalmap,tn.displacementmap,tn.fog,tn.lights,{emissive:{value:new Ut(0)},specular:{value:new Ut(1118481)},shininess:{value:30}}]),vertexShader:hn.meshphong_vert,fragmentShader:hn.meshphong_frag},standard:{uniforms:vo([tn.common,tn.envmap,tn.aomap,tn.lightmap,tn.emissivemap,tn.bumpmap,tn.normalmap,tn.displacementmap,tn.roughnessmap,tn.metalnessmap,tn.fog,tn.lights,{emissive:{value:new Ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag},toon:{uniforms:vo([tn.common,tn.aomap,tn.lightmap,tn.emissivemap,tn.bumpmap,tn.normalmap,tn.displacementmap,tn.gradientmap,tn.fog,tn.lights,{emissive:{value:new Ut(0)}}]),vertexShader:hn.meshtoon_vert,fragmentShader:hn.meshtoon_frag},matcap:{uniforms:vo([tn.common,tn.bumpmap,tn.normalmap,tn.displacementmap,tn.fog,{matcap:{value:null}}]),vertexShader:hn.meshmatcap_vert,fragmentShader:hn.meshmatcap_frag},points:{uniforms:vo([tn.points,tn.fog]),vertexShader:hn.points_vert,fragmentShader:hn.points_frag},dashed:{uniforms:vo([tn.common,tn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hn.linedashed_vert,fragmentShader:hn.linedashed_frag},depth:{uniforms:vo([tn.common,tn.displacementmap]),vertexShader:hn.depth_vert,fragmentShader:hn.depth_frag},normal:{uniforms:vo([tn.common,tn.bumpmap,tn.normalmap,tn.displacementmap,{opacity:{value:1}}]),vertexShader:hn.meshnormal_vert,fragmentShader:hn.meshnormal_frag},sprite:{uniforms:vo([tn.sprite,tn.fog]),vertexShader:hn.sprite_vert,fragmentShader:hn.sprite_frag},background:{uniforms:{uvTransform:{value:new $n},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:hn.background_vert,fragmentShader:hn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new $n}},vertexShader:hn.backgroundCube_vert,fragmentShader:hn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:hn.cube_vert,fragmentShader:hn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hn.equirect_vert,fragmentShader:hn.equirect_frag},distanceRGBA:{uniforms:vo([tn.common,tn.displacementmap,{referencePosition:{value:new te},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hn.distanceRGBA_vert,fragmentShader:hn.distanceRGBA_frag},shadow:{uniforms:vo([tn.lights,tn.fog,{color:{value:new Ut(0)},opacity:{value:1}}]),vertexShader:hn.shadow_vert,fragmentShader:hn.shadow_frag}};iu.physical={uniforms:vo([iu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new $n},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new $n},clearcoatNormalScale:{value:new wt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new $n},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new $n},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new $n},sheen:{value:0},sheenColor:{value:new Ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new $n},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new $n},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new $n},transmissionSamplerSize:{value:new wt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new $n},attenuationDistance:{value:0},attenuationColor:{value:new Ut(0)},specularColor:{value:new Ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new $n},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new $n},anisotropyVector:{value:new wt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new $n}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag};const Yw={r:0,b:0,g:0},Fp=new vi,B1e=new Dt;function z1e(t,e,n,i,r,a,s){const o=new Ut(0);let l=a===!0?0:1,c,u,f=null,h=0,d=null;function g(_){let w=_.isScene===!0?_.background:null;return w&&w.isTexture&&(w=(_.backgroundBlurriness>0?n:e).get(w)),w}function b(_){let w=!1;const M=g(_);M===null?p(o,l):M&&M.isColor&&(p(M,1),w=!0);const S=t.xr.getEnvironmentBlendMode();S==="additive"?i.buffers.color.setClear(0,0,0,1,s):S==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,s),(t.autoClear||w)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function y(_,w){const M=g(w);M&&(M.isCubeTexture||M.mapping===Vv)?(u===void 0&&(u=new _i(new ep(1,1,1),new fs({name:"BackgroundCubeMaterial",uniforms:lv(iu.backgroundCube.uniforms),vertexShader:iu.backgroundCube.vertexShader,fragmentShader:iu.backgroundCube.fragmentShader,side:Da,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(S,A,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Fp.copy(w.backgroundRotation),Fp.x*=-1,Fp.y*=-1,Fp.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Fp.y*=-1,Fp.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(B1e.makeRotationFromEuler(Fp)),u.material.toneMapped=bi.getTransfer(M.colorSpace)!==pr,(f!==M||h!==M.version||d!==t.toneMapping)&&(u.material.needsUpdate=!0,f=M,h=M.version,d=t.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new _i(new Il(2,2),new fs({name:"BackgroundMaterial",uniforms:lv(iu.background.uniforms),vertexShader:iu.background.vertexShader,fragmentShader:iu.background.fragmentShader,side:_u,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=bi.getTransfer(M.colorSpace)!==pr,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(f!==M||h!==M.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,f=M,h=M.version,d=t.toneMapping),c.layers.enableAll(),_.unshift(c,c.geometry,c.material,0,0,null))}function p(_,w){_.getRGB(Yw,n$(t)),i.buffers.color.setClear(Yw.r,Yw.g,Yw.b,w,s)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(_,w=1){o.set(_),l=w,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,p(o,l)},render:b,addToRenderList:y,dispose:x}}function j1e(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=h(null);let a=r,s=!1;function o(R,N,P,j,z){let X=!1;const F=f(j,P,N);a!==F&&(a=F,c(a.object)),X=d(R,j,P,z),X&&g(R,j,P,z),z!==null&&e.update(z,t.ELEMENT_ARRAY_BUFFER),(X||s)&&(s=!1,w(R,N,P,j),z!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(z).buffer))}function l(){return t.createVertexArray()}function c(R){return t.bindVertexArray(R)}function u(R){return t.deleteVertexArray(R)}function f(R,N,P){const j=P.wireframe===!0;let z=i[R.id];z===void 0&&(z={},i[R.id]=z);let X=z[N.id];X===void 0&&(X={},z[N.id]=X);let F=X[j];return F===void 0&&(F=h(l()),X[j]=F),F}function h(R){const N=[],P=[],j=[];for(let z=0;z<n;z++)N[z]=0,P[z]=0,j[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:P,attributeDivisors:j,object:R,attributes:{},index:null}}function d(R,N,P,j){const z=a.attributes,X=N.attributes;let F=0;const H=P.getAttributes();for(const V in H)if(H[V].location>=0){const B=z[V];let Y=X[V];if(Y===void 0&&(V==="instanceMatrix"&&R.instanceMatrix&&(Y=R.instanceMatrix),V==="instanceColor"&&R.instanceColor&&(Y=R.instanceColor)),B===void 0||B.attribute!==Y||Y&&B.data!==Y.data)return!0;F++}return a.attributesNum!==F||a.index!==j}function g(R,N,P,j){const z={},X=N.attributes;let F=0;const H=P.getAttributes();for(const V in H)if(H[V].location>=0){let B=X[V];B===void 0&&(V==="instanceMatrix"&&R.instanceMatrix&&(B=R.instanceMatrix),V==="instanceColor"&&R.instanceColor&&(B=R.instanceColor));const Y={};Y.attribute=B,B&&B.data&&(Y.data=B.data),z[V]=Y,F++}a.attributes=z,a.attributesNum=F,a.index=j}function b(){const R=a.newAttributes;for(let N=0,P=R.length;N<P;N++)R[N]=0}function y(R){p(R,0)}function p(R,N){const P=a.newAttributes,j=a.enabledAttributes,z=a.attributeDivisors;P[R]=1,j[R]===0&&(t.enableVertexAttribArray(R),j[R]=1),z[R]!==N&&(t.vertexAttribDivisor(R,N),z[R]=N)}function x(){const R=a.newAttributes,N=a.enabledAttributes;for(let P=0,j=N.length;P<j;P++)N[P]!==R[P]&&(t.disableVertexAttribArray(P),N[P]=0)}function _(R,N,P,j,z,X,F){F===!0?t.vertexAttribIPointer(R,N,P,z,X):t.vertexAttribPointer(R,N,P,j,z,X)}function w(R,N,P,j){b();const z=j.attributes,X=P.getAttributes(),F=N.defaultAttributeValues;for(const H in X){const V=X[H];if(V.location>=0){let W=z[H];if(W===void 0&&(H==="instanceMatrix"&&R.instanceMatrix&&(W=R.instanceMatrix),H==="instanceColor"&&R.instanceColor&&(W=R.instanceColor)),W!==void 0){const B=W.normalized,Y=W.itemSize,Z=e.get(W);if(Z===void 0)continue;const G=Z.buffer,de=Z.type,oe=Z.bytesPerElement,le=de===t.INT||de===t.UNSIGNED_INT||W.gpuType===Gv;if(W.isInterleavedBufferAttribute){const ue=W.data,Se=ue.stride,Te=W.offset;if(ue.isInstancedInterleavedBuffer){for(let Pe=0;Pe<V.locationSize;Pe++)p(V.location+Pe,ue.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let Pe=0;Pe<V.locationSize;Pe++)y(V.location+Pe);t.bindBuffer(t.ARRAY_BUFFER,G);for(let Pe=0;Pe<V.locationSize;Pe++)_(V.location+Pe,Y/V.locationSize,de,B,Se*oe,(Te+Y/V.locationSize*Pe)*oe,le)}else{if(W.isInstancedBufferAttribute){for(let ue=0;ue<V.locationSize;ue++)p(V.location+ue,W.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=W.meshPerAttribute*W.count)}else for(let ue=0;ue<V.locationSize;ue++)y(V.location+ue);t.bindBuffer(t.ARRAY_BUFFER,G);for(let ue=0;ue<V.locationSize;ue++)_(V.location+ue,Y/V.locationSize,de,B,Y*oe,Y/V.locationSize*ue*oe,le)}}else if(F!==void 0){const B=F[H];if(B!==void 0)switch(B.length){case 2:t.vertexAttrib2fv(V.location,B);break;case 3:t.vertexAttrib3fv(V.location,B);break;case 4:t.vertexAttrib4fv(V.location,B);break;default:t.vertexAttrib1fv(V.location,B)}}}}x()}function M(){C();for(const R in i){const N=i[R];for(const P in N){const j=N[P];for(const z in j)u(j[z].object),delete j[z];delete N[P]}delete i[R]}}function S(R){if(i[R.id]===void 0)return;const N=i[R.id];for(const P in N){const j=N[P];for(const z in j)u(j[z].object),delete j[z];delete N[P]}delete i[R.id]}function A(R){for(const N in i){const P=i[N];if(P[R.id]===void 0)continue;const j=P[R.id];for(const z in j)u(j[z].object),delete j[z];delete P[R.id]}}function C(){k(),s=!0,a!==r&&(a=r,c(a.object))}function k(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:o,reset:C,resetDefaultState:k,dispose:M,releaseStatesOfGeometry:S,releaseStatesOfProgram:A,initAttributes:b,enableAttribute:y,disableUnusedAttributes:x}}function H1e(t,e,n){let i;function r(c){i=c}function a(c,u){t.drawArrays(i,c,u),n.update(u,i,1)}function s(c,u,f){f!==0&&(t.drawArraysInstanced(i,c,u,f),n.update(u,i,f))}function o(c,u,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,c,0,u,0,f);let d=0;for(let g=0;g<f;g++)d+=u[g];n.update(d,i,1)}function l(c,u,f,h){if(f===0)return;const d=e.get("WEBGL_multi_draw");if(d===null)for(let g=0;g<c.length;g++)s(c[g],u[g],h[g]);else{d.multiDrawArraysInstancedWEBGL(i,c,0,u,0,h,0,f);let g=0;for(let b=0;b<f;b++)g+=u[b]*h[b];n.update(g,i,1)}}this.setMode=r,this.render=a,this.renderInstances=s,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function V1e(t,e,n,i){let r;function a(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(A){return!(A!==Qr&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const C=A===as&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==Ao&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==wr&&!C)}function l(A){if(A==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=n.logarithmicDepthBuffer===!0,h=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),_=t.getParameter(t.MAX_VARYING_VECTORS),w=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),M=g>0,S=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:l,textureFormatReadable:s,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:f,reversedDepthBuffer:h,maxTextures:d,maxVertexTextures:g,maxTextureSize:b,maxCubemapSize:y,maxAttributes:p,maxVertexUniforms:x,maxVaryings:_,maxFragmentUniforms:w,vertexTextures:M,maxSamples:S}}function G1e(t){const e=this;let n=null,i=0,r=!1,a=!1;const s=new nu,o=new $n,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const d=f.length!==0||h||i!==0||r;return r=h,i=f.length,d},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){n=u(f,h,0)},this.setState=function(f,h,d){const g=f.clippingPlanes,b=f.clipIntersection,y=f.clipShadows,p=t.get(f);if(!r||g===null||g.length===0||a&&!y)a?u(null):c();else{const x=a?0:i,_=x*4;let w=p.clippingState||null;l.value=w,w=u(g,h,_,d);for(let M=0;M!==_;++M)w[M]=n[M];p.clippingState=w,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,d,g){const b=f!==null?f.length:0;let y=null;if(b!==0){if(y=l.value,g!==!0||y===null){const p=d+b*4,x=h.matrixWorldInverse;o.getNormalMatrix(x),(y===null||y.length<p)&&(y=new Float32Array(p));for(let _=0,w=d;_!==b;++_,w+=4)s.copy(f[_]).applyMatrix4(x,o),s.normal.toArray(y,w),y[w+3]=s.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=b,e.numIntersection=0,y}}function W1e(t){let e=new WeakMap;function n(s,o){return o===$0?s.mapping=df:o===H1&&(s.mapping=Xd),s}function i(s){if(s&&s.isTexture){const o=s.mapping;if(o===$0||o===H1)if(e.has(s)){const l=e.get(s).texture;return n(l,s.mapping)}else{const l=s.image;if(l&&l.height>0){const c=new ZP(l.height);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",r),n(c.texture,s.mapping)}else return null}}return s}function r(s){const o=s.target;o.removeEventListener("dispose",r);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}const a0=4,qj=[.125,.215,.35,.446,.526,.582],am=20,jk=new Ah,Kj=new Ut;let Hk=null,Vk=0,Gk=0,Wk=!1;const em=(1+Math.sqrt(5))/2,bb=1/em,Yj=[new te(-em,bb,0),new te(em,bb,0),new te(-bb,0,em),new te(bb,0,em),new te(0,em,-bb),new te(0,em,bb),new te(-1,1,-1),new te(1,1,-1),new te(-1,1,1),new te(1,1,1)],X1e=new te;class oI{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,n=0,i=.1,r=100,a={}){const{size:s=256,position:o=X1e}=a;Hk=this._renderer.getRenderTarget(),Vk=this._renderer.getActiveCubeFace(),Gk=this._renderer.getActiveMipmapLevel(),Wk=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,o),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Zj(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=$j(),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;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Hk,Vk,Gk),this._renderer.xr.enabled=Wk,e.scissorTest=!1,Jw(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===df||e.mapping===Xd?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Hk=this._renderer.getRenderTarget(),Vk=this._renderer.getActiveCubeFace(),Gk=this._renderer.getActiveMipmapLevel(),Wk=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=n||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,i={magFilter:Vi,minFilter:Vi,generateMipmaps:!1,type:as,format:Qr,colorSpace:Su,depthBuffer:!1},r=Jj(e,n,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Jj(e,n,i);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=q1e(a)),this._blurMaterial=K1e(a,e,n)}return r}_compileMaterial(e){const n=new _i(this._lodPlanes[0],e);this._renderer.compile(n,jk)}_sceneToCubeUV(e,n,i,r,a){const l=new sa(90,1,n,i),c=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],f=this._renderer,h=f.autoClear,d=f.toneMapping;f.getClearColor(Kj),f.toneMapping=sf,f.autoClear=!1,f.state.buffers.depth.getReversed()&&(f.setRenderTarget(r),f.clearDepth(),f.setRenderTarget(null));const b=new Ds({name:"PMREM.Background",side:Da,depthWrite:!1,depthTest:!1}),y=new _i(new ep,b);let p=!1;const x=e.background;x?x.isColor&&(b.color.copy(x),e.background=null,p=!0):(b.color.copy(Kj),p=!0);for(let _=0;_<6;_++){const w=_%3;w===0?(l.up.set(0,c[_],0),l.position.set(a.x,a.y,a.z),l.lookAt(a.x+u[_],a.y,a.z)):w===1?(l.up.set(0,0,c[_]),l.position.set(a.x,a.y,a.z),l.lookAt(a.x,a.y+u[_],a.z)):(l.up.set(0,c[_],0),l.position.set(a.x,a.y,a.z),l.lookAt(a.x,a.y,a.z+u[_]));const M=this._cubeSize;Jw(r,w*M,_>2?M:0,M,M),f.setRenderTarget(r),p&&f.render(y,l),f.render(e,l)}y.geometry.dispose(),y.material.dispose(),f.toneMapping=d,f.autoClear=h,e.background=x}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===df||e.mapping===Xd;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Zj()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=$j());const a=r?this._cubemapMaterial:this._equirectMaterial,s=new _i(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=e;const l=this._cubeSize;Jw(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(s,jk)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;a<r;a++){const s=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),o=Yj[(r-a-1)%Yj.length];this._blur(e,a-1,a,s,o)}n.autoClear=i}_blur(e,n,i,r,a){const s=this._pingPongRenderTarget;this._halfBlur(e,s,n,i,r,"latitudinal",a),this._halfBlur(s,e,i,i,r,"longitudinal",a)}_halfBlur(e,n,i,r,a,s,o){const l=this._renderer,c=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,f=new _i(this._lodPlanes[r],c),h=c.uniforms,d=this._sizeLods[i]-1,g=isFinite(a)?Math.PI/(2*d):2*Math.PI/(2*am-1),b=a/g,y=isFinite(a)?1+Math.floor(u*b):am;y>am&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${am}`);const p=[];let x=0;for(let A=0;A<am;++A){const C=A/b,k=Math.exp(-C*C/2);p.push(k),A===0?x+=k:A<y&&(x+=2*k)}for(let A=0;A<p.length;A++)p[A]=p[A]/x;h.envMap.value=e.texture,h.samples.value=y,h.weights.value=p,h.latitudinal.value=s==="latitudinal",o&&(h.poleAxis.value=o);const{_lodMax:_}=this;h.dTheta.value=g,h.mipInt.value=_-i;const w=this._sizeLods[r],M=3*w*(r>_-a0?r-_+a0:0),S=4*(this._cubeSize-w);Jw(n,M,S,3*w,2*w),l.setRenderTarget(n),l.render(f,jk)}}function q1e(t){const e=[],n=[],i=[];let r=t;const a=t-a0+1+qj.length;for(let s=0;s<a;s++){const o=Math.pow(2,r);n.push(o);let l=1/o;s>t-a0?l=qj[s-t+a0-1]:s===0&&(l=0),i.push(l);const c=1/(o-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,g=6,b=3,y=2,p=1,x=new Float32Array(b*g*d),_=new Float32Array(y*g*d),w=new Float32Array(p*g*d);for(let S=0;S<d;S++){const A=S%3*2/3-1,C=S>2?0:-1,k=[A,C,0,A+2/3,C,0,A+2/3,C+1,0,A,C,0,A+2/3,C+1,0,A,C+1,0];x.set(k,b*g*S),_.set(h,y*g*S);const R=[S,S,S,S,S,S];w.set(R,p*g*S)}const M=new On;M.setAttribute("position",new In(x,b)),M.setAttribute("uv",new In(_,y)),M.setAttribute("faceIndex",new In(w,p)),e.push(M),r>a0&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function Jj(t,e,n){const i=new Cc(t,e,n);return i.texture.mapping=Vv,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jw(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function K1e(t,e,n){const i=new Float32Array(am),r=new te(0,1,0);return new fs({name:"SphericalGaussianBlur",defines:{n:am,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:EU(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:af,depthTest:!1,depthWrite:!1})}function $j(){return new fs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:EU(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:af,depthTest:!1,depthWrite:!1})}function Zj(){return new fs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:EU(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:af,depthTest:!1,depthWrite:!1})}function EU(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function Y1e(t){let e=new WeakMap,n=null;function i(o){if(o&&o.isTexture){const l=o.mapping,c=l===$0||l===H1,u=l===df||l===Xd;if(c||u){let f=e.get(o);const h=f!==void 0?f.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==h)return n===null&&(n=new oI(t)),f=c?n.fromEquirectangular(o,f):n.fromCubemap(o,f),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),f.texture;if(f!==void 0)return f.texture;{const d=o.image;return c&&d&&d.height>0||u&&d&&r(d)?(n===null&&(n=new oI(t)),f=c?n.fromEquirectangular(o):n.fromCubemap(o),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),o.addEventListener("dispose",a),f.texture):null}}}return o}function r(o){let l=0;const c=6;for(let u=0;u<c;u++)o[u]!==void 0&&l++;return l===c}function a(o){const l=o.target;l.removeEventListener("dispose",a);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function s(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:s}}function J1e(t){const e={};function n(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(i)}return e[i]=r,r}return{has:function(i){return n(i)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(i){const r=n(i);return r===null&&S0("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function $1e(t,e,n,i){const r={},a=new WeakMap;function s(f){const h=f.target;h.index!==null&&e.remove(h.index);for(const g in h.attributes)e.remove(h.attributes[g]);h.removeEventListener("dispose",s),delete r[h.id];const d=a.get(h);d&&(e.remove(d),a.delete(h)),i.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,n.memory.geometries--}function o(f,h){return r[h.id]===!0||(h.addEventListener("dispose",s),r[h.id]=!0,n.memory.geometries++),h}function l(f){const h=f.attributes;for(const d in h)e.update(h[d],t.ARRAY_BUFFER)}function c(f){const h=[],d=f.index,g=f.attributes.position;let b=0;if(d!==null){const x=d.array;b=d.version;for(let _=0,w=x.length;_<w;_+=3){const M=x[_+0],S=x[_+1],A=x[_+2];h.push(M,S,S,A,A,M)}}else if(g!==void 0){const x=g.array;b=g.version;for(let _=0,w=x.length/3-1;_<w;_+=3){const M=_+0,S=_+1,A=_+2;h.push(M,S,S,A,A,M)}}else return;const y=new($J(h)?$P:JP)(h,1);y.version=b;const p=a.get(f);p&&e.remove(p),a.set(f,y)}function u(f){const h=a.get(f);if(h){const d=f.index;d!==null&&h.version<d.version&&c(f)}else c(f);return a.get(f)}return{get:o,update:l,getWireframeAttribute:u}}function Z1e(t,e,n){let i;function r(h){i=h}let a,s;function o(h){a=h.type,s=h.bytesPerElement}function l(h,d){t.drawElements(i,d,a,h*s),n.update(d,i,1)}function c(h,d,g){g!==0&&(t.drawElementsInstanced(i,d,a,h*s,g),n.update(d,i,g))}function u(h,d,g){if(g===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,d,0,a,h,0,g);let y=0;for(let p=0;p<g;p++)y+=d[p];n.update(y,i,1)}function f(h,d,g,b){if(g===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let p=0;p<h.length;p++)c(h[p]/s,d[p],b[p]);else{y.multiDrawElementsInstancedWEBGL(i,d,0,a,h,0,b,0,g);let p=0;for(let x=0;x<g;x++)p+=d[x]*b[x];n.update(p,i,1)}}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=f}function Q1e(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(a,s,o){switch(n.calls++,s){case t.TRIANGLES:n.triangles+=o*(a/3);break;case t.LINES:n.lines+=o*(a/2);break;case t.LINE_STRIP:n.lines+=o*(a-1);break;case t.LINE_LOOP:n.lines+=o*a;break;case t.POINTS:n.points+=o*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function r(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:r,update:i}}function e_e(t,e,n){const i=new WeakMap,r=new ni;function a(s,o,l){const c=s.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,f=u!==void 0?u.length:0;let h=i.get(o);if(h===void 0||h.count!==f){let k=function(){A.dispose(),i.delete(o),o.removeEventListener("dispose",k)};h!==void 0&&h.texture.dispose();const d=o.morphAttributes.position!==void 0,g=o.morphAttributes.normal!==void 0,b=o.morphAttributes.color!==void 0,y=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],x=o.morphAttributes.color||[];let _=0;d===!0&&(_=1),g===!0&&(_=2),b===!0&&(_=3);let w=o.attributes.position.count*_,M=1;w>e.maxTextureSize&&(M=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const S=new Float32Array(w*M*4*f),A=new WA(S,w,M,f);A.type=wr,A.needsUpdate=!0;const C=_*4;for(let R=0;R<f;R++){const N=y[R],P=p[R],j=x[R],z=w*M*4*R;for(let X=0;X<N.count;X++){const F=X*C;d===!0&&(r.fromBufferAttribute(N,X),S[z+F+0]=r.x,S[z+F+1]=r.y,S[z+F+2]=r.z,S[z+F+3]=0),g===!0&&(r.fromBufferAttribute(P,X),S[z+F+4]=r.x,S[z+F+5]=r.y,S[z+F+6]=r.z,S[z+F+7]=0),b===!0&&(r.fromBufferAttribute(j,X),S[z+F+8]=r.x,S[z+F+9]=r.y,S[z+F+10]=r.z,S[z+F+11]=j.itemSize===4?r.w:1)}}h={count:f,texture:A,size:new wt(w,M)},i.set(o,h),o.addEventListener("dispose",k)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)l.getUniforms().setValue(t,"morphTexture",s.morphTexture,n);else{let d=0;for(let b=0;b<c.length;b++)d+=c[b];const g=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(t,"morphTargetBaseInfluence",g),l.getUniforms().setValue(t,"morphTargetInfluences",c)}l.getUniforms().setValue(t,"morphTargetsTexture",h.texture,n),l.getUniforms().setValue(t,"morphTargetsTextureSize",h.size)}return{update:a}}function t_e(t,e,n,i){let r=new WeakMap;function a(l){const c=i.render.frame,u=l.geometry,f=e.get(l,u);if(r.get(f)!==c&&(e.update(f),r.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),r.get(l)!==c&&(n.update(l.instanceMatrix,t.ARRAY_BUFFER),l.instanceColor!==null&&n.update(l.instanceColor,t.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const h=l.skeleton;r.get(h)!==c&&(h.update(),r.set(h,c))}return f}function s(){r=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),n.remove(c.instanceMatrix),c.instanceColor!==null&&n.remove(c.instanceColor)}return{update:a,dispose:s}}const q$=new nr,Qj=new nU(1,1),K$=new WA,Y$=new XA,J$=new B_,e5=[],t5=[],n5=new Float32Array(16),i5=new Float32Array(9),r5=new Float32Array(4);function Qv(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let a=e5[r];if(a===void 0&&(a=new Float32Array(r),e5[r]=a),e!==0){i.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=n,t[s].toArray(a,o)}return a}function ja(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ha(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function yC(t,e){let n=t5[e];n===void 0&&(n=new Int32Array(e),t5[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function n_e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function i_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(ja(n,e))return;t.uniform2fv(this.addr,e),Ha(n,e)}}function r_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(ja(n,e))return;t.uniform3fv(this.addr,e),Ha(n,e)}}function a_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(ja(n,e))return;t.uniform4fv(this.addr,e),Ha(n,e)}}function s_e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(ja(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ha(n,e)}else{if(ja(n,i))return;r5.set(i),t.uniformMatrix2fv(this.addr,!1,r5),Ha(n,i)}}function o_e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(ja(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ha(n,e)}else{if(ja(n,i))return;i5.set(i),t.uniformMatrix3fv(this.addr,!1,i5),Ha(n,i)}}function l_e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(ja(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ha(n,e)}else{if(ja(n,i))return;n5.set(i),t.uniformMatrix4fv(this.addr,!1,n5),Ha(n,i)}}function c_e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function u_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(ja(n,e))return;t.uniform2iv(this.addr,e),Ha(n,e)}}function f_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(ja(n,e))return;t.uniform3iv(this.addr,e),Ha(n,e)}}function h_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(ja(n,e))return;t.uniform4iv(this.addr,e),Ha(n,e)}}function d_e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function p_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(ja(n,e))return;t.uniform2uiv(this.addr,e),Ha(n,e)}}function m_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(ja(n,e))return;t.uniform3uiv(this.addr,e),Ha(n,e)}}function g_e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(ja(n,e))return;t.uniform4uiv(this.addr,e),Ha(n,e)}}function b_e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r);let a;this.type===t.SAMPLER_2D_SHADOW?(Qj.compareFunction=qP,a=Qj):a=q$,n.setTexture2D(e||a,r)}function v_e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||Y$,r)}function y_e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||J$,r)}function x_e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||K$,r)}function __e(t){switch(t){case 5126:return n_e;case 35664:return i_e;case 35665:return r_e;case 35666:return a_e;case 35674:return s_e;case 35675:return o_e;case 35676:return l_e;case 5124:case 35670:return c_e;case 35667:case 35671:return u_e;case 35668:case 35672:return f_e;case 35669:case 35673:return h_e;case 5125:return d_e;case 36294:return p_e;case 36295:return m_e;case 36296:return g_e;case 35678:case 36198:case 36298:case 36306:case 35682:return b_e;case 35679:case 36299:case 36307:return v_e;case 35680:case 36300:case 36308:case 36293:return y_e;case 36289:case 36303:case 36311:case 36292:return x_e}}function S_e(t,e){t.uniform1fv(this.addr,e)}function w_e(t,e){const n=Qv(e,this.size,2);t.uniform2fv(this.addr,n)}function E_e(t,e){const n=Qv(e,this.size,3);t.uniform3fv(this.addr,n)}function M_e(t,e){const n=Qv(e,this.size,4);t.uniform4fv(this.addr,n)}function T_e(t,e){const n=Qv(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function A_e(t,e){const n=Qv(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function C_e(t,e){const n=Qv(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function R_e(t,e){t.uniform1iv(this.addr,e)}function k_e(t,e){t.uniform2iv(this.addr,e)}function D_e(t,e){t.uniform3iv(this.addr,e)}function O_e(t,e){t.uniform4iv(this.addr,e)}function I_e(t,e){t.uniform1uiv(this.addr,e)}function N_e(t,e){t.uniform2uiv(this.addr,e)}function L_e(t,e){t.uniform3uiv(this.addr,e)}function P_e(t,e){t.uniform4uiv(this.addr,e)}function U_e(t,e,n){const i=this.cache,r=e.length,a=yC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTexture2D(e[s]||q$,a[s])}function F_e(t,e,n){const i=this.cache,r=e.length,a=yC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTexture3D(e[s]||Y$,a[s])}function B_e(t,e,n){const i=this.cache,r=e.length,a=yC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTextureCube(e[s]||J$,a[s])}function z_e(t,e,n){const i=this.cache,r=e.length,a=yC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTexture2DArray(e[s]||K$,a[s])}function j_e(t){switch(t){case 5126:return S_e;case 35664:return w_e;case 35665:return E_e;case 35666:return M_e;case 35674:return T_e;case 35675:return A_e;case 35676:return C_e;case 5124:case 35670:return R_e;case 35667:case 35671:return k_e;case 35668:case 35672:return D_e;case 35669:case 35673:return O_e;case 5125:return I_e;case 36294:return N_e;case 36295:return L_e;case 36296:return P_e;case 35678:case 36198:case 36298:case 36306:case 35682:return U_e;case 35679:case 36299:case 36307:return F_e;case 35680:case 36300:case 36308:case 36293:return B_e;case 36289:case 36303:case 36311:case 36292:return z_e}}class H_e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.setValue=__e(n.type)}}class V_e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=j_e(n.type)}}class G_e{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,i){const r=this.seq;for(let a=0,s=r.length;a!==s;++a){const o=r[a];o.setValue(e,n[o.id],i)}}}const Xk=/(\w+)(\])?(\[|\.)?/g;function a5(t,e){t.seq.push(e),t.map[e.id]=e}function W_e(t,e,n){const i=t.name,r=i.length;for(Xk.lastIndex=0;;){const a=Xk.exec(i),s=Xk.lastIndex;let o=a[1];const l=a[2]==="]",c=a[3];if(l&&(o=o|0),c===void 0||c==="["&&s+2===r){a5(n,c===void 0?new H_e(o,t,e):new V_e(o,t,e));break}else{let f=n.map[o];f===void 0&&(f=new G_e(o),a5(n,f)),n=f}}}class pM{constructor(e,n){this.seq=[],this.map={};const i=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const a=e.getActiveUniform(n,r),s=e.getUniformLocation(n,a.name);W_e(a,s,this)}}setValue(e,n,i,r){const a=this.map[n];a!==void 0&&a.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,n,i,r){for(let a=0,s=n.length;a!==s;++a){const o=n[a],l=i[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,a=e.length;r!==a;++r){const s=e[r];s.id in n&&i.push(s)}return i}}function s5(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const X_e=37297;let q_e=0;function K_e(t,e){const n=t.split(`
`),i=[],r=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let s=r;s<a;s++){const o=s+1;i.push(`${o===e?">":" "} ${o}: ${n[s]}`)}return i.join(`
`)}const o5=new $n;function Y_e(t){bi._getMatrix(o5,bi.workingColorSpace,t);const e=`mat3( ${o5.elements.map(n=>n.toFixed(4))} )`;switch(bi.getTransfer(t)){case G1:return[e,"LinearTransferOETF"];case pr:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function l5(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),a=(t.getShaderInfoLog(e)||"").trim();if(i&&a==="")return"";const s=/ERROR: 0:(\d+)/.exec(a);if(s){const o=parseInt(s[1]);return n.toUpperCase()+`

`+a+`

`+K_e(t.getShaderSource(e),o)}else return a}function J_e(t,e){const n=Y_e(e);return[`vec4 ${t}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
`)}function $_e(t,e){let n;switch(e){case OJ:n="Linear";break;case IJ:n="Reinhard";break;case NJ:n="Cineon";break;case FP:n="ACESFilmic";break;case PJ:n="AgX";break;case UJ:n="Neutral";break;case LJ:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const $w=new te;function Z_e(){bi.getLuminanceCoefficients($w);const t=$w.x.toFixed(4),e=$w.y.toFixed(4),n=$w.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${t}, ${e}, ${n} );`,"	return dot( weights, rgb );","}"].join(`
`)}function Q_e(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Rx).join(`
`)}function eSe(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(`
`)}function tSe(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const a=t.getActiveAttrib(e,r),s=a.name;let o=1;a.type===t.FLOAT_MAT2&&(o=2),a.type===t.FLOAT_MAT3&&(o=3),a.type===t.FLOAT_MAT4&&(o=4),n[s]={type:a.type,location:t.getAttribLocation(e,s),locationSize:o}}return n}function Rx(t){return t!==""}function c5(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function u5(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const nSe=/^[ \t]*#include +<([\w\d./]+)>/gm;function lI(t){return t.replace(nSe,rSe)}const iSe=new Map;function rSe(t,e){let n=hn[e];if(n===void 0){const i=iSe.get(e);if(i!==void 0)n=hn[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 lI(n)}const aSe=/#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 f5(t){return t.replace(aSe,sSe)}function sSe(t,e,n,i){let r="";for(let a=parseInt(e);a<parseInt(n);a++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function h5(t){let e=`precision ${t.precision} float;
	precision ${t.precision} int;
	precision ${t.precision} sampler2D;
	precision ${t.precision} samplerCube;
	precision ${t.precision} sampler3D;
	precision ${t.precision} sampler2DArray;
	precision ${t.precision} sampler2DShadow;
	precision ${t.precision} samplerCubeShadow;
	precision ${t.precision} sampler2DArrayShadow;
	precision ${t.precision} isampler2D;
	precision ${t.precision} isampler3D;
	precision ${t.precision} isamplerCube;
	precision ${t.precision} isampler2DArray;
	precision ${t.precision} usampler2D;
	precision ${t.precision} usampler3D;
	precision ${t.precision} usamplerCube;
	precision ${t.precision} usampler2DArray;
	`;return t.precision==="highp"?e+=`
#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function oSe(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===UA?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===Qx?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Zc&&(e="SHADOWMAP_TYPE_VSM"),e}function lSe(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case df:case Xd:e="ENVMAP_TYPE_CUBE";break;case Vv:e="ENVMAP_TYPE_CUBE_UV";break}return e}function cSe(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Xd:e="ENVMAP_MODE_REFRACTION";break}return e}function uSe(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case U_:e="ENVMAP_BLENDING_MULTIPLY";break;case kJ:e="ENVMAP_BLENDING_MIX";break;case DJ:e="ENVMAP_BLENDING_ADD";break}return e}function fSe(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:i,maxMip:n}}function hSe(t,e,n,i){const r=t.getContext(),a=n.defines;let s=n.vertexShader,o=n.fragmentShader;const l=oSe(n),c=lSe(n),u=cSe(n),f=uSe(n),h=fSe(n),d=Q_e(n),g=eSe(a),b=r.createProgram();let y,p,x=n.glslVersion?"#version "+n.glslVersion+`
`:"";n.isRawShaderMaterial?(y=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Rx).join(`
`),y.length>0&&(y+=`
`),p=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Rx).join(`
`),p.length>0&&(p+=`
`)):(y=[h5(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
`].filter(Rx).join(`
`),p=[h5(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==sf?"#define TONE_MAPPING":"",n.toneMapping!==sf?hn.tonemapping_pars_fragment:"",n.toneMapping!==sf?$_e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",hn.colorspace_pars_fragment,J_e("linearToOutputTexel",n.outputColorSpace),Z_e(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(Rx).join(`
`)),s=lI(s),s=c5(s,n),s=u5(s,n),o=lI(o),o=c5(o,n),o=u5(o,n),s=f5(s),o=f5(o),n.isRawShaderMaterial!==!0&&(x=`#version 300 es
`,y=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+y,p=["#define varying in",n.glslVersion===QO?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===QO?"":"#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(`
`)+`
`+p);const _=x+y+s,w=x+p+o,M=s5(r,r.VERTEX_SHADER,_),S=s5(r,r.FRAGMENT_SHADER,w);r.attachShader(b,M),r.attachShader(b,S),n.index0AttributeName!==void 0?r.bindAttribLocation(b,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(b,0,"position"),r.linkProgram(b);function A(N){if(t.debug.checkShaderErrors){const P=r.getProgramInfoLog(b)||"",j=r.getShaderInfoLog(M)||"",z=r.getShaderInfoLog(S)||"",X=P.trim(),F=j.trim(),H=z.trim();let V=!0,W=!0;if(r.getProgramParameter(b,r.LINK_STATUS)===!1)if(V=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,b,M,S);else{const B=l5(r,M,"vertex"),Y=l5(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(b,r.VALIDATE_STATUS)+`

Material Name: `+N.name+`
Material Type: `+N.type+`

Program Info Log: `+X+`
`+B+`
`+Y)}else X!==""?console.warn("THREE.WebGLProgram: Program Info Log:",X):(F===""||H==="")&&(W=!1);W&&(N.diagnostics={runnable:V,programLog:X,vertexShader:{log:F,prefix:y},fragmentShader:{log:H,prefix:p}})}r.deleteShader(M),r.deleteShader(S),C=new pM(r,b),k=tSe(r,b)}let C;this.getUniforms=function(){return C===void 0&&A(this),C};let k;this.getAttributes=function(){return k===void 0&&A(this),k};let R=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=r.getProgramParameter(b,X_e)),R},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(b),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=q_e++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=M,this.fragmentShader=S,this}let dSe=0;class pSe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),a=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(r)===!1&&(s.add(r),r.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)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 n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new mSe(e),n.set(e,i)),i}}class mSe{constructor(e){this.id=dSe++,this.code=e,this.usedTimes=0}}function gSe(t,e,n,i,r,a,s){const o=new ov,l=new pSe,c=new Set,u=[],f=r.logarithmicDepthBuffer,h=r.vertexTextures;let d=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function b(k){return c.add(k),k===0?"uv":`uv${k}`}function y(k,R,N,P,j){const z=P.fog,X=j.geometry,F=k.isMeshStandardMaterial?P.environment:null,H=(k.isMeshStandardMaterial?n:e).get(k.envMap||F),V=H&&H.mapping===Vv?H.image.height:null,W=g[k.type];k.precision!==null&&(d=r.getMaxPrecision(k.precision),d!==k.precision&&console.warn("THREE.WebGLProgram.getParameters:",k.precision,"not supported, using",d,"instead."));const B=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,Y=B!==void 0?B.length:0;let Z=0;X.morphAttributes.position!==void 0&&(Z=1),X.morphAttributes.normal!==void 0&&(Z=2),X.morphAttributes.color!==void 0&&(Z=3);let G,de,oe,le;if(W){const un=iu[W];G=un.vertexShader,de=un.fragmentShader}else G=k.vertexShader,de=k.fragmentShader,l.update(k),oe=l.getVertexShaderID(k),le=l.getFragmentShaderID(k);const ue=t.getRenderTarget(),Se=t.state.buffers.depth.getReversed(),Te=j.isInstancedMesh===!0,Pe=j.isBatchedMesh===!0,je=!!k.map,He=!!k.matcap,pe=!!H,ze=!!k.aoMap,Ie=!!k.lightMap,Xe=!!k.bumpMap,we=!!k.normalMap,Ae=!!k.displacementMap,Re=!!k.emissiveMap,Ne=!!k.metalnessMap,Fe=!!k.roughnessMap,Qe=k.anisotropy>0,ae=k.clearcoat>0,K=k.dispersion>0,ce=k.iridescence>0,he=k.sheen>0,me=k.transmission>0,$=Qe&&!!k.anisotropyMap,Ve=ae&&!!k.clearcoatMap,qe=ae&&!!k.clearcoatNormalMap,mt=ae&&!!k.clearcoatRoughnessMap,Ge=ce&&!!k.iridescenceMap,Je=ce&&!!k.iridescenceThicknessMap,Ye=he&&!!k.sheenColorMap,vt=he&&!!k.sheenRoughnessMap,Mt=!!k.specularMap,gt=!!k.specularColorMap,kt=!!k.specularIntensityMap,ke=me&&!!k.transmissionMap,Le=me&&!!k.thicknessMap,ht=!!k.gradientMap,jt=!!k.alphaMap,ot=k.alphaTest>0,it=!!k.alphaHash,bt=!!k.extensions;let Jt=sf;k.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Jt=t.toneMapping);const Kt={shaderID:W,shaderType:k.type,shaderName:k.name,vertexShader:G,fragmentShader:de,defines:k.defines,customVertexShaderID:oe,customFragmentShaderID:le,isRawShaderMaterial:k.isRawShaderMaterial===!0,glslVersion:k.glslVersion,precision:d,batching:Pe,batchingColor:Pe&&j._colorsTexture!==null,instancing:Te,instancingColor:Te&&j.instanceColor!==null,instancingMorph:Te&&j.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:ue===null?t.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Su,alphaToCoverage:!!k.alphaToCoverage,map:je,matcap:He,envMap:pe,envMapMode:pe&&H.mapping,envMapCubeUVHeight:V,aoMap:ze,lightMap:Ie,bumpMap:Xe,normalMap:we,displacementMap:h&&Ae,emissiveMap:Re,normalMapObjectSpace:we&&k.normalMapType===VJ,normalMapTangentSpace:we&&k.normalMapType===Qd,metalnessMap:Ne,roughnessMap:Fe,anisotropy:Qe,anisotropyMap:$,clearcoat:ae,clearcoatMap:Ve,clearcoatNormalMap:qe,clearcoatRoughnessMap:mt,dispersion:K,iridescence:ce,iridescenceMap:Ge,iridescenceThicknessMap:Je,sheen:he,sheenColorMap:Ye,sheenRoughnessMap:vt,specularMap:Mt,specularColorMap:gt,specularIntensityMap:kt,transmission:me,transmissionMap:ke,thicknessMap:Le,gradientMap:ht,opaque:k.transparent===!1&&k.blending===Om&&k.alphaToCoverage===!1,alphaMap:jt,alphaTest:ot,alphaHash:it,combine:k.combine,mapUv:je&&b(k.map.channel),aoMapUv:ze&&b(k.aoMap.channel),lightMapUv:Ie&&b(k.lightMap.channel),bumpMapUv:Xe&&b(k.bumpMap.channel),normalMapUv:we&&b(k.normalMap.channel),displacementMapUv:Ae&&b(k.displacementMap.channel),emissiveMapUv:Re&&b(k.emissiveMap.channel),metalnessMapUv:Ne&&b(k.metalnessMap.channel),roughnessMapUv:Fe&&b(k.roughnessMap.channel),anisotropyMapUv:$&&b(k.anisotropyMap.channel),clearcoatMapUv:Ve&&b(k.clearcoatMap.channel),clearcoatNormalMapUv:qe&&b(k.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:mt&&b(k.clearcoatRoughnessMap.channel),iridescenceMapUv:Ge&&b(k.iridescenceMap.channel),iridescenceThicknessMapUv:Je&&b(k.iridescenceThicknessMap.channel),sheenColorMapUv:Ye&&b(k.sheenColorMap.channel),sheenRoughnessMapUv:vt&&b(k.sheenRoughnessMap.channel),specularMapUv:Mt&&b(k.specularMap.channel),specularColorMapUv:gt&&b(k.specularColorMap.channel),specularIntensityMapUv:kt&&b(k.specularIntensityMap.channel),transmissionMapUv:ke&&b(k.transmissionMap.channel),thicknessMapUv:Le&&b(k.thicknessMap.channel),alphaMapUv:jt&&b(k.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(we||Qe),vertexColors:k.vertexColors,vertexAlphas:k.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:j.isPoints===!0&&!!X.attributes.uv&&(je||jt),fog:!!z,useFog:k.fog===!0,fogExp2:!!z&&z.isFogExp2,flatShading:k.flatShading===!0&&k.wireframe===!1,sizeAttenuation:k.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Se,skinning:j.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:Z,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:k.dithering,shadowMapEnabled:t.shadowMap.enabled&&N.length>0,shadowMapType:t.shadowMap.type,toneMapping:Jt,decodeVideoTexture:je&&k.map.isVideoTexture===!0&&bi.getTransfer(k.map.colorSpace)===pr,decodeVideoTextureEmissive:Re&&k.emissiveMap.isVideoTexture===!0&&bi.getTransfer(k.emissiveMap.colorSpace)===pr,premultipliedAlpha:k.premultipliedAlpha,doubleSided:k.side===Jr,flipSided:k.side===Da,useDepthPacking:k.depthPacking>=0,depthPacking:k.depthPacking||0,index0AttributeName:k.index0AttributeName,extensionClipCullDistance:bt&&k.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(bt&&k.extensions.multiDraw===!0||Pe)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:k.customProgramCacheKey()};return Kt.vertexUv1s=c.has(1),Kt.vertexUv2s=c.has(2),Kt.vertexUv3s=c.has(3),c.clear(),Kt}function p(k){const R=[];if(k.shaderID?R.push(k.shaderID):(R.push(k.customVertexShaderID),R.push(k.customFragmentShaderID)),k.defines!==void 0)for(const N in k.defines)R.push(N),R.push(k.defines[N]);return k.isRawShaderMaterial===!1&&(x(R,k),_(R,k),R.push(t.outputColorSpace)),R.push(k.customProgramCacheKey),R.join()}function x(k,R){k.push(R.precision),k.push(R.outputColorSpace),k.push(R.envMapMode),k.push(R.envMapCubeUVHeight),k.push(R.mapUv),k.push(R.alphaMapUv),k.push(R.lightMapUv),k.push(R.aoMapUv),k.push(R.bumpMapUv),k.push(R.normalMapUv),k.push(R.displacementMapUv),k.push(R.emissiveMapUv),k.push(R.metalnessMapUv),k.push(R.roughnessMapUv),k.push(R.anisotropyMapUv),k.push(R.clearcoatMapUv),k.push(R.clearcoatNormalMapUv),k.push(R.clearcoatRoughnessMapUv),k.push(R.iridescenceMapUv),k.push(R.iridescenceThicknessMapUv),k.push(R.sheenColorMapUv),k.push(R.sheenRoughnessMapUv),k.push(R.specularMapUv),k.push(R.specularColorMapUv),k.push(R.specularIntensityMapUv),k.push(R.transmissionMapUv),k.push(R.thicknessMapUv),k.push(R.combine),k.push(R.fogExp2),k.push(R.sizeAttenuation),k.push(R.morphTargetsCount),k.push(R.morphAttributeCount),k.push(R.numDirLights),k.push(R.numPointLights),k.push(R.numSpotLights),k.push(R.numSpotLightMaps),k.push(R.numHemiLights),k.push(R.numRectAreaLights),k.push(R.numDirLightShadows),k.push(R.numPointLightShadows),k.push(R.numSpotLightShadows),k.push(R.numSpotLightShadowsWithMaps),k.push(R.numLightProbes),k.push(R.shadowMapType),k.push(R.toneMapping),k.push(R.numClippingPlanes),k.push(R.numClipIntersection),k.push(R.depthPacking)}function _(k,R){o.disableAll(),R.supportsVertexTextures&&o.enable(0),R.instancing&&o.enable(1),R.instancingColor&&o.enable(2),R.instancingMorph&&o.enable(3),R.matcap&&o.enable(4),R.envMap&&o.enable(5),R.normalMapObjectSpace&&o.enable(6),R.normalMapTangentSpace&&o.enable(7),R.clearcoat&&o.enable(8),R.iridescence&&o.enable(9),R.alphaTest&&o.enable(10),R.vertexColors&&o.enable(11),R.vertexAlphas&&o.enable(12),R.vertexUv1s&&o.enable(13),R.vertexUv2s&&o.enable(14),R.vertexUv3s&&o.enable(15),R.vertexTangents&&o.enable(16),R.anisotropy&&o.enable(17),R.alphaHash&&o.enable(18),R.batching&&o.enable(19),R.dispersion&&o.enable(20),R.batchingColor&&o.enable(21),R.gradientMap&&o.enable(22),k.push(o.mask),o.disableAll(),R.fog&&o.enable(0),R.useFog&&o.enable(1),R.flatShading&&o.enable(2),R.logarithmicDepthBuffer&&o.enable(3),R.reversedDepthBuffer&&o.enable(4),R.skinning&&o.enable(5),R.morphTargets&&o.enable(6),R.morphNormals&&o.enable(7),R.morphColors&&o.enable(8),R.premultipliedAlpha&&o.enable(9),R.shadowMapEnabled&&o.enable(10),R.doubleSided&&o.enable(11),R.flipSided&&o.enable(12),R.useDepthPacking&&o.enable(13),R.dithering&&o.enable(14),R.transmission&&o.enable(15),R.sheen&&o.enable(16),R.opaque&&o.enable(17),R.pointsUvs&&o.enable(18),R.decodeVideoTexture&&o.enable(19),R.decodeVideoTextureEmissive&&o.enable(20),R.alphaToCoverage&&o.enable(21),k.push(o.mask)}function w(k){const R=g[k.type];let N;if(R){const P=iu[R];N=cv.clone(P.uniforms)}else N=k.uniforms;return N}function M(k,R){let N;for(let P=0,j=u.length;P<j;P++){const z=u[P];if(z.cacheKey===R){N=z,++N.usedTimes;break}}return N===void 0&&(N=new hSe(t,R,k,a),u.push(N)),N}function S(k){if(--k.usedTimes===0){const R=u.indexOf(k);u[R]=u[u.length-1],u.pop(),k.destroy()}}function A(k){l.remove(k)}function C(){l.dispose()}return{getParameters:y,getProgramCacheKey:p,getUniforms:w,acquireProgram:M,releaseProgram:S,releaseShaderCache:A,programs:u,dispose:C}}function bSe(){let t=new WeakMap;function e(s){return t.has(s)}function n(s){let o=t.get(s);return o===void 0&&(o={},t.set(s,o)),o}function i(s){t.delete(s)}function r(s,o,l){t.get(s)[o]=l}function a(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:a}}function vSe(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function d5(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function p5(){const t=[];let e=0;const n=[],i=[],r=[];function a(){e=0,n.length=0,i.length=0,r.length=0}function s(f,h,d,g,b,y){let p=t[e];return p===void 0?(p={id:f.id,object:f,geometry:h,material:d,groupOrder:g,renderOrder:f.renderOrder,z:b,group:y},t[e]=p):(p.id=f.id,p.object=f,p.geometry=h,p.material=d,p.groupOrder=g,p.renderOrder=f.renderOrder,p.z=b,p.group=y),e++,p}function o(f,h,d,g,b,y){const p=s(f,h,d,g,b,y);d.transmission>0?i.push(p):d.transparent===!0?r.push(p):n.push(p)}function l(f,h,d,g,b,y){const p=s(f,h,d,g,b,y);d.transmission>0?i.unshift(p):d.transparent===!0?r.unshift(p):n.unshift(p)}function c(f,h){n.length>1&&n.sort(f||vSe),i.length>1&&i.sort(h||d5),r.length>1&&r.sort(h||d5)}function u(){for(let f=e,h=t.length;f<h;f++){const d=t[f];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:n,transmissive:i,transparent:r,init:a,push:o,unshift:l,finish:u,sort:c}}function ySe(){let t=new WeakMap;function e(i,r){const a=t.get(i);let s;return a===void 0?(s=new p5,t.set(i,[s])):r>=a.length?(s=new p5,a.push(s)):s=a[r],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function xSe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new te,color:new Ut};break;case"SpotLight":n={position:new te,direction:new te,color:new Ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new te,color:new Ut,distance:0,decay:0};break;case"HemisphereLight":n={direction:new te,skyColor:new Ut,groundColor:new Ut};break;case"RectAreaLight":n={color:new Ut,position:new te,halfWidth:new te,halfHeight:new te};break}return t[e.id]=n,n}}}function _Se(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new wt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new wt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new wt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let SSe=0;function wSe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function ESe(t){const e=new xSe,n=_Se(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new te);const r=new te,a=new Dt,s=new Dt;function o(c){let u=0,f=0,h=0;for(let k=0;k<9;k++)i.probe[k].set(0,0,0);let d=0,g=0,b=0,y=0,p=0,x=0,_=0,w=0,M=0,S=0,A=0;c.sort(wSe);for(let k=0,R=c.length;k<R;k++){const N=c[k],P=N.color,j=N.intensity,z=N.distance,X=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)u+=P.r*j,f+=P.g*j,h+=P.b*j;else if(N.isLightProbe){for(let F=0;F<9;F++)i.probe[F].addScaledVector(N.sh.coefficients[F],j);A++}else if(N.isDirectionalLight){const F=e.get(N);if(F.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const H=N.shadow,V=n.get(N);V.shadowIntensity=H.intensity,V.shadowBias=H.bias,V.shadowNormalBias=H.normalBias,V.shadowRadius=H.radius,V.shadowMapSize=H.mapSize,i.directionalShadow[d]=V,i.directionalShadowMap[d]=X,i.directionalShadowMatrix[d]=N.shadow.matrix,x++}i.directional[d]=F,d++}else if(N.isSpotLight){const F=e.get(N);F.position.setFromMatrixPosition(N.matrixWorld),F.color.copy(P).multiplyScalar(j),F.distance=z,F.coneCos=Math.cos(N.angle),F.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),F.decay=N.decay,i.spot[b]=F;const H=N.shadow;if(N.map&&(i.spotLightMap[M]=N.map,M++,H.updateMatrices(N),N.castShadow&&S++),i.spotLightMatrix[b]=H.matrix,N.castShadow){const V=n.get(N);V.shadowIntensity=H.intensity,V.shadowBias=H.bias,V.shadowNormalBias=H.normalBias,V.shadowRadius=H.radius,V.shadowMapSize=H.mapSize,i.spotShadow[b]=V,i.spotShadowMap[b]=X,w++}b++}else if(N.isRectAreaLight){const F=e.get(N);F.color.copy(P).multiplyScalar(j),F.halfWidth.set(N.width*.5,0,0),F.halfHeight.set(0,N.height*.5,0),i.rectArea[y]=F,y++}else if(N.isPointLight){const F=e.get(N);if(F.color.copy(N.color).multiplyScalar(N.intensity),F.distance=N.distance,F.decay=N.decay,N.castShadow){const H=N.shadow,V=n.get(N);V.shadowIntensity=H.intensity,V.shadowBias=H.bias,V.shadowNormalBias=H.normalBias,V.shadowRadius=H.radius,V.shadowMapSize=H.mapSize,V.shadowCameraNear=H.camera.near,V.shadowCameraFar=H.camera.far,i.pointShadow[g]=V,i.pointShadowMap[g]=X,i.pointShadowMatrix[g]=N.shadow.matrix,_++}i.point[g]=F,g++}else if(N.isHemisphereLight){const F=e.get(N);F.skyColor.copy(N.color).multiplyScalar(j),F.groundColor.copy(N.groundColor).multiplyScalar(j),i.hemi[p]=F,p++}}y>0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=tn.LTC_FLOAT_1,i.rectAreaLTC2=tn.LTC_FLOAT_2):(i.rectAreaLTC1=tn.LTC_HALF_1,i.rectAreaLTC2=tn.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;const C=i.hash;(C.directionalLength!==d||C.pointLength!==g||C.spotLength!==b||C.rectAreaLength!==y||C.hemiLength!==p||C.numDirectionalShadows!==x||C.numPointShadows!==_||C.numSpotShadows!==w||C.numSpotMaps!==M||C.numLightProbes!==A)&&(i.directional.length=d,i.spot.length=b,i.rectArea.length=y,i.point.length=g,i.hemi.length=p,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=_,i.pointShadowMap.length=_,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=_,i.spotLightMatrix.length=w+M-S,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=S,i.numLightProbes=A,C.directionalLength=d,C.pointLength=g,C.spotLength=b,C.rectAreaLength=y,C.hemiLength=p,C.numDirectionalShadows=x,C.numPointShadows=_,C.numSpotShadows=w,C.numSpotMaps=M,C.numLightProbes=A,i.version=SSe++)}function l(c,u){let f=0,h=0,d=0,g=0,b=0;const y=u.matrixWorldInverse;for(let p=0,x=c.length;p<x;p++){const _=c[p];if(_.isDirectionalLight){const w=i.directional[f];w.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(y),f++}else if(_.isSpotLight){const w=i.spot[d];w.position.setFromMatrixPosition(_.matrixWorld),w.position.applyMatrix4(y),w.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(y),d++}else if(_.isRectAreaLight){const w=i.rectArea[g];w.position.setFromMatrixPosition(_.matrixWorld),w.position.applyMatrix4(y),s.identity(),a.copy(_.matrixWorld),a.premultiply(y),s.extractRotation(a),w.halfWidth.set(_.width*.5,0,0),w.halfHeight.set(0,_.height*.5,0),w.halfWidth.applyMatrix4(s),w.halfHeight.applyMatrix4(s),g++}else if(_.isPointLight){const w=i.point[h];w.position.setFromMatrixPosition(_.matrixWorld),w.position.applyMatrix4(y),h++}else if(_.isHemisphereLight){const w=i.hemi[b];w.direction.setFromMatrixPosition(_.matrixWorld),w.direction.transformDirection(y),b++}}}return{setup:o,setupView:l,state:i}}function m5(t){const e=new ESe(t),n=[],i=[];function r(u){c.camera=u,n.length=0,i.length=0}function a(u){n.push(u)}function s(u){i.push(u)}function o(){e.setup(n)}function l(u){e.setupView(n,u)}const c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:o,setupLightsView:l,pushLight:a,pushShadow:s}}function MSe(t){let e=new WeakMap;function n(r,a=0){const s=e.get(r);let o;return s===void 0?(o=new m5(t),e.set(r,[o])):a>=s.length?(o=new m5(t),s.push(o)):o=s[a],o}function i(){e=new WeakMap}return{get:n,dispose:i}}const TSe=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,ASe=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function CSe(t,e,n){let i=new tp;const r=new wt,a=new wt,s=new ni,o=new dC({depthPacking:XP}),l=new pC,c={},u=n.maxTextureSize,f={[_u]:Da,[Da]:_u,[Jr]:Jr},h=new fs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new wt},radius:{value:4}},vertexShader:TSe,fragmentShader:ASe}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const g=new On;g.setAttribute("position",new In(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new _i(g,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=UA;let p=this.type;this.render=function(S,A,C){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||S.length===0)return;const k=t.getRenderTarget(),R=t.getActiveCubeFace(),N=t.getActiveMipmapLevel(),P=t.state;P.setBlending(af),P.buffers.depth.getReversed()?P.buffers.color.setClear(0,0,0,0):P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const j=p!==Zc&&this.type===Zc,z=p===Zc&&this.type!==Zc;for(let X=0,F=S.length;X<F;X++){const H=S[X],V=H.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",H,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;r.copy(V.mapSize);const W=V.getFrameExtents();if(r.multiply(W),a.copy(V.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/W.x),r.x=a.x*W.x,V.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/W.y),r.y=a.y*W.y,V.mapSize.y=a.y)),V.map===null||j===!0||z===!0){const Y=this.type!==Zc?{minFilter:ls,magFilter:ls}:{};V.map!==null&&V.map.dispose(),V.map=new Cc(r.x,r.y,Y),V.map.texture.name=H.name+".shadowMap",V.camera.updateProjectionMatrix()}t.setRenderTarget(V.map),t.clear();const B=V.getViewportCount();for(let Y=0;Y<B;Y++){const Z=V.getViewport(Y);s.set(a.x*Z.x,a.y*Z.y,a.x*Z.z,a.y*Z.w),P.viewport(s),V.updateMatrices(H,Y),i=V.getFrustum(),w(A,C,V.camera,H,this.type)}V.isPointLightShadow!==!0&&this.type===Zc&&x(V,C),V.needsUpdate=!1}p=this.type,y.needsUpdate=!1,t.setRenderTarget(k,R,N)};function x(S,A){const C=e.update(b);h.defines.VSM_SAMPLES!==S.blurSamples&&(h.defines.VSM_SAMPLES=S.blurSamples,d.defines.VSM_SAMPLES=S.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Cc(r.x,r.y)),h.uniforms.shadow_pass.value=S.map.texture,h.uniforms.resolution.value=S.mapSize,h.uniforms.radius.value=S.radius,t.setRenderTarget(S.mapPass),t.clear(),t.renderBufferDirect(A,null,C,h,b,null),d.uniforms.shadow_pass.value=S.mapPass.texture,d.uniforms.resolution.value=S.mapSize,d.uniforms.radius.value=S.radius,t.setRenderTarget(S.map),t.clear(),t.renderBufferDirect(A,null,C,d,b,null)}function _(S,A,C,k){let R=null;const N=C.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(N!==void 0)R=N;else if(R=C.isPointLight===!0?l:o,t.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const P=R.uuid,j=A.uuid;let z=c[P];z===void 0&&(z={},c[P]=z);let X=z[j];X===void 0&&(X=R.clone(),z[j]=X,A.addEventListener("dispose",M)),R=X}if(R.visible=A.visible,R.wireframe=A.wireframe,k===Zc?R.side=A.shadowSide!==null?A.shadowSide:A.side:R.side=A.shadowSide!==null?A.shadowSide:f[A.side],R.alphaMap=A.alphaMap,R.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,R.map=A.map,R.clipShadows=A.clipShadows,R.clippingPlanes=A.clippingPlanes,R.clipIntersection=A.clipIntersection,R.displacementMap=A.displacementMap,R.displacementScale=A.displacementScale,R.displacementBias=A.displacementBias,R.wireframeLinewidth=A.wireframeLinewidth,R.linewidth=A.linewidth,C.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const P=t.properties.get(R);P.light=C}return R}function w(S,A,C,k,R){if(S.visible===!1)return;if(S.layers.test(A.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&R===Zc)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,S.matrixWorld);const j=e.update(S),z=S.material;if(Array.isArray(z)){const X=j.groups;for(let F=0,H=X.length;F<H;F++){const V=X[F],W=z[V.materialIndex];if(W&&W.visible){const B=_(S,W,k,R);S.onBeforeShadow(t,S,A,C,j,B,V),t.renderBufferDirect(C,null,j,B,S,V),S.onAfterShadow(t,S,A,C,j,B,V)}}}else if(z.visible){const X=_(S,z,k,R);S.onBeforeShadow(t,S,A,C,j,X,null),t.renderBufferDirect(C,null,j,X,S,null),S.onAfterShadow(t,S,A,C,j,X,null)}}const P=S.children;for(let j=0,z=P.length;j<z;j++)w(P[j],A,C,k,R)}function M(S){S.target.removeEventListener("dispose",M);for(const C in c){const k=c[C],R=S.target.uuid;R in k&&(k[R].dispose(),delete k[R])}}}const RSe={[y2]:x2,[_2]:E2,[S2]:M2,[Xm]:w2,[x2]:y2,[E2]:_2,[M2]:S2,[w2]:Xm};function kSe(t,e){function n(){let ke=!1;const Le=new ni;let ht=null;const jt=new ni(0,0,0,0);return{setMask:function(ot){ht!==ot&&!ke&&(t.colorMask(ot,ot,ot,ot),ht=ot)},setLocked:function(ot){ke=ot},setClear:function(ot,it,bt,Jt,Kt){Kt===!0&&(ot*=Jt,it*=Jt,bt*=Jt),Le.set(ot,it,bt,Jt),jt.equals(Le)===!1&&(t.clearColor(ot,it,bt,Jt),jt.copy(Le))},reset:function(){ke=!1,ht=null,jt.set(-1,0,0,0)}}}function i(){let ke=!1,Le=!1,ht=null,jt=null,ot=null;return{setReversed:function(it){if(Le!==it){const bt=e.get("EXT_clip_control");it?bt.clipControlEXT(bt.LOWER_LEFT_EXT,bt.ZERO_TO_ONE_EXT):bt.clipControlEXT(bt.LOWER_LEFT_EXT,bt.NEGATIVE_ONE_TO_ONE_EXT),Le=it;const Jt=ot;ot=null,this.setClear(Jt)}},getReversed:function(){return Le},setTest:function(it){it?ue(t.DEPTH_TEST):Se(t.DEPTH_TEST)},setMask:function(it){ht!==it&&!ke&&(t.depthMask(it),ht=it)},setFunc:function(it){if(Le&&(it=RSe[it]),jt!==it){switch(it){case y2:t.depthFunc(t.NEVER);break;case x2:t.depthFunc(t.ALWAYS);break;case _2:t.depthFunc(t.LESS);break;case Xm:t.depthFunc(t.LEQUAL);break;case S2:t.depthFunc(t.EQUAL);break;case w2:t.depthFunc(t.GEQUAL);break;case E2:t.depthFunc(t.GREATER);break;case M2:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}jt=it}},setLocked:function(it){ke=it},setClear:function(it){ot!==it&&(Le&&(it=1-it),t.clearDepth(it),ot=it)},reset:function(){ke=!1,ht=null,jt=null,ot=null,Le=!1}}}function r(){let ke=!1,Le=null,ht=null,jt=null,ot=null,it=null,bt=null,Jt=null,Kt=null;return{setTest:function(un){ke||(un?ue(t.STENCIL_TEST):Se(t.STENCIL_TEST))},setMask:function(un){Le!==un&&!ke&&(t.stencilMask(un),Le=un)},setFunc:function(un,Vn,vn){(ht!==un||jt!==Vn||ot!==vn)&&(t.stencilFunc(un,Vn,vn),ht=un,jt=Vn,ot=vn)},setOp:function(un,Vn,vn){(it!==un||bt!==Vn||Jt!==vn)&&(t.stencilOp(un,Vn,vn),it=un,bt=Vn,Jt=vn)},setLocked:function(un){ke=un},setClear:function(un){Kt!==un&&(t.clearStencil(un),Kt=un)},reset:function(){ke=!1,Le=null,ht=null,jt=null,ot=null,it=null,bt=null,Jt=null,Kt=null}}}const a=new n,s=new i,o=new r,l=new WeakMap,c=new WeakMap;let u={},f={},h=new WeakMap,d=[],g=null,b=!1,y=null,p=null,x=null,_=null,w=null,M=null,S=null,A=new Ut(0,0,0),C=0,k=!1,R=null,N=null,P=null,j=null,z=null;const X=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let F=!1,H=0;const V=t.getParameter(t.VERSION);V.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec(V)[1]),F=H>=1):V.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),F=H>=2);let W=null,B={};const Y=t.getParameter(t.SCISSOR_BOX),Z=t.getParameter(t.VIEWPORT),G=new ni().fromArray(Y),de=new ni().fromArray(Z);function oe(ke,Le,ht,jt){const ot=new Uint8Array(4),it=t.createTexture();t.bindTexture(ke,it),t.texParameteri(ke,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(ke,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let bt=0;bt<ht;bt++)ke===t.TEXTURE_3D||ke===t.TEXTURE_2D_ARRAY?t.texImage3D(Le,0,t.RGBA,1,1,jt,0,t.RGBA,t.UNSIGNED_BYTE,ot):t.texImage2D(Le+bt,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,ot);return it}const le={};le[t.TEXTURE_2D]=oe(t.TEXTURE_2D,t.TEXTURE_2D,1),le[t.TEXTURE_CUBE_MAP]=oe(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[t.TEXTURE_2D_ARRAY]=oe(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),le[t.TEXTURE_3D]=oe(t.TEXTURE_3D,t.TEXTURE_3D,1,1),a.setClear(0,0,0,1),s.setClear(1),o.setClear(0),ue(t.DEPTH_TEST),s.setFunc(Xm),Xe(!1),we(qO),ue(t.CULL_FACE),ze(af);function ue(ke){u[ke]!==!0&&(t.enable(ke),u[ke]=!0)}function Se(ke){u[ke]!==!1&&(t.disable(ke),u[ke]=!1)}function Te(ke,Le){return f[ke]!==Le?(t.bindFramebuffer(ke,Le),f[ke]=Le,ke===t.DRAW_FRAMEBUFFER&&(f[t.FRAMEBUFFER]=Le),ke===t.FRAMEBUFFER&&(f[t.DRAW_FRAMEBUFFER]=Le),!0):!1}function Pe(ke,Le){let ht=d,jt=!1;if(ke){ht=h.get(Le),ht===void 0&&(ht=[],h.set(Le,ht));const ot=ke.textures;if(ht.length!==ot.length||ht[0]!==t.COLOR_ATTACHMENT0){for(let it=0,bt=ot.length;it<bt;it++)ht[it]=t.COLOR_ATTACHMENT0+it;ht.length=ot.length,jt=!0}}else ht[0]!==t.BACK&&(ht[0]=t.BACK,jt=!0);jt&&t.drawBuffers(ht)}function je(ke){return g!==ke?(t.useProgram(ke),g=ke,!0):!1}const He={[yd]:t.FUNC_ADD,[dJ]:t.FUNC_SUBTRACT,[pJ]:t.FUNC_REVERSE_SUBTRACT};He[mJ]=t.MIN,He[gJ]=t.MAX;const pe={[bJ]:t.ZERO,[vJ]:t.ONE,[yJ]:t.SRC_COLOR,[b2]:t.SRC_ALPHA,[MJ]:t.SRC_ALPHA_SATURATE,[wJ]:t.DST_COLOR,[_J]:t.DST_ALPHA,[xJ]:t.ONE_MINUS_SRC_COLOR,[v2]:t.ONE_MINUS_SRC_ALPHA,[EJ]:t.ONE_MINUS_DST_COLOR,[SJ]:t.ONE_MINUS_DST_ALPHA,[TJ]:t.CONSTANT_COLOR,[AJ]:t.ONE_MINUS_CONSTANT_COLOR,[CJ]:t.CONSTANT_ALPHA,[RJ]:t.ONE_MINUS_CONSTANT_ALPHA};function ze(ke,Le,ht,jt,ot,it,bt,Jt,Kt,un){if(ke===af){b===!0&&(Se(t.BLEND),b=!1);return}if(b===!1&&(ue(t.BLEND),b=!0),ke!==hJ){if(ke!==y||un!==k){if((p!==yd||w!==yd)&&(t.blendEquation(t.FUNC_ADD),p=yd,w=yd),un)switch(ke){case Om:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case KO:t.blendFunc(t.ONE,t.ONE);break;case YO:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case JO:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",ke);break}else switch(ke){case Om:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case KO:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case YO:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case JO:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",ke);break}x=null,_=null,M=null,S=null,A.set(0,0,0),C=0,y=ke,k=un}return}ot=ot||Le,it=it||ht,bt=bt||jt,(Le!==p||ot!==w)&&(t.blendEquationSeparate(He[Le],He[ot]),p=Le,w=ot),(ht!==x||jt!==_||it!==M||bt!==S)&&(t.blendFuncSeparate(pe[ht],pe[jt],pe[it],pe[bt]),x=ht,_=jt,M=it,S=bt),(Jt.equals(A)===!1||Kt!==C)&&(t.blendColor(Jt.r,Jt.g,Jt.b,Kt),A.copy(Jt),C=Kt),y=ke,k=!1}function Ie(ke,Le){ke.side===Jr?Se(t.CULL_FACE):ue(t.CULL_FACE);let ht=ke.side===Da;Le&&(ht=!ht),Xe(ht),ke.blending===Om&&ke.transparent===!1?ze(af):ze(ke.blending,ke.blendEquation,ke.blendSrc,ke.blendDst,ke.blendEquationAlpha,ke.blendSrcAlpha,ke.blendDstAlpha,ke.blendColor,ke.blendAlpha,ke.premultipliedAlpha),s.setFunc(ke.depthFunc),s.setTest(ke.depthTest),s.setMask(ke.depthWrite),a.setMask(ke.colorWrite);const jt=ke.stencilWrite;o.setTest(jt),jt&&(o.setMask(ke.stencilWriteMask),o.setFunc(ke.stencilFunc,ke.stencilRef,ke.stencilFuncMask),o.setOp(ke.stencilFail,ke.stencilZFail,ke.stencilZPass)),Re(ke.polygonOffset,ke.polygonOffsetFactor,ke.polygonOffsetUnits),ke.alphaToCoverage===!0?ue(t.SAMPLE_ALPHA_TO_COVERAGE):Se(t.SAMPLE_ALPHA_TO_COVERAGE)}function Xe(ke){R!==ke&&(ke?t.frontFace(t.CW):t.frontFace(t.CCW),R=ke)}function we(ke){ke!==cJ?(ue(t.CULL_FACE),ke!==N&&(ke===qO?t.cullFace(t.BACK):ke===uJ?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Se(t.CULL_FACE),N=ke}function Ae(ke){ke!==P&&(F&&t.lineWidth(ke),P=ke)}function Re(ke,Le,ht){ke?(ue(t.POLYGON_OFFSET_FILL),(j!==Le||z!==ht)&&(t.polygonOffset(Le,ht),j=Le,z=ht)):Se(t.POLYGON_OFFSET_FILL)}function Ne(ke){ke?ue(t.SCISSOR_TEST):Se(t.SCISSOR_TEST)}function Fe(ke){ke===void 0&&(ke=t.TEXTURE0+X-1),W!==ke&&(t.activeTexture(ke),W=ke)}function Qe(ke,Le,ht){ht===void 0&&(W===null?ht=t.TEXTURE0+X-1:ht=W);let jt=B[ht];jt===void 0&&(jt={type:void 0,texture:void 0},B[ht]=jt),(jt.type!==ke||jt.texture!==Le)&&(W!==ht&&(t.activeTexture(ht),W=ht),t.bindTexture(ke,Le||le[ke]),jt.type=ke,jt.texture=Le)}function ae(){const ke=B[W];ke!==void 0&&ke.type!==void 0&&(t.bindTexture(ke.type,null),ke.type=void 0,ke.texture=void 0)}function K(){try{t.compressedTexImage2D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function ce(){try{t.compressedTexImage3D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function he(){try{t.texSubImage2D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function me(){try{t.texSubImage3D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function $(){try{t.compressedTexSubImage2D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function Ve(){try{t.compressedTexSubImage3D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function qe(){try{t.texStorage2D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function mt(){try{t.texStorage3D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function Ge(){try{t.texImage2D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function Je(){try{t.texImage3D(...arguments)}catch(ke){console.error("THREE.WebGLState:",ke)}}function Ye(ke){G.equals(ke)===!1&&(t.scissor(ke.x,ke.y,ke.z,ke.w),G.copy(ke))}function vt(ke){de.equals(ke)===!1&&(t.viewport(ke.x,ke.y,ke.z,ke.w),de.copy(ke))}function Mt(ke,Le){let ht=c.get(Le);ht===void 0&&(ht=new WeakMap,c.set(Le,ht));let jt=ht.get(ke);jt===void 0&&(jt=t.getUniformBlockIndex(Le,ke.name),ht.set(ke,jt))}function gt(ke,Le){const jt=c.get(Le).get(ke);l.get(Le)!==jt&&(t.uniformBlockBinding(Le,jt,ke.__bindingPointIndex),l.set(Le,jt))}function kt(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),s.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),u={},W=null,B={},f={},h=new WeakMap,d=[],g=null,b=!1,y=null,p=null,x=null,_=null,w=null,M=null,S=null,A=new Ut(0,0,0),C=0,k=!1,R=null,N=null,P=null,j=null,z=null,G.set(0,0,t.canvas.width,t.canvas.height),de.set(0,0,t.canvas.width,t.canvas.height),a.reset(),s.reset(),o.reset()}return{buffers:{color:a,depth:s,stencil:o},enable:ue,disable:Se,bindFramebuffer:Te,drawBuffers:Pe,useProgram:je,setBlending:ze,setMaterial:Ie,setFlipSided:Xe,setCullFace:we,setLineWidth:Ae,setPolygonOffset:Re,setScissorTest:Ne,activeTexture:Fe,bindTexture:Qe,unbindTexture:ae,compressedTexImage2D:K,compressedTexImage3D:ce,texImage2D:Ge,texImage3D:Je,updateUBOMapping:Mt,uniformBlockBinding:gt,texStorage2D:qe,texStorage3D:mt,texSubImage2D:he,texSubImage3D:me,compressedTexSubImage2D:$,compressedTexSubImage3D:Ve,scissor:Ye,viewport:vt,reset:kt}}function DSe(t,e,n,i,r,a,s){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new wt,u=new WeakMap;let f;const h=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(ae,K){return d?new OffscreenCanvas(ae,K):q1("canvas")}function b(ae,K,ce){let he=1;const me=Qe(ae);if((me.width>ce||me.height>ce)&&(he=ce/Math.max(me.width,me.height)),he<1)if(typeof HTMLImageElement<"u"&&ae instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ae instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ae instanceof ImageBitmap||typeof VideoFrame<"u"&&ae instanceof VideoFrame){const $=Math.floor(he*me.width),Ve=Math.floor(he*me.height);f===void 0&&(f=g($,Ve));const qe=K?g($,Ve):f;return qe.width=$,qe.height=Ve,qe.getContext("2d").drawImage(ae,0,0,$,Ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+$+"x"+Ve+")."),qe}else return"data"in ae&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),ae;return ae}function y(ae){return ae.generateMipmaps}function p(ae){t.generateMipmap(ae)}function x(ae){return ae.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:ae.isWebGL3DRenderTarget?t.TEXTURE_3D:ae.isWebGLArrayRenderTarget||ae.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function _(ae,K,ce,he,me=!1){if(ae!==null){if(t[ae]!==void 0)return t[ae];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ae+"'")}let $=K;if(K===t.RED&&(ce===t.FLOAT&&($=t.R32F),ce===t.HALF_FLOAT&&($=t.R16F),ce===t.UNSIGNED_BYTE&&($=t.R8)),K===t.RED_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.R8UI),ce===t.UNSIGNED_SHORT&&($=t.R16UI),ce===t.UNSIGNED_INT&&($=t.R32UI),ce===t.BYTE&&($=t.R8I),ce===t.SHORT&&($=t.R16I),ce===t.INT&&($=t.R32I)),K===t.RG&&(ce===t.FLOAT&&($=t.RG32F),ce===t.HALF_FLOAT&&($=t.RG16F),ce===t.UNSIGNED_BYTE&&($=t.RG8)),K===t.RG_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.RG8UI),ce===t.UNSIGNED_SHORT&&($=t.RG16UI),ce===t.UNSIGNED_INT&&($=t.RG32UI),ce===t.BYTE&&($=t.RG8I),ce===t.SHORT&&($=t.RG16I),ce===t.INT&&($=t.RG32I)),K===t.RGB_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.RGB8UI),ce===t.UNSIGNED_SHORT&&($=t.RGB16UI),ce===t.UNSIGNED_INT&&($=t.RGB32UI),ce===t.BYTE&&($=t.RGB8I),ce===t.SHORT&&($=t.RGB16I),ce===t.INT&&($=t.RGB32I)),K===t.RGBA_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.RGBA8UI),ce===t.UNSIGNED_SHORT&&($=t.RGBA16UI),ce===t.UNSIGNED_INT&&($=t.RGBA32UI),ce===t.BYTE&&($=t.RGBA8I),ce===t.SHORT&&($=t.RGBA16I),ce===t.INT&&($=t.RGBA32I)),K===t.RGB&&ce===t.UNSIGNED_INT_5_9_9_9_REV&&($=t.RGB9_E5),K===t.RGBA){const Ve=me?G1:bi.getTransfer(he);ce===t.FLOAT&&($=t.RGBA32F),ce===t.HALF_FLOAT&&($=t.RGBA16F),ce===t.UNSIGNED_BYTE&&($=Ve===pr?t.SRGB8_ALPHA8:t.RGBA8),ce===t.UNSIGNED_SHORT_4_4_4_4&&($=t.RGBA4),ce===t.UNSIGNED_SHORT_5_5_5_1&&($=t.RGB5_A1)}return($===t.R16F||$===t.R32F||$===t.RG16F||$===t.RG32F||$===t.RGBA16F||$===t.RGBA32F)&&e.get("EXT_color_buffer_float"),$}function w(ae,K){let ce;return ae?K===null||K===Ac||K===ev?ce=t.DEPTH24_STENCIL8:K===wr?ce=t.DEPTH32F_STENCIL8:K===Q0&&(ce=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):K===null||K===Ac||K===ev?ce=t.DEPTH_COMPONENT24:K===wr?ce=t.DEPTH_COMPONENT32F:K===Q0&&(ce=t.DEPTH_COMPONENT16),ce}function M(ae,K){return y(ae)===!0||ae.isFramebufferTexture&&ae.minFilter!==ls&&ae.minFilter!==Vi?Math.log2(Math.max(K.width,K.height))+1:ae.mipmaps!==void 0&&ae.mipmaps.length>0?ae.mipmaps.length:ae.isCompressedTexture&&Array.isArray(ae.image)?K.mipmaps.length:1}function S(ae){const K=ae.target;K.removeEventListener("dispose",S),C(K),K.isVideoTexture&&u.delete(K)}function A(ae){const K=ae.target;K.removeEventListener("dispose",A),R(K)}function C(ae){const K=i.get(ae);if(K.__webglInit===void 0)return;const ce=ae.source,he=h.get(ce);if(he){const me=he[K.__cacheKey];me.usedTimes--,me.usedTimes===0&&k(ae),Object.keys(he).length===0&&h.delete(ce)}i.remove(ae)}function k(ae){const K=i.get(ae);t.deleteTexture(K.__webglTexture);const ce=ae.source,he=h.get(ce);delete he[K.__cacheKey],s.memory.textures--}function R(ae){const K=i.get(ae);if(ae.depthTexture&&(ae.depthTexture.dispose(),i.remove(ae.depthTexture)),ae.isWebGLCubeRenderTarget)for(let he=0;he<6;he++){if(Array.isArray(K.__webglFramebuffer[he]))for(let me=0;me<K.__webglFramebuffer[he].length;me++)t.deleteFramebuffer(K.__webglFramebuffer[he][me]);else t.deleteFramebuffer(K.__webglFramebuffer[he]);K.__webglDepthbuffer&&t.deleteRenderbuffer(K.__webglDepthbuffer[he])}else{if(Array.isArray(K.__webglFramebuffer))for(let he=0;he<K.__webglFramebuffer.length;he++)t.deleteFramebuffer(K.__webglFramebuffer[he]);else t.deleteFramebuffer(K.__webglFramebuffer);if(K.__webglDepthbuffer&&t.deleteRenderbuffer(K.__webglDepthbuffer),K.__webglMultisampledFramebuffer&&t.deleteFramebuffer(K.__webglMultisampledFramebuffer),K.__webglColorRenderbuffer)for(let he=0;he<K.__webglColorRenderbuffer.length;he++)K.__webglColorRenderbuffer[he]&&t.deleteRenderbuffer(K.__webglColorRenderbuffer[he]);K.__webglDepthRenderbuffer&&t.deleteRenderbuffer(K.__webglDepthRenderbuffer)}const ce=ae.textures;for(let he=0,me=ce.length;he<me;he++){const $=i.get(ce[he]);$.__webglTexture&&(t.deleteTexture($.__webglTexture),s.memory.textures--),i.remove(ce[he])}i.remove(ae)}let N=0;function P(){N=0}function j(){const ae=N;return ae>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ae+" texture units while this GPU supports only "+r.maxTextures),N+=1,ae}function z(ae){const K=[];return K.push(ae.wrapS),K.push(ae.wrapT),K.push(ae.wrapR||0),K.push(ae.magFilter),K.push(ae.minFilter),K.push(ae.anisotropy),K.push(ae.internalFormat),K.push(ae.format),K.push(ae.type),K.push(ae.generateMipmaps),K.push(ae.premultiplyAlpha),K.push(ae.flipY),K.push(ae.unpackAlignment),K.push(ae.colorSpace),K.join()}function X(ae,K){const ce=i.get(ae);if(ae.isVideoTexture&&Ne(ae),ae.isRenderTargetTexture===!1&&ae.isExternalTexture!==!0&&ae.version>0&&ce.__version!==ae.version){const he=ae.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(ce,ae,K);return}}else ae.isExternalTexture&&(ce.__webglTexture=ae.sourceTexture?ae.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,ce.__webglTexture,t.TEXTURE0+K)}function F(ae,K){const ce=i.get(ae);if(ae.isRenderTargetTexture===!1&&ae.version>0&&ce.__version!==ae.version){le(ce,ae,K);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ce.__webglTexture,t.TEXTURE0+K)}function H(ae,K){const ce=i.get(ae);if(ae.isRenderTargetTexture===!1&&ae.version>0&&ce.__version!==ae.version){le(ce,ae,K);return}n.bindTexture(t.TEXTURE_3D,ce.__webglTexture,t.TEXTURE0+K)}function V(ae,K){const ce=i.get(ae);if(ae.version>0&&ce.__version!==ae.version){ue(ce,ae,K);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ce.__webglTexture,t.TEXTURE0+K)}const W={[qd]:t.REPEAT,[_a]:t.CLAMP_TO_EDGE,[Z0]:t.MIRRORED_REPEAT},B={[ls]:t.NEAREST,[FA]:t.NEAREST_MIPMAP_NEAREST,[fm]:t.NEAREST_MIPMAP_LINEAR,[Vi]:t.LINEAR,[_0]:t.LINEAR_MIPMAP_NEAREST,[vc]:t.LINEAR_MIPMAP_LINEAR},Y={[GJ]:t.NEVER,[JJ]:t.ALWAYS,[WJ]:t.LESS,[qP]:t.LEQUAL,[XJ]:t.EQUAL,[YJ]:t.GEQUAL,[qJ]:t.GREATER,[KJ]:t.NOTEQUAL};function Z(ae,K){if(K.type===wr&&e.has("OES_texture_float_linear")===!1&&(K.magFilter===Vi||K.magFilter===_0||K.magFilter===fm||K.magFilter===vc||K.minFilter===Vi||K.minFilter===_0||K.minFilter===fm||K.minFilter===vc)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(ae,t.TEXTURE_WRAP_S,W[K.wrapS]),t.texParameteri(ae,t.TEXTURE_WRAP_T,W[K.wrapT]),(ae===t.TEXTURE_3D||ae===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ae,t.TEXTURE_WRAP_R,W[K.wrapR]),t.texParameteri(ae,t.TEXTURE_MAG_FILTER,B[K.magFilter]),t.texParameteri(ae,t.TEXTURE_MIN_FILTER,B[K.minFilter]),K.compareFunction&&(t.texParameteri(ae,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ae,t.TEXTURE_COMPARE_FUNC,Y[K.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(K.magFilter===ls||K.minFilter!==fm&&K.minFilter!==vc||K.type===wr&&e.has("OES_texture_float_linear")===!1)return;if(K.anisotropy>1||i.get(K).__currentAnisotropy){const ce=e.get("EXT_texture_filter_anisotropic");t.texParameterf(ae,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(K.anisotropy,r.getMaxAnisotropy())),i.get(K).__currentAnisotropy=K.anisotropy}}}function G(ae,K){let ce=!1;ae.__webglInit===void 0&&(ae.__webglInit=!0,K.addEventListener("dispose",S));const he=K.source;let me=h.get(he);me===void 0&&(me={},h.set(he,me));const $=z(K);if($!==ae.__cacheKey){me[$]===void 0&&(me[$]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,ce=!0),me[$].usedTimes++;const Ve=me[ae.__cacheKey];Ve!==void 0&&(me[ae.__cacheKey].usedTimes--,Ve.usedTimes===0&&k(K)),ae.__cacheKey=$,ae.__webglTexture=me[$].texture}return ce}function de(ae,K,ce){return Math.floor(Math.floor(ae/ce)/K)}function oe(ae,K,ce,he){const $=ae.updateRanges;if($.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,K.width,K.height,ce,he,K.data);else{$.sort((Je,Ye)=>Je.start-Ye.start);let Ve=0;for(let Je=1;Je<$.length;Je++){const Ye=$[Ve],vt=$[Je],Mt=Ye.start+Ye.count,gt=de(vt.start,K.width,4),kt=de(Ye.start,K.width,4);vt.start<=Mt+1&&gt===kt&&de(vt.start+vt.count-1,K.width,4)===gt?Ye.count=Math.max(Ye.count,vt.start+vt.count-Ye.start):(++Ve,$[Ve]=vt)}$.length=Ve+1;const qe=t.getParameter(t.UNPACK_ROW_LENGTH),mt=t.getParameter(t.UNPACK_SKIP_PIXELS),Ge=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,K.width);for(let Je=0,Ye=$.length;Je<Ye;Je++){const vt=$[Je],Mt=Math.floor(vt.start/4),gt=Math.ceil(vt.count/4),kt=Mt%K.width,ke=Math.floor(Mt/K.width),Le=gt,ht=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,kt),t.pixelStorei(t.UNPACK_SKIP_ROWS,ke),n.texSubImage2D(t.TEXTURE_2D,0,kt,ke,Le,ht,ce,he,K.data)}ae.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,qe),t.pixelStorei(t.UNPACK_SKIP_PIXELS,mt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Ge)}}function le(ae,K,ce){let he=t.TEXTURE_2D;(K.isDataArrayTexture||K.isCompressedArrayTexture)&&(he=t.TEXTURE_2D_ARRAY),K.isData3DTexture&&(he=t.TEXTURE_3D);const me=G(ae,K),$=K.source;n.bindTexture(he,ae.__webglTexture,t.TEXTURE0+ce);const Ve=i.get($);if($.version!==Ve.__version||me===!0){n.activeTexture(t.TEXTURE0+ce);const qe=bi.getPrimaries(bi.workingColorSpace),mt=K.colorSpace===su?null:bi.getPrimaries(K.colorSpace),Ge=K.colorSpace===su||qe===mt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,K.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,K.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ge);let Je=b(K.image,!1,r.maxTextureSize);Je=Fe(K,Je);const Ye=a.convert(K.format,K.colorSpace),vt=a.convert(K.type);let Mt=_(K.internalFormat,Ye,vt,K.colorSpace,K.isVideoTexture);Z(he,K);let gt;const kt=K.mipmaps,ke=K.isVideoTexture!==!0,Le=Ve.__version===void 0||me===!0,ht=$.dataReady,jt=M(K,Je);if(K.isDepthTexture)Mt=w(K.format===nv,K.type),Le&&(ke?n.texStorage2D(t.TEXTURE_2D,1,Mt,Je.width,Je.height):n.texImage2D(t.TEXTURE_2D,0,Mt,Je.width,Je.height,0,Ye,vt,null));else if(K.isDataTexture)if(kt.length>0){ke&&Le&&n.texStorage2D(t.TEXTURE_2D,jt,Mt,kt[0].width,kt[0].height);for(let ot=0,it=kt.length;ot<it;ot++)gt=kt[ot],ke?ht&&n.texSubImage2D(t.TEXTURE_2D,ot,0,0,gt.width,gt.height,Ye,vt,gt.data):n.texImage2D(t.TEXTURE_2D,ot,Mt,gt.width,gt.height,0,Ye,vt,gt.data);K.generateMipmaps=!1}else ke?(Le&&n.texStorage2D(t.TEXTURE_2D,jt,Mt,Je.width,Je.height),ht&&oe(K,Je,Ye,vt)):n.texImage2D(t.TEXTURE_2D,0,Mt,Je.width,Je.height,0,Ye,vt,Je.data);else if(K.isCompressedTexture)if(K.isCompressedArrayTexture){ke&&Le&&n.texStorage3D(t.TEXTURE_2D_ARRAY,jt,Mt,kt[0].width,kt[0].height,Je.depth);for(let ot=0,it=kt.length;ot<it;ot++)if(gt=kt[ot],K.format!==Qr)if(Ye!==null)if(ke){if(ht)if(K.layerUpdates.size>0){const bt=sI(gt.width,gt.height,K.format,K.type);for(const Jt of K.layerUpdates){const Kt=gt.data.subarray(Jt*bt/gt.data.BYTES_PER_ELEMENT,(Jt+1)*bt/gt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ot,0,0,Jt,gt.width,gt.height,1,Ye,Kt)}K.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ot,0,0,0,gt.width,gt.height,Je.depth,Ye,gt.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,ot,Mt,gt.width,gt.height,Je.depth,0,gt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ke?ht&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,ot,0,0,0,gt.width,gt.height,Je.depth,Ye,vt,gt.data):n.texImage3D(t.TEXTURE_2D_ARRAY,ot,Mt,gt.width,gt.height,Je.depth,0,Ye,vt,gt.data)}else{ke&&Le&&n.texStorage2D(t.TEXTURE_2D,jt,Mt,kt[0].width,kt[0].height);for(let ot=0,it=kt.length;ot<it;ot++)gt=kt[ot],K.format!==Qr?Ye!==null?ke?ht&&n.compressedTexSubImage2D(t.TEXTURE_2D,ot,0,0,gt.width,gt.height,Ye,gt.data):n.compressedTexImage2D(t.TEXTURE_2D,ot,Mt,gt.width,gt.height,0,gt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ke?ht&&n.texSubImage2D(t.TEXTURE_2D,ot,0,0,gt.width,gt.height,Ye,vt,gt.data):n.texImage2D(t.TEXTURE_2D,ot,Mt,gt.width,gt.height,0,Ye,vt,gt.data)}else if(K.isDataArrayTexture)if(ke){if(Le&&n.texStorage3D(t.TEXTURE_2D_ARRAY,jt,Mt,Je.width,Je.height,Je.depth),ht)if(K.layerUpdates.size>0){const ot=sI(Je.width,Je.height,K.format,K.type);for(const it of K.layerUpdates){const bt=Je.data.subarray(it*ot/Je.data.BYTES_PER_ELEMENT,(it+1)*ot/Je.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,it,Je.width,Je.height,1,Ye,vt,bt)}K.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Je.width,Je.height,Je.depth,Ye,vt,Je.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Mt,Je.width,Je.height,Je.depth,0,Ye,vt,Je.data);else if(K.isData3DTexture)ke?(Le&&n.texStorage3D(t.TEXTURE_3D,jt,Mt,Je.width,Je.height,Je.depth),ht&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Je.width,Je.height,Je.depth,Ye,vt,Je.data)):n.texImage3D(t.TEXTURE_3D,0,Mt,Je.width,Je.height,Je.depth,0,Ye,vt,Je.data);else if(K.isFramebufferTexture){if(Le)if(ke)n.texStorage2D(t.TEXTURE_2D,jt,Mt,Je.width,Je.height);else{let ot=Je.width,it=Je.height;for(let bt=0;bt<jt;bt++)n.texImage2D(t.TEXTURE_2D,bt,Mt,ot,it,0,Ye,vt,null),ot>>=1,it>>=1}}else if(kt.length>0){if(ke&&Le){const ot=Qe(kt[0]);n.texStorage2D(t.TEXTURE_2D,jt,Mt,ot.width,ot.height)}for(let ot=0,it=kt.length;ot<it;ot++)gt=kt[ot],ke?ht&&n.texSubImage2D(t.TEXTURE_2D,ot,0,0,Ye,vt,gt):n.texImage2D(t.TEXTURE_2D,ot,Mt,Ye,vt,gt);K.generateMipmaps=!1}else if(ke){if(Le){const ot=Qe(Je);n.texStorage2D(t.TEXTURE_2D,jt,Mt,ot.width,ot.height)}ht&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Ye,vt,Je)}else n.texImage2D(t.TEXTURE_2D,0,Mt,Ye,vt,Je);y(K)&&p(he),Ve.__version=$.version,K.onUpdate&&K.onUpdate(K)}ae.__version=K.version}function ue(ae,K,ce){if(K.image.length!==6)return;const he=G(ae,K),me=K.source;n.bindTexture(t.TEXTURE_CUBE_MAP,ae.__webglTexture,t.TEXTURE0+ce);const $=i.get(me);if(me.version!==$.__version||he===!0){n.activeTexture(t.TEXTURE0+ce);const Ve=bi.getPrimaries(bi.workingColorSpace),qe=K.colorSpace===su?null:bi.getPrimaries(K.colorSpace),mt=K.colorSpace===su||Ve===qe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,K.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,K.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,mt);const Ge=K.isCompressedTexture||K.image[0].isCompressedTexture,Je=K.image[0]&&K.image[0].isDataTexture,Ye=[];for(let it=0;it<6;it++)!Ge&&!Je?Ye[it]=b(K.image[it],!0,r.maxCubemapSize):Ye[it]=Je?K.image[it].image:K.image[it],Ye[it]=Fe(K,Ye[it]);const vt=Ye[0],Mt=a.convert(K.format,K.colorSpace),gt=a.convert(K.type),kt=_(K.internalFormat,Mt,gt,K.colorSpace),ke=K.isVideoTexture!==!0,Le=$.__version===void 0||he===!0,ht=me.dataReady;let jt=M(K,vt);Z(t.TEXTURE_CUBE_MAP,K);let ot;if(Ge){ke&&Le&&n.texStorage2D(t.TEXTURE_CUBE_MAP,jt,kt,vt.width,vt.height);for(let it=0;it<6;it++){ot=Ye[it].mipmaps;for(let bt=0;bt<ot.length;bt++){const Jt=ot[bt];K.format!==Qr?Mt!==null?ke?ht&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,0,0,Jt.width,Jt.height,Mt,Jt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,kt,Jt.width,Jt.height,0,Jt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ke?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,0,0,Jt.width,Jt.height,Mt,gt,Jt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,kt,Jt.width,Jt.height,0,Mt,gt,Jt.data)}}}else{if(ot=K.mipmaps,ke&&Le){ot.length>0&&jt++;const it=Qe(Ye[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,jt,kt,it.width,it.height)}for(let it=0;it<6;it++)if(Je){ke?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Ye[it].width,Ye[it].height,Mt,gt,Ye[it].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,kt,Ye[it].width,Ye[it].height,0,Mt,gt,Ye[it].data);for(let bt=0;bt<ot.length;bt++){const Kt=ot[bt].image[it].image;ke?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,0,0,Kt.width,Kt.height,Mt,gt,Kt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,kt,Kt.width,Kt.height,0,Mt,gt,Kt.data)}}else{ke?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Mt,gt,Ye[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,kt,Mt,gt,Ye[it]);for(let bt=0;bt<ot.length;bt++){const Jt=ot[bt];ke?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,0,0,Mt,gt,Jt.image[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,kt,Mt,gt,Jt.image[it])}}}y(K)&&p(t.TEXTURE_CUBE_MAP),$.__version=me.version,K.onUpdate&&K.onUpdate(K)}ae.__version=K.version}function Se(ae,K,ce,he,me,$){const Ve=a.convert(ce.format,ce.colorSpace),qe=a.convert(ce.type),mt=_(ce.internalFormat,Ve,qe,ce.colorSpace),Ge=i.get(K),Je=i.get(ce);if(Je.__renderTarget=K,!Ge.__hasExternalTextures){const Ye=Math.max(1,K.width>>$),vt=Math.max(1,K.height>>$);me===t.TEXTURE_3D||me===t.TEXTURE_2D_ARRAY?n.texImage3D(me,$,mt,Ye,vt,K.depth,0,Ve,qe,null):n.texImage2D(me,$,mt,Ye,vt,0,Ve,qe,null)}n.bindFramebuffer(t.FRAMEBUFFER,ae),Re(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,he,me,Je.__webglTexture,0,Ae(K)):(me===t.TEXTURE_2D||me>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,he,me,Je.__webglTexture,$),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Te(ae,K,ce){if(t.bindRenderbuffer(t.RENDERBUFFER,ae),K.depthBuffer){const he=K.depthTexture,me=he&&he.isDepthTexture?he.type:null,$=w(K.stencilBuffer,me),Ve=K.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,qe=Ae(K);Re(K)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,qe,$,K.width,K.height):ce?t.renderbufferStorageMultisample(t.RENDERBUFFER,qe,$,K.width,K.height):t.renderbufferStorage(t.RENDERBUFFER,$,K.width,K.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ve,t.RENDERBUFFER,ae)}else{const he=K.textures;for(let me=0;me<he.length;me++){const $=he[me],Ve=a.convert($.format,$.colorSpace),qe=a.convert($.type),mt=_($.internalFormat,Ve,qe,$.colorSpace),Ge=Ae(K);ce&&Re(K)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ge,mt,K.width,K.height):Re(K)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ge,mt,K.width,K.height):t.renderbufferStorage(t.RENDERBUFFER,mt,K.width,K.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function Pe(ae,K){if(K&&K.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,ae),!(K.depthTexture&&K.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const he=i.get(K.depthTexture);he.__renderTarget=K,(!he.__webglTexture||K.depthTexture.image.width!==K.width||K.depthTexture.image.height!==K.height)&&(K.depthTexture.image.width=K.width,K.depthTexture.image.height=K.height,K.depthTexture.needsUpdate=!0),X(K.depthTexture,0);const me=he.__webglTexture,$=Ae(K);if(K.depthTexture.format===tv)Re(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,me,0,$):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,me,0);else if(K.depthTexture.format===nv)Re(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,me,0,$):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,me,0);else throw new Error("Unknown depthTexture format")}function je(ae){const K=i.get(ae),ce=ae.isWebGLCubeRenderTarget===!0;if(K.__boundDepthTexture!==ae.depthTexture){const he=ae.depthTexture;if(K.__depthDisposeCallback&&K.__depthDisposeCallback(),he){const me=()=>{delete K.__boundDepthTexture,delete K.__depthDisposeCallback,he.removeEventListener("dispose",me)};he.addEventListener("dispose",me),K.__depthDisposeCallback=me}K.__boundDepthTexture=he}if(ae.depthTexture&&!K.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");const he=ae.texture.mipmaps;he&&he.length>0?Pe(K.__webglFramebuffer[0],ae):Pe(K.__webglFramebuffer,ae)}else if(ce){K.__webglDepthbuffer=[];for(let he=0;he<6;he++)if(n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer[he]),K.__webglDepthbuffer[he]===void 0)K.__webglDepthbuffer[he]=t.createRenderbuffer(),Te(K.__webglDepthbuffer[he],ae,!1);else{const me=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,$=K.__webglDepthbuffer[he];t.bindRenderbuffer(t.RENDERBUFFER,$),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,$)}}else{const he=ae.texture.mipmaps;if(he&&he.length>0?n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer),K.__webglDepthbuffer===void 0)K.__webglDepthbuffer=t.createRenderbuffer(),Te(K.__webglDepthbuffer,ae,!1);else{const me=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,$=K.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,$),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,$)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function He(ae,K,ce){const he=i.get(ae);K!==void 0&&Se(he.__webglFramebuffer,ae,ae.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ce!==void 0&&je(ae)}function pe(ae){const K=ae.texture,ce=i.get(ae),he=i.get(K);ae.addEventListener("dispose",A);const me=ae.textures,$=ae.isWebGLCubeRenderTarget===!0,Ve=me.length>1;if(Ve||(he.__webglTexture===void 0&&(he.__webglTexture=t.createTexture()),he.__version=K.version,s.memory.textures++),$){ce.__webglFramebuffer=[];for(let qe=0;qe<6;qe++)if(K.mipmaps&&K.mipmaps.length>0){ce.__webglFramebuffer[qe]=[];for(let mt=0;mt<K.mipmaps.length;mt++)ce.__webglFramebuffer[qe][mt]=t.createFramebuffer()}else ce.__webglFramebuffer[qe]=t.createFramebuffer()}else{if(K.mipmaps&&K.mipmaps.length>0){ce.__webglFramebuffer=[];for(let qe=0;qe<K.mipmaps.length;qe++)ce.__webglFramebuffer[qe]=t.createFramebuffer()}else ce.__webglFramebuffer=t.createFramebuffer();if(Ve)for(let qe=0,mt=me.length;qe<mt;qe++){const Ge=i.get(me[qe]);Ge.__webglTexture===void 0&&(Ge.__webglTexture=t.createTexture(),s.memory.textures++)}if(ae.samples>0&&Re(ae)===!1){ce.__webglMultisampledFramebuffer=t.createFramebuffer(),ce.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ce.__webglMultisampledFramebuffer);for(let qe=0;qe<me.length;qe++){const mt=me[qe];ce.__webglColorRenderbuffer[qe]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,ce.__webglColorRenderbuffer[qe]);const Ge=a.convert(mt.format,mt.colorSpace),Je=a.convert(mt.type),Ye=_(mt.internalFormat,Ge,Je,mt.colorSpace,ae.isXRRenderTarget===!0),vt=Ae(ae);t.renderbufferStorageMultisample(t.RENDERBUFFER,vt,Ye,ae.width,ae.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+qe,t.RENDERBUFFER,ce.__webglColorRenderbuffer[qe])}t.bindRenderbuffer(t.RENDERBUFFER,null),ae.depthBuffer&&(ce.__webglDepthRenderbuffer=t.createRenderbuffer(),Te(ce.__webglDepthRenderbuffer,ae,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if($){n.bindTexture(t.TEXTURE_CUBE_MAP,he.__webglTexture),Z(t.TEXTURE_CUBE_MAP,K);for(let qe=0;qe<6;qe++)if(K.mipmaps&&K.mipmaps.length>0)for(let mt=0;mt<K.mipmaps.length;mt++)Se(ce.__webglFramebuffer[qe][mt],ae,K,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+qe,mt);else Se(ce.__webglFramebuffer[qe],ae,K,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+qe,0);y(K)&&p(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Ve){for(let qe=0,mt=me.length;qe<mt;qe++){const Ge=me[qe],Je=i.get(Ge);let Ye=t.TEXTURE_2D;(ae.isWebGL3DRenderTarget||ae.isWebGLArrayRenderTarget)&&(Ye=ae.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Ye,Je.__webglTexture),Z(Ye,Ge),Se(ce.__webglFramebuffer,ae,Ge,t.COLOR_ATTACHMENT0+qe,Ye,0),y(Ge)&&p(Ye)}n.unbindTexture()}else{let qe=t.TEXTURE_2D;if((ae.isWebGL3DRenderTarget||ae.isWebGLArrayRenderTarget)&&(qe=ae.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(qe,he.__webglTexture),Z(qe,K),K.mipmaps&&K.mipmaps.length>0)for(let mt=0;mt<K.mipmaps.length;mt++)Se(ce.__webglFramebuffer[mt],ae,K,t.COLOR_ATTACHMENT0,qe,mt);else Se(ce.__webglFramebuffer,ae,K,t.COLOR_ATTACHMENT0,qe,0);y(K)&&p(qe),n.unbindTexture()}ae.depthBuffer&&je(ae)}function ze(ae){const K=ae.textures;for(let ce=0,he=K.length;ce<he;ce++){const me=K[ce];if(y(me)){const $=x(ae),Ve=i.get(me).__webglTexture;n.bindTexture($,Ve),p($),n.unbindTexture()}}}const Ie=[],Xe=[];function we(ae){if(ae.samples>0){if(Re(ae)===!1){const K=ae.textures,ce=ae.width,he=ae.height;let me=t.COLOR_BUFFER_BIT;const $=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ve=i.get(ae),qe=K.length>1;if(qe)for(let Ge=0;Ge<K.length;Ge++)n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Ve.__webglMultisampledFramebuffer);const mt=ae.texture.mipmaps;mt&&mt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglFramebuffer);for(let Ge=0;Ge<K.length;Ge++){if(ae.resolveDepthBuffer&&(ae.depthBuffer&&(me|=t.DEPTH_BUFFER_BIT),ae.stencilBuffer&&ae.resolveStencilBuffer&&(me|=t.STENCIL_BUFFER_BIT)),qe){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Ve.__webglColorRenderbuffer[Ge]);const Je=i.get(K[Ge]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Je,0)}t.blitFramebuffer(0,0,ce,he,0,0,ce,he,me,t.NEAREST),l===!0&&(Ie.length=0,Xe.length=0,Ie.push(t.COLOR_ATTACHMENT0+Ge),ae.depthBuffer&&ae.resolveDepthBuffer===!1&&(Ie.push($),Xe.push($),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,Xe)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,Ie))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),qe)for(let Ge=0;Ge<K.length;Ge++){n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.RENDERBUFFER,Ve.__webglColorRenderbuffer[Ge]);const Je=i.get(K[Ge]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.TEXTURE_2D,Je,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglMultisampledFramebuffer)}else if(ae.depthBuffer&&ae.resolveDepthBuffer===!1&&l){const K=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[K])}}}function Ae(ae){return Math.min(r.maxSamples,ae.samples)}function Re(ae){const K=i.get(ae);return ae.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&K.__useRenderToTexture!==!1}function Ne(ae){const K=s.render.frame;u.get(ae)!==K&&(u.set(ae,K),ae.update())}function Fe(ae,K){const ce=ae.colorSpace,he=ae.format,me=ae.type;return ae.isCompressedTexture===!0||ae.isVideoTexture===!0||ce!==Su&&ce!==su&&(bi.getTransfer(ce)===pr?(he!==Qr||me!==Ao)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ce)),K}function Qe(ae){return typeof HTMLImageElement<"u"&&ae instanceof HTMLImageElement?(c.width=ae.naturalWidth||ae.width,c.height=ae.naturalHeight||ae.height):typeof VideoFrame<"u"&&ae instanceof VideoFrame?(c.width=ae.displayWidth,c.height=ae.displayHeight):(c.width=ae.width,c.height=ae.height),c}this.allocateTextureUnit=j,this.resetTextureUnits=P,this.setTexture2D=X,this.setTexture2DArray=F,this.setTexture3D=H,this.setTextureCube=V,this.rebindTextures=He,this.setupRenderTarget=pe,this.updateRenderTargetMipmap=ze,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=je,this.setupFrameBufferTexture=Se,this.useMultisampledRTT=Re}function MU(t,e){function n(i,r=su){let a;const s=bi.getTransfer(r);if(i===Ao)return t.UNSIGNED_BYTE;if(i===jA)return t.UNSIGNED_SHORT_4_4_4_4;if(i===HA)return t.UNSIGNED_SHORT_5_5_5_1;if(i===zP)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===BA)return t.BYTE;if(i===zA)return t.SHORT;if(i===Q0)return t.UNSIGNED_SHORT;if(i===Gv)return t.INT;if(i===Ac)return t.UNSIGNED_INT;if(i===wr)return t.FLOAT;if(i===as)return t.HALF_FLOAT;if(i===jP)return t.ALPHA;if(i===HP)return t.RGB;if(i===Qr)return t.RGBA;if(i===tv)return t.DEPTH_COMPONENT;if(i===nv)return t.DEPTH_STENCIL;if(i===Th)return t.RED;if(i===Wv)return t.RED_INTEGER;if(i===VA)return t.RG;if(i===F_)return t.RG_INTEGER;if(i===Xv)return t.RGBA_INTEGER;if(i===e1||i===t1||i===n1||i===i1)if(s===pr)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===e1)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===t1)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===n1)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===i1)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===e1)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===t1)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===n1)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===i1)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===T2||i===A2||i===C2||i===R2)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(i===T2)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===A2)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===C2)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===R2)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===k2||i===D2||i===O2)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(i===k2||i===D2)return s===pr?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===O2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===I2||i===N2||i===L2||i===P2||i===U2||i===F2||i===B2||i===z2||i===j2||i===H2||i===V2||i===G2||i===W2||i===X2)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(i===I2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===N2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===L2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===P2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===U2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===F2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===B2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===z2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===j2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===H2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===V2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===G2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===W2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===X2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===r1||i===q2||i===K2)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(i===r1)return s===pr?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===q2)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===K2)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===VP||i===Y2||i===J2||i===$2)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(i===r1)return a.COMPRESSED_RED_RGTC1_EXT;if(i===Y2)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===J2)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===$2)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ev?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}class $$ extends nr{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}}const OSe=`
void main() {

	gl_Position = vec4( position, 1.0 );

}`,ISe=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;

void main() {

	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );

	if ( coord.x >= 1.0 ) {

		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

	} else {

		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

	}

}`;class NSe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new $$(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new fs({vertexShader:OSe,fragmentShader:ISe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _i(new Il(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class LSe extends yf{constructor(e,n){super();const i=this;let r=null,a=1,s=null,o="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,g=null;const b=new NSe,y={},p=n.getContextAttributes();let x=null,_=null;const w=[],M=[],S=new wt;let A=null;const C=new sa;C.viewport=new ni;const k=new sa;k.viewport=new ni;const R=[C,k],N=new U$;let P=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let le=w[oe];return le===void 0&&(le=new dM,w[oe]=le),le.getTargetRaySpace()},this.getControllerGrip=function(oe){let le=w[oe];return le===void 0&&(le=new dM,w[oe]=le),le.getGripSpace()},this.getHand=function(oe){let le=w[oe];return le===void 0&&(le=new dM,w[oe]=le),le.getHandSpace()};function z(oe){const le=M.indexOf(oe.inputSource);if(le===-1)return;const ue=w[le];ue!==void 0&&(ue.update(oe.inputSource,oe.frame,c||s),ue.dispatchEvent({type:oe.type,data:oe.inputSource}))}function X(){r.removeEventListener("select",z),r.removeEventListener("selectstart",z),r.removeEventListener("selectend",z),r.removeEventListener("squeeze",z),r.removeEventListener("squeezestart",z),r.removeEventListener("squeezeend",z),r.removeEventListener("end",X),r.removeEventListener("inputsourceschange",F);for(let oe=0;oe<w.length;oe++){const le=M[oe];le!==null&&(M[oe]=null,w[oe].disconnect(le))}P=null,j=null,b.reset();for(const oe in y)delete y[oe];e.setRenderTarget(x),d=null,h=null,f=null,r=null,_=null,de.stop(),i.isPresenting=!1,e.setPixelRatio(A),e.setSize(S.width,S.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(oe){a=oe,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(oe){o=oe,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||s},this.setReferenceSpace=function(oe){c=oe},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return f},this.getFrame=function(){return g},this.getSession=function(){return r},this.setSession=async function(oe){if(r=oe,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",z),r.addEventListener("selectstart",z),r.addEventListener("selectend",z),r.addEventListener("squeeze",z),r.addEventListener("squeezestart",z),r.addEventListener("squeezeend",z),r.addEventListener("end",X),r.addEventListener("inputsourceschange",F),p.xrCompatible!==!0&&await n.makeXRCompatible(),A=e.getPixelRatio(),e.getSize(S),typeof XRWebGLBinding<"u"&&(f=new XRWebGLBinding(r,n)),f!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let ue=null,Se=null,Te=null;p.depth&&(Te=p.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,ue=p.stencil?nv:tv,Se=p.stencil?ev:Ac);const Pe={colorFormat:n.RGBA8,depthFormat:Te,scaleFactor:a};h=f.createProjectionLayer(Pe),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),_=new Cc(h.textureWidth,h.textureHeight,{format:Qr,type:Ao,depthTexture:new nU(h.textureWidth,h.textureHeight,Se,void 0,void 0,void 0,void 0,void 0,void 0,ue),stencilBuffer:p.stencil,colorSpace:e.outputColorSpace,samples:p.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1})}else{const ue={antialias:p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(r,n,ue),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),_=new Cc(d.framebufferWidth,d.framebufferHeight,{format:Qr,type:Ao,colorSpace:e.outputColorSpace,stencilBuffer:p.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}_.isXRRenderTarget=!0,this.setFoveation(l),c=null,s=await r.requestReferenceSpace(o),de.setContext(r),de.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function F(oe){for(let le=0;le<oe.removed.length;le++){const ue=oe.removed[le],Se=M.indexOf(ue);Se>=0&&(M[Se]=null,w[Se].disconnect(ue))}for(let le=0;le<oe.added.length;le++){const ue=oe.added[le];let Se=M.indexOf(ue);if(Se===-1){for(let Pe=0;Pe<w.length;Pe++)if(Pe>=M.length){M.push(ue),Se=Pe;break}else if(M[Pe]===null){M[Pe]=ue,Se=Pe;break}if(Se===-1)break}const Te=w[Se];Te&&Te.connect(ue)}}const H=new te,V=new te;function W(oe,le,ue){H.setFromMatrixPosition(le.matrixWorld),V.setFromMatrixPosition(ue.matrixWorld);const Se=H.distanceTo(V),Te=le.projectionMatrix.elements,Pe=ue.projectionMatrix.elements,je=Te[14]/(Te[10]-1),He=Te[14]/(Te[10]+1),pe=(Te[9]+1)/Te[5],ze=(Te[9]-1)/Te[5],Ie=(Te[8]-1)/Te[0],Xe=(Pe[8]+1)/Pe[0],we=je*Ie,Ae=je*Xe,Re=Se/(-Ie+Xe),Ne=Re*-Ie;if(le.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(Ne),oe.translateZ(Re),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert(),Te[10]===-1)oe.projectionMatrix.copy(le.projectionMatrix),oe.projectionMatrixInverse.copy(le.projectionMatrixInverse);else{const Fe=je+Re,Qe=He+Re,ae=we-Ne,K=Ae+(Se-Ne),ce=pe*He/Qe*Fe,he=ze*He/Qe*Fe;oe.projectionMatrix.makePerspective(ae,K,ce,he,Fe,Qe),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}}function B(oe,le){le===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(le.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(r===null)return;let le=oe.near,ue=oe.far;b.texture!==null&&(b.depthNear>0&&(le=b.depthNear),b.depthFar>0&&(ue=b.depthFar)),N.near=k.near=C.near=le,N.far=k.far=C.far=ue,(P!==N.near||j!==N.far)&&(r.updateRenderState({depthNear:N.near,depthFar:N.far}),P=N.near,j=N.far),N.layers.mask=oe.layers.mask|6,C.layers.mask=N.layers.mask&3,k.layers.mask=N.layers.mask&5;const Se=oe.parent,Te=N.cameras;B(N,Se);for(let Pe=0;Pe<Te.length;Pe++)B(Te[Pe],Se);Te.length===2?W(N,C,k):N.projectionMatrix.copy(C.projectionMatrix),Y(oe,N,Se)};function Y(oe,le,ue){ue===null?oe.matrix.copy(le.matrixWorld):(oe.matrix.copy(ue.matrixWorld),oe.matrix.invert(),oe.matrix.multiply(le.matrixWorld)),oe.matrix.decompose(oe.position,oe.quaternion,oe.scale),oe.updateMatrixWorld(!0),oe.projectionMatrix.copy(le.projectionMatrix),oe.projectionMatrixInverse.copy(le.projectionMatrixInverse),oe.isPerspectiveCamera&&(oe.fov=sv*2*Math.atan(1/oe.projectionMatrix.elements[5]),oe.zoom=1)}this.getCamera=function(){return N},this.getFoveation=function(){if(!(h===null&&d===null))return l},this.setFoveation=function(oe){l=oe,h!==null&&(h.fixedFoveation=oe),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=oe)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh(N)},this.getCameraTexture=function(oe){return y[oe]};let Z=null;function G(oe,le){if(u=le.getViewerPose(c||s),g=le,u!==null){const ue=u.views;d!==null&&(e.setRenderTargetFramebuffer(_,d.framebuffer),e.setRenderTarget(_));let Se=!1;ue.length!==N.cameras.length&&(N.cameras.length=0,Se=!0);for(let He=0;He<ue.length;He++){const pe=ue[He];let ze=null;if(d!==null)ze=d.getViewport(pe);else{const Xe=f.getViewSubImage(h,pe);ze=Xe.viewport,He===0&&(e.setRenderTargetTextures(_,Xe.colorTexture,Xe.depthStencilTexture),e.setRenderTarget(_))}let Ie=R[He];Ie===void 0&&(Ie=new sa,Ie.layers.enable(He),Ie.viewport=new ni,R[He]=Ie),Ie.matrix.fromArray(pe.transform.matrix),Ie.matrix.decompose(Ie.position,Ie.quaternion,Ie.scale),Ie.projectionMatrix.fromArray(pe.projectionMatrix),Ie.projectionMatrixInverse.copy(Ie.projectionMatrix).invert(),Ie.viewport.set(ze.x,ze.y,ze.width,ze.height),He===0&&(N.matrix.copy(Ie.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale)),Se===!0&&N.cameras.push(Ie)}const Te=r.enabledFeatures;if(Te&&Te.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&f){const He=f.getDepthInformation(ue[0]);He&&He.isValid&&He.texture&&b.init(He,r.renderState)}if(Te&&Te.includes("camera-access")&&(e.state.unbindTexture(),f))for(let He=0;He<ue.length;He++){const pe=ue[He].camera;if(pe){let ze=y[pe];ze||(ze=new $$,y[pe]=ze);const Ie=f.getCameraImage(pe);ze.sourceTexture=Ie}}}for(let ue=0;ue<w.length;ue++){const Se=M[ue],Te=w[ue];Se!==null&&Te!==void 0&&Te.update(Se,le,c||s)}Z&&Z(oe,le),le.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:le}),g=null}const de=new X$;de.setAnimationLoop(G),this.setAnimationLoop=function(oe){Z=oe},this.dispose=function(){}}}const Bp=new vi,PSe=new Dt;function USe(t,e){function n(y,p){y.matrixAutoUpdate===!0&&y.updateMatrix(),p.value.copy(y.matrix)}function i(y,p){p.color.getRGB(y.fogColor.value,n$(t)),p.isFog?(y.fogNear.value=p.near,y.fogFar.value=p.far):p.isFogExp2&&(y.fogDensity.value=p.density)}function r(y,p,x,_,w){p.isMeshBasicMaterial||p.isMeshLambertMaterial?a(y,p):p.isMeshToonMaterial?(a(y,p),f(y,p)):p.isMeshPhongMaterial?(a(y,p),u(y,p)):p.isMeshStandardMaterial?(a(y,p),h(y,p),p.isMeshPhysicalMaterial&&d(y,p,w)):p.isMeshMatcapMaterial?(a(y,p),g(y,p)):p.isMeshDepthMaterial?a(y,p):p.isMeshDistanceMaterial?(a(y,p),b(y,p)):p.isMeshNormalMaterial?a(y,p):p.isLineBasicMaterial?(s(y,p),p.isLineDashedMaterial&&o(y,p)):p.isPointsMaterial?l(y,p,x,_):p.isSpriteMaterial?c(y,p):p.isShadowMaterial?(y.color.value.copy(p.color),y.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function a(y,p){y.opacity.value=p.opacity,p.color&&y.diffuse.value.copy(p.color),p.emissive&&y.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(y.map.value=p.map,n(p.map,y.mapTransform)),p.alphaMap&&(y.alphaMap.value=p.alphaMap,n(p.alphaMap,y.alphaMapTransform)),p.bumpMap&&(y.bumpMap.value=p.bumpMap,n(p.bumpMap,y.bumpMapTransform),y.bumpScale.value=p.bumpScale,p.side===Da&&(y.bumpScale.value*=-1)),p.normalMap&&(y.normalMap.value=p.normalMap,n(p.normalMap,y.normalMapTransform),y.normalScale.value.copy(p.normalScale),p.side===Da&&y.normalScale.value.negate()),p.displacementMap&&(y.displacementMap.value=p.displacementMap,n(p.displacementMap,y.displacementMapTransform),y.displacementScale.value=p.displacementScale,y.displacementBias.value=p.displacementBias),p.emissiveMap&&(y.emissiveMap.value=p.emissiveMap,n(p.emissiveMap,y.emissiveMapTransform)),p.specularMap&&(y.specularMap.value=p.specularMap,n(p.specularMap,y.specularMapTransform)),p.alphaTest>0&&(y.alphaTest.value=p.alphaTest);const x=e.get(p),_=x.envMap,w=x.envMapRotation;_&&(y.envMap.value=_,Bp.copy(w),Bp.x*=-1,Bp.y*=-1,Bp.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(Bp.y*=-1,Bp.z*=-1),y.envMapRotation.value.setFromMatrix4(PSe.makeRotationFromEuler(Bp)),y.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=p.reflectivity,y.ior.value=p.ior,y.refractionRatio.value=p.refractionRatio),p.lightMap&&(y.lightMap.value=p.lightMap,y.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,y.lightMapTransform)),p.aoMap&&(y.aoMap.value=p.aoMap,y.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,y.aoMapTransform))}function s(y,p){y.diffuse.value.copy(p.color),y.opacity.value=p.opacity,p.map&&(y.map.value=p.map,n(p.map,y.mapTransform))}function o(y,p){y.dashSize.value=p.dashSize,y.totalSize.value=p.dashSize+p.gapSize,y.scale.value=p.scale}function l(y,p,x,_){y.diffuse.value.copy(p.color),y.opacity.value=p.opacity,y.size.value=p.size*x,y.scale.value=_*.5,p.map&&(y.map.value=p.map,n(p.map,y.uvTransform)),p.alphaMap&&(y.alphaMap.value=p.alphaMap,n(p.alphaMap,y.alphaMapTransform)),p.alphaTest>0&&(y.alphaTest.value=p.alphaTest)}function c(y,p){y.diffuse.value.copy(p.color),y.opacity.value=p.opacity,y.rotation.value=p.rotation,p.map&&(y.map.value=p.map,n(p.map,y.mapTransform)),p.alphaMap&&(y.alphaMap.value=p.alphaMap,n(p.alphaMap,y.alphaMapTransform)),p.alphaTest>0&&(y.alphaTest.value=p.alphaTest)}function u(y,p){y.specular.value.copy(p.specular),y.shininess.value=Math.max(p.shininess,1e-4)}function f(y,p){p.gradientMap&&(y.gradientMap.value=p.gradientMap)}function h(y,p){y.metalness.value=p.metalness,p.metalnessMap&&(y.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,y.metalnessMapTransform)),y.roughness.value=p.roughness,p.roughnessMap&&(y.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,y.roughnessMapTransform)),p.envMap&&(y.envMapIntensity.value=p.envMapIntensity)}function d(y,p,x){y.ior.value=p.ior,p.sheen>0&&(y.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),y.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(y.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,y.sheenColorMapTransform)),p.sheenRoughnessMap&&(y.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,y.sheenRoughnessMapTransform))),p.clearcoat>0&&(y.clearcoat.value=p.clearcoat,y.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(y.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,y.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(y.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Da&&y.clearcoatNormalScale.value.negate())),p.dispersion>0&&(y.dispersion.value=p.dispersion),p.iridescence>0&&(y.iridescence.value=p.iridescence,y.iridescenceIOR.value=p.iridescenceIOR,y.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(y.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,y.iridescenceMapTransform)),p.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),p.transmission>0&&(y.transmission.value=p.transmission,y.transmissionSamplerMap.value=x.texture,y.transmissionSamplerSize.value.set(x.width,x.height),p.transmissionMap&&(y.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,y.transmissionMapTransform)),y.thickness.value=p.thickness,p.thicknessMap&&(y.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=p.attenuationDistance,y.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(y.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(y.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=p.specularIntensity,y.specularColor.value.copy(p.specularColor),p.specularColorMap&&(y.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,y.specularColorMapTransform)),p.specularIntensityMap&&(y.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,y.specularIntensityMapTransform))}function g(y,p){p.matcap&&(y.matcap.value=p.matcap)}function b(y,p){const x=e.get(p).light;y.referencePosition.value.setFromMatrixPosition(x.matrixWorld),y.nearDistance.value=x.shadow.camera.near,y.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function FSe(t,e,n,i){let r={},a={},s=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,_){const w=_.program;i.uniformBlockBinding(x,w)}function c(x,_){let w=r[x.id];w===void 0&&(g(x),w=u(x),r[x.id]=w,x.addEventListener("dispose",y));const M=_.program;i.updateUBOMapping(x,M);const S=e.render.frame;a[x.id]!==S&&(h(x),a[x.id]=S)}function u(x){const _=f();x.__bindingPointIndex=_;const w=t.createBuffer(),M=x.__size,S=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,w),t.bufferData(t.UNIFORM_BUFFER,M,S),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,_,w),w}function f(){for(let x=0;x<o;x++)if(s.indexOf(x)===-1)return s.push(x),x;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function h(x){const _=r[x.id],w=x.uniforms,M=x.__cache;t.bindBuffer(t.UNIFORM_BUFFER,_);for(let S=0,A=w.length;S<A;S++){const C=Array.isArray(w[S])?w[S]:[w[S]];for(let k=0,R=C.length;k<R;k++){const N=C[k];if(d(N,S,k,M)===!0){const P=N.__offset,j=Array.isArray(N.value)?N.value:[N.value];let z=0;for(let X=0;X<j.length;X++){const F=j[X],H=b(F);typeof F=="number"||typeof F=="boolean"?(N.__data[0]=F,t.bufferSubData(t.UNIFORM_BUFFER,P+z,N.__data)):F.isMatrix3?(N.__data[0]=F.elements[0],N.__data[1]=F.elements[1],N.__data[2]=F.elements[2],N.__data[3]=0,N.__data[4]=F.elements[3],N.__data[5]=F.elements[4],N.__data[6]=F.elements[5],N.__data[7]=0,N.__data[8]=F.elements[6],N.__data[9]=F.elements[7],N.__data[10]=F.elements[8],N.__data[11]=0):(F.toArray(N.__data,z),z+=H.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,P,N.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function d(x,_,w,M){const S=x.value,A=_+"_"+w;if(M[A]===void 0)return typeof S=="number"||typeof S=="boolean"?M[A]=S:M[A]=S.clone(),!0;{const C=M[A];if(typeof S=="number"||typeof S=="boolean"){if(C!==S)return M[A]=S,!0}else if(C.equals(S)===!1)return C.copy(S),!0}return!1}function g(x){const _=x.uniforms;let w=0;const M=16;for(let A=0,C=_.length;A<C;A++){const k=Array.isArray(_[A])?_[A]:[_[A]];for(let R=0,N=k.length;R<N;R++){const P=k[R],j=Array.isArray(P.value)?P.value:[P.value];for(let z=0,X=j.length;z<X;z++){const F=j[z],H=b(F),V=w%M,W=V%H.boundary,B=V+W;w+=W,B!==0&&M-B<H.storage&&(w+=M-B),P.__data=new Float32Array(H.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=w,w+=H.storage}}}const S=w%M;return S>0&&(w+=M-S),x.__size=w,x.__cache={},this}function b(x){const _={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(_.boundary=4,_.storage=4):x.isVector2?(_.boundary=8,_.storage=8):x.isVector3||x.isColor?(_.boundary=16,_.storage=12):x.isVector4?(_.boundary=16,_.storage=16):x.isMatrix3?(_.boundary=48,_.storage=48):x.isMatrix4?(_.boundary=64,_.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),_}function y(x){const _=x.target;_.removeEventListener("dispose",y);const w=s.indexOf(_.__bindingPointIndex);s.splice(w,1),t.deleteBuffer(r[_.id]),delete r[_.id],delete a[_.id]}function p(){for(const x in r)t.deleteBuffer(r[x]);s=[],r={},a={}}return{bind:l,update:c,dispose:p}}class TU{constructor(e={}){const{canvas:n=ZJ(),context:i=null,depth:r=!0,stencil:a=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reversedDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=s;const g=new Uint32Array(4),b=new Int32Array(4);let y=null,p=null;const x=[],_=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=sf,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const w=this;let M=!1;this._outputColorSpace=As;let S=0,A=0,C=null,k=-1,R=null;const N=new ni,P=new ni;let j=null;const z=new Ut(0);let X=0,F=n.width,H=n.height,V=1,W=null,B=null;const Y=new ni(0,0,F,H),Z=new ni(0,0,F,H);let G=!1;const de=new tp;let oe=!1,le=!1;const ue=new Dt,Se=new te,Te=new ni,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let je=!1;function He(){return C===null?V:1}let pe=i;function ze(ee,xe){return n.getContext(ee,xe)}try{const ee={alpha:!0,depth:r,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Hv}`),n.addEventListener("webglcontextlost",ht,!1),n.addEventListener("webglcontextrestored",jt,!1),n.addEventListener("webglcontextcreationerror",ot,!1),pe===null){const xe="webgl2";if(pe=ze(xe,ee),pe===null)throw ze(xe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(ee){throw console.error("THREE.WebGLRenderer: "+ee.message),ee}let Ie,Xe,we,Ae,Re,Ne,Fe,Qe,ae,K,ce,he,me,$,Ve,qe,mt,Ge,Je,Ye,vt,Mt,gt,kt;function ke(){Ie=new J1e(pe),Ie.init(),Mt=new MU(pe,Ie),Xe=new V1e(pe,Ie,e,Mt),we=new kSe(pe,Ie),Xe.reversedDepthBuffer&&h&&we.buffers.depth.setReversed(!0),Ae=new Q1e(pe),Re=new bSe,Ne=new DSe(pe,Ie,we,Re,Xe,Mt,Ae),Fe=new W1e(w),Qe=new Y1e(w),ae=new aye(pe),gt=new j1e(pe,ae),K=new $1e(pe,ae,Ae,gt),ce=new t_e(pe,K,ae,Ae),Je=new e_e(pe,Xe,Ne),qe=new G1e(Re),he=new gSe(w,Fe,Qe,Ie,Xe,gt,qe),me=new USe(w,Re),$=new ySe,Ve=new MSe(Ie),Ge=new z1e(w,Fe,Qe,we,ce,d,l),mt=new CSe(w,ce,Xe),kt=new FSe(pe,Ae,Xe,we),Ye=new H1e(pe,Ie,Ae),vt=new Z1e(pe,Ie,Ae),Ae.programs=he.programs,w.capabilities=Xe,w.extensions=Ie,w.properties=Re,w.renderLists=$,w.shadowMap=mt,w.state=we,w.info=Ae}ke();const Le=new LSe(w,pe);this.xr=Le,this.getContext=function(){return pe},this.getContextAttributes=function(){return pe.getContextAttributes()},this.forceContextLoss=function(){const ee=Ie.get("WEBGL_lose_context");ee&&ee.loseContext()},this.forceContextRestore=function(){const ee=Ie.get("WEBGL_lose_context");ee&&ee.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(ee){ee!==void 0&&(V=ee,this.setSize(F,H,!1))},this.getSize=function(ee){return ee.set(F,H)},this.setSize=function(ee,xe,Ce=!0){if(Le.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}F=ee,H=xe,n.width=Math.floor(ee*V),n.height=Math.floor(xe*V),Ce===!0&&(n.style.width=ee+"px",n.style.height=xe+"px"),this.setViewport(0,0,ee,xe)},this.getDrawingBufferSize=function(ee){return ee.set(F*V,H*V).floor()},this.setDrawingBufferSize=function(ee,xe,Ce){F=ee,H=xe,V=Ce,n.width=Math.floor(ee*Ce),n.height=Math.floor(xe*Ce),this.setViewport(0,0,ee,xe)},this.getCurrentViewport=function(ee){return ee.copy(N)},this.getViewport=function(ee){return ee.copy(Y)},this.setViewport=function(ee,xe,Ce,Oe){ee.isVector4?Y.set(ee.x,ee.y,ee.z,ee.w):Y.set(ee,xe,Ce,Oe),we.viewport(N.copy(Y).multiplyScalar(V).round())},this.getScissor=function(ee){return ee.copy(Z)},this.setScissor=function(ee,xe,Ce,Oe){ee.isVector4?Z.set(ee.x,ee.y,ee.z,ee.w):Z.set(ee,xe,Ce,Oe),we.scissor(P.copy(Z).multiplyScalar(V).round())},this.getScissorTest=function(){return G},this.setScissorTest=function(ee){we.setScissorTest(G=ee)},this.setOpaqueSort=function(ee){W=ee},this.setTransparentSort=function(ee){B=ee},this.getClearColor=function(ee){return ee.copy(Ge.getClearColor())},this.setClearColor=function(){Ge.setClearColor(...arguments)},this.getClearAlpha=function(){return Ge.getClearAlpha()},this.setClearAlpha=function(){Ge.setClearAlpha(...arguments)},this.clear=function(ee=!0,xe=!0,Ce=!0){let Oe=0;if(ee){let ve=!1;if(C!==null){const _t=C.texture.format;ve=_t===Xv||_t===F_||_t===Wv}if(ve){const _t=C.texture.type,ft=_t===Ao||_t===Ac||_t===Q0||_t===ev||_t===jA||_t===HA,yt=Ge.getClearColor(),St=Ge.getClearAlpha(),Nt=yt.r,Xt=yt.g,at=yt.b;ft?(g[0]=Nt,g[1]=Xt,g[2]=at,g[3]=St,pe.clearBufferuiv(pe.COLOR,0,g)):(b[0]=Nt,b[1]=Xt,b[2]=at,b[3]=St,pe.clearBufferiv(pe.COLOR,0,b))}else Oe|=pe.COLOR_BUFFER_BIT}xe&&(Oe|=pe.DEPTH_BUFFER_BIT),Ce&&(Oe|=pe.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),pe.clear(Oe)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",ht,!1),n.removeEventListener("webglcontextrestored",jt,!1),n.removeEventListener("webglcontextcreationerror",ot,!1),Ge.dispose(),$.dispose(),Ve.dispose(),Re.dispose(),Fe.dispose(),Qe.dispose(),ce.dispose(),gt.dispose(),kt.dispose(),he.dispose(),Le.dispose(),Le.removeEventListener("sessionstart",vn),Le.removeEventListener("sessionend",Qn),Yn.stop()};function ht(ee){ee.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function jt(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const ee=Ae.autoReset,xe=mt.enabled,Ce=mt.autoUpdate,Oe=mt.needsUpdate,ve=mt.type;ke(),Ae.autoReset=ee,mt.enabled=xe,mt.autoUpdate=Ce,mt.needsUpdate=Oe,mt.type=ve}function ot(ee){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ee.statusMessage)}function it(ee){const xe=ee.target;xe.removeEventListener("dispose",it),bt(xe)}function bt(ee){Jt(ee),Re.remove(ee)}function Jt(ee){const xe=Re.get(ee).programs;xe!==void 0&&(xe.forEach(function(Ce){he.releaseProgram(Ce)}),ee.isShaderMaterial&&he.releaseShaderCache(ee))}this.renderBufferDirect=function(ee,xe,Ce,Oe,ve,_t){xe===null&&(xe=Pe);const ft=ve.isMesh&&ve.matrixWorld.determinant()<0,yt=ge(ee,xe,Ce,Oe,ve);we.setMaterial(Oe,ft);let St=Ce.index,Nt=1;if(Oe.wireframe===!0){if(St=K.getWireframeAttribute(Ce),St===void 0)return;Nt=2}const Xt=Ce.drawRange,at=Ce.attributes.position;let nn=Xt.start*Nt,pn=(Xt.start+Xt.count)*Nt;_t!==null&&(nn=Math.max(nn,_t.start*Nt),pn=Math.min(pn,(_t.start+_t.count)*Nt)),St!==null?(nn=Math.max(nn,0),pn=Math.min(pn,St.count)):at!=null&&(nn=Math.max(nn,0),pn=Math.min(pn,at.count));const dn=pn-nn;if(dn<0||dn===1/0)return;gt.setup(ve,Oe,yt,Ce,St);let Dn,$t=Ye;if(St!==null&&(Dn=ae.get(St),$t=vt,$t.setIndex(Dn)),ve.isMesh)Oe.wireframe===!0?(we.setLineWidth(Oe.wireframeLinewidth*He()),$t.setMode(pe.LINES)):$t.setMode(pe.TRIANGLES);else if(ve.isLine){let Yt=Oe.linewidth;Yt===void 0&&(Yt=1),we.setLineWidth(Yt*He()),ve.isLineSegments?$t.setMode(pe.LINES):ve.isLineLoop?$t.setMode(pe.LINE_LOOP):$t.setMode(pe.LINE_STRIP)}else ve.isPoints?$t.setMode(pe.POINTS):ve.isSprite&&$t.setMode(pe.TRIANGLES);if(ve.isBatchedMesh)if(ve._multiDrawInstances!==null)S0("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),$t.renderMultiDrawInstances(ve._multiDrawStarts,ve._multiDrawCounts,ve._multiDrawCount,ve._multiDrawInstances);else if(Ie.get("WEBGL_multi_draw"))$t.renderMultiDraw(ve._multiDrawStarts,ve._multiDrawCounts,ve._multiDrawCount);else{const Yt=ve._multiDrawStarts,Un=ve._multiDrawCounts,xn=ve._multiDrawCount,Zn=St?ae.get(St).bytesPerElement:1,Nn=Re.get(Oe).currentProgram.getUniforms();for(let An=0;An<xn;An++)Nn.setValue(pe,"_gl_DrawID",An),$t.render(Yt[An]/Zn,Un[An])}else if(ve.isInstancedMesh)$t.renderInstances(nn,dn,ve.count);else if(Ce.isInstancedBufferGeometry){const Yt=Ce._maxInstanceCount!==void 0?Ce._maxInstanceCount:1/0,Un=Math.min(Ce.instanceCount,Yt);$t.renderInstances(nn,dn,Un)}else $t.render(nn,dn)};function Kt(ee,xe,Ce){ee.transparent===!0&&ee.side===Jr&&ee.forceSinglePass===!1?(ee.side=Da,ee.needsUpdate=!0,Ii(ee,xe,Ce),ee.side=_u,ee.needsUpdate=!0,Ii(ee,xe,Ce),ee.side=Jr):Ii(ee,xe,Ce)}this.compile=function(ee,xe,Ce=null){Ce===null&&(Ce=ee),p=Ve.get(Ce),p.init(xe),_.push(p),Ce.traverseVisible(function(ve){ve.isLight&&ve.layers.test(xe.layers)&&(p.pushLight(ve),ve.castShadow&&p.pushShadow(ve))}),ee!==Ce&&ee.traverseVisible(function(ve){ve.isLight&&ve.layers.test(xe.layers)&&(p.pushLight(ve),ve.castShadow&&p.pushShadow(ve))}),p.setupLights();const Oe=new Set;return ee.traverse(function(ve){if(!(ve.isMesh||ve.isPoints||ve.isLine||ve.isSprite))return;const _t=ve.material;if(_t)if(Array.isArray(_t))for(let ft=0;ft<_t.length;ft++){const yt=_t[ft];Kt(yt,Ce,ve),Oe.add(yt)}else Kt(_t,Ce,ve),Oe.add(_t)}),p=_.pop(),Oe},this.compileAsync=function(ee,xe,Ce=null){const Oe=this.compile(ee,xe,Ce);return new Promise(ve=>{function _t(){if(Oe.forEach(function(ft){Re.get(ft).currentProgram.isReady()&&Oe.delete(ft)}),Oe.size===0){ve(ee);return}setTimeout(_t,10)}Ie.get("KHR_parallel_shader_compile")!==null?_t():setTimeout(_t,10)})};let un=null;function Vn(ee){un&&un(ee)}function vn(){Yn.stop()}function Qn(){Yn.start()}const Yn=new X$;Yn.setAnimationLoop(Vn),typeof self<"u"&&Yn.setContext(self),this.setAnimationLoop=function(ee){un=ee,Le.setAnimationLoop(ee),ee===null?Yn.stop():Yn.start()},Le.addEventListener("sessionstart",vn),Le.addEventListener("sessionend",Qn),this.render=function(ee,xe){if(xe!==void 0&&xe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(ee.matrixWorldAutoUpdate===!0&&ee.updateMatrixWorld(),xe.parent===null&&xe.matrixWorldAutoUpdate===!0&&xe.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(xe),xe=Le.getCamera()),ee.isScene===!0&&ee.onBeforeRender(w,ee,xe,C),p=Ve.get(ee,_.length),p.init(xe),_.push(p),ue.multiplyMatrices(xe.projectionMatrix,xe.matrixWorldInverse),de.setFromProjectionMatrix(ue,yl,xe.reversedDepth),le=this.localClippingEnabled,oe=qe.init(this.clippingPlanes,le),y=$.get(ee,x.length),y.init(),x.push(y),Le.enabled===!0&&Le.isPresenting===!0){const _t=w.xr.getDepthSensingMesh();_t!==null&&xi(_t,xe,-1/0,w.sortObjects)}xi(ee,xe,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(W,B),je=Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1,je&&Ge.addToRenderList(y,ee),this.info.render.frame++,oe===!0&&qe.beginShadows();const Ce=p.state.shadowsArray;mt.render(Ce,ee,xe),oe===!0&&qe.endShadows(),this.info.autoReset===!0&&this.info.reset();const Oe=y.opaque,ve=y.transmissive;if(p.setupLights(),xe.isArrayCamera){const _t=xe.cameras;if(ve.length>0)for(let ft=0,yt=_t.length;ft<yt;ft++){const St=_t[ft];Ji(Oe,ve,ee,St)}je&&Ge.render(ee);for(let ft=0,yt=_t.length;ft<yt;ft++){const St=_t[ft];qn(y,ee,St,St.viewport)}}else ve.length>0&&Ji(Oe,ve,ee,xe),je&&Ge.render(ee),qn(y,ee,xe);C!==null&&A===0&&(Ne.updateMultisampleRenderTarget(C),Ne.updateRenderTargetMipmap(C)),ee.isScene===!0&&ee.onAfterRender(w,ee,xe),gt.resetDefaultState(),k=-1,R=null,_.pop(),_.length>0?(p=_[_.length-1],oe===!0&&qe.setGlobalState(w.clippingPlanes,p.state.camera)):p=null,x.pop(),x.length>0?y=x[x.length-1]:y=null};function xi(ee,xe,Ce,Oe){if(ee.visible===!1)return;if(ee.layers.test(xe.layers)){if(ee.isGroup)Ce=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(xe);else if(ee.isLight)p.pushLight(ee),ee.castShadow&&p.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||de.intersectsSprite(ee)){Oe&&Te.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(ue);const ft=ce.update(ee),yt=ee.material;yt.visible&&y.push(ee,ft,yt,Ce,Te.z,null)}}else if((ee.isMesh||ee.isLine||ee.isPoints)&&(!ee.frustumCulled||de.intersectsObject(ee))){const ft=ce.update(ee),yt=ee.material;if(Oe&&(ee.boundingSphere!==void 0?(ee.boundingSphere===null&&ee.computeBoundingSphere(),Te.copy(ee.boundingSphere.center)):(ft.boundingSphere===null&&ft.computeBoundingSphere(),Te.copy(ft.boundingSphere.center)),Te.applyMatrix4(ee.matrixWorld).applyMatrix4(ue)),Array.isArray(yt)){const St=ft.groups;for(let Nt=0,Xt=St.length;Nt<Xt;Nt++){const at=St[Nt],nn=yt[at.materialIndex];nn&&nn.visible&&y.push(ee,ft,nn,Ce,Te.z,at)}}else yt.visible&&y.push(ee,ft,yt,Ce,Te.z,null)}}const _t=ee.children;for(let ft=0,yt=_t.length;ft<yt;ft++)xi(_t[ft],xe,Ce,Oe)}function qn(ee,xe,Ce,Oe){const ve=ee.opaque,_t=ee.transmissive,ft=ee.transparent;p.setupLightsView(Ce),oe===!0&&qe.setGlobalState(w.clippingPlanes,Ce),Oe&&we.viewport(N.copy(Oe)),ve.length>0&&hi(ve,xe,Ce),_t.length>0&&hi(_t,xe,Ce),ft.length>0&&hi(ft,xe,Ce),we.buffers.depth.setTest(!0),we.buffers.depth.setMask(!0),we.buffers.color.setMask(!0),we.setPolygonOffset(!1)}function Ji(ee,xe,Ce,Oe){if((Ce.isScene===!0?Ce.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[Oe.id]===void 0&&(p.state.transmissionRenderTarget[Oe.id]=new Cc(1,1,{generateMipmaps:!0,type:Ie.has("EXT_color_buffer_half_float")||Ie.has("EXT_color_buffer_float")?as:Ao,minFilter:vc,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:bi.workingColorSpace}));const _t=p.state.transmissionRenderTarget[Oe.id],ft=Oe.viewport||N;_t.setSize(ft.z*w.transmissionResolutionScale,ft.w*w.transmissionResolutionScale);const yt=w.getRenderTarget(),St=w.getActiveCubeFace(),Nt=w.getActiveMipmapLevel();w.setRenderTarget(_t),w.getClearColor(z),X=w.getClearAlpha(),X<1&&w.setClearColor(16777215,.5),w.clear(),je&&Ge.render(Ce);const Xt=w.toneMapping;w.toneMapping=sf;const at=Oe.viewport;if(Oe.viewport!==void 0&&(Oe.viewport=void 0),p.setupLightsView(Oe),oe===!0&&qe.setGlobalState(w.clippingPlanes,Oe),hi(ee,Ce,Oe),Ne.updateMultisampleRenderTarget(_t),Ne.updateRenderTargetMipmap(_t),Ie.has("WEBGL_multisampled_render_to_texture")===!1){let nn=!1;for(let pn=0,dn=xe.length;pn<dn;pn++){const Dn=xe[pn],$t=Dn.object,Yt=Dn.geometry,Un=Dn.material,xn=Dn.group;if(Un.side===Jr&&$t.layers.test(Oe.layers)){const Zn=Un.side;Un.side=Da,Un.needsUpdate=!0,on($t,Ce,Oe,Yt,Un,xn),Un.side=Zn,Un.needsUpdate=!0,nn=!0}}nn===!0&&(Ne.updateMultisampleRenderTarget(_t),Ne.updateRenderTargetMipmap(_t))}w.setRenderTarget(yt,St,Nt),w.setClearColor(z,X),at!==void 0&&(Oe.viewport=at),w.toneMapping=Xt}function hi(ee,xe,Ce){const Oe=xe.isScene===!0?xe.overrideMaterial:null;for(let ve=0,_t=ee.length;ve<_t;ve++){const ft=ee[ve],yt=ft.object,St=ft.geometry,Nt=ft.group;let Xt=ft.material;Xt.allowOverride===!0&&Oe!==null&&(Xt=Oe),yt.layers.test(Ce.layers)&&on(yt,xe,Ce,St,Xt,Nt)}}function on(ee,xe,Ce,Oe,ve,_t){ee.onBeforeRender(w,xe,Ce,Oe,ve,_t),ee.modelViewMatrix.multiplyMatrices(Ce.matrixWorldInverse,ee.matrixWorld),ee.normalMatrix.getNormalMatrix(ee.modelViewMatrix),ve.onBeforeRender(w,xe,Ce,Oe,ee,_t),ve.transparent===!0&&ve.side===Jr&&ve.forceSinglePass===!1?(ve.side=Da,ve.needsUpdate=!0,w.renderBufferDirect(Ce,xe,Oe,ve,ee,_t),ve.side=_u,ve.needsUpdate=!0,w.renderBufferDirect(Ce,xe,Oe,ve,ee,_t),ve.side=Jr):w.renderBufferDirect(Ce,xe,Oe,ve,ee,_t),ee.onAfterRender(w,xe,Ce,Oe,ve,_t)}function Ii(ee,xe,Ce){xe.isScene!==!0&&(xe=Pe);const Oe=Re.get(ee),ve=p.state.lights,_t=p.state.shadowsArray,ft=ve.state.version,yt=he.getParameters(ee,ve.state,_t,xe,Ce),St=he.getProgramCacheKey(yt);let Nt=Oe.programs;Oe.environment=ee.isMeshStandardMaterial?xe.environment:null,Oe.fog=xe.fog,Oe.envMap=(ee.isMeshStandardMaterial?Qe:Fe).get(ee.envMap||Oe.environment),Oe.envMapRotation=Oe.environment!==null&&ee.envMap===null?xe.environmentRotation:ee.envMapRotation,Nt===void 0&&(ee.addEventListener("dispose",it),Nt=new Map,Oe.programs=Nt);let Xt=Nt.get(St);if(Xt!==void 0){if(Oe.currentProgram===Xt&&Oe.lightsStateVersion===ft)return se(ee,yt),Xt}else yt.uniforms=he.getUniforms(ee),ee.onBeforeCompile(yt,w),Xt=he.acquireProgram(yt,St),Nt.set(St,Xt),Oe.uniforms=yt.uniforms;const at=Oe.uniforms;return(!ee.isShaderMaterial&&!ee.isRawShaderMaterial||ee.clipping===!0)&&(at.clippingPlanes=qe.uniform),se(ee,yt),Oe.needsLights=rt(ee),Oe.lightsStateVersion=ft,Oe.needsLights&&(at.ambientLightColor.value=ve.state.ambient,at.lightProbe.value=ve.state.probe,at.directionalLights.value=ve.state.directional,at.directionalLightShadows.value=ve.state.directionalShadow,at.spotLights.value=ve.state.spot,at.spotLightShadows.value=ve.state.spotShadow,at.rectAreaLights.value=ve.state.rectArea,at.ltc_1.value=ve.state.rectAreaLTC1,at.ltc_2.value=ve.state.rectAreaLTC2,at.pointLights.value=ve.state.point,at.pointLightShadows.value=ve.state.pointShadow,at.hemisphereLights.value=ve.state.hemi,at.directionalShadowMap.value=ve.state.directionalShadowMap,at.directionalShadowMatrix.value=ve.state.directionalShadowMatrix,at.spotShadowMap.value=ve.state.spotShadowMap,at.spotLightMatrix.value=ve.state.spotLightMatrix,at.spotLightMap.value=ve.state.spotLightMap,at.pointShadowMap.value=ve.state.pointShadowMap,at.pointShadowMatrix.value=ve.state.pointShadowMatrix),Oe.currentProgram=Xt,Oe.uniformsList=null,Xt}function ri(ee){if(ee.uniformsList===null){const xe=ee.currentProgram.getUniforms();ee.uniformsList=pM.seqWithValue(xe.seq,ee.uniforms)}return ee.uniformsList}function se(ee,xe){const Ce=Re.get(ee);Ce.outputColorSpace=xe.outputColorSpace,Ce.batching=xe.batching,Ce.batchingColor=xe.batchingColor,Ce.instancing=xe.instancing,Ce.instancingColor=xe.instancingColor,Ce.instancingMorph=xe.instancingMorph,Ce.skinning=xe.skinning,Ce.morphTargets=xe.morphTargets,Ce.morphNormals=xe.morphNormals,Ce.morphColors=xe.morphColors,Ce.morphTargetsCount=xe.morphTargetsCount,Ce.numClippingPlanes=xe.numClippingPlanes,Ce.numIntersection=xe.numClipIntersection,Ce.vertexAlphas=xe.vertexAlphas,Ce.vertexTangents=xe.vertexTangents,Ce.toneMapping=xe.toneMapping}function ge(ee,xe,Ce,Oe,ve){xe.isScene!==!0&&(xe=Pe),Ne.resetTextureUnits();const _t=xe.fog,ft=Oe.isMeshStandardMaterial?xe.environment:null,yt=C===null?w.outputColorSpace:C.isXRRenderTarget===!0?C.texture.colorSpace:Su,St=(Oe.isMeshStandardMaterial?Qe:Fe).get(Oe.envMap||ft),Nt=Oe.vertexColors===!0&&!!Ce.attributes.color&&Ce.attributes.color.itemSize===4,Xt=!!Ce.attributes.tangent&&(!!Oe.normalMap||Oe.anisotropy>0),at=!!Ce.morphAttributes.position,nn=!!Ce.morphAttributes.normal,pn=!!Ce.morphAttributes.color;let dn=sf;Oe.toneMapped&&(C===null||C.isXRRenderTarget===!0)&&(dn=w.toneMapping);const Dn=Ce.morphAttributes.position||Ce.morphAttributes.normal||Ce.morphAttributes.color,$t=Dn!==void 0?Dn.length:0,Yt=Re.get(Oe),Un=p.state.lights;if(oe===!0&&(le===!0||ee!==R)){const Gn=ee===R&&Oe.id===k;qe.setState(Oe,ee,Gn)}let xn=!1;Oe.version===Yt.__version?(Yt.needsLights&&Yt.lightsStateVersion!==Un.state.version||Yt.outputColorSpace!==yt||ve.isBatchedMesh&&Yt.batching===!1||!ve.isBatchedMesh&&Yt.batching===!0||ve.isBatchedMesh&&Yt.batchingColor===!0&&ve.colorTexture===null||ve.isBatchedMesh&&Yt.batchingColor===!1&&ve.colorTexture!==null||ve.isInstancedMesh&&Yt.instancing===!1||!ve.isInstancedMesh&&Yt.instancing===!0||ve.isSkinnedMesh&&Yt.skinning===!1||!ve.isSkinnedMesh&&Yt.skinning===!0||ve.isInstancedMesh&&Yt.instancingColor===!0&&ve.instanceColor===null||ve.isInstancedMesh&&Yt.instancingColor===!1&&ve.instanceColor!==null||ve.isInstancedMesh&&Yt.instancingMorph===!0&&ve.morphTexture===null||ve.isInstancedMesh&&Yt.instancingMorph===!1&&ve.morphTexture!==null||Yt.envMap!==St||Oe.fog===!0&&Yt.fog!==_t||Yt.numClippingPlanes!==void 0&&(Yt.numClippingPlanes!==qe.numPlanes||Yt.numIntersection!==qe.numIntersection)||Yt.vertexAlphas!==Nt||Yt.vertexTangents!==Xt||Yt.morphTargets!==at||Yt.morphNormals!==nn||Yt.morphColors!==pn||Yt.toneMapping!==dn||Yt.morphTargetsCount!==$t)&&(xn=!0):(xn=!0,Yt.__version=Oe.version);let Zn=Yt.currentProgram;xn===!0&&(Zn=Ii(Oe,xe,ve));let Nn=!1,An=!1,Sn=!1;const an=Zn.getUniforms(),di=Yt.uniforms;if(we.useProgram(Zn.program)&&(Nn=!0,An=!0,Sn=!0),Oe.id!==k&&(k=Oe.id,An=!0),Nn||R!==ee){we.buffers.depth.getReversed()&&ee.reversedDepth!==!0&&(ee._reversedDepth=!0,ee.updateProjectionMatrix()),an.setValue(pe,"projectionMatrix",ee.projectionMatrix),an.setValue(pe,"viewMatrix",ee.matrixWorldInverse);const wi=an.map.cameraPosition;wi!==void 0&&wi.setValue(pe,Se.setFromMatrixPosition(ee.matrixWorld)),Xe.logarithmicDepthBuffer&&an.setValue(pe,"logDepthBufFC",2/(Math.log(ee.far+1)/Math.LN2)),(Oe.isMeshPhongMaterial||Oe.isMeshToonMaterial||Oe.isMeshLambertMaterial||Oe.isMeshBasicMaterial||Oe.isMeshStandardMaterial||Oe.isShaderMaterial)&&an.setValue(pe,"isOrthographic",ee.isOrthographicCamera===!0),R!==ee&&(R=ee,An=!0,Sn=!0)}if(ve.isSkinnedMesh){an.setOptional(pe,ve,"bindMatrix"),an.setOptional(pe,ve,"bindMatrixInverse");const Gn=ve.skeleton;Gn&&(Gn.boneTexture===null&&Gn.computeBoneTexture(),an.setValue(pe,"boneTexture",Gn.boneTexture,Ne))}ve.isBatchedMesh&&(an.setOptional(pe,ve,"batchingTexture"),an.setValue(pe,"batchingTexture",ve._matricesTexture,Ne),an.setOptional(pe,ve,"batchingIdTexture"),an.setValue(pe,"batchingIdTexture",ve._indirectTexture,Ne),an.setOptional(pe,ve,"batchingColorTexture"),ve._colorsTexture!==null&&an.setValue(pe,"batchingColorTexture",ve._colorsTexture,Ne));const Li=Ce.morphAttributes;if((Li.position!==void 0||Li.normal!==void 0||Li.color!==void 0)&&Je.update(ve,Ce,Zn),(An||Yt.receiveShadow!==ve.receiveShadow)&&(Yt.receiveShadow=ve.receiveShadow,an.setValue(pe,"receiveShadow",ve.receiveShadow)),Oe.isMeshGouraudMaterial&&Oe.envMap!==null&&(di.envMap.value=St,di.flipEnvMap.value=St.isCubeTexture&&St.isRenderTargetTexture===!1?-1:1),Oe.isMeshStandardMaterial&&Oe.envMap===null&&xe.environment!==null&&(di.envMapIntensity.value=xe.environmentIntensity),An&&(an.setValue(pe,"toneMappingExposure",w.toneMappingExposure),Yt.needsLights&&Ue(di,Sn),_t&&Oe.fog===!0&&me.refreshFogUniforms(di,_t),me.refreshMaterialUniforms(di,Oe,V,H,p.state.transmissionRenderTarget[ee.id]),pM.upload(pe,ri(Yt),di,Ne)),Oe.isShaderMaterial&&Oe.uniformsNeedUpdate===!0&&(pM.upload(pe,ri(Yt),di,Ne),Oe.uniformsNeedUpdate=!1),Oe.isSpriteMaterial&&an.setValue(pe,"center",ve.center),an.setValue(pe,"modelViewMatrix",ve.modelViewMatrix),an.setValue(pe,"normalMatrix",ve.normalMatrix),an.setValue(pe,"modelMatrix",ve.matrixWorld),Oe.isShaderMaterial||Oe.isRawShaderMaterial){const Gn=Oe.uniformsGroups;for(let wi=0,Sa=Gn.length;wi<Sa;wi++){const Gi=Gn[wi];kt.update(Gi,Zn),kt.bind(Gi,Zn)}}return Zn}function Ue(ee,xe){ee.ambientLightColor.needsUpdate=xe,ee.lightProbe.needsUpdate=xe,ee.directionalLights.needsUpdate=xe,ee.directionalLightShadows.needsUpdate=xe,ee.pointLights.needsUpdate=xe,ee.pointLightShadows.needsUpdate=xe,ee.spotLights.needsUpdate=xe,ee.spotLightShadows.needsUpdate=xe,ee.rectAreaLights.needsUpdate=xe,ee.hemisphereLights.needsUpdate=xe}function rt(ee){return ee.isMeshLambertMaterial||ee.isMeshToonMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isShadowMaterial||ee.isShaderMaterial&&ee.lights===!0}this.getActiveCubeFace=function(){return S},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return C},this.setRenderTargetTextures=function(ee,xe,Ce){const Oe=Re.get(ee);Oe.__autoAllocateDepthBuffer=ee.resolveDepthBuffer===!1,Oe.__autoAllocateDepthBuffer===!1&&(Oe.__useRenderToTexture=!1),Re.get(ee.texture).__webglTexture=xe,Re.get(ee.depthTexture).__webglTexture=Oe.__autoAllocateDepthBuffer?void 0:Ce,Oe.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(ee,xe){const Ce=Re.get(ee);Ce.__webglFramebuffer=xe,Ce.__useDefaultFramebuffer=xe===void 0};const dt=pe.createFramebuffer();this.setRenderTarget=function(ee,xe=0,Ce=0){C=ee,S=xe,A=Ce;let Oe=!0,ve=null,_t=!1,ft=!1;if(ee){const St=Re.get(ee);if(St.__useDefaultFramebuffer!==void 0)we.bindFramebuffer(pe.FRAMEBUFFER,null),Oe=!1;else if(St.__webglFramebuffer===void 0)Ne.setupRenderTarget(ee);else if(St.__hasExternalTextures)Ne.rebindTextures(ee,Re.get(ee.texture).__webglTexture,Re.get(ee.depthTexture).__webglTexture);else if(ee.depthBuffer){const at=ee.depthTexture;if(St.__boundDepthTexture!==at){if(at!==null&&Re.has(at)&&(ee.width!==at.image.width||ee.height!==at.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Ne.setupDepthRenderbuffer(ee)}}const Nt=ee.texture;(Nt.isData3DTexture||Nt.isDataArrayTexture||Nt.isCompressedArrayTexture)&&(ft=!0);const Xt=Re.get(ee).__webglFramebuffer;ee.isWebGLCubeRenderTarget?(Array.isArray(Xt[xe])?ve=Xt[xe][Ce]:ve=Xt[xe],_t=!0):ee.samples>0&&Ne.useMultisampledRTT(ee)===!1?ve=Re.get(ee).__webglMultisampledFramebuffer:Array.isArray(Xt)?ve=Xt[Ce]:ve=Xt,N.copy(ee.viewport),P.copy(ee.scissor),j=ee.scissorTest}else N.copy(Y).multiplyScalar(V).floor(),P.copy(Z).multiplyScalar(V).floor(),j=G;if(Ce!==0&&(ve=dt),we.bindFramebuffer(pe.FRAMEBUFFER,ve)&&Oe&&we.drawBuffers(ee,ve),we.viewport(N),we.scissor(P),we.setScissorTest(j),_t){const St=Re.get(ee.texture);pe.framebufferTexture2D(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_CUBE_MAP_POSITIVE_X+xe,St.__webglTexture,Ce)}else if(ft){const St=xe;for(let Nt=0;Nt<ee.textures.length;Nt++){const Xt=Re.get(ee.textures[Nt]);pe.framebufferTextureLayer(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0+Nt,Xt.__webglTexture,Ce,St)}}else if(ee!==null&&Ce!==0){const St=Re.get(ee.texture);pe.framebufferTexture2D(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,St.__webglTexture,Ce)}k=-1},this.readRenderTargetPixels=function(ee,xe,Ce,Oe,ve,_t,ft,yt=0){if(!(ee&&ee.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let St=Re.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&ft!==void 0&&(St=St[ft]),St){we.bindFramebuffer(pe.FRAMEBUFFER,St);try{const Nt=ee.textures[yt],Xt=Nt.format,at=Nt.type;if(!Xe.textureFormatReadable(Xt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Xe.textureTypeReadable(at)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}xe>=0&&xe<=ee.width-Oe&&Ce>=0&&Ce<=ee.height-ve&&(ee.textures.length>1&&pe.readBuffer(pe.COLOR_ATTACHMENT0+yt),pe.readPixels(xe,Ce,Oe,ve,Mt.convert(Xt),Mt.convert(at),_t))}finally{const Nt=C!==null?Re.get(C).__webglFramebuffer:null;we.bindFramebuffer(pe.FRAMEBUFFER,Nt)}}},this.readRenderTargetPixelsAsync=async function(ee,xe,Ce,Oe,ve,_t,ft,yt=0){if(!(ee&&ee.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let St=Re.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&ft!==void 0&&(St=St[ft]),St)if(xe>=0&&xe<=ee.width-Oe&&Ce>=0&&Ce<=ee.height-ve){we.bindFramebuffer(pe.FRAMEBUFFER,St);const Nt=ee.textures[yt],Xt=Nt.format,at=Nt.type;if(!Xe.textureFormatReadable(Xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Xe.textureTypeReadable(at))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const nn=pe.createBuffer();pe.bindBuffer(pe.PIXEL_PACK_BUFFER,nn),pe.bufferData(pe.PIXEL_PACK_BUFFER,_t.byteLength,pe.STREAM_READ),ee.textures.length>1&&pe.readBuffer(pe.COLOR_ATTACHMENT0+yt),pe.readPixels(xe,Ce,Oe,ve,Mt.convert(Xt),Mt.convert(at),0);const pn=C!==null?Re.get(C).__webglFramebuffer:null;we.bindFramebuffer(pe.FRAMEBUFFER,pn);const dn=pe.fenceSync(pe.SYNC_GPU_COMMANDS_COMPLETE,0);return pe.flush(),await Nbe(pe,dn,4),pe.bindBuffer(pe.PIXEL_PACK_BUFFER,nn),pe.getBufferSubData(pe.PIXEL_PACK_BUFFER,0,_t),pe.deleteBuffer(nn),pe.deleteSync(dn),_t}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(ee,xe=null,Ce=0){const Oe=Math.pow(2,-Ce),ve=Math.floor(ee.image.width*Oe),_t=Math.floor(ee.image.height*Oe),ft=xe!==null?xe.x:0,yt=xe!==null?xe.y:0;Ne.setTexture2D(ee,0),pe.copyTexSubImage2D(pe.TEXTURE_2D,Ce,0,0,ft,yt,ve,_t),we.unbindTexture()};const lt=pe.createFramebuffer(),At=pe.createFramebuffer();this.copyTextureToTexture=function(ee,xe,Ce=null,Oe=null,ve=0,_t=null){_t===null&&(ve!==0?(S0("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),_t=ve,ve=0):_t=0);let ft,yt,St,Nt,Xt,at,nn,pn,dn;const Dn=ee.isCompressedTexture?ee.mipmaps[_t]:ee.image;if(Ce!==null)ft=Ce.max.x-Ce.min.x,yt=Ce.max.y-Ce.min.y,St=Ce.isBox3?Ce.max.z-Ce.min.z:1,Nt=Ce.min.x,Xt=Ce.min.y,at=Ce.isBox3?Ce.min.z:0;else{const Li=Math.pow(2,-ve);ft=Math.floor(Dn.width*Li),yt=Math.floor(Dn.height*Li),ee.isDataArrayTexture?St=Dn.depth:ee.isData3DTexture?St=Math.floor(Dn.depth*Li):St=1,Nt=0,Xt=0,at=0}Oe!==null?(nn=Oe.x,pn=Oe.y,dn=Oe.z):(nn=0,pn=0,dn=0);const $t=Mt.convert(xe.format),Yt=Mt.convert(xe.type);let Un;xe.isData3DTexture?(Ne.setTexture3D(xe,0),Un=pe.TEXTURE_3D):xe.isDataArrayTexture||xe.isCompressedArrayTexture?(Ne.setTexture2DArray(xe,0),Un=pe.TEXTURE_2D_ARRAY):(Ne.setTexture2D(xe,0),Un=pe.TEXTURE_2D),pe.pixelStorei(pe.UNPACK_FLIP_Y_WEBGL,xe.flipY),pe.pixelStorei(pe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,xe.premultiplyAlpha),pe.pixelStorei(pe.UNPACK_ALIGNMENT,xe.unpackAlignment);const xn=pe.getParameter(pe.UNPACK_ROW_LENGTH),Zn=pe.getParameter(pe.UNPACK_IMAGE_HEIGHT),Nn=pe.getParameter(pe.UNPACK_SKIP_PIXELS),An=pe.getParameter(pe.UNPACK_SKIP_ROWS),Sn=pe.getParameter(pe.UNPACK_SKIP_IMAGES);pe.pixelStorei(pe.UNPACK_ROW_LENGTH,Dn.width),pe.pixelStorei(pe.UNPACK_IMAGE_HEIGHT,Dn.height),pe.pixelStorei(pe.UNPACK_SKIP_PIXELS,Nt),pe.pixelStorei(pe.UNPACK_SKIP_ROWS,Xt),pe.pixelStorei(pe.UNPACK_SKIP_IMAGES,at);const an=ee.isDataArrayTexture||ee.isData3DTexture,di=xe.isDataArrayTexture||xe.isData3DTexture;if(ee.isDepthTexture){const Li=Re.get(ee),Gn=Re.get(xe),wi=Re.get(Li.__renderTarget),Sa=Re.get(Gn.__renderTarget);we.bindFramebuffer(pe.READ_FRAMEBUFFER,wi.__webglFramebuffer),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,Sa.__webglFramebuffer);for(let Gi=0;Gi<St;Gi++)an&&(pe.framebufferTextureLayer(pe.READ_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Re.get(ee).__webglTexture,ve,at+Gi),pe.framebufferTextureLayer(pe.DRAW_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Re.get(xe).__webglTexture,_t,dn+Gi)),pe.blitFramebuffer(Nt,Xt,ft,yt,nn,pn,ft,yt,pe.DEPTH_BUFFER_BIT,pe.NEAREST);we.bindFramebuffer(pe.READ_FRAMEBUFFER,null),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,null)}else if(ve!==0||ee.isRenderTargetTexture||Re.has(ee)){const Li=Re.get(ee),Gn=Re.get(xe);we.bindFramebuffer(pe.READ_FRAMEBUFFER,lt),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,At);for(let wi=0;wi<St;wi++)an?pe.framebufferTextureLayer(pe.READ_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Li.__webglTexture,ve,at+wi):pe.framebufferTexture2D(pe.READ_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,Li.__webglTexture,ve),di?pe.framebufferTextureLayer(pe.DRAW_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Gn.__webglTexture,_t,dn+wi):pe.framebufferTexture2D(pe.DRAW_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,Gn.__webglTexture,_t),ve!==0?pe.blitFramebuffer(Nt,Xt,ft,yt,nn,pn,ft,yt,pe.COLOR_BUFFER_BIT,pe.NEAREST):di?pe.copyTexSubImage3D(Un,_t,nn,pn,dn+wi,Nt,Xt,ft,yt):pe.copyTexSubImage2D(Un,_t,nn,pn,Nt,Xt,ft,yt);we.bindFramebuffer(pe.READ_FRAMEBUFFER,null),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,null)}else di?ee.isDataTexture||ee.isData3DTexture?pe.texSubImage3D(Un,_t,nn,pn,dn,ft,yt,St,$t,Yt,Dn.data):xe.isCompressedArrayTexture?pe.compressedTexSubImage3D(Un,_t,nn,pn,dn,ft,yt,St,$t,Dn.data):pe.texSubImage3D(Un,_t,nn,pn,dn,ft,yt,St,$t,Yt,Dn):ee.isDataTexture?pe.texSubImage2D(pe.TEXTURE_2D,_t,nn,pn,ft,yt,$t,Yt,Dn.data):ee.isCompressedTexture?pe.compressedTexSubImage2D(pe.TEXTURE_2D,_t,nn,pn,Dn.width,Dn.height,$t,Dn.data):pe.texSubImage2D(pe.TEXTURE_2D,_t,nn,pn,ft,yt,$t,Yt,Dn);pe.pixelStorei(pe.UNPACK_ROW_LENGTH,xn),pe.pixelStorei(pe.UNPACK_IMAGE_HEIGHT,Zn),pe.pixelStorei(pe.UNPACK_SKIP_PIXELS,Nn),pe.pixelStorei(pe.UNPACK_SKIP_ROWS,An),pe.pixelStorei(pe.UNPACK_SKIP_IMAGES,Sn),_t===0&&xe.generateMipmaps&&pe.generateMipmap(Un),we.unbindTexture()},this.copyTextureToTexture3D=function(ee,xe,Ce=null,Oe=null,ve=0){return S0('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(ee,xe,Ce,Oe,ve)},this.initRenderTarget=function(ee){Re.get(ee).__webglFramebuffer===void 0&&Ne.setupRenderTarget(ee)},this.initTexture=function(ee){ee.isCubeTexture?Ne.setTextureCube(ee,0):ee.isData3DTexture?Ne.setTexture3D(ee,0):ee.isDataArrayTexture||ee.isCompressedArrayTexture?Ne.setTexture2DArray(ee,0):Ne.setTexture2D(ee,0),we.unbindTexture()},this.resetState=function(){S=0,A=0,C=null,we.reset(),gt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return yl}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=bi._getDrawingBufferColorSpace(e),n.unpackColorSpace=bi._getUnpackColorSpace()}}const BSe=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:FP,AddEquation:yd,AddOperation:DJ,AdditiveAnimationBlendMode:GP,AdditiveBlending:KO,AgXToneMapping:PJ,AlphaFormat:jP,AlwaysCompare:JJ,AlwaysDepth:x2,AlwaysStencilFunc:ZO,AmbientLight:D$,AnimationAction:z$,AnimationClip:fv,AnimationLoader:ave,AnimationMixer:j$,AnimationObjectGroup:Cve,AnimationUtils:tve,ArcCurve:u$,ArrayCamera:U$,ArrowHelper:Jve,AttachedBindMode:j1,Audio:F$,AudioAnalyser:vve,AudioContext:yU,AudioListener:mve,AudioLoader:hve,AxesHelper:$ve,BackSide:Da,BasicDepthPacking:HJ,BasicShadowMap:fJ,BatchedMesh:o$,Bone:j_,BooleanKeyframeTrack:pg,Box2:Pve,Box3:rr,Box3Helper:aI,BoxGeometry:ep,BoxHelper:Kve,BufferAttribute:In,BufferGeometry:On,BufferGeometryLoader:L$,ByteType:BA,Cache:Ju,Camera:qA,CameraHelper:qve,CanvasTexture:E0e,CapsuleGeometry:tC,CatmullRomCurve3:rU,CineonToneMapping:NJ,CircleGeometry:nC,ClampToEdgeWrapping:_a,Clock:xU,Color:Ut,ColorKeyframeTrack:pU,ColorManagement:bi,CompressedArrayTexture:S0e,CompressedCubeTexture:w0e,CompressedTexture:eC,CompressedTextureLoader:sve,ConeGeometry:H_,ConstantAlphaFactor:CJ,ConstantColorFactor:TJ,Controls:Qve,CubeCamera:i$,CubeReflectionMapping:df,CubeRefractionMapping:Xd,CubeTexture:B_,CubeTextureLoader:R$,CubeUVReflectionMapping:Vv,CubicBezierCurve:aU,CubicBezierCurve3:sU,CubicInterpolant:M$,CullFaceBack:qO,CullFaceFront:uJ,CullFaceFrontBack:Bge,CullFaceNone:cJ,Curve:Au,CurvePath:h$,CustomBlending:hJ,CustomToneMapping:LJ,CylinderGeometry:qm,Cylindrical:Lve,Data3DTexture:XA,DataArrayTexture:WA,DataTexture:cs,DataTextureLoader:mU,DataUtils:pm,DecrementStencilOp:Yge,DecrementWrapStencilOp:$ge,DefaultLoadingManager:C$,DepthFormat:tv,DepthStencilFormat:nv,DepthTexture:nU,DetachedBindMode:BP,DirectionalLight:gC,DirectionalLightHelper:Xve,DiscreteInterpolant:T$,DodecahedronGeometry:iC,DoubleSide:Jr,DstAlphaFactor:_J,DstColorFactor:wJ,DynamicCopyUsage:fbe,DynamicDrawUsage:X1,DynamicReadUsage:lbe,EdgesGeometry:c$,EllipseCurve:rC,EqualCompare:XJ,EqualDepth:S2,EqualStencilFunc:tbe,EquirectangularReflectionMapping:$0,EquirectangularRefractionMapping:H1,Euler:vi,EventDispatcher:yf,ExtrudeGeometry:aC,FileLoader:Ns,Float16BufferAttribute:t$,Float32BufferAttribute:mn,FloatType:wr,Fog:YA,FogExp2:KA,FramebufferTexture:_0e,FrontSide:_u,Frustum:tp,FrustumArray:ZA,GLBufferAttribute:H$,GLSL1:dbe,GLSL3:QO,GreaterCompare:qJ,GreaterDepth:E2,GreaterEqualCompare:YJ,GreaterEqualDepth:w2,GreaterEqualStencilFunc:abe,GreaterStencilFunc:ibe,GridHelper:Gve,Group:xl,HalfFloatType:as,HemisphereLight:k$,HemisphereLightHelper:Vve,IcosahedronGeometry:Yv,ImageBitmapLoader:P$,ImageLoader:$1,ImageUtils:QJ,IncrementStencilOp:Kge,IncrementWrapStencilOp:Jge,InstancedBufferAttribute:pf,InstancedBufferGeometry:G_,InstancedInterleavedBuffer:rT,InstancedMesh:$A,Int16BufferAttribute:Qbe,Int32BufferAttribute:e0e,Int8BufferAttribute:Jbe,IntType:Gv,InterleavedBuffer:z_,InterleavedBufferAttribute:zo,Interpolant:Zv,InterpolateDiscrete:iv,InterpolateLinear:rv,InterpolateSmooth:hM,InterpolationSamplingMode:gbe,InterpolationSamplingType:mbe,InvertStencilOp:Zge,KeepStencilOp:Qp,KeyframeTrack:Uc,LOD:s$,LatheGeometry:sC,Layers:ov,LessCompare:WJ,LessDepth:_2,LessEqualCompare:qP,LessEqualDepth:Xm,LessEqualStencilFunc:nbe,LessStencilFunc:ebe,Light:ip,LightProbe:N$,Line:yh,Line3:G$,LineBasicMaterial:Us,LineCurve:oU,LineCurve3:f$,LineDashedMaterial:S$,LineLoop:eU,LineSegments:Lc,LinearFilter:Vi,LinearInterpolant:dU,LinearMipMapLinearFilter:$O,LinearMipMapNearestFilter:Hge,LinearMipmapLinearFilter:vc,LinearMipmapNearestFilter:_0,LinearSRGBColorSpace:Su,LinearToneMapping:OJ,LinearTransfer:G1,Loader:Fs,LoaderUtils:Ud,LoadingManager:mC,LoopOnce:FJ,LoopPingPong:zJ,LoopRepeat:BJ,MOUSE:Uge,Material:Oa,MaterialLoader:bC,MathUtils:yc,Matrix2:wU,Matrix3:$n,Matrix4:Dt,MaxEquation:gJ,Mesh:_i,MeshBasicMaterial:Ds,MeshDepthMaterial:dC,MeshDistanceMaterial:pC,MeshLambertMaterial:x$,MeshMatcapMaterial:_$,MeshNormalMaterial:y$,MeshPhongMaterial:v$,MeshPhysicalMaterial:Pc,MeshStandardMaterial:$v,MeshToonMaterial:iT,MinEquation:mJ,MirroredRepeatWrapping:Z0,MixOperation:kJ,MultiplyBlending:JO,MultiplyOperation:U_,NearestFilter:ls,NearestMipMapLinearFilter:jge,NearestMipMapNearestFilter:zge,NearestMipmapLinearFilter:fm,NearestMipmapNearestFilter:FA,NeutralToneMapping:UJ,NeverCompare:GJ,NeverDepth:y2,NeverStencilFunc:Qge,NoBlending:af,NoColorSpace:su,NoToneMapping:sf,NormalAnimationBlendMode:GA,NormalBlending:Om,NotEqualCompare:KJ,NotEqualDepth:M2,NotEqualStencilFunc:rbe,NumberKeyframeTrack:Ym,Object3D:Pi,ObjectLoader:uve,ObjectSpaceNormalMap:VJ,OctahedronGeometry:V_,OneFactor:vJ,OneMinusConstantAlphaFactor:RJ,OneMinusConstantColorFactor:AJ,OneMinusDstAlphaFactor:SJ,OneMinusDstColorFactor:EJ,OneMinusSrcAlphaFactor:v2,OneMinusSrcColorFactor:xJ,OrthographicCamera:Ah,PCFShadowMap:UA,PCFSoftShadowMap:Qx,PMREMGenerator:oI,Path:nT,PerspectiveCamera:sa,Plane:nu,PlaneGeometry:Il,PlaneHelper:Yve,PointLight:vU,PointLightHelper:jve,Points:tU,PointsMaterial:QA,PolarGridHelper:Wve,PolyhedronGeometry:np,PositionalAudio:bve,PropertyBinding:Bi,PropertyMixer:B$,QuadraticBezierCurve:lU,QuadraticBezierCurve3:cU,Quaternion:Xn,QuaternionKeyframeTrack:Jm,QuaternionLinearInterpolant:A$,RED_GREEN_RGTC2_Format:J2,RED_RGTC1_Format:VP,REVISION:Hv,RGBADepthPacking:XP,RGBAFormat:Qr,RGBAIntegerFormat:Xv,RGBA_ASTC_10x10_Format:G2,RGBA_ASTC_10x5_Format:j2,RGBA_ASTC_10x6_Format:H2,RGBA_ASTC_10x8_Format:V2,RGBA_ASTC_12x10_Format:W2,RGBA_ASTC_12x12_Format:X2,RGBA_ASTC_4x4_Format:I2,RGBA_ASTC_5x4_Format:N2,RGBA_ASTC_5x5_Format:L2,RGBA_ASTC_6x5_Format:P2,RGBA_ASTC_6x6_Format:U2,RGBA_ASTC_8x5_Format:F2,RGBA_ASTC_8x6_Format:B2,RGBA_ASTC_8x8_Format:z2,RGBA_BPTC_Format:r1,RGBA_ETC2_EAC_Format:O2,RGBA_PVRTC_2BPPV1_Format:R2,RGBA_PVRTC_4BPPV1_Format:C2,RGBA_S3TC_DXT1_Format:t1,RGBA_S3TC_DXT3_Format:n1,RGBA_S3TC_DXT5_Format:i1,RGBDepthPacking:Gge,RGBFormat:HP,RGBIntegerFormat:Vge,RGB_BPTC_SIGNED_Format:q2,RGB_BPTC_UNSIGNED_Format:K2,RGB_ETC1_Format:k2,RGB_ETC2_Format:D2,RGB_PVRTC_2BPPV1_Format:A2,RGB_PVRTC_4BPPV1_Format:T2,RGB_S3TC_DXT1_Format:e1,RGDepthPacking:Wge,RGFormat:VA,RGIntegerFormat:F_,RawShaderMaterial:b$,Ray:xf,Raycaster:W_,RectAreaLight:O$,RedFormat:Th,RedIntegerFormat:Wv,ReinhardToneMapping:IJ,RenderTarget:YP,RenderTarget3D:kve,RepeatWrapping:qd,ReplaceStencilOp:qge,ReverseSubtractEquation:pJ,RingGeometry:oC,SIGNED_RED_GREEN_RGTC2_Format:$2,SIGNED_RED_RGTC1_Format:Y2,SRGBColorSpace:As,SRGBTransfer:pr,Scene:qv,ShaderChunk:hn,ShaderLib:iu,ShaderMaterial:fs,ShadowMaterial:dg,Shape:Nm,ShapeGeometry:lC,ShapePath:Zve,ShapeUtils:du,ShortType:zA,Skeleton:Kv,SkeletonHelper:zve,SkinnedMesh:JA,Source:Md,Sphere:Ur,SphereGeometry:Jv,Spherical:V$,SphericalHarmonics3:I$,SplineCurve:uU,SpotLight:bU,SpotLightHelper:Bve,Sprite:a$,SpriteMaterial:QP,SrcAlphaFactor:b2,SrcAlphaSaturateFactor:MJ,SrcColorFactor:yJ,StaticCopyUsage:ube,StaticDrawUsage:W1,StaticReadUsage:obe,StereoCamera:dve,StreamCopyUsage:hbe,StreamDrawUsage:sbe,StreamReadUsage:cbe,StringKeyframeTrack:mg,SubtractEquation:dJ,SubtractiveBlending:YO,TOUCH:Fge,TangentSpaceNormalMap:Qd,TetrahedronGeometry:cC,Texture:nr,TextureLoader:hv,TextureUtils:rye,Timer:Ive,TimestampQuery:pbe,TorusGeometry:uC,TorusKnotGeometry:fC,Triangle:Bo,TriangleFanDrawMode:Z2,TriangleStripDrawMode:WP,TrianglesDrawMode:jJ,TubeGeometry:hC,UVMapping:Wd,Uint16BufferAttribute:JP,Uint32BufferAttribute:$P,Uint8BufferAttribute:$be,Uint8ClampedBufferAttribute:Zbe,Uniform:vC,UniformsGroup:Ove,UniformsLib:tn,UniformsUtils:cv,UnsignedByteType:Ao,UnsignedInt248Type:ev,UnsignedInt5999Type:zP,UnsignedIntType:Ac,UnsignedShort4444Type:jA,UnsignedShort5551Type:HA,UnsignedShortType:Q0,VSMShadowMap:Zc,Vector2:wt,Vector3:te,Vector4:ni,VectorKeyframeTrack:$m,VideoFrameTexture:x0e,VideoTexture:l$,WebGL3DRenderTarget:Bbe,WebGLArrayRenderTarget:Fbe,WebGLCoordinateSystem:yl,WebGLCubeRenderTarget:ZP,WebGLRenderTarget:Cc,WebGLRenderer:TU,WebGLUtils:MU,WebGPUCoordinateSystem:av,WebXRController:dM,WireframeGeometry:fU,WrapAroundEnding:V1,ZeroCurvatureEnding:hm,ZeroFactor:bJ,ZeroSlopeEnding:dm,ZeroStencilOp:Xge,createCanvasElement:ZJ},Symbol.toStringTag,{value:"Module"}));var Z$={exports:{}},rp={};/**
 * @license React
 * react-reconciler-constants.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */rp.ConcurrentRoot=1;rp.ContinuousEventPriority=8;rp.DefaultEventPriority=32;rp.DiscreteEventPriority=2;rp.IdleEventPriority=268435456;rp.LegacyRoot=0;rp.NoEventPriority=0;Z$.exports=rp;var mM=Z$.exports,Q$={exports:{}},eZ={},tZ={exports:{}},nZ={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var dv=I;function zSe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var jSe=typeof Object.is=="function"?Object.is:zSe,HSe=dv.useState,VSe=dv.useEffect,GSe=dv.useLayoutEffect,WSe=dv.useDebugValue;function XSe(t,e){var n=e(),i=HSe({inst:{value:n,getSnapshot:e}}),r=i[0].inst,a=i[1];return GSe(function(){r.value=n,r.getSnapshot=e,qk(r)&&a({inst:r})},[t,n,e]),VSe(function(){return qk(r)&&a({inst:r}),t(function(){qk(r)&&a({inst:r})})},[t]),WSe(n),n}function qk(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!jSe(t,n)}catch{return!0}}function qSe(t,e){return e()}var KSe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qSe:XSe;nZ.useSyncExternalStore=dv.useSyncExternalStore!==void 0?dv.useSyncExternalStore:KSe;tZ.exports=nZ;var YSe=tZ.exports;/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var xC=I,JSe=YSe;function $Se(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ZSe=typeof Object.is=="function"?Object.is:$Se,QSe=JSe.useSyncExternalStore,ewe=xC.useRef,twe=xC.useEffect,nwe=xC.useMemo,iwe=xC.useDebugValue;eZ.useSyncExternalStoreWithSelector=function(t,e,n,i,r){var a=ewe(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=nwe(function(){function l(d){if(!c){if(c=!0,u=d,d=i(d),r!==void 0&&s.hasValue){var g=s.value;if(r(g,d))return f=g}return f=d}if(g=f,ZSe(u,d))return g;var b=i(d);return r!==void 0&&r(g,b)?(u=d,g):(u=d,f=b)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,i,r]);var o=QSe(t,a[0],a[1]);return twe(function(){s.hasValue=!0,s.value=o},[o]),iwe(o),o};Q$.exports=eZ;var rwe=Q$.exports;const iZ=Rc(rwe),g5=t=>{let e;const n=new Set,i=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const h=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(d=>d(e,h))}},r=()=>e,o={setState:i,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(i,r,o);return o},awe=t=>t?g5(t):g5,{useSyncExternalStoreWithSelector:swe}=iZ,owe=t=>t;function lwe(t,e=owe,n){const i=swe(t.subscribe,t.getState,t.getInitialState,e,n);return Ee.useDebugValue(i),i}const b5=(t,e)=>{const n=awe(t),i=(r,a=e)=>lwe(n,r,a);return Object.assign(i,n),i},rZ=(t,e)=>t?b5(t,e):b5,cwe=t=>typeof t=="object"&&typeof t.then=="function",gm=[];function aZ(t,e,n=(i,r)=>i===r){if(t===e)return!0;if(!t||!e)return!1;const i=t.length;if(e.length!==i)return!1;for(let r=0;r<i;r++)if(!n(t[r],e[r]))return!1;return!0}function sZ(t,e=null,n=!1,i={}){e===null&&(e=[t]);for(const a of gm)if(aZ(e,a.keys,a.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(a,"error"))throw a.error;if(Object.prototype.hasOwnProperty.call(a,"response"))return i.lifespan&&i.lifespan>0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,i.lifespan)),a.response;if(!n)throw a.promise}const r={keys:e,equal:i.equal,remove:()=>{const a=gm.indexOf(r);a!==-1&&gm.splice(a,1)},promise:(cwe(t)?t:t(...e)).then(a=>{r.response=a,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(a=>r.error=a)};if(gm.push(r),!n)throw r.promise}const uwe=(t,e,n)=>sZ(t,e,!1,n),fwe=(t,e,n)=>void sZ(t,e,!0,n),hwe=t=>{if(t===void 0||t.length===0)gm.splice(0,gm.length);else{const e=gm.find(n=>aZ(t,n.keys,n.equal));e&&e.remove()}};var oZ={exports:{}},lZ={exports:{}},cZ={exports:{}},uZ={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){function e(F,H){var V=F.length;F.push(H);e:for(;0<V;){var W=V-1>>>1,B=F[W];if(0<r(B,H))F[W]=H,F[V]=B,V=W;else break e}}function n(F){return F.length===0?null:F[0]}function i(F){if(F.length===0)return null;var H=F[0],V=F.pop();if(V!==H){F[0]=V;e:for(var W=0,B=F.length,Y=B>>>1;W<Y;){var Z=2*(W+1)-1,G=F[Z],de=Z+1,oe=F[de];if(0>r(G,V))de<B&&0>r(oe,G)?(F[W]=oe,F[de]=V,W=de):(F[W]=G,F[Z]=V,W=Z);else if(de<B&&0>r(oe,V))F[W]=oe,F[de]=V,W=de;else break e}}return H}function r(F,H){var V=F.sortIndex-H.sortIndex;return V!==0?V:F.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,d=!1,g=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(F){for(var H=n(c);H!==null;){if(H.callback===null)i(c);else if(H.startTime<=F)i(c),H.sortIndex=H.expirationTime,e(l,H);else break;H=n(c)}}function w(F){if(b=!1,_(F),!g)if(n(l)!==null)g=!0,z();else{var H=n(c);H!==null&&X(w,H.startTime-F)}}var M=!1,S=-1,A=5,C=-1;function k(){return!(t.unstable_now()-C<A)}function R(){if(M){var F=t.unstable_now();C=F;var H=!0;try{e:{g=!1,b&&(b=!1,p(S),S=-1),d=!0;var V=h;try{t:{for(_(F),f=n(l);f!==null&&!(f.expirationTime>F&&k());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var B=W(f.expirationTime<=F);if(F=t.unstable_now(),typeof B=="function"){f.callback=B,_(F),H=!0;break t}f===n(l)&&i(l),_(F)}else i(l);f=n(l)}if(f!==null)H=!0;else{var Y=n(c);Y!==null&&X(w,Y.startTime-F),H=!1}}break e}finally{f=null,h=V,d=!1}H=void 0}}finally{H?N():M=!1}}}var N;if(typeof x=="function")N=function(){x(R)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,j=P.port2;P.port1.onmessage=R,N=function(){j.postMessage(null)}}else N=function(){y(R,0)};function z(){M||(M=!0,N())}function X(F,H){S=y(function(){F(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_continueExecution=function(){g||d||(g=!0,z())},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(F){switch(h){case 1:case 2:case 3:var H=3;break;default:H=h}var V=h;h=H;try{return F()}finally{h=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,H){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var V=h;h=F;try{return H()}finally{h=V}},t.unstable_scheduleCallback=function(F,H,V){var W=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?W+V:W):V=W,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=V+B,F={id:u++,callback:H,priorityLevel:F,startTime:V,expirationTime:B,sortIndex:-1},V>W?(F.sortIndex=V,e(c,F),n(l)===null&&F===n(c)&&(b?(p(S),S=-1):b=!0,X(w,V-W))):(F.sortIndex=B,e(l,F),g||d||(g=!0,z())),F},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(F){var H=h;return function(){var V=h;h=H;try{return F.apply(this,arguments)}finally{h=V}}}})(uZ);cZ.exports=uZ;var cI=cZ.exports;/**
 * @license React
 * react-reconciler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){t.exports=function(e){function n(m,v,T,O){return new Kne(m,v,T,O)}function i(){}function r(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)v+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(m){return m===null||typeof m!="object"?null:(m=y9&&m[y9]||m["@@iterator"],typeof m=="function"?m:null)}function s(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===eie?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case Eg:return"Fragment";case wg:return"Portal";case xR:return"Profiler";case g9:return"StrictMode";case SR:return"Suspense";case wR:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case Nh:return(m.displayName||"Context")+".Provider";case b9:return(m._context.displayName||"Context")+".Consumer";case _R:var v=m.render;return m=m.displayName,m||(m=v.displayName||v.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case ER:return v=m.displayName||null,v!==null?v:s(m.type)||"Memo";case Lh:v=m._payload,m=m._init;try{return s(m(v))}catch{}}return null}function o(m){if(MR===void 0)try{throw Error()}catch(T){var v=T.stack.trim().match(/\n( *(at )?)/);MR=v&&v[1]||"",x9=-1<T.stack.indexOf(`
    at`)?" (<anonymous>)":-1<T.stack.indexOf("@")?"@unknown:0:0":""}return`
`+MR+m+x9}function l(m,v){if(!m||TR)return"";TR=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var O={DetermineComponentFrameRoot:function(){try{if(v){var sn=function(){throw Error()};if(Object.defineProperty(sn.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(sn,[])}catch(ei){var cn=ei}Reflect.construct(m,[],sn)}else{try{sn.call()}catch(ei){cn=ei}m.call(sn.prototype)}}else{try{throw Error()}catch(ei){cn=ei}(sn=m())&&typeof sn.catch=="function"&&sn.catch(function(){})}}catch(ei){if(ei&&cn&&typeof ei.stack=="string")return[ei.stack,cn.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var U=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");U&&U.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var q=O.DetermineComponentFrameRoot(),be=q[0],Be=q[1];if(be&&Be){var nt=be.split(`
`),Rt=Be.split(`
`);for(U=O=0;O<nt.length&&!nt[O].includes("DetermineComponentFrameRoot");)O++;for(;U<Rt.length&&!Rt[U].includes("DetermineComponentFrameRoot");)U++;if(O===nt.length||U===Rt.length)for(O=nt.length-1,U=Rt.length-1;1<=O&&0<=U&&nt[O]!==Rt[U];)U--;for(;1<=O&&0<=U;O--,U--)if(nt[O]!==Rt[U]){if(O!==1||U!==1)do if(O--,U--,0>U||nt[O]!==Rt[U]){var qt=`
`+nt[O].replace(" at new "," at ");return m.displayName&&qt.includes("<anonymous>")&&(qt=qt.replace("<anonymous>",m.displayName)),qt}while(1<=O&&0<=U);break}}}finally{TR=!1,Error.prepareStackTrace=T}return(T=m?m.displayName||m.name:"")?o(T):""}function c(m){switch(m.tag){case 26:case 27:case 5:return o(m.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return m=l(m.type,!1),m;case 11:return m=l(m.type.render,!1),m;case 1:return m=l(m.type,!0),m;default:return""}}function u(m){try{var v="";do v+=c(m),m=m.return;while(m);return v}catch(T){return`
Error generating stack: `+T.message+`
`+T.stack}}function f(m){var v=m,T=m;if(m.alternate)for(;v.return;)v=v.return;else{m=v;do v=m,v.flags&4098&&(T=v.return),m=v.return;while(m)}return v.tag===3?T:null}function h(m){if(f(m)!==m)throw Error(r(188))}function d(m){var v=m.alternate;if(!v){if(v=f(m),v===null)throw Error(r(188));return v!==m?null:m}for(var T=m,O=v;;){var U=T.return;if(U===null)break;var q=U.alternate;if(q===null){if(O=U.return,O!==null){T=O;continue}break}if(U.child===q.child){for(q=U.child;q;){if(q===T)return h(U),m;if(q===O)return h(U),v;q=q.sibling}throw Error(r(188))}if(T.return!==O.return)T=U,O=q;else{for(var be=!1,Be=U.child;Be;){if(Be===T){be=!0,T=U,O=q;break}if(Be===O){be=!0,O=U,T=q;break}Be=Be.sibling}if(!be){for(Be=q.child;Be;){if(Be===T){be=!0,T=q,O=U;break}if(Be===O){be=!0,O=q,T=U;break}Be=Be.sibling}if(!be)throw Error(r(189))}}if(T.alternate!==O)throw Error(r(190))}if(T.tag!==3)throw Error(r(188));return T.stateNode.current===T?m:v}function g(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(v=g(m),v!==null)return v;m=m.sibling}return null}function b(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(m.tag!==4&&(v=b(m),v!==null))return v;m=m.sibling}return null}function y(m){return{current:m}}function p(m){0>Tg||(m.current=OR[Tg],OR[Tg]=null,Tg--)}function x(m,v){Tg++,OR[Tg]=m.current,m.current=v}function _(m){return m>>>=0,m===0?32:31-(mre(m)/gre|0)|0}function w(m){var v=m&42;if(v!==0)return v;switch(m&-m){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:return 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 m&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return m&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return m}}function M(m,v){var T=m.pendingLanes;if(T===0)return 0;var O=0,U=m.suspendedLanes,q=m.pingedLanes,be=m.warmLanes;m=m.finishedLanes!==0;var Be=T&134217727;return Be!==0?(T=Be&~U,T!==0?O=w(T):(q&=Be,q!==0?O=w(q):m||(be=Be&~be,be!==0&&(O=w(be))))):(Be=T&~U,Be!==0?O=w(Be):q!==0?O=w(q):m||(be=T&~be,be!==0&&(O=w(be)))),O===0?0:v!==0&&v!==O&&!(v&U)&&(U=O&-O,be=v&-v,U>=be||U===32&&(be&4194176)!==0)?v:O}function S(m,v){return(m.pendingLanes&~(m.suspendedLanes&~m.pingedLanes)&v)===0}function A(m,v){switch(m){case 1:case 2:case 4:case 8:return v+250;case 16:case 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 v+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function C(){var m=bS;return bS<<=1,!(bS&4194176)&&(bS=128),m}function k(){var m=vS;return vS<<=1,!(vS&62914560)&&(vS=4194304),m}function R(m){for(var v=[],T=0;31>T;T++)v.push(m);return v}function N(m,v){m.pendingLanes|=v,v!==268435456&&(m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0)}function P(m,v,T,O,U,q){var be=m.pendingLanes;m.pendingLanes=T,m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0,m.expiredLanes&=T,m.entangledLanes&=T,m.errorRecoveryDisabledLanes&=T,m.shellSuspendCounter=0;var Be=m.entanglements,nt=m.expirationTimes,Rt=m.hiddenUpdates;for(T=be&~T;0<T;){var qt=31-il(T),sn=1<<qt;Be[qt]=0,nt[qt]=-1;var cn=Rt[qt];if(cn!==null)for(Rt[qt]=null,qt=0;qt<cn.length;qt++){var ei=cn[qt];ei!==null&&(ei.lane&=-536870913)}T&=~sn}O!==0&&j(m,O,0),q!==0&&U===0&&m.tag!==0&&(m.suspendedLanes|=q&~(be&~v))}function j(m,v,T){m.pendingLanes|=v,m.suspendedLanes&=~v;var O=31-il(v);m.entangledLanes|=v,m.entanglements[O]=m.entanglements[O]|1073741824|T&4194218}function z(m,v){var T=m.entangledLanes|=v;for(m=m.entanglements;T;){var O=31-il(T),U=1<<O;U&v|m[O]&v&&(m[O]|=v),T&=~U}}function X(m){return m&=-m,2<m?8<m?m&134217727?32:268435456:8:2}function F(m){if(rl&&typeof rl.onCommitFiberRoot=="function")try{rl.onCommitFiberRoot(my,m,void 0,(m.current.flags&128)===128)}catch{}}function H(m){if(typeof _re=="function"&&Sre(m),rl&&typeof rl.setStrictMode=="function")try{rl.setStrictMode(my,m)}catch{}}function V(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}function W(m,v){if(typeof m=="object"&&m!==null){var T=X9.get(m);return T!==void 0?T:(v={value:m,source:v,stack:u(v)},X9.set(m,v),v)}return{value:m,source:v,stack:u(v)}}function B(m,v){Cg[Rg++]=_S,Cg[Rg++]=xS,xS=m,_S=v}function Y(m,v,T){jl[Hl++]=Tf,jl[Hl++]=Af,jl[Hl++]=mp,mp=m;var O=Tf;m=Af;var U=32-il(O)-1;O&=~(1<<U),T+=1;var q=32-il(v)+U;if(30<q){var be=U-U%5;q=(O&(1<<be)-1).toString(32),O>>=be,U-=be,Tf=1<<32-il(v)+U|T<<U|O,Af=q+m}else Tf=1<<q|T<<U|O,Af=m}function Z(m){m.return!==null&&(B(m,1),Y(m,1,0))}function G(m){for(;m===xS;)xS=Cg[--Rg],Cg[Rg]=null,_S=Cg[--Rg],Cg[Rg]=null;for(;m===mp;)mp=jl[--Hl],jl[Hl]=null,Af=jl[--Hl],jl[Hl]=null,Tf=jl[--Hl],jl[Hl]=null}function de(m,v){x(Uh,v),x(gy,m),x(gs,null),m=iie(v),p(gs),x(gs,m)}function oe(){p(gs),p(gy),p(Uh)}function le(m){m.memoizedState!==null&&x(SS,m);var v=gs.current,T=rie(v,m.type);v!==T&&(x(gy,m),x(gs,T))}function ue(m){gy.current===m&&(p(gs),p(gy)),SS.current===m&&(p(SS),Mf?pp._currentValue=Mg:pp._currentValue2=Mg)}function Se(m){var v=Error(r(418,""));throw pe(W(v,m)),LR}function Te(m,v){if(!Bl)throw Error(r(175));$ie(m.stateNode,m.type,m.memoizedProps,v,m)||Se(m)}function Pe(m){for(po=m.return;po;)switch(po.tag){case 3:case 27:ku=!0;return;case 5:case 13:ku=!1;return;default:po=po.return}}function je(m){if(!Bl||m!==po)return!1;if(!Wi)return Pe(m),Wi=!0,!1;var v=!1;if(Ys?m.tag!==3&&m.tag!==27&&(m.tag!==5||L9(m.type)&&!gS(m.type,m.memoizedProps))&&(v=!0):m.tag!==3&&(m.tag!==5||L9(m.type)&&!gS(m.type,m.memoizedProps))&&(v=!0),v&&Js&&Se(m),Pe(m),m.tag===13){if(!Bl)throw Error(r(316));if(m=m.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));Js=ere(m)}else Js=po?I9(m.stateNode):null;return!0}function He(){Bl&&(Js=po=null,Wi=!1)}function pe(m){Vc===null?Vc=[m]:Vc.push(m)}function ze(){for(var m=kg,v=PR=kg=0;v<m;){var T=Vl[v];Vl[v++]=null;var O=Vl[v];Vl[v++]=null;var U=Vl[v];Vl[v++]=null;var q=Vl[v];if(Vl[v++]=null,O!==null&&U!==null){var be=O.pending;be===null?U.next=U:(U.next=be.next,be.next=U),O.pending=U}q!==0&&Ae(T,U,q)}}function Ie(m,v,T,O){Vl[kg++]=m,Vl[kg++]=v,Vl[kg++]=T,Vl[kg++]=O,PR|=O,m.lanes|=O,m=m.alternate,m!==null&&(m.lanes|=O)}function Xe(m,v,T,O){return Ie(m,v,T,O),Re(m)}function we(m,v){return Ie(m,null,null,v),Re(m)}function Ae(m,v,T){m.lanes|=T;var O=m.alternate;O!==null&&(O.lanes|=T);for(var U=!1,q=m.return;q!==null;)q.childLanes|=T,O=q.alternate,O!==null&&(O.childLanes|=T),q.tag===22&&(m=q.stateNode,m===null||m._visibility&1||(U=!0)),m=q,q=q.return;U&&v!==null&&m.tag===3&&(q=m.stateNode,U=31-il(T),q=q.hiddenUpdates,m=q[U],m===null?q[U]=[v]:m.push(v),v.lane=T|536870912)}function Re(m){if(50<My)throw My=0,ZR=null,Error(r(185));for(var v=m.return;v!==null;)m=v,v=m.return;return m.tag===3?m.stateNode:null}function Ne(m){m!==Dg&&m.next===null&&(Dg===null?wS=Dg=m:Dg=Dg.next=m),ES=!0,UR||(UR=!0,he(Qe))}function Fe(m,v){if(!FR&&ES){FR=!0;do for(var T=!1,O=wS;O!==null;){if(m!==0){var U=O.pendingLanes;if(U===0)var q=0;else{var be=O.suspendedLanes,Be=O.pingedLanes;q=(1<<31-il(42|m)+1)-1,q&=U&~(be&~Be),q=q&201326677?q&201326677|1:q?q|2:0}q!==0&&(T=!0,ce(O,q))}else q=Fi,q=M(O,O===Dr?q:0),!(q&3)||S(O,q)||(T=!0,ce(O,q));O=O.next}while(T);FR=!1}}function Qe(){ES=UR=!1;var m=0;Og!==0&&(hie()&&(m=Og),Og=0);for(var v=Hc(),T=null,O=wS;O!==null;){var U=O.next,q=ae(O,v);q===0?(O.next=null,T===null?wS=U:T.next=U,U===null&&(Dg=T)):(T=O,(m!==0||q&3)&&(ES=!0)),O=U}Fe(m)}function ae(m,v){for(var T=m.suspendedLanes,O=m.pingedLanes,U=m.expirationTimes,q=m.pendingLanes&-62914561;0<q;){var be=31-il(q),Be=1<<be,nt=U[be];nt===-1?(!(Be&T)||Be&O)&&(U[be]=A(Be,v)):nt<=v&&(m.expiredLanes|=Be),q&=~Be}if(v=Dr,T=Fi,T=M(m,m===v?T:0),O=m.callbackNode,T===0||m===v&&Or===2||m.cancelPendingCommit!==null)return O!==null&&O!==null&&IR(O),m.callbackNode=null,m.callbackPriority=0;if(!(T&3)||S(m,T)){if(v=T&-T,v===m.callbackPriority)return v;switch(O!==null&&IR(O),X(T)){case 2:case 8:T=yre;break;case 32:T=NR;break;case 268435456:T=xre;break;default:T=NR}return O=K.bind(null,m),T=yS(T,O),m.callbackPriority=v,m.callbackNode=T,v}return O!==null&&O!==null&&IR(O),m.callbackPriority=2,m.callbackNode=null,2}function K(m,v){var T=m.callbackNode;if(fp()&&m.callbackNode!==T)return null;var O=Fi;return O=M(m,m===Dr?O:0),O===0?null:(Y4(m,O,v),ae(m,Hc()),m.callbackNode!=null&&m.callbackNode===T?K.bind(null,m):null)}function ce(m,v){if(fp())return null;Y4(m,v,!0)}function he(m){vie?yie(function(){yr&6?yS(W9,m):m()}):yS(W9,m)}function me(){return Og===0&&(Og=C()),Og}function $(m,v){if(by===null){var T=by=[];BR=0,Ig=me(),Ng={status:"pending",value:void 0,then:function(O){T.push(O)}}}return BR++,v.then(Ve,Ve),v}function Ve(){if(--BR===0&&by!==null){Ng!==null&&(Ng.status="fulfilled");var m=by;by=null,Ig=0,Ng=null;for(var v=0;v<m.length;v++)(0,m[v])()}}function qe(m,v){var T=[],O={status:"pending",value:null,reason:null,then:function(U){T.push(U)}};return m.then(function(){O.status="fulfilled",O.value=v;for(var U=0;U<T.length;U++)(0,T[U])(v)},function(U){for(O.status="rejected",O.reason=U,U=0;U<T.length;U++)(0,T[U])(void 0)}),O}function mt(m){m.updateQueue={baseState:m.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ge(m,v){m=m.updateQueue,v.updateQueue===m&&(v.updateQueue={baseState:m.baseState,firstBaseUpdate:m.firstBaseUpdate,lastBaseUpdate:m.lastBaseUpdate,shared:m.shared,callbacks:null})}function Je(m){return{lane:m,tag:0,payload:null,callback:null,next:null}}function Ye(m,v,T){var O=m.updateQueue;if(O===null)return null;if(O=O.shared,yr&2){var U=O.pending;return U===null?v.next=v:(v.next=U.next,U.next=v),O.pending=v,v=Re(m),Ae(m,null,T),v}return Ie(m,O,v,T),Re(m)}function vt(m,v,T){if(v=v.updateQueue,v!==null&&(v=v.shared,(T&4194176)!==0)){var O=v.lanes;O&=m.pendingLanes,T|=O,v.lanes=T,z(m,T)}}function Mt(m,v){var T=m.updateQueue,O=m.alternate;if(O!==null&&(O=O.updateQueue,T===O)){var U=null,q=null;if(T=T.firstBaseUpdate,T!==null){do{var be={lane:T.lane,tag:T.tag,payload:T.payload,callback:null,next:null};q===null?U=q=be:q=q.next=be,T=T.next}while(T!==null);q===null?U=q=v:q=q.next=v}else U=q=v;T={baseState:O.baseState,firstBaseUpdate:U,lastBaseUpdate:q,shared:O.shared,callbacks:O.callbacks},m.updateQueue=T;return}m=T.lastBaseUpdate,m===null?T.firstBaseUpdate=v:m.next=v,T.lastBaseUpdate=v}function gt(){if(zR){var m=Ng;if(m!==null)throw m}}function kt(m,v,T,O){zR=!1;var U=m.updateQueue;Fh=!1;var q=U.firstBaseUpdate,be=U.lastBaseUpdate,Be=U.shared.pending;if(Be!==null){U.shared.pending=null;var nt=Be,Rt=nt.next;nt.next=null,be===null?q=Rt:be.next=Rt,be=nt;var qt=m.alternate;qt!==null&&(qt=qt.updateQueue,Be=qt.lastBaseUpdate,Be!==be&&(Be===null?qt.firstBaseUpdate=Rt:Be.next=Rt,qt.lastBaseUpdate=nt))}if(q!==null){var sn=U.baseState;be=0,qt=Rt=nt=null,Be=q;do{var cn=Be.lane&-536870913,ei=cn!==Be.lane;if(ei?(Fi&cn)===cn:(O&cn)===cn){cn!==0&&cn===Ig&&(zR=!0),qt!==null&&(qt=qt.next={lane:0,tag:Be.tag,payload:Be.payload,callback:null,next:null});e:{var Xl=m,Ty=Be;cn=v;var Ep=T;switch(Ty.tag){case 1:if(Xl=Ty.payload,typeof Xl=="function"){sn=Xl.call(Ep,sn,cn);break e}sn=Xl;break e;case 3:Xl.flags=Xl.flags&-65537|128;case 0:if(Xl=Ty.payload,cn=typeof Xl=="function"?Xl.call(Ep,sn,cn):Xl,cn==null)break e;sn=yR({},sn,cn);break e;case 2:Fh=!0}}cn=Be.callback,cn!==null&&(m.flags|=64,ei&&(m.flags|=8192),ei=U.callbacks,ei===null?U.callbacks=[cn]:ei.push(cn))}else ei={lane:cn,tag:Be.tag,payload:Be.payload,callback:Be.callback,next:null},qt===null?(Rt=qt=ei,nt=sn):qt=qt.next=ei,be|=cn;if(Be=Be.next,Be===null){if(Be=U.shared.pending,Be===null)break;ei=Be,Be=ei.next,ei.next=null,U.lastBaseUpdate=ei,U.shared.pending=null}}while(!0);qt===null&&(nt=sn),U.baseState=nt,U.firstBaseUpdate=Rt,U.lastBaseUpdate=qt,q===null&&(U.shared.lanes=0),jh|=be,m.lanes=be,m.memoizedState=sn}}function ke(m,v){if(typeof m!="function")throw Error(r(191,m));m.call(v)}function Le(m,v){var T=m.callbacks;if(T!==null)for(m.callbacks=null,m=0;m<T.length;m++)ke(T[m],v)}function ht(m,v){if(al(m,v))return!0;if(typeof m!="object"||m===null||typeof v!="object"||v===null)return!1;var T=Object.keys(m),O=Object.keys(v);if(T.length!==O.length)return!1;for(O=0;O<T.length;O++){var U=T[O];if(!wre.call(v,U)||!al(m[U],v[U]))return!1}return!0}function jt(m){return m=m.status,m==="fulfilled"||m==="rejected"}function ot(){}function it(m,v,T){switch(T=m[T],T===void 0?m.push(v):T!==v&&(v.then(ot,ot),v=T),v.status){case"fulfilled":return v.value;case"rejected":throw m=v.reason,m===vy?Error(r(483)):m;default:if(typeof v.status=="string")v.then(ot,ot);else{if(m=Dr,m!==null&&100<m.shellSuspendCounter)throw Error(r(482));m=v,m.status="pending",m.then(function(O){if(v.status==="pending"){var U=v;U.status="fulfilled",U.value=O}},function(O){if(v.status==="pending"){var U=v;U.status="rejected",U.reason=O}})}switch(v.status){case"fulfilled":return v.value;case"rejected":throw m=v.reason,m===vy?Error(r(483)):m}throw Lg=v,vy}}function bt(){if(Lg===null)throw Error(r(459));var m=Lg;return Lg=null,m}function Jt(m){var v=yy;return yy+=1,Pg===null&&(Pg=[]),it(Pg,m,v)}function Kt(m,v){v=v.props.ref,m.ref=v!==void 0?v:null}function un(m,v){throw v.$$typeof===$ne?Error(r(525)):(m=Object.prototype.toString.call(v),Error(r(31,m==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":m)))}function Vn(m){var v=m._init;return v(m._payload)}function vn(m){function v(ct,et){if(m){var pt=ct.deletions;pt===null?(ct.deletions=[et],ct.flags|=16):pt.push(et)}}function T(ct,et){if(!m)return null;for(;et!==null;)v(ct,et),et=et.sibling;return null}function O(ct){for(var et=new Map;ct!==null;)ct.key!==null?et.set(ct.key,ct):et.set(ct.index,ct),ct=ct.sibling;return et}function U(ct,et){return ct=Ih(ct,et),ct.index=0,ct.sibling=null,ct}function q(ct,et,pt){return ct.index=pt,m?(pt=ct.alternate,pt!==null?(pt=pt.index,pt<et?(ct.flags|=33554434,et):pt):(ct.flags|=33554434,et)):(ct.flags|=1048576,et)}function be(ct){return m&&ct.alternate===null&&(ct.flags|=33554434),ct}function Be(ct,et,pt,Ht){return et===null||et.tag!==6?(et=gR(pt,ct.mode,Ht),et.return=ct,et):(et=U(et,pt),et.return=ct,et)}function nt(ct,et,pt,Ht){var Tn=pt.type;return Tn===Eg?qt(ct,et,pt.props.children,Ht,pt.key):et!==null&&(et.elementType===Tn||typeof Tn=="object"&&Tn!==null&&Tn.$$typeof===Lh&&Vn(Tn)===et.type)?(et=U(et,pt.props),Kt(et,pt),et.return=ct,et):(et=dS(pt.type,pt.key,pt.props,null,ct.mode,Ht),Kt(et,pt),et.return=ct,et)}function Rt(ct,et,pt,Ht){return et===null||et.tag!==4||et.stateNode.containerInfo!==pt.containerInfo||et.stateNode.implementation!==pt.implementation?(et=bR(pt,ct.mode,Ht),et.return=ct,et):(et=U(et,pt.children||[]),et.return=ct,et)}function qt(ct,et,pt,Ht,Tn){return et===null||et.tag!==7?(et=hp(pt,ct.mode,Ht,Tn),et.return=ct,et):(et=U(et,pt),et.return=ct,et)}function sn(ct,et,pt){if(typeof et=="string"&&et!==""||typeof et=="number"||typeof et=="bigint")return et=gR(""+et,ct.mode,pt),et.return=ct,et;if(typeof et=="object"&&et!==null){switch(et.$$typeof){case pS:return pt=dS(et.type,et.key,et.props,null,ct.mode,pt),Kt(pt,et),pt.return=ct,pt;case wg:return et=bR(et,ct.mode,pt),et.return=ct,et;case Lh:var Ht=et._init;return et=Ht(et._payload),sn(ct,et,pt)}if(mS(et)||a(et))return et=hp(et,ct.mode,pt,null),et.return=ct,et;if(typeof et.then=="function")return sn(ct,Jt(et),pt);if(et.$$typeof===Nh)return sn(ct,rn(ct,et),pt);un(ct,et)}return null}function cn(ct,et,pt,Ht){var Tn=et!==null?et.key:null;if(typeof pt=="string"&&pt!==""||typeof pt=="number"||typeof pt=="bigint")return Tn!==null?null:Be(ct,et,""+pt,Ht);if(typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case pS:return pt.key===Tn?nt(ct,et,pt,Ht):null;case wg:return pt.key===Tn?Rt(ct,et,pt,Ht):null;case Lh:return Tn=pt._init,pt=Tn(pt._payload),cn(ct,et,pt,Ht)}if(mS(pt)||a(pt))return Tn!==null?null:qt(ct,et,pt,Ht,null);if(typeof pt.then=="function")return cn(ct,et,Jt(pt),Ht);if(pt.$$typeof===Nh)return cn(ct,et,rn(ct,pt),Ht);un(ct,pt)}return null}function ei(ct,et,pt,Ht,Tn){if(typeof Ht=="string"&&Ht!==""||typeof Ht=="number"||typeof Ht=="bigint")return ct=ct.get(pt)||null,Be(et,ct,""+Ht,Tn);if(typeof Ht=="object"&&Ht!==null){switch(Ht.$$typeof){case pS:return ct=ct.get(Ht.key===null?pt:Ht.key)||null,nt(et,ct,Ht,Tn);case wg:return ct=ct.get(Ht.key===null?pt:Ht.key)||null,Rt(et,ct,Ht,Tn);case Lh:var Br=Ht._init;return Ht=Br(Ht._payload),ei(ct,et,pt,Ht,Tn)}if(mS(Ht)||a(Ht))return ct=ct.get(pt)||null,qt(et,ct,Ht,Tn,null);if(typeof Ht.then=="function")return ei(ct,et,pt,Jt(Ht),Tn);if(Ht.$$typeof===Nh)return ei(ct,et,pt,rn(et,Ht),Tn);un(et,Ht)}return null}function Xl(ct,et,pt,Ht){for(var Tn=null,Br=null,zn=et,Xi=et=0,Za=null;zn!==null&&Xi<pt.length;Xi++){zn.index>Xi?(Za=zn,zn=null):Za=zn.sibling;var qi=cn(ct,zn,pt[Xi],Ht);if(qi===null){zn===null&&(zn=Za);break}m&&zn&&qi.alternate===null&&v(ct,zn),et=q(qi,et,Xi),Br===null?Tn=qi:Br.sibling=qi,Br=qi,zn=Za}if(Xi===pt.length)return T(ct,zn),Wi&&B(ct,Xi),Tn;if(zn===null){for(;Xi<pt.length;Xi++)zn=sn(ct,pt[Xi],Ht),zn!==null&&(et=q(zn,et,Xi),Br===null?Tn=zn:Br.sibling=zn,Br=zn);return Wi&&B(ct,Xi),Tn}for(zn=O(zn);Xi<pt.length;Xi++)Za=ei(zn,ct,Xi,pt[Xi],Ht),Za!==null&&(m&&Za.alternate!==null&&zn.delete(Za.key===null?Xi:Za.key),et=q(Za,et,Xi),Br===null?Tn=Za:Br.sibling=Za,Br=Za);return m&&zn.forEach(function(Vh){return v(ct,Vh)}),Wi&&B(ct,Xi),Tn}function Ty(ct,et,pt,Ht){if(pt==null)throw Error(r(151));for(var Tn=null,Br=null,zn=et,Xi=et=0,Za=null,qi=pt.next();zn!==null&&!qi.done;Xi++,qi=pt.next()){zn.index>Xi?(Za=zn,zn=null):Za=zn.sibling;var Vh=cn(ct,zn,qi.value,Ht);if(Vh===null){zn===null&&(zn=Za);break}m&&zn&&Vh.alternate===null&&v(ct,zn),et=q(Vh,et,Xi),Br===null?Tn=Vh:Br.sibling=Vh,Br=Vh,zn=Za}if(qi.done)return T(ct,zn),Wi&&B(ct,Xi),Tn;if(zn===null){for(;!qi.done;Xi++,qi=pt.next())qi=sn(ct,qi.value,Ht),qi!==null&&(et=q(qi,et,Xi),Br===null?Tn=qi:Br.sibling=qi,Br=qi);return Wi&&B(ct,Xi),Tn}for(zn=O(zn);!qi.done;Xi++,qi=pt.next())qi=ei(zn,ct,Xi,qi.value,Ht),qi!==null&&(m&&qi.alternate!==null&&zn.delete(qi.key===null?Xi:qi.key),et=q(qi,et,Xi),Br===null?Tn=qi:Br.sibling=qi,Br=qi);return m&&zn.forEach(function(kre){return v(ct,kre)}),Wi&&B(ct,Xi),Tn}function Ep(ct,et,pt,Ht){if(typeof pt=="object"&&pt!==null&&pt.type===Eg&&pt.key===null&&(pt=pt.props.children),typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case pS:e:{for(var Tn=pt.key;et!==null;){if(et.key===Tn){if(Tn=pt.type,Tn===Eg){if(et.tag===7){T(ct,et.sibling),Ht=U(et,pt.props.children),Ht.return=ct,ct=Ht;break e}}else if(et.elementType===Tn||typeof Tn=="object"&&Tn!==null&&Tn.$$typeof===Lh&&Vn(Tn)===et.type){T(ct,et.sibling),Ht=U(et,pt.props),Kt(Ht,pt),Ht.return=ct,ct=Ht;break e}T(ct,et);break}else v(ct,et);et=et.sibling}pt.type===Eg?(Ht=hp(pt.props.children,ct.mode,Ht,pt.key),Ht.return=ct,ct=Ht):(Ht=dS(pt.type,pt.key,pt.props,null,ct.mode,Ht),Kt(Ht,pt),Ht.return=ct,ct=Ht)}return be(ct);case wg:e:{for(Tn=pt.key;et!==null;){if(et.key===Tn)if(et.tag===4&&et.stateNode.containerInfo===pt.containerInfo&&et.stateNode.implementation===pt.implementation){T(ct,et.sibling),Ht=U(et,pt.children||[]),Ht.return=ct,ct=Ht;break e}else{T(ct,et);break}else v(ct,et);et=et.sibling}Ht=bR(pt,ct.mode,Ht),Ht.return=ct,ct=Ht}return be(ct);case Lh:return Tn=pt._init,pt=Tn(pt._payload),Ep(ct,et,pt,Ht)}if(mS(pt))return Xl(ct,et,pt,Ht);if(a(pt)){if(Tn=a(pt),typeof Tn!="function")throw Error(r(150));return pt=Tn.call(pt),Ty(ct,et,pt,Ht)}if(typeof pt.then=="function")return Ep(ct,et,Jt(pt),Ht);if(pt.$$typeof===Nh)return Ep(ct,et,rn(ct,pt),Ht);un(ct,pt)}return typeof pt=="string"&&pt!==""||typeof pt=="number"||typeof pt=="bigint"?(pt=""+pt,et!==null&&et.tag===6?(T(ct,et.sibling),Ht=U(et,pt),Ht.return=ct,ct=Ht):(T(ct,et),Ht=gR(pt,ct.mode,Ht),Ht.return=ct,ct=Ht),be(ct)):T(ct,et)}return function(ct,et,pt,Ht){try{yy=0;var Tn=Ep(ct,et,pt,Ht);return Pg=null,Tn}catch(zn){if(zn===vy)throw zn;var Br=n(29,zn,null,ct.mode);return Br.lanes=Ht,Br.return=ct,Br}finally{}}}function Qn(m,v){m=Df,x(TS,m),x(Ug,v),Df=m|v.baseLanes}function Yn(){x(TS,Df),x(Ug,Ug.current)}function xi(){Df=TS.current,p(Ug),p(TS)}function qn(m){var v=m.alternate;x(La,La.current&1),x(Gl,m),Du===null&&(v===null||Ug.current!==null||v.memoizedState!==null)&&(Du=m)}function Ji(m){if(m.tag===22){if(x(La,La.current),x(Gl,m),Du===null){var v=m.alternate;v!==null&&v.memoizedState!==null&&(Du=m)}}else hi()}function hi(){x(La,La.current),x(Gl,Gl.current)}function on(m){p(Gl),Du===m&&(Du=null),p(La)}function Ii(m){for(var v=m;v!==null;){if(v.tag===13){var T=v.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||RR(T)||kR(T)))return v}else if(v.tag===19&&v.memoizedProps.revealOrder!==void 0){if(v.flags&128)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break;for(;v.sibling===null;){if(v.return===null||v.return===m)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}function ri(){throw Error(r(321))}function se(m,v){if(v===null)return!1;for(var T=0;T<v.length&&T<m.length;T++)if(!al(m[T],v[T]))return!1;return!0}function ge(m,v,T,O,U,q){return Bh=q,gi=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,Kn.H=m===null||m.memoizedState===null?vp:zh,bp=!1,q=T(O,U),bp=!1,Fg&&(q=rt(v,T,O,U)),Ue(m),q}function Ue(m){Kn.H=Ou;var v=vr!==null&&vr.next!==null;if(Bh=0,wa=vr=gi=null,AS=!1,xy=0,Bg=null,v)throw Error(r(300));m===null||Ja||(m=m.dependencies,m!==null&&Vt(m)&&(Ja=!0))}function rt(m,v,T,O){gi=m;var U=0;do{if(Fg&&(Bg=null),xy=0,Fg=!1,25<=U)throw Error(r(301));if(U+=1,wa=vr=null,m.updateQueue!=null){var q=m.updateQueue;q.lastEffect=null,q.events=null,q.stores=null,q.memoCache!=null&&(q.memoCache.index=0)}Kn.H=yp,q=v(T,O)}while(Fg);return q}function dt(){var m=Kn.H,v=m.useState()[0];return v=typeof v.then=="function"?Oe(v):v,m=m.useState()[0],(vr!==null?vr.memoizedState:null)!==m&&(gi.flags|=1024),v}function lt(){var m=CS!==0;return CS=0,m}function At(m,v,T){v.updateQueue=m.updateQueue,v.flags&=-2053,m.lanes&=~T}function ee(m){if(AS){for(m=m.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}AS=!1}Bh=0,wa=vr=gi=null,Fg=!1,xy=CS=0,Bg=null}function xe(){var m={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wa===null?gi.memoizedState=wa=m:wa=wa.next=m,wa}function Ce(){if(vr===null){var m=gi.alternate;m=m!==null?m.memoizedState:null}else m=vr.next;var v=wa===null?gi.memoizedState:wa.next;if(v!==null)wa=v,vr=m;else{if(m===null)throw gi.alternate===null?Error(r(467)):Error(r(310));vr=m,m={memoizedState:vr.memoizedState,baseState:vr.baseState,baseQueue:vr.baseQueue,queue:vr.queue,next:null},wa===null?gi.memoizedState=wa=m:wa=wa.next=m}return wa}function Oe(m){var v=xy;return xy+=1,Bg===null&&(Bg=[]),m=it(Bg,m,v),v=gi,(wa===null?v.memoizedState:wa.next)===null&&(v=v.alternate,Kn.H=v===null||v.memoizedState===null?vp:zh),m}function ve(m){if(m!==null&&typeof m=="object"){if(typeof m.then=="function")return Oe(m);if(m.$$typeof===Nh)return Bt(m)}throw Error(r(438,String(m)))}function _t(m){var v=null,T=gi.updateQueue;if(T!==null&&(v=T.memoCache),v==null){var O=gi.alternate;O!==null&&(O=O.updateQueue,O!==null&&(O=O.memoCache,O!=null&&(v={data:O.data.map(function(U){return U.slice()}),index:0})))}if(v==null&&(v={data:[],index:0}),T===null&&(T=HR(),gi.updateQueue=T),T.memoCache=v,T=v.data[v.index],T===void 0)for(T=v.data[v.index]=Array(m),O=0;O<m;O++)T[O]=Qne;return v.index++,T}function ft(m,v){return typeof v=="function"?v(m):v}function yt(m){var v=Ce();return St(v,vr,m)}function St(m,v,T){var O=m.queue;if(O===null)throw Error(r(311));O.lastRenderedReducer=T;var U=m.baseQueue,q=O.pending;if(q!==null){if(U!==null){var be=U.next;U.next=q.next,q.next=be}v.baseQueue=U=q,O.pending=null}if(q=m.baseState,U===null)m.memoizedState=q;else{v=U.next;var Be=be=null,nt=null,Rt=v,qt=!1;do{var sn=Rt.lane&-536870913;if(sn!==Rt.lane?(Fi&sn)===sn:(Bh&sn)===sn){var cn=Rt.revertLane;if(cn===0)nt!==null&&(nt=nt.next={lane:0,revertLane:0,action:Rt.action,hasEagerState:Rt.hasEagerState,eagerState:Rt.eagerState,next:null}),sn===Ig&&(qt=!0);else if((Bh&cn)===cn){Rt=Rt.next,cn===Ig&&(qt=!0);continue}else sn={lane:0,revertLane:Rt.revertLane,action:Rt.action,hasEagerState:Rt.hasEagerState,eagerState:Rt.eagerState,next:null},nt===null?(Be=nt=sn,be=q):nt=nt.next=sn,gi.lanes|=cn,jh|=cn;sn=Rt.action,bp&&T(q,sn),q=Rt.hasEagerState?Rt.eagerState:T(q,sn)}else cn={lane:sn,revertLane:Rt.revertLane,action:Rt.action,hasEagerState:Rt.hasEagerState,eagerState:Rt.eagerState,next:null},nt===null?(Be=nt=cn,be=q):nt=nt.next=cn,gi.lanes|=sn,jh|=sn;Rt=Rt.next}while(Rt!==null&&Rt!==v);if(nt===null?be=q:nt.next=Be,!al(q,m.memoizedState)&&(Ja=!0,qt&&(T=Ng,T!==null)))throw T;m.memoizedState=q,m.baseState=be,m.baseQueue=nt,O.lastRenderedState=q}return U===null&&(O.lanes=0),[m.memoizedState,O.dispatch]}function Nt(m){var v=Ce(),T=v.queue;if(T===null)throw Error(r(311));T.lastRenderedReducer=m;var O=T.dispatch,U=T.pending,q=v.memoizedState;if(U!==null){T.pending=null;var be=U=U.next;do q=m(q,be.action),be=be.next;while(be!==U);al(q,v.memoizedState)||(Ja=!0),v.memoizedState=q,v.baseQueue===null&&(v.baseState=q),T.lastRenderedState=q}return[q,O]}function Xt(m,v,T){var O=gi,U=Ce(),q=Wi;if(q){if(T===void 0)throw Error(r(407));T=T()}else T=v();var be=!al((vr||U).memoizedState,T);if(be&&(U.memoizedState=T,Ja=!0),U=U.queue,_n(pn.bind(null,O,U,m),[m]),U.getSnapshot!==v||be||wa!==null&&wa.memoizedState.tag&1){if(O.flags|=2048,Gi(9,nn.bind(null,O,U,T,v),{destroy:void 0},null),Dr===null)throw Error(r(349));q||Bh&60||at(O,v,T)}return T}function at(m,v,T){m.flags|=16384,m={getSnapshot:v,value:T},v=gi.updateQueue,v===null?(v=HR(),gi.updateQueue=v,v.stores=[m]):(T=v.stores,T===null?v.stores=[m]:T.push(m))}function nn(m,v,T,O){v.value=T,v.getSnapshot=O,dn(v)&&Dn(m)}function pn(m,v,T){return T(function(){dn(v)&&Dn(m)})}function dn(m){var v=m.getSnapshot;m=m.value;try{var T=v();return!al(m,T)}catch{return!0}}function Dn(m){var v=we(m,2);v!==null&&ho(v,m,2)}function $t(m){var v=xe();if(typeof m=="function"){var T=m;if(m=T(),bp){H(!0);try{T()}finally{H(!1)}}}return v.memoizedState=v.baseState=m,v.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ft,lastRenderedState:m},v}function Yt(m,v,T,O){return m.baseState=T,St(m,vr,typeof O=="function"?O:ft)}function Un(m,v,T,O,U){if(Cn(m))throw Error(r(485));if(m=v.action,m!==null){var q={payload:U,action:m,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(be){q.listeners.push(be)}};Kn.T!==null?T(!0):q.isTransition=!1,O(q),T=v.pending,T===null?(q.next=v.pending=q,xn(v,q)):(q.next=T.next,v.pending=T.next=q)}}function xn(m,v){var T=v.action,O=v.payload,U=m.state;if(v.isTransition){var q=Kn.T,be={};Kn.T=be;try{var Be=T(U,O),nt=Kn.S;nt!==null&&nt(be,Be),Zn(m,v,Be)}catch(Rt){An(m,v,Rt)}finally{Kn.T=q}}else try{q=T(U,O),Zn(m,v,q)}catch(Rt){An(m,v,Rt)}}function Zn(m,v,T){T!==null&&typeof T=="object"&&typeof T.then=="function"?T.then(function(O){Nn(m,v,O)},function(O){return An(m,v,O)}):Nn(m,v,T)}function Nn(m,v,T){v.status="fulfilled",v.value=T,Sn(v),m.state=T,v=m.pending,v!==null&&(T=v.next,T===v?m.pending=null:(T=T.next,v.next=T,xn(m,T)))}function An(m,v,T){var O=m.pending;if(m.pending=null,O!==null){O=O.next;do v.status="rejected",v.reason=T,Sn(v),v=v.next;while(v!==O)}m.action=null}function Sn(m){m=m.listeners;for(var v=0;v<m.length;v++)(0,m[v])()}function an(m,v){return v}function di(m,v){if(Wi){var T=Dr.formState;if(T!==null){e:{var O=gi;if(Wi){if(Js){var U=Gie(Js,ku);if(U){Js=I9(U),O=Wie(U);break e}}Se(O)}O=!1}O&&(v=T[0])}}T=xe(),T.memoizedState=T.baseState=v,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:an,lastRenderedState:v},T.queue=O,T=gn.bind(null,gi,O),O.dispatch=T,O=$t(!1);var q=Ei.bind(null,gi,!1,O.queue);return O=xe(),U={state:v,dispatch:null,action:m,pending:null},O.queue=U,T=Un.bind(null,gi,U,q,T),U.dispatch=T,O.memoizedState=m,[v,T,!1]}function Li(m){var v=Ce();return Gn(v,vr,m)}function Gn(m,v,T){v=St(m,v,an)[0],m=yt(ft)[0],v=typeof v=="object"&&v!==null&&typeof v.then=="function"?Oe(v):v;var O=Ce(),U=O.queue,q=U.dispatch;return T!==O.memoizedState&&(gi.flags|=2048,Gi(9,wi.bind(null,U,T),{destroy:void 0},null)),[v,q,m]}function wi(m,v){m.action=v}function Sa(m){var v=Ce(),T=vr;if(T!==null)return Gn(v,T,m);Ce(),v=v.memoizedState,T=Ce();var O=T.queue.dispatch;return T.memoizedState=m,[v,O,!1]}function Gi(m,v,T,O){return m={tag:m,create:v,inst:T,deps:O,next:null},v=gi.updateQueue,v===null&&(v=HR(),gi.updateQueue=v),T=v.lastEffect,T===null?v.lastEffect=m.next=m:(O=T.next,T.next=m,m.next=O,v.lastEffect=m),m}function Yo(){return Ce().memoizedState}function Bs(m,v,T,O){var U=xe();gi.flags|=m,U.memoizedState=Gi(1|v,T,{destroy:void 0},O===void 0?null:O)}function ko(m,v,T,O){var U=Ce();O=O===void 0?null:O;var q=U.memoizedState.inst;vr!==null&&O!==null&&se(O,vr.memoizedState.deps)?U.memoizedState=Gi(v,T,q,O):(gi.flags|=m,U.memoizedState=Gi(1|v,T,q,O))}function ds(m,v){Bs(8390656,8,m,v)}function _n(m,v){ko(2048,8,m,v)}function Wa(m,v){return ko(4,2,m,v)}function ps(m,v){return ko(4,4,m,v)}function Xa(m,v){if(typeof v=="function"){m=m();var T=v(m);return function(){typeof T=="function"?T():v(null)}}if(v!=null)return m=m(),v.current=m,function(){v.current=null}}function $i(m,v,T){T=T!=null?T.concat([m]):null,ko(4,4,Xa.bind(null,v,m),T)}function so(){}function zs(m,v){var T=Ce();v=v===void 0?null:v;var O=T.memoizedState;return v!==null&&se(v,O[1])?O[0]:(T.memoizedState=[m,v],m)}function js(m,v){var T=Ce();v=v===void 0?null:v;var O=T.memoizedState;if(v!==null&&se(v,O[1]))return O[0];if(O=m(),bp){H(!0);try{m()}finally{H(!1)}}return T.memoizedState=[O,v],O}function E(m,v,T){return T===void 0||Bh&1073741824?m.memoizedState=v:(m.memoizedState=T,m=K4(),gi.lanes|=m,jh|=m,T)}function L(m,v,T,O){return al(T,v)?T:Ug.current!==null?(m=E(m,T,O),al(m,v)||(Ja=!0),m):Bh&42?(m=K4(),gi.lanes|=m,jh|=m,v):(Ja=!0,m.memoizedState=T)}function J(m,v,T,O,U){var q=dp();Do(q!==0&&8>q?q:8);var be=Kn.T,Be={};Kn.T=Be,Ei(m,!1,v,T);try{var nt=U(),Rt=Kn.S;if(Rt!==null&&Rt(Be,nt),nt!==null&&typeof nt=="object"&&typeof nt.then=="function"){var qt=qe(nt,O);Mn(m,v,qt,tl(m))}else Mn(m,v,O,tl(m))}catch(sn){Mn(m,v,{then:function(){},status:"rejected",reason:sn},tl())}finally{Do(q),Kn.T=be}}function re(m){var v=m.memoizedState;if(v!==null)return v;v={memoizedState:Mg,baseState:Mg,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ft,lastRenderedState:Mg},next:null};var T={};return v.next={memoizedState:T,baseState:T,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ft,lastRenderedState:T},next:null},m.memoizedState=v,m=m.alternate,m!==null&&(m.memoizedState=v),v}function ye(){return Bt(pp)}function $e(){return Ce().memoizedState}function tt(){return Ce().memoizedState}function Lt(m){for(var v=m.return;v!==null;){switch(v.tag){case 24:case 3:var T=tl();m=Je(T);var O=Ye(v,m,T);O!==null&&(ho(O,v,T),vt(O,v,T)),v={cache:Jn()},m.payload=v;return}v=v.return}}function zt(m,v,T){var O=tl();T={lane:O,revertLane:0,action:T,hasEagerState:!1,eagerState:null,next:null},Cn(m)?ai(v,T):(T=Xe(m,v,T,O),T!==null&&(ho(T,m,O),Ar(T,v,O)))}function gn(m,v,T){var O=tl();Mn(m,v,T,O)}function Mn(m,v,T,O){var U={lane:O,revertLane:0,action:T,hasEagerState:!1,eagerState:null,next:null};if(Cn(m))ai(v,U);else{var q=m.alternate;if(m.lanes===0&&(q===null||q.lanes===0)&&(q=v.lastRenderedReducer,q!==null))try{var be=v.lastRenderedState,Be=q(be,T);if(U.hasEagerState=!0,U.eagerState=Be,al(Be,be))return Ie(m,v,U,0),Dr===null&&ze(),!1}catch{}finally{}if(T=Xe(m,v,U,O),T!==null)return ho(T,m,O),Ar(T,v,O),!0}return!1}function Ei(m,v,T,O){if(O={lane:2,revertLane:me(),action:O,hasEagerState:!1,eagerState:null,next:null},Cn(m)){if(v)throw Error(r(479))}else v=Xe(m,T,O,2),v!==null&&ho(v,m,2)}function Cn(m){var v=m.alternate;return m===gi||v!==null&&v===gi}function ai(m,v){Fg=AS=!0;var T=m.pending;T===null?v.next=v:(v.next=T.next,T.next=v),m.pending=v}function Ar(m,v,T){if(T&4194176){var O=v.lanes;O&=m.pendingLanes,T|=O,v.lanes=T,z(m,T)}}function Mi(m,v,T,O){v=m.memoizedState,T=T(O,v),T=T==null?v:yR({},v,T),m.memoizedState=T,m.lanes===0&&(m.updateQueue.baseState=T)}function Hi(m,v,T,O,U,q,be){return m=m.stateNode,typeof m.shouldComponentUpdate=="function"?m.shouldComponentUpdate(O,q,be):v.prototype&&v.prototype.isPureReactComponent?!ht(T,O)||!ht(U,q):!0}function Ui(m,v,T,O){m=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(T,O),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(T,O),v.state!==m&&VR.enqueueReplaceState(v,v.state,null)}function pi(m,v){var T=v;if("ref"in v){T={};for(var O in v)O!=="ref"&&(T[O]=v[O])}if(m=m.defaultProps){T===v&&(T=yR({},T));for(var U in m)T[U]===void 0&&(T[U]=m[U])}return T}function Ia(m,v){try{var T=m.onUncaughtError;T(v.value,{componentStack:v.stack})}catch(O){setTimeout(function(){throw O})}}function Pl(m,v,T){try{var O=m.onCaughtError;O(T.value,{componentStack:T.stack,errorBoundary:v.tag===1?v.stateNode:null})}catch(U){setTimeout(function(){throw U})}}function Jo(m,v,T){return T=Je(T),T.tag=3,T.payload={element:null},T.callback=function(){Ia(m,v)},T}function Na(m){return m=Je(m),m.tag=3,m}function sr(m,v,T,O){var U=T.type.getDerivedStateFromError;if(typeof U=="function"){var q=O.value;m.payload=function(){return U(q)},m.callback=function(){Pl(v,T,O)}}var be=T.stateNode;be!==null&&typeof be.componentDidCatch=="function"&&(m.callback=function(){Pl(v,T,O),typeof U!="function"&&(Hh===null?Hh=new Set([this]):Hh.add(this));var Be=O.stack;this.componentDidCatch(O.value,{componentStack:Be!==null?Be:""})})}function op(m,v,T,O,U){if(T.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){if(v=T.alternate,v!==null&&Ot(v,T,U,!0),T=Gl.current,T!==null){switch(T.tag){case 13:return Du===null?hR():T.alternate===null&&ha===0&&(ha=3),T.flags&=-257,T.flags|=65536,T.lanes=U,O===MS?T.flags|=16384:(v=T.updateQueue,v===null?T.updateQueue=new Set([O]):v.add(O),pR(m,O,U)),!1;case 22:return T.flags|=65536,O===MS?T.flags|=16384:(v=T.updateQueue,v===null?(v={transitions:null,markerInstances:null,retryQueue:new Set([O])},T.updateQueue=v):(T=v.retryQueue,T===null?v.retryQueue=new Set([O]):T.add(O)),pR(m,O,U)),!1}throw Error(r(435,T.tag))}return pR(m,O,U),hR(),!1}if(Wi)return v=Gl.current,v!==null?(!(v.flags&65536)&&(v.flags|=256),v.flags|=65536,v.lanes=U,O!==LR&&(m=Error(r(422),{cause:O}),pe(W(m,T)))):(O!==LR&&(v=Error(r(423),{cause:O}),pe(W(v,T))),m=m.current.alternate,m.flags|=65536,U&=-U,m.lanes|=U,O=W(O,T),U=Jo(m.stateNode,O,U),Mt(m,U),ha!==4&&(ha=2)),!1;var q=Error(r(520),{cause:O});if(q=W(q,T),Sy===null?Sy=[q]:Sy.push(q),ha!==4&&(ha=2),v===null)return!0;O=W(O,T),T=v;do{switch(T.tag){case 3:return T.flags|=65536,m=U&-U,T.lanes|=m,m=Jo(T.stateNode,O,m),Mt(T,m),!1;case 1:if(v=T.type,q=T.stateNode,(T.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Hh===null||!Hh.has(q))))return T.flags|=65536,U&=-U,T.lanes|=U,U=Na(U),sr(U,m,T,O),Mt(T,U),!1}T=T.return}while(T!==null);return!1}function Cr(m,v,T,O){v.child=m===null?q9(v,null,T,O):gp(v,m.child,T,O)}function Ul(m,v,T,O,U){T=T.render;var q=v.ref;if("ref"in O){var be={};for(var Be in O)Be!=="ref"&&(be[Be]=O[Be])}else be=O;return Tt(v),O=ge(m,v,T,be,q,U),Be=lt(),m!==null&&!Ja?(At(m,v,U),lo(m,v,U)):(Wi&&Be&&Z(v),v.flags|=1,Cr(m,v,O,U),v.child)}function Fc(m,v,T,O,U){if(m===null){var q=T.type;return typeof q=="function"&&!mR(q)&&q.defaultProps===void 0&&T.compare===null?(v.tag=15,v.type=q,Hs(m,v,q,O,U)):(m=dS(T.type,null,O,v,v.mode,U),m.ref=v.ref,m.return=v,v.child=m)}if(q=m.child,!Fl(m,U)){var be=q.memoizedProps;if(T=T.compare,T=T!==null?T:ht,T(be,O)&&m.ref===v.ref)return lo(m,v,U)}return v.flags|=1,m=Ih(q,O),m.ref=v.ref,m.return=v,v.child=m}function Hs(m,v,T,O,U){if(m!==null){var q=m.memoizedProps;if(ht(q,O)&&m.ref===v.ref)if(Ja=!1,v.pendingProps=O=q,Fl(m,U))m.flags&131072&&(Ja=!0);else return v.lanes=m.lanes,lo(m,v,U)}return Vs(m,v,T,O,U)}function br(m,v,T){var O=v.pendingProps,U=O.children,q=(v.stateNode._pendingVisibility&2)!==0,be=m!==null?m.memoizedState:null;if(ur(m,v),O.mode==="hidden"||q){if(v.flags&128){if(O=be!==null?be.baseLanes|T:T,m!==null){for(U=v.child=m.child,q=0;U!==null;)q=q|U.lanes|U.childLanes,U=U.sibling;v.childLanes=q&~O}else v.childLanes=0,v.child=null;return Wr(m,v,O,T)}if(T&536870912)v.memoizedState={baseLanes:0,cachePool:null},m!==null&&si(v,be!==null?be.cachePool:null),be!==null?Qn(v,be):Yn(),Ji(v);else return v.lanes=v.childLanes=536870912,Wr(m,v,be!==null?be.baseLanes|T:T,T)}else be!==null?(si(v,be.cachePool),Qn(v,be),hi(),v.memoizedState=null):(m!==null&&si(v,null),Yn(),hi());return Cr(m,v,U,T),v.child}function Wr(m,v,T,O){var U=na();return U=U===null?null:{parent:Mf?ua._currentValue:ua._currentValue2,pool:U},v.memoizedState={baseLanes:T,cachePool:U},m!==null&&si(v,null),Yn(),Ji(v),m!==null&&Ot(m,v,O,!0),null}function ur(m,v){var T=v.ref;if(T===null)m!==null&&m.ref!==null&&(v.flags|=2097664);else{if(typeof T!="function"&&typeof T!="object")throw Error(r(284));(m===null||m.ref!==T)&&(v.flags|=2097664)}}function Vs(m,v,T,O,U){return Tt(v),T=ge(m,v,T,O,void 0,U),O=lt(),m!==null&&!Ja?(At(m,v,U),lo(m,v,U)):(Wi&&O&&Z(v),v.flags|=1,Cr(m,v,T,U),v.child)}function qa(m,v,T,O,U,q){return Tt(v),v.updateQueue=null,T=rt(v,O,T,U),Ue(m),O=lt(),m!==null&&!Ja?(At(m,v,q),lo(m,v,q)):(Wi&&O&&Z(v),v.flags|=1,Cr(m,v,T,q),v.child)}function yg(m,v,T,O,U){if(Tt(v),v.stateNode===null){var q=Ag,be=T.contextType;typeof be=="object"&&be!==null&&(q=Bt(be)),q=new T(O,q),v.memoizedState=q.state!==null&&q.state!==void 0?q.state:null,q.updater=VR,v.stateNode=q,q._reactInternals=v,q=v.stateNode,q.props=O,q.state=v.memoizedState,q.refs={},mt(v),be=T.contextType,q.context=typeof be=="object"&&be!==null?Bt(be):Ag,q.state=v.memoizedState,be=T.getDerivedStateFromProps,typeof be=="function"&&(Mi(v,T,be,O),q.state=v.memoizedState),typeof T.getDerivedStateFromProps=="function"||typeof q.getSnapshotBeforeUpdate=="function"||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(be=q.state,typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount(),be!==q.state&&VR.enqueueReplaceState(q,q.state,null),kt(v,O,q,U),gt(),q.state=v.memoizedState),typeof q.componentDidMount=="function"&&(v.flags|=4194308),O=!0}else if(m===null){q=v.stateNode;var Be=v.memoizedProps,nt=pi(T,Be);q.props=nt;var Rt=q.context,qt=T.contextType;be=Ag,typeof qt=="object"&&qt!==null&&(be=Bt(qt));var sn=T.getDerivedStateFromProps;qt=typeof sn=="function"||typeof q.getSnapshotBeforeUpdate=="function",Be=v.pendingProps!==Be,qt||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(Be||Rt!==be)&&Ui(v,q,O,be),Fh=!1;var cn=v.memoizedState;q.state=cn,kt(v,O,q,U),gt(),Rt=v.memoizedState,Be||cn!==Rt||Fh?(typeof sn=="function"&&(Mi(v,T,sn,O),Rt=v.memoizedState),(nt=Fh||Hi(v,T,nt,O,cn,Rt,be))?(qt||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(v.flags|=4194308)):(typeof q.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=O,v.memoizedState=Rt),q.props=O,q.state=Rt,q.context=be,O=nt):(typeof q.componentDidMount=="function"&&(v.flags|=4194308),O=!1)}else{q=v.stateNode,Ge(m,v),be=v.memoizedProps,qt=pi(T,be),q.props=qt,sn=v.pendingProps,cn=q.context,Rt=T.contextType,nt=Ag,typeof Rt=="object"&&Rt!==null&&(nt=Bt(Rt)),Be=T.getDerivedStateFromProps,(Rt=typeof Be=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(be!==sn||cn!==nt)&&Ui(v,q,O,nt),Fh=!1,cn=v.memoizedState,q.state=cn,kt(v,O,q,U),gt();var ei=v.memoizedState;be!==sn||cn!==ei||Fh||m!==null&&m.dependencies!==null&&Vt(m.dependencies)?(typeof Be=="function"&&(Mi(v,T,Be,O),ei=v.memoizedState),(qt=Fh||Hi(v,T,qt,O,cn,ei,nt)||m!==null&&m.dependencies!==null&&Vt(m.dependencies))?(Rt||typeof q.UNSAFE_componentWillUpdate!="function"&&typeof q.componentWillUpdate!="function"||(typeof q.componentWillUpdate=="function"&&q.componentWillUpdate(O,ei,nt),typeof q.UNSAFE_componentWillUpdate=="function"&&q.UNSAFE_componentWillUpdate(O,ei,nt)),typeof q.componentDidUpdate=="function"&&(v.flags|=4),typeof q.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof q.componentDidUpdate!="function"||be===m.memoizedProps&&cn===m.memoizedState||(v.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||be===m.memoizedProps&&cn===m.memoizedState||(v.flags|=1024),v.memoizedProps=O,v.memoizedState=ei),q.props=O,q.state=ei,q.context=nt,O=qt):(typeof q.componentDidUpdate!="function"||be===m.memoizedProps&&cn===m.memoizedState||(v.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||be===m.memoizedProps&&cn===m.memoizedState||(v.flags|=1024),O=!1)}return q=O,ur(m,v),O=(v.flags&128)!==0,q||O?(q=v.stateNode,T=O&&typeof T.getDerivedStateFromError!="function"?null:q.render(),v.flags|=1,m!==null&&O?(v.child=gp(v,m.child,null,U),v.child=gp(v,null,T,U)):Cr(m,v,T,U),v.memoizedState=q.state,m=v.child):m=lo(m,v,U),m}function lp(m,v,T,O){return He(),v.flags|=256,Cr(m,v,T,O),v.child}function Rh(m){return{baseLanes:m,cachePool:zc()}}function Bc(m,v,T){return m=m!==null?m.childLanes&~T:0,v&&(m|=Wl),m}function Ru(m,v,T){var O=v.pendingProps,U=!1,q=(v.flags&128)!==0,be;if((be=q)||(be=m!==null&&m.memoizedState===null?!1:(La.current&2)!==0),be&&(U=!0,v.flags&=-129),be=(v.flags&32)!==0,v.flags&=-33,m===null){if(Wi){if(U?qn(v):hi(),Wi){var Be=Js,nt;(nt=Be)&&(Be=Jie(Be,ku),Be!==null?(v.memoizedState={dehydrated:Be,treeContext:mp!==null?{id:Tf,overflow:Af}:null,retryLane:536870912},nt=n(18,null,null,0),nt.stateNode=Be,nt.return=v,v.child=nt,po=v,Js=null,nt=!0):nt=!1),nt||Se(v)}if(Be=v.memoizedState,Be!==null&&(Be=Be.dehydrated,Be!==null))return kR(Be)?v.lanes=16:v.lanes=536870912,null;on(v)}return Be=O.children,O=O.fallback,U?(hi(),U=v.mode,Be=Sf({mode:"hidden",children:Be},U),O=hp(O,U,T,null),Be.return=v,O.return=v,Be.sibling=O,v.child=Be,U=v.child,U.memoizedState=Rh(T),U.childLanes=Bc(m,be,T),v.memoizedState=GR,O):(qn(v),cp(v,Be))}if(nt=m.memoizedState,nt!==null&&(Be=nt.dehydrated,Be!==null)){if(q)v.flags&256?(qn(v),v.flags&=-257,v=oo(m,v,T)):v.memoizedState!==null?(hi(),v.child=m.child,v.flags|=128,v=null):(hi(),U=O.fallback,Be=v.mode,O=Sf({mode:"visible",children:O.children},Be),U=hp(U,Be,T,null),U.flags|=2,O.return=v,U.return=v,O.sibling=U,v.child=O,gp(v,m.child,null,T),O=v.child,O.memoizedState=Rh(T),O.childLanes=Bc(m,be,T),v.memoizedState=GR,v=U);else if(qn(v),kR(Be))be=Hie(Be).digest,O=Error(r(419)),O.stack="",O.digest=be,pe({value:O,source:null,stack:null}),v=oo(m,v,T);else if(Ja||Ot(m,v,T,!1),be=(T&m.childLanes)!==0,Ja||be){if(be=Dr,be!==null){if(O=T&-T,O&42)O=1;else switch(O){case 2:O=1;break;case 8:O=4;break;case 32:O=16;break;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:O=64;break;case 268435456:O=134217728;break;default:O=0}if(O=O&(be.suspendedLanes|T)?0:O,O!==0&&O!==nt.retryLane)throw nt.retryLane=O,we(m,O),ho(be,m,O),Y9}RR(Be)||hR(),v=oo(m,v,T)}else RR(Be)?(v.flags|=128,v.child=m.child,v=Wne.bind(null,m),Vie(Be,v),v=null):(m=nt.treeContext,Bl&&(Js=qie(Be),po=v,Wi=!0,Vc=null,ku=!1,m!==null&&(jl[Hl++]=Tf,jl[Hl++]=Af,jl[Hl++]=mp,Tf=m.id,Af=m.overflow,mp=v)),v=cp(v,O.children),v.flags|=4096);return v}return U?(hi(),U=O.fallback,Be=v.mode,nt=m.child,q=nt.sibling,O=Ih(nt,{mode:"hidden",children:O.children}),O.subtreeFlags=nt.subtreeFlags&31457280,q!==null?U=Ih(q,U):(U=hp(U,Be,T,null),U.flags|=2),U.return=v,O.return=v,O.sibling=U,v.child=O,O=U,U=v.child,Be=m.child.memoizedState,Be===null?Be=Rh(T):(nt=Be.cachePool,nt!==null?(q=Mf?ua._currentValue:ua._currentValue2,nt=nt.parent!==q?{parent:q,pool:q}:nt):nt=zc(),Be={baseLanes:Be.baseLanes|T,cachePool:nt}),U.memoizedState=Be,U.childLanes=Bc(m,be,T),v.memoizedState=GR,O):(qn(v),T=m.child,m=T.sibling,T=Ih(T,{mode:"visible",children:O.children}),T.return=v,T.sibling=null,m!==null&&(be=v.deletions,be===null?(v.deletions=[m],v.flags|=16):be.push(m)),v.child=T,v.memoizedState=null,T)}function cp(m,v){return v=Sf({mode:"visible",children:v},m.mode),v.return=m,m.child=v}function Sf(m,v){return u9(m,v,0,null)}function oo(m,v,T){return gp(v,m.child,null,T),m=cp(v,v.pendingProps.children),m.flags|=2,v.memoizedState=null,m}function $o(m,v,T){m.lanes|=v;var O=m.alternate;O!==null&&(O.lanes|=v),Ke(m.return,v,T)}function Gs(m,v,T,O,U){var q=m.memoizedState;q===null?m.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:O,tail:T,tailMode:U}:(q.isBackwards=v,q.rendering=null,q.renderingStartTime=0,q.last=O,q.tail=T,q.tailMode=U)}function Ka(m,v,T){var O=v.pendingProps,U=O.revealOrder,q=O.tail;if(Cr(m,v,O.children,T),O=La.current,O&2)O=O&1|2,v.flags|=128;else{if(m!==null&&m.flags&128)e:for(m=v.child;m!==null;){if(m.tag===13)m.memoizedState!==null&&$o(m,T,v);else if(m.tag===19)$o(m,T,v);else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===v)break e;for(;m.sibling===null;){if(m.return===null||m.return===v)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}O&=1}switch(x(La,O),U){case"forwards":for(T=v.child,U=null;T!==null;)m=T.alternate,m!==null&&Ii(m)===null&&(U=T),T=T.sibling;T=U,T===null?(U=v.child,v.child=null):(U=T.sibling,T.sibling=null),Gs(v,!1,U,T,q);break;case"backwards":for(T=null,U=v.child,v.child=null;U!==null;){if(m=U.alternate,m!==null&&Ii(m)===null){v.child=U;break}m=U.sibling,U.sibling=T,T=U,U=m}Gs(v,!0,T,null,q);break;case"together":Gs(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function lo(m,v,T){if(m!==null&&(v.dependencies=m.dependencies),jh|=v.lanes,!(T&v.childLanes))if(m!==null){if(Ot(m,v,T,!1),(T&v.childLanes)===0)return null}else return null;if(m!==null&&v.child!==m.child)throw Error(r(153));if(v.child!==null){for(m=v.child,T=Ih(m,m.pendingProps),v.child=T,T.return=v;m.sibling!==null;)m=m.sibling,T=T.sibling=Ih(m,m.pendingProps),T.return=v;T.sibling=null}return v.child}function Fl(m,v){return m.lanes&v?!0:(m=m.dependencies,!!(m!==null&&Vt(m)))}function kh(m,v,T){switch(v.tag){case 3:de(v,v.stateNode.containerInfo),ie(v,ua,m.memoizedState.cache),He();break;case 27:case 5:le(v);break;case 4:de(v,v.stateNode.containerInfo);break;case 10:ie(v,v.type,v.memoizedProps.value);break;case 13:var O=v.memoizedState;if(O!==null)return O.dehydrated!==null?(qn(v),v.flags|=128,null):T&v.child.childLanes?Ru(m,v,T):(qn(v),m=lo(m,v,T),m!==null?m.sibling:null);qn(v);break;case 19:var U=(m.flags&128)!==0;if(O=(T&v.childLanes)!==0,O||(Ot(m,v,T,!1),O=(T&v.childLanes)!==0),U){if(O)return Ka(m,v,T);v.flags|=128}if(U=v.memoizedState,U!==null&&(U.rendering=null,U.tail=null,U.lastEffect=null),x(La,La.current),O)break;return null;case 22:case 23:return v.lanes=0,br(m,v,T);case 24:ie(v,ua,m.memoizedState.cache)}return lo(m,v,T)}function ne(m,v,T){if(m!==null)if(m.memoizedProps!==v.pendingProps)Ja=!0;else{if(!Fl(m,T)&&!(v.flags&128))return Ja=!1,kh(m,v,T);Ja=!!(m.flags&131072)}else Ja=!1,Wi&&v.flags&1048576&&Y(v,_S,v.index);switch(v.lanes=0,v.tag){case 16:e:{m=v.pendingProps;var O=v.elementType,U=O._init;if(O=U(O._payload),v.type=O,typeof O=="function")mR(O)?(m=pi(O,m),v.tag=1,v=yg(null,v,O,m,T)):(v.tag=0,v=Vs(null,v,O,m,T));else{if(O!=null){if(U=O.$$typeof,U===_R){v.tag=11,v=Ul(null,v,O,m,T);break e}else if(U===ER){v.tag=14,v=Fc(null,v,O,m,T);break e}}throw v=s(O)||O,Error(r(306,v,""))}}return v;case 0:return Vs(m,v,v.type,v.pendingProps,T);case 1:return O=v.type,U=pi(O,v.pendingProps),yg(m,v,O,U,T);case 3:e:{if(de(v,v.stateNode.containerInfo),m===null)throw Error(r(387));var q=v.pendingProps;U=v.memoizedState,O=U.element,Ge(m,v),kt(v,q,null,T);var be=v.memoizedState;if(q=be.cache,ie(v,ua,q),q!==U.cache&&xt(v,[ua],T,!0),gt(),q=be.element,Bl&&U.isDehydrated)if(U={element:q,isDehydrated:!1,cache:be.cache},v.updateQueue.baseState=U,v.memoizedState=U,v.flags&256){v=lp(m,v,q,T);break e}else if(q!==O){O=W(Error(r(424)),v),pe(O),v=lp(m,v,q,T);break e}else for(Bl&&(Js=Xie(v.stateNode.containerInfo),po=v,Wi=!0,Vc=null,ku=!0),T=q9(v,null,q,T),v.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(He(),q===O){v=lo(m,v,T);break e}Cr(m,v,q,T)}v=v.child}return v;case 26:if(zl)return ur(m,v),m===null?(T=U9(v.type,null,v.pendingProps,null))?v.memoizedState=T:Wi||(v.stateNode=lre(v.type,v.pendingProps,Uh.current,v)):v.memoizedState=U9(v.type,m.memoizedProps,v.pendingProps,m.memoizedState),null;case 27:if(Ys)return le(v),m===null&&Ys&&Wi&&(O=v.stateNode=V9(v.type,v.pendingProps,Uh.current,gs.current,!1),po=v,ku=!0,Js=N9(O)),O=v.pendingProps.children,m!==null||Wi?Cr(m,v,O,T):v.child=gp(v,null,O,T),ur(m,v),v.child;case 5:return m===null&&Wi&&(are(v.type,v.pendingProps,gs.current),(U=O=Js)&&(O=Kie(O,v.type,v.pendingProps,ku),O!==null?(v.stateNode=O,po=v,Js=N9(O),ku=!1,U=!0):U=!1),U||Se(v)),le(v),U=v.type,q=v.pendingProps,be=m!==null?m.memoizedProps:null,O=q.children,gS(U,q)?O=null:be!==null&&gS(U,be)&&(v.flags|=32),v.memoizedState!==null&&(U=ge(m,v,dt,null,null,T),Mf?pp._currentValue=U:pp._currentValue2=U),ur(m,v),Cr(m,v,O,T),v.child;case 6:return m===null&&Wi&&(sre(v.pendingProps,gs.current),(m=T=Js)&&(T=Yie(T,v.pendingProps,ku),T!==null?(v.stateNode=T,po=v,Js=null,m=!0):m=!1),m||Se(v)),null;case 13:return Ru(m,v,T);case 4:return de(v,v.stateNode.containerInfo),O=v.pendingProps,m===null?v.child=gp(v,null,O,T):Cr(m,v,O,T),v.child;case 11:return Ul(m,v,v.type,v.pendingProps,T);case 7:return Cr(m,v,v.pendingProps,T),v.child;case 8:return Cr(m,v,v.pendingProps.children,T),v.child;case 12:return Cr(m,v,v.pendingProps.children,T),v.child;case 10:return O=v.pendingProps,ie(v,v.type,O.value),Cr(m,v,O.children,T),v.child;case 9:return U=v.type._context,O=v.pendingProps.children,Tt(v),U=Bt(U),O=O(U),v.flags|=1,Cr(m,v,O,T),v.child;case 14:return Fc(m,v,v.type,v.pendingProps,T);case 15:return Hs(m,v,v.type,v.pendingProps,T);case 19:return Ka(m,v,T);case 22:return br(m,v,T);case 24:return Tt(v),O=Bt(ua),m===null?(U=na(),U===null&&(U=Dr,q=Jn(),U.pooledCache=q,q.refCount++,q!==null&&(U.pooledCacheLanes|=T),U=q),v.memoizedState={parent:O,cache:U},mt(v),ie(v,ua,U)):(m.lanes&T&&(Ge(m,v),kt(v,null,null,T),gt()),U=m.memoizedState,q=v.memoizedState,U.parent!==O?(U={parent:O,cache:O},v.memoizedState=U,v.lanes===0&&(v.memoizedState=v.updateQueue.baseState=U),ie(v,ua,O)):(O=q.cache,ie(v,ua,O),O!==U.cache&&xt(v,[ua],T,!0))),Cr(m,v,v.pendingProps.children,T),v.child;case 29:throw v.pendingProps}throw Error(r(156,v.tag))}function ie(m,v,T){Mf?(x(RS,v._currentValue),v._currentValue=T):(x(RS,v._currentValue2),v._currentValue2=T)}function De(m){var v=RS.current;Mf?m._currentValue=v:m._currentValue2=v,p(RS)}function Ke(m,v,T){for(;m!==null;){var O=m.alternate;if((m.childLanes&v)!==v?(m.childLanes|=v,O!==null&&(O.childLanes|=v)):O!==null&&(O.childLanes&v)!==v&&(O.childLanes|=v),m===T)break;m=m.return}}function xt(m,v,T,O){var U=m.child;for(U!==null&&(U.return=m);U!==null;){var q=U.dependencies;if(q!==null){var be=U.child;q=q.firstContext;e:for(;q!==null;){var Be=q;q=U;for(var nt=0;nt<v.length;nt++)if(Be.context===v[nt]){q.lanes|=T,Be=q.alternate,Be!==null&&(Be.lanes|=T),Ke(q.return,T,m),O||(be=null);break e}q=Be.next}}else if(U.tag===18){if(be=U.return,be===null)throw Error(r(341));be.lanes|=T,q=be.alternate,q!==null&&(q.lanes|=T),Ke(be,T,m),be=null}else be=U.child;if(be!==null)be.return=U;else for(be=U;be!==null;){if(be===m){be=null;break}if(U=be.sibling,U!==null){U.return=be.return,be=U;break}be=be.return}U=be}}function Ot(m,v,T,O){m=null;for(var U=v,q=!1;U!==null;){if(!q){if(U.flags&524288)q=!0;else if(U.flags&262144)break}if(U.tag===10){var be=U.alternate;if(be===null)throw Error(r(387));if(be=be.memoizedProps,be!==null){var Be=U.type;al(U.pendingProps.value,be.value)||(m!==null?m.push(Be):m=[Be])}}else if(U===SS.current){if(be=U.alternate,be===null)throw Error(r(387));be.memoizedState.memoizedState!==U.memoizedState.memoizedState&&(m!==null?m.push(pp):m=[pp])}U=U.return}m!==null&&xt(v,m,T,O),v.flags|=262144}function Vt(m){for(m=m.firstContext;m!==null;){var v=m.context;if(!al(Mf?v._currentValue:v._currentValue2,m.memoizedValue))return!0;m=m.next}return!1}function Tt(m){xp=m,Cf=null,m=m.dependencies,m!==null&&(m.firstContext=null)}function Bt(m){return ln(xp,m)}function rn(m,v){return xp===null&&Tt(m),ln(m,v)}function ln(m,v){var T=Mf?v._currentValue:v._currentValue2;if(v={context:v,memoizedValue:T,next:null},Cf===null){if(m===null)throw Error(r(308));Cf=v,m.dependencies={lanes:0,firstContext:v},m.flags|=524288}else Cf=Cf.next=v;return T}function Jn(){return{controller:new Mre,data:new Map,refCount:0}}function Ln(m){m.refCount--,m.refCount===0&&Tre(Are,function(){m.controller.abort()})}function na(){var m=_p.current;return m!==null?m:Dr.pooledCache}function si(m,v){v===null?x(_p,_p.current):x(_p,v.pool)}function zc(){var m=na();return m===null?null:{parent:Mf?ua._currentValue:ua._currentValue2,pool:m}}function Fr(m){m.flags|=4}function Zo(m,v){if(m!==null&&m.child===v.child)return!1;if(v.flags&16)return!0;for(m=v.child;m!==null;){if(m.flags&13878||m.subtreeFlags&13878)return!0;m=m.sibling}return!1}function wf(m,v,T,O){if(Ks)for(T=v.child;T!==null;){if(T.tag===5||T.tag===6)AR(m,T.stateNode);else if(!(T.tag===4||Ys&&T.tag===27)&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===v)break;for(;T.sibling===null;){if(T.return===null||T.return===v)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else if(Ph)for(var U=v.child;U!==null;){if(U.tag===5){var q=U.stateNode;T&&O&&(q=D9(q,U.type,U.memoizedProps)),AR(m,q)}else if(U.tag===6)q=U.stateNode,T&&O&&(q=O9(q,U.memoizedProps)),AR(m,q);else if(U.tag!==4){if(U.tag===22&&U.memoizedState!==null)q=U.child,q!==null&&(q.return=U),wf(m,U,!0,!0);else if(U.child!==null){U.child.return=U,U=U.child;continue}}if(U===v)break;for(;U.sibling===null;){if(U.return===null||U.return===v)return;U=U.return}U.sibling.return=U.return,U=U.sibling}}function co(m,v,T,O){if(Ph)for(var U=v.child;U!==null;){if(U.tag===5){var q=U.stateNode;T&&O&&(q=D9(q,U.type,U.memoizedProps)),R9(m,q)}else if(U.tag===6)q=U.stateNode,T&&O&&(q=O9(q,U.memoizedProps)),R9(m,q);else if(U.tag!==4){if(U.tag===22&&U.memoizedState!==null)q=U.child,q!==null&&(q.return=U),co(m,U,!(U.memoizedProps!==null&&U.memoizedProps.mode==="manual"),!0);else if(U.child!==null){U.child.return=U,U=U.child;continue}}if(U===v)break;for(;U.sibling===null;){if(U.return===null||U.return===v)return;U=U.return}U.sibling.return=U.return,U=U.sibling}}function Dh(m,v){if(Ph&&Zo(m,v)){m=v.stateNode;var T=m.containerInfo,O=C9();co(O,v,!1,!1),m.pendingChildren=O,Fr(v),jie(T,O)}}function Q(m,v,T,O){if(Ks)m.memoizedProps!==O&&Fr(v);else if(Ph){var U=m.stateNode,q=m.memoizedProps;if((m=Zo(m,v))||q!==O){var be=gs.current;q=zie(U,T,q,O,!m,null),q===U?v.stateNode=U:(S9(q,T,O,be)&&Fr(v),v.stateNode=q,m?wf(q,v,!1,!1):Fr(v))}else v.stateNode=U}}function fe(m,v,T){if(pie(v,T)){if(m.flags|=16777216,!M9(v,T))if(Q4())m.flags|=8192;else throw Lg=MS,jR}else m.flags&=-16777217}function _e(m,v){if(ure(v)){if(m.flags|=16777216,!H9(v))if(Q4())m.flags|=8192;else throw Lg=MS,jR}else m.flags&=-16777217}function Me(m,v){v!==null&&(m.flags|=4),m.flags&16384&&(v=m.tag!==22?k():536870912,m.lanes|=v,Hg|=v)}function We(m,v){if(!Wi)switch(m.tailMode){case"hidden":v=m.tail;for(var T=null;v!==null;)v.alternate!==null&&(T=v),v=v.sibling;T===null?m.tail=null:T.sibling=null;break;case"collapsed":T=m.tail;for(var O=null;T!==null;)T.alternate!==null&&(O=T),T=T.sibling;O===null?v||m.tail===null?m.tail=null:m.tail.sibling=null:O.sibling=null}}function Ze(m){var v=m.alternate!==null&&m.alternate.child===m.child,T=0,O=0;if(v)for(var U=m.child;U!==null;)T|=U.lanes|U.childLanes,O|=U.subtreeFlags&31457280,O|=U.flags&31457280,U.return=m,U=U.sibling;else for(U=m.child;U!==null;)T|=U.lanes|U.childLanes,O|=U.subtreeFlags,O|=U.flags,U.return=m,U=U.sibling;return m.subtreeFlags|=O,m.childLanes=T,v}function Ct(m,v,T){var O=v.pendingProps;switch(G(v),v.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(v),null;case 1:return Ze(v),null;case 3:return T=v.stateNode,O=null,m!==null&&(O=m.memoizedState.cache),v.memoizedState.cache!==O&&(v.flags|=2048),De(ua),oe(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(m===null||m.child===null)&&(je(v)?Fr(v):m===null||m.memoizedState.isDehydrated&&!(v.flags&256)||(v.flags|=1024,Vc!==null&&(uR(Vc),Vc=null))),Dh(m,v),Ze(v),null;case 26:if(zl){T=v.type;var U=v.memoizedState;return m===null?(Fr(v),U!==null?(Ze(v),_e(v,U)):(Ze(v),fe(v,T,O))):U?U!==m.memoizedState?(Fr(v),Ze(v),_e(v,U)):(Ze(v),v.flags&=-16777217):(Ks?m.memoizedProps!==O&&Fr(v):Q(m,v,T,O),Ze(v),fe(v,T,O)),null}case 27:if(Ys){if(ue(v),T=Uh.current,U=v.type,m!==null&&v.stateNode!=null)Ks?m.memoizedProps!==O&&Fr(v):Q(m,v,U,O);else{if(!O){if(v.stateNode===null)throw Error(r(166));return Ze(v),null}m=gs.current,je(v)?Te(v,m):(m=V9(U,O,T,m,!0),v.stateNode=m,Fr(v))}return Ze(v),null}case 5:if(ue(v),T=v.type,m!==null&&v.stateNode!=null)Q(m,v,T,O);else{if(!O){if(v.stateNode===null)throw Error(r(166));return Ze(v),null}m=gs.current,je(v)?Te(v,m):(U=oie(T,O,Uh.current,m,v),wf(U,v,!1,!1),v.stateNode=U,S9(U,T,O,m)&&Fr(v))}return Ze(v),fe(v,v.type,v.pendingProps),null;case 6:if(m&&v.stateNode!=null)T=m.memoizedProps,Ks?T!==O&&Fr(v):Ph&&(T!==O?(v.stateNode=w9(O,Uh.current,gs.current,v),Fr(v)):v.stateNode=m.stateNode);else{if(typeof O!="string"&&v.stateNode===null)throw Error(r(166));if(m=Uh.current,T=gs.current,je(v)){if(!Bl)throw Error(r(176));if(m=v.stateNode,T=v.memoizedProps,O=null,U=po,U!==null)switch(U.tag){case 27:case 5:O=U.memoizedProps}Zie(m,T,v,O)||Se(v)}else v.stateNode=w9(O,m,T,v)}return Ze(v),null;case 13:if(O=v.memoizedState,m===null||m.memoizedState!==null&&m.memoizedState.dehydrated!==null){if(U=je(v),O!==null&&O.dehydrated!==null){if(m===null){if(!U)throw Error(r(318));if(!Bl)throw Error(r(344));if(U=v.memoizedState,U=U!==null?U.dehydrated:null,!U)throw Error(r(317));Qie(U,v)}else He(),!(v.flags&128)&&(v.memoizedState=null),v.flags|=4;Ze(v),U=!1}else Vc!==null&&(uR(Vc),Vc=null),U=!0;if(!U)return v.flags&256?(on(v),v):(on(v),null)}if(on(v),v.flags&128)return v.lanes=T,v;if(T=O!==null,m=m!==null&&m.memoizedState!==null,T){O=v.child,U=null,O.alternate!==null&&O.alternate.memoizedState!==null&&O.alternate.memoizedState.cachePool!==null&&(U=O.alternate.memoizedState.cachePool.pool);var q=null;O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(q=O.memoizedState.cachePool.pool),q!==U&&(O.flags|=2048)}return T!==m&&T&&(v.child.flags|=8192),Me(v,v.updateQueue),Ze(v),null;case 4:return oe(),Dh(m,v),m===null&&uie(v.stateNode.containerInfo),Ze(v),null;case 10:return De(v.type),Ze(v),null;case 19:if(p(La),U=v.memoizedState,U===null)return Ze(v),null;if(O=(v.flags&128)!==0,q=U.rendering,q===null)if(O)We(U,!1);else{if(ha!==0||m!==null&&m.flags&128)for(m=v.child;m!==null;){if(q=Ii(m),q!==null){for(v.flags|=128,We(U,!1),m=q.updateQueue,v.updateQueue=m,Me(v,m),v.subtreeFlags=0,m=T,T=v.child;T!==null;)c9(T,m),T=T.sibling;return x(La,La.current&1|2),v.child}m=m.sibling}U.tail!==null&&Hc()>wy&&(v.flags|=128,O=!0,We(U,!1),v.lanes=4194304)}else{if(!O)if(m=Ii(q),m!==null){if(v.flags|=128,O=!0,m=m.updateQueue,v.updateQueue=m,Me(v,m),We(U,!0),U.tail===null&&U.tailMode==="hidden"&&!q.alternate&&!Wi)return Ze(v),null}else 2*Hc()-U.renderingStartTime>wy&&T!==536870912&&(v.flags|=128,O=!0,We(U,!1),v.lanes=4194304);U.isBackwards?(q.sibling=v.child,v.child=q):(m=U.last,m!==null?m.sibling=q:v.child=q,U.last=q)}return U.tail!==null?(v=U.tail,U.rendering=v,U.tail=v.sibling,U.renderingStartTime=Hc(),v.sibling=null,m=La.current,x(La,O?m&1|2:m&1),v):(Ze(v),null);case 22:case 23:return on(v),xi(),O=v.memoizedState!==null,m!==null?m.memoizedState!==null!==O&&(v.flags|=8192):O&&(v.flags|=8192),O?T&536870912&&!(v.flags&128)&&(Ze(v),v.subtreeFlags&6&&(v.flags|=8192)):Ze(v),T=v.updateQueue,T!==null&&Me(v,T.retryQueue),T=null,m!==null&&m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),O=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(O=v.memoizedState.cachePool.pool),O!==T&&(v.flags|=2048),m!==null&&p(_p),null;case 24:return T=null,m!==null&&(T=m.memoizedState.cache),v.memoizedState.cache!==T&&(v.flags|=2048),De(ua),Ze(v),null;case 25:return null}throw Error(r(156,v.tag))}function Ft(m,v){switch(G(v),v.tag){case 1:return m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 3:return De(ua),oe(),m=v.flags,m&65536&&!(m&128)?(v.flags=m&-65537|128,v):null;case 26:case 27:case 5:return ue(v),null;case 13:if(on(v),m=v.memoizedState,m!==null&&m.dehydrated!==null){if(v.alternate===null)throw Error(r(340));He()}return m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 19:return p(La),null;case 4:return oe(),null;case 10:return De(v.type),null;case 22:case 23:return on(v),xi(),m!==null&&p(_p),m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 24:return De(ua),null;case 25:return null;default:return null}}function Gt(m,v){switch(G(v),v.tag){case 3:De(ua),oe();break;case 26:case 27:case 5:ue(v);break;case 4:oe();break;case 13:on(v);break;case 19:p(La);break;case 10:De(v.type);break;case 22:case 23:on(v),xi(),m!==null&&p(_p);break;case 24:De(ua)}}function en(m,v){try{var T=v.updateQueue,O=T!==null?T.lastEffect:null;if(O!==null){var U=O.next;T=U;do{if((T.tag&m)===m){O=void 0;var q=T.create,be=T.inst;O=q(),be.destroy=O}T=T.next}while(T!==U)}}catch(Be){dr(v,v.return,Be)}}function Qt(m,v,T){try{var O=v.updateQueue,U=O!==null?O.lastEffect:null;if(U!==null){var q=U.next;O=q;do{if((O.tag&m)===m){var be=O.inst,Be=be.destroy;if(Be!==void 0){be.destroy=void 0,U=v;var nt=T;try{Be()}catch(Rt){dr(U,nt,Rt)}}}O=O.next}while(O!==q)}}catch(Rt){dr(v,v.return,Rt)}}function fn(m){var v=m.updateQueue;if(v!==null){var T=m.stateNode;try{Le(v,T)}catch(O){dr(m,m.return,O)}}}function Fn(m,v,T){T.props=pi(m.type,m.memoizedProps),T.state=m.memoizedState;try{T.componentWillUnmount()}catch(O){dr(m,v,O)}}function mi(m,v){try{var T=m.ref;if(T!==null){var O=m.stateNode;switch(m.tag){case 26:case 27:case 5:var U=hy(O);break;default:U=O}typeof T=="function"?m.refCleanup=T(U):T.current=U}}catch(q){dr(m,v,q)}}function Wn(m,v){var T=m.ref,O=m.refCleanup;if(T!==null)if(typeof O=="function")try{O()}catch(U){dr(m,v,U)}finally{m.refCleanup=null,m=m.alternate,m!=null&&(m.refCleanup=null)}else if(typeof T=="function")try{T(null)}catch(U){dr(m,v,U)}else T.current=null}function ui(m){var v=m.type,T=m.memoizedProps,O=m.stateNode;try{Rie(O,v,T,m)}catch(U){dr(m,m.return,U)}}function Rn(m,v,T){try{kie(m.stateNode,m.type,T,v,m)}catch(O){dr(m,m.return,O)}}function yn(m){return m.tag===5||m.tag===3||(zl?m.tag===26:!1)||(Ys?m.tag===27:!1)||m.tag===4}function fr(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||yn(m.return))return null;m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&(!Ys||m.tag!==27)&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue e;m.child.return=m,m=m.child}if(!(m.flags&2))return m.stateNode}}function Rr(m,v,T){var O=m.tag;if(O===5||O===6)m=m.stateNode,v?Oie(T,m,v):Aie(T,m);else if(!(O===4||Ys&&O===27)&&(m=m.child,m!==null))for(Rr(m,v,T),m=m.sibling;m!==null;)Rr(m,v,T),m=m.sibling}function ia(m,v,T){var O=m.tag;if(O===5||O===6)m=m.stateNode,v?Die(T,m,v):Tie(T,m);else if(!(O===4||Ys&&O===27)&&(m=m.child,m!==null))for(ia(m,v,T),m=m.sibling;m!==null;)ia(m,v,T),m=m.sibling}function Zi(m,v,T){m=m.containerInfo;try{k9(m,T)}catch(O){dr(v,v.return,O)}}function Xr(m,v){for(aie(m.containerInfo),$a=v;$a!==null;)if(m=$a,v=m.child,(m.subtreeFlags&1028)!==0&&v!==null)v.return=m,$a=v;else for(;$a!==null;){m=$a;var T=m.alternate;switch(v=m.flags,m.tag){case 0:break;case 11:case 15:break;case 1:if(v&1024&&T!==null){v=void 0;var O=m,U=T.memoizedProps;T=T.memoizedState;var q=O.stateNode;try{var be=pi(O.type,U,O.elementType===O.type);v=q.getSnapshotBeforeUpdate(be,T),q.__reactInternalSnapshotBeforeUpdate=v}catch(Be){dr(O,O.return,Be)}}break;case 3:v&1024&&Ks&&Bie(m.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(v&1024)throw Error(r(163))}if(v=m.sibling,v!==null){v.return=m.return,$a=v;break}$a=m.return}return be=Z9,Z9=!1,be}function Ws(m,v,T){var O=T.flags;switch(T.tag){case 0:case 11:case 15:ms(m,T),O&4&&en(5,T);break;case 1:if(ms(m,T),O&4)if(m=T.stateNode,v===null)try{m.componentDidMount()}catch(Be){dr(T,T.return,Be)}else{var U=pi(T.type,v.memoizedProps);v=v.memoizedState;try{m.componentDidUpdate(U,v,m.__reactInternalSnapshotBeforeUpdate)}catch(Be){dr(T,T.return,Be)}}O&64&&fn(T),O&512&&mi(T,T.return);break;case 3:if(ms(m,T),O&64&&(O=T.updateQueue,O!==null)){if(m=null,T.child!==null)switch(T.child.tag){case 27:case 5:m=hy(T.child.stateNode);break;case 1:m=T.child.stateNode}try{Le(O,m)}catch(Be){dr(T,T.return,Be)}}break;case 26:if(zl){ms(m,T),O&512&&mi(T,T.return);break}case 27:case 5:ms(m,T),v===null&&O&4&&ui(T),O&512&&mi(T,T.return);break;case 12:ms(m,T);break;case 13:ms(m,T),O&4&&Qo(m,T);break;case 22:if(U=T.memoizedState!==null||Rf,!U){v=v!==null&&v.memoizedState!==null||fa;var q=Rf,be=fa;Rf=U,(fa=v)&&!be?jc(m,T,(T.subtreeFlags&8772)!==0):ms(m,T),Rf=q,fa=be}O&512&&(T.memoizedProps.mode==="manual"?mi(T,T.return):Wn(T,T.return));break;default:ms(m,T)}}function Ya(m){var v=m.alternate;v!==null&&(m.alternate=null,Ya(v)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(v=m.stateNode,v!==null&&die(v)),m.stateNode=null,m.return=null,m.dependencies=null,m.memoizedProps=null,m.memoizedState=null,m.pendingProps=null,m.stateNode=null,m.updateQueue=null}function qr(m,v,T){for(T=T.child;T!==null;)uo(m,v,T),T=T.sibling}function uo(m,v,T){if(rl&&typeof rl.onCommitFiberUnmount=="function")try{rl.onCommitFiberUnmount(my,T)}catch{}switch(T.tag){case 26:if(zl){fa||Wn(T,v),qr(m,v,T),T.memoizedState?B9(T.memoizedState):T.stateNode&&j9(T.stateNode);break}case 27:if(Ys){fa||Wn(T,v);var O=Ea,U=sl;Ea=T.stateNode,qr(m,v,T),pre(T.stateNode),Ea=O,sl=U;break}case 5:fa||Wn(T,v);case 6:if(Ks){if(O=Ea,U=sl,Ea=null,qr(m,v,T),Ea=O,sl=U,Ea!==null)if(sl)try{Nie(Ea,T.stateNode)}catch(q){dr(T,v,q)}else try{Iie(Ea,T.stateNode)}catch(q){dr(T,v,q)}}else qr(m,v,T);break;case 18:Ks&&Ea!==null&&(sl?rre(Ea,T.stateNode):ire(Ea,T.stateNode));break;case 4:Ks?(O=Ea,U=sl,Ea=T.stateNode.containerInfo,sl=!0,qr(m,v,T),Ea=O,sl=U):(Ph&&Zi(T.stateNode,T,C9()),qr(m,v,T));break;case 0:case 11:case 14:case 15:fa||Qt(2,T,v),fa||Qt(4,T,v),qr(m,v,T);break;case 1:fa||(Wn(T,v),O=T.stateNode,typeof O.componentWillUnmount=="function"&&Fn(T,v,O)),qr(m,v,T);break;case 21:qr(m,v,T);break;case 22:fa||Wn(T,v),fa=(O=fa)||T.memoizedState!==null,qr(m,v,T),fa=O;break;default:qr(m,v,T)}}function Qo(m,v){if(Bl&&v.memoizedState===null&&(m=v.alternate,m!==null&&(m=m.memoizedState,m!==null&&(m=m.dehydrated,m!==null))))try{nre(m)}catch(T){dr(v,v.return,T)}}function fo(m){switch(m.tag){case 13:case 19:var v=m.stateNode;return v===null&&(v=m.stateNode=new $9),v;case 22:return m=m.stateNode,v=m._retryCache,v===null&&(v=m._retryCache=new $9),v;default:throw Error(r(435,m.tag))}}function Xs(m,v){var T=fo(m);v.forEach(function(O){var U=Xne.bind(null,m,O);T.has(O)||(T.add(O),O.then(U,U))})}function kr(m,v){var T=v.deletions;if(T!==null)for(var O=0;O<T.length;O++){var U=T[O],q=m,be=v;if(Ks){var Be=be;e:for(;Be!==null;){switch(Be.tag){case 27:case 5:Ea=Be.stateNode,sl=!1;break e;case 3:Ea=Be.stateNode.containerInfo,sl=!0;break e;case 4:Ea=Be.stateNode.containerInfo,sl=!0;break e}Be=Be.return}if(Ea===null)throw Error(r(160));uo(q,be,U),Ea=null,sl=!1}else uo(q,be,U);q=U.alternate,q!==null&&(q.return=null),U.return=null}if(v.subtreeFlags&13878)for(v=v.child;v!==null;)el(v,m),v=v.sibling}function el(m,v){var T=m.alternate,O=m.flags;switch(m.tag){case 0:case 11:case 14:case 15:kr(v,m),hr(m),O&4&&(Qt(3,m,m.return),en(3,m),Qt(5,m,m.return));break;case 1:kr(v,m),hr(m),O&512&&(fa||T===null||Wn(T,T.return)),O&64&&Rf&&(m=m.updateQueue,m!==null&&(O=m.callbacks,O!==null&&(T=m.shared.hiddenCallbacks,m.shared.hiddenCallbacks=T===null?O:T.concat(O))));break;case 26:if(zl){var U=Gc;kr(v,m),hr(m),O&512&&(fa||T===null||Wn(T,T.return)),O&4&&(O=T!==null?T.memoizedState:null,v=m.memoizedState,T===null?v===null?m.stateNode===null?m.stateNode=ore(U,m.type,m.memoizedProps,m):z9(U,m.type,m.stateNode):m.stateNode=F9(U,v,m.memoizedProps):O!==v?(O===null?T.stateNode!==null&&j9(T.stateNode):B9(O),v===null?z9(U,m.type,m.stateNode):F9(U,v,m.memoizedProps)):v===null&&m.stateNode!==null&&Rn(m,m.memoizedProps,T.memoizedProps));break}case 27:if(Ys&&O&4&&m.alternate===null){U=m.stateNode;var q=m.memoizedProps;try{hre(U),dre(m.type,q,U,m)}catch(qt){dr(m,m.return,qt)}}case 5:if(kr(v,m),hr(m),O&512&&(fa||T===null||Wn(T,T.return)),Ks){if(m.flags&32){v=m.stateNode;try{A9(v)}catch(qt){dr(m,m.return,qt)}}O&4&&m.stateNode!=null&&(v=m.memoizedProps,Rn(m,v,T!==null?T.memoizedProps:v)),O&1024&&(WR=!0)}break;case 6:if(kr(v,m),hr(m),O&4&&Ks){if(m.stateNode===null)throw Error(r(162));O=m.memoizedProps,T=T!==null?T.memoizedProps:O,v=m.stateNode;try{Cie(v,T,O)}catch(qt){dr(m,m.return,qt)}}break;case 3:if(zl?(cre(),U=Gc,Gc=DR(v.containerInfo),kr(v,m),Gc=U):kr(v,m),hr(m),O&4){if(Ks&&Bl&&T!==null&&T.memoizedState.isDehydrated)try{tre(v.containerInfo)}catch(qt){dr(m,m.return,qt)}if(Ph){O=v.containerInfo,T=v.pendingChildren;try{k9(O,T)}catch(qt){dr(m,m.return,qt)}}}WR&&(WR=!1,qs(m));break;case 4:zl?(T=Gc,Gc=DR(m.stateNode.containerInfo),kr(v,m),hr(m),Gc=T):(kr(v,m),hr(m)),O&4&&Ph&&Zi(m.stateNode,m,m.stateNode.pendingChildren);break;case 12:kr(v,m),hr(m);break;case 13:kr(v,m),hr(m),m.child.flags&8192&&m.memoizedState!==null!=(T!==null&&T.memoizedState!==null)&&(YR=Hc()),O&4&&(O=m.updateQueue,O!==null&&(m.updateQueue=null,Xs(m,O)));break;case 22:O&512&&(fa||T===null||Wn(T,T.return)),U=m.memoizedState!==null;var be=T!==null&&T.memoizedState!==null,Be=Rf,nt=fa;if(Rf=Be||U,fa=nt||be,kr(v,m),fa=nt,Rf=Be,hr(m),v=m.stateNode,v._current=m,v._visibility&=-3,v._visibility|=v._pendingVisibility&2,O&8192&&(v._visibility=U?v._visibility&-2:v._visibility|1,U&&(v=Rf||fa,T===null||be||v||ca(m)),Ks&&(m.memoizedProps===null||m.memoizedProps.mode!=="manual"))){e:if(T=null,Ks)for(v=m;;){if(v.tag===5||zl&&v.tag===26||Ys&&v.tag===27){if(T===null){be=T=v;try{q=be.stateNode,U?Lie(q):Uie(be.stateNode,be.memoizedProps)}catch(qt){dr(be,be.return,qt)}}}else if(v.tag===6){if(T===null){be=v;try{var Rt=be.stateNode;U?Pie(Rt):Fie(Rt,be.memoizedProps)}catch(qt){dr(be,be.return,qt)}}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===m)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break e;for(;v.sibling===null;){if(v.return===null||v.return===m)break e;T===v&&(T=null),v=v.return}T===v&&(T=null),v.sibling.return=v.return,v=v.sibling}}O&4&&(O=m.updateQueue,O!==null&&(T=O.retryQueue,T!==null&&(O.retryQueue=null,Xs(m,T))));break;case 19:kr(v,m),hr(m),O&4&&(O=m.updateQueue,O!==null&&(m.updateQueue=null,Xs(m,O)));break;case 21:break;default:kr(v,m),hr(m)}}function hr(m){var v=m.flags;if(v&2){try{if(Ks&&(!Ys||m.tag!==27)){e:{for(var T=m.return;T!==null;){if(yn(T)){var O=T;break e}T=T.return}throw Error(r(160))}switch(O.tag){case 27:if(Ys){var U=O.stateNode,q=fr(m);ia(m,q,U);break}case 5:var be=O.stateNode;O.flags&32&&(A9(be),O.flags&=-33);var Be=fr(m);ia(m,Be,be);break;case 3:case 4:var nt=O.stateNode.containerInfo,Rt=fr(m);Rr(m,Rt,nt);break;default:throw Error(r(161))}}}catch(qt){dr(m,m.return,qt)}m.flags&=-3}v&4096&&(m.flags&=-4097)}function qs(m){if(m.subtreeFlags&1024)for(m=m.child;m!==null;){var v=m;qs(v),v.tag===5&&v.flags&1024&&bie(v.stateNode),m=m.sibling}}function ms(m,v){if(v.subtreeFlags&8772)for(v=v.child;v!==null;)Ws(m,v.alternate,v),v=v.sibling}function ca(m){for(m=m.child;m!==null;){var v=m;switch(v.tag){case 0:case 11:case 14:case 15:Qt(4,v,v.return),ca(v);break;case 1:Wn(v,v.return);var T=v.stateNode;typeof T.componentWillUnmount=="function"&&Fn(v,v.return,T),ca(v);break;case 26:case 27:case 5:Wn(v,v.return),ca(v);break;case 22:Wn(v,v.return),v.memoizedState===null&&ca(v);break;default:ca(v)}m=m.sibling}}function jc(m,v,T){for(T=T&&(v.subtreeFlags&8772)!==0,v=v.child;v!==null;){var O=v.alternate,U=m,q=v,be=q.flags;switch(q.tag){case 0:case 11:case 15:jc(U,q,T),en(4,q);break;case 1:if(jc(U,q,T),O=q,U=O.stateNode,typeof U.componentDidMount=="function")try{U.componentDidMount()}catch(Rt){dr(O,O.return,Rt)}if(O=q,U=O.updateQueue,U!==null){var Be=O.stateNode;try{var nt=U.shared.hiddenCallbacks;if(nt!==null)for(U.shared.hiddenCallbacks=null,U=0;U<nt.length;U++)ke(nt[U],Be)}catch(Rt){dr(O,O.return,Rt)}}T&&be&64&&fn(q),mi(q,q.return);break;case 26:case 27:case 5:jc(U,q,T),T&&O===null&&be&4&&ui(q),mi(q,q.return);break;case 12:jc(U,q,T);break;case 13:jc(U,q,T),T&&be&4&&Qo(U,q);break;case 22:q.memoizedState===null&&jc(U,q,T),mi(q,q.return);break;default:jc(U,q,T)}v=v.sibling}}function rR(m,v){var T=null;m!==null&&m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),m=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(m=v.memoizedState.cachePool.pool),m!==T&&(m!=null&&m.refCount++,T!=null&&Ln(T))}function aR(m,v){m=null,v.alternate!==null&&(m=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==m&&(v.refCount++,m!=null&&Ln(m))}function Oh(m,v,T,O){if(v.subtreeFlags&10256)for(v=v.child;v!==null;)H4(m,v,T,O),v=v.sibling}function H4(m,v,T,O){var U=v.flags;switch(v.tag){case 0:case 11:case 15:Oh(m,v,T,O),U&2048&&en(9,v);break;case 3:Oh(m,v,T,O),U&2048&&(m=null,v.alternate!==null&&(m=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==m&&(v.refCount++,m!=null&&Ln(m)));break;case 12:if(U&2048){Oh(m,v,T,O),m=v.stateNode;try{var q=v.memoizedProps,be=q.id,Be=q.onPostCommit;typeof Be=="function"&&Be(be,v.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(nt){dr(v,v.return,nt)}}else Oh(m,v,T,O);break;case 23:break;case 22:q=v.stateNode,v.memoizedState!==null?q._visibility&4?Oh(m,v,T,O):uy(m,v):q._visibility&4?Oh(m,v,T,O):(q._visibility|=4,xg(m,v,T,O,(v.subtreeFlags&10256)!==0)),U&2048&&rR(v.alternate,v);break;case 24:Oh(m,v,T,O),U&2048&&aR(v.alternate,v);break;default:Oh(m,v,T,O)}}function xg(m,v,T,O,U){for(U=U&&(v.subtreeFlags&10256)!==0,v=v.child;v!==null;){var q=m,be=v,Be=T,nt=O,Rt=be.flags;switch(be.tag){case 0:case 11:case 15:xg(q,be,Be,nt,U),en(8,be);break;case 23:break;case 22:var qt=be.stateNode;be.memoizedState!==null?qt._visibility&4?xg(q,be,Be,nt,U):uy(q,be):(qt._visibility|=4,xg(q,be,Be,nt,U)),U&&Rt&2048&&rR(be.alternate,be);break;case 24:xg(q,be,Be,nt,U),U&&Rt&2048&&aR(be.alternate,be);break;default:xg(q,be,Be,nt,U)}v=v.sibling}}function uy(m,v){if(v.subtreeFlags&10256)for(v=v.child;v!==null;){var T=m,O=v,U=O.flags;switch(O.tag){case 22:uy(T,O),U&2048&&rR(O.alternate,O);break;case 24:uy(T,O),U&2048&&aR(O.alternate,O);break;default:uy(T,O)}v=v.sibling}}function up(m){if(m.subtreeFlags&zg)for(m=m.child;m!==null;)V4(m),m=m.sibling}function V4(m){switch(m.tag){case 26:up(m),m.flags&zg&&(m.memoizedState!==null?fre(Gc,m.memoizedState,m.memoizedProps):T9(m.type,m.memoizedProps));break;case 5:up(m),m.flags&zg&&T9(m.type,m.memoizedProps);break;case 3:case 4:if(zl){var v=Gc;Gc=DR(m.stateNode.containerInfo),up(m),Gc=v}else up(m);break;case 22:m.memoizedState===null&&(v=m.alternate,v!==null&&v.memoizedState!==null?(v=zg,zg=16777216,up(m),zg=v):up(m));break;default:up(m)}}function G4(m){var v=m.alternate;if(v!==null&&(m=v.child,m!==null)){v.child=null;do v=m.sibling,m.sibling=null,m=v;while(m!==null)}}function fy(m){var v=m.deletions;if(m.flags&16){if(v!==null)for(var T=0;T<v.length;T++){var O=v[T];$a=O,X4(O,m)}G4(m)}if(m.subtreeFlags&10256)for(m=m.child;m!==null;)W4(m),m=m.sibling}function W4(m){switch(m.tag){case 0:case 11:case 15:fy(m),m.flags&2048&&Qt(9,m,m.return);break;case 3:fy(m);break;case 12:fy(m);break;case 22:var v=m.stateNode;m.memoizedState!==null&&v._visibility&4&&(m.return===null||m.return.tag!==13)?(v._visibility&=-5,fS(m)):fy(m);break;default:fy(m)}}function fS(m){var v=m.deletions;if(m.flags&16){if(v!==null)for(var T=0;T<v.length;T++){var O=v[T];$a=O,X4(O,m)}G4(m)}for(m=m.child;m!==null;){switch(v=m,v.tag){case 0:case 11:case 15:Qt(8,v,v.return),fS(v);break;case 22:T=v.stateNode,T._visibility&4&&(T._visibility&=-5,fS(v));break;default:fS(v)}m=m.sibling}}function X4(m,v){for(;$a!==null;){var T=$a;switch(T.tag){case 0:case 11:case 15:Qt(8,T,v);break;case 23:case 22:if(T.memoizedState!==null&&T.memoizedState.cachePool!==null){var O=T.memoizedState.cachePool.pool;O!=null&&O.refCount++}break;case 24:Ln(T.memoizedState.cache)}if(O=T.child,O!==null)O.return=T,$a=O;else e:for(T=m;$a!==null;){O=$a;var U=O.sibling,q=O.return;if(Ya(O),O===T){$a=null;break e}if(U!==null){U.return=q,$a=U;break e}$a=q}}}function sR(m){var v=E9(m);if(v!=null){if(typeof v.memoizedProps["data-testname"]!="string")throw Error(r(364));return v}if(m=xie(m),m===null)throw Error(r(362));return m.stateNode.current}function oR(m,v){var T=m.tag;switch(v.$$typeof){case kS:if(m.type===v.value)return!0;break;case DS:e:{for(v=v.value,m=[m,0],T=0;T<m.length;){var O=m[T++],U=O.tag,q=m[T++],be=v[q];if(U!==5&&U!==26&&U!==27||!py(O)){for(;be!=null&&oR(O,be);)q++,be=v[q];if(q===v.length){v=!0;break e}else for(O=O.child;O!==null;)m.push(O,q),O=O.sibling}}v=!1}return v;case OS:if((T===5||T===26||T===27)&&wie(m.stateNode,v.value))return!0;break;case NS:if((T===5||T===6||T===26||T===27)&&(m=Sie(m),m!==null&&0<=m.indexOf(v.value)))return!0;break;case IS:if((T===5||T===26||T===27)&&(m=m.memoizedProps["data-testname"],typeof m=="string"&&m.toLowerCase()===v.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function lR(m){switch(m.$$typeof){case kS:return"<"+(s(m.value)||"Unknown")+">";case DS:return":has("+(lR(m)||"")+")";case OS:return'[role="'+m.value+'"]';case NS:return'"'+m.value+'"';case IS:return'[data-testname="'+m.value+'"]';default:throw Error(r(365))}}function q4(m,v){var T=[];m=[m,0];for(var O=0;O<m.length;){var U=m[O++],q=U.tag,be=m[O++],Be=v[be];if(q!==5&&q!==26&&q!==27||!py(U)){for(;Be!=null&&oR(U,Be);)be++,Be=v[be];if(be===v.length)T.push(U);else for(U=U.child;U!==null;)m.push(U,be),U=U.sibling}}return T}function cR(m,v){if(!dy)throw Error(r(363));m=sR(m),m=q4(m,v),v=[],m=Array.from(m);for(var T=0;T<m.length;){var O=m[T++],U=O.tag;if(U===5||U===26||U===27)py(O)||v.push(O.stateNode);else for(O=O.child;O!==null;)m.push(O),O=O.sibling}return v}function tl(){if(yr&2&&Fi!==0)return Fi&-Fi;if(Kn.T!==null){var m=Ig;return m!==0?m:me()}return fie()}function K4(){Wl===0&&(Wl=!(Fi&536870912)||Wi?C():536870912);var m=Gl.current;return m!==null&&(m.flags|=32),Wl}function ho(m,v,T){(m===Dr&&Or===2||m.cancelPendingCommit!==null)&&(_g(m,0),Ef(m,Fi,Wl,!1)),N(m,T),(!(yr&2)||m!==Dr)&&(m===Dr&&(!(yr&2)&&(Sp|=T),ha===4&&Ef(m,Fi,Wl,!1)),Ne(m))}function Y4(m,v,T){if(yr&6)throw Error(r(327));var O=!T&&(v&60)===0&&(v&m.expiredLanes)===0||S(m,v),U=O?jne(m,v):dR(m,v,!0),q=O;do{if(U===0){jg&&!O&&Ef(m,v,0,!1);break}else if(U===6)Ef(m,v,0,!kf);else{if(T=m.current.alternate,q&&!Bne(T)){U=dR(m,v,!1),q=!1;continue}if(U===2){if(q=v,m.errorRecoveryDisabledLanes&q)var be=0;else be=m.pendingLanes&-536870913,be=be!==0?be:be&536870912?536870912:0;if(be!==0){v=be;e:{var Be=m;U=Sy;var nt=Bl&&Be.current.memoizedState.isDehydrated;if(nt&&(_g(Be,be).flags|=256),be=dR(Be,be,!1),be!==2){if(XR&&!nt){Be.errorRecoveryDisabledLanes|=q,Sp|=q,U=4;break e}q=Iu,Iu=U,q!==null&&uR(q)}U=be}if(q=!1,U!==2)continue}}if(U===1){_g(m,0),Ef(m,v,0,!0);break}e:{switch(O=m,U){case 0:case 1:throw Error(r(345));case 4:if((v&4194176)===v){Ef(O,v,Wl,!kf);break e}break;case 2:Iu=null;break;case 3:case 5:break;default:throw Error(r(329))}if(O.finishedWork=T,O.finishedLanes=v,(v&62914560)===v&&(q=YR+300-Hc(),10<q)){if(Ef(O,v,Wl,!kf),M(O,0)!==0)break e;O.timeoutHandle=lie(J4.bind(null,O,T,Iu,LS,KR,v,Wl,Sp,Hg,kf,2,-0,0),q);break e}J4(O,T,Iu,LS,KR,v,Wl,Sp,Hg,kf,0,-0,0)}}break}while(!0);Ne(m)}function uR(m){Iu===null?Iu=m:Iu.push.apply(Iu,m)}function J4(m,v,T,O,U,q,be,Be,nt,Rt,qt,sn,cn){var ei=v.subtreeFlags;if((ei&8192||(ei&16785408)===16785408)&&(mie(),V4(v),v=gie(),v!==null)){m.cancelPendingCommit=v(a9.bind(null,m,T,O,U,be,Be,nt,1,sn,cn)),Ef(m,q,be,!Rt);return}a9(m,T,O,U,be,Be,nt,qt,sn,cn)}function Bne(m){for(var v=m;;){var T=v.tag;if((T===0||T===11||T===15)&&v.flags&16384&&(T=v.updateQueue,T!==null&&(T=T.stores,T!==null)))for(var O=0;O<T.length;O++){var U=T[O],q=U.getSnapshot;U=U.value;try{if(!al(q(),U))return!1}catch{return!1}}if(T=v.child,v.subtreeFlags&16384&&T!==null)T.return=v,v=T;else{if(v===m)break;for(;v.sibling===null;){if(v.return===null||v.return===m)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function Ef(m,v,T,O){v&=~qR,v&=~Sp,m.suspendedLanes|=v,m.pingedLanes&=~v,O&&(m.warmLanes|=v),O=m.expirationTimes;for(var U=v;0<U;){var q=31-il(U),be=1<<q;O[q]=-1,U&=~be}T!==0&&j(m,T,v)}function $4(){return yr&6?!0:(Fe(0),!1)}function fR(){if(Ai!==null){if(Or===0)var m=Ai.return;else m=Ai,Cf=xp=null,ee(m),Pg=null,yy=0,m=Ai;for(;m!==null;)Gt(m.alternate,m),m=m.return;Ai=null}}function _g(m,v){m.finishedWork=null,m.finishedLanes=0;var T=m.timeoutHandle;T!==CR&&(m.timeoutHandle=CR,cie(T)),T=m.cancelPendingCommit,T!==null&&(m.cancelPendingCommit=null,T()),fR(),Dr=m,Ai=T=Ih(m.current,null),Fi=v,Or=0,ol=null,kf=!1,jg=S(m,v),XR=!1,Hg=Wl=qR=Sp=jh=ha=0,Iu=Sy=null,KR=!1,v&8&&(v|=v&32);var O=m.entangledLanes;if(O!==0)for(m=m.entanglements,O&=v;0<O;){var U=31-il(O),q=1<<U;v|=m[U],O&=~q}return Df=v,ze(),T}function Z4(m,v){gi=null,Kn.H=Ou,v===vy?(v=bt(),Or=3):v===jR?(v=bt(),Or=4):Or=v===Y9?8:v!==null&&typeof v=="object"&&typeof v.then=="function"?6:1,ol=v,Ai===null&&(ha=1,Ia(m,W(v,m.current)))}function Q4(){var m=Gl.current;return m===null?!0:(Fi&4194176)===Fi?Du===null:(Fi&62914560)===Fi||Fi&536870912?m===Du:!1}function e9(){var m=Kn.H;return Kn.H=Ou,m===null?Ou:m}function t9(){var m=Kn.A;return Kn.A=Cre,m}function hR(){ha=4,kf||(Fi&4194176)!==Fi&&Gl.current!==null||(jg=!0),!(jh&134217727)&&!(Sp&134217727)||Dr===null||Ef(Dr,Fi,Wl,!1)}function dR(m,v,T){var O=yr;yr|=2;var U=e9(),q=t9();(Dr!==m||Fi!==v)&&(LS=null,_g(m,v)),v=!1;var be=ha;e:do try{if(Or!==0&&Ai!==null){var Be=Ai,nt=ol;switch(Or){case 8:fR(),be=6;break e;case 3:case 2:case 6:Gl.current===null&&(v=!0);var Rt=Or;if(Or=0,ol=null,Sg(m,Be,nt,Rt),T&&jg){be=0;break e}break;default:Rt=Or,Or=0,ol=null,Sg(m,Be,nt,Rt)}}zne(),be=ha;break}catch(qt){Z4(m,qt)}while(!0);return v&&m.shellSuspendCounter++,Cf=xp=null,yr=O,Kn.H=U,Kn.A=q,Ai===null&&(Dr=null,Fi=0,ze()),be}function zne(){for(;Ai!==null;)n9(Ai)}function jne(m,v){var T=yr;yr|=2;var O=e9(),U=t9();Dr!==m||Fi!==v?(LS=null,wy=Hc()+500,_g(m,v)):jg=S(m,v);e:do try{if(Or!==0&&Ai!==null){v=Ai;var q=ol;t:switch(Or){case 1:Or=0,ol=null,Sg(m,v,q,1);break;case 2:if(jt(q)){Or=0,ol=null,i9(v);break}v=function(){Or===2&&Dr===m&&(Or=7),Ne(m)},q.then(v,v);break e;case 3:Or=7;break e;case 4:Or=5;break e;case 7:jt(q)?(Or=0,ol=null,i9(v)):(Or=0,ol=null,Sg(m,v,q,7));break;case 5:var be=null;switch(Ai.tag){case 26:be=Ai.memoizedState;case 5:case 27:var Be=Ai,nt=Be.type,Rt=Be.pendingProps;if(be?H9(be):M9(nt,Rt)){Or=0,ol=null;var qt=Be.sibling;if(qt!==null)Ai=qt;else{var sn=Be.return;sn!==null?(Ai=sn,hS(sn)):Ai=null}break t}}Or=0,ol=null,Sg(m,v,q,5);break;case 6:Or=0,ol=null,Sg(m,v,q,6);break;case 8:fR(),ha=6;break e;default:throw Error(r(462))}}Hne();break}catch(cn){Z4(m,cn)}while(!0);return Cf=xp=null,Kn.H=O,Kn.A=U,yr=T,Ai!==null?0:(Dr=null,Fi=0,ze(),ha)}function Hne(){for(;Ai!==null&&!bre();)n9(Ai)}function n9(m){var v=ne(m.alternate,m,Df);m.memoizedProps=m.pendingProps,v===null?hS(m):Ai=v}function i9(m){var v=m,T=v.alternate;switch(v.tag){case 15:case 0:v=qa(T,v,v.pendingProps,v.type,void 0,Fi);break;case 11:v=qa(T,v,v.pendingProps,v.type.render,v.ref,Fi);break;case 5:ee(v);default:Gt(T,v),v=Ai=c9(v,Df),v=ne(T,v,Df)}m.memoizedProps=m.pendingProps,v===null?hS(m):Ai=v}function Sg(m,v,T,O){Cf=xp=null,ee(v),Pg=null,yy=0;var U=v.return;try{if(op(m,U,v,T,Fi)){ha=1,Ia(m,W(T,m.current)),Ai=null;return}}catch(q){if(U!==null)throw Ai=U,q;ha=1,Ia(m,W(T,m.current)),Ai=null;return}v.flags&32768?(Wi||O===1?m=!0:jg||Fi&536870912?m=!1:(kf=m=!0,(O===2||O===3||O===6)&&(O=Gl.current,O!==null&&O.tag===13&&(O.flags|=16384))),r9(v,m)):hS(v)}function hS(m){var v=m;do{if(v.flags&32768){r9(v,kf);return}m=v.return;var T=Ct(v.alternate,v,Df);if(T!==null){Ai=T;return}if(v=v.sibling,v!==null){Ai=v;return}Ai=v=m}while(v!==null);ha===0&&(ha=5)}function r9(m,v){do{var T=Ft(m.alternate,m);if(T!==null){T.flags&=32767,Ai=T;return}if(T=m.return,T!==null&&(T.flags|=32768,T.subtreeFlags=0,T.deletions=null),!v&&(m=m.sibling,m!==null)){Ai=m;return}Ai=m=T}while(m!==null);ha=6,Ai=null}function a9(m,v,T,O,U,q,be,Be,nt,Rt){var qt=Kn.T,sn=dp();try{Do(2),Kn.T=null,Vne(m,v,T,O,sn,U,q,be,Be,nt,Rt)}finally{Kn.T=qt,Do(sn)}}function Vne(m,v,T,O,U,q,be,Be){do fp();while(wp!==null);if(yr&6)throw Error(r(327));var nt=m.finishedWork;if(O=m.finishedLanes,nt===null)return null;if(m.finishedWork=null,m.finishedLanes=0,nt===m.current)throw Error(r(177));m.callbackNode=null,m.callbackPriority=0,m.cancelPendingCommit=null;var Rt=nt.lanes|nt.childLanes;if(Rt|=PR,P(m,O,Rt,q,be,Be),m===Dr&&(Ai=Dr=null,Fi=0),!(nt.subtreeFlags&10256)&&!(nt.flags&10256)||PS||(PS=!0,JR=Rt,$R=T,qne(NR,function(){return fp(),null})),T=(nt.flags&15990)!==0,nt.subtreeFlags&15990||T?(T=Kn.T,Kn.T=null,q=dp(),Do(2),be=yr,yr|=4,Xr(m,nt),el(nt,m),sie(m.containerInfo),m.current=nt,Ws(m,nt.alternate,nt),vre(),yr=be,Do(q),Kn.T=T):m.current=nt,PS?(PS=!1,wp=m,Ey=O):s9(m,Rt),Rt=m.pendingLanes,Rt===0&&(Hh=null),F(nt.stateNode),Ne(m),v!==null)for(U=m.onRecoverableError,nt=0;nt<v.length;nt++)Rt=v[nt],U(Rt.value,{componentStack:Rt.stack});return Ey&3&&fp(),Rt=m.pendingLanes,O&4194218&&Rt&42?m===ZR?My++:(My=0,ZR=m):My=0,Fe(0),null}function s9(m,v){(m.pooledCacheLanes&=v)===0&&(v=m.pooledCache,v!=null&&(m.pooledCache=null,Ln(v)))}function fp(){if(wp!==null){var m=wp,v=JR;JR=0;var T=X(Ey),O=32>T?32:T;T=Kn.T;var U=dp();try{if(Do(O),Kn.T=null,wp===null)var q=!1;else{O=$R,$R=null;var be=wp,Be=Ey;if(wp=null,Ey=0,yr&6)throw Error(r(331));var nt=yr;if(yr|=4,W4(be.current),H4(be,be.current,Be,O),yr=nt,Fe(0,!1),rl&&typeof rl.onPostCommitFiberRoot=="function")try{rl.onPostCommitFiberRoot(my,be)}catch{}q=!0}return q}finally{Do(U),Kn.T=T,s9(m,v)}}return!1}function o9(m,v,T){v=W(T,v),v=Jo(m.stateNode,v,2),m=Ye(m,v,2),m!==null&&(N(m,2),Ne(m))}function dr(m,v,T){if(m.tag===3)o9(m,m,T);else for(;v!==null;){if(v.tag===3){o9(v,m,T);break}else if(v.tag===1){var O=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof O.componentDidCatch=="function"&&(Hh===null||!Hh.has(O))){m=W(T,m),T=Na(2),O=Ye(v,T,2),O!==null&&(sr(T,O,v,m),N(O,2),Ne(O));break}}v=v.return}}function pR(m,v,T){var O=m.pingCache;if(O===null){O=m.pingCache=new Rre;var U=new Set;O.set(v,U)}else U=O.get(v),U===void 0&&(U=new Set,O.set(v,U));U.has(T)||(XR=!0,U.add(T),m=Gne.bind(null,m,v,T),v.then(m,m))}function Gne(m,v,T){var O=m.pingCache;O!==null&&O.delete(v),m.pingedLanes|=m.suspendedLanes&T,m.warmLanes&=~T,Dr===m&&(Fi&T)===T&&(ha===4||ha===3&&(Fi&62914560)===Fi&&300>Hc()-YR?!(yr&2)&&_g(m,0):qR|=T,Hg===Fi&&(Hg=0)),Ne(m)}function l9(m,v){v===0&&(v=k()),m=we(m,v),m!==null&&(N(m,v),Ne(m))}function Wne(m){var v=m.memoizedState,T=0;v!==null&&(T=v.retryLane),l9(m,T)}function Xne(m,v){var T=0;switch(m.tag){case 13:var O=m.stateNode,U=m.memoizedState;U!==null&&(T=U.retryLane);break;case 19:O=m.stateNode;break;case 22:O=m.stateNode._retryCache;break;default:throw Error(r(314))}O!==null&&O.delete(v),l9(m,T)}function qne(m,v){return yS(m,v)}function Kne(m,v,T,O){this.tag=m,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=v,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=O,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mR(m){return m=m.prototype,!(!m||!m.isReactComponent)}function Ih(m,v){var T=m.alternate;return T===null?(T=n(m.tag,v,m.key,m.mode),T.elementType=m.elementType,T.type=m.type,T.stateNode=m.stateNode,T.alternate=m,m.alternate=T):(T.pendingProps=v,T.type=m.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=m.flags&31457280,T.childLanes=m.childLanes,T.lanes=m.lanes,T.child=m.child,T.memoizedProps=m.memoizedProps,T.memoizedState=m.memoizedState,T.updateQueue=m.updateQueue,v=m.dependencies,T.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},T.sibling=m.sibling,T.index=m.index,T.ref=m.ref,T.refCleanup=m.refCleanup,T}function c9(m,v){m.flags&=31457282;var T=m.alternate;return T===null?(m.childLanes=0,m.lanes=v,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=T.childLanes,m.lanes=T.lanes,m.child=T.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=T.memoizedProps,m.memoizedState=T.memoizedState,m.updateQueue=T.updateQueue,m.type=T.type,v=T.dependencies,m.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),m}function dS(m,v,T,O,U,q){var be=0;if(O=m,typeof m=="function")mR(m)&&(be=1);else if(typeof m=="string")be=zl&&Ys?P9(m,T,gs.current)?26:G9(m)?27:5:zl?P9(m,T,gs.current)?26:5:Ys&&G9(m)?27:5;else e:switch(m){case Eg:return hp(T.children,U,q,v);case g9:be=8,U|=24;break;case xR:return m=n(12,T,v,U|2),m.elementType=xR,m.lanes=q,m;case SR:return m=n(13,T,v,U),m.elementType=SR,m.lanes=q,m;case wR:return m=n(19,T,v,U),m.elementType=wR,m.lanes=q,m;case v9:return u9(T,U,q,v);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case Zne:case Nh:be=10;break e;case b9:be=9;break e;case _R:be=11;break e;case ER:be=14;break e;case Lh:be=16,O=null;break e}be=29,T=Error(r(130,m===null?"null":typeof m,"")),O=null}return v=n(be,T,v,U),v.elementType=m,v.type=O,v.lanes=q,v}function hp(m,v,T,O){return m=n(7,m,O,v),m.lanes=T,m}function u9(m,v,T,O){m=n(22,m,O,v),m.elementType=v9,m.lanes=T;var U={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var q=U._current;if(q===null)throw Error(r(456));if(!(U._pendingVisibility&2)){var be=we(q,2);be!==null&&(U._pendingVisibility|=2,ho(be,q,2))}},attach:function(){var q=U._current;if(q===null)throw Error(r(456));if(U._pendingVisibility&2){var be=we(q,2);be!==null&&(U._pendingVisibility&=-3,ho(be,q,2))}}};return m.stateNode=U,m}function gR(m,v,T){return m=n(6,m,null,v),m.lanes=T,m}function bR(m,v,T){return v=n(4,m.children!==null?m.children:[],m.key,v),v.lanes=T,v.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},v}function Yne(m,v,T,O,U,q,be,Be){this.tag=1,this.containerInfo=m,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=CR,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=R(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R(0),this.hiddenUpdates=R(null),this.identifierPrefix=O,this.onUncaughtError=U,this.onCaughtError=q,this.onRecoverableError=be,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Be,this.incompleteTransitions=new Map}function f9(m,v,T,O,U,q,be,Be,nt,Rt,qt,sn){return m=new Yne(m,v,T,be,Be,nt,Rt,sn),v=1,q===!0&&(v|=24),q=n(3,null,null,v),m.current=q,q.stateNode=m,v=Jn(),v.refCount++,m.pooledCache=v,v.refCount++,q.memoizedState={element:O,isDehydrated:T,cache:v},mt(q),m}function h9(m){return m?(m=Ag,m):Ag}function d9(m){var v=m._reactInternals;if(v===void 0)throw typeof m.render=="function"?Error(r(188)):(m=Object.keys(m).join(","),Error(r(268,m)));return m=d(v),m=m!==null?g(m):null,m===null?null:hy(m.stateNode)}function p9(m,v,T,O,U,q){U=h9(U),O.context===null?O.context=U:O.pendingContext=U,O=Je(v),O.payload={element:T},q=q===void 0?null:q,q!==null&&(O.callback=q),T=Ye(m,O,v),T!==null&&(ho(T,m,v),vt(T,m,v))}function m9(m,v){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var T=m.retryLane;m.retryLane=T!==0&&T<v?T:v}}function vR(m,v){m9(m,v),(m=m.alternate)&&m9(m,v)}var Ti={},Jne=I,nl=cI,yR=Object.assign,$ne=Symbol.for("react.element"),pS=Symbol.for("react.transitional.element"),wg=Symbol.for("react.portal"),Eg=Symbol.for("react.fragment"),g9=Symbol.for("react.strict_mode"),xR=Symbol.for("react.profiler"),Zne=Symbol.for("react.provider"),b9=Symbol.for("react.consumer"),Nh=Symbol.for("react.context"),_R=Symbol.for("react.forward_ref"),SR=Symbol.for("react.suspense"),wR=Symbol.for("react.suspense_list"),ER=Symbol.for("react.memo"),Lh=Symbol.for("react.lazy"),v9=Symbol.for("react.offscreen"),Qne=Symbol.for("react.memo_cache_sentinel"),y9=Symbol.iterator,eie=Symbol.for("react.client.reference"),Kn=Jne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,MR,x9,TR=!1,mS=Array.isArray,tie=e.rendererVersion,nie=e.rendererPackageName,_9=e.extraDevToolsConfig,hy=e.getPublicInstance,iie=e.getRootHostContext,rie=e.getChildHostContext,aie=e.prepareForCommit,sie=e.resetAfterCommit,oie=e.createInstance,AR=e.appendInitialChild,S9=e.finalizeInitialChildren,gS=e.shouldSetTextContent,w9=e.createTextInstance,lie=e.scheduleTimeout,cie=e.cancelTimeout,CR=e.noTimeout,Mf=e.isPrimaryRenderer;e.warnsIfNotActing;var Ks=e.supportsMutation,Ph=e.supportsPersistence,Bl=e.supportsHydration,E9=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var uie=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Do=e.setCurrentUpdatePriority,dp=e.getCurrentUpdatePriority,fie=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var hie=e.shouldAttemptEagerTransition,die=e.detachDeletedInstance;e.requestPostPaintCallback;var pie=e.maySuspendCommit,M9=e.preloadInstance,mie=e.startSuspendingCommit,T9=e.suspendInstance,gie=e.waitForCommitToBeReady,Mg=e.NotPendingTransition,pp=e.HostTransitionContext,bie=e.resetFormInstance;e.bindToConsole;var vie=e.supportsMicrotasks,yie=e.scheduleMicrotask,dy=e.supportsTestSelectors,xie=e.findFiberRoot,_ie=e.getBoundingRect,Sie=e.getTextContent,py=e.isHiddenSubtree,wie=e.matchAccessibilityRole,Eie=e.setFocusIfFocusable,Mie=e.setupIntersectionObserver,Tie=e.appendChild,Aie=e.appendChildToContainer,Cie=e.commitTextUpdate,Rie=e.commitMount,kie=e.commitUpdate,Die=e.insertBefore,Oie=e.insertInContainerBefore,Iie=e.removeChild,Nie=e.removeChildFromContainer,A9=e.resetTextContent,Lie=e.hideInstance,Pie=e.hideTextInstance,Uie=e.unhideInstance,Fie=e.unhideTextInstance,Bie=e.clearContainer,zie=e.cloneInstance,C9=e.createContainerChildSet,R9=e.appendChildToContainerChildSet,jie=e.finalizeContainerChildren,k9=e.replaceContainerChildren,D9=e.cloneHiddenInstance,O9=e.cloneHiddenTextInstance,RR=e.isSuspenseInstancePending,kR=e.isSuspenseInstanceFallback,Hie=e.getSuspenseInstanceFallbackErrorDetails,Vie=e.registerSuspenseInstanceRetry,Gie=e.canHydrateFormStateMarker,Wie=e.isFormStateMarkerMatching,I9=e.getNextHydratableSibling,N9=e.getFirstHydratableChild,Xie=e.getFirstHydratableChildWithinContainer,qie=e.getFirstHydratableChildWithinSuspenseInstance,Kie=e.canHydrateInstance,Yie=e.canHydrateTextInstance,Jie=e.canHydrateSuspenseInstance,$ie=e.hydrateInstance,Zie=e.hydrateTextInstance,Qie=e.hydrateSuspenseInstance,ere=e.getNextHydratableInstanceAfterSuspenseInstance,tre=e.commitHydratedContainer,nre=e.commitHydratedSuspenseInstance,ire=e.clearSuspenseBoundary,rre=e.clearSuspenseBoundaryFromContainer,L9=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var are=e.validateHydratableInstance,sre=e.validateHydratableTextInstance,zl=e.supportsResources,P9=e.isHostHoistableType,DR=e.getHoistableRoot,U9=e.getResource,F9=e.acquireResource,B9=e.releaseResource,ore=e.hydrateHoistable,z9=e.mountHoistable,j9=e.unmountHoistable,lre=e.createHoistableInstance,cre=e.prepareToCommitHoistables,ure=e.mayResourceSuspendCommit,H9=e.preloadResource,fre=e.suspendResource,Ys=e.supportsSingletons,V9=e.resolveSingletonInstance,hre=e.clearSingleton,dre=e.acquireSingletonInstance,pre=e.releaseSingletonInstance,G9=e.isHostSingletonType,OR=[],Tg=-1,Ag={},il=Math.clz32?Math.clz32:_,mre=Math.log,gre=Math.LN2,bS=128,vS=4194304,yS=nl.unstable_scheduleCallback,IR=nl.unstable_cancelCallback,bre=nl.unstable_shouldYield,vre=nl.unstable_requestPaint,Hc=nl.unstable_now,W9=nl.unstable_ImmediatePriority,yre=nl.unstable_UserBlockingPriority,NR=nl.unstable_NormalPriority,xre=nl.unstable_IdlePriority,_re=nl.log,Sre=nl.unstable_setDisableYieldValue,my=null,rl=null,al=typeof Object.is=="function"?Object.is:V,X9=new WeakMap,Cg=[],Rg=0,xS=null,_S=0,jl=[],Hl=0,mp=null,Tf=1,Af="",gs=y(null),gy=y(null),Uh=y(null),SS=y(null),po=null,Js=null,Wi=!1,Vc=null,ku=!1,LR=Error(r(519)),Vl=[],kg=0,PR=0,wS=null,Dg=null,UR=!1,ES=!1,FR=!1,Og=0,by=null,BR=0,Ig=0,Ng=null,Fh=!1,zR=!1,wre=Object.prototype.hasOwnProperty,vy=Error(r(460)),jR=Error(r(474)),MS={then:function(){}},Lg=null,Pg=null,yy=0,gp=vn(!0),q9=vn(!1),Ug=y(null),TS=y(0),Gl=y(null),Du=null,La=y(0),Bh=0,gi=null,vr=null,wa=null,AS=!1,Fg=!1,bp=!1,CS=0,xy=0,Bg=null,Ere=0,HR=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Ou={readContext:Bt,use:ve,useCallback:ri,useContext:ri,useEffect:ri,useImperativeHandle:ri,useLayoutEffect:ri,useInsertionEffect:ri,useMemo:ri,useReducer:ri,useRef:ri,useState:ri,useDebugValue:ri,useDeferredValue:ri,useTransition:ri,useSyncExternalStore:ri,useId:ri};Ou.useCacheRefresh=ri,Ou.useMemoCache=ri,Ou.useHostTransitionStatus=ri,Ou.useFormState=ri,Ou.useActionState=ri,Ou.useOptimistic=ri;var vp={readContext:Bt,use:ve,useCallback:function(m,v){return xe().memoizedState=[m,v===void 0?null:v],m},useContext:Bt,useEffect:ds,useImperativeHandle:function(m,v,T){T=T!=null?T.concat([m]):null,Bs(4194308,4,Xa.bind(null,v,m),T)},useLayoutEffect:function(m,v){return Bs(4194308,4,m,v)},useInsertionEffect:function(m,v){Bs(4,2,m,v)},useMemo:function(m,v){var T=xe();v=v===void 0?null:v;var O=m();if(bp){H(!0);try{m()}finally{H(!1)}}return T.memoizedState=[O,v],O},useReducer:function(m,v,T){var O=xe();if(T!==void 0){var U=T(v);if(bp){H(!0);try{T(v)}finally{H(!1)}}}else U=v;return O.memoizedState=O.baseState=U,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:U},O.queue=m,m=m.dispatch=zt.bind(null,gi,m),[O.memoizedState,m]},useRef:function(m){var v=xe();return m={current:m},v.memoizedState=m},useState:function(m){m=$t(m);var v=m.queue,T=gn.bind(null,gi,v);return v.dispatch=T,[m.memoizedState,T]},useDebugValue:so,useDeferredValue:function(m,v){var T=xe();return E(T,m,v)},useTransition:function(){var m=$t(!1);return m=J.bind(null,gi,m.queue,!0,!1),xe().memoizedState=m,[!1,m]},useSyncExternalStore:function(m,v,T){var O=gi,U=xe();if(Wi){if(T===void 0)throw Error(r(407));T=T()}else{if(T=v(),Dr===null)throw Error(r(349));Fi&60||at(O,v,T)}U.memoizedState=T;var q={value:T,getSnapshot:v};return U.queue=q,ds(pn.bind(null,O,q,m),[m]),O.flags|=2048,Gi(9,nn.bind(null,O,q,T,v),{destroy:void 0},null),T},useId:function(){var m=xe(),v=Dr.identifierPrefix;if(Wi){var T=Af,O=Tf;T=(O&~(1<<32-il(O)-1)).toString(32)+T,v=":"+v+"R"+T,T=CS++,0<T&&(v+="H"+T.toString(32)),v+=":"}else T=Ere++,v=":"+v+"r"+T.toString(32)+":";return m.memoizedState=v},useCacheRefresh:function(){return xe().memoizedState=Lt.bind(null,gi)}};vp.useMemoCache=_t,vp.useHostTransitionStatus=ye,vp.useFormState=di,vp.useActionState=di,vp.useOptimistic=function(m){var v=xe();v.memoizedState=v.baseState=m;var T={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return v.queue=T,v=Ei.bind(null,gi,!0,T),T.dispatch=v,[m,v]};var zh={readContext:Bt,use:ve,useCallback:zs,useContext:Bt,useEffect:_n,useImperativeHandle:$i,useInsertionEffect:Wa,useLayoutEffect:ps,useMemo:js,useReducer:yt,useRef:Yo,useState:function(){return yt(ft)},useDebugValue:so,useDeferredValue:function(m,v){var T=Ce();return L(T,vr.memoizedState,m,v)},useTransition:function(){var m=yt(ft)[0],v=Ce().memoizedState;return[typeof m=="boolean"?m:Oe(m),v]},useSyncExternalStore:Xt,useId:$e};zh.useCacheRefresh=tt,zh.useMemoCache=_t,zh.useHostTransitionStatus=ye,zh.useFormState=Li,zh.useActionState=Li,zh.useOptimistic=function(m,v){var T=Ce();return Yt(T,vr,m,v)};var yp={readContext:Bt,use:ve,useCallback:zs,useContext:Bt,useEffect:_n,useImperativeHandle:$i,useInsertionEffect:Wa,useLayoutEffect:ps,useMemo:js,useReducer:Nt,useRef:Yo,useState:function(){return Nt(ft)},useDebugValue:so,useDeferredValue:function(m,v){var T=Ce();return vr===null?E(T,m,v):L(T,vr.memoizedState,m,v)},useTransition:function(){var m=Nt(ft)[0],v=Ce().memoizedState;return[typeof m=="boolean"?m:Oe(m),v]},useSyncExternalStore:Xt,useId:$e};yp.useCacheRefresh=tt,yp.useMemoCache=_t,yp.useHostTransitionStatus=ye,yp.useFormState=Sa,yp.useActionState=Sa,yp.useOptimistic=function(m,v){var T=Ce();return vr!==null?Yt(T,vr,m,v):(T.baseState=m,[m,T.queue.dispatch])};var VR={isMounted:function(m){return(m=m._reactInternals)?f(m)===m:!1},enqueueSetState:function(m,v,T){m=m._reactInternals;var O=tl(),U=Je(O);U.payload=v,T!=null&&(U.callback=T),v=Ye(m,U,O),v!==null&&(ho(v,m,O),vt(v,m,O))},enqueueReplaceState:function(m,v,T){m=m._reactInternals;var O=tl(),U=Je(O);U.tag=1,U.payload=v,T!=null&&(U.callback=T),v=Ye(m,U,O),v!==null&&(ho(v,m,O),vt(v,m,O))},enqueueForceUpdate:function(m,v){m=m._reactInternals;var T=tl(),O=Je(T);O.tag=2,v!=null&&(O.callback=v),v=Ye(m,O,T),v!==null&&(ho(v,m,T),vt(v,m,T))}},K9=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var v=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(v))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},Y9=Error(r(461)),Ja=!1,GR={dehydrated:null,treeContext:null,retryLane:0},RS=y(null),xp=null,Cf=null,Mre=typeof AbortController<"u"?AbortController:function(){var m=[],v=this.signal={aborted:!1,addEventListener:function(T,O){m.push(O)}};this.abort=function(){v.aborted=!0,m.forEach(function(T){return T()})}},Tre=nl.unstable_scheduleCallback,Are=nl.unstable_NormalPriority,ua={$$typeof:Nh,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},J9=Kn.S;Kn.S=function(m,v){typeof v=="object"&&v!==null&&typeof v.then=="function"&&$(m,v),J9!==null&&J9(m,v)};var _p=y(null),Rf=!1,fa=!1,WR=!1,$9=typeof WeakSet=="function"?WeakSet:Set,$a=null,Z9=!1,Ea=null,sl=!1,Gc=null,zg=8192,Cre={getCacheForType:function(m){var v=Bt(ua),T=v.data.get(m);return T===void 0&&(T=m(),v.data.set(m,T)),T}},kS=0,DS=1,OS=2,IS=3,NS=4;if(typeof Symbol=="function"&&Symbol.for){var _y=Symbol.for;kS=_y("selector.component"),DS=_y("selector.has_pseudo_class"),OS=_y("selector.role"),IS=_y("selector.test_id"),NS=_y("selector.text")}var Rre=typeof WeakMap=="function"?WeakMap:Map,yr=0,Dr=null,Ai=null,Fi=0,Or=0,ol=null,kf=!1,jg=!1,XR=!1,Df=0,ha=0,jh=0,Sp=0,qR=0,Wl=0,Hg=0,Sy=null,Iu=null,KR=!1,YR=0,wy=1/0,LS=null,Hh=null,PS=!1,wp=null,Ey=0,JR=0,$R=null,My=0,ZR=null;return Ti.attemptContinuousHydration=function(m){if(m.tag===13){var v=we(m,67108864);v!==null&&ho(v,m,67108864),vR(m,67108864)}},Ti.attemptHydrationAtCurrentPriority=function(m){if(m.tag===13){var v=tl(),T=we(m,v);T!==null&&ho(T,m,v),vR(m,v)}},Ti.attemptSynchronousHydration=function(m){switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=w(m.pendingLanes);if(v!==0){for(m.pendingLanes|=2,m.entangledLanes|=2;v;){var T=1<<31-il(v);m.entanglements[1]|=T,v&=~T}Ne(m),!(yr&6)&&(wy=Hc()+500,Fe(0))}}break;case 13:v=we(m,2),v!==null&&ho(v,m,2),$4(),vR(m,2)}},Ti.batchedUpdates=function(m,v){return m(v)},Ti.createComponentSelector=function(m){return{$$typeof:kS,value:m}},Ti.createContainer=function(m,v,T,O,U,q,be,Be,nt,Rt){return f9(m,v,!1,null,T,O,q,be,Be,nt,Rt,null)},Ti.createHasPseudoClassSelector=function(m){return{$$typeof:DS,value:m}},Ti.createHydrationContainer=function(m,v,T,O,U,q,be,Be,nt,Rt,qt,sn,cn){return m=f9(T,O,!0,m,U,q,Be,nt,Rt,qt,sn,cn),m.context=h9(null),T=m.current,O=tl(),U=Je(O),U.callback=v??null,Ye(T,U,O),m.current.lanes=O,N(m,O),Ne(m),m},Ti.createPortal=function(m,v,T){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wg,key:O==null?null:""+O,children:m,containerInfo:v,implementation:T}},Ti.createRoleSelector=function(m){return{$$typeof:OS,value:m}},Ti.createTestNameSelector=function(m){return{$$typeof:IS,value:m}},Ti.createTextSelector=function(m){return{$$typeof:NS,value:m}},Ti.defaultOnCaughtError=function(m){console.error(m)},Ti.defaultOnRecoverableError=function(m){K9(m)},Ti.defaultOnUncaughtError=function(m){K9(m)},Ti.deferredUpdates=function(m){var v=Kn.T,T=dp();try{return Do(32),Kn.T=null,m()}finally{Do(T),Kn.T=v}},Ti.discreteUpdates=function(m,v,T,O,U){var q=Kn.T,be=dp();try{return Do(2),Kn.T=null,m(v,T,O,U)}finally{Do(be),Kn.T=q,yr===0&&(wy=Hc()+500)}},Ti.findAllNodes=cR,Ti.findBoundingRects=function(m,v){if(!dy)throw Error(r(363));v=cR(m,v),m=[];for(var T=0;T<v.length;T++)m.push(_ie(v[T]));for(v=m.length-1;0<v;v--){T=m[v];for(var O=T.x,U=O+T.width,q=T.y,be=q+T.height,Be=v-1;0<=Be;Be--)if(v!==Be){var nt=m[Be],Rt=nt.x,qt=Rt+nt.width,sn=nt.y,cn=sn+nt.height;if(O>=Rt&&q>=sn&&U<=qt&&be<=cn){m.splice(v,1);break}else if(O!==Rt||T.width!==nt.width||cn<q||sn>be){if(!(q!==sn||T.height!==nt.height||qt<O||Rt>U)){Rt>O&&(nt.width+=Rt-O,nt.x=O),qt<U&&(nt.width=U-Rt),m.splice(v,1);break}}else{sn>q&&(nt.height+=sn-q,nt.y=q),cn<be&&(nt.height=be-sn),m.splice(v,1);break}}}return m},Ti.findHostInstance=d9,Ti.findHostInstanceWithNoPortals=function(m){return m=d(m),m=m!==null?b(m):null,m===null?null:hy(m.stateNode)},Ti.findHostInstanceWithWarning=function(m){return d9(m)},Ti.flushPassiveEffects=fp,Ti.flushSyncFromReconciler=function(m){var v=yr;yr|=1;var T=Kn.T,O=dp();try{if(Do(2),Kn.T=null,m)return m()}finally{Do(O),Kn.T=T,yr=v,!(yr&6)&&Fe(0)}},Ti.flushSyncWork=$4,Ti.focusWithin=function(m,v){if(!dy)throw Error(r(363));for(m=sR(m),v=q4(m,v),v=Array.from(v),m=0;m<v.length;){var T=v[m++],O=T.tag;if(!py(T)){if((O===5||O===26||O===27)&&Eie(T.stateNode))return!0;for(T=T.child;T!==null;)v.push(T),T=T.sibling}}return!1},Ti.getFindAllNodesFailureDescription=function(m,v){if(!dy)throw Error(r(363));var T=0,O=[];m=[sR(m),0];for(var U=0;U<m.length;){var q=m[U++],be=q.tag,Be=m[U++],nt=v[Be];if((be!==5&&be!==26&&be!==27||!py(q))&&(oR(q,nt)&&(O.push(lR(nt)),Be++,Be>T&&(T=Be)),Be<v.length))for(q=q.child;q!==null;)m.push(q,Be),q=q.sibling}if(T<v.length){for(m=[];T<v.length;T++)m.push(lR(v[T]));return`findAllNodes was able to match part of the selector:
  `+(O.join(" > ")+`

No matching component was found for:
  `)+m.join(" > ")}return null},Ti.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 27:case 5:return hy(m.child.stateNode);default:return m.child.stateNode}},Ti.injectIntoDevTools=function(){var m={bundleType:0,version:tie,rendererPackageName:nie,currentDispatcherRef:Kn,findFiberByHostInstance:E9,reconcilerVersion:"19.0.0"};if(_9!==null&&(m.rendererConfig=_9),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)m=!0;else{try{my=v.inject(m),rl=v}catch{}m=!!v.checkDCE}}return m},Ti.isAlreadyRendering=function(){return!1},Ti.observeVisibleRects=function(m,v,T,O){if(!dy)throw Error(r(363));m=cR(m,v);var U=Mie(m,T,O).disconnect;return{disconnect:function(){U()}}},Ti.shouldError=function(){return null},Ti.shouldSuspend=function(){return!1},Ti.startHostTransition=function(m,v,T,O){if(m.tag!==5)throw Error(r(476));var U=re(m).queue;J(m,U,v,Mg,T===null?i:function(){var q=re(m).next.queue;return Mn(m,q,{},tl()),T(O)})},Ti.updateContainer=function(m,v,T,O){var U=v.current,q=tl();return p9(U,q,m,v,T,O),q},Ti.updateContainerSync=function(m,v,T,O){return v.tag===0&&fp(),p9(v.current,2,m,v,T,O),2},Ti},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(lZ);var dwe=lZ.exports;oZ.exports=dwe;var pwe=oZ.exports;const mwe=Rc(pwe);function AU(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=e?t.return:t.child;for(;i;){const r=AU(i,e,n);if(r)return r;i=e?null:i.sibling}}function fZ(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const CU=fZ(I.createContext(null));let hZ=class extends I.Component{render(){return I.createElement(CU.Provider,{value:this._reactInternals},this.props.children)}};function dZ(){const t=I.useContext(CU);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=I.useId();return I.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const i=AU(n,!1,r=>{let a=r.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[t,e])}const gwe=Symbol.for("react.context"),bwe=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===gwe;function vwe(){const t=dZ(),[e]=I.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;bwe(i)&&i!==CU&&!e.has(i)&&e.set(i,I.use(fZ(i))),n=n.return}return e}function pZ(){const t=vwe();return I.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>I.createElement(e,null,I.createElement(n.Provider,{...i,value:t.get(n)})),e=>I.createElement(hZ,{...e})),[t])}function mZ(t){let e=t.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const gZ=t=>t&&t.isOrthographicCamera,ywe=t=>t&&t.hasOwnProperty("current"),xwe=t=>t!=null&&(typeof t=="string"||typeof t=="number"||t.isColor),X_=((t,e)=>typeof window<"u"&&(((t=window.document)==null?void 0:t.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?I.useLayoutEffect:I.useEffect;function RU(t){const e=I.useRef(t);return X_(()=>void(e.current=t),[t]),e}function _we(){const t=dZ(),e=pZ();return I.useMemo(()=>({children:n})=>{const r=!!AU(t,!0,a=>a.type===I.StrictMode)?I.StrictMode:I.Fragment;return D.jsx(r,{children:D.jsx(e,{children:n})})},[t,e])}function Swe({set:t}){return X_(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const wwe=(t=>(t=class extends I.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}},t.getDerivedStateFromError=()=>({error:!0}),t))();function bZ(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}function vb(t){var e;return(e=t.__r3f)==null?void 0:e.root.getState()}const Yr={obj:t=>t===Object(t)&&!Yr.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,nul:t=>t===null,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:i="reference",strict:r=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(Yr.str(t)||Yr.num(t)||Yr.boo(t))return t===e;const a=Yr.obj(t);if(a&&i==="reference")return t===e;const s=Yr.arr(t);if(s&&n==="reference")return t===e;if((s||a)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(a&&n==="shallow"&&i==="shallow"){for(o in r?e:t)if(!Yr.equ(t[o],e[o],{strict:r,objects:"reference"}))return!1}else for(o in r?e:t)if(t[o]!==e[o])return!1;if(Yr.und(o)){if(s&&t.length===0&&e.length===0||a&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function Ewe(t){const e={nodes:{},materials:{},meshes:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material),n.isMesh&&!e.meshes[n.name]&&(e.meshes[n.name]=n)}),e}function Mwe(t){t.type!=="Scene"&&(t.dispose==null||t.dispose());for(const e in t){const n=t[e];n?.type!=="Scene"&&(n==null||n.dispose==null||n.dispose())}}const vZ=["children","key","ref"];function Twe(t){const e={};for(const n in t)vZ.includes(n)||(e[n]=t[n]);return e}function aT(t,e,n,i){const r=t;let a=r?.__r3f;return a||(a={root:e,type:n,parent:null,children:[],props:Twe(i),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=a)),a}function Z1(t,e){let n=t[e];if(!e.includes("-"))return{root:t,key:e,target:n};n=t;for(const r of e.split("-")){var i;e=r,t=n,n=(i=n)==null?void 0:i[e]}return{root:t,key:e,target:n}}const v5=/-\d+$/;function sT(t,e){if(Yr.str(e.props.attach)){if(v5.test(e.props.attach)){const r=e.props.attach.replace(v5,""),{root:a,key:s}=Z1(t.object,r);Array.isArray(a[s])||(a[s]=[])}const{root:n,key:i}=Z1(t.object,e.props.attach);e.previousAttach=n[i],n[i]=e.object}else Yr.fun(e.props.attach)&&(e.previousAttach=e.props.attach(t.object,e.object))}function oT(t,e){if(Yr.str(e.props.attach)){const{root:n,key:i}=Z1(t.object,e.props.attach),r=e.previousAttach;r===void 0?delete n[i]:n[i]=r}else e.previousAttach==null||e.previousAttach(t.object,e.object);delete e.previousAttach}const uI=[...vZ,"args","dispose","attach","object","onUpdate","dispose"],y5=new Map;function Awe(t){let e=y5.get(t.constructor);try{e||(e=new t.constructor,y5.set(t.constructor,e))}catch{}return e}function Cwe(t,e){const n={};for(const i in e)if(!uI.includes(i)&&!Yr.equ(e[i],t.props[i])){n[i]=e[i];for(const r in e)r.startsWith(`${i}-`)&&(n[r]=e[r])}for(const i in t.props){if(uI.includes(i)||e.hasOwnProperty(i))continue;const{root:r,key:a}=Z1(t.object,i);if(r.constructor&&r.constructor.length===0){const s=Awe(r);Yr.und(s)||(n[a]=s[a])}else n[a]=0}return n}const Rwe=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],kwe=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function ou(t,e){var n;const i=t.__r3f,r=i&&mZ(i).getState(),a=i?.eventCount;for(const o in e){let l=e[o];if(uI.includes(o))continue;if(i&&kwe.test(o)){typeof l=="function"?i.handlers[o]=l:delete i.handlers[o],i.eventCount=Object.keys(i.handlers).length;continue}if(l===void 0)continue;let{root:c,key:u,target:f}=Z1(t,o);if(f instanceof ov&&l instanceof ov)f.mask=l.mask;else if(f instanceof Ut&&xwe(l))f.set(l);else if(f!==null&&typeof f=="object"&&typeof f.set=="function"&&typeof f.copy=="function"&&l!=null&&l.constructor&&f.constructor===l.constructor)f.copy(l);else if(f!==null&&typeof f=="object"&&typeof f.set=="function"&&Array.isArray(l))typeof f.fromArray=="function"?f.fromArray(l):f.set(...l);else if(f!==null&&typeof f=="object"&&typeof f.set=="function"&&typeof l=="number")typeof f.setScalar=="function"?f.setScalar(l):f.set(l);else{var s;c[u]=l,r&&!r.linear&&Rwe.includes(u)&&(s=c[u])!=null&&s.isTexture&&c[u].format===Qr&&c[u].type===Ao&&(c[u].colorSpace=As)}}if(i!=null&&i.parent&&r!=null&&r.internal&&(n=i.object)!=null&&n.isObject3D&&a!==i.eventCount){const o=i.object,l=r.internal.interaction.indexOf(o);l>-1&&r.internal.interaction.splice(l,1),i.eventCount&&o.raycast!==null&&r.internal.interaction.push(o)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&ey(i),t}function ey(t){var e;if(!t.parent)return;t.props.onUpdate==null||t.props.onUpdate(t.object);const n=(e=t.root)==null||e.getState==null?void 0:e.getState();n&&n.internal.frames===0&&n.invalidate()}function yZ(t,e){t.manual||(gZ(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix())}const yo=t=>t?.isObject3D;function Zw(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function xZ(t,e,n,i){const r=n.get(e);r&&(n.delete(e),n.size===0&&(t.delete(i),r.target.releasePointerCapture(i)))}function Dwe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(i=>i!==e),n.initialHits=n.initialHits.filter(i=>i!==e),n.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&n.hovered.delete(r)}),n.capturedMap.forEach((i,r)=>{xZ(n.capturedMap,e,i,r)})}function Owe(t){function e(l){const{internal:c}=t.getState(),u=l.offsetX-c.initialClick[0],f=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+f*f))}function n(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var f;return(f=c.__r3f)==null?void 0:f.handlers["onPointer"+u]}))}function i(l,c){const u=t.getState(),f=new Set,h=[],d=c?c(u.internal.interaction):u.internal.interaction;for(let p=0;p<d.length;p++){const x=vb(d[p]);x&&(x.raycaster.camera=void 0)}u.previousRoot||u.events.compute==null||u.events.compute(l,u);function g(p){const x=vb(p);if(!x||!x.events.enabled||x.raycaster.camera===null)return[];if(x.raycaster.camera===void 0){var _;x.events.compute==null||x.events.compute(l,x,(_=x.previousRoot)==null?void 0:_.getState()),x.raycaster.camera===void 0&&(x.raycaster.camera=null)}return x.raycaster.camera?x.raycaster.intersectObject(p,!0):[]}let b=d.flatMap(g).sort((p,x)=>{const _=vb(p.object),w=vb(x.object);return!_||!w?p.distance-x.distance:w.events.priority-_.events.priority||p.distance-x.distance}).filter(p=>{const x=Zw(p);return f.has(x)?!1:(f.add(x),!0)});u.events.filter&&(b=u.events.filter(b,u));for(const p of b){let x=p.object;for(;x;){var y;(y=x.__r3f)!=null&&y.eventCount&&h.push({...p,eventObject:x}),x=x.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let p of u.internal.capturedMap.get(l.pointerId).values())f.has(Zw(p.intersection))||h.push(p.intersection);return h}function r(l,c,u,f){if(l.length){const h={stopped:!1};for(const d of l){let g=vb(d.object);if(g||d.object.traverseAncestors(b=>{const y=vb(b);if(y)return g=y,!1}),g){const{raycaster:b,pointer:y,camera:p,internal:x}=g,_=new te(y.x,y.y,0).unproject(p),w=k=>{var R,N;return(R=(N=x.capturedMap.get(k))==null?void 0:N.has(d.eventObject))!=null?R:!1},M=k=>{const R={intersection:d,target:c.target};x.capturedMap.has(k)?x.capturedMap.get(k).set(d.eventObject,R):x.capturedMap.set(k,new Map([[d.eventObject,R]])),c.target.setPointerCapture(k)},S=k=>{const R=x.capturedMap.get(k);R&&xZ(x.capturedMap,d.eventObject,R,k)};let A={};for(let k in c){let R=c[k];typeof R!="function"&&(A[k]=R)}let C={...d,...A,pointer:y,intersections:l,stopped:h.stopped,delta:u,unprojectedPoint:_,ray:b.ray,camera:p,stopPropagation(){const k="pointerId"in c&&x.capturedMap.get(c.pointerId);if((!k||k.has(d.eventObject))&&(C.stopped=h.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(R=>R.eventObject===d.eventObject))){const R=l.slice(0,l.indexOf(d));a([...R,d])}},target:{hasPointerCapture:w,setPointerCapture:M,releasePointerCapture:S},currentTarget:{hasPointerCapture:w,setPointerCapture:M,releasePointerCapture:S},nativeEvent:c};if(f(C),h.stopped===!0)break}}}return l}function a(l){const{internal:c}=t.getState();for(const u of c.hovered.values())if(!l.length||!l.find(f=>f.object===u.object&&f.index===u.index&&f.instanceId===u.instanceId)){const h=u.eventObject.__r3f;if(c.hovered.delete(Zw(u)),h!=null&&h.eventCount){const d=h.handlers,g={...u,intersections:l};d.onPointerOut==null||d.onPointerOut(g),d.onPointerLeave==null||d.onPointerLeave(g)}}}function s(l,c){for(let u=0;u<c.length;u++){const f=c[u].__r3f;f==null||f.handlers.onPointerMissed==null||f.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return c=>{const{internal:u}=t.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),a([]))})}}return function(u){const{onPointerMissed:f,internal:h}=t.getState();h.lastEvent.current=u;const d=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(u,d?n:void 0),p=g?e(u):0;l==="onPointerDown"&&(h.initialClick=[u.offsetX,u.offsetY],h.initialHits=y.map(_=>_.eventObject)),g&&!y.length&&p<=2&&(s(u,h.interaction),f&&f(u)),d&&a(y);function x(_){const w=_.eventObject,M=w.__r3f;if(!(M!=null&&M.eventCount))return;const S=M.handlers;if(d){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const A=Zw(_),C=h.hovered.get(A);C?C.stopped&&_.stopPropagation():(h.hovered.set(A,_),S.onPointerOver==null||S.onPointerOver(_),S.onPointerEnter==null||S.onPointerEnter(_))}S.onPointerMove==null||S.onPointerMove(_)}else{const A=S[l];A?(!g||h.initialHits.includes(w))&&(s(u,h.interaction.filter(C=>!h.initialHits.includes(C))),A(_)):g&&h.initialHits.includes(w)&&s(u,h.interaction.filter(C=>!h.initialHits.includes(C)))}}r(y,u,p,x)}}return{handlePointer:o}}const x5=t=>!!(t!=null&&t.render),kU=I.createContext(null),Iwe=(t,e)=>{const n=rZ((o,l)=>{const c=new te,u=new te,f=new te;function h(p=l().camera,x=u,_=l().size){const{width:w,height:M,top:S,left:A}=_,C=w/M;x.isVector3?f.copy(x):f.set(...x);const k=p.getWorldPosition(c).distanceTo(f);if(gZ(p))return{width:w/p.zoom,height:M/p.zoom,top:S,left:A,factor:1,distance:k,aspect:C};{const R=p.fov*Math.PI/180,N=2*Math.tan(R/2)*k,P=N*(w/M);return{width:P,height:N,top:S,left:A,factor:w/P,distance:k,aspect:C}}}let d;const g=p=>o(x=>({performance:{...x.performance,current:p}})),b=new wt;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(p=1)=>t(l(),p),advance:(p,x)=>e(p,x,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new xU,pointer:b,mouse:b,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const p=l();d&&clearTimeout(d),p.performance.current!==p.performance.min&&g(p.performance.min),d=setTimeout(()=>g(l().performance.max),p.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:h},setEvents:p=>o(x=>({...x,events:{...x.events,...p}})),setSize:(p,x,_=0,w=0)=>{const M=l().camera,S={width:p,height:x,top:_,left:w};o(A=>({size:S,viewport:{...A.viewport,...h(M,u,S)}}))},setDpr:p=>o(x=>{const _=bZ(p);return{viewport:{...x.viewport,dpr:_,initialDpr:x.viewport.initialDpr||_}}}),setFrameloop:(p="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,p!=="never"&&(x.start(),x.elapsedTime=0),o(()=>({frameloop:p}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:I.createRef(),active:!1,frames:0,priority:0,subscribe:(p,x,_)=>{const w=l().internal;return w.priority=w.priority+(x>0?1:0),w.subscribers.push({ref:p,priority:x,store:_}),w.subscribers=w.subscribers.sort((M,S)=>M.priority-S.priority),()=>{const M=l().internal;M!=null&&M.subscribers&&(M.priority=M.priority-(x>0?1:0),M.subscribers=M.subscribers.filter(S=>S.ref!==p))}}}}}),i=n.getState();let r=i.size,a=i.viewport.dpr,s=i.camera;return n.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:u,set:f}=n.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==a){r=l,a=c.dpr,yZ(o,l),c.dpr>0&&u.setPixelRatio(c.dpr);const h=typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,h)}o!==s&&(s=o,f(h=>({viewport:{...h.viewport,...h.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};function DU(){const t=I.useContext(kU);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function ki(t=n=>n,e){return DU()(t,e)}function la(t,e=0){const n=DU(),i=n.getState().internal.subscribe,r=RU(t);return X_(()=>i(r,e,n),[e,i,n]),null}const _5=new WeakMap,Nwe=t=>{var e;return typeof t=="function"&&(t==null||(e=t.prototype)==null?void 0:e.constructor)===t};function _Z(t,e){return function(n,...i){let r;return Nwe(n)?(r=_5.get(n),r||(r=new n,_5.set(n,r))):r=n,t&&t(r),Promise.all(i.map(a=>new Promise((s,o)=>r.load(a,l=>{yo(l?.scene)&&Object.assign(l,Ewe(l.scene)),s(l)},e,l=>o(new Error(`Could not load ${a}: ${l?.message}`))))))}}function pv(t,e,n,i){const r=Array.isArray(e)?e:[e],a=uwe(_Z(n,i),[t,...r],{equal:Yr.equ});return Array.isArray(e)?a:a[0]}pv.preload=function(t,e,n){const i=Array.isArray(e)?e:[e];return fwe(_Z(n),[t,...i])};pv.clear=function(t,e){const n=Array.isArray(e)?e:[e];return hwe([t,...n])};function Lwe(t){const e=mwe(t);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:I.version}),e}const SZ=0,mv={},Pwe=/^three(?=[A-Z])/,_C=t=>`${t[0].toUpperCase()}${t.slice(1)}`;let Uwe=0;const Fwe=t=>typeof t=="function";function q_(t){if(Fwe(t)){const e=`${Uwe++}`;return mv[e]=t,e}else Object.assign(mv,t)}function wZ(t,e){const n=_C(t),i=mv[n];if(t!=="primitive"&&!i)throw new Error(`R3F: ${n} 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(t==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function Bwe(t,e,n){var i;return t=_C(t)in mv?t:t.replace(Pwe,""),wZ(t,e),t==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,aT(e.object,n,t,e)}function zwe(t){if(!t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?oT(t.parent,t):yo(t.object)&&(t.object.visible=!1),t.isHidden=!0,ey(t)}}function EZ(t){if(t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?sT(t.parent,t):yo(t.object)&&t.props.visible!==!1&&(t.object.visible=!0),t.isHidden=!1,ey(t)}}function OU(t,e,n){const i=e.root.getState();if(!(!t.parent&&t.object!==i.scene)){if(!e.object){var r,a;const s=mv[_C(e.type)];e.object=(r=e.props.object)!=null?r:new s(...(a=e.props.args)!=null?a:[]),e.object.__r3f=e}if(ou(e.object,e.props),e.props.attach)sT(t,e);else if(yo(e.object)&&yo(t.object)){const s=t.object.children.indexOf(n?.object);if(n&&s!==-1){const o=t.object.children.indexOf(e.object);if(o!==-1){t.object.children.splice(o,1);const l=o<s?s-1:s;t.object.children.splice(l,0,e.object)}else e.object.parent=t.object,t.object.children.splice(s,0,e.object),e.object.dispatchEvent({type:"added"}),t.object.dispatchEvent({type:"childadded",child:e.object})}else t.object.add(e.object)}for(const s of e.children)OU(e,s);ey(e)}}function Kk(t,e){e&&(e.parent=t,t.children.push(e),OU(t,e))}function S5(t,e,n){if(!e||!n)return;e.parent=t;const i=t.children.indexOf(n);i!==-1?t.children.splice(i,0,e):t.children.push(e),OU(t,e,n)}function MZ(t){if(typeof t.dispose=="function"){const e=()=>{try{t.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():cI.unstable_scheduleCallback(cI.unstable_IdlePriority,e)}}function fI(t,e,n){if(!e)return;e.parent=null;const i=t.children.indexOf(e);i!==-1&&t.children.splice(i,1),e.props.attach?oT(t,e):yo(e.object)&&yo(t.object)&&(t.object.remove(e.object),Dwe(mZ(e),e.object));const r=e.props.dispose!==null&&n!==!1;for(let a=e.children.length-1;a>=0;a--){const s=e.children[a];fI(e,s,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&MZ(e.object),n===void 0&&ey(e)}function jwe(t,e){for(const n of[t,t.alternate])if(n!==null)if(typeof n.ref=="function"){n.refCleanup==null||n.refCleanup();const i=n.ref(e);typeof i=="function"&&(n.refCleanup=i)}else n.ref&&(n.ref.current=e)}const gM=[];function Hwe(){for(const[n]of gM){const i=n.parent;if(i){n.props.attach?oT(i,n):yo(n.object)&&yo(i.object)&&i.object.remove(n.object);for(const r of n.children)r.props.attach?oT(n,r):yo(r.object)&&yo(n.object)&&n.object.remove(r.object)}n.isHidden&&EZ(n),n.object.__r3f&&delete n.object.__r3f,n.type!=="primitive"&&MZ(n.object)}for(const[n,i,r]of gM){n.props=i;const a=n.parent;if(a){var t,e;const s=mv[_C(n.type)];n.object=(t=n.props.object)!=null?t:new s(...(e=n.props.args)!=null?e:[]),n.object.__r3f=n,jwe(r,n.object),ou(n.object,n.props),n.props.attach?sT(a,n):yo(n.object)&&yo(a.object)&&a.object.add(n.object);for(const o of n.children)o.props.attach?sT(n,o):yo(o.object)&&yo(n.object)&&n.object.add(o.object);ey(n)}}gM.length=0}const Yk=()=>{},w5={};let Qw=SZ;const Vwe=0,Gwe=4,lT=Lwe({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:Bwe,removeChild:fI,appendChild:Kk,appendInitialChild:Kk,insertBefore:S5,appendChildToContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||Kk(n,e)},removeChildFromContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||fI(n,e)},insertInContainerBefore(t,e,n){const i=t.getState().scene.__r3f;!e||!n||!i||S5(i,e,n)},getRootHostContext:()=>w5,getChildHostContext:()=>w5,commitUpdate(t,e,n,i,r){var a,s,o;wZ(e,i);let l=!1;if((t.type==="primitive"&&n.object!==i.object||((a=i.args)==null?void 0:a.length)!==((s=n.args)==null?void 0:s.length)||(o=i.args)!=null&&o.some((u,f)=>{var h;return u!==((h=n.args)==null?void 0:h[f])}))&&(l=!0),l)gM.push([t,{...i},r]);else{const u=Cwe(t,i);Object.keys(u).length&&(Object.assign(t.props,u),ou(t.object,u))}(r.sibling===null||(r.flags&Gwe)===Vwe)&&Hwe()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:t=>t?.object,prepareForCommit:()=>null,preparePortalMount:t=>aT(t.getState().scene,t,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:zwe,unhideInstance:EZ,createTextInstance:Yk,hideTextInstance:Yk,unhideTextInstance:Yk,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:I.createContext(null),setCurrentUpdatePriority(t){Qw=t},getCurrentUpdatePriority(){return Qw},resolveUpdatePriority(){var t;if(Qw!==SZ)return Qw;switch(typeof window<"u"&&((t=window.event)==null?void 0:t.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return mM.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return mM.ContinuousEventPriority;default:return mM.DefaultEventPriority}},resetFormInstance(){}}),Zm=new Map,yb={objects:"shallow",strict:!1};function Wwe(t,e){if(!e&&typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:n,height:i,top:r,left:a}=t.parentElement.getBoundingClientRect();return{width:n,height:i,top:r,left:a}}else if(!e&&typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function Xwe(t){const e=Zm.get(t),n=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,a=i||Iwe(pI,M5),s=n||lT.createContainer(a,mM.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||Zm.set(t,{fiber:s,store:a});let o,l,c=!1,u=null;return{async configure(f={}){let h;u=new Promise(Y=>h=Y);let{gl:d,size:g,scene:b,events:y,onCreated:p,shadows:x=!1,linear:_=!1,flat:w=!1,legacy:M=!1,orthographic:S=!1,frameloop:A="always",dpr:C=[1,2],performance:k,raycaster:R,camera:N,onPointerMissed:P}=f,j=a.getState(),z=j.gl;if(!j.gl){const Y={canvas:t,powerPreference:"high-performance",antialias:!0,alpha:!0},Z=typeof d=="function"?await d(Y):d;x5(Z)?z=Z:z=new TU({...Y,...d}),j.set({gl:z})}let X=j.raycaster;X||j.set({raycaster:X=new W_});const{params:F,...H}=R||{};if(Yr.equ(H,X,yb)||ou(X,{...H}),Yr.equ(F,X.params,yb)||ou(X,{params:{...X.params,...F}}),!j.camera||j.camera===l&&!Yr.equ(l,N,yb)){l=N;const Y=N?.isCamera,Z=Y?N:S?new Ah(0,0,0,0,.1,1e3):new sa(75,0,.1,1e3);Y||(Z.position.z=5,N&&(ou(Z,N),Z.manual||("aspect"in N||"left"in N||"right"in N||"bottom"in N||"top"in N)&&(Z.manual=!0,Z.updateProjectionMatrix())),!j.camera&&!(N!=null&&N.rotation)&&Z.lookAt(0,0,0)),j.set({camera:Z}),X.camera=Z}if(!j.scene){let Y;b!=null&&b.isScene?(Y=b,aT(Y,a,"",{})):(Y=new qv,aT(Y,a,"",{}),b&&ou(Y,b)),j.set({scene:Y})}y&&!j.events.handlers&&j.set({events:y(a)});const V=Wwe(t,g);if(Yr.equ(V,j.size,yb)||j.setSize(V.width,V.height,V.top,V.left),C&&j.viewport.dpr!==bZ(C)&&j.setDpr(C),j.frameloop!==A&&j.setFrameloop(A),j.onPointerMissed||j.set({onPointerMissed:P}),k&&!Yr.equ(k,j.performance,yb)&&j.set(Y=>({performance:{...Y.performance,...k}})),!j.xr){var W;const Y=(de,oe)=>{const le=a.getState();le.frameloop!=="never"&&M5(de,!0,le,oe)},Z=()=>{const de=a.getState();de.gl.xr.enabled=de.gl.xr.isPresenting,de.gl.xr.setAnimationLoop(de.gl.xr.isPresenting?Y:null),de.gl.xr.isPresenting||pI(de)},G={connect(){const de=a.getState().gl;de.xr.addEventListener("sessionstart",Z),de.xr.addEventListener("sessionend",Z)},disconnect(){const de=a.getState().gl;de.xr.removeEventListener("sessionstart",Z),de.xr.removeEventListener("sessionend",Z)}};typeof((W=z.xr)==null?void 0:W.addEventListener)=="function"&&G.connect(),j.set({xr:G})}if(z.shadowMap){const Y=z.shadowMap.enabled,Z=z.shadowMap.type;if(z.shadowMap.enabled=!!x,Yr.boo(x))z.shadowMap.type=Qx;else if(Yr.str(x)){var B;const G={basic:fJ,percentage:UA,soft:Qx,variance:Zc};z.shadowMap.type=(B=G[x])!=null?B:Qx}else Yr.obj(x)&&Object.assign(z.shadowMap,x);(Y!==z.shadowMap.enabled||Z!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}return bi.enabled=!M,c||(z.outputColorSpace=_?Su:As,z.toneMapping=w?sf:FP),j.legacy!==M&&j.set(()=>({legacy:M})),j.linear!==_&&j.set(()=>({linear:_})),j.flat!==w&&j.set(()=>({flat:w})),d&&!Yr.fun(d)&&!x5(d)&&!Yr.equ(d,z,yb)&&ou(z,d),o=p,c=!0,h(),this},render(f){return!c&&!u&&this.configure(),u.then(()=>{lT.updateContainer(D.jsx(qwe,{store:a,children:f,onCreated:o,rootElement:t}),s,null,()=>{})}),a},unmount(){TZ(t)}}}function qwe({store:t,children:e,onCreated:n,rootElement:i}){return X_(()=>{const r=t.getState();r.set(a=>({internal:{...a.internal,active:!0}})),n&&n(r),t.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),D.jsx(kU.Provider,{value:t,children:e})}function TZ(t,e){const n=Zm.get(t),i=n?.fiber;if(i){const r=n?.store.getState();r&&(r.internal.active=!1),lT.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var a,s,o,l;r.events.disconnect==null||r.events.disconnect(),(a=r.gl)==null||(s=a.renderLists)==null||s.dispose==null||s.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),Mwe(r.scene),Zm.delete(t)}catch{}},500)})}}function Kwe(t,e,n){return D.jsx(Ywe,{children:t,container:e,state:n})}function Ywe({state:t={},children:e,container:n}){const{events:i,size:r,...a}=t,s=DU(),[o]=I.useState(()=>new W_),[l]=I.useState(()=>new wt),c=RU((f,h)=>{let d;if(h.camera&&r){const g=h.camera;d=f.viewport.getCurrentViewport(g,new te,r),g!==f.camera&&yZ(g,r)}return{...f,...h,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:s,events:{...f.events,...h.events,...i},size:{...f.size,...r},viewport:{...f.viewport,...d},setEvents:g=>h.set(b=>({...b,events:{...b.events,...g}}))}}),u=I.useMemo(()=>{const f=rZ((d,g)=>({...a,set:d,get:g})),h=d=>f.setState(g=>c.current(d,g));return h(s.getState()),s.subscribe(h),f},[s,n]);return D.jsx(D.Fragment,{children:lT.createPortal(D.jsx(kU.Provider,{value:u,children:e}),u,null)})}function AZ(t,e){const n={callback:t};return e.add(n),()=>void e.delete(n)}const CZ=new Set,RZ=new Set,Jwe=new Set,$we=t=>AZ(t,CZ),Zwe=t=>AZ(t,RZ);function Jk(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function l1(t,e){switch(t){case"before":return Jk(CZ,e);case"after":return Jk(RZ,e);case"tail":return Jk(Jwe,e)}}let $k,Zk;function hI(t,e,n){let i=e.clock.getDelta();e.frameloop==="never"&&typeof t=="number"&&(i=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),$k=e.internal.subscribers;for(let r=0;r<$k.length;r++)Zk=$k[r],Zk.ref.current(Zk.store.getState(),i,n);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let cT=!1,dI=!1,Qk,E5,xb;function kZ(t){E5=requestAnimationFrame(kZ),cT=!0,Qk=0,l1("before",t),dI=!0;for(const n of Zm.values()){var e;xb=n.store.getState(),xb.internal.active&&(xb.frameloop==="always"||xb.internal.frames>0)&&!((e=xb.gl.xr)!=null&&e.isPresenting)&&(Qk+=hI(t,xb))}if(dI=!1,l1("after",t),Qk===0)return l1("tail",t),cT=!1,cancelAnimationFrame(E5)}function pI(t,e=1){var n;if(!t)return Zm.forEach(i=>pI(i.store.getState(),e));(n=t.gl.xr)!=null&&n.isPresenting||!t.internal.active||t.frameloop==="never"||(e>1?t.internal.frames=Math.min(60,t.internal.frames+e):dI?t.internal.frames=2:t.internal.frames=1,cT||(cT=!0,requestAnimationFrame(kZ)))}function M5(t,e=!0,n,i){if(e&&l1("before",t),n)hI(t,n,i);else for(const r of Zm.values())hI(t,r.store.getState());e&&l1("after",t)}const eD={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 Qwe(t){const{handlePointer:e}=Owe(t);return{priority:1,enabled:!0,compute(n,i,r){i.pointer.set(n.offsetX/i.size.width*2-1,-(n.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(eD).reduce((n,i)=>({...n,[i]:e(i)}),{}),update:()=>{var n;const{events:i,internal:r}=t.getState();(n=r.lastEvent)!=null&&n.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:n=>{const{set:i,events:r}=t.getState();if(r.disconnect==null||r.disconnect(),i(a=>({events:{...a.events,connected:n}})),r.handlers)for(const a in r.handlers){const s=r.handlers[a],[o,l]=eD[a];n.addEventListener(o,s,{passive:l})}},disconnect:()=>{const{set:n,events:i}=t.getState();if(i.connected){if(i.handlers)for(const r in i.handlers){const a=i.handlers[r],[s]=eD[r];i.connected.removeEventListener(s,a)}n(r=>({events:{...r.events,connected:void 0}}))}}}}function T5(t,e){let n;return(...i)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...i),e)}}function eEe({debounce:t,scroll:e,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)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[a,s]=I.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=I.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=I.useRef(!1);I.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[f,h,d]=I.useMemo(()=>{const p=()=>{if(!o.current.element)return;const{left:x,top:_,width:w,height:M,bottom:S,right:A,x:C,y:k}=o.current.element.getBoundingClientRect(),R={left:x,top:_,width:w,height:M,bottom:S,right:A,x:C,y:k};o.current.element instanceof HTMLElement&&i&&(R.height=o.current.element.offsetHeight,R.width=o.current.element.offsetWidth),Object.freeze(R),u.current&&!rEe(o.current.lastBounds,R)&&s(o.current.lastBounds=R)};return[p,c?T5(p,c):p,l?T5(p,l):p]},[s,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(p=>p.removeEventListener("scroll",d,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function b(){o.current.element&&(o.current.resizeObserver=new r(d),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(p=>p.addEventListener("scroll",d,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{d()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const y=p=>{!p||p===o.current.element||(g(),o.current.element=p,o.current.scrollContainers=DZ(p),b())};return nEe(d,!!e),tEe(h),I.useEffect(()=>{g(),b()},[e,d,h]),I.useEffect(()=>g,[]),[y,a,f]}function tEe(t){I.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function nEe(t,e){I.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function DZ(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:i,overflowY:r}=window.getComputedStyle(t);return[n,i,r].some(a=>a==="auto"||a==="scroll")&&e.push(t),[...e,...DZ(t.parentElement)]}const iEe=["x","y","top","bottom","left","right","width","height"],rEe=(t,e)=>iEe.every(n=>t[n]===e[n]);function aEe({ref:t,children:e,fallback:n,resize:i,style:r,gl:a,events:s=Qwe,eventSource:o,eventPrefix:l,shadows:c,linear:u,flat:f,legacy:h,orthographic:d,frameloop:g,dpr:b,performance:y,raycaster:p,camera:x,scene:_,onPointerMissed:w,onCreated:M,...S}){I.useMemo(()=>q_(BSe),[]);const A=_we(),[C,k]=eEe({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=I.useRef(null),N=I.useRef(null);I.useImperativeHandle(t,()=>R.current);const P=RU(w),[j,z]=I.useState(!1),[X,F]=I.useState(!1);if(j)throw j;if(X)throw X;const H=I.useRef(null);X_(()=>{const W=R.current;if(k.width>0&&k.height>0&&W){H.current||(H.current=Xwe(W));async function B(){await H.current.configure({gl:a,scene:_,events:s,shadows:c,linear:u,flat:f,legacy:h,orthographic:d,frameloop:g,dpr:b,performance:y,raycaster:p,camera:x,size:k,onPointerMissed:(...Y)=>P.current==null?void 0:P.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(o?ywe(o)?o.current:o:N.current),l&&Y.setEvents({compute:(Z,G)=>{const de=Z[l+"X"],oe=Z[l+"Y"];G.pointer.set(de/G.size.width*2-1,-(oe/G.size.height)*2+1),G.raycaster.setFromCamera(G.pointer,G.camera)}}),M?.(Y)}}),H.current.render(D.jsx(A,{children:D.jsx(wwe,{set:F,children:D.jsx(I.Suspense,{fallback:D.jsx(Swe,{set:z}),children:e??null})})}))}B()}}),I.useEffect(()=>{const W=R.current;if(W)return()=>TZ(W)},[]);const V=o?"none":"auto";return D.jsx("div",{ref:N,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:V,...r},...S,children:D.jsx("div",{ref:C,style:{width:"100%",height:"100%"},children:D.jsx("canvas",{ref:R,style:{display:"block"},children:n})})})}function sEe(t){return D.jsx(hZ,{children:D.jsx(aEe,{...t})})}const K_=new te,IU=new te,oEe=new te,A5=new wt;function lEe(t,e,n){const i=K_.setFromMatrixPosition(t.matrixWorld);i.project(e);const r=n.width/2,a=n.height/2;return[i.x*r+r,-(i.y*a)+a]}function cEe(t,e){const n=K_.setFromMatrixPosition(t.matrixWorld),i=IU.setFromMatrixPosition(e.matrixWorld),r=n.sub(i),a=e.getWorldDirection(oEe);return r.angleTo(a)>Math.PI/2}function uEe(t,e,n,i){const r=K_.setFromMatrixPosition(t.matrixWorld),a=r.clone();a.project(e),A5.set(a.x,a.y),n.setFromCamera(A5,e);const s=n.intersectObjects(i,!0);if(s.length){const o=s[0].distance;return r.distanceTo(n.ray.origin)<o}return!0}function fEe(t,e){if(e instanceof Ah)return e.zoom;if(e instanceof sa){const n=K_.setFromMatrixPosition(t.matrixWorld),i=IU.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,a=n.distanceTo(i);return 1/(2*Math.tan(r/2)*a)}else return 1}function hEe(t,e,n){if(e instanceof sa||e instanceof Ah){const i=K_.setFromMatrixPosition(t.matrixWorld),r=IU.setFromMatrixPosition(e.matrixWorld),a=i.distanceTo(r),s=(n[1]-n[0])/(e.far-e.near),o=n[1]-s*e.far;return Math.round(s*a+o)}}const mI=t=>Math.abs(t)<1e-10?0:t;function OZ(t,e,n=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=mI(e[r]*t.elements[r])+(r!==15?",":")");return n+i}const dEe=(t=>e=>OZ(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),pEe=(t=>(e,n)=>OZ(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]);function mEe(t){return t&&typeof t=="object"&&"current"in t}const ty=I.forwardRef(({children:t,eps:e=.001,style:n,className:i,prepend:r,center:a,fullscreen:s,portal:o,distanceFactor:l,sprite:c=!1,transform:u=!1,occlude:f,onOcclude:h,castShadow:d,receiveShadow:g,material:b,geometry:y,zIndexRange:p=[16777271,0],calculatePosition:x=lEe,as:_="div",wrapperClass:w,pointerEvents:M="auto",...S},A)=>{const{gl:C,camera:k,scene:R,size:N,raycaster:P,events:j,viewport:z}=ki(),[X]=I.useState(()=>document.createElement(_)),F=I.useRef(null),H=I.useRef(null),V=I.useRef(0),W=I.useRef([0,0]),B=I.useRef(null),Y=I.useRef(null),Z=o?.current||j.connected||C.domElement.parentNode,G=I.useRef(null),de=I.useRef(!1),oe=I.useMemo(()=>f&&f!=="blending"||Array.isArray(f)&&f.length&&mEe(f[0]),[f]);I.useLayoutEffect(()=>{const Pe=C.domElement;f&&f==="blending"?(Pe.style.zIndex=`${Math.floor(p[0]/2)}`,Pe.style.position="absolute",Pe.style.pointerEvents="none"):(Pe.style.zIndex=null,Pe.style.position=null,Pe.style.pointerEvents=null)},[f]),I.useLayoutEffect(()=>{if(H.current){const Pe=F.current=cq.createRoot(X);if(R.updateMatrixWorld(),u)X.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const je=x(H.current,k,N);X.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${je[0]}px,${je[1]}px,0);transform-origin:0 0;`}return Z&&(r?Z.prepend(X):Z.appendChild(X)),()=>{Z&&Z.removeChild(X),Pe.unmount()}}},[Z,u]),I.useLayoutEffect(()=>{w&&(X.className=w)},[w]);const le=I.useMemo(()=>u?{position:"absolute",top:0,left:0,width:N.width,height:N.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:a?"translate3d(-50%,-50%,0)":"none",...s&&{top:-N.height/2,left:-N.width/2,width:N.width,height:N.height},...n},[n,a,s,N,u]),ue=I.useMemo(()=>({position:"absolute",pointerEvents:M}),[M]);I.useLayoutEffect(()=>{if(de.current=!1,u){var Pe;(Pe=F.current)==null||Pe.render(I.createElement("div",{ref:B,style:le},I.createElement("div",{ref:Y,style:ue},I.createElement("div",{ref:A,className:i,style:n,children:t}))))}else{var je;(je=F.current)==null||je.render(I.createElement("div",{ref:A,style:le,className:i,children:t}))}});const Se=I.useRef(!0);la(Pe=>{if(H.current){k.updateMatrixWorld(),H.current.updateWorldMatrix(!0,!1);const je=u?W.current:x(H.current,k,N);if(u||Math.abs(V.current-k.zoom)>e||Math.abs(W.current[0]-je[0])>e||Math.abs(W.current[1]-je[1])>e){const He=cEe(H.current,k);let pe=!1;oe&&(Array.isArray(f)?pe=f.map(we=>we.current):f!=="blending"&&(pe=[R]));const ze=Se.current;if(pe){const we=uEe(H.current,k,P,pe);Se.current=we&&!He}else Se.current=!He;ze!==Se.current&&(h?h(!Se.current):X.style.display=Se.current?"block":"none");const Ie=Math.floor(p[0]/2),Xe=f?oe?[p[0],Ie]:[Ie-1,0]:p;if(X.style.zIndex=`${hEe(H.current,k,Xe)}`,u){const[we,Ae]=[N.width/2,N.height/2],Re=k.projectionMatrix.elements[5]*Ae,{isOrthographicCamera:Ne,top:Fe,left:Qe,bottom:ae,right:K}=k,ce=dEe(k.matrixWorldInverse),he=Ne?`scale(${Re})translate(${mI(-(K+Qe)/2)}px,${mI((Fe+ae)/2)}px)`:`translateZ(${Re}px)`;let me=H.current.matrixWorld;c&&(me=k.matrixWorldInverse.clone().transpose().copyPosition(me).scale(H.current.scale),me.elements[3]=me.elements[7]=me.elements[11]=0,me.elements[15]=1),X.style.width=N.width+"px",X.style.height=N.height+"px",X.style.perspective=Ne?"":`${Re}px`,B.current&&Y.current&&(B.current.style.transform=`${he}${ce}translate(${we}px,${Ae}px)`,Y.current.style.transform=pEe(me,1/((l||10)/400)))}else{const we=l===void 0?1:fEe(H.current,k)*l;X.style.transform=`translate3d(${je[0]}px,${je[1]}px,0) scale(${we})`}W.current=je,V.current=k.zoom}}if(!oe&&G.current&&!de.current)if(u){if(B.current){const je=B.current.children[0];if(je!=null&&je.clientWidth&&je!=null&&je.clientHeight){const{isOrthographicCamera:He}=k;if(He||y)S.scale&&(Array.isArray(S.scale)?S.scale instanceof te?G.current.scale.copy(S.scale.clone().divideScalar(1)):G.current.scale.set(1/S.scale[0],1/S.scale[1],1/S.scale[2]):G.current.scale.setScalar(1/S.scale));else{const pe=(l||10)/400,ze=je.clientWidth*pe,Ie=je.clientHeight*pe;G.current.scale.set(ze,Ie,1)}de.current=!0}}}else{const je=X.children[0];if(je!=null&&je.clientWidth&&je!=null&&je.clientHeight){const He=1/z.factor,pe=je.clientWidth*He,ze=je.clientHeight*He;G.current.scale.set(pe,ze,1),de.current=!0}G.current.lookAt(Pe.camera.position)}});const Te=I.useMemo(()=>({vertexShader:u?void 0:`
          /*
            This shader is from the THREE's SpriteMaterial.
            We need to turn the backing plane into a Sprite
            (make it always face the camera) if "transfrom"
            is false.
          */
          #include <common>

          void main() {
            vec2 center = vec2(0., 1.);
            float rotation = 0.0;

            // This is somewhat arbitrary, but it seems to work well
            // Need to figure out how to derive this dynamically if it even matters
            float size = 0.03;

            vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
            vec2 scale;
            scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
            scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );

            bool isPerspective = isPerspectiveMatrix( projectionMatrix );
            if ( isPerspective ) scale *= - mvPosition.z;

            vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
            vec2 rotatedPosition;
            rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
            rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
            mvPosition.xy += rotatedPosition;

            gl_Position = projectionMatrix * mvPosition;
          }
      `,fragmentShader:`
        void main() {
          gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
        }
      `}),[u]);return I.createElement("group",Ls({},S,{ref:H}),f&&!oe&&I.createElement("mesh",{castShadow:d,receiveShadow:g,ref:G},y||I.createElement("planeGeometry",null),b||I.createElement("shaderMaterial",{side:Jr,vertexShader:Te.vertexShader,fragmentShader:Te.fragmentShader})))}),Y_=parseInt(Hv.replace(/\D+/g,"")),IZ=Y_>=125?"uv1":"uv2",gEe=(t,e)=>{const n=t[0].index!==null,i=new Set(Object.keys(t[0].attributes)),r=new Set(Object.keys(t[0].morphAttributes)),a={},s={},o=t[0].morphTargetsRelative,l=new On;let c=0;if(t.forEach((u,f)=>{let h=0;if(n!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let d in u.attributes){if(!i.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;a[d]===void 0&&(a[d]=[]),a[d].push(u.attributes[d]),h++}if(h!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let d in u.morphAttributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+".  .morphAttributes must be consistent throughout all geometries."),null;s[d]===void 0&&(s[d]=[]),s[d].push(u.morphAttributes[d])}l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(u.userData);{let d;if(u.index)d=u.index.count;else if(u.attributes.position!==void 0)d=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,d,f),c+=d}}),n){let u=0;const f=[];t.forEach(h=>{const d=h.index;for(let g=0;g<d.count;++g)f.push(d.getX(g)+u);u+=h.attributes.position.count}),l.setIndex(f)}for(let u in a){const f=C5(a[u]);if(!f)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" attribute."),null;l.setAttribute(u,f)}for(let u in s){const f=s[u][0].length;if(f===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[u]=[];for(let h=0;h<f;++h){const d=[];for(let b=0;b<s[u].length;++b)d.push(s[u][b][h]);const g=C5(d);if(!g)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" morphAttribute."),null;l.morphAttributes[u].push(g)}}return l},C5=t=>{let e,n,i,r=0;if(t.forEach(a=>{if(e===void 0&&(e=a.array.constructor),e!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(n===void 0&&(n=a.itemSize),n!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=a.normalized),i!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=a.array.length}),e&&n){const a=new e(r);let s=0;return t.forEach(o=>{a.set(o.array,s),s+=o.array.length}),new In(a,n,i)}};function R5(t,e){if(e===jJ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Z2||e===WP){let n=t.getIndex();if(n===null){const s=[],o=t.getAttribute("position");if(o!==void 0){for(let l=0;l<o.count;l++)s.push(l);t.setIndex(s),n=t.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t}const i=n.count-2,r=[];if(n)if(e===Z2)for(let s=1;s<=i;s++)r.push(n.getX(0)),r.push(n.getX(s)),r.push(n.getX(s+1));else for(let s=0;s<i;s++)s%2===0?(r.push(n.getX(s)),r.push(n.getX(s+1)),r.push(n.getX(s+2))):(r.push(n.getX(s+2)),r.push(n.getX(s+1)),r.push(n.getX(s)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(r),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}function bEe(t,e=Math.PI/3){const n=Math.cos(e),i=(1+1e-10)*100,r=[new te,new te,new te],a=new te,s=new te,o=new te,l=new te;function c(b){const y=~~(b.x*i),p=~~(b.y*i),x=~~(b.z*i);return`${y},${p},${x}`}const u=t.index?t.toNonIndexed():t,f=u.attributes.position,h={};for(let b=0,y=f.count/3;b<y;b++){const p=3*b,x=r[0].fromBufferAttribute(f,p+0),_=r[1].fromBufferAttribute(f,p+1),w=r[2].fromBufferAttribute(f,p+2);a.subVectors(w,_),s.subVectors(x,_);const M=new te().crossVectors(a,s).normalize();for(let S=0;S<3;S++){const A=r[S],C=c(A);C in h||(h[C]=[]),h[C].push(M)}}const d=new Float32Array(f.count*3),g=new In(d,3,!1);for(let b=0,y=f.count/3;b<y;b++){const p=3*b,x=r[0].fromBufferAttribute(f,p+0),_=r[1].fromBufferAttribute(f,p+1),w=r[2].fromBufferAttribute(f,p+2);a.subVectors(w,_),s.subVectors(x,_),o.crossVectors(a,s).normalize();for(let M=0;M<3;M++){const S=r[M],A=c(S),C=h[A];l.set(0,0,0);for(let k=0,R=C.length;k<R;k++){const N=C[k];o.dot(N)>n&&l.add(N)}l.normalize(),g.setXYZ(p+M,l.x,l.y,l.z)}}return u.setAttribute("normal",g),u}var dc=Uint8Array,Td=Uint16Array,gI=Uint32Array,NZ=new dc([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),LZ=new dc([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),vEe=new dc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),PZ=function(t,e){for(var n=new Td(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];for(var r=new gI(n[30]),i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]},UZ=PZ(NZ,2),FZ=UZ[0],yEe=UZ[1];FZ[28]=258,yEe[258]=28;var xEe=PZ(LZ,0),_Ee=xEe[0],bI=new Td(32768);for(var Hr=0;Hr<32768;++Hr){var Qh=(Hr&43690)>>>1|(Hr&21845)<<1;Qh=(Qh&52428)>>>2|(Qh&13107)<<2,Qh=(Qh&61680)>>>4|(Qh&3855)<<4,bI[Hr]=((Qh&65280)>>>8|(Qh&255)<<8)>>>1}var c1=function(t,e,n){for(var i=t.length,r=0,a=new Td(e);r<i;++r)++a[t[r]-1];var s=new Td(e);for(r=0;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;var o;if(n){o=new Td(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=s[t[r]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)o[bI[f]>>>l]=c}else for(o=new Td(i),r=0;r<i;++r)t[r]&&(o[r]=bI[s[t[r]-1]++]>>>15-t[r]);return o},J_=new dc(288);for(var Hr=0;Hr<144;++Hr)J_[Hr]=8;for(var Hr=144;Hr<256;++Hr)J_[Hr]=9;for(var Hr=256;Hr<280;++Hr)J_[Hr]=7;for(var Hr=280;Hr<288;++Hr)J_[Hr]=8;var BZ=new dc(32);for(var Hr=0;Hr<32;++Hr)BZ[Hr]=5;var SEe=c1(J_,9,1),wEe=c1(BZ,5,1),tD=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Kc=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&n},nD=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},EEe=function(t){return(t/8|0)+(t&7&&1)},MEe=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof Td?Td:t instanceof gI?gI:dc)(n-e);return i.set(t.subarray(e,n)),i},TEe=function(t,e,n){var i=t.length;if(!i||n&&!n.l&&i<5)return e||new dc(0);var r=!e||n,a=!n||n.i;n||(n={}),e||(e=new dc(i*3));var s=function(le){var ue=e.length;if(le>ue){var Se=new dc(Math.max(ue*2,le));Se.set(e),e=Se}},o=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,h=n.m,d=n.n,g=i*8;do{if(!u){n.f=o=Kc(t,l,1);var b=Kc(t,l+1,3);if(l+=3,b)if(b==1)u=SEe,f=wEe,h=9,d=5;else if(b==2){var _=Kc(t,l,31)+257,w=Kc(t,l+10,15)+4,M=_+Kc(t,l+5,31)+1;l+=14;for(var S=new dc(M),A=new dc(19),C=0;C<w;++C)A[vEe[C]]=Kc(t,l+C*3,7);l+=w*3;for(var k=tD(A),R=(1<<k)-1,N=c1(A,k,1),C=0;C<M;){var P=N[Kc(t,l,R)];l+=P&15;var y=P>>>4;if(y<16)S[C++]=y;else{var j=0,z=0;for(y==16?(z=3+Kc(t,l,3),l+=2,j=S[C-1]):y==17?(z=3+Kc(t,l,7),l+=3):y==18&&(z=11+Kc(t,l,127),l+=7);z--;)S[C++]=j}}var X=S.subarray(0,_),F=S.subarray(_);h=tD(X),d=tD(F),u=c1(X,h,1),f=c1(F,d,1)}else throw"invalid block type";else{var y=EEe(l)+4,p=t[y-4]|t[y-3]<<8,x=y+p;if(x>i){if(a)throw"unexpected EOF";break}r&&s(c+p),e.set(t.subarray(y,x),c),n.b=c+=p,n.p=l=x*8;continue}if(l>g){if(a)throw"unexpected EOF";break}}r&&s(c+131072);for(var H=(1<<h)-1,V=(1<<d)-1,W=l;;W=l){var j=u[nD(t,l)&H],B=j>>>4;if(l+=j&15,l>g){if(a)throw"unexpected EOF";break}if(!j)throw"invalid length/literal";if(B<256)e[c++]=B;else if(B==256){W=l,u=null;break}else{var Y=B-254;if(B>264){var C=B-257,Z=NZ[C];Y=Kc(t,l,(1<<Z)-1)+FZ[C],l+=Z}var G=f[nD(t,l)&V],de=G>>>4;if(!G)throw"invalid distance";l+=G&15;var F=_Ee[de];if(de>3){var Z=LZ[de];F+=nD(t,l)&(1<<Z)-1,l+=Z}if(l>g){if(a)throw"unexpected EOF";break}r&&s(c+131072);for(var oe=c+Y;c<oe;c+=4)e[c]=e[c-F],e[c+1]=e[c+1-F],e[c+2]=e[c+2-F],e[c+3]=e[c+3-F];c=oe}}n.l=u,n.p=W,n.b=c,u&&(o=1,n.m=h,n.d=f,n.n=d)}while(!o);return c==e.length?e:MEe(e,0,c)},AEe=new dc(0),CEe=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function eE(t,e){return TEe((CEe(t),t.subarray(2,-4)),e)}var REe=typeof TextDecoder<"u"&&new TextDecoder,kEe=0;try{REe.decode(AEe,{stream:!0}),kEe=1}catch{}const DEe=t=>t&&t.isCubeTexture;class OEe extends _i{constructor(e,n){var i,r;const a=DEe(e),o=((r=a?(i=e.image[0])==null?void 0:i.width:e.image.width)!=null?r:1024)/4,l=Math.floor(Math.log2(o)),c=Math.pow(2,l),u=3*Math.max(c,16*7),f=4*c,h=[a?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/u}`,`#define CUBEUV_TEXEL_HEIGHT ${1/f}`,`#define CUBEUV_MAX_MIP ${l}.0`],d=`
        varying vec3 vWorldPosition;
        void main() 
        {
            vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );
            vWorldPosition = worldPosition.xyz;
            
            gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
        }
        `,g=h.join(`
`)+`
        #define ENVMAP_TYPE_CUBE_UV
        varying vec3 vWorldPosition;
        uniform float radius;
        uniform float height;
        uniform float angle;
        #ifdef ENVMAP_TYPE_CUBE
            uniform samplerCube map;
        #else
            uniform sampler2D map;
        #endif
        // From: https://www.shadertoy.com/view/4tsBD7
        float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 
        {
            float d = dot ( rd, n );
            
            if( d > 0.0 ) { return 1e6; }
            
            vec3  o = ro - c;
            float t = - dot( n, o ) / d;
            vec3  q = o + rd * t;
            
            return ( dot( q, q ) < r * r ) ? t : 1e6;
        }
        // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm
        float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 
        {
            vec3 oc = ro - ce;
            float b = dot( oc, rd );
            float c = dot( oc, oc ) - ra * ra;
            float h = b * b - c;
            
            if( h < 0.0 ) { return -1.0; }
            
            h = sqrt( h );
            
            return - b + h;
        }
        vec3 project() 
        {
            vec3 p = normalize( vWorldPosition );
            vec3 camPos = cameraPosition;
            camPos.y -= height;
            float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );
            if( intersection > 0.0 ) {
                
                vec3 h = vec3( 0.0, - height, 0.0 );
                float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );
                p = ( camPos + min( intersection, intersection2 ) * p ) / radius;
            } else {
                p = vec3( 0.0, 1.0, 0.0 );
            }
            return p;
        }
        #include <common>
        #include <cube_uv_reflection_fragment>
        void main() 
        {
            vec3 projectedWorldPosition = project();
            
            #ifdef ENVMAP_TYPE_CUBE
                vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;
            #else
                vec3 direction = normalize( projectedWorldPosition );
                vec2 uv = equirectUv( direction );
                vec3 outcolor = texture2D( map, uv ).rgb;
            #endif
            gl_FragColor = vec4( outcolor, 1.0 );
            #include <tonemapping_fragment>
            #include <${Y_>=154?"colorspace_fragment":"encodings_fragment"}>
        }
        `,b={map:{value:e},height:{value:n?.height||15},radius:{value:n?.radius||100}},y=new Yv(1,16),p=new fs({uniforms:b,fragmentShader:g,vertexShader:d,side:Jr});super(y,p)}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}}function uT(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}const bm="srgb",lh="srgb-linear",k5=3001,IEe=3e3;class NEe extends Fs{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(n){return new BEe(n)}),this.register(function(n){return new zEe(n)}),this.register(function(n){return new YEe(n)}),this.register(function(n){return new JEe(n)}),this.register(function(n){return new $Ee(n)}),this.register(function(n){return new HEe(n)}),this.register(function(n){return new VEe(n)}),this.register(function(n){return new GEe(n)}),this.register(function(n){return new WEe(n)}),this.register(function(n){return new FEe(n)}),this.register(function(n){return new XEe(n)}),this.register(function(n){return new jEe(n)}),this.register(function(n){return new KEe(n)}),this.register(function(n){return new qEe(n)}),this.register(function(n){return new PEe(n)}),this.register(function(n){return new ZEe(n)}),this.register(function(n){return new QEe(n)})}load(e,n,i,r){const a=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const c=Ud.extractUrlBase(e);s=Ud.resolveURL(c,this.path)}else s=Ud.extractUrlBase(e);this.manager.itemStart(e);const o=function(c){r?r(c):console.error(c),a.manager.itemError(e),a.manager.itemEnd(e)},l=new Ns(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{a.parse(c,s,function(u){n(u),a.manager.itemEnd(e)},o)}catch(u){o(u)}},i,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,i,r){let a;const s={},o={};if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(uT(new Uint8Array(e.slice(0,4)))===zZ){try{s[Di.KHR_BINARY_GLTF]=new eMe(e)}catch(u){r&&r(u);return}a=JSON.parse(s[Di.KHR_BINARY_GLTF].content)}else a=JSON.parse(uT(new Uint8Array(e)));else a=e;if(a.asset===void 0||a.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new dMe(a,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){const u=this.pluginCallbacks[c](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[u.name]=u,s[u.name]=!0}if(a.extensionsUsed)for(let c=0;c<a.extensionsUsed.length;++c){const u=a.extensionsUsed[c],f=a.extensionsRequired||[];switch(u){case Di.KHR_MATERIALS_UNLIT:s[u]=new UEe;break;case Di.KHR_DRACO_MESH_COMPRESSION:s[u]=new tMe(a,this.dracoLoader);break;case Di.KHR_TEXTURE_TRANSFORM:s[u]=new nMe;break;case Di.KHR_MESH_QUANTIZATION:s[u]=new iMe;break;default:f.indexOf(u)>=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(i,r)}parseAsync(e,n){const i=this;return new Promise(function(r,a){i.parse(e,n,r,a)})}}function LEe(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Di={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class PEe{constructor(e){this.parser=e,this.name=Di.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let i=0,r=n.length;i<r;i++){const a=n[i];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const n=this.parser,i="light:"+e;let r=n.cache.get(i);if(r)return r;const a=n.json,l=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let c;const u=new Ut(16777215);l.color!==void 0&&u.setRGB(l.color[0],l.color[1],l.color[2],lh);const f=l.range!==void 0?l.range:0;switch(l.type){case"directional":c=new gC(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new vU(u),c.distance=f;break;case"spot":c=new bU(u),c.distance=f,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,c.angle=l.spot.outerConeAngle,c.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return c.position.set(0,0,0),c.decay=2,Vf(c,l),l.intensity!==void 0&&(c.intensity=l.intensity),c.name=n.createUniqueName(l.name||"light_"+e),r=Promise.resolve(c),n.cache.add(i,r),r}getDependency(e,n){if(e==="light")return this._loadLight(n)}createNodeAttachment(e){const n=this,i=this.parser,a=i.json.nodes[e],o=(a.extensions&&a.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(l){return i._getNodeRef(n.cache,o,l)})}}class UEe{constructor(){this.name=Di.KHR_MATERIALS_UNLIT}getMaterialType(){return Ds}extendParams(e,n,i){const r=[];e.color=new Ut(1,1,1),e.opacity=1;const a=n.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const s=a.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],lh),e.opacity=s[3]}a.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",a.baseColorTexture,bm))}return Promise.all(r)}}class FEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,n){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name].emissiveStrength;return a!==void 0&&(n.emissiveIntensity=a),Promise.resolve()}}class BEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(n.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&a.push(i.assignTexture(n,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(n.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&a.push(i.assignTexture(n,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(a.push(i.assignTexture(n,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const o=s.clearcoatNormalTexture.scale;n.clearcoatNormalScale=new wt(o,o)}return Promise.all(a)}}class zEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name];return n.dispersion=a.dispersion!==void 0?a.dispersion:0,Promise.resolve()}}class jEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(n.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&a.push(i.assignTexture(n,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(n.iridescenceIOR=s.iridescenceIor),n.iridescenceThicknessRange===void 0&&(n.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(n.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(n.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&a.push(i.assignTexture(n,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(a)}}class HEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[];n.sheenColor=new Ut(0,0,0),n.sheenRoughness=0,n.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const o=s.sheenColorFactor;n.sheenColor.setRGB(o[0],o[1],o[2],lh)}return s.sheenRoughnessFactor!==void 0&&(n.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&a.push(i.assignTexture(n,"sheenColorMap",s.sheenColorTexture,bm)),s.sheenRoughnessTexture!==void 0&&a.push(i.assignTexture(n,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(a)}}class VEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(n.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&a.push(i.assignTexture(n,"transmissionMap",s.transmissionTexture)),Promise.all(a)}}class GEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];n.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&a.push(i.assignTexture(n,"thicknessMap",s.thicknessTexture)),n.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return n.attenuationColor=new Ut().setRGB(o[0],o[1],o[2],lh),Promise.all(a)}}class WEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name];return n.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class XEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];n.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&a.push(i.assignTexture(n,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return n.specularColor=new Ut().setRGB(o[0],o[1],o[2],lh),s.specularColorTexture!==void 0&&a.push(i.assignTexture(n,"specularColorMap",s.specularColorTexture,bm)),Promise.all(a)}}class qEe{constructor(e){this.parser=e,this.name=Di.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return n.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&a.push(i.assignTexture(n,"bumpMap",s.bumpTexture)),Promise.all(a)}}class KEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(n.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(n.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&a.push(i.assignTexture(n,"anisotropyMap",s.anisotropyTexture)),Promise.all(a)}}class YEe{constructor(e){this.parser=e,this.name=Di.KHR_TEXTURE_BASISU}loadTexture(e){const n=this.parser,i=n.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const a=r.extensions[this.name],s=n.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,a.source,s)}}class JEe{constructor(e){this.parser=e,this.name=Di.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,r=i.json,a=r.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=r.images[s.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,s.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(n)>=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 n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class $Ee{constructor(e){this.parser=e,this.name=Di.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,r=i.json,a=r.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=r.images[s.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,s.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(n)>=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 n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class ZEe{constructor(e){this.name=Di.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,i=n.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],a=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(o){const l=r.byteOffset||0,c=r.byteLength||0,u=r.count,f=r.byteStride,h=new Uint8Array(o,l,c);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(u,f,h,r.mode,r.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(u*f);return s.decodeGltfBuffer(new Uint8Array(d),u,f,h,r.mode,r.filter),d})})}else return null}}class QEe{constructor(e){this.name=Di.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,i=n.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=n.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==tc.TRIANGLES&&c.mode!==tc.TRIANGLE_STRIP&&c.mode!==tc.TRIANGLE_FAN&&c.mode!==void 0)return null;const s=i.extensions[this.name].attributes,o=[],l={};for(const c in s)o.push(this.parser.getDependency("accessor",s[c]).then(u=>(l[c]=u,l[c])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(c=>{const u=c.pop(),f=u.isGroup?u.children:[u],h=c[0].count,d=[];for(const g of f){const b=new Dt,y=new te,p=new Xn,x=new te(1,1,1),_=new $A(g.geometry,g.material,h);for(let w=0;w<h;w++)l.TRANSLATION&&y.fromBufferAttribute(l.TRANSLATION,w),l.ROTATION&&p.fromBufferAttribute(l.ROTATION,w),l.SCALE&&x.fromBufferAttribute(l.SCALE,w),_.setMatrixAt(w,b.compose(y,p,x));for(const w in l)if(w==="_COLOR_0"){const M=l[w];_.instanceColor=new pf(M.array,M.itemSize,M.normalized)}else w!=="TRANSLATION"&&w!=="ROTATION"&&w!=="SCALE"&&g.geometry.setAttribute(w,l[w]);Pi.prototype.copy.call(_,g),this.parser.assignFinalMaterial(_),d.push(_)}return u.isGroup?(u.clear(),u.add(...d),u):d[0]}))}}const zZ="glTF",$y=12,D5={JSON:1313821514,BIN:5130562};class eMe{constructor(e){this.name=Di.KHR_BINARY_GLTF,this.content=null,this.body=null;const n=new DataView(e,0,$y);if(this.header={magic:uT(new Uint8Array(e.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==zZ)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-$y,r=new DataView(e,$y);let a=0;for(;a<i;){const s=r.getUint32(a,!0);a+=4;const o=r.getUint32(a,!0);if(a+=4,o===D5.JSON){const l=new Uint8Array(e,$y+a,s);this.content=uT(l)}else if(o===D5.BIN){const l=$y+a;this.body=e.slice(l,l+s)}a+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class tMe{constructor(e,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Di.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=n,this.dracoLoader.preload()}decodePrimitive(e,n){const i=this.json,r=this.dracoLoader,a=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},l={},c={};for(const u in s){const f=vI[u]||u.toLowerCase();o[f]=s[u]}for(const u in e.attributes){const f=vI[u]||u.toLowerCase();if(s[u]!==void 0){const h=i.accessors[e.attributes[u]],d=E0[h.componentType];c[f]=d.name,l[f]=h.normalized===!0}}return n.getDependency("bufferView",a).then(function(u){return new Promise(function(f,h){r.decodeDracoFile(u,function(d){for(const g in d.attributes){const b=d.attributes[g],y=l[g];y!==void 0&&(b.normalized=y)}f(d)},o,c,lh,h)})})}}class nMe{constructor(){this.name=Di.KHR_TEXTURE_TRANSFORM}extendTexture(e,n){return(n.texCoord===void 0||n.texCoord===e.channel)&&n.offset===void 0&&n.rotation===void 0&&n.scale===void 0||(e=e.clone(),n.texCoord!==void 0&&(e.channel=n.texCoord),n.offset!==void 0&&e.offset.fromArray(n.offset),n.rotation!==void 0&&(e.rotation=n.rotation),n.scale!==void 0&&e.repeat.fromArray(n.scale),e.needsUpdate=!0),e}}class iMe{constructor(){this.name=Di.KHR_MESH_QUANTIZATION}}class jZ extends Zv{constructor(e,n,i,r){super(e,n,i,r)}copySampleValue_(e){const n=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r*3+r;for(let s=0;s!==r;s++)n[s]=i[a+s];return n}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,c=o*3,u=r-n,f=(i-n)/u,h=f*f,d=h*f,g=e*c,b=g-c,y=-2*d+3*h,p=d-h,x=1-y,_=p-h+f;for(let w=0;w!==o;w++){const M=s[b+w+o],S=s[b+w+l]*u,A=s[g+w+o],C=s[g+w]*u;a[w]=x*M+_*S+y*A+p*C}return a}}const rMe=new Xn;class aMe extends jZ{interpolate_(e,n,i,r){const a=super.interpolate_(e,n,i,r);return rMe.fromArray(a).normalize().toArray(a),a}}const tc={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},E0={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},O5={9728:ls,9729:Vi,9984:FA,9985:_0,9986:fm,9987:vc},I5={33071:_a,33648:Z0,10497:qd},iD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vI={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...Y_>=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"},ed={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},sMe={CUBICSPLINE:void 0,LINEAR:rv,STEP:iv},rD={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function oMe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new $v({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:_u})),t.DefaultMaterial}function zp(t,e,n){for(const i in n.extensions)t[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=n.extensions[i])}function Vf(t,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function lMe(t,e,n){let i=!1,r=!1,a=!1;for(let c=0,u=e.length;c<u;c++){const f=e[c];if(f.POSITION!==void 0&&(i=!0),f.NORMAL!==void 0&&(r=!0),f.COLOR_0!==void 0&&(a=!0),i&&r&&a)break}if(!i&&!r&&!a)return Promise.resolve(t);const s=[],o=[],l=[];for(let c=0,u=e.length;c<u;c++){const f=e[c];if(i){const h=f.POSITION!==void 0?n.getDependency("accessor",f.POSITION):t.attributes.position;s.push(h)}if(r){const h=f.NORMAL!==void 0?n.getDependency("accessor",f.NORMAL):t.attributes.normal;o.push(h)}if(a){const h=f.COLOR_0!==void 0?n.getDependency("accessor",f.COLOR_0):t.attributes.color;l.push(h)}}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l)]).then(function(c){const u=c[0],f=c[1],h=c[2];return i&&(t.morphAttributes.position=u),r&&(t.morphAttributes.normal=f),a&&(t.morphAttributes.color=h),t.morphTargetsRelative=!0,t})}function cMe(t,e){if(t.updateMorphTargets(),e.weights!==void 0)for(let n=0,i=e.weights.length;n<i;n++)t.morphTargetInfluences[n]=e.weights[n];if(e.extras&&Array.isArray(e.extras.targetNames)){const n=e.extras.targetNames;if(t.morphTargetInfluences.length===n.length){t.morphTargetDictionary={};for(let i=0,r=n.length;i<r;i++)t.morphTargetDictionary[n[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function uMe(t){let e;const n=t.extensions&&t.extensions[Di.KHR_DRACO_MESH_COMPRESSION];if(n?e="draco:"+n.bufferView+":"+n.indices+":"+aD(n.attributes):e=t.indices+":"+aD(t.attributes)+":"+t.mode,t.targets!==void 0)for(let i=0,r=t.targets.length;i<r;i++)e+=":"+aD(t.targets[i]);return e}function aD(t){let e="";const n=Object.keys(t).sort();for(let i=0,r=n.length;i<r;i++)e+=n[i]+":"+t[n[i]]+";";return e}function yI(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function fMe(t){return t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const hMe=new Dt;class dMe{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new LEe,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,a=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,a=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&a<98?this.textureLoader=new hv(this.options.manager):this.textureLoader=new P$(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ns(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,n){const i=this,r=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(s){const o={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:i,userData:{}};return zp(a,o,r),Vf(o,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();e(o)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],i=this.json.meshes||[];for(let r=0,a=n.length;r<a;r++){const s=n[r].joints;for(let o=0,l=s.length;o<l;o++)e[s[o]].isBone=!0}for(let r=0,a=e.length;r<a;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(i[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,n){n!==void 0&&(e.refs[n]===void 0&&(e.refs[n]=e.uses[n]=0),e.refs[n]++)}_getNodeRef(e,n,i){if(e.refs[n]<=1)return i;const r=i.clone(),a=(s,o)=>{const l=this.associations.get(s);l!=null&&this.associations.set(o,l);for(const[c,u]of s.children.entries())a(u,o.children[c])};return a(i,r),r.name+="_instance_"+e.uses[n]++,r}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let i=0;i<n.length;i++){const r=e(n[i]);if(r)return r}return null}_invokeAll(e){const n=Object.values(this.plugins);n.unshift(this);const i=[];for(let r=0;r<n.length;r++){const a=e(n[r]);a&&i.push(a)}return i}getDependency(e,n){const i=e+":"+n;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(n);break;case"node":r=this._invokeOne(function(a){return a.loadNode&&a.loadNode(n)});break;case"mesh":r=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(n)});break;case"accessor":r=this.loadAccessor(n);break;case"bufferView":r=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(n)});break;case"buffer":r=this.loadBuffer(n);break;case"material":r=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(n)});break;case"texture":r=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(n)});break;case"skin":r=this.loadSkin(n);break;case"animation":r=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(n)});break;case"camera":r=this.loadCamera(n);break;default:if(r=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,n)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let n=this.cache.get(e);if(!n){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];n=Promise.all(r.map(function(a,s){return i.getDependency(e,s)})),this.cache.add(e,n)}return n}loadBuffer(e){const n=this.json.buffers[e],i=this.fileLoader;if(n.type&&n.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+n.type+" buffer type is not supported.");if(n.uri===void 0&&e===0)return Promise.resolve(this.extensions[Di.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(a,s){i.load(Ud.resolveURL(n.uri,r.path),a,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})}loadBufferView(e){const n=this.json.bufferViews[e];return this.getDependency("buffer",n.buffer).then(function(i){const r=n.byteLength||0,a=n.byteOffset||0;return i.slice(a,a+r)})}loadAccessor(e){const n=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=iD[r.type],o=E0[r.componentType],l=r.normalized===!0,c=new o(r.count*s);return Promise.resolve(new In(c,s,l))}const a=[];return r.bufferView!==void 0?a.push(this.getDependency("bufferView",r.bufferView)):a.push(null),r.sparse!==void 0&&(a.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(a).then(function(s){const o=s[0],l=iD[r.type],c=E0[r.componentType],u=c.BYTES_PER_ELEMENT,f=u*l,h=r.byteOffset||0,d=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,g=r.normalized===!0;let b,y;if(d&&d!==f){const p=Math.floor(h/d),x="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+p+":"+r.count;let _=n.cache.get(x);_||(b=new c(o,p*d,r.count*d/u),_=new z_(b,d/u),n.cache.add(x,_)),y=new zo(_,l,h%d/u,g)}else o===null?b=new c(r.count*l):b=new c(o,h,r.count*l),y=new In(b,l,g);if(r.sparse!==void 0){const p=iD.SCALAR,x=E0[r.sparse.indices.componentType],_=r.sparse.indices.byteOffset||0,w=r.sparse.values.byteOffset||0,M=new x(s[1],_,r.sparse.count*p),S=new c(s[2],w,r.sparse.count*l);o!==null&&(y=new In(y.array.slice(),y.itemSize,y.normalized));for(let A=0,C=M.length;A<C;A++){const k=M[A];if(y.setX(k,S[A*l]),l>=2&&y.setY(k,S[A*l+1]),l>=3&&y.setZ(k,S[A*l+2]),l>=4&&y.setW(k,S[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const n=this.json,i=this.options,a=n.textures[e].source,s=n.images[a];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,n,i){const r=this,a=this.json,s=a.textures[e],o=a.images[n],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,i).then(function(u){u.flipY=!1,u.name=s.name||o.name||"",u.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(u.name=o.uri);const h=(a.samplers||{})[s.sampler]||{};return u.magFilter=O5[h.magFilter]||Vi,u.minFilter=O5[h.minFilter]||vc,u.wrapS=I5[h.wrapS]||qd,u.wrapT=I5[h.wrapT]||qd,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const i=this,r=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=r.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",c=!1;if(s.bufferView!==void 0)l=i.getDependency("bufferView",s.bufferView).then(function(f){c=!0;const h=new Blob([f],{type:s.mimeType});return l=o.createObjectURL(h),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(f){return new Promise(function(h,d){let g=h;n.isImageBitmapLoader===!0&&(g=function(b){const y=new nr(b);y.needsUpdate=!0,h(y)}),n.load(Ud.resolveURL(f,a.path),g,void 0,d)})}).then(function(f){return c===!0&&o.revokeObjectURL(l),Vf(f,s),f.userData.mimeType=s.mimeType||fMe(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=u,u}assignTexture(e,n,i,r){const a=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(s=s.clone(),s.channel=i.texCoord),a.extensions[Di.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[Di.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[Di.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===k5?bm:lh),"colorSpace"in s?s.colorSpace=r:s.encoding=r===bm?k5:IEe),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let i=e.material;const r=n.attributes.tangent===void 0,a=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new QA,Oa.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(o,l)),i=l}else if(e.isLine){const o="LineBasicMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new Us,Oa.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(o,l)),i=l}if(r||a||s){let o="ClonedMaterial:"+i.uuid+":";r&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=i.clone(),a&&(l.vertexColors=!0),s&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return $v}loadMaterial(e){const n=this,i=this.json,r=this.extensions,a=i.materials[e];let s;const o={},l=a.extensions||{},c=[];if(l[Di.KHR_MATERIALS_UNLIT]){const f=r[Di.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),c.push(f.extendParams(o,a,n))}else{const f=a.pbrMetallicRoughness||{};if(o.color=new Ut(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){const h=f.baseColorFactor;o.color.setRGB(h[0],h[1],h[2],lh),o.opacity=h[3]}f.baseColorTexture!==void 0&&c.push(n.assignTexture(o,"map",f.baseColorTexture,bm)),o.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,o.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(o,"metalnessMap",f.metallicRoughnessTexture)),c.push(n.assignTexture(o,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=Jr);const u=a.alphaMode||rD.OPAQUE;if(u===rD.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===rD.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==Ds&&(c.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new wt(1,1),a.normalTexture.scale!==void 0)){const f=a.normalTexture.scale;o.normalScale.set(f,f)}if(a.occlusionTexture!==void 0&&s!==Ds&&(c.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==Ds){const f=a.emissiveFactor;o.emissive=new Ut().setRGB(f[0],f[1],f[2],lh)}return a.emissiveTexture!==void 0&&s!==Ds&&c.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,bm)),Promise.all(c).then(function(){const f=new s(o);return a.name&&(f.name=a.name),Vf(f,a),n.associations.set(f,{materials:e}),a.extensions&&zp(r,f,a),f})}createUniqueName(e){const n=Bi.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,i=this.extensions,r=this.primitiveCache;function a(o){return i[Di.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,n).then(function(l){return N5(l,o,n)})}const s=[];for(let o=0,l=e.length;o<l;o++){const c=e[o],u=uMe(c),f=r[u];if(f)s.push(f.promise);else{let h;c.extensions&&c.extensions[Di.KHR_DRACO_MESH_COMPRESSION]?h=a(c):h=N5(new On,c,n),r[u]={primitive:c,promise:h},s.push(h)}}return Promise.all(s)}loadMesh(e){const n=this,i=this.json,r=this.extensions,a=i.meshes[e],s=a.primitives,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l].material===void 0?oMe(this.cache):this.getDependency("material",s[l].material);o.push(u)}return o.push(n.loadGeometries(s)),Promise.all(o).then(function(l){const c=l.slice(0,l.length-1),u=l[l.length-1],f=[];for(let d=0,g=u.length;d<g;d++){const b=u[d],y=s[d];let p;const x=c[d];if(y.mode===tc.TRIANGLES||y.mode===tc.TRIANGLE_STRIP||y.mode===tc.TRIANGLE_FAN||y.mode===void 0)p=a.isSkinnedMesh===!0?new JA(b,x):new _i(b,x),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),y.mode===tc.TRIANGLE_STRIP?p.geometry=R5(p.geometry,WP):y.mode===tc.TRIANGLE_FAN&&(p.geometry=R5(p.geometry,Z2));else if(y.mode===tc.LINES)p=new Lc(b,x);else if(y.mode===tc.LINE_STRIP)p=new yh(b,x);else if(y.mode===tc.LINE_LOOP)p=new eU(b,x);else if(y.mode===tc.POINTS)p=new tU(b,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+y.mode);Object.keys(p.geometry.morphAttributes).length>0&&cMe(p,a),p.name=n.createUniqueName(a.name||"mesh_"+e),Vf(p,a),y.extensions&&zp(r,p,y),n.assignFinalMaterial(p),f.push(p)}for(let d=0,g=f.length;d<g;d++)n.associations.set(f[d],{meshes:e,primitives:d});if(f.length===1)return a.extensions&&zp(r,f[0],a),f[0];const h=new xl;a.extensions&&zp(r,h,a),n.associations.set(h,{meshes:e});for(let d=0,g=f.length;d<g;d++)h.add(f[d]);return h})}loadCamera(e){let n;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?n=new sa(yc.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(n=new Ah(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(n.name=this.createUniqueName(i.name)),Vf(n,i),Promise.resolve(n)}loadSkin(e){const n=this.json.skins[e],i=[];for(let r=0,a=n.joints.length;r<a;r++)i.push(this._loadNodeShallow(n.joints[r]));return n.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",n.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){const a=r.pop(),s=r,o=[],l=[];for(let c=0,u=s.length;c<u;c++){const f=s[c];if(f){o.push(f);const h=new Dt;a!==null&&h.fromArray(a.array,c*16),l.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',n.joints[c])}return new Kv(o,l)})}loadAnimation(e){const n=this.json,i=this,r=n.animations[e],a=r.name?r.name:"animation_"+e,s=[],o=[],l=[],c=[],u=[];for(let f=0,h=r.channels.length;f<h;f++){const d=r.channels[f],g=r.samplers[d.sampler],b=d.target,y=b.node,p=r.parameters!==void 0?r.parameters[g.input]:g.input,x=r.parameters!==void 0?r.parameters[g.output]:g.output;b.node!==void 0&&(s.push(this.getDependency("node",y)),o.push(this.getDependency("accessor",p)),l.push(this.getDependency("accessor",x)),c.push(g),u.push(b))}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(c),Promise.all(u)]).then(function(f){const h=f[0],d=f[1],g=f[2],b=f[3],y=f[4],p=[];for(let x=0,_=h.length;x<_;x++){const w=h[x],M=d[x],S=g[x],A=b[x],C=y[x];if(w===void 0)continue;w.updateMatrix&&w.updateMatrix();const k=i._createAnimationTracks(w,M,S,A,C);if(k)for(let R=0;R<k.length;R++)p.push(k[R])}return new fv(a,void 0,p)})}createNodeMesh(e){const n=this.json,i=this,r=n.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(a){const s=i._getNodeRef(i.meshCache,r.mesh,a);return r.weights!==void 0&&s.traverse(function(o){if(o.isMesh)for(let l=0,c=r.weights.length;l<c;l++)o.morphTargetInfluences[l]=r.weights[l]}),s})}loadNode(e){const n=this.json,i=this,r=n.nodes[e],a=i._loadNodeShallow(e),s=[],o=r.children||[];for(let c=0,u=o.length;c<u;c++)s.push(i.getDependency("node",o[c]));const l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([a,Promise.all(s),l]).then(function(c){const u=c[0],f=c[1],h=c[2];h!==null&&u.traverse(function(d){d.isSkinnedMesh&&d.bind(h,hMe)});for(let d=0,g=f.length;d<g;d++)u.add(f[d]);return u})}_loadNodeShallow(e){const n=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=n.nodes[e],s=a.name?r.createUniqueName(a.name):"",o=[],l=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return l&&o.push(l),a.camera!==void 0&&o.push(r.getDependency("camera",a.camera).then(function(c){return r._getNodeRef(r.cameraCache,a.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){o.push(c)}),this.nodeCache[e]=Promise.all(o).then(function(c){let u;if(a.isBone===!0?u=new j_:c.length>1?u=new xl:c.length===1?u=c[0]:u=new Pi,u!==c[0])for(let f=0,h=c.length;f<h;f++)u.add(c[f]);if(a.name&&(u.userData.name=a.name,u.name=s),Vf(u,a),a.extensions&&zp(i,u,a),a.matrix!==void 0){const f=new Dt;f.fromArray(a.matrix),u.applyMatrix4(f)}else a.translation!==void 0&&u.position.fromArray(a.translation),a.rotation!==void 0&&u.quaternion.fromArray(a.rotation),a.scale!==void 0&&u.scale.fromArray(a.scale);return r.associations.has(u)||r.associations.set(u,{}),r.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,i=this.json.scenes[e],r=this,a=new xl;i.name&&(a.name=r.createUniqueName(i.name)),Vf(a,i),i.extensions&&zp(n,a,i);const s=i.nodes||[],o=[];for(let l=0,c=s.length;l<c;l++)o.push(r.getDependency("node",s[l]));return Promise.all(o).then(function(l){for(let u=0,f=l.length;u<f;u++)a.add(l[u]);const c=u=>{const f=new Map;for(const[h,d]of r.associations)(h instanceof Oa||h instanceof nr)&&f.set(h,d);return u.traverse(h=>{const d=r.associations.get(h);d!=null&&f.set(h,d)}),f};return r.associations=c(a),a})}_createAnimationTracks(e,n,i,r,a){const s=[],o=e.name?e.name:e.uuid,l=[];ed[a.path]===ed.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(o);let c;switch(ed[a.path]){case ed.weights:c=Ym;break;case ed.rotation:c=Jm;break;case ed.position:case ed.scale:c=$m;break;default:switch(i.itemSize){case 1:c=Ym;break;case 2:case 3:default:c=$m;break}break}const u=r.interpolation!==void 0?sMe[r.interpolation]:rv,f=this._getArrayFromAccessor(i);for(let h=0,d=l.length;h<d;h++){const g=new c(l[h]+"."+ed[a.path],n.array,f,u);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),s.push(g)}return s}_getArrayFromAccessor(e){let n=e.array;if(e.normalized){const i=yI(n.constructor),r=new Float32Array(n.length);for(let a=0,s=n.length;a<s;a++)r[a]=n[a]*i;n=r}return n}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const r=this instanceof Jm?aMe:jZ;return new r(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function pMe(t,e,n){const i=e.attributes,r=new rr;if(i.POSITION!==void 0){const o=n.json.accessors[i.POSITION],l=o.min,c=o.max;if(l!==void 0&&c!==void 0){if(r.set(new te(l[0],l[1],l[2]),new te(c[0],c[1],c[2])),o.normalized){const u=yI(E0[o.componentType]);r.min.multiplyScalar(u),r.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const o=new te,l=new te;for(let c=0,u=a.length;c<u;c++){const f=a[c];if(f.POSITION!==void 0){const h=n.json.accessors[f.POSITION],d=h.min,g=h.max;if(d!==void 0&&g!==void 0){if(l.setX(Math.max(Math.abs(d[0]),Math.abs(g[0]))),l.setY(Math.max(Math.abs(d[1]),Math.abs(g[1]))),l.setZ(Math.max(Math.abs(d[2]),Math.abs(g[2]))),h.normalized){const b=yI(E0[h.componentType]);l.multiplyScalar(b)}o.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(o)}t.boundingBox=r;const s=new Ur;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,t.boundingSphere=s}function N5(t,e,n){const i=e.attributes,r=[];function a(s,o){return n.getDependency("accessor",s).then(function(l){t.setAttribute(o,l)})}for(const s in i){const o=vI[s]||s.toLowerCase();o in t.attributes||r.push(a(i[s],o))}if(e.indices!==void 0&&!t.index){const s=n.getDependency("accessor",e.indices).then(function(o){t.setIndex(o)});r.push(s)}return Vf(t,e),pMe(t,e,n),Promise.all(r).then(function(){return e.targets!==void 0?lMe(t,e.targets,n):t})}class mMe extends mU{constructor(e){super(e),this.type=as}parse(e){const s=function(C,k){switch(C){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(k||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(k||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(k||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(k||""))}},u=`
`,f=function(C,k,R){k=k||1024;let P=C.pos,j=-1,z=0,X="",F=String.fromCharCode.apply(null,new Uint16Array(C.subarray(P,P+128)));for(;0>(j=F.indexOf(u))&&z<k&&P<C.byteLength;)X+=F,z+=F.length,P+=128,F+=String.fromCharCode.apply(null,new Uint16Array(C.subarray(P,P+128)));return-1<j?(C.pos+=z+j+1,X+F.slice(0,j)):!1},h=function(C){const k=/^#\?(\S+)/,R=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,N=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,P=/^\s*FORMAT=(\S+)\s*$/,j=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,z={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let X,F;for((C.pos>=C.byteLength||!(X=f(C)))&&s(1,"no header found"),(F=X.match(k))||s(3,"bad initial token"),z.valid|=1,z.programtype=F[1],z.string+=X+`
`;X=f(C),X!==!1;){if(z.string+=X+`
`,X.charAt(0)==="#"){z.comments+=X+`
`;continue}if((F=X.match(R))&&(z.gamma=parseFloat(F[1])),(F=X.match(N))&&(z.exposure=parseFloat(F[1])),(F=X.match(P))&&(z.valid|=2,z.format=F[1]),(F=X.match(j))&&(z.valid|=4,z.height=parseInt(F[1],10),z.width=parseInt(F[2],10)),z.valid&2&&z.valid&4)break}return z.valid&2||s(3,"missing format specifier"),z.valid&4||s(3,"missing image size specifier"),z},d=function(C,k,R){const N=k;if(N<8||N>32767||C[0]!==2||C[1]!==2||C[2]&128)return new Uint8Array(C);N!==(C[2]<<8|C[3])&&s(3,"wrong scanline width");const P=new Uint8Array(4*k*R);P.length||s(4,"unable to allocate buffer space");let j=0,z=0;const X=4*N,F=new Uint8Array(4),H=new Uint8Array(X);let V=R;for(;V>0&&z<C.byteLength;){z+4>C.byteLength&&s(1),F[0]=C[z++],F[1]=C[z++],F[2]=C[z++],F[3]=C[z++],(F[0]!=2||F[1]!=2||(F[2]<<8|F[3])!=N)&&s(3,"bad rgbe scanline format");let W=0,B;for(;W<X&&z<C.byteLength;){B=C[z++];const Z=B>128;if(Z&&(B-=128),(B===0||W+B>X)&&s(3,"bad scanline data"),Z){const G=C[z++];for(let de=0;de<B;de++)H[W++]=G}else H.set(C.subarray(z,z+B),W),W+=B,z+=B}const Y=N;for(let Z=0;Z<Y;Z++){let G=0;P[j]=H[Z+G],G+=N,P[j+1]=H[Z+G],G+=N,P[j+2]=H[Z+G],G+=N,P[j+3]=H[Z+G],j+=4}V--}return P},g=function(C,k,R,N){const P=C[k+3],j=Math.pow(2,P-128)/255;R[N+0]=C[k+0]*j,R[N+1]=C[k+1]*j,R[N+2]=C[k+2]*j,R[N+3]=1},b=function(C,k,R,N){const P=C[k+3],j=Math.pow(2,P-128)/255;R[N+0]=pm.toHalfFloat(Math.min(C[k+0]*j,65504)),R[N+1]=pm.toHalfFloat(Math.min(C[k+1]*j,65504)),R[N+2]=pm.toHalfFloat(Math.min(C[k+2]*j,65504)),R[N+3]=pm.toHalfFloat(1)},y=new Uint8Array(e);y.pos=0;const p=h(y),x=p.width,_=p.height,w=d(y.subarray(y.pos),x,_);let M,S,A;switch(this.type){case wr:A=w.length/4;const C=new Float32Array(A*4);for(let R=0;R<A;R++)g(w,R*4,C,R*4);M=C,S=wr;break;case as:A=w.length/4;const k=new Uint16Array(A*4);for(let R=0;R<A;R++)b(w,R*4,k,R*4);M=k,S=as;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:x,height:_,data:M,header:p.string,gamma:p.gamma,exposure:p.exposure,type:S}}setDataType(e){return this.type=e,this}load(e,n,i,r){function a(s,o){switch(s.type){case wr:case as:"colorSpace"in s?s.colorSpace="srgb-linear":s.encoding=3e3,s.minFilter=Vi,s.magFilter=Vi,s.generateMipmaps=!1,s.flipY=!0;break}n&&n(s,o)}return super.load(e,a,i,r)}}const Zy=Y_>=152;class gMe extends mU{constructor(e){super(e),this.type=as}parse(e){const k=Math.pow(2.7182818,2.2);function R(se,ge){for(var Ue=0,rt=0;rt<65536;++rt)(rt==0||se[rt>>3]&1<<(rt&7))&&(ge[Ue++]=rt);for(var dt=Ue-1;Ue<65536;)ge[Ue++]=0;return dt}function N(se){for(var ge=0;ge<16384;ge++)se[ge]={},se[ge].len=0,se[ge].lit=0,se[ge].p=null}const P={l:0,c:0,lc:0};function j(se,ge,Ue,rt,dt){for(;Ue<se;)ge=ge<<8|vt(rt,dt),Ue+=8;Ue-=se,P.l=ge>>Ue&(1<<se)-1,P.c=ge,P.lc=Ue}const z=new Array(59);function X(se){for(var ge=0;ge<=58;++ge)z[ge]=0;for(var ge=0;ge<65537;++ge)z[se[ge]]+=1;for(var Ue=0,ge=58;ge>0;--ge){var rt=Ue+z[ge]>>1;z[ge]=Ue,Ue=rt}for(var ge=0;ge<65537;++ge){var dt=se[ge];dt>0&&(se[ge]=dt|z[dt]++<<6)}}function F(se,ge,Ue,rt,dt,lt,At){for(var ee=Ue,xe=0,Ce=0;dt<=lt;dt++){if(ee.value-Ue.value>rt)return!1;j(6,xe,Ce,se,ee);var Oe=P.l;if(xe=P.c,Ce=P.lc,At[dt]=Oe,Oe==63){if(ee.value-Ue.value>rt)throw"Something wrong with hufUnpackEncTable";j(8,xe,Ce,se,ee);var ve=P.l+6;if(xe=P.c,Ce=P.lc,dt+ve>lt+1)throw"Something wrong with hufUnpackEncTable";for(;ve--;)At[dt++]=0;dt--}else if(Oe>=59){var ve=Oe-59+2;if(dt+ve>lt+1)throw"Something wrong with hufUnpackEncTable";for(;ve--;)At[dt++]=0;dt--}}X(At)}function H(se){return se&63}function V(se){return se>>6}function W(se,ge,Ue,rt){for(;ge<=Ue;ge++){var dt=V(se[ge]),lt=H(se[ge]);if(dt>>lt)throw"Invalid table entry";if(lt>14){var At=rt[dt>>lt-14];if(At.len)throw"Invalid table entry";if(At.lit++,At.p){var ee=At.p;At.p=new Array(At.lit);for(var xe=0;xe<At.lit-1;++xe)At.p[xe]=ee[xe]}else At.p=new Array(1);At.p[At.lit-1]=ge}else if(lt)for(var Ce=0,xe=1<<14-lt;xe>0;xe--){var At=rt[(dt<<14-lt)+Ce];if(At.len||At.p)throw"Invalid table entry";At.len=lt,At.lit=ge,Ce++}}return!0}const B={c:0,lc:0};function Y(se,ge,Ue,rt){se=se<<8|vt(Ue,rt),ge+=8,B.c=se,B.lc=ge}const Z={c:0,lc:0};function G(se,ge,Ue,rt,dt,lt,At,ee,xe,Ce){if(se==ge){rt<8&&(Y(Ue,rt,dt,At),Ue=B.c,rt=B.lc),rt-=8;var Oe=Ue>>rt,Oe=new Uint8Array([Oe])[0];if(xe.value+Oe>Ce)return!1;for(var ve=ee[xe.value-1];Oe-- >0;)ee[xe.value++]=ve}else if(xe.value<Ce)ee[xe.value++]=se;else return!1;Z.c=Ue,Z.lc=rt}function de(se){return se&65535}function oe(se){var ge=de(se);return ge>32767?ge-65536:ge}const le={a:0,b:0};function ue(se,ge){var Ue=oe(se),rt=oe(ge),dt=rt,lt=Ue+(dt&1)+(dt>>1),At=lt,ee=lt-dt;le.a=At,le.b=ee}function Se(se,ge){var Ue=de(se),rt=de(ge),dt=Ue-(rt>>1)&65535,lt=rt+dt-32768&65535;le.a=lt,le.b=dt}function Te(se,ge,Ue,rt,dt,lt,At){for(var ee=At<16384,xe=Ue>dt?dt:Ue,Ce=1,Oe;Ce<=xe;)Ce<<=1;for(Ce>>=1,Oe=Ce,Ce>>=1;Ce>=1;){for(var ve=0,_t=ve+lt*(dt-Oe),ft=lt*Ce,yt=lt*Oe,St=rt*Ce,Nt=rt*Oe,Xt,at,nn,pn;ve<=_t;ve+=yt){for(var dn=ve,Dn=ve+rt*(Ue-Oe);dn<=Dn;dn+=Nt){var $t=dn+St,Yt=dn+ft,Un=Yt+St;ee?(ue(se[dn+ge],se[Yt+ge]),Xt=le.a,nn=le.b,ue(se[$t+ge],se[Un+ge]),at=le.a,pn=le.b,ue(Xt,at),se[dn+ge]=le.a,se[$t+ge]=le.b,ue(nn,pn),se[Yt+ge]=le.a,se[Un+ge]=le.b):(Se(se[dn+ge],se[Yt+ge]),Xt=le.a,nn=le.b,Se(se[$t+ge],se[Un+ge]),at=le.a,pn=le.b,Se(Xt,at),se[dn+ge]=le.a,se[$t+ge]=le.b,Se(nn,pn),se[Yt+ge]=le.a,se[Un+ge]=le.b)}if(Ue&Ce){var Yt=dn+ft;ee?ue(se[dn+ge],se[Yt+ge]):Se(se[dn+ge],se[Yt+ge]),Xt=le.a,se[Yt+ge]=le.b,se[dn+ge]=Xt}}if(dt&Ce)for(var dn=ve,Dn=ve+rt*(Ue-Oe);dn<=Dn;dn+=Nt){var $t=dn+St;ee?ue(se[dn+ge],se[$t+ge]):Se(se[dn+ge],se[$t+ge]),Xt=le.a,se[$t+ge]=le.b,se[dn+ge]=Xt}Oe=Ce,Ce>>=1}return ve}function Pe(se,ge,Ue,rt,dt,lt,At,ee,xe,Ce){for(var Oe=0,ve=0,_t=ee,ft=Math.trunc(dt.value+(lt+7)/8);dt.value<ft;)for(Y(Oe,ve,Ue,dt),Oe=B.c,ve=B.lc;ve>=14;){var yt=Oe>>ve-14&16383,St=ge[yt];if(St.len)ve-=St.len,G(St.lit,At,Oe,ve,Ue,rt,dt,xe,Ce,_t),Oe=Z.c,ve=Z.lc;else{if(!St.p)throw"hufDecode issues";var Nt;for(Nt=0;Nt<St.lit;Nt++){for(var Xt=H(se[St.p[Nt]]);ve<Xt&&dt.value<ft;)Y(Oe,ve,Ue,dt),Oe=B.c,ve=B.lc;if(ve>=Xt&&V(se[St.p[Nt]])==(Oe>>ve-Xt&(1<<Xt)-1)){ve-=Xt,G(St.p[Nt],At,Oe,ve,Ue,rt,dt,xe,Ce,_t),Oe=Z.c,ve=Z.lc;break}}if(Nt==St.lit)throw"hufDecode issues"}}var at=8-lt&7;for(Oe>>=at,ve-=at;ve>0;){var St=ge[Oe<<14-ve&16383];if(St.len)ve-=St.len,G(St.lit,At,Oe,ve,Ue,rt,dt,xe,Ce,_t),Oe=Z.c,ve=Z.lc;else throw"hufDecode issues"}return!0}function je(se,ge,Ue,rt,dt,lt){var At={value:0},ee=Ue.value,xe=Ye(ge,Ue),Ce=Ye(ge,Ue);Ue.value+=4;var Oe=Ye(ge,Ue);if(Ue.value+=4,xe<0||xe>=65537||Ce<0||Ce>=65537)throw"Something wrong with HUF_ENCSIZE";var ve=new Array(65537),_t=new Array(16384);N(_t);var ft=rt-(Ue.value-ee);if(F(se,ge,Ue,ft,xe,Ce,ve),Oe>8*(rt-(Ue.value-ee)))throw"Something wrong with hufUncompress";W(ve,xe,Ce,_t),Pe(ve,_t,se,ge,Ue,Oe,Ce,lt,dt,At)}function He(se,ge,Ue){for(var rt=0;rt<Ue;++rt)ge[rt]=se[ge[rt]]}function pe(se){for(var ge=1;ge<se.length;ge++){var Ue=se[ge-1]+se[ge]-128;se[ge]=Ue}}function ze(se,ge){for(var Ue=0,rt=Math.floor((se.length+1)/2),dt=0,lt=se.length-1;!(dt>lt||(ge[dt++]=se[Ue++],dt>lt));)ge[dt++]=se[rt++]}function Ie(se){for(var ge=se.byteLength,Ue=new Array,rt=0,dt=new DataView(se);ge>0;){var lt=dt.getInt8(rt++);if(lt<0){var At=-lt;ge-=At+1;for(var ee=0;ee<At;ee++)Ue.push(dt.getUint8(rt++))}else{var At=lt;ge-=2;for(var xe=dt.getUint8(rt++),ee=0;ee<At+1;ee++)Ue.push(xe)}}return Ue}function Xe(se,ge,Ue,rt,dt,lt){var $t=new DataView(lt.buffer),At=Ue[se.idx[0]].width,ee=Ue[se.idx[0]].height,xe=3,Ce=Math.floor(At/8),Oe=Math.ceil(At/8),ve=Math.ceil(ee/8),_t=At-(Oe-1)*8,ft=ee-(ve-1)*8,yt={value:0},St=new Array(xe),Nt=new Array(xe),Xt=new Array(xe),at=new Array(xe),nn=new Array(xe);for(let Nn=0;Nn<xe;++Nn)nn[Nn]=ge[se.idx[Nn]],St[Nn]=Nn<1?0:St[Nn-1]+Oe*ve,Nt[Nn]=new Float32Array(64),Xt[Nn]=new Uint16Array(64),at[Nn]=new Uint16Array(Oe*64);for(let Nn=0;Nn<ve;++Nn){var pn=8;Nn==ve-1&&(pn=ft);var dn=8;for(let Sn=0;Sn<Oe;++Sn){Sn==Oe-1&&(dn=_t);for(let an=0;an<xe;++an)Xt[an].fill(0),Xt[an][0]=dt[St[an]++],we(yt,rt,Xt[an]),Ae(Xt[an],Nt[an]),Re(Nt[an]);Ne(Nt);for(let an=0;an<xe;++an)Fe(Nt[an],at[an],Sn*64)}let An=0;for(let Sn=0;Sn<xe;++Sn){const an=Ue[se.idx[Sn]].type;for(let di=8*Nn;di<8*Nn+pn;++di){An=nn[Sn][di];for(let Li=0;Li<Ce;++Li){const Gn=Li*64+(di&7)*8;$t.setUint16(An+0*2*an,at[Sn][Gn+0],!0),$t.setUint16(An+1*2*an,at[Sn][Gn+1],!0),$t.setUint16(An+2*2*an,at[Sn][Gn+2],!0),$t.setUint16(An+3*2*an,at[Sn][Gn+3],!0),$t.setUint16(An+4*2*an,at[Sn][Gn+4],!0),$t.setUint16(An+5*2*an,at[Sn][Gn+5],!0),$t.setUint16(An+6*2*an,at[Sn][Gn+6],!0),$t.setUint16(An+7*2*an,at[Sn][Gn+7],!0),An+=8*2*an}}if(Ce!=Oe)for(let di=8*Nn;di<8*Nn+pn;++di){const Li=nn[Sn][di]+8*Ce*2*an,Gn=Ce*64+(di&7)*8;for(let wi=0;wi<dn;++wi)$t.setUint16(Li+wi*2*an,at[Sn][Gn+wi],!0)}}}for(var Dn=new Uint16Array(At),$t=new DataView(lt.buffer),Yt=0;Yt<xe;++Yt){Ue[se.idx[Yt]].decoded=!0;var Un=Ue[se.idx[Yt]].type;if(Ue[Yt].type==2)for(var xn=0;xn<ee;++xn){const Nn=nn[Yt][xn];for(var Zn=0;Zn<At;++Zn)Dn[Zn]=$t.getUint16(Nn+Zn*2*Un,!0);for(var Zn=0;Zn<At;++Zn)$t.setFloat32(Nn+Zn*2*Un,Le(Dn[Zn]),!0)}}}function we(se,ge,Ue){for(var rt,dt=1;dt<64;)rt=ge[se.value],rt==65280?dt=64:rt>>8==255?dt+=rt&255:(Ue[dt]=rt,dt++),se.value++}function Ae(se,ge){ge[0]=Le(se[0]),ge[1]=Le(se[1]),ge[2]=Le(se[5]),ge[3]=Le(se[6]),ge[4]=Le(se[14]),ge[5]=Le(se[15]),ge[6]=Le(se[27]),ge[7]=Le(se[28]),ge[8]=Le(se[2]),ge[9]=Le(se[4]),ge[10]=Le(se[7]),ge[11]=Le(se[13]),ge[12]=Le(se[16]),ge[13]=Le(se[26]),ge[14]=Le(se[29]),ge[15]=Le(se[42]),ge[16]=Le(se[3]),ge[17]=Le(se[8]),ge[18]=Le(se[12]),ge[19]=Le(se[17]),ge[20]=Le(se[25]),ge[21]=Le(se[30]),ge[22]=Le(se[41]),ge[23]=Le(se[43]),ge[24]=Le(se[9]),ge[25]=Le(se[11]),ge[26]=Le(se[18]),ge[27]=Le(se[24]),ge[28]=Le(se[31]),ge[29]=Le(se[40]),ge[30]=Le(se[44]),ge[31]=Le(se[53]),ge[32]=Le(se[10]),ge[33]=Le(se[19]),ge[34]=Le(se[23]),ge[35]=Le(se[32]),ge[36]=Le(se[39]),ge[37]=Le(se[45]),ge[38]=Le(se[52]),ge[39]=Le(se[54]),ge[40]=Le(se[20]),ge[41]=Le(se[22]),ge[42]=Le(se[33]),ge[43]=Le(se[38]),ge[44]=Le(se[46]),ge[45]=Le(se[51]),ge[46]=Le(se[55]),ge[47]=Le(se[60]),ge[48]=Le(se[21]),ge[49]=Le(se[34]),ge[50]=Le(se[37]),ge[51]=Le(se[47]),ge[52]=Le(se[50]),ge[53]=Le(se[56]),ge[54]=Le(se[59]),ge[55]=Le(se[61]),ge[56]=Le(se[35]),ge[57]=Le(se[36]),ge[58]=Le(se[48]),ge[59]=Le(se[49]),ge[60]=Le(se[57]),ge[61]=Le(se[58]),ge[62]=Le(se[62]),ge[63]=Le(se[63])}function Re(se){const ge=.5*Math.cos(.7853975),Ue=.5*Math.cos(3.14159/16),rt=.5*Math.cos(3.14159/8),dt=.5*Math.cos(3*3.14159/16),lt=.5*Math.cos(5*3.14159/16),At=.5*Math.cos(3*3.14159/8),ee=.5*Math.cos(7*3.14159/16);for(var xe=new Array(4),Ce=new Array(4),Oe=new Array(4),ve=new Array(4),_t=0;_t<8;++_t){var ft=_t*8;xe[0]=rt*se[ft+2],xe[1]=At*se[ft+2],xe[2]=rt*se[ft+6],xe[3]=At*se[ft+6],Ce[0]=Ue*se[ft+1]+dt*se[ft+3]+lt*se[ft+5]+ee*se[ft+7],Ce[1]=dt*se[ft+1]-ee*se[ft+3]-Ue*se[ft+5]-lt*se[ft+7],Ce[2]=lt*se[ft+1]-Ue*se[ft+3]+ee*se[ft+5]+dt*se[ft+7],Ce[3]=ee*se[ft+1]-lt*se[ft+3]+dt*se[ft+5]-Ue*se[ft+7],Oe[0]=ge*(se[ft+0]+se[ft+4]),Oe[3]=ge*(se[ft+0]-se[ft+4]),Oe[1]=xe[0]+xe[3],Oe[2]=xe[1]-xe[2],ve[0]=Oe[0]+Oe[1],ve[1]=Oe[3]+Oe[2],ve[2]=Oe[3]-Oe[2],ve[3]=Oe[0]-Oe[1],se[ft+0]=ve[0]+Ce[0],se[ft+1]=ve[1]+Ce[1],se[ft+2]=ve[2]+Ce[2],se[ft+3]=ve[3]+Ce[3],se[ft+4]=ve[3]-Ce[3],se[ft+5]=ve[2]-Ce[2],se[ft+6]=ve[1]-Ce[1],se[ft+7]=ve[0]-Ce[0]}for(var yt=0;yt<8;++yt)xe[0]=rt*se[16+yt],xe[1]=At*se[16+yt],xe[2]=rt*se[48+yt],xe[3]=At*se[48+yt],Ce[0]=Ue*se[8+yt]+dt*se[24+yt]+lt*se[40+yt]+ee*se[56+yt],Ce[1]=dt*se[8+yt]-ee*se[24+yt]-Ue*se[40+yt]-lt*se[56+yt],Ce[2]=lt*se[8+yt]-Ue*se[24+yt]+ee*se[40+yt]+dt*se[56+yt],Ce[3]=ee*se[8+yt]-lt*se[24+yt]+dt*se[40+yt]-Ue*se[56+yt],Oe[0]=ge*(se[yt]+se[32+yt]),Oe[3]=ge*(se[yt]-se[32+yt]),Oe[1]=xe[0]+xe[3],Oe[2]=xe[1]-xe[2],ve[0]=Oe[0]+Oe[1],ve[1]=Oe[3]+Oe[2],ve[2]=Oe[3]-Oe[2],ve[3]=Oe[0]-Oe[1],se[0+yt]=ve[0]+Ce[0],se[8+yt]=ve[1]+Ce[1],se[16+yt]=ve[2]+Ce[2],se[24+yt]=ve[3]+Ce[3],se[32+yt]=ve[3]-Ce[3],se[40+yt]=ve[2]-Ce[2],se[48+yt]=ve[1]-Ce[1],se[56+yt]=ve[0]-Ce[0]}function Ne(se){for(var ge=0;ge<64;++ge){var Ue=se[0][ge],rt=se[1][ge],dt=se[2][ge];se[0][ge]=Ue+1.5747*dt,se[1][ge]=Ue-.1873*rt-.4682*dt,se[2][ge]=Ue+1.8556*rt}}function Fe(se,ge,Ue){for(var rt=0;rt<64;++rt)ge[Ue+rt]=pm.toHalfFloat(Qe(se[rt]))}function Qe(se){return se<=1?Math.sign(se)*Math.pow(Math.abs(se),2.2):Math.sign(se)*Math.pow(k,Math.abs(se)-1)}function ae(se){return new DataView(se.array.buffer,se.offset.value,se.size)}function K(se){var ge=se.viewer.buffer.slice(se.offset.value,se.offset.value+se.size),Ue=new Uint8Array(Ie(ge)),rt=new Uint8Array(Ue.length);return pe(Ue),ze(Ue,rt),new DataView(rt.buffer)}function ce(se){var ge=se.array.slice(se.offset.value,se.offset.value+se.size),Ue=eE(ge),rt=new Uint8Array(Ue.length);return pe(Ue),ze(Ue,rt),new DataView(rt.buffer)}function he(se){for(var ge=se.viewer,Ue={value:se.offset.value},rt=new Uint16Array(se.width*se.scanlineBlockSize*(se.channels*se.type)),dt=new Uint8Array(8192),lt=0,At=new Array(se.channels),ee=0;ee<se.channels;ee++)At[ee]={},At[ee].start=lt,At[ee].end=At[ee].start,At[ee].nx=se.width,At[ee].ny=se.lines,At[ee].size=se.type,lt+=At[ee].nx*At[ee].ny*At[ee].size;var xe=ht(ge,Ue),Ce=ht(ge,Ue);if(Ce>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(xe<=Ce)for(var ee=0;ee<Ce-xe+1;ee++)dt[ee+xe]=Mt(ge,Ue);var Oe=new Uint16Array(65536),ve=R(dt,Oe),_t=Ye(ge,Ue);je(se.array,ge,Ue,_t,rt,lt);for(var ee=0;ee<se.channels;++ee)for(var ft=At[ee],yt=0;yt<At[ee].size;++yt)Te(rt,ft.start+yt,ft.nx,ft.size,ft.ny,ft.nx*ft.size,ve);He(Oe,rt,lt);for(var St=0,Nt=new Uint8Array(rt.buffer.byteLength),Xt=0;Xt<se.lines;Xt++)for(var at=0;at<se.channels;at++){var ft=At[at],nn=ft.nx*ft.size,pn=new Uint8Array(rt.buffer,ft.end*2,nn*2);Nt.set(pn,St),St+=nn*2,ft.end+=nn}return new DataView(Nt.buffer)}function me(se){var ge=se.array.slice(se.offset.value,se.offset.value+se.size),Ue=eE(ge);const rt=se.lines*se.channels*se.width,dt=se.type==1?new Uint16Array(rt):new Uint32Array(rt);let lt=0,At=0;const ee=new Array(4);for(let xe=0;xe<se.lines;xe++)for(let Ce=0;Ce<se.channels;Ce++){let Oe=0;switch(se.type){case 1:ee[0]=lt,ee[1]=ee[0]+se.width,lt=ee[1]+se.width;for(let ve=0;ve<se.width;++ve){const _t=Ue[ee[0]++]<<8|Ue[ee[1]++];Oe+=_t,dt[At]=Oe,At++}break;case 2:ee[0]=lt,ee[1]=ee[0]+se.width,ee[2]=ee[1]+se.width,lt=ee[2]+se.width;for(let ve=0;ve<se.width;++ve){const _t=Ue[ee[0]++]<<24|Ue[ee[1]++]<<16|Ue[ee[2]++]<<8;Oe+=_t,dt[At]=Oe,At++}break}}return new DataView(dt.buffer)}function $(se){var ge=se.viewer,Ue={value:se.offset.value},rt=new Uint8Array(se.width*se.lines*(se.channels*se.type*2)),dt={version:gt(ge,Ue),unknownUncompressedSize:gt(ge,Ue),unknownCompressedSize:gt(ge,Ue),acCompressedSize:gt(ge,Ue),dcCompressedSize:gt(ge,Ue),rleCompressedSize:gt(ge,Ue),rleUncompressedSize:gt(ge,Ue),rleRawSize:gt(ge,Ue),totalAcUncompressedCount:gt(ge,Ue),totalDcUncompressedCount:gt(ge,Ue),acCompression:gt(ge,Ue)};if(dt.version<2)throw"EXRLoader.parse: "+hi.compression+" version "+dt.version+" is unsupported";for(var lt=new Array,At=ht(ge,Ue)-2;At>0;){var ee=Ve(ge.buffer,Ue),xe=Mt(ge,Ue),Ce=xe>>2&3,Oe=(xe>>4)-1,ve=new Int8Array([Oe])[0],_t=Mt(ge,Ue);lt.push({name:ee,index:ve,type:_t,compression:Ce}),At-=ee.length+3}for(var ft=hi.channels,yt=new Array(se.channels),St=0;St<se.channels;++St){var Nt=yt[St]={},Xt=ft[St];Nt.name=Xt.name,Nt.compression=0,Nt.decoded=!1,Nt.type=Xt.pixelType,Nt.pLinear=Xt.pLinear,Nt.width=se.width,Nt.height=se.lines}for(var at={idx:new Array(3)},nn=0;nn<se.channels;++nn)for(var Nt=yt[nn],St=0;St<lt.length;++St){var pn=lt[St];Nt.name==pn.name&&(Nt.compression=pn.compression,pn.index>=0&&(at.idx[pn.index]=nn),Nt.offset=nn)}if(dt.acCompressedSize>0)switch(dt.acCompression){case 0:var $t=new Uint16Array(dt.totalAcUncompressedCount);je(se.array,ge,Ue,dt.acCompressedSize,$t,dt.totalAcUncompressedCount);break;case 1:var dn=se.array.slice(Ue.value,Ue.value+dt.totalAcUncompressedCount),Dn=eE(dn),$t=new Uint16Array(Dn.buffer);Ue.value+=dt.totalAcUncompressedCount;break}if(dt.dcCompressedSize>0){var Yt={array:se.array,offset:Ue,size:dt.dcCompressedSize},Un=new Uint16Array(ce(Yt).buffer);Ue.value+=dt.dcCompressedSize}if(dt.rleRawSize>0){var dn=se.array.slice(Ue.value,Ue.value+dt.rleCompressedSize),Dn=eE(dn),xn=Ie(Dn.buffer);Ue.value+=dt.rleCompressedSize}for(var Zn=0,Nn=new Array(yt.length),St=0;St<Nn.length;++St)Nn[St]=new Array;for(var An=0;An<se.lines;++An)for(var Sn=0;Sn<yt.length;++Sn)Nn[Sn].push(Zn),Zn+=yt[Sn].width*se.type*2;Xe(at,Nn,yt,$t,Un,rt);for(var St=0;St<yt.length;++St){var Nt=yt[St];if(!Nt.decoded)switch(Nt.compression){case 2:for(var an=0,di=0,An=0;An<se.lines;++An){for(var Li=Nn[St][an],Gn=0;Gn<Nt.width;++Gn){for(var wi=0;wi<2*Nt.type;++wi)rt[Li++]=xn[di+wi*Nt.width*Nt.height];di++}an++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(rt.buffer)}function Ve(se,ge){for(var Ue=new Uint8Array(se),rt=0;Ue[ge.value+rt]!=0;)rt+=1;var dt=new TextDecoder().decode(Ue.slice(ge.value,ge.value+rt));return ge.value=ge.value+rt+1,dt}function qe(se,ge,Ue){var rt=new TextDecoder().decode(new Uint8Array(se).slice(ge.value,ge.value+Ue));return ge.value=ge.value+Ue,rt}function mt(se,ge){var Ue=Je(se,ge),rt=Ye(se,ge);return[Ue,rt]}function Ge(se,ge){var Ue=Ye(se,ge),rt=Ye(se,ge);return[Ue,rt]}function Je(se,ge){var Ue=se.getInt32(ge.value,!0);return ge.value=ge.value+4,Ue}function Ye(se,ge){var Ue=se.getUint32(ge.value,!0);return ge.value=ge.value+4,Ue}function vt(se,ge){var Ue=se[ge.value];return ge.value=ge.value+1,Ue}function Mt(se,ge){var Ue=se.getUint8(ge.value);return ge.value=ge.value+1,Ue}const gt=function(se,ge){let Ue;return"getBigInt64"in DataView.prototype?Ue=Number(se.getBigInt64(ge.value,!0)):Ue=se.getUint32(ge.value+4,!0)+Number(se.getUint32(ge.value,!0)<<32),ge.value+=8,Ue};function kt(se,ge){var Ue=se.getFloat32(ge.value,!0);return ge.value+=4,Ue}function ke(se,ge){return pm.toHalfFloat(kt(se,ge))}function Le(se){var ge=(se&31744)>>10,Ue=se&1023;return(se>>15?-1:1)*(ge?ge===31?Ue?NaN:1/0:Math.pow(2,ge-15)*(1+Ue/1024):6103515625e-14*(Ue/1024))}function ht(se,ge){var Ue=se.getUint16(ge.value,!0);return ge.value+=2,Ue}function jt(se,ge){return Le(ht(se,ge))}function ot(se,ge,Ue,rt){for(var dt=Ue.value,lt=[];Ue.value<dt+rt-1;){var At=Ve(ge,Ue),ee=Je(se,Ue),xe=Mt(se,Ue);Ue.value+=3;var Ce=Je(se,Ue),Oe=Je(se,Ue);lt.push({name:At,pixelType:ee,pLinear:xe,xSampling:Ce,ySampling:Oe})}return Ue.value+=1,lt}function it(se,ge){var Ue=kt(se,ge),rt=kt(se,ge),dt=kt(se,ge),lt=kt(se,ge),At=kt(se,ge),ee=kt(se,ge),xe=kt(se,ge),Ce=kt(se,ge);return{redX:Ue,redY:rt,greenX:dt,greenY:lt,blueX:At,blueY:ee,whiteX:xe,whiteY:Ce}}function bt(se,ge){var Ue=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],rt=Mt(se,ge);return Ue[rt]}function Jt(se,ge){var Ue=Ye(se,ge),rt=Ye(se,ge),dt=Ye(se,ge),lt=Ye(se,ge);return{xMin:Ue,yMin:rt,xMax:dt,yMax:lt}}function Kt(se,ge){var Ue=["INCREASING_Y"],rt=Mt(se,ge);return Ue[rt]}function un(se,ge){var Ue=kt(se,ge),rt=kt(se,ge);return[Ue,rt]}function Vn(se,ge){var Ue=kt(se,ge),rt=kt(se,ge),dt=kt(se,ge);return[Ue,rt,dt]}function vn(se,ge,Ue,rt,dt){if(rt==="string"||rt==="stringvector"||rt==="iccProfile")return qe(ge,Ue,dt);if(rt==="chlist")return ot(se,ge,Ue,dt);if(rt==="chromaticities")return it(se,Ue);if(rt==="compression")return bt(se,Ue);if(rt==="box2i")return Jt(se,Ue);if(rt==="lineOrder")return Kt(se,Ue);if(rt==="float")return kt(se,Ue);if(rt==="v2f")return un(se,Ue);if(rt==="v3f")return Vn(se,Ue);if(rt==="int")return Je(se,Ue);if(rt==="rational")return mt(se,Ue);if(rt==="timecode")return Ge(se,Ue);if(rt==="preview")return Ue.value+=dt,"skipped";Ue.value+=dt}function Qn(se,ge,Ue){const rt={};if(se.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";rt.version=se.getUint8(4);const dt=se.getUint8(5);rt.spec={singleTile:!!(dt&2),longName:!!(dt&4),deepFormat:!!(dt&8),multiPart:!!(dt&16)},Ue.value=8;for(var lt=!0;lt;){var At=Ve(ge,Ue);if(At==0)lt=!1;else{var ee=Ve(ge,Ue),xe=Ye(se,Ue),Ce=vn(se,ge,Ue,ee,xe);Ce===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${ee}'.`):rt[At]=Ce}}if(dt&-5)throw console.error("EXRHeader:",rt),"THREE.EXRLoader: provided file is currently unsupported.";return rt}function Yn(se,ge,Ue,rt,dt){const lt={size:0,viewer:ge,array:Ue,offset:rt,width:se.dataWindow.xMax-se.dataWindow.xMin+1,height:se.dataWindow.yMax-se.dataWindow.yMin+1,channels:se.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:se.channels[0].pixelType,uncompress:null,getter:null,format:null,[Zy?"colorSpace":"encoding"]:null};switch(se.compression){case"NO_COMPRESSION":lt.lines=1,lt.uncompress=ae;break;case"RLE_COMPRESSION":lt.lines=1,lt.uncompress=K;break;case"ZIPS_COMPRESSION":lt.lines=1,lt.uncompress=ce;break;case"ZIP_COMPRESSION":lt.lines=16,lt.uncompress=ce;break;case"PIZ_COMPRESSION":lt.lines=32,lt.uncompress=he;break;case"PXR24_COMPRESSION":lt.lines=16,lt.uncompress=me;break;case"DWAA_COMPRESSION":lt.lines=32,lt.uncompress=$;break;case"DWAB_COMPRESSION":lt.lines=256,lt.uncompress=$;break;default:throw"EXRLoader.parse: "+se.compression+" is unsupported"}if(lt.scanlineBlockSize=lt.lines,lt.type==1)switch(dt){case wr:lt.getter=jt,lt.inputSize=2;break;case as:lt.getter=ht,lt.inputSize=2;break}else if(lt.type==2)switch(dt){case wr:lt.getter=kt,lt.inputSize=4;break;case as:lt.getter=ke,lt.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+lt.type+" for "+se.compression+".";lt.blockCount=(se.dataWindow.yMax+1)/lt.scanlineBlockSize;for(var At=0;At<lt.blockCount;At++)gt(ge,rt);lt.outputChannels=lt.channels==3?4:lt.channels;const ee=lt.width*lt.height*lt.outputChannels;switch(dt){case wr:lt.byteArray=new Float32Array(ee),lt.channels<lt.outputChannels&&lt.byteArray.fill(1,0,ee);break;case as:lt.byteArray=new Uint16Array(ee),lt.channels<lt.outputChannels&&lt.byteArray.fill(15360,0,ee);break;default:console.error("THREE.EXRLoader: unsupported type: ",dt);break}return lt.bytesPerLine=lt.width*lt.inputSize*lt.channels,lt.outputChannels==4?lt.format=Qr:lt.format=Th,Zy?lt.colorSpace="srgb-linear":lt.encoding=3e3,lt}const xi=new DataView(e),qn=new Uint8Array(e),Ji={value:0},hi=Qn(xi,e,Ji),on=Yn(hi,xi,qn,Ji,this.type),Ii={value:0},ri={R:0,G:1,B:2,A:3,Y:0};for(let se=0;se<on.height/on.scanlineBlockSize;se++){const ge=Ye(xi,Ji);on.size=Ye(xi,Ji),on.lines=ge+on.scanlineBlockSize>on.height?on.height-ge:on.scanlineBlockSize;const rt=on.size<on.lines*on.bytesPerLine?on.uncompress(on):ae(on);Ji.value+=on.size;for(let dt=0;dt<on.scanlineBlockSize;dt++){const lt=dt+se*on.scanlineBlockSize;if(lt>=on.height)break;for(let At=0;At<on.channels;At++){const ee=ri[hi.channels[At].name];for(let xe=0;xe<on.width;xe++){Ii.value=(dt*(on.channels*on.width)+At*on.width+xe)*on.inputSize;const Ce=(on.height-1-lt)*(on.width*on.outputChannels)+xe*on.outputChannels+ee;on.byteArray[Ce]=on.getter(rt,Ii)}}}}return{header:hi,width:on.width,height:on.height,data:on.byteArray,format:on.format,[Zy?"colorSpace":"encoding"]:on[Zy?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,n,i,r){function a(s,o){Zy?s.colorSpace=o.colorSpace:s.encoding=o.encoding,s.minFilter=Vi,s.magFilter=Vi,s.generateMipmaps=!1,s.flipY=!1,n&&n(s,o)}return super.load(e,a,i,r)}}const sD=new WeakMap;class bMe extends Fs{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,n,i,r){const a=new Ns(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,s=>{const o={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(s,o).then(n).catch(r)},i,r)}decodeDracoFile(e,n,i,r){const a={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,a).then(n)}decodeGeometry(e,n){for(const l in n.attributeTypes){const c=n.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(n.attributeTypes[l]=c.name)}const i=JSON.stringify(n);if(sD.has(e)){const l=sD.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 a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then(l=>(r=l,new Promise((c,u)=>{r._callbacks[a]={resolve:c,reject:u},r.postMessage({type:"decode",id:a,taskConfig:n,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{r&&a&&this._releaseTask(r,a)}),sD.set(e,{key:i,promise:o}),o}_createGeometry(e){const n=new On;e.index&&n.setIndex(new In(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const r=e.attributes[i],a=r.name,s=r.array,o=r.itemSize;n.setAttribute(a,new In(s,o))}return n}_loadLibrary(e,n){const i=new Ns(this.manager);return i.setPath(this.decoderPath),i.setResponseType(n),i.setWithCredentials(this.withCredentials),new Promise((r,a)=>{i.load(e,r,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",n=[];return e?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const a=vMe.toString(),s=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,n){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(a){const s=a.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,a){return r._taskLoad>a._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=n,i._taskLoad+=n,i})}_releaseTask(e,n){e._taskLoad-=e._taskCosts[n],delete e._callbacks[n],delete e._taskCosts[n]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function vMe(){let t,e;onmessage=function(s){const o=s.data;switch(o.type){case"init":t=o.decoderConfig,e=new Promise(function(u){t.onModuleLoaded=function(f){u({draco:f})},DracoDecoderModule(t)});break;case"decode":const l=o.buffer,c=o.taskConfig;e.then(u=>{const f=u.draco,h=new f.Decoder,d=new f.DecoderBuffer;d.Init(new Int8Array(l),l.byteLength);try{const g=n(f,h,d,c),b=g.attributes.map(y=>y.array.buffer);g.index&&b.push(g.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:g},b)}catch(g){console.error(g),self.postMessage({type:"error",id:o.id,error:g.message})}finally{f.destroy(d),f.destroy(h)}});break}};function n(s,o,l,c){const u=c.attributeIDs,f=c.attributeTypes;let h,d;const g=o.GetEncodedGeometryType(l);if(g===s.TRIANGULAR_MESH)h=new s.Mesh,d=o.DecodeBufferToMesh(l,h);else if(g===s.POINT_CLOUD)h=new s.PointCloud,d=o.DecodeBufferToPointCloud(l,h);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||h.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const b={index:null,attributes:[]};for(const y in u){const p=self[f[y]];let x,_;if(c.useUniqueIDs)_=u[y],x=o.GetAttributeByUniqueId(h,_);else{if(_=o.GetAttributeId(h,s[u[y]]),_===-1)continue;x=o.GetAttribute(h,_)}b.attributes.push(r(s,o,h,y,p,x))}return g===s.TRIANGULAR_MESH&&(b.index=i(s,o,h)),s.destroy(h),b}function i(s,o,l){const u=l.num_faces()*3,f=u*4,h=s._malloc(f);o.GetTrianglesUInt32Array(l,f,h);const d=new Uint32Array(s.HEAPF32.buffer,h,u).slice();return s._free(h),{array:d,itemSize:1}}function r(s,o,l,c,u,f){const h=f.num_components(),g=l.num_points()*h,b=g*u.BYTES_PER_ELEMENT,y=a(s,u),p=s._malloc(b);o.GetAttributeDataArrayForAllPoints(l,f,y,b,p);const x=new u(s.HEAPF32.buffer,p,g).slice();return s._free(p),{name:c,array:x,itemSize:h}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}const L5=new rr,tE=new te;class SC extends G_{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new mn(e,3)),this.setAttribute("uv",new mn(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new rT(n,6,1);return this.setAttribute("instanceStart",new zo(i,3,0)),this.setAttribute("instanceEnd",new zo(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,n=3){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const r=new rT(i,n*2,1);return this.setAttribute("instanceColorStart",new zo(r,n,0)),this.setAttribute("instanceColorEnd",new zo(r,n,n)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new fU(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),L5.setFromBufferAttribute(n),this.boundingBox.union(L5))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ur),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let r=0;for(let a=0,s=e.count;a<s;a++)tE.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(tE)),tE.fromBufferAttribute(n,a),r=Math.max(r,i.distanceToSquared(tE));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}class NU extends SC{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const n=e.length-3,i=new Float32Array(2*n);for(let r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return super.setPositions(i),this}setColors(e,n=3){const i=e.length-n,r=new Float32Array(2*i);if(n===3)for(let a=0;a<i;a+=n)r[2*a]=e[a],r[2*a+1]=e[a+1],r[2*a+2]=e[a+2],r[2*a+3]=e[a+3],r[2*a+4]=e[a+4],r[2*a+5]=e[a+5];else for(let a=0;a<i;a+=n)r[2*a]=e[a],r[2*a+1]=e[a+1],r[2*a+2]=e[a+2],r[2*a+3]=e[a+3],r[2*a+4]=e[a+4],r[2*a+5]=e[a+5],r[2*a+6]=e[a+6],r[2*a+7]=e[a+7];return super.setColors(r,n),this}fromLine(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}}class wC extends fs{constructor(e){super({type:"LineMaterial",uniforms:cv.clone(cv.merge([tn.common,tn.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new wt(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
				#include <common>
				#include <fog_pars_vertex>
				#include <logdepthbuf_pars_vertex>
				#include <clipping_planes_pars_vertex>

				uniform float linewidth;
				uniform vec2 resolution;

				attribute vec3 instanceStart;
				attribute vec3 instanceEnd;

				#ifdef USE_COLOR
					#ifdef USE_LINE_COLOR_ALPHA
						varying vec4 vLineColor;
						attribute vec4 instanceColorStart;
						attribute vec4 instanceColorEnd;
					#else
						varying vec3 vLineColor;
						attribute vec3 instanceColorStart;
						attribute vec3 instanceColorEnd;
					#endif
				#endif

				#ifdef WORLD_UNITS

					varying vec4 worldPos;
					varying vec3 worldStart;
					varying vec3 worldEnd;

					#ifdef USE_DASH

						varying vec2 vUv;

					#endif

				#else

					varying vec2 vUv;

				#endif

				#ifdef USE_DASH

					uniform float dashScale;
					attribute float instanceDistanceStart;
					attribute float instanceDistanceEnd;
					varying float vLineDistance;

				#endif

				void trimSegment( const in vec4 start, inout vec4 end ) {

					// trim end segment so it terminates between the camera plane and the near plane

					// conservative estimate of the near plane
					float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
					float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
					float nearEstimate = - 0.5 * b / a;

					float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );

					end.xyz = mix( start.xyz, end.xyz, alpha );

				}

				void main() {

					#ifdef USE_COLOR

						vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;

					#endif

					#ifdef USE_DASH

						vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
						vUv = uv;

					#endif

					float aspect = resolution.x / resolution.y;

					// camera space
					vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
					vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );

					#ifdef WORLD_UNITS

						worldStart = start.xyz;
						worldEnd = end.xyz;

					#else

						vUv = uv;

					#endif

					// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
					// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
					// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
					// perhaps there is a more elegant solution -- WestLangley

					bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column

					if ( perspective ) {

						if ( start.z < 0.0 && end.z >= 0.0 ) {

							trimSegment( start, end );

						} else if ( end.z < 0.0 && start.z >= 0.0 ) {

							trimSegment( end, start );

						}

					}

					// clip space
					vec4 clipStart = projectionMatrix * start;
					vec4 clipEnd = projectionMatrix * end;

					// ndc space
					vec3 ndcStart = clipStart.xyz / clipStart.w;
					vec3 ndcEnd = clipEnd.xyz / clipEnd.w;

					// direction
					vec2 dir = ndcEnd.xy - ndcStart.xy;

					// account for clip-space aspect ratio
					dir.x *= aspect;
					dir = normalize( dir );

					#ifdef WORLD_UNITS

						// get the offset direction as perpendicular to the view vector
						vec3 worldDir = normalize( end.xyz - start.xyz );
						vec3 offset;
						if ( position.y < 0.5 ) {

							offset = normalize( cross( start.xyz, worldDir ) );

						} else {

							offset = normalize( cross( end.xyz, worldDir ) );

						}

						// sign flip
						if ( position.x < 0.0 ) offset *= - 1.0;

						float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );

						// don't extend the line if we're rendering dashes because we
						// won't be rendering the endcaps
						#ifndef USE_DASH

							// extend the line bounds to encompass  endcaps
							start.xyz += - worldDir * linewidth * 0.5;
							end.xyz += worldDir * linewidth * 0.5;

							// shift the position of the quad so it hugs the forward edge of the line
							offset.xy -= dir * forwardOffset;
							offset.z += 0.5;

						#endif

						// endcaps
						if ( position.y > 1.0 || position.y < 0.0 ) {

							offset.xy += dir * 2.0 * forwardOffset;

						}

						// adjust for linewidth
						offset *= linewidth * 0.5;

						// set the world position
						worldPos = ( position.y < 0.5 ) ? start : end;
						worldPos.xyz += offset;

						// project the worldpos
						vec4 clip = projectionMatrix * worldPos;

						// shift the depth of the projected points so the line
						// segments overlap neatly
						vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
						clip.z = clipPose.z * clip.w;

					#else

						vec2 offset = vec2( dir.y, - dir.x );
						// undo aspect ratio adjustment
						dir.x /= aspect;
						offset.x /= aspect;

						// sign flip
						if ( position.x < 0.0 ) offset *= - 1.0;

						// endcaps
						if ( position.y < 0.0 ) {

							offset += - dir;

						} else if ( position.y > 1.0 ) {

							offset += dir;

						}

						// adjust for linewidth
						offset *= linewidth;

						// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
						offset /= resolution.y;

						// select end
						vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;

						// back to clip space
						offset *= clip.w;

						clip.xy += offset;

					#endif

					gl_Position = clip;

					vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation

					#include <logdepthbuf_vertex>
					#include <clipping_planes_vertex>
					#include <fog_vertex>

				}
			`,fragmentShader:`
				uniform vec3 diffuse;
				uniform float opacity;
				uniform float linewidth;

				#ifdef USE_DASH

					uniform float dashOffset;
					uniform float dashSize;
					uniform float gapSize;

				#endif

				varying float vLineDistance;

				#ifdef WORLD_UNITS

					varying vec4 worldPos;
					varying vec3 worldStart;
					varying vec3 worldEnd;

					#ifdef USE_DASH

						varying vec2 vUv;

					#endif

				#else

					varying vec2 vUv;

				#endif

				#include <common>
				#include <fog_pars_fragment>
				#include <logdepthbuf_pars_fragment>
				#include <clipping_planes_pars_fragment>

				#ifdef USE_COLOR
					#ifdef USE_LINE_COLOR_ALPHA
						varying vec4 vLineColor;
					#else
						varying vec3 vLineColor;
					#endif
				#endif

				vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {

					float mua;
					float mub;

					vec3 p13 = p1 - p3;
					vec3 p43 = p4 - p3;

					vec3 p21 = p2 - p1;

					float d1343 = dot( p13, p43 );
					float d4321 = dot( p43, p21 );
					float d1321 = dot( p13, p21 );
					float d4343 = dot( p43, p43 );
					float d2121 = dot( p21, p21 );

					float denom = d2121 * d4343 - d4321 * d4321;

					float numer = d1343 * d4321 - d1321 * d4343;

					mua = numer / denom;
					mua = clamp( mua, 0.0, 1.0 );
					mub = ( d1343 + d4321 * ( mua ) ) / d4343;
					mub = clamp( mub, 0.0, 1.0 );

					return vec2( mua, mub );

				}

				void main() {

					#include <clipping_planes_fragment>

					#ifdef USE_DASH

						if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps

						if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX

					#endif

					float alpha = opacity;

					#ifdef WORLD_UNITS

						// Find the closest points on the view ray and the line segment
						vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
						vec3 lineDir = worldEnd - worldStart;
						vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );

						vec3 p1 = worldStart + lineDir * params.x;
						vec3 p2 = rayEnd * params.y;
						vec3 delta = p1 - p2;
						float len = length( delta );
						float norm = len / linewidth;

						#ifndef USE_DASH

							#ifdef USE_ALPHA_TO_COVERAGE

								float dnorm = fwidth( norm );
								alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );

							#else

								if ( norm > 0.5 ) {

									discard;

								}

							#endif

						#endif

					#else

						#ifdef USE_ALPHA_TO_COVERAGE

							// artifacts appear on some hardware if a derivative is taken within a conditional
							float a = vUv.x;
							float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
							float len2 = a * a + b * b;
							float dlen = fwidth( len2 );

							if ( abs( vUv.y ) > 1.0 ) {

								alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );

							}

						#else

							if ( abs( vUv.y ) > 1.0 ) {

								float a = vUv.x;
								float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
								float len2 = a * a + b * b;

								if ( len2 > 1.0 ) discard;

							}

						#endif

					#endif

					vec4 diffuseColor = vec4( diffuse, alpha );
					#ifdef USE_COLOR
						#ifdef USE_LINE_COLOR_ALPHA
							diffuseColor *= vLineColor;
						#else
							diffuseColor.rgb *= vLineColor;
						#endif
					#endif

					#include <logdepthbuf_fragment>

					gl_FragColor = diffuseColor;

					#include <tonemapping_fragment>
					#include <${Y_>=154?"colorspace_fragment":"encodings_fragment"}>
					#include <fog_fragment>
					#include <premultiplied_alpha_fragment>

				}
			`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(n){this.uniforms.diffuse.value=n}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(n){n===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(n){this.uniforms.linewidth.value=n}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(n){!!n!="USE_DASH"in this.defines&&(this.needsUpdate=!0),n===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(n){this.uniforms.dashScale.value=n}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(n){this.uniforms.dashSize.value=n}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(n){this.uniforms.dashOffset.value=n}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(n){this.uniforms.gapSize.value=n}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(n){this.uniforms.opacity.value=n}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(n){this.uniforms.resolution.value.copy(n)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(n){!!n!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),n===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const oD=new ni,P5=new te,U5=new te,bs=new ni,vs=new ni,Uu=new ni,lD=new te,cD=new Dt,ws=new G$,F5=new te,nE=new rr,iE=new Ur,Fu=new ni;let qu,Lm;function B5(t,e,n){return Fu.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),Fu.multiplyScalar(1/Fu.w),Fu.x=Lm/n.width,Fu.y=Lm/n.height,Fu.applyMatrix4(t.projectionMatrixInverse),Fu.multiplyScalar(1/Fu.w),Math.abs(Math.max(Fu.x,Fu.y))}function yMe(t,e){const n=t.matrixWorld,i=t.geometry,r=i.attributes.instanceStart,a=i.attributes.instanceEnd,s=Math.min(i.instanceCount,r.count);for(let o=0,l=s;o<l;o++){ws.start.fromBufferAttribute(r,o),ws.end.fromBufferAttribute(a,o),ws.applyMatrix4(n);const c=new te,u=new te;qu.distanceSqToSegment(ws.start,ws.end,u,c),u.distanceTo(c)<Lm*.5&&e.push({point:u,pointOnLine:c,distance:qu.origin.distanceTo(u),object:t,face:null,faceIndex:o,uv:null,[IZ]:null})}}function xMe(t,e,n){const i=e.projectionMatrix,a=t.material.resolution,s=t.matrixWorld,o=t.geometry,l=o.attributes.instanceStart,c=o.attributes.instanceEnd,u=Math.min(o.instanceCount,l.count),f=-e.near;qu.at(1,Uu),Uu.w=1,Uu.applyMatrix4(e.matrixWorldInverse),Uu.applyMatrix4(i),Uu.multiplyScalar(1/Uu.w),Uu.x*=a.x/2,Uu.y*=a.y/2,Uu.z=0,lD.copy(Uu),cD.multiplyMatrices(e.matrixWorldInverse,s);for(let h=0,d=u;h<d;h++){if(bs.fromBufferAttribute(l,h),vs.fromBufferAttribute(c,h),bs.w=1,vs.w=1,bs.applyMatrix4(cD),vs.applyMatrix4(cD),bs.z>f&&vs.z>f)continue;if(bs.z>f){const _=bs.z-vs.z,w=(bs.z-f)/_;bs.lerp(vs,w)}else if(vs.z>f){const _=vs.z-bs.z,w=(vs.z-f)/_;vs.lerp(bs,w)}bs.applyMatrix4(i),vs.applyMatrix4(i),bs.multiplyScalar(1/bs.w),vs.multiplyScalar(1/vs.w),bs.x*=a.x/2,bs.y*=a.y/2,vs.x*=a.x/2,vs.y*=a.y/2,ws.start.copy(bs),ws.start.z=0,ws.end.copy(vs),ws.end.z=0;const b=ws.closestPointToPointParameter(lD,!0);ws.at(b,F5);const y=yc.lerp(bs.z,vs.z,b),p=y>=-1&&y<=1,x=lD.distanceTo(F5)<Lm*.5;if(p&&x){ws.start.fromBufferAttribute(l,h),ws.end.fromBufferAttribute(c,h),ws.start.applyMatrix4(s),ws.end.applyMatrix4(s);const _=new te,w=new te;qu.distanceSqToSegment(ws.start,ws.end,w,_),n.push({point:w,pointOnLine:_,distance:qu.origin.distanceTo(w),object:t,face:null,faceIndex:h,uv:null,[IZ]:null})}}}class LU extends _i{constructor(e=new SC,n=new wC({color:Math.random()*16777215})){super(e,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,n=e.attributes.instanceStart,i=e.attributes.instanceEnd,r=new Float32Array(2*n.count);for(let s=0,o=0,l=n.count;s<l;s++,o+=2)P5.fromBufferAttribute(n,s),U5.fromBufferAttribute(i,s),r[o]=o===0?0:r[o-1],r[o+1]=r[o]+P5.distanceTo(U5);const a=new rT(r,2,1);return e.setAttribute("instanceDistanceStart",new zo(a,1,0)),e.setAttribute("instanceDistanceEnd",new zo(a,1,1)),this}raycast(e,n){const i=this.material.worldUnits,r=e.camera;r===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=e.params.Line2!==void 0&&e.params.Line2.threshold||0;qu=e.ray;const s=this.matrixWorld,o=this.geometry,l=this.material;Lm=l.linewidth+a,o.boundingSphere===null&&o.computeBoundingSphere(),iE.copy(o.boundingSphere).applyMatrix4(s);let c;if(i)c=Lm*.5;else{const f=Math.max(r.near,iE.distanceToPoint(qu.origin));c=B5(r,f,l.resolution)}if(iE.radius+=c,qu.intersectsSphere(iE)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),nE.copy(o.boundingBox).applyMatrix4(s);let u;if(i)u=Lm*.5;else{const f=Math.max(r.near,nE.distanceToPoint(qu.origin));u=B5(r,f,l.resolution)}nE.expandByScalar(u),qu.intersectsBox(nE)!==!1&&(i?yMe(this,n):xMe(this,r,n))}onBeforeRender(e){const n=this.material.uniforms;n&&n.resolution&&(e.getViewport(oD),this.material.uniforms.resolution.value.set(oD.z,oD.w))}}class HZ extends LU{constructor(e=new NU,n=new wC({color:Math.random()*16777215})){super(e,n),this.isLine2=!0,this.type="Line2"}}const _Me=new te,SMe=new te,wMe=new te,EMe=(t,e,n)=>{const i=n.width/2,r=n.height/2;e.updateMatrixWorld(!1);const a=t.project(e);return a.x=a.x*i+i,a.y=-(a.y*r)+r,a},MMe=(t,e,n,i=1)=>{const r=_Me.set(t.x/n.width*2-1,-(t.y/n.height)*2+1,i);return r.unproject(e),r},VZ=(t,e,n,i)=>{const r=EMe(wMe.copy(t),n,i);let a=0;for(let s=0;s<2;++s){const o=SMe.copy(r).setComponent(s,r.getComponent(s)+e),l=MMe(o,n,i,o.z);a=Math.max(a,t.distanceTo(l))}return a},Qm=I.forwardRef(function({points:e,color:n=16777215,vertexColors:i,linewidth:r,lineWidth:a,segments:s,dashed:o,...l},c){var u,f;const h=ki(p=>p.size),d=I.useMemo(()=>s?new LU:new HZ,[s]),[g]=I.useState(()=>new wC),b=(i==null||(u=i[0])==null?void 0:u.length)===4?4:3,y=I.useMemo(()=>{const p=s?new SC:new NU,x=e.map(_=>{const w=Array.isArray(_);return _ instanceof te||_ instanceof ni?[_.x,_.y,_.z]:_ instanceof wt?[_.x,_.y,0]:w&&_.length===3?[_[0],_[1],_[2]]:w&&_.length===2?[_[0],_[1],0]:_});if(p.setPositions(x.flat()),i){n=16777215;const _=i.map(w=>w instanceof Ut?w.toArray():w);p.setColors(_.flat(),b)}return p},[e,s,i,b]);return I.useLayoutEffect(()=>{d.computeLineDistances()},[e,d]),I.useLayoutEffect(()=>{o?g.defines.USE_DASH="":delete g.defines.USE_DASH,g.needsUpdate=!0},[o,g]),I.useEffect(()=>()=>{y.dispose(),g.dispose()},[y]),I.createElement("primitive",Ls({object:d,ref:c},l),I.createElement("primitive",{object:y,attach:"geometry"}),I.createElement("primitive",Ls({object:g,attach:"material",color:n,vertexColors:!!i,resolution:[h.width,h.height],linewidth:(f=r??a)!==null&&f!==void 0?f:1,dashed:o,transparent:b===4},l)))}),TMe=I.forwardRef(function({start:e,end:n,midA:i,midB:r,segments:a=20,...s},o){const l=I.useMemo(()=>{const c=e instanceof te?e:new te(...e),u=n instanceof te?n:new te(...n),f=i instanceof te?i:new te(...i),h=r instanceof te?r:new te(...r);return new sU(c,f,h,u).getPoints(a)},[e,n,i,r,a]);return I.createElement(Qm,Ls({ref:o,points:l},s))}),AMe=I.forwardRef(function({points:e,closed:n=!1,curveType:i="centripetal",tension:r=.5,segments:a=20,vertexColors:s,...o},l){const c=I.useMemo(()=>{const h=e.map(d=>d instanceof te?d:new te(...d));return new rU(h,n,i,r)},[e,n,i,r]),u=I.useMemo(()=>c.getPoints(a),[c,a]),f=I.useMemo(()=>{if(!s||s.length<2)return;if(s.length===a+1)return s;const h=s.map(b=>b instanceof Ut?b:new Ut(...b));n&&h.push(h[0].clone());const d=[h[0]],g=a/(h.length-1);for(let b=1;b<a;b++){const y=b%g/g,p=Math.floor(b/g);d.push(h[p].clone().lerp(h[p+1],y))}return d.push(h[h.length-1]),d},[s,a]);return I.createElement(Qm,Ls({ref:l,points:u,vertexColors:f},o))});function CMe(){var t=Object.create(null);function e(r,a){var s=r.id,o=r.name,l=r.dependencies;l===void 0&&(l=[]);var c=r.init;c===void 0&&(c=function(){});var u=r.getTransferables;if(u===void 0&&(u=null),!t[s])try{l=l.map(function(h){return h&&h.isWorkerModule&&(e(h,function(d){if(d instanceof Error)throw d}),h=t[h.id].value),h}),c=i("<"+o+">.init",c),u&&(u=i("<"+o+">.getTransferables",u));var f=null;typeof c=="function"?f=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),t[s]={id:s,value:f,getTransferables:u},a(f)}catch(h){h&&h.noLog||console.error(h),a(h)}}function n(r,a){var s,o=r.id,l=r.args;(!t[o]||typeof t[o].value!="function")&&a(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var c=(s=t[o]).value.apply(s,l);c&&typeof c.then=="function"?c.then(u,function(f){return a(f instanceof Error?f:new Error(""+f))}):u(c)}catch(f){a(f)}function u(f){try{var h=t[o].getTransferables&&t[o].getTransferables(f);(!h||!Array.isArray(h)||!h.length)&&(h=void 0),a(f,h)}catch(d){console.error(d),a(d)}}}function i(r,a){var s=void 0;self.troikaDefine=function(l){return s=l};var o=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/

troikaDefine(
`+a+`
)`],{type:"application/javascript"}));try{importScripts(o)}catch(l){console.error(l)}return URL.revokeObjectURL(o),delete self.troikaDefine,s}self.addEventListener("message",function(r){var a=r.data,s=a.messageId,o=a.action,l=a.data;try{o==="registerModule"&&e(l,function(c){c instanceof Error?postMessage({messageId:s,success:!1,error:c.message}):postMessage({messageId:s,success:!0,result:{isCallable:typeof c=="function"}})}),o==="callModule"&&n(l,function(c,u){c instanceof Error?postMessage({messageId:s,success:!1,error:c.message}):postMessage({messageId:s,success:!0,result:c},u||void 0)})}catch(c){postMessage({messageId:s,success:!1,error:c.stack})}})}function RMe(t){var e=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,n);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var n=t.dependencies,i=t.init;n=Array.isArray(n)?n.map(function(a){return a&&(a=a.onMainThread||a,a._getInitResult&&(a=a._getInitResult())),a}):[];var r=Promise.all(n).then(function(a){return i.apply(null,a)});return e._getInitResult=function(){return r},r},e}var GZ=function(){var t=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),t=!0}catch(n){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return GZ=function(){return t},t},kMe=0,DMe=0,uD=!1,u1=Object.create(null),f1=Object.create(null),xI=Object.create(null);function ny(t){if((!t||typeof t.init!="function")&&!uD)throw new Error("requires `options.init` function");var e=t.dependencies,n=t.init,i=t.getTransferables,r=t.workerId,a=RMe(t);r==null&&(r="#default");var s="workerModule"+ ++kMe,o=t.name||s,l=null;e=e&&e.map(function(u){return typeof u=="function"&&!u.workerModuleData&&(uD=!0,u=ny({workerId:r,name:"<"+o+"> function dependency: "+u.name,init:`function(){return (
`+bM(u)+`
)}`}),uD=!1),u&&u.workerModuleData&&(u=u.workerModuleData),u});function c(){for(var u=[],f=arguments.length;f--;)u[f]=arguments[f];if(!GZ())return a.apply(void 0,u);if(!l){l=z5(r,"registerModule",c.workerModuleData);var h=function(){l=null,f1[r].delete(h)};(f1[r]||(f1[r]=new Set)).add(h)}return l.then(function(d){var g=d.isCallable;if(g)return z5(r,"callModule",{id:s,args:u});throw new Error("Worker module function was called but `init` did not return a callable function")})}return c.workerModuleData={isWorkerModule:!0,id:s,name:o,dependencies:e,init:bM(n),getTransferables:i&&bM(i)},c.onMainThread=a,c}function OMe(t){f1[t]&&f1[t].forEach(function(e){e()}),u1[t]&&(u1[t].terminate(),delete u1[t])}function bM(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function IMe(t){var e=u1[t];if(!e){var n=bM(CMe);e=u1[t]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+t.replace(/\*/g,"")+` **/

;(`+n+")()"],{type:"application/javascript"}))),e.onmessage=function(i){var r=i.data,a=r.messageId,s=xI[a];if(!s)throw new Error("WorkerModule response with empty or unknown messageId");delete xI[a],s(r)}}return e}function z5(t,e,n){return new Promise(function(i,r){var a=++DMe;xI[a]=function(s){s.success?i(s.result):r(new Error("Error in worker "+e+" call: "+s.error))},IMe(t).postMessage({messageId:a,action:e,data:n})})}function WZ(){var t=function(e){function n(W,B,Y,Z,G,de,oe,le){var ue=1-oe;le.x=ue*ue*W+2*ue*oe*Y+oe*oe*G,le.y=ue*ue*B+2*ue*oe*Z+oe*oe*de}function i(W,B,Y,Z,G,de,oe,le,ue,Se){var Te=1-ue;Se.x=Te*Te*Te*W+3*Te*Te*ue*Y+3*Te*ue*ue*G+ue*ue*ue*oe,Se.y=Te*Te*Te*B+3*Te*Te*ue*Z+3*Te*ue*ue*de+ue*ue*ue*le}function r(W,B){for(var Y=/([MLQCZ])([^MLQCZ]*)/g,Z,G,de,oe,le;Z=Y.exec(W);){var ue=Z[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(Se){return parseFloat(Se)});switch(Z[1]){case"M":oe=G=ue[0],le=de=ue[1];break;case"L":(ue[0]!==oe||ue[1]!==le)&&B("L",oe,le,oe=ue[0],le=ue[1]);break;case"Q":{B("Q",oe,le,oe=ue[2],le=ue[3],ue[0],ue[1]);break}case"C":{B("C",oe,le,oe=ue[4],le=ue[5],ue[0],ue[1],ue[2],ue[3]);break}case"Z":(oe!==G||le!==de)&&B("L",oe,le,G,de);break}}}function a(W,B,Y){Y===void 0&&(Y=16);var Z={x:0,y:0};r(W,function(G,de,oe,le,ue,Se,Te,Pe,je){switch(G){case"L":B(de,oe,le,ue);break;case"Q":{for(var He=de,pe=oe,ze=1;ze<Y;ze++)n(de,oe,Se,Te,le,ue,ze/(Y-1),Z),B(He,pe,Z.x,Z.y),He=Z.x,pe=Z.y;break}case"C":{for(var Ie=de,Xe=oe,we=1;we<Y;we++)i(de,oe,Se,Te,Pe,je,le,ue,we/(Y-1),Z),B(Ie,Xe,Z.x,Z.y),Ie=Z.x,Xe=Z.y;break}}})}var s="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",l=new WeakMap,c={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function u(W,B){var Y=W.getContext?W.getContext("webgl",c):W,Z=l.get(Y);if(!Z){let Te=function(Ie){var Xe=de[Ie];if(!Xe&&(Xe=de[Ie]=Y.getExtension(Ie),!Xe))throw new Error(Ie+" not supported");return Xe},Pe=function(Ie,Xe){var we=Y.createShader(Xe);return Y.shaderSource(we,Ie),Y.compileShader(we),we},je=function(Ie,Xe,we,Ae){if(!oe[Ie]){var Re={},Ne={},Fe=Y.createProgram();Y.attachShader(Fe,Pe(Xe,Y.VERTEX_SHADER)),Y.attachShader(Fe,Pe(we,Y.FRAGMENT_SHADER)),Y.linkProgram(Fe),oe[Ie]={program:Fe,transaction:function(ae){Y.useProgram(Fe),ae({setUniform:function(ce,he){for(var me=[],$=arguments.length-2;$-- >0;)me[$]=arguments[$+2];var Ve=Ne[he]||(Ne[he]=Y.getUniformLocation(Fe,he));Y["uniform"+ce].apply(Y,[Ve].concat(me))},setAttribute:function(ce,he,me,$,Ve){var qe=Re[ce];qe||(qe=Re[ce]={buf:Y.createBuffer(),loc:Y.getAttribLocation(Fe,ce),data:null}),Y.bindBuffer(Y.ARRAY_BUFFER,qe.buf),Y.vertexAttribPointer(qe.loc,he,Y.FLOAT,!1,0,0),Y.enableVertexAttribArray(qe.loc),G?Y.vertexAttribDivisor(qe.loc,$):Te("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(qe.loc,$),Ve!==qe.data&&(Y.bufferData(Y.ARRAY_BUFFER,Ve,me),qe.data=Ve)}})}}}oe[Ie].transaction(Ae)},He=function(Ie,Xe){ue++;try{Y.activeTexture(Y.TEXTURE0+ue);var we=le[Ie];we||(we=le[Ie]=Y.createTexture(),Y.bindTexture(Y.TEXTURE_2D,we),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MIN_FILTER,Y.NEAREST),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MAG_FILTER,Y.NEAREST)),Y.bindTexture(Y.TEXTURE_2D,we),Xe(we,ue)}finally{ue--}},pe=function(Ie,Xe,we){var Ae=Y.createFramebuffer();Se.push(Ae),Y.bindFramebuffer(Y.FRAMEBUFFER,Ae),Y.activeTexture(Y.TEXTURE0+Xe),Y.bindTexture(Y.TEXTURE_2D,Ie),Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_2D,Ie,0);try{we(Ae)}finally{Y.deleteFramebuffer(Ae),Y.bindFramebuffer(Y.FRAMEBUFFER,Se[--Se.length-1]||null)}},ze=function(){de={},oe={},le={},ue=-1,Se.length=0};var G=typeof WebGL2RenderingContext<"u"&&Y instanceof WebGL2RenderingContext,de={},oe={},le={},ue=-1,Se=[];Y.canvas.addEventListener("webglcontextlost",function(Ie){ze(),Ie.preventDefault()},!1),l.set(Y,Z={gl:Y,isWebGL2:G,getExtension:Te,withProgram:je,withTexture:He,withTextureFramebuffer:pe,handleContextLoss:ze})}B(Z)}function f(W,B,Y,Z,G,de,oe,le){oe===void 0&&(oe=15),le===void 0&&(le=null),u(W,function(ue){var Se=ue.gl,Te=ue.withProgram,Pe=ue.withTexture;Pe("copy",function(je,He){Se.texImage2D(Se.TEXTURE_2D,0,Se.RGBA,G,de,0,Se.RGBA,Se.UNSIGNED_BYTE,B),Te("copy",s,o,function(pe){var ze=pe.setUniform,Ie=pe.setAttribute;Ie("aUV",2,Se.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ze("1i","image",He),Se.bindFramebuffer(Se.FRAMEBUFFER,le||null),Se.disable(Se.BLEND),Se.colorMask(oe&8,oe&4,oe&2,oe&1),Se.viewport(Y,Z,G,de),Se.scissor(Y,Z,G,de),Se.drawArrays(Se.TRIANGLES,0,3)})})})}function h(W,B,Y){var Z=W.width,G=W.height;u(W,function(de){var oe=de.gl,le=new Uint8Array(Z*G*4);oe.readPixels(0,0,Z,G,oe.RGBA,oe.UNSIGNED_BYTE,le),W.width=B,W.height=Y,f(oe,le,0,0,Z,G)})}var d=Object.freeze({__proto__:null,withWebGLContext:u,renderImageData:f,resizeWebGLCanvasWithoutClearing:h});function g(W,B,Y,Z,G,de){de===void 0&&(de=1);var oe=new Uint8Array(W*B),le=Z[2]-Z[0],ue=Z[3]-Z[1],Se=[];a(Y,function(Ie,Xe,we,Ae){Se.push({x1:Ie,y1:Xe,x2:we,y2:Ae,minX:Math.min(Ie,we),minY:Math.min(Xe,Ae),maxX:Math.max(Ie,we),maxY:Math.max(Xe,Ae)})}),Se.sort(function(Ie,Xe){return Ie.maxX-Xe.maxX});for(var Te=0;Te<W;Te++)for(var Pe=0;Pe<B;Pe++){var je=pe(Z[0]+le*(Te+.5)/W,Z[1]+ue*(Pe+.5)/B),He=Math.pow(1-Math.abs(je)/G,de)/2;je<0&&(He=1-He),He=Math.max(0,Math.min(255,Math.round(He*255))),oe[Pe*W+Te]=He}return oe;function pe(Ie,Xe){for(var we=1/0,Ae=1/0,Re=Se.length;Re--;){var Ne=Se[Re];if(Ne.maxX+Ae<=Ie)break;if(Ie+Ae>Ne.minX&&Xe-Ae<Ne.maxY&&Xe+Ae>Ne.minY){var Fe=p(Ie,Xe,Ne.x1,Ne.y1,Ne.x2,Ne.y2);Fe<we&&(we=Fe,Ae=Math.sqrt(we))}}return ze(Ie,Xe)&&(Ae=-Ae),Ae}function ze(Ie,Xe){for(var we=0,Ae=Se.length;Ae--;){var Re=Se[Ae];if(Re.maxX<=Ie)break;var Ne=Re.y1>Xe!=Re.y2>Xe&&Ie<(Re.x2-Re.x1)*(Xe-Re.y1)/(Re.y2-Re.y1)+Re.x1;Ne&&(we+=Re.y1<Re.y2?1:-1)}return we!==0}}function b(W,B,Y,Z,G,de,oe,le,ue,Se){de===void 0&&(de=1),le===void 0&&(le=0),ue===void 0&&(ue=0),Se===void 0&&(Se=0),y(W,B,Y,Z,G,de,oe,null,le,ue,Se)}function y(W,B,Y,Z,G,de,oe,le,ue,Se,Te){de===void 0&&(de=1),ue===void 0&&(ue=0),Se===void 0&&(Se=0),Te===void 0&&(Te=0);for(var Pe=g(W,B,Y,Z,G,de),je=new Uint8Array(Pe.length*4),He=0;He<Pe.length;He++)je[He*4+Te]=Pe[He];f(oe,je,ue,Se,W,B,1<<3-Te,le)}function p(W,B,Y,Z,G,de){var oe=G-Y,le=de-Z,ue=oe*oe+le*le,Se=ue?Math.max(0,Math.min(1,((W-Y)*oe+(B-Z)*le)/ue)):0,Te=W-(Y+Se*oe),Pe=B-(Z+Se*le);return Te*Te+Pe*Pe}var x=Object.freeze({__proto__:null,generate:g,generateIntoCanvas:b,generateIntoFramebuffer:y}),_="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",w="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",M="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",S=new Float32Array([0,0,2,0,0,2]),A=null,C=!1,k={},R=new WeakMap;function N(W){if(!C&&!X(W))throw new Error("WebGL generation not supported")}function P(W,B,Y,Z,G,de,oe){if(de===void 0&&(de=1),oe===void 0&&(oe=null),!oe&&(oe=A,!oe)){var le=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!le)throw new Error("OffscreenCanvas or DOM canvas not supported");oe=A=le.getContext("webgl",{depth:!1})}N(oe);var ue=new Uint8Array(W*B*4);u(oe,function(je){var He=je.gl,pe=je.withTexture,ze=je.withTextureFramebuffer;pe("readable",function(Ie,Xe){He.texImage2D(He.TEXTURE_2D,0,He.RGBA,W,B,0,He.RGBA,He.UNSIGNED_BYTE,null),ze(Ie,Xe,function(we){z(W,B,Y,Z,G,de,He,we,0,0,0),He.readPixels(0,0,W,B,He.RGBA,He.UNSIGNED_BYTE,ue)})})});for(var Se=new Uint8Array(W*B),Te=0,Pe=0;Te<ue.length;Te+=4)Se[Pe++]=ue[Te];return Se}function j(W,B,Y,Z,G,de,oe,le,ue,Se){de===void 0&&(de=1),le===void 0&&(le=0),ue===void 0&&(ue=0),Se===void 0&&(Se=0),z(W,B,Y,Z,G,de,oe,null,le,ue,Se)}function z(W,B,Y,Z,G,de,oe,le,ue,Se,Te){de===void 0&&(de=1),ue===void 0&&(ue=0),Se===void 0&&(Se=0),Te===void 0&&(Te=0),N(oe);var Pe=[];a(Y,function(je,He,pe,ze){Pe.push(je,He,pe,ze)}),Pe=new Float32Array(Pe),u(oe,function(je){var He=je.gl,pe=je.isWebGL2,ze=je.getExtension,Ie=je.withProgram,Xe=je.withTexture,we=je.withTextureFramebuffer,Ae=je.handleContextLoss;if(Xe("rawDistances",function(Re,Ne){(W!==Re._lastWidth||B!==Re._lastHeight)&&He.texImage2D(He.TEXTURE_2D,0,He.RGBA,Re._lastWidth=W,Re._lastHeight=B,0,He.RGBA,He.UNSIGNED_BYTE,null),Ie("main",_,w,function(Fe){var Qe=Fe.setAttribute,ae=Fe.setUniform,K=!pe&&ze("ANGLE_instanced_arrays"),ce=!pe&&ze("EXT_blend_minmax");Qe("aUV",2,He.STATIC_DRAW,0,S),Qe("aLineSegment",4,He.DYNAMIC_DRAW,1,Pe),ae.apply(void 0,["4f","uGlyphBounds"].concat(Z)),ae("1f","uMaxDistance",G),ae("1f","uExponent",de),we(Re,Ne,function(he){He.enable(He.BLEND),He.colorMask(!0,!0,!0,!0),He.viewport(0,0,W,B),He.scissor(0,0,W,B),He.blendFunc(He.ONE,He.ONE),He.blendEquationSeparate(He.FUNC_ADD,pe?He.MAX:ce.MAX_EXT),He.clear(He.COLOR_BUFFER_BIT),pe?He.drawArraysInstanced(He.TRIANGLES,0,3,Pe.length/4):K.drawArraysInstancedANGLE(He.TRIANGLES,0,3,Pe.length/4)})}),Ie("post",s,M,function(Fe){Fe.setAttribute("aUV",2,He.STATIC_DRAW,0,S),Fe.setUniform("1i","tex",Ne),He.bindFramebuffer(He.FRAMEBUFFER,le),He.disable(He.BLEND),He.colorMask(Te===0,Te===1,Te===2,Te===3),He.viewport(ue,Se,W,B),He.scissor(ue,Se,W,B),He.drawArrays(He.TRIANGLES,0,3)})}),He.isContextLost())throw Ae(),new Error("webgl context lost")})}function X(W){var B=!W||W===A?k:W.canvas||W,Y=R.get(B);if(Y===void 0){C=!0;var Z=null;try{var G=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],de=P(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,W);Y=de&&G.length===de.length&&de.every(function(oe,le){return oe===G[le]}),Y||(Z="bad trial run results",console.info(G,de))}catch(oe){Y=!1,Z=oe.message}Z&&console.warn("WebGL SDF generation not supported:",Z),C=!1,R.set(B,Y)}return Y}var F=Object.freeze({__proto__:null,generate:P,generateIntoCanvas:j,generateIntoFramebuffer:z,isSupported:X});function H(W,B,Y,Z,G,de){G===void 0&&(G=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),de===void 0&&(de=1);try{return P.apply(F,arguments)}catch(oe){return console.info("WebGL SDF generation failed, falling back to JS",oe),g.apply(x,arguments)}}function V(W,B,Y,Z,G,de,oe,le,ue,Se){G===void 0&&(G=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),de===void 0&&(de=1),le===void 0&&(le=0),ue===void 0&&(ue=0),Se===void 0&&(Se=0);try{return j.apply(F,arguments)}catch(Te){return console.info("WebGL SDF generation failed, falling back to JS",Te),b.apply(x,arguments)}}return e.forEachPathCommand=r,e.generate=H,e.generateIntoCanvas=V,e.javascript=x,e.pathToLineSegments=a,e.webgl=F,e.webglUtils=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}function NMe(){var t=function(e){var n={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},r={};i.L=1,r[1]="L",Object.keys(n).forEach(function(Ae,Re){i[Ae]=1<<Re+1,r[i[Ae]]=Ae}),Object.freeze(i);var a=i.LRI|i.RLI|i.FSI,s=i.L|i.R|i.AL,o=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,l=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,c=i.S|i.WS|i.B|a|i.PDI|l,u=null;function f(){if(!u){u=new Map;var Ae=function(Ne){if(n.hasOwnProperty(Ne)){var Fe=0;n[Ne].split(",").forEach(function(Qe){var ae=Qe.split("+"),K=ae[0],ce=ae[1];K=parseInt(K,36),ce=ce?parseInt(ce,36):0,u.set(Fe+=K,i[Ne]);for(var he=0;he<ce;he++)u.set(++Fe,i[Ne])})}};for(var Re in n)Ae(Re)}}function h(Ae){return f(),u.get(Ae.codePointAt(0))||i.L}function d(Ae){return r[h(Ae)]}var g={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function b(Ae,Re){var Ne=36,Fe=0,Qe=new Map,ae=Re&&new Map,K;return Ae.split(",").forEach(function ce(he){if(he.indexOf("+")!==-1)for(var me=+he;me--;)ce(K);else{K=he;var $=he.split(">"),Ve=$[0],qe=$[1];Ve=String.fromCodePoint(Fe+=parseInt(Ve,Ne)),qe=String.fromCodePoint(Fe+=parseInt(qe,Ne)),Qe.set(Ve,qe),Re&&ae.set(qe,Ve)}}),{map:Qe,reverseMap:ae}}var y,p,x;function _(){if(!y){var Ae=b(g.pairs,!0),Re=Ae.map,Ne=Ae.reverseMap;y=Re,p=Ne,x=b(g.canonical,!1).map}}function w(Ae){return _(),y.get(Ae)||null}function M(Ae){return _(),p.get(Ae)||null}function S(Ae){return _(),x.get(Ae)||null}var A=i.L,C=i.R,k=i.EN,R=i.ES,N=i.ET,P=i.AN,j=i.CS,z=i.B,X=i.S,F=i.ON,H=i.BN,V=i.NSM,W=i.AL,B=i.LRO,Y=i.RLO,Z=i.LRE,G=i.RLE,de=i.PDF,oe=i.LRI,le=i.RLI,ue=i.FSI,Se=i.PDI;function Te(Ae,Re){for(var Ne=125,Fe=new Uint32Array(Ae.length),Qe=0;Qe<Ae.length;Qe++)Fe[Qe]=h(Ae[Qe]);var ae=new Map;function K(br,Wr){var ur=Fe[br];Fe[br]=Wr,ae.set(ur,ae.get(ur)-1),ur&o&&ae.set(o,ae.get(o)-1),ae.set(Wr,(ae.get(Wr)||0)+1),Wr&o&&ae.set(o,(ae.get(o)||0)+1)}for(var ce=new Uint8Array(Ae.length),he=new Map,me=[],$=null,Ve=0;Ve<Ae.length;Ve++)$||me.push($={start:Ve,end:Ae.length-1,level:Re==="rtl"?1:Re==="ltr"?0:Fc(Ve,!1)}),Fe[Ve]&z&&($.end=Ve,$=null);for(var qe=G|Z|Y|B|a|Se|de|z,mt=function(br){return br+(br&1?1:2)},Ge=function(br){return br+(br&1?2:1)},Je=0;Je<me.length;Je++){$=me[Je];var Ye=[{_level:$.level,_override:0,_isolate:0}],vt=void 0,Mt=0,gt=0,kt=0;ae.clear();for(var ke=$.start;ke<=$.end;ke++){var Le=Fe[ke];if(vt=Ye[Ye.length-1],ae.set(Le,(ae.get(Le)||0)+1),Le&o&&ae.set(o,(ae.get(o)||0)+1),Le&qe)if(Le&(G|Z)){ce[ke]=vt._level;var ht=(Le===G?Ge:mt)(vt._level);ht<=Ne&&!Mt&&!gt?Ye.push({_level:ht,_override:0,_isolate:0}):Mt||gt++}else if(Le&(Y|B)){ce[ke]=vt._level;var jt=(Le===Y?Ge:mt)(vt._level);jt<=Ne&&!Mt&&!gt?Ye.push({_level:jt,_override:Le&Y?C:A,_isolate:0}):Mt||gt++}else if(Le&a){Le&ue&&(Le=Fc(ke+1,!0)===1?le:oe),ce[ke]=vt._level,vt._override&&K(ke,vt._override);var ot=(Le===le?Ge:mt)(vt._level);ot<=Ne&&Mt===0&&gt===0?(kt++,Ye.push({_level:ot,_override:0,_isolate:1,_isolInitIndex:ke})):Mt++}else if(Le&Se){if(Mt>0)Mt--;else if(kt>0){for(gt=0;!Ye[Ye.length-1]._isolate;)Ye.pop();var it=Ye[Ye.length-1]._isolInitIndex;it!=null&&(he.set(it,ke),he.set(ke,it)),Ye.pop(),kt--}vt=Ye[Ye.length-1],ce[ke]=vt._level,vt._override&&K(ke,vt._override)}else Le&de?(Mt===0&&(gt>0?gt--:!vt._isolate&&Ye.length>1&&(Ye.pop(),vt=Ye[Ye.length-1])),ce[ke]=vt._level):Le&z&&(ce[ke]=$.level);else ce[ke]=vt._level,vt._override&&Le!==H&&K(ke,vt._override)}for(var bt=[],Jt=null,Kt=$.start;Kt<=$.end;Kt++){var un=Fe[Kt];if(!(un&l)){var Vn=ce[Kt],vn=un&a,Qn=un===Se;Jt&&Vn===Jt._level?(Jt._end=Kt,Jt._endsWithIsolInit=vn):bt.push(Jt={_start:Kt,_end:Kt,_level:Vn,_startsWithPDI:Qn,_endsWithIsolInit:vn})}}for(var Yn=[],xi=0;xi<bt.length;xi++){var qn=bt[xi];if(!qn._startsWithPDI||qn._startsWithPDI&&!he.has(qn._start)){for(var Ji=[Jt=qn],hi=void 0;Jt&&Jt._endsWithIsolInit&&(hi=he.get(Jt._end))!=null;)for(var on=xi+1;on<bt.length;on++)if(bt[on]._start===hi){Ji.push(Jt=bt[on]);break}for(var Ii=[],ri=0;ri<Ji.length;ri++)for(var se=Ji[ri],ge=se._start;ge<=se._end;ge++)Ii.push(ge);for(var Ue=ce[Ii[0]],rt=$.level,dt=Ii[0]-1;dt>=0;dt--)if(!(Fe[dt]&l)){rt=ce[dt];break}var lt=Ii[Ii.length-1],At=ce[lt],ee=$.level;if(!(Fe[lt]&a)){for(var xe=lt+1;xe<=$.end;xe++)if(!(Fe[xe]&l)){ee=ce[xe];break}}Yn.push({_seqIndices:Ii,_sosType:Math.max(rt,Ue)%2?C:A,_eosType:Math.max(ee,At)%2?C:A})}}for(var Ce=0;Ce<Yn.length;Ce++){var Oe=Yn[Ce],ve=Oe._seqIndices,_t=Oe._sosType,ft=Oe._eosType,yt=ce[ve[0]]&1?C:A;if(ae.get(V))for(var St=0;St<ve.length;St++){var Nt=ve[St];if(Fe[Nt]&V){for(var Xt=_t,at=St-1;at>=0;at--)if(!(Fe[ve[at]]&l)){Xt=Fe[ve[at]];break}K(Nt,Xt&(a|Se)?F:Xt)}}if(ae.get(k))for(var nn=0;nn<ve.length;nn++){var pn=ve[nn];if(Fe[pn]&k)for(var dn=nn-1;dn>=-1;dn--){var Dn=dn===-1?_t:Fe[ve[dn]];if(Dn&s){Dn===W&&K(pn,P);break}}}if(ae.get(W))for(var $t=0;$t<ve.length;$t++){var Yt=ve[$t];Fe[Yt]&W&&K(Yt,C)}if(ae.get(R)||ae.get(j))for(var Un=1;Un<ve.length-1;Un++){var xn=ve[Un];if(Fe[xn]&(R|j)){for(var Zn=0,Nn=0,An=Un-1;An>=0&&(Zn=Fe[ve[An]],!!(Zn&l));An--);for(var Sn=Un+1;Sn<ve.length&&(Nn=Fe[ve[Sn]],!!(Nn&l));Sn++);Zn===Nn&&(Fe[xn]===R?Zn===k:Zn&(k|P))&&K(xn,Zn)}}if(ae.get(k))for(var an=0;an<ve.length;an++){var di=ve[an];if(Fe[di]&k){for(var Li=an-1;Li>=0&&Fe[ve[Li]]&(N|l);Li--)K(ve[Li],k);for(an++;an<ve.length&&Fe[ve[an]]&(N|l|k);an++)Fe[ve[an]]!==k&&K(ve[an],k)}}if(ae.get(N)||ae.get(R)||ae.get(j))for(var Gn=0;Gn<ve.length;Gn++){var wi=ve[Gn];if(Fe[wi]&(N|R|j)){K(wi,F);for(var Sa=Gn-1;Sa>=0&&Fe[ve[Sa]]&l;Sa--)K(ve[Sa],F);for(var Gi=Gn+1;Gi<ve.length&&Fe[ve[Gi]]&l;Gi++)K(ve[Gi],F)}}if(ae.get(k))for(var Yo=0,Bs=_t;Yo<ve.length;Yo++){var ko=ve[Yo],ds=Fe[ko];ds&k?Bs===A&&K(ko,A):ds&s&&(Bs=ds)}if(ae.get(o)){var _n=C|k|P,Wa=_n|A,ps=[];{for(var Xa=[],$i=0;$i<ve.length;$i++)if(Fe[ve[$i]]&o){var so=Ae[ve[$i]],zs=void 0;if(w(so)!==null)if(Xa.length<63)Xa.push({char:so,seqIndex:$i});else break;else if((zs=M(so))!==null)for(var js=Xa.length-1;js>=0;js--){var E=Xa[js].char;if(E===zs||E===M(S(so))||w(S(E))===so){ps.push([Xa[js].seqIndex,$i]),Xa.length=js;break}}}ps.sort(function(br,Wr){return br[0]-Wr[0]})}for(var L=0;L<ps.length;L++){for(var J=ps[L],re=J[0],ye=J[1],$e=!1,tt=0,Lt=re+1;Lt<ye;Lt++){var zt=ve[Lt];if(Fe[zt]&Wa){$e=!0;var gn=Fe[zt]&_n?C:A;if(gn===yt){tt=gn;break}}}if($e&&!tt){tt=_t;for(var Mn=re-1;Mn>=0;Mn--){var Ei=ve[Mn];if(Fe[Ei]&Wa){var Cn=Fe[Ei]&_n?C:A;Cn!==yt?tt=Cn:tt=yt;break}}}if(tt){if(Fe[ve[re]]=Fe[ve[ye]]=tt,tt!==yt){for(var ai=re+1;ai<ve.length;ai++)if(!(Fe[ve[ai]]&l)){h(Ae[ve[ai]])&V&&(Fe[ve[ai]]=tt);break}}if(tt!==yt){for(var Ar=ye+1;Ar<ve.length;Ar++)if(!(Fe[ve[Ar]]&l)){h(Ae[ve[Ar]])&V&&(Fe[ve[Ar]]=tt);break}}}}for(var Mi=0;Mi<ve.length;Mi++)if(Fe[ve[Mi]]&o){for(var Hi=Mi,Ui=Mi,pi=_t,Ia=Mi-1;Ia>=0;Ia--)if(Fe[ve[Ia]]&l)Hi=Ia;else{pi=Fe[ve[Ia]]&_n?C:A;break}for(var Pl=ft,Jo=Mi+1;Jo<ve.length;Jo++)if(Fe[ve[Jo]]&(o|l))Ui=Jo;else{Pl=Fe[ve[Jo]]&_n?C:A;break}for(var Na=Hi;Na<=Ui;Na++)Fe[ve[Na]]=pi===Pl?pi:yt;Mi=Ui}}}for(var sr=$.start;sr<=$.end;sr++){var op=ce[sr],Cr=Fe[sr];if(op&1?Cr&(A|k|P)&&ce[sr]++:Cr&C?ce[sr]++:Cr&(P|k)&&(ce[sr]+=2),Cr&l&&(ce[sr]=sr===0?$.level:ce[sr-1]),sr===$.end||h(Ae[sr])&(X|z))for(var Ul=sr;Ul>=0&&h(Ae[Ul])&c;Ul--)ce[Ul]=$.level}}return{levels:ce,paragraphs:me};function Fc(br,Wr){for(var ur=br;ur<Ae.length;ur++){var Vs=Fe[ur];if(Vs&(C|W))return 1;if(Vs&(z|A)||Wr&&Vs===Se)return 0;if(Vs&a){var qa=Hs(ur);ur=qa===-1?Ae.length:qa}}return 0}function Hs(br){for(var Wr=1,ur=br+1;ur<Ae.length;ur++){var Vs=Fe[ur];if(Vs&z)break;if(Vs&Se){if(--Wr===0)return ur}else Vs&a&&Wr++}return-1}}var Pe="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",je;function He(){if(!je){var Ae=b(Pe,!0),Re=Ae.map,Ne=Ae.reverseMap;Ne.forEach(function(Fe,Qe){Re.set(Qe,Fe)}),je=Re}}function pe(Ae){return He(),je.get(Ae)||null}function ze(Ae,Re,Ne,Fe){var Qe=Ae.length;Ne=Math.max(0,Ne==null?0:+Ne),Fe=Math.min(Qe-1,Fe==null?Qe-1:+Fe);for(var ae=new Map,K=Ne;K<=Fe;K++)if(Re[K]&1){var ce=pe(Ae[K]);ce!==null&&ae.set(K,ce)}return ae}function Ie(Ae,Re,Ne,Fe){var Qe=Ae.length;Ne=Math.max(0,Ne==null?0:+Ne),Fe=Math.min(Qe-1,Fe==null?Qe-1:+Fe);var ae=[];return Re.paragraphs.forEach(function(K){var ce=Math.max(Ne,K.start),he=Math.min(Fe,K.end);if(ce<he){for(var me=Re.levels.slice(ce,he+1),$=he;$>=ce&&h(Ae[$])&c;$--)me[$]=K.level;for(var Ve=K.level,qe=1/0,mt=0;mt<me.length;mt++){var Ge=me[mt];Ge>Ve&&(Ve=Ge),Ge<qe&&(qe=Ge|1)}for(var Je=Ve;Je>=qe;Je--)for(var Ye=0;Ye<me.length;Ye++)if(me[Ye]>=Je){for(var vt=Ye;Ye+1<me.length&&me[Ye+1]>=Je;)Ye++;Ye>vt&&ae.push([vt+ce,Ye+ce])}}}),ae}function Xe(Ae,Re,Ne,Fe){var Qe=we(Ae,Re,Ne,Fe),ae=[].concat(Ae);return Qe.forEach(function(K,ce){ae[ce]=(Re.levels[K]&1?pe(Ae[K]):null)||Ae[K]}),ae.join("")}function we(Ae,Re,Ne,Fe){for(var Qe=Ie(Ae,Re,Ne,Fe),ae=[],K=0;K<Ae.length;K++)ae[K]=K;return Qe.forEach(function(ce){for(var he=ce[0],me=ce[1],$=ae.slice(he,me+1),Ve=$.length;Ve--;)ae[me-Ve]=$[Ve]}),ae}return e.closingToOpeningBracket=M,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=S,e.getEmbeddingLevels=Te,e.getMirroredCharacter=pe,e.getMirroredCharactersMap=ze,e.getReorderSegments=Ie,e.getReorderedIndices=we,e.getReorderedString=Xe,e.openingToClosingBracket=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}const XZ=/\bvoid\s+main\s*\(\s*\)\s*{/g;function _I(t){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(i,r){let a=hn[r];return a?_I(a):i}return t.replace(e,n)}const xs=[];for(let t=0;t<256;t++)xs[t]=(t<16?"0":"")+t.toString(16);function LMe(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(xs[t&255]+xs[t>>8&255]+xs[t>>16&255]+xs[t>>24&255]+"-"+xs[e&255]+xs[e>>8&255]+"-"+xs[e>>16&15|64]+xs[e>>24&255]+"-"+xs[n&63|128]+xs[n>>8&255]+"-"+xs[n>>16&255]+xs[n>>24&255]+xs[i&255]+xs[i>>8&255]+xs[i>>16&255]+xs[i>>24&255]).toUpperCase()}const jp=Object.assign||function(){let t=arguments[0];for(let e=1,n=arguments.length;e<n;e++){let i=arguments[e];if(i)for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},PMe=Date.now(),j5=new WeakMap,H5=new Map;let UMe=1e10;function Q1(t,e){const n=jMe(e);let i=j5.get(t);if(i||j5.set(t,i=Object.create(null)),i[n])return new i[n];const r=`_onBeforeCompile${n}`,a=function(c,u){t.onBeforeCompile.call(this,c,u);const f=this.customProgramCacheKey()+"|"+c.vertexShader+"|"+c.fragmentShader;let h=H5[f];if(!h){const d=FMe(this,c,e,n);h=H5[f]=d}c.vertexShader=h.vertexShader,c.fragmentShader=h.fragmentShader,jp(c.uniforms,this.uniforms),e.timeUniform&&(c.uniforms[e.timeUniform]={get value(){return Date.now()-PMe}}),this[r]&&this[r](c)},s=function(){return o(e.chained?t:t.clone())},o=function(c){const u=Object.create(c,l);return Object.defineProperty(u,"baseMaterial",{value:t}),Object.defineProperty(u,"id",{value:UMe++}),u.uuid=LMe(),u.uniforms=jp({},c.uniforms,e.uniforms),u.defines=jp({},c.defines,e.defines),u.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",u.extensions=jp({},c.extensions,e.extensions),u._listeners=void 0,u},l={constructor:{value:s},isDerivedMaterial:{value:!0},type:{get:()=>t.type,set:c=>{t.type=c}},isDerivedFrom:{writable:!0,configurable:!0,value:function(c){const u=this.baseMaterial;return c===u||u.isDerivedMaterial&&u.isDerivedFrom(c)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return t.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get(){return a},set(c){this[r]=c}},copy:{writable:!0,configurable:!0,value:function(c){return t.copy.call(this,c),!t.isShaderMaterial&&!t.isDerivedMaterial&&(jp(this.extensions,c.extensions),jp(this.defines,c.defines),jp(this.uniforms,cv.clone(c.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const c=new t.constructor;return o(c).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let c=this._depthMaterial;return c||(c=this._depthMaterial=Q1(t.isDerivedMaterial?t.getDepthMaterial():new dC({depthPacking:XP}),e),c.defines.IS_DEPTH_MATERIAL="",c.uniforms=this.uniforms),c}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let c=this._distanceMaterial;return c||(c=this._distanceMaterial=Q1(t.isDerivedMaterial?t.getDistanceMaterial():new pC,e),c.defines.IS_DISTANCE_MATERIAL="",c.uniforms=this.uniforms),c}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:c,_distanceMaterial:u}=this;c&&c.dispose(),u&&u.dispose(),t.dispose.call(this)}}};return i[n]=s,new s}function FMe(t,{vertexShader:e,fragmentShader:n},i,r){let{vertexDefs:a,vertexMainIntro:s,vertexMainOutro:o,vertexTransform:l,fragmentDefs:c,fragmentMainIntro:u,fragmentMainOutro:f,fragmentColorTransform:h,customRewriter:d,timeUniform:g}=i;if(a=a||"",s=s||"",o=o||"",c=c||"",u=u||"",f=f||"",(l||d)&&(e=_I(e)),(h||d)&&(n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
//!BEGIN_POST_CHUNK $1
$&
//!END_POST_CHUNK
`),n=_I(n)),d){let b=d({vertexShader:e,fragmentShader:n});e=b.vertexShader,n=b.fragmentShader}if(h){let b=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,y=>(b.push(y),"")),f=`${h}
${b.join(`
`)}
${f}`}if(g){const b=`
uniform float ${g};
`;a=b+a,c=b+c}return l&&(e=`vec3 troika_position_${r};
vec3 troika_normal_${r};
vec2 troika_uv_${r};
${e}
`,a=`${a}
void troikaVertexTransform${r}(inout vec3 position, inout vec3 normal, inout vec2 uv) {
  ${l}
}
`,s=`
troika_position_${r} = vec3(position);
troika_normal_${r} = vec3(normal);
troika_uv_${r} = vec2(uv);
troikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r});
${s}
`,e=e.replace(/\b(position|normal|uv)\b/g,(b,y,p,x)=>/\battribute\s+vec[23]\s+$/.test(x.substr(0,p))?y:`troika_${y}_${r}`),t.map&&t.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=V5(e,r,a,s,o),n=V5(n,r,c,u,f),{vertexShader:e,fragmentShader:n}}function V5(t,e,n,i,r){return(i||r||n)&&(t=t.replace(XZ,`
${n}
void troikaOrigMain${e}() {`),t+=`
void main() {
  ${i}
  troikaOrigMain${e}();
  ${r}
}`),t}function BMe(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}let zMe=0;const G5=new Map;function jMe(t){const e=JSON.stringify(t,BMe);let n=G5.get(e);return n==null&&G5.set(e,n=++zMe),n}/*!
Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering.
Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE
*/function HMe(){return typeof window>"u"&&(self.window=self),function(t){var e={parse:function(r){var a=e._bin,s=new Uint8Array(r);if(a.readASCII(s,0,4)=="ttcf"){var o=4;a.readUshort(s,o),o+=2,a.readUshort(s,o),o+=2;var l=a.readUint(s,o);o+=4;for(var c=[],u=0;u<l;u++){var f=a.readUint(s,o);o+=4,c.push(e._readFont(s,f))}return c}return[e._readFont(s,0)]},_readFont:function(r,a){var s=e._bin,o=a;s.readFixed(r,a),a+=4;var l=s.readUshort(r,a);a+=2,s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2;for(var c=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],u={_data:r,_offset:o},f={},h=0;h<l;h++){var d=s.readASCII(r,a,4);a+=4,s.readUint(r,a),a+=4;var g=s.readUint(r,a);a+=4;var b=s.readUint(r,a);a+=4,f[d]={offset:g,length:b}}for(h=0;h<c.length;h++){var y=c[h];f[y]&&(u[y.trim()]=e[y.trim()].parse(r,f[y].offset,f[y].length,u))}return u},_tabOffset:function(r,a,s){for(var o=e._bin,l=o.readUshort(r,s+4),c=s+12,u=0;u<l;u++){var f=o.readASCII(r,c,4);c+=4,o.readUint(r,c),c+=4;var h=o.readUint(r,c);if(c+=4,o.readUint(r,c),c+=4,f==a)return h}return 0}};e._bin={readFixed:function(r,a){return(r[a]<<8|r[a+1])+(r[a+2]<<8|r[a+3])/65540},readF2dot14:function(r,a){return e._bin.readShort(r,a)/16384},readInt:function(r,a){return e._bin._view(r).getInt32(a)},readInt8:function(r,a){return e._bin._view(r).getInt8(a)},readShort:function(r,a){return e._bin._view(r).getInt16(a)},readUshort:function(r,a){return e._bin._view(r).getUint16(a)},readUshorts:function(r,a,s){for(var o=[],l=0;l<s;l++)o.push(e._bin.readUshort(r,a+2*l));return o},readUint:function(r,a){return e._bin._view(r).getUint32(a)},readUint64:function(r,a){return 4294967296*e._bin.readUint(r,a)+e._bin.readUint(r,a+4)},readASCII:function(r,a,s){for(var o="",l=0;l<s;l++)o+=String.fromCharCode(r[a+l]);return o},readUnicode:function(r,a,s){for(var o="",l=0;l<s;l++){var c=r[a++]<<8|r[a++];o+=String.fromCharCode(c)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,a,s){var o=e._bin._tdec;return o&&a==0&&s==r.length?o.decode(r):e._bin.readASCII(r,a,s)},readBytes:function(r,a,s){for(var o=[],l=0;l<s;l++)o.push(r[a+l]);return o},readASCIIArray:function(r,a,s){for(var o=[],l=0;l<s;l++)o.push(String.fromCharCode(r[a+l]));return o},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},e._lctf={},e._lctf.parse=function(r,a,s,o,l){var c=e._bin,u={},f=a;c.readFixed(r,a),a+=4;var h=c.readUshort(r,a);a+=2;var d=c.readUshort(r,a);a+=2;var g=c.readUshort(r,a);return a+=2,u.scriptList=e._lctf.readScriptList(r,f+h),u.featureList=e._lctf.readFeatureList(r,f+d),u.lookupList=e._lctf.readLookupList(r,f+g,l),u},e._lctf.readLookupList=function(r,a,s){var o=e._bin,l=a,c=[],u=o.readUshort(r,a);a+=2;for(var f=0;f<u;f++){var h=o.readUshort(r,a);a+=2;var d=e._lctf.readLookupTable(r,l+h,s);c.push(d)}return c},e._lctf.readLookupTable=function(r,a,s){var o=e._bin,l=a,c={tabs:[]};c.ltype=o.readUshort(r,a),a+=2,c.flag=o.readUshort(r,a),a+=2;var u=o.readUshort(r,a);a+=2;for(var f=c.ltype,h=0;h<u;h++){var d=o.readUshort(r,a);a+=2;var g=s(r,f,l+d,c);c.tabs.push(g)}return c},e._lctf.numOfOnes=function(r){for(var a=0,s=0;s<32;s++)r>>>s&1&&a++;return a},e._lctf.readClassDef=function(r,a){var s=e._bin,o=[],l=s.readUshort(r,a);if(a+=2,l==1){var c=s.readUshort(r,a);a+=2;var u=s.readUshort(r,a);a+=2;for(var f=0;f<u;f++)o.push(c+f),o.push(c+f),o.push(s.readUshort(r,a)),a+=2}if(l==2){var h=s.readUshort(r,a);for(a+=2,f=0;f<h;f++)o.push(s.readUshort(r,a)),a+=2,o.push(s.readUshort(r,a)),a+=2,o.push(s.readUshort(r,a)),a+=2}return o},e._lctf.getInterval=function(r,a){for(var s=0;s<r.length;s+=3){var o=r[s],l=r[s+1];if(r[s+2],o<=a&&a<=l)return s}return-1},e._lctf.readCoverage=function(r,a){var s=e._bin,o={};o.fmt=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);return a+=2,o.fmt==1&&(o.tab=s.readUshorts(r,a,l)),o.fmt==2&&(o.tab=s.readUshorts(r,a,3*l)),o},e._lctf.coverageIndex=function(r,a){var s=r.tab;if(r.fmt==1)return s.indexOf(a);if(r.fmt==2){var o=e._lctf.getInterval(s,a);if(o!=-1)return s[o+2]+(a-s[o])}return-1},e._lctf.readFeatureList=function(r,a){var s=e._bin,o=a,l=[],c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readASCII(r,a,4);a+=4;var h=s.readUshort(r,a);a+=2;var d=e._lctf.readFeatureTable(r,o+h);d.tag=f.trim(),l.push(d)}return l},e._lctf.readFeatureTable=function(r,a){var s=e._bin,o=a,l={},c=s.readUshort(r,a);a+=2,c>0&&(l.featureParams=o+c);var u=s.readUshort(r,a);a+=2,l.tab=[];for(var f=0;f<u;f++)l.tab.push(s.readUshort(r,a+2*f));return l},e._lctf.readScriptList=function(r,a){var s=e._bin,o=a,l={},c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readASCII(r,a,4);a+=4;var h=s.readUshort(r,a);a+=2,l[f.trim()]=e._lctf.readScriptTable(r,o+h)}return l},e._lctf.readScriptTable=function(r,a){var s=e._bin,o=a,l={},c=s.readUshort(r,a);a+=2,c>0&&(l.default=e._lctf.readLangSysTable(r,o+c));var u=s.readUshort(r,a);a+=2;for(var f=0;f<u;f++){var h=s.readASCII(r,a,4);a+=4;var d=s.readUshort(r,a);a+=2,l[h.trim()]=e._lctf.readLangSysTable(r,o+d)}return l},e._lctf.readLangSysTable=function(r,a){var s=e._bin,o={};s.readUshort(r,a),a+=2,o.reqFeature=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);return a+=2,o.features=s.readUshorts(r,a,l),o},e.CFF={},e.CFF.parse=function(r,a,s){var o=e._bin;(r=new Uint8Array(r.buffer,a,s))[a=0],r[++a],r[++a],r[++a],a++;var l=[];a=e.CFF.readIndex(r,a,l);for(var c=[],u=0;u<l.length-1;u++)c.push(o.readASCII(r,a+l[u],l[u+1]-l[u]));a+=l[l.length-1];var f=[];a=e.CFF.readIndex(r,a,f);var h=[];for(u=0;u<f.length-1;u++)h.push(e.CFF.readDict(r,a+f[u],a+f[u+1]));a+=f[f.length-1];var d=h[0],g=[];a=e.CFF.readIndex(r,a,g);var b=[];for(u=0;u<g.length-1;u++)b.push(o.readASCII(r,a+g[u],g[u+1]-g[u]));if(a+=g[g.length-1],e.CFF.readSubrs(r,a,d),d.CharStrings){a=d.CharStrings,g=[],a=e.CFF.readIndex(r,a,g);var y=[];for(u=0;u<g.length-1;u++)y.push(o.readBytes(r,a+g[u],g[u+1]-g[u]));d.CharStrings=y}if(d.ROS){a=d.FDArray;var p=[];for(a=e.CFF.readIndex(r,a,p),d.FDArray=[],u=0;u<p.length-1;u++){var x=e.CFF.readDict(r,a+p[u],a+p[u+1]);e.CFF._readFDict(r,x,b),d.FDArray.push(x)}a+=p[p.length-1],a=d.FDSelect,d.FDSelect=[];var _=r[a];if(a++,_!=3)throw _;var w=o.readUshort(r,a);for(a+=2,u=0;u<w+1;u++)d.FDSelect.push(o.readUshort(r,a),r[a+2]),a+=3}return d.Encoding&&(d.Encoding=e.CFF.readEncoding(r,d.Encoding,d.CharStrings.length)),d.charset&&(d.charset=e.CFF.readCharset(r,d.charset,d.CharStrings.length)),e.CFF._readFDict(r,d,b),d},e.CFF._readFDict=function(r,a,s){var o;for(var l in a.Private&&(o=a.Private[1],a.Private=e.CFF.readDict(r,o,o+a.Private[0]),a.Private.Subrs&&e.CFF.readSubrs(r,o+a.Private.Subrs,a.Private)),a)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(l)!=-1&&(a[l]=s[a[l]-426+35])},e.CFF.readSubrs=function(r,a,s){var o=e._bin,l=[];a=e.CFF.readIndex(r,a,l);var c,u=l.length;c=u<1240?107:u<33900?1131:32768,s.Bias=c,s.Subrs=[];for(var f=0;f<l.length-1;f++)s.Subrs.push(o.readBytes(r,a+l[f],l[f+1]-l[f]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(r,a){for(var s=0;s<r.charset.length;s++)if(r.charset[s]==a)return s;return-1},e.CFF.glyphBySE=function(r,a){return a<0||a>255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[a])},e.CFF.readEncoding=function(r,a,s){e._bin;var o=[".notdef"],l=r[a];if(a++,l!=0)throw"error: unknown encoding format: "+l;var c=r[a];a++;for(var u=0;u<c;u++)o.push(r[a+u]);return o},e.CFF.readCharset=function(r,a,s){var o=e._bin,l=[".notdef"],c=r[a];if(a++,c==0)for(var u=0;u<s;u++){var f=o.readUshort(r,a);a+=2,l.push(f)}else{if(c!=1&&c!=2)throw"error: format: "+c;for(;l.length<s;){f=o.readUshort(r,a),a+=2;var h=0;for(c==1?(h=r[a],a++):(h=o.readUshort(r,a),a+=2),u=0;u<=h;u++)l.push(f),f++}}return l},e.CFF.readIndex=function(r,a,s){var o=e._bin,l=o.readUshort(r,a)+1,c=r[a+=2];if(a++,c==1)for(var u=0;u<l;u++)s.push(r[a+u]);else if(c==2)for(u=0;u<l;u++)s.push(o.readUshort(r,a+2*u));else if(c==3)for(u=0;u<l;u++)s.push(16777215&o.readUint(r,a+3*u-1));else if(l!=1)throw"unsupported offset size: "+c+", count: "+l;return(a+=l*c)-1},e.CFF.getCharString=function(r,a,s){var o=e._bin,l=r[a],c=r[a+1];r[a+2],r[a+3],r[a+4];var u=1,f=null,h=null;l<=20&&(f=l,u=1),l==12&&(f=100*l+c,u=2),21<=l&&l<=27&&(f=l,u=1),l==28&&(h=o.readShort(r,a+1),u=3),29<=l&&l<=31&&(f=l,u=1),32<=l&&l<=246&&(h=l-139,u=1),247<=l&&l<=250&&(h=256*(l-247)+c+108,u=2),251<=l&&l<=254&&(h=256*-(l-251)-c-108,u=2),l==255&&(h=o.readInt(r,a+1)/65535,u=5),s.val=h??"o"+f,s.size=u},e.CFF.readCharString=function(r,a,s){for(var o=a+s,l=e._bin,c=[];a<o;){var u=r[a],f=r[a+1];r[a+2],r[a+3],r[a+4];var h=1,d=null,g=null;u<=20&&(d=u,h=1),u==12&&(d=100*u+f,h=2),u!=19&&u!=20||(d=u,h=2),21<=u&&u<=27&&(d=u,h=1),u==28&&(g=l.readShort(r,a+1),h=3),29<=u&&u<=31&&(d=u,h=1),32<=u&&u<=246&&(g=u-139,h=1),247<=u&&u<=250&&(g=256*(u-247)+f+108,h=2),251<=u&&u<=254&&(g=256*-(u-251)-f-108,h=2),u==255&&(g=l.readInt(r,a+1)/65535,h=5),c.push(g??"o"+d),a+=h}return c},e.CFF.readDict=function(r,a,s){for(var o=e._bin,l={},c=[];a<s;){var u=r[a],f=r[a+1];r[a+2],r[a+3],r[a+4];var h=1,d=null,g=null;if(u==28&&(g=o.readShort(r,a+1),h=3),u==29&&(g=o.readInt(r,a+1),h=5),32<=u&&u<=246&&(g=u-139,h=1),247<=u&&u<=250&&(g=256*(u-247)+f+108,h=2),251<=u&&u<=254&&(g=256*-(u-251)-f-108,h=2),u==255)throw g=o.readInt(r,a+1)/65535,h=5,"unknown number";if(u==30){var b=[];for(h=1;;){var y=r[a+h];h++;var p=y>>4,x=15&y;if(p!=15&&b.push(p),x!=15&&b.push(x),x==15)break}for(var _="",w=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],M=0;M<b.length;M++)_+=w[b[M]];g=parseFloat(_)}u<=21&&(d=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][u],h=1,u==12&&(d=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][f],h=2)),d!=null?(l[d]=c.length==1?c[0]:c,c=[]):c.push(g),a+=h}return l},e.cmap={},e.cmap.parse=function(r,a,s){r=new Uint8Array(r.buffer,a,s),a=0;var o=e._bin,l={};o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2;var u=[];l.tables=[];for(var f=0;f<c;f++){var h=o.readUshort(r,a);a+=2;var d=o.readUshort(r,a);a+=2;var g=o.readUint(r,a);a+=4;var b="p"+h+"e"+d,y=u.indexOf(g);if(y==-1){var p;y=l.tables.length,u.push(g);var x=o.readUshort(r,g);x==0?p=e.cmap.parse0(r,g):x==4?p=e.cmap.parse4(r,g):x==6?p=e.cmap.parse6(r,g):x==12?p=e.cmap.parse12(r,g):console.debug("unknown format: "+x,h,d,g),l.tables.push(p)}if(l[b]!=null)throw"multiple tables for one platform+encoding";l[b]=y}return l},e.cmap.parse0=function(r,a){var s=e._bin,o={};o.format=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);a+=2,s.readUshort(r,a),a+=2,o.map=[];for(var c=0;c<l-6;c++)o.map.push(r[a+c]);return o},e.cmap.parse4=function(r,a){var s=e._bin,o=a,l={};l.format=s.readUshort(r,a),a+=2;var c=s.readUshort(r,a);a+=2,s.readUshort(r,a),a+=2;var u=s.readUshort(r,a);a+=2;var f=u/2;l.searchRange=s.readUshort(r,a),a+=2,l.entrySelector=s.readUshort(r,a),a+=2,l.rangeShift=s.readUshort(r,a),a+=2,l.endCount=s.readUshorts(r,a,f),a+=2*f,a+=2,l.startCount=s.readUshorts(r,a,f),a+=2*f,l.idDelta=[];for(var h=0;h<f;h++)l.idDelta.push(s.readShort(r,a)),a+=2;for(l.idRangeOffset=s.readUshorts(r,a,f),a+=2*f,l.glyphIdArray=[];a<o+c;)l.glyphIdArray.push(s.readUshort(r,a)),a+=2;return l},e.cmap.parse6=function(r,a){var s=e._bin,o={};o.format=s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2,o.firstCode=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);a+=2,o.glyphIdArray=[];for(var c=0;c<l;c++)o.glyphIdArray.push(s.readUshort(r,a)),a+=2;return o},e.cmap.parse12=function(r,a){var s=e._bin,o={};o.format=s.readUshort(r,a),a+=2,a+=2,s.readUint(r,a),a+=4,s.readUint(r,a),a+=4;var l=s.readUint(r,a);a+=4,o.groups=[];for(var c=0;c<l;c++){var u=a+12*c,f=s.readUint(r,u+0),h=s.readUint(r,u+4),d=s.readUint(r,u+8);o.groups.push([f,h,d])}return o},e.glyf={},e.glyf.parse=function(r,a,s,o){for(var l=[],c=0;c<o.maxp.numGlyphs;c++)l.push(null);return l},e.glyf._parseGlyf=function(r,a){var s=e._bin,o=r._data,l=e._tabOffset(o,"glyf",r._offset)+r.loca[a];if(r.loca[a]==r.loca[a+1])return null;var c={};if(c.noc=s.readShort(o,l),l+=2,c.xMin=s.readShort(o,l),l+=2,c.yMin=s.readShort(o,l),l+=2,c.xMax=s.readShort(o,l),l+=2,c.yMax=s.readShort(o,l),l+=2,c.xMin>=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var u=0;u<c.noc;u++)c.endPts.push(s.readUshort(o,l)),l+=2;var f=s.readUshort(o,l);if(l+=2,o.length-l<f)return null;c.instructions=s.readBytes(o,l,f),l+=f;var h=c.endPts[c.noc-1]+1;for(c.flags=[],u=0;u<h;u++){var d=o[l];if(l++,c.flags.push(d),(8&d)!=0){var g=o[l];l++;for(var b=0;b<g;b++)c.flags.push(d),u++}}for(c.xs=[],u=0;u<h;u++){var y=(2&c.flags[u])!=0,p=(16&c.flags[u])!=0;y?(c.xs.push(p?o[l]:-o[l]),l++):p?c.xs.push(0):(c.xs.push(s.readShort(o,l)),l+=2)}for(c.ys=[],u=0;u<h;u++)y=(4&c.flags[u])!=0,p=(32&c.flags[u])!=0,y?(c.ys.push(p?o[l]:-o[l]),l++):p?c.ys.push(0):(c.ys.push(s.readShort(o,l)),l+=2);var x=0,_=0;for(u=0;u<h;u++)x+=c.xs[u],_+=c.ys[u],c.xs[u]=x,c.ys[u]=_}else{var w;c.parts=[];do{w=s.readUshort(o,l),l+=2;var M={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(c.parts.push(M),M.glyphIndex=s.readUshort(o,l),l+=2,1&w){var S=s.readShort(o,l);l+=2;var A=s.readShort(o,l);l+=2}else S=s.readInt8(o,l),l++,A=s.readInt8(o,l),l++;2&w?(M.m.tx=S,M.m.ty=A):(M.p1=S,M.p2=A),8&w?(M.m.a=M.m.d=s.readF2dot14(o,l),l+=2):64&w?(M.m.a=s.readF2dot14(o,l),l+=2,M.m.d=s.readF2dot14(o,l),l+=2):128&w&&(M.m.a=s.readF2dot14(o,l),l+=2,M.m.b=s.readF2dot14(o,l),l+=2,M.m.c=s.readF2dot14(o,l),l+=2,M.m.d=s.readF2dot14(o,l),l+=2)}while(32&w);if(256&w){var C=s.readUshort(o,l);for(l+=2,c.instr=[],u=0;u<C;u++)c.instr.push(o[l]),l++}}return c},e.GDEF={},e.GDEF.parse=function(r,a,s,o){var l=a;a+=4;var c=e._bin.readUshort(r,a);return{glyphClassDef:c===0?null:e._lctf.readClassDef(r,l+c)}},e.GPOS={},e.GPOS.parse=function(r,a,s,o){return e._lctf.parse(r,a,s,o,e.GPOS.subt)},e.GPOS.subt=function(r,a,s,o){var l=e._bin,c=s,u={};if(u.fmt=l.readUshort(r,s),s+=2,a==1||a==2||a==3||a==7||a==8&&u.fmt<=2){var f=l.readUshort(r,s);s+=2,u.coverage=e._lctf.readCoverage(r,f+c)}if(a==1&&u.fmt==1){var h=l.readUshort(r,s);s+=2,h!=0&&(u.pos=e.GPOS.readValueRecord(r,s,h))}else if(a==2&&u.fmt>=1&&u.fmt<=2){h=l.readUshort(r,s),s+=2;var d=l.readUshort(r,s);s+=2;var g=e._lctf.numOfOnes(h),b=e._lctf.numOfOnes(d);if(u.fmt==1){u.pairsets=[];var y=l.readUshort(r,s);s+=2;for(var p=0;p<y;p++){var x=c+l.readUshort(r,s);s+=2;var _=l.readUshort(r,x);x+=2;for(var w=[],M=0;M<_;M++){var S=l.readUshort(r,x);x+=2,h!=0&&(P=e.GPOS.readValueRecord(r,x,h),x+=2*g),d!=0&&(j=e.GPOS.readValueRecord(r,x,d),x+=2*b),w.push({gid2:S,val1:P,val2:j})}u.pairsets.push(w)}}if(u.fmt==2){var A=l.readUshort(r,s);s+=2;var C=l.readUshort(r,s);s+=2;var k=l.readUshort(r,s);s+=2;var R=l.readUshort(r,s);for(s+=2,u.classDef1=e._lctf.readClassDef(r,c+A),u.classDef2=e._lctf.readClassDef(r,c+C),u.matrix=[],p=0;p<k;p++){var N=[];for(M=0;M<R;M++){var P=null,j=null;h!=0&&(P=e.GPOS.readValueRecord(r,s,h),s+=2*g),d!=0&&(j=e.GPOS.readValueRecord(r,s,d),s+=2*b),N.push({val1:P,val2:j})}u.matrix.push(N)}}}else if(a==4&&u.fmt==1)u.markCoverage=e._lctf.readCoverage(r,l.readUshort(r,s)+c),u.baseCoverage=e._lctf.readCoverage(r,l.readUshort(r,s+2)+c),u.markClassCount=l.readUshort(r,s+4),u.markArray=e.GPOS.readMarkArray(r,l.readUshort(r,s+6)+c),u.baseArray=e.GPOS.readBaseArray(r,l.readUshort(r,s+8)+c,u.markClassCount);else if(a==6&&u.fmt==1)u.mark1Coverage=e._lctf.readCoverage(r,l.readUshort(r,s)+c),u.mark2Coverage=e._lctf.readCoverage(r,l.readUshort(r,s+2)+c),u.markClassCount=l.readUshort(r,s+4),u.mark1Array=e.GPOS.readMarkArray(r,l.readUshort(r,s+6)+c),u.mark2Array=e.GPOS.readBaseArray(r,l.readUshort(r,s+8)+c,u.markClassCount);else{if(a==9&&u.fmt==1){var z=l.readUshort(r,s);s+=2;var X=l.readUint(r,s);if(s+=4,o.ltype==9)o.ltype=z;else if(o.ltype!=z)throw"invalid extension substitution";return e.GPOS.subt(r,o.ltype,c+X)}console.debug("unsupported GPOS table LookupType",a,"format",u.fmt)}return u},e.GPOS.readValueRecord=function(r,a,s){var o=e._bin,l=[];return l.push(1&s?o.readShort(r,a):0),a+=1&s?2:0,l.push(2&s?o.readShort(r,a):0),a+=2&s?2:0,l.push(4&s?o.readShort(r,a):0),a+=4&s?2:0,l.push(8&s?o.readShort(r,a):0),a+=8&s?2:0,l},e.GPOS.readBaseArray=function(r,a,s){var o=e._bin,l=[],c=a,u=o.readUshort(r,a);a+=2;for(var f=0;f<u;f++){for(var h=[],d=0;d<s;d++)h.push(e.GPOS.readAnchorRecord(r,c+o.readUshort(r,a))),a+=2;l.push(h)}return l},e.GPOS.readMarkArray=function(r,a){var s=e._bin,o=[],l=a,c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=e.GPOS.readAnchorRecord(r,s.readUshort(r,a+2)+l);f.markClass=s.readUshort(r,a),o.push(f),a+=4}return o},e.GPOS.readAnchorRecord=function(r,a){var s=e._bin,o={};return o.fmt=s.readUshort(r,a),o.x=s.readShort(r,a+2),o.y=s.readShort(r,a+4),o},e.GSUB={},e.GSUB.parse=function(r,a,s,o){return e._lctf.parse(r,a,s,o,e.GSUB.subt)},e.GSUB.subt=function(r,a,s,o){var l=e._bin,c=s,u={};if(u.fmt=l.readUshort(r,s),s+=2,a!=1&&a!=2&&a!=4&&a!=5&&a!=6)return null;if(a==1||a==2||a==4||a==5&&u.fmt<=2||a==6&&u.fmt<=2){var f=l.readUshort(r,s);s+=2,u.coverage=e._lctf.readCoverage(r,c+f)}if(a==1&&u.fmt>=1&&u.fmt<=2){if(u.fmt==1)u.delta=l.readShort(r,s),s+=2;else if(u.fmt==2){var h=l.readUshort(r,s);s+=2,u.newg=l.readUshorts(r,s,h),s+=2*u.newg.length}}else if(a==2&&u.fmt==1){h=l.readUshort(r,s),s+=2,u.seqs=[];for(var d=0;d<h;d++){var g=l.readUshort(r,s)+c;s+=2;var b=l.readUshort(r,g);u.seqs.push(l.readUshorts(r,g+2,b))}}else if(a==4)for(u.vals=[],h=l.readUshort(r,s),s+=2,d=0;d<h;d++){var y=l.readUshort(r,s);s+=2,u.vals.push(e.GSUB.readLigatureSet(r,c+y))}else if(a==5&&u.fmt==2){if(u.fmt==2){var p=l.readUshort(r,s);s+=2,u.cDef=e._lctf.readClassDef(r,c+p),u.scset=[];var x=l.readUshort(r,s);for(s+=2,d=0;d<x;d++){var _=l.readUshort(r,s);s+=2,u.scset.push(_==0?null:e.GSUB.readSubClassSet(r,c+_))}}}else if(a==6&&u.fmt==3){if(u.fmt==3){for(d=0;d<3;d++){h=l.readUshort(r,s),s+=2;for(var w=[],M=0;M<h;M++)w.push(e._lctf.readCoverage(r,c+l.readUshort(r,s+2*M)));s+=2*h,d==0&&(u.backCvg=w),d==1&&(u.inptCvg=w),d==2&&(u.ahedCvg=w)}h=l.readUshort(r,s),s+=2,u.lookupRec=e.GSUB.readSubstLookupRecords(r,s,h)}}else{if(a==7&&u.fmt==1){var S=l.readUshort(r,s);s+=2;var A=l.readUint(r,s);if(s+=4,o.ltype==9)o.ltype=S;else if(o.ltype!=S)throw"invalid extension substitution";return e.GSUB.subt(r,o.ltype,c+A)}console.debug("unsupported GSUB table LookupType",a,"format",u.fmt)}return u},e.GSUB.readSubClassSet=function(r,a){var s=e._bin.readUshort,o=a,l=[],c=s(r,a);a+=2;for(var u=0;u<c;u++){var f=s(r,a);a+=2,l.push(e.GSUB.readSubClassRule(r,o+f))}return l},e.GSUB.readSubClassRule=function(r,a){var s=e._bin.readUshort,o={},l=s(r,a),c=s(r,a+=2);a+=2,o.input=[];for(var u=0;u<l-1;u++)o.input.push(s(r,a)),a+=2;return o.substLookupRecords=e.GSUB.readSubstLookupRecords(r,a,c),o},e.GSUB.readSubstLookupRecords=function(r,a,s){for(var o=e._bin.readUshort,l=[],c=0;c<s;c++)l.push(o(r,a),o(r,a+2)),a+=4;return l},e.GSUB.readChainSubClassSet=function(r,a){var s=e._bin,o=a,l=[],c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readUshort(r,a);a+=2,l.push(e.GSUB.readChainSubClassRule(r,o+f))}return l},e.GSUB.readChainSubClassRule=function(r,a){for(var s=e._bin,o={},l=["backtrack","input","lookahead"],c=0;c<l.length;c++){var u=s.readUshort(r,a);a+=2,c==1&&u--,o[l[c]]=s.readUshorts(r,a,u),a+=2*o[l[c]].length}return u=s.readUshort(r,a),a+=2,o.subst=s.readUshorts(r,a,2*u),a+=2*o.subst.length,o},e.GSUB.readLigatureSet=function(r,a){var s=e._bin,o=a,l=[],c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readUshort(r,a);a+=2,l.push(e.GSUB.readLigature(r,o+f))}return l},e.GSUB.readLigature=function(r,a){var s=e._bin,o={chain:[]};o.nglyph=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);a+=2;for(var c=0;c<l-1;c++)o.chain.push(s.readUshort(r,a)),a+=2;return o},e.head={},e.head.parse=function(r,a,s){var o=e._bin,l={};return o.readFixed(r,a),a+=4,l.fontRevision=o.readFixed(r,a),a+=4,o.readUint(r,a),a+=4,o.readUint(r,a),a+=4,l.flags=o.readUshort(r,a),a+=2,l.unitsPerEm=o.readUshort(r,a),a+=2,l.created=o.readUint64(r,a),a+=8,l.modified=o.readUint64(r,a),a+=8,l.xMin=o.readShort(r,a),a+=2,l.yMin=o.readShort(r,a),a+=2,l.xMax=o.readShort(r,a),a+=2,l.yMax=o.readShort(r,a),a+=2,l.macStyle=o.readUshort(r,a),a+=2,l.lowestRecPPEM=o.readUshort(r,a),a+=2,l.fontDirectionHint=o.readShort(r,a),a+=2,l.indexToLocFormat=o.readShort(r,a),a+=2,l.glyphDataFormat=o.readShort(r,a),a+=2,l},e.hhea={},e.hhea.parse=function(r,a,s){var o=e._bin,l={};return o.readFixed(r,a),a+=4,l.ascender=o.readShort(r,a),a+=2,l.descender=o.readShort(r,a),a+=2,l.lineGap=o.readShort(r,a),a+=2,l.advanceWidthMax=o.readUshort(r,a),a+=2,l.minLeftSideBearing=o.readShort(r,a),a+=2,l.minRightSideBearing=o.readShort(r,a),a+=2,l.xMaxExtent=o.readShort(r,a),a+=2,l.caretSlopeRise=o.readShort(r,a),a+=2,l.caretSlopeRun=o.readShort(r,a),a+=2,l.caretOffset=o.readShort(r,a),a+=2,a+=8,l.metricDataFormat=o.readShort(r,a),a+=2,l.numberOfHMetrics=o.readUshort(r,a),a+=2,l},e.hmtx={},e.hmtx.parse=function(r,a,s,o){for(var l=e._bin,c={aWidth:[],lsBearing:[]},u=0,f=0,h=0;h<o.maxp.numGlyphs;h++)h<o.hhea.numberOfHMetrics&&(u=l.readUshort(r,a),a+=2,f=l.readShort(r,a),a+=2),c.aWidth.push(u),c.lsBearing.push(f);return c},e.kern={},e.kern.parse=function(r,a,s,o){var l=e._bin,c=l.readUshort(r,a);if(a+=2,c==1)return e.kern.parseV1(r,a-2,s,o);var u=l.readUshort(r,a);a+=2;for(var f={glyph1:[],rval:[]},h=0;h<u;h++){a+=2,s=l.readUshort(r,a),a+=2;var d=l.readUshort(r,a);a+=2;var g=d>>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;a=e.kern.readFormat0(r,a,f)}return f},e.kern.parseV1=function(r,a,s,o){var l=e._bin;l.readFixed(r,a),a+=4;var c=l.readUint(r,a);a+=4;for(var u={glyph1:[],rval:[]},f=0;f<c;f++){l.readUint(r,a),a+=4;var h=l.readUshort(r,a);a+=2,l.readUshort(r,a),a+=2;var d=h>>>8;if((d&=15)!=0)throw"unknown kern table format: "+d;a=e.kern.readFormat0(r,a,u)}return u},e.kern.readFormat0=function(r,a,s){var o=e._bin,l=-1,c=o.readUshort(r,a);a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2;for(var u=0;u<c;u++){var f=o.readUshort(r,a);a+=2;var h=o.readUshort(r,a);a+=2;var d=o.readShort(r,a);a+=2,f!=l&&(s.glyph1.push(f),s.rval.push({glyph2:[],vals:[]}));var g=s.rval[s.rval.length-1];g.glyph2.push(h),g.vals.push(d),l=f}return a},e.loca={},e.loca.parse=function(r,a,s,o){var l=e._bin,c=[],u=o.head.indexToLocFormat,f=o.maxp.numGlyphs+1;if(u==0)for(var h=0;h<f;h++)c.push(l.readUshort(r,a+(h<<1))<<1);if(u==1)for(h=0;h<f;h++)c.push(l.readUint(r,a+(h<<2)));return c},e.maxp={},e.maxp.parse=function(r,a,s){var o=e._bin,l={},c=o.readUint(r,a);return a+=4,l.numGlyphs=o.readUshort(r,a),a+=2,c==65536&&(l.maxPoints=o.readUshort(r,a),a+=2,l.maxContours=o.readUshort(r,a),a+=2,l.maxCompositePoints=o.readUshort(r,a),a+=2,l.maxCompositeContours=o.readUshort(r,a),a+=2,l.maxZones=o.readUshort(r,a),a+=2,l.maxTwilightPoints=o.readUshort(r,a),a+=2,l.maxStorage=o.readUshort(r,a),a+=2,l.maxFunctionDefs=o.readUshort(r,a),a+=2,l.maxInstructionDefs=o.readUshort(r,a),a+=2,l.maxStackElements=o.readUshort(r,a),a+=2,l.maxSizeOfInstructions=o.readUshort(r,a),a+=2,l.maxComponentElements=o.readUshort(r,a),a+=2,l.maxComponentDepth=o.readUshort(r,a),a+=2),l},e.name={},e.name.parse=function(r,a,s){var o=e._bin,l={};o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2,o.readUshort(r,a);for(var u,f=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],h=a+=2,d=0;d<c;d++){var g=o.readUshort(r,a);a+=2;var b=o.readUshort(r,a);a+=2;var y=o.readUshort(r,a);a+=2;var p=o.readUshort(r,a);a+=2;var x=o.readUshort(r,a);a+=2;var _=o.readUshort(r,a);a+=2;var w,M=f[p],S=h+12*c+_;if(g==0)w=o.readUnicode(r,S,x/2);else if(g==3&&b==0)w=o.readUnicode(r,S,x/2);else if(b==0)w=o.readASCII(r,S,x);else if(b==1)w=o.readUnicode(r,S,x/2);else if(b==3)w=o.readUnicode(r,S,x/2);else{if(g!=1)throw"unknown encoding "+b+", platformID: "+g;w=o.readASCII(r,S,x),console.debug("reading unknown MAC encoding "+b+" as ASCII")}var A="p"+g+","+y.toString(16);l[A]==null&&(l[A]={}),l[A][M!==void 0?M:p]=w,l[A]._lang=y}for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==1033)return l[C];for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==0)return l[C];for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==3084)return l[C];for(var C in l)if(l[C].postScriptName!=null)return l[C];for(var C in l){u=C;break}return console.debug("returning name table with languageID "+l[u]._lang),l[u]},e["OS/2"]={},e["OS/2"].parse=function(r,a,s){var o=e._bin.readUshort(r,a);a+=2;var l={};if(o==0)e["OS/2"].version0(r,a,l);else if(o==1)e["OS/2"].version1(r,a,l);else if(o==2||o==3||o==4)e["OS/2"].version2(r,a,l);else{if(o!=5)throw"unknown OS/2 table version: "+o;e["OS/2"].version5(r,a,l)}return l},e["OS/2"].version0=function(r,a,s){var o=e._bin;return s.xAvgCharWidth=o.readShort(r,a),a+=2,s.usWeightClass=o.readUshort(r,a),a+=2,s.usWidthClass=o.readUshort(r,a),a+=2,s.fsType=o.readUshort(r,a),a+=2,s.ySubscriptXSize=o.readShort(r,a),a+=2,s.ySubscriptYSize=o.readShort(r,a),a+=2,s.ySubscriptXOffset=o.readShort(r,a),a+=2,s.ySubscriptYOffset=o.readShort(r,a),a+=2,s.ySuperscriptXSize=o.readShort(r,a),a+=2,s.ySuperscriptYSize=o.readShort(r,a),a+=2,s.ySuperscriptXOffset=o.readShort(r,a),a+=2,s.ySuperscriptYOffset=o.readShort(r,a),a+=2,s.yStrikeoutSize=o.readShort(r,a),a+=2,s.yStrikeoutPosition=o.readShort(r,a),a+=2,s.sFamilyClass=o.readShort(r,a),a+=2,s.panose=o.readBytes(r,a,10),a+=10,s.ulUnicodeRange1=o.readUint(r,a),a+=4,s.ulUnicodeRange2=o.readUint(r,a),a+=4,s.ulUnicodeRange3=o.readUint(r,a),a+=4,s.ulUnicodeRange4=o.readUint(r,a),a+=4,s.achVendID=[o.readInt8(r,a),o.readInt8(r,a+1),o.readInt8(r,a+2),o.readInt8(r,a+3)],a+=4,s.fsSelection=o.readUshort(r,a),a+=2,s.usFirstCharIndex=o.readUshort(r,a),a+=2,s.usLastCharIndex=o.readUshort(r,a),a+=2,s.sTypoAscender=o.readShort(r,a),a+=2,s.sTypoDescender=o.readShort(r,a),a+=2,s.sTypoLineGap=o.readShort(r,a),a+=2,s.usWinAscent=o.readUshort(r,a),a+=2,s.usWinDescent=o.readUshort(r,a),a+=2},e["OS/2"].version1=function(r,a,s){var o=e._bin;return a=e["OS/2"].version0(r,a,s),s.ulCodePageRange1=o.readUint(r,a),a+=4,s.ulCodePageRange2=o.readUint(r,a),a+=4},e["OS/2"].version2=function(r,a,s){var o=e._bin;return a=e["OS/2"].version1(r,a,s),s.sxHeight=o.readShort(r,a),a+=2,s.sCapHeight=o.readShort(r,a),a+=2,s.usDefault=o.readUshort(r,a),a+=2,s.usBreak=o.readUshort(r,a),a+=2,s.usMaxContext=o.readUshort(r,a),a+=2},e["OS/2"].version5=function(r,a,s){var o=e._bin;return a=e["OS/2"].version2(r,a,s),s.usLowerOpticalPointSize=o.readUshort(r,a),a+=2,s.usUpperOpticalPointSize=o.readUshort(r,a),a+=2},e.post={},e.post.parse=function(r,a,s){var o=e._bin,l={};return l.version=o.readFixed(r,a),a+=4,l.italicAngle=o.readFixed(r,a),a+=4,l.underlinePosition=o.readShort(r,a),a+=2,l.underlineThickness=o.readShort(r,a),a+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(r,a){var s=r.cmap,o=-1;if(s.p0e4!=null?o=s.p0e4:s.p3e1!=null?o=s.p3e1:s.p1e0!=null?o=s.p1e0:s.p0e3!=null&&(o=s.p0e3),o==-1)throw"no familiar platform and encoding!";var l=s.tables[o];if(l.format==0)return a>=l.map.length?0:l.map[a];if(l.format==4){for(var c=-1,u=0;u<l.endCount.length;u++)if(a<=l.endCount[u]){c=u;break}return c==-1||l.startCount[c]>a?0:65535&(l.idRangeOffset[c]!=0?l.glyphIdArray[a-l.startCount[c]+(l.idRangeOffset[c]>>1)-(l.idRangeOffset.length-c)]:a+l.idDelta[c])}if(l.format==12){if(a>l.groups[l.groups.length-1][1])return 0;for(u=0;u<l.groups.length;u++){var f=l.groups[u];if(f[0]<=a&&a<=f[1])return f[2]+(a-f[0])}return 0}throw"unknown cmap table format "+l.format},e.U.glyphToPath=function(r,a){var s={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[a]){var o=r.SVG.entries[a];return o==null?s:(typeof o=="string"&&(o=e.SVG.toPath(o),r.SVG.entries[a]=o),o)}if(r.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},c=r.CFF,u=r.CFF.Private;if(c.ROS){for(var f=0;c.FDSelect[f+2]<=a;)f+=2;u=c.FDArray[c.FDSelect[f+1]].Private}e.U._drawCFF(r.CFF.CharStrings[a],l,c,u,s)}else r.glyf&&e.U._drawGlyf(a,r,s);return s},e.U._drawGlyf=function(r,a,s){var o=a.glyf[r];o==null&&(o=a.glyf[r]=e.glyf._parseGlyf(a,r)),o!=null&&(o.noc>-1?e.U._simpleGlyph(o,s):e.U._compoGlyph(o,a,s))},e.U._simpleGlyph=function(r,a){for(var s=0;s<r.noc;s++){for(var o=s==0?0:r.endPts[s-1]+1,l=r.endPts[s],c=o;c<=l;c++){var u=c==o?l:c-1,f=c==l?o:c+1,h=1&r.flags[c],d=1&r.flags[u],g=1&r.flags[f],b=r.xs[c],y=r.ys[c];if(c==o)if(h){if(!d){e.U.P.moveTo(a,b,y);continue}e.U.P.moveTo(a,r.xs[u],r.ys[u])}else d?e.U.P.moveTo(a,r.xs[u],r.ys[u]):e.U.P.moveTo(a,(r.xs[u]+b)/2,(r.ys[u]+y)/2);h?d&&e.U.P.lineTo(a,b,y):g?e.U.P.qcurveTo(a,b,y,r.xs[f],r.ys[f]):e.U.P.qcurveTo(a,b,y,(b+r.xs[f])/2,(y+r.ys[f])/2)}e.U.P.closePath(a)}},e.U._compoGlyph=function(r,a,s){for(var o=0;o<r.parts.length;o++){var l={cmds:[],crds:[]},c=r.parts[o];e.U._drawGlyf(c.glyphIndex,a,l);for(var u=c.m,f=0;f<l.crds.length;f+=2){var h=l.crds[f],d=l.crds[f+1];s.crds.push(h*u.a+d*u.b+u.tx),s.crds.push(h*u.c+d*u.d+u.ty)}for(f=0;f<l.cmds.length;f++)s.cmds.push(l.cmds[f])}},e.U._getGlyphClass=function(r,a){var s=e._lctf.getInterval(a,r);return s==-1?0:a[s+2]},e.U._applySubs=function(r,a,s,o){for(var l=r.length-a-1,c=0;c<s.tabs.length;c++)if(s.tabs[c]!=null){var u,f=s.tabs[c];if(!f.coverage||(u=e._lctf.coverageIndex(f.coverage,r[a]))!=-1){if(s.ltype==1)r[a],f.fmt==1?r[a]=r[a]+f.delta:r[a]=f.newg[u];else if(s.ltype==4)for(var h=f.vals[u],d=0;d<h.length;d++){var g=h[d],b=g.chain.length;if(!(b>l)){for(var y=!0,p=0,x=0;x<b;x++){for(;r[a+p+(1+x)]==-1;)p++;g.chain[x]!=r[a+p+(1+x)]&&(y=!1)}if(y){for(r[a]=g.nglyph,x=0;x<b+p;x++)r[a+x+1]=-1;break}}}else if(s.ltype==5&&f.fmt==2)for(var _=e._lctf.getInterval(f.cDef,r[a]),w=f.cDef[_+2],M=f.scset[w],S=0;S<M.length;S++){var A=M[S],C=A.input;if(!(C.length>l)){for(y=!0,x=0;x<C.length;x++){var k=e._lctf.getInterval(f.cDef,r[a+1+x]);if(_==-1&&f.cDef[k+2]!=C[x]){y=!1;break}}if(y){var R=A.substLookupRecords;for(d=0;d<R.length;d+=2)R[d],R[d+1]}}}else if(s.ltype==6&&f.fmt==3){if(!e.U._glsCovered(r,f.backCvg,a-f.backCvg.length)||!e.U._glsCovered(r,f.inptCvg,a)||!e.U._glsCovered(r,f.ahedCvg,a+f.inptCvg.length))continue;var N=f.lookupRec;for(S=0;S<N.length;S+=2){_=N[S];var P=o[N[S+1]];e.U._applySubs(r,a+_,P,o)}}}}},e.U._glsCovered=function(r,a,s){for(var o=0;o<a.length;o++)if(e._lctf.coverageIndex(a[o],r[s+o])==-1)return!1;return!0},e.U.glyphsToPath=function(r,a,s){for(var o={cmds:[],crds:[]},l=0,c=0;c<a.length;c++){var u=a[c];if(u!=-1){for(var f=c<a.length-1&&a[c+1]!=-1?a[c+1]:0,h=e.U.glyphToPath(r,u),d=0;d<h.crds.length;d+=2)o.crds.push(h.crds[d]+l),o.crds.push(h.crds[d+1]);for(s&&o.cmds.push(s),d=0;d<h.cmds.length;d++)o.cmds.push(h.cmds[d]);s&&o.cmds.push("X"),l+=r.hmtx.aWidth[u],c<a.length-1&&(l+=e.U.getPairAdjustment(r,u,f))}}return o},e.U.P={},e.U.P.moveTo=function(r,a,s){r.cmds.push("M"),r.crds.push(a,s)},e.U.P.lineTo=function(r,a,s){r.cmds.push("L"),r.crds.push(a,s)},e.U.P.curveTo=function(r,a,s,o,l,c,u){r.cmds.push("C"),r.crds.push(a,s,o,l,c,u)},e.U.P.qcurveTo=function(r,a,s,o,l){r.cmds.push("Q"),r.crds.push(a,s,o,l)},e.U.P.closePath=function(r){r.cmds.push("Z")},e.U._drawCFF=function(r,a,s,o,l){for(var c=a.stack,u=a.nStems,f=a.haveWidth,h=a.width,d=a.open,g=0,b=a.x,y=a.y,p=0,x=0,_=0,w=0,M=0,S=0,A=0,C=0,k=0,R=0,N={val:0,size:0};g<r.length;){e.CFF.getCharString(r,g,N);var P=N.val;if(g+=N.size,P=="o1"||P=="o18")c.length%2!=0&&!f&&(h=c.shift()+o.nominalWidthX),u+=c.length>>1,c.length=0,f=!0;else if(P=="o3"||P=="o23")c.length%2!=0&&!f&&(h=c.shift()+o.nominalWidthX),u+=c.length>>1,c.length=0,f=!0;else if(P=="o4")c.length>1&&!f&&(h=c.shift()+o.nominalWidthX,f=!0),d&&e.U.P.closePath(l),y+=c.pop(),e.U.P.moveTo(l,b,y),d=!0;else if(P=="o5")for(;c.length>0;)b+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,b,y);else if(P=="o6"||P=="o7")for(var j=c.length,z=P=="o6",X=0;X<j;X++){var F=c.shift();z?b+=F:y+=F,z=!z,e.U.P.lineTo(l,b,y)}else if(P=="o8"||P=="o24"){j=c.length;for(var H=0;H+6<=j;)p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w+c.shift(),e.U.P.curveTo(l,p,x,_,w,b,y),H+=6;P=="o24"&&(b+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,b,y))}else{if(P=="o11")break;if(P=="o1234"||P=="o1235"||P=="o1236"||P=="o1237")P=="o1234"&&(x=y,_=(p=b+c.shift())+c.shift(),R=w=x+c.shift(),S=w,C=y,b=(A=(M=(k=_+c.shift())+c.shift())+c.shift())+c.shift(),e.U.P.curveTo(l,p,x,_,w,k,R),e.U.P.curveTo(l,M,S,A,C,b,y)),P=="o1235"&&(p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),k=_+c.shift(),R=w+c.shift(),M=k+c.shift(),S=R+c.shift(),A=M+c.shift(),C=S+c.shift(),b=A+c.shift(),y=C+c.shift(),c.shift(),e.U.P.curveTo(l,p,x,_,w,k,R),e.U.P.curveTo(l,M,S,A,C,b,y)),P=="o1236"&&(p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),R=w=x+c.shift(),S=w,A=(M=(k=_+c.shift())+c.shift())+c.shift(),C=S+c.shift(),b=A+c.shift(),e.U.P.curveTo(l,p,x,_,w,k,R),e.U.P.curveTo(l,M,S,A,C,b,y)),P=="o1237"&&(p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),k=_+c.shift(),R=w+c.shift(),M=k+c.shift(),S=R+c.shift(),A=M+c.shift(),C=S+c.shift(),Math.abs(A-b)>Math.abs(C-y)?b=A+c.shift():y=C+c.shift(),e.U.P.curveTo(l,p,x,_,w,k,R),e.U.P.curveTo(l,M,S,A,C,b,y));else if(P=="o14"){if(c.length>0&&!f&&(h=c.shift()+s.nominalWidthX,f=!0),c.length==4){var V=c.shift(),W=c.shift(),B=c.shift(),Y=c.shift(),Z=e.CFF.glyphBySE(s,B),G=e.CFF.glyphBySE(s,Y);e.U._drawCFF(s.CharStrings[Z],a,s,o,l),a.x=V,a.y=W,e.U._drawCFF(s.CharStrings[G],a,s,o,l)}d&&(e.U.P.closePath(l),d=!1)}else if(P=="o19"||P=="o20")c.length%2!=0&&!f&&(h=c.shift()+o.nominalWidthX),u+=c.length>>1,c.length=0,f=!0,g+=u+7>>3;else if(P=="o21")c.length>2&&!f&&(h=c.shift()+o.nominalWidthX,f=!0),y+=c.pop(),b+=c.pop(),d&&e.U.P.closePath(l),e.U.P.moveTo(l,b,y),d=!0;else if(P=="o22")c.length>1&&!f&&(h=c.shift()+o.nominalWidthX,f=!0),b+=c.pop(),d&&e.U.P.closePath(l),e.U.P.moveTo(l,b,y),d=!0;else if(P=="o25"){for(;c.length>6;)b+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,b,y);p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w+c.shift(),e.U.P.curveTo(l,p,x,_,w,b,y)}else if(P=="o26")for(c.length%2&&(b+=c.shift());c.length>0;)p=b,x=y+c.shift(),b=_=p+c.shift(),y=(w=x+c.shift())+c.shift(),e.U.P.curveTo(l,p,x,_,w,b,y);else if(P=="o27")for(c.length%2&&(y+=c.shift());c.length>0;)x=y,_=(p=b+c.shift())+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w,e.U.P.curveTo(l,p,x,_,w,b,y);else if(P=="o10"||P=="o29"){var de=P=="o10"?o:s;if(c.length==0)console.debug("error: empty stack");else{var oe=c.pop(),le=de.Subrs[oe+de.Bias];a.x=b,a.y=y,a.nStems=u,a.haveWidth=f,a.width=h,a.open=d,e.U._drawCFF(le,a,s,o,l),b=a.x,y=a.y,u=a.nStems,f=a.haveWidth,h=a.width,d=a.open}}else if(P=="o30"||P=="o31"){var ue=c.length,Se=(H=0,P=="o31");for(H+=ue-(j=-3&ue);H<j;)Se?(x=y,_=(p=b+c.shift())+c.shift(),y=(w=x+c.shift())+c.shift(),j-H==5?(b=_+c.shift(),H++):b=_,Se=!1):(p=b,x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),b=_+c.shift(),j-H==5?(y=w+c.shift(),H++):y=w,Se=!0),e.U.P.curveTo(l,p,x,_,w,b,y),H+=4}else{if((P+"").charAt(0)=="o")throw console.debug("Unknown operation: "+P,r),P;c.push(P)}}}a.x=b,a.y=y,a.nStems=u,a.haveWidth=f,a.width=h,a.open=d};var n=e,i={Typr:n};return t.Typr=n,t.default=i,Object.defineProperty(t,"__esModule",{value:!0}),t}({}).Typr}/*!
Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
(https://github.com/101arrowz/fflate) for use in Troika text rendering. 
Original licenses apply: 
- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
*/function VMe(){return function(t){var e=Uint8Array,n=Uint16Array,i=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(P,j){for(var z=new n(31),X=0;X<31;++X)z[X]=j+=1<<P[X-1];var F=new i(z[30]);for(X=1;X<30;++X)for(var H=z[X];H<z[X+1];++H)F[H]=H-z[X]<<5|X;return[z,F]},l=o(r,2),c=l[0],u=l[1];c[28]=258,u[258]=28;for(var f=o(a,0)[0],h=new n(32768),d=0;d<32768;++d){var g=(43690&d)>>>1|(21845&d)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,h[d]=((65280&g)>>>8|(255&g)<<8)>>>1}var b=function(P,j,z){for(var X=P.length,F=0,H=new n(j);F<X;++F)++H[P[F]-1];var V,W=new n(j);for(F=0;F<j;++F)W[F]=W[F-1]+H[F-1]<<1;{V=new n(1<<j);var B=15-j;for(F=0;F<X;++F)if(P[F])for(var Y=F<<4|P[F],Z=j-P[F],G=W[P[F]-1]++<<Z,de=G|(1<<Z)-1;G<=de;++G)V[h[G]>>>B]=Y}return V},y=new e(288);for(d=0;d<144;++d)y[d]=8;for(d=144;d<256;++d)y[d]=9;for(d=256;d<280;++d)y[d]=7;for(d=280;d<288;++d)y[d]=8;var p=new e(32);for(d=0;d<32;++d)p[d]=5;var x=b(y,9),_=b(p,5),w=function(P){for(var j=P[0],z=1;z<P.length;++z)P[z]>j&&(j=P[z]);return j},M=function(P,j,z){var X=j/8|0;return(P[X]|P[X+1]<<8)>>(7&j)&z},S=function(P,j){var z=j/8|0;return(P[z]|P[z+1]<<8|P[z+2]<<16)>>(7&j)},A=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],C=function(P,j,z){var X=new Error(j||A[P]);if(X.code=P,Error.captureStackTrace&&Error.captureStackTrace(X,C),!z)throw X;return X},k=function(P,j,z){var X=P.length;if(!X||z&&!z.l&&X<5)return j||new e(0);var F=!j||z,H=!z||z.i;z||(z={}),j||(j=new e(3*X));var V,W=function(vt){var Mt=j.length;if(vt>Mt){var gt=new e(Math.max(2*Mt,vt));gt.set(j),j=gt}},B=z.f||0,Y=z.p||0,Z=z.b||0,G=z.l,de=z.d,oe=z.m,le=z.n,ue=8*X;do{if(!G){z.f=B=M(P,Y,1);var Se=M(P,Y+1,3);if(Y+=3,!Se){var Te=P[(Ne=((V=Y)/8|0)+(7&V&&1)+4)-4]|P[Ne-3]<<8,Pe=Ne+Te;if(Pe>X){H&&C(0);break}F&&W(Z+Te),j.set(P.subarray(Ne,Pe),Z),z.b=Z+=Te,z.p=Y=8*Pe;continue}if(Se==1)G=x,de=_,oe=9,le=5;else if(Se==2){var je=M(P,Y,31)+257,He=M(P,Y+10,15)+4,pe=je+M(P,Y+5,31)+1;Y+=14;for(var ze=new e(pe),Ie=new e(19),Xe=0;Xe<He;++Xe)Ie[s[Xe]]=M(P,Y+3*Xe,7);Y+=3*He;var we=w(Ie),Ae=(1<<we)-1,Re=b(Ie,we);for(Xe=0;Xe<pe;){var Ne,Fe=Re[M(P,Y,Ae)];if(Y+=15&Fe,(Ne=Fe>>>4)<16)ze[Xe++]=Ne;else{var Qe=0,ae=0;for(Ne==16?(ae=3+M(P,Y,3),Y+=2,Qe=ze[Xe-1]):Ne==17?(ae=3+M(P,Y,7),Y+=3):Ne==18&&(ae=11+M(P,Y,127),Y+=7);ae--;)ze[Xe++]=Qe}}var K=ze.subarray(0,je),ce=ze.subarray(je);oe=w(K),le=w(ce),G=b(K,oe),de=b(ce,le)}else C(1);if(Y>ue){H&&C(0);break}}F&&W(Z+131072);for(var he=(1<<oe)-1,me=(1<<le)-1,$=Y;;$=Y){var Ve=(Qe=G[S(P,Y)&he])>>>4;if((Y+=15&Qe)>ue){H&&C(0);break}if(Qe||C(2),Ve<256)j[Z++]=Ve;else{if(Ve==256){$=Y,G=null;break}var qe=Ve-254;if(Ve>264){var mt=r[Xe=Ve-257];qe=M(P,Y,(1<<mt)-1)+c[Xe],Y+=mt}var Ge=de[S(P,Y)&me],Je=Ge>>>4;if(Ge||C(3),Y+=15&Ge,ce=f[Je],Je>3&&(mt=a[Je],ce+=S(P,Y)&(1<<mt)-1,Y+=mt),Y>ue){H&&C(0);break}F&&W(Z+131072);for(var Ye=Z+qe;Z<Ye;Z+=4)j[Z]=j[Z-ce],j[Z+1]=j[Z+1-ce],j[Z+2]=j[Z+2-ce],j[Z+3]=j[Z+3-ce];Z=Ye}}z.l=G,z.p=$,z.b=Z,G&&(B=1,z.m=oe,z.d=de,z.n=le)}while(!B);return Z==j.length?j:function(vt,Mt,gt){(gt==null||gt>vt.length)&&(gt=vt.length);var kt=new(vt instanceof n?n:vt instanceof i?i:e)(gt-Mt);return kt.set(vt.subarray(Mt,gt)),kt}(j,0,Z)},R=new e(0),N=typeof TextDecoder<"u"&&new TextDecoder;try{N.decode(R,{stream:!0})}catch{}return t.convert_streams=function(P){var j=new DataView(P),z=0;function X(){var je=j.getUint16(z);return z+=2,je}function F(){var je=j.getUint32(z);return z+=4,je}function H(je){Te.setUint16(Pe,je),Pe+=2}function V(je){Te.setUint32(Pe,je),Pe+=4}for(var W={signature:F(),flavor:F(),length:F(),numTables:X(),reserved:X(),totalSfntSize:F(),majorVersion:X(),minorVersion:X(),metaOffset:F(),metaLength:F(),metaOrigLength:F(),privOffset:F(),privLength:F()},B=0;Math.pow(2,B)<=W.numTables;)B++;B--;for(var Y=16*Math.pow(2,B),Z=16*W.numTables-Y,G=12,de=[],oe=0;oe<W.numTables;oe++)de.push({tag:F(),offset:F(),compLength:F(),origLength:F(),origChecksum:F()}),G+=16;var le,ue=new Uint8Array(12+16*de.length+de.reduce(function(je,He){return je+He.origLength+4},0)),Se=ue.buffer,Te=new DataView(Se),Pe=0;return V(W.flavor),H(W.numTables),H(Y),H(B),H(Z),de.forEach(function(je){V(je.tag),V(je.origChecksum),V(G),V(je.origLength),je.outOffset=G,(G+=je.origLength)%4!=0&&(G+=4-G%4)}),de.forEach(function(je){var He,pe=P.slice(je.offset,je.offset+je.compLength);if(je.compLength!=je.origLength){var ze=new Uint8Array(je.origLength);He=new Uint8Array(pe,2),k(He,ze)}else ze=new Uint8Array(pe);ue.set(ze,je.outOffset);var Ie=0;(G=je.outOffset+je.origLength)%4!=0&&(Ie=4-G%4),ue.set(new Uint8Array(Ie).buffer,je.outOffset+je.origLength),le=G+Ie}),Se.slice(0,le)},Object.defineProperty(t,"__esModule",{value:!0}),t}({}).convert_streams}function GMe(t,e){const n={M:2,L:2,Q:4,C:6,Z:0},i={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,a=2,s=4,o=8,l=16,c=32;let u;function f(A){if(!u){const C={R:a,L:r,D:s,C:l,U:c,T:o};u=new Map;for(let k in i){let R=0;i[k].split(",").forEach(N=>{let[P,j]=N.split("+");P=parseInt(P,36),j=j?parseInt(j,36):0,u.set(R+=P,C[k]);for(let z=j;z--;)u.set(++R,C[k])})}}return u.get(A)||c}const h=1,d=2,g=3,b=4,y=[null,"isol","init","fina","medi"];function p(A){const C=new Uint8Array(A.length);let k=c,R=h,N=-1;for(let P=0;P<A.length;P++){const j=A.codePointAt(P);let z=f(j)|0,X=h;z&o||(k&(r|s|l)?z&(a|s|l)?(X=g,(R===h||R===g)&&C[N]++):z&(r|c)&&(R===d||R===b)&&C[N]--:k&(a|c)&&(R===d||R===b)&&C[N]--,R=C[P]=X,k=z,N=P,j>65535&&P++)}return C}function x(A,C){const k=[];for(let N=0;N<C.length;N++){const P=C.codePointAt(N);P>65535&&N++,k.push(t.U.codeToGlyph(A,P))}const R=A.GSUB;if(R){const{lookupList:N,featureList:P}=R;let j;const z=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,X=[];P.forEach(F=>{if(z.test(F.tag))for(let H=0;H<F.tab.length;H++){if(X[F.tab[H]])continue;X[F.tab[H]]=!0;const V=N[F.tab[H]],W=/^(isol|init|fina|medi)$/.test(F.tag);W&&!j&&(j=p(C));for(let B=0;B<k.length;B++)(!j||!W||y[j[B]]===F.tag)&&t.U._applySubs(k,B,V,N)}})}return k}function _(A,C){const k=new Int16Array(C.length*3);let R=0;for(;R<C.length;R++){const z=C[R];if(z===-1)continue;k[R*3+2]=A.hmtx.aWidth[z];const X=A.GPOS;if(X){const F=X.lookupList;for(let H=0;H<F.length;H++){const V=F[H];for(let W=0;W<V.tabs.length;W++){const B=V.tabs[W];if(V.ltype===1){if(t._lctf.coverageIndex(B.coverage,z)!==-1&&B.pos){j(B.pos,R);break}}else if(V.ltype===2){let Y=null,Z=N();if(Z!==-1){const G=t._lctf.coverageIndex(B.coverage,C[Z]);if(G!==-1){if(B.fmt===1){const de=B.pairsets[G];for(let oe=0;oe<de.length;oe++)de[oe].gid2===z&&(Y=de[oe])}else if(B.fmt===2){const de=t.U._getGlyphClass(C[Z],B.classDef1),oe=t.U._getGlyphClass(z,B.classDef2);Y=B.matrix[de][oe]}if(Y){Y.val1&&j(Y.val1,Z),Y.val2&&j(Y.val2,R);break}}}}else if(V.ltype===4){const Y=t._lctf.coverageIndex(B.markCoverage,z);if(Y!==-1){const Z=N(P),G=Z===-1?-1:t._lctf.coverageIndex(B.baseCoverage,C[Z]);if(G!==-1){const de=B.markArray[Y],oe=B.baseArray[G][de.markClass];k[R*3]=oe.x-de.x+k[Z*3]-k[Z*3+2],k[R*3+1]=oe.y-de.y+k[Z*3+1];break}}}else if(V.ltype===6){const Y=t._lctf.coverageIndex(B.mark1Coverage,z);if(Y!==-1){const Z=N();if(Z!==-1){const G=C[Z];if(w(A,G)===3){const de=t._lctf.coverageIndex(B.mark2Coverage,G);if(de!==-1){const oe=B.mark1Array[Y],le=B.mark2Array[de][oe.markClass];k[R*3]=le.x-oe.x+k[Z*3]-k[Z*3+2],k[R*3+1]=le.y-oe.y+k[Z*3+1];break}}}}}}}}else if(A.kern&&!A.cff){const F=N();if(F!==-1){const H=A.kern.glyph1.indexOf(C[F]);if(H!==-1){const V=A.kern.rval[H].glyph2.indexOf(z);V!==-1&&(k[F*3+2]+=A.kern.rval[H].vals[V])}}}}return k;function N(z){for(let X=R-1;X>=0;X--)if(C[X]!==-1&&(!z||z(C[X])))return X;return-1}function P(z){return w(A,z)===1}function j(z,X){for(let F=0;F<3;F++)k[X*3+F]+=z[F]||0}}function w(A,C){const k=A.GDEF&&A.GDEF.glyphClassDef;return k?t.U._getGlyphClass(C,k):0}function M(...A){for(let C=0;C<A.length;C++)if(typeof A[C]=="number")return A[C]}function S(A){const C=Object.create(null),k=A["OS/2"],R=A.hhea,N=A.head.unitsPerEm,P=M(k&&k.sTypoAscender,R&&R.ascender,N),j={unitsPerEm:N,ascender:P,descender:M(k&&k.sTypoDescender,R&&R.descender,0),capHeight:M(k&&k.sCapHeight,P),xHeight:M(k&&k.sxHeight,P),lineGap:M(k&&k.sTypoLineGap,R&&R.lineGap),supportsCodePoint(z){return t.U.codeToGlyph(A,z)>0},forEachGlyph(z,X,F,H){let V=0;const W=1/j.unitsPerEm*X,B=x(A,z);let Y=0;const Z=_(A,B);return B.forEach((G,de)=>{if(G!==-1){let oe=C[G];if(!oe){const{cmds:le,crds:ue}=t.U.glyphToPath(A,G);let Se="",Te=0;for(let ze=0,Ie=le.length;ze<Ie;ze++){const Xe=n[le[ze]];Se+=le[ze];for(let we=1;we<=Xe;we++)Se+=(we>1?",":"")+ue[Te++]}let Pe,je,He,pe;if(ue.length){Pe=je=1/0,He=pe=-1/0;for(let ze=0,Ie=ue.length;ze<Ie;ze+=2){let Xe=ue[ze],we=ue[ze+1];Xe<Pe&&(Pe=Xe),we<je&&(je=we),Xe>He&&(He=Xe),we>pe&&(pe=we)}}else Pe=He=je=pe=0;oe=C[G]={index:G,advanceWidth:A.hmtx.aWidth[G],xMin:Pe,yMin:je,xMax:He,yMax:pe,path:Se}}H.call(null,oe,V+Z[de*3]*W,Z[de*3+1]*W,Y),V+=Z[de*3+2]*W,F&&(V+=F*X)}Y+=z.codePointAt(Y)>65535?2:1}),V}};return j}return function(C){const k=new Uint8Array(C,0,4),R=t._bin.readASCII(k,0,4);if(R==="wOFF")C=e(C);else if(R==="wOF2")throw new Error("woff2 fonts not supported");return S(t.parse(C)[0])}}const WMe=ny({name:"Typr Font Parser",dependencies:[HMe,VMe,GMe],init(t,e,n){const i=t(),r=e();return n(i,r)}});/*!
Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
for use in Troika text rendering. 
Original MIT license applies
*/function XMe(){return function(t){var e=function(){this.buckets=new Map};e.prototype.add=function(_){var w=_>>5;this.buckets.set(w,(this.buckets.get(w)||0)|1<<(31&_))},e.prototype.has=function(_){var w=this.buckets.get(_>>5);return w!==void 0&&(w&1<<(31&_))!=0},e.prototype.serialize=function(){var _=[];return this.buckets.forEach(function(w,M){_.push((+M).toString(36)+":"+w.toString(36))}),_.join(",")},e.prototype.deserialize=function(_){var w=this;this.buckets.clear(),_.split(",").forEach(function(M){var S=M.split(":");w.buckets.set(parseInt(S[0],36),parseInt(S[1],36))})};var n=Math.pow(2,8),i=n-1,r=~i;function a(_){var w=function(S){return S&r}(_).toString(16),M=function(S){return(S&r)+n-1}(_).toString(16);return"codepoint-index/plane"+(_>>16)+"/"+w+"-"+M+".json"}function s(_,w){var M=_&i,S=w.codePointAt(M/6|0);return((S=(S||48)-48)&1<<M%6)!=0}function o(_,w){var M;(M=_,M.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(S){return S.split("-").map(function(A){return parseInt(A.trim(),16)})})).forEach(function(S){var A=S[0],C=S[1];C===void 0&&(C=A),w(A,C)})}function l(_,w){o(_,function(M,S){for(var A=M;A<=S;A++)w(A)})}var c={},u={},f=new WeakMap,h="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function d(_){var w=f.get(_);return w||(w=new e,l(_.ranges,function(M){return w.add(M)}),f.set(_,w)),w}var g,b=new Map;function y(_,w,M){return _[w]?w:_[M]?M:function(S){for(var A in S)return A}(_)}function p(_,w){var M=w;if(!_.includes(M)){M=1/0;for(var S=0;S<_.length;S++)Math.abs(_[S]-w)<Math.abs(M-w)&&(M=_[S])}return M}function x(_){return g||(g=new Set,l("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(w){g.add(w)})),g.has(_)}return t.CodePointSet=e,t.clearCache=function(){c={},u={}},t.getFontsForString=function(_,w){w===void 0&&(w={});var M,S=w.lang;S===void 0&&(S=new RegExp("\\p{Script=Hangul}","u").test(M=_)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(M)?"ja":"en");var A=w.category;A===void 0&&(A="sans-serif");var C=w.style;C===void 0&&(C="normal");var k=w.weight;k===void 0&&(k=400);var R=(w.dataUrl||h).replace(/\/$/g,""),N=new Map,P=new Uint8Array(_.length),j={},z={},X=new Array(_.length),F=new Map,H=!1;function V(Y){var Z=b.get(Y);return Z||(Z=fetch(R+"/"+Y).then(function(G){if(!G.ok)throw new Error(G.statusText);return G.json().then(function(de){if(!Array.isArray(de)||de[0]!==1)throw new Error("Incorrect schema version; need 1, got "+de[0]);return de[1]})}).catch(function(G){if(R!==h)return H||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+R+'", trying default CDN. '+G.message),H=!0),R=h,b.delete(Y),V(Y);throw G}),b.set(Y,Z)),Z}for(var W=function(Y){var Z=_.codePointAt(Y),G=a(Z);X[Y]=G,c[G]||F.has(G)||F.set(G,V(G).then(function(de){c[G]=de})),Z>65535&&(Y++,B=Y)},B=0;B<_.length;B++)W(B);return Promise.all(F.values()).then(function(){F.clear();for(var Y=function(G){var de=_.codePointAt(G),oe=null,le=c[X[G]],ue=void 0;for(var Se in le){var Te=z[Se];if(Te===void 0&&(Te=z[Se]=new RegExp(Se).test(S||"en")),Te){for(var Pe in ue=Se,le[Se])if(s(de,le[Se][Pe])){oe=Pe;break}break}}if(!oe){e:for(var je in le)if(je!==ue){for(var He in le[je])if(s(de,le[je][He])){oe=He;break e}}}oe||(console.debug("No font coverage for U+"+de.toString(16)),oe="latin"),X[G]=oe,u[oe]||F.has(oe)||F.set(oe,V("font-meta/"+oe+".json").then(function(pe){u[oe]=pe})),de>65535&&(G++,Z=G)},Z=0;Z<_.length;Z++)Y(Z);return Promise.all(F.values())}).then(function(){for(var Y,Z=null,G=0;G<_.length;G++){var de=_.codePointAt(G);if(Z&&(x(de)||d(Z).has(de)))P[G]=P[G-1];else{Z=u[X[G]];var oe=j[Z.id];if(!oe){var le=Z.typeforms,ue=y(le,A,"sans-serif"),Se=y(le[ue],C,"normal"),Te=p((Y=le[ue])===null||Y===void 0?void 0:Y[Se],k);oe=j[Z.id]=R+"/font-files/"+Z.id+"/"+ue+"."+Se+"."+Te+".woff"}var Pe=N.get(oe);Pe==null&&(Pe=N.size,N.set(oe,Pe)),P[G]=Pe}de>65535&&(G++,P[G]=P[G-1])}return{fontUrls:Array.from(N.keys()),chars:P}})},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}function qMe(t,e){const n=Object.create(null),i=Object.create(null);function r(s,o){const l=c=>{console.error(`Failure loading font ${s}`,c)};try{const c=new XMLHttpRequest;c.open("get",s,!0),c.responseType="arraybuffer",c.onload=function(){if(c.status>=400)l(new Error(c.statusText));else if(c.status>0)try{const u=t(c.response);u.src=s,o(u)}catch(u){l(u)}},c.onerror=l,c.send()}catch(c){l(c)}}function a(s,o){let l=n[s];l?o(l):i[s]?i[s].push(o):(i[s]=[o],r(s,c=>{c.src=s,n[s]=c,i[s].forEach(u=>u(c)),delete i[s]}))}return function(s,o,{lang:l,fonts:c=[],style:u="normal",weight:f="normal",unicodeFontsURL:h}={}){const d=new Uint8Array(s.length),g=[];s.length||x();const b=new Map,y=[];if(u!=="italic"&&(u="normal"),typeof f!="number"&&(f=f==="bold"?700:400),c&&!Array.isArray(c)&&(c=[c]),c=c.slice().filter(w=>!w.lang||w.lang.test(l)).reverse(),c.length){let A=0;(function C(k=0){for(let R=k,N=s.length;R<N;R++){const P=s.codePointAt(R);if(A===1&&g[d[R-1]].supportsCodePoint(P)||R>0&&/\s/.test(s[R]))d[R]=d[R-1],A===2&&(y[y.length-1][1]=R);else for(let j=d[R],z=c.length;j<=z;j++)if(j===z){const X=A===2?y[y.length-1]:y[y.length]=[R,R];X[1]=R,A=2}else{d[R]=j;const{src:X,unicodeRange:F}=c[j];if(!F||_(P,F)){const H=n[X];if(!H){a(X,()=>{C(R)});return}if(H.supportsCodePoint(P)){let V=b.get(H);typeof V!="number"&&(V=g.length,g.push(H),b.set(H,V)),d[R]=V,A=1;break}}}P>65535&&R+1<N&&(d[R+1]=d[R],R++,A===2&&(y[y.length-1][1]=R))}p()})()}else y.push([0,s.length-1]),p();function p(){if(y.length){const w=y.map(M=>s.substring(M[0],M[1]+1)).join(`
`);e.getFontsForString(w,{lang:l||void 0,style:u,weight:f,dataUrl:h}).then(({fontUrls:M,chars:S})=>{const A=g.length;let C=0;y.forEach(R=>{for(let N=0,P=R[1]-R[0];N<=P;N++)d[R[0]+N]=S[C++]+A;C++});let k=0;M.forEach((R,N)=>{a(R,P=>{g[N+A]=P,++k===M.length&&x()})})})}else x()}function x(){o({chars:d,fonts:g})}function _(w,M){for(let S=0;S<M.length;S++){const[A,C=A]=M[S];if(A<=w&&w<=C)return!0}return!1}}}const KMe=ny({name:"FontResolver",dependencies:[qMe,WMe,XMe],init(t,e,n){return t(e,n())}});function YMe(t,e){const i=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",a=new RegExp(`${r}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function s({text:g,lang:b,fonts:y,style:p,weight:x,preResolvedFonts:_,unicodeFontsURL:w},M){const S=({chars:A,fonts:C})=>{let k,R;const N=[];for(let P=0;P<A.length;P++)A[P]!==R?(R=A[P],N.push(k={start:P,end:P,fontObj:C[A[P]]})):k.end=P;M(N)};_?S(_):t(g,S,{lang:b,fonts:y,style:p,weight:x,unicodeFontsURL:w})}function o({text:g="",font:b,lang:y,sdfGlyphSize:p=64,fontSize:x=400,fontWeight:_=1,fontStyle:w="normal",letterSpacing:M=0,lineHeight:S="normal",maxWidth:A=1/0,direction:C,textAlign:k="left",textIndent:R=0,whiteSpace:N="normal",overflowWrap:P="normal",anchorX:j=0,anchorY:z=0,metricsOnly:X=!1,unicodeFontsURL:F,preResolvedFonts:H=null,includeCaretPositions:V=!1,chunkedBoundsSize:W=8192,colorRanges:B=null},Y){const Z=f(),G={fontLoad:0,typesetting:0};g.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),g=g.replace(/\r\n/g,`
`).replace(/\r/g,`
`)),x=+x,M=+M,A=+A,S=S||"normal",R=+R,s({text:g,lang:y,style:w,weight:_,fonts:typeof b=="string"?[{src:b}]:b,unicodeFontsURL:F,preResolvedFonts:H},de=>{G.fontLoad=f()-Z;const oe=isFinite(A);let le=null,ue=null,Se=null,Te=null,Pe=null,je=null,He=null,pe=null,ze=0,Ie=0,Xe=N!=="nowrap";const we=new Map,Ae=f();let Re=R,Ne=0,Fe=new h;const Qe=[Fe];de.forEach(me=>{const{fontObj:$}=me,{ascender:Ve,descender:qe,unitsPerEm:mt,lineGap:Ge,capHeight:Je,xHeight:Ye}=$;let vt=we.get($);if(!vt){const Le=x/mt,ht=S==="normal"?(Ve-qe+Ge)*Le:S*x,jt=(ht-(Ve-qe)*Le)/2,ot=Math.min(ht,(Ve-qe)*Le),it=(Ve+qe)/2*Le+ot/2;vt={index:we.size,src:$.src,fontObj:$,fontSizeMult:Le,unitsPerEm:mt,ascender:Ve*Le,descender:qe*Le,capHeight:Je*Le,xHeight:Ye*Le,lineHeight:ht,baseline:-jt-Ve*Le,caretTop:it,caretBottom:it-ot},we.set($,vt)}const{fontSizeMult:Mt}=vt,gt=g.slice(me.start,me.end+1);let kt,ke;$.forEachGlyph(gt,x,M,(Le,ht,jt,ot)=>{ht+=Ne,ot+=me.start,kt=ht,ke=Le;const it=g.charAt(ot),bt=Le.advanceWidth*Mt,Jt=Fe.count;let Kt;if("isEmpty"in Le||(Le.isWhitespace=!!it&&new RegExp(r).test(it),Le.canBreakAfter=!!it&&a.test(it),Le.isEmpty=Le.xMin===Le.xMax||Le.yMin===Le.yMax||i.test(it)),!Le.isWhitespace&&!Le.isEmpty&&Ie++,Xe&&oe&&!Le.isWhitespace&&ht+bt+Re>A&&Jt){if(Fe.glyphAt(Jt-1).glyphObj.canBreakAfter)Kt=new h,Re=-ht;else for(let Vn=Jt;Vn--;)if(Vn===0&&P==="break-word"){Kt=new h,Re=-ht;break}else if(Fe.glyphAt(Vn).glyphObj.canBreakAfter){Kt=Fe.splitAt(Vn+1);const vn=Kt.glyphAt(0).x;Re-=vn;for(let Qn=Kt.count;Qn--;)Kt.glyphAt(Qn).x-=vn;break}Kt&&(Fe.isSoftWrapped=!0,Fe=Kt,Qe.push(Fe),ze=A)}let un=Fe.glyphAt(Fe.count);un.glyphObj=Le,un.x=ht+Re,un.y=jt,un.width=bt,un.charIndex=ot,un.fontData=vt,it===`
`&&(Fe=new h,Qe.push(Fe),Re=-(ht+bt+M*x)+R)}),Ne=kt+ke.advanceWidth*Mt+M*x});let ae=0;Qe.forEach(me=>{let $=!0;for(let Ve=me.count;Ve--;){const qe=me.glyphAt(Ve);$&&!qe.glyphObj.isWhitespace&&(me.width=qe.x+qe.width,me.width>ze&&(ze=me.width),$=!1);let{lineHeight:mt,capHeight:Ge,xHeight:Je,baseline:Ye}=qe.fontData;mt>me.lineHeight&&(me.lineHeight=mt);const vt=Ye-me.baseline;vt<0&&(me.baseline+=vt,me.cap+=vt,me.ex+=vt),me.cap=Math.max(me.cap,me.baseline+Ge),me.ex=Math.max(me.ex,me.baseline+Je)}me.baseline-=ae,me.cap-=ae,me.ex-=ae,ae+=me.lineHeight});let K=0,ce=0;if(j&&(typeof j=="number"?K=-j:typeof j=="string"&&(K=-ze*(j==="left"?0:j==="center"?.5:j==="right"?1:c(j)))),z&&(typeof z=="number"?ce=-z:typeof z=="string"&&(ce=z==="top"?0:z==="top-baseline"?-Qe[0].baseline:z==="top-cap"?-Qe[0].cap:z==="top-ex"?-Qe[0].ex:z==="middle"?ae/2:z==="bottom"?ae:z==="bottom-baseline"?-Qe[Qe.length-1].baseline:c(z)*ae)),!X){const me=e.getEmbeddingLevels(g,C);le=new Uint16Array(Ie),ue=new Uint8Array(Ie),Se=new Float32Array(Ie*2),Te={},He=[1/0,1/0,-1/0,-1/0],pe=[],V&&(je=new Float32Array(g.length*4)),B&&(Pe=new Uint8Array(Ie*3));let $=0,Ve=-1,qe=-1,mt,Ge;if(Qe.forEach((Je,Ye)=>{let{count:vt,width:Mt}=Je;if(vt>0){let gt=0;for(let ot=vt;ot--&&Je.glyphAt(ot).glyphObj.isWhitespace;)gt++;let kt=0,ke=0;if(k==="center")kt=(ze-Mt)/2;else if(k==="right")kt=ze-Mt;else if(k==="justify"&&Je.isSoftWrapped){let ot=0;for(let it=vt-gt;it--;)Je.glyphAt(it).glyphObj.isWhitespace&&ot++;ke=(ze-Mt)/ot}if(ke||kt){let ot=0;for(let it=0;it<vt;it++){let bt=Je.glyphAt(it);const Jt=bt.glyphObj;bt.x+=kt+ot,ke!==0&&Jt.isWhitespace&&it<vt-gt&&(ot+=ke,bt.width+=ke)}}const Le=e.getReorderSegments(g,me,Je.glyphAt(0).charIndex,Je.glyphAt(Je.count-1).charIndex);for(let ot=0;ot<Le.length;ot++){const[it,bt]=Le[ot];let Jt=1/0,Kt=-1/0;for(let un=0;un<vt;un++)if(Je.glyphAt(un).charIndex>=it){let Vn=un,vn=un;for(;vn<vt;vn++){let Qn=Je.glyphAt(vn);if(Qn.charIndex>bt)break;vn<vt-gt&&(Jt=Math.min(Jt,Qn.x),Kt=Math.max(Kt,Qn.x+Qn.width))}for(let Qn=Vn;Qn<vn;Qn++){const Yn=Je.glyphAt(Qn);Yn.x=Kt-(Yn.x+Yn.width-Jt)}break}}let ht;const jt=ot=>ht=ot;for(let ot=0;ot<vt;ot++){const it=Je.glyphAt(ot);ht=it.glyphObj;const bt=ht.index,Jt=me.levels[it.charIndex]&1;if(Jt){const Kt=e.getMirroredCharacter(g[it.charIndex]);Kt&&it.fontData.fontObj.forEachGlyph(Kt,0,0,jt)}if(V){const{charIndex:Kt,fontData:un}=it,Vn=it.x+K,vn=it.x+it.width+K;je[Kt*4]=Jt?vn:Vn,je[Kt*4+1]=Jt?Vn:vn,je[Kt*4+2]=Je.baseline+un.caretBottom+ce,je[Kt*4+3]=Je.baseline+un.caretTop+ce;const Qn=Kt-Ve;Qn>1&&u(je,Ve,Qn),Ve=Kt}if(B){const{charIndex:Kt}=it;for(;Kt>qe;)qe++,B.hasOwnProperty(qe)&&(Ge=B[qe])}if(!ht.isWhitespace&&!ht.isEmpty){const Kt=$++,{fontSizeMult:un,src:Vn,index:vn}=it.fontData,Qn=Te[Vn]||(Te[Vn]={});Qn[bt]||(Qn[bt]={path:ht.path,pathBounds:[ht.xMin,ht.yMin,ht.xMax,ht.yMax]});const Yn=it.x+K,xi=it.y+Je.baseline+ce;Se[Kt*2]=Yn,Se[Kt*2+1]=xi;const qn=Yn+ht.xMin*un,Ji=xi+ht.yMin*un,hi=Yn+ht.xMax*un,on=xi+ht.yMax*un;qn<He[0]&&(He[0]=qn),Ji<He[1]&&(He[1]=Ji),hi>He[2]&&(He[2]=hi),on>He[3]&&(He[3]=on),Kt%W===0&&(mt={start:Kt,end:Kt,rect:[1/0,1/0,-1/0,-1/0]},pe.push(mt)),mt.end++;const Ii=mt.rect;if(qn<Ii[0]&&(Ii[0]=qn),Ji<Ii[1]&&(Ii[1]=Ji),hi>Ii[2]&&(Ii[2]=hi),on>Ii[3]&&(Ii[3]=on),le[Kt]=bt,ue[Kt]=vn,B){const ri=Kt*3;Pe[ri]=Ge>>16&255,Pe[ri+1]=Ge>>8&255,Pe[ri+2]=Ge&255}}}}}),je){const Je=g.length-Ve;Je>1&&u(je,Ve,Je)}}const he=[];we.forEach(({index:me,src:$,unitsPerEm:Ve,ascender:qe,descender:mt,lineHeight:Ge,capHeight:Je,xHeight:Ye})=>{he[me]={src:$,unitsPerEm:Ve,ascender:qe,descender:mt,lineHeight:Ge,capHeight:Je,xHeight:Ye}}),G.typesetting=f()-Ae,Y({glyphIds:le,glyphFontIndices:ue,glyphPositions:Se,glyphData:Te,fontData:he,caretPositions:je,glyphColors:Pe,chunkedBounds:pe,fontSize:x,topBaseline:ce+Qe[0].baseline,blockBounds:[K,ce-ae,K+ze,ce],visibleBounds:He,timings:G})})}function l(g,b){o({...g,metricsOnly:!0},y=>{const[p,x,_,w]=y.blockBounds;b({width:_-p,height:w-x})})}function c(g){let b=g.match(/^([\d.]+)%$/),y=b?parseFloat(b[1]):NaN;return isNaN(y)?0:y/100}function u(g,b,y){const p=g[b*4],x=g[b*4+1],_=g[b*4+2],w=g[b*4+3],M=(x-p)/y;for(let S=0;S<y;S++){const A=(b+S)*4;g[A]=p+M*S,g[A+1]=p+M*(S+1),g[A+2]=_,g[A+3]=w}}function f(){return(self.performance||Date).now()}function h(){this.data=[]}const d=["glyphObj","x","y","width","charIndex","fontData"];return h.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/d.length)},glyphAt(g){let b=h.flyweight;return b.data=this.data,b.index=g,b},splitAt(g){let b=new h;return b.data=this.data.splice(g*d.length),b}},h.flyweight=d.reduce((g,b,y,p)=>(Object.defineProperty(g,b,{get(){return this.data[this.index*d.length+y]},set(x){this.data[this.index*d.length+y]=x}}),g),{data:null,index:0}),{typeset:o,measure:l}}const Pm=()=>(self.performance||Date).now(),EC=WZ();let W5;function JMe(t,e,n,i,r,a,s,o,l,c,u=!0){return u?ZMe(t,e,n,i,r,a,s,o,l,c).then(null,f=>(W5||(console.warn("WebGL SDF generation failed, falling back to JS",f),W5=!0),q5(t,e,n,i,r,a,s,o,l,c))):q5(t,e,n,i,r,a,s,o,l,c)}const vM=[],$Me=5;let SI=0;function qZ(){const t=Pm();for(;vM.length&&Pm()-t<$Me;)vM.shift()();SI=vM.length?setTimeout(qZ,0):0}const ZMe=(...t)=>new Promise((e,n)=>{vM.push(()=>{const i=Pm();try{EC.webgl.generateIntoCanvas(...t),e({timing:Pm()-i})}catch(r){n(r)}}),SI||(SI=setTimeout(qZ,0))}),QMe=4,e2e=2e3,X5={};let t2e=0;function q5(t,e,n,i,r,a,s,o,l,c){const u="TroikaTextSDFGenerator_JS_"+t2e++%QMe;let f=X5[u];return f||(f=X5[u]={workerModule:ny({name:u,workerId:u,dependencies:[WZ,Pm],init(h,d){const g=h().javascript.generate;return function(...b){const y=d();return{textureData:g(...b),timing:d()-y}}},getTransferables(h){return[h.textureData.buffer]}}),requests:0,idleTimer:null}),f.requests++,clearTimeout(f.idleTimer),f.workerModule(t,e,n,i,r,a).then(({textureData:h,timing:d})=>{const g=Pm(),b=new Uint8Array(h.length*4);for(let y=0;y<h.length;y++)b[y*4+c]=h[y];return EC.webglUtils.renderImageData(s,b,o,l,t,e,1<<3-c),d+=Pm()-g,--f.requests===0&&(f.idleTimer=setTimeout(()=>{OMe(u)},e2e)),{timing:d}})}function n2e(t){t._warm||(EC.webgl.isSupported(t),t._warm=!0)}const i2e=EC.webglUtils.resizeWebGLCanvasWithoutClearing,kx={unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},r2e=new Ut;function _b(){return(self.performance||Date).now()}const K5=Object.create(null);function a2e(t,e){t=o2e({},t);const n=_b(),i=[];if(t.font&&i.push({label:"user",src:l2e(t.font)}),t.font=i,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||kx.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||kx.unicodeFontsURL,t.colorRanges!=null){let h={};for(let d in t.colorRanges)if(t.colorRanges.hasOwnProperty(d)){let g=t.colorRanges[d];typeof g!="number"&&(g=r2e.set(g).getHex()),h[d]=g}t.colorRanges=h}Object.freeze(t);const{textureWidth:r,sdfExponent:a}=kx,{sdfGlyphSize:s}=t,o=r/s*4;let l=K5[s];if(!l){const h=document.createElement("canvas");h.width=r,h.height=s*256/o,l=K5[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:h,sdfTexture:new nr(h,void 0,void 0,void 0,Vi,Vi),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,s2e(l)}const{sdfTexture:c,sdfCanvas:u}=l;JZ(t).then(h=>{const{glyphIds:d,glyphFontIndices:g,fontData:b,glyphPositions:y,fontSize:p,timings:x}=h,_=[],w=new Float32Array(d.length*4);let M=0,S=0;const A=_b(),C=b.map(j=>{let z=l.glyphsByFont.get(j.src);return z||l.glyphsByFont.set(j.src,z=new Map),z});d.forEach((j,z)=>{const X=g[z],{src:F,unitsPerEm:H}=b[X];let V=C[X].get(j);if(!V){const{path:G,pathBounds:de}=h.glyphData[F][j],oe=Math.max(de[2]-de[0],de[3]-de[1])/s*(kx.sdfMargin*s+.5),le=l.glyphCount++,ue=[de[0]-oe,de[1]-oe,de[2]+oe,de[3]+oe];C[X].set(j,V={path:G,atlasIndex:le,sdfViewBox:ue}),_.push(V)}const{sdfViewBox:W}=V,B=y[S++],Y=y[S++],Z=p/H;w[M++]=B+W[0]*Z,w[M++]=Y+W[1]*Z,w[M++]=B+W[2]*Z,w[M++]=Y+W[3]*Z,d[z]=V.atlasIndex}),x.quads=(x.quads||0)+(_b()-A);const k=_b();x.sdf={};const R=u.height,N=Math.ceil(l.glyphCount/o),P=Math.pow(2,Math.ceil(Math.log2(N*s)));P>R&&(console.info(`Increasing SDF texture size ${R}->${P}`),i2e(u,r,P),c.dispose()),Promise.all(_.map(j=>KZ(j,l,t.gpuAccelerateSDF).then(({timing:z})=>{x.sdf[j.atlasIndex]=z}))).then(()=>{_.length&&!l.contextLost&&(YZ(l),c.needsUpdate=!0),x.sdfTotal=_b()-k,x.total=_b()-n,e(Object.freeze({parameters:t,sdfTexture:c,sdfGlyphSize:s,sdfExponent:a,glyphBounds:w,glyphAtlasIndices:d,glyphColors:h.glyphColors,caretPositions:h.caretPositions,chunkedBounds:h.chunkedBounds,ascender:h.ascender,descender:h.descender,lineHeight:h.lineHeight,capHeight:h.capHeight,xHeight:h.xHeight,topBaseline:h.topBaseline,blockBounds:h.blockBounds,visibleBounds:h.visibleBounds,timings:h.timings}))})}),Promise.resolve().then(()=>{l.contextLost||n2e(u)})}function KZ({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:i,sdfCanvas:r,contextLost:a},s){if(a)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=kx,c=Math.max(n[2]-n[0],n[3]-n[1]),u=Math.floor(e/4),f=u%(o/i)*i,h=Math.floor(u/(o/i))*i,d=e%4;return JMe(i,i,t,n,c,l,r,f,h,d,s)}function s2e(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",n=>{console.log("Context Lost",n),n.preventDefault(),t.contextLost=!0}),e.addEventListener("webglcontextrestored",n=>{console.log("Context Restored",n),t.contextLost=!1;const i=[];t.glyphsByFont.forEach(r=>{r.forEach(a=>{i.push(KZ(a,t,!0))})}),Promise.all(i).then(()=>{YZ(t),t.sdfTexture.needsUpdate=!0})})}function o2e(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}let rE;function l2e(t){return rE||(rE=typeof document>"u"?{}:document.createElement("a")),rE.href=t,rE.href}function YZ(t){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:i,height:r}=e,a=t.sdfCanvas.getContext("webgl");let s=n.image.data;(!s||s.length!==i*r*4)&&(s=new Uint8Array(i*r*4),n.image={width:i,height:r,data:s},n.flipY=!1,n.isDataTexture=!0),a.readPixels(0,0,i,r,a.RGBA,a.UNSIGNED_BYTE,s)}}const c2e=ny({name:"Typesetter",dependencies:[YMe,KMe,NMe],init(t,e,n){return t(e,n())}}),JZ=ny({name:"Typesetter",dependencies:[c2e],init(t){return function(e){return new Promise(n=>{t.typeset(e,n)})}},getTransferables(t){const e=[];for(let n in t)t[n]&&t[n].buffer&&e.push(t[n].buffer);return e}});JZ.onMainThread;const Y5={};function u2e(t){let e=Y5[t];return e||(e=Y5[t]=new Il(1,1,t,t).translate(.5,.5,0)),e}const yM="aTroikaGlyphBounds",h1="aTroikaGlyphIndex",f2e="aTroikaGlyphColor";class h2e extends G_{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Ur,this.boundingBox=new rr}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let n=u2e(e);["position","normal","uv"].forEach(i=>{this.attributes[i]=n.attributes[i].clone()}),this.setIndex(n.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,n,i,r,a){this.updateAttributeData(yM,e,4),this.updateAttributeData(h1,n,1),this.updateAttributeData(f2e,a,3),this._blockBounds=i,this._chunkedBounds=r,this.instanceCount=n.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:n,boundingBox:i}=this;if(n){const{PI:r,floor:a,min:s,max:o,sin:l,cos:c}=Math,u=r/2,f=r*2,h=Math.abs(n),d=e[0]/h,g=e[2]/h,b=a((d+u)/f)!==a((g+u)/f)?-h:s(l(d)*h,l(g)*h),y=a((d-u)/f)!==a((g-u)/f)?h:o(l(d)*h,l(g)*h),p=a((d+r)/f)!==a((g+r)/f)?h*2:o(h-c(d)*h,h-c(g)*h);i.min.set(b,e[1],n<0?-p:0),i.max.set(y,e[3],n<0?0:p)}else i.min.set(e[0],e[1],0),i.max.set(e[2],e[3],0);i.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let n=this.getAttribute(h1).count,i=this._chunkedBounds;if(i)for(let r=i.length;r--;){n=i[r].end;let a=i[r].rect;if(a[1]<e.w&&a[3]>e.y&&a[0]<e.z&&a[2]>e.x)break}this.instanceCount=n}updateAttributeData(e,n,i){const r=this.getAttribute(e);n?r&&r.array.length===n.length?(r.array.set(n),r.needsUpdate=!0):(this.setAttribute(e,new pf(n,i)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}}const d2e=`
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform vec4 uTroikaTotalBounds;
uniform vec4 uTroikaClipRect;
uniform mat3 uTroikaOrient;
uniform bool uTroikaUseGlyphColors;
uniform float uTroikaEdgeOffset;
uniform float uTroikaBlurRadius;
uniform vec2 uTroikaPositionOffset;
uniform float uTroikaCurveRadius;
attribute vec4 aTroikaGlyphBounds;
attribute float aTroikaGlyphIndex;
attribute vec3 aTroikaGlyphColor;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec3 vTroikaGlyphColor;
varying vec2 vTroikaGlyphDimensions;
`,p2e=`
vec4 bounds = aTroikaGlyphBounds;
bounds.xz += uTroikaPositionOffset.x;
bounds.yw -= uTroikaPositionOffset.y;

vec4 outlineBounds = vec4(
  bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,
  bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius
);
vec4 clippedBounds = vec4(
  clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),
  clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)
);

vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);

position.xy = mix(bounds.xy, bounds.zw, clippedXY);

uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);

float rad = uTroikaCurveRadius;
if (rad != 0.0) {
  float angle = position.x / rad;
  position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);
  normal.xz = vec2(sin(angle), cos(angle));
}
  
position = uTroikaOrient * position;
normal = uTroikaOrient * normal;

vTroikaGlyphUV = clippedXY.xy;
vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);


float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;
vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;
vec2 txStartUV = txUvPerSquare * vec2(
  mod(floor(aTroikaGlyphIndex / 4.0), txCols),
  floor(floor(aTroikaGlyphIndex / 4.0) / txCols)
);
vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
`,m2e=`
uniform sampler2D uTroikaSDFTexture;
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform float uTroikaSDFExponent;
uniform float uTroikaEdgeOffset;
uniform float uTroikaFillOpacity;
uniform float uTroikaBlurRadius;
uniform vec3 uTroikaStrokeColor;
uniform float uTroikaStrokeWidth;
uniform float uTroikaStrokeOpacity;
uniform bool uTroikaSDFDebug;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec2 vTroikaGlyphDimensions;

float troikaSdfValueToSignedDistance(float alpha) {
  // Inverse of exponential encoding in webgl-sdf-generator
  
  float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);
  float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;
  float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);
  return signedDist;
}

float troikaGlyphUvToSdfValue(vec2 glyphUV) {
  vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);
  vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);
  float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1
  return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;
}

float troikaGlyphUvToDistance(vec2 uv) {
  return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));
}

float troikaGetAADist() {
  
  #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300
  return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;
  #else
  return vTroikaGlyphDimensions.x / 64.0;
  #endif
}

float troikaGetFragDistValue() {
  vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);
  float distance = troikaGlyphUvToDistance(clampedGlyphUV);
 
  // Extrapolate distance when outside bounds:
  distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 
    length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);

  

  return distance;
}

float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
  #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)
  float alpha = step(-distanceOffset, -distance);
  #else

  float alpha = smoothstep(
    distanceOffset + aaDist,
    distanceOffset - aaDist,
    distance
  );
  #endif

  return alpha;
}
`,g2e=`
float aaDist = troikaGetAADist();
float fragDistance = troikaGetFragDistValue();
float edgeAlpha = uTroikaSDFDebug ?
  troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
  troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));

#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
vec4 fillRGBA = gl_FragColor;
fillRGBA.a *= uTroikaFillOpacity;
vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);
if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
  -uTroikaStrokeWidth - aaDist,
  -uTroikaStrokeWidth + aaDist,
  fragDistance
));
gl_FragColor.a *= edgeAlpha;
#endif

if (edgeAlpha == 0.0) {
  discard;
}
`;function $Z(t){const e=Q1(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new wt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new ni(0,0,0,0)},uTroikaClipRect:{value:new ni(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new wt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Ut},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new $n},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:d2e,vertexTransform:p2e,fragmentDefs:m2e,fragmentColorTransform:g2e,customRewriter({vertexShader:n,fragmentShader:i}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(i)&&(i=i.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(n)||(n=n.replace(XZ,`uniform vec3 diffuse;
$&
vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
`))),{vertexShader:n,fragmentShader:i}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const PU=new Ds({color:16777215,side:Jr,transparent:!0}),J5=8421504,$5=new Dt,aE=new te,fD=new te,Qy=[],b2e=new te,hD="+x+y";function Z5(t){return Array.isArray(t)?t[0]:t}let ZZ=()=>{const t=new _i(new Il(1,1),PU);return ZZ=()=>t,t},QZ=()=>{const t=new _i(new Il(1,1,32,1),PU);return QZ=()=>t,t};const v2e={type:"syncstart"},y2e={type:"synccomplete"},eQ=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],x2e=eQ.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class d1 extends _i{constructor(){const e=new h2e;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=J5,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=hD,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(v2e),a2e({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},n=>{this._isSyncing=!1,this._textRenderInfo=n,this.geometry.updateGlyphs(n.glyphBounds,n.glyphAtlasIndices,n.blockBounds,n.chunkedBounds,n.glyphColors);const i=this._queuedSyncs;i&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{i.forEach(r=>r&&r())})),this.dispatchEvent(y2e),e&&e()})))}onBeforeRender(e,n,i,r,a,s){this.sync(),a.isTroikaTextMaterial&&this._prepareForRender(a)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return $Z(e)}get material(){let e=this._derivedMaterial;const n=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=PU.clone());if((!e||!e.isDerivedFrom(n))&&(e=this._derivedMaterial=this.createDerivedMaterial(n),n.addEventListener("dispose",function i(){n.removeEventListener("dispose",i),e.dispose()})),this.hasOutline()){let i=e._outlineMtl;return i||(i=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),i.isTextOutlineMaterial=!0,i.depthWrite=!1,i.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),i.dispose()})),[i,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return Z5(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return Z5(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const n=e.isTextOutlineMaterial,i=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:o,blockBounds:l}=r;i.uTroikaSDFTexture.value=o,i.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),i.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,i.uTroikaSDFExponent.value=r.sdfExponent,i.uTroikaTotalBounds.value.fromArray(l),i.uTroikaUseGlyphColors.value=!n&&!!r.glyphColors;let c=0,u=0,f=0,h,d,g,b=0,y=0;if(n){let{outlineWidth:x,outlineOffsetX:_,outlineOffsetY:w,outlineBlur:M,outlineOpacity:S}=this;c=this._parsePercent(x)||0,u=Math.max(0,this._parsePercent(M)||0),h=S,b=this._parsePercent(_)||0,y=this._parsePercent(w)||0}else f=Math.max(0,this._parsePercent(this.strokeWidth)||0),f&&(g=this.strokeColor,i.uTroikaStrokeColor.value.set(g??J5),d=this.strokeOpacity,d==null&&(d=1)),h=this.fillOpacity;i.uTroikaEdgeOffset.value=c,i.uTroikaPositionOffset.value.set(b,y),i.uTroikaBlurRadius.value=u,i.uTroikaStrokeWidth.value=f,i.uTroikaStrokeOpacity.value=d,i.uTroikaFillOpacity.value=h??1,i.uTroikaCurveRadius.value=this.curveRadius||0;let p=this.clipRect;if(p&&Array.isArray(p)&&p.length===4)i.uTroikaClipRect.value.fromArray(p);else{const x=(this.fontSize||.1)*100;i.uTroikaClipRect.value.set(l[0]-x,l[1]-x,l[2]+x,l[3]+x)}this.geometry.applyClipRect(i.uTroikaClipRect.value)}i.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const a=n?this.outlineColor||0:this.color;if(a==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new Ut;(a!==o._input||typeof a=="object")&&o.set(o._input=a)}let s=this.orientation||hD;if(s!==e._orientation){let o=i.uTroikaOrient.value;s=s.replace(/[^-+xyz]/g,"");let l=s!==hD&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,u,f,h]=l;aE.set(0,0,0)[u]=c==="-"?1:-1,fD.set(0,0,0)[h]=f==="-"?-1:1,$5.lookAt(b2e,aE.cross(fD),fD),o.setFromMatrix4($5)}else o.identity();e._orientation=s}}_parsePercent(e){if(typeof e=="string"){let n=e.match(/^(-?[\d.]+)%$/),i=n?parseFloat(n[1]):NaN;e=(isNaN(i)?0:i/100)*this.fontSize}return e}localPositionToTextCoords(e,n=new wt){n.copy(e);const i=this.curveRadius;return i&&(n.x=Math.atan2(e.x,Math.abs(i)-Math.abs(e.z))*Math.abs(i)),n}worldPositionToTextCoords(e,n=new wt){return aE.copy(e),this.localPositionToTextCoords(this.worldToLocal(aE),n)}raycast(e,n){const{textRenderInfo:i,curveRadius:r}=this;if(i){const a=i.blockBounds,s=r?QZ():ZZ(),o=s.geometry,{position:l,uv:c}=o.attributes;for(let u=0;u<c.count;u++){let f=a[0]+c.getX(u)*(a[2]-a[0]);const h=a[1]+c.getY(u)*(a[3]-a[1]);let d=0;r&&(d=r-Math.cos(f/r)*r,f=Math.sin(f/r)*r),l.setXYZ(u,f,h,d)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,s.matrixWorld=this.matrixWorld,s.material.side=this.material.side,Qy.length=0,s.raycast(e,Qy);for(let u=0;u<Qy.length;u++)Qy[u].object=this,n.push(Qy[u])}}copy(e){const n=this.geometry;return super.copy(e),this.geometry=n,x2e.forEach(i=>{this[i]=e[i]}),this}clone(){return new this.constructor().copy(this)}}eQ.forEach(t=>{const e="_private_"+t;Object.defineProperty(d1.prototype,t,{get(){return this[e]},set(n){n!==this[e]&&(this[e]=n,this._needsSync=!0)}})});const _2e={type:"syncstart"},S2e={type:"synccomplete"},s0="aTroikaTextBatchMemberIndex",wI=32,Q5=new rr,e6=new Ut;class UU extends d1{constructor(){super(),this._members=new Map,this._dataTextures={},this._onMemberSynced=e=>{this._members.get(e.target).dirty=!0}}add(...e){for(let n=0;n<e.length;n++)e[n]instanceof d1?this.addText(e[n]):super.add(e[n]);return this}remove(...e){for(let n=0;n<e.length;n++)e[n]instanceof d1?this.removeText(e[n]):super.remove(e[n]);return this}addText(e){this._members.has(e)||(this._members.set(e,{index:-1,glyphCount:-1,dirty:!0}),e.addEventListener("synccomplete",this._onMemberSynced))}removeText(e){this._needsRepack=!0,e.removeEventListener("synccomplete",this._onMemberSynced),this._members.delete(e)}createDerivedMaterial(e){return w2e(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateBounds()}updateBounds(){const e=this.geometry.boundingBox.makeEmpty();this._members.forEach((n,i)=>{i.matrixAutoUpdate&&i.updateMatrix(),Q5.copy(i.geometry.boundingBox).applyMatrix4(i.matrix),e.union(Q5)}),e.getBoundingSphere(this.geometry.boundingSphere)}hasOutline(){for(let e of this._members.keys())if(e.hasOutline())return!0;return!1}_prepareForRender(e){const n=e.isTextOutlineMaterial;e.uniforms.uTroikaIsOutline.value=n;let i=this._dataTextures[n?"outline":"main"];const r=Math.pow(2,Math.ceil(Math.log2(this._members.size*wI)));if(!i||r!==i.image.data.length){i&&i.dispose();const o=Math.min(r/4,1024);i=this._dataTextures[n?"outline":"main"]=new cs(new Float32Array(r),o,r/4/o,Qr,wr)}const a=i.image.data,s=(o,l)=>{l!==a[o]&&(a[o]=l,i.needsUpdate=!0)};this._members.forEach(({index:o,dirty:l},c)=>{if(o>-1){const u=o*wI,f=c.matrix.elements;for(let A=0;A<16;A++)s(u+A,f[A]);c._prepareForRender(e);const{uTroikaTotalBounds:h,uTroikaClipRect:d,uTroikaPositionOffset:g,uTroikaEdgeOffset:b,uTroikaBlurRadius:y,uTroikaStrokeWidth:p,uTroikaStrokeColor:x,uTroikaStrokeOpacity:_,uTroikaFillOpacity:w,uTroikaCurveRadius:M}=e.uniforms;for(let A=0;A<4;A++)s(u+16+A,h.value.getComponent(A));for(let A=0;A<4;A++)s(u+20+A,d.value.getComponent(A));let S=n?c.outlineColor||0:c.color;S==null&&(S=this.color),S==null&&(S=this.material.color),S==null&&(S=16777215),s(u+24,e6.set(S).getHex()),s(u+25,w.value),s(u+26,M.value),n?(s(u+28,g.value.x),s(u+29,g.value.y),s(u+30,b.value),s(u+31,y.value)):(s(u+28,p.value),s(u+29,e6.set(x.value).getHex()),s(u+30,_.value))}}),e.setMatrixTexture(i),super._prepareForRender(e)}sync(e){let n=this._needsRepack?[]:null;this._needsRepack=!1,this._members.forEach((i,r)=>{(i.dirty||r._needsSync)&&(i.dirty=!1,(n||(n=[])).push(new Promise(a=>{r._needsSync?r.sync(a):a()})))}),n&&(this.dispatchEvent(_2e),Promise.all(n).then(()=>{const{geometry:i}=this,r=i.attributes;let a=r[s0]&&r[s0].array||new Uint16Array(0),s=r[h1]&&r[h1].array||new Float32Array(0),o=r[yM]&&r[yM].array||new Float32Array(0),l=0;this._members.forEach((f,{textRenderInfo:h})=>{h&&(l+=h.glyphAtlasIndices.length,this._textRenderInfo=h)}),l!==a.length&&(a=dD(a,l),s=dD(s,l),o=dD(o,l*4));let c=0,u=0;this._members.forEach((f,{textRenderInfo:h})=>{if(h){const d=h.glyphAtlasIndices.length;a.fill(c,u,u+d),s.set(h.glyphAtlasIndices,u,u+d),o.set(h.glyphBounds,u*4,(u+d)*4),u+=d,f.index=c++}}),i.updateAttributeData(s0,a,1),i.getAttribute(s0).setUsage(X1),i.updateAttributeData(h1,s,1),i.updateAttributeData(yM,o,4),this.updateBounds(),this.dispatchEvent(S2e),e&&e()}))}copy(e){return e instanceof UU&&(super.copy(e),this._members.forEach((n,i)=>this.removeText(i)),e._members.forEach((n,i)=>this.addText(i))),this}dispose(){super.dispose(),Object.values(this._dataTextures).forEach(e=>e.dispose())}}function dD(t,e){const n=new t.constructor(e);return n.set(t.subarray(0,e)),n}function w2e(t){const e="uTroikaMatricesTexture",n="uTroikaMatricesTextureSize";let i=Q1(t,{chained:!0,uniforms:{[n]:{value:new wt},[e]:{value:null}},vertexDefs:`
      uniform highp sampler2D ${e};
      uniform vec2 ${n};
      attribute float ${s0};

      vec4 troikaBatchTexel(float offset) {
        offset += ${s0} * ${wI.toFixed(1)} / 4.0;
        float w = ${n}.x;
        vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ${n};
        return texture2D(${e}, uv);
      }
    `,vertexTransform:`
      mat4 matrix = mat4(
        troikaBatchTexel(0.0),
        troikaBatchTexel(1.0),
        troikaBatchTexel(2.0),
        troikaBatchTexel(3.0)
      );
      position.xyz = (matrix * vec4(position, 1.0)).xyz;
    `});return i=$Z(i),i=Q1(i,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(r){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(s=>{r=E2e(r,s)}),r},vertexDefs:`
      uniform bool uTroikaIsOutline;
      vec3 troikaFloatToColor(float v) {
        return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;
      }
    `,vertexTransform:`
      uTroikaTotalBounds = troikaBatchTexel(4.0);
      uTroikaClipRect = troikaBatchTexel(5.0);
      
      vec4 data = troikaBatchTexel(6.0);
      diffuse = troikaFloatToColor(data.x);
      uTroikaFillOpacity = data.y;
      uTroikaCurveRadius = data.z;
      
      data = troikaBatchTexel(7.0);
      if (uTroikaIsOutline) {
        if (data == vec4(0.0)) { // degenerate if zero outline
          position = vec3(0.0);
        } else {
          uTroikaPositionOffset = data.xy;
          uTroikaEdgeOffset = data.z;
          uTroikaBlurRadius = data.w;
        }
      } else {
        uTroikaStrokeWidth = data.x;
        uTroikaStrokeColor = troikaFloatToColor(data.y);
        uTroikaStrokeOpacity = data.z;
      }
    `}),i.setMatrixTexture=r=>{i.uniforms[e].value=r,i.uniforms[n].value.set(r.image.width,r.image.height)},i}function E2e({vertexShader:t,fragmentShader:e},n,i=n){const r=new RegExp(`uniform\\s+(bool|float|vec[234]|mat[34])\\s+${n}\\b`);let a,s=!1;e=e.replace(r,(l,c)=>(s=!0,`varying ${a=c} ${i}`));let o=!1;return t=t.replace(r,(l,c)=>(o=!0,`${s?"varying":""} ${a=c} ${i}`)),o||(t=`${s?"varying":""} ${a} ${i};
${t}`),{vertexShader:t,fragmentShader:e}}function MC(t,e,n,i){var r;return r=class extends fs{constructor(a){super({vertexShader:e,fragmentShader:n,...a});for(const s in t)this.uniforms[s]=new vC(t[s]),Object.defineProperty(this,s,{get(){return this.uniforms[s].value},set(o){this.uniforms[s].value=o}});this.uniforms=cv.clone(this.uniforms)}},r.key=yc.generateUUID(),r}const M2e=()=>parseInt(Hv.replace(/\D+/g,"")),tQ=M2e();/*!
 * camera-controls
 * https://github.com/yomotsu/camera-controls
 * (c) 2017 @yomotsu
 * Released under the MIT License.
 */const aa={LEFT:1,RIGHT:2,MIDDLE:4},ut=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),Sb={NONE:0,IN:1,OUT:-1};function Hp(t){return t.isPerspectiveCamera}function sd(t){return t.isOrthographicCamera}const td=Math.PI*2,t6=Math.PI/2,nQ=1e-5,ex=Math.PI/180;function Jc(t,e,n){return Math.max(e,Math.min(n,t))}function Ir(t,e=nQ){return Math.abs(t)<e}function or(t,e,n=nQ){return Ir(t-e,n)}function n6(t,e){return Math.round(t/e)*e}function tx(t){return isFinite(t)?t:t<0?-Number.MAX_VALUE:Number.MAX_VALUE}function nx(t){return Math.abs(t)<Number.MAX_VALUE?t:t*(1/0)}function sE(t,e,n,i,r=1/0,a){i=Math.max(1e-4,i);const s=2/i,o=s*a,l=1/(1+o+.48*o*o+.235*o*o*o);let c=t-e;const u=e,f=r*i;c=Jc(c,-f,f),e=t-c;const h=(n.value+s*c)*a;n.value=(n.value-s*h)*l;let d=e+(c+h)*l;return u-t>0==d>u&&(d=u,n.value=(d-u)/a),d}function i6(t,e,n,i,r=1/0,a,s){i=Math.max(1e-4,i);const o=2/i,l=o*a,c=1/(1+l+.48*l*l+.235*l*l*l);let u=e.x,f=e.y,h=e.z,d=t.x-u,g=t.y-f,b=t.z-h;const y=u,p=f,x=h,_=r*i,w=_*_,M=d*d+g*g+b*b;if(M>w){const X=Math.sqrt(M);d=d/X*_,g=g/X*_,b=b/X*_}u=t.x-d,f=t.y-g,h=t.z-b;const S=(n.x+o*d)*a,A=(n.y+o*g)*a,C=(n.z+o*b)*a;n.x=(n.x-o*S)*c,n.y=(n.y-o*A)*c,n.z=(n.z-o*C)*c,s.x=u+(d+S)*c,s.y=f+(g+A)*c,s.z=h+(b+C)*c;const k=y-t.x,R=p-t.y,N=x-t.z,P=s.x-y,j=s.y-p,z=s.z-x;return k*P+R*j+N*z>0&&(s.x=y,s.y=p,s.z=x,n.x=(s.x-y)/a,n.y=(s.y-p)/a,n.z=(s.z-x)/a),s}function pD(t,e){e.set(0,0),t.forEach(n=>{e.x+=n.clientX,e.y+=n.clientY}),e.x/=t.length,e.y/=t.length}function mD(t,e){return sd(t)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let T2e=class{constructor(){this._listeners={}}addEventListener(e,n){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners[e];if(r!==void 0){const a=r.indexOf(n);a!==-1&&r.splice(a,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,s=r.length;a<s;a++)r[a].call(this,e)}}};var gD;const A2e="3.1.0",oE=1/8,C2e=/Mac/.test((gD=globalThis?.navigator)===null||gD===void 0?void 0:gD.platform);let jn,r6,lE,bD,Io,oi,Ki,wb,ix,Bu,zu,Vp,a6,s6,hl,Eb,Mb,o6,vD,l6,yD,xD,cE,R2e=class EI extends T2e{static install(e){jn=e.THREE,r6=Object.freeze(new jn.Vector3(0,0,0)),lE=Object.freeze(new jn.Vector3(0,1,0)),bD=Object.freeze(new jn.Vector3(0,0,1)),Io=new jn.Vector2,oi=new jn.Vector3,Ki=new jn.Vector3,wb=new jn.Vector3,ix=new jn.Vector3,Bu=new jn.Vector3,zu=new jn.Vector3,Vp=new jn.Vector3,a6=new jn.Vector3,s6=new jn.Vector3,hl=new jn.Spherical,Eb=new jn.Spherical,Mb=new jn.Box3,o6=new jn.Box3,vD=new jn.Sphere,l6=new jn.Quaternion,yD=new jn.Quaternion,xD=new jn.Matrix4,cE=new jn.Raycaster}static get ACTION(){return ut}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,n){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=ut.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Sb.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new jn.Vector3,this._focalOffsetVelocity=new jn.Vector3,this._zoomVelocity={value:0},this._truckInternal=(p,x,_,w)=>{let M,S;if(Hp(this._camera)){const A=oi.copy(this._camera.position).sub(this._target),C=this._camera.getEffectiveFOV()*ex,k=A.length()*Math.tan(C*.5);M=this.truckSpeed*p*k/this._elementRect.height,S=this.truckSpeed*x*k/this._elementRect.height}else if(sd(this._camera)){const A=this._camera;M=this.truckSpeed*p*(A.right-A.left)/A.zoom/this._elementRect.width,S=this.truckSpeed*x*(A.top-A.bottom)/A.zoom/this._elementRect.height}else return;w?(_?this.setFocalOffset(this._focalOffsetEnd.x+M,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(M,0,!0),this.forward(-S,!0)):_?this.setFocalOffset(this._focalOffsetEnd.x+M,this._focalOffsetEnd.y+S,this._focalOffsetEnd.z,!0):this.truck(M,S,!0)},this._rotateInternal=(p,x)=>{const _=td*this.azimuthRotateSpeed*p/this._elementRect.height,w=td*this.polarRotateSpeed*x/this._elementRect.height;this.rotate(_,w,!0)},this._dollyInternal=(p,x,_)=>{const w=Math.pow(.95,-p*this.dollySpeed),M=this._sphericalEnd.radius,S=this._sphericalEnd.radius*w,A=Jc(S,this.minDistance,this.maxDistance),C=A-S;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(S,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(C,!0),this._dollyToNoClamp(A,!0)):this._dollyToNoClamp(A,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?S:A)-M,this._dollyControlCoord.set(x,_)),this._lastDollyDirection=Math.sign(-p)},this._zoomInternal=(p,x,_)=>{const w=Math.pow(.95,p*this.dollySpeed),M=this._zoom,S=this._zoom*w;this.zoomTo(S,!0),this.dollyToCursor&&(this._changedZoom+=S-M,this._dollyControlCoord.set(x,_))},typeof jn>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new jn.Quaternion().setFromUnitVectors(this._camera.up,lE),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=ut.NONE,this._target=new jn.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new jn.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new jn.Spherical().setFromVector3(oi.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new jn.Vector3,new jn.Vector3,new jn.Vector3,new jn.Vector3],this._updateNearPlaneCorners(),this._boundary=new jn.Box3(new jn.Vector3(-1/0,-1/0,-1/0),new jn.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new jn.Vector2,this.mouseButtons={left:ut.ROTATE,middle:ut.DOLLY,right:ut.TRUCK,wheel:Hp(this._camera)?ut.DOLLY:sd(this._camera)?ut.ZOOM:ut.NONE},this.touches={one:ut.TOUCH_ROTATE,two:Hp(this._camera)?ut.TOUCH_DOLLY_TRUCK:sd(this._camera)?ut.TOUCH_ZOOM_TRUCK:ut.NONE,three:ut.TOUCH_TRUCK};const i=new jn.Vector2,r=new jn.Vector2,a=new jn.Vector2,s=p=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),M=p.clientX/w.width,S=p.clientY/w.height;if(M<this._interactiveArea.left||M>this._interactiveArea.right||S<this._interactiveArea.top||S>this._interactiveArea.bottom)return}const x=p.pointerType!=="mouse"?null:(p.buttons&aa.LEFT)===aa.LEFT?aa.LEFT:(p.buttons&aa.MIDDLE)===aa.MIDDLE?aa.MIDDLE:(p.buttons&aa.RIGHT)===aa.RIGHT?aa.RIGHT:null;if(x!==null){const w=this._findPointerByMouseButton(x);w&&this._disposePointer(w)}if((p.buttons&aa.LEFT)===aa.LEFT&&this._lockedPointer)return;const _={pointerId:p.pointerId,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:x};this._activePointers.push(_),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,h(p)},o=p=>{p.cancelable&&p.preventDefault();const x=p.pointerId,_=this._lockedPointer||this._findPointerById(x);if(_){if(_.clientX=p.clientX,_.clientY=p.clientY,_.deltaX=p.movementX,_.deltaY=p.movementY,this._state=0,p.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(p.buttons&aa.LEFT)===aa.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(p.buttons&aa.MIDDLE)===aa.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(p.buttons&aa.RIGHT)===aa.RIGHT&&(this._state=this._state|this.mouseButtons.right);d()}},l=p=>{const x=this._findPointerById(p.pointerId);if(!(x&&x===this._lockedPointer)){if(x&&this._disposePointer(x),p.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=ut.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=ut.NONE;g()}};let c=-1;const u=p=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===ut.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const S=this._domElement.getBoundingClientRect(),A=p.clientX/S.width,C=p.clientY/S.height;if(A<this._interactiveArea.left||A>this._interactiveArea.right||C<this._interactiveArea.top||C>this._interactiveArea.bottom)return}if(p.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ut.ROTATE||this.mouseButtons.wheel===ut.TRUCK){const S=performance.now();c-S<1e3&&this._getClientRect(this._elementRect),c=S}const x=C2e?-1:-3,_=p.deltaMode===1||p.ctrlKey?p.deltaY/x:p.deltaY/(x*10),w=this.dollyToCursor?(p.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,M=this.dollyToCursor?(p.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case ut.ROTATE:{this._rotateInternal(p.deltaX,p.deltaY),this._isUserControllingRotate=!0;break}case ut.TRUCK:{this._truckInternal(p.deltaX,p.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case ut.SCREEN_PAN:{this._truckInternal(p.deltaX,p.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case ut.OFFSET:{this._truckInternal(p.deltaX,p.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case ut.DOLLY:{this._dollyInternal(-_,w,M),this._isUserControllingDolly=!0;break}case ut.ZOOM:{this._zoomInternal(-_,w,M),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},f=p=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===EI.ACTION.NONE){const x=p instanceof PointerEvent?p.pointerId:0,_=this._findPointerById(x);_&&this._disposePointer(_),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}p.preventDefault()}},h=p=>{if(!this._enabled)return;if(pD(this._activePointers,Io),this._getClientRect(this._elementRect),i.copy(Io),r.copy(Io),this._activePointers.length>=2){const _=Io.x-this._activePointers[1].clientX,w=Io.y-this._activePointers[1].clientY,M=Math.sqrt(_*_+w*w);a.set(0,M);const S=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,A=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(S,A)}if(this._state=0,!p)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in p&&p.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(p.buttons&aa.LEFT)===aa.LEFT&&(this._state=this._state|this.mouseButtons.left),(p.buttons&aa.MIDDLE)===aa.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&aa.RIGHT)===aa.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&ut.ROTATE)===ut.ROTATE||(this._state&ut.TOUCH_ROTATE)===ut.TOUCH_ROTATE||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&ut.TRUCK)===ut.TRUCK||(this._state&ut.SCREEN_PAN)===ut.SCREEN_PAN||(this._state&ut.TOUCH_TRUCK)===ut.TOUCH_TRUCK||(this._state&ut.TOUCH_SCREEN_PAN)===ut.TOUCH_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&ut.DOLLY)===ut.DOLLY||(this._state&ut.TOUCH_DOLLY)===ut.TOUCH_DOLLY||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&ut.ZOOM)===ut.ZOOM||(this._state&ut.TOUCH_ZOOM)===ut.TOUCH_ZOOM||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_ZOOM_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&ut.OFFSET)===ut.OFFSET||(this._state&ut.TOUCH_OFFSET)===ut.TOUCH_OFFSET||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},d=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,pD(this._activePointers,Io);const x=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,_=x?-x.deltaX:r.x-Io.x,w=x?-x.deltaY:r.y-Io.y;if(r.copy(Io),((this._state&ut.ROTATE)===ut.ROTATE||(this._state&ut.TOUCH_ROTATE)===ut.TOUCH_ROTATE||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(_,w),this._isUserControllingRotate=!0),(this._state&ut.DOLLY)===ut.DOLLY||(this._state&ut.ZOOM)===ut.ZOOM){const M=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,A=this.dollyDragInverted?-1:1;(this._state&ut.DOLLY)===ut.DOLLY?(this._dollyInternal(A*w*oE,M,S),this._isUserControllingDolly=!0):(this._zoomInternal(A*w*oE,M,S),this._isUserControllingZoom=!0)}if((this._state&ut.TOUCH_DOLLY)===ut.TOUCH_DOLLY||(this._state&ut.TOUCH_ZOOM)===ut.TOUCH_ZOOM||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_ZOOM_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE){const M=Io.x-this._activePointers[1].clientX,S=Io.y-this._activePointers[1].clientY,A=Math.sqrt(M*M+S*S),C=a.y-A;a.set(0,A);const k=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,R=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&ut.TOUCH_DOLLY)===ut.TOUCH_DOLLY||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET?(this._dollyInternal(C*oE,k,R),this._isUserControllingDolly=!0):(this._zoomInternal(C*oE,k,R),this._isUserControllingZoom=!0)}((this._state&ut.TRUCK)===ut.TRUCK||(this._state&ut.TOUCH_TRUCK)===ut.TOUCH_TRUCK||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(_,w,!1,!1),this._isUserControllingTruck=!0),((this._state&ut.SCREEN_PAN)===ut.SCREEN_PAN||(this._state&ut.TOUCH_SCREEN_PAN)===ut.TOUCH_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(_,w,!1,!0),this._isUserControllingTruck=!0),((this._state&ut.OFFSET)===ut.OFFSET||(this._state&ut.TOUCH_OFFSET)===ut.TOUCH_OFFSET||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(_,w,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{pD(this._activePointers,Io),r.copy(Io),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",b),this._domElement.ownerDocument.addEventListener("pointerlockerror",y),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),h())},this.unlockPointer=()=>{var p,x,_;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(p=this._domElement)===null||p===void 0||p.ownerDocument.exitPointerLock(),(x=this._domElement)===null||x===void 0||x.ownerDocument.removeEventListener("pointerlockchange",b),(_=this._domElement)===null||_===void 0||_.ownerDocument.removeEventListener("pointerlockerror",y),this.cancel()};const b=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},y=()=>{this.unlockPointer()};this._addAllEventListeners=p=>{this._domElement=p,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",s),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",f)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",s),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",f),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",b),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))},this.cancel=()=>{this._state!==ut.NONE&&(this._state=ut.NONE,this._activePointers.length=0,g())},n&&this.connect(n),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Jc(e.width,0,1),this._interactiveArea.height=Jc(e.height,0,1),this._interactiveArea.x=Jc(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Jc(e.y,0,1-this._interactiveArea.height)}addEventListener(e,n){super.addEventListener(e,n)}removeEventListener(e,n){super.removeEventListener(e,n)}rotate(e,n,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+n,i)}rotateAzimuthTo(e,n=!1){return this.rotateTo(e,this._sphericalEnd.phi,n)}rotatePolarTo(e,n=!1){return this.rotateTo(this._sphericalEnd.theta,e,n)}rotateTo(e,n,i=!1){this._isUserControllingRotate=!1;const r=Jc(e,this.minAzimuthAngle,this.maxAzimuthAngle),a=Jc(n,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=a,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const s=!i||or(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&or(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(s)}dolly(e,n=!1){return this.dollyTo(this._sphericalEnd.radius-e,n)}dollyTo(e,n=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Sb.NONE,this._changedDolly=0,this._dollyToNoClamp(Jc(e,this.minDistance,this.maxDistance),n)}_dollyToNoClamp(e,n=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const s=this._collisionTest(),o=or(s,this._spherical.radius);if(!(i>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,s)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,n||(this._spherical.radius=this._sphericalEnd.radius);const a=!n||or(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(a)}dollyInFixed(e,n=!1){this._targetEnd.add(this._getCameraDirection(ix).multiplyScalar(e)),n||this._target.copy(this._targetEnd);const i=!n||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,n=!1){return this.zoomTo(this._zoomEnd+e,n)}zoomTo(e,n=!1){this._isUserControllingZoom=!1,this._zoomEnd=Jc(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,n||(this._zoom=this._zoomEnd);const i=!n||or(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,n,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,n,i)}truck(e,n,i=!1){this._camera.updateMatrix(),Bu.setFromMatrixColumn(this._camera.matrix,0),zu.setFromMatrixColumn(this._camera.matrix,1),Bu.multiplyScalar(e),zu.multiplyScalar(-n);const r=oi.copy(Bu).add(zu),a=Ki.copy(this._targetEnd).add(r);return this.moveTo(a.x,a.y,a.z,i)}forward(e,n=!1){oi.setFromMatrixColumn(this._camera.matrix,0),oi.crossVectors(this._camera.up,oi),oi.multiplyScalar(e);const i=Ki.copy(this._targetEnd).add(oi);return this.moveTo(i.x,i.y,i.z,n)}elevate(e,n=!1){return oi.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+oi.x,this._targetEnd.y+oi.y,this._targetEnd.z+oi.z,n)}moveTo(e,n,i,r=!1){this._isUserControllingTruck=!1;const a=oi.set(e,n,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,a,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const s=!r||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}lookInDirectionOf(e,n,i,r=!1){const o=oi.set(e,n,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(o.x,o.y,o.z,r)}fitToBox(e,n,{cover:i=!1,paddingLeft:r=0,paddingRight:a=0,paddingBottom:s=0,paddingTop:o=0}={}){const l=[],c=e.isBox3?Mb.copy(e):Mb.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=n6(this._sphericalEnd.theta,t6),f=n6(this._sphericalEnd.phi,t6);l.push(this.rotateTo(u,f,n));const h=oi.setFromSpherical(this._sphericalEnd).normalize(),d=l6.setFromUnitVectors(h,bD),g=or(Math.abs(h.y),1);g&&d.multiply(yD.setFromAxisAngle(lE,u)),d.multiply(this._yAxisUpSpaceInverse);const b=o6.makeEmpty();Ki.copy(c.min).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.min).setX(c.max.x).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.min).setY(c.max.y).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).setZ(c.min.z).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.min).setZ(c.max.z).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).setY(c.min.y).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).setX(c.min.x).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).applyQuaternion(d),b.expandByPoint(Ki),b.min.x-=r,b.min.y-=s,b.max.x+=a,b.max.y+=o,d.setFromUnitVectors(bD,h),g&&d.premultiply(yD.invert()),d.premultiply(this._yAxisUpSpace);const y=b.getSize(oi),p=b.getCenter(Ki).applyQuaternion(d);if(Hp(this._camera)){const x=this.getDistanceToFitBox(y.x,y.y,y.z,i);l.push(this.moveTo(p.x,p.y,p.z,n)),l.push(this.dollyTo(x,n)),l.push(this.setFocalOffset(0,0,0,n))}else if(sd(this._camera)){const x=this._camera,_=x.right-x.left,w=x.top-x.bottom,M=i?Math.max(_/y.x,w/y.y):Math.min(_/y.x,w/y.y);l.push(this.moveTo(p.x,p.y,p.z,n)),l.push(this.zoomTo(M,n)),l.push(this.setFocalOffset(0,0,0,n))}return Promise.all(l)}fitToSphere(e,n){const i=[],a="isObject3D"in e?EI.createBoundingSphere(e,vD):vD.copy(e);if(i.push(this.moveTo(a.center.x,a.center.y,a.center.z,n)),Hp(this._camera)){const s=this.getDistanceToFitSphere(a.radius);i.push(this.dollyTo(s,n))}else if(sd(this._camera)){const s=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,l=2*a.radius,c=Math.min(s/l,o/l);i.push(this.zoomTo(c,n))}return i.push(this.setFocalOffset(0,0,0,n)),Promise.all(i)}setLookAt(e,n,i,r,a,s,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Sb.NONE,this._changedDolly=0;const l=Ki.set(r,a,s),c=oi.set(e,n,i);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!o||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold)&&or(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&or(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&or(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerp(e,n,i,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Sb.NONE,this._changedDolly=0;const a=oi.set(...e.target);if("spherical"in e)hl.set(...e.spherical);else{const f=Ki.set(...e.position);hl.setFromVector3(f.sub(a).applyQuaternion(this._yAxisUpSpace))}const s=wb.set(...n.target);if("spherical"in n)Eb.set(...n.spherical);else{const f=Ki.set(...n.position);Eb.setFromVector3(f.sub(s).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(a.lerp(s,i));const o=Eb.theta-hl.theta,l=Eb.phi-hl.phi,c=Eb.radius-hl.radius;this._sphericalEnd.set(hl.radius+c*i,hl.phi+l*i,hl.theta+o*i),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!r||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold)&&or(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&or(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&or(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,n,i,r,a,s,o,l,c,u,f,h,d,g=!1){return this.lerp({position:[e,n,i],target:[r,a,s]},{position:[o,l,c],target:[u,f,h]},d,g)}setPosition(e,n,i,r=!1){return this.setLookAt(e,n,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,n,i,r=!1){const a=this.getPosition(oi),s=this.setLookAt(a.x,a.y,a.z,e,n,i,r);return this._sphericalEnd.phi=Jc(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),s}setFocalOffset(e,n,i,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,n,i),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const a=!r||or(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&or(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&or(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}setOrbitPoint(e,n,i){this._camera.updateMatrixWorld(),Bu.setFromMatrixColumn(this._camera.matrixWorldInverse,0),zu.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Vp.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=oi.set(e,n,i),a=r.distanceTo(this._camera.position),s=r.sub(this._camera.position);Bu.multiplyScalar(s.x),zu.multiplyScalar(s.y),Vp.multiplyScalar(s.z),oi.copy(Bu).add(zu).add(Vp),oi.z=oi.z+a,this.dollyTo(a,!1),this.setFocalOffset(-oi.x,oi.y,-oi.z,!1),this.moveTo(e,n,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,n,i,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new jn.Vector4,typeof e=="number"?this._viewport.set(e,n,i,r):this._viewport.copy(e)}getDistanceToFitBox(e,n,i,r=!1){if(mD(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const a=e/n,s=this._camera.getEffectiveFOV()*ex,o=this._camera.aspect;return((r?a>o:a<o)?n:e/o)*.5/Math.tan(s*.5)+i*.5}getDistanceToFitSphere(e){if(mD(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const n=this._camera.getEffectiveFOV()*ex,i=Math.atan(Math.tan(n*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?n:i;return e/Math.sin(r*.5)}getTarget(e,n=!0){return(e&&e.isVector3?e:new jn.Vector3).copy(n?this._targetEnd:this._target)}getPosition(e,n=!0){return(e&&e.isVector3?e:new jn.Vector3).setFromSpherical(n?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(n?this._targetEnd:this._target)}getSpherical(e,n=!0){return(e||new jn.Spherical).copy(n?this._sphericalEnd:this._spherical)}getFocalOffset(e,n=!0){return(e&&e.isVector3?e:new jn.Vector3).copy(n?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%td+td)%td,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=td),this._spherical.theta+=td*Math.round((this._sphericalEnd.theta-this._spherical.theta)/td),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!or(this._camera.up.x,this._cameraUp0.x)||!or(this._camera.up.y,this._cameraUp0.y)||!or(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(oi);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const n=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(n)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,lE),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=oi.subVectors(this._target,this._camera.position).normalize(),n=Ki.crossVectors(e,this._camera.up);this._camera.up.crossVectors(n,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(oi);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const n=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,a=a6.subVectors(this._targetEnd,this._target),s=s6.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(Ir(n))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=sE(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,f,1/0,e),this._needsUpdate=!0}if(Ir(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=sE(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,f,1/0,e),this._needsUpdate=!0}if(Ir(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const f=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=sE(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,f,this.maxSpeed,e),this._needsUpdate=!0}if(Ir(a.x)&&Ir(a.y)&&Ir(a.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const f=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;i6(this._target,this._targetEnd,this._targetVelocity,f,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(Ir(s.x)&&Ir(s.y)&&Ir(s.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const f=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;i6(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,f,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(Ir(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const f=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=sE(this._zoom,this._zoomEnd,this._zoomVelocity,f,1/0,e)}if(this.dollyToCursor){if(Hp(this._camera)&&this._changedDolly!==0){const f=this._spherical.radius-this._lastDistance,h=this._camera,d=this._getCameraDirection(ix),g=oi.copy(d).cross(h.up).normalize();g.lengthSq()===0&&(g.x=1);const b=Ki.crossVectors(g,d),y=this._sphericalEnd.radius*Math.tan(h.getEffectiveFOV()*ex*.5),x=(this._sphericalEnd.radius-f-this._sphericalEnd.radius)/this._sphericalEnd.radius,_=wb.copy(this._targetEnd).add(g.multiplyScalar(this._dollyControlCoord.x*y*h.aspect)).add(b.multiplyScalar(this._dollyControlCoord.y*y)),w=oi.copy(this._targetEnd).lerp(_,x),M=this._lastDollyDirection===Sb.IN&&this._spherical.radius<=this.minDistance,S=this._lastDollyDirection===Sb.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(M||S)){this._sphericalEnd.radius-=f,this._spherical.radius-=f;const C=Ki.copy(d).multiplyScalar(-f);w.add(C)}this._boundary.clampPoint(w,w);const A=Ki.subVectors(w,this._targetEnd);this._targetEnd.copy(w),this._target.add(A),this._changedDolly-=f,Ir(this._changedDolly)&&(this._changedDolly=0)}else if(sd(this._camera)&&this._changedZoom!==0){const f=this._zoom-this._lastZoom,h=this._camera,d=oi.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(h.near+h.far)/(h.near-h.far)).unproject(h),g=Ki.set(0,0,-1).applyQuaternion(h.quaternion),b=wb.copy(d).add(g.multiplyScalar(-d.dot(h.up))),p=-(this._zoom-f-this._zoom)/this._zoom,x=this._getCameraDirection(ix),_=this._targetEnd.dot(x),w=oi.copy(this._targetEnd).lerp(b,p),M=w.dot(x),S=x.multiplyScalar(M-_);w.sub(S),this._boundary.clampPoint(w,w);const A=Ki.subVectors(w,this._targetEnd);this._targetEnd.copy(w),this._target.add(A),this._changedZoom-=f,Ir(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!Ir(this._focalOffset.x)||!Ir(this._focalOffset.y)||!Ir(this._focalOffset.z))&&(Bu.setFromMatrixColumn(this._camera.matrix,0),zu.setFromMatrixColumn(this._camera.matrix,1),Vp.setFromMatrixColumn(this._camera.matrix,2),Bu.multiplyScalar(this._focalOffset.x),zu.multiplyScalar(-this._focalOffset.y),Vp.multiplyScalar(this._focalOffset.z),oi.copy(Bu).add(zu).add(Vp),this._camera.position.add(oi),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),oi.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const u=this._needsUpdate;return u&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):u?(this.dispatchEvent({type:"update"}),Ir(n,this.restThreshold)&&Ir(i,this.restThreshold)&&Ir(r,this.restThreshold)&&Ir(a.x,this.restThreshold)&&Ir(a.y,this.restThreshold)&&Ir(a.z,this.restThreshold)&&Ir(s.x,this.restThreshold)&&Ir(s.y,this.restThreshold)&&Ir(s.z,this.restThreshold)&&Ir(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!u&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=u,this._needsUpdate=!1,u}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:tx(this.maxDistance),minZoom:this.minZoom,maxZoom:tx(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:tx(this.maxPolarAngle),minAzimuthAngle:tx(this.minAzimuthAngle),maxAzimuthAngle:tx(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:oi.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,n=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=nx(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=nx(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=nx(i.maxPolarAngle),this.minAzimuthAngle=nx(i.minAzimuthAngle),this.maxAzimuthAngle=nx(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],n),hl.setFromVector3(oi.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(hl.theta,hl.phi,n),this.dollyTo(hl.radius,n),this.zoomTo(i.zoom,n),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],n),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",A2e),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(n=>n.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(n=>n.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,n,i){const r=n.lengthSq();if(r===0)return e;const a=Ki.copy(n).add(e),o=this._boundary.clampPoint(a,wb).sub(a),l=o.lengthSq();if(l===0)return e.add(n);if(l===r)return e;if(i===0)return e.add(n).add(o);{const c=1+i*l/n.dot(o);return e.add(Ki.copy(n).multiplyScalar(c)).add(o.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Hp(this._camera)){const e=this._camera,n=e.near,i=e.getEffectiveFOV()*ex,r=Math.tan(i*.5)*n,a=r*e.aspect;this._nearPlaneCorners[0].set(-a,-r,0),this._nearPlaneCorners[1].set(a,-r,0),this._nearPlaneCorners[2].set(a,r,0),this._nearPlaneCorners[3].set(-a,r,0)}else if(sd(this._camera)){const e=this._camera,n=1/e.zoom,i=e.left*n,r=e.right*n,a=e.top*n,s=e.bottom*n;this._nearPlaneCorners[0].set(i,a,0),this._nearPlaneCorners[1].set(r,a,0),this._nearPlaneCorners[2].set(r,s,0),this._nearPlaneCorners[3].set(i,s,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||mD(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(ix);xD.lookAt(r6,i,this._camera.up);for(let r=0;r<4;r++){const a=Ki.copy(this._nearPlaneCorners[r]);a.applyMatrix4(xD);const s=wb.addVectors(this._target,a);cE.set(s,i),cE.far=this._spherical.radius+1;const o=cE.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const n=this._domElement.getBoundingClientRect();return e.x=n.left,e.y=n.top,this._viewport?(e.x+=this._viewport.x,e.y+=n.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=n.width,e.height=n.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(n=>{const i=()=>{this.removeEventListener("rest",i),n()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,n=new jn.Sphere){const i=n,r=i.center;Mb.makeEmpty(),e.traverseVisible(s=>{s.isMesh&&Mb.expandByObject(s)}),Mb.getCenter(r);let a=0;return e.traverseVisible(s=>{if(!s.isMesh)return;const o=s;if(!o.geometry)return;const l=o.geometry.clone();l.applyMatrix4(o.matrixWorld);const u=l.attributes.position;for(let f=0,h=u.count;f<h;f++)oi.fromBufferAttribute(u,f),a=Math.max(a,r.distanceToSquared(oi))}),i.radius=Math.sqrt(a),i}};const c6=I.forwardRef((t,e)=>{const{impl:n,camera:i,domElement:r,makeDefault:a,onControlStart:s,onControl:o,onControlEnd:l,onTransitionStart:c,onUpdate:u,onWake:f,onRest:h,onSleep:d,onStart:g,onEnd:b,onChange:y,regress:p,...x}=t,_=n??R2e;I.useMemo(()=>{const X={Box3:rr,MathUtils:{clamp:yc.clamp},Matrix4:Dt,Quaternion:Xn,Raycaster:W_,Sphere:Ur,Spherical:V$,Vector2:wt,Vector3:te,Vector4:ni};_.install({THREE:X}),q_({CameraControlsImpl:_})},[_]);const w=ki(X=>X.camera),M=ki(X=>X.gl),S=ki(X=>X.invalidate),A=ki(X=>X.events),C=ki(X=>X.setEvents),k=ki(X=>X.set),R=ki(X=>X.get),N=ki(X=>X.performance),P=i||w,j=r||A.connected||M.domElement,z=I.useMemo(()=>new _(P),[_,P]);return la((X,F)=>{z.update(F)},-1),I.useEffect(()=>(z.connect(j),()=>void z.disconnect()),[j,z]),I.useEffect(()=>{function X(){S(),p&&N.regress()}const F=de=>{X(),s?.(de),g?.(de)},H=de=>{X(),o?.(de),y?.(de)},V=de=>{l?.(de),b?.(de)},W=de=>{X(),c?.(de),y?.(de)},B=de=>{X(),u?.(de),y?.(de)},Y=de=>{X(),f?.(de),y?.(de)},Z=de=>{h?.(de)},G=de=>{d?.(de)};return z.addEventListener("controlstart",F),z.addEventListener("control",H),z.addEventListener("controlend",V),z.addEventListener("transitionstart",W),z.addEventListener("update",B),z.addEventListener("wake",Y),z.addEventListener("rest",Z),z.addEventListener("sleep",G),()=>{z.removeEventListener("controlstart",F),z.removeEventListener("control",H),z.removeEventListener("controlend",V),z.removeEventListener("transitionstart",W),z.removeEventListener("update",B),z.removeEventListener("wake",Y),z.removeEventListener("rest",Z),z.removeEventListener("sleep",G)}},[z,S,C,p,N,s,o,l,c,u,f,h,d,y,g,b]),I.useEffect(()=>{if(a){const X=R().controls;return k({controls:z}),()=>k({controls:X})}},[a,z]),I.createElement("primitive",Ls({ref:e,object:z},x))}),k2e=MC({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new Ut,sectionColor:new Ut,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new te,worldPlanePosition:new te},`
    varying vec3 localPosition;
    varying vec4 worldPosition;

    uniform vec3 worldCamProjPosition;
    uniform vec3 worldPlanePosition;
    uniform float fadeDistance;
    uniform bool infiniteGrid;
    uniform bool followCamera;

    void main() {
      localPosition = position.xzy;
      if (infiniteGrid) localPosition *= 1.0 + fadeDistance;
      
      worldPosition = modelMatrix * vec4(localPosition, 1.0);
      if (followCamera) {
        worldPosition.xyz += (worldCamProjPosition - worldPlanePosition);
        localPosition = (inverse(modelMatrix) * worldPosition).xyz;
      }

      gl_Position = projectionMatrix * viewMatrix * worldPosition;
    }
  `,`
    varying vec3 localPosition;
    varying vec4 worldPosition;

    uniform vec3 worldCamProjPosition;
    uniform float cellSize;
    uniform float sectionSize;
    uniform vec3 cellColor;
    uniform vec3 sectionColor;
    uniform float fadeDistance;
    uniform float fadeStrength;
    uniform float fadeFrom;
    uniform float cellThickness;
    uniform float sectionThickness;

    float getGrid(float size, float thickness) {
      vec2 r = localPosition.xz / size;
      vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r);
      float line = min(grid.x, grid.y) + 1.0 - thickness;
      return 1.0 - min(line, 1.0);
    }

    void main() {
      float g1 = getGrid(cellSize, cellThickness);
      float g2 = getGrid(sectionSize, sectionThickness);

      vec3 from = worldCamProjPosition*vec3(fadeFrom);
      float dist = distance(from, worldPosition.xyz);
      float d = 1.0 - min(dist / fadeDistance, 1.0);
      vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2));

      gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength));
      gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2);
      if (gl_FragColor.a <= 0.0) discard;

      #include <tonemapping_fragment>
      #include <${tQ>=154?"colorspace_fragment":"encodings_fragment"}>
    }
  `),iQ=I.forwardRef(({args:t,cellColor:e="#000000",sectionColor:n="#2080ff",cellSize:i=.5,sectionSize:r=1,followCamera:a=!1,infiniteGrid:s=!1,fadeDistance:o=100,fadeStrength:l=1,fadeFrom:c=1,cellThickness:u=.5,sectionThickness:f=1,side:h=Da,...d},g)=>{q_({GridMaterial:k2e});const b=I.useRef(null);I.useImperativeHandle(g,()=>b.current,[]);const y=new nu,p=new te(0,1,0),x=new te(0,0,0);la(M=>{y.setFromNormalAndCoplanarPoint(p,x).applyMatrix4(b.current.matrixWorld);const S=b.current.material,A=S.uniforms.worldCamProjPosition,C=S.uniforms.worldPlanePosition;y.projectPoint(M.camera.position,A.value),C.value.set(0,0,0).applyMatrix4(b.current.matrixWorld)});const _={cellSize:i,sectionSize:r,cellColor:e,sectionColor:n,cellThickness:u,sectionThickness:f},w={fadeDistance:o,fadeStrength:l,fadeFrom:c,infiniteGrid:s,followCamera:a};return I.createElement("mesh",Ls({ref:b,frustumCulled:!1},d),I.createElement("gridMaterial",Ls({transparent:!0,"extensions-derivatives":!0,side:h},_,w)),I.createElement("planeGeometry",{args:t}))}),D2e="modulepreload",O2e=function(t){return"/"+t},u6={},I2e=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");r=Promise.allSettled(n.map(l=>{if(l=O2e(l),l in u6)return;u6[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":D2e,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,d)=>{f.addEventListener("load",h),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return r.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var rQ={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(zm,function(){var n=function(){function i(d){return s.appendChild(d.dom),d}function r(d){for(var g=0;g<s.children.length;g++)s.children[g].style.display=g===d?"block":"none";a=d}var a=0,s=document.createElement("div");s.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",s.addEventListener("click",function(d){d.preventDefault(),r(++a%s.children.length)},!1);var o=(performance||Date).now(),l=o,c=0,u=i(new n.Panel("FPS","#0ff","#002")),f=i(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=i(new n.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:s,addPanel:i,showPanel:r,begin:function(){o=(performance||Date).now()},end:function(){c++;var d=(performance||Date).now();if(f.update(d-o,200),d>l+1e3&&(u.update(1e3*c/(d-l),100),l=d,c=0,h)){var g=performance.memory;h.update(g.usedJSHeapSize/1048576,g.jsHeapSizeLimit/1048576)}return d},update:function(){o=this.end()},domElement:s,setMode:r}};return n.Panel=function(i,r,a){var s=1/0,o=0,l=Math.round,c=l(window.devicePixelRatio||1),u=80*c,f=48*c,h=3*c,d=2*c,g=3*c,b=15*c,y=74*c,p=30*c,x=document.createElement("canvas");x.width=u,x.height=f,x.style.cssText="width:80px;height:48px";var _=x.getContext("2d");return _.font="bold "+9*c+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=a,_.fillRect(0,0,u,f),_.fillStyle=r,_.fillText(i,h,d),_.fillRect(g,b,y,p),_.fillStyle=a,_.globalAlpha=.9,_.fillRect(g,b,y,p),{dom:x,update:function(w,M){s=Math.min(s,w),o=Math.max(o,w),_.fillStyle=a,_.globalAlpha=1,_.fillRect(0,0,u,b),_.fillStyle=r,_.fillText(l(w)+" "+i+" ("+l(s)+"-"+l(o)+")",h,d),_.drawImage(x,g+c,b,y-c,p,g,b,y-c,p),_.fillRect(g+y-c,b,c,p),_.fillStyle=a,_.globalAlpha=.9,_.fillRect(g+y-c,b,c,l((1-w/M)*p))}}},n})})(rQ);var N2e=rQ.exports;const L2e=Rc(N2e);function P2e(t,e=[],n){const[i,r]=I.useState();return I.useLayoutEffect(()=>{const a=t();return r(a),()=>void 0},e),i}function U2e({showPanel:t=0,className:e,parent:n}){const i=P2e(()=>new L2e,[]);return I.useEffect(()=>{if(i){const r=n&&n.current||document.body;i.showPanel(t),r?.appendChild(i.dom);const a=(e??"").split(" ").filter(l=>l);a.length&&i.dom.classList.add(...a);const s=$we(()=>i.begin()),o=Zwe(()=>i.end());return()=>{a.length&&i.dom.classList.remove(...a),r?.removeChild(i.dom),s(),o()}}},[n,i,e,t]),null}const f6=(t,e)=>{t.updateRanges[0]=e};function F2e(t){return typeof t=="function"}const h6=new Dt,d6=new Dt,uE=[],rx=new _i;class B2e extends xl{constructor(){super(),this.color=new Ut("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var e;return(e=this.instance.current)==null?void 0:e.geometry}raycast(e,n){const i=this.instance.current;if(!i||!i.geometry||!i.material)return;rx.geometry=i.geometry;const r=i.matrixWorld,a=i.userData.instances.indexOf(this.instanceKey);if(!(a===-1||a>i.count)){i.getMatrixAt(a,h6),d6.multiplyMatrices(r,h6),rx.matrixWorld=d6,i.material instanceof Oa?rx.material.side=i.material.side:rx.material.side=i.material[0].side,rx.raycast(e,uE);for(let s=0,o=uE.length;s<o;s++){const l=uE[s];l.instanceId=a,l.object=this,n.push(l)}uE.length=0}}}const aQ=I.createContext(null),p6=new Dt,m6=new Dt,z2e=new Dt,g6=new te,b6=new Xn,v6=new te,j2e=t=>t.isInstancedBufferAttribute,cc=I.forwardRef(({context:t,children:e,...n},i)=>{I.useMemo(()=>q_({PositionMesh:B2e}),[]);const r=I.useRef(null);I.useImperativeHandle(i,()=>r.current,[]);const{subscribe:a,getParent:s}=I.useContext(t||aQ);return I.useLayoutEffect(()=>a(r),[]),I.createElement("positionMesh",Ls({instance:s(),instanceKey:r,ref:r},n),e)}),fT=I.forwardRef(({context:t,children:e,range:n,limit:i=1e3,frames:r=1/0,...a},s)=>{const[{localContext:o,instance:l}]=I.useState(()=>{const x=I.createContext(null);return{localContext:x,instance:I.forwardRef((_,w)=>I.createElement(cc,Ls({context:x},_,{ref:w})))}}),c=I.useRef(null);I.useImperativeHandle(s,()=>c.current,[]);const[u,f]=I.useState([]),[[h,d]]=I.useState(()=>{const x=new Float32Array(i*16);for(let _=0;_<i;_++)z2e.identity().toArray(x,_*16);return[x,new Float32Array([...new Array(i*3)].map(()=>1))]});I.useEffect(()=>{c.current.instanceMatrix.needsUpdate=!0});let g=0,b=0;const y=I.useRef([]);I.useLayoutEffect(()=>{y.current=Object.entries(c.current.geometry.attributes).filter(([x,_])=>j2e(_))}),la(()=>{if(r===1/0||g<r){c.current.updateMatrix(),c.current.updateMatrixWorld(),p6.copy(c.current.matrixWorld).invert(),b=Math.min(i,n!==void 0?n:i,u.length),c.current.count=b,f6(c.current.instanceMatrix,{start:0,count:b*16}),f6(c.current.instanceColor,{start:0,count:b*3});for(let x=0;x<u.length;x++){const _=u[x].current;_.matrixWorld.decompose(g6,b6,v6),m6.compose(g6,b6,v6).premultiply(p6),m6.toArray(h,x*16),c.current.instanceMatrix.needsUpdate=!0,_.color.toArray(d,x*3),c.current.instanceColor.needsUpdate=!0}g++}});const p=I.useMemo(()=>({getParent:()=>c,subscribe:x=>(f(_=>[..._,x]),()=>f(_=>_.filter(w=>w.current!==x.current)))}),[]);return I.createElement("instancedMesh",Ls({userData:{instances:u,limit:i,frames:r},matrixAutoUpdate:!1,ref:c,args:[null,null,0],raycast:()=>null},a),I.createElement("instancedBufferAttribute",{attach:"instanceMatrix",args:[h,16],usage:X1}),I.createElement("instancedBufferAttribute",{attach:"instanceColor",args:[d,3],usage:X1}),F2e(e)?I.createElement(o.Provider,{value:p},e(l)):t?I.createElement(t.Provider,{value:p},e):I.createElement(aQ.Provider,{value:p},e))}),sQ=(t,e,n)=>{let i;switch(t){case Ao:i=new Uint8ClampedArray(e*n*4);break;case as:i=new Uint16Array(e*n*4);break;case Ac:i=new Uint32Array(e*n*4);break;case BA:i=new Int8Array(e*n*4);break;case zA:i=new Int16Array(e*n*4);break;case Gv:i=new Int32Array(e*n*4);break;case wr:i=new Float32Array(e*n*4);break;default:throw new Error("Unsupported data type")}return i};let fE;const H2e=(t,e,n,i)=>{if(fE!==void 0)return fE;const r=new Cc(1,1,i);e.setRenderTarget(r);const a=new _i(new Il,new Ds({color:16777215}));e.render(a,n),e.setRenderTarget(null);const s=sQ(t,r.width,r.height);return e.readRenderTargetPixels(r,0,0,r.width,r.height,s),r.dispose(),a.geometry.dispose(),a.material.dispose(),fE=s[0]!==0,fE};class FU{constructor(e){var n,i,r,a,s,o,l,c,u,f,h,d,g,b,y,p;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(_){throw this._renderer.setRenderTarget(null),_}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const x={format:Qr,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((n=e.renderTargetOptions)===null||n===void 0?void 0:n.anisotropy)!==void 0?(i=e.renderTargetOptions)===null||i===void 0?void 0:i.anisotropy:1,generateMipmaps:((r=e.renderTargetOptions)===null||r===void 0?void 0:r.generateMipmaps)!==void 0?(a=e.renderTargetOptions)===null||a===void 0?void 0:a.generateMipmaps:!1,magFilter:((s=e.renderTargetOptions)===null||s===void 0?void 0:s.magFilter)!==void 0?(o=e.renderTargetOptions)===null||o===void 0?void 0:o.magFilter:Vi,minFilter:((l=e.renderTargetOptions)===null||l===void 0?void 0:l.minFilter)!==void 0?(c=e.renderTargetOptions)===null||c===void 0?void 0:c.minFilter:Vi,samples:((u=e.renderTargetOptions)===null||u===void 0?void 0:u.samples)!==void 0?(f=e.renderTargetOptions)===null||f===void 0?void 0:f.samples:void 0,wrapS:((h=e.renderTargetOptions)===null||h===void 0?void 0:h.wrapS)!==void 0?(d=e.renderTargetOptions)===null||d===void 0?void 0:d.wrapS:_a,wrapT:((g=e.renderTargetOptions)===null||g===void 0?void 0:g.wrapT)!==void 0?(b=e.renderTargetOptions)===null||b===void 0?void 0:b.wrapT:_a};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=FU.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new qv,this._camera=new Ah,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!H2e(this._type,this._renderer,this._camera,x)){let _;switch(this._type){case as:_=this._renderer.extensions.has("EXT_color_buffer_float")?wr:void 0;break}_!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${wr}`),this._type=_):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new _i(new Il,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Cc(this.width,this.height,x),this._renderTarget.texture.mapping=((y=e.renderTargetOptions)===null||y===void 0?void 0:y.mapping)!==void 0?(p=e.renderTargetOptions)===null||p===void 0?void 0:p.mapping:Wd}static instantiateRenderer(){const e=new TU;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=sQ(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const n=new cs(this.toArray(),this.width,this.height,Qr,this._type,e?.mapping||Wd,e?.wrapS||_a,e?.wrapT||_a,e?.magFilter||Vi,e?.minFilter||Vi,e?.anisotropy||1,Su);return n.generateMipmaps=e?.generateMipmaps!==void 0?e?.generateMipmaps:!1,n}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof fs&&Object.values(this.material.uniforms).forEach(n=>{n.value instanceof nr&&n.value.dispose()}),Object.values(this.material).forEach(n=>{n instanceof nr&&n.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const V2e=`
varying vec2 vUv;

void main() {
  vUv = uv;
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,G2e=`
// min half float value
#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )
// max half float value
#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )

uniform sampler2D sdr;
uniform sampler2D gainMap;
uniform vec3 gamma;
uniform vec3 offsetHdr;
uniform vec3 offsetSdr;
uniform vec3 gainMapMin;
uniform vec3 gainMapMax;
uniform float weightFactor;

varying vec2 vUv;

void main() {
  vec3 rgb = texture2D( sdr, vUv ).rgb;
  vec3 recovery = texture2D( gainMap, vUv ).rgb;
  vec3 logRecovery = pow( recovery, gamma );
  vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;
  vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;
  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
  gl_FragColor = vec4( clampedHdrColor , 1.0 );
}
`;class W2e extends fs{constructor({gamma:e,offsetHdr:n,offsetSdr:i,gainMapMin:r,gainMapMax:a,maxDisplayBoost:s,hdrCapacityMin:o,hdrCapacityMax:l,sdr:c,gainMap:u}){super({name:"GainMapDecoderMaterial",vertexShader:V2e,fragmentShader:G2e,uniforms:{sdr:{value:c},gainMap:{value:u},gamma:{value:new te(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new te().fromArray(n)},offsetSdr:{value:new te().fromArray(i)},gainMapMin:{value:new te().fromArray(r)},gainMapMax:{value:new te().fromArray(a)},weightFactor:{value:(Math.log2(s)-o)/(l-o)}},blending:af,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=s,this._hdrCapacityMin=o,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const n=this.uniforms.gamma.value;n.x=1/e[0],n.y=1/e[1],n.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class oQ extends Error{}class lQ extends Error{}const ax=(t,e,n)=>{const i=new RegExp(`${e}="([^"]*)"`,"i").exec(t);if(i)return i[1];const r=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(t);if(r){const a=r[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return a&&a.length===3?a.map(s=>s.replace(/<\/?rdf:li>/g,"")):r[1].trim()}if(n!==void 0)return n;throw new Error(`Can't find ${e} in gainmap metadata`)},X2e=t=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(t):e=t.toString();let n=e.indexOf("<x:xmpmeta");for(;n!==-1;){const i=e.indexOf("x:xmpmeta>",n),r=e.slice(n,i+10);try{const a=ax(r,"hdrgm:GainMapMin","0"),s=ax(r,"hdrgm:GainMapMax"),o=ax(r,"hdrgm:Gamma","1"),l=ax(r,"hdrgm:OffsetSDR","0.015625"),c=ax(r,"hdrgm:OffsetHDR","0.015625"),u=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(r),f=u?u[1]:"0",h=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(r);if(!h)throw new Error("Incomplete gainmap metadata");const d=h[1];return{gainMapMin:Array.isArray(a)?a.map(g=>parseFloat(g)):[parseFloat(a),parseFloat(a),parseFloat(a)],gainMapMax:Array.isArray(s)?s.map(g=>parseFloat(g)):[parseFloat(s),parseFloat(s),parseFloat(s)],gamma:Array.isArray(o)?o.map(g=>parseFloat(g)):[parseFloat(o),parseFloat(o),parseFloat(o)],offsetSdr:Array.isArray(l)?l.map(g=>parseFloat(g)):[parseFloat(l),parseFloat(l),parseFloat(l)],offsetHdr:Array.isArray(c)?c.map(g=>parseFloat(g)):[parseFloat(c),parseFloat(c),parseFloat(c)],hdrCapacityMin:parseFloat(f),hdrCapacityMax:parseFloat(d)}}catch{}n=e.indexOf("<x:xmpmeta",i)}};class q2e{constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((n,i)=>{const r=this.options.debug,a=new DataView(e.buffer);if(a.getUint16(0)!==65496){i(new Error("Not a valid jpeg"));return}const s=a.byteLength;let o=2,l=0,c;for(;o<s;){if(++l>250){i(new Error(`Found no marker after ${l} loops 😵`));return}if(a.getUint8(o)!==255){i(new Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${a.getUint8(o).toString(16)}`));return}if(c=a.getUint8(o+1),r&&console.log(`Marker: ${c.toString(16)}`),c===226){r&&console.log("Found APP2 marker (0xffe2)");const u=o+4;if(a.getUint32(u)===1297106432){const f=u+4;let h;if(a.getUint16(f)===18761)h=!1;else if(a.getUint16(f)===19789)h=!0;else{i(new Error("No valid endianness marker found in TIFF header"));return}if(a.getUint16(f+2,!h)!==42){i(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const d=a.getUint32(f+4,!h);if(d<8){i(new Error("Not valid TIFF data! (First offset less than 8)"));return}const g=f+d,b=a.getUint16(g,!h),y=g+2;let p=0;for(let M=y;M<y+12*b;M+=12)a.getUint16(M,!h)===45057&&(p=a.getUint32(M+8,!h));const _=g+2+b*12+4,w=[];for(let M=_;M<_+p*16;M+=16){const S={MPType:a.getUint32(M,!h),size:a.getUint32(M+4,!h),dataOffset:a.getUint32(M+8,!h),dependantImages:a.getUint32(M+12,!h),start:-1,end:-1,isFII:!1};S.dataOffset?(S.start=f+S.dataOffset,S.isFII=!1):(S.start=0,S.isFII=!0),S.end=S.start+S.size,w.push(S)}if(this.options.extractNonFII&&w.length){const M=new Blob([a]),S=[];for(const A of w){if(A.isFII&&!this.options.extractFII)continue;const C=M.slice(A.start,A.end+1,"image/jpeg");S.push(C)}n(S)}}}o+=2+a.getUint16(o+2)}})}}const K2e=async t=>{const e=X2e(t);if(!e)throw new lQ("Gain map XMP metadata not found");const i=await new q2e({extractFII:!0,extractNonFII:!0}).extract(t);if(i.length!==2)throw new oQ("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:e}},y6=t=>new Promise((e,n)=>{const i=document.createElement("img");i.onload=()=>{e(i)},i.onerror=r=>{n(r)},i.src=URL.createObjectURL(t)});class cQ extends Fs{constructor(e,n){super(n),e&&(this._renderer=e),this._internalLoadingManager=new mC}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new W2e({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new nr,sdr:new nr});return new FU({width:16,height:16,type:as,colorSpace:Su,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,n,i,r){const a=r?new Blob([r],{type:"image/jpeg"}):void 0,s=new Blob([i],{type:"image/jpeg"});let o,l,c=!1;if(typeof createImageBitmap>"u"){const h=await Promise.all([a?y6(a):Promise.resolve(void 0),y6(s)]);l=h[0],o=h[1],c=!0}else{const h=await Promise.all([a?createImageBitmap(a,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(s,{imageOrientation:"flipY"})]);l=h[0],o=h[1]}const u=new nr(l||new ImageData(2,2),Wd,_a,_a,Vi,$O,Qr,Ao,1,Su);u.flipY=c,u.needsUpdate=!0;const f=new nr(o,Wd,_a,_a,Vi,$O,Qr,Ao,1,As);f.flipY=c,f.needsUpdate=!0,e.width=o.width,e.height=o.height,e.material.gainMap=u,e.material.sdr=f,e.material.gainMapMin=n.gainMapMin,e.material.gainMapMax=n.gainMapMax,e.material.offsetHdr=n.offsetHdr,e.material.offsetSdr=n.offsetSdr,e.material.gamma=n.gamma,e.material.hdrCapacityMin=n.hdrCapacityMin,e.material.hdrCapacityMax=n.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,n.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class Y2e extends cQ{load([e,n,i],r,a,s){const o=this.prepareQuadRenderer();let l,c,u;const f=async()=>{if(l&&c&&u){try{await this.render(o,u,l,c)}catch(k){this.manager.itemError(e),this.manager.itemError(n),this.manager.itemError(i),typeof s=="function"&&s(k),o.disposeOnDemandRenderer();return}typeof r=="function"&&r(o),this.manager.itemEnd(e),this.manager.itemEnd(n),this.manager.itemEnd(i),o.disposeOnDemandRenderer()}};let h=!0,d=0,g=0,b=!0,y=0,p=0,x=!0,_=0,w=0;const M=()=>{if(typeof a=="function"){const k=d+y+_,R=g+p+w,N=h&&b&&x;a(new ProgressEvent("progress",{lengthComputable:N,loaded:R,total:k}))}};this.manager.itemStart(e),this.manager.itemStart(n),this.manager.itemStart(i);const S=new Ns(this._internalLoadingManager);S.setResponseType("arraybuffer"),S.setRequestHeader(this.requestHeader),S.setPath(this.path),S.setWithCredentials(this.withCredentials),S.load(e,async k=>{if(typeof k=="string")throw new Error("Invalid sdr buffer");l=k,await f()},k=>{h=k.lengthComputable,g=k.loaded,d=k.total,M()},k=>{this.manager.itemError(e),typeof s=="function"&&s(k)});const A=new Ns(this._internalLoadingManager);A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setPath(this.path),A.setWithCredentials(this.withCredentials),A.load(n,async k=>{if(typeof k=="string")throw new Error("Invalid gainmap buffer");c=k,await f()},k=>{b=k.lengthComputable,p=k.loaded,y=k.total,M()},k=>{this.manager.itemError(n),typeof s=="function"&&s(k)});const C=new Ns(this._internalLoadingManager);return C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(i,async k=>{if(typeof k!="string")throw new Error("Invalid metadata string");u=JSON.parse(k),await f()},k=>{x=k.lengthComputable,w=k.loaded,_=k.total,M()},k=>{this.manager.itemError(i),typeof s=="function"&&s(k)}),o}}class J2e extends cQ{load(e,n,i,r){const a=this.prepareQuadRenderer(),s=new Ns(this._internalLoadingManager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),this.manager.itemStart(e),s.load(e,async o=>{if(typeof o=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const l=new Uint8Array(o);let c,u,f;try{const h=await K2e(l);c=h.sdr,u=h.gainMap,f=h.metadata}catch(h){if(h instanceof lQ||h instanceof oQ)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),f={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},c=l;else throw h}try{await this.render(a,f,c,u)}catch(h){this.manager.itemError(e),typeof r=="function"&&r(h),a.disposeOnDemandRenderer();return}typeof n=="function"&&n(a),this.manager.itemEnd(e),a.disposeOnDemandRenderer()},i,o=>{this.manager.itemError(e),typeof r=="function"&&r(o)}),a}}const e_={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"},uQ="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",M0=t=>Array.isArray(t),BU=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function TC({files:t=BU,path:e="",preset:n=void 0,colorSpace:i=void 0,extensions:r}={}){n&&(zU(n),t=e_[n],e=uQ);const a=M0(t),{extension:s,isCubemap:o}=jU(t),l=HU(s);if(!l)throw new Error("useEnvironment: Unrecognized file extension: "+t);const c=ki(d=>d.gl);I.useLayoutEffect(()=>{if(s!=="webp"&&s!=="jpg"&&s!=="jpeg")return;function d(){pv.clear(l,a?[t]:t)}c.domElement.addEventListener("webglcontextlost",d,{once:!0})},[t,c.domElement]);const u=pv(l,a?[t]:t,d=>{(s==="webp"||s==="jpg"||s==="jpeg")&&d.setRenderer(c),d.setPath==null||d.setPath(e),r&&r(d)});let f=a?u[0]:u;if(s==="jpg"||s==="jpeg"||s==="webp"){var h;f=(h=f.renderTarget)==null?void 0:h.texture}return f.mapping=o?df:$0,f.colorSpace=i??(o?"srgb":"srgb-linear"),f}const $2e={files:BU,path:"",preset:void 0,extensions:void 0};TC.preload=t=>{const e={...$2e,...t};let{files:n,path:i=""}=e;const{preset:r,extensions:a}=e;r&&(zU(r),n=e_[r],i=uQ);const{extension:s}=jU(n);if(s==="webp"||s==="jpg"||s==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const o=HU(s);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);pv.preload(o,M0(n)?[n]:n,l=>{l.setPath==null||l.setPath(i),a&&a(l)})};const Z2e={files:BU,preset:void 0};TC.clear=t=>{const e={...Z2e,...t};let{files:n}=e;const{preset:i}=e;i&&(zU(i),n=e_[i]);const{extension:r}=jU(n),a=HU(r);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+n);pv.clear(a,M0(n)?[n]:n)};function zU(t){if(!(t in e_))throw new Error("Preset must be one of: "+Object.keys(e_).join(", "))}function jU(t){var e;const n=M0(t)&&t.length===6,i=M0(t)&&t.length===3&&t.some(s=>s.endsWith("json")),r=M0(t)?t[0]:t;return{extension:n?"cube":i?"webp":r.startsWith("data:application/exr")?"exr":r.startsWith("data:application/hdr")?"hdr":r.startsWith("data:image/jpeg")?"jpg":(e=r.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:n,isGainmap:i}}function HU(t){return t==="cube"?R$:t==="hdr"?mMe:t==="exr"?gMe:t==="jpg"||t==="jpeg"?J2e:t==="webp"?Y2e:null}const Q2e=t=>t.current&&t.current.isScene,eTe=t=>Q2e(t)?t.current:t;function VU(t,e,n,i,r={}){var a,s,o,l;r={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...r};const c=eTe(e||n),u=c.background,f=c.environment,h={backgroundBlurriness:c.backgroundBlurriness,backgroundIntensity:c.backgroundIntensity,backgroundRotation:(a=(s=c.backgroundRotation)==null||s.clone==null?void 0:s.clone())!==null&&a!==void 0?a:[0,0,0],environmentIntensity:c.environmentIntensity,environmentRotation:(o=(l=c.environmentRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0]};return t!=="only"&&(c.environment=i),t&&(c.background=i),ou(c,r),()=>{t!=="only"&&(c.environment=f),t&&(c.background=u),ou(c,h)}}function GU({scene:t,background:e=!1,map:n,...i}){const r=ki(a=>a.scene);return I.useLayoutEffect(()=>{if(n)return VU(e,t,r,n,i)}),null}function fQ({background:t=!1,scene:e,blur:n,backgroundBlurriness:i,backgroundIntensity:r,backgroundRotation:a,environmentIntensity:s,environmentRotation:o,...l}){const c=TC(l),u=ki(f=>f.scene);return I.useLayoutEffect(()=>VU(t,e,u,c,{backgroundBlurriness:n??i,backgroundIntensity:r,backgroundRotation:a,environmentIntensity:s,environmentRotation:o})),I.useEffect(()=>()=>{c.dispose()},[c]),null}function tTe({children:t,near:e=.1,far:n=1e3,resolution:i=256,frames:r=1,map:a,background:s=!1,blur:o,backgroundBlurriness:l,backgroundIntensity:c,backgroundRotation:u,environmentIntensity:f,environmentRotation:h,scene:d,files:g,path:b,preset:y=void 0,extensions:p}){const x=ki(C=>C.gl),_=ki(C=>C.scene),w=I.useRef(null),[M]=I.useState(()=>new qv),S=I.useMemo(()=>{const C=new ZP(i);return C.texture.type=as,C},[i]);I.useEffect(()=>()=>{S.dispose()},[S]),I.useLayoutEffect(()=>{if(r===1){const C=x.autoClear;x.autoClear=!0,w.current.update(x,M),x.autoClear=C}return VU(s,d,_,S.texture,{backgroundBlurriness:o??l,backgroundIntensity:c,backgroundRotation:u,environmentIntensity:f,environmentRotation:h})},[t,M,S.texture,d,_,s,r,x]);let A=1;return la(()=>{if(r===1/0||A<r){const C=x.autoClear;x.autoClear=!0,w.current.update(x,M),x.autoClear=C,A++}}),I.createElement(I.Fragment,null,Kwe(I.createElement(I.Fragment,null,t,I.createElement("cubeCamera",{ref:w,args:[e,n,S]}),g||y?I.createElement(fQ,{background:!0,files:g,preset:y,path:b,extensions:p}):a?I.createElement(GU,{background:!0,map:a,extensions:p}):null),M))}function nTe(t){var e,n,i,r;const a=TC(t),s=t.map||a;I.useMemo(()=>q_({GroundProjectedEnvImpl:OEe}),[]),I.useEffect(()=>()=>{a.dispose()},[a]);const o=I.useMemo(()=>[s],[s]),l=(e=t.ground)==null?void 0:e.height,c=(n=t.ground)==null?void 0:n.radius,u=(i=(r=t.ground)==null?void 0:r.scale)!==null&&i!==void 0?i:1e3;return I.createElement(I.Fragment,null,I.createElement(GU,Ls({},t,{map:s})),I.createElement("groundProjectedEnvImpl",{args:o,scale:u,height:l,radius:c}))}function iTe(t){return t.ground?I.createElement(nTe,t):t.map?I.createElement(GU,t):t.children?I.createElement(tTe,t):I.createElement(fQ,t)}const rTe=I.createContext(null);function aTe({iterations:t=10,ms:e=250,threshold:n=.75,step:i=.1,factor:r=.5,flipflops:a=1/0,bounds:s=h=>h>100?[60,100]:[40,60],onIncline:o,onDecline:l,onChange:c,onFallback:u,children:f}){const h=Math.pow(10,0),[d,g]=I.useState(()=>({fps:0,index:0,factor:r,flipped:0,refreshrate:0,fallback:!1,frames:[],averages:[],subscriptions:new Map,subscribe:y=>{const p=Symbol();return d.subscriptions.set(p,y.current),()=>void d.subscriptions.delete(p)}}));let b=0;return la(()=>{const{frames:y,averages:p}=d;if(!d.fallback&&p.length<t){y.push(performance.now());const x=y[y.length-1]-y[0];if(x>=e){if(d.fps=Math.round(y.length/x*1e3*h)/h,d.refreshrate=Math.max(d.refreshrate,d.fps),p[d.index++%t]=d.fps,p.length===t){const[_,w]=s(d.refreshrate),M=p.filter(A=>A>=w),S=p.filter(A=>A<_);M.length>t*n&&(d.factor=Math.min(1,d.factor+i),d.flipped++,o&&o(d),d.subscriptions.forEach(A=>A.onIncline&&A.onIncline(d))),S.length>t*n&&(d.factor=Math.max(0,d.factor-i),d.flipped++,l&&l(d),d.subscriptions.forEach(A=>A.onDecline&&A.onDecline(d))),b!==d.factor&&(b=d.factor,c&&c(d),d.subscriptions.forEach(A=>A.onChange&&A.onChange(d))),d.flipped>a&&!d.fallback&&(d.fallback=!0,u&&u(d),d.subscriptions.forEach(A=>A.onFallback&&A.onFallback(d))),d.averages=[]}d.frames=[]}}}),I.createElement(rTe.Provider,{value:d},f)}const sTe={},x6=t=>{let e;const n=new Set,i=(u,f)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const d=e;e=f??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(g=>g(e,d))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(sTe?"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."),n.clear()}},c=e=t(i,r,l);return l},oTe=t=>t?x6(t):x6,hQ={},{useDebugValue:lTe}=Ee,{useSyncExternalStoreWithSelector:cTe}=iZ;let _6=!1;const uTe=t=>t;function fTe(t,e=uTe,n){(hQ?"production":void 0)!=="production"&&n&&!_6&&(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"),_6=!0);const i=cTe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return lTe(i),i}const S6=t=>{(hQ?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?oTe(t):t,n=(i,r)=>fTe(e,i,r);return Object.assign(n,e),n},$_=t=>t?S6(t):S6,Z_=I.createContext(null),hE=new te,w6=new te,hTe=(t,e,n,i)=>{const r=e.dot(e),a=e.dot(t)-e.dot(n),s=e.dot(i);return s===0?-a/r:(hE.copy(i).multiplyScalar(r/s).sub(e),w6.copy(i).multiplyScalar(a/s).add(n).sub(t),-hE.dot(w6)/hE.dot(hE))},dTe=new te(0,1,0),E6=new Dt,_D=({direction:t,axis:e})=>{const{translation:n,translationLimits:i,annotations:r,annotationsClass:a,depthTest:s,scale:o,lineWidth:l,fixed:c,axisColors:u,hoveredColor:f,opacity:h,renderOrder:d,onDragStart:g,onDrag:b,onDragEnd:y,userData:p}=I.useContext(Z_),x=ki(V=>V.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(null),S=I.useRef(0),[A,C]=I.useState(!1),k=I.useCallback(V=>{r&&(_.current.innerText=`${n.current[e].toFixed(2)}`,_.current.style.display="block"),V.stopPropagation();const W=new Dt().extractRotation(w.current.matrixWorld),B=V.point.clone(),Y=new te().setFromMatrixPosition(w.current.matrixWorld),Z=t.clone().applyMatrix4(W).normalize();M.current={clickPoint:B,dir:Z},S.current=n.current[e],g({component:"Arrow",axis:e,origin:Y,directions:[Z]}),x&&(x.enabled=!1),V.target.setPointerCapture(V.pointerId)},[r,t,x,g,n,e]),R=I.useCallback(V=>{if(V.stopPropagation(),A||C(!0),M.current){const{clickPoint:W,dir:B}=M.current,[Y,Z]=i?.[e]||[void 0,void 0];let G=hTe(W,B,V.ray.origin,V.ray.direction);Y!==void 0&&(G=Math.max(G,Y-S.current)),Z!==void 0&&(G=Math.min(G,Z-S.current)),n.current[e]=S.current+G,r&&(_.current.innerText=`${n.current[e].toFixed(2)}`),E6.makeTranslation(B.x*G,B.y*G,B.z*G),b(E6)}},[r,b,A,n,i,e]),N=I.useCallback(V=>{r&&(_.current.style.display="none"),V.stopPropagation(),M.current=null,y(),x&&(x.enabled=!0),V.target.releasePointerCapture(V.pointerId)},[r,x,y]),P=I.useCallback(V=>{V.stopPropagation(),C(!1)},[]),{cylinderLength:j,coneWidth:z,coneLength:X,matrixL:F}=I.useMemo(()=>{const V=c?l/o*1.6:o/20,W=c?.2:o/5,B=c?1-W:o-W,Y=new Xn().setFromUnitVectors(dTe,t.clone().normalize()),Z=new Dt().makeRotationFromQuaternion(Y);return{cylinderLength:B,coneWidth:V,coneLength:W,matrixL:Z}},[t,o,l,c]),H=A?f:u[e];return I.createElement("group",{ref:w},I.createElement("group",{matrix:F,matrixAutoUpdate:!1,onPointerDown:k,onPointerMove:R,onPointerUp:N,onPointerOut:P},r&&I.createElement(ty,{position:[0,-X,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:a,ref:_})),I.createElement("mesh",{visible:!1,position:[0,(j+X)/2,0],userData:p},I.createElement("cylinderGeometry",{args:[z*1.4,z*1.4,j+X,8,1]})),I.createElement(Qm,{transparent:!0,raycast:()=>null,depthTest:s,points:[0,0,0,0,j,0],lineWidth:l,side:Jr,color:H,opacity:h,polygonOffset:!0,renderOrder:1,polygonOffsetFactor:-10,fog:!1}),I.createElement("mesh",{raycast:()=>null,position:[0,j+X/2,0],renderOrder:d},I.createElement("coneGeometry",{args:[z,X,24,1]}),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:s,color:H,opacity:h,polygonOffset:!0,polygonOffsetFactor:-10,fog:!1}))))},SD=new te,wD=new te,ED=t=>t*180/Math.PI,pTe=t=>t*Math.PI/180,mTe=(t,e,n,i,r)=>{SD.copy(t).sub(n),wD.copy(e).sub(n);const a=i.dot(i),s=r.dot(r),o=SD.dot(i)/a,l=SD.dot(r)/s,c=wD.dot(i)/a,u=wD.dot(r)/s,f=Math.atan2(l,o);return Math.atan2(u,c)-f},gTe=(t,e)=>{let n=Math.floor(t/e);return n=n<0?n+1:n,t-n*e},M6=t=>{let e=gTe(t,2*Math.PI);return Math.abs(e)<1e-6?0:(e<0&&(e+=2*Math.PI),e)},dE=new Dt,T6=new te,pE=new xf,MD=new te,TD=({dir1:t,dir2:e,axis:n})=>{const{rotationLimits:i,annotations:r,annotationsClass:a,depthTest:s,scale:o,lineWidth:l,fixed:c,axisColors:u,hoveredColor:f,renderOrder:h,opacity:d,onDragStart:g,onDrag:b,onDragEnd:y,userData:p}=I.useContext(Z_),x=ki(H=>H.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(0),S=I.useRef(0),A=I.useRef(null),[C,k]=I.useState(!1),R=I.useCallback(H=>{r&&(_.current.innerText=`${ED(S.current).toFixed(0)}º`,_.current.style.display="block"),H.stopPropagation();const V=H.point.clone(),W=new te().setFromMatrixPosition(w.current.matrixWorld),B=new te().setFromMatrixColumn(w.current.matrixWorld,0).normalize(),Y=new te().setFromMatrixColumn(w.current.matrixWorld,1).normalize(),Z=new te().setFromMatrixColumn(w.current.matrixWorld,2).normalize(),G=new nu().setFromNormalAndCoplanarPoint(Z,W);A.current={clickPoint:V,origin:W,e1:B,e2:Y,normal:Z,plane:G},g({component:"Rotator",axis:n,origin:W,directions:[B,Y,Z]}),x&&(x.enabled=!1),H.target.setPointerCapture(H.pointerId)},[r,x,g,n]),N=I.useCallback(H=>{if(H.stopPropagation(),C||k(!0),A.current){const{clickPoint:V,origin:W,e1:B,e2:Y,normal:Z,plane:G}=A.current,[de,oe]=i?.[n]||[void 0,void 0];pE.copy(H.ray),pE.intersectPlane(G,MD),pE.direction.negate(),pE.intersectPlane(G,MD);let le=mTe(V,MD,W,B,Y),ue=ED(le);H.shiftKey&&(ue=Math.round(ue/10)*10,le=pTe(ue)),de!==void 0&&oe!==void 0&&oe-de<2*Math.PI?(le=M6(le),le=le>Math.PI?le-2*Math.PI:le,le=yc.clamp(le,de-M.current,oe-M.current),S.current=M.current+le):(S.current=M6(M.current+le),S.current=S.current>Math.PI?S.current-2*Math.PI:S.current),r&&(ue=ED(S.current),_.current.innerText=`${ue.toFixed(0)}º`),dE.makeRotationAxis(Z,le),T6.copy(W).applyMatrix4(dE).sub(W).negate(),dE.setPosition(T6),b(dE)}},[r,b,C,i,n]),P=I.useCallback(H=>{r&&(_.current.style.display="none"),H.stopPropagation(),M.current=S.current,A.current=null,y(),x&&(x.enabled=!0),H.target.releasePointerCapture(H.pointerId)},[r,x,y]),j=I.useCallback(H=>{H.stopPropagation(),k(!1)},[]),z=I.useMemo(()=>{const H=t.clone().normalize(),V=e.clone().normalize();return new Dt().makeBasis(H,V,H.clone().cross(V))},[t,e]),X=c?.65:o*.65,F=I.useMemo(()=>{const V=[];for(let W=0;W<=32;W++){const B=W*(Math.PI/2)/32;V.push(new te(Math.cos(B)*X,Math.sin(B)*X,0))}return V},[X]);return I.createElement("group",{ref:w,onPointerDown:R,onPointerMove:N,onPointerUp:P,onPointerOut:j,matrix:z,matrixAutoUpdate:!1},r&&I.createElement(ty,{position:[X,X,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:a,ref:_})),I.createElement(Qm,{points:F,lineWidth:l*4,visible:!1,userData:p}),I.createElement(Qm,{transparent:!0,raycast:()=>null,depthTest:s,points:F,lineWidth:l,side:Jr,color:C?f:u[n],opacity:d,polygonOffset:!0,polygonOffsetFactor:-10,renderOrder:h,fog:!1}))},bTe=(t,e,n)=>{const i=Math.abs(t.x)>=Math.abs(t.y)&&Math.abs(t.x)>=Math.abs(t.z)?0:Math.abs(t.y)>=Math.abs(t.x)&&Math.abs(t.y)>=Math.abs(t.z)?1:2,r=[0,1,2].sort((g,b)=>Math.abs(e.getComponent(b))-Math.abs(e.getComponent(g))),a=i===r[0]?r[1]:r[0],s=t.getComponent(i),o=t.getComponent(a),l=e.getComponent(i),c=e.getComponent(a),u=n.getComponent(i),h=(n.getComponent(a)-u*(o/s))/(c-l*(o/s));return[(u-h*l)/s,h]},mE=new xf,gE=new te,A6=new Dt,AD=({dir1:t,dir2:e,axis:n})=>{const{translation:i,translationLimits:r,annotations:a,annotationsClass:s,depthTest:o,scale:l,lineWidth:c,fixed:u,axisColors:f,hoveredColor:h,opacity:d,onDragStart:g,onDrag:b,onDragEnd:y,userData:p}=I.useContext(Z_),x=ki(W=>W.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(null),S=I.useRef(0),A=I.useRef(0),[C,k]=I.useState(!1),R=I.useCallback(W=>{a&&(_.current.innerText=`${i.current[(n+1)%3].toFixed(2)}, ${i.current[(n+2)%3].toFixed(2)}`,_.current.style.display="block"),W.stopPropagation();const B=W.point.clone(),Y=new te().setFromMatrixPosition(w.current.matrixWorld),Z=new te().setFromMatrixColumn(w.current.matrixWorld,0).normalize(),G=new te().setFromMatrixColumn(w.current.matrixWorld,1).normalize(),de=new te().setFromMatrixColumn(w.current.matrixWorld,2).normalize(),oe=new nu().setFromNormalAndCoplanarPoint(de,Y);M.current={clickPoint:B,e1:Z,e2:G,plane:oe},S.current=i.current[(n+1)%3],A.current=i.current[(n+2)%3],g({component:"Slider",axis:n,origin:Y,directions:[Z,G,de]}),x&&(x.enabled=!1),W.target.setPointerCapture(W.pointerId)},[a,x,g,n]),N=I.useCallback(W=>{if(W.stopPropagation(),C||k(!0),M.current){const{clickPoint:B,e1:Y,e2:Z,plane:G}=M.current,[de,oe]=r?.[(n+1)%3]||[void 0,void 0],[le,ue]=r?.[(n+2)%3]||[void 0,void 0];mE.copy(W.ray),mE.intersectPlane(G,gE),mE.direction.negate(),mE.intersectPlane(G,gE),gE.sub(B);let[Se,Te]=bTe(Y,Z,gE);de!==void 0&&(Se=Math.max(Se,de-S.current)),oe!==void 0&&(Se=Math.min(Se,oe-S.current)),le!==void 0&&(Te=Math.max(Te,le-A.current)),ue!==void 0&&(Te=Math.min(Te,ue-A.current)),i.current[(n+1)%3]=S.current+Se,i.current[(n+2)%3]=A.current+Te,a&&(_.current.innerText=`${i.current[(n+1)%3].toFixed(2)}, ${i.current[(n+2)%3].toFixed(2)}`),A6.makeTranslation(Se*Y.x+Te*Z.x,Se*Y.y+Te*Z.y,Se*Y.z+Te*Z.z),b(A6)}},[a,b,C,i,r,n]),P=I.useCallback(W=>{a&&(_.current.style.display="none"),W.stopPropagation(),M.current=null,y(),x&&(x.enabled=!0),W.target.releasePointerCapture(W.pointerId)},[a,x,y]),j=I.useCallback(W=>{W.stopPropagation(),k(!1)},[]),z=I.useMemo(()=>{const W=t.clone().normalize(),B=e.clone().normalize();return new Dt().makeBasis(W,B,W.clone().cross(B))},[t,e]),X=u?1/7:l/7,F=u?.225:l*.225,H=C?h:f[n],V=I.useMemo(()=>[new te(0,0,0),new te(0,F,0),new te(F,F,0),new te(F,0,0),new te(0,0,0)],[F]);return I.createElement("group",{ref:w,matrix:z,matrixAutoUpdate:!1},a&&I.createElement(ty,{position:[0,0,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:s,ref:_})),I.createElement("group",{position:[X*1.7,X*1.7,0]},I.createElement("mesh",{visible:!0,onPointerDown:R,onPointerMove:N,onPointerUp:P,onPointerOut:j,scale:F,userData:p},I.createElement("planeGeometry",null),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:o,color:H,polygonOffset:!0,polygonOffsetFactor:-10,side:Jr,fog:!1})),I.createElement(Qm,{position:[-F/2,-F/2,0],transparent:!0,depthTest:o,points:V,lineWidth:c,color:H,opacity:d,polygonOffset:!0,polygonOffsetFactor:-10,userData:p,fog:!1})))},Dx=new te,C6=new te,vTe=(t,e,n,i)=>{const r=e.dot(e),a=e.dot(t)-e.dot(n),s=e.dot(i);return s===0?-a/r:(Dx.copy(i).multiplyScalar(r/s).sub(e),C6.copy(i).multiplyScalar(a/s).add(n).sub(t),-Dx.dot(C6)/Dx.dot(Dx))},yTe=new te(0,1,0),sx=new te,R6=new Dt,CD=({direction:t,axis:e})=>{const{scaleLimits:n,annotations:i,annotationsClass:r,depthTest:a,scale:s,lineWidth:o,fixed:l,axisColors:c,hoveredColor:u,opacity:f,renderOrder:h,onDragStart:d,onDrag:g,onDragEnd:b,userData:y}=I.useContext(Z_),p=ki(W=>W.size),x=ki(W=>W.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(null),S=I.useRef(1),A=I.useRef(1),C=I.useRef(null),[k,R]=I.useState(!1),N=l?1.2:1.2*s,P=I.useCallback(W=>{i&&(_.current.innerText=`${A.current.toFixed(2)}`,_.current.style.display="block"),W.stopPropagation();const B=new Dt().extractRotation(w.current.matrixWorld),Y=W.point.clone(),Z=new te().setFromMatrixPosition(w.current.matrixWorld),G=t.clone().applyMatrix4(B).normalize(),de=w.current.matrixWorld.clone(),oe=de.clone().invert(),le=l?1/VZ(w.current.getWorldPosition(Dx),s,W.camera,p):1;C.current={clickPoint:Y,dir:G,mPLG:de,mPLGInv:oe,offsetMultiplier:le},d({component:"Sphere",axis:e,origin:Z,directions:[G]}),x&&(x.enabled=!1),W.target.setPointerCapture(W.pointerId)},[i,x,t,d,e,l,s,p]),j=I.useCallback(W=>{if(W.stopPropagation(),k||R(!0),C.current){const{clickPoint:B,dir:Y,mPLG:Z,mPLGInv:G,offsetMultiplier:de}=C.current,[oe,le]=n?.[e]||[1e-5,void 0],Se=vTe(B,Y,W.ray.origin,W.ray.direction)*de,Te=l?Se:Se/s;let Pe=Math.pow(2,Te*.2);W.shiftKey&&(Pe=Math.round(Pe*10)/10),Pe=Math.max(Pe,oe/S.current),le!==void 0&&(Pe=Math.min(Pe,le/S.current)),A.current=S.current*Pe,M.current.position.set(0,N+Se,0),i&&(_.current.innerText=`${A.current.toFixed(2)}`),sx.set(1,1,1),sx.setComponent(e,Pe),R6.makeScale(sx.x,sx.y,sx.z).premultiply(Z).multiply(G),g(R6)}},[i,N,g,k,n,e]),z=I.useCallback(W=>{i&&(_.current.style.display="none"),W.stopPropagation(),S.current=A.current,C.current=null,M.current.position.set(0,N,0),b(),x&&(x.enabled=!0),W.target.releasePointerCapture(W.pointerId)},[i,x,b,N]),X=I.useCallback(W=>{W.stopPropagation(),R(!1)},[]),{radius:F,matrixL:H}=I.useMemo(()=>{const W=l?o/s*1.8:s/22.5,B=new Xn().setFromUnitVectors(yTe,t.clone().normalize()),Y=new Dt().makeRotationFromQuaternion(B);return{radius:W,matrixL:Y}},[t,s,o,l]),V=k?u:c[e];return I.createElement("group",{ref:w},I.createElement("group",{matrix:H,matrixAutoUpdate:!1,onPointerDown:P,onPointerMove:j,onPointerUp:z,onPointerOut:X},i&&I.createElement(ty,{position:[0,N/2,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:r,ref:_})),I.createElement("mesh",{ref:M,position:[0,N,0],renderOrder:h,userData:y},I.createElement("sphereGeometry",{args:[F,12,12]}),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:a,color:V,opacity:f,polygonOffset:!0,polygonOffsetFactor:-10}))))},k6=new Dt,D6=new Dt,O6=new Dt,bE=new Dt,RD=new Dt,Tb=new Dt,I6=new Dt,N6=new Dt,L6=new Dt,Ab=new rr,kD=new rr,P6=new te,U6=new te,F6=new te,B6=new te,ox=new te,Cb=new te(1,0,0),Rb=new te(0,1,0),kb=new te(0,0,1),dQ=I.forwardRef(({enabled:t=!0,matrix:e,onDragStart:n,onDrag:i,onDragEnd:r,autoTransform:a=!0,anchor:s,disableAxes:o=!1,disableSliders:l=!1,disableRotations:c=!1,disableScaling:u=!1,activeAxes:f=[!0,!0,!0],offset:h=[0,0,0],rotation:d=[0,0,0],scale:g=1,lineWidth:b=4,fixed:y=!1,translationLimits:p,rotationLimits:x,scaleLimits:_,depthTest:w=!0,renderOrder:M=500,axisColors:S=["#ff2060","#20df80","#2080ff"],hoveredColor:A="#ffff40",annotations:C=!1,annotationsClass:k,opacity:R=1,visible:N=!0,userData:P,children:j,...z},X)=>{const F=ki(le=>le.invalidate),H=I.useRef(null),V=I.useRef(null),W=I.useRef(null),B=I.useRef(null),Y=I.useRef([0,0,0]),Z=I.useRef(new te(1,1,1)),G=I.useRef(new te(1,1,1));I.useLayoutEffect(()=>{s&&(B.current.updateWorldMatrix(!0,!0),bE.copy(B.current.matrixWorld).invert(),Ab.makeEmpty(),B.current.traverse(le=>{le.geometry&&(le.geometry.boundingBox||le.geometry.computeBoundingBox(),Tb.copy(le.matrixWorld).premultiply(bE),kD.copy(le.geometry.boundingBox),kD.applyMatrix4(Tb),Ab.union(kD))}),P6.copy(Ab.max).add(Ab.min).multiplyScalar(.5),U6.copy(Ab.max).sub(Ab.min).multiplyScalar(.5),F6.copy(U6).multiply(new te(...s)).add(P6),B6.set(...h).add(F6),W.current.position.copy(B6),F())});const de=I.useMemo(()=>({onDragStart:le=>{k6.copy(V.current.matrix),D6.copy(V.current.matrixWorld),n&&n(le),F()},onDrag:le=>{O6.copy(H.current.matrixWorld),bE.copy(O6).invert(),RD.copy(D6).premultiply(le),Tb.copy(RD).premultiply(bE),I6.copy(k6).invert(),N6.copy(Tb).multiply(I6),a&&V.current.matrix.copy(Tb),i&&i(Tb,N6,RD,le),F()},onDragEnd:()=>{r&&r(),F()},translation:Y,translationLimits:p,rotationLimits:x,axisColors:S,hoveredColor:A,opacity:R,scale:g,lineWidth:b,fixed:y,depthTest:w,renderOrder:M,userData:P,annotations:C,annotationsClass:k}),[n,i,r,Y,p,x,_,w,g,b,y,...S,A,R,P,a,C,k]),oe=new te;return la(le=>{if(y){const ue=VZ(W.current.getWorldPosition(oe),g,le.camera,le.size);Z.current.setScalar(ue)}e&&e instanceof Dt&&(V.current.matrix=e),V.current.updateWorldMatrix(!0,!0),L6.makeRotationFromEuler(W.current.rotation).setPosition(W.current.position).premultiply(V.current.matrixWorld),G.current.setFromMatrixScale(L6),ox.copy(Z.current).divide(G.current),(Math.abs(W.current.scale.x-ox.x)>1e-4||Math.abs(W.current.scale.y-ox.y)>1e-4||Math.abs(W.current.scale.z-ox.z)>1e-4)&&(W.current.scale.copy(ox),le.invalidate())}),I.useImperativeHandle(X,()=>V.current,[]),I.createElement(Z_.Provider,{value:de},I.createElement("group",{ref:H},I.createElement("group",Ls({ref:V,matrix:e,matrixAutoUpdate:!1},z),I.createElement("group",{visible:N,ref:W,position:h,rotation:d},t&&I.createElement(I.Fragment,null,!o&&f[0]&&I.createElement(_D,{axis:0,direction:Cb}),!o&&f[1]&&I.createElement(_D,{axis:1,direction:Rb}),!o&&f[2]&&I.createElement(_D,{axis:2,direction:kb}),!l&&f[0]&&f[1]&&I.createElement(AD,{axis:2,dir1:Cb,dir2:Rb}),!l&&f[0]&&f[2]&&I.createElement(AD,{axis:1,dir1:kb,dir2:Cb}),!l&&f[2]&&f[1]&&I.createElement(AD,{axis:0,dir1:Rb,dir2:kb}),!c&&f[0]&&f[1]&&I.createElement(TD,{axis:2,dir1:Cb,dir2:Rb}),!c&&f[0]&&f[2]&&I.createElement(TD,{axis:1,dir1:kb,dir2:Cb}),!c&&f[2]&&f[1]&&I.createElement(TD,{axis:0,dir1:Rb,dir2:kb}),!u&&f[0]&&I.createElement(CD,{axis:0,direction:Cb}),!u&&f[1]&&I.createElement(CD,{axis:1,direction:Rb}),!u&&f[2]&&I.createElement(CD,{axis:2,direction:kb}))),I.createElement("group",{ref:B},j))))}),Si=Ee.createContext(null),WU={width:0,height:0,left:0,top:0,right:0,bottom:0,centerX:0,centerY:0,widthRatio:0,heightRatio:0,centerRatioX:0,centerRatioY:0},pQ=Ee.createContext(WU);function z6(t){return Number.isFinite(t)&&t>0?t:0}function xTe(t){const e=t.getBoundingClientRect(),n=z6(typeof window<"u"?window.innerWidth:e.width),i=z6(typeof window<"u"?window.innerHeight:e.height),r=n>0?e.width/n:0,a=i>0?e.height/i:0,s=n>0?(e.left+e.width/2)/n:0,o=i>0?(e.top+e.height/2)/i:0;return{width:e.width,height:e.height,left:e.left,top:e.top,right:e.right,bottom:e.bottom,centerX:e.left+e.width/2,centerY:e.top+e.height/2,widthRatio:r,heightRatio:a,centerRatioX:s,centerRatioY:o}}function _Te({targetRef:t,children:e}){const[n,i]=I.useState(WU),r=Ee.useContext(Si);I.useLayoutEffect(()=>{const s=t.current;if(!s)return;const o=()=>{i(xTe(s))};o();const l=new ResizeObserver(o);return l.observe(s),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{l.disconnect(),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[t]),I.useLayoutEffect(()=>{r&&(r.mutable.current.viewportMetrics=n)},[n,r]),I.useLayoutEffect(()=>{const s=t.current;s&&(s.style.setProperty("--viser-viewport-width-px",`${n.width}`),s.style.setProperty("--viser-viewport-height-px",`${n.height}`),s.style.setProperty("--viser-viewport-center-x-px",`${n.centerX}`),s.style.setProperty("--viser-viewport-center-y-px",`${n.centerY}`),s.style.setProperty("--viser-viewport-width-ratio",`${n.widthRatio}`),s.style.setProperty("--viser-viewport-height-ratio",`${n.heightRatio}`),s.style.setProperty("--viser-viewport-center-x-ratio",`${n.centerRatioX}`),s.style.setProperty("--viser-viewport-center-y-ratio",`${n.centerRatioY}`))},[n,t]);const a=I.useMemo(()=>n,[n]);return D.jsx(pQ.Provider,{value:a,children:e})}function STe(){return Ee.useContext(pQ)}/*!
 * hold-event
 * https://github.com/yomotsu/hold-event
 * (c) 2020 @yomotsu
 * Released under the MIT License.
 */var Es;(function(t){t.HOLD_START="holdStart",t.HOLD_END="holdEnd",t.HOLDING="holding"})(Es||(Es={}));class wTe{constructor(){this._listeners={}}addEventListener(e,n){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}removeEventListener(e,n){const r=this._listeners[e];if(r!==void 0){const a=r.indexOf(n);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,s=r.length;a<s;a++)r[a].call(this,e)}}}class ETe extends wTe{constructor(e){super(),this._enabled=!0,this._holding=!1,this._intervalId=-1,this._deltaTime=0,this._elapsedTime=0,this._lastTime=0,this._holdStart=n=>{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:Es.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:n}),this._holding=!0;const i=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(i,this.holdIntervalDelay):window.requestAnimationFrame(i);const r=performance.now();this._deltaTime=r-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:Es.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:n})};this._intervalId=this.holdIntervalDelay?window.setTimeout(i,this.holdIntervalDelay):window.requestAnimationFrame(i)},this._holdEnd=n=>{if(!this._enabled||!this._holding)return;const i=performance.now();this._deltaTime=i-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:Es.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:n}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}get holding(){return this._holding}}class ju extends ETe{constructor(e,n){if(typeof e!="string"){console.error("KeyboardKeyHold: the first argument has to be a KeyboardEvent.code string.");return}super(n),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const i=a=>{MTe(a)||a.code===e&&this._holdStart(a)},r=a=>{a.code===e&&this._holdEnd(a)};document.addEventListener("keydown",i),document.addEventListener("keyup",r),window.addEventListener("blur",this._holdEnd)}}function MTe(t){const e=t.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}function Qf(t){const e=t.useSceneTree.getState()[""],n=e?.wxyz??[1,0,0,0],i=e?.position??[0,0,0];return new Dt().makeRotationFromQuaternion(new Xn(n[1],n[2],n[3],n[0])).setPosition(i[0],i[1],i[2])}function mQ(t,e){const n=Qf(t).invert(),i=e.origin.clone().applyMatrix4(n),r=n.setPosition(0,0,0),a=e.direction.clone().applyMatrix4(r);return new xf(i,a)}function AC(t){const e=Ee.useContext(Si);return gQ(e,t)}function gQ(t,e){let n=!0,i=!1,r=null;function a(o){const l=t.mutable.current;l.sendMessage!==null&&(r=o,n?(l.sendMessage(o),i=!1,n=!1,setTimeout(()=>{n=!0,i&&r&&a(r)},e)):i=!0)}function s(){t.mutable.current.sendMessage!==null&&r!==null&&(t.mutable.current.sendMessage(r),r=null,i=!1)}return{send:a,flush:s}}function DD(t){return t!=null&&t.isTexture!==void 0}function TTe({visible:t,children:e}){const{camera:n}=ki(),i=I.useRef(null),r=new te;return la(()=>{if(i.current&&t){i.current.getWorldPosition(r);const a=n.position.distanceTo(r),s=Math.tan(n.fov*Math.PI/360);i.current.scale.setScalar(a/20*s)}}),D.jsxs("group",{ref:i,visible:t,children:[D.jsxs(fT,{limit:6,children:[D.jsx("boxGeometry",{args:[.4,.02,.02]}),D.jsx("meshBasicMaterial",{opacity:.625,transparent:!0}),D.jsx(cc,{position:[.5,0,0],color:"#777777"}),D.jsx(cc,{position:[-.5,0,0],color:"#777777"}),D.jsx(cc,{position:[0,0,.5],rotation:new vi(0,Math.PI/2,0),color:"#777777"}),D.jsx(cc,{position:[0,0,-.5],rotation:new vi(0,Math.PI/2,0),color:"#777777"}),D.jsx(cc,{position:[0,.5,0],rotation:new vi(0,0,Math.PI/2),color:"#999999"}),D.jsx(cc,{position:[0,-.5,0],rotation:new vi(0,0,Math.PI/2),color:"#999999"})]}),D.jsxs("mesh",{children:[D.jsx("sphereGeometry",{args:[.04,8,8]}),D.jsx("meshBasicMaterial",{color:"#999999",opacity:.625,transparent:!0})]}),e]})}function ATe({forceShow:t,pivotRef:e,onPivotChange:n,update:i,crosshairVisible:r}){const a=I.useContext(Si),s=a.useGui(c=>c.showOrbitOriginTool),o=a.useDevSettings(c=>c.enableOrbitCrosshair);Ee.useEffect(i,[s]);const l=s||t;return D.jsxs(dQ,{ref:e,scale:200,lineWidth:3,fixed:!0,axisColors:["#ffaaff","#ff33ff","#ffaaff"],disableScaling:!0,disableAxes:!l,disableRotations:!l,disableSliders:!l,onDragEnd:()=>{n(e.current.matrix)},children:[D.jsx(iQ,{args:[10,10,10,10],infiniteGrid:!0,fadeStrength:0,fadeFrom:0,fadeDistance:1e3,sectionColor:"#ffaaff",cellColor:"#ffccff",side:Jr,visible:l}),D.jsx(TTe,{visible:o&&r})]})}function CTe(){const t=I.useContext(Si),e=ki(V=>V.camera),n=STe(),i=AC(20).send,r=I.useRef(null),a=I.useRef(null),s=t.mutable.current,[o,l]=I.useState(0),[c,u]=I.useState(!1),f=o>0||c,[h,d]=I.useState(null),g=.5;la(V=>{if(h&&s.cameraControl){const W=s.cameraControl,B=W.camera,Y=V.clock.getElapsedTime()-h.startTime,Z=Math.min(Y/h.duration,1),G=Z*Z*(3-2*Z),de=new te().copy(h.startUp).lerp(h.targetUp,G).normalize(),oe=new te().copy(h.startLookAt).lerp(h.targetLookAt,G);B.up.copy(de);const le=new te;W.getPosition(le),W.updateCameraUp(),W.setPosition(le.x,le.y,le.z,!1),W.setLookAt(le.x,le.y,le.z,oe.x,oe.y,oe.z,!1),Z>=1&&d(null)}});const{clock:b}=ki(),y=V=>{if(!s.cameraControl)return;const W=new te;W.setFromMatrixPosition(V);const B=s.cameraControl,Y=s.cameraControl.camera,Z=new te().setFromMatrixColumn(V,1),G=B.getTarget(new te);d({startUp:Y.up.clone(),targetUp:Z,startLookAt:G,targetLookAt:W,startTime:b.getElapsedTime(),duration:g})},p=()=>{if(h!==null||!s.cameraControl||!a.current)return;const W=s.cameraControl.getTarget(new te),B=new Dt().extractRotation(a.current.matrix),Y=e.up.clone().normalize(),Z=new te(0,1,0).applyMatrix4(B).normalize(),G=new te().crossVectors(Z,Y).normalize(),de=Math.acos(Math.min(1,Math.max(-1,Y.dot(Z)))),oe=new Dt;G.lengthSq()>1e-4&&oe.makeRotationAxis(G,de);const le=new Dt;le.multiply(oe),le.multiply(B),le.setPosition(W),a.current.matrix.copy(le),a.current.updateMatrixWorld(!0)};s.resetCameraView=()=>{e.up.set(r.current.camera.up.x,r.current.camera.up.y,r.current.camera.up.z),s.cameraControl.updateCameraUp(),s.cameraControl.setLookAt(r.current.camera.position.x,r.current.camera.position.y,r.current.camera.position.z,r.current.lookAt.x,r.current.lookAt.y,r.current.lookAt.z,!0)};const x=new Xn().setFromEuler(new vi(Math.PI,0,0)),_=new Xn,w=new Dt,M=new te,S=new Xn,A=new te,C=new te,k=Ee.useCallback(()=>{p();const V=e,W=s.cameraControl,B=s.canvas;if(W===null){setTimeout(k,10);return}const Y=Qf(t).invert(),Z=Y.clone().multiply(w.makeRotationFromQuaternion(V.quaternion).setPosition(V.position)).multiply(w.makeRotationFromQuaternion(x));_.setFromRotationMatrix(Y),W.getTarget(M).applyQuaternion(_);const G=V.up.clone().applyQuaternion(_);r.current===null&&(r.current={camera:V.clone(),lookAt:W.getTarget(new te)}),Z.decompose(A,S,C),i({type:"ViewerCameraMessage",wxyz:[S.w,S.x,S.y,S.z],position:A.toArray(),image_height:B.height,image_width:B.width,fov:V.fov*Math.PI/180,near:V.near,far:V.far,look_at:[M.x,M.y,M.z],up_direction:[G.x,G.y,G.z]}),X&&console.log(`&initialCameraPosition=${A.x.toFixed(3)},${A.y.toFixed(3)},${A.z.toFixed(3)}&initialCameraLookAt=${M.x.toFixed(3)},${M.y.toFixed(3)},${M.z.toFixed(3)}&initialCameraUp=${G.x.toFixed(3)},${G.y.toFixed(3)},${G.z.toFixed(3)}`)},[e,i]),R=new URLSearchParams(window.location.search),N=R.get("initialCameraPosition"),P=R.get("initialCameraLookAt"),j=R.get("initialCameraUp"),z=R.get("forceOrbitOriginTool")==="1",X=t.useDevSettings(V=>V.logCamera),F=t.useGui(V=>V.websocketConnected),H=Ee.useRef(!1);return Ee.useEffect(()=>{if(!H.current){const V=new te(...N?N.split(",").map(Number):[3,3,3]);V.applyMatrix4(Qf(t));const W=new te(...P?P.split(",").map(Number):[0,0,0]);W.applyMatrix4(Qf(t));const B=new te(...j?j.split(",").map(Number):[0,0,1]);B.applyMatrix4(Qf(t)),B.normalize(),e.up.set(B.x,B.y,B.z),s.cameraControl.updateCameraUp(),s.cameraControl.setLookAt(V.x,V.y,V.z,W.x,W.y,W.z,!1),H.current=!0}s.sendCamera=k,F&&setTimeout(()=>k(),50)},[F,k]),Ee.useEffect(()=>{const V=t.mutable.current.cameraControl;if(!V)return;const W=V.getPosition(new te),B=V.getTarget(new te);V.setLookAt(W.x,W.y,W.z,B.x,B.y,B.z,!1),k()},[n.width,n.height,n.left,n.top,k]),Ee.useEffect(()=>{const V=s.cameraControl,W={w:new ju("KeyW",1e3/60),a:new ju("KeyA",1e3/60),s:new ju("KeyS",1e3/60),d:new ju("KeyD",1e3/60),q:new ju("KeyQ",1e3/60),e:new ju("KeyE",1e3/60),up:new ju("ArrowUp",1e3/60),down:new ju("ArrowDown",1e3/60),left:new ju("ArrowLeft",1e3/60),right:new ju("ArrowRight",1e3/60)};W.a.addEventListener(Es.HOLDING,B=>{V.truck(-.002*B?.deltaTime,0,!1)}),W.d.addEventListener(Es.HOLDING,B=>{V.truck(.002*B?.deltaTime,0,!1)}),W.w.addEventListener(Es.HOLDING,B=>{V.forward(.002*B?.deltaTime,!1)}),W.s.addEventListener(Es.HOLDING,B=>{V.forward(-.002*B?.deltaTime,!1)}),W.q.addEventListener(Es.HOLDING,B=>{V.elevate(-.002*B?.deltaTime,!1)}),W.e.addEventListener(Es.HOLDING,B=>{V.elevate(.002*B?.deltaTime,!1)}),W.left.addEventListener(Es.HOLDING,B=>{V.rotate(-.05*yc.DEG2RAD*B?.deltaTime,0,!0)}),W.right.addEventListener(Es.HOLDING,B=>{V.rotate(.05*yc.DEG2RAD*B?.deltaTime,0,!0)}),W.up.addEventListener(Es.HOLDING,B=>{V.rotate(0,-.05*yc.DEG2RAD*B?.deltaTime,!0)}),W.down.addEventListener(Es.HOLDING,B=>{V.rotate(0,.05*yc.DEG2RAD*B?.deltaTime,!0)});for(const B of Object.values(W))B.addEventListener(Es.HOLD_START,()=>{l(Y=>Y+1)}),B.addEventListener(Es.HOLD_END,()=>{l(Y=>Math.max(0,Y-1))});return()=>{}},[c6]),D.jsxs(D.Fragment,{children:[D.jsx(c6,{ref:V=>s.cameraControl=V,minDistance:.01,dollySpeed:.3,smoothTime:.05,draggingSmoothTime:0,onChange:k,onStart:()=>{u(!0)},onEnd:()=>{u(!1)},makeDefault:!0}),D.jsx(ATe,{forceShow:z,pivotRef:a,onPivotChange:V=>{y(V)},update:p,crosshairVisible:f})]})}const iy=Ee.createContext(null);function Q_(t,e){if(t===e)return!0;if(!t||!e)return t===e;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const XU=MC({screenspace:!1,color:new Ut("black"),opacity:1,thickness:.05,size:new wt},`#include <common>
   #include <morphtarget_pars_vertex>
   #include <skinning_pars_vertex>
   uniform float thickness;
   uniform float screenspace;
   uniform vec2 size;
   void main() {
     #if defined (USE_SKINNING)
	     #include <beginnormal_vertex>
       #include <morphnormal_vertex>
       #include <skinbase_vertex>
       #include <skinnormal_vertex>
       #include <defaultnormal_vertex>
     #endif
     #include <begin_vertex>
	   #include <morphtarget_vertex>
	   #include <skinning_vertex>
     #include <project_vertex>
     vec4 tNormal = vec4(normal, 0.0);
     vec4 tPosition = vec4(transformed, 1.0);
     #ifdef USE_INSTANCING
       tNormal = instanceMatrix * tNormal;
       tPosition = instanceMatrix * tPosition;
     #endif
     if (screenspace == 0.0) {
       vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness;
       gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);
     } else {
       vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition;
       vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal;
       vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0;
       clipPosition.xy += offset;
       gl_Position = clipPosition;
     }
   }`,`uniform vec3 color;
   uniform float opacity;
   void main(){
     gl_FragColor = vec4(color, opacity);
     #include <tonemapping_fragment>
     #include <${tQ>=154?"colorspace_fragment":"encodings_fragment"}>
   }`),RTe=I.forwardRef(function({color:e="black",opacity:n=1,transparent:i=!1,screenspace:r=!1,toneMapped:a=!0,polygonOffset:s=!1,polygonOffsetFactor:o=0,renderOrder:l=0,thickness:c=.05,angle:u=Math.PI,...f},h){const d=I.useRef(null),[g]=I.useState(()=>new XU({side:Da})),y=ki(_=>_.gl).getDrawingBufferSize(new wt),p=I.useRef(0),x=I.useRef();return I.useLayoutEffect(()=>{const _=d.current;if(!_)return;const w=_.parent;if(w&&w.geometry&&(p.current!==u||x.current!==w.geometry)){p.current=u,x.current=w.geometry;let M=_.children[0];M&&(u&&M.geometry.dispose(),_.remove(M)),w.skeleton?(M=new JA,M.material=g,M.bind(w.skeleton,w.bindMatrix),_.add(M)):w.isInstancedMesh?(M=new $A(w.geometry,g,w.count),M.instanceMatrix=w.instanceMatrix,_.add(M)):(M=new _i,M.material=g,_.add(M)),M.geometry=u?bEe(w.geometry,u):w.geometry}}),I.useLayoutEffect(()=>{const _=d.current;if(!_)return;const w=_.children[0];w&&(w.renderOrder=l,ou(w.material,{transparent:i,thickness:c,color:e,opacity:n,size:y,screenspace:r,toneMapped:a,polygonOffset:s,polygonOffsetFactor:o}))}),I.useEffect(()=>()=>{const _=d.current;if(!_)return;const w=_.children[0];w&&(u&&w.geometry.dispose(),_.remove(w))},[]),D.jsx("group",{ref:_=>{d.current=_,typeof h=="function"?h(_):h&&(h.current=_)},...f})});function eh(t={unmountOnHide:!1,enableCreaseAngle:!1}){const e=Ee.useContext(iy);return e===null||!e.clickable?null:D.jsx(kTe,{...t})}function kTe(t){const e=Ee.useRef(null),n=Ee.useContext(iy),[i,r]=Ee.useState(!0),a=t.enableCreaseAngle?Math.PI:0;return la(()=>{if(!(n===null||!n.clickable)){if(t.unmountOnHide){i!==n.state.current.isHovered&&r(n.state.current.isHovered);return}e.current!==null&&(e.current.visible=n.state.current.isHovered)}}),i?D.jsx(RTe,{ref:e,thickness:10,screenspace:!0,color:16514816,opacity:.8,transparent:!0,angle:a}):null}const Kl={instanceMatrix:new Dt,transformMatrix:new Dt,finalMatrix:new Dt,position:new te,quaternion:new Xn,scale:new te,oneVector:new te(1,1,1)},xM=({geometry:t,batched_positions:e,batched_wxyzs:n,batched_scales:i,meshTransform:r,computeBatchIndexFromInstanceIndex:a})=>{const s=Ee.useContext(iy),o=Ee.useRef(null),l=ki(h=>h.gl),c=Ee.useMemo(()=>l.getDrawingBufferSize(new wt),[l]),u=Ee.useMemo(()=>t?t.clone():null,[t]),f=Ee.useMemo(()=>{const h=new XU({side:Da});return h.thickness=10,h.color=new Ut(16514816),h.opacity=.8,h.size=c,h.transparent=!0,h.screenspace=!0,h.toneMapped=!0,h},[c]);return Ee.useEffect(()=>()=>{u&&u.dispose()},[u]),Ee.useEffect(()=>()=>{f&&f.dispose()},[f]),la(()=>{if(!(!o.current||!u||!s)&&(o.current.visible=!1,s.state.current.isHovered&&s.state.current.instanceId!==null)){const h=s.state.current.instanceId,d=a?a(h):h,g=new DataView(e.buffer,e.byteOffset,e.byteLength),b=new DataView(n.buffer,n.byteOffset,n.byteLength),y=i?new DataView(i.buffer,i.byteOffset,i.byteLength):null;if(d>=0&&d*12<e.byteLength){const p=d*3*4%e.byteLength,x=d*4*4%n.byteLength;if(o.current.position.set(g.getFloat32(p,!0),g.getFloat32(p+4,!0),g.getFloat32(p+8,!0)),o.current.quaternion.set(b.getFloat32(x+4,!0),b.getFloat32(x+8,!0),b.getFloat32(x+12,!0),b.getFloat32(x,!0)),y&&i)if(i.byteLength===n.byteLength/4*3){const _=d*3*4%i.byteLength;o.current.scale.set(y.getFloat32(_,!0),y.getFloat32(_+4,!0),y.getFloat32(_+8,!0))}else{const _=d*4%i.byteLength,w=y.getFloat32(_,!0);o.current.scale.setScalar(w)}else o.current.scale.set(1,1,1);r&&(Kl.instanceMatrix.compose(o.current.position,o.current.quaternion,o.current.scale),Kl.transformMatrix.compose(r.position,r.rotation,r.scale),Kl.finalMatrix.copy(Kl.instanceMatrix).multiply(Kl.transformMatrix),Kl.finalMatrix.decompose(Kl.position,Kl.quaternion,Kl.scale),o.current.position.copy(Kl.position),o.current.quaternion.copy(Kl.quaternion),o.current.scale.copy(Kl.scale)),o.current.visible=!0}}}),!s||!s.clickable||!u?null:D.jsx("mesh",{ref:o,geometry:u,material:f,visible:!1})},bQ=Ee.createContext(null),j6=16777215,H6=.85,V6=.2,G6=.2;function DTe(t,e){const n=t.material;return n?((Array.isArray(n)?n:[n]).forEach(r=>{r.depthTest=e,r.depthWrite=!1,r.transparent=!0,r.needsUpdate=!0}),t.renderOrder=1e4,!0):!1}function OTe(t,e,n,i){return t.updateMatrix(),t.updateWorldMatrix(!1,!1),t.getWorldQuaternion(n),e.getWorldQuaternion(i).premultiply(n.invert()),i}function MI(t,e,n){return t==="screen"?.3*e:n}function ITe(t,e,n){if("fov"in t&&typeof t.fov=="number"){n.copy(e),n.applyMatrix4(t.matrixWorldInverse);const i=-n.z,r=Math.tan(t.fov*Math.PI/360);return i/10*r}else return 1}const NTe=new Jv(1),LTe=MC({scale:1,point_ball_norm:0,uniformColor:new Ut(1,1,1)},`
  precision mediump float;

  varying vec3 vPosition;
  varying vec3 vColor; // in the vertex shader
  uniform float scale;
  uniform vec3 uniformColor;

  void main() {
      vPosition = position;
      #ifdef USE_COLOR
      vColor = color;
      #else
      vColor = uniformColor;
      #endif
      vec4 world_pos = modelViewMatrix * vec4(position, 1.0);
      gl_Position = projectionMatrix * world_pos;
      gl_PointSize = (scale / -world_pos.z);
  }
   `,`varying vec3 vPosition;
  varying vec3 vColor;
  uniform float point_ball_norm;

  void main() {
      if (point_ball_norm < 1000.0) {
          float r = pow(
              pow(abs(gl_PointCoord.x - 0.5), point_ball_norm)
              + pow(abs(gl_PointCoord.y - 0.5), point_ball_norm),
              1.0 / point_ball_norm);
          if (r > 0.5) discard;
      }
      gl_FragColor = vec4(vColor, 1.0);
  }
   `),PTe=Ee.forwardRef(function({children:e,...n},i){const r=ki(c=>c.get),a=n.props,s=Ee.useMemo(()=>{const c=new On;return n.props.precision==="float16"?c.setAttribute("position",new t$(new Uint16Array(a.points.buffer.slice(a.points.byteOffset,a.points.byteOffset+a.points.byteLength)),3)):c.setAttribute("position",new mn(new Float32Array(a.points.buffer.slice(a.points.byteOffset,a.points.byteOffset+a.points.byteLength)),3)),a.colors.length>3?c.setAttribute("color",new In(new Uint8Array(a.colors),3,!0)):a.colors.length<3&&console.error(`Invalid color buffer length, got ${a.colors.length}`),c},[a.points,a.colors]),o=Ee.useMemo(()=>{const c=new LTe;return a.colors.length>3?c.vertexColors=!0:(c.vertexColors=!1,c.uniforms.uniformColor.value=new Ut(a.colors[0]/255,a.colors[1]/255,a.colors[2]/255)),c},[a.colors]);Ee.useEffect(()=>()=>{s.dispose(),o.dispose()},[s,o]),Ee.useEffect(()=>{o.uniforms.scale.value=10,o.uniforms.point_ball_norm.value={square:1/0,diamond:1,circle:2,rounded:3,sparkle:.6}[a.point_shape]},[a.point_shape,o]);const l=new wt;return la(()=>{o.uniforms.scale.value=a.point_size/Math.tan(r().camera.fov/180*Math.PI/2)*r().gl.getSize(l).height*r().gl.getPixelRatio()}),D.jsx("points",{frustumCulled:!1,ref:i,geometry:s,material:o,children:e})}),UTe=Ee.forwardRef(function({showAxes:e=!0,axesLength:n=.5,axesRadius:i=.0125,originRadius:r=void 0,originColor:a=15526912,children:s},o){return r=r??i*2,D.jsxs("group",{ref:o,children:[e&&D.jsxs(D.Fragment,{children:[D.jsxs("mesh",{geometry:NTe,scale:new te(r,r,r),children:[D.jsx("meshBasicMaterial",{color:a}),D.jsx(eh,{})]}),D.jsxs(fT,{limit:6,children:[D.jsx("meshBasicMaterial",{}),D.jsx("cylinderGeometry",{args:[i,i,n,16]}),D.jsx(cc,{rotation:new vi(0,0,3*Math.PI/2),position:[.5*n,0,0],color:13369344,children:D.jsx(eh,{unmountOnHide:!0,enableCreaseAngle:!0})}),D.jsx(cc,{position:[0,.5*n,0],color:52224,children:D.jsx(eh,{unmountOnHide:!0,enableCreaseAngle:!0})}),D.jsx(cc,{rotation:new vi(Math.PI/2,0,0),position:[0,0,.5*n],color:204,children:D.jsx(eh,{unmountOnHide:!0,enableCreaseAngle:!0})})]})]}),s]})}),FTe=Ee.forwardRef(function({batched_wxyzs:e,batched_positions:n,batched_scales:i,axes_length:r=.5,axes_radius:a=.0125,children:s},o){const l=Ee.useRef(null),c=Ee.useMemo(()=>new qm(a,a,r,16),[a,r]),u=Ee.useMemo(()=>new Ds,[]);Ee.useEffect(()=>()=>{c.dispose(),u.dispose()},[c,u]);const f=Ee.useMemo(()=>({T_frame_framex:new Dt().makeRotationFromEuler(new vi(0,0,3*Math.PI/2)).setPosition(.5*r,0,0),T_frame_framey:new Dt().makeRotationFromEuler(new vi(0,0,0)).setPosition(0,.5*r,0),T_frame_framez:new Dt().makeRotationFromEuler(new vi(Math.PI/2,0,0)).setPosition(0,0,.5*r),red:new Ut(13369344),green:new Ut(52224),blue:new Ut(204)}),[r]);Ee.useEffect(()=>{if(!l.current)return;const p=new Dt,x=new Dt,_=new Dt,w=new Dt,M=new Xn,S=new te,{T_frame_framex:A,T_frame_framey:C,T_frame_framez:k,red:R,green:N,blue:P}=f,j=new DataView(n.buffer,n.byteOffset,n.byteLength),z=new DataView(e.buffer,e.byteOffset,e.byteLength),X=i?new DataView(i.buffer,i.byteOffset,i.byteLength):null,F=e.byteLength/(4*4);for(let H=0;H<F;H++){const V=H*3*4%n.byteLength,W=H*4*4%e.byteLength,B=i&&i.byteLength===e.byteLength/4*3?H*3*4%i.byteLength:H*4%(i?.byteLength??4);if(X&&i)if(i.byteLength===e.byteLength/4*3)S.set(X.getFloat32(B,!0),X.getFloat32(B+4,!0),X.getFloat32(B+8,!0));else{const Y=X.getFloat32(B,!0);S.set(Y,Y,Y)}else S.set(1,1,1);p.makeRotationFromQuaternion(M.set(z.getFloat32(W+4,!0),z.getFloat32(W+8,!0),z.getFloat32(W+12,!0),z.getFloat32(W,!0))).scale(S).setPosition(j.getFloat32(V,!0),j.getFloat32(V+4,!0),j.getFloat32(V+8,!0)),x.copy(p).multiply(A),_.copy(p).multiply(C),w.copy(p).multiply(k),l.current.setMatrixAt(H*3+0,x),l.current.setMatrixAt(H*3+1,_),l.current.setMatrixAt(H*3+2,w),l.current.setColorAt(H*3+0,R),l.current.setColorAt(H*3+1,N),l.current.setColorAt(H*3+2,P)}l.current.instanceMatrix.needsUpdate=!0,l.current.instanceColor.needsUpdate=!0},[e,n,i,f]);const h=Ee.useMemo(()=>new qm(a,a,r,16),[a,r]),d=Ee.useMemo(()=>({position:new te(.5*r,0,0),rotation:new Xn().setFromEuler(new vi(0,0,3*Math.PI/2)),scale:new te(1,1,1)}),[r]),g=Ee.useMemo(()=>({position:new te(0,.5*r,0),rotation:new Xn().setFromEuler(new vi(0,0,0)),scale:new te(1,1,1)}),[r]),b=Ee.useMemo(()=>({position:new te(0,0,.5*r),rotation:new Xn().setFromEuler(new vi(Math.PI/2,0,0)),scale:new te(1,1,1)}),[r]),y=e.byteLength/(4*4)*3;return D.jsxs("group",{ref:o,children:[D.jsx("instancedMesh",{ref:l,args:[c,u,y]}),D.jsx(xM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:d,computeBatchIndexFromInstanceIndex:p=>Math.floor(p/3)}),D.jsx(xM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:g,computeBatchIndexFromInstanceIndex:p=>Math.floor(p/3)}),D.jsx(xM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:b,computeBatchIndexFromInstanceIndex:p=>Math.floor(p/3)}),s]})}),BTe=Ee.forwardRef(function({children:e,...n},i){const[r,a]=Ee.useState();return Ee.useEffect(()=>{if(n.props._format!==null&&n.props._data!==null){const s=URL.createObjectURL(new Blob([n.props._data],{type:"image/"+n.props._format}));new hv().load(s,o=>{a(o),URL.revokeObjectURL(s)})}},[n.props._format,n.props._data]),D.jsxs("group",{ref:i,children:[D.jsxs("mesh",{rotation:new vi(Math.PI,0,0),castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[D.jsx(eh,{}),D.jsx("planeGeometry",{attach:"geometry",args:[n.props.render_width,n.props.render_height]}),D.jsx("meshBasicMaterial",{attach:"material",transparent:!0,side:Jr,map:r,toneMapped:!1})]}),e]})});function zTe(t){const[e,n]=t.split("-");return{anchorX:n==="left"?"left":n==="right"?"right":"center",anchorY:e==="top"?"top":e==="bottom"?"bottom":"middle"}}const jTe=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useContext(Si),a=Ee.useRef(null),s=Ee.useRef(null),o=Ee.useContext(bQ);if(!o)throw new Error("ViserLabel must be used within BatchedLabelManager context");const{anchorX:l,anchorY:c}=zTe(n.props.anchor),u=MI(n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height);return Ee.useEffect(()=>{const h=new d1;return h.text=n.props.text,h.font="./Inter-VariableFont_slnt,wght.ttf",h.fontSize=u,h.color=0,h.anchorX=l,h.anchorY=c,h.sdfGlyphSize=32,h.position.set(0,0,0),s.current=h,o.registerText(h,n.name,n.props.depth_test,n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height,l,c),()=>{o.unregisterText(h),h.dispose()}},[]),Ee.useEffect(()=>{s.current&&(s.current.text=n.props.text,o.syncText(s.current))},[n.props.text,o]),Ee.useEffect(()=>{s.current&&o.updateText(s.current,n.props.depth_test,n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height,l,c)},[n.props.depth_test,n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height,l,c,o]),Ee.useImperativeHandle(i,()=>a.current,[]),r.useSceneTree(h=>{const d=h[n.name];return d?.children&&d.children.length>0})?D.jsx("group",{ref:a,children:e}):null});function vQ(t){return t[0]<<16|t[1]<<8|t[2]}function W6(t){const e=new cs(Uint8Array.from(t===3?[0,128,255]:[0,64,128,192,255]),t,1,Th);return e.needsUpdate=!0,e}function HTe(t){throw new Error(`Should never get here! ${t}`)}function X6(t){"map"in t&&t.map?.dispose(),"lightMap"in t&&t.lightMap?.dispose(),"bumpMap"in t&&t.bumpMap?.dispose(),"normalMap"in t&&t.normalMap?.dispose(),"specularMap"in t&&t.specularMap?.dispose(),"envMap"in t&&t.envMap?.dispose(),"alphaMap"in t&&t.alphaMap?.dispose(),"aoMap"in t&&t.aoMap?.dispose(),"displacementMap"in t&&t.displacementMap?.dispose(),"emissiveMap"in t&&t.emissiveMap?.dispose(),"gradientMap"in t&&t.gradientMap?.dispose(),"metalnessMap"in t&&t.metalnessMap?.dispose(),"roughnessMap"in t&&t.roughnessMap?.dispose(),t.dispose()}function eS(t){const e={color:t.color===void 0?16777215:vQ(t.color),wireframe:t.wireframe,transparent:t.opacity!==null,opacity:t.opacity??1,side:{front:_u,back:Da,double:Jr}[t.side]};return t.material=="standard"||t.wireframe?new $v({flatShading:t.flat_shading&&!t.wireframe,...e}):t.material=="toon3"?new iT({gradientMap:W6(3),...e}):t.material=="toon5"?new iT({gradientMap:W6(5),...e}):HTe(t.material)}const VTe=Ee.forwardRef(function({children:e,...n},i){const[r,a]=Ee.useState();Ee.useEffect(()=>{if(n.props._format!==null&&n.props._image_data!==null){const y=URL.createObjectURL(new Blob([n.props._image_data],{type:"image/"+n.props._format}));new hv().load(y,p=>{a(p),URL.revokeObjectURL(y)})}else a(void 0)},[n.props._format,n.props._image_data]);let s=Math.tan(n.props.fov/2),o=s*n.props.aspect,l=1;const c=Math.cbrt(o*s*l/3);o/=c,s/=c,l/=c,o*=n.props.scale,s*=n.props.scale,l*=n.props.scale;const u=Ee.useContext(iy),[f,h]=Ee.useState(!1);la(()=>{u!==null&&u.state.current.isHovered!==f&&h(u.state.current.isHovered)});const d=[[-1,-1,1],[1,-1,1],[1,-1,1],[1,1,1],[1,1,1],[-1,1,1],[-1,1,1],[-1,-1,1],[-1,-1,1],[0,0,0],[0,0,0],[1,-1,1],[-1,1,1],[0,0,0],[0,0,0],[1,1,1],[0,-1.2,1],r===void 0?[0,-.9,1]:[0,-1,1]].map(y=>[y[0]*o,y[1]*s,y[2]*l]),g=Ee.useMemo(()=>{if(n.props.variant!=="filled")return null;const y=new On,p=new Float32Array([0,0,0,-o,-s,l,o,-s,l,o,s,l,-o,s,l]),x=new Uint16Array([0,1,2,0,2,3,0,3,4,0,4,1,1,4,3,1,3,2]);return y.setAttribute("position",new In(p,3)),y.setIndex(new In(x,1)),y.computeVertexNormals(),y},[o,s,l,n.props.variant]),b=new Ut().setRGB(n.props.color[0]/255,n.props.color[1]/255,n.props.color[2]/255);return D.jsxs("group",{ref:i,children:[D.jsx(Qm,{points:d,color:f?16514816:vQ(n.props.color),lineWidth:f?1.5*n.props.line_width:n.props.line_width,segments:!0}),n.props.variant==="filled"&&g&&D.jsx("mesh",{geometry:g,children:D.jsx("meshBasicMaterial",{color:f?16514816:b,transparent:!0,opacity:.3,side:Jr,depthWrite:!1})}),r&&D.jsxs("mesh",{position:[0,0,l*.999999],rotation:new vi(Math.PI,0,0),castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[D.jsx("planeGeometry",{attach:"geometry",args:[n.props.aspect*s*2,s*2]}),D.jsx("meshBasicMaterial",{attach:"material",transparent:!0,side:Jr,map:r,toneMapped:!1})]}),e]})});var GTe=(()=>{var t=import.meta.url;return async function(e={}){var n,i=e,r,a,s=new Promise((ne,ie)=>{r=ne,a=ie}),o=typeof window=="object",l=typeof importScripts=="function",c=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(c){const{createRequire:ne}=await I2e(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]);var u=ne(import.meta.url)}var f=Object.assign({},i),h="";function d(ne){return i.locateFile?i.locateFile(ne,h):h+ne}var g,b,y;if(c){var p=u("fs"),x=u("path");h=u("url").fileURLToPath(new URL("./",import.meta.url)),g=(ne,ie)=>(ne=He(ne)?new URL(ne):x.normalize(ne),p.readFileSync(ne,ie?void 0:"utf8")),y=ne=>{var ie=g(ne,!0);return ie.buffer||(ie=new Uint8Array(ie)),ie},b=(ne,ie,De,Ke=!0)=>{ne=He(ne)?new URL(ne):x.normalize(ne),p.readFile(ne,Ke?void 0:"utf8",(xt,Ot)=>{xt?De(xt):ie(Ke?Ot.buffer:Ot)})},!i.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else(o||l)&&(l?h=self.location.href:typeof document<"u"&&document.currentScript&&(h=document.currentScript.src),t&&(h=t),h.startsWith("blob:")?h="":h=h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1),g=ne=>{var ie=new XMLHttpRequest;return ie.open("GET",ne,!1),ie.send(null),ie.responseText},l&&(y=ne=>{var ie=new XMLHttpRequest;return ie.open("GET",ne,!1),ie.responseType="arraybuffer",ie.send(null),new Uint8Array(ie.response)}),b=(ne,ie,De)=>{if(He(ne)){var Ke=new XMLHttpRequest;Ke.open("GET",ne,!0),Ke.responseType="arraybuffer",Ke.onload=()=>{if(Ke.status==200||Ke.status==0&&Ke.response){ie(Ke.response);return}De()},Ke.onerror=De,Ke.send(null);return}fetch(ne,{credentials:"same-origin"}).then(xt=>xt.ok?xt.arrayBuffer():Promise.reject(new Error(xt.status+" : "+xt.url))).then(ie,De)});i.print||console.log.bind(console);var _=i.printErr||console.error.bind(console);Object.assign(i,f),f=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit;var w;i.wasmBinary&&(w=i.wasmBinary);var M,S=!1,A,C,k,R,N,P,j,z;function X(){var ne=M.buffer;i.HEAP8=A=new Int8Array(ne),i.HEAP16=k=new Int16Array(ne),i.HEAPU8=C=new Uint8Array(ne),i.HEAPU16=R=new Uint16Array(ne),i.HEAP32=N=new Int32Array(ne),i.HEAPU32=P=new Uint32Array(ne),i.HEAPF32=j=new Float32Array(ne),i.HEAPF64=z=new Float64Array(ne)}var F=[],H=[],V=[];function W(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Z(i.preRun.shift());Fe(F)}function B(){Fe(H)}function Y(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)de(i.postRun.shift());Fe(V)}function Z(ne){F.unshift(ne)}function G(ne){H.unshift(ne)}function de(ne){V.unshift(ne)}var oe=0,le=null;function ue(ne){oe++,i.monitorRunDependencies?.(oe)}function Se(ne){if(oe--,i.monitorRunDependencies?.(oe),oe==0&&le){var ie=le;le=null,ie()}}function Te(ne){i.onAbort?.(ne),ne="Aborted("+ne+")",_(ne),S=!0,ne+=". Build with -sASSERTIONS for more info.";var ie=new WebAssembly.RuntimeError(ne);throw a(ie),ie}var Pe="data:application/octet-stream;base64,",je=ne=>ne.startsWith(Pe),He=ne=>ne.startsWith("file://");function pe(){if(i.locateFile){var ne="Sorter.wasm";return je(ne)?ne:d(ne)}return new URL("/assets/Sorter-Df0J3ZWJ.wasm",import.meta.url).href}var ze;function Ie(ne){if(ne==ze&&w)return new Uint8Array(w);if(y)return y(ne);throw"both async and sync fetching of the wasm failed"}function Xe(ne){return w?Promise.resolve().then(()=>Ie(ne)):new Promise((ie,De)=>{b(ne,Ke=>ie(new Uint8Array(Ke)),Ke=>{try{ie(Ie(ne))}catch(xt){De(xt)}})})}function we(ne,ie,De){return Xe(ne).then(Ke=>WebAssembly.instantiate(Ke,ie)).then(De,Ke=>{_(`failed to asynchronously prepare wasm: ${Ke}`),Te(Ke)})}function Ae(ne,ie,De,Ke){return!ne&&typeof WebAssembly.instantiateStreaming=="function"&&!je(ie)&&!He(ie)&&!c&&typeof fetch=="function"?fetch(ie,{credentials:"same-origin"}).then(xt=>{var Ot=WebAssembly.instantiateStreaming(xt,De);return Ot.then(Ke,function(Vt){return _(`wasm streaming compile failed: ${Vt}`),_("falling back to ArrayBuffer instantiation"),we(ie,De,Ke)})}):we(ie,De,Ke)}function Re(){return{a:Sf}}function Ne(){var ne=Re();function ie(Ke,xt){return oo=Ke.exports,M=oo.z,X(),Dn=oo.C,G(oo.A),Se(),oo}ue();function De(Ke){ie(Ke.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(ne,ie)}catch(Ke){_(`Module.instantiateWasm callback failed with error: ${Ke}`),a(Ke)}return ze||(ze=pe()),Ae(w,ze,ne,De).catch(a),{}}var Fe=ne=>{for(;ne.length>0;)ne.shift()(i)};i.noExitRuntime;class Qe{constructor(ie){this.excPtr=ie,this.ptr=ie-24}set_type(ie){P[this.ptr+4>>2]=ie}get_type(){return P[this.ptr+4>>2]}set_destructor(ie){P[this.ptr+8>>2]=ie}get_destructor(){return P[this.ptr+8>>2]}set_caught(ie){ie=ie?1:0,A[this.ptr+12]=ie}get_caught(){return A[this.ptr+12]!=0}set_rethrown(ie){ie=ie?1:0,A[this.ptr+13]=ie}get_rethrown(){return A[this.ptr+13]!=0}init(ie,De){this.set_adjusted_ptr(0),this.set_type(ie),this.set_destructor(De)}set_adjusted_ptr(ie){P[this.ptr+16>>2]=ie}get_adjusted_ptr(){return P[this.ptr+16>>2]}get_exception_ptr(){var ie=lo(this.get_type());if(ie)return P[this.excPtr>>2];var De=this.get_adjusted_ptr();return De!==0?De:this.excPtr}}var ae=0,K=(ne,ie,De)=>{var Ke=new Qe(ne);throw Ke.init(ie,De),ae=ne,ae},ce=()=>{Te("")},he=(ne,ie,De,Ke,xt)=>{},me=()=>{for(var ne=new Array(256),ie=0;ie<256;++ie)ne[ie]=String.fromCharCode(ie);$=ne},$,Ve=ne=>{for(var ie="",De=ne;C[De];)ie+=$[C[De++]];return ie},qe={},mt={},Ge={},Je,Ye=ne=>{throw new Je(ne)},vt,Mt=ne=>{throw new vt(ne)},gt=(ne,ie,De)=>{ne.forEach(function(Tt){Ge[Tt]=ie});function Ke(Tt){var Bt=De(Tt);Bt.length!==ne.length&&Mt("Mismatched type converter count");for(var rn=0;rn<ne.length;++rn)ke(ne[rn],Bt[rn])}var xt=new Array(ie.length),Ot=[],Vt=0;ie.forEach((Tt,Bt)=>{mt.hasOwnProperty(Tt)?xt[Bt]=mt[Tt]:(Ot.push(Tt),qe.hasOwnProperty(Tt)||(qe[Tt]=[]),qe[Tt].push(()=>{xt[Bt]=mt[Tt],++Vt,Vt===Ot.length&&Ke(xt)}))}),Ot.length===0&&Ke(xt)};function kt(ne,ie,De={}){var Ke=ie.name;if(ne||Ye(`type "${Ke}" must have a positive integer typeid pointer`),mt.hasOwnProperty(ne)){if(De.ignoreDuplicateRegistrations)return;Ye(`Cannot register type '${Ke}' twice`)}if(mt[ne]=ie,delete Ge[ne],qe.hasOwnProperty(ne)){var xt=qe[ne];delete qe[ne],xt.forEach(Ot=>Ot())}}function ke(ne,ie,De={}){if(!("argPackAdvance"in ie))throw new TypeError("registerType registeredInstance requires argPackAdvance");return kt(ne,ie,De)}var Le=8,ht=(ne,ie,De,Ke)=>{ie=Ve(ie),ke(ne,{name:ie,fromWireType:function(xt){return!!xt},toWireType:function(xt,Ot){return Ot?De:Ke},argPackAdvance:Le,readValueFromPointer:function(xt){return this.fromWireType(C[xt])},destructorFunction:null})},jt=ne=>({count:ne.count,deleteScheduled:ne.deleteScheduled,preservePointerOnDelete:ne.preservePointerOnDelete,ptr:ne.ptr,ptrType:ne.ptrType,smartPtr:ne.smartPtr,smartPtrType:ne.smartPtrType}),ot=ne=>{function ie(De){return De.$$.ptrType.registeredClass.name}Ye(ie(ne)+" instance already deleted")},it=!1,bt=ne=>{},Jt=ne=>{ne.smartPtr?ne.smartPtrType.rawDestructor(ne.smartPtr):ne.ptrType.registeredClass.rawDestructor(ne.ptr)},Kt=ne=>{ne.count.value-=1;var ie=ne.count.value===0;ie&&Jt(ne)},un=(ne,ie,De)=>{if(ie===De)return ne;if(De.baseClass===void 0)return null;var Ke=un(ne,ie,De.baseClass);return Ke===null?null:De.downcast(Ke)},Vn={},vn=()=>Object.keys(on).length,Qn=()=>{var ne=[];for(var ie in on)on.hasOwnProperty(ie)&&ne.push(on[ie]);return ne},Yn=[],xi=()=>{for(;Yn.length;){var ne=Yn.pop();ne.$$.deleteScheduled=!1,ne.delete()}},qn,Ji=ne=>{qn=ne,Yn.length&&qn&&qn(xi)},hi=()=>{i.getInheritedInstanceCount=vn,i.getLiveInheritedInstances=Qn,i.flushPendingDeletes=xi,i.setDelayFunction=Ji},on={},Ii=(ne,ie)=>{for(ie===void 0&&Ye("ptr should not be undefined");ne.baseClass;)ie=ne.upcast(ie),ne=ne.baseClass;return ie},ri=(ne,ie)=>(ie=Ii(ne,ie),on[ie]),se=(ne,ie)=>{(!ie.ptrType||!ie.ptr)&&Mt("makeClassHandle requires ptr and ptrType");var De=!!ie.smartPtrType,Ke=!!ie.smartPtr;return De!==Ke&&Mt("Both smartPtrType and smartPtr must be specified"),ie.count={value:1},Ue(Object.create(ne,{$$:{value:ie,writable:!0}}))};function ge(ne){var ie=this.getPointee(ne);if(!ie)return this.destructor(ne),null;var De=ri(this.registeredClass,ie);if(De!==void 0){if(De.$$.count.value===0)return De.$$.ptr=ie,De.$$.smartPtr=ne,De.clone();var Ke=De.clone();return this.destructor(ne),Ke}function xt(){return this.isSmartPointer?se(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:ie,smartPtrType:this,smartPtr:ne}):se(this.registeredClass.instancePrototype,{ptrType:this,ptr:ne})}var Ot=this.registeredClass.getActualType(ie),Vt=Vn[Ot];if(!Vt)return xt.call(this);var Tt;this.isConst?Tt=Vt.constPointerType:Tt=Vt.pointerType;var Bt=un(ie,this.registeredClass,Tt.registeredClass);return Bt===null?xt.call(this):this.isSmartPointer?se(Tt.registeredClass.instancePrototype,{ptrType:Tt,ptr:Bt,smartPtrType:this,smartPtr:ne}):se(Tt.registeredClass.instancePrototype,{ptrType:Tt,ptr:Bt})}var Ue=ne=>typeof FinalizationRegistry>"u"?(Ue=ie=>ie,ne):(it=new FinalizationRegistry(ie=>{Kt(ie.$$)}),Ue=ie=>{var De=ie.$$,Ke=!!De.smartPtr;if(Ke){var xt={$$:De};it.register(ie,xt,ie)}return ie},bt=ie=>it.unregister(ie),Ue(ne)),rt=()=>{Object.assign(dt.prototype,{isAliasOf(ne){if(!(this instanceof dt)||!(ne instanceof dt))return!1;var ie=this.$$.ptrType.registeredClass,De=this.$$.ptr;ne.$$=ne.$$;for(var Ke=ne.$$.ptrType.registeredClass,xt=ne.$$.ptr;ie.baseClass;)De=ie.upcast(De),ie=ie.baseClass;for(;Ke.baseClass;)xt=Ke.upcast(xt),Ke=Ke.baseClass;return ie===Ke&&De===xt},clone(){if(this.$$.ptr||ot(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var ne=Ue(Object.create(Object.getPrototypeOf(this),{$$:{value:jt(this.$$)}}));return ne.$$.count.value+=1,ne.$$.deleteScheduled=!1,ne},delete(){this.$$.ptr||ot(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ye("Object already scheduled for deletion"),bt(this),Kt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||ot(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ye("Object already scheduled for deletion"),Yn.push(this),Yn.length===1&&qn&&qn(xi),this.$$.deleteScheduled=!0,this}})};function dt(){}var lt=(ne,ie)=>Object.defineProperty(ie,"name",{value:ne}),At=(ne,ie,De)=>{if(ne[ie].overloadTable===void 0){var Ke=ne[ie];ne[ie]=function(...xt){return ne[ie].overloadTable.hasOwnProperty(xt.length)||Ye(`Function '${De}' called with an invalid number of arguments (${xt.length}) - expects one of (${ne[ie].overloadTable})!`),ne[ie].overloadTable[xt.length].apply(this,xt)},ne[ie].overloadTable=[],ne[ie].overloadTable[Ke.argCount]=Ke}},ee=(ne,ie,De)=>{i.hasOwnProperty(ne)?(Ye(`Cannot register public name '${ne}' twice`),At(i,ne,ne),i.hasOwnProperty(De)&&Ye(`Cannot register multiple overloads of a function with the same number of arguments (${De})!`),i[ne].overloadTable[De]=ie):i[ne]=ie},xe=48,Ce=57,Oe=ne=>{if(ne===void 0)return"_unknown";ne=ne.replace(/[^a-zA-Z0-9_]/g,"$");var ie=ne.charCodeAt(0);return ie>=xe&&ie<=Ce?`_${ne}`:ne};function ve(ne,ie,De,Ke,xt,Ot,Vt,Tt){this.name=ne,this.constructor=ie,this.instancePrototype=De,this.rawDestructor=Ke,this.baseClass=xt,this.getActualType=Ot,this.upcast=Vt,this.downcast=Tt,this.pureVirtualFunctions=[]}var _t=(ne,ie,De)=>{for(;ie!==De;)ie.upcast||Ye(`Expected null or instance of ${De.name}, got an instance of ${ie.name}`),ne=ie.upcast(ne),ie=ie.baseClass;return ne};function ft(ne,ie){if(ie===null)return this.isReference&&Ye(`null is not a valid ${this.name}`),0;ie.$$||Ye(`Cannot pass "${js(ie)}" as a ${this.name}`),ie.$$.ptr||Ye(`Cannot pass deleted object as a pointer of type ${this.name}`);var De=ie.$$.ptrType.registeredClass,Ke=_t(ie.$$.ptr,De,this.registeredClass);return Ke}function yt(ne,ie){var De;if(ie===null)return this.isReference&&Ye(`null is not a valid ${this.name}`),this.isSmartPointer?(De=this.rawConstructor(),ne!==null&&ne.push(this.rawDestructor,De),De):0;(!ie||!ie.$$)&&Ye(`Cannot pass "${js(ie)}" as a ${this.name}`),ie.$$.ptr||Ye(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&ie.$$.ptrType.isConst&&Ye(`Cannot convert argument of type ${ie.$$.smartPtrType?ie.$$.smartPtrType.name:ie.$$.ptrType.name} to parameter type ${this.name}`);var Ke=ie.$$.ptrType.registeredClass;if(De=_t(ie.$$.ptr,Ke,this.registeredClass),this.isSmartPointer)switch(ie.$$.smartPtr===void 0&&Ye("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:ie.$$.smartPtrType===this?De=ie.$$.smartPtr:Ye(`Cannot convert argument of type ${ie.$$.smartPtrType?ie.$$.smartPtrType.name:ie.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:De=ie.$$.smartPtr;break;case 2:if(ie.$$.smartPtrType===this)De=ie.$$.smartPtr;else{var xt=ie.clone();De=this.rawShare(De,$i.toHandle(()=>xt.delete())),ne!==null&&ne.push(this.rawDestructor,De)}break;default:Ye("Unsupporting sharing policy")}return De}function St(ne,ie){if(ie===null)return this.isReference&&Ye(`null is not a valid ${this.name}`),0;ie.$$||Ye(`Cannot pass "${js(ie)}" as a ${this.name}`),ie.$$.ptr||Ye(`Cannot pass deleted object as a pointer of type ${this.name}`),ie.$$.ptrType.isConst&&Ye(`Cannot convert argument of type ${ie.$$.ptrType.name} to parameter type ${this.name}`);var De=ie.$$.ptrType.registeredClass,Ke=_t(ie.$$.ptr,De,this.registeredClass);return Ke}function Nt(ne){return this.fromWireType(P[ne>>2])}var Xt=()=>{Object.assign(at.prototype,{getPointee(ne){return this.rawGetPointee&&(ne=this.rawGetPointee(ne)),ne},destructor(ne){this.rawDestructor?.(ne)},argPackAdvance:Le,readValueFromPointer:Nt,fromWireType:ge})};function at(ne,ie,De,Ke,xt,Ot,Vt,Tt,Bt,rn,ln){this.name=ne,this.registeredClass=ie,this.isReference=De,this.isConst=Ke,this.isSmartPointer=xt,this.pointeeType=Ot,this.sharingPolicy=Vt,this.rawGetPointee=Tt,this.rawConstructor=Bt,this.rawShare=rn,this.rawDestructor=ln,!xt&&ie.baseClass===void 0?Ke?(this.toWireType=ft,this.destructorFunction=null):(this.toWireType=St,this.destructorFunction=null):this.toWireType=yt}var nn=(ne,ie,De)=>{i.hasOwnProperty(ne)||Mt("Replacing nonexistent public symbol"),i[ne].overloadTable!==void 0&&De!==void 0||(i[ne]=ie,i[ne].argCount=De)},pn=(ne,ie,De)=>{ne=ne.replace(/p/g,"i");var Ke=i["dynCall_"+ne];return Ke(ie,...De)},dn=[],Dn,$t=ne=>{var ie=dn[ne];return ie||(ne>=dn.length&&(dn.length=ne+1),dn[ne]=ie=Dn.get(ne)),ie},Yt=(ne,ie,De=[])=>{if(ne.includes("j"))return pn(ne,ie,De);var Ke=$t(ie)(...De);return Ke},Un=(ne,ie)=>(...De)=>Yt(ne,ie,De),xn=(ne,ie)=>{ne=Ve(ne);function De(){return ne.includes("j")?Un(ne,ie):$t(ie)}var Ke=De();return typeof Ke!="function"&&Ye(`unknown function pointer with signature ${ne}: ${ie}`),Ke},Zn=(ne,ie)=>{var De=lt(ie,function(Ke){this.name=ie,this.message=Ke;var xt=new Error(Ke).stack;xt!==void 0&&(this.stack=this.toString()+`
`+xt.replace(/^Error(:[^\n]*)?\n/,""))});return De.prototype=Object.create(ne.prototype),De.prototype.constructor=De,De.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},De},Nn,An=ne=>{var ie=$o(ne),De=Ve(ie);return Ka(ie),De},Sn=(ne,ie)=>{var De=[],Ke={};function xt(Ot){if(!Ke[Ot]&&!mt[Ot]){if(Ge[Ot]){Ge[Ot].forEach(xt);return}De.push(Ot),Ke[Ot]=!0}}throw ie.forEach(xt),new Nn(`${ne}: `+De.map(An).join([", "]))},an=(ne,ie,De,Ke,xt,Ot,Vt,Tt,Bt,rn,ln,Jn,Ln)=>{ln=Ve(ln),Ot=xn(xt,Ot),Tt&&=xn(Vt,Tt),rn&&=xn(Bt,rn),Ln=xn(Jn,Ln);var na=Oe(ln);ee(na,function(){Sn(`Cannot construct ${ln} due to unbound types`,[Ke])}),gt([ne,ie,De],Ke?[Ke]:[],si=>{si=si[0];var zc,Fr;Ke?(zc=si.registeredClass,Fr=zc.instancePrototype):Fr=dt.prototype;var Zo=lt(ln,function(..._e){if(Object.getPrototypeOf(this)!==wf)throw new Je("Use 'new' to construct "+ln);if(co.constructor_body===void 0)throw new Je(ln+" has no accessible constructor");var Me=co.constructor_body[_e.length];if(Me===void 0)throw new Je(`Tried to invoke ctor of ${ln} with invalid number of parameters (${_e.length}) - expected (${Object.keys(co.constructor_body).toString()}) parameters instead!`);return Me.apply(this,_e)}),wf=Object.create(Fr,{constructor:{value:Zo}});Zo.prototype=wf;var co=new ve(ln,Zo,wf,Ln,zc,Ot,Tt,rn);co.baseClass&&(co.baseClass.__derivedClasses??=[],co.baseClass.__derivedClasses.push(co));var Dh=new at(ln,co,!0,!1,!1),Q=new at(ln+"*",co,!1,!1,!1),fe=new at(ln+" const*",co,!1,!0,!1);return Vn[ne]={pointerType:Q,constPointerType:fe},nn(na,Zo),[Dh,Q,fe]})},di=(ne,ie)=>{for(var De=[],Ke=0;Ke<ne;Ke++)De.push(P[ie+Ke*4>>2]);return De},Li=ne=>{for(;ne.length;){var ie=ne.pop(),De=ne.pop();De(ie)}};function Gn(ne){for(var ie=1;ie<ne.length;++ie)if(ne[ie]!==null&&ne[ie].destructorFunction===void 0)return!0;return!1}function wi(ne,ie){if(!(ne instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof ne} which is not a function`);var De=lt(ne.name||"unknownFunctionName",function(){});De.prototype=ne.prototype;var Ke=new De,xt=ne.apply(Ke,ie);return xt instanceof Object?xt:Ke}function Sa(ne,ie,De,Ke){for(var xt=Gn(ne),Ot=ne.length,Vt="",Tt="",Bt=0;Bt<Ot-2;++Bt)Vt+=(Bt!==0?", ":"")+"arg"+Bt,Tt+=(Bt!==0?", ":"")+"arg"+Bt+"Wired";var rn=`
        return function (${Vt}) {
        if (arguments.length !== ${Ot-2}) {
          throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${Ot-2}');
        }`;xt&&(rn+=`var destructors = [];
`);var ln=xt?"destructors":"null",Jn=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];ie&&(rn+="var thisWired = classParam['toWireType']("+ln+`, this);
`);for(var Bt=0;Bt<Ot-2;++Bt)rn+="var arg"+Bt+"Wired = argType"+Bt+"['toWireType']("+ln+", arg"+Bt+`);
`,Jn.push("argType"+Bt);if(ie&&(Tt="thisWired"+(Tt.length>0?", ":"")+Tt),rn+=(De||Ke?"var rv = ":"")+"invoker(fn"+(Tt.length>0?", ":"")+Tt+`);
`,xt)rn+=`runDestructors(destructors);
`;else for(var Bt=ie?1:2;Bt<ne.length;++Bt){var Ln=Bt===1?"thisWired":"arg"+(Bt-2)+"Wired";ne[Bt].destructorFunction!==null&&(rn+=`${Ln}_dtor(${Ln});
`,Jn.push(`${Ln}_dtor`))}return De&&(rn+=`var ret = retType['fromWireType'](rv);
return ret;
`),rn+=`}
`,[Jn,rn]}function Gi(ne,ie,De,Ke,xt,Ot){var Vt=ie.length;Vt<2&&Ye("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var Tt=ie[1]!==null&&De!==null,Bt=Gn(ie),rn=ie[0].name!=="void",ln=[ne,Ye,Ke,xt,Li,ie[0],ie[1]],Jn=0;Jn<Vt-2;++Jn)ln.push(ie[Jn+2]);if(!Bt)for(var Jn=Tt?1:2;Jn<ie.length;++Jn)ie[Jn].destructorFunction!==null&&ln.push(ie[Jn].destructorFunction);let[Ln,na]=Sa(ie,Tt,rn,Ot);Ln.push(na);var si=wi(Function,Ln)(...ln);return lt(ne,si)}var Yo=(ne,ie,De,Ke,xt,Ot)=>{var Vt=di(ie,De);xt=xn(Ke,xt),gt([],[ne],Tt=>{Tt=Tt[0];var Bt=`constructor ${Tt.name}`;if(Tt.registeredClass.constructor_body===void 0&&(Tt.registeredClass.constructor_body=[]),Tt.registeredClass.constructor_body[ie-1]!==void 0)throw new Je(`Cannot register multiple constructors with identical number of parameters (${ie-1}) for class '${Tt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Tt.registeredClass.constructor_body[ie-1]=()=>{Sn(`Cannot construct ${Tt.name} due to unbound types`,Vt)},gt([],Vt,rn=>(rn.splice(1,0,null),Tt.registeredClass.constructor_body[ie-1]=Gi(Bt,rn,null,xt,Ot),[])),[]})},Bs=ne=>{ne=ne.trim();const ie=ne.indexOf("(");return ie!==-1?ne.substr(0,ie):ne},ko=(ne,ie,De,Ke,xt,Ot,Vt,Tt,Bt)=>{var rn=di(De,Ke);ie=Ve(ie),ie=Bs(ie),Ot=xn(xt,Ot),gt([],[ne],ln=>{ln=ln[0];var Jn=`${ln.name}.${ie}`;ie.startsWith("@@")&&(ie=Symbol[ie.substring(2)]),Tt&&ln.registeredClass.pureVirtualFunctions.push(ie);function Ln(){Sn(`Cannot call ${Jn} due to unbound types`,rn)}var na=ln.registeredClass.instancePrototype,si=na[ie];return si===void 0||si.overloadTable===void 0&&si.className!==ln.name&&si.argCount===De-2?(Ln.argCount=De-2,Ln.className=ln.name,na[ie]=Ln):(At(na,ie,Jn),na[ie].overloadTable[De-2]=Ln),gt([],rn,zc=>{var Fr=Gi(Jn,zc,ln,Ot,Vt,Bt);return na[ie].overloadTable===void 0?(Fr.argCount=De-2,na[ie]=Fr):na[ie].overloadTable[De-2]=Fr,[]}),[]})},ds=[],_n=[],Wa=ne=>{ne>9&&--_n[ne+1]===0&&(_n[ne]=void 0,ds.push(ne))},ps=()=>_n.length/2-5-ds.length,Xa=()=>{_n.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=ps},$i={toValue:ne=>(ne||Ye("Cannot use deleted val. handle = "+ne),_n[ne]),toHandle:ne=>{switch(ne){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const ie=ds.pop()||_n.length;return _n[ie]=ne,_n[ie+1]=1,ie}}}},so={name:"emscripten::val",fromWireType:ne=>{var ie=$i.toValue(ne);return Wa(ne),ie},toWireType:(ne,ie)=>$i.toHandle(ie),argPackAdvance:Le,readValueFromPointer:Nt,destructorFunction:null},zs=ne=>ke(ne,so),js=ne=>{if(ne===null)return"null";var ie=typeof ne;return ie==="object"||ie==="array"||ie==="function"?ne.toString():""+ne},E=(ne,ie)=>{switch(ie){case 4:return function(De){return this.fromWireType(j[De>>2])};case 8:return function(De){return this.fromWireType(z[De>>3])};default:throw new TypeError(`invalid float width (${ie}): ${ne}`)}},L=(ne,ie,De)=>{ie=Ve(ie),ke(ne,{name:ie,fromWireType:Ke=>Ke,toWireType:(Ke,xt)=>xt,argPackAdvance:Le,readValueFromPointer:E(ie,De),destructorFunction:null})},J=(ne,ie,De)=>{switch(ie){case 1:return De?Ke=>A[Ke]:Ke=>C[Ke];case 2:return De?Ke=>k[Ke>>1]:Ke=>R[Ke>>1];case 4:return De?Ke=>N[Ke>>2]:Ke=>P[Ke>>2];default:throw new TypeError(`invalid integer width (${ie}): ${ne}`)}},re=(ne,ie,De,Ke,xt)=>{ie=Ve(ie);var Ot=ln=>ln;if(Ke===0){var Vt=32-8*De;Ot=ln=>ln<<Vt>>>Vt}var Tt=ie.includes("unsigned"),Bt=(ln,Jn)=>{},rn;Tt?rn=function(ln,Jn){return Bt(Jn,this.name),Jn>>>0}:rn=function(ln,Jn){return Bt(Jn,this.name),Jn},ke(ne,{name:ie,fromWireType:Ot,toWireType:rn,argPackAdvance:Le,readValueFromPointer:J(ie,De,Ke!==0),destructorFunction:null})},ye=(ne,ie,De)=>{var Ke=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],xt=Ke[ie];function Ot(Vt){var Tt=P[Vt>>2],Bt=P[Vt+4>>2];return new xt(A.buffer,Bt,Tt)}De=Ve(De),ke(ne,{name:De,fromWireType:Ot,argPackAdvance:Le,readValueFromPointer:Ot},{ignoreDuplicateRegistrations:!0})},$e=(ne,ie,De,Ke)=>{if(!(Ke>0))return 0;for(var xt=De,Ot=De+Ke-1,Vt=0;Vt<ne.length;++Vt){var Tt=ne.charCodeAt(Vt);if(Tt>=55296&&Tt<=57343){var Bt=ne.charCodeAt(++Vt);Tt=65536+((Tt&1023)<<10)|Bt&1023}if(Tt<=127){if(De>=Ot)break;ie[De++]=Tt}else if(Tt<=2047){if(De+1>=Ot)break;ie[De++]=192|Tt>>6,ie[De++]=128|Tt&63}else if(Tt<=65535){if(De+2>=Ot)break;ie[De++]=224|Tt>>12,ie[De++]=128|Tt>>6&63,ie[De++]=128|Tt&63}else{if(De+3>=Ot)break;ie[De++]=240|Tt>>18,ie[De++]=128|Tt>>12&63,ie[De++]=128|Tt>>6&63,ie[De++]=128|Tt&63}}return ie[De]=0,De-xt},tt=(ne,ie,De)=>$e(ne,C,ie,De),Lt=ne=>{for(var ie=0,De=0;De<ne.length;++De){var Ke=ne.charCodeAt(De);Ke<=127?ie++:Ke<=2047?ie+=2:Ke>=55296&&Ke<=57343?(ie+=4,++De):ie+=3}return ie},zt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,gn=(ne,ie,De)=>{for(var Ke=ie+De,xt=ie;ne[xt]&&!(xt>=Ke);)++xt;if(xt-ie>16&&ne.buffer&&zt)return zt.decode(ne.subarray(ie,xt));for(var Ot="";ie<xt;){var Vt=ne[ie++];if(!(Vt&128)){Ot+=String.fromCharCode(Vt);continue}var Tt=ne[ie++]&63;if((Vt&224)==192){Ot+=String.fromCharCode((Vt&31)<<6|Tt);continue}var Bt=ne[ie++]&63;if((Vt&240)==224?Vt=(Vt&15)<<12|Tt<<6|Bt:Vt=(Vt&7)<<18|Tt<<12|Bt<<6|ne[ie++]&63,Vt<65536)Ot+=String.fromCharCode(Vt);else{var rn=Vt-65536;Ot+=String.fromCharCode(55296|rn>>10,56320|rn&1023)}}return Ot},Mn=(ne,ie)=>ne?gn(C,ne,ie):"",Ei=(ne,ie)=>{ie=Ve(ie);var De=ie==="std::string";ke(ne,{name:ie,fromWireType(Ke){var xt=P[Ke>>2],Ot=Ke+4,Vt;if(De)for(var Tt=Ot,Bt=0;Bt<=xt;++Bt){var rn=Ot+Bt;if(Bt==xt||C[rn]==0){var ln=rn-Tt,Jn=Mn(Tt,ln);Vt===void 0?Vt=Jn:(Vt+="\0",Vt+=Jn),Tt=rn+1}}else{for(var Ln=new Array(xt),Bt=0;Bt<xt;++Bt)Ln[Bt]=String.fromCharCode(C[Ot+Bt]);Vt=Ln.join("")}return Ka(Ke),Vt},toWireType(Ke,xt){xt instanceof ArrayBuffer&&(xt=new Uint8Array(xt));var Ot,Vt=typeof xt=="string";Vt||xt instanceof Uint8Array||xt instanceof Uint8ClampedArray||xt instanceof Int8Array||Ye("Cannot pass non-string to std::string"),De&&Vt?Ot=Lt(xt):Ot=xt.length;var Tt=Gs(4+Ot+1),Bt=Tt+4;if(P[Tt>>2]=Ot,De&&Vt)tt(xt,Bt,Ot+1);else if(Vt)for(var rn=0;rn<Ot;++rn){var ln=xt.charCodeAt(rn);ln>255&&(Ka(Bt),Ye("String has UTF-16 code units that do not fit in 8 bits")),C[Bt+rn]=ln}else for(var rn=0;rn<Ot;++rn)C[Bt+rn]=xt[rn];return Ke!==null&&Ke.push(Ka,Tt),Tt},argPackAdvance:Le,readValueFromPointer:Nt,destructorFunction(Ke){Ka(Ke)}})},Cn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ai=(ne,ie)=>{for(var De=ne,Ke=De>>1,xt=Ke+ie/2;!(Ke>=xt)&&R[Ke];)++Ke;if(De=Ke<<1,De-ne>32&&Cn)return Cn.decode(C.subarray(ne,De));for(var Ot="",Vt=0;!(Vt>=ie/2);++Vt){var Tt=k[ne+Vt*2>>1];if(Tt==0)break;Ot+=String.fromCharCode(Tt)}return Ot},Ar=(ne,ie,De)=>{if(De??=2147483647,De<2)return 0;De-=2;for(var Ke=ie,xt=De<ne.length*2?De/2:ne.length,Ot=0;Ot<xt;++Ot){var Vt=ne.charCodeAt(Ot);k[ie>>1]=Vt,ie+=2}return k[ie>>1]=0,ie-Ke},Mi=ne=>ne.length*2,Hi=(ne,ie)=>{for(var De=0,Ke="";!(De>=ie/4);){var xt=N[ne+De*4>>2];if(xt==0)break;if(++De,xt>=65536){var Ot=xt-65536;Ke+=String.fromCharCode(55296|Ot>>10,56320|Ot&1023)}else Ke+=String.fromCharCode(xt)}return Ke},Ui=(ne,ie,De)=>{if(De??=2147483647,De<4)return 0;for(var Ke=ie,xt=Ke+De-4,Ot=0;Ot<ne.length;++Ot){var Vt=ne.charCodeAt(Ot);if(Vt>=55296&&Vt<=57343){var Tt=ne.charCodeAt(++Ot);Vt=65536+((Vt&1023)<<10)|Tt&1023}if(N[ie>>2]=Vt,ie+=4,ie+4>xt)break}return N[ie>>2]=0,ie-Ke},pi=ne=>{for(var ie=0,De=0;De<ne.length;++De){var Ke=ne.charCodeAt(De);Ke>=55296&&Ke<=57343&&++De,ie+=4}return ie},Ia=(ne,ie,De)=>{De=Ve(De);var Ke,xt,Ot,Vt;ie===2?(Ke=ai,xt=Ar,Vt=Mi,Ot=Tt=>R[Tt>>1]):ie===4&&(Ke=Hi,xt=Ui,Vt=pi,Ot=Tt=>P[Tt>>2]),ke(ne,{name:De,fromWireType:Tt=>{for(var Bt=P[Tt>>2],rn,ln=Tt+4,Jn=0;Jn<=Bt;++Jn){var Ln=Tt+4+Jn*ie;if(Jn==Bt||Ot(Ln)==0){var na=Ln-ln,si=Ke(ln,na);rn===void 0?rn=si:(rn+="\0",rn+=si),ln=Ln+ie}}return Ka(Tt),rn},toWireType:(Tt,Bt)=>{typeof Bt!="string"&&Ye(`Cannot pass non-string to C++ string type ${De}`);var rn=Vt(Bt),ln=Gs(4+rn+ie);return P[ln>>2]=rn/ie,xt(Bt,ln+4,rn+ie),Tt!==null&&Tt.push(Ka,ln),ln},argPackAdvance:Le,readValueFromPointer:Nt,destructorFunction(Tt){Ka(Tt)}})},Pl=(ne,ie)=>{ie=Ve(ie),ke(ne,{isVoid:!0,name:ie,argPackAdvance:0,fromWireType:()=>{},toWireType:(De,Ke)=>{}})},Jo=(ne,ie,De)=>C.copyWithin(ne,ie,ie+De),Na=(ne,ie)=>{var De=mt[ne];return De===void 0&&Ye(`${ie} has unknown type ${An(ne)}`),De},sr=(ne,ie,De)=>{var Ke=[],xt=ne.toWireType(Ke,De);return Ke.length&&(P[ie>>2]=$i.toHandle(Ke)),xt},op=(ne,ie,De)=>(ne=$i.toValue(ne),ie=Na(ie,"emval::as"),sr(ie,De,ne)),Cr={},Ul=ne=>{var ie=Cr[ne];return ie===void 0?Ve(ne):ie},Fc=[],Hs=(ne,ie,De,Ke,xt)=>(ne=Fc[ne],ie=$i.toValue(ie),De=Ul(De),ne(ie,ie[De],Ke,xt)),br=ne=>{var ie=Fc.length;return Fc.push(ne),ie},Wr=(ne,ie)=>{for(var De=new Array(ne),Ke=0;Ke<ne;++Ke)De[Ke]=Na(P[ie+Ke*4>>2],"parameter "+Ke);return De},ur=(ne,ie,De)=>{var Ke=Wr(ne,ie),xt=Ke.shift();ne--;var Ot=`return function (obj, func, destructorsRef, args) {
`,Vt=0,Tt=[];De===0&&Tt.push("obj");for(var Bt=["retType"],rn=[xt],ln=0;ln<ne;++ln)Tt.push("arg"+ln),Bt.push("argType"+ln),rn.push(Ke[ln]),Ot+=`  var arg${ln} = argType${ln}.readValueFromPointer(args${Vt?"+"+Vt:""});
`,Vt+=Ke[ln].argPackAdvance;var Jn=De===1?"new func":"func.call";Ot+=`  var rv = ${Jn}(${Tt.join(", ")});
`,xt.isVoid||(Bt.push("emval_returnValue"),rn.push(sr),Ot+=`  return emval_returnValue(retType, destructorsRef, rv);
`),Ot+=`};
`,Bt.push(Ot);var Ln=wi(Function,Bt)(...rn),na=`methodCaller<(${Ke.map(si=>si.name).join(", ")}) => ${xt.name}>`;return br(lt(na,Ln))},Vs=(ne,ie)=>(ne=$i.toValue(ne),ie=$i.toValue(ie),$i.toHandle(ne[ie])),qa=ne=>{ne>9&&(_n[ne+1]+=1)},yg=ne=>$i.toHandle(Ul(ne)),lp=ne=>{var ie=$i.toValue(ne);Li(ie),Wa(ne)},Rh=(ne,ie)=>{ne=Na(ne,"_emval_take_value");var De=ne.readValueFromPointer(ie);return $i.toHandle(De)},Bc=()=>1073741824,Ru=ne=>{var ie=M.buffer,De=(ne-ie.byteLength+65535)/65536;try{return M.grow(De),X(),1}catch{}},cp=ne=>{var ie=C.length;ne>>>=0;var De=Bc();if(ne>De)return!1;for(var Ke=(Bt,rn)=>Bt+(rn-Bt%rn)%rn,xt=1;xt<=4;xt*=2){var Ot=ie*(1+.2/xt);Ot=Math.min(Ot,ne+100663296);var Vt=Math.min(De,Ke(Math.max(ne,Ot),65536)),Tt=Ru(Vt);if(Tt)return!0}return!1};me(),Je=i.BindingError=class extends Error{constructor(ie){super(ie),this.name="BindingError"}},vt=i.InternalError=class extends Error{constructor(ie){super(ie),this.name="InternalError"}},rt(),hi(),Xt(),Nn=i.UnboundTypeError=Zn(Error,"UnboundTypeError"),Xa();var Sf={n:K,t:ce,s:he,x:ht,r:an,q:Yo,k:ko,w:zs,m:L,c:re,a:ye,l:Ei,f:Ia,y:Pl,v:Jo,h:op,o:Hs,b:Wa,p:ur,i:Vs,g:qa,j:yg,d:lp,e:Rh,u:cp},oo=Ne(),$o=ne=>($o=oo.B)(ne),Gs=ne=>(Gs=oo.D)(ne),Ka=ne=>(Ka=oo.E)(ne),lo=ne=>(lo=oo.F)(ne);i.addOnPostRun=de;var Fl;le=function ne(){Fl||kh(),Fl||(le=ne)};function kh(){if(oe>0||(W(),oe>0))return;function ne(){Fl||(Fl=!0,i.calledRun=!0,!S&&(B(),r(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Y()))}i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),ne()},1)):ne()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return kh(),n=s,n}})();function WTe(t){return new Worker("/assets/SplatSortWorker-D00osGmu.js",{type:"module",name:t?.name})}const _s=[];for(let t=0;t<256;++t)_s.push((t+256).toString(16).slice(1));function XTe(t,e=0){return(_s[t[e+0]]+_s[t[e+1]]+_s[t[e+2]]+_s[t[e+3]]+"-"+_s[t[e+4]]+_s[t[e+5]]+"-"+_s[t[e+6]]+_s[t[e+7]]+"-"+_s[t[e+8]]+_s[t[e+9]]+"-"+_s[t[e+10]]+_s[t[e+11]]+_s[t[e+12]]+_s[t[e+13]]+_s[t[e+14]]+_s[t[e+15]]).toLowerCase()}let OD;const qTe=new Uint8Array(16);function KTe(){if(!OD){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");OD=crypto.getRandomValues.bind(crypto)}return OD(qTe)}const YTe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),q6={randomUUID:YTe};function yQ(t,e,n){if(q6.randomUUID&&!t)return q6.randomUUID();t=t||{};const i=t.random??t.rng?.()??KTe();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,XTe(i)}const JTe=MC({numGaussians:0,viewport:[640,480],near:1,far:100,depthTest:!0,depthWrite:!1,transparent:!0,textureBuffer:null,textureT_camera_groups:null,transitionInState:0,projectionMatrixCustom:new Dt},`precision highp usampler2D; // Most important: ints must be 32-bit.
  precision mediump float;

  // Index from the splat sorter.
  attribute uint sortedIndex;

  // Buffers for splat data; each Gaussian gets 4 floats and 4 int32s. We just
  // copy quadjr for this.
  uniform usampler2D textureBuffer;

  // We could also use a uniform to store transforms, but this would be more
  // limiting in terms of the # of groups we can have.
  uniform sampler2D textureT_camera_groups;

  // Various other uniforms...
  uniform uint numGaussians;
  uniform vec2 viewport;
  uniform float near;
  uniform float far;
  uniform mat4 projectionMatrixCustom;

  // Fade in state between [0, 1].
  uniform float transitionInState;

  out vec4 vRgba;
  out vec2 vPosition;

  // Function to fetch and construct the i-th transform matrix using texelFetch
  mat4 getGroupTransform(uint i) {
    // Calculate the base index for the i-th transform.
    uint baseIndex = i * 3u;

    // Fetch the texels that represent the first 3 rows of the transform. We
    // choose to use row-major here, since it lets us exclude the fourth row of
    // the matrix.
    vec4 row0 = texelFetch(textureT_camera_groups, ivec2(baseIndex + 0u, 0), 0);
    vec4 row1 = texelFetch(textureT_camera_groups, ivec2(baseIndex + 1u, 0), 0);
    vec4 row2 = texelFetch(textureT_camera_groups, ivec2(baseIndex + 2u, 0), 0);

    // Construct the mat4 with the fetched rows.
    mat4 transform = mat4(row0, row1, row2, vec4(0.0, 0.0, 0.0, 1.0));
    return transpose(transform);
  }

  void main () {
    // Get position + scale from float buffer.
    ivec2 texSize = textureSize(textureBuffer, 0);
    uint texStart = sortedIndex << 1u;
    ivec2 texPos0 = ivec2(texStart % uint(texSize.x), texStart / uint(texSize.x));


    // Fetch from textures.
    uvec4 floatBufferData = texelFetch(textureBuffer, texPos0, 0);
    mat4 T_camera_group = getGroupTransform(floatBufferData.w);

    // Any early return will discard the fragment.
    gl_Position = vec4(0.0, 0.0, 2.0, 1.0);

    // Get center wrt camera. modelViewMatrix is T_cam_world.
    vec3 center = uintBitsToFloat(floatBufferData.xyz);
    vec4 c_cam = T_camera_group * vec4(center, 1);
    if (-c_cam.z < near || -c_cam.z > far)
      return;
    vec4 pos2d = projectionMatrixCustom * c_cam;
    float clip = 1.1 * pos2d.w;
    if (pos2d.x < -clip || pos2d.x > clip || pos2d.y < -clip || pos2d.y > clip)
      return;

    // Read covariance terms.
    ivec2 texPos1 = ivec2((texStart + 1u) % uint(texSize.x), (texStart + 1u) / uint(texSize.x));
    uvec4 intBufferData = texelFetch(textureBuffer, texPos1, 0);

    // Get covariance terms from int buffer.
    uint rgbaUint32 = intBufferData.w;
    vec2 triu01 = unpackHalf2x16(intBufferData.x);
    vec2 triu23 = unpackHalf2x16(intBufferData.y);
    vec2 triu45 = unpackHalf2x16(intBufferData.z);

    // Transition in.
    float startTime = 0.8 * float(sortedIndex) / float(numGaussians);
    float cov_scale = smoothstep(startTime, startTime + 0.2, transitionInState);

    // Extract focal lengths from projection matrix
    // In perspective projection: P[0][0] = 2*near/(right-left) = fx/width for symmetric frustum
    // So fx = P[0][0] * viewport.x / 2.0, fy = P[1][1] * viewport.y / 2.0
    float fx = projectionMatrixCustom[0][0] * viewport.x / 2.0;
    float fy = projectionMatrixCustom[1][1] * viewport.y / 2.0;

    // Do the actual splatting.
    mat3 cov3d = mat3(
        triu01.x, triu01.y, triu23.x,
        triu01.y, triu23.y, triu45.x,
        triu23.x, triu45.x, triu45.y
    );
    mat3 J = mat3(
        // Matrices are column-major.
        fx / c_cam.z, 0., 0.0,
        0., fy / c_cam.z, 0.0,
        -(fx * c_cam.x) / (c_cam.z * c_cam.z), -(fy * c_cam.y) / (c_cam.z * c_cam.z), 0.
    );
    mat3 A = J * mat3(T_camera_group);
    mat3 cov_proj = A * cov3d * transpose(A);
    float diag1 = cov_proj[0][0] + 0.3;
    float offDiag = cov_proj[0][1];
    float diag2 = cov_proj[1][1] + 0.3;

    // Eigendecomposition.
    float mid = 0.5 * (diag1 + diag2);
    float radius = length(vec2((diag1 - diag2) / 2.0, offDiag));
    float lambda1 = mid + radius;
    float lambda2 = mid - radius;
    if (lambda2 < 0.0)
      return;
    vec2 diagonalVector = normalize(vec2(offDiag, lambda1 - diag1));
    vec2 v1 = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector;
    vec2 v2 = min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x);

    vRgba = vec4(
      float(rgbaUint32 & uint(0xFF)) / 255.0,
      float((rgbaUint32 >> uint(8)) & uint(0xFF)) / 255.0,
      float((rgbaUint32 >> uint(16)) & uint(0xFF)) / 255.0,
      float(rgbaUint32 >> uint(24)) / 255.0
    );

    // Throw the Gaussian off the screen if it's too close, too far, or too small.
    float weightedDeterminant = vRgba.a * (diag1 * diag2 - offDiag * offDiag);
    if (weightedDeterminant < 0.25)
      return;
    vPosition = position.xy;

    gl_Position = vec4(
        vec2(pos2d) / pos2d.w
            + position.x * v1 / viewport * 2.0
            + position.y * v2 / viewport * 2.0, pos2d.z / pos2d.w, 1.);
  }
`,`precision mediump float;

  uniform vec2 viewport;

  in vec4 vRgba;
  in vec2 vPosition;

  void main () {
    float A = -dot(vPosition, vPosition);
    if (A < -4.0) discard;
    float B = exp(A) * vRgba.a;
    if (B < 0.01) discard;  // alphaTest.
    gl_FragColor = vec4(vRgba.rgb, B);
  }`);function $Te(t,e){const n=t.length/8,i=ki(d=>d.gl).capabilities.maxTextureSize,r=new G_;r.instanceCount=n,r.setIndex(new In(new Uint32Array([0,2,1,0,3,2]),1)),r.setAttribute("position",new In(new Float32Array([-2,-2,2,-2,2,2,-2,2]),2));const a=new pf(new Uint32Array(n),1);a.setUsage(X1),r.setAttribute("sortedIndex",a);const s=Math.min(n*2,i),o=Math.ceil(n*2/s),l=new Uint32Array(s*o*4);l.set(t);const c=new cs(l,s,o,Xv,Ac);c.internalFormat="RGBA32UI",c.needsUpdate=!0;const u=new Float32Array(e*12),f=new cs(u,e*12/4,1,Qr,wr);f.internalFormat="RGBA32F",f.needsUpdate=!0;const h=new JTe;return h.textureBuffer=c,h.textureT_camera_groups=f,h.numGaussians=n,{geometry:r,material:h,textureBuffer:c,sortedIndexAttribute:a,textureT_camera_groups:f,rowMajorT_camera_groups:u}}function ZTe(){const t=Ee.useRef({});return Ee.useState(()=>$_(e=>({groupBufferFromId:{},nodeRefFromId:t,setBuffer:(n,i)=>e(r=>({groupBufferFromId:{...r.groupBufferFromId,[n]:i}})),removeBuffer:n=>e(i=>{const{[n]:r,...a}=i.groupBufferFromId;return{groupBufferFromId:a}})})))[0]}const tS=Ee.createContext(null);function QTe({children:t}){const e=ZTe();return D.jsxs(tS.Provider,{value:{useGaussianSplatStore:e,updateCamera:Ee.useRef(null),meshPropsRef:Ee.useRef(null)},children:[D.jsx(tAe,{}),t]})}const eAe=Ee.forwardRef(function({buffer:e,children:n},i){const r=Ee.useContext(tS),a=r.useGaussianSplatStore(c=>c.setBuffer),s=r.useGaussianSplatStore(c=>c.removeBuffer),o=r.useGaussianSplatStore(c=>c.nodeRefFromId),l=Ee.useMemo(()=>yQ(),[e]);return Ee.useEffect(()=>(a(l,e),()=>{s(l),delete o.current[l]}),[e]),D.jsx("group",{ref:c=>{c!==null&&(i!==null&&("current"in i?i.current=c:i(c)),o.current[l]=c)},children:n})});function tAe(){const e=Ee.useContext(tS).useGaussianSplatStore(n=>n.groupBufferFromId);return Object.keys(e).length>0?D.jsx(nAe,{}):null}function nAe(){const t=Ee.useContext(tS),e=t.useGaussianSplatStore(p=>p.groupBufferFromId),n=t.useGaussianSplatStore(p=>p.nodeRefFromId),i=iAe(e),r=$Te(i.gaussianBuffer,i.numGroups);t.meshPropsRef.current=r;const a=new WTe;let s=!1;a.onmessage=p=>{const x=p.data.sortedIndices;r.sortedIndexAttribute.set(x),r.sortedIndexAttribute.needsUpdate=!0,s||(r.material.uniforms.numGaussians.value=i.numGaussians,r.textureBuffer.needsUpdate=!0,s=!0)};function o(p){a.postMessage(p)}o({setBuffer:i.gaussianBuffer,setGroupIndices:i.groupIndices}),Ee.useEffect(()=>()=>{r.textureBuffer.dispose(),r.geometry.dispose(),r.material.dispose(),o({close:!0})});const l=Ee.useRef(null),c=new Dt,u=new Float32Array(i.numGroups*4),f=r.rowMajorT_camera_groups.slice().fill(0),h=[],d=Ee.useRef({fovY:0,aspect:0,near:0,far:0}),g=Ee.useRef(new Dt().makePerspective(-1,1,1,-1,.1,1e3)),b=Ee.useRef(null);Ee.useEffect(()=>{(async()=>b.current=new(await GTe()).Sorter(i.gaussianBuffer,i.groupIndices))()},[i.gaussianBuffer,i.groupIndices]);const y=Ee.useCallback(function(x,_,w,M){x.updateMatrixWorld(!0),x.updateProjectionMatrix();const S=x.fov*Math.PI/180,A=_/w;if(r.material===void 0)return;const C=r.material.uniforms;C.near.value=x.near,C.far.value=x.far,C.viewport.value=[_,w];const k=x.matrixWorldInverse,R=[];let N=!1;for(const[F,H]of Object.keys(e).entries()){const V=n.current[H];if(V===void 0)continue;c.copy(k).multiply(V.matrixWorld);const W=c.elements;u.set([W[2],W[6],W[10],W[14]],F*4);const B=c.transpose().elements;r.rowMajorT_camera_groups.set(B.slice(0,12),F*12);const Y=V.visible&&V.parent!==null;R.push(Y&&h[F]===!0),h[F]!==Y&&(h[F]=Y,N=!0)}const P=!r.rowMajorT_camera_groups.every((F,H)=>F===f[H]);if(P)if(M&&b.current!==null){const F=b.current.sort(u);r.sortedIndexAttribute.set(F),r.sortedIndexAttribute.needsUpdate=!0}else o({setTz_camera_groups:u});if(P||N){for(const[F,H]of R.entries())H||(r.rowMajorT_camera_groups[F*12+3]=1e10,r.rowMajorT_camera_groups[F*12+7]=1e10,r.rowMajorT_camera_groups[F*12+11]=1e10);f.set(r.rowMajorT_camera_groups),r.textureT_camera_groups.needsUpdate=!0}r.material.uniforms.projectionMatrixCustom.value.copy(g.current);const j=x.near,z=x.far,X=d.current;if(S!==X.fovY||A!==X.aspect||j!==X.near||z!==X.far){const F=Math.tan(S/2),H=j*F,V=-H,W=H*A,B=-W;g.current.makePerspective(B,W,H,V,j,z),X.fovY=S,X.aspect=A,X.near=j,X.far=z}},[r]);return t.updateCamera.current=y,la((p,x)=>{if(l.current===null||a===null||r.rowMajorT_camera_groups.length===0)return;const w=r.material.uniforms;w.transitionInState.value=Math.min(w.transitionInState.value+x*2,1),y(p.camera,p.viewport.dpr*p.size.width,p.viewport.dpr*p.size.height,!1)},-100),D.jsx("mesh",{ref:l,geometry:r.geometry,material:r.material,renderOrder:1e4})}function iAe(t){let e=0;for(const o of Object.values(t))e+=o.length;const n=e/8,i=new Uint32Array(e),r=new Uint32Array(n);let a=0;for(const[o,l]of Object.values(t).entries()){r.fill(o,a/8,(a+l.length)/8),i.set(l,a);for(let c=0;c<l.length;c+=8)i[a+c+3]=o;a+=l.length}const s=Object.keys(t).length;return{numGaussians:n,gaussianBuffer:i,numGroups:s,groupIndices:r}}const hs=I.createContext({folderDepth:0,setValue:()=>{},messageSender:()=>{},GuiContainer:()=>{throw new Error("GuiComponentContext not initialized")}});function xQ(t,e){if(t===e)return!0;if(!t||!e)return t===e;const n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(const r of n)if(!(r in e))return!1;return!0}var qU="_11mcxao0",_Q="_11mcxao1";function CC(t){if(t!==null){if(Array.isArray(t)){const[e,n,i]=t;return`#${e.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}return t}}function K6(t){return`rgb(${Math.round(t[0])}, ${Math.round(t[1])}, ${Math.round(t[2])})`}function Y6(t){return`rgba(${Math.round(t[0])}, ${Math.round(t[1])}, ${Math.round(t[2])}, ${(t[3]/255).toFixed(4)})`}function Ox(t){const e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(e)return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])];const n=t.match(/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/);if(n){const i=n[1];let r,a,s;return i.length===3?(r=parseInt(i[0]+i[0],16),a=parseInt(i[1]+i[1],16),s=parseInt(i[2]+i[2],16)):(r=parseInt(i.substring(0,2),16),a=parseInt(i.substring(2,4),16),s=parseInt(i.substring(4,6),16)),[r,a,s]}return null}function vE(t){const e=t.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);if(e)return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),Math.round(parseFloat(e[4])*255)];const n=t.match(/^#([0-9A-Fa-f]{3,8})$/);if(n){const r=n[1];if(r.length===4)return[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];if(r.length===8)return[parseInt(r.substring(0,2),16),parseInt(r.substring(2,4),16),parseInt(r.substring(4,6),16),parseInt(r.substring(6,8),16)]}const i=Ox(t);return i?[...i,255]:null}function ID(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function ND(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function rAe({uuid:t,props:{visible:e,disabled:n,label:i,color:r,_icon_html:a}}){const{messageSender:s}=Ee.useContext(hs);return e??!0?D.jsx(st,{mx:"xs",pb:"0.5em",children:D.jsx(ks,{id:t,fullWidth:!0,color:CC(r),onClick:()=>s({type:"GuiUpdateMessage",uuid:t,updates:{value:!0}}),style:{height:"2em"},disabled:n??!1,size:"sm",leftSection:a===null?void 0:D.jsx("div",{className:qU,dangerouslySetInnerHTML:{__html:a}}),children:i})}):null}function Cu({uuid:t,label:e,hint:n,children:i}){const{folderDepth:r}=I.useContext(hs);return n!=null&&(i=D.jsx(Pr,{zIndex:100,label:n,multiline:!0,style:{width:"15rem"},withArrow:!0,openDelay:500,withinPortal:!0,children:D.jsx(st,{children:i})})),e!==void 0&&(i=D.jsx(aAe,{uuid:t,label:e,input:i,folderDepth:r})),D.jsx(st,{pb:"0.5em",px:"xs",children:i})}function aAe(t){return D.jsxs(ff,{align:"center",children:[D.jsx(st,{pr:"xs",style:{width:`${7.25-t.folderDepth*.6375}em`,flexShrink:0,position:"relative"},children:D.jsx(bu,{c:"dimmed",style:{fontSize:"0.875em",fontWeight:"450",lineHeight:"1.375em",letterSpacing:"-0.75px",width:"100%",boxSizing:"content-box"},unselectable:"off",children:D.jsx("label",{htmlFor:t.uuid,children:t.label})})}),D.jsx(st,{style:{flexGrow:1},children:t.input})]})}function SQ(t){return D.jsx(ff,{justify:"space-between",columnGap:"0.5em",children:[...Array(t.n).keys()].map(e=>D.jsx(ug,{id:e===0?t.uuid:void 0,value:t.value[e],onChange:n=>{const i=[...t.value];i[e]=n===""?0:Number(n),t.onChange(i)},size:"xs",styles:{root:{flexGrow:1,width:0},input:{paddingLeft:"0.5em",paddingRight:"1.75em",textAlign:"right",height:"1.875em",minHeight:"1.875em"},controls:{height:"1.25em",width:"0.825em"}},rightSectionWidth:"1em",decimalScale:t.precision,step:t.step,min:t.min===null?void 0:t.min[e],max:t.max===null?void 0:t.max[e],stepHoldDelay:500,stepHoldInterval:n=>Math.max(1e3/n**2,25),disabled:t.disabled},e))})}function sAe({uuid:t,value:e,props:{label:n,hint:i,visible:r,disabled:a,min:s,max:o,precision:l,step:c,_marks:u}}){const{setValue:f}=Ee.useContext(hs);if(!r)return null;const h=b=>f(t,b),d=typeof e=="number"&&l!=null?Number(e.toFixed(l)):e,g=D.jsxs(ff,{justify:"space-between",children:[D.jsx(LA,{id:t,className:u===null?_Q:void 0,size:"xs",thumbSize:0,radius:"xs",style:{flexGrow:1},styles:b=>({thumb:{height:"0.75rem",width:"0.5rem",background:b.colors[b.primaryColor][6]},trackContainer:{zIndex:3,position:"relative"},markLabel:{transform:"translate(-50%, 0.05rem)",fontSize:"0.6rem",textAlign:"center"},mark:{transform:"scale(2)"}}),pt:"0.3em",pb:"0.2em",showLabelOnHover:!1,min:s,max:o,step:c??void 0,precision:l,value:d,onChange:h,marks:u===null?[{value:s,label:`${s.toFixed(6).replace(/\.?0+$/,"")}`},{value:o,label:`${o.toFixed(6).replace(/\.?0+$/,"")}`}]:u,disabled:a}),D.jsx(ug,{value:d,onChange:b=>{if(b==="")return;const y=Number(b);if(Number.isFinite(y)){const p=l!=null?Number(y.toFixed(l)):y;h(p)}},size:"xs",min:s,max:o,hideControls:!0,step:c??void 0,style:{width:l&&l>3?"3.5rem":"3rem"},styles:{input:{padding:"0.375em",letterSpacing:"-0.5px",minHeight:"1.875em",height:"1.875em"}},ml:"xs"})]});return D.jsx(Cu,{uuid:t,hint:i,label:n,children:g})}function oAe({uuid:t,value:e,props:{visible:n,label:i,hint:r,disabled:a,precision:s,min:o,max:l,step:c}}){const{setValue:u}=I.useContext(hs);return n?D.jsx(Cu,{uuid:t,hint:r,label:i,children:D.jsx(ug,{id:t,value:e,decimalScale:s,min:o??void 0,max:l??void 0,step:c,size:"xs",onChange:f=>{f!==""&&u(t,f)},styles:{input:{minHeight:"1.625rem",height:"1.625rem"},controls:{height:"1.625em",width:"0.825em"}},disabled:a,stepHoldDelay:500,stepHoldInterval:f=>Math.max(1e3/f**2,25)})}):null}function lAe({uuid:t,value:e,props:{hint:n,label:i,disabled:r,visible:a,multiline:s}}){const{setValue:o}=I.useContext(hs);return a?D.jsx(Cu,{uuid:t,hint:n,label:i,children:s?D.jsx(SA,{value:e,size:"xs",onChange:l=>{o(t,l.target.value)},styles:{input:{padding:"0 0.5em"}},disabled:r,minRows:2,maxRows:6,autosize:!0,resize:"vertical"}):D.jsx(hg,{value:e,size:"xs",onChange:l=>{o(t,l.target.value)},styles:{input:{minHeight:"1.625rem",height:"1.625rem",padding:"0 0.5em"}},disabled:r})}):null}function cAe({uuid:t,value:e,props:{disabled:n,visible:i,hint:r,label:a}}){const{setValue:s}=I.useContext(hs);if(!i)return null;let o=D.jsx(vh,{id:t,checked:e,size:"xs",onChange:l=>{s(t,l.target.checked)},disabled:n});return r!=null&&(o=D.jsx(Pr,{zIndex:100,label:r,multiline:!0,style:{width:"15rem"},withArrow:!0,openDelay:500,withinPortal:!0,children:D.jsx(st,{style:{display:"inline-block"},children:o})})),D.jsx(Cu,{uuid:t,label:a,children:o})}function uAe({uuid:t,value:e,props:{hint:n,label:i,visible:r,disabled:a,min:s,max:o,step:l,precision:c}}){const{setValue:u}=I.useContext(hs);return r?D.jsx(Cu,{uuid:t,hint:n,label:i,children:D.jsx(SQ,{uuid:t,n:2,value:e,onChange:f=>u(t,f),min:s,max:o,step:l,precision:c,disabled:a})}):null}function fAe({uuid:t,value:e,props:{hint:n,label:i,visible:r,disabled:a,min:s,max:o,step:l,precision:c}}){const{setValue:u}=I.useContext(hs);return r?D.jsx(Cu,{uuid:t,hint:n,label:i,children:D.jsx(SQ,{uuid:t,n:3,value:e,onChange:f=>u(t,f),min:s,max:o,step:l,precision:c,disabled:a})}):null}function hAe({uuid:t,value:e,props:{hint:n,label:i,disabled:r,visible:a,options:s}}){const{setValue:o}=I.useContext(hs);return a?D.jsx(Cu,{uuid:t,hint:n,label:i,children:D.jsx(jv,{id:t,radius:"xs",value:e,data:s,onChange:l=>l!==null&&o(t,l),disabled:r,searchable:!0,maxDropdownHeight:400,size:"xs",rightSectionWidth:"1.2em",styles:{input:{padding:"0.5em",letterSpacing:"-0.5px",minHeight:"1.625rem",height:"1.625rem"}},comboboxProps:{zIndex:1e3}})}):null}/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var dAe={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ar=(t,e,n,i)=>{const r=I.forwardRef(({color:a="currentColor",size:s=24,stroke:o=2,title:l,className:c,children:u,...f},h)=>I.createElement("svg",{ref:h,...dAe[t],width:s,height:s,className:["tabler-icon",`tabler-icon-${e}`,c].join(" "),...t==="filled"?{fill:a}:{strokeWidth:o,stroke:a},...f},[l&&I.createElement("title",{key:"svg-title"},l),...i.map(([d,g])=>I.createElement(d,g)),...Array.isArray(u)?u:[u]]));return r.displayName=`${n}`,r};/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const pAe=[["path",{d:"M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M6 4v4",key:"svg-1"}],["path",{d:"M6 12v8",key:"svg-2"}],["path",{d:"M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-3"}],["path",{d:"M12 4v10",key:"svg-4"}],["path",{d:"M12 18v2",key:"svg-5"}],["path",{d:"M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M18 4v1",key:"svg-7"}],["path",{d:"M18 9v11",key:"svg-8"}]],mAe=ar("outline","adjustments","Adjustments",pAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const gAe=[["path",{d:"M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1",key:"svg-0"}]],bAe=ar("outline","arrow-back","ArrowBack",gAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const vAe=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],yAe=ar("outline","brand-github","BrandGithub",vAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xAe=[["path",{d:"M6 10l6 6l6 -6h-12",key:"svg-0"}]],_Ae=ar("outline","caret-down","CaretDown",xAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const SAe=[["path",{d:"M10 18l6 -6l-6 -6v12",key:"svg-0"}]],wAe=ar("outline","caret-right","CaretRight",SAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const EAe=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],KU=ar("outline","check","Check",EAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const MAe=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],TAe=ar("outline","chevron-down","ChevronDown",MAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const AAe=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],CAe=ar("outline","chevron-left","ChevronLeft",AAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const RAe=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],kAe=ar("outline","chevron-right","ChevronRight",RAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const DAe=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],OAe=ar("outline","chevron-up","ChevronUp",DAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const IAe=[["path",{d:"M11 18.004h-4.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.388 0 2.585 .82 3.138 2.007",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]],NAe=ar("outline","cloud-check","CloudCheck",IAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const LAe=[["path",{d:"M11 7l6 6",key:"svg-0"}],["path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z",key:"svg-1"}]],wQ=ar("outline","color-picker","ColorPicker",LAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const PAe=[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],UAe=ar("outline","copy","Copy",PAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const FAe=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],BAe=ar("outline","device-floppy","DeviceFloppy",FAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const zAe=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],jAe=ar("outline","download","Download",zAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const HAe=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],VAe=ar("outline","eye-off","EyeOff",HAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const GAe=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M13.048 17.942a9.298 9.298 0 0 1 -1.048 .058c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6a17.986 17.986 0 0 1 -1.362 1.975",key:"svg-1"}],["path",{d:"M22 22l-5 -5",key:"svg-2"}],["path",{d:"M17 22l5 -5",key:"svg-3"}]],WAe=ar("outline","eye-x","EyeX",GAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const XAe=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],qAe=ar("outline","eye","Eye",XAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const KAe=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 17h6",key:"svg-2"}],["path",{d:"M9 13h6",key:"svg-3"}]],YAe=ar("outline","file-description","FileDescription",KAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const JAe=[["path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2",key:"svg-0"}],["path",{d:"M19 12h2l-9 -9l-9 9h2v7a2 2 0 0 0 2 2h5.5",key:"svg-1"}],["path",{d:"M16 19h6",key:"svg-2"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-3"}]],$Ae=ar("outline","home-move","HomeMove",JAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZAe=[["path",{d:"M2 6m0 2a2 2 0 0 1 2 -2h16a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-16a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M6 10l0 .01",key:"svg-1"}],["path",{d:"M10 10l0 .01",key:"svg-2"}],["path",{d:"M14 10l0 .01",key:"svg-3"}],["path",{d:"M18 10l0 .01",key:"svg-4"}],["path",{d:"M6 14l0 .01",key:"svg-5"}],["path",{d:"M18 14l0 .01",key:"svg-6"}],["path",{d:"M10 14l4 .01",key:"svg-7"}]],QAe=ar("outline","keyboard","Keyboard",ZAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const eCe=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}]],EQ=ar("outline","maximize","Maximize",eCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const tCe=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],nCe=ar("outline","pencil","Pencil",tCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const iCe=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],rCe=ar("outline","photo","Photo",iCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const aCe=[["path",{d:"M20 16l-4 4",key:"svg-0"}],["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5z",key:"svg-1"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5z",key:"svg-2"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-3"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-4"}],["path",{d:"M10 11l-2 2",key:"svg-5"}],["path",{d:"M13 14l-2 2",key:"svg-6"}],["path",{d:"M16 16l4 4",key:"svg-7"}]],sCe=ar("outline","plug-connected-x","PlugConnectedX",aCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const oCe=[["path",{d:"M8 4h1a1 1 0 0 1 1 1v1m-.297 3.711a1 1 0 0 1 -.703 .289h-4a1 1 0 0 1 -1 -1v-4c0 -.275 .11 -.524 .29 -.705",key:"svg-0"}],["path",{d:"M7 17v.01",key:"svg-1"}],["path",{d:"M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M7 7v.01",key:"svg-3"}],["path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M17 7v.01",key:"svg-5"}],["path",{d:"M20 14v.01",key:"svg-6"}],["path",{d:"M14 14v3",key:"svg-7"}],["path",{d:"M14 20h3",key:"svg-8"}],["path",{d:"M3 3l18 18",key:"svg-9"}]],lCe=ar("outline","qrcode-off","QrcodeOff",oCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const cCe=[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M7 17l0 .01",key:"svg-1"}],["path",{d:"M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M7 7l0 .01",key:"svg-3"}],["path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M17 7l0 .01",key:"svg-5"}],["path",{d:"M14 14l3 0",key:"svg-6"}],["path",{d:"M20 14l0 .01",key:"svg-7"}],["path",{d:"M14 14l0 3",key:"svg-8"}],["path",{d:"M14 20l3 0",key:"svg-9"}],["path",{d:"M17 17l3 0",key:"svg-10"}],["path",{d:"M20 17l0 3",key:"svg-11"}]],uCe=ar("outline","qrcode","Qrcode",cCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const fCe=[["path",{d:"M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}],["path",{d:"M8.7 10.7l6.6 -3.4",key:"svg-3"}],["path",{d:"M8.7 13.3l6.6 3.4",key:"svg-4"}]],hCe=ar("outline","share","Share",fCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const dCe=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],pCe=ar("outline","x","X",dCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const mCe=[["path",{d:"M9 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z",key:"svg-0"}],["path",{d:"M17 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z",key:"svg-1"}]],gCe=ar("filled","player-pause-filled","PlayerPauseFilled",mCe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const bCe=[["path",{d:"M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z",key:"svg-0"}]],vCe=ar("filled","player-play-filled","PlayerPlayFilled",bCe);function yCe({uuid:t,value:e,props:{label:n,hint:i,disabled:r,visible:a}}){const{setValue:s}=I.useContext(hs),[o,l]=I.useState(K6(e));return I.useEffect(()=>{const c=Ox(o);(!c||!ID(c,e))&&l(K6(e))},[e]),a?D.jsx(Cu,{uuid:t,hint:i,label:n,children:D.jsx(Bv,{disabled:r,size:"xs",value:o,format:"rgb",eyeDropperIcon:D.jsx(wQ,{size:18,stroke:1.5}),popoverProps:{zIndex:1e3},styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},onChange:c=>{if(l(c),c.startsWith("rgb(")){const u=Ox(c);u&&!ID(u,e)&&s(t,u)}},onKeyDown:c=>{if(c.key==="Enter"){const u=Ox(o);u&&s(t,u)}},onBlur:()=>{const c=Ox(o);c&&!ID(c,e)&&s(t,c)}})}):null}function xCe({uuid:t,value:e,props:{label:n,hint:i,disabled:r,visible:a}}){const{setValue:s}=I.useContext(hs),[o,l]=I.useState(Y6(e));return I.useEffect(()=>{const c=vE(o);(!c||!ND(c,e))&&l(Y6(e))},[e,o]),a?D.jsx(Cu,{uuid:t,hint:i,label:n,children:D.jsx(Bv,{disabled:r,size:"xs",value:o,format:"rgba",eyeDropperIcon:D.jsx(wQ,{size:18,stroke:1.5}),popoverProps:{zIndex:1e3},styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},onChange:c=>{if(l(c),c.startsWith("rgba(")){const u=vE(c);u&&!ND(u,e)&&s(t,u)}},onKeyDown:c=>{if(c.key==="Enter"){const u=vE(o);u&&s(t,u)}},onBlur:()=>{const c=vE(o);c&&!ND(c,e)&&s(t,c)}})}):null}function _Ce({uuid:t,props:{hint:e,label:n,visible:i,disabled:r,options:a}}){const{messageSender:s}=I.useContext(hs);return i?D.jsx(Cu,{uuid:t,hint:e,label:n,children:D.jsx(ff,{justify:"space-between",columnGap:"xs",children:a.map((o,l)=>D.jsx(ks,{onClick:()=>s({type:"GuiUpdateMessage",uuid:t,updates:{value:o}}),style:{flexGrow:1,wuuidth:0},disabled:r,size:"compact-xs",variant:"outline",children:o},l))})}):null}const TI={},MQ=Ee.createContext(TI);function TQ(t){const e=Ee.useContext(MQ);return Ee.useMemo(function(){return typeof t=="function"?t(e):{...e,...t}},[e,t])}function SCe(t){let e;return t.disableParentContext?e=typeof t.components=="function"?t.components(TI):t.components||TI:e=TQ(t.components),Ee.createElement(MQ.Provider,{value:e},t.children)}const wCe=Object.freeze(Object.defineProperty({__proto__:null,MDXProvider:SCe,useMDXComponents:TQ},Symbol.toStringTag,{value:"Module"}));function xc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?J6(t.position):"start"in t||"end"in t?J6(t):"line"in t||"column"in t?AI(t):""}function AI(t){return $6(t&&t.line)+":"+$6(t&&t.column)}function J6(t){return AI(t&&t.start)+"-"+AI(t&&t.end)}function $6(t){return t&&typeof t=="number"?t:1}class tr extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?r=e:!a.cause&&e&&(s=!0,r=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?a.ruleId=i:(a.source=i.slice(0,l),a.ruleId=i.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=xc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tr.prototype.file="";tr.prototype.name="";tr.prototype.reason="";tr.prototype.message="";tr.prototype.stack="";tr.prototype.column=void 0;tr.prototype.line=void 0;tr.prototype.ancestors=void 0;tr.prototype.cause=void 0;tr.prototype.fatal=void 0;tr.prototype.place=void 0;tr.prototype.ruleId=void 0;tr.prototype.source=void 0;const Vu={basename:ECe,dirname:MCe,extname:TCe,join:ACe,sep:"/"};function ECe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');nS(t);let n=0,i=-1,r=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(a){n=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let s=-1,o=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(a){n=r+1;break}}else s<0&&(a=!0,s=r+1),o>-1&&(t.codePointAt(r)===e.codePointAt(o--)?o<0&&(i=r):(o=-1,i=s));return n===i?i=s:i<0&&(i=t.length),t.slice(n,i)}function MCe(t){if(nS(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function TCe(t){nS(t);let e=t.length,n=-1,i=0,r=-1,a=0,s;for(;e--;){const o=t.codePointAt(e);if(o===47){if(s){i=e+1;break}continue}n<0&&(s=!0,n=e+1),o===46?r<0?r=e:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||n<0||a===0||a===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function ACe(...t){let e=-1,n;for(;++e<t.length;)nS(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":CCe(n)}function CCe(t){nS(t);const e=t.codePointAt(0)===47;let n=RCe(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function RCe(t,e){let n="",i=0,r=-1,a=0,s=-1,o,l;for(;++s<=t.length;){if(s<t.length)o=t.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(r===s-1||a===1))if(r!==s-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),r=s,a=0;continue}}else if(n.length>0){n="",i=0,r=s,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,s):n=t.slice(r+1,s),i=s-r-1;r=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function nS(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const kCe={cwd:DCe};function DCe(){return"/"}function CI(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function OCe(t){if(typeof t=="string")t=new URL(t);else if(!CI(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return ICe(t)}function ICe(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const LD=["history","path","basename","stem","extname","dirname"];class AQ{constructor(e){let n;e?CI(e)?n={path:e}:typeof e=="string"||NCe(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":kCe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<LD.length;){const a=LD[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let r;for(r in n)LD.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?Vu.basename(this.path):void 0}set basename(e){UD(e,"basename"),PD(e,"basename"),this.path=Vu.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Vu.dirname(this.path):void 0}set dirname(e){Z6(this.basename,"dirname"),this.path=Vu.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Vu.extname(this.path):void 0}set extname(e){if(PD(e,"extname"),Z6(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Vu.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){CI(e)&&(e=OCe(e)),UD(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Vu.basename(this.path,this.extname):void 0}set stem(e){UD(e,"stem"),PD(e,"stem"),this.path=Vu.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const r=this.message(e,n,i);throw r.fatal=!0,r}info(e,n,i){const r=this.message(e,n,i);return r.fatal=void 0,r}message(e,n,i){const r=new tr(e,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function PD(t,e){if(t&&t.includes(Vu.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Vu.sep+"`")}function UD(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Z6(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function NCe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const LCe=["md","markdown","mdown","mkdn","mkd","mdwn","mkdown","ron"],PCe=LCe.map(function(t){return"."+t});function UCe(t,e){const n=FCe(t)?t:new AQ(t),{format:i,...r}=e||{};return{file:n,options:{format:i==="md"||i==="mdx"?i:n.extname&&(r.mdExtensions||PCe).includes(n.extname)?"md":"mdx",...r}}}function FCe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}const BCe=/[$_\p{ID_Start}]/u,zCe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,jCe=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,HCe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VCe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CQ={};function Yc(t){return t?BCe.test(String.fromCodePoint(t)):!1}function lx(t,e){const i=(e||CQ).jsx?jCe:zCe;return t?i.test(String.fromCodePoint(t)):!1}function of(t,e){return((e||CQ).jsx?VCe:HCe).test(t)}class GCe{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e}}replace(e,n,i,r){e&&n&&(i!=null?e[n][i]=r:e[n]=r)}remove(e,n,i){e&&n&&(i!=null?e[n].splice(i,1):delete e[n])}}class WCe extends GCe{constructor(e,n){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:i=>this.replacement=i},this.enter=e,this.leave=n}visit(e,n,i,r){if(e){if(this.enter){const s=this.should_skip,o=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,n,i,r),this.replacement&&(e=this.replacement,this.replace(n,i,r,e)),this.should_remove&&this.remove(n,i,r);const c=this.should_skip,u=this.should_remove;if(this.should_skip=s,this.should_remove=o,this.replacement=l,c)return e;if(u)return null}let a;for(a in e){const s=e[a];if(s&&typeof s=="object")if(Array.isArray(s)){const o=s;for(let l=0;l<o.length;l+=1){const c=o[l];Q6(c)&&(this.visit(c,e,a,l)||l--)}}else Q6(s)&&this.visit(s,e,a,null)}if(this.leave){const s=this.replacement,o=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,n,i,r),this.replacement&&(e=this.replacement,this.replace(n,i,r,e)),this.should_remove&&this.remove(n,i,r);const l=this.should_remove;if(this.replacement=s,this.should_remove=o,l)return null}}return e}}function Q6(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"}function T0(t,{enter:e,leave:n}){return new WCe(e,n).visit(t,null)}const FD=/@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g;function XCe(t,e){const n=e||{};let i=n.runtime==="automatic";const r={},a={};T0(t,{enter(s){if(s.type==="Program"){const o=s.comments||[];let l=-1;for(;++l<o.length;){FD.lastIndex=0;let c=FD.exec(o[l].value);for(;c;)r[c[1]]=c[2],c=FD.exec(o[l].value)}if(r.jsxRuntime)if(r.jsxRuntime==="automatic"){if(i=!0,r.jsx)throw new Error("Unexpected `@jsx` pragma w/ automatic runtime");if(r.jsxFrag)throw new Error("Unexpected `@jsxFrag` pragma w/ automatic runtime")}else if(r.jsxRuntime==="classic"){if(i=!1,r.jsxImportSource)throw new Error("Unexpected `@jsxImportSource` w/ classic runtime")}else throw new Error("Unexpected `jsxRuntime` `"+r.jsxRuntime+"`, expected `automatic` or `classic`")}},leave(s){if(s.type==="Program"){const b=[];if(a.fragment&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"Fragment"},local:{type:"Identifier",name:"_Fragment"}}),a.jsx&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsx"},local:{type:"Identifier",name:"_jsx"}}),a.jsxs&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsxs"},local:{type:"Identifier",name:"_jsxs"}}),a.jsxDEV&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsxDEV"},local:{type:"Identifier",name:"_jsxDEV"}}),b.length>0){let y=0;for(;y<s.body.length;){const p=s.body[y];if("directive"in p&&p.directive)y++;else break}s.body.splice(y,0,{type:"ImportDeclaration",specifiers:b,source:{type:"Literal",value:(r.jsxImportSource||n.importSource||"react")+(n.development?"/jsx-dev-runtime":"/jsx-runtime")}})}}if(s.type!=="JSXElement"&&s.type!=="JSXFragment")return;const o=[];let l=-1;for(;++l<s.children.length;){const b=s.children[l];if(b.type==="JSXExpressionContainer")b.expression.type!=="JSXEmptyExpression"&&o.push(b.expression);else if(b.type==="JSXText"){const y=b.value.replace(/\t/g," ").replace(/ *(\r?\n|\r) */g,`
`).replace(/\n+/g,`
`).replace(/\n+$/,"").replace(/^\n+/,"").replace(/\n/g," ");if(y){const p={type:"Literal",value:y};p1(b,p),o.push(p)}}else b.type!=="JSXElement"&&b.type!=="JSXFragment"&&b.type,o.push(b)}let c;const u=[];let f=[],h;if(s.type==="JSXElement"){if(c=hT(s.openingElement.name),c.type==="Identifier"&&/^[a-z]/.test(c.name)){const x={type:"Literal",value:c.name};p1(c,x),c=x}let b;const y=s.openingElement.attributes;let p=-1;for(;++p<y.length;){const x=y[p];if(x.type==="JSXSpreadAttribute")x.argument.type==="ObjectExpression"?u.push(...x.argument.properties):u.push({type:"SpreadElement",argument:x.argument}),b=!0;else{const _=qCe(x);if(i&&_.key.type==="Identifier"&&_.key.name==="key"){if(b)throw new Error("Expected `key` to come before any spread expressions");const w=_.value;w.type!=="AssignmentPattern"&&w.type!=="ArrayPattern"&&w.type!=="ObjectPattern"&&w.type,h=w}else u.push(_)}}}else i?(a.fragment=!0,c={type:"Identifier",name:"_Fragment"}):c=eH(r.jsxFrag||n.pragmaFrag||"React.Fragment");i?o.length>0&&u.push({type:"Property",key:{type:"Identifier",name:"children"},value:o.length>1?{type:"ArrayExpression",elements:o}:o[0],kind:"init",method:!1,shorthand:!1,computed:!1}):f=o;let d;if(i){f.push({type:"ObjectExpression",properties:u}),h?f.push(h):n.development&&f.push({type:"Identifier",name:"undefined"});const b=o.length>1;if(n.development){a.jsxDEV=!0,d={type:"Identifier",name:"_jsxDEV"},f.push({type:"Literal",value:b});const y={type:"ObjectExpression",properties:[{type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"fileName"},value:{type:"Literal",value:n.filePath||"<source.js>"}}]};s.loc&&y.properties.push({type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"lineNumber"},value:{type:"Literal",value:s.loc.start.line}},{type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"columnNumber"},value:{type:"Literal",value:s.loc.start.column+1}}),f.push(y,{type:"ThisExpression"})}else b?(a.jsxs=!0,d={type:"Identifier",name:"_jsxs"}):(a.jsx=!0,d={type:"Identifier",name:"_jsx"})}else u.length>0?f.unshift({type:"ObjectExpression",properties:u}):f.length>0&&f.unshift({type:"Literal",value:null}),d=eH(r.jsx||n.pragma||"React.createElement");f.unshift(c);const g={type:"CallExpression",callee:d,arguments:f,optional:!1};p1(s,g),this.replace(g)}})}function qCe(t){let e;if(t.value)if(t.value.type==="JSXExpressionContainer"){const i=t.value.expression;i.type,e=i}else{const i=t.value;i.type!=="JSXElement"&&i.type,e=i,delete e.raw}else e={type:"Literal",value:!0};const n={type:"Property",key:hT(t.name),value:e,kind:"init",method:!1,shorthand:!1,computed:!1};return p1(t,n),n}function hT(t){let e;if(t.type==="JSXMemberExpression"){const n=hT(t.property);e={type:"MemberExpression",object:hT(t.object),property:n,computed:n.type==="Literal",optional:!1}}else t.type==="JSXNamespacedName"?e={type:"Literal",value:t.namespace.name+":"+t.name.name}:e=of(t.name)?{type:"Identifier",name:t.name}:{type:"Literal",value:t.name};return p1(t,e),e}function eH(t){const e=t.split(".");let n=-1,i;for(;++n<e.length;){const r=of(e[n])?{type:"Identifier",name:e[n]}:{type:"Literal",value:e[n]};i=i?{type:"MemberExpression",object:i,property:r,computed:!!(n&&r.type==="Literal"),optional:!1}:r}return i}function p1(t,e){const n=["start","end","loc","range","comments"];let i=-1;for(;++i<n.length;){const r=n[i];r in t&&(e[r]=t[r])}}function KCe(t){return function(e,n){XCe(e,{filePath:n.history[0],...t})}}var RQ={exports:{}},YCe={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},yE={exports:{}},tH;function RI(){return tH||(tH=1,function(t,e){(function(n,i){i(e)})(zm,function(n){var i=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],r=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],a="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏０-９＿･",s="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",o={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},l="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",c={5:l,"5module":l+" export import",6:l+" const class extends export import super"},u=/^in(stanceof)?$/,f=new RegExp("["+s+"]"),h=new RegExp("["+s+a+"]");function d(E,L){for(var J=65536,re=0;re<L.length;re+=2){if(J+=L[re],J>E)return!1;if(J+=L[re+1],J>=E)return!0}return!1}function g(E,L){return E<65?E===36:E<91?!0:E<97?E===95:E<123?!0:E<=65535?E>=170&&f.test(String.fromCharCode(E)):L===!1?!1:d(E,r)}function b(E,L){return E<48?E===36:E<58?!0:E<65?!1:E<91?!0:E<97?E===95:E<123?!0:E<=65535?E>=170&&h.test(String.fromCharCode(E)):L===!1?!1:d(E,r)||d(E,i)}var y=function(L,J){J===void 0&&(J={}),this.label=L,this.keyword=J.keyword,this.beforeExpr=!!J.beforeExpr,this.startsExpr=!!J.startsExpr,this.isLoop=!!J.isLoop,this.isAssign=!!J.isAssign,this.prefix=!!J.prefix,this.postfix=!!J.postfix,this.binop=J.binop||null,this.updateContext=null};function p(E,L){return new y(E,{beforeExpr:!0,binop:L})}var x={beforeExpr:!0},_={startsExpr:!0},w={};function M(E,L){return L===void 0&&(L={}),L.keyword=E,w[E]=new y(E,L)}var S={num:new y("num",_),regexp:new y("regexp",_),string:new y("string",_),name:new y("name",_),privateId:new y("privateId",_),eof:new y("eof"),bracketL:new y("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new y("]"),braceL:new y("{",{beforeExpr:!0,startsExpr:!0}),braceR:new y("}"),parenL:new y("(",{beforeExpr:!0,startsExpr:!0}),parenR:new y(")"),comma:new y(",",x),semi:new y(";",x),colon:new y(":",x),dot:new y("."),question:new y("?",x),questionDot:new y("?."),arrow:new y("=>",x),template:new y("template"),invalidTemplate:new y("invalidTemplate"),ellipsis:new y("...",x),backQuote:new y("`",_),dollarBraceL:new y("${",{beforeExpr:!0,startsExpr:!0}),eq:new y("=",{beforeExpr:!0,isAssign:!0}),assign:new y("_=",{beforeExpr:!0,isAssign:!0}),incDec:new y("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new y("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:p("||",1),logicalAND:p("&&",2),bitwiseOR:p("|",3),bitwiseXOR:p("^",4),bitwiseAND:p("&",5),equality:p("==/!=/===/!==",6),relational:p("</>/<=/>=",7),bitShift:p("<</>>/>>>",8),plusMin:new y("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:p("%",10),star:p("*",10),slash:p("/",10),starstar:new y("**",{beforeExpr:!0}),coalesce:p("??",1),_break:M("break"),_case:M("case",x),_catch:M("catch"),_continue:M("continue"),_debugger:M("debugger"),_default:M("default",x),_do:M("do",{isLoop:!0,beforeExpr:!0}),_else:M("else",x),_finally:M("finally"),_for:M("for",{isLoop:!0}),_function:M("function",_),_if:M("if"),_return:M("return",x),_switch:M("switch"),_throw:M("throw",x),_try:M("try"),_var:M("var"),_const:M("const"),_while:M("while",{isLoop:!0}),_with:M("with"),_new:M("new",{beforeExpr:!0,startsExpr:!0}),_this:M("this",_),_super:M("super",_),_class:M("class",_),_extends:M("extends",x),_export:M("export"),_import:M("import",_),_null:M("null",_),_true:M("true",_),_false:M("false",_),_in:M("in",{beforeExpr:!0,binop:7}),_instanceof:M("instanceof",{beforeExpr:!0,binop:7}),_typeof:M("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:M("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:M("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},A=/\r\n?|\n|\u2028|\u2029/,C=new RegExp(A.source,"g");function k(E){return E===10||E===13||E===8232||E===8233}function R(E,L,J){J===void 0&&(J=E.length);for(var re=L;re<J;re++){var ye=E.charCodeAt(re);if(k(ye))return re<J-1&&ye===13&&E.charCodeAt(re+1)===10?re+2:re+1}return-1}var N=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,P=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,j=Object.prototype,z=j.hasOwnProperty,X=j.toString,F=Object.hasOwn||function(E,L){return z.call(E,L)},H=Array.isArray||function(E){return X.call(E)==="[object Array]"},V=Object.create(null);function W(E){return V[E]||(V[E]=new RegExp("^(?:"+E.replace(/ /g,"|")+")$"))}function B(E){return E<=65535?String.fromCharCode(E):(E-=65536,String.fromCharCode((E>>10)+55296,(E&1023)+56320))}var Y=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Z=function(L,J){this.line=L,this.column=J};Z.prototype.offset=function(L){return new Z(this.line,this.column+L)};var G=function(L,J,re){this.start=J,this.end=re,L.sourceFile!==null&&(this.source=L.sourceFile)};function de(E,L){for(var J=1,re=0;;){var ye=R(E,re,L);if(ye<0)return new Z(J,L-re);++J,re=ye}}var oe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},le=!1;function ue(E){var L={};for(var J in oe)L[J]=E&&F(E,J)?E[J]:oe[J];if(L.ecmaVersion==="latest"?L.ecmaVersion=1e8:L.ecmaVersion==null?(!le&&typeof console=="object"&&console.warn&&(le=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
Defaulting to 2020, but this will stop working in the future.`)),L.ecmaVersion=11):L.ecmaVersion>=2015&&(L.ecmaVersion-=2009),L.allowReserved==null&&(L.allowReserved=L.ecmaVersion<5),(!E||E.allowHashBang==null)&&(L.allowHashBang=L.ecmaVersion>=14),H(L.onToken)){var re=L.onToken;L.onToken=function(ye){return re.push(ye)}}return H(L.onComment)&&(L.onComment=Se(L,L.onComment)),L}function Se(E,L){return function(J,re,ye,$e,tt,Lt){var zt={type:J?"Block":"Line",value:re,start:ye,end:$e};E.locations&&(zt.loc=new G(this,tt,Lt)),E.ranges&&(zt.range=[ye,$e]),L.push(zt)}}var Te=1,Pe=2,je=4,He=8,pe=16,ze=32,Ie=64,Xe=128,we=256,Ae=512,Re=Te|Pe|we;function Ne(E,L){return Pe|(E?je:0)|(L?He:0)}var Fe=0,Qe=1,ae=2,K=3,ce=4,he=5,me=function(L,J,re){this.options=L=ue(L),this.sourceFile=L.sourceFile,this.keywords=W(c[L.ecmaVersion>=6?6:L.sourceType==="module"?"5module":5]);var ye="";L.allowReserved!==!0&&(ye=o[L.ecmaVersion>=6?6:L.ecmaVersion===5?5:3],L.sourceType==="module"&&(ye+=" await")),this.reservedWords=W(ye);var $e=(ye?ye+" ":"")+o.strict;this.reservedWordsStrict=W($e),this.reservedWordsStrictBind=W($e+" "+o.strictBind),this.input=String(J),this.containsEsc=!1,re?(this.pos=re,this.lineStart=this.input.lastIndexOf(`
`,re-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(A).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=L.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&L.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Te),this.regexpState=null,this.privateNameStack=[]},$={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};me.prototype.parse=function(){var L=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(L)},$.inFunction.get=function(){return(this.currentVarScope().flags&Pe)>0},$.inGenerator.get=function(){return(this.currentVarScope().flags&He)>0},$.inAsync.get=function(){return(this.currentVarScope().flags&je)>0},$.canAwait.get=function(){for(var E=this.scopeStack.length-1;E>=0;E--){var L=this.scopeStack[E],J=L.flags;if(J&(we|Ae))return!1;if(J&Pe)return(J&je)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},$.allowSuper.get=function(){var E=this.currentThisScope(),L=E.flags;return(L&Ie)>0||this.options.allowSuperOutsideMethod},$.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Xe)>0},$.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},$.allowNewDotTarget.get=function(){for(var E=this.scopeStack.length-1;E>=0;E--){var L=this.scopeStack[E],J=L.flags;if(J&(we|Ae)||J&Pe&&!(J&pe))return!0}return!1},$.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&we)>0},me.extend=function(){for(var L=[],J=arguments.length;J--;)L[J]=arguments[J];for(var re=this,ye=0;ye<L.length;ye++)re=L[ye](re);return re},me.parse=function(L,J){return new this(J,L).parse()},me.parseExpressionAt=function(L,J,re){var ye=new this(re,L,J);return ye.nextToken(),ye.parseExpression()},me.tokenizer=function(L,J){return new this(J,L)},Object.defineProperties(me.prototype,$);var Ve=me.prototype,qe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Ve.strictDirective=function(E){if(this.options.ecmaVersion<5)return!1;for(;;){P.lastIndex=E,E+=P.exec(this.input)[0].length;var L=qe.exec(this.input.slice(E));if(!L)return!1;if((L[1]||L[2])==="use strict"){P.lastIndex=E+L[0].length;var J=P.exec(this.input),re=J.index+J[0].length,ye=this.input.charAt(re);return ye===";"||ye==="}"||A.test(J[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(ye)||ye==="!"&&this.input.charAt(re+1)==="=")}E+=L[0].length,P.lastIndex=E,E+=P.exec(this.input)[0].length,this.input[E]===";"&&E++}},Ve.eat=function(E){return this.type===E?(this.next(),!0):!1},Ve.isContextual=function(E){return this.type===S.name&&this.value===E&&!this.containsEsc},Ve.eatContextual=function(E){return this.isContextual(E)?(this.next(),!0):!1},Ve.expectContextual=function(E){this.eatContextual(E)||this.unexpected()},Ve.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||A.test(this.input.slice(this.lastTokEnd,this.start))},Ve.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ve.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()},Ve.afterTrailingComma=function(E,L){if(this.type===E)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),L||this.next(),!0},Ve.expect=function(E){this.eat(E)||this.unexpected()},Ve.unexpected=function(E){this.raise(E??this.start,"Unexpected token")};var mt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ve.checkPatternErrors=function(E,L){if(E){E.trailingComma>-1&&this.raiseRecoverable(E.trailingComma,"Comma is not permitted after the rest element");var J=L?E.parenthesizedAssign:E.parenthesizedBind;J>-1&&this.raiseRecoverable(J,L?"Assigning to rvalue":"Parenthesized pattern")}},Ve.checkExpressionErrors=function(E,L){if(!E)return!1;var J=E.shorthandAssign,re=E.doubleProto;if(!L)return J>=0||re>=0;J>=0&&this.raise(J,"Shorthand property assignments are valid only in destructuring patterns"),re>=0&&this.raiseRecoverable(re,"Redefinition of __proto__ property")},Ve.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Ve.isSimpleAssignTarget=function(E){return E.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(E.expression):E.type==="Identifier"||E.type==="MemberExpression"};var Ge=me.prototype;Ge.parseTopLevel=function(E){var L=Object.create(null);for(E.body||(E.body=[]);this.type!==S.eof;){var J=this.parseStatement(null,!0,L);E.body.push(J)}if(this.inModule)for(var re=0,ye=Object.keys(this.undefinedExports);re<ye.length;re+=1){var $e=ye[re];this.raiseRecoverable(this.undefinedExports[$e].start,"Export '"+$e+"' is not defined")}return this.adaptDirectivePrologue(E.body),this.next(),E.sourceType=this.options.sourceType,this.finishNode(E,"Program")};var Je={kind:"loop"},Ye={kind:"switch"};Ge.isLet=function(E){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;P.lastIndex=this.pos;var L=P.exec(this.input),J=this.pos+L[0].length,re=this.input.charCodeAt(J);if(re===91||re===92)return!0;if(E)return!1;if(re===123||re>55295&&re<56320)return!0;if(g(re,!0)){for(var ye=J+1;b(re=this.input.charCodeAt(ye),!0);)++ye;if(re===92||re>55295&&re<56320)return!0;var $e=this.input.slice(J,ye);if(!u.test($e))return!0}return!1},Ge.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;P.lastIndex=this.pos;var E=P.exec(this.input),L=this.pos+E[0].length,J;return!A.test(this.input.slice(this.pos,L))&&this.input.slice(L,L+8)==="function"&&(L+8===this.input.length||!(b(J=this.input.charCodeAt(L+8))||J>55295&&J<56320))},Ge.isUsingKeyword=function(E,L){if(this.options.ecmaVersion<17||!this.isContextual(E?"await":"using"))return!1;P.lastIndex=this.pos;var J=P.exec(this.input),re=this.pos+J[0].length;if(A.test(this.input.slice(this.pos,re)))return!1;if(E){var ye=re+5,$e;if(this.input.slice(re,ye)!=="using"||ye===this.input.length||b($e=this.input.charCodeAt(ye))||$e>55295&&$e<56320)return!1;P.lastIndex=ye;var tt=P.exec(this.input);if(tt&&A.test(this.input.slice(ye,ye+tt[0].length)))return!1}if(L){var Lt=re+2,zt;if(this.input.slice(re,Lt)==="of"&&(Lt===this.input.length||!b(zt=this.input.charCodeAt(Lt))&&!(zt>55295&&zt<56320)))return!1}var gn=this.input.charCodeAt(re);return g(gn,!0)||gn===92},Ge.isAwaitUsing=function(E){return this.isUsingKeyword(!0,E)},Ge.isUsing=function(E){return this.isUsingKeyword(!1,E)},Ge.parseStatement=function(E,L,J){var re=this.type,ye=this.startNode(),$e;switch(this.isLet(E)&&(re=S._var,$e="let"),re){case S._break:case S._continue:return this.parseBreakContinueStatement(ye,re.keyword);case S._debugger:return this.parseDebuggerStatement(ye);case S._do:return this.parseDoStatement(ye);case S._for:return this.parseForStatement(ye);case S._function:return E&&(this.strict||E!=="if"&&E!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(ye,!1,!E);case S._class:return E&&this.unexpected(),this.parseClass(ye,!0);case S._if:return this.parseIfStatement(ye);case S._return:return this.parseReturnStatement(ye);case S._switch:return this.parseSwitchStatement(ye);case S._throw:return this.parseThrowStatement(ye);case S._try:return this.parseTryStatement(ye);case S._const:case S._var:return $e=$e||this.value,E&&$e!=="var"&&this.unexpected(),this.parseVarStatement(ye,$e);case S._while:return this.parseWhileStatement(ye);case S._with:return this.parseWithStatement(ye);case S.braceL:return this.parseBlock(!0,ye);case S.semi:return this.parseEmptyStatement(ye);case S._export:case S._import:if(this.options.ecmaVersion>10&&re===S._import){P.lastIndex=this.pos;var tt=P.exec(this.input),Lt=this.pos+tt[0].length,zt=this.input.charCodeAt(Lt);if(zt===40||zt===46)return this.parseExpressionStatement(ye,this.parseExpression())}return this.options.allowImportExportEverywhere||(L||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),re===S._import?this.parseImport(ye):this.parseExport(ye,J);default:if(this.isAsyncFunction())return E&&this.unexpected(),this.next(),this.parseFunctionStatement(ye,!0,!E);var gn=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(gn)return L&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),gn==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(ye,!1,gn),this.semicolon(),this.finishNode(ye,"VariableDeclaration");var Mn=this.value,Ei=this.parseExpression();return re===S.name&&Ei.type==="Identifier"&&this.eat(S.colon)?this.parseLabeledStatement(ye,Mn,Ei,E):this.parseExpressionStatement(ye,Ei)}},Ge.parseBreakContinueStatement=function(E,L){var J=L==="break";this.next(),this.eat(S.semi)||this.insertSemicolon()?E.label=null:this.type!==S.name?this.unexpected():(E.label=this.parseIdent(),this.semicolon());for(var re=0;re<this.labels.length;++re){var ye=this.labels[re];if((E.label==null||ye.name===E.label.name)&&(ye.kind!=null&&(J||ye.kind==="loop")||E.label&&J))break}return re===this.labels.length&&this.raise(E.start,"Unsyntactic "+L),this.finishNode(E,J?"BreakStatement":"ContinueStatement")},Ge.parseDebuggerStatement=function(E){return this.next(),this.semicolon(),this.finishNode(E,"DebuggerStatement")},Ge.parseDoStatement=function(E){return this.next(),this.labels.push(Je),E.body=this.parseStatement("do"),this.labels.pop(),this.expect(S._while),E.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(S.semi):this.semicolon(),this.finishNode(E,"DoWhileStatement")},Ge.parseForStatement=function(E){this.next();var L=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Je),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return L>-1&&this.unexpected(L),this.parseFor(E,null);var J=this.isLet();if(this.type===S._var||this.type===S._const||J){var re=this.startNode(),ye=J?"let":this.value;return this.next(),this.parseVar(re,!0,ye),this.finishNode(re,"VariableDeclaration"),this.parseForAfterInit(E,re,L)}var $e=this.isContextual("let"),tt=!1,Lt=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Lt){var zt=this.startNode();return this.next(),Lt==="await using"&&this.next(),this.parseVar(zt,!0,Lt),this.finishNode(zt,"VariableDeclaration"),this.parseForAfterInit(E,zt,L)}var gn=this.containsEsc,Mn=new mt,Ei=this.start,Cn=L>-1?this.parseExprSubscripts(Mn,"await"):this.parseExpression(!0,Mn);return this.type===S._in||(tt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(L>-1?(this.type===S._in&&this.unexpected(L),E.await=!0):tt&&this.options.ecmaVersion>=8&&(Cn.start===Ei&&!gn&&Cn.type==="Identifier"&&Cn.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(E.await=!1)),$e&&tt&&this.raise(Cn.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Cn,!1,Mn),this.checkLValPattern(Cn),this.parseForIn(E,Cn)):(this.checkExpressionErrors(Mn,!0),L>-1&&this.unexpected(L),this.parseFor(E,Cn))},Ge.parseForAfterInit=function(E,L,J){return(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&L.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===S._in?J>-1&&this.unexpected(J):E.await=J>-1),this.parseForIn(E,L)):(J>-1&&this.unexpected(J),this.parseFor(E,L))},Ge.parseFunctionStatement=function(E,L,J){return this.next(),this.parseFunction(E,Mt|(J?0:gt),!1,L)},Ge.parseIfStatement=function(E){return this.next(),E.test=this.parseParenExpression(),E.consequent=this.parseStatement("if"),E.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(E,"IfStatement")},Ge.parseReturnStatement=function(E){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?E.argument=null:(E.argument=this.parseExpression(),this.semicolon()),this.finishNode(E,"ReturnStatement")},Ge.parseSwitchStatement=function(E){this.next(),E.discriminant=this.parseParenExpression(),E.cases=[],this.expect(S.braceL),this.labels.push(Ye),this.enterScope(0);for(var L,J=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var re=this.type===S._case;L&&this.finishNode(L,"SwitchCase"),E.cases.push(L=this.startNode()),L.consequent=[],this.next(),re?L.test=this.parseExpression():(J&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),J=!0,L.test=null),this.expect(S.colon)}else L||this.unexpected(),L.consequent.push(this.parseStatement(null));return this.exitScope(),L&&this.finishNode(L,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(E,"SwitchStatement")},Ge.parseThrowStatement=function(E){return this.next(),A.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),E.argument=this.parseExpression(),this.semicolon(),this.finishNode(E,"ThrowStatement")};var vt=[];Ge.parseCatchClauseParam=function(){var E=this.parseBindingAtom(),L=E.type==="Identifier";return this.enterScope(L?ze:0),this.checkLValPattern(E,L?ce:ae),this.expect(S.parenR),E},Ge.parseTryStatement=function(E){if(this.next(),E.block=this.parseBlock(),E.handler=null,this.type===S._catch){var L=this.startNode();this.next(),this.eat(S.parenL)?L.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),L.param=null,this.enterScope(0)),L.body=this.parseBlock(!1),this.exitScope(),E.handler=this.finishNode(L,"CatchClause")}return E.finalizer=this.eat(S._finally)?this.parseBlock():null,!E.handler&&!E.finalizer&&this.raise(E.start,"Missing catch or finally clause"),this.finishNode(E,"TryStatement")},Ge.parseVarStatement=function(E,L,J){return this.next(),this.parseVar(E,!1,L,J),this.semicolon(),this.finishNode(E,"VariableDeclaration")},Ge.parseWhileStatement=function(E){return this.next(),E.test=this.parseParenExpression(),this.labels.push(Je),E.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(E,"WhileStatement")},Ge.parseWithStatement=function(E){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),E.object=this.parseParenExpression(),E.body=this.parseStatement("with"),this.finishNode(E,"WithStatement")},Ge.parseEmptyStatement=function(E){return this.next(),this.finishNode(E,"EmptyStatement")},Ge.parseLabeledStatement=function(E,L,J,re){for(var ye=0,$e=this.labels;ye<$e.length;ye+=1){var tt=$e[ye];tt.name===L&&this.raise(J.start,"Label '"+L+"' is already declared")}for(var Lt=this.type.isLoop?"loop":this.type===S._switch?"switch":null,zt=this.labels.length-1;zt>=0;zt--){var gn=this.labels[zt];if(gn.statementStart===E.start)gn.statementStart=this.start,gn.kind=Lt;else break}return this.labels.push({name:L,kind:Lt,statementStart:this.start}),E.body=this.parseStatement(re?re.indexOf("label")===-1?re+"label":re:"label"),this.labels.pop(),E.label=J,this.finishNode(E,"LabeledStatement")},Ge.parseExpressionStatement=function(E,L){return E.expression=L,this.semicolon(),this.finishNode(E,"ExpressionStatement")},Ge.parseBlock=function(E,L,J){for(E===void 0&&(E=!0),L===void 0&&(L=this.startNode()),L.body=[],this.expect(S.braceL),E&&this.enterScope(0);this.type!==S.braceR;){var re=this.parseStatement(null);L.body.push(re)}return J&&(this.strict=!1),this.next(),E&&this.exitScope(),this.finishNode(L,"BlockStatement")},Ge.parseFor=function(E,L){return E.init=L,this.expect(S.semi),E.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),E.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),E.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(E,"ForStatement")},Ge.parseForIn=function(E,L){var J=this.type===S._in;return this.next(),L.type==="VariableDeclaration"&&L.declarations[0].init!=null&&(!J||this.options.ecmaVersion<8||this.strict||L.kind!=="var"||L.declarations[0].id.type!=="Identifier")&&this.raise(L.start,(J?"for-in":"for-of")+" loop variable declaration may not have an initializer"),E.left=L,E.right=J?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),E.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(E,J?"ForInStatement":"ForOfStatement")},Ge.parseVar=function(E,L,J,re){for(E.declarations=[],E.kind=J;;){var ye=this.startNode();if(this.parseVarId(ye,J),this.eat(S.eq)?ye.init=this.parseMaybeAssign(L):!re&&J==="const"&&!(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!re&&(J==="using"||J==="await using")&&this.options.ecmaVersion>=17&&this.type!==S._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+J+" declaration"):!re&&ye.id.type!=="Identifier"&&!(L&&(this.type===S._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):ye.init=null,E.declarations.push(this.finishNode(ye,"VariableDeclarator")),!this.eat(S.comma))break}return E},Ge.parseVarId=function(E,L){E.id=L==="using"||L==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(E.id,L==="var"?Qe:ae,!1)};var Mt=1,gt=2,kt=4;Ge.parseFunction=function(E,L,J,re,ye){this.initFunction(E),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!re)&&(this.type===S.star&&L&gt&&this.unexpected(),E.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(E.async=!!re),L&Mt&&(E.id=L&kt&&this.type!==S.name?null:this.parseIdent(),E.id&&!(L&gt)&&this.checkLValSimple(E.id,this.strict||E.generator||E.async?this.treatFunctionsAsVar?Qe:ae:K));var $e=this.yieldPos,tt=this.awaitPos,Lt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ne(E.async,E.generator)),L&Mt||(E.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(E),this.parseFunctionBody(E,J,!1,ye),this.yieldPos=$e,this.awaitPos=tt,this.awaitIdentPos=Lt,this.finishNode(E,L&Mt?"FunctionDeclaration":"FunctionExpression")},Ge.parseFunctionParams=function(E){this.expect(S.parenL),E.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Ge.parseClass=function(E,L){this.next();var J=this.strict;this.strict=!0,this.parseClassId(E,L),this.parseClassSuper(E);var re=this.enterClassBody(),ye=this.startNode(),$e=!1;for(ye.body=[],this.expect(S.braceL);this.type!==S.braceR;){var tt=this.parseClassElement(E.superClass!==null);tt&&(ye.body.push(tt),tt.type==="MethodDefinition"&&tt.kind==="constructor"?($e&&this.raiseRecoverable(tt.start,"Duplicate constructor in the same class"),$e=!0):tt.key&&tt.key.type==="PrivateIdentifier"&&ke(re,tt)&&this.raiseRecoverable(tt.key.start,"Identifier '#"+tt.key.name+"' has already been declared"))}return this.strict=J,this.next(),E.body=this.finishNode(ye,"ClassBody"),this.exitClassBody(),this.finishNode(E,L?"ClassDeclaration":"ClassExpression")},Ge.parseClassElement=function(E){if(this.eat(S.semi))return null;var L=this.options.ecmaVersion,J=this.startNode(),re="",ye=!1,$e=!1,tt="method",Lt=!1;if(this.eatContextual("static")){if(L>=13&&this.eat(S.braceL))return this.parseClassStaticBlock(J),J;this.isClassElementNameStart()||this.type===S.star?Lt=!0:re="static"}if(J.static=Lt,!re&&L>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===S.star)&&!this.canInsertSemicolon()?$e=!0:re="async"),!re&&(L>=9||!$e)&&this.eat(S.star)&&(ye=!0),!re&&!$e&&!ye){var zt=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?tt=zt:re=zt)}if(re?(J.computed=!1,J.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),J.key.name=re,this.finishNode(J.key,"Identifier")):this.parseClassElementName(J),L<13||this.type===S.parenL||tt!=="method"||ye||$e){var gn=!J.static&&Le(J,"constructor"),Mn=gn&&E;gn&&tt!=="method"&&this.raise(J.key.start,"Constructor can't have get/set modifier"),J.kind=gn?"constructor":tt,this.parseClassMethod(J,ye,$e,Mn)}else this.parseClassField(J);return J},Ge.isClassElementNameStart=function(){return this.type===S.name||this.type===S.privateId||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword},Ge.parseClassElementName=function(E){this.type===S.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),E.computed=!1,E.key=this.parsePrivateIdent()):this.parsePropertyName(E)},Ge.parseClassMethod=function(E,L,J,re){var ye=E.key;E.kind==="constructor"?(L&&this.raise(ye.start,"Constructor can't be a generator"),J&&this.raise(ye.start,"Constructor can't be an async method")):E.static&&Le(E,"prototype")&&this.raise(ye.start,"Classes may not have a static property named prototype");var $e=E.value=this.parseMethod(L,J,re);return E.kind==="get"&&$e.params.length!==0&&this.raiseRecoverable($e.start,"getter should have no params"),E.kind==="set"&&$e.params.length!==1&&this.raiseRecoverable($e.start,"setter should have exactly one param"),E.kind==="set"&&$e.params[0].type==="RestElement"&&this.raiseRecoverable($e.params[0].start,"Setter cannot use rest params"),this.finishNode(E,"MethodDefinition")},Ge.parseClassField=function(E){return Le(E,"constructor")?this.raise(E.key.start,"Classes can't have a field named 'constructor'"):E.static&&Le(E,"prototype")&&this.raise(E.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Ae|Ie),E.value=this.parseMaybeAssign(),this.exitScope()):E.value=null,this.semicolon(),this.finishNode(E,"PropertyDefinition")},Ge.parseClassStaticBlock=function(E){E.body=[];var L=this.labels;for(this.labels=[],this.enterScope(we|Ie);this.type!==S.braceR;){var J=this.parseStatement(null);E.body.push(J)}return this.next(),this.exitScope(),this.labels=L,this.finishNode(E,"StaticBlock")},Ge.parseClassId=function(E,L){this.type===S.name?(E.id=this.parseIdent(),L&&this.checkLValSimple(E.id,ae,!1)):(L===!0&&this.unexpected(),E.id=null)},Ge.parseClassSuper=function(E){E.superClass=this.eat(S._extends)?this.parseExprSubscripts(null,!1):null},Ge.enterClassBody=function(){var E={declared:Object.create(null),used:[]};return this.privateNameStack.push(E),E.declared},Ge.exitClassBody=function(){var E=this.privateNameStack.pop(),L=E.declared,J=E.used;if(this.options.checkPrivateFields)for(var re=this.privateNameStack.length,ye=re===0?null:this.privateNameStack[re-1],$e=0;$e<J.length;++$e){var tt=J[$e];F(L,tt.name)||(ye?ye.used.push(tt):this.raiseRecoverable(tt.start,"Private field '#"+tt.name+"' must be declared in an enclosing class"))}};function ke(E,L){var J=L.key.name,re=E[J],ye="true";return L.type==="MethodDefinition"&&(L.kind==="get"||L.kind==="set")&&(ye=(L.static?"s":"i")+L.kind),re==="iget"&&ye==="iset"||re==="iset"&&ye==="iget"||re==="sget"&&ye==="sset"||re==="sset"&&ye==="sget"?(E[J]="true",!1):re?!0:(E[J]=ye,!1)}function Le(E,L){var J=E.computed,re=E.key;return!J&&(re.type==="Identifier"&&re.name===L||re.type==="Literal"&&re.value===L)}Ge.parseExportAllDeclaration=function(E,L){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(E.exported=this.parseModuleExportName(),this.checkExport(L,E.exported,this.lastTokStart)):E.exported=null),this.expectContextual("from"),this.type!==S.string&&this.unexpected(),E.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(E,"ExportAllDeclaration")},Ge.parseExport=function(E,L){if(this.next(),this.eat(S.star))return this.parseExportAllDeclaration(E,L);if(this.eat(S._default))return this.checkExport(L,"default",this.lastTokStart),E.declaration=this.parseExportDefaultDeclaration(),this.finishNode(E,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())E.declaration=this.parseExportDeclaration(E),E.declaration.type==="VariableDeclaration"?this.checkVariableExport(L,E.declaration.declarations):this.checkExport(L,E.declaration.id,E.declaration.id.start),E.specifiers=[],E.source=null,this.options.ecmaVersion>=16&&(E.attributes=[]);else{if(E.declaration=null,E.specifiers=this.parseExportSpecifiers(L),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),E.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause());else{for(var J=0,re=E.specifiers;J<re.length;J+=1){var ye=re[J];this.checkUnreserved(ye.local),this.checkLocalExport(ye.local),ye.local.type==="Literal"&&this.raise(ye.local.start,"A string literal cannot be used as an exported binding without `from`.")}E.source=null,this.options.ecmaVersion>=16&&(E.attributes=[])}this.semicolon()}return this.finishNode(E,"ExportNamedDeclaration")},Ge.parseExportDeclaration=function(E){return this.parseStatement(null)},Ge.parseExportDefaultDeclaration=function(){var E;if(this.type===S._function||(E=this.isAsyncFunction())){var L=this.startNode();return this.next(),E&&this.next(),this.parseFunction(L,Mt|kt,!1,E)}else if(this.type===S._class){var J=this.startNode();return this.parseClass(J,"nullableID")}else{var re=this.parseMaybeAssign();return this.semicolon(),re}},Ge.checkExport=function(E,L,J){E&&(typeof L!="string"&&(L=L.type==="Identifier"?L.name:L.value),F(E,L)&&this.raiseRecoverable(J,"Duplicate export '"+L+"'"),E[L]=!0)},Ge.checkPatternExport=function(E,L){var J=L.type;if(J==="Identifier")this.checkExport(E,L,L.start);else if(J==="ObjectPattern")for(var re=0,ye=L.properties;re<ye.length;re+=1){var $e=ye[re];this.checkPatternExport(E,$e)}else if(J==="ArrayPattern")for(var tt=0,Lt=L.elements;tt<Lt.length;tt+=1){var zt=Lt[tt];zt&&this.checkPatternExport(E,zt)}else J==="Property"?this.checkPatternExport(E,L.value):J==="AssignmentPattern"?this.checkPatternExport(E,L.left):J==="RestElement"&&this.checkPatternExport(E,L.argument)},Ge.checkVariableExport=function(E,L){if(E)for(var J=0,re=L;J<re.length;J+=1){var ye=re[J];this.checkPatternExport(E,ye.id)}},Ge.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},Ge.parseExportSpecifier=function(E){var L=this.startNode();return L.local=this.parseModuleExportName(),L.exported=this.eatContextual("as")?this.parseModuleExportName():L.local,this.checkExport(E,L.exported,L.exported.start),this.finishNode(L,"ExportSpecifier")},Ge.parseExportSpecifiers=function(E){var L=[],J=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(J)J=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;L.push(this.parseExportSpecifier(E))}return L},Ge.parseImport=function(E){return this.next(),this.type===S.string?(E.specifiers=vt,E.source=this.parseExprAtom()):(E.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),E.source=this.type===S.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(E,"ImportDeclaration")},Ge.parseImportSpecifier=function(){var E=this.startNode();return E.imported=this.parseModuleExportName(),this.eatContextual("as")?E.local=this.parseIdent():(this.checkUnreserved(E.imported),E.local=E.imported),this.checkLValSimple(E.local,ae),this.finishNode(E,"ImportSpecifier")},Ge.parseImportDefaultSpecifier=function(){var E=this.startNode();return E.local=this.parseIdent(),this.checkLValSimple(E.local,ae),this.finishNode(E,"ImportDefaultSpecifier")},Ge.parseImportNamespaceSpecifier=function(){var E=this.startNode();return this.next(),this.expectContextual("as"),E.local=this.parseIdent(),this.checkLValSimple(E.local,ae),this.finishNode(E,"ImportNamespaceSpecifier")},Ge.parseImportSpecifiers=function(){var E=[],L=!0;if(this.type===S.name&&(E.push(this.parseImportDefaultSpecifier()),!this.eat(S.comma)))return E;if(this.type===S.star)return E.push(this.parseImportNamespaceSpecifier()),E;for(this.expect(S.braceL);!this.eat(S.braceR);){if(L)L=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;E.push(this.parseImportSpecifier())}return E},Ge.parseWithClause=function(){var E=[];if(!this.eat(S._with))return E;this.expect(S.braceL);for(var L={},J=!0;!this.eat(S.braceR);){if(J)J=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var re=this.parseImportAttribute(),ye=re.key.type==="Identifier"?re.key.name:re.key.value;F(L,ye)&&this.raiseRecoverable(re.key.start,"Duplicate attribute key '"+ye+"'"),L[ye]=!0,E.push(re)}return E},Ge.parseImportAttribute=function(){var E=this.startNode();return E.key=this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(S.colon),this.type!==S.string&&this.unexpected(),E.value=this.parseExprAtom(),this.finishNode(E,"ImportAttribute")},Ge.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===S.string){var E=this.parseLiteral(this.value);return Y.test(E.value)&&this.raise(E.start,"An export name cannot include a lone surrogate."),E}return this.parseIdent(!0)},Ge.adaptDirectivePrologue=function(E){for(var L=0;L<E.length&&this.isDirectiveCandidate(E[L]);++L)E[L].directive=E[L].expression.raw.slice(1,-1)},Ge.isDirectiveCandidate=function(E){return this.options.ecmaVersion>=5&&E.type==="ExpressionStatement"&&E.expression.type==="Literal"&&typeof E.expression.value=="string"&&(this.input[E.start]==='"'||this.input[E.start]==="'")};var ht=me.prototype;ht.toAssignable=function(E,L,J){if(this.options.ecmaVersion>=6&&E)switch(E.type){case"Identifier":this.inAsync&&E.name==="await"&&this.raise(E.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":E.type="ObjectPattern",J&&this.checkPatternErrors(J,!0);for(var re=0,ye=E.properties;re<ye.length;re+=1){var $e=ye[re];this.toAssignable($e,L),$e.type==="RestElement"&&($e.argument.type==="ArrayPattern"||$e.argument.type==="ObjectPattern")&&this.raise($e.argument.start,"Unexpected token")}break;case"Property":E.kind!=="init"&&this.raise(E.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(E.value,L);break;case"ArrayExpression":E.type="ArrayPattern",J&&this.checkPatternErrors(J,!0),this.toAssignableList(E.elements,L);break;case"SpreadElement":E.type="RestElement",this.toAssignable(E.argument,L),E.argument.type==="AssignmentPattern"&&this.raise(E.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":E.operator!=="="&&this.raise(E.left.end,"Only '=' operator can be used for specifying default value."),E.type="AssignmentPattern",delete E.operator,this.toAssignable(E.left,L);break;case"ParenthesizedExpression":this.toAssignable(E.expression,L,J);break;case"ChainExpression":this.raiseRecoverable(E.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!L)break;default:this.raise(E.start,"Assigning to rvalue")}else J&&this.checkPatternErrors(J,!0);return E},ht.toAssignableList=function(E,L){for(var J=E.length,re=0;re<J;re++){var ye=E[re];ye&&this.toAssignable(ye,L)}if(J){var $e=E[J-1];this.options.ecmaVersion===6&&L&&$e&&$e.type==="RestElement"&&$e.argument.type!=="Identifier"&&this.unexpected($e.argument.start)}return E},ht.parseSpread=function(E){var L=this.startNode();return this.next(),L.argument=this.parseMaybeAssign(!1,E),this.finishNode(L,"SpreadElement")},ht.parseRestBinding=function(){var E=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==S.name&&this.unexpected(),E.argument=this.parseBindingAtom(),this.finishNode(E,"RestElement")},ht.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case S.bracketL:var E=this.startNode();return this.next(),E.elements=this.parseBindingList(S.bracketR,!0,!0),this.finishNode(E,"ArrayPattern");case S.braceL:return this.parseObj(!0)}return this.parseIdent()},ht.parseBindingList=function(E,L,J,re){for(var ye=[],$e=!0;!this.eat(E);)if($e?$e=!1:this.expect(S.comma),L&&this.type===S.comma)ye.push(null);else{if(J&&this.afterTrailingComma(E))break;if(this.type===S.ellipsis){var tt=this.parseRestBinding();this.parseBindingListItem(tt),ye.push(tt),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(E);break}else ye.push(this.parseAssignableListItem(re))}return ye},ht.parseAssignableListItem=function(E){var L=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(L),L},ht.parseBindingListItem=function(E){return E},ht.parseMaybeDefault=function(E,L,J){if(J=J||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return J;var re=this.startNodeAt(E,L);return re.left=J,re.right=this.parseMaybeAssign(),this.finishNode(re,"AssignmentPattern")},ht.checkLValSimple=function(E,L,J){L===void 0&&(L=Fe);var re=L!==Fe;switch(E.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(E.name)&&this.raiseRecoverable(E.start,(re?"Binding ":"Assigning to ")+E.name+" in strict mode"),re&&(L===ae&&E.name==="let"&&this.raiseRecoverable(E.start,"let is disallowed as a lexically bound name"),J&&(F(J,E.name)&&this.raiseRecoverable(E.start,"Argument name clash"),J[E.name]=!0),L!==he&&this.declareName(E.name,L,E.start));break;case"ChainExpression":this.raiseRecoverable(E.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":re&&this.raiseRecoverable(E.start,"Binding member expression");break;case"ParenthesizedExpression":return re&&this.raiseRecoverable(E.start,"Binding parenthesized expression"),this.checkLValSimple(E.expression,L,J);default:this.raise(E.start,(re?"Binding":"Assigning to")+" rvalue")}},ht.checkLValPattern=function(E,L,J){switch(L===void 0&&(L=Fe),E.type){case"ObjectPattern":for(var re=0,ye=E.properties;re<ye.length;re+=1){var $e=ye[re];this.checkLValInnerPattern($e,L,J)}break;case"ArrayPattern":for(var tt=0,Lt=E.elements;tt<Lt.length;tt+=1){var zt=Lt[tt];zt&&this.checkLValInnerPattern(zt,L,J)}break;default:this.checkLValSimple(E,L,J)}},ht.checkLValInnerPattern=function(E,L,J){switch(L===void 0&&(L=Fe),E.type){case"Property":this.checkLValInnerPattern(E.value,L,J);break;case"AssignmentPattern":this.checkLValPattern(E.left,L,J);break;case"RestElement":this.checkLValPattern(E.argument,L,J);break;default:this.checkLValPattern(E,L,J)}};var jt=function(L,J,re,ye,$e){this.token=L,this.isExpr=!!J,this.preserveSpace=!!re,this.override=ye,this.generator=!!$e},ot={b_stat:new jt("{",!1),b_expr:new jt("{",!0),b_tmpl:new jt("${",!1),p_stat:new jt("(",!1),p_expr:new jt("(",!0),q_tmpl:new jt("`",!0,!0,function(E){return E.tryReadTemplateToken()}),f_stat:new jt("function",!1),f_expr:new jt("function",!0),f_expr_gen:new jt("function",!0,!1,null,!0),f_gen:new jt("function",!1,!1,null,!0)},it=me.prototype;it.initialContext=function(){return[ot.b_stat]},it.curContext=function(){return this.context[this.context.length-1]},it.braceIsBlock=function(E){var L=this.curContext();return L===ot.f_expr||L===ot.f_stat?!0:E===S.colon&&(L===ot.b_stat||L===ot.b_expr)?!L.isExpr:E===S._return||E===S.name&&this.exprAllowed?A.test(this.input.slice(this.lastTokEnd,this.start)):E===S._else||E===S.semi||E===S.eof||E===S.parenR||E===S.arrow?!0:E===S.braceL?L===ot.b_stat:E===S._var||E===S._const||E===S.name?!1:!this.exprAllowed},it.inGeneratorContext=function(){for(var E=this.context.length-1;E>=1;E--){var L=this.context[E];if(L.token==="function")return L.generator}return!1},it.updateContext=function(E){var L,J=this.type;J.keyword&&E===S.dot?this.exprAllowed=!1:(L=J.updateContext)?L.call(this,E):this.exprAllowed=J.beforeExpr},it.overrideContext=function(E){this.curContext()!==E&&(this.context[this.context.length-1]=E)},S.parenR.updateContext=S.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var E=this.context.pop();E===ot.b_stat&&this.curContext().token==="function"&&(E=this.context.pop()),this.exprAllowed=!E.isExpr},S.braceL.updateContext=function(E){this.context.push(this.braceIsBlock(E)?ot.b_stat:ot.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(ot.b_tmpl),this.exprAllowed=!0},S.parenL.updateContext=function(E){var L=E===S._if||E===S._for||E===S._with||E===S._while;this.context.push(L?ot.p_stat:ot.p_expr),this.exprAllowed=!0},S.incDec.updateContext=function(){},S._function.updateContext=S._class.updateContext=function(E){E.beforeExpr&&E!==S._else&&!(E===S.semi&&this.curContext()!==ot.p_stat)&&!(E===S._return&&A.test(this.input.slice(this.lastTokEnd,this.start)))&&!((E===S.colon||E===S.braceL)&&this.curContext()===ot.b_stat)?this.context.push(ot.f_expr):this.context.push(ot.f_stat),this.exprAllowed=!1},S.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},S.backQuote.updateContext=function(){this.curContext()===ot.q_tmpl?this.context.pop():this.context.push(ot.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(E){if(E===S._function){var L=this.context.length-1;this.context[L]===ot.f_expr?this.context[L]=ot.f_expr_gen:this.context[L]=ot.f_gen}this.exprAllowed=!0},S.name.updateContext=function(E){var L=!1;this.options.ecmaVersion>=6&&E!==S.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(L=!0),this.exprAllowed=L};var bt=me.prototype;bt.checkPropClash=function(E,L,J){if(!(this.options.ecmaVersion>=9&&E.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(E.computed||E.method||E.shorthand))){var re=E.key,ye;switch(re.type){case"Identifier":ye=re.name;break;case"Literal":ye=String(re.value);break;default:return}var $e=E.kind;if(this.options.ecmaVersion>=6){ye==="__proto__"&&$e==="init"&&(L.proto&&(J?J.doubleProto<0&&(J.doubleProto=re.start):this.raiseRecoverable(re.start,"Redefinition of __proto__ property")),L.proto=!0);return}ye="$"+ye;var tt=L[ye];if(tt){var Lt;$e==="init"?Lt=this.strict&&tt.init||tt.get||tt.set:Lt=tt.init||tt[$e],Lt&&this.raiseRecoverable(re.start,"Redefinition of property")}else tt=L[ye]={init:!1,get:!1,set:!1};tt[$e]=!0}},bt.parseExpression=function(E,L){var J=this.start,re=this.startLoc,ye=this.parseMaybeAssign(E,L);if(this.type===S.comma){var $e=this.startNodeAt(J,re);for($e.expressions=[ye];this.eat(S.comma);)$e.expressions.push(this.parseMaybeAssign(E,L));return this.finishNode($e,"SequenceExpression")}return ye},bt.parseMaybeAssign=function(E,L,J){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(E);this.exprAllowed=!1}var re=!1,ye=-1,$e=-1,tt=-1;L?(ye=L.parenthesizedAssign,$e=L.trailingComma,tt=L.doubleProto,L.parenthesizedAssign=L.trailingComma=-1):(L=new mt,re=!0);var Lt=this.start,zt=this.startLoc;(this.type===S.parenL||this.type===S.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=E==="await");var gn=this.parseMaybeConditional(E,L);if(J&&(gn=J.call(this,gn,Lt,zt)),this.type.isAssign){var Mn=this.startNodeAt(Lt,zt);return Mn.operator=this.value,this.type===S.eq&&(gn=this.toAssignable(gn,!1,L)),re||(L.parenthesizedAssign=L.trailingComma=L.doubleProto=-1),L.shorthandAssign>=gn.start&&(L.shorthandAssign=-1),this.type===S.eq?this.checkLValPattern(gn):this.checkLValSimple(gn),Mn.left=gn,this.next(),Mn.right=this.parseMaybeAssign(E),tt>-1&&(L.doubleProto=tt),this.finishNode(Mn,"AssignmentExpression")}else re&&this.checkExpressionErrors(L,!0);return ye>-1&&(L.parenthesizedAssign=ye),$e>-1&&(L.trailingComma=$e),gn},bt.parseMaybeConditional=function(E,L){var J=this.start,re=this.startLoc,ye=this.parseExprOps(E,L);if(this.checkExpressionErrors(L))return ye;if(this.eat(S.question)){var $e=this.startNodeAt(J,re);return $e.test=ye,$e.consequent=this.parseMaybeAssign(),this.expect(S.colon),$e.alternate=this.parseMaybeAssign(E),this.finishNode($e,"ConditionalExpression")}return ye},bt.parseExprOps=function(E,L){var J=this.start,re=this.startLoc,ye=this.parseMaybeUnary(L,!1,!1,E);return this.checkExpressionErrors(L)||ye.start===J&&ye.type==="ArrowFunctionExpression"?ye:this.parseExprOp(ye,J,re,-1,E)},bt.parseExprOp=function(E,L,J,re,ye){var $e=this.type.binop;if($e!=null&&(!ye||this.type!==S._in)&&$e>re){var tt=this.type===S.logicalOR||this.type===S.logicalAND,Lt=this.type===S.coalesce;Lt&&($e=S.logicalAND.binop);var zt=this.value;this.next();var gn=this.start,Mn=this.startLoc,Ei=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,ye),gn,Mn,$e,ye),Cn=this.buildBinary(L,J,E,Ei,zt,tt||Lt);return(tt&&this.type===S.coalesce||Lt&&(this.type===S.logicalOR||this.type===S.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(Cn,L,J,re,ye)}return E},bt.buildBinary=function(E,L,J,re,ye,$e){re.type==="PrivateIdentifier"&&this.raise(re.start,"Private identifier can only be left side of binary expression");var tt=this.startNodeAt(E,L);return tt.left=J,tt.operator=ye,tt.right=re,this.finishNode(tt,$e?"LogicalExpression":"BinaryExpression")},bt.parseMaybeUnary=function(E,L,J,re){var ye=this.start,$e=this.startLoc,tt;if(this.isContextual("await")&&this.canAwait)tt=this.parseAwait(re),L=!0;else if(this.type.prefix){var Lt=this.startNode(),zt=this.type===S.incDec;Lt.operator=this.value,Lt.prefix=!0,this.next(),Lt.argument=this.parseMaybeUnary(null,!0,zt,re),this.checkExpressionErrors(E,!0),zt?this.checkLValSimple(Lt.argument):this.strict&&Lt.operator==="delete"&&Jt(Lt.argument)?this.raiseRecoverable(Lt.start,"Deleting local variable in strict mode"):Lt.operator==="delete"&&Kt(Lt.argument)?this.raiseRecoverable(Lt.start,"Private fields can not be deleted"):L=!0,tt=this.finishNode(Lt,zt?"UpdateExpression":"UnaryExpression")}else if(!L&&this.type===S.privateId)(re||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),tt=this.parsePrivateIdent(),this.type!==S._in&&this.unexpected();else{if(tt=this.parseExprSubscripts(E,re),this.checkExpressionErrors(E))return tt;for(;this.type.postfix&&!this.canInsertSemicolon();){var gn=this.startNodeAt(ye,$e);gn.operator=this.value,gn.prefix=!1,gn.argument=tt,this.checkLValSimple(tt),this.next(),tt=this.finishNode(gn,"UpdateExpression")}}if(!J&&this.eat(S.starstar))if(L)this.unexpected(this.lastTokStart);else return this.buildBinary(ye,$e,tt,this.parseMaybeUnary(null,!1,!1,re),"**",!1);else return tt};function Jt(E){return E.type==="Identifier"||E.type==="ParenthesizedExpression"&&Jt(E.expression)}function Kt(E){return E.type==="MemberExpression"&&E.property.type==="PrivateIdentifier"||E.type==="ChainExpression"&&Kt(E.expression)||E.type==="ParenthesizedExpression"&&Kt(E.expression)}bt.parseExprSubscripts=function(E,L){var J=this.start,re=this.startLoc,ye=this.parseExprAtom(E,L);if(ye.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return ye;var $e=this.parseSubscripts(ye,J,re,!1,L);return E&&$e.type==="MemberExpression"&&(E.parenthesizedAssign>=$e.start&&(E.parenthesizedAssign=-1),E.parenthesizedBind>=$e.start&&(E.parenthesizedBind=-1),E.trailingComma>=$e.start&&(E.trailingComma=-1)),$e},bt.parseSubscripts=function(E,L,J,re,ye){for(var $e=this.options.ecmaVersion>=8&&E.type==="Identifier"&&E.name==="async"&&this.lastTokEnd===E.end&&!this.canInsertSemicolon()&&E.end-E.start===5&&this.potentialArrowAt===E.start,tt=!1;;){var Lt=this.parseSubscript(E,L,J,re,$e,tt,ye);if(Lt.optional&&(tt=!0),Lt===E||Lt.type==="ArrowFunctionExpression"){if(tt){var zt=this.startNodeAt(L,J);zt.expression=Lt,Lt=this.finishNode(zt,"ChainExpression")}return Lt}E=Lt}},bt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)},bt.parseSubscriptAsyncArrow=function(E,L,J,re){return this.parseArrowExpression(this.startNodeAt(E,L),J,!0,re)},bt.parseSubscript=function(E,L,J,re,ye,$e,tt){var Lt=this.options.ecmaVersion>=11,zt=Lt&&this.eat(S.questionDot);re&&zt&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var gn=this.eat(S.bracketL);if(gn||zt&&this.type!==S.parenL&&this.type!==S.backQuote||this.eat(S.dot)){var Mn=this.startNodeAt(L,J);Mn.object=E,gn?(Mn.property=this.parseExpression(),this.expect(S.bracketR)):this.type===S.privateId&&E.type!=="Super"?Mn.property=this.parsePrivateIdent():Mn.property=this.parseIdent(this.options.allowReserved!=="never"),Mn.computed=!!gn,Lt&&(Mn.optional=zt),E=this.finishNode(Mn,"MemberExpression")}else if(!re&&this.eat(S.parenL)){var Ei=new mt,Cn=this.yieldPos,ai=this.awaitPos,Ar=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Mi=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1,Ei);if(ye&&!zt&&this.shouldParseAsyncArrow())return this.checkPatternErrors(Ei,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=Cn,this.awaitPos=ai,this.awaitIdentPos=Ar,this.parseSubscriptAsyncArrow(L,J,Mi,tt);this.checkExpressionErrors(Ei,!0),this.yieldPos=Cn||this.yieldPos,this.awaitPos=ai||this.awaitPos,this.awaitIdentPos=Ar||this.awaitIdentPos;var Hi=this.startNodeAt(L,J);Hi.callee=E,Hi.arguments=Mi,Lt&&(Hi.optional=zt),E=this.finishNode(Hi,"CallExpression")}else if(this.type===S.backQuote){(zt||$e)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Ui=this.startNodeAt(L,J);Ui.tag=E,Ui.quasi=this.parseTemplate({isTagged:!0}),E=this.finishNode(Ui,"TaggedTemplateExpression")}return E},bt.parseExprAtom=function(E,L,J){this.type===S.slash&&this.readRegexp();var re,ye=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),re=this.startNode(),this.next(),this.type===S.parenL&&!this.allowDirectSuper&&this.raise(re.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(re,"Super");case S._this:return re=this.startNode(),this.next(),this.finishNode(re,"ThisExpression");case S.name:var $e=this.start,tt=this.startLoc,Lt=this.containsEsc,zt=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Lt&&zt.name==="async"&&!this.canInsertSemicolon()&&this.eat(S._function))return this.overrideContext(ot.f_expr),this.parseFunction(this.startNodeAt($e,tt),0,!1,!0,L);if(ye&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt($e,tt),[zt],!1,L);if(this.options.ecmaVersion>=8&&zt.name==="async"&&this.type===S.name&&!Lt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return zt=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(S.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt($e,tt),[zt],!0,L)}return zt;case S.regexp:var gn=this.value;return re=this.parseLiteral(gn.value),re.regex={pattern:gn.pattern,flags:gn.flags},re;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return re=this.startNode(),re.value=this.type===S._null?null:this.type===S._true,re.raw=this.type.keyword,this.next(),this.finishNode(re,"Literal");case S.parenL:var Mn=this.start,Ei=this.parseParenAndDistinguishExpression(ye,L);return E&&(E.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ei)&&(E.parenthesizedAssign=Mn),E.parenthesizedBind<0&&(E.parenthesizedBind=Mn)),Ei;case S.bracketL:return re=this.startNode(),this.next(),re.elements=this.parseExprList(S.bracketR,!0,!0,E),this.finishNode(re,"ArrayExpression");case S.braceL:return this.overrideContext(ot.b_expr),this.parseObj(!1,E);case S._function:return re=this.startNode(),this.next(),this.parseFunction(re,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>=11?this.parseExprImport(J):this.unexpected();default:return this.parseExprAtomDefault()}},bt.parseExprAtomDefault=function(){this.unexpected()},bt.parseExprImport=function(E){var L=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===S.parenL&&!E)return this.parseDynamicImport(L);if(this.type===S.dot){var J=this.startNodeAt(L.start,L.loc&&L.loc.start);return J.name="import",L.meta=this.finishNode(J,"Identifier"),this.parseImportMeta(L)}else this.unexpected()},bt.parseDynamicImport=function(E){if(this.next(),E.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(S.parenR)?E.options=null:(this.expect(S.comma),this.afterTrailingComma(S.parenR)?E.options=null:(E.options=this.parseMaybeAssign(),this.eat(S.parenR)||(this.expect(S.comma),this.afterTrailingComma(S.parenR)||this.unexpected())));else if(!this.eat(S.parenR)){var L=this.start;this.eat(S.comma)&&this.eat(S.parenR)?this.raiseRecoverable(L,"Trailing comma is not allowed in import()"):this.unexpected(L)}return this.finishNode(E,"ImportExpression")},bt.parseImportMeta=function(E){this.next();var L=this.containsEsc;return E.property=this.parseIdent(!0),E.property.name!=="meta"&&this.raiseRecoverable(E.property.start,"The only valid meta property for import is 'import.meta'"),L&&this.raiseRecoverable(E.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(E.start,"Cannot use 'import.meta' outside a module"),this.finishNode(E,"MetaProperty")},bt.parseLiteral=function(E){var L=this.startNode();return L.value=E,L.raw=this.input.slice(this.start,this.end),L.raw.charCodeAt(L.raw.length-1)===110&&(L.bigint=L.value!=null?L.value.toString():L.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(L,"Literal")},bt.parseParenExpression=function(){this.expect(S.parenL);var E=this.parseExpression();return this.expect(S.parenR),E},bt.shouldParseArrow=function(E){return!this.canInsertSemicolon()},bt.parseParenAndDistinguishExpression=function(E,L){var J=this.start,re=this.startLoc,ye,$e=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var tt=this.start,Lt=this.startLoc,zt=[],gn=!0,Mn=!1,Ei=new mt,Cn=this.yieldPos,ai=this.awaitPos,Ar;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;)if(gn?gn=!1:this.expect(S.comma),$e&&this.afterTrailingComma(S.parenR,!0)){Mn=!0;break}else if(this.type===S.ellipsis){Ar=this.start,zt.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else zt.push(this.parseMaybeAssign(!1,Ei,this.parseParenItem));var Mi=this.lastTokEnd,Hi=this.lastTokEndLoc;if(this.expect(S.parenR),E&&this.shouldParseArrow(zt)&&this.eat(S.arrow))return this.checkPatternErrors(Ei,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Cn,this.awaitPos=ai,this.parseParenArrowList(J,re,zt,L);(!zt.length||Mn)&&this.unexpected(this.lastTokStart),Ar&&this.unexpected(Ar),this.checkExpressionErrors(Ei,!0),this.yieldPos=Cn||this.yieldPos,this.awaitPos=ai||this.awaitPos,zt.length>1?(ye=this.startNodeAt(tt,Lt),ye.expressions=zt,this.finishNodeAt(ye,"SequenceExpression",Mi,Hi)):ye=zt[0]}else ye=this.parseParenExpression();if(this.options.preserveParens){var Ui=this.startNodeAt(J,re);return Ui.expression=ye,this.finishNode(Ui,"ParenthesizedExpression")}else return ye},bt.parseParenItem=function(E){return E},bt.parseParenArrowList=function(E,L,J,re){return this.parseArrowExpression(this.startNodeAt(E,L),J,!1,re)};var un=[];bt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var E=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===S.dot){var L=this.startNodeAt(E.start,E.loc&&E.loc.start);L.name="new",E.meta=this.finishNode(L,"Identifier"),this.next();var J=this.containsEsc;return E.property=this.parseIdent(!0),E.property.name!=="target"&&this.raiseRecoverable(E.property.start,"The only valid meta property for new is 'new.target'"),J&&this.raiseRecoverable(E.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(E.start,"'new.target' can only be used in functions and class static block"),this.finishNode(E,"MetaProperty")}var re=this.start,ye=this.startLoc;return E.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),re,ye,!0,!1),this.eat(S.parenL)?E.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1):E.arguments=un,this.finishNode(E,"NewExpression")},bt.parseTemplateElement=function(E){var L=E.isTagged,J=this.startNode();return this.type===S.invalidTemplate?(L||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),J.value={raw:this.value.replace(/\r\n?/g,`
`),cooked:null}):J.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
`),cooked:this.value},this.next(),J.tail=this.type===S.backQuote,this.finishNode(J,"TemplateElement")},bt.parseTemplate=function(E){E===void 0&&(E={});var L=E.isTagged;L===void 0&&(L=!1);var J=this.startNode();this.next(),J.expressions=[];var re=this.parseTemplateElement({isTagged:L});for(J.quasis=[re];!re.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),J.expressions.push(this.parseExpression()),this.expect(S.braceR),J.quasis.push(re=this.parseTemplateElement({isTagged:L}));return this.next(),this.finishNode(J,"TemplateLiteral")},bt.isAsyncProp=function(E){return!E.computed&&E.key.type==="Identifier"&&E.key.name==="async"&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!A.test(this.input.slice(this.lastTokEnd,this.start))},bt.parseObj=function(E,L){var J=this.startNode(),re=!0,ye={};for(J.properties=[],this.next();!this.eat(S.braceR);){if(re)re=!1;else if(this.expect(S.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(S.braceR))break;var $e=this.parseProperty(E,L);E||this.checkPropClash($e,ye,L),J.properties.push($e)}return this.finishNode(J,E?"ObjectPattern":"ObjectExpression")},bt.parseProperty=function(E,L){var J=this.startNode(),re,ye,$e,tt;if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return E?(J.argument=this.parseIdent(!1),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(J,"RestElement")):(J.argument=this.parseMaybeAssign(!1,L),this.type===S.comma&&L&&L.trailingComma<0&&(L.trailingComma=this.start),this.finishNode(J,"SpreadElement"));this.options.ecmaVersion>=6&&(J.method=!1,J.shorthand=!1,(E||L)&&($e=this.start,tt=this.startLoc),E||(re=this.eat(S.star)));var Lt=this.containsEsc;return this.parsePropertyName(J),!E&&!Lt&&this.options.ecmaVersion>=8&&!re&&this.isAsyncProp(J)?(ye=!0,re=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(J)):ye=!1,this.parsePropertyValue(J,E,re,ye,$e,tt,L,Lt),this.finishNode(J,"Property")},bt.parseGetterSetter=function(E){var L=E.key.name;this.parsePropertyName(E),E.value=this.parseMethod(!1),E.kind=L;var J=E.kind==="get"?0:1;if(E.value.params.length!==J){var re=E.value.start;E.kind==="get"?this.raiseRecoverable(re,"getter should have no params"):this.raiseRecoverable(re,"setter should have exactly one param")}else E.kind==="set"&&E.value.params[0].type==="RestElement"&&this.raiseRecoverable(E.value.params[0].start,"Setter cannot use rest params")},bt.parsePropertyValue=function(E,L,J,re,ye,$e,tt,Lt){(J||re)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon)?(E.value=L?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,tt),E.kind="init"):this.options.ecmaVersion>=6&&this.type===S.parenL?(L&&this.unexpected(),E.method=!0,E.value=this.parseMethod(J,re),E.kind="init"):!L&&!Lt&&this.options.ecmaVersion>=5&&!E.computed&&E.key.type==="Identifier"&&(E.key.name==="get"||E.key.name==="set")&&this.type!==S.comma&&this.type!==S.braceR&&this.type!==S.eq?((J||re)&&this.unexpected(),this.parseGetterSetter(E)):this.options.ecmaVersion>=6&&!E.computed&&E.key.type==="Identifier"?((J||re)&&this.unexpected(),this.checkUnreserved(E.key),E.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=ye),L?E.value=this.parseMaybeDefault(ye,$e,this.copyNode(E.key)):this.type===S.eq&&tt?(tt.shorthandAssign<0&&(tt.shorthandAssign=this.start),E.value=this.parseMaybeDefault(ye,$e,this.copyNode(E.key))):E.value=this.copyNode(E.key),E.kind="init",E.shorthand=!0):this.unexpected()},bt.parsePropertyName=function(E){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return E.computed=!0,E.key=this.parseMaybeAssign(),this.expect(S.bracketR),E.key;E.computed=!1}return E.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},bt.initFunction=function(E){E.id=null,this.options.ecmaVersion>=6&&(E.generator=E.expression=!1),this.options.ecmaVersion>=8&&(E.async=!1)},bt.parseMethod=function(E,L,J){var re=this.startNode(),ye=this.yieldPos,$e=this.awaitPos,tt=this.awaitIdentPos;return this.initFunction(re),this.options.ecmaVersion>=6&&(re.generator=E),this.options.ecmaVersion>=8&&(re.async=!!L),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ne(L,re.generator)|Ie|(J?Xe:0)),this.expect(S.parenL),re.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(re,!1,!0,!1),this.yieldPos=ye,this.awaitPos=$e,this.awaitIdentPos=tt,this.finishNode(re,"FunctionExpression")},bt.parseArrowExpression=function(E,L,J,re){var ye=this.yieldPos,$e=this.awaitPos,tt=this.awaitIdentPos;return this.enterScope(Ne(J,!1)|pe),this.initFunction(E),this.options.ecmaVersion>=8&&(E.async=!!J),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,E.params=this.toAssignableList(L,!0),this.parseFunctionBody(E,!0,!1,re),this.yieldPos=ye,this.awaitPos=$e,this.awaitIdentPos=tt,this.finishNode(E,"ArrowFunctionExpression")},bt.parseFunctionBody=function(E,L,J,re){var ye=L&&this.type!==S.braceL,$e=this.strict,tt=!1;if(ye)E.body=this.parseMaybeAssign(re),E.expression=!0,this.checkParams(E,!1);else{var Lt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(E.params);(!$e||Lt)&&(tt=this.strictDirective(this.end),tt&&Lt&&this.raiseRecoverable(E.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var zt=this.labels;this.labels=[],tt&&(this.strict=!0),this.checkParams(E,!$e&&!tt&&!L&&!J&&this.isSimpleParamList(E.params)),this.strict&&E.id&&this.checkLValSimple(E.id,he),E.body=this.parseBlock(!1,void 0,tt&&!$e),E.expression=!1,this.adaptDirectivePrologue(E.body.body),this.labels=zt}this.exitScope()},bt.isSimpleParamList=function(E){for(var L=0,J=E;L<J.length;L+=1){var re=J[L];if(re.type!=="Identifier")return!1}return!0},bt.checkParams=function(E,L){for(var J=Object.create(null),re=0,ye=E.params;re<ye.length;re+=1){var $e=ye[re];this.checkLValInnerPattern($e,Qe,L?null:J)}},bt.parseExprList=function(E,L,J,re){for(var ye=[],$e=!0;!this.eat(E);){if($e)$e=!1;else if(this.expect(S.comma),L&&this.afterTrailingComma(E))break;var tt=void 0;J&&this.type===S.comma?tt=null:this.type===S.ellipsis?(tt=this.parseSpread(re),re&&this.type===S.comma&&re.trailingComma<0&&(re.trailingComma=this.start)):tt=this.parseMaybeAssign(!1,re),ye.push(tt)}return ye},bt.checkUnreserved=function(E){var L=E.start,J=E.end,re=E.name;if(this.inGenerator&&re==="yield"&&this.raiseRecoverable(L,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&re==="await"&&this.raiseRecoverable(L,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Re)&&re==="arguments"&&this.raiseRecoverable(L,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(re==="arguments"||re==="await")&&this.raise(L,"Cannot use "+re+" in class static initialization block"),this.keywords.test(re)&&this.raise(L,"Unexpected keyword '"+re+"'"),!(this.options.ecmaVersion<6&&this.input.slice(L,J).indexOf("\\")!==-1)){var ye=this.strict?this.reservedWordsStrict:this.reservedWords;ye.test(re)&&(!this.inAsync&&re==="await"&&this.raiseRecoverable(L,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(L,"The keyword '"+re+"' is reserved"))}},bt.parseIdent=function(E){var L=this.parseIdentNode();return this.next(!!E),this.finishNode(L,"Identifier"),E||(this.checkUnreserved(L),L.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=L.start)),L},bt.parseIdentNode=function(){var E=this.startNode();return this.type===S.name?E.name=this.value:this.type.keyword?(E.name=this.type.keyword,(E.name==="class"||E.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=S.name):this.unexpected(),E},bt.parsePrivateIdent=function(){var E=this.startNode();return this.type===S.privateId?E.name=this.value:this.unexpected(),this.next(),this.finishNode(E,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(E.start,"Private field '#"+E.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(E)),E},bt.parseYield=function(E){this.yieldPos||(this.yieldPos=this.start);var L=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(L.delegate=!1,L.argument=null):(L.delegate=this.eat(S.star),L.argument=this.parseMaybeAssign(E)),this.finishNode(L,"YieldExpression")},bt.parseAwait=function(E){this.awaitPos||(this.awaitPos=this.start);var L=this.startNode();return this.next(),L.argument=this.parseMaybeUnary(null,!0,!1,E),this.finishNode(L,"AwaitExpression")};var Vn=me.prototype;Vn.raise=function(E,L){var J=de(this.input,E);L+=" ("+J.line+":"+J.column+")",this.sourceFile&&(L+=" in "+this.sourceFile);var re=new SyntaxError(L);throw re.pos=E,re.loc=J,re.raisedAt=this.pos,re},Vn.raiseRecoverable=Vn.raise,Vn.curPosition=function(){if(this.options.locations)return new Z(this.curLine,this.pos-this.lineStart)};var vn=me.prototype,Qn=function(L){this.flags=L,this.var=[],this.lexical=[],this.functions=[]};vn.enterScope=function(E){this.scopeStack.push(new Qn(E))},vn.exitScope=function(){this.scopeStack.pop()},vn.treatFunctionsAsVarInScope=function(E){return E.flags&Pe||!this.inModule&&E.flags&Te},vn.declareName=function(E,L,J){var re=!1;if(L===ae){var ye=this.currentScope();re=ye.lexical.indexOf(E)>-1||ye.functions.indexOf(E)>-1||ye.var.indexOf(E)>-1,ye.lexical.push(E),this.inModule&&ye.flags&Te&&delete this.undefinedExports[E]}else if(L===ce){var $e=this.currentScope();$e.lexical.push(E)}else if(L===K){var tt=this.currentScope();this.treatFunctionsAsVar?re=tt.lexical.indexOf(E)>-1:re=tt.lexical.indexOf(E)>-1||tt.var.indexOf(E)>-1,tt.functions.push(E)}else for(var Lt=this.scopeStack.length-1;Lt>=0;--Lt){var zt=this.scopeStack[Lt];if(zt.lexical.indexOf(E)>-1&&!(zt.flags&ze&&zt.lexical[0]===E)||!this.treatFunctionsAsVarInScope(zt)&&zt.functions.indexOf(E)>-1){re=!0;break}if(zt.var.push(E),this.inModule&&zt.flags&Te&&delete this.undefinedExports[E],zt.flags&Re)break}re&&this.raiseRecoverable(J,"Identifier '"+E+"' has already been declared")},vn.checkLocalExport=function(E){this.scopeStack[0].lexical.indexOf(E.name)===-1&&this.scopeStack[0].var.indexOf(E.name)===-1&&(this.undefinedExports[E.name]=E)},vn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},vn.currentVarScope=function(){for(var E=this.scopeStack.length-1;;E--){var L=this.scopeStack[E];if(L.flags&(Re|Ae|we))return L}},vn.currentThisScope=function(){for(var E=this.scopeStack.length-1;;E--){var L=this.scopeStack[E];if(L.flags&(Re|Ae|we)&&!(L.flags&pe))return L}};var Yn=function(L,J,re){this.type="",this.start=J,this.end=0,L.options.locations&&(this.loc=new G(L,re)),L.options.directSourceFile&&(this.sourceFile=L.options.directSourceFile),L.options.ranges&&(this.range=[J,0])},xi=me.prototype;xi.startNode=function(){return new Yn(this,this.start,this.startLoc)},xi.startNodeAt=function(E,L){return new Yn(this,E,L)};function qn(E,L,J,re){return E.type=L,E.end=J,this.options.locations&&(E.loc.end=re),this.options.ranges&&(E.range[1]=J),E}xi.finishNode=function(E,L){return qn.call(this,E,L,this.lastTokEnd,this.lastTokEndLoc)},xi.finishNodeAt=function(E,L,J,re){return qn.call(this,E,L,J,re)},xi.copyNode=function(E){var L=new Yn(this,E.start,this.startLoc);for(var J in E)L[J]=E[J];return L};var Ji="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",hi="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",on=hi+" Extended_Pictographic",Ii=on,ri=Ii+" EBase EComp EMod EPres ExtPict",se=ri,ge=se,Ue={9:hi,10:on,11:Ii,12:ri,13:se,14:ge},rt="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",dt={9:"",10:"",11:"",12:"",13:"",14:rt},lt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",At="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ee=At+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",xe=ee+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ce=xe+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Oe=Ce+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ve=Oe+" "+Ji,_t={9:At,10:ee,11:xe,12:Ce,13:Oe,14:ve},ft={};function yt(E){var L=ft[E]={binary:W(Ue[E]+" "+lt),binaryOfStrings:W(dt[E]),nonBinary:{General_Category:W(lt),Script:W(_t[E])}};L.nonBinary.Script_Extensions=L.nonBinary.Script,L.nonBinary.gc=L.nonBinary.General_Category,L.nonBinary.sc=L.nonBinary.Script,L.nonBinary.scx=L.nonBinary.Script_Extensions}for(var St=0,Nt=[9,10,11,12,13,14];St<Nt.length;St+=1){var Xt=Nt[St];yt(Xt)}var at=me.prototype,nn=function(L,J){this.parent=L,this.base=J||this};nn.prototype.separatedFrom=function(L){for(var J=this;J;J=J.parent)for(var re=L;re;re=re.parent)if(J.base===re.base&&J!==re)return!0;return!1},nn.prototype.sibling=function(){return new nn(this.parent,this.base)};var pn=function(L){this.parser=L,this.validFlags="gim"+(L.options.ecmaVersion>=6?"uy":"")+(L.options.ecmaVersion>=9?"s":"")+(L.options.ecmaVersion>=13?"d":"")+(L.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ft[L.options.ecmaVersion>=14?14:L.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};pn.prototype.reset=function(L,J,re){var ye=re.indexOf("v")!==-1,$e=re.indexOf("u")!==-1;this.start=L|0,this.source=J+"",this.flags=re,ye&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=$e&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=$e&&this.parser.options.ecmaVersion>=9)},pn.prototype.raise=function(L){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+L)},pn.prototype.at=function(L,J){J===void 0&&(J=!1);var re=this.source,ye=re.length;if(L>=ye)return-1;var $e=re.charCodeAt(L);if(!(J||this.switchU)||$e<=55295||$e>=57344||L+1>=ye)return $e;var tt=re.charCodeAt(L+1);return tt>=56320&&tt<=57343?($e<<10)+tt-56613888:$e},pn.prototype.nextIndex=function(L,J){J===void 0&&(J=!1);var re=this.source,ye=re.length;if(L>=ye)return ye;var $e=re.charCodeAt(L),tt;return!(J||this.switchU)||$e<=55295||$e>=57344||L+1>=ye||(tt=re.charCodeAt(L+1))<56320||tt>57343?L+1:L+2},pn.prototype.current=function(L){return L===void 0&&(L=!1),this.at(this.pos,L)},pn.prototype.lookahead=function(L){return L===void 0&&(L=!1),this.at(this.nextIndex(this.pos,L),L)},pn.prototype.advance=function(L){L===void 0&&(L=!1),this.pos=this.nextIndex(this.pos,L)},pn.prototype.eat=function(L,J){return J===void 0&&(J=!1),this.current(J)===L?(this.advance(J),!0):!1},pn.prototype.eatChars=function(L,J){J===void 0&&(J=!1);for(var re=this.pos,ye=0,$e=L;ye<$e.length;ye+=1){var tt=$e[ye],Lt=this.at(re,J);if(Lt===-1||Lt!==tt)return!1;re=this.nextIndex(re,J)}return this.pos=re,!0},at.validateRegExpFlags=function(E){for(var L=E.validFlags,J=E.flags,re=!1,ye=!1,$e=0;$e<J.length;$e++){var tt=J.charAt($e);L.indexOf(tt)===-1&&this.raise(E.start,"Invalid regular expression flag"),J.indexOf(tt,$e+1)>-1&&this.raise(E.start,"Duplicate regular expression flag"),tt==="u"&&(re=!0),tt==="v"&&(ye=!0)}this.options.ecmaVersion>=15&&re&&ye&&this.raise(E.start,"Invalid regular expression flag")};function dn(E){for(var L in E)return!0;return!1}at.validateRegExpPattern=function(E){this.regexp_pattern(E),!E.switchN&&this.options.ecmaVersion>=9&&dn(E.groupNames)&&(E.switchN=!0,this.regexp_pattern(E))},at.regexp_pattern=function(E){E.pos=0,E.lastIntValue=0,E.lastStringValue="",E.lastAssertionIsQuantifiable=!1,E.numCapturingParens=0,E.maxBackReference=0,E.groupNames=Object.create(null),E.backReferenceNames.length=0,E.branchID=null,this.regexp_disjunction(E),E.pos!==E.source.length&&(E.eat(41)&&E.raise("Unmatched ')'"),(E.eat(93)||E.eat(125))&&E.raise("Lone quantifier brackets")),E.maxBackReference>E.numCapturingParens&&E.raise("Invalid escape");for(var L=0,J=E.backReferenceNames;L<J.length;L+=1){var re=J[L];E.groupNames[re]||E.raise("Invalid named capture referenced")}},at.regexp_disjunction=function(E){var L=this.options.ecmaVersion>=16;for(L&&(E.branchID=new nn(E.branchID,null)),this.regexp_alternative(E);E.eat(124);)L&&(E.branchID=E.branchID.sibling()),this.regexp_alternative(E);L&&(E.branchID=E.branchID.parent),this.regexp_eatQuantifier(E,!0)&&E.raise("Nothing to repeat"),E.eat(123)&&E.raise("Lone quantifier brackets")},at.regexp_alternative=function(E){for(;E.pos<E.source.length&&this.regexp_eatTerm(E););},at.regexp_eatTerm=function(E){return this.regexp_eatAssertion(E)?(E.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(E)&&E.switchU&&E.raise("Invalid quantifier"),!0):(E.switchU?this.regexp_eatAtom(E):this.regexp_eatExtendedAtom(E))?(this.regexp_eatQuantifier(E),!0):!1},at.regexp_eatAssertion=function(E){var L=E.pos;if(E.lastAssertionIsQuantifiable=!1,E.eat(94)||E.eat(36))return!0;if(E.eat(92)){if(E.eat(66)||E.eat(98))return!0;E.pos=L}if(E.eat(40)&&E.eat(63)){var J=!1;if(this.options.ecmaVersion>=9&&(J=E.eat(60)),E.eat(61)||E.eat(33))return this.regexp_disjunction(E),E.eat(41)||E.raise("Unterminated group"),E.lastAssertionIsQuantifiable=!J,!0}return E.pos=L,!1},at.regexp_eatQuantifier=function(E,L){return L===void 0&&(L=!1),this.regexp_eatQuantifierPrefix(E,L)?(E.eat(63),!0):!1},at.regexp_eatQuantifierPrefix=function(E,L){return E.eat(42)||E.eat(43)||E.eat(63)||this.regexp_eatBracedQuantifier(E,L)},at.regexp_eatBracedQuantifier=function(E,L){var J=E.pos;if(E.eat(123)){var re=0,ye=-1;if(this.regexp_eatDecimalDigits(E)&&(re=E.lastIntValue,E.eat(44)&&this.regexp_eatDecimalDigits(E)&&(ye=E.lastIntValue),E.eat(125)))return ye!==-1&&ye<re&&!L&&E.raise("numbers out of order in {} quantifier"),!0;E.switchU&&!L&&E.raise("Incomplete quantifier"),E.pos=J}return!1},at.regexp_eatAtom=function(E){return this.regexp_eatPatternCharacters(E)||E.eat(46)||this.regexp_eatReverseSolidusAtomEscape(E)||this.regexp_eatCharacterClass(E)||this.regexp_eatUncapturingGroup(E)||this.regexp_eatCapturingGroup(E)},at.regexp_eatReverseSolidusAtomEscape=function(E){var L=E.pos;if(E.eat(92)){if(this.regexp_eatAtomEscape(E))return!0;E.pos=L}return!1},at.regexp_eatUncapturingGroup=function(E){var L=E.pos;if(E.eat(40)){if(E.eat(63)){if(this.options.ecmaVersion>=16){var J=this.regexp_eatModifiers(E),re=E.eat(45);if(J||re){for(var ye=0;ye<J.length;ye++){var $e=J.charAt(ye);J.indexOf($e,ye+1)>-1&&E.raise("Duplicate regular expression modifiers")}if(re){var tt=this.regexp_eatModifiers(E);!J&&!tt&&E.current()===58&&E.raise("Invalid regular expression modifiers");for(var Lt=0;Lt<tt.length;Lt++){var zt=tt.charAt(Lt);(tt.indexOf(zt,Lt+1)>-1||J.indexOf(zt)>-1)&&E.raise("Duplicate regular expression modifiers")}}}}if(E.eat(58)){if(this.regexp_disjunction(E),E.eat(41))return!0;E.raise("Unterminated group")}}E.pos=L}return!1},at.regexp_eatCapturingGroup=function(E){if(E.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(E):E.current()===63&&E.raise("Invalid group"),this.regexp_disjunction(E),E.eat(41))return E.numCapturingParens+=1,!0;E.raise("Unterminated group")}return!1},at.regexp_eatModifiers=function(E){for(var L="",J=0;(J=E.current())!==-1&&Dn(J);)L+=B(J),E.advance();return L};function Dn(E){return E===105||E===109||E===115}at.regexp_eatExtendedAtom=function(E){return E.eat(46)||this.regexp_eatReverseSolidusAtomEscape(E)||this.regexp_eatCharacterClass(E)||this.regexp_eatUncapturingGroup(E)||this.regexp_eatCapturingGroup(E)||this.regexp_eatInvalidBracedQuantifier(E)||this.regexp_eatExtendedPatternCharacter(E)},at.regexp_eatInvalidBracedQuantifier=function(E){return this.regexp_eatBracedQuantifier(E,!0)&&E.raise("Nothing to repeat"),!1},at.regexp_eatSyntaxCharacter=function(E){var L=E.current();return $t(L)?(E.lastIntValue=L,E.advance(),!0):!1};function $t(E){return E===36||E>=40&&E<=43||E===46||E===63||E>=91&&E<=94||E>=123&&E<=125}at.regexp_eatPatternCharacters=function(E){for(var L=E.pos,J=0;(J=E.current())!==-1&&!$t(J);)E.advance();return E.pos!==L},at.regexp_eatExtendedPatternCharacter=function(E){var L=E.current();return L!==-1&&L!==36&&!(L>=40&&L<=43)&&L!==46&&L!==63&&L!==91&&L!==94&&L!==124?(E.advance(),!0):!1},at.regexp_groupSpecifier=function(E){if(E.eat(63)){this.regexp_eatGroupName(E)||E.raise("Invalid group");var L=this.options.ecmaVersion>=16,J=E.groupNames[E.lastStringValue];if(J)if(L)for(var re=0,ye=J;re<ye.length;re+=1){var $e=ye[re];$e.separatedFrom(E.branchID)||E.raise("Duplicate capture group name")}else E.raise("Duplicate capture group name");L?(J||(E.groupNames[E.lastStringValue]=[])).push(E.branchID):E.groupNames[E.lastStringValue]=!0}},at.regexp_eatGroupName=function(E){if(E.lastStringValue="",E.eat(60)){if(this.regexp_eatRegExpIdentifierName(E)&&E.eat(62))return!0;E.raise("Invalid capture group name")}return!1},at.regexp_eatRegExpIdentifierName=function(E){if(E.lastStringValue="",this.regexp_eatRegExpIdentifierStart(E)){for(E.lastStringValue+=B(E.lastIntValue);this.regexp_eatRegExpIdentifierPart(E);)E.lastStringValue+=B(E.lastIntValue);return!0}return!1},at.regexp_eatRegExpIdentifierStart=function(E){var L=E.pos,J=this.options.ecmaVersion>=11,re=E.current(J);return E.advance(J),re===92&&this.regexp_eatRegExpUnicodeEscapeSequence(E,J)&&(re=E.lastIntValue),Yt(re)?(E.lastIntValue=re,!0):(E.pos=L,!1)};function Yt(E){return g(E,!0)||E===36||E===95}at.regexp_eatRegExpIdentifierPart=function(E){var L=E.pos,J=this.options.ecmaVersion>=11,re=E.current(J);return E.advance(J),re===92&&this.regexp_eatRegExpUnicodeEscapeSequence(E,J)&&(re=E.lastIntValue),Un(re)?(E.lastIntValue=re,!0):(E.pos=L,!1)};function Un(E){return b(E,!0)||E===36||E===95||E===8204||E===8205}at.regexp_eatAtomEscape=function(E){return this.regexp_eatBackReference(E)||this.regexp_eatCharacterClassEscape(E)||this.regexp_eatCharacterEscape(E)||E.switchN&&this.regexp_eatKGroupName(E)?!0:(E.switchU&&(E.current()===99&&E.raise("Invalid unicode escape"),E.raise("Invalid escape")),!1)},at.regexp_eatBackReference=function(E){var L=E.pos;if(this.regexp_eatDecimalEscape(E)){var J=E.lastIntValue;if(E.switchU)return J>E.maxBackReference&&(E.maxBackReference=J),!0;if(J<=E.numCapturingParens)return!0;E.pos=L}return!1},at.regexp_eatKGroupName=function(E){if(E.eat(107)){if(this.regexp_eatGroupName(E))return E.backReferenceNames.push(E.lastStringValue),!0;E.raise("Invalid named reference")}return!1},at.regexp_eatCharacterEscape=function(E){return this.regexp_eatControlEscape(E)||this.regexp_eatCControlLetter(E)||this.regexp_eatZero(E)||this.regexp_eatHexEscapeSequence(E)||this.regexp_eatRegExpUnicodeEscapeSequence(E,!1)||!E.switchU&&this.regexp_eatLegacyOctalEscapeSequence(E)||this.regexp_eatIdentityEscape(E)},at.regexp_eatCControlLetter=function(E){var L=E.pos;if(E.eat(99)){if(this.regexp_eatControlLetter(E))return!0;E.pos=L}return!1},at.regexp_eatZero=function(E){return E.current()===48&&!Gi(E.lookahead())?(E.lastIntValue=0,E.advance(),!0):!1},at.regexp_eatControlEscape=function(E){var L=E.current();return L===116?(E.lastIntValue=9,E.advance(),!0):L===110?(E.lastIntValue=10,E.advance(),!0):L===118?(E.lastIntValue=11,E.advance(),!0):L===102?(E.lastIntValue=12,E.advance(),!0):L===114?(E.lastIntValue=13,E.advance(),!0):!1},at.regexp_eatControlLetter=function(E){var L=E.current();return xn(L)?(E.lastIntValue=L%32,E.advance(),!0):!1};function xn(E){return E>=65&&E<=90||E>=97&&E<=122}at.regexp_eatRegExpUnicodeEscapeSequence=function(E,L){L===void 0&&(L=!1);var J=E.pos,re=L||E.switchU;if(E.eat(117)){if(this.regexp_eatFixedHexDigits(E,4)){var ye=E.lastIntValue;if(re&&ye>=55296&&ye<=56319){var $e=E.pos;if(E.eat(92)&&E.eat(117)&&this.regexp_eatFixedHexDigits(E,4)){var tt=E.lastIntValue;if(tt>=56320&&tt<=57343)return E.lastIntValue=(ye-55296)*1024+(tt-56320)+65536,!0}E.pos=$e,E.lastIntValue=ye}return!0}if(re&&E.eat(123)&&this.regexp_eatHexDigits(E)&&E.eat(125)&&Zn(E.lastIntValue))return!0;re&&E.raise("Invalid unicode escape"),E.pos=J}return!1};function Zn(E){return E>=0&&E<=1114111}at.regexp_eatIdentityEscape=function(E){if(E.switchU)return this.regexp_eatSyntaxCharacter(E)?!0:E.eat(47)?(E.lastIntValue=47,!0):!1;var L=E.current();return L!==99&&(!E.switchN||L!==107)?(E.lastIntValue=L,E.advance(),!0):!1},at.regexp_eatDecimalEscape=function(E){E.lastIntValue=0;var L=E.current();if(L>=49&&L<=57){do E.lastIntValue=10*E.lastIntValue+(L-48),E.advance();while((L=E.current())>=48&&L<=57);return!0}return!1};var Nn=0,An=1,Sn=2;at.regexp_eatCharacterClassEscape=function(E){var L=E.current();if(an(L))return E.lastIntValue=-1,E.advance(),An;var J=!1;if(E.switchU&&this.options.ecmaVersion>=9&&((J=L===80)||L===112)){E.lastIntValue=-1,E.advance();var re;if(E.eat(123)&&(re=this.regexp_eatUnicodePropertyValueExpression(E))&&E.eat(125))return J&&re===Sn&&E.raise("Invalid property name"),re;E.raise("Invalid property name")}return Nn};function an(E){return E===100||E===68||E===115||E===83||E===119||E===87}at.regexp_eatUnicodePropertyValueExpression=function(E){var L=E.pos;if(this.regexp_eatUnicodePropertyName(E)&&E.eat(61)){var J=E.lastStringValue;if(this.regexp_eatUnicodePropertyValue(E)){var re=E.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(E,J,re),An}}if(E.pos=L,this.regexp_eatLoneUnicodePropertyNameOrValue(E)){var ye=E.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(E,ye)}return Nn},at.regexp_validateUnicodePropertyNameAndValue=function(E,L,J){F(E.unicodeProperties.nonBinary,L)||E.raise("Invalid property name"),E.unicodeProperties.nonBinary[L].test(J)||E.raise("Invalid property value")},at.regexp_validateUnicodePropertyNameOrValue=function(E,L){if(E.unicodeProperties.binary.test(L))return An;if(E.switchV&&E.unicodeProperties.binaryOfStrings.test(L))return Sn;E.raise("Invalid property name")},at.regexp_eatUnicodePropertyName=function(E){var L=0;for(E.lastStringValue="";di(L=E.current());)E.lastStringValue+=B(L),E.advance();return E.lastStringValue!==""};function di(E){return xn(E)||E===95}at.regexp_eatUnicodePropertyValue=function(E){var L=0;for(E.lastStringValue="";Li(L=E.current());)E.lastStringValue+=B(L),E.advance();return E.lastStringValue!==""};function Li(E){return di(E)||Gi(E)}at.regexp_eatLoneUnicodePropertyNameOrValue=function(E){return this.regexp_eatUnicodePropertyValue(E)},at.regexp_eatCharacterClass=function(E){if(E.eat(91)){var L=E.eat(94),J=this.regexp_classContents(E);return E.eat(93)||E.raise("Unterminated character class"),L&&J===Sn&&E.raise("Negated character class may contain strings"),!0}return!1},at.regexp_classContents=function(E){return E.current()===93?An:E.switchV?this.regexp_classSetExpression(E):(this.regexp_nonEmptyClassRanges(E),An)},at.regexp_nonEmptyClassRanges=function(E){for(;this.regexp_eatClassAtom(E);){var L=E.lastIntValue;if(E.eat(45)&&this.regexp_eatClassAtom(E)){var J=E.lastIntValue;E.switchU&&(L===-1||J===-1)&&E.raise("Invalid character class"),L!==-1&&J!==-1&&L>J&&E.raise("Range out of order in character class")}}},at.regexp_eatClassAtom=function(E){var L=E.pos;if(E.eat(92)){if(this.regexp_eatClassEscape(E))return!0;if(E.switchU){var J=E.current();(J===99||ko(J))&&E.raise("Invalid class escape"),E.raise("Invalid escape")}E.pos=L}var re=E.current();return re!==93?(E.lastIntValue=re,E.advance(),!0):!1},at.regexp_eatClassEscape=function(E){var L=E.pos;if(E.eat(98))return E.lastIntValue=8,!0;if(E.switchU&&E.eat(45))return E.lastIntValue=45,!0;if(!E.switchU&&E.eat(99)){if(this.regexp_eatClassControlLetter(E))return!0;E.pos=L}return this.regexp_eatCharacterClassEscape(E)||this.regexp_eatCharacterEscape(E)},at.regexp_classSetExpression=function(E){var L=An,J;if(!this.regexp_eatClassSetRange(E))if(J=this.regexp_eatClassSetOperand(E)){J===Sn&&(L=Sn);for(var re=E.pos;E.eatChars([38,38]);){if(E.current()!==38&&(J=this.regexp_eatClassSetOperand(E))){J!==Sn&&(L=An);continue}E.raise("Invalid character in character class")}if(re!==E.pos)return L;for(;E.eatChars([45,45]);)this.regexp_eatClassSetOperand(E)||E.raise("Invalid character in character class");if(re!==E.pos)return L}else E.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(E)){if(J=this.regexp_eatClassSetOperand(E),!J)return L;J===Sn&&(L=Sn)}},at.regexp_eatClassSetRange=function(E){var L=E.pos;if(this.regexp_eatClassSetCharacter(E)){var J=E.lastIntValue;if(E.eat(45)&&this.regexp_eatClassSetCharacter(E)){var re=E.lastIntValue;return J!==-1&&re!==-1&&J>re&&E.raise("Range out of order in character class"),!0}E.pos=L}return!1},at.regexp_eatClassSetOperand=function(E){return this.regexp_eatClassSetCharacter(E)?An:this.regexp_eatClassStringDisjunction(E)||this.regexp_eatNestedClass(E)},at.regexp_eatNestedClass=function(E){var L=E.pos;if(E.eat(91)){var J=E.eat(94),re=this.regexp_classContents(E);if(E.eat(93))return J&&re===Sn&&E.raise("Negated character class may contain strings"),re;E.pos=L}if(E.eat(92)){var ye=this.regexp_eatCharacterClassEscape(E);if(ye)return ye;E.pos=L}return null},at.regexp_eatClassStringDisjunction=function(E){var L=E.pos;if(E.eatChars([92,113])){if(E.eat(123)){var J=this.regexp_classStringDisjunctionContents(E);if(E.eat(125))return J}else E.raise("Invalid escape");E.pos=L}return null},at.regexp_classStringDisjunctionContents=function(E){for(var L=this.regexp_classString(E);E.eat(124);)this.regexp_classString(E)===Sn&&(L=Sn);return L},at.regexp_classString=function(E){for(var L=0;this.regexp_eatClassSetCharacter(E);)L++;return L===1?An:Sn},at.regexp_eatClassSetCharacter=function(E){var L=E.pos;if(E.eat(92))return this.regexp_eatCharacterEscape(E)||this.regexp_eatClassSetReservedPunctuator(E)?!0:E.eat(98)?(E.lastIntValue=8,!0):(E.pos=L,!1);var J=E.current();return J<0||J===E.lookahead()&&Gn(J)||wi(J)?!1:(E.advance(),E.lastIntValue=J,!0)};function Gn(E){return E===33||E>=35&&E<=38||E>=42&&E<=44||E===46||E>=58&&E<=64||E===94||E===96||E===126}function wi(E){return E===40||E===41||E===45||E===47||E>=91&&E<=93||E>=123&&E<=125}at.regexp_eatClassSetReservedPunctuator=function(E){var L=E.current();return Sa(L)?(E.lastIntValue=L,E.advance(),!0):!1};function Sa(E){return E===33||E===35||E===37||E===38||E===44||E===45||E>=58&&E<=62||E===64||E===96||E===126}at.regexp_eatClassControlLetter=function(E){var L=E.current();return Gi(L)||L===95?(E.lastIntValue=L%32,E.advance(),!0):!1},at.regexp_eatHexEscapeSequence=function(E){var L=E.pos;if(E.eat(120)){if(this.regexp_eatFixedHexDigits(E,2))return!0;E.switchU&&E.raise("Invalid escape"),E.pos=L}return!1},at.regexp_eatDecimalDigits=function(E){var L=E.pos,J=0;for(E.lastIntValue=0;Gi(J=E.current());)E.lastIntValue=10*E.lastIntValue+(J-48),E.advance();return E.pos!==L};function Gi(E){return E>=48&&E<=57}at.regexp_eatHexDigits=function(E){var L=E.pos,J=0;for(E.lastIntValue=0;Yo(J=E.current());)E.lastIntValue=16*E.lastIntValue+Bs(J),E.advance();return E.pos!==L};function Yo(E){return E>=48&&E<=57||E>=65&&E<=70||E>=97&&E<=102}function Bs(E){return E>=65&&E<=70?10+(E-65):E>=97&&E<=102?10+(E-97):E-48}at.regexp_eatLegacyOctalEscapeSequence=function(E){if(this.regexp_eatOctalDigit(E)){var L=E.lastIntValue;if(this.regexp_eatOctalDigit(E)){var J=E.lastIntValue;L<=3&&this.regexp_eatOctalDigit(E)?E.lastIntValue=L*64+J*8+E.lastIntValue:E.lastIntValue=L*8+J}else E.lastIntValue=L;return!0}return!1},at.regexp_eatOctalDigit=function(E){var L=E.current();return ko(L)?(E.lastIntValue=L-48,E.advance(),!0):(E.lastIntValue=0,!1)};function ko(E){return E>=48&&E<=55}at.regexp_eatFixedHexDigits=function(E,L){var J=E.pos;E.lastIntValue=0;for(var re=0;re<L;++re){var ye=E.current();if(!Yo(ye))return E.pos=J,!1;E.lastIntValue=16*E.lastIntValue+Bs(ye),E.advance()}return!0};var ds=function(L){this.type=L.type,this.value=L.value,this.start=L.start,this.end=L.end,L.options.locations&&(this.loc=new G(L,L.startLoc,L.endLoc)),L.options.ranges&&(this.range=[L.start,L.end])},_n=me.prototype;_n.next=function(E){!E&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ds(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},_n.getToken=function(){return this.next(),new ds(this)},typeof Symbol<"u"&&(_n[Symbol.iterator]=function(){var E=this;return{next:function(){var L=E.getToken();return{done:L.type===S.eof,value:L}}}}),_n.nextToken=function(){var E=this.curContext();if((!E||!E.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(S.eof);if(E.override)return E.override(this);this.readToken(this.fullCharCodeAtPos())},_n.readToken=function(E){return g(E,this.options.ecmaVersion>=6)||E===92?this.readWord():this.getTokenFromCode(E)},_n.fullCharCodeAtPos=function(){var E=this.input.charCodeAt(this.pos);if(E<=55295||E>=56320)return E;var L=this.input.charCodeAt(this.pos+1);return L<=56319||L>=57344?E:(E<<10)+L-56613888},_n.skipBlockComment=function(){var E=this.options.onComment&&this.curPosition(),L=this.pos,J=this.input.indexOf("*/",this.pos+=2);if(J===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=J+2,this.options.locations)for(var re=void 0,ye=L;(re=R(this.input,ye,this.pos))>-1;)++this.curLine,ye=this.lineStart=re;this.options.onComment&&this.options.onComment(!0,this.input.slice(L+2,J),L,this.pos,E,this.curPosition())},_n.skipLineComment=function(E){for(var L=this.pos,J=this.options.onComment&&this.curPosition(),re=this.input.charCodeAt(this.pos+=E);this.pos<this.input.length&&!k(re);)re=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(L+E,this.pos),L,this.pos,J,this.curPosition())},_n.skipSpace=function(){e:for(;this.pos<this.input.length;){var E=this.input.charCodeAt(this.pos);switch(E){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(E>8&&E<14||E>=5760&&N.test(String.fromCharCode(E)))++this.pos;else break e}}},_n.finishToken=function(E,L){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var J=this.type;this.type=E,this.value=L,this.updateContext(J)},_n.readToken_dot=function(){var E=this.input.charCodeAt(this.pos+1);if(E>=48&&E<=57)return this.readNumber(!0);var L=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&E===46&&L===46?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},_n.readToken_slash=function(){var E=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):E===61?this.finishOp(S.assign,2):this.finishOp(S.slash,1)},_n.readToken_mult_modulo_exp=function(E){var L=this.input.charCodeAt(this.pos+1),J=1,re=E===42?S.star:S.modulo;return this.options.ecmaVersion>=7&&E===42&&L===42&&(++J,re=S.starstar,L=this.input.charCodeAt(this.pos+2)),L===61?this.finishOp(S.assign,J+1):this.finishOp(re,J)},_n.readToken_pipe_amp=function(E){var L=this.input.charCodeAt(this.pos+1);if(L===E){if(this.options.ecmaVersion>=12){var J=this.input.charCodeAt(this.pos+2);if(J===61)return this.finishOp(S.assign,3)}return this.finishOp(E===124?S.logicalOR:S.logicalAND,2)}return L===61?this.finishOp(S.assign,2):this.finishOp(E===124?S.bitwiseOR:S.bitwiseAND,1)},_n.readToken_caret=function(){var E=this.input.charCodeAt(this.pos+1);return E===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},_n.readToken_plus_min=function(E){var L=this.input.charCodeAt(this.pos+1);return L===E?L===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||A.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(S.incDec,2):L===61?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},_n.readToken_lt_gt=function(E){var L=this.input.charCodeAt(this.pos+1),J=1;return L===E?(J=E===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+J)===61?this.finishOp(S.assign,J+1):this.finishOp(S.bitShift,J)):L===33&&E===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(L===61&&(J=2),this.finishOp(S.relational,J))},_n.readToken_eq_excl=function(E){var L=this.input.charCodeAt(this.pos+1);return L===61?this.finishOp(S.equality,this.input.charCodeAt(this.pos+2)===61?3:2):E===61&&L===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(E===61?S.eq:S.prefix,1)},_n.readToken_question=function(){var E=this.options.ecmaVersion;if(E>=11){var L=this.input.charCodeAt(this.pos+1);if(L===46){var J=this.input.charCodeAt(this.pos+2);if(J<48||J>57)return this.finishOp(S.questionDot,2)}if(L===63){if(E>=12){var re=this.input.charCodeAt(this.pos+2);if(re===61)return this.finishOp(S.assign,3)}return this.finishOp(S.coalesce,2)}}return this.finishOp(S.question,1)},_n.readToken_numberSign=function(){var E=this.options.ecmaVersion,L=35;if(E>=13&&(++this.pos,L=this.fullCharCodeAtPos(),g(L,!0)||L===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+B(L)+"'")},_n.getTokenFromCode=function(E){switch(E){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var L=this.input.charCodeAt(this.pos+1);if(L===120||L===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(L===111||L===79)return this.readRadixNumber(8);if(L===98||L===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(E);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(E);case 124:case 38:return this.readToken_pipe_amp(E);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(E);case 60:case 62:return this.readToken_lt_gt(E);case 61:case 33:return this.readToken_eq_excl(E);case 63:return this.readToken_question();case 126:return this.finishOp(S.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+B(E)+"'")},_n.finishOp=function(E,L){var J=this.input.slice(this.pos,this.pos+L);return this.pos+=L,this.finishToken(E,J)},_n.readRegexp=function(){for(var E,L,J=this.pos;;){this.pos>=this.input.length&&this.raise(J,"Unterminated regular expression");var re=this.input.charAt(this.pos);if(A.test(re)&&this.raise(J,"Unterminated regular expression"),E)E=!1;else{if(re==="[")L=!0;else if(re==="]"&&L)L=!1;else if(re==="/"&&!L)break;E=re==="\\"}++this.pos}var ye=this.input.slice(J,this.pos);++this.pos;var $e=this.pos,tt=this.readWord1();this.containsEsc&&this.unexpected($e);var Lt=this.regexpState||(this.regexpState=new pn(this));Lt.reset(J,ye,tt),this.validateRegExpFlags(Lt),this.validateRegExpPattern(Lt);var zt=null;try{zt=new RegExp(ye,tt)}catch{}return this.finishToken(S.regexp,{pattern:ye,flags:tt,value:zt})},_n.readInt=function(E,L,J){for(var re=this.options.ecmaVersion>=12&&L===void 0,ye=J&&this.input.charCodeAt(this.pos)===48,$e=this.pos,tt=0,Lt=0,zt=0,gn=L??1/0;zt<gn;++zt,++this.pos){var Mn=this.input.charCodeAt(this.pos),Ei=void 0;if(re&&Mn===95){ye&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),Lt===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),zt===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),Lt=Mn;continue}if(Mn>=97?Ei=Mn-97+10:Mn>=65?Ei=Mn-65+10:Mn>=48&&Mn<=57?Ei=Mn-48:Ei=1/0,Ei>=E)break;Lt=Mn,tt=tt*E+Ei}return re&&Lt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===$e||L!=null&&this.pos-$e!==L?null:tt};function Wa(E,L){return L?parseInt(E,8):parseFloat(E.replace(/_/g,""))}function ps(E){return typeof BigInt!="function"?null:BigInt(E.replace(/_/g,""))}_n.readRadixNumber=function(E){var L=this.pos;this.pos+=2;var J=this.readInt(E);return J==null&&this.raise(this.start+2,"Expected number in radix "+E),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(J=ps(this.input.slice(L,this.pos)),++this.pos):g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,J)},_n.readNumber=function(E){var L=this.pos;!E&&this.readInt(10,void 0,!0)===null&&this.raise(L,"Invalid number");var J=this.pos-L>=2&&this.input.charCodeAt(L)===48;J&&this.strict&&this.raise(L,"Invalid number");var re=this.input.charCodeAt(this.pos);if(!J&&!E&&this.options.ecmaVersion>=11&&re===110){var ye=ps(this.input.slice(L,this.pos));return++this.pos,g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,ye)}J&&/[89]/.test(this.input.slice(L,this.pos))&&(J=!1),re===46&&!J&&(++this.pos,this.readInt(10),re=this.input.charCodeAt(this.pos)),(re===69||re===101)&&!J&&(re=this.input.charCodeAt(++this.pos),(re===43||re===45)&&++this.pos,this.readInt(10)===null&&this.raise(L,"Invalid number")),g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var $e=Wa(this.input.slice(L,this.pos),J);return this.finishToken(S.num,$e)},_n.readCodePoint=function(){var E=this.input.charCodeAt(this.pos),L;if(E===123){this.options.ecmaVersion<6&&this.unexpected();var J=++this.pos;L=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,L>1114111&&this.invalidStringToken(J,"Code point out of bounds")}else L=this.readHexChar(4);return L},_n.readString=function(E){for(var L="",J=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var re=this.input.charCodeAt(this.pos);if(re===E)break;re===92?(L+=this.input.slice(J,this.pos),L+=this.readEscapedChar(!1),J=this.pos):re===8232||re===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(k(re)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return L+=this.input.slice(J,this.pos++),this.finishToken(S.string,L)};var Xa={};_n.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(E){if(E===Xa)this.readInvalidTemplateToken();else throw E}this.inTemplateElement=!1},_n.invalidStringToken=function(E,L){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Xa;this.raise(E,L)},_n.readTmplToken=function(){for(var E="",L=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var J=this.input.charCodeAt(this.pos);if(J===96||J===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===S.template||this.type===S.invalidTemplate)?J===36?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote)):(E+=this.input.slice(L,this.pos),this.finishToken(S.template,E));if(J===92)E+=this.input.slice(L,this.pos),E+=this.readEscapedChar(!0),L=this.pos;else if(k(J)){switch(E+=this.input.slice(L,this.pos),++this.pos,J){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:E+=`
`;break;default:E+=String.fromCharCode(J);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),L=this.pos}else++this.pos}},_n.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(S.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
`&&++this.pos;case`
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},_n.readEscapedChar=function(E){var L=this.input.charCodeAt(++this.pos);switch(++this.pos,L){case 110:return`
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return B(this.readCodePoint());case 116:return"	";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),E){var J=this.pos-1;this.invalidStringToken(J,"Invalid escape sequence in template string")}default:if(L>=48&&L<=55){var re=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],ye=parseInt(re,8);return ye>255&&(re=re.slice(0,-1),ye=parseInt(re,8)),this.pos+=re.length-1,L=this.input.charCodeAt(this.pos),(re!=="0"||L===56||L===57)&&(this.strict||E)&&this.invalidStringToken(this.pos-1-re.length,E?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(ye)}return k(L)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(L)}},_n.readHexChar=function(E){var L=this.pos,J=this.readInt(16,E);return J===null&&this.invalidStringToken(L,"Bad character escape sequence"),J},_n.readWord1=function(){this.containsEsc=!1;for(var E="",L=!0,J=this.pos,re=this.options.ecmaVersion>=6;this.pos<this.input.length;){var ye=this.fullCharCodeAtPos();if(b(ye,re))this.pos+=ye<=65535?1:2;else if(ye===92){this.containsEsc=!0,E+=this.input.slice(J,this.pos);var $e=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var tt=this.readCodePoint();(L?g:b)(tt,re)||this.invalidStringToken($e,"Invalid Unicode escape"),E+=B(tt),J=this.pos}else break;L=!1}return E+this.input.slice(J,this.pos)},_n.readWord=function(){var E=this.readWord1(),L=S.name;return this.keywords.test(E)&&(L=w[E]),this.finishToken(L,E)};var $i="8.15.0";me.acorn={Parser:me,version:$i,defaultOptions:oe,Position:Z,SourceLocation:G,getLineInfo:de,Node:Yn,TokenType:y,tokTypes:S,keywordTypes:w,TokContext:jt,tokContexts:ot,isIdentifierChar:b,isIdentifierStart:g,Token:ds,isNewLine:k,lineBreak:A,lineBreakG:C,nonASCIIwhitespace:N};function so(E,L){return me.parse(E,L)}function zs(E,L,J){return me.parseExpressionAt(E,L,J)}function js(E,L){return me.tokenizer(E,L)}n.Node=Yn,n.Parser=me,n.Position=Z,n.SourceLocation=G,n.TokContext=jt,n.Token=ds,n.TokenType=y,n.defaultOptions=oe,n.getLineInfo=de,n.isIdentifierChar=b,n.isIdentifierStart=g,n.isNewLine=k,n.keywordTypes=w,n.lineBreak=A,n.lineBreakG=C,n.nonASCIIwhitespace=N,n.parse=so,n.parseExpressionAt=zs,n.tokContexts=ot,n.tokTypes=S,n.tokenizer=js,n.version=$i})}(yE,yE.exports)),yE.exports}(function(t){const e=YCe,n=/^[\da-fA-F]+$/,i=/^\d+$/,r=new WeakMap;function a(l){l=l.Parser.acorn||l;let c=r.get(l);if(!c){const u=l.tokTypes,f=l.TokContext,h=l.TokenType,d=new f("<tag",!1),g=new f("</tag",!1),b=new f("<tag>...</tag>",!0,!0),y={tc_oTag:d,tc_cTag:g,tc_expr:b},p={jsxName:new h("jsxName"),jsxText:new h("jsxText",{beforeExpr:!0}),jsxTagStart:new h("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new h("jsxTagEnd")};p.jsxTagStart.updateContext=function(){this.context.push(b),this.context.push(d),this.exprAllowed=!1},p.jsxTagEnd.updateContext=function(x){let _=this.context.pop();_===d&&x===u.slash||_===g?(this.context.pop(),this.exprAllowed=this.curContext()===b):this.exprAllowed=!0},c={tokContexts:y,tokTypes:p},r.set(l,c)}return c}function s(l){if(!l)return l;if(l.type==="JSXIdentifier")return l.name;if(l.type==="JSXNamespacedName")return l.namespace.name+":"+l.name.name;if(l.type==="JSXMemberExpression")return s(l.object)+"."+s(l.property)}t.exports=function(l){return l=l||{},function(c){return o({allowNamespaces:l.allowNamespaces!==!1,allowNamespacedObjects:!!l.allowNamespacedObjects},c)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return a(RI()).tokTypes},configurable:!0,enumerable:!0});function o(l,c){const u=c.acorn||RI(),f=a(u),h=u.tokTypes,d=f.tokTypes,g=u.tokContexts,b=f.tokContexts.tc_oTag,y=f.tokContexts.tc_cTag,p=f.tokContexts.tc_expr,x=u.isNewLine,_=u.isIdentifierStart,w=u.isIdentifierChar;return class extends c{static get acornJsx(){return f}jsx_readToken(){let M="",S=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let A=this.input.charCodeAt(this.pos);switch(A){case 60:case 123:return this.pos===this.start?A===60&&this.exprAllowed?(++this.pos,this.finishToken(d.jsxTagStart)):this.getTokenFromCode(A):(M+=this.input.slice(S,this.pos),this.finishToken(d.jsxText,M));case 38:M+=this.input.slice(S,this.pos),M+=this.jsx_readEntity(),S=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(A===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:x(A)?(M+=this.input.slice(S,this.pos),M+=this.jsx_readNewLine(!0),S=this.pos):++this.pos}}}jsx_readNewLine(M){let S=this.input.charCodeAt(this.pos),A;return++this.pos,S===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,A=M?`
`:`\r
`):A=String.fromCharCode(S),this.options.locations&&(++this.curLine,this.lineStart=this.pos),A}jsx_readString(M){let S="",A=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let C=this.input.charCodeAt(this.pos);if(C===M)break;C===38?(S+=this.input.slice(A,this.pos),S+=this.jsx_readEntity(),A=this.pos):x(C)?(S+=this.input.slice(A,this.pos),S+=this.jsx_readNewLine(!1),A=this.pos):++this.pos}return S+=this.input.slice(A,this.pos++),this.finishToken(h.string,S)}jsx_readEntity(){let M="",S=0,A,C=this.input[this.pos];C!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let k=++this.pos;for(;this.pos<this.input.length&&S++<10;){if(C=this.input[this.pos++],C===";"){M[0]==="#"?M[1]==="x"?(M=M.substr(2),n.test(M)&&(A=String.fromCharCode(parseInt(M,16)))):(M=M.substr(1),i.test(M)&&(A=String.fromCharCode(parseInt(M,10)))):A=e[M];break}M+=C}return A||(this.pos=k,"&")}jsx_readWord(){let M,S=this.pos;do M=this.input.charCodeAt(++this.pos);while(w(M)||M===45);return this.finishToken(d.jsxName,this.input.slice(S,this.pos))}jsx_parseIdentifier(){let M=this.startNode();return this.type===d.jsxName?M.name=this.value:this.type.keyword?M.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(M,"JSXIdentifier")}jsx_parseNamespacedName(){let M=this.start,S=this.startLoc,A=this.jsx_parseIdentifier();if(!l.allowNamespaces||!this.eat(h.colon))return A;var C=this.startNodeAt(M,S);return C.namespace=A,C.name=this.jsx_parseIdentifier(),this.finishNode(C,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===d.jsxTagEnd)return"";let M=this.start,S=this.startLoc,A=this.jsx_parseNamespacedName();for(this.type===h.dot&&A.type==="JSXNamespacedName"&&!l.allowNamespacedObjects&&this.unexpected();this.eat(h.dot);){let C=this.startNodeAt(M,S);C.object=A,C.property=this.jsx_parseIdentifier(),A=this.finishNode(C,"JSXMemberExpression")}return A}jsx_parseAttributeValue(){switch(this.type){case h.braceL:let M=this.jsx_parseExpressionContainer();return M.expression.type==="JSXEmptyExpression"&&this.raise(M.start,"JSX attributes must only be assigned a non-empty expression"),M;case d.jsxTagStart:case h.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let M=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(M,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let M=this.startNode();return this.next(),M.expression=this.type===h.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(h.braceR),this.finishNode(M,"JSXExpressionContainer")}jsx_parseAttribute(){let M=this.startNode();return this.eat(h.braceL)?(this.expect(h.ellipsis),M.argument=this.parseMaybeAssign(),this.expect(h.braceR),this.finishNode(M,"JSXSpreadAttribute")):(M.name=this.jsx_parseNamespacedName(),M.value=this.eat(h.eq)?this.jsx_parseAttributeValue():null,this.finishNode(M,"JSXAttribute"))}jsx_parseOpeningElementAt(M,S){let A=this.startNodeAt(M,S);A.attributes=[];let C=this.jsx_parseElementName();for(C&&(A.name=C);this.type!==h.slash&&this.type!==d.jsxTagEnd;)A.attributes.push(this.jsx_parseAttribute());return A.selfClosing=this.eat(h.slash),this.expect(d.jsxTagEnd),this.finishNode(A,C?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(M,S){let A=this.startNodeAt(M,S),C=this.jsx_parseElementName();return C&&(A.name=C),this.expect(d.jsxTagEnd),this.finishNode(A,C?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(M,S){let A=this.startNodeAt(M,S),C=[],k=this.jsx_parseOpeningElementAt(M,S),R=null;if(!k.selfClosing){e:for(;;)switch(this.type){case d.jsxTagStart:if(M=this.start,S=this.startLoc,this.next(),this.eat(h.slash)){R=this.jsx_parseClosingElementAt(M,S);break e}C.push(this.jsx_parseElementAt(M,S));break;case d.jsxText:C.push(this.parseExprAtom());break;case h.braceL:C.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(R.name)!==s(k.name)&&this.raise(R.start,"Expected corresponding JSX closing tag for <"+s(k.name)+">")}let N=k.name?"Element":"Fragment";return A["opening"+N]=k,A["closing"+N]=R,A.children=C,this.type===h.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(A,"JSX"+N)}jsx_parseText(){let M=this.parseLiteral(this.value);return M.type="JSXText",M}jsx_parseElement(){let M=this.start,S=this.startLoc;return this.next(),this.jsx_parseElementAt(M,S)}parseExprAtom(M){return this.type===d.jsxText?this.jsx_parseText():this.type===d.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(M)}readToken(M){let S=this.curContext();if(S===p)return this.jsx_readToken();if(S===b||S===y){if(_(M))return this.jsx_readWord();if(M==62)return++this.pos,this.finishToken(d.jsxTagEnd);if((M===34||M===39)&&S==b)return this.jsx_readString(M)}return M===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(d.jsxTagStart)):super.readToken(M)}updateContext(M){if(this.type==h.braceL){var S=this.curContext();S==b?this.context.push(g.b_expr):S==p?this.context.push(g.b_tmpl):super.updateContext(M),this.exprAllowed=!0}else if(this.type===h.slash&&M===d.jsxTagStart)this.context.length-=2,this.context.push(y),this.exprAllowed=!1;else return super.updateContext(M)}}}})(RQ);var JCe=RQ.exports;const kQ=Rc(JCe),{stringify:$Ce}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");const xE={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},ru=17,ZCe={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:ru,ClassExpression:ru,FunctionExpression:ru,ObjectExpression:ru,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Db(t,e){const{generator:n}=t;if(t.write("("),e!=null&&e.length>0){n[e[0].type](e[0],t);const{length:i}=e;for(let r=1;r<i;r++){const a=e[r];t.write(", "),n[a.type](a,t)}}t.write(")")}function DQ(t,e,n,i){const r=t.expressionsPrecedence[e.type];if(r===ru)return!0;const a=t.expressionsPrecedence[n.type];return r!==a?!i&&r===15&&a===14&&n.operator==="**"||r<a:r!==13&&r!==14?!1:e.operator==="**"&&n.operator==="**"?!i:r===13&&a===13&&(e.operator==="??"||n.operator==="??")?!0:i?xE[e.operator]<=xE[n.operator]:xE[e.operator]<xE[n.operator]}function _E(t,e,n,i){const{generator:r}=t;DQ(t,e,n,i)?(t.write("("),r[e.type](e,t),t.write(")")):r[e.type](e,t)}function QCe(t,e,n,i){const r=e.split(`
`),a=r.length-1;if(t.write(r[0].trim()),a>0){t.write(i);for(let s=1;s<a;s++)t.write(n+r[s].trim()+i);t.write(n+r[a].trim())}}function bo(t,e,n,i){const{length:r}=e;for(let a=0;a<r;a++){const s=e[a];t.write(n),s.type[0]==="L"?t.write("// "+s.value.trim()+`
`,s):(t.write("/*"),QCe(t,s.value,n,i),t.write("*/"+i))}}function eRe(t){let e=t;for(;e!=null;){const{type:n}=e;if(n[0]==="C"&&n[1]==="a")return!0;if(n[0]==="M"&&n[1]==="e"&&n[2]==="m")e=e.object;else return!1}}function BD(t,e){const{generator:n}=t,{declarations:i}=e;t.write(e.kind+" ");const{length:r}=i;if(r>0){n.VariableDeclarator(i[0],t);for(let a=1;a<r;a++)t.write(", "),n.VariableDeclarator(i[a],t)}}let nH,iH,rH,aH,sH,oH;const OQ={Program(t,e){const n=e.indent.repeat(e.indentLevel),{lineEnd:i,writeComments:r}=e;r&&t.comments!=null&&bo(e,t.comments,n,i);const a=t.body,{length:s}=a;for(let o=0;o<s;o++){const l=a[o];r&&l.comments!=null&&bo(e,l.comments,n,i),e.write(n),this[l.type](l,e),e.write(i)}r&&t.trailingComments!=null&&bo(e,t.trailingComments,n,i)},BlockStatement:oH=function(t,e){const n=e.indent.repeat(e.indentLevel++),{lineEnd:i,writeComments:r}=e,a=n+e.indent;e.write("{");const s=t.body;if(s!=null&&s.length>0){e.write(i),r&&t.comments!=null&&bo(e,t.comments,a,i);const{length:o}=s;for(let l=0;l<o;l++){const c=s[l];r&&c.comments!=null&&bo(e,c.comments,a,i),e.write(a),this[c.type](c,e),e.write(i)}e.write(n)}else r&&t.comments!=null&&(e.write(i),bo(e,t.comments,a,i),e.write(n));r&&t.trailingComments!=null&&bo(e,t.trailingComments,a,i),e.write("}"),e.indentLevel--},ClassBody:oH,StaticBlock(t,e){e.write("static "),this.BlockStatement(t,e)},EmptyStatement(t,e){e.write(";")},ExpressionStatement(t,e){const n=e.expressionsPrecedence[t.expression.type];n===ru||n===3&&t.expression.left.type[0]==="O"?(e.write("("),this[t.expression.type](t.expression,e),e.write(")")):this[t.expression.type](t.expression,e),e.write(";")},IfStatement(t,e){e.write("if ("),this[t.test.type](t.test,e),e.write(") "),this[t.consequent.type](t.consequent,e),t.alternate!=null&&(e.write(" else "),this[t.alternate.type](t.alternate,e))},LabeledStatement(t,e){this[t.label.type](t.label,e),e.write(": "),this[t.body.type](t.body,e)},BreakStatement(t,e){e.write("break"),t.label!=null&&(e.write(" "),this[t.label.type](t.label,e)),e.write(";")},ContinueStatement(t,e){e.write("continue"),t.label!=null&&(e.write(" "),this[t.label.type](t.label,e)),e.write(";")},WithStatement(t,e){e.write("with ("),this[t.object.type](t.object,e),e.write(") "),this[t.body.type](t.body,e)},SwitchStatement(t,e){const n=e.indent.repeat(e.indentLevel++),{lineEnd:i,writeComments:r}=e;e.indentLevel++;const a=n+e.indent,s=a+e.indent;e.write("switch ("),this[t.discriminant.type](t.discriminant,e),e.write(") {"+i);const{cases:o}=t,{length:l}=o;for(let c=0;c<l;c++){const u=o[c];r&&u.comments!=null&&bo(e,u.comments,a,i),u.test?(e.write(a+"case "),this[u.test.type](u.test,e),e.write(":"+i)):e.write(a+"default:"+i);const{consequent:f}=u,{length:h}=f;for(let d=0;d<h;d++){const g=f[d];r&&g.comments!=null&&bo(e,g.comments,s,i),e.write(s),this[g.type](g,e),e.write(i)}}e.indentLevel-=2,e.write(n+"}")},ReturnStatement(t,e){e.write("return"),t.argument&&(e.write(" "),this[t.argument.type](t.argument,e)),e.write(";")},ThrowStatement(t,e){e.write("throw "),this[t.argument.type](t.argument,e),e.write(";")},TryStatement(t,e){if(e.write("try "),this[t.block.type](t.block,e),t.handler){const{handler:n}=t;n.param==null?e.write(" catch "):(e.write(" catch ("),this[n.param.type](n.param,e),e.write(") ")),this[n.body.type](n.body,e)}t.finalizer&&(e.write(" finally "),this[t.finalizer.type](t.finalizer,e))},WhileStatement(t,e){e.write("while ("),this[t.test.type](t.test,e),e.write(") "),this[t.body.type](t.body,e)},DoWhileStatement(t,e){e.write("do "),this[t.body.type](t.body,e),e.write(" while ("),this[t.test.type](t.test,e),e.write(");")},ForStatement(t,e){if(e.write("for ("),t.init!=null){const{init:n}=t;n.type[0]==="V"?BD(e,n):this[n.type](n,e)}e.write("; "),t.test&&this[t.test.type](t.test,e),e.write("; "),t.update&&this[t.update.type](t.update,e),e.write(") "),this[t.body.type](t.body,e)},ForInStatement:nH=function(t,e){e.write(`for ${t.await?"await ":""}(`);const{left:n}=t;n.type[0]==="V"?BD(e,n):this[n.type](n,e),e.write(t.type[3]==="I"?" in ":" of "),this[t.right.type](t.right,e),e.write(") "),this[t.body.type](t.body,e)},ForOfStatement:nH,DebuggerStatement(t,e){e.write("debugger;",t)},FunctionDeclaration:iH=function(t,e){e.write((t.async?"async ":"")+(t.generator?"function* ":"function ")+(t.id?t.id.name:""),t),Db(e,t.params),e.write(" "),this[t.body.type](t.body,e)},FunctionExpression:iH,VariableDeclaration(t,e){BD(e,t),e.write(";")},VariableDeclarator(t,e){this[t.id.type](t.id,e),t.init!=null&&(e.write(" = "),this[t.init.type](t.init,e))},ClassDeclaration(t,e){if(e.write("class "+(t.id?`${t.id.name} `:""),t),t.superClass){e.write("extends ");const{superClass:n}=t,{type:i}=n,r=e.expressionsPrecedence[i];(i[0]!=="C"||i[1]!=="l"||i[5]!=="E")&&(r===ru||r<e.expressionsPrecedence.ClassExpression)?(e.write("("),this[t.superClass.type](n,e),e.write(")")):this[n.type](n,e),e.write(" ")}this.ClassBody(t.body,e)},ImportDeclaration(t,e){e.write("import ");const{specifiers:n,attributes:i}=t,{length:r}=n;let a=0;if(r>0){for(;a<r;){a>0&&e.write(", ");const s=n[a],o=s.type[6];if(o==="D")e.write(s.local.name,s),a++;else if(o==="N")e.write("* as "+s.local.name,s),a++;else break}if(a<r){for(e.write("{");;){const s=n[a],{name:o}=s.imported;if(e.write(o,s),o!==s.local.name&&e.write(" as "+s.local.name),++a<r)e.write(", ");else break}e.write("}")}e.write(" from ")}if(this.Literal(t.source,e),i&&i.length>0){e.write(" with { ");for(let s=0;s<i.length;s++)this.ImportAttribute(i[s],e),s<i.length-1&&e.write(", ");e.write(" }")}e.write(";")},ImportAttribute(t,e){this.Identifier(t.key,e),e.write(": "),this.Literal(t.value,e)},ImportExpression(t,e){e.write("import("),this[t.source.type](t.source,e),e.write(")")},ExportDefaultDeclaration(t,e){e.write("export default "),this[t.declaration.type](t.declaration,e),e.expressionsPrecedence[t.declaration.type]!=null&&t.declaration.type[0]!=="F"&&e.write(";")},ExportNamedDeclaration(t,e){if(e.write("export "),t.declaration)this[t.declaration.type](t.declaration,e);else{e.write("{");const{specifiers:n}=t,{length:i}=n;if(i>0)for(let r=0;;){const a=n[r],{name:s}=a.local;if(e.write(s,a),s!==a.exported.name&&e.write(" as "+a.exported.name),++r<i)e.write(", ");else break}if(e.write("}"),t.source&&(e.write(" from "),this.Literal(t.source,e)),t.attributes&&t.attributes.length>0){e.write(" with { ");for(let r=0;r<t.attributes.length;r++)this.ImportAttribute(t.attributes[r],e),r<t.attributes.length-1&&e.write(", ");e.write(" }")}e.write(";")}},ExportAllDeclaration(t,e){if(t.exported!=null?e.write("export * as "+t.exported.name+" from "):e.write("export * from "),this.Literal(t.source,e),t.attributes&&t.attributes.length>0){e.write(" with { ");for(let n=0;n<t.attributes.length;n++)this.ImportAttribute(t.attributes[n],e),n<t.attributes.length-1&&e.write(", ");e.write(" }")}e.write(";")},MethodDefinition(t,e){t.static&&e.write("static ");const n=t.kind[0];(n==="g"||n==="s")&&e.write(t.kind+" "),t.value.async&&e.write("async "),t.value.generator&&e.write("*"),t.computed?(e.write("["),this[t.key.type](t.key,e),e.write("]")):this[t.key.type](t.key,e),Db(e,t.value.params),e.write(" "),this[t.value.body.type](t.value.body,e)},ClassExpression(t,e){this.ClassDeclaration(t,e)},ArrowFunctionExpression(t,e){e.write(t.async?"async ":"",t);const{params:n}=t;n!=null&&(n.length===1&&n[0].type[0]==="I"?e.write(n[0].name,n[0]):Db(e,t.params)),e.write(" => "),t.body.type[0]==="O"?(e.write("("),this.ObjectExpression(t.body,e),e.write(")")):this[t.body.type](t.body,e)},ThisExpression(t,e){e.write("this",t)},Super(t,e){e.write("super",t)},RestElement:rH=function(t,e){e.write("..."),this[t.argument.type](t.argument,e)},SpreadElement:rH,YieldExpression(t,e){e.write(t.delegate?"yield*":"yield"),t.argument&&(e.write(" "),this[t.argument.type](t.argument,e))},AwaitExpression(t,e){e.write("await ",t),_E(e,t.argument,t)},TemplateLiteral(t,e){const{quasis:n,expressions:i}=t;e.write("`");const{length:r}=i;for(let s=0;s<r;s++){const o=i[s],l=n[s];e.write(l.value.raw,l),e.write("${"),this[o.type](o,e),e.write("}")}const a=n[n.length-1];e.write(a.value.raw,a),e.write("`")},TemplateElement(t,e){e.write(t.value.raw,t)},TaggedTemplateExpression(t,e){_E(e,t.tag,t),this[t.quasi.type](t.quasi,e)},ArrayExpression:sH=function(t,e){if(e.write("["),t.elements.length>0){const{elements:n}=t,{length:i}=n;for(let r=0;;){const a=n[r];if(a!=null&&this[a.type](a,e),++r<i)e.write(", ");else{a==null&&e.write(", ");break}}}e.write("]")},ArrayPattern:sH,ObjectExpression(t,e){const n=e.indent.repeat(e.indentLevel++),{lineEnd:i,writeComments:r}=e,a=n+e.indent;if(e.write("{"),t.properties.length>0){e.write(i),r&&t.comments!=null&&bo(e,t.comments,a,i);const s=","+i,{properties:o}=t,{length:l}=o;for(let c=0;;){const u=o[c];if(r&&u.comments!=null&&bo(e,u.comments,a,i),e.write(a),this[u.type](u,e),++c<l)e.write(s);else break}e.write(i),r&&t.trailingComments!=null&&bo(e,t.trailingComments,a,i),e.write(n+"}")}else r?t.comments!=null?(e.write(i),bo(e,t.comments,a,i),t.trailingComments!=null&&bo(e,t.trailingComments,a,i),e.write(n+"}")):t.trailingComments!=null?(e.write(i),bo(e,t.trailingComments,a,i),e.write(n+"}")):e.write("}"):e.write("}");e.indentLevel--},Property(t,e){t.method||t.kind[0]!=="i"?this.MethodDefinition(t,e):(t.shorthand||(t.computed?(e.write("["),this[t.key.type](t.key,e),e.write("]")):this[t.key.type](t.key,e),e.write(": ")),this[t.value.type](t.value,e))},PropertyDefinition(t,e){if(t.static&&e.write("static "),t.computed&&e.write("["),this[t.key.type](t.key,e),t.computed&&e.write("]"),t.value==null){t.key.type[0]!=="F"&&e.write(";");return}e.write(" = "),this[t.value.type](t.value,e),e.write(";")},ObjectPattern(t,e){if(e.write("{"),t.properties.length>0){const{properties:n}=t,{length:i}=n;for(let r=0;this[n[r].type](n[r],e),++r<i;)e.write(", ")}e.write("}")},SequenceExpression(t,e){Db(e,t.expressions)},UnaryExpression(t,e){if(t.prefix){const{operator:n,argument:i,argument:{type:r}}=t;e.write(n);const a=DQ(e,i,t);!a&&(n.length>1||r[0]==="U"&&(r[1]==="n"||r[1]==="p")&&i.prefix&&i.operator[0]===n&&(n==="+"||n==="-"))&&e.write(" "),a?(e.write(n.length>1?" (":"("),this[r](i,e),e.write(")")):this[r](i,e)}else this[t.argument.type](t.argument,e),e.write(t.operator)},UpdateExpression(t,e){t.prefix?(e.write(t.operator),this[t.argument.type](t.argument,e)):(this[t.argument.type](t.argument,e),e.write(t.operator))},AssignmentExpression(t,e){this[t.left.type](t.left,e),e.write(" "+t.operator+" "),this[t.right.type](t.right,e)},AssignmentPattern(t,e){this[t.left.type](t.left,e),e.write(" = "),this[t.right.type](t.right,e)},BinaryExpression:aH=function(t,e){const n=t.operator==="in";n&&e.write("("),_E(e,t.left,t,!1),e.write(" "+t.operator+" "),_E(e,t.right,t,!0),n&&e.write(")")},LogicalExpression:aH,ConditionalExpression(t,e){const{test:n}=t,i=e.expressionsPrecedence[n.type];i===ru||i<=e.expressionsPrecedence.ConditionalExpression?(e.write("("),this[n.type](n,e),e.write(")")):this[n.type](n,e),e.write(" ? "),this[t.consequent.type](t.consequent,e),e.write(" : "),this[t.alternate.type](t.alternate,e)},NewExpression(t,e){e.write("new ");const n=e.expressionsPrecedence[t.callee.type];n===ru||n<e.expressionsPrecedence.CallExpression||eRe(t.callee)?(e.write("("),this[t.callee.type](t.callee,e),e.write(")")):this[t.callee.type](t.callee,e),Db(e,t.arguments)},CallExpression(t,e){const n=e.expressionsPrecedence[t.callee.type];n===ru||n<e.expressionsPrecedence.CallExpression?(e.write("("),this[t.callee.type](t.callee,e),e.write(")")):this[t.callee.type](t.callee,e),t.optional&&e.write("?."),Db(e,t.arguments)},ChainExpression(t,e){this[t.expression.type](t.expression,e)},MemberExpression(t,e){const n=e.expressionsPrecedence[t.object.type];n===ru||n<e.expressionsPrecedence.MemberExpression?(e.write("("),this[t.object.type](t.object,e),e.write(")")):this[t.object.type](t.object,e),t.computed?(t.optional&&e.write("?."),e.write("["),this[t.property.type](t.property,e),e.write("]")):(t.optional?e.write("?."):e.write("."),this[t.property.type](t.property,e))},MetaProperty(t,e){e.write(t.meta.name+"."+t.property.name,t)},Identifier(t,e){e.write(t.name,t)},PrivateIdentifier(t,e){e.write(`#${t.name}`,t)},Literal(t,e){t.raw!=null?e.write(t.raw,t):t.regex!=null?this.RegExpLiteral(t,e):t.bigint!=null?e.write(t.bigint+"n",t):e.write($Ce(t.value),t)},RegExpLiteral(t,e){const{regex:n}=t;e.write(`/${n.pattern}/${n.flags}`,t)}},tRe={};class nRe{constructor(e){const n=e??tRe;this.output="",n.output!=null?(this.output=n.output,this.write=this.writeToStream):this.output="",this.generator=n.generator!=null?n.generator:OQ,this.expressionsPrecedence=n.expressionsPrecedence!=null?n.expressionsPrecedence:ZCe,this.indent=n.indent!=null?n.indent:"  ",this.lineEnd=n.lineEnd!=null?n.lineEnd:`
`,this.indentLevel=n.startingIndentLevel!=null?n.startingIndentLevel:0,this.writeComments=n.comments?n.comments:!1,n.sourceMap!=null&&(this.write=n.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=n.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:n.sourceMap.file||n.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,n){this.output+=e,this.map(e,n)}writeToStreamAndMap(e,n){this.output.write(e),this.map(e,n)}map(e,n){if(n!=null){const{type:a}=n;if(a[0]==="L"&&a[2]==="n"){this.column=0,this.line++;return}if(n.loc!=null){const{mapping:s}=this;s.original=n.loc.start,s.name=n.name,this.sourceMap.addMapping(s)}if(a[0]==="T"&&a[8]==="E"||a[0]==="L"&&a[1]==="i"&&typeof n.value=="string"){const{length:s}=e;let{column:o,line:l}=this;for(let c=0;c<s;c++)e[c]===`
`?(o=0,l++):o++;this.column=o,this.line=l;return}}const{length:i}=e,{lineEnd:r}=this;i>0&&(this.lineEndSize>0&&(r.length===1?e[i-1]===r:e.endsWith(r))?(this.line+=this.lineEndSize,this.column=0):this.column+=i)}toString(){return this.output}}function iRe(t,e){const n=new nRe(e);return n.generator[t.type](t,n),n.output}const rRe={};function aRe(t,e){const{SourceMapGenerator:n,filePath:i,handlers:r}=e||rRe,a=n?new n({file:i||"<unknown>.js"}):void 0,s=iRe(t,{comments:!0,generator:{...OQ,...r},sourceMap:a||void 0}),o=a?a.toJSON():void 0;return{value:s,map:o}}const sRe={JSXAttribute:oRe,JSXClosingElement:lRe,JSXClosingFragment:cRe,JSXElement:uRe,JSXEmptyExpression:fRe,JSXExpressionContainer:hRe,JSXFragment:dRe,JSXIdentifier:pRe,JSXMemberExpression:mRe,JSXNamespacedName:gRe,JSXOpeningElement:bRe,JSXOpeningFragment:vRe,JSXSpreadAttribute:yRe,JSXText:xRe};function oRe(t,e){this[t.name.type](t.name,e),t.value!==null&&t.value!==void 0&&(e.write("="),t.value.type==="Literal"?e.write('"'+IQ(String(t.value.value)).replace(/"/g,"&quot;")+'"',t):this[t.value.type](t.value,e))}function lRe(t,e){e.write("</"),this[t.name.type](t.name,e),e.write(">")}function cRe(t,e){e.write("</>",t)}function uRe(t,e){let n=-1;if(this[t.openingElement.type](t.openingElement,e),t.children)for(;++n<t.children.length;){const i=t.children[n];if(i.type==="JSXSpreadChild")throw new Error("JSX spread children are not supported");this[i.type](i,e)}t.closingElement&&this[t.closingElement.type](t.closingElement,e)}function fRe(){}function hRe(t,e){e.write("{"),this[t.expression.type](t.expression,e),e.write("}")}function dRe(t,e){let n=-1;if(this[t.openingFragment.type](t.openingFragment,e),t.children)for(;++n<t.children.length;){const i=t.children[n];if(i.type==="JSXSpreadChild")throw new Error("JSX spread children are not supported");this[i.type](i,e)}this[t.closingFragment.type](t.closingFragment,e)}function pRe(t,e){e.write(t.name,t)}function mRe(t,e){this[t.object.type](t.object,e),e.write("."),this[t.property.type](t.property,e)}function gRe(t,e){this[t.namespace.type](t.namespace,e),e.write(":"),this[t.name.type](t.name,e)}function bRe(t,e){let n=-1;if(e.write("<"),this[t.name.type](t.name,e),t.attributes)for(;++n<t.attributes.length;)e.write(" "),this[t.attributes[n].type](t.attributes[n],e);e.write(t.selfClosing?" />":">")}function vRe(t,e){e.write("<>",t)}function yRe(t,e){e.write("{"),this.SpreadElement(t,e),e.write("}")}function xRe(t,e){e.write(IQ(t.value).replace(/[<>{}]/g,_Re),t)}function IQ(t){return t.replace(/&(?=[#a-z])/gi,"&amp;")}function _Re(t){return t==="<"?"&lt;":t===">"?"&gt;":t==="{"?"&#123;":"&#125;"}function SRe(){const t=this.data(),e=t.settings||(t.settings={}),n=e.handlers||(e.handlers={});(e.plugins||(e.plugins=[])).push(kQ()),Object.assign(n,sRe)}function wRe(t){const e=this;this.compiler=n;function n(i,r){const a={...e.data("settings"),...t},s=aRe(i,{SourceMapGenerator:a.SourceMapGenerator,filePath:r.path||"unknown.js",handlers:a.handlers});return r.map=s.map,s.value}}function ERe(t,e){const n={type:"Block",value:t.value};e.inherit(t,n),e.comments.push(n);const i={type:"JSXEmptyExpression",comments:[Object.assign({},n,{leading:!1,trailing:!0})]};e.patch(t,i);const r={type:"JSXExpressionContainer",expression:i};return e.patch(t,r),r}function MRe(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}class iS{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}iS.prototype.normal={};iS.prototype.property={};iS.prototype.space=void 0;function NQ(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new iS(n,i,e)}function kI(t){return t.toLowerCase()}class Ko{constructor(e,n){this.attribute=n,this.property=e}}Ko.prototype.attribute="";Ko.prototype.booleanish=!1;Ko.prototype.boolean=!1;Ko.prototype.commaOrSpaceSeparated=!1;Ko.prototype.commaSeparated=!1;Ko.prototype.defined=!1;Ko.prototype.mustUseProperty=!1;Ko.prototype.number=!1;Ko.prototype.overloadedBoolean=!1;Ko.prototype.property="";Ko.prototype.spaceSeparated=!1;Ko.prototype.space=void 0;let TRe=0;const li=gg(),Ta=gg(),DI=gg(),Wt=gg(),Nr=gg(),A0=gg(),dl=gg();function gg(){return 2**++TRe}const OI=Object.freeze(Object.defineProperty({__proto__:null,boolean:li,booleanish:Ta,commaOrSpaceSeparated:dl,commaSeparated:A0,number:Wt,overloadedBoolean:DI,spaceSeparated:Nr},Symbol.toStringTag,{value:"Module"})),zD=Object.keys(OI);class YU extends Ko{constructor(e,n,i,r){let a=-1;if(super(e,n),lH(this,"space",r),typeof i=="number")for(;++a<zD.length;){const s=zD[a];lH(this,zD[a],(i&OI[s])===OI[s])}}}YU.prototype.defined=!0;function lH(t,e,n){n&&(t[e]=n)}function ry(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const a=new YU(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),e[i]=a,n[kI(i)]=i,n[kI(a.attribute)]=i}return new iS(e,n,t.space)}const LQ=ry({properties:{ariaActiveDescendant:null,ariaAtomic:Ta,ariaAutoComplete:null,ariaBusy:Ta,ariaChecked:Ta,ariaColCount:Wt,ariaColIndex:Wt,ariaColSpan:Wt,ariaControls:Nr,ariaCurrent:null,ariaDescribedBy:Nr,ariaDetails:null,ariaDisabled:Ta,ariaDropEffect:Nr,ariaErrorMessage:null,ariaExpanded:Ta,ariaFlowTo:Nr,ariaGrabbed:Ta,ariaHasPopup:null,ariaHidden:Ta,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nr,ariaLevel:Wt,ariaLive:null,ariaModal:Ta,ariaMultiLine:Ta,ariaMultiSelectable:Ta,ariaOrientation:null,ariaOwns:Nr,ariaPlaceholder:null,ariaPosInSet:Wt,ariaPressed:Ta,ariaReadOnly:Ta,ariaRelevant:null,ariaRequired:Ta,ariaRoleDescription:Nr,ariaRowCount:Wt,ariaRowIndex:Wt,ariaRowSpan:Wt,ariaSelected:Ta,ariaSetSize:Wt,ariaSort:null,ariaValueMax:Wt,ariaValueMin:Wt,ariaValueNow:Wt,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function PQ(t,e){return e in t?t[e]:e}function UQ(t,e){return PQ(t,e.toLowerCase())}const ARe=ry({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:A0,acceptCharset:Nr,accessKey:Nr,action:null,allow:null,allowFullScreen:li,allowPaymentRequest:li,allowUserMedia:li,alt:null,as:null,async:li,autoCapitalize:null,autoComplete:Nr,autoFocus:li,autoPlay:li,blocking:Nr,capture:null,charSet:null,checked:li,cite:null,className:Nr,cols:Wt,colSpan:null,content:null,contentEditable:Ta,controls:li,controlsList:Nr,coords:Wt|A0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:li,defer:li,dir:null,dirName:null,disabled:li,download:DI,draggable:Ta,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:li,formTarget:null,headers:Nr,height:Wt,hidden:DI,high:Wt,href:null,hrefLang:null,htmlFor:Nr,httpEquiv:Nr,id:null,imageSizes:null,imageSrcSet:null,inert:li,inputMode:null,integrity:null,is:null,isMap:li,itemId:null,itemProp:Nr,itemRef:Nr,itemScope:li,itemType:Nr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:li,low:Wt,manifest:null,max:null,maxLength:Wt,media:null,method:null,min:null,minLength:Wt,multiple:li,muted:li,name:null,nonce:null,noModule:li,noValidate:li,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:li,optimum:Wt,pattern:null,ping:Nr,placeholder:null,playsInline:li,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:li,referrerPolicy:null,rel:Nr,required:li,reversed:li,rows:Wt,rowSpan:Wt,sandbox:Nr,scope:null,scoped:li,seamless:li,selected:li,shadowRootClonable:li,shadowRootDelegatesFocus:li,shadowRootMode:null,shape:null,size:Wt,sizes:null,slot:null,span:Wt,spellCheck:Ta,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Wt,step:null,style:null,tabIndex:Wt,target:null,title:null,translate:null,type:null,typeMustMatch:li,useMap:null,value:Ta,width:Wt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nr,axis:null,background:null,bgColor:null,border:Wt,borderColor:null,bottomMargin:Wt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:li,declare:li,event:null,face:null,frame:null,frameBorder:null,hSpace:Wt,leftMargin:Wt,link:null,longDesc:null,lowSrc:null,marginHeight:Wt,marginWidth:Wt,noResize:li,noHref:li,noShade:li,noWrap:li,object:null,profile:null,prompt:null,rev:null,rightMargin:Wt,rules:null,scheme:null,scrolling:Ta,standby:null,summary:null,text:null,topMargin:Wt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Wt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:li,disableRemotePlayback:li,prefix:null,property:null,results:Wt,security:null,unselectable:null},space:"html",transform:UQ}),CRe=ry({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:dl,accentHeight:Wt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Wt,amplitude:Wt,arabicForm:null,ascent:Wt,attributeName:null,attributeType:null,azimuth:Wt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Wt,by:null,calcMode:null,capHeight:Wt,className:Nr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Wt,diffuseConstant:Wt,direction:null,display:null,dur:null,divisor:Wt,dominantBaseline:null,download:li,dx:null,dy:null,edgeMode:null,editable:null,elevation:Wt,enableBackground:null,end:null,event:null,exponent:Wt,externalResourcesRequired:null,fill:null,fillOpacity:Wt,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:A0,g2:A0,glyphName:A0,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Wt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Wt,horizOriginX:Wt,horizOriginY:Wt,id:null,ideographic:Wt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Wt,k:Wt,k1:Wt,k2:Wt,k3:Wt,k4:Wt,kernelMatrix:dl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Wt,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Wt,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Wt,overlineThickness:Wt,paintOrder:null,panose1:null,path:null,pathLength:Wt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Wt,pointsAtY:Wt,pointsAtZ:Wt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dl,rev:dl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dl,requiredFeatures:dl,requiredFonts:dl,requiredFormats:dl,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Wt,specularExponent:Wt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Wt,strikethroughThickness:Wt,string:null,stroke:null,strokeDashArray:dl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Wt,strokeOpacity:Wt,strokeWidth:null,style:null,surfaceScale:Wt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dl,tabIndex:Wt,tableValues:null,target:null,targetX:Wt,targetY:Wt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Wt,underlineThickness:Wt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Wt,values:null,vAlphabetic:Wt,vMathematical:Wt,vectorEffect:null,vHanging:Wt,vIdeographic:Wt,version:null,vertAdvY:Wt,vertOriginX:Wt,vertOriginY:Wt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Wt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:PQ}),FQ=ry({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),BQ=ry({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:UQ}),zQ=ry({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),RRe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},kRe=/[A-Z]/g,cH=/-[a-z]/g,DRe=/^data[-\w.:]+$/i;function ORe(t,e){const n=kI(e);let i=e,r=Ko;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&DRe.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(cH,NRe);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!cH.test(a)){let s=a.replace(kRe,IRe);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}r=YU}return new r(i,e)}function IRe(t){return"-"+t.toLowerCase()}function NRe(t){return t.charAt(1).toUpperCase()}const LRe=NQ([LQ,ARe,FQ,BQ,zQ],"html"),JU=NQ([LQ,CRe,FQ,BQ,zQ],"svg");function PRe(t){return t.join(" ").trim()}var $U={},uH=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,URe=/\n/g,FRe=/^\s*/,BRe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,zRe=/^:\s*/,jRe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,HRe=/^[;\s]*/,VRe=/^\s+|\s+$/g,GRe=`
`,fH="/",hH="*",sm="",WRe="comment",XRe="declaration",qRe=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,i=1;function r(g){var b=g.match(URe);b&&(n+=b.length);var y=g.lastIndexOf(GRe);i=~y?g.length-y:i+g.length}function a(){var g={line:n,column:i};return function(b){return b.position=new s(g),c(),b}}function s(g){this.start=g,this.end={line:n,column:i},this.source=e.source}s.prototype.content=t;function o(g){var b=new Error(e.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=e.source,b.line=n,b.column=i,b.source=t,!e.silent)throw b}function l(g){var b=g.exec(t);if(b){var y=b[0];return r(y),t=t.slice(y.length),b}}function c(){l(FRe)}function u(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=a();if(!(fH!=t.charAt(0)||hH!=t.charAt(1))){for(var b=2;sm!=t.charAt(b)&&(hH!=t.charAt(b)||fH!=t.charAt(b+1));)++b;if(b+=2,sm===t.charAt(b-1))return o("End of comment missing");var y=t.slice(2,b-2);return i+=2,r(y),t=t.slice(b),i+=2,g({type:WRe,comment:y})}}function h(){var g=a(),b=l(BRe);if(b){if(f(),!l(zRe))return o("property missing ':'");var y=l(jRe),p=g({type:XRe,property:dH(b[0].replace(uH,sm)),value:y?dH(y[0].replace(uH,sm)):sm});return l(HRe),p}}function d(){var g=[];u(g);for(var b;b=h();)b!==!1&&(g.push(b),u(g));return g}return c(),d()};function dH(t){return t?t.replace(VRe,sm):sm}var KRe=zm&&zm.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($U,"__esModule",{value:!0});$U.default=JRe;var YRe=KRe(qRe);function JRe(t,e){var n=null;if(!t||typeof t!="string")return n;var i=(0,YRe.default)(t),r=typeof e=="function";return i.forEach(function(a){if(a.type==="declaration"){var s=a.property,o=a.value;r?e(s,o,a):o&&(n=n||{},n[s]=o)}}),n}var RC={};Object.defineProperty(RC,"__esModule",{value:!0});RC.camelCase=void 0;var $Re=/^--[a-zA-Z0-9_-]+$/,ZRe=/-([a-z])/g,QRe=/^[^-]+$/,e3e=/^-(webkit|moz|ms|o|khtml)-/,t3e=/^-(ms)-/,n3e=function(t){return!t||QRe.test(t)||$Re.test(t)},i3e=function(t,e){return e.toUpperCase()},pH=function(t,e){return"".concat(e,"-")},r3e=function(t,e){return e===void 0&&(e={}),n3e(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(t3e,pH):t=t.replace(e3e,pH),t.replace(ZRe,i3e))};RC.camelCase=r3e;var a3e=zm&&zm.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s3e=a3e($U),o3e=RC;function II(t,e){var n={};return!t||typeof t!="string"||(0,s3e.default)(t,function(i,r){i&&r&&(n[(0,o3e.camelCase)(i,e)]=r)}),n}II.default=II;var l3e=II;const c3e=Rc(l3e),NI={}.hasOwnProperty,u3e=/[A-Z]/g,f3e=new Set(["td","th"]);function h3e(t,e){const n=e.schema;let i=n;const r=t.properties||{};n.space==="html"&&t.tagName.toLowerCase()==="svg"&&(i=JU,e.schema=i);const a=e.all(t),s=[];let o,l,c;for(o in r)if(NI.call(r,o)){let f=r[o];const h=ORe(i,o);let d;if(f==null||f===!1||typeof f=="number"&&Number.isNaN(f)||!f&&h.boolean)continue;if(o=e.elementAttributeNameCase==="react"&&h.space?RRe[h.property]||h.property:h.attribute,Array.isArray(f)&&(f=h.commaSeparated?MRe(f):PRe(f)),o==="style"){let g=typeof f=="object"?f:d3e(String(f),t.tagName);e.stylePropertyNameCase==="css"&&(g=p3e(g));const b=[];let y;for(y in g)NI.call(g,y)&&b.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:of(y)?{type:"Identifier",name:y}:{type:"Literal",value:y},value:{type:"Literal",value:String(g[y])},kind:"init"});c=b,d={type:"JSXExpressionContainer",expression:{type:"ObjectExpression",properties:b}}}else if(f===!0)d=null;else if(e.tableCellAlignToStyle&&f3e.has(t.tagName)&&o==="align"){l=String(f);continue}else d={type:"Literal",value:String(f)};of(o,{jsx:!0})?s.push({type:"JSXAttribute",name:{type:"JSXIdentifier",name:o},value:d}):s.push({type:"JSXSpreadAttribute",argument:{type:"ObjectExpression",properties:[{type:"Property",method:!1,shorthand:!1,computed:!1,key:{type:"Literal",value:String(o)},value:d||{type:"Literal",value:!0},kind:"init"}]}})}if(l!==void 0){c||(c=[],s.push({type:"JSXAttribute",name:{type:"JSXIdentifier",name:"style"},value:{type:"JSXExpressionContainer",expression:{type:"ObjectExpression",properties:c}}}));const f=e.stylePropertyNameCase==="css"?jQ("textAlign"):"textAlign";c.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:of(f)?{type:"Identifier",name:f}:{type:"Literal",value:f},value:{type:"Literal",value:l},kind:"init"})}e.schema=n;const u={type:"JSXElement",openingElement:{type:"JSXOpeningElement",attributes:s,name:e.createJsxElementName(t.tagName),selfClosing:a.length===0},closingElement:a.length>0?{type:"JSXClosingElement",name:e.createJsxElementName(t.tagName)}:null,children:a};return e.inherit(t,u),u}function d3e(t,e){try{return c3e(t,{reactCompat:!0})}catch(n){const i=n;throw new Error("Could not parse `style` attribute on `"+e+"`",{cause:i})}}function p3e(t){const e={};let n;for(n in t)NI.call(t,n)&&(e[jQ(n)]=t[n]);return e}function jQ(t){let e=t.replace(u3e,m3e);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function m3e(t){return"-"+t.toLowerCase()}const g3e={}.hasOwnProperty,b3e=[];function dT(t,e){const n=e?[...e].sort(ZU):b3e;n.length>0&&HQ(t,{comments:n,index:0})}function HQ(t,e){if(e.index===e.comments.length)return;const n=[],i=[];let r;for(r in t)if(g3e.call(t,r)){const s=t[r];if(s&&typeof s=="object"&&r!=="comments")if(Array.isArray(s)){let o=-1;for(;++o<s.length;)s[o]&&typeof s[o].type=="string"&&n.push(s[o])}else typeof s.type=="string"&&n.push(s)}n.sort(ZU),i.push(...mH(e,t,!1,{leading:!0,trailing:!1}));let a=-1;for(;++a<n.length;)HQ(n[a],e);i.push(...mH(e,t,!0,{leading:!1,trailing:n.length>0})),i.length>0&&(t.comments=i)}function mH(t,e,n,i){const r=[];for(;t.comments[t.index]&&ZU(t.comments[t.index],e,n)<1;)r.push(Object.assign({},t.comments[t.index++],i));return r}function ZU(t,e,n){const i=n?"end":"start";return t.range&&e.range?t.range[0]-e.range[n?1:0]:t.loc&&t.loc.start&&e.loc&&e.loc[i]?t.loc.start.line-e.loc[i].line||t.loc.start.column-e.loc[i].column:"start"in t&&i in e?t.start-e[i]:Number.NaN}function gH(t,e){const n=t.data&&t.data.estree,i=n&&n.comments||[];let r;n&&(e.comments.push(...i),dT(n,n.comments),r=n.body[0]&&n.body[0].type==="ExpressionStatement"&&n.body[0].expression||void 0),r||(r={type:"JSXEmptyExpression"},e.patch(t,r));const a={type:"JSXExpressionContainer",expression:r};return e.inherit(t,a),a}function bH(t,e){const n=e.schema;let i=n;const r=t.attributes||[];let a=-1;t.name&&n.space==="html"&&t.name.toLowerCase()==="svg"&&(i=JU,e.schema=i);const s=e.all(t),o=[];for(;++a<r.length;){const c=r[a],u=c.value;let f;if(c.type==="mdxJsxAttribute"){if(u==null)f=null;else if(typeof u=="object"){const d=u.data&&u.data.estree,g=d&&d.comments||[];let b;d&&(e.comments.push(...g),dT(d,d.comments),b=d.body[0]&&d.body[0].type==="ExpressionStatement"&&d.body[0].expression||void 0),f={type:"JSXExpressionContainer",expression:b||{type:"JSXEmptyExpression"}},e.inherit(u,f)}else f={type:"Literal",value:String(u)};const h={type:"JSXAttribute",name:e.createJsxAttributeName(c.name),value:f};e.inherit(c,h),o.push(h)}else{const h=c.data&&c.data.estree,d=h&&h.comments||[];let g;h&&(e.comments.push(...d),dT(h,h.comments),g=h.body[0]&&h.body[0].type==="ExpressionStatement"&&h.body[0].expression&&h.body[0].expression.type==="ObjectExpression"&&h.body[0].expression.properties&&h.body[0].expression.properties[0]&&h.body[0].expression.properties[0].type==="SpreadElement"&&h.body[0].expression.properties[0].argument||void 0);const b={type:"JSXSpreadAttribute",argument:g||{type:"ObjectExpression",properties:[]}};e.inherit(c,b),o.push(b)}}e.schema=n;const l=t.name?{type:"JSXElement",openingElement:{type:"JSXOpeningElement",attributes:o,name:e.createJsxElementName(t.name),selfClosing:s.length===0},closingElement:s.length>0?{type:"JSXClosingElement",name:e.createJsxElementName(t.name)}:null,children:s}:{type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:s};return e.inherit(t,l),l}function v3e(t,e){const n=t.data&&t.data.estree,i=n&&n.comments||[];n&&(e.comments.push(...i),dT(n,i),e.esm.push(...n.body))}const y3e=/[ \t\n\f\r]/g;function x3e(t){return typeof t=="object"?t.type==="text"?vH(t.value):!1:vH(t)}function vH(t){return t.replace(y3e,"")===""}function _3e(t,e){const n=e.all(t),i=[];let r=-1,a;for(;++r<n.length;){const o=n[r];o.type==="JSXExpressionContainer"&&o.expression.type==="Literal"&&x3e(String(o.expression.value))?a&&a.push(o):(a&&i.push(...a),i.push(o),a=[])}const s={type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:i};return e.inherit(t,s),s}function S3e(t,e){const n=String(t.value||"");if(n){const i={type:"Literal",value:n};e.inherit(t,i);const r={type:"JSXExpressionContainer",expression:i};return e.patch(t,r),r}}const w3e={comment:ERe,doctype:E3e,element:h3e,mdxFlowExpression:gH,mdxJsxFlowElement:bH,mdxJsxTextElement:bH,mdxTextExpression:gH,mdxjsEsm:v3e,root:_3e,text:S3e};function E3e(){}const VQ=WQ("end"),GQ=WQ("start");function WQ(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function XQ(t){const e=GQ(t),n=VQ(t);if(e&&n)return{start:e,end:n}}const yH={}.hasOwnProperty;function M3e(t,e){const n=e||{};function i(r,...a){let s=i.invalid;const o=i.handlers;if(r&&yH.call(r,t)){const l=String(r[t]);s=yH.call(o,l)?o[l]:i.unknown}if(s)return s.call(this,r,...a)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const T3e={}.hasOwnProperty,A3e=new Set(["table","tbody","thead","tfoot","tr"]);function C3e(t){const e=M3e("type",{invalid:R3e,unknown:k3e,handlers:{...w3e,...t.handlers}});return{elementAttributeNameCase:t.elementAttributeNameCase||"react",schema:t.space==="svg"?JU:LRe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1,comments:[],esm:[],all:D3e,createJsxAttributeName:I3e,createJsxElementName:N3e,handle:n,inherit:O3e,patch:qQ};function n(i){return e(i,this)}}function R3e(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function k3e(t){throw new Error("Cannot handle unknown node `"+t.type+"`")}function D3e(t){const e=t.children||[];let n=-1;const i=[],r=this.schema.space==="html"&&t.type==="element"&&A3e.has(t.tagName.toLowerCase());for(;++n<e.length;){const a=e[n];if(r&&a.type==="text"&&a.value===`
`)continue;const s=this.handle(a);Array.isArray(s)?i.push(...s):s&&i.push(s)}return i}function O3e(t,e){const n=t.data;let i,r;if(qQ(t,e),n){for(r in n)T3e.call(n,r)&&r!=="estree"&&(i||(i={}),i[r]=n[r]);i&&(e.data=i)}}function qQ(t,e){const n=XQ(t);n&&n.start.offset!==void 0&&n.end.offset!==void 0&&(e.start=n.start.offset,e.end=n.end.offset,e.loc={start:{line:n.start.line,column:n.start.column-1},end:{line:n.end.line,column:n.end.column-1}},e.range=[n.start.offset,n.end.offset])}function I3e(t){const e=KQ(t);if(e.type==="JSXMemberExpression")throw new Error("Member expressions in attribute names are not supported");return e}function N3e(t){return KQ(t)}function KQ(t){if(t.includes(".")){const e=t.split(".");let n=e.shift(),i={type:"JSXIdentifier",name:n};for(;n=e.shift();)i={type:"JSXMemberExpression",object:i,property:{type:"JSXIdentifier",name:n}};return i}if(t.includes(":")){const e=t.split(":");return{type:"JSXNamespacedName",namespace:{type:"JSXIdentifier",name:e[0]},name:{type:"JSXIdentifier",name:e[1]}}}return{type:"JSXIdentifier",name:t}}function L3e(t,e){const n=C3e(e||{});let i=n.handle(t);const r=n.esm;if(i){i.type!=="JSXFragment"&&i.type!=="JSXElement"&&(i={type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:[i]},n.patch(t,i));const s={type:"ExpressionStatement",expression:i};n.patch(t,s),r.push(s)}const a={type:"Program",body:r,sourceType:"module",comments:n.comments};return n.patch(t,a),a}function P3e(t){return function(e){return L3e(e,t)}}function U3e(){return{enter:{mdxFlowExpression:B3e,mdxTextExpression:z3e},exit:{mdxFlowExpression:xH,mdxFlowExpressionChunk:_H,mdxTextExpression:xH,mdxTextExpressionChunk:_H}}}function F3e(){return{handlers:{mdxFlowExpression:SH,mdxTextExpression:SH},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]}}function B3e(t){this.enter({type:"mdxFlowExpression",value:""},t),this.buffer()}function z3e(t){this.enter({type:"mdxTextExpression",value:""},t),this.buffer()}function xH(t){const e=this.resume(),n=t.estree,i=this.stack[this.stack.length-1];i.type==="mdxFlowExpression"||i.type,this.exit(t),i.value=e,n&&(i.data={estree:n})}function _H(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function SH(t,e,n){const i=t.value||"";return"{"+n.indentLines(i,function(a,s,o){return(s===0||o?"":"  ")+a})+"}"}function pT(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}const j3e=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],wH={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function YQ(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=48&&e<=57}function H3e(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function V3e(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=122||e>=65&&e<=90}function EH(t){return V3e(t)||YQ(t)}const MH=document.createElement("i");function t_(t){const e="&"+t+";";MH.innerHTML=e;const n=MH.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}const G3e=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function W3e(t,e){const n=e||{},i=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,r=[];let a=0,s=-1,o="",l,c;n.position&&("start"in n.position||"indent"in n.position?(c=n.position.indent,l=n.position.start):l=n.position);let u=(l?l.line:0)||1,f=(l?l.column:0)||1,h=g(),d;for(a--;++a<=t.length;)if(d===10&&(f=(c?c[s]:0)||1),d=t.charCodeAt(a),d===38){const p=t.charCodeAt(a+1);if(p===9||p===10||p===12||p===32||p===38||p===60||Number.isNaN(p)||i&&p===i){o+=String.fromCharCode(d),f++;continue}const x=a+1;let _=x,w=x,M;if(p===35){w=++_;const j=t.charCodeAt(w);j===88||j===120?(M="hexadecimal",w=++_):M="decimal"}else M="named";let S="",A="",C="";const k=M==="named"?EH:M==="decimal"?YQ:H3e;for(w--;++w<=t.length;){const j=t.charCodeAt(w);if(!k(j))break;C+=String.fromCharCode(j),M==="named"&&j3e.includes(C)&&(S=C,A=t_(C))}let R=t.charCodeAt(w)===59;if(R){w++;const j=M==="named"?t_(C):!1;j&&(S=C,A=j)}let N=1+w-x,P="";if(!(!R&&n.nonTerminated===!1))if(!C)M!=="named"&&b(4,N);else if(M==="named"){if(R&&!A)b(5,1);else if(S!==C&&(w=_+S.length,N=1+w-_,R=!1),!R){const j=S?1:3;if(n.attribute){const z=t.charCodeAt(w);z===61?(b(j,N),A=""):EH(z)?A="":b(j,N)}else b(j,N)}P=A}else{R||b(2,N);let j=Number.parseInt(C,M==="hexadecimal"?16:10);if(X3e(j))b(7,N),P="�";else if(j in wH)b(6,N),P=wH[j];else{let z="";q3e(j)&&b(6,N),j>65535&&(j-=65536,z+=String.fromCharCode(j>>>10|55296),j=56320|j&1023),P=z+String.fromCharCode(j)}}if(P){y(),h=g(),a=w-1,f+=w-x+1,r.push(P);const j=g();j.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,P,{start:h,end:j},t.slice(x-1,w)),h=j}else C=t.slice(x-1,w),o+=C,f+=C.length,a=w-1}else d===10&&(u++,s++,f=0),Number.isNaN(d)?y():(o+=String.fromCharCode(d),f++);return r.join("");function g(){return{line:u,column:f,offset:a+((l?l.offset:0)||0)}}function b(p,x){let _;n.warning&&(_=g(),_.column+=x,_.offset+=x,n.warning.call(n.warningContext||void 0,G3e[p],_,p))}function y(){o&&(r.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:h,end:g()}),o="")}}function X3e(t){return t>=55296&&t<=57343||t>1114111}function q3e(t){return t>=1&&t<=8||t===11||t>=13&&t<=31||t>=127&&t<=159||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534}const K3e=/["&'<>`]/g,Y3e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,J3e=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,$3e=/[|\\{}()[\]^$+*?.]/g,TH=new WeakMap;function Z3e(t,e){if(t=t.replace(e.subset?Q3e(e.subset):K3e,i),e.subset||e.escapeOnly)return t;return t.replace(Y3e,n).replace(J3e,i);function n(r,a,s){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),e)}function i(r,a,s){return e.format(r.charCodeAt(0),s.charCodeAt(a+1),e)}}function Q3e(t){let e=TH.get(t);return e||(e=eke(t),TH.set(t,e)),e}function eke(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace($3e,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function tke(t){return"&#x"+t.toString(16).toUpperCase()+";"}function nke(t,e){return Z3e(t,Object.assign({format:tke},e))}const JQ="  ";function ike(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:i,mdxJsxFlowTagClosingMarker:r,mdxJsxFlowTagAttribute:f,mdxJsxFlowTagExpressionAttribute:h,mdxJsxFlowTagAttributeValueLiteral:t,mdxJsxFlowTagAttributeValueExpression:t,mdxJsxFlowTagSelfClosingMarker:s,mdxJsxTextTag:i,mdxJsxTextTagClosingMarker:r,mdxJsxTextTagAttribute:f,mdxJsxTextTagExpressionAttribute:h,mdxJsxTextTagAttributeValueLiteral:t,mdxJsxTextTagAttributeValueExpression:t,mdxJsxTextTagSelfClosingMarker:s},exit:{mdxJsxFlowTagClosingMarker:o,mdxJsxFlowTagNamePrimary:l,mdxJsxFlowTagNameMember:c,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:d,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:g,mdxJsxFlowTagAttributeNameLocal:b,mdxJsxFlowTagAttributeValueLiteral:y,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:p,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:x,mdxJsxFlowTag:_,mdxJsxTextTagClosingMarker:o,mdxJsxTextTagNamePrimary:l,mdxJsxTextTagNameMember:c,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:d,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:g,mdxJsxTextTagAttributeNameLocal:b,mdxJsxTextTagAttributeValueLiteral:y,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:p,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:x,mdxJsxTextTag:_}};function t(){this.buffer()}function e(A){return{line:A.line,column:A.column,offset:A.offset}}function n(A){this.config.enter.data.call(this,A),this.config.exit.data.call(this,A)}function i(A){const C={name:void 0,attributes:[],close:!1,selfClosing:!1,start:A.start,end:A.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=C,this.buffer()}function r(A){if(this.data.mdxJsxTagStack.length===0)throw new tr("Unexpected closing slash `/` in tag, expected an open tag first",{start:A.start,end:A.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function a(A){if(this.data.mdxJsxTag.close)throw new tr("Unexpected attribute in closing tag, expected the end of the tag",{start:A.start,end:A.end},"mdast-util-mdx-jsx:unexpected-attribute")}function s(A){if(this.data.mdxJsxTag.close)throw new tr("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:A.start,end:A.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function o(){const A=this.data.mdxJsxTag;A.close=!0}function l(A){const C=this.data.mdxJsxTag;C.name=this.sliceSerialize(A)}function c(A){const C=this.data.mdxJsxTag;C.name+="."+this.sliceSerialize(A)}function u(A){const C=this.data.mdxJsxTag;C.name+=":"+this.sliceSerialize(A)}function f(A){const C=this.data.mdxJsxTag;a.call(this,A),C.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:e(A.start),end:void 0}})}function h(A){const C=this.data.mdxJsxTag;a.call(this,A),C.attributes.push({type:"mdxJsxExpressionAttribute",value:"",position:{start:e(A.start),end:void 0}}),this.buffer()}function d(A){const C=this.data.mdxJsxTag,k=C.attributes[C.attributes.length-1];k.type;const R=A.estree;k.value=this.resume(),k.position,k.position.end=e(A.end),R&&(k.data={estree:R})}function g(A){const C=this.data.mdxJsxTag,k=C.attributes[C.attributes.length-1];k.type,k.name=this.sliceSerialize(A),k.position,k.position.end=e(A.end)}function b(A){const C=this.data.mdxJsxTag,k=C.attributes[C.attributes.length-1];k.type,k.name+=":"+this.sliceSerialize(A),k.position,k.position.end=e(A.end)}function y(A){const C=this.data.mdxJsxTag,k=C.attributes[C.attributes.length-1];k.value=W3e(this.resume(),{nonTerminated:!1}),k.position,k.position.end=e(A.end)}function p(A){const C=this.data.mdxJsxTag,k=C.attributes[C.attributes.length-1];k.type;const R={type:"mdxJsxAttributeValueExpression",value:this.resume()},N=A.estree;N&&(R.data={estree:N}),k.value=R,k.position,k.position.end=e(A.end)}function x(){const A=this.data.mdxJsxTag;A.selfClosing=!0}function _(A){const C=this.data.mdxJsxTag,k=this.data.mdxJsxTagStack,R=k[k.length-1];if(C.close&&R.name!==C.name)throw new tr("Unexpected closing tag `"+S(C)+"`, expected corresponding closing tag for `"+S(R)+"` ("+xc(R)+")",{start:A.start,end:A.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),C.close?k.pop():this.enter({type:A.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:C.name||null,attributes:C.attributes,children:[]},A,w),C.selfClosing||C.close?this.exit(A,M):k.push(C)}function w(A,C){const k=this.data.mdxJsxTagStack,R=k[k.length-1],N=A?" before the end of `"+A.type+"`":"",P=A?{start:A.start,end:A.end}:void 0;throw new tr("Expected a closing tag for `"+S(R)+"` ("+xc({start:C.start,end:C.end})+")"+N,P,"mdast-util-mdx-jsx:end-tag-mismatch")}function M(A,C){const k=this.data.mdxJsxTag;throw new tr("Expected the closing tag `"+S(k)+"` either after the end of `"+C.type+"` ("+xc(C.end)+") or another opening tag after the start of `"+C.type+"` ("+xc(C.start)+")",{start:A.start,end:A.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function S(A){return"<"+(A.close?"/":"")+(A.name||"")+">"}}function rke(t){const e=t||{},n=e.quote||'"',i=e.quoteSmart||!1,r=e.tightSelfClosing||!1,a=e.printWidth||Number.POSITIVE_INFINITY,s=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return o.peek=ske,{handlers:{mdxJsxFlowElement:o,mdxJsxTextElement:o},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function o(l,c,u,f){const h=l.type==="mdxJsxFlowElement",d=l.name?!l.children||l.children.length===0:!1,g=$Q(u),b=ZQ(g),y=u.createTracker(f),p=u.createTracker(f),x=[],_=(h?b:"")+"<"+(l.name||""),w=u.enter(l.type);if(y.move(_),p.move(_),l.attributes&&l.attributes.length>0){if(!l.name)throw new Error("Cannot serialize fragment w/ attributes");let k=-1;for(;++k<l.attributes.length;){const R=l.attributes[k];let N;if(R.type==="mdxJsxExpressionAttribute")N="{"+(R.value||"")+"}";else{if(!R.name)throw new Error("Cannot serialize attribute w/o name");const P=R.value,j=R.name;let z="";if(P!=null)if(typeof P=="object")z="{"+(P.value||"")+"}";else{const X=i&&pT(P,n)>pT(P,s)?s:n;z=X+nke(P,{subset:[X]})+X}N=j+(z?"=":"")+z}x.push(N)}}let M=!1;const S=x.join(" ");h&&(/\r?\n|\r/.test(S)||y.current().now.column+S.length+(d?r?2:3:1)>a)&&(M=!0);let A=y,C=_;if(M){A=p;let k=-1;for(;++k<x.length;)x[k]=b+JQ+x[k];C+=A.move(`
`+x.join(`
`)+`
`+b)}else S&&(C+=A.move(" "+S));return d&&(C+=A.move((r||M?"":" ")+"/")),C+=A.move(">"),l.children&&l.children.length>0&&(l.type==="mdxJsxTextElement"?C+=A.move(u.containerPhrasing(l,{...A.current(),before:">",after:"<"})):(A.shift(2),C+=A.move(`
`),C+=A.move(ake(l,u,A.current())),C+=A.move(`
`))),d||(C+=A.move((h?b:"")+"</"+(l.name||"")+">")),w(),C}}function ake(t,e,n){const i=e.indexStack,r=t.children,a=e.createTracker(n),s=ZQ($Q(e)),o=[];let l=-1;for(i.push(-1);++l<r.length;){const c=r[l];i[i.length-1]=l;const u={before:`
`,after:`
`,...a.current()},f=e.handle(c,t,e,u),h=c.type==="mdxJsxFlowElement"?f:e.indentLines(f,function(d,g,b){return(b?"":s)+d});o.push(a.move(h)),c.type!=="list"&&(e.bulletLastUsed=void 0),l<r.length-1&&o.push(a.move(`

`))}return i.pop(),o.join("")}function $Q(t){let e=0,n=t.stack.length;for(;--n>-1;){const i=t.stack[n];if(i==="blockquote"||i==="listItem")break;i==="mdxJsxFlowElement"&&e++}return e}function ZQ(t){return JQ.repeat(t)}function ske(){return"<"}function oke(){return{enter:{mdxjsEsm:cke},exit:{mdxjsEsm:uke,mdxjsEsmData:fke}}}function lke(){return{handlers:{mdxjsEsm:hke}}}function cke(t){this.enter({type:"mdxjsEsm",value:""},t),this.buffer()}function uke(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(t);const i=t.estree;n.value=e,i&&(n.data={estree:i})}function fke(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function hke(t){return t.value||""}function dke(){return[U3e(),ike(),oke()]}function pke(t){return{extensions:[F3e(),rke(t),lke()]}}var mke=RI();const to=ap(/[A-Za-z]/),ro=ap(/[\dA-Za-z]/),gke=ap(/[#-'*+\--9=?A-Z^-~]/);function mT(t){return t!==null&&(t<32||t===127)}const LI=ap(/\d/),bke=ap(/[\dA-Fa-f]/),vke=ap(/[!-/:-@[-`{-~]/);function bn(t){return t!==null&&t<-2}function zi(t){return t!==null&&(t<0||t===32)}function ii(t){return t===-2||t===-1||t===32}const kC=ap(new RegExp("\\p{P}|\\p{S}","u")),xo=ap(/\s/);function ap(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Oi(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return ii(l)?(t.enter(n),o(l)):e(l)}function o(l){return ii(l)&&a++<r?(t.consume(l),o):(t.exit(n),e(l))}}const yke={}.hasOwnProperty,xke=Symbol("continue"),jD=Symbol("exit"),_ke=Symbol("skip");function Ske(t,e){let n,i;typeof e=="function"?n=e:e&&typeof e=="object"&&(e.enter&&(n=e.enter),e.leave&&(i=e.leave)),r(t,void 0,void 0,[])();function r(a,s,o,l){return HD(a)&&(c.displayName="node ("+a.type+")"),c;function c(){const u=n?AH(n(a,s,o,l)):[];if(u[0]===jD)return u;if(u[0]!==_ke){let f;for(f in a)if(yke.call(a,f)&&a[f]&&typeof a[f]=="object"&&f!=="data"&&f!=="position"){const h=l.concat(a),d=a[f];if(Array.isArray(d)){const g=d;let b=0;for(;b>-1&&b<g.length;){const y=g[b];if(HD(y)){const p=r(y,f,b,h)();if(p[0]===jD)return p;b=typeof p[1]=="number"?p[1]:b+1}else b++}}else if(HD(d)){const g=r(d,f,void 0,h)();if(g[0]===jD)return g}}}return i?AH(i(a,s,o,l)):u}}}function AH(t){return Array.isArray(t)?t:typeof t=="number"?[xke,t]:[t]}function HD(t){return!!(t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.length>0)}function QQ(t,e){const n=e.prefix||"",i=e.suffix||"",r=Object.assign({},e.acornOptions),a=[],s=[],o=r.onComment,l=r.onToken;let c=!1,u,f;const h=Object.assign({},r,{onComment:a,preserveParens:!0});l&&(h.onToken=s);const d=wke(t,e.tokenTypes),g=d.value,b=n+g+i,y=e.expression&&CH(g);if(y&&!e.allowEmpty)throw new tr("Unexpected empty expression",{place:x(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{u=e.expression&&!y?e.acorn.parseExpressionAt(b,0,h):e.acorn.parse(b,h)}catch(_){const w=_,M=x(w.pos);w.message=String(w.message).replace(/ \(\d+:\d+\)$/,""),w.pos=M.offset,w.loc={line:M.line,column:M.column-1},f=w,c=w.raisedAt>=n.length+g.length||w.message==="Unterminated comment"}if(u&&e.expression&&!y)if(CH(b.slice(u.end,b.length-i.length)))u={type:"Program",start:0,end:n.length+g.length,body:[{type:"ExpressionStatement",expression:u,start:0,end:n.length+g.length}],sourceType:"module",comments:[]};else{const _=x(u.end),w=new Error("Unexpected content after expression");w.pos=_.offset,w.loc={line:_.line,column:_.column-1},f=w,u=void 0}if(u){if(u.comments=a,Ske(u,function(_,w,M,S){let A=S[S.length-1],C=w;_.type==="ParenthesizedExpression"&&A&&C&&(typeof M=="number"&&(A=A[C],C=M),A[C]=_.expression),p(_)}),Array.isArray(o))o.push(...a);else if(typeof o=="function")for(const _ of a)o(_.type==="Block",_.value,_.start,_.end,_.loc.start,_.loc.end);for(const _ of s)_.end<=n.length||_.start-n.length>=g.length||(p(_),Array.isArray(l)?l.push(_):l(_))}return{estree:u,error:f,swallow:c};function p(_){const w=x(_.start),M=x(_.end);_.start=w.offset,_.end=M.offset,_.loc={start:{line:w.line,column:w.column-1,offset:w.offset},end:{line:M.line,column:M.column-1,offset:M.offset}},_.range=[_.start,_.end]}function x(_){let w=_-n.length;w<0?w=0:w>g.length&&(w=g.length);let M=Eke(d.stops,w);return M||(M={line:e.start.line,column:e.start.column,offset:e.start.offset}),M}}function CH(t){return/^\s*$/.test(t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function wke(t,e){const n={value:"",stops:[]};let i=-1;for(;++i<t.length;){const r=t[i];if(r[0]==="enter"){const a=r[1].type;if(a==="lineEnding"||e.includes(a)){const s=r[2].sliceStream(r[1]);for(;s.length>0&&s[0]===-1;)s.shift();const o=Mke(s);n.stops.push([n.value.length,r[1].start]),n.value+=o,n.stops.push([n.value.length,r[1].end])}}}return n}function Eke(t,e){let n=0;for(;n<t.length&&t[n][0]<=e;)n+=1;if(n===0)return;const[i,r]=t[n-1],a=e-i;return{line:r.line,column:r.column+a,offset:r.offset+a}}function Mke(t){let e=-1;const n=[];let i;for(;++e<t.length;){const r=t[e];let a;if(typeof r=="string")a=r;else switch(r){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a="	";break}case-1:{if(i)continue;a=" ";break}default:a=String.fromCharCode(r)}i=r===-2,n.push(a)}return n.join("")}function th(t){const e=t||{},n=e.loc||{},i=e.range||[void 0,void 0],r=RH(n.start,i[0]||e.start),a=RH(n.end,i[1]||e.end);if(r&&a)return{start:r,end:a}}function RH(t,e){if(t&&typeof t=="object"){const n="line"in t?VD(t.line):void 0,i="column"in t?VD(t.column):void 0;if(n&&i!==void 0)return{line:n,column:i+1,offset:VD(e)}}}function VD(t){return typeof t=="number"&&t>-1?t:void 0}const Tke=2,o0="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",Ake="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",Cke="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",kH="#unexpected-type-in-code-expected-an-object-spread-spread",Rke="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",kke="#could-not-parse-expression-with-acorn";function gT(t,e,n,i,r,a,s,o,l,c,u){const f=this,h=this.events.length+3;let d=0,g,b;return y;function y(w){return t.enter(n),t.enter(i),t.consume(w),t.exit(i),g=f.now(),p}function p(w){if(w===null){if(b)throw b;const M=new tr("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:f.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw M.url=o0+Ake,M}if(bn(w))return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),_;if(w===125&&d===0){const M=a?Dke.call(f,a,s,r,h,g,c||!1,l||!1):{type:"ok",estree:void 0};if(M.type==="ok"){t.enter(i),t.consume(w),t.exit(i);const S=t.exit(n);return o&&M.estree&&Object.assign(S,{estree:M.estree}),e}return b=M.message,t.enter(r),t.consume(w),x}return t.enter(r),x(w)}function x(w){return w===125&&d===0||w===null||bn(w)?(t.exit(r),p(w)):(w===123&&!a?d+=1:w===125&&(d-=1),t.consume(w),x)}function _(w){const M=f.now();if(M.line!==g.line&&!u&&f.parser.lazy[M.line]){const S=new tr("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:f.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw S.url=o0+Cke,S}return ii(w)?Oi(t,p,"linePrefix",Tke+1)(w):p(w)}}function Dke(t,e,n,i,r,a,s){const o=QQ(this.events.slice(i),{acorn:t,tokenTypes:[n],acornOptions:e,start:r,expression:!0,allowEmpty:a,prefix:s?"({":"",suffix:s?"})":""}),l=o.estree;if(s&&l){const c=l.body[0];if(c.type!=="ExpressionStatement"||c.expression.type!=="ObjectExpression"){const u=th(c),f=new tr("Unexpected `"+c.type+"` in code: expected an object spread (`{...spread}`)",{place:u.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=o0+kH,f}if(c.expression.properties[1]){const u=th(c.expression.properties[1]),f=new tr("Unexpected extra content in spread: only a single spread is supported",{place:u.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw f.url=o0+Rke,f}if(c.expression.properties[0]&&c.expression.properties[0].type!=="SpreadElement"){const u=th(c.expression.properties[0]),f=new tr("Unexpected `"+c.expression.properties[0].type+"` in code: only spread elements are supported",{place:u.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=o0+kH,f}}if(o.error){const c=new tr("Could not parse expression with acorn",{cause:o.error,place:{line:o.error.loc.line,column:o.error.loc.column+1,offset:o.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return c.url=o0+kke,{type:"nok",message:c}}return{type:"ok",estree:l}}function Oke(t){const e=t||{},n=e.addResult,i=e.acorn,r=e.spread;let a=e.allowEmpty,s;if(a==null&&(a=!0),i){if(!i.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");s=Object.assign({ecmaVersion:2024,sourceType:"module"},e.acornOptions)}else if(e.acornOptions||e.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:"mdxFlowExpression",tokenize:o,concrete:!0}},text:{123:{name:"mdxTextExpression",tokenize:l}}};function o(c,u,f){const h=this;return d;function d(p){return g(p)}function g(p){return gT.call(h,c,b,"mdxFlowExpression","mdxFlowExpressionMarker","mdxFlowExpressionChunk",i,s,n,r,a)(p)}function b(p){return ii(p)?Oi(c,y,"whitespace")(p):y(p)}function y(p){const x=h.parser.constructs.flow[60],w=(Array.isArray(x)?x:x?[x]:[]).find(function(M){return M.name==="mdxJsxFlowTag"});return p===60&&w?c.attempt(w,y,f)(p):p===null||bn(p)?u(p):f(p)}}function l(c,u){const f=this;return h;function h(d){return gT.call(f,c,u,"mdxTextExpression","mdxTextExpressionMarker","mdxTextExpressionChunk",i,s,n,r,a,!0)(d)}}}const DH="https://github.com/micromark/micromark-extension-mdx-jsx";function eee(t,e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y,p,x,_,w,M,S,A,C,k,R,N,P,j,z,X){const F=this;let H,V;return W;function W($){return t.enter(o),t.enter(l),t.consume($),t.exit(l),B}function B($){return zi($)?n($):(H=Y,K($))}function Y($){if($===47)return t.enter(c),t.consume($),t.exit(c),H=Z,K;if($===62)return ae($);if($!==null&&$>=0&&Yc($))return t.enter(f),t.enter(h),t.consume($),G;me($,"before name","a character that can start a name, such as a letter, `$`, or `_`"+($===33?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function Z($){if($===62)return ae($);if($!==null&&$>=0&&Yc($))return t.enter(f),t.enter(h),t.consume($),G;me($,"before name","a character that can start a name, such as a letter, `$`, or `_`"+($===42||$===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function G($){if($!==null&&$>=0&&lx($,{jsx:!0}))return t.consume($),G;if($===46||$===47||$===58||$===62||$===123||zi($)||xo($))return t.exit(h),H=de,K($);me($,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+($===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function de($){if($===46)return t.enter(d),t.consume($),t.exit(d),H=oe,K;if($===58)return t.enter(b),t.consume($),t.exit(b),H=Se,K;if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(f),je($);me($,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe($){if($!==null&&$>=0&&Yc($))return t.enter(g),t.consume($),le;me($,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le($){if($!==null&&$>=0&&lx($,{jsx:!0}))return t.consume($),le;if($===46||$===47||$===62||$===123||zi($)||xo($))return t.exit(g),H=ue,K($);me($,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+($===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function ue($){if($===46)return t.enter(d),t.consume($),t.exit(d),H=oe,K;if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(f),je($);me($,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Se($){if($!==null&&$>=0&&Yc($))return t.enter(y),t.consume($),Te;me($,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+($===43||$!==null&&$>46&&$<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function Te($){if($!==null&&$>=0&&lx($,{jsx:!0}))return t.consume($),Te;if($===47||$===62||$===123||zi($)||xo($))return t.exit(y),H=Pe,K($);me($,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Pe($){if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(f),je($);me($,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function je($){if($===47)return t.enter(u),t.consume($),t.exit(u),H=Qe,K;if($===62)return ae($);if($===123)return gT.call(F,t,He,p,x,_,i,r,a,!0,!1,s)($);if($!==null&&$>=0&&Yc($))return t.enter(w),t.enter(M),t.enter(S),t.consume($),pe;me($,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function He($){return H=je,K($)}function pe($){if($!==null&&$>=0&&lx($,{jsx:!0}))return t.consume($),pe;if($===47||$===58||$===61||$===62||$===123||zi($)||xo($))return t.exit(S),H=ze,K($);me($,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ze($){if($===58)return t.enter(A),t.consume($),t.exit(A),H=Ie,K;if($===61)return t.exit(M),t.enter(k),t.consume($),t.exit(k),H=Ae,K;if($===47||$===62||$===123||zi($)||xo($)||$!==null&&$>=0&&Yc($))return t.exit(M),t.exit(w),H=je,K($);me($,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ie($){if($!==null&&$>=0&&Yc($))return t.enter(C),t.consume($),Xe;me($,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Xe($){if($!==null&&$>=0&&lx($,{jsx:!0}))return t.consume($),Xe;if($===47||$===61||$===62||$===123||zi($)||xo($))return t.exit(C),t.exit(M),H=we,K($);me($,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function we($){if($===61)return t.enter(k),t.consume($),t.exit(k),H=Ae,K;if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(w),je($);me($,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ae($){if($===34||$===39)return t.enter(R),t.enter(N),t.consume($),t.exit(N),V=$,Ne;if($===123)return gT.call(F,t,Re,j,z,X,i,r,a,!1,!1,s)($);me($,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+($===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function Re($){return t.exit(w),H=je,K($)}function Ne($){return $===null&&me($,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(V)+"`"),$===V?(t.enter(N),t.consume($),t.exit(N),t.exit(R),t.exit(w),V=void 0,H=je,K):bn($)?(H=Ne,K($)):(t.enter(P),Fe($))}function Fe($){return $===null||$===V||bn($)?(t.exit(P),Ne($)):(t.consume($),Fe)}function Qe($){if($===62)return ae($);me($,"after self-closing slash","`>` to end the tag"+($===42||$===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function ae($){return t.enter(l),t.consume($),t.exit(l),t.exit(o),e}function K($){return bn($)?(t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),he):ii($)||xo($)?(t.enter("esWhitespace"),ce($)):H($)}function ce($){return bn($)?(t.exit("esWhitespace"),K($)):ii($)||xo($)?(t.consume($),ce):(t.exit("esWhitespace"),H($))}function he($){if(!s&&F.parser.lazy[F.now().line]){const Ve=new tr("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",F.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw Ve.url=DH+"#unexpected-lazy-line-in-container-expected-line-to-be",Ve}return K($)}function me($,Ve,qe){const mt=new tr("Unexpected "+($===null?"end of file":"character `"+($===96?"` ` `":String.fromCodePoint($))+"` ("+Ike($)+")")+" "+Ve+", expected "+qe,F.now(),"micromark-extension-mdx-jsx:unexpected-"+($===null?"eof":"character"));throw mt.url=DH+($===null?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),mt}}function Ike(t){return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function Nke(t,e){return{name:"mdxJsxTextTag",tokenize:n};function n(i,r,a){return eee.call(this,i,r,a,t,e.acornOptions,e.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}function Lke(t,e){return{concrete:!0,name:"mdxJsxFlowTag",tokenize:n};function n(i,r,a){const s=this;return o;function o(f){return l(f)}function l(f){return eee.call(s,i,c,a,t,e.acornOptions,e.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(f)}function c(f){return ii(f)?Oi(i,u,"whitespace")(f):u(f)}function u(f){const h=s.parser.constructs.flow[123],d=Array.isArray(h)?h:h?[h]:[];let g;for(const b of d)if(b.name==="mdxFlowExpression"){g=b;break}return f===60?o(f):f===123&&g?i.attempt(g,u,a)(f):f===null||bn(f)?r(f):a(f)}}}function Pke(t){const e=t||{},n=e.acorn;let i;if(n){if(!n.parse||!n.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");i=Object.assign({ecmaVersion:2024,sourceType:"module"},e.acornOptions,{locations:!0})}else if(e.acornOptions||e.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:Lke(n||void 0,{acornOptions:i,addResult:e.addResult||void 0})},text:{60:Nke(n||void 0,{acornOptions:i,addResult:e.addResult||void 0})}}}function Uke(){return{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}}function Tl(t,e,n,i){const r=t.length;let a=0,s;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)s=Array.from(i),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);a<i.length;)s=i.slice(a,a+1e4),s.unshift(e,0),t.splice(...s),a+=1e4,e+=1e4}function uc(t,e){return t.length>0?(Tl(t,t.length,0,e),t):e}function gv(t){if(t===null||zi(t)||xo(t))return 1;if(kC(t))return 2}function DC(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const a=t[r].resolveAll;a&&!i.includes(a)&&(e=a(e,n),i.push(a))}return e}const PI={name:"attention",resolveAll:Fke,tokenize:Bke};function Fke(t,e){let n=-1,i,r,a,s,o,l,c,u;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[i][1].end},h={...t[n][1].start};OH(f,-l),OH(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[i][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},a={type:l>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},t[i][1].end={...s.start},t[n][1].start={...o.end},c=[],t[i][1].end.offset-t[i][1].start.offset&&(c=uc(c,[["enter",t[i][1],e],["exit",t[i][1],e]])),c=uc(c,[["enter",r,e],["enter",s,e],["exit",s,e],["enter",a,e]]),c=uc(c,DC(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),c=uc(c,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=uc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Tl(t,i-1,n-i+3,c),n=i+c.length-u-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Bke(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=gv(i);let a;return s;function s(l){return a=l,t.enter("attentionSequence"),o(l)}function o(l){if(l===a)return t.consume(l),o;const c=t.exit("attentionSequence"),u=gv(l),f=!u||u===2&&r||n.includes(l),h=!r||r===2&&u||n.includes(i);return c._open=!!(a===42?f:f&&(r||!h)),c._close=!!(a===42?h:h&&(u||!f)),e(l)}}function OH(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const zke={name:"autolink",tokenize:jke};function jke(t,e,n){let i=0;return r;function r(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(d){return to(d)?(t.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||ro(d)?(i=1,o(d)):c(d)}function o(d){return d===58?(t.consume(d),i=0,l):(d===43||d===45||d===46||ro(d))&&i++<32?(t.consume(d),o):(i=0,c(d))}function l(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||mT(d)?n(d):(t.consume(d),l)}function c(d){return d===64?(t.consume(d),u):gke(d)?(t.consume(d),c):n(d)}function u(d){return ro(d)?f(d):n(d)}function f(d){return d===46?(t.consume(d),i=0,u):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):h(d)}function h(d){if((d===45||ro(d))&&i++<63){const g=d===45?h:f;return t.consume(d),g}return n(d)}}const ay={partial:!0,tokenize:Hke};function Hke(t,e,n){return i;function i(a){return ii(a)?Oi(t,r,"linePrefix")(a):r(a)}function r(a){return a===null||bn(a)?e(a):n(a)}}const tee={continuation:{tokenize:Gke},exit:Wke,name:"blockQuote",tokenize:Vke};function Vke(t,e,n){const i=this;return r;function r(s){if(s===62){const o=i.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),a}return n(s)}function a(s){return ii(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function Gke(t,e,n){const i=this;return r;function r(s){return ii(s)?Oi(t,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return t.attempt(tee,e,n)(s)}}function Wke(t){t.exit("blockQuote")}const nee={name:"characterEscape",tokenize:Xke};function Xke(t,e,n){return i;function i(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),r}function r(a){return vke(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const iee={name:"characterReference",tokenize:qke};function qke(t,e,n){const i=this;let r=0,a,s;return o;function o(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),a=31,s=ro,u(f))}function c(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,s=bke,u):(t.enter("characterReferenceValue"),a=7,s=LI,u(f))}function u(f){if(f===59&&r){const h=t.exit("characterReferenceValue");return s===ro&&!t_(i.sliceSerialize(h))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&r++<a?(t.consume(f),u):n(f)}}const IH={partial:!0,tokenize:Yke},NH={concrete:!0,name:"codeFenced",tokenize:Kke};function Kke(t,e,n){const i=this,r={partial:!0,tokenize:M};let a=0,s=0,o;return l;function l(S){return c(S)}function c(S){const A=i.events[i.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,o=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===o?(s++,t.consume(S),u):s<3?n(S):(t.exit("codeFencedFenceSequence"),ii(S)?Oi(t,f,"whitespace")(S):f(S))}function f(S){return S===null||bn(S)?(t.exit("codeFencedFence"),i.interrupt?e(S):t.check(IH,b,w)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||bn(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):ii(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Oi(t,d,"whitespace")(S)):S===96&&S===o?n(S):(t.consume(S),h)}function d(S){return S===null||bn(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||bn(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===o?n(S):(t.consume(S),g)}function b(S){return t.attempt(r,w,y)(S)}function y(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),p}function p(S){return a>0&&ii(S)?Oi(t,x,"linePrefix",a+1)(S):x(S)}function x(S){return S===null||bn(S)?t.check(IH,b,w)(S):(t.enter("codeFlowValue"),_(S))}function _(S){return S===null||bn(S)?(t.exit("codeFlowValue"),x(S)):(t.consume(S),_)}function w(S){return t.exit("codeFenced"),e(S)}function M(S,A,C){let k=0;return R;function R(X){return S.enter("lineEnding"),S.consume(X),S.exit("lineEnding"),N}function N(X){return S.enter("codeFencedFence"),ii(X)?Oi(S,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):P(X)}function P(X){return X===o?(S.enter("codeFencedFenceSequence"),j(X)):C(X)}function j(X){return X===o?(k++,S.consume(X),j):k>=s?(S.exit("codeFencedFenceSequence"),ii(X)?Oi(S,z,"whitespace")(X):z(X)):C(X)}function z(X){return X===null||bn(X)?(S.exit("codeFencedFence"),A(X)):C(X)}}}function Yke(t,e,n){const i=this;return r;function r(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return i.parser.lazy[i.now().line]?n(s):e(s)}}const GD={name:"codeIndented",tokenize:$ke},Jke={partial:!0,tokenize:Zke};function $ke(t,e,n){const i=this;return r;function r(c){return t.enter("codeIndented"),Oi(t,a,"linePrefix",5)(c)}function a(c){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):bn(c)?t.attempt(Jke,s,l)(c):(t.enter("codeFlowValue"),o(c))}function o(c){return c===null||bn(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),o)}function l(c){return t.exit("codeIndented"),e(c)}}function Zke(t,e,n){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):bn(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r):Oi(t,a,"linePrefix",5)(s)}function a(s){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):bn(s)?r(s):n(s)}}const Qke={name:"codeText",previous:tDe,resolve:eDe,tokenize:nDe};function eDe(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function tDe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nDe(t,e,n){let i=0,r,a;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),o(f)}function o(f){return f===96?(t.consume(f),i++,o):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(a=t.enter("codeTextSequence"),r=0,u(f)):bn(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||bn(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),c)}function u(f){return f===96?(t.consume(f),r++,u):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(a.type="codeTextData",c(f))}}class iDe{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&cx(this.left,i),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),cx(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),cx(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);cx(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);cx(this.left,n.reverse())}}}function cx(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function ree(t){const e={};let n=-1,i,r,a,s,o,l,c;const u=new iDe(t);for(;++n<u.length;){for(;n in e;)n=e[n];if(i=u.get(n),n&&i[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,rDe(u,n)),n=e[n],c=!0);else if(i[1]._container){for(a=n,r=void 0;a--;)if(s=u.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;r&&(i[1].end={...u.get(r)[1].start},o=u.slice(r,n),o.unshift(i),u.splice(r,n-r+1,o))}}return Tl(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function rDe(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const a=[];let s=n._tokenizer;s||(s=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],c={};let u,f,h=-1,d=n,g=0,b=0;const y=[b];for(;d;){for(;t.get(++r)[1]!==d;);a.push(r),d._tokenizer||(u=i.sliceStream(d),d.next||u.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(b=h+1,y.push(b),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),h=y.length;h--;){const p=o.slice(y[h],y[h+1]),x=a.pop();l.push([x,x+p.length-1]),t.splice(x,2,p)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const aDe={resolve:oDe,tokenize:lDe},sDe={partial:!0,tokenize:cDe};function oDe(t){return ree(t),t}function lDe(t,e){let n;return i;function i(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(o)}function r(o){return o===null?a(o):bn(o)?t.check(sDe,s,a)(o):(t.consume(o),r)}function a(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function s(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function cDe(t,e,n){const i=this;return r;function r(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Oi(t,a,"linePrefix")}function a(s){if(s===null||bn(s))return n(s);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):t.interrupt(i.parser.constructs.flow,n,e)(s)}}function aee(t,e,n,i,r,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(p){return p===60?(t.enter(i),t.enter(r),t.enter(a),t.consume(p),t.exit(a),h):p===null||p===32||p===41||mT(p)?n(p):(t.enter(i),t.enter(s),t.enter(o),t.enter("chunkString",{contentType:"string"}),b(p))}function h(p){return p===62?(t.enter(a),t.consume(p),t.exit(a),t.exit(r),t.exit(i),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===62?(t.exit("chunkString"),t.exit(o),h(p)):p===null||p===60||bn(p)?n(p):(t.consume(p),p===92?g:d)}function g(p){return p===60||p===62||p===92?(t.consume(p),d):d(p)}function b(p){return!u&&(p===null||p===41||zi(p))?(t.exit("chunkString"),t.exit(o),t.exit(s),t.exit(i),e(p)):u<c&&p===40?(t.consume(p),u++,b):p===41?(t.consume(p),u--,b):p===null||p===32||p===40||mT(p)?n(p):(t.consume(p),p===92?y:b)}function y(p){return p===40||p===41||p===92?(t.consume(p),b):b(p)}}function see(t,e,n,i,r,a){const s=this;let o=0,l;return c;function c(d){return t.enter(i),t.enter(r),t.consume(d),t.exit(r),t.enter(a),u}function u(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(a),t.enter(r),t.consume(d),t.exit(r),t.exit(i),e):bn(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||bn(d)||o++>999?(t.exit("chunkString"),u(d)):(t.consume(d),l||(l=!ii(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(t.consume(d),o++,f):f(d)}}function oee(t,e,n,i,r,a){let s;return o;function o(h){return h===34||h===39||h===40?(t.enter(i),t.enter(r),t.consume(h),t.exit(r),s=h===40?41:h,l):n(h)}function l(h){return h===s?(t.enter(r),t.consume(h),t.exit(r),t.exit(i),e):(t.enter(a),c(h))}function c(h){return h===s?(t.exit(a),l(s)):h===null?n(h):bn(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),Oi(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||bn(h)?(t.exit("chunkString"),c(h)):(t.consume(h),h===92?f:u)}function f(h){return h===s||h===92?(t.consume(h),u):u(h)}}function m1(t,e){let n;return i;function i(r){return bn(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):ii(r)?Oi(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}function vu(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const uDe={name:"definition",tokenize:hDe},fDe={partial:!0,tokenize:dDe};function hDe(t,e,n){const i=this;let r;return a;function a(d){return t.enter("definition"),s(d)}function s(d){return see.call(i,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return r=vu(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return zi(d)?m1(t,c)(d):c(d)}function c(d){return aee(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return t.attempt(fDe,f,f)(d)}function f(d){return ii(d)?Oi(t,h,"whitespace")(d):h(d)}function h(d){return d===null||bn(d)?(t.exit("definition"),i.parser.defined.push(r),e(d)):n(d)}}function dDe(t,e,n){return i;function i(o){return zi(o)?m1(t,r)(o):n(o)}function r(o){return oee(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ii(o)?Oi(t,s,"whitespace")(o):s(o)}function s(o){return o===null||bn(o)?e(o):n(o)}}const pDe={name:"hardBreakEscape",tokenize:mDe};function mDe(t,e,n){return i;function i(a){return t.enter("hardBreakEscape"),t.consume(a),r}function r(a){return bn(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const gDe={name:"headingAtx",resolve:bDe,tokenize:vDe};function bDe(t,e){let n=t.length-2,i=3,r,a;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},a={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},Tl(t,i,n-i+1,[["enter",r,e],["enter",a,e],["exit",a,e],["exit",r,e]])),t}function vDe(t,e,n){let i=0;return r;function r(u){return t.enter("atxHeading"),a(u)}function a(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&i++<6?(t.consume(u),s):u===null||zi(u)?(t.exit("atxHeadingSequence"),o(u)):n(u)}function o(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||bn(u)?(t.exit("atxHeading"),e(u)):ii(u)?Oi(t,o,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),o(u))}function c(u){return u===null||u===35||zi(u)?(t.exit("atxHeadingText"),o(u)):(t.consume(u),c)}}const yDe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],LH=["pre","script","style","textarea"],xDe={concrete:!0,name:"htmlFlow",resolveTo:wDe,tokenize:EDe},_De={partial:!0,tokenize:TDe},SDe={partial:!0,tokenize:MDe};function wDe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function EDe(t,e,n){const i=this;let r,a,s,o,l;return c;function c(G){return u(G)}function u(G){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(G),f}function f(G){return G===33?(t.consume(G),h):G===47?(t.consume(G),a=!0,b):G===63?(t.consume(G),r=3,i.interrupt?e:B):to(G)?(t.consume(G),s=String.fromCharCode(G),y):n(G)}function h(G){return G===45?(t.consume(G),r=2,d):G===91?(t.consume(G),r=5,o=0,g):to(G)?(t.consume(G),r=4,i.interrupt?e:B):n(G)}function d(G){return G===45?(t.consume(G),i.interrupt?e:B):n(G)}function g(G){const de="CDATA[";return G===de.charCodeAt(o++)?(t.consume(G),o===de.length?i.interrupt?e:P:g):n(G)}function b(G){return to(G)?(t.consume(G),s=String.fromCharCode(G),y):n(G)}function y(G){if(G===null||G===47||G===62||zi(G)){const de=G===47,oe=s.toLowerCase();return!de&&!a&&LH.includes(oe)?(r=1,i.interrupt?e(G):P(G)):yDe.includes(s.toLowerCase())?(r=6,de?(t.consume(G),p):i.interrupt?e(G):P(G)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(G):a?x(G):_(G))}return G===45||ro(G)?(t.consume(G),s+=String.fromCharCode(G),y):n(G)}function p(G){return G===62?(t.consume(G),i.interrupt?e:P):n(G)}function x(G){return ii(G)?(t.consume(G),x):R(G)}function _(G){return G===47?(t.consume(G),R):G===58||G===95||to(G)?(t.consume(G),w):ii(G)?(t.consume(G),_):R(G)}function w(G){return G===45||G===46||G===58||G===95||ro(G)?(t.consume(G),w):M(G)}function M(G){return G===61?(t.consume(G),S):ii(G)?(t.consume(G),M):_(G)}function S(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(t.consume(G),l=G,A):ii(G)?(t.consume(G),S):C(G)}function A(G){return G===l?(t.consume(G),l=null,k):G===null||bn(G)?n(G):(t.consume(G),A)}function C(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||zi(G)?M(G):(t.consume(G),C)}function k(G){return G===47||G===62||ii(G)?_(G):n(G)}function R(G){return G===62?(t.consume(G),N):n(G)}function N(G){return G===null||bn(G)?P(G):ii(G)?(t.consume(G),N):n(G)}function P(G){return G===45&&r===2?(t.consume(G),F):G===60&&r===1?(t.consume(G),H):G===62&&r===4?(t.consume(G),Y):G===63&&r===3?(t.consume(G),B):G===93&&r===5?(t.consume(G),W):bn(G)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(_De,Z,j)(G)):G===null||bn(G)?(t.exit("htmlFlowData"),j(G)):(t.consume(G),P)}function j(G){return t.check(SDe,z,Z)(G)}function z(G){return t.enter("lineEnding"),t.consume(G),t.exit("lineEnding"),X}function X(G){return G===null||bn(G)?j(G):(t.enter("htmlFlowData"),P(G))}function F(G){return G===45?(t.consume(G),B):P(G)}function H(G){return G===47?(t.consume(G),s="",V):P(G)}function V(G){if(G===62){const de=s.toLowerCase();return LH.includes(de)?(t.consume(G),Y):P(G)}return to(G)&&s.length<8?(t.consume(G),s+=String.fromCharCode(G),V):P(G)}function W(G){return G===93?(t.consume(G),B):P(G)}function B(G){return G===62?(t.consume(G),Y):G===45&&r===2?(t.consume(G),B):P(G)}function Y(G){return G===null||bn(G)?(t.exit("htmlFlowData"),Z(G)):(t.consume(G),Y)}function Z(G){return t.exit("htmlFlow"),e(G)}}function MDe(t,e,n){const i=this;return r;function r(s){return bn(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):n(s)}function a(s){return i.parser.lazy[i.now().line]?n(s):e(s)}}function TDe(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(ay,e,n)}}const ADe={name:"htmlText",tokenize:CDe};function CDe(t,e,n){const i=this;let r,a,s;return o;function o(B){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(B),l}function l(B){return B===33?(t.consume(B),c):B===47?(t.consume(B),M):B===63?(t.consume(B),_):to(B)?(t.consume(B),C):n(B)}function c(B){return B===45?(t.consume(B),u):B===91?(t.consume(B),a=0,g):to(B)?(t.consume(B),x):n(B)}function u(B){return B===45?(t.consume(B),d):n(B)}function f(B){return B===null?n(B):B===45?(t.consume(B),h):bn(B)?(s=f,H(B)):(t.consume(B),f)}function h(B){return B===45?(t.consume(B),d):f(B)}function d(B){return B===62?F(B):B===45?h(B):f(B)}function g(B){const Y="CDATA[";return B===Y.charCodeAt(a++)?(t.consume(B),a===Y.length?b:g):n(B)}function b(B){return B===null?n(B):B===93?(t.consume(B),y):bn(B)?(s=b,H(B)):(t.consume(B),b)}function y(B){return B===93?(t.consume(B),p):b(B)}function p(B){return B===62?F(B):B===93?(t.consume(B),p):b(B)}function x(B){return B===null||B===62?F(B):bn(B)?(s=x,H(B)):(t.consume(B),x)}function _(B){return B===null?n(B):B===63?(t.consume(B),w):bn(B)?(s=_,H(B)):(t.consume(B),_)}function w(B){return B===62?F(B):_(B)}function M(B){return to(B)?(t.consume(B),S):n(B)}function S(B){return B===45||ro(B)?(t.consume(B),S):A(B)}function A(B){return bn(B)?(s=A,H(B)):ii(B)?(t.consume(B),A):F(B)}function C(B){return B===45||ro(B)?(t.consume(B),C):B===47||B===62||zi(B)?k(B):n(B)}function k(B){return B===47?(t.consume(B),F):B===58||B===95||to(B)?(t.consume(B),R):bn(B)?(s=k,H(B)):ii(B)?(t.consume(B),k):F(B)}function R(B){return B===45||B===46||B===58||B===95||ro(B)?(t.consume(B),R):N(B)}function N(B){return B===61?(t.consume(B),P):bn(B)?(s=N,H(B)):ii(B)?(t.consume(B),N):k(B)}function P(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),r=B,j):bn(B)?(s=P,H(B)):ii(B)?(t.consume(B),P):(t.consume(B),z)}function j(B){return B===r?(t.consume(B),r=void 0,X):B===null?n(B):bn(B)?(s=j,H(B)):(t.consume(B),j)}function z(B){return B===null||B===34||B===39||B===60||B===61||B===96?n(B):B===47||B===62||zi(B)?k(B):(t.consume(B),z)}function X(B){return B===47||B===62||zi(B)?k(B):n(B)}function F(B){return B===62?(t.consume(B),t.exit("htmlTextData"),t.exit("htmlText"),e):n(B)}function H(B){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),V}function V(B){return ii(B)?Oi(t,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):W(B)}function W(B){return t.enter("htmlTextData"),s(B)}}const QU={name:"labelEnd",resolveAll:ODe,resolveTo:IDe,tokenize:NDe},RDe={tokenize:LDe},kDe={tokenize:PDe},DDe={tokenize:UDe};function ODe(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&Tl(t,0,t.length,n),t}function IDe(t,e){let n=t.length,i=0,r,a,s,o;for(;n--;)if(r=t[n][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=n);const l={type:t[a][1].type==="labelLink"?"link":"image",start:{...t[a][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[a][1].start},end:{...t[s][1].end}},u={type:"labelText",start:{...t[a+i+2][1].end},end:{...t[s-2][1].start}};return o=[["enter",l,e],["enter",c,e]],o=uc(o,t.slice(a+1,a+i+3)),o=uc(o,[["enter",u,e]]),o=uc(o,DC(e.parser.constructs.insideSpan.null,t.slice(a+i+4,s-3),e)),o=uc(o,[["exit",u,e],t[s-2],t[s-1],["exit",c,e]]),o=uc(o,t.slice(s+1)),o=uc(o,[["exit",l,e]]),Tl(t,a,t.length,o),t}function NDe(t,e,n){const i=this;let r=i.events.length,a,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){a=i.events[r][1];break}return o;function o(h){return a?a._inactive?f(h):(s=i.parser.defined.includes(vu(i.sliceSerialize({start:a.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),l):n(h)}function l(h){return h===40?t.attempt(RDe,u,s?u:f)(h):h===91?t.attempt(kDe,u,s?c:f)(h):s?u(h):f(h)}function c(h){return t.attempt(DDe,u,f)(h)}function u(h){return e(h)}function f(h){return a._balanced=!0,n(h)}}function LDe(t,e,n){return i;function i(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),r}function r(f){return zi(f)?m1(t,a)(f):a(f)}function a(f){return f===41?u(f):aee(t,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return zi(f)?m1(t,l)(f):u(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?oee(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return zi(f)?m1(t,u)(f):u(f)}function u(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function PDe(t,e,n){const i=this;return r;function r(o){return see.call(i,t,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return i.parser.defined.includes(vu(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function s(o){return n(o)}}function UDe(t,e,n){return i;function i(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),r}function r(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):n(a)}}const FDe={name:"labelStartImage",resolveAll:QU.resolveAll,tokenize:BDe};function BDe(t,e,n){const i=this;return r;function r(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),a}function a(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):e(o)}}const zDe={name:"labelStartLink",resolveAll:QU.resolveAll,tokenize:jDe};function jDe(t,e,n){const i=this;return r;function r(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(s):e(s)}}const WD={name:"lineEnding",tokenize:HDe};function HDe(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Oi(t,e,"linePrefix")}}const _M={name:"thematicBreak",tokenize:VDe};function VDe(t,e,n){let i=0,r;return a;function a(c){return t.enter("thematicBreak"),s(c)}function s(c){return r=c,o(c)}function o(c){return c===r?(t.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||bn(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===r?(t.consume(c),i++,l):(t.exit("thematicBreakSequence"),ii(c)?Oi(t,o,"whitespace")(c):o(c))}}const Lo={continuation:{tokenize:qDe},exit:YDe,name:"list",tokenize:XDe},GDe={partial:!0,tokenize:JDe},WDe={partial:!0,tokenize:KDe};function XDe(t,e,n){const i=this,r=i.events[i.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return o;function o(d){const g=i.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||d===i.containerState.marker:LI(d)){if(i.containerState.type||(i.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(_M,n,c)(d):c(d);if(!i.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return LI(d)&&++s<10?(t.consume(d),l):(!i.interrupt||s<2)&&(i.containerState.marker?d===i.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),c(d)):n(d)}function c(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||d,t.check(ay,i.interrupt?n:u,t.attempt(GDe,h,f))}function u(d){return i.containerState.initialBlankLine=!0,a++,h(d)}function f(d){return ii(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return i.containerState.size=a+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function qDe(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(ay,r,a);function r(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Oi(t,e,"listItemIndent",i.containerState.size+1)(o)}function a(o){return i.containerState.furtherBlankLines||!ii(o)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(o)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(WDe,e,s)(o))}function s(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,Oi(t,t.attempt(Lo,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function KDe(t,e,n){const i=this;return Oi(t,r,"listItemIndent",i.containerState.size+1);function r(a){const s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?e(a):n(a)}}function YDe(t){t.exit(this.containerState.type)}function JDe(t,e,n){const i=this;return Oi(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const s=i.events[i.events.length-1];return!ii(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const PH={name:"setextUnderline",resolveTo:$De,tokenize:ZDe};function $De(t,e){let n=t.length,i,r,a;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!a&&t[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",a?(t.splice(r,0,["enter",s,e]),t.splice(a+1,0,["exit",t[i][1],e]),t[i][1].end={...t[a][1].end}):t[i][1]=s,t.push(["exit",s,e]),t}function ZDe(t,e,n){const i=this;let r;return a;function a(c){let u=i.events.length,f;for(;u--;)if(i.events[u][1].type!=="lineEnding"&&i.events[u][1].type!=="linePrefix"&&i.events[u][1].type!=="content"){f=i.events[u][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(t.enter("setextHeadingLine"),r=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===r?(t.consume(c),o):(t.exit("setextHeadingLineSequence"),ii(c)?Oi(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||bn(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const QDe={tokenize:n8e,partial:!0},UH="https://github.com/micromark/micromark-extension-mdxjs-esm",e8e=new Set(["ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ImportDeclaration"]);function t8e(t){const e={tokenize:r,concrete:!0};if(!t||!t.acorn||!t.acorn.parse)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");const n=t.acorn,i=Object.assign({ecmaVersion:2024,sourceType:"module"},t.acornOptions,{locations:!0});return{flow:{101:e,105:e}};function r(a,s,o){const l=this,c=l.parser.definedModuleSpecifiers||(l.parser.definedModuleSpecifiers=[]),u=this.events.length+1;let f="";return l.interrupt?o:h;function h(x){return l.now().column>1?o(x):(a.enter("mdxjsEsm"),a.enter("mdxjsEsmData"),a.consume(x),f+=String.fromCharCode(x),d)}function d(x){return to(x)?(a.consume(x),f+=String.fromCharCode(x),d):(f==="import"||f==="export")&&x===32?(a.consume(x),g):o(x)}function g(x){return x===null||bn(x)?(a.exit("mdxjsEsmData"),b(x)):(a.consume(x),g)}function b(x){return x===null?p(x):bn(x)?a.check(QDe,p,y)(x):(a.enter("mdxjsEsmData"),g(x))}function y(x){return a.enter("lineEnding"),a.consume(x),a.exit("lineEnding"),b}function p(x){const _=QQ(l.events.slice(u),{acorn:n,acornOptions:i,tokenTypes:["mdxjsEsmData"],prefix:c.length>0?"var "+c.join(",")+`
`:""});if(_.error){if(x!==null&&_.swallow)return y(x);const M=new tr("Could not parse import/exports with acorn",{cause:_.error,place:{line:_.error.loc.line,column:_.error.loc.column+1,offset:_.error.pos},ruleId:"acorn",source:"micromark-extension-mdxjs-esm"});throw M.url=UH+"#could-not-parse-importexports-with-acorn",M}c.length>0&&_.estree.body.shift();let w=-1;for(;++w<_.estree.body.length;){const M=_.estree.body[w];if(!e8e.has(M.type)){const S=new tr("Unexpected `"+M.type+"` in code: only import/exports are supported",{place:th(M),ruleId:"non-esm",source:"micromark-extension-mdxjs-esm"});throw S.url=UH+"#unexpected-type-in-code-only-importexports-are-supported",S}if(M.type==="ImportDeclaration"&&!l.interrupt){let S=-1;for(;++S<M.specifiers.length;){const A=M.specifiers[S];c.push(A.local.name)}}}return Object.assign(a.exit("mdxjsEsm"),t.addResult?{estree:_.estree}:void 0),s(x)}}}function n8e(t,e,n){return i;function i(r){return t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),t.attempt(ay,e,n)}}const FH={}.hasOwnProperty;function e4(t){const e={};let n=-1;for(;++n<t.length;)i8e(e,t[n]);return e}function i8e(t,e){let n;for(n in e){const r=(FH.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let s;if(a)for(s in a){FH.call(r,s)||(r[s]=[]);const o=a[s];r8e(r[s],Array.isArray(o)?o:o?[o]:[])}}}function r8e(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);Tl(t,0,0,i)}function a8e(t){const e=Object.assign({acorn:mke.Parser.extend(kQ()),acornOptions:{ecmaVersion:2024,sourceType:"module"},addResult:!0},t);return e4([t8e(e),Oke(e),Pke(e),Uke()])}const s8e={};function o8e(t){const e=this,n=t||s8e,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(a8e(n)),a.push(dke()),s.push(pke(n))}const l8e={};function t4(t,e){const n=l8e,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return lee(t,i,r)}function lee(t,e,n){if(c8e(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return BH(t.children,e,n)}return Array.isArray(t)?BH(t,e,n):""}function BH(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=lee(t[r],e,n);return i.join("")}function c8e(t){return!!(t&&typeof t=="object")}function cee(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function sy(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const a=t.charCodeAt(n);let s="";if(a===37&&ro(t.charCodeAt(n+1))&&ro(t.charCodeAt(n+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=t.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),r=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(i,n),encodeURIComponent(s)),i=n+r+1,s=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}const u8e={tokenize:f8e};function f8e(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Oi(t,e,"linePrefix")}function r(o){return t.enter("paragraph"),a(o)}function a(o){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return bn(o)?(t.consume(o),t.exit("chunkText"),a):(t.consume(o),s)}}const h8e={tokenize:d8e},zH={tokenize:p8e};function d8e(t){const e=this,n=[];let i=0,r,a,s;return o;function o(_){if(i<n.length){const w=n[i];return e.containerState=w[1],t.attempt(w[0].continuation,l,c)(_)}return c(_)}function l(_){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&x();const w=e.events.length;let M=w,S;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){S=e.events[M][1].end;break}p(i);let A=w;for(;A<e.events.length;)e.events[A][1].end={...S},A++;return Tl(e.events,M+1,0,e.events.slice(w)),e.events.length=A,c(_)}return o(_)}function c(_){if(i===n.length){if(!r)return h(_);if(r.currentConstruct&&r.currentConstruct.concrete)return g(_);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(zH,u,f)(_)}function u(_){return r&&x(),p(i),h(_)}function f(_){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,g(_)}function h(_){return e.containerState={},t.attempt(zH,d,g)(_)}function d(_){return i++,n.push([e.currentConstruct,e.containerState]),h(_)}function g(_){if(_===null){r&&x(),p(0),t.consume(_);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),b(_)}function b(_){if(_===null){y(t.exit("chunkFlow"),!0),p(0),t.consume(_);return}return bn(_)?(t.consume(_),y(t.exit("chunkFlow")),i=0,e.interrupt=void 0,o):(t.consume(_),b)}function y(_,w){const M=e.sliceStream(_);if(w&&M.push(null),_.previous=a,a&&(a.next=_),a=_,r.defineSkip(_.start),r.write(M),e.parser.lazy[_.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<s&&(!r.events[S][1].end||r.events[S][1].end.offset>s))return;const A=e.events.length;let C=A,k,R;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(k){R=e.events[C][1].end;break}k=!0}for(p(i),S=A;S<e.events.length;)e.events[S][1].end={...R},S++;Tl(e.events,C+1,0,e.events.slice(A)),e.events.length=S}}function p(_){let w=n.length;for(;w-- >_;){const M=n[w];e.containerState=M[1],M[0].exit.call(e,t)}n.length=_}function x(){r.write([null]),a=void 0,r=void 0,e.containerState._closeFlow=void 0}}function p8e(t,e,n){return Oi(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const m8e={tokenize:g8e};function g8e(t){const e=this,n=t.attempt(ay,i,t.attempt(this.parser.constructs.flowInitial,r,Oi(t,t.attempt(this.parser.constructs.flow,r,t.attempt(aDe,r)),"linePrefix")));return n;function i(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const b8e={resolveAll:fee()},v8e=uee("string"),y8e=uee("text");function uee(t){return{resolveAll:fee(t==="text"?x8e:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],a=n.attempt(r,s,o);return s;function s(u){return c(u)?a(u):o(u)}function o(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),a(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=r[u];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(i,i.previous))return!0}return!1}}}function fee(t){return e;function e(n,i){let r=-1,a;for(;++r<=n.length;)a===void 0?n[r]&&n[r][1].type==="data"&&(a=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==a+2&&(n[a][1].end=n[r-1][1].end,n.splice(a+2,r-a-2),r=a+2),a=void 0);return t?t(n,i):n}}function x8e(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let a=r.length,s=-1,o=0,l;for(;a--;){const c=r[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)l=!0,o++;else if(c!==-1){a++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const c={type:n===t.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:i.start._bufferIndex+s,_index:i.start._index+a,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const _8e={42:Lo,43:Lo,45:Lo,48:Lo,49:Lo,50:Lo,51:Lo,52:Lo,53:Lo,54:Lo,55:Lo,56:Lo,57:Lo,62:tee},S8e={91:uDe},w8e={[-2]:GD,[-1]:GD,32:GD},E8e={35:gDe,42:_M,45:[PH,_M],60:xDe,61:PH,95:_M,96:NH,126:NH},M8e={38:iee,92:nee},T8e={[-5]:WD,[-4]:WD,[-3]:WD,33:FDe,38:iee,42:PI,60:[zke,ADe],91:zDe,92:[pDe,nee],93:QU,95:PI,96:Qke},A8e={null:[PI,b8e]},C8e={null:[42,95]},R8e={null:[]},k8e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:C8e,contentInitial:S8e,disable:R8e,document:_8e,flow:E8e,flowInitial:w8e,insideSpan:A8e,string:M8e,text:T8e},Symbol.toStringTag,{value:"Module"}));function D8e(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},a=[];let s=[],o=[];const l={attempt:A(M),check:A(S),consume:x,enter:_,exit:w,interrupt:A(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:h,sliceStream:d,write:f};let u=e.tokenize.call(c,l);return e.resolveAll&&a.push(e),c;function f(N){return s=uc(s,N),y(),s[s.length-1]!==null?[]:(C(e,0),c.events=DC(a,c.events,c),c.events)}function h(N,P){return I8e(d(N),P)}function d(N){return O8e(s,N)}function g(){const{_bufferIndex:N,_index:P,line:j,column:z,offset:X}=i;return{_bufferIndex:N,_index:P,line:j,column:z,offset:X}}function b(N){r[N.line]=N.column,R()}function y(){let N;for(;i._index<s.length;){const P=s[i._index];if(typeof P=="string")for(N=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===N&&i._bufferIndex<P.length;)p(P.charCodeAt(i._bufferIndex));else p(P)}}function p(N){u=u(N)}function x(N){bn(N)?(i.line++,i.column=1,i.offset+=N===-3?2:1,R()):N!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=N}function _(N,P){const j=P||{};return j.type=N,j.start=g(),c.events.push(["enter",j,c]),o.push(j),j}function w(N){const P=o.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function M(N,P){C(N,P.from)}function S(N,P){P.restore()}function A(N,P){return j;function j(z,X,F){let H,V,W,B;return Array.isArray(z)?Z(z):"tokenize"in z?Z([z]):Y(z);function Y(le){return ue;function ue(Se){const Te=Se!==null&&le[Se],Pe=Se!==null&&le.null,je=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return Z(je)(Se)}}function Z(le){return H=le,V=0,le.length===0?F:G(le[V])}function G(le){return ue;function ue(Se){return B=k(),W=le,le.partial||(c.currentConstruct=le),le.name&&c.parser.constructs.disable.null.includes(le.name)?oe():le.tokenize.call(P?Object.assign(Object.create(c),P):c,l,de,oe)(Se)}}function de(le){return N(W,B),X}function oe(le){return B.restore(),++V<H.length?G(H[V]):F}}}function C(N,P){N.resolveAll&&!a.includes(N)&&a.push(N),N.resolve&&Tl(c.events,P,c.events.length-P,N.resolve(c.events.slice(P),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function k(){const N=g(),P=c.previous,j=c.currentConstruct,z=c.events.length,X=Array.from(o);return{from:z,restore:F};function F(){i=N,c.previous=P,c.currentConstruct=j,c.events.length=z,o=X,R()}}function R(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function O8e(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,a=e.end._bufferIndex;let s;if(n===r)s=[t[n].slice(i,a)];else{if(s=t.slice(n,r),i>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(i):s.shift()}a>0&&s.push(t[r].slice(0,a))}return s}function I8e(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const a=t[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
`;break}case-3:{s=`\r
`;break}case-2:{s=e?" ":"	";break}case-1:{if(!e&&r)continue;s=" ";break}default:s=String.fromCharCode(a)}r=a===-2,i.push(s)}return i.join("")}function N8e(t){const i={constructs:e4([k8e,...(t||{}).extensions||[]]),content:r(u8e),defined:[],document:r(h8e),flow:r(m8e),lazy:{},string:r(v8e),text:r(y8e)};return i;function r(a){return s;function s(o){return D8e(i,a,o)}}}function L8e(t){for(;!ree(t););return t}const jH=/[\0\t\n\r]/g;function P8e(){let t=1,e="",n=!0,i;return r;function r(a,s,o){const l=[];let c,u,f,h,d;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,e="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(jH.lastIndex=f,c=jH.exec(a),h=c&&c.index!==void 0?c.index:a.length,d=a.charCodeAt(h),!c){e=a.slice(f);break}if(d===10&&f===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),f<h&&(l.push(a.slice(f,h)),t+=h-f),d){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:i=!0,t=1}f=h+1}return o&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}const U8e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function F8e(t){return t.replace(U8e,B8e)}function B8e(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),a=r===120||r===88;return cee(n.slice(a?2:1),a?16:10)}return t_(n)||t}const hee={}.hasOwnProperty;function z8e(t,e,n){return typeof e!="string"&&(n=e,e=void 0),j8e(n)(L8e(N8e(n).document().write(P8e()(t,e,!0))))}function j8e(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Re),autolinkProtocol:k,autolinkEmail:k,atxHeading:a(Ie),blockQuote:a(Pe),characterEscape:k,characterReference:k,codeFenced:a(je),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(je,s),codeText:a(He,s),codeTextData:k,data:k,codeFlowValue:k,definition:a(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ze),hardBreakEscape:a(Xe),hardBreakTrailing:a(Xe),htmlFlow:a(we,s),htmlFlowData:k,htmlText:a(we,s),htmlTextData:k,image:a(Ae),label:s,link:a(Re),listItem:a(Fe),listItemValue:h,listOrdered:a(Ne,f),listUnordered:a(Ne),paragraph:a(Qe),reference:G,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Ie),strong:a(ae),thematicBreak:a(ce)},exit:{atxHeading:l(),atxHeadingSequence:M,autolink:l(),autolinkEmail:Te,autolinkProtocol:Se,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:le,characterReference:ue,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:l(p),codeText:l(X),codeTextData:R,data:R,definition:l(),definitionDestinationString:w,definitionLabelString:x,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(P),hardBreakTrailing:l(P),htmlFlow:l(j),htmlFlowData:R,htmlText:l(z),htmlTextData:R,image:l(H),label:W,labelText:V,lineEnding:N,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:de,resourceDestinationString:B,resourceTitleString:Y,resource:Z,setextHeading:l(C),setextHeadingLineSequence:A,setextHeadingText:S,strong:l(),thematicBreak:l()}};dee(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(he){let me={type:"root",children:[]};const $={stack:[me],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:n},Ve=[];let qe=-1;for(;++qe<he.length;)if(he[qe][1].type==="listOrdered"||he[qe][1].type==="listUnordered")if(he[qe][0]==="enter")Ve.push(qe);else{const mt=Ve.pop();qe=r(he,mt,qe)}for(qe=-1;++qe<he.length;){const mt=e[he[qe][0]];hee.call(mt,he[qe][1].type)&&mt[he[qe][1].type].call(Object.assign({sliceSerialize:he[qe][2].sliceSerialize},$),he[qe][1])}if($.tokenStack.length>0){const mt=$.tokenStack[$.tokenStack.length-1];(mt[1]||HH).call($,void 0,mt[0])}for(me.position={start:nd(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:nd(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<e.transforms.length;)me=e.transforms[qe](me)||me;return me}function r(he,me,$){let Ve=me-1,qe=-1,mt=!1,Ge,Je,Ye,vt;for(;++Ve<=$;){const Mt=he[Ve];switch(Mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Mt[0]==="enter"?qe++:qe--,vt=void 0;break}case"lineEndingBlank":{Mt[0]==="enter"&&(Ge&&!vt&&!qe&&!Ye&&(Ye=Ve),vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vt=void 0}if(!qe&&Mt[0]==="enter"&&Mt[1].type==="listItemPrefix"||qe===-1&&Mt[0]==="exit"&&(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered")){if(Ge){let gt=Ve;for(Je=void 0;gt--;){const kt=he[gt];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;Je&&(he[Je][1].type="lineEndingBlank",mt=!0),kt[1].type="lineEnding",Je=gt}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}Ye&&(!Je||Ye<Je)&&(Ge._spread=!0),Ge.end=Object.assign({},Je?he[Je][1].start:Mt[1].end),he.splice(Je||Ve,0,["exit",Ge,Mt[2]]),Ve++,$++}if(Mt[1].type==="listItemPrefix"){const gt={type:"listItem",_spread:!1,start:Object.assign({},Mt[1].start),end:void 0};Ge=gt,he.splice(Ve,0,["enter",gt,Mt[2]]),Ve++,$++,Ye=void 0,vt=!0}}}return he[me][1]._spread=mt,$}function a(he,me){return $;function $(Ve){o.call(this,he(Ve),Ve),me&&me.call(this,Ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(he,me,$){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([me,$||void 0]),he.position={start:nd(me.start),end:void 0}}function l(he){return me;function me($){he&&he.call(this,$),c.call(this,$)}}function c(he,me){const $=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==he.type&&(me?me.call(this,he,Ve[0]):(Ve[1]||HH).call(this,he,Ve[0]));else throw new Error("Cannot close `"+he.type+"` ("+xc({start:he.start,end:he.end})+"): it’s not open");$.position.end=nd(he.end)}function u(){return t4(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(he){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function d(){const he=this.resume(),me=this.stack[this.stack.length-1];me.lang=he}function g(){const he=this.resume(),me=this.stack[this.stack.length-1];me.meta=he}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he.replace(/(\r?\n|\r)$/g,"")}function x(he){const me=this.resume(),$=this.stack[this.stack.length-1];$.label=me,$.identifier=vu(this.sliceSerialize(he)).toLowerCase()}function _(){const he=this.resume(),me=this.stack[this.stack.length-1];me.title=he}function w(){const he=this.resume(),me=this.stack[this.stack.length-1];me.url=he}function M(he){const me=this.stack[this.stack.length-1];if(!me.depth){const $=this.sliceSerialize(he).length;me.depth=$}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(he){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function k(he){const $=this.stack[this.stack.length-1].children;let Ve=$[$.length-1];(!Ve||Ve.type!=="text")&&(Ve=K(),Ve.position={start:nd(he.start),end:void 0},$.push(Ve)),this.stack.push(Ve)}function R(he){const me=this.stack.pop();me.value+=this.sliceSerialize(he),me.position.end=nd(he.end)}function N(he){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $=me.children[me.children.length-1];$.position.end=nd(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(k.call(this,he),R.call(this,he))}function P(){this.data.atHardBreak=!0}function j(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function z(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function X(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function F(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=me,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function H(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=me,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function V(he){const me=this.sliceSerialize(he),$=this.stack[this.stack.length-2];$.label=F8e(me),$.identifier=vu(me).toLowerCase()}function W(){const he=this.stack[this.stack.length-1],me=this.resume(),$=this.stack[this.stack.length-1];if(this.data.inReference=!0,$.type==="link"){const Ve=he.children;$.children=Ve}else $.alt=me}function B(){const he=this.resume(),me=this.stack[this.stack.length-1];me.url=he}function Y(){const he=this.resume(),me=this.stack[this.stack.length-1];me.title=he}function Z(){this.data.inReference=void 0}function G(){this.data.referenceType="collapsed"}function de(he){const me=this.resume(),$=this.stack[this.stack.length-1];$.label=me,$.identifier=vu(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function oe(he){this.data.characterReferenceType=he.type}function le(he){const me=this.sliceSerialize(he),$=this.data.characterReferenceType;let Ve;$?(Ve=cee(me,$==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=t_(me);const qe=this.stack[this.stack.length-1];qe.value+=Ve}function ue(he){const me=this.stack.pop();me.position.end=nd(he.end)}function Se(he){R.call(this,he);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(he)}function Te(he){R.call(this,he);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(he)}function Pe(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Ie(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function we(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function Ne(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Fe(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function ae(){return{type:"strong",children:[]}}function K(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}function nd(t){return{line:t.line,column:t.column,offset:t.offset}}function dee(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?dee(t,i):H8e(t,i)}}function H8e(t,e){let n;for(n in e)if(hee.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function HH(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+xc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+xc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+xc({start:e.start,end:e.end})+") is still open")}function V8e(t){const e=this;e.parser=n;function n(i){return z8e(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function G8e(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function W8e(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
`}]}function X8e(t,e){const n=e.value?e.value+`
`:"",i={};e.lang&&(i.className=["language-"+e.lang]);let r={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(r.data={meta:e.meta}),t.patch(e,r),r=t.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},t.patch(e,r),r}function q8e(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function K8e(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Y8e(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=sy(i.toLowerCase()),a=t.footnoteOrder.indexOf(i);let s,o=t.footnoteCounts.get(i);o===void 0?(o=0,t.footnoteOrder.push(i),s=t.footnoteOrder.length):s=a+1,o+=1,t.footnoteCounts.set(i,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)}function J8e(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function $8e(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function pee(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&s.type==="text"?s.value+=i:r.push({type:"text",value:i}),r}function Z8e(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return pee(t,e);const r={src:sy(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,a),t.applyData(e,a)}function Q8e(t,e){const n={src:sy(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function eOe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function tOe(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return pee(t,e);const r={href:sy(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,a),t.applyData(e,a)}function nOe(t,e){const n={href:sy(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function iOe(t,e,n){const i=t.all(e),r=n?rOe(n):mee(e),a={},s=[];if(typeof e.checked=="boolean"){const u=i[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<i.length;){const u=i[o];(r||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!r?s.push(...u.children):s.push(u)}const l=i[i.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:a,children:s};return t.patch(e,c),t.applyData(e,c)}function rOe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=mee(n[i])}return e}function mee(t){const e=t.spread;return e??t.children.length>1}function aOe(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<i.length;){const s=i[r];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function sOe(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function oOe(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function lOe(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function cOe(t,e){const n=t.all(e),i=n.shift(),r=[];if(i){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],s),r.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=GQ(e.children[1]),l=VQ(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),r.push(s)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,a),t.applyData(e,a)}function uOe(t,e,n){const i=n?n.children:void 0,a=(i?i.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const f=e.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let g={type:"element",tagName:a,properties:h,children:[]};f&&(g.children=t.all(f),t.patch(f,g),g=t.applyData(f,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,u),t.applyData(e,u)}function fOe(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const VH=9,GH=32;function hOe(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const a=[];for(;i;)a.push(WH(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return a.push(WH(e.slice(r),r>0,!1)),a.join("")}function WH(t,e,n){let i=0,r=t.length;if(e){let a=t.codePointAt(i);for(;a===VH||a===GH;)i++,a=t.codePointAt(i)}if(n){let a=t.codePointAt(r-1);for(;a===VH||a===GH;)r--,a=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function dOe(t,e){const n={type:"text",value:hOe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function pOe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const mOe={blockquote:G8e,break:W8e,code:X8e,delete:q8e,emphasis:K8e,footnoteReference:Y8e,heading:J8e,html:$8e,imageReference:Z8e,image:Q8e,inlineCode:eOe,linkReference:tOe,link:nOe,listItem:iOe,list:aOe,paragraph:sOe,root:oOe,strong:lOe,table:cOe,tableCell:fOe,tableRow:uOe,text:dOe,thematicBreak:pOe,toml:SE,yaml:SE,definition:SE,footnoteDefinition:SE};function SE(){}const gee=-1,OC=0,g1=1,bT=2,n4=3,i4=4,r4=5,a4=6,bee=7,vee=8,XH=typeof self=="object"?self:globalThis,gOe=(t,e)=>{const n=(r,a)=>(t.set(a,r),r),i=r=>{if(t.has(r))return t.get(r);const[a,s]=e[r];switch(a){case OC:case gee:return n(s,r);case g1:{const o=n([],r);for(const l of s)o.push(i(l));return o}case bT:{const o=n({},r);for(const[l,c]of s)o[i(l)]=i(c);return o}case n4:return n(new Date(s),r);case i4:{const{source:o,flags:l}=s;return n(new RegExp(o,l),r)}case r4:{const o=n(new Map,r);for(const[l,c]of s)o.set(i(l),i(c));return o}case a4:{const o=n(new Set,r);for(const l of s)o.add(i(l));return o}case bee:{const{name:o,message:l}=s;return n(new XH[o](l),r)}case vee:return n(BigInt(s),r);case"BigInt":return n(Object(BigInt(s)),r);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(new XH[a](s),r)};return i},qH=t=>gOe(new Map,t)(0),Ob="",{toString:bOe}={},{keys:vOe}=Object,ux=t=>{const e=typeof t;if(e!=="object"||!t)return[OC,e];const n=bOe.call(t).slice(8,-1);switch(n){case"Array":return[g1,Ob];case"Object":return[bT,Ob];case"Date":return[n4,Ob];case"RegExp":return[i4,Ob];case"Map":return[r4,Ob];case"Set":return[a4,Ob];case"DataView":return[g1,n]}return n.includes("Array")?[g1,n]:n.includes("Error")?[bee,n]:[bT,n]},wE=([t,e])=>t===OC&&(e==="function"||e==="symbol"),yOe=(t,e,n,i)=>{const r=(s,o)=>{const l=i.push(s)-1;return n.set(o,l),l},a=s=>{if(n.has(s))return n.get(s);let[o,l]=ux(s);switch(o){case OC:{let u=s;switch(l){case"bigint":o=vee,u=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return r([gee],s)}return r([o,u],s)}case g1:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),r([l,[...h]],s)}const u=[],f=r([o,u],s);for(const h of s)u.push(a(h));return f}case bT:{if(l)switch(l){case"BigInt":return r([l,s.toString()],s);case"Boolean":case"Number":case"String":return r([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const u=[],f=r([o,u],s);for(const h of vOe(s))(t||!wE(ux(s[h])))&&u.push([a(h),a(s[h])]);return f}case n4:return r([o,s.toISOString()],s);case i4:{const{source:u,flags:f}=s;return r([o,{source:u,flags:f}],s)}case r4:{const u=[],f=r([o,u],s);for(const[h,d]of s)(t||!(wE(ux(h))||wE(ux(d))))&&u.push([a(h),a(d)]);return f}case a4:{const u=[],f=r([o,u],s);for(const h of s)(t||!wE(ux(h)))&&u.push(a(h));return f}}const{message:c}=s;return r([o,{name:l,message:c}],s)};return a},KH=(t,{json:e,lossy:n}={})=>{const i=[];return yOe(!(e||n),!!e,new Map,i)(t),i},vT=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?qH(KH(t,e)):structuredClone(t):(t,e)=>qH(KH(t,e));function xOe(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function _Oe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function SOe(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||xOe,i=t.options.footnoteBackLabel||_Oe,r=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<t.footnoteOrder.length;){const c=t.footnoteById.get(t.footnoteOrder[l]);if(!c)continue;const u=t.all(c),f=String(c.identifier).toUpperCase(),h=sy(f.toLowerCase());let d=0;const g=[],b=t.footnoteCounts.get(f);for(;b!==void 0&&++d<=b;){g.length>0&&g.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,d);typeof x=="string"&&(x={type:"text",value:x}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,d),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const p={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(u,!0)};t.patch(c,p),o.push(p)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...vT(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
`}]}}const IC=function(t){if(t==null)return TOe;if(typeof t=="function")return NC(t);if(typeof t=="object")return Array.isArray(t)?wOe(t):EOe(t);if(typeof t=="string")return MOe(t);throw new Error("Expected function, string, or object as test")};function wOe(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=IC(t[n]);return NC(i);function i(...r){let a=-1;for(;++a<e.length;)if(e[a].apply(this,r))return!0;return!1}}function EOe(t){const e=t;return NC(n);function n(i){const r=i;let a;for(a in t)if(r[a]!==e[a])return!1;return!0}}function MOe(t){return NC(e);function e(n){return n&&n.type===t}}function NC(t){return e;function e(n,i,r){return!!(AOe(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function TOe(){return!0}function AOe(t){return t!==null&&typeof t=="object"&&"type"in t}const yee=[],COe=!0,UI=!1,ROe="skip";function xee(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;const a=IC(r),s=i?-1:1;o(t,void 0,[])();function o(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=yee,g,b,y;if((!e||a(l,c,u[u.length-1]||void 0))&&(d=kOe(n(l,u)),d[0]===UI))return d;if("children"in l&&l.children){const p=l;if(p.children&&d[0]!==ROe)for(b=(i?p.children.length:-1)+s,y=u.concat(p);b>-1&&b<p.children.length;){const x=p.children[b];if(g=o(x,b,y)(),g[0]===UI)return g;b=typeof g[1]=="number"?g[1]:b+s}}return d}}}function kOe(t){return Array.isArray(t)?t:typeof t=="number"?[COe,t]:t==null?yee:[t]}function rS(t,e,n,i){let r,a,s;typeof e=="function"&&typeof n!="function"?(a=void 0,s=e,r=n):(a=e,s=n,r=i),xee(t,a,o,r);function o(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const FI={}.hasOwnProperty,DOe={};function OOe(t,e){const n=e||DOe,i=new Map,r=new Map,a=new Map,s={...mOe,...n.handlers},o={all:c,applyData:NOe,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:n,patch:IOe,wrap:POe};return rS(t,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?i:r,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),o;function l(u,f){const h=u.type,d=o.handlers[h];if(FI.call(o.handlers,h)&&d)return d(o,u,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:b,...y}=u,p=vT(y);return p.children=o.all(u),p}return vT(u)}return(o.options.unknownHandler||LOe)(o,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let d=-1;for(;++d<h.length;){const g=o.one(h[d],u);if(g){if(d&&h[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=YH(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=YH(b.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function IOe(t,e){t.position&&(e.position=XQ(t))}function NOe(t,e){let n=e;if(t&&t.data){const i=t.data.hName,r=t.data.hChildren,a=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const s="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,vT(a)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function LOe(t,e){const n=e.data||{},i="value"in e&&!(FI.call(n,"hProperties")||FI.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function POe(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
`});++i<t.length;)i&&n.push({type:"text",value:`
`}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
`}),n}function YH(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function JH(t,e){const n=OOe(t,e),i=n.one(t,void 0),r=SOe(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:`
`},r),a}function UOe(t,e){return t&&"run"in t?async function(n,i){const r=JH(n,{file:i,...e});await t.run(r,i)}:function(n,i){return JH(n,{file:i,...t||e})}}function $H(t){if(t)throw t}var SM=Object.prototype.hasOwnProperty,_ee=Object.prototype.toString,ZH=Object.defineProperty,QH=Object.getOwnPropertyDescriptor,eV=function(e){return typeof Array.isArray=="function"?Array.isArray(e):_ee.call(e)==="[object Array]"},tV=function(e){if(!e||_ee.call(e)!=="[object Object]")return!1;var n=SM.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&SM.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;var r;for(r in e);return typeof r>"u"||SM.call(e,r)},nV=function(e,n){ZH&&n.name==="__proto__"?ZH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},iV=function(e,n){if(n==="__proto__")if(SM.call(e,n)){if(QH)return QH(e,n).value}else return;return e[n]},FOe=function t(){var e,n,i,r,a,s,o=arguments[0],l=1,c=arguments.length,u=!1;for(typeof o=="boolean"&&(u=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(e=arguments[l],e!=null)for(n in e)i=iV(o,n),r=iV(e,n),o!==r&&(u&&r&&(tV(r)||(a=eV(r)))?(a?(a=!1,s=i&&eV(i)?i:[]):s=i&&tV(i)?i:{},nV(o,{name:n,newValue:t(u,s,r)})):typeof r<"u"&&nV(o,{name:n,newValue:r}));return o};const XD=Rc(FOe);function BI(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function BOe(){const t=[],e={run:n,use:i};return e;function n(...r){let a=-1;const s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...r);function o(l,...c){const u=t[++a];let f=-1;if(l){s(l);return}for(;++f<r.length;)(c[f]===null||c[f]===void 0)&&(c[f]=r[f]);r=c,u?zOe(u,o)(...c):s(null,...c)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function zOe(t,e){let n;return i;function i(...s){const o=t.length>s.length;let l;o&&s.push(r);try{l=t.apply(this,s)}catch(c){const u=c;if(o&&n)throw u;return r(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,r):l instanceof Error?r(l):a(l))}function r(s,...o){n||(n=!0,e(s,...o))}function a(s){r(null,s)}}const jOe=function(t){const i=this.constructor.prototype,r=i[t],a=function(){return r.apply(a,arguments)};return Object.setPrototypeOf(a,i),a},HOe={}.hasOwnProperty;class s4 extends jOe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=BOe()}copy(){const e=new s4;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data(XD(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(YD("data",this.frozen),this.namespace[e]=n,this):HOe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(YD("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=EE(e),i=this.parser||this.Parser;return qD("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),qD("process",this.parser||this.Parser),KD("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(a,s){const o=EE(e),l=i.parse(o);i.run(l,o,function(u,f,h){if(u||!f||!h)return c(u);const d=f,g=i.stringify(d,h);WOe(g)?h.value=g:h.result=g,c(u,h)});function c(u,f){u||!f?s(u):a?a(f):n(void 0,f)}}}processSync(e){let n=!1,i;return this.freeze(),qD("processSync",this.parser||this.Parser),KD("processSync",this.compiler||this.Compiler),this.process(e,r),aV("processSync","process",n),i;function r(a,s){n=!0,$H(a),i=s}}run(e,n,i){rV(e),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(s,o){const l=EE(n);r.run(e,l,c);function c(u,f,h){const d=f||e;u?o(u):s?s(d):i(void 0,d,h)}}}runSync(e,n){let i=!1,r;return this.run(e,n,a),aV("runSync","run",i),r;function a(s,o){$H(s),r=o,i=!0}}stringify(e,n){this.freeze();const i=EE(n),r=this.compiler||this.Compiler;return KD("stringify",r),rV(e),r(e,i)}use(e,...n){const i=this.attachers,r=this.namespace;if(YD("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(r.settings=XD(!0,r.settings,c.settings))}function o(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];a(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<i.length;)if(i[f][0]===c){h=f;break}if(h===-1)i.push([c,...u]);else if(u.length>0){let[d,...g]=u;const b=i[h][1];BI(b)&&BI(d)&&(d=XD(!0,b,d)),i[h]=[c,d,...g]}}}}const VOe=new s4().freeze();function qD(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function KD(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function YD(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rV(t){if(!BI(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function aV(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function EE(t){return GOe(t)?t:new AQ(t)}function GOe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function WOe(t){return typeof t=="string"||XOe(t)}function XOe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function ud(t,e){const n=["start","end","loc","range"];let i=-1;for(;++i<n.length;){const r=n[i];r in t&&(e[r]=t[r])}}function o4(t,e){let n=-1;const i=[],r=[];let a;for(;++n<t.length;){const s=t[n];s.type==="ImportNamespaceSpecifier"?a=s:r.push(s)}if(a){const s={type:"VariableDeclarator",id:a.local,init:e};ud(a,s),i.push(s)}return i.push({type:"VariableDeclarator",id:{type:"ObjectPattern",properties:r.map(function(s){let o=s.type==="ImportSpecifier"?s.imported:s.type==="ExportSpecifier"?s.exported:{type:"Identifier",name:"default"},l=s.local;s.type==="ExportSpecifier"&&(l=o,o=s.local),l.type;const c={type:"Property",kind:"init",shorthand:o.type==="Identifier"&&l.type==="Identifier"&&o.name===l.name,method:!1,computed:!1,key:o,value:l};return ud(s,c),c})},init:a?{type:"Identifier",name:a.local.name}:e}),i}function Fd(t){let e=-1,n;for(;++e<t.length;){const i=t[e],r=typeof i=="string"&&of(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};n=n?{type:"MemberExpression",object:n,property:r,computed:r.type==="Literal",optional:!1}:r}return n.type,n}function sV(t){let e=-1,n;for(;++e<t.length;){const i=t[e];typeof i=="string"&&of(i,{jsx:!0});const r={type:"JSXIdentifier",name:i};n=n?{type:"JSXMemberExpression",object:n,property:r}:r}return n}function qOe(t){const{outputFormat:e}=t||{};return function(n){if(n.comments&&(n.comments=n.comments.filter(function(i){return!i.data?._mdxIsPragmaComment})),e==="function-body"){let i=0;for(;i<n.body.length;){const a=n.body[i];if("directive"in a&&a.directive)i++;else break}const r=n.body[i];r&&r.type==="ImportDeclaration"&&typeof r.source.value=="string"&&/\/jsx-(dev-)?runtime$/.test(r.source.value)&&(n.body[i]={type:"VariableDeclaration",kind:"const",declarations:o4(r.specifiers,Fd(["arguments",0]))})}}}function See(){const t=[{block:!1,defined:[]}];return{enter:e,exit:n,scopes:t};function e(a){if(a.type==="ArrowFunctionExpression"){t.push({block:!1,defined:[]});for(const s of a.params)r(s,!1)}else if(a.type==="BlockStatement"||a.type==="DoWhileStatement"||a.type==="ForInStatement"||a.type==="ForOfStatement"||a.type==="ForStatement"||a.type==="WhileStatement")t.push({block:!0,defined:[]});else if(a.type==="CatchClause")t.push({block:!0,defined:[]}),a.param&&r(a.param,!0);else if(a.type==="ClassDeclaration")i(a.id.name,!1);else if(a.type==="FunctionDeclaration"){i(a.id.name,!1),t.push({block:!1,defined:[]});for(const s of a.params)r(s,!1)}else if(a.type==="FunctionExpression"){a.id&&i(a.id.name,!1),t.push({block:!1,defined:[]});for(const s of a.params)r(s,!1)}else if(a.type==="ImportDeclaration")for(const s of a.specifiers)i(s.local.name,!1);else if(a.type==="VariableDeclaration")for(const s of a.declarations)r(s.id,a.kind!=="var")}function n(a){if(a.type==="ArrowFunctionExpression"||a.type==="FunctionDeclaration"||a.type==="FunctionExpression"){const s=t.pop();s.block}else if(a.type==="BlockStatement"||a.type==="CatchClause"||a.type==="DoWhileStatement"||a.type==="ForInStatement"||a.type==="ForOfStatement"||a.type==="ForStatement"||a.type==="WhileStatement"){const s=t.pop();s.block}}function i(a,s){let o=t.length,l;for(;o--&&(l=t[o],!(s||!l.block)););l.defined.push(a)}function r(a,s){if(a.type==="ArrayPattern")for(const o of a.elements)o&&r(o,s);else if(a.type==="AssignmentPattern")r(a.left,s);else if(a.type==="Identifier")i(a.name,s);else if(a.type==="ObjectPattern")for(const o of a.properties)o.type==="Property"?r(o.value,s):(o.type,r(o,s));else a.type,r(a.argument,s)}}function KOe(t){return t.type==="FunctionDeclaration"?{...t,type:"FunctionExpression"}:(t.type,{...t,type:"ClassExpression"})}function YOe(t){return t.type==="FunctionDeclaration"||t.type==="ClassDeclaration"||t.type==="VariableDeclaration"}function JOe(t){const e=t.baseUrl||void 0,n=typeof e=="object"?e.href:e,i=t.outputFormat||"program",r=t.pragma===void 0?"React.createElement":t.pragma,a=t.pragmaFrag===void 0?"React.Fragment":t.pragmaFrag,s=t.pragmaImportSource||"react",o=t.jsxImportSource||"react",l=t.jsxRuntime||"automatic";return function(u,f){const h=[],d=[];let g=0,b,y,p;if(l==="classic"&&a&&ME(u,"@jsxFrag",a),l==="classic"&&r&&ME(u,"@jsx",r),l==="automatic"&&o&&ME(u,"@jsxImportSource",o),ME(u,"@jsxRuntime",l),l==="classic"&&s){if(!r)throw new Error("Missing `pragma` in classic runtime with `pragmaImportSource`");M({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:{type:"Identifier",name:r.split(".")[0]}}],source:{type:"Literal",value:s}})}for(p of u.body)if(p.type==="ExportDefaultDeclaration")b&&f.fail("Unexpected duplicate layout, expected a single layout (previous: "+xc(th(b))+")",{ancestors:[u,p],place:th(p),ruleId:"duplicate-layout",source:"recma-document"}),b=p,d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"MDXLayout"},init:YOe(p.declaration)?KOe(p.declaration):p.declaration}]});else if(p.type==="ExportNamedDeclaration"&&p.source){const S=p.source;p.specifiers=p.specifiers.filter(function(A){if(A.exported.type==="Identifier"&&A.exported.name==="default"){b&&f.fail("Unexpected duplicate layout, expected a single layout (previous: "+xc(th(b))+")",{ancestors:[u,p,A],place:th(p),ruleId:"duplicate-layout",source:"recma-document"}),b=A;const C=[];if(A.local.type==="Identifier"&&A.local.name==="default")C.push({type:"ImportDefaultSpecifier",local:{type:"Identifier",name:"MDXLayout"}});else{const N={type:"ImportSpecifier",imported:A.local,local:{type:"Identifier",name:"MDXLayout"}};ud(A.local,N),C.push(N)}const k={type:"Literal",value:S.value};ud(S,k);const R={type:"ImportDeclaration",specifiers:C,source:k};return ud(A,R),M(R),!1}return!0}),p.specifiers.length>0&&w(p)}else p.type==="ExportNamedDeclaration"||p.type==="ExportAllDeclaration"?w(p):p.type==="ImportDeclaration"?M(p):p.type==="ExpressionStatement"&&(p.expression.type==="JSXElement"||p.expression.type==="JSXFragment")?(y=!0,d.push(...c(p.expression,i,!!b))):d.push(p);y||d.push(...c(void 0,i,!!b)),h.push(["MDXContent","default"]),i==="function-body"&&d.push({type:"ReturnStatement",argument:{type:"ObjectExpression",properties:[...Array.from({length:g}).map(function(S,A){return{type:"SpreadElement",argument:{type:"Identifier",name:"_exportAll"+(A+1)}}}),...h.map(function(S){return{type:"Property",kind:"init",method:!1,computed:!1,shorthand:typeof S=="string",key:{type:"Identifier",name:typeof S=="string"?S:S[1]},value:{type:"Identifier",name:typeof S=="string"?S:S[0]}}})]}}),u.body=d;let x=!1,_=!1;(n||i==="function-body")&&T0(u,{enter(S){if((S.type==="ExportAllDeclaration"||S.type==="ExportNamedDeclaration"||S.type==="ImportDeclaration")&&S.source){let A=S.source.value;try{new URL(A)}catch{(A.startsWith("/")||A.startsWith("./")||A.startsWith("../"))&&(A=new URL(A,n).href)}const C={type:"Literal",value:A};ud(S.source,C),S.source=C;return}if(S.type==="ImportExpression"){_=!0;const A={type:"CallExpression",callee:{type:"Identifier",name:"_resolveDynamicMdxSpecifier"},arguments:[S.source],optional:!1};S.source=A;return}if(S.type==="MemberExpression"&&"object"in S&&S.object.type==="MetaProperty"&&S.property.type==="Identifier"&&S.object.meta.name==="import"&&S.object.property.name==="meta"&&S.property.name==="url"){x=!0;const A={type:"Identifier",name:"_importMetaUrl"};ud(S,A),this.replace(A)}}}),_&&(n||(x=!0),u.body.push($Oe(n?{type:"Literal",value:n}:{type:"Identifier",name:"_importMetaUrl"}))),x&&u.body.unshift(...ZOe());function w(S){if(S.type==="ExportNamedDeclaration"){if(S.declaration){const A=See();T0(S,{enter(C){A.enter(C),(C.type==="ArrowFunctionExpression"||C.type==="FunctionDeclaration"||C.type==="FunctionExpression")&&(this.skip(),A.exit(C))},leave:A.exit}),h.push(...A.scopes[0].defined)}for(p of S.specifiers)p.exported.type==="Identifier"?h.push(p.exported.name):(p.exported.value,h.push(p.exported.value))}M(S)}function M(S){let A,C;if(i==="function-body")if(S.type==="ImportDeclaration"||S.type==="ExportAllDeclaration"||S.type==="ExportNamedDeclaration"&&S.source){S.source;const k={type:"ImportExpression",source:S.source};ud(S,k),C={type:"AwaitExpression",argument:k},(S.type==="ImportDeclaration"||S.type==="ExportNamedDeclaration")&&S.specifiers.length===0?A={type:"ExpressionStatement",expression:C}:A={type:"VariableDeclaration",kind:"const",declarations:S.type==="ExportAllDeclaration"?[{type:"VariableDeclarator",id:{type:"Identifier",name:"_exportAll"+ ++g},init:C}]:o4(S.specifiers,C)}}else if(S.declaration)A=S.declaration;else{const k=[];for(const R of S.specifiers)R.exported.type==="Identifier"&&R.local.type==="Identifier"&&R.local.name!==R.exported.name&&k.push({type:"VariableDeclarator",id:R.exported,init:R.local});k.length>0&&(A={type:"VariableDeclaration",kind:"const",declarations:k})}else A=S;A&&d.push(A)}};function c(u,f,h){let g={type:"JSXElement",openingElement:{type:"JSXOpeningElement",name:{type:"JSXIdentifier",name:"MDXLayout"},attributes:[{type:"JSXSpreadAttribute",argument:{type:"Identifier",name:"props"}}],selfClosing:!1},closingElement:{type:"JSXClosingElement",name:{type:"JSXIdentifier",name:"MDXLayout"}},children:[{type:"JSXElement",openingElement:{type:"JSXOpeningElement",name:{type:"JSXIdentifier",name:"_createMdxContent"},attributes:[{type:"JSXSpreadAttribute",argument:{type:"Identifier",name:"props"}}],selfClosing:!0},closingElement:null,children:[]}]};h||(g={type:"ConditionalExpression",test:{type:"Identifier",name:"MDXLayout"},consequent:g,alternate:{type:"CallExpression",callee:{type:"Identifier",name:"_createMdxContent"},arguments:[{type:"Identifier",name:"props"}],optional:!1}});let b=u||{type:"Identifier",name:"undefined"};b.type==="JSXFragment"&&b.children.length===1&&b.children[0].type==="JSXElement"&&(b=b.children[0]);let y=!1;T0(b,{enter(x){if(x.type==="ArrowFunctionExpression"||x.type==="FunctionDeclaration"||x.type==="FunctionExpression")return this.skip();(x.type==="AwaitExpression"||x.type==="ForOfStatement"&&x.await)&&(y=!0)}});const p={type:"FunctionDeclaration",id:{type:"Identifier",name:"MDXContent"},params:[{type:"AssignmentPattern",left:{type:"Identifier",name:"props"},right:{type:"ObjectExpression",properties:[]}}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:g}]}};return[{type:"FunctionDeclaration",async:y,id:{type:"Identifier",name:"_createMdxContent"},params:[{type:"Identifier",name:"props"}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:b}]}},f==="program"?{type:"ExportDefaultDeclaration",declaration:p}:p]}}function ME(t,e,n){t.comments?.unshift({type:"Block",value:e+" "+n,data:{_mdxIsPragmaComment:!0}})}function $Oe(t){return{type:"FunctionDeclaration",id:{type:"Identifier",name:"_resolveDynamicMdxSpecifier"},generator:!1,async:!1,params:[{type:"Identifier",name:"d"}],body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:!0,argument:{type:"Identifier",name:"d"}},operator:"!==",right:{type:"Literal",value:"string"}},consequent:{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}},alternate:null},{type:"TryStatement",block:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"NewExpression",callee:{type:"Identifier",name:"URL"},arguments:[{type:"Identifier",name:"d"}]}},{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}}]},handler:{type:"CatchClause",param:null,body:{type:"BlockStatement",body:[]}},finalizer:null},{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"LogicalExpression",left:{type:"CallExpression",callee:Fd(["d","startsWith"]),arguments:[{type:"Literal",value:"/"}],optional:!1},operator:"||",right:{type:"CallExpression",callee:Fd(["d","startsWith"]),arguments:[{type:"Literal",value:"./"}],optional:!1}},operator:"||",right:{type:"CallExpression",callee:Fd(["d","startsWith"]),arguments:[{type:"Literal",value:"../"}],optional:!1}},consequent:{type:"ReturnStatement",argument:{type:"MemberExpression",object:{type:"NewExpression",callee:{type:"Identifier",name:"URL"},arguments:[{type:"Identifier",name:"d"},t]},property:{type:"Identifier",name:"href"},computed:!1,optional:!1}},alternate:null},{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}}]}}}function ZOe(){return[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_importMetaUrl"},init:Fd(["arguments",0,"baseUrl"])}],kind:"const"},{type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:{type:"Identifier",name:"_importMetaUrl"}},consequent:{type:"ThrowStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Error"},arguments:[{type:"Literal",value:"Unexpected missing `options.baseUrl` needed to support `export … from`, `import`, or `import.meta.url` when generating `function-body`"}]}},alternate:null}]}function oV(t){let e=-1,n;for(;++e<t.length;){const i=t[e];n=n?{type:"BinaryExpression",left:n,operator:"+",right:i}:i}return n}function QOe(t){const{development:e,outputFormat:n,providerImportSource:i}=t;return function(r,a){const s=See(),o=[];let l=!1,c=!1;if(T0(r,{enter(u){s.enter(u),(u.type==="FunctionDeclaration"||u.type==="FunctionExpression"||u.type==="ArrowFunctionExpression")&&(o.push({components:[],idToInvalidComponentName:new Map,node:u,objects:[],references:{},tags:[]}),Ib(u,"MDXContent")&&!JD(s.scopes,"MDXLayout")&&o[0].components.push("MDXLayout"));const f=o[0];if(!(!f||!Ib(f.node,"_createMdxContent")&&!i)&&u.type==="JSXElement"){let h=u.openingElement.name;if(h.type==="JSXMemberExpression"){const d=[];for(;h.type==="JSXMemberExpression";)d.unshift(h.property.name),h=h.object;d.unshift(h.name);const g=d.join("."),b=h.name,y=JD(s.scopes,b);!Object.hasOwn(f.references,g)&&(!y||o.length===1&&o[0].node.type==="FunctionDeclaration"&&Ib(o[0].node,"_createMdxContent"))&&(f.references[g]={component:!0,node:u}),!f.objects.includes(b)&&!y&&f.objects.push(b)}else if(h.type!=="JSXNamespacedName"){if(of(h.name)&&!/^[a-z]/.test(h.name)){const d=h.name;JD(s.scopes,d)||(d!=="MDXLayout"&&!Object.hasOwn(f.references,d)&&(f.references[d]={component:!0,node:u}),f.components.includes(d)||f.components.push(d))}else if(!(u.data&&u.data._mdxExplicitJsx)){const d=h.name;f.tags.includes(d)||f.tags.push(d);let g=["_components",d];if(of(d)===!1){let b=f.idToInvalidComponentName.get(d);b===void 0&&(b=`_component${f.idToInvalidComponentName.size}`,f.idToInvalidComponentName.set(d,b)),g=[b]}u.openingElement.name=sV(g),u.closingElement&&(u.closingElement.name=sV(g))}}}},leave(u){s.exit(u);const f=[],h=[],d=[],g=[];if(u.type==="FunctionDeclaration"||u.type==="FunctionExpression"||u.type==="ArrowFunctionExpression"){const b=o[o.length-1];let y;for(y of b.tags.sort())f.push({type:"Property",kind:"init",key:of(y)?{type:"Identifier",name:y}:{type:"Literal",value:y},value:{type:"Literal",value:y},method:!1,shorthand:!1,computed:!1});h.push(...b.components);for(y of b.objects)h.includes(y)||h.push(y);h.sort();const p=[];if(f.length>0||h.length>0||b.idToInvalidComponentName.size>0){if(i&&(l=!0,d.push({type:"CallExpression",callee:{type:"Identifier",name:"_provideComponents"},arguments:[],optional:!1})),(Ib(b.node,"MDXContent")||Ib(b.node,"_createMdxContent"))&&d.push(Fd(["props","components"])),f.length>0||d.length>1)for(const A of d)f.push({type:"SpreadElement",argument:A});let M=f.length>0?{type:"ObjectExpression",properties:f}:{type:"LogicalExpression",operator:"||",left:d[0],right:{type:"ObjectExpression",properties:[]}},S;if(h.length>0&&(S={type:"ObjectPattern",properties:h.map(function(A){return{type:"Property",kind:"init",key:{type:"Identifier",name:A==="MDXLayout"?"wrapper":A},value:{type:"Identifier",name:A},method:!1,shorthand:A!=="MDXLayout",computed:!1}})}),b.tags.length>0&&(g.push({type:"VariableDeclarator",id:{type:"Identifier",name:"_components"},init:M}),M={type:"Identifier",name:"_components"}),Ib(b.node,"_createMdxContent"))for(const[A,C]of[...b.idToInvalidComponentName].sort(function([k],[R]){return k.localeCompare(R)}))g.push({type:"VariableDeclarator",id:{type:"Identifier",name:C},init:{type:"MemberExpression",object:{type:"Identifier",name:"_components"},property:{type:"Literal",value:A},computed:!0,optional:!1}});S&&g.push({type:"VariableDeclarator",id:S,init:M}),g.length>0&&p.push({type:"VariableDeclaration",kind:"const",declarations:g})}let x;for(x in b.references)if(Object.hasOwn(b.references,x)){const M=x.split(".");let S=0;for(;++S<M.length;){const A=M.slice(0,S).join(".");Object.hasOwn(b.references,A)||(b.references[A]={component:!1,node:b.references[x].node})}}const _=Object.keys(b.references).sort();let w=-1;for(;++w<_.length;){const M=_[w],S=b.references[M],A=xc(th(S.node)),C=[{type:"Literal",value:M},{type:"Literal",value:S.component}];c=!0,e&&A&&C.push({type:"Literal",value:A}),p.push({type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:Fd(M.split("."))},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"_missingMdxReference"},arguments:C,optional:!1}},alternate:void 0})}p.length>0&&(u.body.type!=="BlockStatement"&&(u.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:u.body}]}),u.body.body.unshift(...p)),o.pop()}}}),l&&i&&r.body.unshift(eIe(i,n)),c){const u=[{type:"Literal",value:"Expected "},{type:"ConditionalExpression",test:{type:"Identifier",name:"component"},consequent:{type:"Literal",value:"component"},alternate:{type:"Literal",value:"object"}},{type:"Literal",value:" `"},{type:"Identifier",name:"id"},{type:"Literal",value:"` to be defined: you likely forgot to import, pass, or provide it."}],f=[{type:"Identifier",name:"id"},{type:"Identifier",name:"component"}];e&&(u.push({type:"ConditionalExpression",test:{type:"Identifier",name:"place"},consequent:oV([{type:"Literal",value:"\nIt’s referenced in your code at `"},{type:"Identifier",name:"place"},{type:"Literal",value:(a.path?"` in `"+a.path:"")+"`"}]),alternate:{type:"Literal",value:""}}),f.push({type:"Identifier",name:"place"})),r.body.push({type:"FunctionDeclaration",id:{type:"Identifier",name:"_missingMdxReference"},generator:!1,async:!1,params:f,body:{type:"BlockStatement",body:[{type:"ThrowStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Error"},arguments:[oV(u)]}}]}})}n==="function-body"&&r.body.unshift({type:"ExpressionStatement",expression:{type:"Literal",value:"use strict"},directive:"use strict"})}}function eIe(t,e){const n=[{type:"ImportSpecifier",imported:{type:"Identifier",name:"useMDXComponents"},local:{type:"Identifier",name:"_provideComponents"}}];return e==="function-body"?{type:"VariableDeclaration",kind:"const",declarations:o4(n,Fd(["arguments",0]))}:{type:"ImportDeclaration",specifiers:n,source:{type:"Literal",value:t}}}function Ib(t,e){return!!(t&&"id"in t&&t.id&&t.id.name===e)}function JD(t,e){let n=t.length;for(;n--;)if(t[n].defined.includes(e))return!0;return!1}function tIe(){return function(t){rS(t,"raw",function(e,n,i){if(i&&typeof n=="number")return i.children.splice(n,1),n})}}const nIe=/\s+/g,iIe=/[\t\n\v\f\r ]+/g;function rIe(t,e){e?typeof e=="string"&&(e={style:e}):e={};const n=e.preserveLineEndings?aIe:sIe;return String(t).replace(e.style==="html"?iIe:nIe,e.trim?oIe(n):n)}function aIe(t){const e=/\r?\n|\r/.exec(t);return e?e[0]:" "}function sIe(){return" "}function oIe(t){return e;function e(n,i,r){return i===0||i+n.length===r.length?"":t(n)}}function lIe(){return function(t){rS(t,function(e,n,i){let r=-1,a=!0,s=!1;if(i&&typeof n=="number"&&e.type==="paragraph"){const o=e.children;for(;++r<o.length;){const l=o[r];if(l.type==="mdxJsxTextElement"||l.type==="mdxTextExpression")s=!0;else if(!(l.type==="text"&&rIe(l.value,{style:"html",trim:!0})==="")){a=!1;break}}if(a&&s){r=-1;const l=[];for(;++r<o.length;){const c=o[r];c.type==="mdxJsxTextElement"&&(c.type="mdxJsxFlowElement"),c.type==="mdxTextExpression"&&(c.type="mdxFlowExpression"),c.type==="text"&&/^[\t\r\n ]+$/.test(String(c.value))||l.push(c)}return i.children.splice(n,1,...l),n}}if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement"){const o=e.data||(e.data={});o._mdxExplicitJsx=!0}(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression"||e.type==="mdxjsEsm")&&e.data&&e.data.estree&&T0(e.data.estree,{enter(o){if(o.type==="JSXElement"){const l=o.data||(o.data={});l._mdxExplicitJsx=!0}}})})}}const cIe=["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"];let lV=!1;function uIe(t){const e=t||{};e.format,(e.jsxRuntime==="classic"||e.pragma||e.pragmaFrag||e.pragmaImportSource)&&!lV&&(lV=!0,console.warn("Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate"));const n=VOe().use(V8e);e.format!=="md"&&n.use(o8e);const i=e.remarkRehypeOptions||{};return n.use(lIe).use(e.remarkPlugins||[]).use(UOe,{...i,allowDangerousHtml:!0,passThrough:[...i.passThrough||[],...cIe]}).use(e.rehypePlugins||[]),e.format==="md"&&n.use(tIe),n.use(P3e,e).use(JOe,e).use(QOe,e),e.jsx||n.use(KCe,e).use(qOe,e),n.use(SRe).use(wRe,e).use(e.recmaPlugins||[]),n}function fIe(t,e){const{file:n,options:i}=UCe(t,e);return uIe(i).process(n)}function hIe(t){const{Fragment:e,baseUrl:n,development:i,jsx:r,jsxDEV:a,jsxs:s,useMDXComponents:o,...l}=t||{};if(!e)throw new Error("Expected `Fragment` given to `evaluate`");if(i){if(!a)throw new Error("Expected `jsxDEV` given to `evaluate`")}else{if(!r)throw new Error("Expected `jsx` given to `evaluate`");if(!s)throw new Error("Expected `jsxs` given to `evaluate`")}return{compiletime:{...l,development:i,outputFormat:"function-body",providerImportSource:o?"#":void 0},runtime:{Fragment:e,baseUrl:n,jsx:r,jsxDEV:a,jsxs:s,useMDXComponents:o}}}const dIe=Object.getPrototypeOf(wee).constructor;async function wee(t,e){return new dIe(String(t))(e)}async function pIe(t,e){const{compiletime:n,runtime:i}=hIe(e);return wee(await fIe(t,n),i)}function mIe(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gIe(t,e,n){const r=IC((n||{}).ignore||[]),a=bIe(e);let s=-1;for(;++s<a.length;)xee(t,"text",o);function o(c,u){let f=-1,h;for(;++f<u.length;){const d=u[f],g=h?h.children:void 0;if(r(d,g?g.indexOf(d):void 0,h))return;h=d}if(h)return l(c,u)}function l(c,u){const f=u[u.length-1],h=a[s][0],d=a[s][1];let g=0;const y=f.children.indexOf(c);let p=!1,x=[];h.lastIndex=0;let _=h.exec(c.value);for(;_;){const w=_.index,M={index:_.index,input:_.input,stack:[...u,c]};let S=d(..._,M);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=w+1:(g!==w&&x.push({type:"text",value:c.value.slice(g,w)}),Array.isArray(S)?x.push(...S):S&&x.push(S),g=w+_[0].length,p=!0),!h.global)break;_=h.exec(c.value)}return p?(g<c.value.length&&x.push({type:"text",value:c.value.slice(g)}),f.children.splice(y,1,...x)):x=[c],y+x.length}}function bIe(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<n.length;){const r=n[i];e.push([vIe(r[0]),yIe(r[1])])}return e}function vIe(t){return typeof t=="string"?new RegExp(mIe(t),"g"):t}function yIe(t){return typeof t=="function"?t:function(){return t}}const $D="phrasing",ZD=["autolink","link","image","label"];function xIe(){return{transforms:[AIe],enter:{literalAutolink:SIe,literalAutolinkEmail:QD,literalAutolinkHttp:QD,literalAutolinkWww:QD},exit:{literalAutolink:TIe,literalAutolinkEmail:MIe,literalAutolinkHttp:wIe,literalAutolinkWww:EIe}}}function _Ie(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$D,notInConstruct:ZD},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$D,notInConstruct:ZD},{character:":",before:"[ps]",after:"\\/",inConstruct:$D,notInConstruct:ZD}]}}function SIe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function QD(t){this.config.enter.autolinkProtocol.call(this,t)}function wIe(t){this.config.exit.autolinkProtocol.call(this,t)}function EIe(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function MIe(t){this.config.exit.autolinkEmail.call(this,t)}function TIe(t){this.exit(t)}function AIe(t){gIe(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,CIe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),RIe]],{ignore:["link","linkReference"]})}function CIe(t,e,n,i,r){let a="";if(!Eee(r)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!kIe(n)))return!1;const s=DIe(n+i);if(!s[0])return!1;const o={type:"link",title:null,url:a+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function RIe(t,e,n,i){return!Eee(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function kIe(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function DIe(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=pT(t,"(");let a=pT(t,")");for(;i!==-1&&r>a;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[t,n]}function Eee(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||xo(n)||kC(n))&&(!e||n!==47)}Mee.peek=zIe;function OIe(){this.buffer()}function IIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function NIe(){this.buffer()}function LIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function PIe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vu(this.sliceSerialize(t)).toLowerCase(),n.label=e}function UIe(t){this.exit(t)}function FIe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vu(this.sliceSerialize(t)).toLowerCase(),n.label=e}function BIe(t){this.exit(t)}function zIe(){return"["}function Mee(t,e,n,i){const r=n.createTracker(i);let a=r.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=r.move(n.safe(n.associationId(t),{after:"]",before:a})),o(),s(),a+=r.move("]"),a}function jIe(){return{enter:{gfmFootnoteCallString:OIe,gfmFootnoteCall:IIe,gfmFootnoteDefinitionLabelString:NIe,gfmFootnoteDefinition:LIe},exit:{gfmFootnoteCallString:PIe,gfmFootnoteCall:UIe,gfmFootnoteDefinitionLabelString:FIe,gfmFootnoteDefinition:BIe}}}function HIe(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mee},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,a,s){const o=a.createTracker(s);let l=o.move("[^");const c=a.enter("footnoteDefinition"),u=a.enter("label");return l+=o.move(a.safe(a.associationId(i),{before:l,after:"]"})),u(),l+=o.move("]:"),i.children&&i.children.length>0&&(o.shift(4),l+=o.move((e?`
`:" ")+a.indentLines(a.containerFlow(i,o.current()),e?Tee:VIe))),c(),l}}function VIe(t,e,n){return e===0?t:Tee(t,e,n)}function Tee(t,e,n){return(n?"":"    ")+t}const GIe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Aee.peek=YIe;function WIe(){return{canContainEols:["delete"],enter:{strikethrough:qIe},exit:{strikethrough:KIe}}}function XIe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GIe}],handlers:{delete:Aee}}}function qIe(t){this.enter({type:"delete",children:[]},t)}function KIe(t){this.exit(t)}function Aee(t,e,n,i){const r=n.createTracker(i),a=n.enter("strikethrough");let s=r.move("~~");return s+=n.containerPhrasing(t,{...r.current(),before:s,after:"~"}),s+=r.move("~~"),a(),s}function YIe(){return"~"}function JIe(t){return t.length}function $Ie(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||JIe,a=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<t.length;){const b=[],y=[];let p=-1;for(t[u].length>c&&(c=t[u].length);++p<t[u].length;){const x=ZIe(t[u][p]);if(n.alignDelimiters!==!1){const _=r(x);y[p]=_,(l[p]===void 0||_>l[p])&&(l[p]=_)}b.push(x)}s[u]=b,o[u]=y}let f=-1;if(typeof i=="object"&&"length"in i)for(;++f<c;)a[f]=cV(i[f]);else{const b=cV(i);for(;++f<c;)a[f]=b}f=-1;const h=[],d=[];for(;++f<c;){const b=a[f];let y="",p="";b===99?(y=":",p=":"):b===108?y=":":b===114&&(p=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-p.length);const _=y+"-".repeat(x)+p;n.alignDelimiters!==!1&&(x=y.length+x+p.length,x>l[f]&&(l[f]=x),d[f]=x),h[f]=_}s.splice(1,0,h),o.splice(1,0,d),u=-1;const g=[];for(;++u<s.length;){const b=s[u],y=o[u];f=-1;const p=[];for(;++f<c;){const x=b[f]||"";let _="",w="";if(n.alignDelimiters!==!1){const M=l[f]-(y[f]||0),S=a[f];S===114?_=" ".repeat(M):S===99?M%2?(_=" ".repeat(M/2+.5),w=" ".repeat(M/2-.5)):(_=" ".repeat(M/2),w=_):w=" ".repeat(M)}n.delimiterStart!==!1&&!f&&p.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||f)&&p.push(" "),n.alignDelimiters!==!1&&p.push(_),p.push(x),n.alignDelimiters!==!1&&p.push(w),n.padding!==!1&&p.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&p.push("|")}g.push(n.delimiterEnd===!1?p.join("").replace(/ +$/,""):p.join(""))}return g.join(`
`)}function ZIe(t){return t==null?"":String(t)}function cV(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function QIe(t,e,n,i){const r=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(t,a.current()),eNe);return r(),s}function eNe(t,e,n){return">"+(n?"":" ")+t}function tNe(t,e){return uV(t,e.inConstruct,!0)&&!uV(t,e.notInConstruct,!1)}function uV(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function fV(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
`&&tNe(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
`}function nNe(t,e){const n=String(t);let i=n.indexOf(e),r=i,a=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++a>s&&(s=a):a=1,r=i+e.length,i=n.indexOf(e,r);return s}function iNe(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function rNe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function aNe(t,e,n,i){const r=rNe(n),a=t.value||"",s=r==="`"?"GraveAccent":"Tilde";if(iNe(t,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,sNe);return f(),h}const o=n.createTracker(i),l=r.repeat(Math.max(nNe(a,r)+1,3)),c=n.enter("codeFenced");let u=o.move(l);if(t.lang){const f=n.enter(`codeFencedLang${s}`);u+=o.move(n.safe(t.lang,{before:u,after:" ",encode:["`"],...o.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(n.safe(t.meta,{before:u,after:`
`,encode:["`"],...o.current()})),f()}return u+=o.move(`
`),a&&(u+=o.move(a+`
`)),u+=o.move(l),c(),u}function sNe(t,e,n){return(n?"":"    ")+t}function l4(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function oNe(t,e,n,i){const r=l4(n),a=r==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":`
`,...l.current()}))),o(),t.title&&(o=n.enter(`title${a}`),c+=l.move(" "+r),c+=l.move(n.safe(t.title,{before:c,after:r,...l.current()})),c+=l.move(r),o()),s(),c}function lNe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function n_(t){return"&#x"+t.toString(16).toUpperCase()+";"}function yT(t,e,n){const i=gv(t),r=gv(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Cee.peek=cNe;function Cee(t,e,n,i){const r=lNe(n),a=n.enter("emphasis"),s=n.createTracker(i),o=s.move(r);let l=s.move(n.containerPhrasing(t,{after:r,before:o,...s.current()}));const c=l.charCodeAt(0),u=yT(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=n_(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=yT(i.after.charCodeAt(0),f,r);h.inside&&(l=l.slice(0,-1)+n_(f));const d=s.move(r);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+d}function cNe(t,e,n){return n.options.emphasis||"*"}function uNe(t,e){let n=!1;return rS(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,UI}),!!((!t.depth||t.depth<3)&&t4(t)&&(e.options.setext||n))}function fNe(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),a=n.createTracker(i);if(uNe(t,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(t,{...a.current(),before:`
`,after:`
`});return f(),u(),h+`
`+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
`))+1))}const s="#".repeat(r),o=n.enter("headingAtx"),l=n.enter("phrasing");a.move(s+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(c)&&(c=n_(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),o(),c}Ree.peek=hNe;function Ree(t){return t.value||""}function hNe(){return"<"}kee.peek=dNe;function kee(t,e,n,i){const r=l4(n),a=r==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=n.enter(`title${a}`),c+=l.move(" "+r),c+=l.move(n.safe(t.title,{before:c,after:r,...l.current()})),c+=l.move(r),o()),c+=l.move(")"),s(),c}function dNe(){return"!"}Dee.peek=pNe;function Dee(t,e,n,i){const r=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(i);let l=o.move("![");const c=n.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...o.current()});return s(),n.stack=u,a(),r==="full"||!c||c!==f?l+=o.move(f+"]"):r==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function pNe(){return"!"}Oee.peek=mNe;function Oee(t,e,n){let i=t.value||"",r="`",a=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(i);){let c=l.index;i.charCodeAt(c)===10&&i.charCodeAt(c-1)===13&&c--,i=i.slice(0,c)+" "+i.slice(l.index+1)}}return r+i+r}function mNe(){return"`"}function Iee(t,e){const n=t4(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Nee.peek=gNe;function Nee(t,e,n,i){const r=l4(n),a=r==='"'?"Quote":"Apostrophe",s=n.createTracker(i);let o,l;if(Iee(t,n)){const u=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=u,f}o=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=n.enter(`title${a}`),c+=s.move(" "+r),c+=s.move(n.safe(t.title,{before:c,after:r,...s.current()})),c+=s.move(r),l()),c+=s.move(")"),o(),c}function gNe(t,e,n){return Iee(t,n)?"<":"["}Lee.peek=bNe;function Lee(t,e,n,i){const r=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(i);let l=o.move("[");const c=n.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...o.current()});return s(),n.stack=u,a(),r==="full"||!c||c!==f?l+=o.move(f+"]"):r==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function bNe(){return"["}function c4(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function vNe(t){const e=c4(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function yNe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Pee(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function xNe(t,e,n,i){const r=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?yNe(n):c4(n);const o=t.ordered?s==="."?")":".":vNe(n);let l=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Pee(n)===s&&u){let f=-1;for(;++f<t.children.length;){const h=t.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),n.bulletCurrent=s;const c=n.containerFlow(t,i);return n.bulletLastUsed=s,n.bulletCurrent=a,r(),c}function _Ne(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function SNe(t,e,n,i){const r=_Ne(n);let a=n.bulletCurrent||c4(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(i);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(t,o.current()),u);return l(),c;function u(f,h,d){return h?(d?"":" ".repeat(s))+f:(d?a:a+" ".repeat(s-a.length))+f}}function wNe(t,e,n,i){const r=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,i);return a(),r(),s}const ENe=IC(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MNe(t,e,n,i){return(t.children.some(function(s){return ENe(s)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function TNe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Uee.peek=ANe;function Uee(t,e,n,i){const r=TNe(n),a=n.enter("strong"),s=n.createTracker(i),o=s.move(r+r);let l=s.move(n.containerPhrasing(t,{after:r,before:o,...s.current()}));const c=l.charCodeAt(0),u=yT(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=n_(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=yT(i.after.charCodeAt(0),f,r);h.inside&&(l=l.slice(0,-1)+n_(f));const d=s.move(r+r);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+d}function ANe(t,e,n){return n.options.strong||"*"}function CNe(t,e,n,i){return n.safe(t.value,i)}function RNe(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function kNe(t,e,n){const i=(Pee(n)+(n.options.ruleSpaces?" ":"")).repeat(RNe(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Fee={blockquote:QIe,break:fV,code:aNe,definition:oNe,emphasis:Cee,hardBreak:fV,heading:fNe,html:Ree,image:kee,imageReference:Dee,inlineCode:Oee,link:Nee,linkReference:Lee,list:xNe,listItem:SNe,paragraph:wNe,root:MNe,strong:Uee,text:CNe,thematicBreak:kNe};function DNe(){return{enter:{table:ONe,tableData:hV,tableHeader:hV,tableRow:NNe},exit:{codeText:LNe,table:INe,tableData:e8,tableHeader:e8,tableRow:e8}}}function ONe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function INe(t){this.exit(t),this.data.inTable=void 0}function NNe(t){this.enter({type:"tableRow",children:[]},t)}function e8(t){this.exit(t)}function hV(t){this.enter({type:"tableCell",children:[]},t)}function LNe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,PNe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function PNe(t,e){return e==="|"?e:t}function UNe(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:o}};function s(d,g,b,y){return c(u(d,b,y),d.align)}function o(d,g,b,y){const p=f(d,b,y),x=c([p]);return x.slice(0,x.indexOf(`
`))}function l(d,g,b,y){const p=b.enter("tableCell"),x=b.enter("phrasing"),_=b.containerPhrasing(d,{...y,before:a,after:a});return x(),p(),_}function c(d,g){return $Ie(d,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function u(d,g,b){const y=d.children;let p=-1;const x=[],_=g.enter("table");for(;++p<y.length;)x[p]=f(y[p],g,b);return _(),x}function f(d,g,b){const y=d.children;let p=-1;const x=[],_=g.enter("tableRow");for(;++p<y.length;)x[p]=l(y[p],d,g,b);return _(),x}function h(d,g,b){let y=Fee.inlineCode(d,g,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function FNe(){return{exit:{taskListCheckValueChecked:dV,taskListCheckValueUnchecked:dV,paragraph:zNe}}}function BNe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jNe}}}function dV(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function zNe(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=e.children;let a=-1,s;for(;++a<r.length;){const o=r[a];if(o.type==="paragraph"){s=o;break}}s===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function jNe(t,e,n,i){const r=t.children[0],a=typeof t.checked=="boolean"&&r&&r.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",o=n.createTracker(i);a&&o.move(s);let l=Fee.listItem(t,e,n,{...i,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function HNe(){return[xIe(),jIe(),WIe(),DNe(),FNe()]}function VNe(t){return{extensions:[_Ie(),HIe(t),XIe(),UNe(t),BNe()]}}const GNe={tokenize:JNe,partial:!0},Bee={tokenize:$Ne,partial:!0},zee={tokenize:ZNe,partial:!0},jee={tokenize:QNe,partial:!0},WNe={tokenize:eLe,partial:!0},Hee={name:"wwwAutolink",tokenize:KNe,previous:Gee},Vee={name:"protocolAutolink",tokenize:YNe,previous:Wee},Ch={name:"emailAutolink",tokenize:qNe,previous:Xee},_f={};function XNe(){return{text:_f}}let Gp=48;for(;Gp<123;)_f[Gp]=Ch,Gp++,Gp===58?Gp=65:Gp===91&&(Gp=97);_f[43]=Ch;_f[45]=Ch;_f[46]=Ch;_f[95]=Ch;_f[72]=[Ch,Vee];_f[104]=[Ch,Vee];_f[87]=[Ch,Hee];_f[119]=[Ch,Hee];function qNe(t,e,n){const i=this;let r,a;return s;function s(f){return!zI(f)||!Xee.call(i,i.previous)||u4(i.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(f))}function o(f){return zI(f)?(t.consume(f),o):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check(WNe,u,c)(f):f===45||f===95||ro(f)?(a=!0,t.consume(f),l):u(f)}function c(f){return t.consume(f),r=!0,l}function u(f){return a&&r&&to(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function KNe(t,e,n){const i=this;return r;function r(s){return s!==87&&s!==119||!Gee.call(i,i.previous)||u4(i.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(GNe,t.attempt(Bee,t.attempt(zee,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function YNe(t,e,n){const i=this;let r="",a=!1;return s;function s(f){return(f===72||f===104)&&Wee.call(i,i.previous)&&!u4(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(f),t.consume(f),o):n(f)}function o(f){if(to(f)&&r.length<5)return r+=String.fromCodePoint(f),t.consume(f),o;if(f===58){const h=r.toLowerCase();if(h==="http"||h==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),a?c:(a=!0,l)):n(f)}function c(f){return f===null||mT(f)||zi(f)||xo(f)||kC(f)?n(f):t.attempt(Bee,t.attempt(zee,u),n)(f)}function u(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function JNe(t,e,n){let i=0;return r;function r(s){return(s===87||s===119)&&i<3?(i++,t.consume(s),r):s===46&&i===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function $Ne(t,e,n){let i,r,a;return s;function s(c){return c===46||c===95?t.check(jee,l,o)(c):c===null||zi(c)||xo(c)||c!==45&&kC(c)?l(c):(a=!0,t.consume(c),s)}function o(c){return c===95?i=!0:(r=i,i=void 0),t.consume(c),s}function l(c){return r||i||!a?n(c):e(c)}}function ZNe(t,e){let n=0,i=0;return r;function r(s){return s===40?(n++,t.consume(s),r):s===41&&i<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(jee,e,a)(s):s===null||zi(s)||xo(s)?e(s):(t.consume(s),r)}function a(s){return s===41&&i++,t.consume(s),r}}function QNe(t,e,n){return i;function i(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),i):o===38?(t.consume(o),a):o===93?(t.consume(o),r):o===60||o===null||zi(o)||xo(o)?e(o):n(o)}function r(o){return o===null||o===40||o===91||zi(o)||xo(o)?e(o):i(o)}function a(o){return to(o)?s(o):n(o)}function s(o){return o===59?(t.consume(o),i):to(o)?(t.consume(o),s):n(o)}}function eLe(t,e,n){return i;function i(a){return t.consume(a),r}function r(a){return ro(a)?n(a):e(a)}}function Gee(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||zi(t)}function Wee(t){return!to(t)}function Xee(t){return!(t===47||zI(t))}function zI(t){return t===43||t===45||t===46||t===95||ro(t)}function u4(t){let e=t.length,n=!1;for(;e--;){const i=t[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tLe={tokenize:cLe,partial:!0};function nLe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sLe,continuation:{tokenize:oLe},exit:lLe}},text:{91:{name:"gfmFootnoteCall",tokenize:aLe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iLe,resolveTo:rLe}}}}function iLe(t,e,n){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;r--;){const l=i.events[r][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const c=vu(i.sliceSerialize({start:s.end,end:i.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function rLe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...o),t}function aLe(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(f){if(a>999||f===93&&!s||f===null||f===91||zi(f))return n(f);if(f===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return r.includes(vu(i.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return zi(f)||(s=!0),a++,t.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(t.consume(f),a++,c):c(f)}}function sLe(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):n(g)}function u(g){if(s>999||g===93&&!o||g===null||g===91||zi(g))return n(g);if(g===93){t.exit("chunkString");const b=t.exit("gfmFootnoteDefinitionLabelString");return a=vu(i.sliceSerialize(b)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return zi(g)||(o=!0),s++,t.consume(g),g===92?f:u}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,u):u(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),r.includes(a)||r.push(a),Oi(t,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return e(g)}}function oLe(t,e,n){return t.check(ay,e,t.attempt(tLe,e,n))}function lLe(t){t.exit("gfmFootnoteDefinition")}function cLe(t,e,n){const i=this;return Oi(t,r,"gfmFootnoteDefinitionIndent",5);function r(a){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function uLe(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",u,o],["enter",s[c][1],o],["exit",s[c][1],o],["enter",f,o]],d=o.parser.constructs.insideSpan.null;d&&Tl(h,h.length,0,DC(d,s.slice(c+1,l),o)),Tl(h,h.length,0,[["exit",f,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",u,o]]),Tl(s,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const c=this.previous,u=this.events;let f=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const b=gv(c);if(g===126)return f>1?l(g):(s.consume(g),f++,d);if(f<2&&!n)return l(g);const y=s.exit("strikethroughSequenceTemporary"),p=gv(g);return y._open=!p||p===2&&!!b,y._close=!b||b===2&&!!p,o(g)}}}class fLe{constructor(){this.map=[]}add(e,n,i){hLe(this,e,n,i)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const a of r)e.push(a);r=i.pop()}this.map.length=0}}function hLe(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function dLe(t,e){let n=!1;const i=[];for(;e<t.length;){const r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function pLe(){return{flow:{null:{name:"table",tokenize:mLe,resolveAll:gLe}}}}function mLe(t,e,n){const i=this;let r=0,a=0,s;return o;function o(R){let N=i.events.length-1;for(;N>-1;){const z=i.events[N][1].type;if(z==="lineEnding"||z==="linePrefix")N--;else break}const P=N>-1?i.events[N][1].type:null,j=P==="tableHead"||P==="tableRow"?S:l;return j===S&&i.parser.lazy[i.now().line]?n(R):j(R)}function l(R){return t.enter("tableHead"),t.enter("tableRow"),c(R)}function c(R){return R===124||(s=!0,a+=1),u(R)}function u(R){return R===null?n(R):bn(R)?a>1?(a=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),d):n(R):ii(R)?Oi(t,u,"whitespace")(R):(a+=1,s&&(s=!1,r+=1),R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),s=!0,u):(t.enter("data"),f(R)))}function f(R){return R===null||R===124||zi(R)?(t.exit("data"),u(R)):(t.consume(R),R===92?h:f)}function h(R){return R===92||R===124?(t.consume(R),f):f(R)}function d(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(t.enter("tableDelimiterRow"),s=!1,ii(R)?Oi(t,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):g(R))}function g(R){return R===45||R===58?y(R):R===124?(s=!0,t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),b):M(R)}function b(R){return ii(R)?Oi(t,y,"whitespace")(R):y(R)}function y(R){return R===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),p):R===45?(a+=1,p(R)):R===null||bn(R)?w(R):M(R)}function p(R){return R===45?(t.enter("tableDelimiterFiller"),x(R)):M(R)}function x(R){return R===45?(t.consume(R),x):R===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),_):(t.exit("tableDelimiterFiller"),_(R))}function _(R){return ii(R)?Oi(t,w,"whitespace")(R):w(R)}function w(R){return R===124?g(R):R===null||bn(R)?!s||r!==a?M(R):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(R)):M(R)}function M(R){return n(R)}function S(R){return t.enter("tableRow"),A(R)}function A(R){return R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),A):R===null||bn(R)?(t.exit("tableRow"),e(R)):ii(R)?Oi(t,A,"whitespace")(R):(t.enter("data"),C(R))}function C(R){return R===null||R===124||zi(R)?(t.exit("data"),A(R)):(t.consume(R),R===92?k:C)}function k(R){return R===92||R===124?(t.consume(R),C):C(R)}}function gLe(t,e){let n=-1,i=!0,r=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,c,u,f;const h=new fLe;for(;++n<t.length;){const d=t[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(pV(h,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(i=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,e]])),r=g.type==="tableDelimiterRow"?2:u?3:1):r&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=TE(h,e,a,r,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(s[0]=s[1],f=TE(h,e,a,r,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,a[1]!==0?(s[0]=s[1],f=TE(h,e,a,r,n,f)):s[1]!==0&&(f=TE(h,e,s,r,n,f)),r=0):r&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&pV(h,e,l,c,u),h.consume(e.events),n=-1;++n<e.events.length;){const d=e.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=dLe(e.events,n))}return t}function TE(t,e,n,i,r,a){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Vb(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const l=Vb(e.events,n[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const c=Vb(e.events,n[2]),u=Vb(e.events,n[3]),f={type:o,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(n[2],0,[["enter",f,e]]),i!==2){const h=e.events[n[2]],d=e.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;t.add(g,b,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return r!==void 0&&(a.end=Object.assign({},Vb(e.events,r)),t.add(r,0,[["exit",a,e]]),a=void 0),a}function pV(t,e,n,i,r){const a=[],s=Vb(e.events,n);r&&(r.end=Object.assign({},s),a.push(["exit",r,e])),i.end=Object.assign({},s),a.push(["exit",i,e]),t.add(n+1,0,a)}function Vb(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const bLe={name:"tasklistCheck",tokenize:yLe};function vLe(){return{text:{91:bLe}}}function yLe(t,e,n){const i=this;return r;function r(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return zi(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(l)}function o(l){return bn(l)?e(l):ii(l)?t.check({tokenize:xLe},e,n)(l):n(l)}}function xLe(t,e,n){return Oi(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function _Le(t){return e4([XNe(),nLe(),uLe(t),pLe(),vLe()])}const SLe={};function wLe(t){const e=this,n=t||SLe,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(_Le(n)),a.push(HNe()),s.push(VNe(n))}const ELe=function(t){return MLe(t)};function MLe(t){return TLe(e);function e(n){return n&&n.type===t}}function TLe(t){return e;function e(n,...i){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...i))}}const ALe=!0,mV=!1,CLe="skip",RLe=function(t,e,n,i){const r=ELe(e),a=1;s(t,void 0,[])();function s(o,l,c){const u=o&&typeof o=="object"?o:{};if(typeof u.type=="string"){const h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=[],d,g,b;if(r(o,l,c[c.length-1]||null)&&(h=kLe(n(o,c)),h[0]===mV))return h;if(o.children&&h[0]!==CLe)for(g=-1+a,b=c.concat(o);g>-1&&g<o.children.length;){if(d=s(o.children[g],g,b)(),d[0]===mV)return d;g=typeof d[1]=="number"?d[1]:g+a}return h}}};function kLe(t){return Array.isArray(t)?t:typeof t=="number"?[ALe,t]:[t]}const DLe=function(t,e,n,i){RLe(t,e,r);function r(a,s){const o=s[s.length-1];return n(a,o?o.children.indexOf(a):null,o)}};function OLe(t){return"children"in t?qee(t):"value"in t?t.value:""}function ILe(t){return t.type==="text"?t.value:"children"in t?qee(t):""}function qee(t){let e=-1;const n=[];for(;++e<t.children.length;)n[e]=ILe(t.children[e]);return n.join("")}function f4(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Kee(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function aS(){}var i_=.7,xT=1/i_,C0="\\s*([+-]?\\d+)\\s*",r_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",NLe=/^#([0-9a-f]{3,8})$/,LLe=new RegExp(`^rgb\\(${C0},${C0},${C0}\\)$`),PLe=new RegExp(`^rgb\\(${lf},${lf},${lf}\\)$`),ULe=new RegExp(`^rgba\\(${C0},${C0},${C0},${r_}\\)$`),FLe=new RegExp(`^rgba\\(${lf},${lf},${lf},${r_}\\)$`),BLe=new RegExp(`^hsl\\(${r_},${lf},${lf}\\)$`),zLe=new RegExp(`^hsla\\(${r_},${lf},${lf},${r_}\\)$`),gV={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};f4(aS,LC,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:bV,formatHex:bV,formatHex8:jLe,formatHsl:HLe,formatRgb:vV,toString:vV});function bV(){return this.rgb().formatHex()}function jLe(){return this.rgb().formatHex8()}function HLe(){return Yee(this).formatHsl()}function vV(){return this.rgb().formatRgb()}function LC(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=NLe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?yV(e):n===3?new jo(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?AE(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?AE(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=LLe.exec(t))?new jo(e[1],e[2],e[3],1):(e=PLe.exec(t))?new jo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ULe.exec(t))?AE(e[1],e[2],e[3],e[4]):(e=FLe.exec(t))?AE(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=BLe.exec(t))?SV(e[1],e[2]/100,e[3]/100,1):(e=zLe.exec(t))?SV(e[1],e[2]/100,e[3]/100,e[4]):gV.hasOwnProperty(t)?yV(gV[t]):t==="transparent"?new jo(NaN,NaN,NaN,0):null}function yV(t){return new jo(t>>16&255,t>>8&255,t&255,1)}function AE(t,e,n,i){return i<=0&&(t=e=n=NaN),new jo(t,e,n,i)}function VLe(t){return t instanceof aS||(t=LC(t)),t?(t=t.rgb(),new jo(t.r,t.g,t.b,t.opacity)):new jo}function GLe(t,e,n,i){return arguments.length===1?VLe(t):new jo(t,e,n,i??1)}function jo(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}f4(jo,GLe,Kee(aS,{brighter(t){return t=t==null?xT:Math.pow(xT,t),new jo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?i_:Math.pow(i_,t),new jo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new jo(Um(this.r),Um(this.g),Um(this.b),_T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xV,formatHex:xV,formatHex8:WLe,formatRgb:_V,toString:_V}));function xV(){return`#${vm(this.r)}${vm(this.g)}${vm(this.b)}`}function WLe(){return`#${vm(this.r)}${vm(this.g)}${vm(this.b)}${vm((isNaN(this.opacity)?1:this.opacity)*255)}`}function _V(){const t=_T(this.opacity);return`${t===1?"rgb(":"rgba("}${Um(this.r)}, ${Um(this.g)}, ${Um(this.b)}${t===1?")":`, ${t})`}`}function _T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Um(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vm(t){return t=Um(t),(t<16?"0":"")+t.toString(16)}function SV(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new lu(t,e,n,i)}function Yee(t){if(t instanceof lu)return new lu(t.h,t.s,t.l,t.opacity);if(t instanceof aS||(t=LC(t)),!t)return new lu;if(t instanceof lu)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),s=NaN,o=a-r,l=(a+r)/2;return o?(e===a?s=(n-i)/o+(n<i)*6:n===a?s=(i-e)/o+2:s=(e-n)/o+4,o/=l<.5?a+r:2-a-r,s*=60):o=l>0&&l<1?0:s,new lu(s,o,l,t.opacity)}function XLe(t,e,n,i){return arguments.length===1?Yee(t):new lu(t,e,n,i??1)}function lu(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}f4(lu,XLe,Kee(aS,{brighter(t){return t=t==null?xT:Math.pow(xT,t),new lu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?i_:Math.pow(i_,t),new lu(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new jo(t8(t>=240?t-240:t+120,r,i),t8(t,r,i),t8(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new lu(wV(this.h),CE(this.s),CE(this.l),_T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=_T(this.opacity);return`${t===1?"hsl(":"hsla("}${wV(this.h)}, ${CE(this.s)*100}%, ${CE(this.l)*100}%${t===1?")":`, ${t})`}`}}));function wV(t){return t=(t||0)%360,t<0?t+360:t}function CE(t){return Math.max(0,Math.min(1,t||0))}function t8(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function qLe(t){return t===void 0&&(t={customClassName:"gfm-color-chip"}),function(e){DLe(e,"element",function(n){if(n.tagName==="code"&&n.properties){var i=OLe(n),r=LC(i);r&&n.children.push({type:"element",tagName:"span",properties:{className:[t.customClassName],style:"background-color: "+r.formatHex()+";"},children:[]})}})}}function KLe(){return t=>{rS(t,"element",(e,n,i)=>{e.tagName==="code"&&i&&i.type==="element"&&i.tagName==="pre"&&(e.properties={block:!0,...e.properties})})}}function YLe(t){return D.jsx(bu,{...t})}function JLe(t){return D.jsx(Dm,{...t})}function Nb(t,e){return D.jsx(PA,{order:e,...t})}function EV(t,e,n){return t.className=="contains-task-list"?D.jsx(J0,{type:n,...t,listStyleType:"none",children:e}):D.jsx(J0,{type:n,...t,children:e})}function $Le(t,e){return D.jsx(J0.Item,{...t,children:e})}function ZLe(t,e){return D.jsx(mP,{...t,children:e})}function QLe(t){return D.jsx(fP,{...t})}function ePe(t){return D.jsx("cite",{style:{display:"block",fontSize:"0.875rem",marginTop:"0.625rem",color:"#909296",overflow:"hidden",textOverflow:"ellipsis"},...t})}function tPe(t){return D.jsx(Nc,{...t,highlightOnHover:!0,withColumnBorders:!0})}function nPe(t){return D.jsx(I_,{maw:240,mx:"auto",radius:"md",...t})}const iPe={p:t=>YLe(t),a:t=>JLe(t),h1:t=>Nb(t,1),h2:t=>Nb(t,2),h3:t=>Nb(t,3),h4:t=>Nb(t,4),h5:t=>Nb(t,5),h6:t=>Nb(t,6),ul:t=>EV(t,t.children??"","unordered"),ol:t=>EV(t,t.children??"","ordered"),li:t=>$Le(t,t.children??""),code:t=>ZLe(t,t.children??""),pre:t=>D.jsx(D.Fragment,{children:t.children}),blockquote:t=>QLe(t),Cite:t=>ePe(t),table:t=>tPe(t),img:t=>nPe(t),"*":()=>D.jsx(D.Fragment,{})};async function rPe(t){const{default:e}=await pIe(t,{...Lre,...wCe,development:!1,remarkPlugins:[wLe],rehypePlugins:[KLe,qLe]});return e}function aPe(t){const[e,n]=I.useState(null);return I.useEffect(()=>{try{rPe(t.children??"").then(i=>{n(D.jsx(i,{components:iPe}))})}catch{n(D.jsx(PA,{order:2,children:"Error Parsing Markdown..."}))}},[t.children]),e}const sPe=I.createContext(null),n8={didCatch:!1,error:null};class oPe extends I.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=n8}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,i,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:a,reason:"imperative-api"}),this.setState(n8)}}componentDidCatch(e,n){var i,r;(i=(r=this.props).onError)===null||i===void 0||i.call(r,e,n)}componentDidUpdate(e,n){const{didCatch:i}=this.state,{resetKeys:r}=this.props;if(i&&n.error!==null&&lPe(e.resetKeys,r)){var a,s;(a=(s=this.props).onReset)===null||a===void 0||a.call(s,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(n8)}}render(){const{children:e,fallbackRender:n,FallbackComponent:i,fallback:r}=this.props,{didCatch:a,error:s}=this.state;let o=e;if(a){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(i)o=I.createElement(i,l);else if(r!==void 0)o=r;else throw s}return I.createElement(sPe.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},o)}}function lPe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,i)=>!Object.is(n,e[i]))}function cPe({props:{visible:t,_markdown:e}}){return t?D.jsx(st,{pb:"xs",px:"sm",style:{maxWidth:"95%"},children:D.jsx(oPe,{fallback:D.jsx(bu,{style:{textAlign:"center"},children:"Markdown Failed to Render"}),children:D.jsx(aPe,{children:e})})}):null}var h4="_3o7djo0",uPe="_3o7djo1",fPe="_3o7djo2";const MV=Ee.memo(function({jsonStr:e,aspectRatio:n,onExpand:i}){const[r,a]=Ee.useState(!1);if(e==="")return D.jsx("div",{});const s=JSON.parse(e);s.layout.uirevision="true";const{ref:o,width:l}=bq();s.layout.width=l,s.layout.height=l*n;const c=Ee.useRef(null);return Ee.useEffect(()=>{Plotly.react(c.current,s.data,s.layout,s.config)},[s]),D.jsxs(Ps,{ref:o,className:h4,withBorder:!0,style:{position:"relative"},onMouseEnter:i?()=>a(!0):void 0,onMouseLeave:i?()=>a(!1):void 0,children:[D.jsx("div",{ref:c}),i&&r&&D.jsx(Pr,{label:"Expand plot",children:D.jsx(Ol,{onClick:i,variant:"subtle",color:"gray",size:"sm",style:{position:"absolute",bottom:8,right:8,backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(4px)",zIndex:1001},children:D.jsx(EQ,{size:14})})})]})});function hPe({props:{visible:t,_plotly_json_str:e,aspect:n}}){if(!t)return null;const[i,{open:r,close:a}]=Ec(!1);return D.jsxs(st,{children:[D.jsx(MV,{jsonStr:e,aspectRatio:n,onExpand:r}),D.jsx(Ro,{opened:i,onClose:a,size:"xl",children:D.jsx(MV,{jsonStr:e,aspectRatio:n})})]})}var Jee={exports:{}};const dPe=!0,Ga="u-",pPe="uplot",mPe=Ga+"hz",gPe=Ga+"vt",bPe=Ga+"title",vPe=Ga+"wrap",yPe=Ga+"under",xPe=Ga+"over",_Pe=Ga+"axis",om=Ga+"off",SPe=Ga+"select",wPe=Ga+"cursor-x",EPe=Ga+"cursor-y",MPe=Ga+"cursor-pt",TPe=Ga+"legend",APe=Ga+"live",CPe=Ga+"inline",RPe=Ga+"series",kPe=Ga+"marker",TV=Ga+"label",DPe=Ga+"value",Ix="width",Nx="height",fx="top",AV="bottom",Lb="left",i8="right",d4="#000",CV=d4+"0",r8="mousemove",RV="mousedown",a8="mouseup",kV="mouseenter",DV="mouseleave",OV="dblclick",OPe="resize",IPe="scroll",IV="change",ST="dppxchange",p4="--",oy=typeof window<"u",jI=oy?document:null,R0=oy?window:null,NPe=oy?navigator:null;let Qi,RE;function HI(){let t=devicePixelRatio;Qi!=t&&(Qi=t,RE&&GI(IV,RE,HI),RE=matchMedia(`(min-resolution: ${Qi-.001}dppx) and (max-resolution: ${Qi+.001}dppx)`),Fm(IV,RE,HI),R0.dispatchEvent(new CustomEvent(ST)))}function pl(t,e){if(e!=null){let n=t.classList;!n.contains(e)&&n.add(e)}}function VI(t,e){let n=t.classList;n.contains(e)&&n.remove(e)}function zr(t,e,n){t.style[e]=n+"px"}function $c(t,e,n,i){let r=jI.createElement(t);return e!=null&&pl(r,e),n?.insertBefore(r,i),r}function Ql(t,e){return $c("div",t,e)}const NV=new WeakMap;function Hu(t,e,n,i,r){let a="translate("+e+"px,"+n+"px)",s=NV.get(t);a!=s&&(t.style.transform=a,NV.set(t,a),e<0||n<0||e>i||n>r?pl(t,om):VI(t,om))}const LV=new WeakMap;function PV(t,e,n){let i=e+n,r=LV.get(t);i!=r&&(LV.set(t,i),t.style.background=e,t.style.borderColor=n)}const UV=new WeakMap;function FV(t,e,n,i){let r=e+""+n,a=UV.get(t);r!=a&&(UV.set(t,r),t.style.height=n+"px",t.style.width=e+"px",t.style.marginLeft=i?-e/2+"px":0,t.style.marginTop=i?-n/2+"px":0)}const m4={passive:!0},LPe={...m4,capture:!0};function Fm(t,e,n,i){e.addEventListener(t,n,i?LPe:m4)}function GI(t,e,n,i){e.removeEventListener(t,n,m4)}oy&&HI();function tu(t,e,n,i){let r;n=n||0,i=i||e.length-1;let a=i<=2147483647;for(;i-n>1;)r=a?n+i>>1:Al((n+i)/2),e[r]<t?n=r:i=r;return t-e[n]<=e[i]-t?n:i}function $ee(t){return(n,i,r)=>{let a=-1,s=-1;for(let o=i;o<=r;o++)if(t(n[o])){a=o;break}for(let o=r;o>=i;o--)if(t(n[o])){s=o;break}return[a,s]}}const Zee=t=>t!=null,Qee=t=>t!=null&&t>0,PC=$ee(Zee),PPe=$ee(Qee);function UPe(t,e,n,i=0,r=!1){let a=r?PPe:PC,s=r?Qee:Zee;[e,n]=a(t,e,n);let o=t[e],l=t[e];if(e>-1)if(i==1)o=t[e],l=t[n];else if(i==-1)o=t[n],l=t[e];else for(let c=e;c<=n;c++){let u=t[c];s(u)&&(u<o?o=u:u>l&&(l=u))}return[o??Er,l??-Er]}function UC(t,e,n,i){let r=jV(t),a=jV(e);t==e&&(r==-1?(t*=n,e/=n):(t/=n,e*=n));let s=n==10?ch:ete,o=r==1?Al:ac,l=a==1?ac:Al,c=o(s(Ua(t))),u=l(s(Ua(e))),f=bv(n,c),h=bv(n,u);return n==10&&(c<0&&(f=Mr(f,-c)),u<0&&(h=Mr(h,-u))),i||n==2?(t=f*r,e=h*a):(t=rte(t,f),e=FC(e,h)),[t,e]}function g4(t,e,n,i){let r=UC(t,e,n,i);return t==0&&(r[0]=0),e==0&&(r[1]=0),r}const b4=.1,BV={mode:3,pad:b4},b1={pad:0,soft:null,mode:0},FPe={min:b1,max:b1};function wT(t,e,n,i){return BC(n)?zV(t,e,n):(b1.pad=n,b1.soft=i?0:null,b1.mode=i?3:0,zV(t,e,FPe))}function Yi(t,e){return t??e}function BPe(t,e,n){for(e=Yi(e,0),n=Yi(n,t.length-1);e<=n;){if(t[e]!=null)return!0;e++}return!1}function zV(t,e,n){let i=n.min,r=n.max,a=Yi(i.pad,0),s=Yi(r.pad,0),o=Yi(i.hard,-Er),l=Yi(r.hard,Er),c=Yi(i.soft,Er),u=Yi(r.soft,-Er),f=Yi(i.mode,0),h=Yi(r.mode,0),d=e-t,g=ch(d),b=To(Ua(t),Ua(e)),y=ch(b),p=Ua(y-g);(d<1e-24||p>10)&&(d=0,(t==0||e==0)&&(d=1e-24,f==2&&c!=Er&&(a=0),h==2&&u!=-Er&&(s=0)));let x=d||b||1e3,_=ch(x),w=bv(10,Al(_)),M=x*(d==0?t==0?.1:1:a),S=Mr(rte(t-M,w/10),24),A=t>=c&&(f==1||f==3&&S<=c||f==2&&S>=c)?c:Er,C=To(o,S<A&&t>=A?A:cu(A,S)),k=x*(d==0?e==0?.1:1:s),R=Mr(FC(e+k,w/10),24),N=e<=u&&(h==1||h==3&&R>=u||h==2&&R<=u)?u:-Er,P=cu(l,R>N&&e<=N?N:To(N,R));return C==P&&C==0&&(P=100),[C,P]}const zPe=new Intl.NumberFormat(oy?NPe.language:"en-US"),v4=t=>zPe.format(t),Nl=Math,wM=Nl.PI,Ua=Nl.abs,Al=Nl.floor,Pa=Nl.round,ac=Nl.ceil,cu=Nl.min,To=Nl.max,bv=Nl.pow,jV=Nl.sign,ch=Nl.log10,ete=Nl.log2,jPe=(t,e=1)=>Nl.sinh(t)*e,s8=(t,e=1)=>Nl.asinh(t/e),Er=1/0;function HV(t){return(ch((t^t>>31)-(t>>31))|0)+1}function WI(t,e,n){return cu(To(t,e),n)}function tte(t){return typeof t=="function"}function Ni(t){return tte(t)?t:()=>t}const HPe=()=>{},nte=t=>t,ite=(t,e)=>e,VPe=t=>null,VV=t=>!0,GV=(t,e)=>t==e,GPe=/\.\d*?(?=9{6,}|0{6,})/gm,eg=t=>{if(ste(t)||Kd.has(t))return t;const e=`${t}`,n=e.match(GPe);if(n==null)return t;let i=n[0].length-1;if(e.indexOf("e-")!=-1){let[r,a]=e.split("e");return+`${eg(r)}e${a}`}return Mr(t,i)};function tm(t,e){return eg(Mr(eg(t/e))*e)}function FC(t,e){return eg(ac(eg(t/e))*e)}function rte(t,e){return eg(Al(eg(t/e))*e)}function Mr(t,e=0){if(ste(t))return t;let n=10**e,i=t*n*(1+Number.EPSILON);return Pa(i)/n}const Kd=new Map;function ate(t){return((""+t).split(".")[1]||"").length}function a_(t,e,n,i){let r=[],a=i.map(ate);for(let s=e;s<n;s++){let o=Ua(s),l=Mr(bv(t,s),o);for(let c=0;c<i.length;c++){let u=t==10?+`${i[c]}e${s}`:i[c]*l,f=(s>=0?0:o)+(s>=a[c]?0:a[c]),h=t==10?u:Mr(u,f);r.push(h),Kd.set(h,f)}}return r}const v1={},y4=[],vv=[null,null],fd=Array.isArray,ste=Number.isInteger,WPe=t=>t===void 0;function WV(t){return typeof t=="string"}function BC(t){let e=!1;if(t!=null){let n=t.constructor;e=n==null||n==Object}return e}function XPe(t){return t!=null&&typeof t=="object"}const qPe=Object.getPrototypeOf(Uint8Array),ote="__proto__";function yv(t,e=BC){let n;if(fd(t)){let i=t.find(r=>r!=null);if(fd(i)||e(i)){n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=yv(t[r],e)}else n=t.slice()}else if(t instanceof qPe)n=t.slice();else if(e(t)){n={};for(let i in t)i!=ote&&(n[i]=yv(t[i],e))}else n=t;return n}function Aa(t){let e=arguments;for(let n=1;n<e.length;n++){let i=e[n];for(let r in i)r!=ote&&(BC(t[r])?Aa(t[r],yv(i[r])):t[r]=yv(i[r]))}return t}const KPe=0,YPe=1,JPe=2;function $Pe(t,e,n){for(let i=0,r,a=-1;i<e.length;i++){let s=e[i];if(s>a){for(r=s-1;r>=0&&t[r]==null;)t[r--]=null;for(r=s+1;r<n&&t[r]==null;)t[a=r++]=null}}}function ZPe(t,e){if(tUe(t)){let s=t[0].slice();for(let o=1;o<t.length;o++)s.push(...t[o].slice(1));return nUe(s[0])||(s=eUe(s)),s}let n=new Set;for(let s=0;s<t.length;s++){let l=t[s][0],c=l.length;for(let u=0;u<c;u++)n.add(l[u])}let i=[Array.from(n).sort((s,o)=>s-o)],r=i[0].length,a=new Map;for(let s=0;s<r;s++)a.set(i[0][s],s);for(let s=0;s<t.length;s++){let o=t[s],l=o[0];for(let c=1;c<o.length;c++){let u=o[c],f=Array(r).fill(void 0),h=e?e[s][c]:YPe,d=[];for(let g=0;g<u.length;g++){let b=u[g],y=a.get(l[g]);b===null?h!=KPe&&(f[y]=b,h==JPe&&d.push(y)):f[y]=b}$Pe(f,d,r),i.push(f)}}return i}const QPe=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask;function eUe(t){let e=t[0],n=e.length,i=Array(n);for(let a=0;a<i.length;a++)i[a]=a;i.sort((a,s)=>e[a]-e[s]);let r=[];for(let a=0;a<t.length;a++){let s=t[a],o=Array(n);for(let l=0;l<n;l++)o[l]=s[i[l]];r.push(o)}return r}function tUe(t){let e=t[0][0],n=e.length;for(let i=1;i<t.length;i++){let r=t[i][0];if(r.length!=n)return!1;if(r!=e){for(let a=0;a<n;a++)if(r[a]!=e[a])return!1}}return!0}function nUe(t,e=100){const n=t.length;if(n<=1)return!0;let i=0,r=n-1;for(;i<=r&&t[i]==null;)i++;for(;r>=i&&t[r]==null;)r--;if(r<=i)return!0;const a=To(1,Al((r-i+1)/e));for(let s=t[i],o=i+a;o<=r;o+=a){const l=t[o];if(l!=null){if(l<=s)return!1;s=l}}return!0}const lte=["January","February","March","April","May","June","July","August","September","October","November","December"],cte=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ute(t){return t.slice(0,3)}const iUe=cte.map(ute),rUe=lte.map(ute),aUe={MMMM:lte,MMM:rUe,WWWW:cte,WWW:iUe};function hx(t){return(t<10?"0":"")+t}function sUe(t){return(t<10?"00":t<100?"0":"")+t}const oUe={YYYY:t=>t.getFullYear(),YY:t=>(t.getFullYear()+"").slice(2),MMMM:(t,e)=>e.MMMM[t.getMonth()],MMM:(t,e)=>e.MMM[t.getMonth()],MM:t=>hx(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>hx(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>hx(t.getHours()),H:t=>t.getHours(),h:t=>{let e=t.getHours();return e==0?12:e>12?e-12:e},AA:t=>t.getHours()>=12?"PM":"AM",aa:t=>t.getHours()>=12?"pm":"am",a:t=>t.getHours()>=12?"p":"a",mm:t=>hx(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>hx(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>sUe(t.getMilliseconds())};function x4(t,e){e=e||aUe;let n=[],i=/\{([a-z]+)\}|[^{]+/gi,r;for(;r=i.exec(t);)n.push(r[0][0]=="{"?oUe[r[1]]:r[0]);return a=>{let s="";for(let o=0;o<n.length;o++)s+=typeof n[o]=="string"?n[o]:n[o](a,e);return s}}const lUe=new Intl.DateTimeFormat().resolvedOptions().timeZone;function cUe(t,e){let n;return e=="UTC"||e=="Etc/UTC"?n=new Date(+t+t.getTimezoneOffset()*6e4):e==lUe?n=t:(n=new Date(t.toLocaleString("en-US",{timeZone:e})),n.setMilliseconds(t.getMilliseconds())),n}const fte=t=>t%1==0,ET=[1,2,2.5,5],uUe=a_(10,-32,0,ET),hte=a_(10,0,32,ET),fUe=hte.filter(fte),nm=uUe.concat(hte),_4=`
`,dte="{YYYY}",XV=_4+dte,pte="{M}/{D}",Lx=_4+pte,kE=Lx+"/{YY}",mte="{aa}",hUe="{h}:{mm}",Gb=hUe+mte,qV=_4+Gb,KV=":{ss}",lr=null;function gte(t){let e=t*1e3,n=e*60,i=n*60,r=i*24,a=r*30,s=r*365,l=(t==1?a_(10,0,3,ET).filter(fte):a_(10,-3,0,ET)).concat([e,e*5,e*10,e*15,e*30,n,n*5,n*10,n*15,n*30,i,i*2,i*3,i*4,i*6,i*8,i*12,r,r*2,r*3,r*4,r*5,r*6,r*7,r*8,r*9,r*10,r*15,a,a*2,a*3,a*4,a*6,s,s*2,s*5,s*10,s*25,s*50,s*100]);const c=[[s,dte,lr,lr,lr,lr,lr,lr,1],[r*28,"{MMM}",XV,lr,lr,lr,lr,lr,1],[r,pte,XV,lr,lr,lr,lr,lr,1],[i,"{h}"+mte,kE,lr,Lx,lr,lr,lr,1],[n,Gb,kE,lr,Lx,lr,lr,lr,1],[e,KV,kE+" "+Gb,lr,Lx+" "+Gb,lr,qV,lr,1],[t,KV+".{fff}",kE+" "+Gb,lr,Lx+" "+Gb,lr,qV,lr,1]];function u(f){return(h,d,g,b,y,p)=>{let x=[],_=y>=s,w=y>=a&&y<s,M=f(g),S=Mr(M*t,3),A=o8(M.getFullYear(),_?0:M.getMonth(),w||_?1:M.getDate()),C=Mr(A*t,3);if(w||_){let k=w?y/a:0,R=_?y/s:0,N=S==C?S:Mr(o8(A.getFullYear()+R,A.getMonth()+k,1)*t,3),P=new Date(Pa(N/t)),j=P.getFullYear(),z=P.getMonth();for(let X=0;N<=b;X++){let F=o8(j+R*X,z+k*X,1),H=F-f(Mr(F*t,3));N=Mr((+F+H)*t,3),N<=b&&x.push(N)}}else{let k=y>=r?r:y,R=Al(g)-Al(S),N=C+R+FC(S-C,k);x.push(N);let P=f(N),j=P.getHours()+P.getMinutes()/n+P.getSeconds()/i,z=y/i,X=h.axes[d]._space,F=p/X;for(;N=Mr(N+y,t==1?0:3),!(N>b);)if(z>1){let H=Al(Mr(j+z,6))%24,B=f(N).getHours()-H;B>1&&(B=-1),N-=B*i,j=(j+z)%24;let Y=x[x.length-1];Mr((N-Y)/y,3)*F>=.7&&x.push(N)}else x.push(N)}return x}}return[l,c,u]}const[dUe,pUe,mUe]=gte(1),[gUe,bUe,vUe]=gte(.001);a_(2,-53,53,[1]);function YV(t,e){return t.map(n=>n.map((i,r)=>r==0||r==8||i==null?i:e(r==1||n[8]==0?i:n[1]+i)))}function JV(t,e){return(n,i,r,a,s)=>{let o=e.find(g=>s>=g[0])||e[e.length-1],l,c,u,f,h,d;return i.map(g=>{let b=t(g),y=b.getFullYear(),p=b.getMonth(),x=b.getDate(),_=b.getHours(),w=b.getMinutes(),M=b.getSeconds(),S=y!=l&&o[2]||p!=c&&o[3]||x!=u&&o[4]||_!=f&&o[5]||w!=h&&o[6]||M!=d&&o[7]||o[1];return l=y,c=p,u=x,f=_,h=w,d=M,S(b)})}}function yUe(t,e){let n=x4(e);return(i,r,a,s,o)=>r.map(l=>n(t(l)))}function o8(t,e,n){return new Date(t,e,n)}function $V(t,e){return e(t)}const xUe="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function ZV(t,e){return(n,i,r,a)=>a==null?p4:e(t(i))}function _Ue(t,e){let n=t.series[e];return n.width?n.stroke(t,e):n.points.width?n.points.stroke(t,e):null}function SUe(t,e){return t.series[e].fill(t,e)}const wUe={show:!0,live:!0,isolate:!1,mount:HPe,markers:{show:!0,width:2,stroke:_Ue,fill:SUe,dash:"solid"},idx:null,idxs:null,values:[]};function EUe(t,e){let n=t.cursor.points,i=Ql(),r=n.size(t,e);zr(i,Ix,r),zr(i,Nx,r);let a=r/-2;zr(i,"marginLeft",a),zr(i,"marginTop",a);let s=n.width(t,e,r);return s&&zr(i,"borderWidth",s),i}function MUe(t,e){let n=t.series[e].points;return n._fill||n._stroke}function TUe(t,e){let n=t.series[e].points;return n._stroke||n._fill}function AUe(t,e){return t.series[e].points.size}const l8=[0,0];function CUe(t,e,n){return l8[0]=e,l8[1]=n,l8}function DE(t,e,n,i=!0){return r=>{r.button==0&&(!i||r.target==e)&&n(r)}}function c8(t,e,n,i=!0){return r=>{(!i||r.target==e)&&n(r)}}const RUe={show:!0,x:!0,y:!0,lock:!1,move:CUe,points:{one:!1,show:EUe,size:AUe,width:0,stroke:TUe,fill:MUe},bind:{mousedown:DE,mouseup:DE,click:DE,dblclick:DE,mousemove:c8,mouseleave:c8,mouseenter:c8},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(t,e)=>{e.stopPropagation(),e.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(t,e,n,i,r)=>i-r,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},bte={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},S4=Aa({},bte,{filter:ite}),vte=Aa({},S4,{size:10}),yte=Aa({},bte,{show:!1}),w4='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',xte="bold "+w4,_te=1.5,QV={show:!0,scale:"x",stroke:d4,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:xte,side:2,grid:S4,ticks:vte,border:yte,font:w4,lineGap:_te,rotate:0},kUe="Value",DUe="Time",eG={show:!0,scale:"x",auto:!1,sorted:1,min:Er,max:-Er,idxs:[]};function OUe(t,e,n,i,r){return e.map(a=>a==null?"":v4(a))}function IUe(t,e,n,i,r,a,s){let o=[],l=Kd.get(r)||0;n=s?n:Mr(FC(n,r),l);for(let c=n;c<=i;c=Mr(c+r,l))o.push(Object.is(c,-0)?0:c);return o}function XI(t,e,n,i,r,a,s){const o=[],l=t.scales[t.axes[e].scale].log,c=l==10?ch:ete,u=Al(c(n));r=bv(l,u),l==10&&(r=nm[tu(r,nm)]);let f=n,h=r*l;l==10&&(h=nm[tu(h,nm)]);do o.push(f),f=f+r,l==10&&!Kd.has(f)&&(f=Mr(f,Kd.get(r))),f>=h&&(r=f,h=r*l,l==10&&(h=nm[tu(h,nm)]));while(f<=i);return o}function NUe(t,e,n,i,r,a,s){let l=t.scales[t.axes[e].scale].asinh,c=i>l?XI(t,e,To(l,n),i,r):[l],u=i>=0&&n<=0?[0]:[];return(n<-l?XI(t,e,To(l,-i),-n,r):[l]).reverse().map(h=>-h).concat(u,c)}const Ste=/./,LUe=/[12357]/,PUe=/[125]/,tG=/1/,qI=(t,e,n,i)=>t.map((r,a)=>e==4&&r==0||a%i==0&&n.test(r.toExponential()[r<0?1:0])?r:null);function UUe(t,e,n,i,r){let a=t.axes[n],s=a.scale,o=t.scales[s],l=t.valToPos,c=a._space,u=l(10,s),f=l(9,s)-u>=c?Ste:l(7,s)-u>=c?LUe:l(5,s)-u>=c?PUe:tG;if(f==tG){let h=Ua(l(1,s)-u);if(h<c)return qI(e.slice().reverse(),o.distr,f,ac(c/h)).reverse()}return qI(e,o.distr,f,1)}function FUe(t,e,n,i,r){let a=t.axes[n],s=a.scale,o=a._space,l=t.valToPos,c=Ua(l(1,s)-l(2,s));return c<o?qI(e.slice().reverse(),3,Ste,ac(o/c)).reverse():e}function BUe(t,e,n,i){return i==null?p4:e==null?"":v4(e)}const nG={show:!0,scale:"y",stroke:d4,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:xte,side:3,grid:S4,ticks:vte,border:yte,font:w4,lineGap:_te,rotate:0};function zUe(t,e){let n=3+(t||1)*2;return Mr(n*e,3)}function jUe(t,e){let{scale:n,idxs:i}=t.series[0],r=t._data[0],a=t.valToPos(r[i[0]],n,!0),s=t.valToPos(r[i[1]],n,!0),o=Ua(s-a),l=t.series[e],c=o/(l.points.space*Qi);return i[1]-i[0]<=c}const iG={scale:null,auto:!0,sorted:0,min:Er,max:-Er},wte=(t,e,n,i,r)=>r,rG={show:!0,auto:!0,sorted:0,gaps:wte,alpha:1,facets:[Aa({},iG,{scale:"x"}),Aa({},iG,{scale:"y"})]},aG={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:wte,alpha:1,points:{show:jUe,filter:null},values:null,min:Er,max:-Er,idxs:[],path:null,clip:null};function HUe(t,e,n,i,r){return n/10}const Ete={time:dPe,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},VUe=Aa({},Ete,{time:!1,ori:1}),sG={};function Mte(t,e){let n=sG[t];return n||(n={key:t,plots:[],sub(i){n.plots.push(i)},unsub(i){n.plots=n.plots.filter(r=>r!=i)},pub(i,r,a,s,o,l,c){for(let u=0;u<n.plots.length;u++)n.plots[u]!=r&&n.plots[u].pub(i,r,a,s,o,l,c)}},t!=null&&(sG[t]=n)),n}const xv=1,KI=2;function bg(t,e,n){const i=t.mode,r=t.series[e],a=i==2?t._data[e]:t._data,s=t.scales,o=t.bbox;let l=a[0],c=i==2?a[1]:a[e],u=i==2?s[r.facets[0].scale]:s[t.series[0].scale],f=i==2?s[r.facets[1].scale]:s[r.scale],h=o.left,d=o.top,g=o.width,b=o.height,y=t.valToPosH,p=t.valToPosV;return u.ori==0?n(r,l,c,u,f,y,p,h,d,g,b,jC,ly,VC,Ate,Rte):n(r,l,c,u,f,p,y,d,h,b,g,HC,cy,T4,Cte,kte)}function E4(t,e){let n=0,i=0,r=Yi(t.bands,y4);for(let a=0;a<r.length;a++){let s=r[a];s.series[0]==e?n=s.dir:s.series[1]==e&&(s.dir==1?i|=1:i|=2)}return[n,i==1?-1:i==2?1:i==3?2:0]}function GUe(t,e,n,i,r){let a=t.mode,s=t.series[e],o=a==2?s.facets[1].scale:s.scale,l=t.scales[o];return r==-1?l.min:r==1?l.max:l.distr==3?l.dir==1?l.min:l.max:0}function uh(t,e,n,i,r,a){return bg(t,e,(s,o,l,c,u,f,h,d,g,b,y)=>{let p=s.pxRound;const x=c.dir*(c.ori==0?1:-1),_=c.ori==0?ly:cy;let w,M;x==1?(w=n,M=i):(w=i,M=n);let S=p(f(o[w],c,b,d)),A=p(h(l[w],u,y,g)),C=p(f(o[M],c,b,d)),k=p(h(a==1?u.max:u.min,u,y,g)),R=new Path2D(r);return _(R,C,k),_(R,S,k),_(R,S,A),R})}function zC(t,e,n,i,r,a){let s=null;if(t.length>0){s=new Path2D;const o=e==0?VC:T4;let l=n;for(let f=0;f<t.length;f++){let h=t[f];if(h[1]>h[0]){let d=h[0]-l;d>0&&o(s,l,i,d,i+a),l=h[1]}}let c=n+r-l,u=10;c>0&&o(s,l,i-u/2,c,i+a+u)}return s}function WUe(t,e,n){let i=t[t.length-1];i&&i[0]==e?i[1]=n:t.push([e,n])}function M4(t,e,n,i,r,a,s){let o=[],l=t.length;for(let c=r==1?n:i;c>=n&&c<=i;c+=r)if(e[c]===null){let f=c,h=c;if(r==1)for(;++c<=i&&e[c]===null;)h=c;else for(;--c>=n&&e[c]===null;)h=c;let d=a(t[f]),g=h==f?d:a(t[h]),b=f-r;d=s<=0&&b>=0&&b<l?a(t[b]):d;let p=h+r;g=s>=0&&p>=0&&p<l?a(t[p]):g,g>=d&&o.push([d,g])}return o}function oG(t){return t==0?nte:t==1?Pa:e=>tm(e,t)}function Tte(t){let e=t==0?jC:HC,n=t==0?(r,a,s,o,l,c)=>{r.arcTo(a,s,o,l,c)}:(r,a,s,o,l,c)=>{r.arcTo(s,a,l,o,c)},i=t==0?(r,a,s,o,l)=>{r.rect(a,s,o,l)}:(r,a,s,o,l)=>{r.rect(s,a,l,o)};return(r,a,s,o,l,c=0,u=0)=>{c==0&&u==0?i(r,a,s,o,l):(c=cu(c,o/2,l/2),u=cu(u,o/2,l/2),e(r,a+c,s),n(r,a+o,s,a+o,s+l,c),n(r,a+o,s+l,a,s+l,u),n(r,a,s+l,a,s,u),n(r,a,s,a+o,s,c),r.closePath())}}const jC=(t,e,n)=>{t.moveTo(e,n)},HC=(t,e,n)=>{t.moveTo(n,e)},ly=(t,e,n)=>{t.lineTo(e,n)},cy=(t,e,n)=>{t.lineTo(n,e)},VC=Tte(0),T4=Tte(1),Ate=(t,e,n,i,r,a)=>{t.arc(e,n,i,r,a)},Cte=(t,e,n,i,r,a)=>{t.arc(n,e,i,r,a)},Rte=(t,e,n,i,r,a,s)=>{t.bezierCurveTo(e,n,i,r,a,s)},kte=(t,e,n,i,r,a,s)=>{t.bezierCurveTo(n,e,r,i,s,a)};function Dte(t){return(e,n,i,r,a)=>bg(e,n,(s,o,l,c,u,f,h,d,g,b,y)=>{let{pxRound:p,points:x}=s,_,w;c.ori==0?(_=jC,w=Ate):(_=HC,w=Cte);const M=Mr(x.width*Qi,3);let S=(x.size-x.width)/2*Qi,A=Mr(S*2,3),C=new Path2D,k=new Path2D,{left:R,top:N,width:P,height:j}=e.bbox;VC(k,R-A,N-A,P+A*2,j+A*2);const z=X=>{if(l[X]!=null){let F=p(f(o[X],c,b,d)),H=p(h(l[X],u,y,g));_(C,F+S,H),w(C,F,H,S,0,wM*2)}};if(a)a.forEach(z);else for(let X=i;X<=r;X++)z(X);return{stroke:M>0?C:null,fill:C,clip:k,flags:xv|KI}})}function Ote(t){return(e,n,i,r,a,s)=>{i!=r&&(a!=i&&s!=i&&t(e,n,i),a!=r&&s!=r&&t(e,n,r),t(e,n,s))}}const XUe=Ote(ly),qUe=Ote(cy);function Ite(t){const e=Yi(t?.alignGaps,0);return(n,i,r,a)=>bg(n,i,(s,o,l,c,u,f,h,d,g,b,y)=>{[r,a]=PC(l,r,a);let p=s.pxRound,x=j=>p(f(j,c,b,d)),_=j=>p(h(j,u,y,g)),w,M;c.ori==0?(w=ly,M=XUe):(w=cy,M=qUe);const S=c.dir*(c.ori==0?1:-1),A={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:xv},C=A.stroke;let k=!1;if(a-r>=b*4){let j=G=>n.posToVal(G,c.key,!0),z=null,X=null,F,H,V,W=x(o[S==1?r:a]),B=x(o[r]),Y=x(o[a]),Z=j(S==1?B+1:Y-1);for(let G=S==1?r:a;G>=r&&G<=a;G+=S){let de=o[G],le=(S==1?de<Z:de>Z)?W:x(de),ue=l[G];le==W?ue!=null?(H=ue,z==null?(w(C,le,_(H)),F=z=X=H):H<z?z=H:H>X&&(X=H)):ue===null&&(k=!0):(z!=null&&M(C,W,_(z),_(X),_(F),_(H)),ue!=null?(H=ue,w(C,le,_(H)),z=X=F=H):(z=X=null,ue===null&&(k=!0)),W=le,Z=j(W+S))}z!=null&&z!=X&&V!=W&&M(C,W,_(z),_(X),_(F),_(H))}else for(let j=S==1?r:a;j>=r&&j<=a;j+=S){let z=l[j];z===null?k=!0:z!=null&&w(C,x(o[j]),_(z))}let[N,P]=E4(n,i);if(s.fill!=null||N!=0){let j=A.fill=new Path2D(C),z=s.fillTo(n,i,s.min,s.max,N),X=_(z),F=x(o[r]),H=x(o[a]);S==-1&&([H,F]=[F,H]),w(j,H,X),w(j,F,X)}if(!s.spanGaps){let j=[];k&&j.push(...M4(o,l,r,a,S,x,e)),A.gaps=j=s.gaps(n,i,r,a,j),A.clip=zC(j,c.ori,d,g,b,y)}return P!=0&&(A.band=P==2?[uh(n,i,r,a,C,-1),uh(n,i,r,a,C,1)]:uh(n,i,r,a,C,P)),A})}function KUe(t){const e=Yi(t.align,1),n=Yi(t.ascDesc,!1),i=Yi(t.alignGaps,0),r=Yi(t.extend,!1);return(a,s,o,l)=>bg(a,s,(c,u,f,h,d,g,b,y,p,x,_)=>{[o,l]=PC(f,o,l);let w=c.pxRound,{left:M,width:S}=a.bbox,A=B=>w(g(B,h,x,y)),C=B=>w(b(B,d,_,p)),k=h.ori==0?ly:cy;const R={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:xv},N=R.stroke,P=h.dir*(h.ori==0?1:-1);let j=C(f[P==1?o:l]),z=A(u[P==1?o:l]),X=z,F=z;r&&e==-1&&(F=M,k(N,F,j)),k(N,z,j);for(let B=P==1?o:l;B>=o&&B<=l;B+=P){let Y=f[B];if(Y==null)continue;let Z=A(u[B]),G=C(Y);e==1?k(N,Z,j):k(N,X,G),k(N,Z,G),j=G,X=Z}let H=X;r&&e==1&&(H=M+S,k(N,H,j));let[V,W]=E4(a,s);if(c.fill!=null||V!=0){let B=R.fill=new Path2D(N),Y=c.fillTo(a,s,c.min,c.max,V),Z=C(Y);k(B,H,Z),k(B,F,Z)}if(!c.spanGaps){let B=[];B.push(...M4(u,f,o,l,P,A,i));let Y=c.width*Qi/2,Z=n||e==1?Y:-Y,G=n||e==-1?-Y:Y;B.forEach(de=>{de[0]+=Z,de[1]+=G}),R.gaps=B=c.gaps(a,s,o,l,B),R.clip=zC(B,h.ori,y,p,x,_)}return W!=0&&(R.band=W==2?[uh(a,s,o,l,N,-1),uh(a,s,o,l,N,1)]:uh(a,s,o,l,N,W)),R})}function lG(t,e,n,i,r,a,s=Er){if(t.length>1){let o=null;for(let l=0,c=1/0;l<t.length;l++)if(e[l]!==void 0){if(o!=null){let u=Ua(t[l]-t[o]);u<c&&(c=u,s=Ua(n(t[l],i,r,a)-n(t[o],i,r,a)))}o=l}}return s}function YUe(t){t=t||v1;const e=Yi(t.size,[.6,Er,1]),n=t.align||0,i=t.gap||0;let r=t.radius;r=r==null?[0,0]:typeof r=="number"?[r,0]:r;const a=Ni(r),s=1-e[0],o=Yi(e[1],Er),l=Yi(e[2],1),c=Yi(t.disp,v1),u=Yi(t.each,d=>{}),{fill:f,stroke:h}=c;return(d,g,b,y)=>bg(d,g,(p,x,_,w,M,S,A,C,k,R,N)=>{let P=p.pxRound,j=n,z=i*Qi,X=o*Qi,F=l*Qi,H,V;w.ori==0?[H,V]=a(d,g):[V,H]=a(d,g);const W=w.dir*(w.ori==0?1:-1);let B=w.ori==0?VC:T4,Y=w.ori==0?u:(ce,he,me,$,Ve,qe,mt)=>{u(ce,he,me,Ve,$,mt,qe)},Z=Yi(d.bands,y4).find(ce=>ce.series[0]==g),G=Z!=null?Z.dir:0,de=p.fillTo(d,g,p.min,p.max,G),oe=P(A(de,M,N,k)),le,ue,Se,Te=R,Pe=P(p.width*Qi),je=!1,He=null,pe=null,ze=null,Ie=null;f!=null&&(Pe==0||h!=null)&&(je=!0,He=f.values(d,g,b,y),pe=new Map,new Set(He).forEach(ce=>{ce!=null&&pe.set(ce,new Path2D)}),Pe>0&&(ze=h.values(d,g,b,y),Ie=new Map,new Set(ze).forEach(ce=>{ce!=null&&Ie.set(ce,new Path2D)})));let{x0:Xe,size:we}=c;if(Xe!=null&&we!=null){j=1,x=Xe.values(d,g,b,y),Xe.unit==2&&(x=x.map(me=>d.posToVal(C+me*R,w.key,!0)));let ce=we.values(d,g,b,y);we.unit==2?ue=ce[0]*R:ue=S(ce[0],w,R,C)-S(0,w,R,C),Te=lG(x,_,S,w,R,C,Te),Se=Te-ue+z}else Te=lG(x,_,S,w,R,C,Te),Se=Te*s+z,ue=Te-Se;Se<1&&(Se=0),Pe>=ue/2&&(Pe=0),Se<5&&(P=nte);let Ae=Se>0,Re=Te-Se-(Ae?Pe:0);ue=P(WI(Re,F,X)),le=(j==0?ue/2:j==W?0:ue)-j*W*((j==0?z/2:0)+(Ae?Pe/2:0));const Ne={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Fe=je?null:new Path2D;let Qe=null;if(Z!=null)Qe=d.data[Z.series[1]];else{let{y0:ce,y1:he}=c;ce!=null&&he!=null&&(_=he.values(d,g,b,y),Qe=ce.values(d,g,b,y))}let ae=H*ue,K=V*ue;for(let ce=W==1?b:y;ce>=b&&ce<=y;ce+=W){let he=_[ce];if(he==null)continue;if(Qe!=null){let Ye=Qe[ce]??0;if(he-Ye==0)continue;oe=A(Ye,M,N,k)}let me=w.distr!=2||c!=null?x[ce]:ce,$=S(me,w,R,C),Ve=A(Yi(he,de),M,N,k),qe=P($-le),mt=P(To(Ve,oe)),Ge=P(cu(Ve,oe)),Je=mt-Ge;if(he!=null){let Ye=he<0?K:ae,vt=he<0?ae:K;je?(Pe>0&&ze[ce]!=null&&B(Ie.get(ze[ce]),qe,Ge+Al(Pe/2),ue,To(0,Je-Pe),Ye,vt),He[ce]!=null&&B(pe.get(He[ce]),qe,Ge+Al(Pe/2),ue,To(0,Je-Pe),Ye,vt)):B(Fe,qe,Ge+Al(Pe/2),ue,To(0,Je-Pe),Ye,vt),Y(d,g,ce,qe-Pe/2,Ge,ue+Pe,Je)}}return Pe>0?Ne.stroke=je?Ie:Fe:je||(Ne._fill=p.width==0?p._fill:p._stroke??p._fill,Ne.width=0),Ne.fill=je?pe:Fe,Ne})}function JUe(t,e){const n=Yi(e?.alignGaps,0);return(i,r,a,s)=>bg(i,r,(o,l,c,u,f,h,d,g,b,y,p)=>{[a,s]=PC(c,a,s);let x=o.pxRound,_=H=>x(h(H,u,y,g)),w=H=>x(d(H,f,p,b)),M,S,A;u.ori==0?(M=jC,A=ly,S=Rte):(M=HC,A=cy,S=kte);const C=u.dir*(u.ori==0?1:-1);let k=_(l[C==1?a:s]),R=k,N=[],P=[];for(let H=C==1?a:s;H>=a&&H<=s;H+=C)if(c[H]!=null){let W=l[H],B=_(W);N.push(R=B),P.push(w(c[H]))}const j={stroke:t(N,P,M,A,S,x),fill:null,clip:null,band:null,gaps:null,flags:xv},z=j.stroke;let[X,F]=E4(i,r);if(o.fill!=null||X!=0){let H=j.fill=new Path2D(z),V=o.fillTo(i,r,o.min,o.max,X),W=w(V);A(H,R,W),A(H,k,W)}if(!o.spanGaps){let H=[];H.push(...M4(l,c,a,s,C,_,n)),j.gaps=H=o.gaps(i,r,a,s,H),j.clip=zC(H,u.ori,g,b,y,p)}return F!=0&&(j.band=F==2?[uh(i,r,a,s,z,-1),uh(i,r,a,s,z,1)]:uh(i,r,a,s,z,F)),j})}function $Ue(t){return JUe(ZUe,t)}function ZUe(t,e,n,i,r,a){const s=t.length;if(s<2)return null;const o=new Path2D;if(n(o,t[0],e[0]),s==2)i(o,t[1],e[1]);else{let l=Array(s),c=Array(s-1),u=Array(s-1),f=Array(s-1);for(let h=0;h<s-1;h++)u[h]=e[h+1]-e[h],f[h]=t[h+1]-t[h],c[h]=u[h]/f[h];l[0]=c[0];for(let h=1;h<s-1;h++)c[h]===0||c[h-1]===0||c[h-1]>0!=c[h]>0?l[h]=0:(l[h]=3*(f[h-1]+f[h])/((2*f[h]+f[h-1])/c[h-1]+(f[h]+2*f[h-1])/c[h]),isFinite(l[h])||(l[h]=0));l[s-1]=c[s-2];for(let h=0;h<s-1;h++)r(o,t[h]+f[h]/3,e[h]+l[h]*f[h]/3,t[h+1]-f[h]/3,e[h+1]-l[h+1]*f[h]/3,t[h+1],e[h+1])}return o}const YI=new Set;function cG(){for(let t of YI)t.syncRect(!0)}oy&&(Fm(OPe,R0,cG),Fm(IPe,R0,cG,!0),Fm(ST,R0,()=>{ao.pxRatio=Qi}));const QUe=Ite(),e4e=Dte();function uG(t,e,n,i){return(i?[t[0],t[1]].concat(t.slice(2)):[t[0]].concat(t.slice(1))).map((a,s)=>JI(a,s,e,n))}function t4e(t,e){return t.map((n,i)=>i==0?{}:Aa({},e,n))}function JI(t,e,n,i){return Aa({},e==0?n:i,t)}function Nte(t,e,n){return e==null?vv:[e,n]}const n4e=Nte;function i4e(t,e,n){return e==null?vv:wT(e,n,b4,!0)}function Lte(t,e,n,i){return e==null?vv:UC(e,n,t.scales[i].log,!1)}const r4e=Lte;function Pte(t,e,n,i){return e==null?vv:g4(e,n,t.scales[i].log,!1)}const a4e=Pte;function s4e(t,e,n,i,r){let a=To(HV(t),HV(e)),s=e-t,o=tu(r/i*s,n);do{let l=n[o],c=i*l/s;if(c>=r&&a+(l<5?Kd.get(l):0)<=17)return[l,c]}while(++o<n.length);return[0,0]}function fG(t){let e,n;return t=t.replace(/(\d+)px/,(i,r)=>(e=Pa((n=+r)*Qi))+"px"),[t,e,n]}function o4e(t){t.show&&[t.font,t.labelFont].forEach(e=>{let n=Mr(e[2]*Qi,1);e[0]=e[0].replace(/[0-9.]+px/,n+"px"),e[1]=n})}function ao(t,e,n){const i={mode:Yi(t.mode,1)},r=i.mode;function a(Q,fe,_e,Me){let We=fe.valToPct(Q);return Me+_e*(fe.dir==-1?1-We:We)}function s(Q,fe,_e,Me){let We=fe.valToPct(Q);return Me+_e*(fe.dir==-1?We:1-We)}function o(Q,fe,_e,Me){return fe.ori==0?a(Q,fe,_e,Me):s(Q,fe,_e,Me)}i.valToPosH=a,i.valToPosV=s;let l=!1;i.status=0;const c=i.root=Ql(pPe);if(t.id!=null&&(c.id=t.id),pl(c,t.class),t.title){let Q=Ql(bPe,c);Q.textContent=t.title}const u=$c("canvas"),f=i.ctx=u.getContext("2d"),h=Ql(vPe,c);Fm("click",h,Q=>{Q.target===g&&(Cn!=zt||ai!=gn)&&Mi.click(i,Q)},!0);const d=i.under=Ql(yPe,h);h.appendChild(u);const g=i.over=Ql(xPe,h);t=yv(t);const b=+Yi(t.pxAlign,1),y=oG(b);(t.plugins||[]).forEach(Q=>{Q.opts&&(t=Q.opts(i,t)||t)});const p=t.ms||.001,x=i.series=r==1?uG(t.series||[],eG,aG,!1):t4e(t.series||[null],rG),_=i.axes=uG(t.axes||[],QV,nG,!0),w=i.scales={},M=i.bands=t.bands||[];M.forEach(Q=>{Q.fill=Ni(Q.fill||null),Q.dir=Yi(Q.dir,-1)});const S=r==2?x[1].facets[0].scale:x[0].scale,A={axes:_n,series:Sn},C=(t.drawOrder||["axes","series"]).map(Q=>A[Q]);function k(Q){const fe=Q.distr==3?_e=>ch(_e>0?_e:Q.clamp(i,_e,Q.min,Q.max,Q.key)):Q.distr==4?_e=>s8(_e,Q.asinh):Q.distr==100?_e=>Q.fwd(_e):_e=>_e;return _e=>{let Me=fe(_e),{_min:We,_max:Ze}=Q,Ct=Ze-We;return(Me-We)/Ct}}function R(Q){let fe=w[Q];if(fe==null){let _e=(t.scales||v1)[Q]||v1;if(_e.from!=null){R(_e.from);let Me=Aa({},w[_e.from],_e,{key:Q});Me.valToPct=k(Me),w[Q]=Me}else{fe=w[Q]=Aa({},Q==S?Ete:VUe,_e),fe.key=Q;let Me=fe.time,We=fe.range,Ze=fd(We);if((Q!=S||r==2&&!Me)&&(Ze&&(We[0]==null||We[1]==null)&&(We={min:We[0]==null?BV:{mode:1,hard:We[0],soft:We[0]},max:We[1]==null?BV:{mode:1,hard:We[1],soft:We[1]}},Ze=!1),!Ze&&BC(We))){let Ct=We;We=(Ft,Gt,en)=>Gt==null?vv:wT(Gt,en,Ct)}fe.range=Ni(We||(Me?n4e:Q==S?fe.distr==3?r4e:fe.distr==4?a4e:Nte:fe.distr==3?Lte:fe.distr==4?Pte:i4e)),fe.auto=Ni(Ze?!1:fe.auto),fe.clamp=Ni(fe.clamp||HUe),fe._min=fe._max=null,fe.valToPct=k(fe)}}}R("x"),R("y"),r==1&&x.forEach(Q=>{R(Q.scale)}),_.forEach(Q=>{R(Q.scale)});for(let Q in t.scales)R(Q);const N=w[S],P=N.distr;let j,z;N.ori==0?(pl(c,mPe),j=a,z=s):(pl(c,gPe),j=s,z=a);const X={};for(let Q in w){let fe=w[Q];(fe.min!=null||fe.max!=null)&&(X[Q]={min:fe.min,max:fe.max},fe.min=fe.max=null)}const F=t.tzDate||(Q=>new Date(Pa(Q/p))),H=t.fmtDate||x4,V=p==1?mUe(F):vUe(F),W=JV(F,YV(p==1?pUe:bUe,H)),B=ZV(F,$V(xUe,H)),Y=[],Z=i.legend=Aa({},wUe,t.legend),G=i.cursor=Aa({},RUe,{drag:{y:r==2}},t.cursor),de=Z.show,oe=G.show,le=Z.markers;Z.idxs=Y,le.width=Ni(le.width),le.dash=Ni(le.dash),le.stroke=Ni(le.stroke),le.fill=Ni(le.fill);let ue,Se,Te,Pe=[],je=[],He,pe=!1,ze={};if(Z.live){const Q=x[1]?x[1].values:null;pe=Q!=null,He=pe?Q(i,1,0):{_:0};for(let fe in He)ze[fe]=p4}if(de)if(ue=$c("table",TPe,c),Te=$c("tbody",null,ue),Z.mount(i,ue),pe){Se=$c("thead",null,ue,Te);let Q=$c("tr",null,Se);$c("th",null,Q);for(var Ie in He)$c("th",TV,Q).textContent=Ie}else pl(ue,CPe),Z.live&&pl(ue,APe);const Xe={show:!0},we={show:!1};function Ae(Q,fe){if(fe==0&&(pe||!Z.live||r==2))return vv;let _e=[],Me=$c("tr",RPe,Te,Te.childNodes[fe]);pl(Me,Q.class),Q.show||pl(Me,om);let We=$c("th",null,Me);if(le.show){let Ft=Ql(kPe,We);if(fe>0){let Gt=le.width(i,fe);Gt&&(Ft.style.border=Gt+"px "+le.dash(i,fe)+" "+le.stroke(i,fe)),Ft.style.background=le.fill(i,fe)}}let Ze=Ql(TV,We);Q.label instanceof HTMLElement?Ze.appendChild(Q.label):Ze.textContent=Q.label,fe>0&&(le.show||(Ze.style.color=Q.width>0?le.stroke(i,fe):le.fill(i,fe)),Ne("click",We,Ft=>{if(G._lock)return;Vn(Ft);let Gt=x.indexOf(Q);if((Ft.ctrlKey||Ft.metaKey)!=Z.isolate){let en=x.some((Qt,fn)=>fn>0&&fn!=Gt&&Qt.show);x.forEach((Qt,fn)=>{fn>0&&sr(fn,en?fn==Gt?Xe:we:Xe,!0,si.setSeries)})}else sr(Gt,{show:!Q.show},!0,si.setSeries)},!1),Yn&&Ne(kV,We,Ft=>{G._lock||(Vn(Ft),sr(x.indexOf(Q),ur,!0,si.setSeries))},!1));for(var Ct in He){let Ft=$c("td",DPe,Me);Ft.textContent="--",_e.push(Ft)}return[Me,_e]}const Re=new Map;function Ne(Q,fe,_e,Me=!0){const We=Re.get(fe)||{},Ze=G.bind[Q](i,fe,_e,Me);Ze&&(Fm(Q,fe,We[Q]=Ze),Re.set(fe,We))}function Fe(Q,fe,_e){const Me=Re.get(fe)||{};for(let We in Me)(Q==null||We==Q)&&(GI(We,fe,Me[We]),delete Me[We]);Q==null&&Re.delete(fe)}let Qe=0,ae=0,K=0,ce=0,he=0,me=0,$=he,Ve=me,qe=K,mt=ce,Ge=0,Je=0,Ye=0,vt=0;i.bbox={};let Mt=!1,gt=!1,kt=!1,ke=!1,Le=!1,ht=!1;function jt(Q,fe,_e){(_e||Q!=i.width||fe!=i.height)&&ot(Q,fe),Wa(!1),kt=!0,gt=!0,zs()}function ot(Q,fe){i.width=Qe=K=Q,i.height=ae=ce=fe,he=me=0,Kt(),un();let _e=i.bbox;Ge=_e.left=tm(he*Qi,.5),Je=_e.top=tm(me*Qi,.5),Ye=_e.width=tm(K*Qi,.5),vt=_e.height=tm(ce*Qi,.5)}const it=3;function bt(){let Q=!1,fe=0;for(;!Q;){fe++;let _e=ko(fe),Me=ds(fe);Q=fe==it||_e&&Me,Q||(ot(i.width,i.height),gt=!0)}}function Jt({width:Q,height:fe}){jt(Q,fe)}i.setSize=Jt;function Kt(){let Q=!1,fe=!1,_e=!1,Me=!1;_.forEach((We,Ze)=>{if(We.show&&We._show){let{side:Ct,_size:Ft}=We,Gt=Ct%2,en=We.label!=null?We.labelSize:0,Qt=Ft+en;Qt>0&&(Gt?(K-=Qt,Ct==3?(he+=Qt,Me=!0):_e=!0):(ce-=Qt,Ct==0?(me+=Qt,Q=!0):fe=!0))}}),ge[0]=Q,ge[1]=_e,ge[2]=fe,ge[3]=Me,K-=lt[1]+lt[3],he+=lt[3],ce-=lt[2]+lt[0],me+=lt[0]}function un(){let Q=he+K,fe=me+ce,_e=he,Me=me;function We(Ze,Ct){switch(Ze){case 1:return Q+=Ct,Q-Ct;case 2:return fe+=Ct,fe-Ct;case 3:return _e-=Ct,_e+Ct;case 0:return Me-=Ct,Me+Ct}}_.forEach((Ze,Ct)=>{if(Ze.show&&Ze._show){let Ft=Ze.side;Ze._pos=We(Ft,Ze._size),Ze.label!=null&&(Ze._lpos=We(Ft,Ze.labelSize))}})}if(G.dataIdx==null){let Q=G.hover,fe=Q.skip=new Set(Q.skip??[]);fe.add(void 0);let _e=Q.prox=Ni(Q.prox),Me=Q.bias??=0;G.dataIdx=(We,Ze,Ct,Ft)=>{if(Ze==0)return Ct;let Gt=Ct,en=_e(We,Ze,Ct,Ft)??Er,Qt=en>=0&&en<Er,fn=N.ori==0?K:ce,Fn=G.left,mi=e[0],Wn=e[Ze];if(fe.has(Wn[Ct])){Gt=null;let ui=null,Rn=null,yn;if(Me==0||Me==-1)for(yn=Ct;ui==null&&yn-- >0;)fe.has(Wn[yn])||(ui=yn);if(Me==0||Me==1)for(yn=Ct;Rn==null&&yn++<Wn.length;)fe.has(Wn[yn])||(Rn=yn);if(ui!=null||Rn!=null)if(Qt){let fr=ui==null?-1/0:j(mi[ui],N,fn,0),Rr=Rn==null?1/0:j(mi[Rn],N,fn,0),ia=Fn-fr,Zi=Rr-Fn;ia<=Zi?ia<=en&&(Gt=ui):Zi<=en&&(Gt=Rn)}else Gt=Rn==null?ui:ui==null?Rn:Ct-ui<=Rn-Ct?ui:Rn}else Qt&&Ua(Fn-j(mi[Ct],N,fn,0))>en&&(Gt=null);return Gt}}const Vn=Q=>{G.event=Q};G.idxs=Y,G._lock=!1;let vn=G.points;vn.show=Ni(vn.show),vn.size=Ni(vn.size),vn.stroke=Ni(vn.stroke),vn.width=Ni(vn.width),vn.fill=Ni(vn.fill);const Qn=i.focus=Aa({},t.focus||{alpha:.3},G.focus),Yn=Qn.prox>=0,xi=Yn&&vn.one;let qn=[],Ji=[],hi=[];function on(Q,fe){let _e=vn.show(i,fe);if(_e instanceof HTMLElement)return pl(_e,MPe),pl(_e,Q.class),Hu(_e,-10,-10,K,ce),g.insertBefore(_e,qn[fe]),_e}function Ii(Q,fe){if(r==1||fe>0){let _e=r==1&&w[Q.scale].time,Me=Q.value;Q.value=_e?WV(Me)?ZV(F,$V(Me,H)):Me||B:Me||BUe,Q.label=Q.label||(_e?DUe:kUe)}if(xi||fe>0){Q.width=Q.width==null?1:Q.width,Q.paths=Q.paths||QUe||VPe,Q.fillTo=Ni(Q.fillTo||GUe),Q.pxAlign=+Yi(Q.pxAlign,b),Q.pxRound=oG(Q.pxAlign),Q.stroke=Ni(Q.stroke||null),Q.fill=Ni(Q.fill||null),Q._stroke=Q._fill=Q._paths=Q._focus=null;let _e=zUe(To(1,Q.width),1),Me=Q.points=Aa({},{size:_e,width:To(1,_e*.2),stroke:Q.stroke,space:_e*2,paths:e4e,_stroke:null,_fill:null},Q.points);Me.show=Ni(Me.show),Me.filter=Ni(Me.filter),Me.fill=Ni(Me.fill),Me.stroke=Ni(Me.stroke),Me.paths=Ni(Me.paths),Me.pxAlign=Q.pxAlign}if(de){let _e=Ae(Q,fe);Pe.splice(fe,0,_e[0]),je.splice(fe,0,_e[1]),Z.values.push(null)}if(oe){Y.splice(fe,0,null);let _e=null;xi?fe==0&&(_e=on(Q,fe)):fe>0&&(_e=on(Q,fe)),qn.splice(fe,0,_e),Ji.splice(fe,0,0),hi.splice(fe,0,0)}Ln("addSeries",fe)}function ri(Q,fe){fe=fe??x.length,Q=r==1?JI(Q,fe,eG,aG):JI(Q,fe,{},rG),x.splice(fe,0,Q),Ii(x[fe],fe)}i.addSeries=ri;function se(Q){if(x.splice(Q,1),de){Z.values.splice(Q,1),je.splice(Q,1);let fe=Pe.splice(Q,1)[0];Fe(null,fe.firstChild),fe.remove()}oe&&(Y.splice(Q,1),qn.splice(Q,1)[0].remove(),Ji.splice(Q,1),hi.splice(Q,1)),Ln("delSeries",Q)}i.delSeries=se;const ge=[!1,!1,!1,!1];function Ue(Q,fe){if(Q._show=Q.show,Q.show){let _e=Q.side%2,Me=w[Q.scale];Me==null&&(Q.scale=_e?x[1].scale:S,Me=w[Q.scale]);let We=Me.time;Q.size=Ni(Q.size),Q.space=Ni(Q.space),Q.rotate=Ni(Q.rotate),fd(Q.incrs)&&Q.incrs.forEach(Ct=>{!Kd.has(Ct)&&Kd.set(Ct,ate(Ct))}),Q.incrs=Ni(Q.incrs||(Me.distr==2?fUe:We?p==1?dUe:gUe:nm)),Q.splits=Ni(Q.splits||(We&&Me.distr==1?V:Me.distr==3?XI:Me.distr==4?NUe:IUe)),Q.stroke=Ni(Q.stroke),Q.grid.stroke=Ni(Q.grid.stroke),Q.ticks.stroke=Ni(Q.ticks.stroke),Q.border.stroke=Ni(Q.border.stroke);let Ze=Q.values;Q.values=fd(Ze)&&!fd(Ze[0])?Ni(Ze):We?fd(Ze)?JV(F,YV(Ze,H)):WV(Ze)?yUe(F,Ze):Ze||W:Ze||OUe,Q.filter=Ni(Q.filter||(Me.distr>=3&&Me.log==10?UUe:Me.distr==3&&Me.log==2?FUe:ite)),Q.font=fG(Q.font),Q.labelFont=fG(Q.labelFont),Q._size=Q.size(i,null,fe,0),Q._space=Q._rotate=Q._incrs=Q._found=Q._splits=Q._values=null,Q._size>0&&(ge[fe]=!0,Q._el=Ql(_Pe,h))}}function rt(Q,fe,_e,Me){let[We,Ze,Ct,Ft]=_e,Gt=fe%2,en=0;return Gt==0&&(Ft||Ze)&&(en=fe==0&&!We||fe==2&&!Ct?Pa(QV.size/3):0),Gt==1&&(We||Ct)&&(en=fe==1&&!Ze||fe==3&&!Ft?Pa(nG.size/2):0),en}const dt=i.padding=(t.padding||[rt,rt,rt,rt]).map(Q=>Ni(Yi(Q,rt))),lt=i._padding=dt.map((Q,fe)=>Q(i,fe,ge,0));let At,ee=null,xe=null;const Ce=r==1?x[0].idxs:null;let Oe=null,ve=!1;function _t(Q,fe){if(e=Q??[],i.data=i._data=e,r==2){At=0;for(let _e=1;_e<x.length;_e++)At+=e[_e][0].length}else{e.length==0&&(i.data=i._data=e=[[]]),Oe=e[0],At=Oe.length;let _e=e;if(P==2){_e=e.slice();let Me=_e[0]=Array(At);for(let We=0;We<At;We++)Me[We]=We}i._data=e=_e}if(Wa(!0),Ln("setData"),P==2&&(kt=!0),fe!==!1){let _e=N;_e.auto(i,ve)?ft():Na(S,_e.min,_e.max),ke=ke||G.left>=0,ht=!0,zs()}}i.setData=_t;function ft(){ve=!0;let Q,fe;r==1&&(At>0?(ee=Ce[0]=0,xe=Ce[1]=At-1,Q=e[0][ee],fe=e[0][xe],P==2?(Q=ee,fe=xe):Q==fe&&(P==3?[Q,fe]=UC(Q,Q,N.log,!1):P==4?[Q,fe]=g4(Q,Q,N.log,!1):N.time?fe=Q+Pa(86400/p):[Q,fe]=wT(Q,fe,b4,!0))):(ee=Ce[0]=Q=null,xe=Ce[1]=fe=null)),Na(S,Q,fe)}let yt,St,Nt,Xt,at,nn,pn,dn,Dn,$t;function Yt(Q,fe,_e,Me,We,Ze){Q??=CV,_e??=y4,Me??="butt",We??=CV,Ze??="round",Q!=yt&&(f.strokeStyle=yt=Q),We!=St&&(f.fillStyle=St=We),fe!=Nt&&(f.lineWidth=Nt=fe),Ze!=at&&(f.lineJoin=at=Ze),Me!=nn&&(f.lineCap=nn=Me),_e!=Xt&&f.setLineDash(Xt=_e)}function Un(Q,fe,_e,Me){fe!=St&&(f.fillStyle=St=fe),Q!=pn&&(f.font=pn=Q),_e!=dn&&(f.textAlign=dn=_e),Me!=Dn&&(f.textBaseline=Dn=Me)}function xn(Q,fe,_e,Me,We=0){if(Me.length>0&&Q.auto(i,ve)&&(fe==null||fe.min==null)){let Ze=Yi(ee,0),Ct=Yi(xe,Me.length-1),Ft=_e.min==null?UPe(Me,Ze,Ct,We,Q.distr==3):[_e.min,_e.max];Q.min=cu(Q.min,_e.min=Ft[0]),Q.max=To(Q.max,_e.max=Ft[1])}}const Zn={min:null,max:null};function Nn(){for(let Me in w){let We=w[Me];X[Me]==null&&(We.min==null||X[S]!=null&&We.auto(i,ve))&&(X[Me]=Zn)}for(let Me in w){let We=w[Me];X[Me]==null&&We.from!=null&&X[We.from]!=null&&(X[Me]=Zn)}X[S]!=null&&Wa(!0);let Q={};for(let Me in X){let We=X[Me];if(We!=null){let Ze=Q[Me]=yv(w[Me],XPe);if(We.min!=null)Aa(Ze,We);else if(Me!=S||r==2)if(At==0&&Ze.from==null){let Ct=Ze.range(i,null,null,Me);Ze.min=Ct[0],Ze.max=Ct[1]}else Ze.min=Er,Ze.max=-Er}}if(At>0){x.forEach((Me,We)=>{if(r==1){let Ze=Me.scale,Ct=X[Ze];if(Ct==null)return;let Ft=Q[Ze];if(We==0){let Gt=Ft.range(i,Ft.min,Ft.max,Ze);Ft.min=Gt[0],Ft.max=Gt[1],ee=tu(Ft.min,e[0]),xe=tu(Ft.max,e[0]),xe-ee>1&&(e[0][ee]<Ft.min&&ee++,e[0][xe]>Ft.max&&xe--),Me.min=Oe[ee],Me.max=Oe[xe]}else Me.show&&Me.auto&&xn(Ft,Ct,Me,e[We],Me.sorted);Me.idxs[0]=ee,Me.idxs[1]=xe}else if(We>0&&Me.show&&Me.auto){let[Ze,Ct]=Me.facets,Ft=Ze.scale,Gt=Ct.scale,[en,Qt]=e[We],fn=Q[Ft],Fn=Q[Gt];fn!=null&&xn(fn,X[Ft],Ze,en,Ze.sorted),Fn!=null&&xn(Fn,X[Gt],Ct,Qt,Ct.sorted),Me.min=Ct.min,Me.max=Ct.max}});for(let Me in Q){let We=Q[Me],Ze=X[Me];if(We.from==null&&(Ze==null||Ze.min==null)){let Ct=We.range(i,We.min==Er?null:We.min,We.max==-Er?null:We.max,Me);We.min=Ct[0],We.max=Ct[1]}}}for(let Me in Q){let We=Q[Me];if(We.from!=null){let Ze=Q[We.from];if(Ze.min==null)We.min=We.max=null;else{let Ct=We.range(i,Ze.min,Ze.max,Me);We.min=Ct[0],We.max=Ct[1]}}}let fe={},_e=!1;for(let Me in Q){let We=Q[Me],Ze=w[Me];if(Ze.min!=We.min||Ze.max!=We.max){Ze.min=We.min,Ze.max=We.max;let Ct=Ze.distr;Ze._min=Ct==3?ch(Ze.min):Ct==4?s8(Ze.min,Ze.asinh):Ct==100?Ze.fwd(Ze.min):Ze.min,Ze._max=Ct==3?ch(Ze.max):Ct==4?s8(Ze.max,Ze.asinh):Ct==100?Ze.fwd(Ze.max):Ze.max,fe[Me]=_e=!0}}if(_e){x.forEach((Me,We)=>{r==2?We>0&&fe.y&&(Me._paths=null):fe[Me.scale]&&(Me._paths=null)});for(let Me in fe)kt=!0,Ln("setScale",Me);oe&&G.left>=0&&(ke=ht=!0)}for(let Me in X)X[Me]=null}function An(Q){let fe=WI(ee-1,0,At-1),_e=WI(xe+1,0,At-1);for(;Q[fe]==null&&fe>0;)fe--;for(;Q[_e]==null&&_e<At-1;)_e++;return[fe,_e]}function Sn(){if(At>0){let Q=x.some(fe=>fe._focus)&&$t!=Qn.alpha;Q&&(f.globalAlpha=$t=Qn.alpha),x.forEach((fe,_e)=>{if(_e>0&&fe.show&&(an(_e,!1),an(_e,!0),fe._paths==null)){let Me=$t;$t!=fe.alpha&&(f.globalAlpha=$t=fe.alpha);let We=r==2?[0,e[_e][0].length-1]:An(e[_e]);fe._paths=fe.paths(i,_e,We[0],We[1]),$t!=Me&&(f.globalAlpha=$t=Me)}}),x.forEach((fe,_e)=>{if(_e>0&&fe.show){let Me=$t;$t!=fe.alpha&&(f.globalAlpha=$t=fe.alpha),fe._paths!=null&&di(_e,!1);{let We=fe._paths!=null?fe._paths.gaps:null,Ze=fe.points.show(i,_e,ee,xe,We),Ct=fe.points.filter(i,_e,Ze,We);(Ze||Ct)&&(fe.points._paths=fe.points.paths(i,_e,ee,xe,Ct),di(_e,!0))}$t!=Me&&(f.globalAlpha=$t=Me),Ln("drawSeries",_e)}}),Q&&(f.globalAlpha=$t=1)}}function an(Q,fe){let _e=fe?x[Q].points:x[Q];_e._stroke=_e.stroke(i,Q),_e._fill=_e.fill(i,Q)}function di(Q,fe){let _e=fe?x[Q].points:x[Q],{stroke:Me,fill:We,clip:Ze,flags:Ct,_stroke:Ft=_e._stroke,_fill:Gt=_e._fill,_width:en=_e.width}=_e._paths;en=Mr(en*Qi,3);let Qt=null,fn=en%2/2;fe&&Gt==null&&(Gt=en>0?"#fff":Ft);let Fn=_e.pxAlign==1&&fn>0;if(Fn&&f.translate(fn,fn),!fe){let mi=Ge-en/2,Wn=Je-en/2,ui=Ye+en,Rn=vt+en;Qt=new Path2D,Qt.rect(mi,Wn,ui,Rn)}fe?wi(Ft,en,_e.dash,_e.cap,Gt,Me,We,Ct,Ze):Li(Q,Ft,en,_e.dash,_e.cap,Gt,Me,We,Ct,Qt,Ze),Fn&&f.translate(-fn,-fn)}function Li(Q,fe,_e,Me,We,Ze,Ct,Ft,Gt,en,Qt){let fn=!1;Gt!=0&&M.forEach((Fn,mi)=>{if(Fn.series[0]==Q){let Wn=x[Fn.series[1]],ui=e[Fn.series[1]],Rn=(Wn._paths||v1).band;fd(Rn)&&(Rn=Fn.dir==1?Rn[0]:Rn[1]);let yn,fr=null;Wn.show&&Rn&&BPe(ui,ee,xe)?(fr=Fn.fill(i,mi)||Ze,yn=Wn._paths.clip):Rn=null,wi(fe,_e,Me,We,fr,Ct,Ft,Gt,en,Qt,yn,Rn),fn=!0}}),fn||wi(fe,_e,Me,We,Ze,Ct,Ft,Gt,en,Qt)}const Gn=xv|KI;function wi(Q,fe,_e,Me,We,Ze,Ct,Ft,Gt,en,Qt,fn){Yt(Q,fe,_e,Me,We),(Gt||en||fn)&&(f.save(),Gt&&f.clip(Gt),en&&f.clip(en)),fn?(Ft&Gn)==Gn?(f.clip(fn),Qt&&f.clip(Qt),Gi(We,Ct),Sa(Q,Ze,fe)):Ft&KI?(Gi(We,Ct),f.clip(fn),Sa(Q,Ze,fe)):Ft&xv&&(f.save(),f.clip(fn),Qt&&f.clip(Qt),Gi(We,Ct),f.restore(),Sa(Q,Ze,fe)):(Gi(We,Ct),Sa(Q,Ze,fe)),(Gt||en||fn)&&f.restore()}function Sa(Q,fe,_e){_e>0&&(fe instanceof Map?fe.forEach((Me,We)=>{f.strokeStyle=yt=We,f.stroke(Me)}):fe!=null&&Q&&f.stroke(fe))}function Gi(Q,fe){fe instanceof Map?fe.forEach((_e,Me)=>{f.fillStyle=St=Me,f.fill(_e)}):fe!=null&&Q&&f.fill(fe)}function Yo(Q,fe,_e,Me){let We=_[Q],Ze;if(Me<=0)Ze=[0,0];else{let Ct=We._space=We.space(i,Q,fe,_e,Me),Ft=We._incrs=We.incrs(i,Q,fe,_e,Me,Ct);Ze=s4e(fe,_e,Ft,Me,Ct)}return We._found=Ze}function Bs(Q,fe,_e,Me,We,Ze,Ct,Ft,Gt,en){let Qt=Ct%2/2;b==1&&f.translate(Qt,Qt),Yt(Ft,Ct,Gt,en,Ft),f.beginPath();let fn,Fn,mi,Wn,ui=We+(Me==0||Me==3?-Ze:Ze);_e==0?(Fn=We,Wn=ui):(fn=We,mi=ui);for(let Rn=0;Rn<Q.length;Rn++)fe[Rn]!=null&&(_e==0?fn=mi=Q[Rn]:Fn=Wn=Q[Rn],f.moveTo(fn,Fn),f.lineTo(mi,Wn));f.stroke(),b==1&&f.translate(-Qt,-Qt)}function ko(Q){let fe=!0;return _.forEach((_e,Me)=>{if(!_e.show)return;let We=w[_e.scale];if(We.min==null){_e._show&&(fe=!1,_e._show=!1,Wa(!1));return}else _e._show||(fe=!1,_e._show=!0,Wa(!1));let Ze=_e.side,Ct=Ze%2,{min:Ft,max:Gt}=We,[en,Qt]=Yo(Me,Ft,Gt,Ct==0?K:ce);if(Qt==0)return;let fn=We.distr==2,Fn=_e._splits=_e.splits(i,Me,Ft,Gt,en,Qt,fn),mi=We.distr==2?Fn.map(yn=>Oe[yn]):Fn,Wn=We.distr==2?Oe[Fn[1]]-Oe[Fn[0]]:en,ui=_e._values=_e.values(i,_e.filter(i,mi,Me,Qt,Wn),Me,Qt,Wn);_e._rotate=Ze==2?_e.rotate(i,ui,Me,Qt):0;let Rn=_e._size;_e._size=ac(_e.size(i,ui,Me,Q)),Rn!=null&&_e._size!=Rn&&(fe=!1)}),fe}function ds(Q){let fe=!0;return dt.forEach((_e,Me)=>{let We=_e(i,Me,ge,Q);We!=lt[Me]&&(fe=!1),lt[Me]=We}),fe}function _n(){for(let Q=0;Q<_.length;Q++){let fe=_[Q];if(!fe.show||!fe._show)continue;let _e=fe.side,Me=_e%2,We,Ze,Ct=fe.stroke(i,Q),Ft=_e==0||_e==3?-1:1,[Gt,en]=fe._found;if(fe.label!=null){let hr=fe.labelGap*Ft,qs=Pa((fe._lpos+hr)*Qi);Un(fe.labelFont[0],Ct,"center",_e==2?fx:AV),f.save(),Me==1?(We=Ze=0,f.translate(qs,Pa(Je+vt/2)),f.rotate((_e==3?-wM:wM)/2)):(We=Pa(Ge+Ye/2),Ze=qs);let ms=tte(fe.label)?fe.label(i,Q,Gt,en):fe.label;f.fillText(ms,We,Ze),f.restore()}if(en==0)continue;let Qt=w[fe.scale],fn=Me==0?Ye:vt,Fn=Me==0?Ge:Je,mi=fe._splits,Wn=Qt.distr==2?mi.map(hr=>Oe[hr]):mi,ui=Qt.distr==2?Oe[mi[1]]-Oe[mi[0]]:Gt,Rn=fe.ticks,yn=fe.border,fr=Rn.show?Rn.size:0,Rr=Pa(fr*Qi),ia=Pa((fe.alignTo==2?fe._size-fr-fe.gap:fe.gap)*Qi),Zi=fe._rotate*-wM/180,Xr=y(fe._pos*Qi),Ws=(Rr+ia)*Ft,Ya=Xr+Ws;Ze=Me==0?Ya:0,We=Me==1?Ya:0;let qr=fe.font[0],uo=fe.align==1?Lb:fe.align==2?i8:Zi>0?Lb:Zi<0?i8:Me==0?"center":_e==3?i8:Lb,Qo=Zi||Me==1?"middle":_e==2?fx:AV;Un(qr,Ct,uo,Qo);let fo=fe.font[1]*fe.lineGap,Xs=mi.map(hr=>y(o(hr,Qt,fn,Fn))),kr=fe._values;for(let hr=0;hr<kr.length;hr++){let qs=kr[hr];if(qs!=null){Me==0?We=Xs[hr]:Ze=Xs[hr],qs=""+qs;let ms=qs.indexOf(`
`)==-1?[qs]:qs.split(/\n/gm);for(let ca=0;ca<ms.length;ca++){let jc=ms[ca];Zi?(f.save(),f.translate(We,Ze+ca*fo),f.rotate(Zi),f.fillText(jc,0,0),f.restore()):f.fillText(jc,We,Ze+ca*fo)}}}Rn.show&&Bs(Xs,Rn.filter(i,Wn,Q,en,ui),Me,_e,Xr,Rr,Mr(Rn.width*Qi,3),Rn.stroke(i,Q),Rn.dash,Rn.cap);let el=fe.grid;el.show&&Bs(Xs,el.filter(i,Wn,Q,en,ui),Me,Me==0?2:1,Me==0?Je:Ge,Me==0?vt:Ye,Mr(el.width*Qi,3),el.stroke(i,Q),el.dash,el.cap),yn.show&&Bs([Xr],[1],Me==0?1:0,Me==0?1:2,Me==1?Je:Ge,Me==1?vt:Ye,Mr(yn.width*Qi,3),yn.stroke(i,Q),yn.dash,yn.cap)}Ln("drawAxes")}function Wa(Q){x.forEach((fe,_e)=>{_e>0&&(fe._paths=null,Q&&(r==1?(fe.min=null,fe.max=null):fe.facets.forEach(Me=>{Me.min=null,Me.max=null})))})}let ps=!1,Xa=!1,$i=[];function so(){Xa=!1;for(let Q=0;Q<$i.length;Q++)Ln(...$i[Q]);$i.length=0}function zs(){ps||(QPe(E),ps=!0)}function js(Q,fe=!1){ps=!0,Xa=fe,Q(i),E(),fe&&$i.length>0&&queueMicrotask(so)}i.batch=js;function E(){if(Mt&&(Nn(),Mt=!1),kt&&(bt(),kt=!1),gt){if(zr(d,Lb,he),zr(d,fx,me),zr(d,Ix,K),zr(d,Nx,ce),zr(g,Lb,he),zr(g,fx,me),zr(g,Ix,K),zr(g,Nx,ce),zr(h,Ix,Qe),zr(h,Nx,ae),u.width=Pa(Qe*Qi),u.height=Pa(ae*Qi),_.forEach(({_el:Q,_show:fe,_size:_e,_pos:Me,side:We})=>{if(Q!=null)if(fe){let Ze=We===3||We===0?_e:0,Ct=We%2==1;zr(Q,Ct?"left":"top",Me-Ze),zr(Q,Ct?"width":"height",_e),zr(Q,Ct?"top":"left",Ct?me:he),zr(Q,Ct?"height":"width",Ct?ce:K),VI(Q,om)}else pl(Q,om)}),yt=St=Nt=at=nn=pn=dn=Dn=Xt=null,$t=1,Ka(!0),he!=$||me!=Ve||K!=qe||ce!=mt){Wa(!1);let Q=K/qe,fe=ce/mt;if(oe&&!ke&&G.left>=0){G.left*=Q,G.top*=fe,ye&&Hu(ye,Pa(G.left),0,K,ce),$e&&Hu($e,0,Pa(G.top),K,ce);for(let _e=0;_e<qn.length;_e++){let Me=qn[_e];Me!=null&&(Ji[_e]*=Q,hi[_e]*=fe,Hu(Me,ac(Ji[_e]),ac(hi[_e]),K,ce))}}if(pi.show&&!Le&&pi.left>=0&&pi.width>0){pi.left*=Q,pi.width*=Q,pi.top*=fe,pi.height*=fe;for(let _e in kh)zr(Ia,_e,pi[_e])}$=he,Ve=me,qe=K,mt=ce}Ln("setSize"),gt=!1}Qe>0&&ae>0&&(f.clearRect(0,0,u.width,u.height),Ln("drawClear"),C.forEach(Q=>Q()),Ln("draw")),pi.show&&Le&&(Pl(pi),Le=!1),oe&&ke&&($o(null,!0,!1),ke=!1),Z.show&&Z.live&&ht&&(Sf(),ht=!1),l||(l=!0,i.status=1,Ln("ready")),ve=!1,ps=!1}i.redraw=(Q,fe)=>{kt=fe||!1,Q!==!1?Na(S,N.min,N.max):zs()};function L(Q,fe){let _e=w[Q];if(_e.from==null){if(At==0){let Me=_e.range(i,fe.min,fe.max,Q);fe.min=Me[0],fe.max=Me[1]}if(fe.min>fe.max){let Me=fe.min;fe.min=fe.max,fe.max=Me}if(At>1&&fe.min!=null&&fe.max!=null&&fe.max-fe.min<1e-16)return;Q==S&&_e.distr==2&&At>0&&(fe.min=tu(fe.min,e[0]),fe.max=tu(fe.max,e[0]),fe.min==fe.max&&fe.max++),X[Q]=fe,Mt=!0,zs()}}i.setScale=L;let J,re,ye,$e,tt,Lt,zt,gn,Mn,Ei,Cn,ai,Ar=!1;const Mi=G.drag;let Hi=Mi.x,Ui=Mi.y;oe&&(G.x&&(J=Ql(wPe,g)),G.y&&(re=Ql(EPe,g)),N.ori==0?(ye=J,$e=re):(ye=re,$e=J),Cn=G.left,ai=G.top);const pi=i.select=Aa({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Ia=pi.show?Ql(SPe,pi.over?g:d):null;function Pl(Q,fe){if(pi.show){for(let _e in Q)pi[_e]=Q[_e],_e in kh&&zr(Ia,_e,Q[_e]);fe!==!1&&Ln("setSelect")}}i.setSelect=Pl;function Jo(Q){if(x[Q].show)de&&VI(Pe[Q],om);else if(de&&pl(Pe[Q],om),oe){let _e=xi?qn[0]:qn[Q];_e!=null&&Hu(_e,-10,-10,K,ce)}}function Na(Q,fe,_e){L(Q,{min:fe,max:_e})}function sr(Q,fe,_e,Me){fe.focus!=null&&Vs(Q),fe.show!=null&&x.forEach((We,Ze)=>{Ze>0&&(Q==Ze||Q==null)&&(We.show=fe.show,Jo(Ze),r==2?(Na(We.facets[0].scale,null,null),Na(We.facets[1].scale,null,null)):Na(We.scale,null,null),zs())}),_e!==!1&&Ln("setSeries",Q,fe),Me&&Zo("setSeries",i,Q,fe)}i.setSeries=sr;function op(Q,fe){Aa(M[Q],fe)}function Cr(Q,fe){Q.fill=Ni(Q.fill||null),Q.dir=Yi(Q.dir,-1),fe=fe??M.length,M.splice(fe,0,Q)}function Ul(Q){Q==null?M.length=0:M.splice(Q,1)}i.addBand=Cr,i.setBand=op,i.delBand=Ul;function Fc(Q,fe){x[Q].alpha=fe,oe&&qn[Q]!=null&&(qn[Q].style.opacity=fe),de&&Pe[Q]&&(Pe[Q].style.opacity=fe)}let Hs,br,Wr;const ur={focus:!0};function Vs(Q){if(Q!=Wr){let fe=Q==null,_e=Qn.alpha!=1;x.forEach((Me,We)=>{if(r==1||We>0){let Ze=fe||We==0||We==Q;Me._focus=fe?null:Ze,_e&&Fc(We,Ze?1:Qn.alpha)}}),Wr=Q,_e&&zs()}}de&&Yn&&Ne(DV,ue,Q=>{G._lock||(Vn(Q),Wr!=null&&sr(null,ur,!0,si.setSeries))});function qa(Q,fe,_e){let Me=w[fe];_e&&(Q=Q/Qi-(Me.ori==1?me:he));let We=K;Me.ori==1&&(We=ce,Q=We-Q),Me.dir==-1&&(Q=We-Q);let Ze=Me._min,Ct=Me._max,Ft=Q/We,Gt=Ze+(Ct-Ze)*Ft,en=Me.distr;return en==3?bv(10,Gt):en==4?jPe(Gt,Me.asinh):en==100?Me.bwd(Gt):Gt}function yg(Q,fe){let _e=qa(Q,S,fe);return tu(_e,e[0],ee,xe)}i.valToIdx=Q=>tu(Q,e[0]),i.posToIdx=yg,i.posToVal=qa,i.valToPos=(Q,fe,_e)=>w[fe].ori==0?a(Q,w[fe],_e?Ye:K,_e?Ge:0):s(Q,w[fe],_e?vt:ce,_e?Je:0),i.setCursor=(Q,fe,_e)=>{Cn=Q.left,ai=Q.top,$o(null,fe,_e)};function lp(Q,fe){zr(Ia,Lb,pi.left=Q),zr(Ia,Ix,pi.width=fe)}function Rh(Q,fe){zr(Ia,fx,pi.top=Q),zr(Ia,Nx,pi.height=fe)}let Bc=N.ori==0?lp:Rh,Ru=N.ori==1?lp:Rh;function cp(){if(de&&Z.live)for(let Q=r==2?1:0;Q<x.length;Q++){if(Q==0&&pe)continue;let fe=Z.values[Q],_e=0;for(let Me in fe)je[Q][_e++].firstChild.nodeValue=fe[Me]}}function Sf(Q,fe){if(Q!=null&&(Q.idxs?Q.idxs.forEach((_e,Me)=>{Y[Me]=_e}):WPe(Q.idx)||Y.fill(Q.idx),Z.idx=Y[0]),de&&Z.live){for(let _e=0;_e<x.length;_e++)(_e>0||r==1&&!pe)&&oo(_e,Y[_e]);cp()}ht=!1,fe!==!1&&Ln("setLegend")}i.setLegend=Sf;function oo(Q,fe){let _e=x[Q],Me=Q==0&&P==2?Oe:e[Q],We;pe?We=_e.values(i,Q,fe)??ze:(We=_e.value(i,fe==null?null:Me[fe],Q,fe),We=We==null?ze:{_:We}),Z.values[Q]=We}function $o(Q,fe,_e){Mn=Cn,Ei=ai,[Cn,ai]=G.move(i,Cn,ai),G.left=Cn,G.top=ai,oe&&(ye&&Hu(ye,Pa(Cn),0,K,ce),$e&&Hu($e,0,Pa(ai),K,ce));let Me,We=ee>xe;Hs=Er,br=null;let Ze=N.ori==0?K:ce,Ct=N.ori==1?K:ce;if(Cn<0||At==0||We){Me=G.idx=null;for(let Ft=0;Ft<x.length;Ft++){let Gt=qn[Ft];Gt!=null&&Hu(Gt,-10,-10,K,ce)}Yn&&sr(null,ur,!0,Q==null&&si.setSeries),Z.live&&(Y.fill(Me),ht=!0)}else{let Ft,Gt,en;r==1&&(Ft=N.ori==0?Cn:ai,Gt=qa(Ft,S),Me=G.idx=tu(Gt,e[0],ee,xe),en=j(e[0][Me],N,Ze,0));let Qt=-10,fn=-10,Fn=0,mi=0,Wn=!0,ui="",Rn="";for(let yn=r==2?1:0;yn<x.length;yn++){let fr=x[yn],Rr=Y[yn],ia=Rr==null?null:r==1?e[yn][Rr]:e[yn][1][Rr],Zi=G.dataIdx(i,yn,Me,Gt),Xr=Zi==null?null:r==1?e[yn][Zi]:e[yn][1][Zi];if(ht=ht||Xr!=ia||Zi!=Rr,Y[yn]=Zi,yn>0&&fr.show){let Ws=Zi==null?-10:Zi==Me?en:j(r==1?e[0][Zi]:e[yn][0][Zi],N,Ze,0),Ya=Xr==null?-10:z(Xr,r==1?w[fr.scale]:w[fr.facets[1].scale],Ct,0);if(Yn&&Xr!=null){let qr=N.ori==1?Cn:ai,uo=Ua(Qn.dist(i,yn,Zi,Ya,qr));if(uo<Hs){let Qo=Qn.bias;if(Qo!=0){let fo=qa(qr,fr.scale),Xs=Xr>=0?1:-1,kr=fo>=0?1:-1;kr==Xs&&(kr==1?Qo==1?Xr>=fo:Xr<=fo:Qo==1?Xr<=fo:Xr>=fo)&&(Hs=uo,br=yn)}else Hs=uo,br=yn}}if(ht||xi){let qr,uo;N.ori==0?(qr=Ws,uo=Ya):(qr=Ya,uo=Ws);let Qo,fo,Xs,kr,el,hr,qs=!0,ms=vn.bbox;if(ms!=null){qs=!1;let ca=ms(i,yn);Xs=ca.left,kr=ca.top,Qo=ca.width,fo=ca.height}else Xs=qr,kr=uo,Qo=fo=vn.size(i,yn);if(hr=vn.fill(i,yn),el=vn.stroke(i,yn),xi)yn==br&&Hs<=Qn.prox&&(Qt=Xs,fn=kr,Fn=Qo,mi=fo,Wn=qs,ui=hr,Rn=el);else{let ca=qn[yn];ca!=null&&(Ji[yn]=Xs,hi[yn]=kr,FV(ca,Qo,fo,qs),PV(ca,hr,el),Hu(ca,ac(Xs),ac(kr),K,ce))}}}}if(xi){let yn=Qn.prox,fr=Wr==null?Hs<=yn:Hs>yn||br!=Wr;if(ht||fr){let Rr=qn[0];Rr!=null&&(Ji[0]=Qt,hi[0]=fn,FV(Rr,Fn,mi,Wn),PV(Rr,ui,Rn),Hu(Rr,ac(Qt),ac(fn),K,ce))}}}if(pi.show&&Ar)if(Q!=null){let[Ft,Gt]=si.scales,[en,Qt]=si.match,[fn,Fn]=Q.cursor.sync.scales,mi=Q.cursor.drag;if(Hi=mi._x,Ui=mi._y,Hi||Ui){let{left:Wn,top:ui,width:Rn,height:yn}=Q.select,fr=Q.scales[fn].ori,Rr=Q.posToVal,ia,Zi,Xr,Ws,Ya,qr=Ft!=null&&en(Ft,fn),uo=Gt!=null&&Qt(Gt,Fn);qr&&Hi?(fr==0?(ia=Wn,Zi=Rn):(ia=ui,Zi=yn),Xr=w[Ft],Ws=j(Rr(ia,fn),Xr,Ze,0),Ya=j(Rr(ia+Zi,fn),Xr,Ze,0),Bc(cu(Ws,Ya),Ua(Ya-Ws))):Bc(0,Ze),uo&&Ui?(fr==1?(ia=Wn,Zi=Rn):(ia=ui,Zi=yn),Xr=w[Gt],Ws=z(Rr(ia,Fn),Xr,Ct,0),Ya=z(Rr(ia+Zi,Fn),Xr,Ct,0),Ru(cu(Ws,Ya),Ua(Ya-Ws))):Ru(0,Ct)}else ne()}else{let Ft=Ua(Mn-tt),Gt=Ua(Ei-Lt);if(N.ori==1){let Fn=Ft;Ft=Gt,Gt=Fn}Hi=Mi.x&&Ft>=Mi.dist,Ui=Mi.y&&Gt>=Mi.dist;let en=Mi.uni;en!=null?Hi&&Ui&&(Hi=Ft>=en,Ui=Gt>=en,!Hi&&!Ui&&(Gt>Ft?Ui=!0:Hi=!0)):Mi.x&&Mi.y&&(Hi||Ui)&&(Hi=Ui=!0);let Qt,fn;Hi&&(N.ori==0?(Qt=zt,fn=Cn):(Qt=gn,fn=ai),Bc(cu(Qt,fn),Ua(fn-Qt)),Ui||Ru(0,Ct)),Ui&&(N.ori==1?(Qt=zt,fn=Cn):(Qt=gn,fn=ai),Ru(cu(Qt,fn),Ua(fn-Qt)),Hi||Bc(0,Ze)),!Hi&&!Ui&&(Bc(0,0),Ru(0,0))}if(Mi._x=Hi,Mi._y=Ui,Q==null){if(_e){if(zc!=null){let[Ft,Gt]=si.scales;si.values[0]=Ft!=null?qa(N.ori==0?Cn:ai,Ft):null,si.values[1]=Gt!=null?qa(N.ori==1?Cn:ai,Gt):null}Zo(r8,i,Cn,ai,K,ce,Me)}if(Yn){let Ft=_e&&si.setSeries,Gt=Qn.prox;Wr==null?Hs<=Gt&&sr(br,ur,!0,Ft):Hs>Gt?sr(null,ur,!0,Ft):br!=Wr&&sr(br,ur,!0,Ft)}}ht&&(Z.idx=Me,Sf()),fe!==!1&&Ln("setCursor")}let Gs=null;Object.defineProperty(i,"rect",{get(){return Gs==null&&Ka(!1),Gs}});function Ka(Q=!1){Q?Gs=null:(Gs=g.getBoundingClientRect(),Ln("syncRect",Gs))}function lo(Q,fe,_e,Me,We,Ze,Ct){G._lock||Ar&&Q!=null&&Q.movementX==0&&Q.movementY==0||(Fl(Q,fe,_e,Me,We,Ze,Ct,!1,Q!=null),Q!=null?$o(null,!0,!0):$o(fe,!0,!1))}function Fl(Q,fe,_e,Me,We,Ze,Ct,Ft,Gt){if(Gs==null&&Ka(!1),Vn(Q),Q!=null)_e=Q.clientX-Gs.left,Me=Q.clientY-Gs.top;else{if(_e<0||Me<0){Cn=-10,ai=-10;return}let[en,Qt]=si.scales,fn=fe.cursor.sync,[Fn,mi]=fn.values,[Wn,ui]=fn.scales,[Rn,yn]=si.match,fr=fe.axes[0].side%2==1,Rr=N.ori==0?K:ce,ia=N.ori==1?K:ce,Zi=fr?Ze:We,Xr=fr?We:Ze,Ws=fr?Me:_e,Ya=fr?_e:Me;if(Wn!=null?_e=Rn(en,Wn)?o(Fn,w[en],Rr,0):-10:_e=Rr*(Ws/Zi),ui!=null?Me=yn(Qt,ui)?o(mi,w[Qt],ia,0):-10:Me=ia*(Ya/Xr),N.ori==1){let qr=_e;_e=Me,Me=qr}}Gt&&(fe==null||fe.cursor.event.type==r8)&&((_e<=1||_e>=K-1)&&(_e=tm(_e,K)),(Me<=1||Me>=ce-1)&&(Me=tm(Me,ce))),Ft?(tt=_e,Lt=Me,[zt,gn]=G.move(i,_e,Me)):(Cn=_e,ai=Me)}const kh={width:0,height:0,left:0,top:0};function ne(){Pl(kh,!1)}let ie,De,Ke,xt;function Ot(Q,fe,_e,Me,We,Ze,Ct){Ar=!0,Hi=Ui=Mi._x=Mi._y=!1,Fl(Q,fe,_e,Me,We,Ze,Ct,!0,!1),Q!=null&&(Ne(a8,jI,Vt,!1),Zo(RV,i,zt,gn,K,ce,null));let{left:Ft,top:Gt,width:en,height:Qt}=pi;ie=Ft,De=Gt,Ke=en,xt=Qt}function Vt(Q,fe,_e,Me,We,Ze,Ct){Ar=Mi._x=Mi._y=!1,Fl(Q,fe,_e,Me,We,Ze,Ct,!1,!0);let{left:Ft,top:Gt,width:en,height:Qt}=pi,fn=en>0||Qt>0,Fn=ie!=Ft||De!=Gt||Ke!=en||xt!=Qt;if(fn&&Fn&&Pl(pi),Mi.setScale&&fn&&Fn){let mi=Ft,Wn=en,ui=Gt,Rn=Qt;if(N.ori==1&&(mi=Gt,Wn=Qt,ui=Ft,Rn=en),Hi&&Na(S,qa(mi,S),qa(mi+Wn,S)),Ui)for(let yn in w){let fr=w[yn];yn!=S&&fr.from==null&&fr.min!=Er&&Na(yn,qa(ui+Rn,yn),qa(ui,yn))}ne()}else G.lock&&(G._lock=!G._lock,$o(fe,!0,Q!=null));Q!=null&&(Fe(a8,jI),Zo(a8,i,Cn,ai,K,ce,null))}function Tt(Q,fe,_e,Me,We,Ze,Ct){if(G._lock)return;Vn(Q);let Ft=Ar;if(Ar){let Gt=!0,en=!0,Qt=10,fn,Fn;N.ori==0?(fn=Hi,Fn=Ui):(fn=Ui,Fn=Hi),fn&&Fn&&(Gt=Cn<=Qt||Cn>=K-Qt,en=ai<=Qt||ai>=ce-Qt),fn&&Gt&&(Cn=Cn<zt?0:K),Fn&&en&&(ai=ai<gn?0:ce),$o(null,!0,!0),Ar=!1}Cn=-10,ai=-10,Y.fill(null),$o(null,!0,!0),Ft&&(Ar=Ft)}function Bt(Q,fe,_e,Me,We,Ze,Ct){G._lock||(Vn(Q),ft(),ne(),Q!=null&&Zo(OV,i,Cn,ai,K,ce,null))}function rn(){_.forEach(o4e),jt(i.width,i.height,!0)}Fm(ST,R0,rn);const ln={};ln.mousedown=Ot,ln.mousemove=lo,ln.mouseup=Vt,ln.dblclick=Bt,ln.setSeries=(Q,fe,_e,Me)=>{let We=si.match[2];_e=We(i,fe,_e),_e!=-1&&sr(_e,Me,!0,!1)},oe&&(Ne(RV,g,Ot),Ne(r8,g,lo),Ne(kV,g,Q=>{Vn(Q),Ka(!1)}),Ne(DV,g,Tt),Ne(OV,g,Bt),YI.add(i),i.syncRect=Ka);const Jn=i.hooks=t.hooks||{};function Ln(Q,fe,_e){Xa?$i.push([Q,fe,_e]):Q in Jn&&Jn[Q].forEach(Me=>{Me.call(null,i,fe,_e)})}(t.plugins||[]).forEach(Q=>{for(let fe in Q.hooks)Jn[fe]=(Jn[fe]||[]).concat(Q.hooks[fe])});const na=(Q,fe,_e)=>_e,si=Aa({key:null,setSeries:!1,filters:{pub:VV,sub:VV},scales:[S,x[1]?x[1].scale:null],match:[GV,GV,na],values:[null,null]},G.sync);si.match.length==2&&si.match.push(na),G.sync=si;const zc=si.key,Fr=Mte(zc);function Zo(Q,fe,_e,Me,We,Ze,Ct){si.filters.pub(Q,fe,_e,Me,We,Ze,Ct)&&Fr.pub(Q,fe,_e,Me,We,Ze,Ct)}Fr.sub(i);function wf(Q,fe,_e,Me,We,Ze,Ct){si.filters.sub(Q,fe,_e,Me,We,Ze,Ct)&&ln[Q](null,fe,_e,Me,We,Ze,Ct)}i.pub=wf;function co(){Fr.unsub(i),YI.delete(i),Re.clear(),GI(ST,R0,rn),c.remove(),ue?.remove(),Ln("destroy")}i.destroy=co;function Dh(){Ln("init",t,e),_t(e||t.data,!1),X[S]?L(S,X[S]):ft(),Le=pi.show&&(pi.width>0||pi.height>0),ke=ht=!0,jt(t.width,t.height)}return x.forEach(Ii),_.forEach(Ue),n?n instanceof HTMLElement?(n.appendChild(c),Dh()):n(i,Dh):Dh(),i}ao.assign=Aa;ao.fmtNum=v4;ao.rangeNum=wT;ao.rangeLog=UC;ao.rangeAsinh=g4;ao.orient=bg;ao.pxRatio=Qi;ao.join=ZPe;ao.fmtDate=x4,ao.tzDate=cUe;ao.sync=Mte;{ao.addGap=WUe,ao.clipGaps=zC;let t=ao.paths={points:Dte};t.linear=Ite,t.stepped=KUe,t.bars=YUe,t.spline=$Ue}const l4e=Object.freeze(Object.defineProperty({__proto__:null,default:ao},Symbol.toStringTag,{value:"Module"})),c4e=Dre(l4e);(function(t,e){(function(i,r){t.exports=r(I,c4e)})(zm,(n,i)=>(()=>{var r={"./common/index.ts":(l,c,u)=>{u.r(c),u.d(c,{dataMatch:()=>d,optionsUpdateState:()=>h});var f=function(g,b){var y={};for(var p in g)Object.prototype.hasOwnProperty.call(g,p)&&b.indexOf(p)<0&&(y[p]=g[p]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,p=Object.getOwnPropertySymbols(g);x<p.length;x++)b.indexOf(p[x])<0&&Object.prototype.propertyIsEnumerable.call(g,p[x])&&(y[p[x]]=g[p[x]]);return y};Object.is||Object.defineProperty(Object,"is",{value:function(b,y){return b===y&&(b!==0||1/b===1/y)||b!==b&&y!==y}});var h=function(b,y){var p=b.width,x=b.height,_=f(b,["width","height"]),w=y.width,M=y.height,S=f(y,["width","height"]),A="keep";if((x!==M||p!==w)&&(A="update"),Object.keys(_).length!==Object.keys(S).length)return"create";for(var C=0,k=Object.keys(_);C<k.length;C++){var R=k[C];if(!Object.is(_[R],S[R])){A="create";break}}return A},d=function(b,y){return b.length!==y.length?!1:b.every(function(p,x){var _=y[x];return p.length!==_.length?!1:p.every(function(w,M){return w===_[M]})})}},react:l=>{l.exports=n},uplot:l=>{l.exports=i}},a={};function s(l){var c=a[l];if(c!==void 0)return c.exports;var u=a[l]={exports:{}};return r[l](u,u.exports,s),u.exports}s.n=l=>{var c=l&&l.__esModule?()=>l.default:()=>l;return s.d(c,{a:c}),c},s.d=(l,c)=>{for(var u in c)s.o(c,u)&&!s.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:c[u]})},s.o=(l,c)=>Object.prototype.hasOwnProperty.call(l,c),s.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var o={};return(()=>{/*!*******************************!*\
  !*** ./react/uplot-react.tsx ***!
  \*******************************/s.r(o),s.d(o,{default:()=>d});var l=s("react"),c=s.n(l),u=s("uplot"),f=s.n(u),h=s("./common/index.ts");function d(g){var b=g.options,y=g.data,p=g.target,x=g.onDelete,_=g.onCreate,w=g.resetScales,M=w===void 0?!0:w,S=g.className,A=(0,l.useRef)(null),C=(0,l.useRef)(null),k=(0,l.useRef)(b),R=(0,l.useRef)(p),N=(0,l.useRef)(y),P=(0,l.useRef)(_),j=(0,l.useRef)(x);(0,l.useEffect)(function(){P.current=_,j.current=x});var z=(0,l.useCallback)(function(F){var H;F&&((H=j.current)===null||H===void 0||H.call(j,F),F.destroy(),A.current=null)},[]),X=(0,l.useCallback)(function(){var F,H=new(f())(k.current,N.current,R.current||C.current);A.current=H,(F=P.current)===null||F===void 0||F.call(P,H)},[]);return(0,l.useEffect)(function(){return X(),function(){z(A.current)}},[X,z]),(0,l.useEffect)(function(){if(k.current!==b){var F=(0,h.optionsUpdateState)(k.current,b);k.current=b,!A.current||F==="create"?(z(A.current),X()):F==="update"&&A.current.setSize({width:b.width,height:b.height})}},[b,X,z]),(0,l.useEffect)(function(){N.current!==y&&(A.current?(0,h.dataMatch)(N.current,y)||(M?A.current.setData(y,!0):(A.current.setData(y,!1),A.current.redraw())):(N.current=y,X()),N.current=y)},[y,M,X]),(0,l.useEffect)(function(){return R.current!==p&&(R.current=p,X()),function(){return z(A.current)}},[p,X,z]),p?null:c().createElement("div",{ref:C,className:S})}})(),o=o.default,o})())})(Jee);var u4e=Jee.exports;const f4e=Rc(u4e);function hG({props:t,onExpand:e}){const[n,i]=I.useState(!1),{ref:r,width:a}=bq(),s=ba(),{colorScheme:o}=Vd(),[l,c,u]=I.useMemo(()=>{const b=t.data.map(x=>new Float64Array(x.buffer.slice(x.byteOffset,x.byteOffset+x.byteLength)));let y=1/0,p=-1/0;for(const x of b[0])x<y&&(y=x),x>p&&(p=x);return[b,y,p]},[t.data]),f=I.useMemo(()=>{const b=o==="dark"?s.colors.gray[5]:s.colors.gray[7],y=o==="dark"?"rgba(255, 255, 255, 0.03)":s.colors.gray[2];let p=t.axes;return p==null?p=[{stroke:b,grid:{stroke:y,show:!0}},{stroke:b,grid:{stroke:y,show:!0}}]:p=p.map(x=>{if(x==null)return x;const _={...x};return _.stroke===void 0&&(_.stroke=b),_.grid===void 0?_.grid={stroke:y}:_.grid!==null&&_.grid.stroke===void 0&&(_.grid={..._.grid,stroke:y}),_.ticks===void 0?_.ticks={stroke:b}:_.ticks!==null&&_.ticks.stroke===void 0&&(_.ticks={..._.ticks,stroke:b}),_}),{width:a,height:a/t.aspect,title:t.title||void 0,mode:t.mode||void 0,series:t.series||[],cursor:t.cursor||void 0,bands:t.bands||void 0,scales:t.scales||void 0,axes:p,legend:t.legend||void 0,focus:t.focus||void 0,padding:[0,24,0,0]}},[a,t.aspect,t.title,t.mode,t.series,t.cursor,t.bands,t.scales,t.axes,t.legend,t.focus,o]),[h,d]=I.useState(),g=I.useRef({relMin:0,relMax:1});return I.useEffect(()=>{if(!h)return;const b=Object.keys(h.scales)[0],y=h.scales[b];if(y.auto===!1)return;const p=u-c;if(p!==0)return h.setScale(b,{min:c+g.current.relMin*p,max:c+g.current.relMax*p}),()=>{g.current={relMin:((y.min??0)-c)/p,relMax:((y.max??1)-c)/p}}},[c,u,h]),D.jsxs(Ps,{ref:r,className:`${h4} uplot-container`,withBorder:!0,style:{position:"relative"},onMouseEnter:e?()=>i(!0):void 0,onMouseLeave:e?()=>i(!1):void 0,children:[f&&D.jsx(f4e,{resetScales:!1,onCreate:b=>{d(b)},onDelete:()=>{d(void 0)},options:f,data:l},o),e&&n&&D.jsx(Pr,{label:"Expand plot",children:D.jsx(Ol,{onClick:e,variant:"subtle",color:"gray",size:"sm",style:{position:"absolute",top:8,right:8,backgroundColor:o==="dark"?"rgba(255, 255, 255, 0.1)":"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(4px)"},children:D.jsx(EQ,{size:14})})})]})}function h4e(t){const[e,{open:n,close:i}]=Ec(!1);return t.props.visible===!1?null:D.jsxs(st,{children:[D.jsx(hG,{...t,onExpand:n}),D.jsx(Ro,{opened:e,onClose:i,size:"xl",children:D.jsx(hG,{...t})})]})}function d4e({props:{_tab_labels:t,_tab_icons_html:e,_tab_container_ids:n,visible:i}}){const{GuiContainer:r}=I.useContext(hs);return i?D.jsxs(Zf,{radius:"xs",defaultValue:"0",style:{marginTop:"-0.55em"},children:[D.jsx(Zf.List,{children:t.map((a,s)=>D.jsx(Zf.Tab,{value:s.toString(),styles:{tabSection:{marginRight:"0.5em"},tab:{padding:"0.75em"}},leftSection:e[s]===null?void 0:D.jsx("div",{className:qU,dangerouslySetInnerHTML:{__html:e[s]}}),children:a},s))}),n.map((a,s)=>D.jsx(Zf.Panel,{value:s.toString(),children:D.jsx(r,{containerUuid:a})},a))]}):null}function p4e({uuid:t,props:{label:e,visible:n,expand_by_default:i},nextGuiUuid:r}){const a=I.useContext(Si),[s,{toggle:o}]=Ec(i),l=a.useGui(d=>d.guiUuidSetFromContainerUuid[t],xQ),c=I.useContext(hs),u=l===void 0||Object.keys(l).length===0,f=a.useGui(d=>r==null?null:d.guiConfigFromUuid[r]?.type),h=s?OAe:TAe;return n?D.jsxs(Ps,{withBorder:!0,className:h4,mb:f==="GuiFolderMessage"?"md":void 0,children:[D.jsxs(Ps,{className:uPe,style:{cursor:u?void 0:"pointer"},onClick:o,children:[e,D.jsx(h,{className:fPe,style:{display:u?"none":void 0}})]}),D.jsx(gh,{in:s&&!u,children:D.jsx(st,{pt:"0.2em",children:D.jsx(hs.Provider,{value:{...c,folderDepth:c.folderDepth+1},children:D.jsx(c.GuiContainer,{containerUuid:t})})})}),D.jsx(gh,{in:!(s&&!u),children:D.jsx(st,{p:"xs"})})]}):null}function m4e(t,e,n){return Math.max(e,Math.min(n,t))}function g4e({min:t,max:e,step:n=1,value:i,onChange:r,marks:a,fixedEndpoints:s=!1,minRange:o,precision:l=2,id:c,className:u,disabled:f=!1,pt:h,pb:d}){const[g,b]=I.useState(null),y=I.useRef(null),p=ba(),{colorScheme:x}=Vd(),_=k=>(k-t)/(e-t)*100,w=k=>{if(!y.current)return 0;const R=y.current.getBoundingClientRect(),P=(k-R.left)/R.width*(e-t)+t;return n?Math.round(P/n)*n:parseFloat(P.toFixed(l))},M=k=>{if(i.length===0)return-1;let R=1/0,N=0;return i.forEach((P,j)=>{const z=Math.abs(P-k);z<R&&(R=z,N=j)}),N},S=I.useCallback((k,R)=>{const N=[...i];N[R]=m4e(k,t,e);const P=o||n;R<N.length-1&&N[R]>N[R+1]-P&&(N[R]=N[R+1]-P),R>0&&N[R]<N[R-1]+P&&(N[R]=N[R-1]+P),!(s&&(R===0||R===N.length-1))&&r(N)},[i,r,t,e,n,o,s]),A=k=>{if(f||i.length===0)return;const R=w(k.clientX),N=M(R);if(N===-1)return;b(N);const P=z=>{const X=w(z.clientX);S(X,N)},j=()=>{b(null),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",j)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",j)},C=(k,R)=>{if(k.stopPropagation(),f||i.length===0||R>=i.length)return;b(R);const N=j=>{const z=w(j.clientX);S(z,R)},P=()=>{b(null),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",P)};document.addEventListener("mousemove",N),document.addEventListener("mouseup",P)};return D.jsx(st,{id:c,className:`multi-slider ${u||""} ${f?"disabled":""}`,pt:h,pb:d,children:D.jsxs("div",{ref:y,className:"multi-slider-track-container",onMouseDown:A,children:[D.jsx("div",{className:"multi-slider-track"}),i.map((k,R)=>D.jsx(Pr,{label:k.toFixed(l),opened:g===R,position:"top",offset:10,transitionProps:{transition:"fade",duration:0},withinPortal:!0,children:D.jsx("div",{className:`multi-slider-thumb ${g===R?"active":""}`,style:{left:`${_(k)}%`,backgroundColor:f?void 0:p.colors[p.primaryColor][x==="dark"?5:6]},onMouseDown:N=>C(N,R)})},`thumb-${R}`)),a&&a.map((k,R)=>D.jsxs("div",{className:"multi-slider-mark-wrapper",style:{left:`${_(k.value)}%`},children:[D.jsx("div",{className:"multi-slider-mark"}),k.label&&k.label!==null&&D.jsx("div",{className:"multi-slider-mark-label",children:k.label})]},`mark-${R}`))]})})}function b4e({uuid:t,value:e,props:{label:n,hint:i,visible:r,disabled:a,min:s,max:o,precision:l,step:c,_marks:u,fixed_endpoints:f,min_range:h}}){const{setValue:d}=Ee.useContext(hs);if(!r)return null;const g=y=>d(t,y),b=D.jsx(st,{px:"0.1em",children:D.jsx(g4e,{id:t,className:u===null?_Q:void 0,min:s,max:o,step:c??void 0,fixedEndpoints:f,precision:l,minRange:h??void 0,marks:u===null?[{value:s,label:`${s.toFixed(6).replace(/\.?0+$/,"")}`},{value:o,label:`${o.toFixed(6).replace(/\.?0+$/,"")}`}]:u,value:e,onChange:g,disabled:a})});return D.jsx(Cu,{uuid:t,hint:i,label:n,children:b})}function v4e({uuid:t,props:{disabled:e,mime_type:n,color:i,_icon_html:r,label:a}}){const s=I.useContext(Si),o=Ee.useRef(null),{isUploading:l,upload:c}=y4e({viewer:s,componentUuid:t});return D.jsxs(st,{mx:"xs",mb:"0.5em",children:[D.jsx("input",{type:"file",style:{display:"none"},id:`file_upload_${t}`,name:"file",accept:n,ref:o,onChange:u=>{const f=u.target;f.files&&c(f.files[0])}}),D.jsx(ks,{id:t,fullWidth:!0,color:CC(i),onClick:()=>{o.current!==null&&(o.current.value=o.current.defaultValue,o.current.click())},style:{height:"2em"},disabled:e||l,size:"sm",leftSection:r===null?void 0:D.jsx("div",{className:qU,dangerouslySetInnerHTML:{__html:r}}),children:a})]})}function y4e({viewer:t,componentUuid:e}){const n=t.useGui(l=>l.updateUploadState),i=t.useGui(l=>l.uploadsInProgress[e]),r=i?.totalBytes,a=Ee.useMemo(()=>{if(r===void 0)return"";let l=r;const c=["B","K","M","G","T","P"];let u=0;for(;l>=100&&u<c.length-1;)l/=1024,u+=1;return`${l.toFixed(1)}${c[u]}`},[r]);Ee.useEffect(()=>{if(i===void 0)return;const{notificationId:l,filename:c}=i;if(i.uploadedBytes===0)Is.show({id:l,title:`Uploading ${c} (${a})`,message:D.jsx(hf,{size:"sm",value:0}),autoClose:!1,withCloseButton:!1,loading:!0});else{const u=i.uploadedBytes/i.totalBytes,f=u===1;Is.update({id:l,title:`Uploading ${c} (${a})`,message:f?"File uploaded successfully.":D.jsx(hf,{size:"sm",transitionDuration:10,value:100*u}),autoClose:f,withCloseButton:f,loading:!f,icon:f?D.jsx(KU,{}):void 0})}},[i,a]);const s=i!==void 0&&i.uploadedBytes<i.totalBytes;async function o(l){const c=t.mutable.current,u=512*1024,f=Math.ceil(l.size/u),h=yQ(),d="upload-"+h;n({componentId:e,uploadedBytes:0,totalBytes:l.size,filename:l.name,notificationId:d}),c.sendMessage({type:"FileTransferStartUpload",source_component_uuid:e,transfer_uuid:h,filename:l.name,mime_type:l.type,size_bytes:l.size,part_count:f});for(let g=0;g<f;g++){const b=g*u,y=(g+1)*u,x=await l.slice(b,y).arrayBuffer();c.sendMessage({type:"FileTransferPart",source_component_uuid:e,transfer_uuid:h,part_index:g,content:new Uint8Array(x)})}}return{isUploading:s,upload:o}}function x4e({value:t,props:{visible:e,color:n,animated:i}}){return e?D.jsx(st,{pb:"xs",px:"xs",children:D.jsx(hf,{radius:"xs",color:CC(n),value:t,animated:i,transitionDuration:0})}):null}function _4e({props:t}){if(!t.visible)return null;const[e,n]=I.useState(null);return I.useEffect(()=>{if(t._data===null)n(null);else{const i=URL.createObjectURL(new Blob([t._data],{type:"image/"+t._format}));return n(i),()=>{URL.revokeObjectURL(i)}}},[t._data,t._format]),e===null?null:D.jsxs(st,{px:"xs",children:[t.label===null?null:D.jsx(bu,{fz:"sm",style:{display:"block"},children:t.label}),D.jsx("img",{src:e,style:{maxWidth:"100%",height:"auto"}})]})}function S4e({props:t}){return t.visible?D.jsx("div",{dangerouslySetInnerHTML:{__html:t.content}}):null}const w4e=.35,u8=.2,$I=360,E4e=260,ZI=.9,EM=250,MM=12,M4e=3,T4e=Math.max(M4e-1,0);function A4e(t,e){if(!e||e.length!==t)return Array.from({length:t},()=>1/Math.max(t,1));const n=e.map(r=>Number.isFinite(r)&&r>0?r:0),i=n.reduce((r,a)=>r+a,0);return i<=0?Array.from({length:t},()=>1/Math.max(t,1)):n.map(r=>r/i)}function C4e(t){const{GuiContainer:e}=Ee.useContext(hs),n=t.props._column_container_ids,i=t.props.visible,r=Ee.useMemo(()=>A4e(n.length,t.props.column_widths),[n.length,t.props.column_widths]),[a,s]=Ee.useState(0),[o,l]=gq(),c=l.width;if(n.length===0)return null;const u=n.length,f=Math.max(u-1,0),h=MM*Math.max(n.length-1,0),d=$I*ZI,g=(u>0?d:0)+f*EM+h,y=c!==void 0&&c+6<g,p=Ee.useMemo(()=>{if(y||c===void 0||n.length===0)return null;const _=n.length,w=Math.max(_-1,0),M=MM*Math.max(_-1,0),S=c-M;if(S<=0)return null;const A=new Array(_);let C=$I;const k=Array.from({length:w},()=>E4e),R=C+k.reduce((j,z)=>j+z,0);if(R<=0)return null;if(S>=R){const j=S/R;C*=j;for(let z=0;z<k.length;z+=1)k[z]*=j}else{let j=R-S;const z=k.map(X=>Math.min(X,EM));if(j>0&&w>0){const X=k.reduce((H,V,W)=>H+Math.max(V-z[W],0),0),F=Math.min(j,X);if(F>0){let H=F,V=w;for(let W=0;W<w&&!(H<=0);W+=1){const B=z[W],Y=k[W],Z=Math.max(Y-B,0),G=Math.min(Z,H/Math.max(V,1));k[W]=Y-G,H-=G,V-=1}j-=F}}if(j>0){const X=C*ZI,F=Math.min(j,Math.max(C-X,0));F>0&&(C-=F,j-=F)}}A[0]=C;for(let j=0;j<w;j+=1)A[j+1]=k[j];const N=A.reduce((j,z)=>j+z,0),P=S-N;return Math.abs(P)>.001&&_>0&&(A[_-1]=Math.max(A[_-1]+P,0)),A},[y,c,n,r]);Ee.useEffect(()=>{a>=n.length&&s(0)},[a,n.length]);const x=Ee.useMemo(()=>n.map((_,w)=>`Column ${w+1}`),[n]);return D.jsx(st,{ref:o,style:{display:i?void 0:"none",width:"100%"},children:y?D.jsxs(Pd,{gap:"sm",children:[D.jsx(kP,{fullWidth:!0,value:String(a),onChange:_=>s(Number(_)),data:x.map((_,w)=>({value:String(w),label:_}))}),D.jsx(st,{children:D.jsx(e,{containerUuid:n[a]})})]}):D.jsx(ff,{gap:`${MM}px`,align:"flex-start",wrap:"nowrap",style:{width:"100%"},children:n.map((_,w)=>{const M=w===0?d:EM,S=p?.[w],A=S?{flex:`0 0 ${S}px`,width:`${S}px`,minWidth:`${M}px`}:{flexGrow:r[w],flexShrink:w===0?0:1,flexBasis:0,minWidth:`${M}px`};return D.jsx(st,{style:A,children:D.jsx(e,{containerUuid:_})},_)})})})}function A4({containerUuid:t}){const n=Ee.useContext(Si).useGui(a=>a.updateGuiProps),i=AC(50).send;function r(a,s){n(a,{value:s}),i({type:"GuiUpdateMessage",uuid:a,updates:{value:s}})}return D.jsx(hs.Provider,{value:{folderDepth:0,GuiContainer:dG,messageSender:i,setValue:r},children:D.jsx(dG,{containerUuid:t})})}function dG({containerUuid:t}){const e=Ee.useContext(Si);e.useGui.getState().guiUuidSetFromContainerUuid[t]===void 0&&e.useGui.setState({...e.useGui.getState(),guiUuidSetFromContainerUuid:{...e.useGui.getState().guiUuidSetFromContainerUuid,[t]:{}}});const n=e.useGui(o=>o.guiUuidSetFromContainerUuid[t],xQ),i=[...Object.keys(n)],r=e.useGui(o=>o.guiOrderFromUuid);let a=i.map(o=>({uuid:o,order:r[o]}));return a=a.sort((o,l)=>o.order-l.order),D.jsx(st,{pt:"xs",children:a.map((o,l)=>D.jsx(R4e,{guiUuid:o.uuid,nextGuiUuid:a[l+1]?.uuid??null},o.uuid))})}function R4e(t){const n=Ee.useContext(Si).useGui(i=>i.guiConfigFromUuid[t.guiUuid]);if(n===void 0)return console.error("Tried to render non-existent component",t.guiUuid),null;switch(n.type){case"GuiFolderMessage":return D.jsx(p4e,{...n,nextGuiUuid:t.nextGuiUuid});case"GuiTabGroupMessage":return D.jsx(d4e,{...n});case"GuiColumnsMessage":return D.jsx(C4e,{...n});case"GuiMarkdownMessage":return D.jsx(cPe,{...n});case"GuiHtmlMessage":return D.jsx(S4e,{...n});case"GuiPlotlyMessage":return D.jsx(hPe,{...n});case"GuiUplotMessage":return D.jsx(h4e,{...n});case"GuiImageMessage":return D.jsx(_4e,{...n});case"GuiButtonMessage":return D.jsx(rAe,{...n});case"GuiUploadButtonMessage":return D.jsx(v4e,{...n});case"GuiSliderMessage":return D.jsx(sAe,{...n});case"GuiMultiSliderMessage":return D.jsx(b4e,{...n});case"GuiNumberMessage":return D.jsx(oAe,{...n});case"GuiTextMessage":return D.jsx(lAe,{...n});case"GuiCheckboxMessage":return D.jsx(cAe,{...n});case"GuiVector2Message":return D.jsx(uAe,{...n});case"GuiVector3Message":return D.jsx(fAe,{...n});case"GuiDropdownMessage":return D.jsx(hAe,{...n});case"GuiRgbMessage":return D.jsx(yCe,{...n});case"GuiRgbaMessage":return D.jsx(xCe,{...n});case"GuiButtonGroupMessage":return D.jsx(_Ce,{...n});case"GuiProgressBarMessage":return D.jsx(x4e,{...n});default:k4e(n)}}function k4e(t){throw new Error("Unexpected object: "+t.type)}const D4e=I.forwardRef(function({points:e,color:n=16777215,vertexColors:i,linewidth:r,lineWidth:a,segments:s,dashed:o,...l},c){const u=ki(b=>b.size),f=I.useMemo(()=>s?new LU:new HZ,[s]),[h]=I.useState(()=>new wC),d=3,g=I.useMemo(()=>{const b=s?new SC:new NU;if(b.setPositions(e),i){const y=new Float32Array(i).map(p=>p/255);n=16777215,b.setColors(y,d)}return b},[e,s,i,d]);return I.useLayoutEffect(()=>{f.computeLineDistances()},[e,f]),I.useLayoutEffect(()=>{o?h.defines.USE_DASH="":delete h.defines.USE_DASH,h.needsUpdate=!0},[o,h]),I.useEffect(()=>()=>{g.dispose(),h.dispose()},[g]),D.jsxs("primitive",{object:f,ref:c,...l,children:[D.jsx("primitive",{object:g,attach:"geometry"}),D.jsx("primitive",{object:h,attach:"material",color:n,vertexColors:!!i,resolution:[u.width,u.height],linewidth:r??a??1,dashed:o,transparent:!1,...l})]})}),O4e=I.forwardRef(function({props:e,children:n},i){const r=I.useMemo(()=>new Float32Array(e.points.buffer.slice(e.points.byteOffset,e.points.byteOffset+e.points.byteLength)),[e.points]),a=I.useMemo(()=>new Uint8Array(e.colors.buffer.slice(e.colors.byteOffset,e.colors.byteOffset+e.colors.byteLength)),[e.colors]),{color:s,vertexColors:o}=I.useMemo(()=>a.length===3?{color:a[0]<<16|a[1]<<8|a[2],vertexColors:void 0}:{color:void 0,vertexColors:a},[a]);return D.jsxs("group",{ref:i,children:[D.jsx(D4e,{points:r,lineWidth:e.line_width,color:s,vertexColors:o,segments:!0}),n]})}),pG={"shadow-camera-near":.001,"shadow-camera-far":500,"shadow-bias":-1e-5,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024,"shadow-radius":4},f8=new Dt;class GC{constructor(e){e=e||{},this.zNear=e.webGL===!0?-1:0,this.vertices={near:[new te,new te,new te,new te],far:[new te,new te,new te,new te]},e.projectionMatrix!==void 0&&this.setFromProjectionMatrix(e.projectionMatrix,e.maxFar||1e4)}setFromProjectionMatrix(e,n){const i=this.zNear,r=e.elements[2*4+3]===0;return f8.copy(e).invert(),this.vertices.near[0].set(1,1,i),this.vertices.near[1].set(1,-1,i),this.vertices.near[2].set(-1,-1,i),this.vertices.near[3].set(-1,1,i),this.vertices.near.forEach(function(a){a.applyMatrix4(f8)}),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach(function(a){a.applyMatrix4(f8);const s=Math.abs(a.z);r?a.z*=Math.min(n/s,1):a.multiplyScalar(Math.min(n/s,1))}),this.vertices}split(e,n){for(;e.length>n.length;)n.push(new GC);n.length=e.length;for(let i=0;i<e.length;i++){const r=n[i];if(i===0)for(let a=0;a<4;a++)r.vertices.near[a].copy(this.vertices.near[a]);else for(let a=0;a<4;a++)r.vertices.near[a].lerpVectors(this.vertices.near[a],this.vertices.far[a],e[i-1]);if(i===e.length-1)for(let a=0;a<4;a++)r.vertices.far[a].copy(this.vertices.far[a]);else for(let a=0;a<4;a++)r.vertices.far[a].lerpVectors(this.vertices.near[a],this.vertices.far[a],e[i])}}toSpace(e,n){for(let i=0;i<4;i++)n.vertices.near[i].copy(this.vertices.near[i]).applyMatrix4(e),n.vertices.far[i].copy(this.vertices.far[i]).applyMatrix4(e)}}const mG={lights_fragment_begin:`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );

vec3 geometryClearcoatNormal = vec3( 0.0 );

#ifdef USE_CLEARCOAT

	geometryClearcoatNormal = clearcoatNormal;

#endif

#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		// Iridescence F0 approximation
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif

IncidentLight directLight;

#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )

	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {

		pointLight = pointLights[ i ];

		getPointLightInfo( pointLight, geometryPosition, directLight );

		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;

		#endif

		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )

	SpotLight spotLight;
 	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;

	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {

		spotLight = spotLights[ i ];

		getSpotLightInfo( spotLight, geometryPosition, directLight );

  		// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX

		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;

		#endif

		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )

	DirectionalLight directionalLight;
	float linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif

	#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )
		vec2 cascade;
		float cascadeCenter;
		float closestEdge;
		float margin;
		float csmx;
		float csmy;

		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {

			directionalLight = directionalLights[ i ];
			getDirectionalLightInfo( directionalLight, directLight );

			#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
				// NOTE: Depth gets larger away from the camera.
				// cascade.x is closer, cascade.y is further
				cascade = CSM_cascades[ i ];
				cascadeCenter = ( cascade.x + cascade.y ) / 2.0;
				closestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;
				margin = 0.25 * pow( closestEdge, 2.0 );
				csmx = cascade.x - margin / 2.0;
				csmy = cascade.y + margin / 2.0;
				if( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {

					float dist = min( linearDepth - csmx, csmy - linearDepth );
					float ratio = clamp( dist / margin, 0.0, 1.0 );

					vec3 prevColor = directLight.color;
					directionalLightShadow = directionalLightShadows[ i ];
					directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;

					bool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;
					directLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );

					ReflectedLight prevLight = reflectedLight;
					RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

					bool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;
					float blendRatio = shouldBlend ? ratio : 1.0;

					reflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );
					reflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );
					reflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );
					reflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );

				}
			#endif

		}
		#pragma unroll_loop_end
	#elif defined (USE_SHADOWMAP)

		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {

			directionalLight = directionalLights[ i ];
			getDirectionalLightInfo( directionalLight, directLight );

			#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )

				directionalLightShadow = directionalLightShadows[ i ];
				if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;

				if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

			#endif

		}
		#pragma unroll_loop_end

	#elif ( NUM_DIR_LIGHT_SHADOWS > 0 )
		// note: no loop here - all CSM lights are in fact one light only
		getDirectionalLightInfo( directionalLights[0], directLight );
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	#endif

	#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)
		// compute the lights not casting shadows (if any)

		#pragma unroll_loop_start
		for ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {

			directionalLight = directionalLights[ i ];

			getDirectionalLightInfo( directionalLight, directLight );

			RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

		}
		#pragma unroll_loop_end

	#endif

#endif


#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )

	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {

		directionalLight = directionalLights[ i ];

		getDirectionalLightInfo( directionalLight, directLight );

		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif

		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )

	RectAreaLight rectAreaLight;

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {

		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if defined( RE_IndirectDiffuse )

	vec3 iblIrradiance = vec3( 0.0 );

	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );

	#if defined( USE_LIGHT_PROBES )

		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );

	#endif

	#if ( NUM_HEMI_LIGHTS > 0 )

		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {

			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );

		}
		#pragma unroll_loop_end

	#endif

#endif

#if defined( RE_IndirectSpecular )

	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );

#endif
`,lights_pars_begin:`
#if defined( USE_CSM ) && defined( CSM_CASCADES )
uniform vec2 CSM_cascades[CSM_CASCADES];
uniform float cameraNear;
uniform float shadowFar;
#endif
	`+hn.lights_pars_begin},gG=new Dt,h8=new GC({webGL:!0}),jf=new te,dx=new rr,d8=[],p8=[],m8=new Dt,bG=new Dt,I4e=new te(0,1,0);class N4e{constructor(e){this.camera=e.camera,this.parent=e.parent,this.cascades=e.cascades||3,this.maxFar=e.maxFar||1e5,this.mode=e.mode||"practical",this.shadowMapSize=e.shadowMapSize||2048,this.shadowBias=e.shadowBias||1e-6,this.lightDirection=e.lightDirection||new te(1,-1,1).normalize(),this.lightIntensity=e.lightIntensity||3,this.lightNear=e.lightNear||1,this.lightFar=e.lightFar||2e3,this.lightMargin=e.lightMargin||200,this.customSplitsCallback=e.customSplitsCallback,this.fade=!1,this.mainFrustum=new GC({webGL:!0}),this.frustums=[],this.breaks=[],this.lights=[],this.shaders=new Map,this._createLights(),this.updateFrustums(),this._injectInclude()}_createLights(){for(let e=0;e<this.cascades;e++){const n=new gC(16777215,this.lightIntensity);n.castShadow=!0,n.shadow.mapSize.width=this.shadowMapSize,n.shadow.mapSize.height=this.shadowMapSize,n.shadow.camera.near=this.lightNear,n.shadow.camera.far=this.lightFar,n.shadow.bias=this.shadowBias,this.parent.add(n),this.parent.add(n.target),this.lights.push(n)}}_initCascades(){const e=this.camera;e.updateProjectionMatrix(),this.mainFrustum.setFromProjectionMatrix(e.projectionMatrix,this.maxFar),this.mainFrustum.split(this.breaks,this.frustums)}_updateShadowBounds(){const e=this.frustums;for(let n=0;n<e.length;n++){const r=this.lights[n].shadow.camera,a=this.frustums[n],s=a.vertices.near,o=a.vertices.far,l=o[0];let c;l.distanceTo(o[2])>l.distanceTo(s[2])?c=o[2]:c=s[2];let u=l.distanceTo(c);if(this.fade){const f=this.camera,h=Math.max(f.far,this.maxFar),d=a.vertices.far[0].z/(h-f.near),g=.25*Math.pow(d,2)*(h-f.near);u+=g}r.left=-u/2,r.right=u/2,r.top=u/2,r.bottom=-u/2,r.updateProjectionMatrix()}}_getBreaks(){const e=this.camera,n=Math.min(e.far,this.maxFar);switch(this.breaks.length=0,this.mode){case"uniform":i(this.cascades,e.near,n,this.breaks);break;case"logarithmic":r(this.cascades,e.near,n,this.breaks);break;case"practical":a(this.cascades,e.near,n,.5,this.breaks);break;case"custom":this.customSplitsCallback===void 0&&console.error("CSM: Custom split scheme callback not defined."),this.customSplitsCallback(this.cascades,e.near,n,this.breaks);break}function i(s,o,l,c){for(let u=1;u<s;u++)c.push((o+(l-o)*u/s)/l);c.push(1)}function r(s,o,l,c){for(let u=1;u<s;u++)c.push(o*(l/o)**(u/s)/l);c.push(1)}function a(s,o,l,c,u){d8.length=0,p8.length=0,r(s,o,l,p8),i(s,o,l,d8);for(let f=1;f<s;f++)u.push(yc.lerp(d8[f-1],p8[f-1],c));u.push(1)}}update(){const e=this.camera,n=this.frustums;m8.lookAt(new te,this.lightDirection,I4e),bG.copy(m8).invert();for(let i=0;i<n.length;i++){const r=this.lights[i],a=r.shadow.camera,s=(a.right-a.left)/this.shadowMapSize,o=(a.top-a.bottom)/this.shadowMapSize;gG.multiplyMatrices(bG,e.matrixWorld),n[i].toSpace(gG,h8);const l=h8.vertices.near,c=h8.vertices.far;dx.makeEmpty();for(let u=0;u<4;u++)dx.expandByPoint(l[u]),dx.expandByPoint(c[u]);dx.getCenter(jf),jf.z=dx.max.z+this.lightMargin,jf.x=Math.floor(jf.x/s)*s,jf.y=Math.floor(jf.y/o)*o,jf.applyMatrix4(m8),r.position.copy(jf),r.target.position.copy(jf),r.target.position.x+=this.lightDirection.x,r.target.position.y+=this.lightDirection.y,r.target.position.z+=this.lightDirection.z}}_injectInclude(){hn.lights_fragment_begin=mG.lights_fragment_begin,hn.lights_pars_begin=mG.lights_pars_begin}setupMaterial(e){e.defines=e.defines||{},e.defines.USE_CSM=1,e.defines.CSM_CASCADES=this.cascades,this.fade&&(e.defines.CSM_FADE="");const n=[],i=this,r=this.shaders;e.onBeforeCompile=function(a){const s=Math.min(i.camera.far,i.maxFar);i._getExtendedBreaks(n),a.uniforms.CSM_cascades={value:n},a.uniforms.cameraNear={value:i.camera.near},a.uniforms.shadowFar={value:s},r.set(e,a)},r.set(e,null)}_updateUniforms(){const e=Math.min(this.camera.far,this.maxFar);this.shaders.forEach(function(i,r){if(i!==null){const a=i.uniforms;this._getExtendedBreaks(a.CSM_cascades.value),a.cameraNear.value=this.camera.near,a.shadowFar.value=e}!this.fade&&"CSM_FADE"in r.defines?(delete r.defines.CSM_FADE,r.needsUpdate=!0):this.fade&&!("CSM_FADE"in r.defines)&&(r.defines.CSM_FADE="",r.needsUpdate=!0)},this)}_getExtendedBreaks(e){for(;e.length<this.breaks.length;)e.push(new wt);e.length=this.breaks.length;for(let n=0;n<this.cascades;n++){const i=this.breaks[n],r=this.breaks[n-1]||0;e[n].x=r,e[n].y=i}}updateFrustums(){this._getBreaks(),this._initCascades(),this._updateShadowBounds(),this._updateUniforms()}remove(){for(let e=0;e<this.lights.length;e++)this.parent.remove(this.lights[e].target),this.parent.remove(this.lights[e])}dispose(){const e=this.shaders;e.forEach(function(n,i){delete i.onBeforeCompile,delete i.defines.USE_CSM,delete i.defines.CSM_CASCADES,delete i.defines.CSM_FADE,n!==null&&(delete n.uniforms.CSM_cascades,delete n.uniforms.cameraNear,delete n.uniforms.shadowFar),i.needsUpdate=!0}),e.clear()}}class L4e extends xl{constructor(e){super(),this.csm=e,this.displayFrustum=!0,this.displayPlanes=!0,this.displayShadowBounds=!0;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new On;r.setIndex(new In(n,1)),r.setAttribute("position",new In(i,3,!1));const a=new Lc(r,new Us);this.add(a),this.frustumLines=a,this.cascadeLines=[],this.cascadePlanes=[],this.shadowLines=[]}updateVisibility(){const e=this.displayFrustum,n=this.displayPlanes,i=this.displayShadowBounds,r=this.frustumLines,a=this.cascadeLines,s=this.cascadePlanes,o=this.shadowLines;for(let l=0,c=a.length;l<c;l++){const u=a[l],f=s[l],h=o[l];u.visible=e,f.visible=e&&n,h.visible=i}r.visible=e}update(){const e=this.csm,n=e.camera,i=e.cascades,r=e.mainFrustum,a=e.frustums,s=e.lights,l=this.frustumLines.geometry.getAttribute("position"),c=this.cascadeLines,u=this.cascadePlanes,f=this.shadowLines;if(n===null)return;for(this.position.copy(n.position),this.quaternion.copy(n.quaternion),this.scale.copy(n.scale),this.updateMatrixWorld(!0);c.length>i;)this.remove(c.pop()),this.remove(u.pop()),this.remove(f.pop());for(;c.length<i;){const g=new aI(new rr,16711935),b=new Ds({transparent:!0,opacity:.1,depthWrite:!1,side:Jr}),y=new _i(new Il,b),p=new xl,x=new aI(new rr,16711680);p.add(x),this.add(g),this.add(y),this.add(p),c.push(g),u.push(y),f.push(p)}for(let g=0;g<i;g++){const b=a[g],p=s[g].shadow.camera,x=b.vertices.far,_=c[g],w=u[g],M=f[g],S=M.children[0];_.box.min.copy(x[2]),_.box.max.copy(x[0]),_.box.max.z+=1e-4,w.position.addVectors(x[0],x[2]),w.position.multiplyScalar(.5),w.scale.subVectors(x[0],x[2]),w.scale.z=1e-4,this.remove(M),M.position.copy(p.position),M.quaternion.copy(p.quaternion),M.scale.copy(p.scale),M.updateMatrixWorld(!0),this.attach(M),S.box.min.set(p.bottom,p.left,-p.far),S.box.max.set(p.top,p.right,-p.near)}const h=r.vertices.near,d=r.vertices.far;l.setXYZ(0,d[0].x,d[0].y,d[0].z),l.setXYZ(1,d[3].x,d[3].y,d[3].z),l.setXYZ(2,d[2].x,d[2].y,d[2].z),l.setXYZ(3,d[1].x,d[1].y,d[1].z),l.setXYZ(4,h[0].x,h[0].y,h[0].z),l.setXYZ(5,h[3].x,h[3].y,h[3].z),l.setXYZ(6,h[2].x,h[2].y,h[2].z),l.setXYZ(7,h[1].x,h[1].y,h[1].z),l.needsUpdate=!0}dispose(){const e=this.frustumLines,n=this.cascadeLines,i=this.cascadePlanes,r=this.shadowLines;e.geometry.dispose(),e.material.dispose();const a=this.csm.cascades;for(let s=0;s<a;s++){const o=n[s],l=i[s],u=r[s].children[0];o.dispose(),l.geometry.dispose(),l.material.dispose(),u.dispose()}}}let vG="",yG="",OE=0;class P4e{instance;args;constructor(e){this.args=e,OE===0&&(vG=hn.lights_fragment_begin,yG=hn.lights_pars_begin)}attach(){this.instance||(this.instance=new N4e(this.args),OE++)}dispose(){this.instance&&(this.instance.remove(),this.instance.dispose(),this.instance=void 0,OE--,OE===0&&(hn.lights_fragment_begin=vG,hn.lights_pars_begin=yG))}}function xG(t){t.traverse(e=>{const n=e;n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(i=>{i.needsUpdate=!0}):n.material.needsUpdate=!0)})}function QI({maxFar:t=20,shadowMapSize:e=1024,lightIntensity:n=.25,cascades:i=3,fade:r=!0,position:a=[0,0,0],shadowBias:s=-1e-5,lightFar:o=2e3,lightMargin:l=200,lightNear:c=1e-4,mode:u="practical",color:f=16777215,castShadow:h=!0,debug:d=!1}){return h?D.jsx(U4e,{maxFar:t,shadowMapSize:e,lightIntensity:n/i,cascades:i,fade:r,position:a,shadowBias:s,lightFar:o,lightMargin:l,lightNear:c,mode:u,color:f,debug:d},"csm-shadow"):D.jsx("directionalLight",{intensity:n,position:a,color:f!==void 0?new Ut(f):void 0})}function U4e({maxFar:t,shadowMapSize:e,lightIntensity:n,cascades:i,fade:r,position:a=[0,-1,0],shadowBias:s,lightFar:o,lightMargin:l,lightNear:c,mode:u,color:f,debug:h=!1}){const d=ki(C=>C.camera),{scene:g}=ki(),b=I.useMemo(()=>{let C=g;for(;C;){if(C instanceof qv)return C;C=C.parent}throw new Error("Could not find scene object in r3f context!")},[g]),y=I.useMemo(()=>new te(-a[0],-a[1],-a[2]).normalize(),[a]),p=I.useRef(null),x=I.useRef(null),_=I.useMemo(()=>new te,[]),w=I.useMemo(()=>new te(0,0,0),[]),M=I.useMemo(()=>new te,[]),S=I.useMemo(()=>new P4e({camera:d,cascades:i,lightDirection:y.clone(),lightFar:o,lightIntensity:n,lightMargin:l,lightNear:c,maxFar:t,mode:u,parent:b,shadowBias:s,shadowMapSize:e}),[d,b,i,y,o,n,l,c,t,u,s,e]),A=I.useMemo(()=>new Ut(f),[f]);return I.useEffect(()=>{S.instance&&(S.instance.lights.forEach(C=>{C.color=A}),S.instance.fade=r??!1)},[S,A,r]),la(()=>{!S.instance||!p.current||(p.current.getWorldPosition(_),M.subVectors(w,_).normalize(),S.instance.lightDirection.copy(M),S.instance.update(),x.current&&x.current.update())}),I.useEffect(()=>(xG(b),()=>{requestAnimationFrame(()=>{xG(b)})}),[b]),I.useEffect(()=>{if(S.attach(),S.instance&&S.instance.lights.forEach(C=>{C.color=A}),h&&S.instance){const C=new L4e(S.instance);C.displayFrustum=!0,C.displayPlanes=!0,C.displayShadowBounds=!0,C.updateVisibility(),b.add(C),x.current=C}return()=>{x.current&&(b.remove(x.current),x.current.traverse(C=>{if(C.geometry&&C.geometry.dispose(),C.material){const k=C.material;Array.isArray(k)?k.forEach(R=>R.dispose()):k.dispose()}}),x.current=null),S.dispose()}},[S,A,h,b]),D.jsx(D.Fragment,{children:D.jsx("group",{position:a,ref:p})})}const F4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useMemo(()=>eS(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),a=Ee.useMemo(()=>{const l=new On;return l.setAttribute("position",new In(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),l.setIndex(new In(new Uint32Array(n.props.faces.buffer.slice(n.props.faces.byteOffset,n.props.faces.byteOffset+n.props.faces.byteLength)),1)),l.computeVertexNormals(),l.computeBoundingSphere(),l},[n.props.vertices.buffer,n.props.faces.buffer]);Ee.useEffect(()=>()=>{a&&a.dispose()},[a]),Ee.useEffect(()=>()=>{r&&r.dispose()},[r]);const s=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,o=Ee.useMemo(()=>s===0?null:new dg({opacity:s,color:0,depthWrite:!1}),[s]);return D.jsxs("mesh",{ref:i,geometry:a,material:r,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[D.jsx(eh,{enableCreaseAngle:a.attributes.position.count<1024&&a.boundingSphere.radius>.1}),o&&s>0?D.jsx("mesh",{geometry:a,material:o,receiveShadow:!0}):null,e]})});let IE=null;const B4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useMemo(()=>eS(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]);IE===null&&(IE=new ep(1,1,1)),Ee.useEffect(()=>()=>{r&&r.dispose()},[r]);const a=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,s=Ee.useMemo(()=>a===0?null:new dg({opacity:a,color:0,depthWrite:!1}),[a]);return D.jsxs("group",{ref:i,children:[D.jsxs("mesh",{geometry:IE,scale:n.props.dimensions,material:r,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[D.jsx(eh,{enableCreaseAngle:!0}),s&&a>0?D.jsx("mesh",{geometry:IE,material:s,receiveShadow:!0}):null]}),e]})}),g8=new Map,z4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useMemo(()=>eS(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),a=Ee.useMemo(()=>(g8.has(n.props.subdivisions)||g8.set(n.props.subdivisions,new Yv(1,n.props.subdivisions)),g8.get(n.props.subdivisions)),[n.props.subdivisions]);Ee.useEffect(()=>()=>{a&&a.dispose()},[a]),Ee.useEffect(()=>()=>{r&&r.dispose()},[r]);const s=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,o=Ee.useMemo(()=>s===0?null:new dg({opacity:s,color:0,depthWrite:!1}),[s]);return D.jsxs("group",{ref:i,children:[D.jsxs("mesh",{ref:i,geometry:a,scale:n.props.radius,material:r,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[D.jsx(eh,{}),o&&s>0?D.jsx("mesh",{geometry:a,material:o,receiveShadow:!0}):null]}),e]})}),j4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useContext(Si),a=Ee.useMemo(()=>eS(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),s=Ee.useRef(),{geometry:o,skeleton:l}=Ee.useMemo(()=>{const h=new On;h.setAttribute("position",new In(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),h.setIndex(new In(new Uint32Array(n.props.faces.buffer.slice(n.props.faces.byteOffset,n.props.faces.byteOffset+n.props.faces.byteLength)),1)),h.computeVertexNormals(),h.computeBoundingSphere();const d=new Float32Array(n.props.bone_wxyzs.buffer.slice(n.props.bone_wxyzs.byteOffset,n.props.bone_wxyzs.byteOffset+n.props.bone_wxyzs.byteLength)),g=new Float32Array(n.props.bone_positions.buffer.slice(n.props.bone_positions.byteOffset,n.props.bone_positions.byteOffset+n.props.bone_positions.byteLength)),b=[];s.current=b;for(let _=0;_<g.length/3;_++)b.push(new j_);const y=[],p=new Xn;b.forEach((_,w)=>{p.set(d[w*4+1],d[w*4+2],d[w*4+3],d[w*4+0]);const M=new Dt;M.makeRotationFromQuaternion(p),M.setPosition(g[w*3+0],g[w*3+1],g[w*3+2]),M.invert(),y.push(M),_.setRotationFromQuaternion(p),_.position.set(g[w*3+0],g[w*3+1],g[w*3+2])});const x=new Kv(b,y);return h.setAttribute("skinIndex",new In(new Uint16Array(n.props.skin_indices.buffer.slice(n.props.skin_indices.byteOffset,n.props.skin_indices.byteOffset+n.props.skin_indices.byteLength)),4)),h.setAttribute("skinWeight",new In(new Float32Array(n.props.skin_weights.buffer.slice(n.props.skin_weights.byteOffset,n.props.skin_weights.byteOffset+n.props.skin_weights.byteLength)),4)),x.init(),{geometry:h,skeleton:x}},[n.props.vertices.buffer,n.props.faces.buffer,n.props.skin_indices.buffer,n.props.skin_weights?.buffer,n.props.bone_wxyzs.buffer,n.props.bone_positions.buffer]),c=r.mutable.current;Ee.useEffect(()=>{const h=c.skinnedMeshState[n.name];return h.initialized=!1,()=>{l&&l.dispose(),o&&o.dispose()}},[l,o,n.name,c.skinnedMeshState]),Ee.useEffect(()=>()=>{a&&a.dispose()},[a]);const u=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,f=Ee.useMemo(()=>u===0?null:new dg({opacity:u,color:0,depthWrite:!1}),[u]);return la(()=>{const h=c.skinnedMeshState[n.name],d=s.current;if(l!==void 0&&d!==void 0){if(!h.initialized){const g=c.nodeRefFromName[n.name];if(g===void 0)return;d.forEach(b=>{g.add(b)}),h.initialized=!0}h.dirty&&(d.forEach((g,b)=>{const y=h.poses[b].wxyz,p=h.poses[b].position;g.quaternion.set(y[1],y[2],y[3],y[0]),g.position.set(p[0],p[1],p[2])}),h.dirty=!1)}}),D.jsxs("skinnedMesh",{ref:i,geometry:o,material:a,skeleton:l,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,frustumCulled:!1,children:[D.jsx(eh,{enableCreaseAngle:o.attributes.position.count<1024}),f&&u>0?D.jsx("skinnedMesh",{geometry:o,material:f,skeleton:l,receiveShadow:!0,frustumCulled:!1}):null,e]})});function b8(t,e,n){n[0]=t[0]>e[0]?e[0]:t[0],n[1]=t[1]<e[1]?e[1]:t[1],n[2]=t[2]>e[2]?e[2]:t[2],n[3]=t[3]<e[3]?e[3]:t[3],n[4]=t[4]>e[4]?e[4]:t[4],n[5]=t[5]<e[5]?e[5]:t[5]}function H4e(t,e,n){let i=!1;const r=t[0]>e[0]?e[0]:t[0],a=t[1]<e[1]?e[1]:t[1],s=t[2]>e[2]?e[2]:t[2],o=t[3]<e[3]?e[3]:t[3],l=t[4]>e[4]?e[4]:t[4],c=t[5]<e[5]?e[5]:t[5];return n[0]>r&&(n[0]=r,i=!0),n[1]<a&&(n[1]=a,i=!0),n[2]>s&&(n[2]=s,i=!0),n[3]<o&&(n[3]=o,i=!0),n[4]>l&&(n[4]=l,i=!0),n[5]<c&&(n[5]=c,i=!0),i}function V4e(t,e){return!(e[0]>t[0]||e[1]<t[1]||e[2]>t[2]||e[3]<t[3]||e[4]>t[4]||e[5]<t[5])}function G4e(t,e){let n=!1;return e[0]>t[0]&&(e[0]=t[0],n=!0),e[1]<t[1]&&(e[1]=t[1],n=!0),e[2]>t[2]&&(e[2]=t[2],n=!0),e[3]<t[3]&&(e[3]=t[3],n=!0),e[4]>t[4]&&(e[4]=t[4],n=!0),e[5]<t[5]&&(e[5]=t[5],n=!0),n}function NE(t,e){t[0]-=e,t[1]+=e,t[2]-=e,t[3]+=e,t[4]-=e,t[5]+=e}function Pb(t){const e=t[1]-t[0],n=t[3]-t[2],i=t[5]-t[4];return 2*(e*n+n*i+i*e)}function Wp(t,e){const n=t[0]>e[0]?e[0]:t[0],i=t[1]<e[1]?e[1]:t[1],r=t[2]>e[2]?e[2]:t[2],a=t[3]<e[3]?e[3]:t[3],s=t[4]>e[4]?e[4]:t[4],o=t[5]<e[5]?e[5]:t[5],l=i-n,c=a-r,u=o-s;return 2*(l*c+c*u+u*l)}function W4e(t){const e=t[1]-t[0],n=t[3]-t[2],i=t[5]-t[4];return e>n?e>i?0:2:n>i?1:2}function Px(t,e){const n=t[0]-e[0],i=e[0]-t[1];let r=n>i?n:i;r<0&&(r=0);const a=t[2]-e[1],s=e[1]-t[3];let o=a>s?a:s;o<0&&(o=0);const l=t[4]-e[2],c=e[2]-t[5];let u=l>c?l:c;return u<0&&(u=0),r*r+o*o+u*u}function X4e(t,e){let n,i,r,a,s,o;const l=t[0]-e[0],c=e[0]-t[1];l>c?(n=l,i=c):(n=c,i=l),n<0&&(n=0);const u=t[2]-e[1],f=e[1]-t[3];u>f?(r=u,a=f):(r=f,a=u),r<0&&(r=0);const h=t[4]-e[2],d=e[2]-t[5];return h>d?(s=h,o=d):(s=d,o=h),s<0&&(s=0),{min:n*n+r*r+s*s,max:i*i+a*a+o*o}}let q4e=class{constructor(){this.array=[]}clear(){this.array=[]}push(e){const n=this.array,i=e.inheritedCost,r=n.length>6?n.length-6:0;let a;for(a=n.length-1;a>=r&&!(i<=n[a].inheritedCost);a--);a>n.length-7&&n.splice(a+1,0,e)}pop(){return this.array.pop()}},K4e=class{constructor(e=!1){this.root=null,this._sortedList=new q4e,this.count=0,this.highPrecision=e,this._typeArray=e?Float64Array:Float32Array}createFromArray(e,n,i,r=0){const a=n.length,s=this._typeArray;s!==(n[0].BYTES_PER_ELEMENT===4?Float32Array:Float64Array)&&console.warn("Different precision.");const o=new s(6);let l,c;this.root=u(0,a,null);function u(g,b,y){if(b===1){const w=n[g];r>0&&NE(w,r);const M={box:w,object:e[g],parent:y};return i&&i(M),M}const p=f(g,b);h();let x=d(g,b);(x===g||x===g+b)&&(x=g+(b>>1));const _={box:p,parent:y};return _.left=u(g,x-g,_),_.right=u(x,b-x+g,_),_}function f(g,b){const y=new s(6),p=g+b;y[0]=1/0,y[1]=-1/0,y[2]=1/0,y[3]=-1/0,y[4]=1/0,y[5]=-1/0,o[0]=1/0,o[1]=-1/0,o[2]=1/0,o[3]=-1/0,o[4]=1/0,o[5]=-1/0;for(let x=g;x<p;x++){const _=n[x],w=_[0],M=_[1],S=_[2],A=_[3],C=_[4],k=_[5];y[0]>w&&(y[0]=w),y[1]<M&&(y[1]=M),y[2]>S&&(y[2]=S),y[3]<A&&(y[3]=A),y[4]>C&&(y[4]=C),y[5]<k&&(y[5]=k);const R=(M+w)*.5,N=(A+S)*.5,P=(k+C)*.5;o[0]>R&&(o[0]=R),o[1]<R&&(o[1]=R),o[2]>N&&(o[2]=N),o[3]<N&&(o[3]=N),o[4]>P&&(o[4]=P),o[5]<P&&(o[5]=P)}return y[0]-=r,y[1]+=r,y[2]-=r,y[3]+=r,y[4]-=r,y[5]+=r,y}function h(){l=W4e(o)*2,c=(o[l]+o[l+1])*.5}function d(g,b){let y=g,p=g+b-1;for(;y<=p;){const x=n[y];if((x[l+1]+x[l])*.5>=c)for(;;){const _=n[p];if((_[l+1]+_[l])*.5<c){const w=e[y];e[y]=e[p],e[p]=w;const M=n[y];n[y]=n[p],n[p]=M,p--;break}if(p--,p<=y)return y}y++}return y}}insert(e,n,i){i>0&&NE(n,i);const r=this.createLeafNode(e,n);return this.root===null?this.root=r:this.insertLeaf(r),this.count++,r}insertRange(e,n,i,r){console.warn("Method not optimized yet. It just calls 'insert' N times.");const a=e.length,s=i>0?i:i?null:0;for(let o=0;o<a;o++){const l=this.insert(e[o],n[o],s??i[o]);r&&r(l)}}move(e,n){if(!e.parent||V4e(e.box,e.parent.box)){n>0&&NE(e.box,n);return}n>0&&NE(e.box,n);const i=this.delete(e);this.insertLeaf(e,i),this.count++}delete(e){const n=e.parent;if(n===null)return this.root=null,null;const i=n.parent,r=n.left===e?n.right:n.left;return r.parent=i,e.parent=null,i===null?(this.root=r,n):(i.left===n?i.left=r:i.right=r,this.refit(i),this.count--,n)}clear(){this.root=null}insertLeaf(e,n){const i=this.findBestSibling(e.box),r=i.parent;n===void 0?n=this.createInternalNode(r,i,e):(n.parent=r,n.left=i,n.right=e),i.parent=n,e.parent=n,r===null?this.root=n:r.left===i?r.left=n:r.right=n,this.refitAndRotate(e,i)}createLeafNode(e,n){return{box:n,object:e,parent:null}}createInternalNode(e,n,i){return{parent:e,left:n,right:i,box:new this._typeArray(6)}}findBestSibling(e){const n=this.root;let i=n,r=Wp(e,n.box);const a=Pb(e);if(n.object!==void 0)return n;const s=this._sortedList;s.clear();let o={node:n,inheritedCost:r-Pb(n.box)};do{const{node:l,inheritedCost:c}=o;if(a+c>=r)break;const u=l.left,f=l.right,h=Wp(e,u.box)+c,d=h-Pb(u.box),g=Wp(e,f.box)+c,b=g-Pb(f.box);if(h>g?r>g&&(i=f,r=g):r>h&&(i=u,r=h),b>d){if(a+d>=r||(u.object===void 0&&s.push({node:u,inheritedCost:d}),a+b>=r))continue;f.object===void 0&&s.push({node:f,inheritedCost:b})}else{if(a+b>=r||(f.object===void 0&&s.push({node:f,inheritedCost:b}),a+d>=r))continue;u.object===void 0&&s.push({node:u,inheritedCost:d})}}while(o=s.pop());return i}refit(e){for(b8(e.left.box,e.right.box,e.box);e=e.parent;)if(!H4e(e.left.box,e.right.box,e.box))return}refitAndRotate(e,n){const i=e.box;e=e.parent;const r=e.box;for(b8(i,n.box,r);e=e.parent;){const a=e.box;if(!G4e(i,a))return;const s=e.left,o=e.right,l=s.box,c=o.box;let u=null,f=null,h=0;if(o.object===void 0){const d=o.left,g=o.right,b=Pb(o.box),y=b-Wp(l,d.box),p=b-Wp(l,g.box);y>p?y>0&&(u=s,f=g,h=y):p>0&&(u=s,f=d,h=p)}if(s.object===void 0){const d=s.left,g=s.right,b=Pb(s.box),y=b-Wp(c,d.box),p=b-Wp(c,g.box);y>p?y>h&&(u=o,f=g):p>h&&(u=o,f=d)}u!==null&&this.swap(u,f)}}swap(e,n){const i=e.parent,r=n.parent,a=r.box;i.left===e?i.left=n:i.right=n,r.left===n?r.left=e:r.right=e,e.parent=r,n.parent=i,b8(r.left.box,r.right.box,a)}};const C4=0,Y4e=1;let J4e=class{constructor(e,n){this.coordinateSystem=n,this.array=e?new Float64Array(24):new Float32Array(24)}setFromProjectionMatrix(e){if(this.updatePlane(0,e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),this.updatePlane(1,e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),this.updatePlane(2,e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),this.updatePlane(3,e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),this.updatePlane(4,e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14]),this.coordinateSystem===C4)this.updatePlane(5,e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]);else if(this.coordinateSystem===Y4e)this.updatePlane(5,e[2],e[6],e[10],e[14]);else throw new Error("Invalid coordinate system: "+this.coordinateSystem);return this}updatePlane(e,n,i,r,a){const s=this.array,o=e*4,l=Math.sqrt(n*n+i*i+r*r);s[o+0]=n/l,s[o+1]=i/l,s[o+2]=r/l,s[o+3]=a/l}intersectsBoxMask(e,n){const i=this.array;let r,a,s,o,l,c;for(let u=0;u<6;u++){if(!(n&32>>u))continue;const f=u*4,h=i[f+0],d=i[f+1],g=i[f+2],b=i[f+3];if(h>0?(r=e[1],o=e[0]):(r=e[0],o=e[1]),d>0?(a=e[3],l=e[2]):(a=e[2],l=e[3]),g>0?(s=e[5],c=e[4]):(s=e[4],c=e[5]),h*r+d*a+g*s<-b)return-1;h*o+d*l+g*c>-b&&(n^=32>>u)}return n}isIntersected(e,n){const i=this.array;for(let r=0;r<6;r++){if(!(n&32>>r))continue;const a=r*4,s=i[a+0],o=i[a+1],l=i[a+2],c=i[a+3],u=s>0?e[1]:e[0],f=o>0?e[3]:e[2],h=l>0?e[5]:e[4];if(s*u+o*f+l*h<-c)return!1}return!0}isIntersectedMargin(e,n,i){if(n===0)return!0;const r=this.array;for(let a=0;a<6;a++){if(!(n&32>>a))continue;const s=a*4,o=r[s+0],l=r[s+1],c=r[s+2],u=r[s+3],f=o>0?e[1]-i:e[0]+i,h=l>0?e[3]-i:e[2]+i,d=c>0?e[5]-i:e[4]+i;if(o*f+l*h+c*d<-u)return!1}return!0}};function _G(t,e,n,i,r,a){let s=i[0],o=e[0],l=n[0],c=(t[s]-o)*l,u=(t[s^1]-o)*l,f=c>0?c:0,h=u<1/0?u:1/0;return s=i[1],o=e[1],l=n[1],c=(t[s+2]-o)*l,c>h||(u=(t[s^3]-o)*l,f>u)||(f=c>f?c:f,h=u<h?u:h,s=i[2],o=e[2],l=n[2],c=(t[s+4]-o)*l,c>h)||(u=(t[s^5]-o)*l,f>u)?!1:(f=c>f?c:f,h=u<h?u:h,f<=a&&h>=r)}function SG(t,e){return t[1]>=e[0]&&e[1]>=t[0]&&t[3]>=e[2]&&e[3]>=t[2]&&t[5]>=e[4]&&e[5]>=t[4]}function $4e(t,e,n){return Px(n,t)<=e*e}class Z4e{constructor(e,n=C4){this._sign=new Uint8Array(3),this.builder=e;const i=e.highPrecision;this.frustum=new J4e(i,n),this._dirInv=i?new Float64Array(3):new Float32Array(3)}get root(){return this.builder.root}createFromArray(e,n,i,r){e?.length>0&&this.builder.createFromArray(e,n,i,r)}insert(e,n,i){return this.builder.insert(e,n,i)}insertRange(e,n,i,r){e?.length>0&&this.builder.insertRange(e,n,i,r)}move(e,n){this.builder.move(e,n)}delete(e){return this.builder.delete(e)}clear(){this.builder.clear()}traverse(e){if(this.root===null)return;n(this.root,0);function n(i,r){if(i.object!==void 0){e(i,r);return}e(i,r)||(n(i.left,r+1),n(i.right,r+1))}}intersectsRay(e,n,i,r=0,a=1/0){if(this.root===null)return!1;const s=this._dirInv,o=this._sign;return s[0]=1/e[0],s[1]=1/e[1],s[2]=1/e[2],o[0]=s[0]<0?1:0,o[1]=s[1]<0?1:0,o[2]=s[2]<0?1:0,l(this.root);function l(c){return _G(c.box,n,s,o,r,a)?c.object!==void 0?i(c.object):l(c.left)||l(c.right):!1}}intersectsBox(e,n){if(this.root===null)return!1;return i(this.root);function i(r){return SG(e,r.box)?r.object!==void 0?n(r.object):i(r.left)||i(r.right):!1}}intersectsSphere(e,n,i){if(this.root===null)return!1;return r(this.root);function r(a){return $4e(e,n,a.box)?a.object!==void 0?i(a.object):r(a.left)||r(a.right):!1}}isNodeIntersected(e,n){const i=e.box;let r;for(;r=e.parent;){const s=r.left===e?r.right:r.left;if(a(s))return!0;e=r}return!1;function a(s){return SG(i,s.box)?s.object!==void 0?n(s.object):a(s.left)||a(s.right):!1}}rayIntersections(e,n,i,r=0,a=1/0){if(this.root===null)return;const s=this._dirInv,o=this._sign;s[0]=1/e[0],s[1]=1/e[1],s[2]=1/e[2],o[0]=s[0]<0?1:0,o[1]=s[1]<0?1:0,o[2]=s[2]<0?1:0,l(this.root);function l(c){if(_G(c.box,n,s,o,r,a)){if(c.object!==void 0){i(c.object);return}l(c.left),l(c.right)}}}frustumCulling(e,n){if(this.root===null)return;const i=this.frustum.setFromProjectionMatrix(e);r(this.root,63);function r(s,o){if(s.object!==void 0){i.isIntersected(s.box,o)&&n(s,i,o);return}if(o=i.intersectsBoxMask(s.box,o),!(o<0)){if(o===0){a(s.left),a(s.right);return}r(s.left,o),r(s.right,o)}}function a(s){if(s.object!==void 0){n(s,i,0);return}a(s.left),a(s.right)}}frustumCullingLOD(e,n,i,r){if(this.root===null)return;const a=this.frustum.setFromProjectionMatrix(e);s(this.root,63,null);function s(c,u,f){const h=c.box;if(f===null&&(f=l(h)),c.object!==void 0){a.isIntersected(h,u)&&r(c,f,a,u);return}if(u=a.intersectsBoxMask(h,u),!(u<0)){if(u===0){o(c.left,f),o(c.right,f);return}s(c.left,u,f),s(c.right,u,f)}}function o(c,u){if(u===null&&(u=l(c.box)),c.object!==void 0){r(c,u,a,0);return}o(c.left,u),o(c.right,u)}function l(c){const{min:u,max:f}=X4e(c,n);for(let h=i.length-1;h>0;h--)if(f>=i[h])return u>=i[h]?h:null;return 0}}closestPointToPoint(e,n){if(this.root===null)return;let i=1/0;return r(this.root),Math.sqrt(i);function r(a){if(a.object!==void 0){if(n){const l=n(a.object)??Px(a.box,e);l<i&&(i=l)}else i=Px(a.box,e);return}const s=Px(a.left.box,e),o=Px(a.right.box,e);s<o?s<i&&(r(a.left),o<i&&r(a.right)):o<i&&(r(a.right),s<i&&r(a.left))}}}function wG(t,e){return e[0]=t.x,e[1]=t.y,e[2]=t.z,e}function EG(t,e){const n=t.min,i=t.max;return e[0]=n.x,e[1]=i.x,e[2]=n.y,e[3]=i.y,e[4]=n.z,e[5]=i.z,e}class Ute{constructor(e,n,i){if(this.isInstanceEntity=!0,this.position=new te,this.scale=new te(1,1,1),this.quaternion=new Xn,this.id=n,this.owner=e,i){const r=this.quaternion,a=this.rotation=new vi;a._onChange(()=>r.setFromEuler(a,!1)),r._onChange(()=>a.setFromQuaternion(r,void 0,!1))}}get visible(){return this.owner.getVisibilityAt(this.id)}set visible(e){this.owner.setVisibilityAt(this.id,e)}get active(){return this.owner.getActiveAt(this.id)}set active(e){this.owner.setActiveAt(this.id,e)}get color(){return this.owner.getColorAt(this.id)}set color(e){this.owner.setColorAt(this.id,e)}get opacity(){return this.owner.getOpacityAt(this.id)}set opacity(e){this.owner.setOpacityAt(this.id,e)}get morph(){return this.owner.getMorphAt(this.id)}set morph(e){this.owner.setMorphAt(this.id,e)}get matrix(){return this.owner.getMatrixAt(this.id)}get matrixWorld(){return this.matrix.premultiply(this.owner.matrixWorld)}setMatrixIdentity(){const e=this.owner,n=e.matricesTexture._data,i=this.id,r=i*16;n[r+0]=1,n[r+1]=0,n[r+2]=0,n[r+3]=0,n[r+4]=0,n[r+5]=1,n[r+6]=0,n[r+7]=0,n[r+8]=0,n[r+9]=0,n[r+10]=1,n[r+11]=0,n[r+12]=0,n[r+13]=0,n[r+14]=0,n[r+15]=1,e.matricesTexture.enqueueUpdate(i)}updateMatrix(){const e=this.owner,n=this.position,i=this.quaternion,r=this.scale,a=e.matricesTexture._data,s=this.id,o=s*16,l=i._x,c=i._y,u=i._z,f=i._w,h=l+l,d=c+c,g=u+u,b=l*h,y=l*d,p=l*g,x=c*d,_=c*g,w=u*g,M=f*h,S=f*d,A=f*g,C=r.x,k=r.y,R=r.z;a[o+0]=(1-(x+w))*C,a[o+1]=(y+A)*C,a[o+2]=(p-S)*C,a[o+3]=0,a[o+4]=(y-A)*k,a[o+5]=(1-(b+w))*k,a[o+6]=(_+M)*k,a[o+7]=0,a[o+8]=(p+S)*R,a[o+9]=(_-M)*R,a[o+10]=(1-(b+x))*R,a[o+11]=0,a[o+12]=n.x,a[o+13]=n.y,a[o+14]=n.z,a[o+15]=1,e.matricesTexture.enqueueUpdate(s),e.bvh&&e.autoUpdateBVH&&e.bvh.move(s)}updateMatrixPosition(){const e=this.owner,n=this.position,i=e.matricesTexture._data,r=this.id,a=r*16;i[a+12]=n.x,i[a+13]=n.y,i[a+14]=n.z,e.matricesTexture.enqueueUpdate(r),e.bvh&&e.autoUpdateBVH&&e.bvh.move(r)}getUniform(e,n){return this.owner.getUniformAt(this.id,e,n)}updateBones(e=!0,n){this.owner.setBonesAt(this.id,e,n)}setUniform(e,n){this.owner.setUniformAt(this.id,e,n)}copyTo(e){e.position.copy(this.position),e.scale.copy(this.scale),e.quaternion.copy(this.quaternion),this.rotation&&e.rotation.copy(this.rotation)}applyMatrix4(e){return this.matrix.premultiply(e).decompose(this.position,this.quaternion,this.scale),this}applyQuaternion(e){return this.quaternion.premultiply(e),this}rotateOnAxis(e,n){return LE.setFromAxisAngle(e,n),this.quaternion.multiply(LE),this}rotateOnWorldAxis(e,n){return LE.setFromAxisAngle(e,n),this.quaternion.premultiply(LE),this}rotateX(e){return this.rotateOnAxis(TG,e)}rotateY(e){return this.rotateOnAxis(AG,e)}rotateZ(e){return this.rotateOnAxis(CG,e)}translateOnAxis(e,n){return MG.copy(e).applyQuaternion(this.quaternion),this.position.add(MG.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(TG,e)}translateY(e){return this.translateOnAxis(AG,e)}translateZ(e){return this.translateOnAxis(CG,e)}remove(){return this.owner.removeInstances(this.id),this}}const LE=new Xn,MG=new te,TG=new te(1,0,0),AG=new te(0,1,0),CG=new te(0,0,1);class Q4e{constructor(e,n=0,i=!1,r=!0){this.nodesMap=new Map,this.LODsMap=new Map,this._geoBoundingSphere=null,this._sphereTarget=null,this.target=e,this.accurateCulling=r,this._margin=n;const a=e._geometry;if(a.boundingBox||a.computeBoundingBox(),this.geoBoundingBox=a.boundingBox,i){a.boundingSphere||a.computeBoundingSphere();const s=a.boundingSphere.center;s.x===0&&s.y===0&&s.z===0?(this._geoBoundingSphere=a.boundingSphere,this._sphereTarget={centerX:0,centerY:0,centerZ:0,maxScale:0}):(console.warn('"getBoxFromSphere" is ignored because geometry is not centered.'),i=!1)}this.bvh=new Z4e(new K4e,C4),this._origin=new Float32Array(3),this._dir=new Float32Array(3),this._cameraPos=new Float32Array(3),this._getBoxFromSphere=i}create(){const e=this.target._instancesCount,n=this.target._instancesArrayCount,i=new Array(e),r=new Uint32Array(e);let a=0;this.clear();for(let s=0;s<n;s++)this.target.getActiveAt(s)&&(i[a]=this.getBox(s,new Float32Array(6)),r[a]=s,a++);this.bvh.createFromArray(r,i,s=>{this.nodesMap.set(s.object,s)},this._margin)}insert(e){const n=this.bvh.insert(e,this.getBox(e,new Float32Array(6)),this._margin);this.nodesMap.set(e,n)}insertRange(e){const n=e.length,i=new Array(n);for(let r=0;r<n;r++)i[r]=this.getBox(e[r],new Float32Array(6));this.bvh.insertRange(e,i,this._margin,r=>{this.nodesMap.set(r.object,r)})}move(e){const n=this.nodesMap.get(e);n&&(this.getBox(e,n.box),this.bvh.move(n,this._margin))}delete(e){const n=this.nodesMap.get(e);n&&(this.bvh.delete(n),this.nodesMap.delete(e))}clear(){this.bvh.clear(),this.nodesMap.clear()}frustumCulling(e,n){this._margin>0&&this.accurateCulling?this.bvh.frustumCulling(e.elements,(i,r,a)=>{r.isIntersectedMargin(i.box,a,this._margin)&&n(i)}):this.bvh.frustumCulling(e.elements,n)}frustumCullingLOD(e,n,i,r){this.LODsMap.has(i)||this.LODsMap.set(i,new Float32Array(i.length));const a=this.LODsMap.get(i);for(let o=0;o<i.length;o++)a[o]=i[o].distance;const s=this._cameraPos;s[0]=n.x,s[1]=n.y,s[2]=n.z,this._margin>0&&this.accurateCulling?this.bvh.frustumCullingLOD(e.elements,s,a,(o,l,c,u)=>{c.isIntersectedMargin(o.box,u,this._margin)&&r(o,l)}):this.bvh.frustumCullingLOD(e.elements,s,a,r)}raycast(e,n){const i=e.ray,r=this._origin,a=this._dir;wG(i.origin,r),wG(i.direction,a),this.bvh.rayIntersections(a,r,n,e.near,e.far)}intersectBox(e,n){this._boxArray||(this._boxArray=new Float32Array(6));const i=this._boxArray;return EG(e,i),this.bvh.intersectsBox(i,n)}getBox(e,n){if(this._getBoxFromSphere){const i=this.target.matricesTexture._data,{centerX:r,centerY:a,centerZ:s,maxScale:o}=this.getSphereFromMatrix_centeredGeometry(e,i,this._sphereTarget),l=this._geoBoundingSphere.radius*o;n[0]=r-l,n[1]=r+l,n[2]=a-l,n[3]=a+l,n[4]=s-l,n[5]=s+l}else RG.copy(this.geoBoundingBox).applyMatrix4(this.target.getMatrixAt(e)),EG(RG,n);return n}getSphereFromMatrix_centeredGeometry(e,n,i){const r=e*16,a=n[r+0],s=n[r+1],o=n[r+2],l=n[r+4],c=n[r+5],u=n[r+6],f=n[r+8],h=n[r+9],d=n[r+10],g=a*a+s*s+o*o,b=l*l+c*c+u*u,y=f*f+h*h+d*d;return i.maxScale=Math.sqrt(Math.max(g,b,y)),i.centerX=n[r+12],i.centerY=n[r+13],i.centerZ=n[r+14],i}}const RG=new rr;class e9e extends H${constructor(e,n,i,r,a,s=1){const o=e.createBuffer();super(o,n,i,r,a.length/i),this.isGLInstancedBufferAttribute=!0,this._needsUpdate=!1,this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s,this.array=a,this._cacheArray=a,e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,a,e.DYNAMIC_DRAW)}update(e,n){if(!this._needsUpdate||n===0)return;const i=e.getContext();i.bindBuffer(i.ARRAY_BUFFER,this.buffer),this.array===this._cacheArray?i.bufferSubData(i.ARRAY_BUFFER,0,this.array,0,n):(i.bufferData(i.ARRAY_BUFFER,this.array,i.DYNAMIC_DRAW),this._cacheArray=this.array),this._needsUpdate=!1}clone(){return this}}let WC=null,MT=null;const v8={};function t9e(t){var e;return((e=MT.get(t))==null?void 0:e())??WC(t)}function n9e(t){if(MT.has(t))return;const e={};MT.set(t,()=>{if(t.isMeshDistanceMaterial){const n=WC(t);e.light=n.light}return e})}function i9e(t,e,n){const i=e.properties;WC=i.get;const r=`${!!t.colorsTexture}_${t._useOpacity}_${!!t.boneTexture}_${!!t.uniformsTexture}`;v8[r]??(v8[r]=new WeakMap),MT=v8[r],i.get=t9e,n9e(n)}function r9e(t){t.properties.get=WC}function Fte(t,e){return Math.max(e,Math.ceil(Math.sqrt(t/e))*e)}function a9e(t,e,n,i){e===3&&(console.warn('"channels" cannot be 3. Set to 4. More info: https://github.com/mrdoob/three.js/pull/23228'),e=4);const r=Fte(i,n),a=new t(r*r*e),s=t.name.includes("Float"),o=t.name.includes("Uint"),l=s?wr:o?Ac:Gv;let c;switch(e){case 1:c=s?Th:Wv;break;case 2:c=s?VA:F_;break;case 4:c=s?Qr:Xv;break}return{array:a,size:r,type:l,format:c}}let TT=class extends cs{constructor(e,n,i,r,a,s){n===3&&(n=4);const{array:o,format:l,size:c,type:u}=a9e(e,n,i,r);super(o,c,c,l,u),this.partialUpdate=!0,this.maxUpdateCalls=1/0,this._utils=null,this._needsUpdate=!0,this._lastWidth=-1,this._data=o,this._channels=n,this._pixelsPerInstance=i,this._stride=i*n,this._rowToUpdate=new Array(c),this._uniformMap=a,this._fetchUniformsInFragmentShader=s,this.needsUpdate=!0}resize(e){const n=Fte(e,this._pixelsPerInstance);if(n===this.image.width)return;const i=this._data,r=this._channels;this._rowToUpdate.length=n;const a=i.constructor,s=new a(n*n*r),o=Math.min(i.length,s.length);s.set(new a(i.buffer,0,o)),this.dispose(),this.image={data:s,height:n,width:n},this._data=s}enqueueUpdate(e){if(this._needsUpdate=!0,!this.partialUpdate)return;const n=this.image.width/this._pixelsPerInstance,i=Math.floor(e/n);this._rowToUpdate[i]=!0}bindToProgram(e,n,i,r,a){if(!r[a])return;r[a].value=this;const s=this.getSlot(i,a);if(s===void 0)return;const o=e.properties.get(this);e.state.bindTexture(n.TEXTURE_2D,o.__webglTexture,n.TEXTURE0+s)}update(e,n,i){const r=e.properties.get(this),a=r.__version!==this.version;if(!this._needsUpdate&&!a)return;const s=this._lastWidth!==this.image.width;if(!r.__webglTexture||s)e.initTexture(this);else{const o=this.getSlot(n,i)??e.capabilities.maxTextures-1;this.partialUpdate?this.updatePartial(r,e,o):this.updateFull(r,e,o),r.__version=this.version}this._lastWidth=this.image.width,this._needsUpdate=!1}getSlot(e,n){var i;return(i=e[n])==null?void 0:i.cache[0]}updateFull(e,n,i){this.updateRows(e,n,[{row:0,count:this.image.height}],i)}updatePartial(e,n,i){const r=this.getUpdateRowsInfo();r.length!==0&&(r.length>this.maxUpdateCalls?this.updateFull(e,n,i):this.updateRows(e,n,r,i),this._rowToUpdate.fill(!1))}getUpdateRowsInfo(){const e=this._rowToUpdate,n=[];for(let i=0,r=e.length;i<r;i++)if(e[i]){const a=i;for(;i<r&&e[i];i++);n.push({row:a,count:i-a})}return n}updateRows(e,n,i,r){var a;const s=n.getContext();this._utils??(this._utils=new MU(s,n.extensions,n.capabilities));const o=this._utils.convert(this.format),l=this._utils.convert(this.type),{data:c,width:u}=this.image,f=this._channels;n.state.activeTexture(s.TEXTURE0+r),n.state.bindTexture(s.TEXTURE_2D,e.__webglTexture,s.TEXTURE0+r);const h=bi.getPrimaries(bi.workingColorSpace),d=this.colorSpace===su?null:bi.getPrimaries(this.colorSpace),g=this.colorSpace===su||h===d?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,this.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,this.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,g);for(const{count:b,row:y}of i)s.texSubImage2D(s.TEXTURE_2D,0,0,y,u,b,o,l,c,y*u*f);(a=this.onUpdate)==null||a.call(this,this)}setUniformAt(e,n,i){const{offset:r,size:a}=this._uniformMap.get(n),s=this._stride;a===1?this._data[e*s+r]=i:i.toArray(this._data,e*s+r)}getUniformAt(e,n,i){const{offset:r,size:a}=this._uniformMap.get(n),s=this._stride;return a===1?this._data[e*s+r]:i.fromArray(this._data,e*s+r)}getUniformsGLSL(e,n,i){const r=this.getUniformsVertexGLSL(e,n,i),a=this.getUniformsFragmentGLSL(e,n,i);return{vertex:r,fragment:a}}getUniformsVertexGLSL(e,n,i){if(this._fetchUniformsInFragmentShader)return`
        flat varying ${i} ez_v${n}; 
        void main() {
          ez_v${n} = ${n};`;const r=this.texelsFetchGLSL(e,n),a=this.getFromTexelsGLSL(),{assignVarying:s,declareVarying:o}=this.getVarying();return`
      uniform highp sampler2D ${e};  
      ${o}
      void main() {
        ${r}
        ${a}
        ${s}`}getUniformsFragmentGLSL(e,n,i){if(!this._fetchUniformsInFragmentShader){const{declareVarying:s,getVarying:o}=this.getVarying();return`
      ${s}
      void main() {
        ${o}`}const r=this.texelsFetchGLSL(e,`ez_v${n}`),a=this.getFromTexelsGLSL();return`
      uniform highp sampler2D ${e};  
      flat varying ${i} ez_v${n};
      void main() {
        ${r}
        ${a}`}texelsFetchGLSL(e,n){const i=this._pixelsPerInstance;let r=`
      int size = textureSize(${e}, 0).x;
      int j = int(${n}) * ${i};
      int x = j % size;
      int y = j / size;
    `;for(let a=0;a<i;a++)r+=`vec4 ez_texel${a} = texelFetch(${e}, ivec2(x + ${a}, y), 0);
`;return r}getFromTexelsGLSL(){const e=this._uniformMap;let n="";for(const[i,{type:r,offset:a,size:s}]of e){const o=Math.floor(a/this._channels);if(r==="mat3")n+=`mat3 ${i} = mat3(ez_texel${o}.rgb, vec3(ez_texel${o}.a, ez_texel${o+1}.rg), vec3(ez_texel${o+1}.ba, ez_texel${o+2}.r));
`;else if(r==="mat4")n+=`mat4 ${i} = mat4(ez_texel${o}, ez_texel${o+1}, ez_texel${o+2}, ez_texel${o+3});
`;else{const l=this.getUniformComponents(a,s);n+=`${r} ${i} = ez_texel${o}.${l};
`}}return n}getVarying(){const e=this._uniformMap;let n="",i="",r="";for(const[a,{type:s}]of e)n+=`flat varying ${s} ez_v${a};
`,i+=`ez_v${a} = ${a};
`,r+=`${s} ${a} = ez_v${a};
`;return{declareVarying:n,assignVarying:i,getVarying:r}}getUniformComponents(e,n){const i=e%this._channels;let r="";for(let a=0;a<n;a++)r+=s9e[i+a];return r}copy(e){return super.copy(e),this.partialUpdate=e.partialUpdate,this.maxUpdateCalls=e.maxUpdateCalls,this._channels=e._channels,this._pixelsPerInstance=e._pixelsPerInstance,this._stride=e._stride,this._rowToUpdate=e._rowToUpdate,this._uniformMap=e._uniformMap,this._fetchUniformsInFragmentShader=e._fetchUniformsInFragmentShader,this}};const s9e=["r","g","b","a"];let kn=class extends _i{constructor(e,n,i={},r){if(!e)throw new Error('"geometry" is mandatory.');if(!n)throw new Error('"material" is mandatory.');const{allowsEuler:a,renderer:s,createEntities:o}=i;super(e,null),this.type="InstancedMesh2",this.isInstancedMesh2=!0,this.instances=null,this.instanceIndex=null,this.colorsTexture=null,this.morphTexture=null,this.boneTexture=null,this.uniformsTexture=null,this.boundingBox=null,this.boundingSphere=null,this.bvh=null,this.customSort=null,this.raycastOnlyFrustum=!1,this.LODinfo=null,this.autoUpdate=!0,this.bindMode=j1,this.bindMatrix=null,this.bindMatrixInverse=null,this.skeleton=null,this.autoUpdateBVH=!0,this.onFrustumEnter=null,this._renderer=null,this._instancesCount=0,this._instancesArrayCount=0,this._perObjectFrustumCulled=!0,this._sortObjects=!1,this._indexArrayNeedsUpdate=!1,this._useOpacity=!1,this._currentMaterial=null,this._customProgramCacheKeyBase=null,this._onBeforeCompileBase=null,this._freeIds=[],this.isInstancedMesh=!0,this.instanceMatrix=new pf(new Float32Array(0),16),this.instanceColor=null,this._customProgramCacheKey=()=>`ez_${!!this.colorsTexture}_${this._useOpacity}_${!!this.boneTexture}_${!!this.uniformsTexture}_${this._customProgramCacheKeyBase.call(this._currentMaterial)}`,this._onBeforeCompile=(c,u)=>{if(this._onBeforeCompileBase&&this._onBeforeCompileBase.call(this._currentMaterial,c,u),c.defines??(c.defines={}),c.defines.USE_INSTANCING_INDIRECT="",c.uniforms.matricesTexture={value:this.matricesTexture},this.uniformsTexture){c.uniforms.uniformsTexture={value:this.uniformsTexture};const{vertex:f,fragment:h}=this.uniformsTexture.getUniformsGLSL("uniformsTexture","instanceIndex","uint");c.vertexShader=c.vertexShader.replace("void main() {",f),c.fragmentShader=c.fragmentShader.replace("void main() {",h)}this.colorsTexture&&c.fragmentShader.includes("#include <color_pars_fragment>")&&(c.defines.USE_INSTANCING_COLOR_INDIRECT="",c.uniforms.colorsTexture={value:this.colorsTexture},c.vertexShader=c.vertexShader.replace("<color_vertex>","<instanced_color_vertex>"),c.vertexColors&&(c.defines.USE_VERTEX_COLOR=""),this._useOpacity?c.defines.USE_COLOR_ALPHA="":c.defines.USE_COLOR=""),this.boneTexture&&(c.defines.USE_SKINNING="",c.defines.USE_INSTANCING_SKINNING="",c.uniforms.bindMatrix={value:this.bindMatrix},c.uniforms.bindMatrixInverse={value:this.bindMatrixInverse},c.uniforms.bonesPerInstance={value:this.skeleton.bones.length},c.uniforms.boneTexture={value:this.boneTexture})};const l=i.capacity>0?i.capacity:o9e;this._renderer=s,this._capacity=l,this._parentLOD=r,this._geometry=e,this.material=n,this._allowsEuler=a??!1,this._tempInstance=new Ute(this,-1,a),this.availabilityArray=r?.availabilityArray??new Array(l*2),this._createEntities=o,this.initLastRenderInfo(),this.initIndexAttribute(),this.initMatricesTexture()}get capacity(){return this._capacity}get instancesCount(){return this._instancesCount}get perObjectFrustumCulled(){return this._perObjectFrustumCulled}set perObjectFrustumCulled(e){this._perObjectFrustumCulled=e,this._indexArrayNeedsUpdate=!0}get sortObjects(){return this._sortObjects}set sortObjects(e){this._sortObjects=e,this._indexArrayNeedsUpdate=!0}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.patchGeometry(e)}onBeforeShadow(e,n,i,r,a,s,o){this.patchMaterial(e,s),this.updateTextures(e,s);const l=e.info.render.frame;this.instanceIndex&&this.autoUpdate&&!this.frustumCullingAlreadyPerformed(l,i,r)&&this.performFrustumCulling(r,i),this.count!==0&&(this.instanceIndex.update(this._renderer,this.count),this.bindTextures(e,s))}onBeforeRender(e,n,i,r,a,s){if(this.patchMaterial(e,a),this.updateTextures(e,a),!this.instanceIndex){this._renderer=e;return}const o=e.info.render.frame;this.autoUpdate&&!this.frustumCullingAlreadyPerformed(o,i,null)&&this.performFrustumCulling(i),this.count!==0&&(this.instanceIndex.update(this._renderer,this.count),this.bindTextures(e,a))}onAfterShadow(e,n,i,r,a,s,o){this.unpatchMaterial(e,s)}onAfterRender(e,n,i,r,a,s){this.unpatchMaterial(e,a),!(this.instanceIndex||s&&!this.isLastGroup(s.materialIndex))&&this.initIndexAttribute()}updateTextures(e,n){var i,r,a;const s=e.properties.get(n);this.matricesTexture.update(e,s,"matricesTexture"),(i=this.colorsTexture)==null||i.update(e,s,"colorsTexture"),(r=this.uniformsTexture)==null||r.update(e,s,"uniformsTexture"),(a=this.boneTexture)==null||a.update(e,s,"boneTexture")}bindTextures(e,n){var i,r,a;const s=e.properties.get(n),o=s.uniforms;if(!o)return;const l=s.currentProgram,c=l?.program;if(!c)return;const u=e.getContext(),f=l.getUniforms().map,h=u.getParameter(u.CURRENT_PROGRAM);e.state.useProgram(c),this.matricesTexture.bindToProgram(e,u,f,o,"matricesTexture"),(i=this.colorsTexture)==null||i.bindToProgram(e,u,f,o,"colorsTexture"),(r=this.uniformsTexture)==null||r.bindToProgram(e,u,f,o,"uniformsTexture"),(a=this.boneTexture)==null||a.bindToProgram(e,u,f,o,"boneTexture"),e.state.useProgram(h)}isLastGroup(e){const n=this.material;for(let i=n.length-1;i>=e;i--)if(n[i].visible)return i===e}initIndexAttribute(){if(!this._renderer){this.count=0;return}const e=this._renderer.getContext(),n=this._capacity,i=new Uint32Array(n);for(let r=0;r<n;r++)i[r]=r;this.instanceIndex=new e9e(e,e.UNSIGNED_INT,1,4,i),this._geometry.setAttribute("instanceIndex",this.instanceIndex)}initLastRenderInfo(){this._parentLOD||(this._lastRenderInfo={frame:-1,camera:null,shadowCamera:null})}initMatricesTexture(){this._parentLOD||(this.matricesTexture=new TT(Float32Array,4,4,this._capacity))}initColorsTexture(){this._parentLOD||(this.colorsTexture=new TT(Float32Array,4,1,this._capacity),this.colorsTexture.colorSpace=bi.workingColorSpace,this.colorsTexture._data.fill(1),this.materialsNeedsUpdate())}materialsNeedsUpdate(){if(this.material.isMaterial){this.material.needsUpdate=!0;return}for(const e of this.material)e.needsUpdate=!0}patchGeometry(e){const n=e.getAttribute("instanceIndex");if(n){if(n===this.instanceIndex)return;console.warn("The geometry has been cloned because it was already used."),e=e.clone(),e.deleteAttribute("instanceIndex")}this.instanceIndex&&e.setAttribute("instanceIndex",this.instanceIndex)}patchMaterial(e,n){this._currentMaterial=n,this._customProgramCacheKeyBase=n.customProgramCacheKey,this._onBeforeCompileBase=n.onBeforeCompile,n.customProgramCacheKey=this._customProgramCacheKey,n.onBeforeCompile=this._onBeforeCompile,i9e(this,e,n)}unpatchMaterial(e,n){this._currentMaterial=null,r9e(e),n.onBeforeCompile=this._onBeforeCompileBase,n.customProgramCacheKey=this._customProgramCacheKeyBase,this._onBeforeCompileBase=null,this._customProgramCacheKeyBase=null}computeBVH(e={}){this.bvh||(this.bvh=new Q4e(this,e.margin,e.getBBoxFromBSphere,e.accurateCulling)),this.bvh.clear(),this.bvh.create()}disposeBVH(){this.bvh=null}setMatrixAt(e,n){if(n.toArray(this.matricesTexture._data,e*16),this.instances){const i=this.instances[e];n.decompose(i.position,i.quaternion,i.scale)}this.matricesTexture.enqueueUpdate(e),this.bvh&&this.autoUpdateBVH&&this.bvh.move(e)}getMatrixAt(e,n=l9e){return n.fromArray(this.matricesTexture._data,e*16)}getPositionAt(e,n=c9e){const i=e*16,r=this.matricesTexture._data;return n.x=r[i+12],n.y=r[i+13],n.z=r[i+14],n}getPositionAndMaxScaleOnAxisAt(e,n){const i=e*16,r=this.matricesTexture._data,a=r[i+0],s=r[i+1],o=r[i+2],l=a*a+s*s+o*o,c=r[i+4],u=r[i+5],f=r[i+6],h=c*c+u*u+f*f,d=r[i+8],g=r[i+9],b=r[i+10],y=d*d+g*g+b*b;return n.x=r[i+12],n.y=r[i+13],n.z=r[i+14],Math.sqrt(Math.max(l,h,y))}applyMatrixAtToSphere(e,n,i,r){const a=e*16,s=this.matricesTexture._data,o=s[a+0],l=s[a+1],c=s[a+2],u=s[a+3],f=s[a+4],h=s[a+5],d=s[a+6],g=s[a+7],b=s[a+8],y=s[a+9],p=s[a+10],x=s[a+11],_=s[a+12],w=s[a+13],M=s[a+14],S=s[a+15],A=n.center,C=i.x,k=i.y,R=i.z,N=1/(u*C+g*k+x*R+S);A.x=(o*C+f*k+b*R+_)*N,A.y=(l*C+h*k+y*R+w)*N,A.z=(c*C+d*k+p*R+M)*N;const P=o*o+l*l+c*c,j=f*f+h*h+d*d,z=b*b+y*y+p*p;n.radius=r*Math.sqrt(Math.max(P,j,z))}setVisibilityAt(e,n){this.availabilityArray[e*2]=n,this._indexArrayNeedsUpdate=!0}getVisibilityAt(e){return this.availabilityArray[e*2]}setActiveAt(e,n){this.availabilityArray[e*2+1]=n,this._indexArrayNeedsUpdate=!0}getActiveAt(e){return this.availabilityArray[e*2+1]}getActiveAndVisibilityAt(e){const n=e*2,i=this.availabilityArray;return i[n]&&i[n+1]}setActiveAndVisibilityAt(e,n){const i=e*2,r=this.availabilityArray;r[i]=n,r[i+1]=n,this._indexArrayNeedsUpdate=!0}setColorAt(e,n){this.colorsTexture===null&&this.initColorsTexture(),n.isColor?n.toArray(this.colorsTexture._data,e*4):OG.set(n).toArray(this.colorsTexture._data,e*4),this.colorsTexture.enqueueUpdate(e)}getColorAt(e,n=OG){return n.fromArray(this.colorsTexture._data,e*4)}setOpacityAt(e,n){this._useOpacity||(this.colorsTexture===null?this.initColorsTexture():this.materialsNeedsUpdate(),this._useOpacity=!0),this.colorsTexture._data[e*4+3]=n,this.colorsTexture.enqueueUpdate(e)}getOpacityAt(e){return this._useOpacity?this.colorsTexture._data[e*4+3]:1}copyTo(e,n){this.getMatrixAt(e,n.matrix).decompose(n.position,n.quaternion,n.scale)}computeBoundingBox(){const e=this._geometry,n=this._instancesArrayCount;this.boundingBox??(this.boundingBox=new rr),e.boundingBox===null&&e.computeBoundingBox();const i=e.boundingBox,r=this.boundingBox;r.makeEmpty();for(let a=0;a<n;a++)this.getActiveAt(a)&&(kG.copy(i).applyMatrix4(this.getMatrixAt(a)),r.union(kG))}computeBoundingSphere(){const e=this._geometry,n=this._instancesArrayCount;this.boundingSphere??(this.boundingSphere=new Ur),e.boundingSphere===null&&e.computeBoundingSphere();const i=e.boundingSphere,r=this.boundingSphere;r.makeEmpty();for(let a=0;a<n;a++)this.getActiveAt(a)&&(DG.copy(i).applyMatrix4(this.getMatrixAt(a)),r.union(DG))}clone(e){const n={capacity:this._capacity,renderer:this._renderer,allowsEuler:this._allowsEuler,createEntities:this._createEntities};return new this.constructor(this.geometry,this.material,n).copy(this,e)}copy(e,n){return super.copy(e,n),this.count=e._capacity,this._instancesCount=e._instancesCount,this._instancesArrayCount=e._instancesArrayCount,this._capacity=e._capacity,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this.matricesTexture=e.matricesTexture.clone(),this.matricesTexture.image.data=this.matricesTexture.image.data.slice(),e.colorsTexture!==null&&(this.colorsTexture=e.colorsTexture.clone(),this.colorsTexture.image.data=this.colorsTexture.image.data.slice()),e.uniformsTexture!==null&&(this.uniformsTexture=e.uniformsTexture.clone(),this.uniformsTexture.image.data=this.uniformsTexture.image.data.slice()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone(),this.morphTexture.image.data=this.morphTexture.image.data.slice()),e.boneTexture!==null&&(this.boneTexture=e.boneTexture.clone(),this.boneTexture.image.data=this.boneTexture.image.data.slice()),this}dispose(){var e,n,i,r;this.dispatchEvent({type:"dispose"}),this.matricesTexture.dispose(),(e=this.colorsTexture)==null||e.dispose(),(n=this.morphTexture)==null||n.dispose(),(i=this.boneTexture)==null||i.dispose(),(r=this.uniformsTexture)==null||r.dispose()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMatrixInverse&&(this.bindMode===j1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===BP?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("Unrecognized bindMode: "+this.bindMode))}};const o9e=1e3,kG=new rr,DG=new Ur,l9e=new Dt,OG=new Ut,c9e=new te;kn.prototype.resizeBuffers=function(t){var e;const n=this._capacity;this._capacity=t;const i=Math.min(t,n);if(this.instanceIndex){const r=new Uint32Array(t);r.set(new Uint32Array(this.instanceIndex.array.buffer,0,i)),this.instanceIndex.array=r}if(this.LODinfo){for(const r of this.LODinfo.objects)if(r._capacity=t,r.instanceIndex){const a=new Uint32Array(t);a.set(new Uint32Array(r.instanceIndex.array.buffer,0,i)),r.instanceIndex.array=a}}if(this.availabilityArray.length=t*2,this.matricesTexture.resize(t),this.colorsTexture&&(this.colorsTexture.resize(t),t>n&&this.colorsTexture._data.fill(1,n*4)),this.morphTexture){const r=this.morphTexture.image.data,a=r.length/n;this.morphTexture.dispose(),this.morphTexture=new cs(new Float32Array(a*t),a,t,Th,wr),this.morphTexture.image.data.set(r)}return(e=this.uniformsTexture)==null||e.resize(t),this};kn.prototype.setInstancesArrayCount=function(t){if(t<this._instancesArrayCount){const n=this.bvh;if(n)for(let i=this._instancesArrayCount-1;i>=t;i--)this.getActiveAt(i)&&n.delete(i);this._instancesArrayCount=t;return}if(t>this._capacity){let n=this._capacity+(this._capacity>>1)+512;for(;n<t;)n+=(n>>1)+512;this.resizeBuffers(n)}const e=this._instancesArrayCount;this._instancesArrayCount=t,this._createEntities&&this.createEntities(e)};function Bte(t,e){return t.depth-e.depth}function zte(t,e){return e.depth-t.depth}class u9e{constructor(){this.array=[],this.pool=[]}push(e,n){const i=this.pool,r=this.array,a=r.length;a>=i.length&&i.push({depth:null,index:null,depthSort:null});const s=i[a];s.depth=e,s.index=n,r.push(s)}reset(){this.array.length=0}}const AT=new tp,pu=new u9e,tg=new Dt,k0=new Dt,XC=new te,sS=new te,D0=new te,f9e=new te,au=new Ur;kn.prototype.performFrustumCulling=function(t,e=t){const n=this._parentLOD??this,i=n.LODinfo;let r;if(i){r=t!==e?i.shadowRender??i.render:i.render;for(const a of i.objects)a.count=0}else n.count=0;n._instancesArrayCount!==0&&(r?.levels.length>0?n.frustumCullingLOD(r,t,e):n.frustumCulling(t))};kn.prototype.frustumCullingAlreadyPerformed=function(t,e,n){const i=this._lastRenderInfo;return i.frame===t&&i.camera===e&&i.shadowCamera===n?!0:(i.frame=t,i.camera=e,i.shadowCamera=n,!1)};kn.prototype.frustumCulling=function(t){var e;const n=this._sortObjects,i=this._perObjectFrustumCulled,r=this.instanceIndex.array;if(this.instanceIndex._needsUpdate=!0,!i&&!n){this.updateIndexArray();return}if(n&&(k0.copy(this.matrixWorld).invert(),sS.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k0),XC.set(0,0,-1).transformDirection(t.matrixWorld).transformDirection(k0)),i?(tg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse).multiply(this.matrixWorld),this.bvh?this.BVHCulling(t):this.linearCulling(t)):this.updateRenderList(),n){const a=this.customSort;a===null?pu.array.sort((e=this.material)!=null&&e.transparent?zte:Bte):a(pu.array);const s=pu.array,o=s.length;for(let l=0;l<o;l++)r[l]=s[l].index;this.count=o,pu.reset()}};kn.prototype.updateIndexArray=function(){if(!this._indexArrayNeedsUpdate)return;const t=this.instanceIndex.array,e=this._instancesArrayCount;let n=0;for(let i=0;i<e;i++)this.getActiveAndVisibilityAt(i)&&(t[n++]=i);this.count=n,this._indexArrayNeedsUpdate=!1};kn.prototype.updateRenderList=function(){const t=this._instancesArrayCount;for(let e=0;e<t;e++)if(this.getActiveAndVisibilityAt(e)){const n=this.getPositionAt(e).sub(sS).dot(XC);pu.push(n,e)}};kn.prototype.BVHCulling=function(t){const e=this.instanceIndex.array,n=this._instancesArrayCount,i=this._sortObjects,r=this.onFrustumEnter;let a=0;this.bvh.frustumCulling(tg,s=>{const o=s.object;if(o<n&&this.getVisibilityAt(o)&&(!r||r(o,t)))if(i){const l=this.getPositionAt(o).sub(sS).dot(XC);pu.push(l,o)}else e[a++]=o}),this.count=a};kn.prototype.linearCulling=function(t){const e=this.instanceIndex.array;this.geometry.boundingSphere||this.geometry.computeBoundingSphere();const n=this._geometry.boundingSphere,i=n.radius,r=n.center,a=this._instancesArrayCount,s=r.x===0&&r.y===0&&r.z===0,o=this._sortObjects,l=this.onFrustumEnter;let c=0;AT.setFromProjectionMatrix(tg);for(let u=0;u<a;u++)if(this.getActiveAndVisibilityAt(u)){if(s){const f=this.getPositionAndMaxScaleOnAxisAt(u,au.center);au.radius=i*f}else this.applyMatrixAtToSphere(u,au,r,i);if(AT.intersectsSphere(au)&&(!l||l(u,t)))if(o){const f=f9e.subVectors(au.center,sS).dot(XC);pu.push(f,u)}else e[c++]=u}this.count=c};kn.prototype.frustumCullingLOD=function(t,e,n){var i,r;const{count:a,levels:s}=t,o=e===n&&this._sortObjects;for(let c=0;c<s.length;c++)a[c]=0,s[c].object.instanceIndex&&(s[c].object.instanceIndex._needsUpdate=!0);tg.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse).multiply(this.matrixWorld),k0.copy(this.matrixWorld).invert(),sS.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k0),D0.setFromMatrixPosition(n.matrixWorld).applyMatrix4(k0);const l=t.levels.map(c=>c.object.instanceIndex.array);if(this.bvh?this.BVHCullingLOD(t,l,o,e,n):this.linearCullingLOD(t,l,o,e,n),o){const c=this.customSort,u=pu.array;let f=0,h=s[1].distance;c===null?u.sort((i=s[0].object.material)!=null&&i.transparent?zte:Bte):c(u);for(let d=0,g=u.length;d<g;d++){const b=u[d];b.depth>h&&(f++,h=((r=s[f+1])==null?void 0:r.distance)??1/0),l[f][a[f]++]=b.index}pu.reset()}for(let c=0;c<s.length;c++){const u=s[c].object;u.count=a[c]}};kn.prototype.BVHCullingLOD=function(t,e,n,i,r){const{count:a,levels:s}=t,o=this._instancesArrayCount,l=this.onFrustumEnter;n?this.bvh.frustumCulling(tg,c=>{const u=c.object;if(u<o&&this.getVisibilityAt(u)&&(!l||l(u,i,r))){const f=this.getPositionAt(u).distanceToSquared(D0);pu.push(f,u)}}):this.bvh.frustumCullingLOD(tg,D0,s,(c,u)=>{const f=c.object;if(f<o&&this.getVisibilityAt(f)){if(u===null){const h=this.getPositionAt(f).distanceToSquared(D0);u=this.getObjectLODIndexForDistance(s,h)}(!l||l(f,i,r,u))&&(e[u][a[u]++]=f)}})};kn.prototype.linearCullingLOD=function(t,e,n,i,r){const{count:a,levels:s}=t;this.geometry.boundingSphere||this.geometry.computeBoundingSphere();const o=this._geometry.boundingSphere,l=o.radius,c=o.center,u=this._instancesArrayCount,f=c.x===0&&c.y===0&&c.z===0,h=this.onFrustumEnter;AT.setFromProjectionMatrix(tg);for(let d=0;d<u;d++)if(this.getActiveAndVisibilityAt(d)){if(f){const g=this.getPositionAndMaxScaleOnAxisAt(d,au.center);au.radius=l*g}else this.applyMatrixAtToSphere(d,au,c,l);if(AT.intersectsSphere(au))if(n){if(!h||h(d,i,r))continue;const g=au.center.distanceToSquared(D0);pu.push(g,d)}else{const g=au.center.distanceToSquared(D0),b=this.getObjectLODIndexForDistance(s,g);(!h||h(d,i,r,b))&&(e[b][a[b]++]=d)}}};kn.prototype.clearTempInstance=function(t){const e=this._tempInstance;return e.id=t,this.clearInstance(e)};kn.prototype.clearTempInstancePosition=function(t){const e=this._tempInstance;return e.id=t,e.position.set(0,0,0),e};kn.prototype.clearInstance=function(t){return t.position.set(0,0,0),t.scale.set(1,1,1),t.quaternion.identity(),t};kn.prototype.updateInstances=function(t){const e=this._instancesArrayCount,n=this.instances;for(let i=0;i<e;i++){if(!this.getActiveAt(i))continue;const r=n?n[i]:this.clearTempInstance(i);t(r,i),r.updateMatrix()}return this};kn.prototype.updateInstancesPosition=function(t){const e=this._instancesArrayCount,n=this.instances;for(let i=0;i<e;i++){if(!this.getActiveAt(i))continue;const r=n?n[i]:this.clearTempInstancePosition(i);t(r,i),r.updateMatrixPosition()}return this};kn.prototype.createEntities=function(t){const e=this._instancesArrayCount;if(!this.instances)this.instances=new Array(e);else if(this.instances.length<e)this.instances.length=e;else return this;const n=this.instances;for(let i=t;i<e;i++)n[i]||(n[i]=new Ute(this,i,this._allowsEuler));return this};kn.prototype.addInstances=function(t,e){!e&&this.bvh&&console.warn("InstancedMesh2: if `computeBVH()` has already been called, it is better to valorize the instances in the `onCreation` callback for better performance.");const n=this._freeIds;if(n.length>0){let a=-1;const s=Math.min(n.length,t),o=n.length-s;for(let l=n.length-1;l>=o;l--){const c=n[l];c>a&&(a=c),this.addInstance(c,e)}n.length-=s,t-=s,this._instancesArrayCount=Math.max(a+1,this._instancesArrayCount)}const i=this._instancesArrayCount,r=i+t;this.setInstancesArrayCount(r);for(let a=i;a<r;a++)this.addInstance(a,e);return this};kn.prototype.addInstance=function(t,e){var n;this._instancesCount++,this.setActiveAndVisibilityAt(t,!0);const i=this.instances?this.clearInstance(this.instances[t]):this.clearTempInstance(t);e?(e(i,t),i.updateMatrix()):i.setMatrixIdentity(),(n=this.bvh)==null||n.insert(t)};kn.prototype.removeInstances=function(...t){const e=this._freeIds,n=this.bvh;for(const i of t)i<this._instancesArrayCount&&this.getActiveAt(i)&&(this.setActiveAt(i,!1),e.push(i),n?.delete(i),this._instancesCount--);for(let i=this._instancesArrayCount-1;i>=0&&!this.getActiveAt(i);i--)this._instancesArrayCount--;return this};kn.prototype.clearInstances=function(){var t;if(this._instancesCount=0,this._instancesArrayCount=0,this._freeIds.length=0,(t=this.bvh)==null||t.clear(),this.LODinfo)for(const e of this.LODinfo.objects)e.count=0;return this};kn.prototype.getObjectLODIndexForDistance=function(t,e){for(let n=t.length-1;n>0;n--){const i=t[n],r=i.distance-i.distance*i.hysteresis;if(e>=r)return n}return 0};kn.prototype.setFirstLODDistance=function(t){if(this._parentLOD)throw new Error("Cannot create LOD for this InstancedMesh2.");return this.LODinfo||(this.LODinfo={render:null,shadowRender:null,objects:[this]}),this.LODinfo.render||(this.LODinfo.render={levels:[{distance:t,hysteresis:0,object:this}],count:[0]}),this};kn.prototype.addLOD=function(t,e,n=0,i=0){var r;if(this._parentLOD)throw new Error("Cannot create LOD for this InstancedMesh2.");if(!((r=this.LODinfo)!=null&&r.render)&&n===0)throw new Error('Cannot set distance to 0 for the first LOD. Call "setFirstLODDistance" method before use "addLOD".');return this.setFirstLODDistance(0),this.addLevel(this.LODinfo.render,t,e,n,i),this};kn.prototype.addShadowLOD=function(t,e=0,n=0){if(this._parentLOD)throw new Error("Cannot create LOD for this InstancedMesh2.");this.LODinfo||(this.LODinfo={render:null,shadowRender:null,objects:[this]}),this.LODinfo.shadowRender||(this.LODinfo.shadowRender={levels:[],count:[]});const i=this.addLevel(this.LODinfo.shadowRender,t,null,e,n);return i.castShadow=!0,this.castShadow=!0,this};kn.prototype.addLevel=function(t,e,n,i,r){const a=this.LODinfo.objects,s=t.levels;let o,l;i=i**2;const c=a.findIndex(u=>u.geometry===e);if(c===-1){const u={capacity:this._capacity,renderer:this._renderer};l=new kn(e,n??new fs,u,this),l.frustumCulled=!1,this.patchLevel(l),a.push(l),this.add(l)}else l=a[c],n&&(l.material=n);for(o=0;o<s.length&&!(i<s[o].distance);o++);return s.splice(o,0,{distance:i,hysteresis:r,object:l}),t.count.push(0),l};kn.prototype.updateLevel=function(t,e,n,i){if(!t)throw new Error("Render list is invalid.");const r=t.levels[e];if(!r)throw new Error("Cannot update an empty LOD.");if(n!=null&&!Number.isNaN(n)){const a=n**2;r.distance=a}return i!=null&&!Number.isNaN(i)&&(r.hysteresis=i),this};kn.prototype.updateLOD=function(t,e,n){var i;const r=(i=this==null?void 0:this.LODinfo)==null?void 0:i.render;if(t===0)throw new Error("Cannot change distance for LOD0. It is the main mesh and must stay at 0.");return this.updateLevel(r,t,e,n)};kn.prototype.updateShadowLOD=function(t,e,n){var i;return this.updateLevel((i=this.LODinfo)==null?void 0:i.shadowRender,t,e,n)};kn.prototype.updateAllLevels=function(t,e,n){var i;if(!(t!=null&&t.levels))throw new Error("Invalid LOD list.");const r=t.levels,a=((i=this.LODinfo)==null?void 0:i.render)===t,s=a?1:0;a&&(r[0].distance=0);const o=e?.length>0;let l=[];o&&(l=a&&e[0]===0?e.slice(1,Math.min(r.length,e.length)):e.slice(0,Math.min(r.length-s,e.length)),l.every((u,f)=>{if(f>0&&u<=l[f-1])throw new Error(`LOD distances must be strictly increasing: d[${f-1}]=${l[f-1]} < d[${f}]=${u}`);return!0}));const c=o?l.length:r.length-s;for(let u=0;u<c;u++){const f=o?l[u]:void 0,h=Array.isArray(n)?n[u]:n;this.updateLevel(t,s+u,f,h)}return this};kn.prototype.updateAllLOD=function(t,e){var n;return this.updateAllLevels((n=this.LODinfo)==null?void 0:n.render,t,e)};kn.prototype.updateAllShadowLOD=function(t,e){var n;return this.updateAllLevels((n=this.LODinfo)==null?void 0:n.shadowRender,t,e)};kn.prototype.disposeLOD=function(t){t.geometry.dispose();const e=t.material;if(Array.isArray(e))for(const n of e)n.dispose();else e.dispose()};kn.prototype.removeLOD=function(t,e=!0){var n,i,r,a,s,o;const l=this.LODinfo,c=l?.render;if(!(c!=null&&c.levels))throw new Error("Invalid LOD list.");const u=c.levels.length;if(t<0||t>=u)throw new Error("Level index OOB");if(u>1&&t===0)throw new Error("Cannot remove LOD0 while others exist");const[f]=c.levels.splice(t,1);(i=(n=c.count)==null?void 0:n.splice)==null||i.call(n,t,1),c.levels.length<=1&&(l.render=null);const h=f.object,d=(r=this.LODinfo)==null?void 0:r.shadowRender;if(d!=null&&d.levels&&t<d.levels.length&&(d.levels.splice(t,1),(s=(a=d.count)==null?void 0:a.splice)==null||s.call(a,t,1),d.levels.length===0&&(this.LODinfo.shadowRender=null)),e&&h!==this)try{this.remove(h);const g=((o=l.objects)==null?void 0:o.indexOf(h))??-1;g!==-1&&l.objects.splice(g,1),this.disposeLOD(h)}catch(g){console.error(g)}return this};kn.prototype.patchLevel=function(t){Object.defineProperty(t,"renderOrder",{get(){return this._parentLOD.renderOrder}}),Object.defineProperty(t,"_lastRenderInfo",{get(){return this._parentLOD._lastRenderInfo}}),Object.defineProperty(t,"matricesTexture",{get(){return this._parentLOD.matricesTexture}}),Object.defineProperty(t,"colorsTexture",{get(){return this._parentLOD.colorsTexture}}),Object.defineProperty(t,"uniformsTexture",{get(){return this._parentLOD.uniformsTexture}}),Object.defineProperty(t,"morphTexture",{get(){return this._parentLOD.morphTexture}}),Object.defineProperty(t,"boneTexture",{get(){return this._parentLOD.boneTexture}}),Object.defineProperty(t,"skeleton",{get(){return this._parentLOD.skeleton}}),Object.defineProperty(t,"bindMatrixInverse",{get(){return this._parentLOD.bindMatrixInverse}}),Object.defineProperty(t,"bindMatrix",{get(){return this._parentLOD.bindMatrix}})};const h9e=new _i;kn.prototype.getMorphAt=function(t,e=h9e){const n=e.morphTargetInfluences,i=this.morphTexture.source.data.data,r=n.length+1,a=t*r+1;for(let s=0;s<n.length;s++)n[s]=i[a+s];return e};kn.prototype.setMorphAt=function(t,e){const n=e.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&!this._parentLOD&&(this.morphTexture=new cs(new Float32Array(i*this._capacity),i,this._capacity,Th,wr));const r=this.morphTexture.source.data.data;let a=0;for(const l of n)a+=l;const s=this._geometry.morphTargetsRelative?1:1-a,o=i*t;r[o]=s,r.set(n,o+1),this.morphTexture.needsUpdate=!0};const y8=[],CT=new _i,d9e=new xf,IG=new te,NG=new te,LG=new Dt,PG=new Ur;kn.prototype.raycast=function(t,e){if(this._parentLOD||!this.material||this._instancesArrayCount===0||!this.instanceIndex)return;CT.geometry=this._geometry,CT.material=this.material;const n=t.ray,i=t.near,r=t.far;LG.copy(this.matrixWorld).invert(),NG.setFromMatrixScale(this.matrixWorld),IG.copy(t.ray.direction).multiply(NG);const a=IG.length();t.ray=d9e.copy(t.ray).applyMatrix4(LG),t.near/=a,t.far/=a,this.raycastInstances(t,e),t.ray=n,t.near=i,t.far=r};kn.prototype.raycastInstances=function(t,e){if(this.bvh)this.bvh.raycast(t,n=>this.checkObjectIntersection(t,n,e));else{if(this.boundingSphere===null&&this.computeBoundingSphere(),PG.copy(this.boundingSphere),!t.ray.intersectsSphere(PG))return;const n=this.instanceIndex.array,i=this.raycastOnlyFrustum&&this._perObjectFrustumCulled?this.count:this._instancesArrayCount;for(let r=0;r<i;r++)this.checkObjectIntersection(t,n[r],e)}};kn.prototype.checkObjectIntersection=function(t,e,n){if(!(e>this._instancesArrayCount||!this.getActiveAndVisibilityAt(e))){this.getMatrixAt(e,CT.matrixWorld),CT.raycast(t,y8);for(const i of y8)i.instanceId=e,i.object=this,n.push(i);y8.length=0}};kn.prototype.initSkeleton=function(t,e=!0){if(t&&this.skeleton!==t&&!this._parentLOD){const n=t.bones;if(this.skeleton=t,this.bindMatrix=new Dt,this.bindMatrixInverse=new Dt,this.boneTexture=new TT(Float32Array,4,4*n.length,this._capacity),e)for(const i of n)i.matrixAutoUpdate=!1,i.matrixWorldAutoUpdate=!1;this.materialsNeedsUpdate()}};kn.prototype.setBonesAt=function(t,e=!0,n){const i=this.skeleton;if(!i)throw new Error('"setBonesAt" cannot be called before "initSkeleton"');const r=i.bones,a=i.boneInverses;for(let s=0,o=r.length;s<o;s++){const l=r[s];e&&(n!=null&&n.has(l.name)||l.updateMatrix(),l.matrixWorld.multiplyMatrices(l.parent.matrixWorld,l.matrix)),this.multiplyBoneMatricesAt(t,s,l.matrixWorld,a[s])}this.boneTexture.enqueueUpdate(t)};kn.prototype.multiplyBoneMatricesAt=function(t,e,n,i){const r=(t*this.skeleton.bones.length+e)*16,a=n.elements,s=i.elements,o=this.boneTexture._data,l=a[0],c=a[4],u=a[8],f=a[12],h=a[1],d=a[5],g=a[9],b=a[13],y=a[2],p=a[6],x=a[10],_=a[14],w=a[3],M=a[7],S=a[11],A=a[15],C=s[0],k=s[4],R=s[8],N=s[12],P=s[1],j=s[5],z=s[9],X=s[13],F=s[2],H=s[6],V=s[10],W=s[14],B=s[3],Y=s[7],Z=s[11],G=s[15];o[r+0]=l*C+c*P+u*F+f*B,o[r+4]=l*k+c*j+u*H+f*Y,o[r+8]=l*R+c*z+u*V+f*Z,o[r+12]=l*N+c*X+u*W+f*G,o[r+1]=h*C+d*P+g*F+b*B,o[r+5]=h*k+d*j+g*H+b*Y,o[r+9]=h*R+d*z+g*V+b*Z,o[r+13]=h*N+d*X+g*W+b*G,o[r+2]=y*C+p*P+x*F+_*B,o[r+6]=y*k+p*j+x*H+_*Y,o[r+10]=y*R+p*z+x*V+_*Z,o[r+14]=y*N+p*X+x*W+_*G,o[r+3]=w*C+M*P+S*F+A*B,o[r+7]=w*k+M*j+S*H+A*Y,o[r+11]=w*R+M*z+S*V+A*Z,o[r+15]=w*N+M*X+S*W+A*G};kn.prototype.getUniformAt=function(t,e,n){if(!this.uniformsTexture)throw new Error(`Before get/set uniform, it's necessary to use "initUniformsPerInstance".`);return this.uniformsTexture.getUniformAt(t,e,n)};kn.prototype.setUniformAt=function(t,e,n){if(!this.uniformsTexture)throw new Error(`Before get/set uniform, it's necessary to use "initUniformsPerInstance".`);this.uniformsTexture.setUniformAt(t,e,n),this.uniformsTexture.enqueueUpdate(t)};kn.prototype.initUniformsPerInstance=function(t){if(!this._parentLOD){const{channels:e,pixelsPerInstance:n,uniformMap:i,fetchInFragmentShader:r}=this.getUniformSchemaResult(t);this.uniformsTexture=new TT(Float32Array,e,n,this._capacity,i,r),this.materialsNeedsUpdate()}};kn.prototype.getUniformSchemaResult=function(t){let e=0;const n=new Map,i=[],r=t.vertex??{},a=t.fragment??{};let s=!0;for(const c in r){const u=r[c],f=this.getUniformSize(u);e+=f,i.push({name:c,type:u,size:f}),s=!1}for(const c in a)if(!r[c]){const u=a[c],f=this.getUniformSize(u);e+=f,i.push({name:c,type:u,size:f})}i.sort((c,u)=>u.size-c.size);const o=[];for(const{name:c,size:u,type:f}of i){const h=this.getUniformOffset(u,o);n.set(c,{offset:h,size:u,type:f})}const l=Math.ceil(e/4);return{channels:Math.min(e,4),pixelsPerInstance:l,uniformMap:n,fetchInFragmentShader:s}};kn.prototype.getUniformOffset=function(t,e){if(t<4){for(let i=0;i<e.length;i++)if(e[i]+t<=4){const r=i*4+e[i];return e[i]+=t,r}}const n=e.length*4;for(;t>0;t-=4)e.push(t);return n};kn.prototype.getUniformSize=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;case"mat3":return 9;case"mat4":return 16;default:throw new Error(`Invalid uniform type: ${t}`)}};var p9e=`#ifdef USE_INSTANCING_INDIRECT\r
  attribute uint instanceIndex;\r
  uniform highp sampler2D matricesTexture;  

  mat4 getInstancedMatrix() {\r
    int size = textureSize( matricesTexture, 0 ).x;\r
    int j = int( instanceIndex ) * 4;\r
    int x = j % size;\r
    int y = j / size;\r
    vec4 v1 = texelFetch( matricesTexture, ivec2( x, y ), 0 );\r
    vec4 v2 = texelFetch( matricesTexture, ivec2( x + 1, y ), 0 );\r
    vec4 v3 = texelFetch( matricesTexture, ivec2( x + 2, y ), 0 );\r
    vec4 v4 = texelFetch( matricesTexture, ivec2( x + 3, y ), 0 );\r
    return mat4( v1, v2, v3, v4 );\r
  }\r
#endif`,m9e=`#ifdef USE_INSTANCING_COLOR_INDIRECT\r
  uniform highp sampler2D colorsTexture;

  #ifdef USE_COLOR_ALPHA\r
    vec4 getColorTexture() {\r
      int size = textureSize( colorsTexture, 0 ).x;\r
      int j = int( instanceIndex );\r
      int x = j % size;\r
      int y = j / size;\r
      return texelFetch( colorsTexture, ivec2( x, y ), 0 );\r
    }\r
  #else\r
    vec3 getColorTexture() {\r
      int size = textureSize( colorsTexture, 0 ).x;\r
      int j = int( instanceIndex );\r
      int x = j % size;\r
      int y = j / size;\r
      return texelFetch( colorsTexture, ivec2( x, y ), 0 ).rgb;\r
    }\r
  #endif\r
#endif`,g9e=`#ifdef USE_INSTANCING_INDIRECT\r
  mat4 instanceMatrix = getInstancedMatrix();

  #ifdef USE_INSTANCING_COLOR_INDIRECT\r
    vColor *= getColorTexture();\r
  #endif\r
#endif`,b9e=`#ifdef USE_INSTANCING_COLOR_INDIRECT\r
  #ifdef USE_VERTEX_COLOR\r
    vColor = color;\r
  #else\r
    #ifdef USE_COLOR_ALPHA\r
      vColor = vec4( 1.0 );\r
    #else\r
      vColor = vec3( 1.0 );\r
    #endif\r
  #endif\r
#endif`,v9e=`#ifdef USE_SKINNING\r
  uniform mat4 bindMatrix;\r
  uniform mat4 bindMatrixInverse;\r
  uniform highp sampler2D boneTexture;

  #ifdef USE_INSTANCING_SKINNING\r
    uniform int bonesPerInstance;\r
  #endif

  mat4 getBoneMatrix( const in float i ) {\r
    int size = textureSize( boneTexture, 0 ).x;

    #ifdef USE_INSTANCING_SKINNING\r
      int j = ( bonesPerInstance * int( instanceIndex ) + int( i ) ) * 4;\r
    #else\r
      int j = int( i ) * 4;\r
    #endif

    int x = j % size;\r
    int y = j / size;\r
    vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\r
    vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\r
    vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\r
    vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\r
    return mat4( v1, v2, v3, v4 );\r
  }\r
#endif`;hn.instanced_pars_vertex=p9e;hn.instanced_color_pars_vertex=m9e;hn.instanced_vertex=g9e;hn.instanced_color_vertex=b9e;function R4(t){return t.replace("#ifdef USE_INSTANCING","#if defined USE_INSTANCING || defined USE_INSTANCING_INDIRECT")}hn.project_vertex=R4(hn.project_vertex);hn.worldpos_vertex=R4(hn.worldpos_vertex);hn.defaultnormal_vertex=R4(hn.defaultnormal_vertex);hn.batching_pars_vertex=hn.batching_pars_vertex.concat(`
#include <instanced_pars_vertex>`);hn.color_pars_vertex=hn.color_pars_vertex.concat(`
#include <instanced_color_pars_vertex>`);hn.batching_vertex=hn.batching_vertex.concat(`
#include <instanced_vertex>`);hn.skinning_pars_vertex=v9e;hn.morphinstance_vertex&&(hn.morphinstance_vertex=hn.morphinstance_vertex.replaceAll("gl_InstanceID","instanceIndex"));(function(){var t="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuec;G:Qdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq;i28Adbk:Bhdhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;C:kjjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8AarcUf9cb83ibarc8Wf9cb83ibarcyf9cb83ibarcaf9cb83ibarcKf9cb83ibarczf9cb83ibar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzarc;qofcKfhHarc;qofczfhOcbhAincdhCcbhodnavci6mbaH9cb83ibaO9cb83ibar9cb83i;yoar9cb83i;qoadaAfgoybbhXcbhQincbhwcbhLdninaoalfhKaoybbgYaX7aLVhLawcP0meaKhoaYhXawcefgwaQfai6mbkkcbhXarc;qofhwincwh8AcwhEdnaLaX93gocFeGg3cs0mbclhEa3ci0mba3cb9hcethEkdnaocw4cFeGg3cs0mbclh8Aa3ci0mba3cb9hceth8Aka8AaEfh3awydbh5cwh8AcwhEdnaocz4cFeGg8Ecs0mbclhEa8Eci0mba8Ecb9hcethEka3a5fh3dnaocFFFFb0mbclh8AaocFFF8F0mbaocFFFr0ceth8Akawa3aEfa8AfBdbawclfhwaXcefgXcw9hmbkaKhoaYhXaQczfgQai6mbkcbhocehwazhLinawaoaLydbarc;qofaocdtfydb6EhoaLclfhLawcefgwcw9hmbkcihCkcbh3arc;qlfcbcjdz:xjjjb8Aarc;alfcwfcbBdbar9cb83i;alaoclth8Fadhaaqhhakh5inarc;qlfadcba3cufgoaoa30Eal2falz:wjjjb8Aaiahaiah6Ehgdnaqaia39Ra3aqfai6EgYcsfc9WGgoaY9nmbarc;qofaYfcbaoaY9Rz:xjjjb8Akada3al2fh8Jcbh8Kina8Ka8FVcl4hQarc;alfa8Kcdtfh8LaAh8Mcbh8Nina8NaAfhwdndndndndndna8KPldebidkasa8Mc98GgLfhoa5aLfh8Aarc;qlfawc98GgLfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkaYTmla8Ncith8Ea8JaLfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aQ93a8E486bba8Aalfh8AaEalfhEaLhXaKcefgKaY9hmbxlkkaYTmia8Mc9:Ghoa8NcitcwGhEarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhLarc;qofhwaghXinawa5aofRbbcwtaaaofRbbVg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbaoalfhoawcefhwa8AhLa3aXcufgX9hmbxikkaYTmda8Jawfhoarc;qlfawfRbbhLarc;qofhwaghXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLa3aXcufgX9hmbxdkkaYTmeka8LydbhEcbhKarc;qofhoincdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egwa8Aawa8A6Egwczawcz6EaEfhEaoczfhoaKczfgKaY6mbka8LaEBdbka8Mcefh8Ma8Ncefg8Ncl9hmbka8Kcefg8KaC9hmbkaaamfhaahaxfhha5amfh5a3axfg3ai6mbkcbhocehwaPhLinawaoaLydbarc;alfaocdtfydb6EhoaLclfhLawcefgXhwaCaX9hmbkaraAcd4fa8FcdVaoaocdSE86bbaAclfgAal6mbkkabaefh8Kabcefhoalcd4gecbaDEhkadcefhOarc;abfceVhHcbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aa8Kao9Rak6mdadamal2gwfhxcbh8JaOawfhzaocbakz:xjjjbghakfh5aqaiam9Ramaqfai6Egscsfgocl4cifcd4hCaoc9WGg8LThPindndndndndndndndndndnaDTmbara8Jcd4fRbbgLciGPlbedlbkasTmdaxa8Jfhoarc;abfa8JfRbbhLarc;qofhwashXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLaXcufgXmbxikkasTmia8JcitcwGhEarc;abfa8JceVfRbbcwtarc;abfa8Jc9:GgofRbbVhLaxaofhoarc;qofhwashXinawao8Vbbg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbawcefhwaoalfhoa8AhLaXcufgXmbxdkkaHa8Jc98GgEfhoazaEfh8Aarc;abfaEfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkasTmbaLcl4hYa8JcitcKGh3axaEfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aY93a3486bba8Aalfh8AaEalfhEaLhXaKcefgKas9hmbkkaDmbcbhoxlka8LTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8L9pmdxbkkdnavmbcehoxikcbhEaChKaChYinarc;qofaEfgocwf8Pibhyao8Pibh8PcdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egoa8Aaoa8A6Egoczaocz6EaYfhYaocucbaya8P:e9cb9sEgwaoaw6EaKfhKaEczfgEa8L9pmdxbkkaha8Jcd4fgoaoRbbcda8JcetcoGtV86bbxikdnaKas6mbaYas6mbaha8Jcd4fgoaoRbbcia8JcetcoGtV86bba8Ka59Ras6mra5arc;qofasz:wjjjbasfh5xikaKaY9phokaha8Jcd4fgwawRbbaoa8JcetcoGtV86bbka8Ka59RaC6mla5cbaCz:xjjjbgAaCfhYdndna8LmbaPhoxekdna8KaY9RcK9pmbaPhoxekaocdtc:q1jjbfcj1jjbaDEg5ydxggcetc;:FFFeGh8Fcuh3cuagtcu7cFeGhacbh8Marc;qofhLinarc;qofa8MfhQczhEdndndnagPDbeeeeeeedekcucbaQcwf8PibaQ8Pib:e9cb9sEhExekcbhoa8FhEinaEaaaLaofRbb9nfhEaocefgocz9hmbkkcih8Ecbh8Ainczhwdndndna5a8AcdtfydbgKPDbeeeeeeedekcucbaQcwf8PibaQ8Pib:e9cb9sEhwxekaKcetc;:FFFeGhwcuaKtcu7cFeGhXcbhoinawaXaLaofRbb9nfhwaocefgocz9hmbkkdndnawaE6mbaKa39hmeawaE9hmea5a8EcdtfydbcwSmeka8Ah8EawhEka8Acefg8Aci9hmbkaAa8Mco4fgoaoRbba8Ea8Mci4coGtV86bbdndndna5a8Ecdtfydbg3PDdbbbbbbbebkdncwa39Tg8ETmbcua3tcu7hwdndna3ceSmbcbh8NaLhQinaQhoa8Eh8AcbhXinaoRbbgEawcFeGgKaEaK6EaXa3tVhXaocefhoa8Acufg8AmbkaYaX86bbaQa8EfhQaYcefhYa8Na8Efg8Ncz6mbxdkkcbh8NaLhQinaQhoa8Eh8AcbhXinaoRbbgEawcFeGgKaEaK6EaXcetVhXaocefhoa8Acufg8AmbkaYaX:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaQa8EfhQaYcefhYa8Na8Efg8Ncz6mbkkcbhoinaYaLaofRbbgX86bbaYaXawcFeG9pfhYaocefgocz9hmbxikkdna3ceSmbinaYcb86bbaYcefhYxbkkinaYcb86bbaYcefhYxbkkaYaQ8Pbb83bbaYcwfaQcwf8Pbb83bbaYczfhYka8Mczfg8Ma8L9pgomeaLczfhLa8KaY9RcK9pmbkkaoTmlaYh5aYTmlka8Jcefg8Jal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma5hoa5mbkcbhwxdkdna8Kao9RakalfgwcKcaaDEgLawaL0EgX9pmbcbhwxdkdnawaL9pmbaocbaXaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoaraez:wjjjbaefhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;C:kjjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;C:kjjbk:Ese5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd;m:kjjbgrc;GeV86bbalc;abfcFecjez:xjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc;i1jjbfydbcdtfydbh3aLaoc;e1jjbfydbcdtfydbh8AaLaoc;a1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc;a1jjbfydbcdtfydbgKTaLavc;e1jjbfydbcdtfydbg8AceSGaLavc;i1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavc:W1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkdnaeaP9nmbcbhvxekcbhvinaeavfavc:W1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:kjjbk:Adewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb;m:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkdnaoar9nmbcbskaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b0Ec:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A0Ec:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk:Ylvdud99due99iudnaeTmbceaicufgvthocuaitcu7:Zhrcuavtcu7:Zhwcbhvadcl9hhDcbhqindndnalcwfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikdndnalIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohdxekcjjjj94hdkadai9Rcd9TgxaifhidndnalclfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEawNJbbbZMgk:lJbbb9p9DTmbak:Ohmxekcjjjj94hmkadaifhiaoamVhmdndnaDmbabavfgPai86bbaPcifam86bbaPcdfad86bbaPcefax86bbxekabaqfgPai87ebaPcofam87ebaPclfad87ebaPcdfax87ebkalczfhlavclfhvaqcwfhqaecufgembkkk;YqdXui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AcbhodnadTmbcbhoaiTmbdndnabaeSmbaehrxekavcuadcdtgwadcFFFFi0Ecbyd;q:kjjbHjjjjbbgrBd:SeavceBd:mdaraeawz:wjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaradaiavc:Sefz:pjjjbavyd:GehDadci9Ugqcbyd;q:kjjbHjjjjbbheavc:Sefavyd:mdgkcdtfaeBdbavakcefgwBd:mdaecbaqz:xjjjbhxavc:SefawcdtfcuaicdtaicFFFFi0Ecbyd;q:kjjbHjjjjbbgmBdbavakcdfgPBd:mdalc;ebfhsaDheamhwinawalIdbasaeydbgzcwazcw6EcdtfIdbMUdbaeclfheawclfhwaicufgimbkavc:SefaPcdtfcuaqcdtadcFFFF970Ecbyd;q:kjjbHjjjjbbgPBdbdnadci6mbarheaPhwaqhiinawamaeydbcdtfIdbamaeclfydbcdtfIdbMamaecwfydbcdtfIdbMUdbaecxfheawclfhwaicufgimbkkakcifhoalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhzcbhwcbhXcehQinaehLcihkarawci2gKcdtfgeydbhsaeclfydbhdabaXcx2fgicwfaecwfydbgYBdbaiclfadBdbaiasBdbaxawfce86bbaOaYBdwaOadBdlaOasBdbaPawcdtfcbBdbdnazTmbcihkaLhiinaOakcdtfaiydbgeBdbakaeaY9haeas9haead9hGGfhkaiclfhiazcufgzmbkkaXcefhXcbhzinaCaAarazaKfcdtfydbcdtgifydbcdtfgYheaDaifgdydbgshidnasTmbdninaeydbawSmeaeclfheaicufgiTmdxbkkaeaYascdtfc98fydbBdbadadydbcufBdbkazcefgzci9hmbkdndnakTmbcuhwJbbbbh8Acbhdavyd:KehYavyd:OehKindndnaDaOadcdtfydbcdtgzfydbgembadcefhdxekadcs0hiamazfgsIdbhEasalcbadcefgdaiEcdtfIdbaHaecwaecw6EcdtfIdbMg3Udba3aE:th3aecdthiaKaYazfydbcdtfheinaPaeydbgzcdtfgsa3asIdbMgEUdbaEa8Aa8AaE9DgsEh8AazawasEhwaeclfheaic98fgimbkkadak9hmbkawcu9hmekaQaq9pmdindnaxaQfRbbmbaQhwxdkaqaQcefgQ9hmbxikkakczakcz6EhzaOheaLhOawcu9hmbkkaocdtavc:Seffc98fhedninaoTmeaeydbcbyd;u:kjjbH:bjjjbbaec98fheaocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd;q:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic;K1jjbz:ojjjbkQbabaeadaic;m:jjjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:Vvioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:kjjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:kjjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkclhvdninavc98Smealcxfavfydbcbyd;u:kjjbH:bjjjbbavc98fhvxbkkalc;Waf8Kjjjjbk:Jwliuo99iud9:cbhv8Jjjjjbca9Rgoczfcwfcbyd:8:kjjbBdbaocb8Pd:0:kjjb83izaocwfcbyd;i:kjjbBdbaocb8Pd;a:kjjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:kjjbgeabcifc98GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:kjjbgeabcrfc94GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;y:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;y:kjjbfgdBd;y:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk;Qddbcjwk;mdbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;mqkzebbbebbbdbbb9G:vbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(t),{}).then(function(d){n=d.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function r(d){for(var g=new Uint8Array(d.length),b=0;b<d.length;++b){var y=d.charCodeAt(b);g[b]=y>96?y-97:y>64?y-39:y+4}for(var p=0,b=0;b<d.length;++b)g[p++]=g[b]<60?e[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,p)}function a(d){if(!d)throw new Error("Assertion failed")}function s(d){return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}function o(d,g,b,y){var p=n.exports.sbrk,x=p(g.length*4),_=p(b*4),w=new Uint8Array(n.exports.memory.buffer),M=s(g);w.set(M,x),y&&y(x,x,g.length,b);var S=d(_,x,g.length,b);w=new Uint8Array(n.exports.memory.buffer);var A=new Uint32Array(b);new Uint8Array(A.buffer).set(w.subarray(_,_+b*4)),M.set(w.subarray(x,x+g.length*4)),p(x-p(0));for(var C=0;C<g.length;++C)g[C]=A[g[C]];return[A,S]}function l(d,g,b,y){var p=n.exports.sbrk,x=p(b*4),_=p(b*y),w=new Uint8Array(n.exports.memory.buffer);w.set(s(g),_),d(x,_,b,y),w=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(b);return new Uint8Array(M.buffer).set(w.subarray(x,x+b*4)),p(x-p(0)),M}function c(d,g,b,y,p,x,_){var w=n.exports.sbrk,M=w(g),S=w(y*p),A=new Uint8Array(n.exports.memory.buffer);A.set(s(b),S);var C=d(M,g,S,y,p,x,_),k=new Uint8Array(C);return k.set(A.subarray(M,M+C)),w(M-w(0)),k}function u(d){for(var g=0,b=0;b<d.length;++b){var y=d[b];g=g<y?y:g}return g}function f(d,g){if(a(g==2||g==4),g==4)return new Uint32Array(d.buffer,d.byteOffset,d.byteLength/4);var b=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/2);return new Uint32Array(b)}function h(d,g,b,y,p,x,_){var w=n.exports.sbrk,M=w(b*y),S=w(b*x),A=new Uint8Array(n.exports.memory.buffer);A.set(s(g),S),d(M,b,y,p,S,_);var C=new Uint8Array(b*y);return C.set(A.subarray(M,M+b*y)),w(M-w(0)),C}return{ready:i,supported:!0,reorderMesh:function(d,g,b){var y=g?b?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return o(n.exports.meshopt_optimizeVertexFetchRemap,d,u(d)+1,y)},reorderPoints:function(d,g){return a(d instanceof Float32Array),a(d.length%g==0),a(g>=3),l(n.exports.meshopt_spatialSortRemap,d,d.length/g,g*4)},encodeVertexBuffer:function(d,g,b){a(b>0&&b<=256),a(b%4==0);var y=n.exports.meshopt_encodeVertexBufferBound(g,b);return c(n.exports.meshopt_encodeVertexBuffer,y,d,g,b)},encodeVertexBufferLevel:function(d,g,b,y,p){a(b>0&&b<=256),a(b%4==0),a(y>=0&&y<=3),a(p===void 0||p==0||p==1);var x=n.exports.meshopt_encodeVertexBufferBound(g,b);return c(n.exports.meshopt_encodeVertexBufferLevel,x,d,g,b,y,p||0)},encodeIndexBuffer:function(d,g,b){a(b==2||b==4),a(g%3==0);var y=f(d,b),p=n.exports.meshopt_encodeIndexBufferBound(g,u(y)+1);return c(n.exports.meshopt_encodeIndexBuffer,p,y,g,4)},encodeIndexSequence:function(d,g,b){a(b==2||b==4);var y=f(d,b),p=n.exports.meshopt_encodeIndexSequenceBound(g,u(y)+1);return c(n.exports.meshopt_encodeIndexSequence,p,y,g,4)},encodeGltfBuffer:function(d,g,b,y){var p={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return a(p[y]),p[y](d,g,b)},encodeFilterOct:function(d,g,b,y){return a(b==4||b==8),a(y>=1&&y<=16),h(n.exports.meshopt_encodeFilterOct,d,g,b,y,16)},encodeFilterQuat:function(d,g,b,y){return a(b==8),a(y>=4&&y<=16),h(n.exports.meshopt_encodeFilterQuat,d,g,b,y,16)},encodeFilterExp:function(d,g,b,y,p){a(b>0&&b%4==0),a(y>=1&&y<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return h(n.exports.meshopt_encodeFilterExp,d,g,b,y,b,p?x[p]:1)},encodeFilterColor:function(d,g,b,y){return a(b==4||b==8),a(y>=2&&y<=16),h(n.exports.meshopt_encodeFilterColor,d,g,b,y,16)}}})();(function(){var t="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuec:W:Odkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;BZkdbk;jYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbhodnawTmbaxa8Acd4fRbbhokaocFeGh5cbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q1jjbfcj1jjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bbarcwf9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfag9c8F1:NghcKtc8F91aicdfa8J9c8N1:Nfg8KRbbG86bbarcVfcba8KahcjeGcr4fghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fag9c8F1:NgicKtc8F91aha8J9c8N1:NfghRbbG86bbarc96fcbahaicjeGcr4fgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbb83bbarcwfaicwf8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbcbaocl49Rh8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E93aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:XseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K1jjbgeabcifc98GfgbBd:K1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk81dbcjwk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:Kwkl8WNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuec:q:6dkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq;Ctklbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:183lYud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxavaialfgmar9Rgoad;8qbbcj;abad9Uc;WFbGcjdadca0EhPdndndnadTmbaoadfhscbhzinaeaz9nmdamax9RaD6miabazad2fhHaxaDfhOaPaeaz9RazaPfae6EgAcsfgocl4cifcd4hCavcj;cbfaoc9WGgXcetfhQavcj;cbfaXci2fhLavcj;cbfaXfhKcbhYaoc;ab6h8AincbhodnawTmbaxaYcd4fRbbhokaocFeGhEcbh3avcj;cbfh5indndndndnaEa3cet4ciGgoc9:fPdebdkamaO9RaX6mwavcj;cbfa3aX2faOaX;8qbbaOaAfhOxdkavcj;cbfa3aX2fcbaX;8kbxekamaO9RaC6moaoclVcbawEhraOaCfhocbhidna8Ambamao9Rc;Gb6mbcbhlina5alfhidndndndndndnaOalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiczfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaicafaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaoclffaqc:q:yjjbfRbbfhoxikaic8Wfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaocwffaqc:q:yjjbfRbbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitc:q1jjbfpbibaic:q:yjjbfRbbgipsaoRbegqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqc:q:yjjbfRbbfhokalc;abfhialcjefaX0meaihlamao9Rc;Fb0mbkkdnaiaX9pmbaici4hlinamao9RcK6mwa5aifhqdndndndndndnaOaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaoclffahc:q:yjjbfRbbfhoxikaqaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaocwffahc:q:yjjbfRbbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpkbbaaaocdffahc:q:yjjbfRbbfhokalcdfhlaiczfgiaX6mbkkaohOaoTmoka5aXfh5a3cefg3cl9hmbkdndndndnawTmbasaYcd4fRbbglciGPlbedwbkaXTmdavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep9Ta8Epxeeeeeeeeeeeeeeeeg8Fp9op9Hp9rg8Eagp9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Ug8Fp9Abbbaladfgla8Fa8Ea8Epmlvorlvorlvorlvorp9Ug8Fp9Abbbaladfgla8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9Ug8Fp9Abbbaladfgla8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9AbbbaladfhlaoczfgoaX6mbxikkaXTmeavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep:nea8Epxebebebebebebebebg8Fp9op:bep9rg8Eagp:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeg8Fp9Abbbaladfgla8Fa8Ea8Epmlvorlvorlvorlvorp:oeg8Fp9Abbbaladfgla8Fa8Ea8EpmwDqkwDqkwDqkwDqkp:oeg8Fp9Abbbaladfgla8Fa8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9AbbbaladfhlaoczfgoaX6mbxdkkaXTmbcbhocbalcl4gl9Rc8FGhiavcjdfaYfhravaYfpbdbh8Finaravcj;cbfaofpblbggaKaofpblbg8JpmbzeHdOiAlCvXoQrLg8KaQaofpblbg8LaLaofpblbg8MpmbzeHdOiAlCvXoQrLg8NpmbezHdiOAlvCXorQLg8Eaip:Rea8Ealp:Sep9qg8Ea8Fp9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Fa8Ka8NpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwKDYq8AkEx3m5P8Es8Fgga8La8MpmwKDYq8AkEx3m5P8Es8Fg8JpmbezHdiOAlvCXorQLg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9AbbbaradfhraoczfgoaX6mbkkaYclfgYad6mbkaHavcjdfaAad2;8qbbavavcjdfaAcufad2fad;8qbbaAazfhzc9:hoaOhxaOmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdaPaeao9RaoaPfae6Eaofgoae6mbkaial9Rhxkcbc99amax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbk:TseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:2Pliur97eue978Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskaipxFubbFubbFubbFubbgxpklbdnalTmbcbhvabhdinadczfgmampbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblbaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgopklbaiaopklbaiabalcitfgdaeciGglcitgv;8qbbaiaxpkladnalTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblaaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkadaiav;8qbbkk;Iwllue97euo978Jjjjjbca9Rhidnaec98GglTmbcbhvabhoinaocKfpxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81ZaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qp;6ep;NegxaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meaxarczp:Sep;6ep;Megmamp;Meaxaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgxp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgPp9oamaxp;Mearp;Keczp:Rep9qgmaDaxp;Mearp;KeaPp9oaqaxp;Mearp;Keczp:Rep9qgrpmwDKYqk8AExm35Ps8E8FgDp5eakclp:RegxpEi:T:j83ibawaDp5baxpEd:T:j83ibaocwfamarpmbezHdiOAlvCXorQLgrp5eaxpEe:T:j83ibaoarp5baxpEb:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgxpklbaiaxpklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81ZaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qp;6ep;NegxaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meaxarczp:Sep;6ep;Megmamp;Meaxaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgxp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgPp9oamaxp;Mearp;Keczp:Rep9qgmaDaxp;Mearp;KeaPp9oaqaxp;Mearp;Keczp:Rep9qgrpmwDKYqk8AExm35Ps8E8FgDp5eakclp:RegxpEi:T:j83iKaiaDp5baxpEd:T:j83izaiamarpmbezHdiOAlvCXorQLgrp5eaxpEe:T:j83iwaiarp5baxpEb:T:j83ibkaoaiaw;8qbbkk;uddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaic8WfpxbbbbbbbbbbbbbbbbgopklbaicafaopklbaiczfaopklbaiaopklbaiabavcdtfgdalciGgecdtgv;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkadaiav;8qbbkk:CPvdue97euw97eu8Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadpbbbhradpxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpkbbadczfhdaoclfgoal6mbkkalaeSmeaiavpklaaicafabalcdtfgdaeciGglcdtgo;8qbbaiavpklbdnalTmbaipblahraipxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpklakadaicafao;8qbbskaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadczfgspxbFu9hbFu9hbFu9hbFu9hadpbbbgDaspbbbgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblbp9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpkbbadaxarpmbezHdiOAlvCXorQLpkbbadcafhdaoclfgoal6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgrpklbaiarpklbaiabalcitfgdaeciGglcitgo;8qbbaiavpkladnalTmbaipxbFu9hbFu9hbFu9hbFu9haipblbgDaipblzgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblap9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpklzaiaxarpmbezHdiOAlvCXorQLpklbkadaiao;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=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,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?o(e):o(t),a,s=WebAssembly.instantiate(r,{}).then(function(p){a=p.instance,a.exports.__wasm_call_ctors()});function o(p){for(var x=new Uint8Array(p.length),_=0;_<p.length;++_){var w=p.charCodeAt(_);x[_]=w>96?w-97:w>64?w-39:w+4}for(var M=0,_=0;_<p.length;++_)x[M++]=x[_]<60?i[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,M)}function l(p,x,_,w,M,S,A){var C=p.exports.sbrk,k=w+3&-4,R=C(k*M),N=C(S.length),P=new Uint8Array(p.exports.memory.buffer);P.set(S,N);var j=x(R,w,M,N,S.length);if(j==0&&A&&A(R,k,M),_.set(P.subarray(R,R+w*M)),C(R-C(0)),j!=0)throw new Error("Malformed buffer data: "+j)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],h=0;function d(p){var x={object:new Worker(p),pending:0,requests:{}};return x.object.onmessage=function(_){var w=_.data;x.pending-=w.count,x.requests[w.id][w.action](w.value),delete x.requests[w.id]},x}function g(p){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+y.name+";"+l.toString()+y.toString(),_=new Blob([x],{type:"text/javascript"}),w=URL.createObjectURL(_),M=f.length;M<p;++M)f[M]=d(w);for(var M=p;M<f.length;++M)f[M].object.postMessage({});f.length=p,URL.revokeObjectURL(w)}function b(p,x,_,w,M){for(var S=f[0],A=1;A<f.length;++A)f[A].pending<S.pending&&(S=f[A]);return new Promise(function(C,k){var R=new Uint8Array(_),N=++h;S.pending+=p,S.requests[N]={resolve:C,reject:k},S.object.postMessage({id:N,count:p,size:x,source:R,mode:w,filter:M},[R.buffer])})}function y(p){var x=p.data;if(!x.id)return self.close();self.ready.then(function(_){try{var w=new Uint8Array(x.count*x.size);l(_,_.exports[x.mode],w,x.count,x.size,x.source,_.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:w},[w.buffer])}catch(M){self.postMessage({id:x.id,count:x.count,action:"reject",value:M})}})}return{ready:s,supported:!0,useWorkers:function(p){g(p)},decodeVertexBuffer:function(p,x,_,w,M){l(a,a.exports.meshopt_decodeVertexBuffer,p,x,_,w,a.exports[c[M]])},decodeIndexBuffer:function(p,x,_,w){l(a,a.exports.meshopt_decodeIndexBuffer,p,x,_,w)},decodeIndexSequence:function(p,x,_,w){l(a,a.exports.meshopt_decodeIndexSequence,p,x,_,w)},decodeGltfBuffer:function(p,x,_,w,M,S){l(a,a.exports[u[M]],p,x,_,w,a.exports[c[S]])},decodeGltfBufferAsync:function(p,x,_,w,M){return f.length>0?b(p,x,_,u[w],c[M]):s.then(function(){var S=new Uint8Array(p*x);return l(a,a.exports[u[w]],S,p,x,_,a.exports[c[M]]),S})}}})();var y9e=function(){var t="b9H79Tebbbe:Gez9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuiXCdilvorlwiDqkxmPbssbelve9Weiiviebeoweuec:G:Pdkr;7eko9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95br8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bw8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbDQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bqX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbkQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bxX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbma9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbPl79IV9RbsDwebcekdOAq:d;OeCdbk:J1eo3ue99euE99Cue9:8Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:rjjjb8AdnabaeSmbabaeadcdtz:qjjjb8AkdnamcdGTmbalcrfci4gHcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:rjjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd1:jjjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egCcdtfaHBdbasaCcefBd;8eaHcFeaOz:rjjjbhQdnadTmbaecufhLcbhKindndnaQabaXcdtfgYydbgCc:v;t;h;Ev2aLGgOcdtfgAydbgHcuSmbceheinazaHcdtfydbaCSmdaOaefhHaecefheaQaHaLGgOcdtfgAydbgHcu9hmbkkazaKcdtfaCBdbaAaKBdbaKhHaKcefhKkaYaHBdbaXcefgXad9hmbkkaQcbyd:m:jjjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbhKasc:Cefasyd;8egecdtfaKBdbasaKBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:jjjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:jjjbHjjjjbbhCasc:Cefasyd;8egHcdtfaCBdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8eaCaYaialavazasc:Cefz:djjjbalcbyd1:jjjbHjjjjbbh5asc:Cefasyd;8egHcdtfa5BdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egOcdtfaHBdbasaOcefBd;8ea3cbyd1:jjjbHjjjjbbhOasc:Cefasyd;8egAcdtfaOBdbasaAcefBd;8eaHcFeaez:rjjjbh8EaOcFeaez:rjjjbh8FdnalTmbaEcwfhaindnaKa8AgOcefg8AcdtfydbgAaKaOcdtgefydbgHSmbaAaH9RhhaEaHcitfhga8Faefh8Ja8Eaefh8KcbhQindndnagaQcitfydbgLaO9hmba8KaOBdba8JaOBdbxekdnaKaLcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgAfydbaOSmeaHae9Rh8Maecu7aHfhXaaaAfhHcbheinaXaeSmeaecefheaHydbhAaHcwfhHaAaO9hmbkaea8M6meka8Fa8LfgeaOaLaeydbcuSEBdba8KaLaOa8KydbcuSEBdbkaQcefgQah9hmbkka8Aal9hmbkaChHaYhOa8FhAa8EhQcbheindndnaeaHydbgL9hmbdnaeaOydbgL9hmbaQydbhLdnaAydbgXcu9hmbaLcu9hmba5aefcb86bbxikdnaXcuSmbaLcuSmbaeaXSmbaCaXcdtfydbaCaLcdtfydb9hmba5aefcd86bbxika5aefh8KdnaeaXSmbaeaLSmba8Kce86bbxika8Kcl86bbxdkdnaeaYaLcdtgXfydb9hmbdnaAydbg8KcuSmbaea8KSmbaQydbghcuSmbaeahSmba8FaXfydbggcuSmbagaLSmba8EaXfydbgXcuSmbaXaLSmbdnaCa8KcdtfydbgLaCaXcdtfydb9hmbaLaCahcdtfydbgXSmbaXaCagcdtfydb9hmba5aefcd86bbxlka5aefcl86bbxika5aefcl86bbxdka5aefcl86bbxeka5aefa5aLfRbb86bbkaHclfhHaOclfhOaAclfhAaQclfhQalaecefge9hmbkdnamcaGTmbaEcwfh8Jcbh8Nindndna5a8NfgyRbbg8Pc9:fPibebekdndndnaCa8Ncdtfydbgea8N9hmbdnaqmbcbhgxdkdnazTmbcbhga8NheinagaqazaecdtgefydbfRbbcdGce4VhgaYaefydbgea8N9hmbxikkcbhga8NheinagaqaefRbbcdGce4VhgaYaecdtfydbgea8N9hmbxdkka5aefRbbhexeka8NheindnaKaecdtgafgeclfydbgHaeydbgeSmbaHae9Rh8AaEaecitfh8MaCaafh8Lcbh8Kina8Ma8KcitfydbgXhednindnaKaecdtgLfgeclfydbgHaeydbgeSmbdnaCaEaecitgOfydbcdtfydba8LydbgQ9hmbcehexikaHae9Rhhaecu7aHfhAa8JaOfhHcbheinaAaeSmeaecefheaHydbhOaHcwfhHaCaOcdtfydbaQ9hmbkaeah6hexdkaYaLfydbgeaX9hmbkcbhekagaece7Vhga8Kcefg8Ka8A9hmbkkaYaafydbgea8N9hmbka8PciagceGEhekayae86bbka8Ncefg8Nal9hmbkkdnaqTmbdndnazTmbazheaChHalhOindnaqaeydbfRbbceGTmba5aHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaChealhHindnaqRbbceGTmba5aeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaChealhOa5hHindna5aeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmba5healhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbhIcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhaasc:Cefasyd;8egecdtfaaBdbasaecefBd;8easc:qefcbBdbas9cb83i1eaaaialavazasc1efz:ejjjbh8RdndnaDmbcbh8Scbh8Lxekcbh8LawhecbhHindnaeIdbJbbbb9ETmbasa8LcdtfaHBdba8Lcefh8LkaeclfheaDaHcefgH9hmbkcua8Lal2gecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbh8Sasc:Cefasyd;8egecdtfa8SBdbasaecefBd;8ealTmbdna8Lmbcbh8Lxekarcd4hXdnazTmba8Lcdth8KcbhLa8ShKinaoazaLcdtfydbaX2cdtfhQasheaKhHa8LhOinaHaQaeydbcdtgAfIdbawaAfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKa8KfhKaLcefgLal9hmbxdkka8Lcdth8KcbhLa8ShKinaoaLaX2cdtfhQasheaKhHa8LhOinaHaQaeydbcdtgAfIdbawaAfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKa8KfhKaLcefgLal9hmbkkcualc8S2gHalc;D;O;f8U0EgAcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:rjjjbhycbhqcbh8Ndna8LTmbcbhIaAcbyd1:jjjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8ea8NcbaHz:rjjjb8Acua8Lal2gecltgHaecFFFFb0Ecbyd1:jjjbHjjjjbbhqasc:Cefasyd;8egecdtfaqBdbasaecefBd;8eaqcbaHz:rjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:jjjbHjjjjbbhIasc:Cefasyd;8egHcdtfaIBdbasaHcefBd;8eaIcbaez:rjjjb8AkdnadTmbcbhQabhHinaaaHclfydbgLcx2fgeIdbaaaHydbgKcx2fgOIdbgR:tg8UaaaHcwfydbgXcx2fgAIdlaOIdlg8V:tg8WNaAIdbaR:tg8XaeIdla8V:tg8YN:tg8Zh80aeIdwaOIdwg81:tgBa8XNaAIdwa81:tg83a8UN:tgUh8Xa8Ya83Na8WaBN:tg8Yh8Udna8Za8ZNa8Ya8YNaUaUNMM:rgBJbbbb9EgOTmba8ZaB:vh80aUaB:vh8Xa8YaB:vh8UkayaCaKcdtfydbgAc8S2fgea8UaB:rg8Wa8UNNg85aeIdbMUdbaea8Xa8Wa8XNg86Ng87aeIdlMUdlaea80a8Wa80Ng83Ng88aeIdwMUdwaea86a8UNg86aeIdxMUdxaea83a8UNg89aeIdzMUdzaea83a8XNg8:aeIdCMUdCaea8Ua8Wa80a81Na8UaRNa8Va8XNMM:mgZNg83Ng8UaeIdKMUdKaea8Xa83Ng8XaeId3MUd3aea80a83Ng80aeIdaMUdaaea83aZNg83aeId8KMUd8Kaea8WaeIdyMUdyayaCaLcdtfydbgLc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdyayaCaXcdtfydbgKc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdydnaITmbdnaOTmba8ZaB:vh8ZaUaB:vhUa8YaB:vh8YkaIaAcltfgeaBJbbbZNg8UaUNg8WaeIdlMUdlaea8Ua8ZNg8XaeIdwMUdwaea8Ua8YNg80aeIdbMUdbaea8UaR:ma8YNaUa8VN:ta81a8ZN:tNg8UaeIdxMUdxaIaLcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxaIaKcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxkaHcxfhHaQcifgQad6mbkkdnalTmbJ;n;m;m89J:v:;;w8ZamczGEh8YcbhOaChAaahHayheindnaOaAydb9hmbaecxfgQaQIdbJbbbbMUdbaeczfgQaQIdbJbbbbMUdbaecCfgQaQIdbJbbbbMUdbaea8YaecyfgQIdbg8ZNg8UaeIdbMUdbaeclfgLa8UaLIdbMUdbaecwfgLa8UaLIdbMUdbaecKfgLaLIdbaHIdbg8Xa8UN:tUdbaHcwfIdbh8Waec3fgLaLIdba8UaHclfIdbg80N:tUdbaecafgLaLIdba8Ua8WN:tUdbaec8KfgLIdbhUaQa8Za8UMUdbaLaUa8Ua8Wa8WNa8Xa8XNa80a80NMMNMUdbkaAclfhAaHcxfhHaec8SfhealaOcefgO9hmbkkdnadTmbcbhXabhKinabaXcdtfhLcbhHina5aLaHc:G1jjbfydbcdtfydbgOfRbbhedndna5aKaHfydbgAfRbbgQc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaQcufcFeGce0mba8EaAcdtfydbaO9hmekdnaecufcFeGce0mba8FaOcdtfydbaA9hmekJbbacJbbacJbbbZaecFeGceSEaQcFeGceSEh88aaaOcx2fgeIdwaaaAcx2fgQIdwgB:tg80:mh86aeIdlaQIdlg83:tg8Z:mh89aeIdbaQIdbgR:tgU:mh8:dnaaaLaHc:K1jjbfydbcdtfydbcx2fgeIdwaB:tg8Va80a80NaUaUNa8Za8ZNMMg8YNa8Va80NaeIdbaR:tg81aUNa8ZaeIdla83:tg85NMMg8Wa80N:tg8Xa8XNa81a8YNa8WaUN:tg8Ua8UNa85a8YNa8Wa8ZN:tg8Wa8WNMM:rg87Jbbbb9ETmba8Xa87:vh8Xa8Wa87:vh8Wa8Ua87:vh8Uka88a8Y:rNg8Ya8XaBNa8UaRNa83a8WNMM:mgZNg87aZNhZa8Xa87Nhna8Wa87Nhca8Ua87Nh9ca8Ya8XNg87a8WNhJa87a8UNh9ea8Ya8WNgTa8UNhSa8Xa87Nh87a8WaTNhTa8Ua8Ya8UNNh9hdnaUa85Na81a89NMg8Xa8XNa8Za8VNa85a86NMg8Ua8UNa80a81Na8Va8:NMg8Wa8WNMM:rg80Jbbbb9ETmba8Xa80:vh8Xa8Wa80:vh8Wa8Ua80:vh8UkayaCaAcdtfydbc8S2fgeaeIdba9ha8Ua88a80:rNg80a8UNNMgUMUdbaeaTa8Wa80a8WNg8VNMg81aeIdlMUdlaea87a8Xa80a8XNg8ZNMg85aeIdwMUdwaeaSa8Va8UNMg8VaeIdxMUdxaea9ea8Za8UNMg87aeIdzMUdzaeaJa8Za8WNMg8ZaeIdCMUdCaea9ca8Ua80a8XaBNa8UaRNa83a8WNMMgB:mNg80NMg8UaeIdKMUdKaeaca8Wa80NMg8WaeId3MUd3aeana8Xa80NMg8XaeIdaMUdaaeaZaBa80N:tg80aeId8KMUd8Kaea8YJbbbbMg8YaeIdyMUdyayaCaOcdtfydbc8S2fgeaUaeIdbMUdbaea81aeIdlMUdlaea85aeIdwMUdwaea8VaeIdxMUdxaea87aeIdzMUdzaea8ZaeIdCMUdCaea8UaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea80aeId8KMUd8Kaea8YaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaXcifgXad6mbka8LTmbcbhKinJbbbbh8YaaabaKcdtfgeclfydbgXcx2fgHIdwaaaeydbg8Kcx2fgOIdwg81:tg8Wa8WNaHIdbaOIdbg85:tg8Xa8XNaHIdlaOIdlg87:tg80a80NMMgRaaaecwfydbghcx2fgeIdwa81:tg8ZNa8Wa8Wa8ZNa8XaeIdba85:tgUNa80aeIdla87:tgBNMMg8UN:tJbbbbJbbjZaRa8Za8ZNaUaUNaBaBNMMg8VNa8Ua8UN:tg83:va83Jbbbb9BEg83Nh89a8Va8WNa8Za8UN:ta83Nh8:aRaBNa80a8UN:ta83NhZa8Va80NaBa8UN:ta83NhnaRaUNa8Xa8UN:ta83Nhca8Va8XNaUa8UN:ta83Nh9ca8XaBNaUa80N:tg8Ua8UNa80a8ZNaBa8WN:tg8Ua8UNa8WaUNa8Za8XN:tg8Ua8UNMM:rJbbbZNh8Ua8Sa8Ka8L2ggcdtfhHa8Saha8L2gEcdtfhOa8SaXa8L2g8JcdtfhAa81:mhJa87:mh9ea85:mhTcbhQa8LhLJbbbbhBJbbbbh83JbbbbhRJbbbbh8VJbbbbh81Jbbbbh85Jbbbbh87Jbbbbh88Jbbbbh86inascjdfaQfgecwfa8Ua8:aAIdbaHIdbg8Z:tg80Na89aOIdba8Z:tgUNMg8WNUdbaeclfa8Uana80NaZaUNMg8XNUdbaea8Ua9ca80NacaUNMg80NUdbaecxfa8UaJa8WNa9ea8XNa8ZaTa80NMMMg8ZNUdba8Ua8Wa8XNNa8VMh8Va8Ua8Wa80NNa81Mh81a8Ua8Xa80NNa85Mh85a8Ua8Za8ZNNa8YMh8Ya8Ua8Wa8ZNNaBMhBa8Ua8Xa8ZNNa83Mh83a8Ua80a8ZNNaRMhRa8Ua8Wa8WNNa87Mh87a8Ua8Xa8XNNa88Mh88a8Ua80a80NNa86Mh86aHclfhHaAclfhAaOclfhOaQczfhQaLcufgLmbka8Na8Kc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8NaXc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8Nahc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdyaqagcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaqa8JcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaqaEcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaKcifgKad6mbkkcbhOdndnamcwGg9imbJbbbbh85cbh6cbh9kcbh0xekcbh6a3cbyd1:jjjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ecua0alabadaCz:fjjjbgAcltaAcjjjjiGEcbyd1:jjjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ea9kaAa0aaalz:gjjjbJFFuuh85aATmba9kheaAhHinaeIdbg8Ua85a85a8U9EEh85aeclfheaHcufgHmbkaAh6kasydNeh9mdnalTmba9mclfhea9mydbhAa5hHalhQcbhOincbaeydbgLaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaLhAaQcufgQmbkaOce4hOkcuadaO9Rcifg9ncx2a9nc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ecua9ncdta9ncFFFFi0Ecbyd1:jjjbHjjjjbbh9oasc:Cefasyd;8egecdtfa9oBdbasaecefBd;8ea3cbyd1:jjjbHjjjjbbhDasc:Cefasyd;8egecdtfaDBdbasaecefBd;8ealcbyd1:jjjbHjjjjbbh9pasc:Cefasyd;8egecdtfa9pBdbasaecefBd;8eaxaxNa8RJbbjZamclGEgnanN:vh88Jbbbbh86dnadak9nmbdna9nci6mbasyd:yeh9qa8Lclth9ra8Pcwfh9sJbbbbh87Jbbbbh86inascNefabadalaCz:cjjjbabh8Kcbh8Mcbh3inaba3cdtfhgcbheindnaCa8KaefydbgOcdtgXfydbgAaCagaec:W1jjbfydbcdtfydbgHcdtghfydbgQSmba5aHfRbbgKcv2a5aOfRbbgLfc;a1jjbfRbbg8JaLcv2aKfgEc;a1jjbfRbbg8AVcFeGTmbdnaQaA9nmbaEc;G1jjbfRbbcFeGmekdnaLcufcFeGce0mbaKTmba8EaXfydbaH9hmekdnaLTmbaKcufcFeGce0mba8FahfydbaO9hmeka8Pa8Mcx2fgAaHaOa8AcFeGgQEBdlaAaOaHaQEBdbaAaQa8JGcb9hBdwa8Mcefh8Mkaeclfgecx9hmbkdna3cifg3ad9pmba8Kcxfh8Ka8Mcifa9n9nmekka8MTmdcbhhinayaCa8Pahcx2fgKydbgQcdtgAfydbc8S2fgeIdwaaaKydlgLcx2fgHIdwg8XNaeIdzaHIdbg80NaeIdaMg8Ua8UMMa8XNaeIdlaHIdlg8ZNaeIdCa8XNaeId3Mg8Ua8UMMa8ZNaeIdba80NaeIdxa8ZNaeIdKMg8Ua8UMMa80NaeId8KMMM:lh8UJbbbbJbbjZaeIdyg8W:va8WJbbbb9BEh8WdndnaKydwg8KmbJFFuuh81xekJbbbbJbbjZayaCaLcdtfydbc8S2fgeIdygU:vaUJbbbb9BEaeIdwaaaQcx2fgHIdwgUNaeIdzaHIdbg8YNaeIdaMgBaBMMaUNaeIdlaHIdlgBNaeIdCaUNaeId3MgUaUMMaBNaeIdba8YNaeIdxaBNaeIdKMgUaUMMa8YNaeId8KMMM:lNh81ka8Wa8UNh8Vdna8LTmba8NaQc8S2fgHIdwa8XNaHIdza80NaHIdaMg8Ua8UMMa8XNaHIdla8ZNaHIdCa8XNaHId3Mg8Ua8UMMa8ZNaHIdba80NaHIdxa8ZNaHIdKMg8Ua8UMMa80NaHId8KMMMh8UaqaQa8L2ggcltfheaHIdyhUa8SaLa8L2gEcdtfgXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8KmbJbbbbh8Wxeka8NaLc8S2fgOIdwaaaQcx2fgeIdwg8YNaOIdzaeIdbgBNaOIdaMg8Wa8WMMa8YNaOIdlaeIdlg83NaOIdCa8YNaOId3Mg8Wa8WMMa83NaOIdbaBNaOIdxa83NaOIdKMg8Wa8WMMaBNaOId8KMMMh8Wa8SagcdtfhHaqaEcltfheaOIdyhRa8LhOinaHIdbgUaUaRNaecxfIdba8YaecwfIdbNaBaeIdbNa83aeclfIdbNMMMgUaUM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8Wka8Va8U:lMh8Va81a8WMh81dndndna5aQfRbbc9:fPdbedkdna8Fa8Ea8EaAfydbaLSEaYaAfydbgXcdtfydbgAcu9hmbaYaLcdtfydbhAka8NaXc8S2fgOIdwaaaAcx2fgeIdwg8XNaOIdzaeIdbg80NaOIdaMg8Ua8UMMa8XNaOIdlaeIdlg8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8Ua8SaAa8L2ggcdtfhHaqaXa8L2gEcltfheaOIdyhUa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8KmbJbbbbh8Wxeka8NaAc8S2fgOIdwaaaXcx2fgeIdwg80NaOIdzaeIdbg8ZNaOIdaMg8Wa8WMMa80NaOIdlaeIdlgUNaOIdCa80NaOId3Mg8Wa8WMMaUNaOIdba8ZNaOIdxaUNaOIdKMg8Wa8WMMa8ZNaOId8KMMMh8Wa8SaEcdtfhHaqagcltfheaOIdyh8Ya8LhOinaHIdbg8Xa8Xa8YNaecxfIdba80aecwfIdbNa8ZaeIdbNaUaeclfIdbNMMMg8Xa8XM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8Wka8Va8U:lMh8Va81a8WMh81xdkaYaAfydbgAaQSmbina8NaAc8S2fgHIdwa8XNaHIdza80NaHIdaMg8Ua8UMMa8XNaHIdla8ZNaHIdCa8XNaHId3Mg8Ua8UMMa8ZNaHIdba80NaHIdxa8ZNaHIdKMg8Ua8UMMa80NaHId8KMMMh8UaqaAa8L2cltfheaHIdyhUaXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka8Va8U:lMh8VaYaAcdtfydbgAaQ9hmbkka5aLfRbbci9hmba8KTmbaYaLcdtfydbgAaLSmba8SagcdtfhXaaaQcx2fgeIdbh8XaeIdwh80aeIdlh8Zina8NaAc8S2fgHIdwa80NaHIdza8XNaHIdaMg8Ua8UMMa80NaHIdla8ZNaHIdCa80NaHId3Mg8Ua8UMMa8ZNaHIdba8XNaHIdxa8ZNaHIdKMg8Ua8UMMa8XNaHId8KMMMh8UaqaAa8L2cltfheaHIdyhUaXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba80aecwfIdbNa8XaeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka81a8U:lMh81aYaAcdtfydbgAaL9hmbkkaKa81a8Va81a8V9DgeEUdwaKaQaLaea8Kcb9hGgeEBdlaKaLaQaeEBdbahcefgha8M9hmbkascjdfcbcj;qbz:rjjjb8Aa9shea8MhHinascjdfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea9shHinascjdfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdba9oaOcdtfaeBdbaHcxfhHa8Maecefge9hmbkadak9RgOci9Uh9tdnalTmbcbheaDhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ua9pcbalz:rjjjbh3aOcO9Uh9va9tce4h9wcbh8Acbh8Jdnina8Pa9oa8Jcdtfydbcx2fgEIdwg8Ua889Emea8Aa9t9pmeJFFuuh8Wdna9wa8M9pmba8Pa9oa9wcdtfydbcx2fIdwJbb;aZNh8Wkdna8Ua8W9ETmba8Ua869ETmba8Aa9v0mdkdna3aCaEydlghcdtg9xfydbgAfg9yRbba3aCaEydbg8Kcdtg9zfydbgefg9ARbbVmba5a8KfRbbh9Bdna9maecdtfgHclfydbgOaHydbgHSmbaOaH9RhQaaaAcx2fhKaaaecx2fhXa9qaHcitfhecbhHcehgdnindnaDaeydbcdtfydbgOaASmbaDaeclfydbcdtfydbgLaASmbaOaLSmbaaaLcx2fgLIdbaaaOcx2fgOIdbg8X:tg8UaXIdlaOIdlg80:tg8YNaXIdba8X:tgBaLIdla80:tg8WN:tg8Za8UaKIdla80:tg83NaKIdba8X:tgRa8WN:tg80Na8WaXIdwaOIdwgU:tg8VNa8YaLIdwaU:tg8XN:tg8Ya8WaKIdwaU:tg81Na83a8XN:tg8WNa8XaBNa8Va8UN:tgUa8XaRNa81a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaQ6hgaQaH9hmbkkagceGTmba9wcefh9wxekdndndndna9Bc9:fPdebdka8KheinaDaecdtgefahBdbaYaefydbgea8K9hmbxikkdna8Fa8Ea8Ea9zfydbahSEaYa9zfydbg8Kcdtfydbgecu9hmbaYa9xfydbhekaDa9zfahBdbaehhkaDa8KcdtfahBdbka9Ace86bba9yce86bbaEIdwg8Ua86a86a8U9DEh86a9ucefh9ucecda9BceSEa8Afh8Aka8Jcefg8Ja8M9hmbkka9uTmddnalTmbcbhLcbhXindnaDaXcdtgefydbgOaXSmbaCaOcdtfydbh8KdnaXaCaefydb9hghmbaya8Kc8S2fgeayaXc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyaITmbaIa8KcltfgeaIaXcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxka8LTmba8NaOc8S2fgea8NaXc8S2ggfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9raO2hKaqhHa8LhAinaHaKfgeaHaLfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkahmbJbbbbJbbjZayagfgeIdyg8U:va8UJbbbb9BEaeIdwaaa8Kcx2fgHIdwg8UNaeIdzaHIdbg8WNaeIdaMg8Xa8XMMa8UNaeIdlaHIdlg8XNaeIdCa8UNaeId3Mg8Ua8UMMa8XNaeIdba8WNaeIdxa8XNaeIdKMg8Ua8UMMa8WNaeId8KMMM:lNg8Ua87a87a8U9DEh87kaLa9rfhLaXcefgXal9hmbkcbhHa8EheindnaeydbgOcuSmbdnaHaDaOcdtgAfydbgO9hmbcuhOa8EaAfydbgAcuSmbaDaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHa8FheindnaeydbgOcuSmbdnaHaDaOcdtgAfydbgO9hmbcuhOa8FaAfydbgAcuSmbaDaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkka87a86a8LEh87cbhHabhecbhOindnaCaDaeydbcdtfydbgLcdtfydbgAaCaDaeclfydbcdtfydbgKcdtfydbgQSmbaAaCaDaecwfydbcdtfydbg8KcdtfydbgXSmbaQaXSmbabaHcdtfgAaLBdbaAcwfa8KBdbaAclfaKBdbaHcifhHkaecxfheaOcifgOad6mbkdndna9imbaHhdxekdnaHak0mbaHhdxekdna85a879FmbaHhdxekJFFuuh85cbhdabhecbhOindna9ka0aeydbgAcdtfydbcdtfIdbg8Ua879ETmbaeclf8Pdbh9CabadcdtfgQaABdbaQclfa9C83dba8Ua85a85a8U9EEh85adcifhdkaecxfheaOcifgOaH6mbkkadak0mbxdkkascNefabadalaCz:cjjjbkdndnadak0mbadhOxekdna9imbadhOxekdna85a889FmbadhOxekcehLina85Jbb;aZNg8Ua88a8Ua889DEh8XJbbbbh8Udna6Tmba9khea6hHinaeIdbg8Wa8Ua8Wa8X9FEa8Ua8Wa8U9EEh8UaeclfheaHcufgHmbkkJFFuuh85cbhOabhecbhHindna9ka0aeydbgAcdtfydbcdtfIdbg8Wa8X9ETmbaeclf8Pdbh9CabaOcdtfgQaABdbaQclfa9C83dba8Wa85a85a8W9EEh85aOcifhOkaecxfheaHcifgHad6mbkdnaLaOad9hVceGmbadhOxdka8Ua86a86a8U9DEh86aOak9nmecbhLaOhda85a889FmbkkdnamcjjjjdGTmba9pcbalz:rjjjbhLdnaOTmbabheaOhHinaLaeydbgAfa5aAfRbbcl9h86bbaeclfheaHcufgHmbkkascNefabaOalaCz:cjjjbalTmbcbhQasyd:yehgindnaLaQfRbbTmbdna5aQfRbbgecl0mbceaetcQGmekdnaCaQcdtgKfydbgeaQSmbaaaQcx2fgHaaaecx2fge8Pdb83dbaHcwfaecwfydbBdbxekayaQc8S2fgeIdyg8Ua8UJL:3;rUNg8UMh88aeIdwa8UMhRaeIdla8UMh8VaeIdba8UMhUaeIdaa8UaaaQcx2fg8KIdwg89N:th81aeId3a8Ua8KIdlg8:N:th85aeIdKa8KIdbgZa8UN:th8YJbbbbhcaeIdCJbbbbMh87aeIdzJbbbbMhBaeIdxJbbbbMh83dndna8LTmbaQhAinJbbbba88a8NaAc8S2fgHIdyg8U:va8UJbbbb9BEh8UaqaAa8L2cltfheaHIdaa88Na81Mh81aHId3a88Na85Mh85aHIdKa88Na8YMh8YaHIdCa88Na87Mh87aHIdza88NaBMhBaHIdxa88Na83Mh83aHIdwa88NaRMhRaHIdla88Na8VMh8VaHIdba88NaUMhUa8LhHina81aecxfIdbg8ZaecwfIdbg8WNa8UN:th81a85a8ZaeclfIdbg8XNa8UN:th85a87a8Wa8XNa8UN:th87aUaeIdbg80a80Na8UN:thUa8Ya8Za80Na8UN:th8YaBa8Wa80Na8UN:thBa83a8Xa80Na8UN:th83aRa8Wa8WNa8UN:thRa8Va8Xa8XNa8UN:th8VaeczfheaHcufgHmbkaYaAcdtfydbgAaQ9hmbkaITmbaIaQcltfgeIdxhTaeIdwh9caeIdlhJaeIdbh8UxekJbbbbhTJbbbbh9cJbbbbhJJbbbbh8UkaBaU:vg8Xa8YNa81:ta87aBa83aU:vg8WN:tg81a8Va83a8WN:tg8Z:vg80a8Wa8YNa85:tg8VN:th85a9ca8Ua8XN:taJa8Ua8WN:tg83a80N:tg87aRaBa8XN:ta81a80N:tgB:vgR:mh81a83a8Z:vg9c:mhJdnJbbbba8Ua8UaU:vg9eN:ta83a9cN:ta87aRN:tg83:la88J:983:g81Ng8U9ETmba81a85NaJa8VNa9ea8YNaT:tMMa83:vhckaU:la8U9ETmba8Z:la8U9ETmbaB:la8U9ETmba9e:macNa8X:ma81acNa85aB:vMg85Na8W:maJacNa80:ma85Na8Va8Z:vMMg87Na8Y:maU:vMMMh88a9maKfgeclfydbgHaeydbge9RhXagaecitfhKJbbbbh8UdnaHaeSghmbJbbbbh8UaKheaXhAinaaaeclfydbcx2fgHIdwa89:tg8Wa8WNaHIdbaZ:tg8Wa8WNaHIdla8::tg8Wa8WNMMg8Waaaeydbcx2fgHIdwa89:tg8Xa8XNaHIdbaZ:tg8Xa8XNaHIdla8::tg8Xa8XNMMg8Xa8Ua8Ua8X9DEg8Ua8Ua8W9DEh8UaecwfheaAcufgAmbkka85a89:tg8Wa8WNa88aZ:tg8Wa8WNa87a8::tg8Wa8WNMMa8U:rg8Ua8UN9EmbdnahmbcbhAcehhdninaaaKclfydbcx2fgeIdbaaaKydbcx2fgHIdbg8X:tg8Ua8:aHIdlg80:tg8YNaZa8X:tgBaeIdla80:tg8WN:tg8Za8Ua87a80:tg83Na88a8X:tgRa8WN:tg80Na8Wa89aHIdwgU:tg8VNa8YaeIdwaU:tg8XN:tg8Ya8Wa85aU:tg81Na83a8XN:tg8WNa8XaBNa8Va8UN:tgUa8XaRNa81a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmeaKcwfhKaAcefgAaX6hhaXaA9hmbkkahceGmeka8Ka85Udwa8Ka87Udla8Ka88UdbkaQcefgQal9hmbkdndna8LTmba8LclthYa8Lcdth8KcbhKa8ShXindnaLaKfRbbTmba5aKfRbbclSmbJbbbbJbbjZa8NaKc8S2fIdyg8U:va8UJbbbb9BEh8UaaaCaKcdtfydbcx2fhHaqheaXhAa8LhQinaAa8UaecwfIdbaHIdwNaeIdbaHIdbNaeclfIdbaHIdlNMMaecxfIdbMNUdbaeczfheaAclfhAaQcufgQmbkkaqaYfhqaXa8KfhXaKcefgKal9hmbkarcd4hXavcd4hYasId:qeh8UasId:meh8WasId1eh8XazTmea8Lcdth8KcbhKindnaLaKfRbbTmbaiazaKcdtfydbgCaY2cdtfgeaaaKcx2fgHIdba8RNa8XMUdbaeaHIdla8RNa8WMUdlaeaHIdwa8RNa8UMUdwaoaCaX2cdtfhQashea8ShHa8LhCinaQaeydbcdtgAfaHIdbawaAfIdb:vUdbaeclfheaHclfhHaCcufgCmbkka8Sa8Kfh8SaKcefgKal9hmbxikkavcd4hCasId:qeh8UasId:meh8WasId1eh8XdnazTmbazheindna9pRbbTmbaiaeydbaC2cdtfgHaaIdba8RNa8XMUdbaHaaclfIdba8RNa8WMUdlaHaacwfIdba8RNa8UMUdwka9pcefh9paeclfheaacxfhaalcufglmbxikkaCcdtheindna9pRbbTmbaiaaIdba8RNa8XMUdbaiclfaaclfIdba8RNa8WMUdbaicwfaacwfIdba8RNa8UMUdbka9pcefh9paacxfhaaiaefhialcufglmbxdkka8Lcdth8KcbhKindnaLaKfRbbTmbaiaKaY2cdtfgeaaaKcx2fgHIdba8RNa8XMUdbaeaHIdla8RNa8WMUdlaeaHIdwa8RNa8UMUdwaoaKaX2cdtfhQashea8ShHa8LhCinaQaeydbcdtgAfaHIdbawaAfIdb:vUdbaeclfheaHclfhHaCcufgCmbkka8Sa8Kfh8SaKcefgKal9hmbkkdnamcjjjjlGTmbazmbaOTmbcbhLabheina5aeydbgAfRbbc3thKaecwfgXydbhHdndna8EaAcdtg8KfydbaeclfgYydbgCSmbcbhQa8FaCcdtfydbaA9hmekcjjjj94hQkaeaKaQVaAVBdba5aCfRbbc3thKdndna8EaCcdtfydbaHSmbcbhQa8FaHcdtfydbaC9hmekcjjjj94hQkaYaKaQVaCVBdba5aHfRbbc3thQdndna8EaHcdtfydbaASmbcbhCa8Fa8KfydbaH9hmekcjjjj94hCkaXaQaCVaHVBdbaecxfheaLcifgLaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPana86:rNUdbkasyd;8egecdtasc:Ceffc98fhHdninaeTmeaHydbcbyd:m:jjjbH:bjjjbbaHc98fhHaecufhexbkkascj;sbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:rjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:jjjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:rjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:jjjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkawclfhwabclfhbaiaDcefgD9hmbkkk:hrdvuv998Jjjjjbca9Rgoczfcwfcbyd11jjbBdbaocb8Pdj1jjb83izaocwfcbydN1jjbBdbaocb8Pd:m1jjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:ZlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvc:G1jjbfydbcdtfydbcdtfydbhodnabalawavfydbcdtfydbgqcdtfgkydbgvaqSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnabaocdtfgkydbgvaoSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnabavfgDydbgvaxSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhvabhocbhkindndnavalydbgq9hmbdnavaoydbgq9hmbaoakBdbakcefhkxdkaoabaqcdtfydbBdbxekaoabaqcdtfydbBdbkaoclfhoalclfhlaeavcefgv9hmbkakk;Jiilud99duabcbaecltz:rjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakclfgxaqaxIdbMUdbakcwfgxaDaxIdbMUdbakcxfgkakIdbJbbjZMUdbaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhraehkinarcxfgoIdbhDaocbBdbararIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbarclfgoaDaoIdbNUdbarcwfgoaDaoIdbNUdbarczfhrakcufgkmbkkdnalTmbinavadydbcltfgrcxfgkaicwfIdbarcwfIdb:tgDaDNaiIdbarIdb:tgDaDNaiclfIdbarclfIdb:tgDaDNMMgDakIdbgqaqaD9DEUdbadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhrinabarIdbUdbarczfhrabclfhbaecufgembkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:p8Koque99due99iuq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:rjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:jjjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhHdndninashYaHhXaPhrakg8AaQ9pmeaXar9Rcd9imeavaXcufavaX9iEarcefavar9kEhzdnalTmbazcuf:YhwdnaoTmbcbhOaihPaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhHxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhHxekcjjjj94hHkaHcqthHdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaHasVhHdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaHascCtVhHkaPaHBdbaPclfhPavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhPindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhHxekcjjjj94hHkaHcCthHdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascqtaHVhHdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaOaHasVBdbavcxfhvaOclfhOaPcufgPmbkkcbhOdnadTmbaehvcbhPinaOaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgs9haiavydbcdtfydbgAaH9haAas9hGGfhOavcxfhvaPcifgPad6mbkkaYhsaOhkaXhHazhPdnaOaQ9nmbaOhsa8AhkazhHarhPkdndnaKcl0mbdnaY:Zgwa8A:ZgC:taz:YgEar:Y:tg3aEaX:Y:tg5aO:Zg8EaL:tNNNawaL:ta5NaCa8E:tNaCaL:ta3Na8Eaw:tNM:vaEMJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPaHfcd9ThvkaKcefgKcs9hmbxdkka8AhkarhPkdndndnakmbJbbjZhwcbhicdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgravcFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCaqciBd2aqamcbyd1:jjjbHjjjjbbgXBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihHaxhPindndnaoaOfRbbceGTmbaOcjjjjlVhsxekdndnaPclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascqthsdndnaPcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkasaAVhsdndnaPIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkasaAcCtVhskaHasBdbaHclfhHaPcxfhPalaOcefgO9hmbxikkazcFearz:rjjjb8AcbhrcbhvxdkaxhOaihPalhHindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascCthsdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqtasVhsdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaPasaAVBdbaOcxfhOaPclfhPaHcufgHmbkkazcFearz:rjjjbhAavcufhocbhrcbhzindndndnaAaiazcdtgKfydbgHcm4aH7c:v;t;h;Ev2gvcs4av7aoGgPcdtfgsydbgOcuSmbcehvinaiaOcdtgOfydbaHSmdaPavfhOavcefhvaAaOaoGgPcdtfgsydbgOcu9hmbkkasazBdbarhvarcefhrxekaXaOfydbhvkaXaKfavBdbazcefgzal9hmbkcuarc8S2gOarc;D;O;f8U0EhvkcbhAaqavcbyd1:jjjbHjjjjbbgvBd3aqcvBd2avcbaOz:rjjjbhOdnadTmbaehiinJbbnnJbbjZaXaiydbgHcdtfydbgvaXaiclfydbgPcdtfydbgzSavaXaicwfydbgscdtfydbgKSGgoEh8FdnaxaPcx2fgPIdbaxaHcx2fgHIdbg8E:tgCaxascx2fgsIdlaHIdlg3:tgwNasIdba8E:tgEaPIdla3:tgaN:tgLaLNaaasIdwaHIdwg5:tghNawaPIdwa5:tgaN:tgwawNaaaENahaCN:tgCaCNMM:rgEJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNgaMUdbavaCaEaCNghNggavIdlMUdlavaLaEaLNg8FNg8JavIdwMUdwavahawNghavIdxMUdxava8FawNg8KavIdzMUdzava8FaCNg8FavIdCMUdCavawaEaLa5Nawa8ENa3aCNMM:mg3Ng8ENgwavIdKMUdKavaCa8ENgCavId3MUd3avaLa8ENgLavIdaMUdaava8Ea3Ng8EavId8KMUd8KavaEavIdyMUdydnaombaOazc8S2fgvaaavIdbMUdbavagavIdlMUdlava8JavIdwMUdwavahavIdxMUdxava8KavIdzMUdzava8FavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava8EavId8KMUd8KavaEavIdyMUdyaOaKc8S2fgvaaavIdbMUdbavagavIdlMUdlava8JavIdwMUdwavahavIdxMUdxava8KavIdzMUdzava8FavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava8EavId8KMUd8KavaEavIdyMUdykaicxfhiaAcifgAad6mbkkcbhHaqcuarcdtgvarcFFFFi0Egicbyd1:jjjbHjjjjbbgPBdaaqcoBd2aqaicbyd1:jjjbHjjjjbbgiBd8KaqcrBd2aPcFeavz:rjjjbhzdnalTmbaXhPinJbbbbJbbjZaOaPydbgsc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnazascdtgvfgsydbcuSmbaiavfIdbaw9ETmekasaHBdbaiavfawUdbkaPclfhPaxcxfhxalaHcefgH9hmbkkJbbbbhwdnarTmbinaiIdbgCawawaC9DEhwaiclfhiarcufgrmbkkakcd4akfhOcehiinaigvcethiavaO6mbkcbhiaqcuavcdtgOavcFFFFi0Ecbyd1:jjjbHjjjjbbgPBdyaPcFeaOz:rjjjbhsdnadTmbavcufhAcbhrcbhxindnaXaeaxcdtfgvydbcdtfydbgiaXavclfydbcdtfydbgOSmbaiaXavcwfydbcdtfydbgvSmbaOavSmbazavcdtfydbhHdndnazaOcdtfydbgvazaicdtfydbgi9pmbavaH9pmbaHhlaihoavhHxekdnaHai9pmbaHav9pmbaihlavhoxekavhlaHhoaihHkabarcx2fgvaHBdbavcwfaoBdbavclfalBdbdnasaoc:3F;N8N2alc:F:b:DD27aHc;D;O:B8J27aAGgOcdtfgvydbgicuSmbcehPinaPhvdnabaicx2fgiydbaH9hmbaiydlal9hmbaiydwaoSmikavcefhPasaOavfaAGgOcdtfgvydbgicu9hmbkkavarBdbarcefhrkaxcifgxad6mbkarci2hikdnaDmbcwhvxdkaw:rhwcwhvkaDawUdbkavcdthvdninavTmeavc98fgvaqcxffydbcbyd:m:jjjbH:bjjjbbxbkkaqc;Wbf8Kjjjjbaik:2ldwue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:rjjjb8AdnabaeSmbabaeadcdtz:qjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:jjjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhkarcxfaryd2gxcdtgmfakBdbaraxcefgPBd2akaialavcbcbz:ejjjb8AarcxfaPcdtfaDcbyd1:jjjbHjjjjbbgvBdbaraxcdfgiBd2arcxfaicdtfcuavalaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:jjjbHjjjjbbgiBdbaiaeavakalz:gjjjbdnadTmbaoaoNhocbhwabhlcbhkindnaiavalydbgecdtfydbcdtfIdbao9ETmbalclf8PdbhsabawcdtfgqaeBdbaqclfas83dbawcifhwkalcxfhlakcifgkad6mbkkaxcifhlamarcxffcwfhkdninalTmeakydbcbyd:m:jjjbH:bjjjbbakc98fhkalcufhlxbkkarc;Wbf8Kjjjjbawk:FCoDud99rue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:rjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:rjjjbh3cbh5cbhPindna3axaPcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5aPcefgPad9hmbxdkkazcFeasz:rjjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa5:ZghaH:tNNNaOaH:taaNa8Aah:tNa8AaH:ta8FNahaO:tNM:va8EMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:rjjjbh3cbhDcbhYindndndna3axaYcdtgKfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbcehiinaxaecdtgefydbaCSmdamaifheaicefhia3aeaAGgmcdtfgEydbgecu9hmbkkaEaYBdbaDhiaDcefhDxeka5aefydbhika5aKfaiBdbaYcefgYad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:rjjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBd3awcvBd2aecbaiz:rjjjbhEavcd4hKdnadTmbdnalTmbaKcdth3a5hCaqhealhmadhAinaEaCydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaecxfheama3fhmaAcufgAmbxdkka5hmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBdaawcoBd2awaicbyd1:jjjbHjjjjbbg3Bd8KaecFeaYz:rjjjbhxdnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8AaKcdthPalheina8Aaec;81jjbalEgmIdwaEa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndnaxaAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka5clfh5aqcxfhqaeaPfheadaCcefgC9hmbkkabaxaYz:qjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Ydidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:rjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:GNbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(t),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function r(p){for(var x=new Uint8Array(p.length),_=0;_<p.length;++_){var w=p.charCodeAt(_);x[_]=w>96?w-97:w>64?w-39:w+4}for(var M=0,_=0;_<p.length;++_)x[M++]=x[_]<60?e[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,M)}function a(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function o(p,x,_){var w=n.exports.sbrk,M=w(x.length*4),S=w(_*4),A=new Uint8Array(n.exports.memory.buffer),C=s(x);A.set(C,M);var k=p(S,M,x.length,_);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(_);new Uint8Array(R.buffer).set(A.subarray(S,S+_*4)),C.set(A.subarray(M,M+x.length*4)),w(M-w(0));for(var N=0;N<x.length;++N)x[N]=R[x[N]];return[R,k]}function l(p){for(var x=0,_=0;_<p.length;++_){var w=p[_];x=x<w?w:x}return x}function c(p,x,_,w,M,S,A,C,k){var R=n.exports.sbrk,N=R(4),P=R(_*4),j=R(M*S),z=R(_*4),X=new Uint8Array(n.exports.memory.buffer);X.set(s(w),j),X.set(s(x),z);var F=p(P,z,_,j,M,S,A,C,k,N);X=new Uint8Array(n.exports.memory.buffer);var H=new Uint32Array(F);s(H).set(X.subarray(P,P+F*4));var V=new Float32Array(1);return s(V).set(X.subarray(N,N+4)),R(N-R(0)),[H,V[0]]}function u(p,x,_,w,M,S,A,C,k,R,N,P,j){var z=n.exports.sbrk,X=z(4),F=z(_*4),H=z(M*S),V=z(M*C),W=z(k.length*4),B=z(_*4),Y=R?z(M):0,Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(w),H),Z.set(s(A),V),Z.set(s(k),W),Z.set(s(x),B),R&&Z.set(s(R),Y);var G=p(F,B,_,H,M,S,V,C,W,k.length,Y,N,P,j,X);Z=new Uint8Array(n.exports.memory.buffer);var de=new Uint32Array(G);s(de).set(Z.subarray(F,F+G*4));var oe=new Float32Array(1);return s(oe).set(Z.subarray(X,X+4)),z(X-z(0)),[de,oe[0]]}function f(p,x,_,w,M,S,A,C,k,R,N,P,j){var z=n.exports.sbrk,X=z(4),F=z(M*S),H=z(M*C),V=z(k.length*4),W=z(_*4),B=R?z(M):0,Y=new Uint8Array(n.exports.memory.buffer);Y.set(s(w),F),Y.set(s(A),H),Y.set(s(k),V),Y.set(s(x),W),R&&Y.set(s(R),B);var Z=p(W,_,F,M,S,H,C,V,k.length,B,N,P,j,X);Y=new Uint8Array(n.exports.memory.buffer),s(x).set(Y.subarray(W,W+Z*4)),s(w).set(Y.subarray(F,F+M*S)),s(A).set(Y.subarray(H,H+M*C));var G=new Float32Array(1);return s(G).set(Y.subarray(X,X+4)),z(X-z(0)),[Z,G[0]]}function h(p,x,_,w){var M=n.exports.sbrk,S=M(_*w),A=new Uint8Array(n.exports.memory.buffer);A.set(s(x),S);var C=p(S,_,w);return M(S-M(0)),C}function d(p,x,_,w,M,S,A,C){var k=n.exports.sbrk,R=k(C*4),N=k(_*w),P=k(_*S),j=new Uint8Array(n.exports.memory.buffer);j.set(s(x),N),M&&j.set(s(M),P);var z=p(R,N,_,w,P,S,A,C);j=new Uint8Array(n.exports.memory.buffer);var X=new Uint32Array(z);return s(X).set(j.subarray(R,R+z*4)),k(R-k(0)),X}function g(p,x,_,w,M,S,A,C,k){var R=n.exports.sbrk,N=R(4),P=R(_*4),j=R(M*S),z=R(_*4),X=A?R(M):0,F=new Uint8Array(n.exports.memory.buffer);F.set(s(w),j),F.set(s(x),z),A&&F.set(s(A),X);var H=p(P,z,_,j,M,S,X,C,k,N);F=new Uint8Array(n.exports.memory.buffer);var V=new Uint32Array(H);s(V).set(F.subarray(P,P+H*4));var W=new Float32Array(1);return s(W).set(F.subarray(N,N+4)),R(N-R(0)),[V,W[0]]}function b(p,x,_,w,M,S,A){var C=n.exports.sbrk,k=C(_*4),R=C(M*S),N=C(_*4),P=new Uint8Array(n.exports.memory.buffer);P.set(s(w),R),P.set(s(x),N);var j=p(k,N,_,R,M,S,A);P=new Uint8Array(n.exports.memory.buffer);var z=new Uint32Array(j);return s(z).set(P.subarray(k,k+j*4)),C(k-C(0)),z}var y={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(p){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0);var x=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return o(n.exports.meshopt_optimizeVertexFetchRemap,x,l(p)+1)},simplify:function(p,x,_,w,M,S){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w>=0&&w<=p.length),a(w%3==0),a(M>=0);for(var A=0,C=0;C<(S?S.length:0);++C)a(S[C]in y),A|=y[S[C]];var k=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),R=c(n.exports.meshopt_simplify,k,p.length,x,x.length/_,_*4,w,M,A);return R[0]=p instanceof Uint32Array?R[0]:new p.constructor(R[0]),R},simplifyWithAttributes:function(p,x,_,w,M,S,A,C,k,R){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w instanceof Float32Array),a(w.length==M*(x.length/_)),a(M>=0),a(A==null||A instanceof Uint8Array),a(A==null||A.length==x.length/_),a(C>=0&&C<=p.length),a(C%3==0),a(k>=0),a(Array.isArray(S)),a(M>=S.length),a(S.length<=32);for(var N=0;N<S.length;++N)a(S[N]>=0);for(var P=0,N=0;N<(R?R.length:0);++N)a(R[N]in y),P|=y[R[N]];var j=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),z=u(n.exports.meshopt_simplifyWithAttributes,j,p.length,x,x.length/_,_*4,w,M*4,new Float32Array(S),A,C,k,P);return z[0]=p instanceof Uint32Array?z[0]:new p.constructor(z[0]),z},simplifyWithUpdate:function(p,x,_,w,M,S,A,C,k,R){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w instanceof Float32Array),a(w.length==M*(x.length/_)),a(M>=0),a(A==null||A instanceof Uint8Array),a(A==null||A.length==x.length/_),a(C>=0&&C<=p.length),a(C%3==0),a(k>=0),a(Array.isArray(S)),a(M>=S.length),a(S.length<=32);for(var N=0;N<S.length;++N)a(S[N]>=0);for(var P=0,N=0;N<(R?R.length:0);++N)a(R[N]in y),P|=y[R[N]];var j=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),z=f(n.exports.meshopt_simplifyWithUpdate,j,p.length,x,x.length/_,_*4,w,M*4,new Float32Array(S),A,C,k,P);if(p!==j)for(var N=0;N<z[0];++N)p[N]=j[N];return z},getScale:function(p,x){return a(p instanceof Float32Array),a(p.length%x==0),a(x>=3),h(n.exports.meshopt_simplifyScale,p,p.length/x,x*4)},simplifyPoints:function(p,x,_,w,M,S){return a(p instanceof Float32Array),a(p.length%x==0),a(x>=3),a(_>=0&&_<=p.length/x),w?(a(w instanceof Float32Array),a(w.length%M==0),a(M>=3),a(p.length/x==w.length/M),d(n.exports.meshopt_simplifyPoints,p,p.length/x,x*4,w,M*4,S,_)):d(n.exports.meshopt_simplifyPoints,p,p.length/x,x*4,void 0,0,0,_)},simplifySloppy:function(p,x,_,w,M,S){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w==null||w instanceof Uint8Array),a(w==null||w.length==x.length/_),a(M>=0&&M<=p.length),a(M%3==0),a(S>=0);var A=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),C=g(n.exports.meshopt_simplifySloppy,A,p.length,x,x.length/_,_*4,w,M,S);return C[0]=p instanceof Uint32Array?C[0]:new p.constructor(C[0]),C},simplifyPrune:function(p,x,_,w){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w>=0);var M=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),S=b(n.exports.meshopt_simplifyPrune,M,p.length,x,x.length/_,_*4,w);return S=p instanceof Uint32Array?S:new p.constructor(S),S}}}();(function(){var t="b9H79TebbbeVx9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gvuuuuueu9Gwuuuuuuuub9Gxuuuuuuuuuuuueu9Gkuuuuuuuuuu99eu9Gouuuuuub9Gruuuuuuub9GluuuubiAOdilvorwDqqDkbiibeilve9Weiiviebeoweuec;G:Odkr;qeDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bqL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbkl79IV9RbxDwebcekdszq:x9DOdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:w8KDPue99eux99dui99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:ojjjb8Adndnalcb9imbaoal9nmbamcuaocdtaocFFFFi0Egscbyd;u1jjbHjjjjbbgzBd:CwamceBd;8wamascbyd;u1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;u1jjbHjjjjbbgOBd:KwamciBd;8waihsalhAinazasydbcdtfcbBdbasclfhsaAcufgAmbkaihsalhAinazasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkaihsalhCcbhXindnazasydbcdtgQfgAydbcb9imbaHaQfaXBdbaAaAydbgQcjjjj94VBdbaQaXfhXkasclfhsaCcufgCmbkalci9UhLdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhXaHaAydbcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaXcdtfgXaXydbgXcefBdbaOaXcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaihsalhAindnazasydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaHaCfgCaCydbaQ9RBdbkasclfhsaAcufgAmbxdkkamcuaocdtgsaocFFFFi0EgAcbyd;u1jjbHjjjjbbgzBd:CwamceBd;8wamaAcbyd;u1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;u1jjbHjjjjbbgOBd:KwamciBd;8wazcbasz:ojjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhAaXhCaohQinaAasBdbaAclfhAaCydbasfhsaCclfhCaQcufgQmbkkdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhQaHaAydbcdtfgKaKydbgKcefBdbaOaKcdtfasBdbaHaQcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaoTmbcbhsaohAinaHasfgCaCydbaXasfydb9RBdbasclfhsaAcufgAmbkkamaLcbyd;u1jjbHjjjjbbgsBd:OwamclBd;8wascbaLz:ojjjbhYamcuaLcK2alcjjjjd0Ecbyd;u1jjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihAa8AhsaLhrJbbbbh5inavaAclfydbaK2cdtfgCIdlh8EavaAydbaK2cdtfgXIdlhEavaAcwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgasaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbasclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyascxfa8EaE:tg8Eagah:tggNa8FaE:tg8Faaah:tgaN:tgEJbbbbJbbjZa8Ja8K:tg8Ja8FNa8La8K:tg8Ka8EN:tghahNaEaENaaa8KNaga8JN:tgEaENMM:rg8K:va8KJbbbb9BEg8ENUdbasczfaEa8ENUdbascCfaha8ENUdbascwfa8Maya8NMMJbbnn:vUdba5a8KMh5aAcxfhAascKfhsarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;u1jjbHjjjjbbgCBd:WwamcoBd;8waEaq:ZNhEdna3mbcbhsaChAinaAasBdbaAclfhAaLascefgs9hmbkkaE:rhhcuh8PamcuaLcltalcFFFFd0Ecbyd;u1jjbHjjjjbbgIBd:0wamcrBd;8wcbaIa8AaCaLz:djjjb8AJFFuuhyJFFuuh8RJFFuuh8Sdnalci6gXmbJFFuuh8Sa8AhsaLhAJFFuuh8RJFFuuhyinascwfIdbgEayayaE9EEhyasclfIdbgEa8Ra8RaE9EEh8RasIdbgEa8Sa8SaE9EEh8SascKfhsaAcufgAmbkkahJbbbZNhgamaocetgscuaocu9kEcbyd;u1jjbHjjjjbbgABd:4waAcFeasz:ojjjbhCdnaXmbcbhAJFFuuhEa8Ahscuh8PinascwfIdbay:tghahNasIdba8S:tghahNasclfIdba8R:tghahNMM:rghaEa8PcuSahaE9DVgXEhEaAa8PaXEh8PascKfhsaLaAcefgA9hmbkkamczfcbcjwz:ojjjb8Aamcwf9cb83ibam9cb83ibagaxNhRJbbjZak:th8Ncbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80cbh81cbhPinJbbbbhEdna8UTmbJbbjZa8U:Z:vhEkJbbbbhhdna80a80Na8Ya8YNa8Za8ZNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8XaENh5a8WaENh8Fa8VaENhaa8PhQdndndndndna8UaPVTmbamydwgBTmea80ahNh8Ja8ZahNh8La8YahNh8Maeamydbcdtfh83cbh3JFFuuhEcvhXcuhQindnaza83a3cdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAindndnaCaiaAydbgKcx2fgsclfydbgrcetf8Vebcs4aCasydbgLcetf8Vebcs4faCascwfydbglcetf8Vebcs4fgombcbhsxekcehsazaLcdtfydbgLceSmbcehsazarcdtfydbgrceSmbcehsazalcdtfydbglceSmbdnarcdSaLcdSfalcdSfcd6mbaocefhsxekaocdfhskdnasaX9kmba8AaKcK2fgLIdwa5:thhaLIdla8F:th8KaLIdbaa:th8EdndnakJbbbb9DTmba8E:lg8Ea8K:lg8Ka8Ea8K9EEg8Kah:lgha8Kah9EEag:vJbbjZMhhxekahahNa8Ea8ENa8Ka8KNMM:rag:va8NNJbbjZMJ9VO:d86JbbjZaLIdCa8JNaLIdxa8MNa8LaLIdzNMMakN:tghahJ9VO:d869DENhhkaKaQasaX6ahaE9DVgLEhQasaXaLEhXahaEaLEhEkaAclfhAavcufgvmbkka3cefg3aB9hmbkkaQcu9hmekama5Ud:ODama8FUd:KDamaaUd:GDamcuBd:qDamcFFF;7rBdjDaIcba8AaYamc:GDfakJbbbb9Damc:qDfamcjDfz:ejjjbamyd:qDhQdndnaxJbbbb9ETmba8UaD6mbaQcuSmeceh3amIdjDaR9EmixdkaQcu9hmekdna8UTmbdnamydlgza8Uci2fgsciGTmbadasfcba8Uazcu7fciGcefz:ojjjb8AkabaPcltfgzam8Pib83dbazcwfamcwf8Pib83dbaPcefhPkc3hzinazc98Smvamc:Cwfazfydbcbyd;y1jjbH:bjjjbbazc98fhzxbkkcbh3a8Uaq9pmbamydwaCaiaQcx2fgsydbcetf8Vebcs4aCascwfydbcetf8Vebcs4faCasclfydbcetf8Vebcs4ffaw9nmekcbhscbhAdna81TmbcbhAamczfhXinamczfaAcdtfaXydbgLBdbaXclfhXaAaYaLfRbbTfhAa81cufg81mbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDaAc;8eaAclfc:bd6Eh81inamcjDfasfcFFF;7rBdbasclfgscz9hmbka81cdthBdnalTmbaeaXcdtfhocbhrindnazaoarcdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAcuhLcuhsinazaiaAydbgKcx2fgXclfydbcdtfydbazaXydbcdtfydbfazaXcwfydbcdtfydbfgXasaXas6gXEhsaKaLaXEhLaAclfhAavcufgvmbkaLcuSmba8AaLcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEcbhAindndnasamc:qDfaAfgvydbgX6mbasaX9hmeaEamcjDfaAfIdb9FTmekavasBdbamc:GDfaAfaLBdbamcjDfaAfaEUdbxdkaAclfgAcz9hmbkkarcefgral9hmbkkamczfaBfhLcbhscbhAindnamc:GDfasfydbgXcuSmbaLaAcdtfaXBdbaAcefhAkasclfgscz9hmbkaAa81fg81TmbJFFuuhhcuhKamczfhsa81hvcuhLina8AasydbgXcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEdndnazaiaXcx2fgAclfydbcdtfydbazaAydbcdtfydbfazaAcwfydbcdtfydbfgAaL6mbaAaL9hmeaEah9DTmekaEhhaAhLaXhKkasclfhsavcufgvmbkaKcuSmbaKhQkdnamaiaQcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80kcbhXinaOaHaraXcdtfydbcdtgAfydbcdtfgKhsazaAfgvydbgLhAdnaLTmbdninasydbaQSmeasclfhsaAcufgATmdxbkkasaKaLcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaQcK2fgsIdbhEasIdlhhasIdwh8KasIdxh8EasIdzh5asIdCh8FaYaQfce86bba80a8FMh80a8Za5Mh8Za8Ya8EMh8Ya8Xa8KMh8Xa8WahMh8Wa8VaEMh8Vamydxh8Uxbkkamc:WDf8KjjjjbaPk;Vvivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbararydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark:;idiud99dndnabaecitfgwydlgDciGgqciSmbinabcbaDcd4gDalaqcdtfIdbawIdb:tgkJbbbb9FEgwaecefgefadaialavaoarz:ejjjbak:larIdb9FTmdabawaD7aefgecitfgwydlgDciGgqci9hmbkkabaecitfgeclfhbdnavmbcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdwalIdw:tgkakNaqIdbalIdb:tgkakNaqIdlalIdl:tgkakNMM:rgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbxdkkcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdbalIdb:t:lgkaqIdlalIdl:t:lgxakax9EEgkaqIdwalIdw:t:lgxakax9EEgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbkkk;llevudnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0abydxaq9pVakVgDce9hmbavawcltfgxab8Pdb83dbaxcwfabcwfgx8Pdb83dbdnaxydbgqTmbaoabydbcdtfhxaqhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkdnabydxglci2gsabydlgxfgkciGTmbarakfcbalaxcu7fciGcefz:ojjjb8Aabydxci2hsabydlhxabydwhqkab9cb83dwababydbaqfBdbabascifc98GaxfBdlaP8Vebhscbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk8LbabaeadaialavaoarawaDaDaqJbbbbz:cjjjbk;Nkovud99euv99eul998Jjjjjbc:W;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:W:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaoc8Wfawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeaocbBd8Sao9cb83iKao9cb83izaoczfaoc8Wfawci2cxaoc8Sfcbcrz1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:W:qefawcxaoc8Sfcbciz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:W:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:W:qefheaoc8WfhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabaxUd8KabasUdaabazUd3abaCaxaPN:tUdKabaXasaPN:tUdCabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabae86b8UdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabav86bRdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:W;aef8Kjjjjbk;Iwwvul99iud99eue99eul998Jjjjjbcje9Rgr8Kjjjjbavcd4hwaicd4hDdndnaoTmbarc;abfcbaocdtgvz:ojjjb8Aarc;Gbfcbavz:ojjjb8AarhvarcafhiaohqinavcFFF97BdbaicFFF;7rBdbaiclfhiavclfhvaqcufgqmbkdnadTmbcbhkinaeakaD2cdtfgvIdwhxavIdlhmavIdbhPalakaw2cdtfIdbhsarc;abfhzarhiarc;GbfhHarcafhqcj1jjbhvaohOinasavcwfIdbaxNavIdbaPNavclfIdbamNMMgAMhCakhXdnaAas:tgAaqIdbgQ9DgLmbaHydbhXkaHaXBdbakhXdnaCaiIdbgK9EmbazydbhXaKhCkazaXBdbaiaCUdbaqaAaQaLEUdbavcxfhvaqclfhqaHclfhHaiclfhiazclfhzaOcufgOmbkakcefgkad9hmbkkadThkJbbbbhCcbhXarc;abfhvarc;Gbfhicbhqinalavydbgzaw2cdtfIdbalaiydbgHaw2cdtfIdbaeazaD2cdtfgzIdwaeaHaD2cdtfgHIdw:tgsasNazIdbaHIdb:tgsasNazIdlaHIdl:tgsasNMM:rMMgsaCasaC9EgzEhCaqaXazEhXaiclfhiavclfhvaoaqcefgq9hmbkaCJbbbZNhKxekadThkcbhXJbbbbhKkJbbbbhCdnaearc;abfaXcdtgifydbgqaD2cdtfgvIdwaearc;GbfaifydbgzaD2cdtfgiIdwgm:tgsasNavIdbaiIdbgY:tgAaANavIdlaiIdlgP:tgQaQNMM:rgxJbbbb9ETmbaxalaqaw2cdtfIdbMalazaw2cdtfIdb:taxaxM:vhCkasaCNamMhmaQaCNaPMhPaAaCNaYMhYdnakmbaDcdthvawcdthiindnalIdbg8AaecwfIdbam:tgCaCNaeIdbaY:tgsasNaeclfIdbaP:tgAaANMM:rgQMgEaK9ETmbJbbbbhxdnaQJbbbb9ETmbaEaK:taQaQM:vhxkaxaCNamMhmaxaANaPMhPaxasNaYMhYa8AaKaQMMJbbbZNhKkaeavfhealaifhladcufgdmbkkabaKUdxabamUdwabaPUdlabaYUdbarcjef8Kjjjjbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Reeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrz1jjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk:3lequ8JjjjjbcjP9Rgl8Kjjjjbcbhvalcjxfcbaiz:ojjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjxfaDcefRbbfRbb9RcFeGci6aoalcjxfaDRbbfRbb9RcFeGci6faoalcjxfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:rjjjb8Aakalcjxffaocefgo86bbaxalcjxffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjxffao86bbarcifhravcefgvad9hmbkalcFeaicetz:ojjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkcetfgw8UebgDcu9kmbawax87ebaocjlfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjlfaDz:njjjb8AalcjPf8Kjjjjbk9teiucbcbyd;C1jjbgeabcifc98GfgbBd;C1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;C1jjbgeabcrfc94GfgbBd;C1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;C1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;C1jjbfgdBd;C1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkk9Tdbcjwk9ubbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;uwkxebbbdbbb9GNbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(t),{}).then(function(b){n=b.instance,n.exports.__wasm_call_ctors()});function r(b){for(var y=new Uint8Array(b.length),p=0;p<b.length;++p){var x=b.charCodeAt(p);y[p]=x>96?x-97:x>64?x-39:x+4}for(var _=0,p=0;p<b.length;++p)y[_++]=y[p]<60?e[y[p]]:(y[p]-60)*64+y[++p];return y.buffer.slice(0,_)}function a(b){if(!b)throw new Error("Assertion failed")}function s(b){return new Uint8Array(b.buffer,b.byteOffset,b.byteLength)}var o=48,l=16;function c(b,y){var p=b.meshlets[y*4+0],x=b.meshlets[y*4+1],_=b.meshlets[y*4+2],w=b.meshlets[y*4+3];return{vertices:b.vertices.subarray(p,p+_),triangles:b.triangles.subarray(x,x+w*3)}}function u(b,y,p,x,_,w,M){var S=n.exports.sbrk,A=n.exports.meshopt_buildMeshletsBound(b.length,_,w),C=S(A*l),k=S(A*_*4),R=S(A*w*3),N=S(b.byteLength),P=S(y.byteLength),j=new Uint8Array(n.exports.memory.buffer);j.set(s(b),N),j.set(s(y),P);var z=n.exports.meshopt_buildMeshlets(C,k,R,N,b.length,P,p,x,_,w,M);j=new Uint8Array(n.exports.memory.buffer);for(var X=j.subarray(C,C+z*l),F=new Uint32Array(X.buffer,X.byteOffset,X.byteLength/4).slice(),H=0;H<z;++H){var V=F[H*4+0],W=F[H*4+1],p=F[H*4+2],B=F[H*4+3];n.exports.meshopt_optimizeMeshlet(k+V*4,R+W,B,p)}var Y=F[(z-1)*4+0],Z=F[(z-1)*4+1],G=F[(z-1)*4+2],de=F[(z-1)*4+3],oe=Y+G,le=Z+(de*3+3&-4),ue={meshlets:F,vertices:new Uint32Array(j.buffer,k,oe).slice(),triangles:new Uint8Array(j.buffer,R,le*3).slice(),meshletCount:z};return S(C-S(0)),ue}function f(b){var y=new Float32Array(n.exports.memory.buffer,b,o/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function h(b,y,p,x){var _=n.exports.sbrk,w=[],M=_(y.byteLength),S=_(b.vertices.byteLength),A=_(b.triangles.byteLength),C=_(o),k=new Uint8Array(n.exports.memory.buffer);k.set(s(y),M),k.set(s(b.vertices),S),k.set(s(b.triangles),A);for(var R=0;R<b.meshletCount;++R){var N=b.meshlets[R*4+0],P=b.meshlets[R*4+0+1],j=b.meshlets[R*4+0+3];n.exports.meshopt_computeMeshletBounds(C,S+N*4,A+P,j,M,p,x),w.push(f(C))}return _(M-_(0)),w}function d(b,y,p,x){var _=n.exports.sbrk,w=_(o),M=_(b.byteLength),S=_(y.byteLength),A=new Uint8Array(n.exports.memory.buffer);A.set(s(b),M),A.set(s(y),S),n.exports.meshopt_computeClusterBounds(w,M,b.length,S,p,x);var C=f(w);return _(w-_(0)),C}function g(b,y,p,x,_){var w=n.exports.sbrk,M=w(o),S=w(b.byteLength),A=x?w(x.byteLength):0,C=new Uint8Array(n.exports.memory.buffer);C.set(s(b),S),x&&C.set(s(x),A),n.exports.meshopt_computeSphereBounds(M,S,y,p,A,x?_:0);var k=f(M);return w(M-w(0)),k}return{ready:i,supported:!0,buildMeshlets:function(b,y,p,x,_,w){a(b.length%3==0),a(y instanceof Float32Array),a(y.length%p==0),a(p>=3),a(x<=256||x>0),a(_<=512),a(_%4==0),w=w||0;var M=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return u(M,y,y.length/p,p*4,x,_,w)},extractMeshlet:function(b,y){return a(y>=0&&y<b.meshletCount),c(b,y)},computeClusterBounds:function(b,y,p){a(b.length%3==0),a(b.length/3<=512),a(y instanceof Float32Array),a(y.length%p==0),a(p>=3);var x=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return d(x,y,y.length/p,p*4)},computeMeshletBounds:function(b,y,p){return a(b.meshletCount!=0),a(y instanceof Float32Array),a(y.length%p==0),a(p>=3),h(b,y,y.length/p,p*4)},computeSphereBounds:function(b,y,p,x){return a(b instanceof Float32Array),a(b.length%y==0),a(y>=3),a(!p||p instanceof Float32Array),a(!p||p.length%x==0),a(!p||x>=1),a(!p||b.length/y==p.length/x),x=x||0,g(b,b.length/y,y*4,p,x*4)}}})();function x9e(t,e,n,i){if(!t||!e||i==="off")return{geometries:[],materials:[]};let r=[],a=[];if(e.computeBoundingSphere(),i==="auto"){const l=e.boundingSphere.radius,c=e.attributes.position.count;let u=[];if(c<256)return{geometries:[],materials:[]};c<1024?(r=[.25],u=[2]):c<8192?(r=[.5,.25],u=[1,8]):(r=[8192/c,2048/c,512/c],u=[1,2,8]);const f=Math.sqrt(l+1e-5);a=u.map(h=>h*f)}else r=i.map(l=>l[1]),a=i.map(l=>l[0]);const s=[],o=[];return r.forEach((l,c)=>{const u=Math.floor(e.index.array.length*l/3)*3,f=e.clone(),h=y9e.simplify(new Uint32Array(f.index.array),new Float32Array(f.attributes.position.array),3,u,.02,["LockBorder"])[0];f.index.array.set(h),f.index.needsUpdate=!0,f.setDrawRange(0,h.length);const d=Array.isArray(n)?n.map(g=>g.clone()):n.clone();t.addLOD(f,d,a[c]),s.push(f),Array.isArray(d)?o.push(...d):o.push(d)}),{geometries:s,materials:o}}const jte=Ee.forwardRef(function(e,n){const[i,r]=Ee.useState(null);Ee.useImperativeHandle(n,()=>i,[i]);const a=I.useMemo(()=>new te,[]),s=I.useMemo(()=>new Xn,[]),o=I.useMemo(()=>new te(1,1,1),[]),l=ki(c=>c.gl);return I.useEffect(()=>{const c=e.batched_positions.byteLength/(3*Float32Array.BYTES_PER_ELEMENT),u=new kn(e.geometry.clone(),e.material,{capacity:c,renderer:l});u.frustumCulled=!1;let f=[],h=[];if(e.lod!=="off"){const d=x9e(u,e.geometry,e.material,e.lod);f=d.geometries,h=d.materials}return r(u),()=>{u.disposeBVH(),u.dispose(),f.forEach(d=>d.dispose()),h.forEach(d=>d.dispose())}},[e.geometry,e.lod,e.material]),I.useEffect(()=>{if(!i)return;const c=e.batched_positions.byteLength/(3*Float32Array.BYTES_PER_ELEMENT);i.instancesCount!==c&&(i.capacity<c&&i.resizeBuffers(c),i.clearInstances(),i.addInstances(c,()=>{}));const u=new DataView(e.batched_positions.buffer,e.batched_positions.byteOffset,e.batched_positions.byteLength),f=new DataView(e.batched_wxyzs.buffer,e.batched_wxyzs.byteOffset,e.batched_wxyzs.byteLength),h=e.batched_scales?new DataView(e.batched_scales.buffer,e.batched_scales.byteOffset,e.batched_scales.byteLength):null;i.updateInstances((d,g)=>{const b=g*3*4%e.batched_positions.byteLength,y=g*4*4%e.batched_wxyzs.byteLength;if(a.set(u.getFloat32(b,!0),u.getFloat32(b+4,!0),u.getFloat32(b+8,!0)),s.set(f.getFloat32(y+4,!0),f.getFloat32(y+8,!0),f.getFloat32(y+12,!0),f.getFloat32(y,!0)),h&&e.batched_scales)if(e.batched_scales.byteLength===e.batched_wxyzs.byteLength/4*3){const p=g*3*4%e.batched_scales.byteLength;o.set(h.getFloat32(p,!0),h.getFloat32(p+4,!0),h.getFloat32(p+8,!0))}else{const p=g*4%e.batched_scales.byteLength,x=h.getFloat32(p,!0);o.setScalar(x)}else o.set(1,1,1);d.position.copy(a),d.quaternion.copy(s),d.scale.copy(o)})},[e.batched_positions,e.batched_wxyzs,e.batched_scales,i]),Ee.useEffect(()=>{i!==null&&(e.clickable||i.instancesCount>5e4?i.computeBVH({margin:i.geometry.boundingSphere.radius*.2}):i.disposeBVH())},[e.clickable,i]),Ee.useEffect(()=>{if(i===null||e.batched_colors===null||e.batched_colors.byteLength!==3)return;const c=new Ut(e.batched_colors[0]/255,e.batched_colors[1]/255,e.batched_colors[2]/255);for(let u=0;u<i.instancesCount;u++)i.setColorAt(u,c)},[e.batched_colors,i,e.batched_positions.byteLength]),Ee.useEffect(()=>{if(!(i===null||e.batched_colors===null)&&e.batched_colors.byteLength!==3){if(e.batched_colors.byteLength!==i.instancesCount*3){console.error(`Invalid batched_colors length: ${e.batched_colors.byteLength}, expected 3 or ${i.instancesCount*3}`);return}for(let c=0;c<i.instancesCount;c++){const u=new Ut(e.batched_colors[c*3]/255,e.batched_colors[c*3+1]/255,e.batched_colors[c*3+2]/255);i.setColorAt(c,u)}}},[e.batched_colors,i]),I.useEffect(()=>{i&&(i.castShadow=e.cast_shadow,i.receiveShadow=e.receive_shadow,i.LODinfo&&i.LODinfo.objects&&i.LODinfo.objects.forEach(c=>{c.castShadow=e.cast_shadow,c.receiveShadow=e.receive_shadow}))},[e.cast_shadow,e.receive_shadow,i]),D.jsxs(D.Fragment,{children:[i&&D.jsx("primitive",{object:i}),e.clickable&&D.jsx(xM,{geometry:e.geometry,batched_positions:e.batched_positions,batched_wxyzs:e.batched_wxyzs,batched_scales:e.batched_scales})]})}),_9e=Ee.forwardRef(function({children:e,...n},i){const a=Ee.useContext(Si).useSceneTree(l=>l[n.name]?.clickable)??!1,s=I.useMemo(()=>{const l=eS({material:n.props.material,wireframe:n.props.wireframe,opacity:n.props.opacity,flat_shading:n.props.flat_shading,side:n.props.side});return n.props.opacity!==null&&n.props.opacity<1&&(l.transparent=!0),l},[n.props.material,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),o=I.useMemo(()=>{const l=new On;return l.setAttribute("position",new In(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),l.setIndex(new In(new Uint32Array(n.props.faces.buffer.slice(n.props.faces.byteOffset,n.props.faces.byteOffset+n.props.faces.byteLength)),1)),l.computeVertexNormals(),l.computeBoundingSphere(),l},[n.props.vertices.buffer,n.props.faces.buffer]);return D.jsxs("group",{ref:i,children:[D.jsx(jte,{geometry:o,material:s,batched_positions:n.props.batched_positions,batched_wxyzs:n.props.batched_wxyzs,batched_scales:n.props.batched_scales,batched_colors:n.props.batched_colors,lod:n.props.lod,cast_shadow:n.props.cast_shadow,receive_shadow:n.props.receive_shadow,clickable:a}),e]})}),Hte=new bMe;Hte.setDecoderPath("https://www.gstatic.com/draco/v1/decoders/");function S9e(t){t instanceof _i&&(t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(e=>{X6(e)}):X6(t.material)))}function Vte(t){const[e,n]=Ee.useState(),[i,r]=Ee.useState([]),a=Ee.useRef(null);return Ee.useEffect(()=>{const s=new NEe;return s.setDRACOLoader(Hte),s.parse(new Uint8Array(t).buffer,"",o=>{o.animations&&o.animations.length&&(a.current=new j$(o.scene),o.animations.forEach(c=>{a.current.clipAction(c).play()}));const l=[];o?.scene.traverse(c=>{c instanceof _i&&(c.geometry.computeVertexNormals(),c.geometry.computeBoundingSphere(),l.push(c))}),r(l),n(o)},o=>{console.log("Error loading GLB!"),console.log(o)}),()=>{a.current&&a.current.stopAllAction(),e&&e.scene.traverse(S9e)}},[t]),{gltf:e,meshes:i,mixerRef:a}}const w9e=Ee.forwardRef(function({children:e,...n},i){const{gltf:r,meshes:a,mixerRef:s}=Vte(n.props.glb_data);Ee.useEffect(()=>{r&&r.scene.traverse(b=>{b instanceof _i&&(b.castShadow=n.props.cast_shadow,b.receiveShadow=n.props.receive_shadow===!0)})},[r,n.props.cast_shadow,n.props.receive_shadow]),la((b,y)=>{s.current?.update(y)});const o=ki(b=>b.gl),l=Ee.useMemo(()=>o.getDrawingBufferSize(new wt),[o]),c=Ee.useMemo(()=>{const b=new XU({side:Da});return b.thickness=10,b.color=new Ut(16514816),b.opacity=.8,b.size=l,b.transparent=!0,b.screenspace=!0,b.toneMapped=!0,b},[l]),u=Ee.useRef(null),f=Ee.useContext(iy);la(()=>{u.current!==null&&(u.current.visible=f.state.current.isHovered)});const h=f.clickable,d=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,g=Ee.useMemo(()=>d===0?null:new dg({opacity:d,color:0,depthWrite:!1}),[d]);return r?D.jsxs("group",{ref:i,children:[D.jsx("primitive",{object:r.scene,scale:n.props.scale}),g&&d>0?D.jsx("group",{scale:n.props.scale,children:a.map((b,y)=>D.jsx("mesh",{geometry:b.geometry,material:g,receiveShadow:!0,position:b.position,rotation:b.rotation,scale:b.scale},`shadow-${y}`))}):null,h?D.jsx("group",{ref:u,visible:!1,children:a.map((b,y)=>D.jsx("mesh",{geometry:b.geometry,material:c},y))}):null,e]}):null}),E9e=Ee.forwardRef(function({children:e,...n},i){const a=Ee.useContext(Si).useSceneTree(c=>c[n.name]?.clickable)??!1,{gltf:s}=Vte(n.props.glb_data),{geometry:o,material:l}=I.useMemo(()=>{if(!s)return{geometry:null,material:null};const c=[],u=[];s.scene.traverse(d=>{d instanceof _i&&d.parent&&(d.geometry.applyMatrix4(d.matrixWorld),c.push(d.geometry),u.push(d.material))});const f=c.length===1?c[0].clone():gEe(c),h=u.length===1?u[0]:u;return{geometry:f,material:h}},[s]);return!o||!l?null:D.jsxs("group",{ref:i,children:[D.jsx(jte,{geometry:o,material:l,batched_positions:n.props.batched_positions,batched_wxyzs:n.props.batched_wxyzs,batched_scales:n.props.batched_scales,batched_colors:null,lod:n.props.lod,cast_shadow:n.props.cast_shadow,receive_shadow:n.props.receive_shadow,clickable:a}),e]})});function M9e(t,e){const n=new wt;return n.x=(e[0]+.5)/t.mutable.current.canvas.clientWidth,n.y=(e[1]+.5)/t.mutable.current.canvas.clientHeight,n}function Yl(t){return t[0]<<16|t[1]<<8|t[2]}function T9e(t){return Ee.useContext(Si).useSceneTree(i=>i[t.name]?.labelVisible)?D.jsx(ty,{children:D.jsx("span",{style:{backgroundColor:"rgba(240, 240, 240, 0.9)",color:"#333",borderRadius:"0.2rem",userSelect:"none",padding:"0.1em 0.2em"},children:t.name})}):null}function x8(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=[];for(let i=0;i<e.byteLength;i+=12)n.push([e.getFloat32(i,!0),e.getFloat32(i+4,!0),e.getFloat32(i+8,!0)]);return n}function A9e(t,e,n){if(t===void 0)return{makeObject:()=>null};switch(t.type){case"FrameMessage":return{makeObject:(i,r)=>D.jsx(UTe,{ref:i,showAxes:t.props.show_axes,axesLength:t.props.axes_length,axesRadius:t.props.axes_radius,originRadius:t.props.origin_radius,originColor:Yl(t.props.origin_color),children:r})};case"BatchedAxesMessage":return{makeObject:(i,r)=>D.jsx(FTe,{ref:i,batched_wxyzs:t.props.batched_wxyzs,batched_positions:t.props.batched_positions,batched_scales:t.props.batched_scales,axes_length:t.props.axes_length,axes_radius:t.props.axes_radius,children:r}),computeClickInstanceIndexFromInstanceId:i=>Math.floor(i/3)};case"GridMessage":{const i=new Xn().setFromEuler(t.props.plane=="xz"?new vi(0,0,0):t.props.plane=="xy"?new vi(Math.PI/2,0,0):t.props.plane=="yx"?new vi(0,Math.PI/2,Math.PI/2):t.props.plane=="yz"?new vi(0,0,Math.PI/2):t.props.plane=="zx"?new vi(0,Math.PI/2,0):new vi(-Math.PI/2,0,-Math.PI/2)),r=new Xn().setFromEuler(new vi(-Math.PI/2,0,0)).premultiply(i);let a;if(t.props.shadow_opacity>0){const s=t.props.infinite_grid?1e4:t.props.width,o=t.props.infinite_grid?1e4:t.props.height;a=D.jsxs("mesh",{receiveShadow:!0,position:[0,0,-.01],quaternion:r,children:[D.jsx("planeGeometry",{args:[s,o]}),D.jsx("shadowMaterial",{opacity:t.props.shadow_opacity,color:0,depthWrite:!1})]})}else a=null;return{makeObject:(s,o)=>D.jsxs("group",{ref:s,children:[D.jsx(iQ,{args:[t.props.width,t.props.height],side:Jr,cellColor:Yl(t.props.cell_color),cellThickness:t.props.cell_thickness,cellSize:t.props.cell_size,sectionColor:Yl(t.props.section_color),sectionThickness:t.props.section_thickness,sectionSize:t.props.section_size,infiniteGrid:t.props.infinite_grid,fadeDistance:t.props.fade_distance,fadeStrength:t.props.fade_strength,fadeFrom:t.props.fade_from==="camera"?1:0,quaternion:i}),a,o]})}}case"PointCloudMessage":return{makeObject:(i,r)=>D.jsx(PTe,{ref:i,...t,children:r})};case"SkinnedMeshMessage":return{makeObject:(i,r)=>D.jsx(j4e,{ref:i,...t,children:r})};case"MeshMessage":return{makeObject:(i,r)=>D.jsx(F4e,{ref:i,...t,children:r})};case"BoxMessage":return{makeObject:(i,r)=>D.jsx(B4e,{ref:i,...t,children:r})};case"IcosphereMessage":return{makeObject:(i,r)=>D.jsx(z4e,{ref:i,...t,children:r})};case"BatchedMeshesMessage":return{makeObject:(i,r)=>D.jsx(_9e,{ref:i,...t,children:r}),computeClickInstanceIndexFromInstanceId:t.type==="BatchedMeshesMessage"?i=>i:void 0};case"CameraFrustumMessage":return{makeObject:(i,r)=>D.jsx(VTe,{ref:i,...t,children:r})};case"TransformControlsMessage":{const{send:i,flush:r}=gQ(e,50);let a=!1;return{makeObject:(s,o)=>D.jsx("group",{onClick:l=>l.stopPropagation(),children:D.jsx(dQ,{ref:s,scale:t.props.scale,lineWidth:t.props.line_width,fixed:t.props.fixed,activeAxes:t.props.active_axes,disableAxes:t.props.disable_axes,disableSliders:t.props.disable_sliders,disableRotations:t.props.disable_rotations,disableScaling:!0,translationLimits:t.props.translation_limits,rotationLimits:t.props.rotation_limits,depthTest:t.props.depth_test,opacity:t.props.opacity,onDragStart:()=>{a=!0,e.mutable.current.sendMessage({type:"TransformControlsDragStartMessage",name:t.name})},onDrag:l=>{const c=new Xn;c.setFromRotationMatrix(l);const u=new te().setFromMatrixPosition(l),f=[c.w,c.x,c.y,c.z],h=u.toArray();e.sceneTreeActions.updateNodeAttributes(t.name,{wxyz:f,position:h}),i({type:"TransformControlsUpdateMessage",name:t.name,wxyz:f,position:h})},onDragEnd:()=>{a&&(a=!1,r(),e.mutable.current.sendMessage({type:"TransformControlsDragEndMessage",name:t.name}))},children:o})}),unmountWhenInvisible:!0}}case"LabelMessage":return{makeObject:(i,r)=>D.jsx(jTe,{ref:i,...t,children:r}),unmountWhenInvisible:!1};case"Gui3DMessage":return{makeObject:(i,r)=>D.jsxs("group",{ref:i,children:[D.jsx(ty,{children:D.jsx(n,{children:D.jsx(Ps,{style:{width:"18em",fontSize:"0.875em",marginLeft:"0.5em",marginTop:"0.5em"},shadow:"0 0 0.8em 0 rgba(0,0,0,0.1)",pb:"0.25em",onPointerDown:a=>{a.stopPropagation()},children:D.jsx(A4,{containerUuid:t.props.container_uuid})})})}),r]}),unmountWhenInvisible:!0};case"ImageMessage":return{makeObject:(i,r)=>D.jsx(BTe,{ref:i,...t,children:r})};case"GlbMessage":return{makeObject:(i,r)=>D.jsx(w9e,{ref:i,...t,children:r})};case"BatchedGlbMessage":return{makeObject:(i,r)=>D.jsx(E9e,{ref:i,...t,children:r}),computeClickInstanceIndexFromInstanceId:i=>i};case"LineSegmentsMessage":return{makeObject:(i,r)=>D.jsx(O4e,{ref:i,...t,children:r})};case"CatmullRomSplineMessage":return{makeObject:(i,r)=>D.jsxs("group",{ref:i,children:[D.jsx(AMe,{points:x8(t.props.points),closed:t.props.closed,curveType:t.props.curve_type,tension:t.props.tension,lineWidth:t.props.line_width,color:Yl(t.props.color),segments:t.props.segments??void 0}),r]})};case"CubicBezierSplineMessage":return{makeObject:(i,r)=>{const a=x8(t.props.points),s=x8(t.props.control_points);return D.jsxs("group",{ref:i,children:[[...Array(a.length-1).keys()].map(o=>D.jsx(TMe,{start:a[o],end:a[o+1],midA:s[2*o],midB:s[2*o+1],lineWidth:t.props.line_width,color:Yl(t.props.color),segments:t.props.segments??void 0},o)),r]})}};case"GaussianSplatsMessage":return{makeObject:(i,r)=>D.jsx(eAe,{ref:i,buffer:new Uint32Array(t.props.buffer.buffer.slice(t.props.buffer.byteOffset,t.props.buffer.byteOffset+t.props.buffer.byteLength)),children:r})};case"DirectionalLightMessage":return{makeObject:(i,r)=>D.jsxs("group",{ref:i,children:[D.jsx(QI,{lightIntensity:t.props.intensity,color:Yl(t.props.color),castShadow:t.props.cast_shadow}),r]}),unmountWhenInvisible:!0};case"AmbientLightMessage":return{makeObject:(i,r)=>D.jsx("ambientLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.color),children:r})};case"HemisphereLightMessage":return{makeObject:(i,r)=>D.jsx("hemisphereLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.sky_color),groundColor:Yl(t.props.ground_color),children:r})};case"PointLightMessage":return{makeObject:(i,r)=>D.jsx("pointLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.color),distance:t.props.distance,decay:t.props.decay,castShadow:t.props.cast_shadow,...pG,children:r})};case"RectAreaLightMessage":return{makeObject:(i,r)=>D.jsx("rectAreaLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.color),width:t.props.width,height:t.props.height,children:r})};case"SpotLightMessage":return{makeObject:(i,r)=>D.jsx("spotLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.color),distance:t.props.distance,angle:t.props.angle,penumbra:t.props.penumbra,decay:t.props.decay,castShadow:t.props.cast_shadow,...pG,children:r})};default:return console.log("Received message did not match any known types:",t),{makeObject:()=>null}}}function Gte(t){const e=Ee.useContext(Si),n=e.useSceneTree(w=>w[t.name]?.message),i=pZ(),r=e.sceneTreeActions.updateNodeAttributes,{makeObject:a,unmountWhenInvisible:s,computeClickInstanceIndexFromInstanceId:o}=Ee.useMemo(()=>A9e(n,e,i),[n,e,i]),[l,c]=Ee.useState(!1),u=e.useSceneTree(w=>w[t.name]?.clickable)??!1,f=Ee.useRef(null),h=Ee.useRef(),d=Ee.useMemo(()=>D.jsx(C9e,{name:t.name}),[]),g=e.mutable.current,b=Ee.useMemo(()=>a===void 0?null:a(w=>{f.current=w,g.nodeRefFromName[t.name]=f.current},d),[a,d]);function y(){return e.useSceneTree.getState()[t.name]?.effectiveVisibility??!1}Ee.useEffect(()=>{r(t.name,{poseUpdateState:"needsUpdate"})},[b]),la(()=>{const w=e.useSceneTree.getState()[t.name];if(s){const M=y();M&&l&&(f.current!==null&&(f.current.visible=!1),r(t.name,{poseUpdateState:"needsUpdate"}),c(!1)),!M&&!l&&c(!0)}if(f.current!==null&&w!==void 0&&(f.current.visible=w.overrideVisibility??w.visibility??!0,w.poseUpdateState=="needsUpdate")){if(r(t.name,{poseUpdateState:"updated"}),n.type!=="LabelMessage"){const S=w.wxyz??[1,0,0,0];f.current.quaternion.set(S[1],S[2],S[3],S[0])}const M=w.position??[0,0,0];f.current.position.set(M[0],M[1],M[2]),f.current.matrixAutoUpdate||f.current.updateMatrix(),f.current.matrixWorldAutoUpdate||f.current.updateMatrixWorld()}},-1e3);const p=AC(50).send,x=Ee.useRef({isHovered:!1,instanceId:null});!u&&x.current.isHovered&&(x.current.isHovered=!1,g.hoveredElementsCount--,g.hoveredElementsCount===0&&(document.body.style.cursor="auto")),I.useEffect(()=>()=>{x.current.isHovered&&(g.hoveredElementsCount--,g.hoveredElementsCount===0&&(document.body.style.cursor="auto"))});const _=Ee.useRef({dragging:!1,startClientX:0,startClientY:0});return b===void 0||l?null:D.jsx(D.Fragment,{children:D.jsx("group",{ref:h,onPointerDown:u?w=>{if(!y())return;w.stopPropagation();const M=_.current,S=g.canvas.getBoundingClientRect();M.startClientX=w.clientX-S.left,M.startClientY=w.clientY-S.top,M.dragging=!1}:void 0,onPointerMove:u?w=>{if(!y())return;w.stopPropagation();const M=_.current,S=g.canvas.getBoundingClientRect(),A=w.clientX-S.left-M.startClientX,C=w.clientY-S.top-M.startClientY;Math.abs(A)<=3&&Math.abs(C)<=3||(M.dragging=!0)}:void 0,onPointerUp:u?w=>{if(!y()||(w.stopPropagation(),_.current.dragging))return;const S=mQ(e,w.ray),A=g.canvas.getBoundingClientRect(),C=M9e(e,[w.clientX-A.left,w.clientY-A.top]);p({type:"SceneNodeClickMessage",name:t.name,instance_index:o===void 0?null:o(w.instanceId),ray_origin:[S.origin.x,S.origin.y,S.origin.z],ray_direction:[S.direction.x,S.direction.y,S.direction.z],screen_pos:[C.x,C.y]})}:void 0,onPointerOver:u?w=>{y()&&(w.stopPropagation(),x.current.isHovered=!0,x.current.instanceId=w.instanceId??null,g.hoveredElementsCount++,g.hoveredElementsCount===1&&(document.body.style.cursor="pointer"))}:void 0,onPointerOut:u?()=>{y()&&(x.current.isHovered=!1,x.current.instanceId=null,g.hoveredElementsCount--,g.hoveredElementsCount===0&&(document.body.style.cursor="auto"))}:void 0,children:D.jsx(iy.Provider,{value:{state:x,clickable:u},children:b})})})}function C9e(t){const n=Ee.useContext(Si).useSceneTree(i=>i[t.name]?.children,Q_);return D.jsxs(D.Fragment,{children:[n&&n.map(i=>D.jsx(Gte,{name:i},i)),D.jsx(T9e,{name:t.name})]})}var qC={},Wte={L:1,M:0,Q:3,H:2},Xte={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},R9e=Xte;function qte(t){this.mode=R9e.MODE_8BIT_BYTE,this.data=t}qte.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}};var k9e=qte,PE=Wte;function Ku(t,e){this.totalCount=t,this.dataCount=e}Ku.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Ku.getRSBlocks=function(t,e){var n=Ku.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var i=n.length/3,r=new Array,a=0;a<i;a++)for(var s=n[a*3+0],o=n[a*3+1],l=n[a*3+2],c=0;c<s;c++)r.push(new Ku(o,l));return r};Ku.getRsBlockTable=function(t,e){switch(e){case PE.L:return Ku.RS_BLOCK_TABLE[(t-1)*4+0];case PE.M:return Ku.RS_BLOCK_TABLE[(t-1)*4+1];case PE.Q:return Ku.RS_BLOCK_TABLE[(t-1)*4+2];case PE.H:return Ku.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};var D9e=Ku;function Kte(){this.buffer=new Array,this.length=0}Kte.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var O9e=Kte,uu={glog:function(t){if(t<1)throw new Error("glog("+t+")");return uu.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return uu.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Cs=0;Cs<8;Cs++)uu.EXP_TABLE[Cs]=1<<Cs;for(var Cs=8;Cs<256;Cs++)uu.EXP_TABLE[Cs]=uu.EXP_TABLE[Cs-4]^uu.EXP_TABLE[Cs-5]^uu.EXP_TABLE[Cs-6]^uu.EXP_TABLE[Cs-8];for(var Cs=0;Cs<255;Cs++)uu.LOG_TABLE[uu.EXP_TABLE[Cs]]=Cs;var Yte=uu,Xp=Yte;function TM(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(var i=0;i<t.length-n;i++)this.num[i]=t[i+n]}TM.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var i=0;i<t.getLength();i++)e[n+i]^=Xp.gexp(Xp.glog(this.get(n))+Xp.glog(t.get(i)));return new TM(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Xp.glog(this.get(0))-Xp.glog(t.get(0)),n=new Array(this.getLength()),i=0;i<this.getLength();i++)n[i]=this.get(i);for(var i=0;i<t.getLength();i++)n[i]^=Xp.gexp(Xp.glog(t.get(i))+e);return new TM(n,0).mod(t)}};var Jte=TM,Jl=Xte,UG=Jte,I9e=Yte,id={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ss={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;Ss.getBCHDigit(e)-Ss.getBCHDigit(Ss.G15)>=0;)e^=Ss.G15<<Ss.getBCHDigit(e)-Ss.getBCHDigit(Ss.G15);return(t<<10|e)^Ss.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;Ss.getBCHDigit(e)-Ss.getBCHDigit(Ss.G18)>=0;)e^=Ss.G18<<Ss.getBCHDigit(e)-Ss.getBCHDigit(Ss.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return Ss.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case id.PATTERN000:return(e+n)%2==0;case id.PATTERN001:return e%2==0;case id.PATTERN010:return n%3==0;case id.PATTERN011:return(e+n)%3==0;case id.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case id.PATTERN101:return e*n%2+e*n%3==0;case id.PATTERN110:return(e*n%2+e*n%3)%2==0;case id.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new UG([1],0),n=0;n<t;n++)e=e.multiply(new UG([1,I9e.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Jl.MODE_NUMBER:return 10;case Jl.MODE_ALPHA_NUM:return 9;case Jl.MODE_8BIT_BYTE:return 8;case Jl.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Jl.MODE_NUMBER:return 12;case Jl.MODE_ALPHA_NUM:return 11;case Jl.MODE_8BIT_BYTE:return 16;case Jl.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Jl.MODE_NUMBER:return 14;case Jl.MODE_ALPHA_NUM:return 13;case Jl.MODE_8BIT_BYTE:return 16;case Jl.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,i=0;i<e;i++)for(var r=0;r<e;r++){for(var a=0,s=t.isDark(i,r),o=-1;o<=1;o++)if(!(i+o<0||e<=i+o))for(var l=-1;l<=1;l++)r+l<0||e<=r+l||o==0&&l==0||s==t.isDark(i+o,r+l)&&a++;a>5&&(n+=3+a-5)}for(var i=0;i<e-1;i++)for(var r=0;r<e-1;r++){var c=0;t.isDark(i,r)&&c++,t.isDark(i+1,r)&&c++,t.isDark(i,r+1)&&c++,t.isDark(i+1,r+1)&&c++,(c==0||c==4)&&(n+=3)}for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)t.isDark(i,r)&&!t.isDark(i,r+1)&&t.isDark(i,r+2)&&t.isDark(i,r+3)&&t.isDark(i,r+4)&&!t.isDark(i,r+5)&&t.isDark(i,r+6)&&(n+=40);for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)t.isDark(i,r)&&!t.isDark(i+1,r)&&t.isDark(i+2,r)&&t.isDark(i+3,r)&&t.isDark(i+4,r)&&!t.isDark(i+5,r)&&t.isDark(i+6,r)&&(n+=40);for(var u=0,r=0;r<e;r++)for(var i=0;i<e;i++)t.isDark(i,r)&&u++;var f=Math.abs(100*u/e/e-50)/5;return n+=f*10,n}},N9e=Ss,L9e=k9e,$te=D9e,Zte=O9e,sp=N9e,P9e=Jte;function $u(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Ll=$u.prototype;Ll.addData=function(t){var e=new L9e(t);this.dataList.push(e),this.dataCache=null};Ll.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]};Ll.getModuleCount=function(){return this.moduleCount};Ll.make=function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=$te.getRSBlocks(t,this.errorCorrectLevel),n=new Zte,i=0,r=0;r<e.length;r++)i+=e[r].dataCount;for(var r=0;r<this.dataList.length;r++){var a=this.dataList[r];n.put(a.mode,4),n.put(a.getLength(),sp.getLengthInBits(a.mode,t)),a.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())};Ll.makeImpl=function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=$u.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Ll.setupPositionProbePattern=function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)};Ll.getBestMaskPattern=function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=sp.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e};Ll.createMovieClip=function(t,e,n){var i=t.createEmptyMovieClip(e,n),r=1;this.make();for(var a=0;a<this.modules.length;a++)for(var s=a*r,o=0;o<this.modules[a].length;o++){var l=o*r,c=this.modules[a][o];c&&(i.beginFill(0,100),i.moveTo(l,s),i.lineTo(l+r,s),i.lineTo(l+r,s+r),i.lineTo(l,s+r),i.endFill())}return i};Ll.setupTimingPattern=function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)};Ll.setupPositionAdjustPattern=function(){for(var t=sp.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var i=t[e],r=t[n];if(this.modules[i][r]==null)for(var a=-2;a<=2;a++)for(var s=-2;s<=2;s++)a==-2||a==2||s==-2||s==2||a==0&&s==0?this.modules[i+a][r+s]=!0:this.modules[i+a][r+s]=!1}};Ll.setupTypeNumber=function(t){for(var e=sp.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(var n=0;n<18;n++){var i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}};Ll.setupTypeInfo=function(t,e){for(var n=this.errorCorrectLevel<<3|e,i=sp.getBCHTypeInfo(n),r=0;r<15;r++){var a=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(var r=0;r<15;r++){var a=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t};Ll.mapData=function(t,e){for(var n=-1,i=this.moduleCount-1,r=7,a=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var o=0;o<2;o++)if(this.modules[i][s-o]==null){var l=!1;a<t.length&&(l=(t[a]>>>r&1)==1);var c=sp.getMask(e,i,s-o);c&&(l=!l),this.modules[i][s-o]=l,r--,r==-1&&(a++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}};$u.PAD0=236;$u.PAD1=17;$u.createData=function(t,e,n){for(var i=$te.getRSBlocks(t,e),r=new Zte,a=0;a<n.length;a++){var s=n[a];r.put(s.mode,4),r.put(s.getLength(),sp.getLengthInBits(s.mode,t)),s.write(r)}for(var o=0,a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put($u.PAD0,8),r.getLengthInBits()>=o*8));)r.put($u.PAD1,8);return $u.createBytes(r,i)};$u.createBytes=function(t,e){for(var n=0,i=0,r=0,a=new Array(e.length),s=new Array(e.length),o=0;o<e.length;o++){var l=e[o].dataCount,c=e[o].totalCount-l;i=Math.max(i,l),r=Math.max(r,c),a[o]=new Array(l);for(var u=0;u<a[o].length;u++)a[o][u]=255&t.buffer[u+n];n+=l;var f=sp.getErrorCorrectPolynomial(c),h=new P9e(a[o],f.getLength()-1),d=h.mod(f);s[o]=new Array(f.getLength()-1);for(var u=0;u<s[o].length;u++){var g=u+d.getLength()-s[o].length;s[o][u]=g>=0?d.get(g):0}}for(var b=0,u=0;u<e.length;u++)b+=e[u].totalCount;for(var y=new Array(b),p=0,u=0;u<i;u++)for(var o=0;o<e.length;o++)u<a[o].length&&(y[p++]=a[o][u]);for(var u=0;u<r;u++)for(var o=0;o<e.length;o++)u<s[o].length&&(y[p++]=s[o][u]);return y};var U9e=$u,k4={};Object.defineProperty(k4,"__esModule",{value:!0});var F9e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},B9e=wq,$l=ene(B9e),Qte=I,UE=ene(Qte);function ene(t){return t&&t.__esModule?t:{default:t}}function z9e(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}var j9e={bgColor:$l.default.oneOfType([$l.default.object,$l.default.string]).isRequired,bgD:$l.default.string.isRequired,fgColor:$l.default.oneOfType([$l.default.object,$l.default.string]).isRequired,fgD:$l.default.string.isRequired,size:$l.default.number.isRequired,title:$l.default.string,viewBoxSize:$l.default.number.isRequired,xmlns:$l.default.string},D4=(0,Qte.forwardRef)(function(t,e){var n=t.bgColor,i=t.bgD,r=t.fgD,a=t.fgColor,s=t.size,o=t.title,l=t.viewBoxSize,c=t.xmlns,u=c===void 0?"http://www.w3.org/2000/svg":c,f=z9e(t,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return UE.default.createElement("svg",F9e({},f,{height:s,ref:e,viewBox:"0 0 "+l+" "+l,width:s,xmlns:u}),o?UE.default.createElement("title",null,o):null,UE.default.createElement("path",{d:i,fill:n}),UE.default.createElement("path",{d:r,fill:a}))});D4.displayName="QRCodeSvg";D4.propTypes=j9e;k4.default=D4;Object.defineProperty(qC,"__esModule",{value:!0});qC.QRCode=void 0;var H9e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},V9e=wq,Hf=oS(V9e),G9e=Wte,W9e=oS(G9e),X9e=U9e,q9e=oS(X9e),tne=I,K9e=oS(tne),Y9e=k4,J9e=oS(Y9e);function oS(t){return t&&t.__esModule?t:{default:t}}function $9e(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}var Z9e={bgColor:Hf.default.oneOfType([Hf.default.object,Hf.default.string]),fgColor:Hf.default.oneOfType([Hf.default.object,Hf.default.string]),level:Hf.default.string,size:Hf.default.number,value:Hf.default.string.isRequired},KC=(0,tne.forwardRef)(function(t,e){var n=t.bgColor,i=n===void 0?"#FFFFFF":n,r=t.fgColor,a=r===void 0?"#000000":r,s=t.level,o=s===void 0?"L":s,l=t.size,c=l===void 0?256:l,u=t.value,f=$9e(t,["bgColor","fgColor","level","size","value"]),h=new q9e.default(-1,W9e.default[o]);h.addData(u),h.make();var d=h.modules;return K9e.default.createElement(J9e.default,H9e({},f,{bgColor:i,bgD:d.map(function(g,b){return g.map(function(y,p){return y?"":"M "+p+" "+b+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:a,fgD:d.map(function(g,b){return g.map(function(y,p){return y?"M "+p+" "+b+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:e,size:c,viewBoxSize:d.length}))});qC.QRCode=KC;KC.displayName="QRCode";KC.propTypes=Z9e;var Q9e=qC.default=KC,eFe="z8daqr0",tFe="z8daqr1",FG="z8daqr2",nFe="z8daqr3",iFe="z8daqr4";function rFe(t){if(!/^[0-9a-zA-Z-]+$/.test(t))throw new Error(`[@mantine/use-form] Form name "${t}" is invalid, it should contain only letters, numbers and dashes`)}const aFe=typeof window<"u"?I.useLayoutEffect:I.useEffect;function ys(t,e){aFe(()=>{if(t)return window.addEventListener(t,e),()=>window.removeEventListener(t,e)},[t])}function sFe(t,e){t&&rFe(t),ys(`mantine-form:${t}:set-field-value`,n=>e.setFieldValue(n.detail.path,n.detail.value)),ys(`mantine-form:${t}:set-values`,n=>e.setValues(n.detail)),ys(`mantine-form:${t}:set-initial-values`,n=>e.setInitialValues(n.detail)),ys(`mantine-form:${t}:set-errors`,n=>e.setErrors(n.detail)),ys(`mantine-form:${t}:set-field-error`,n=>e.setFieldError(n.detail.path,n.detail.error)),ys(`mantine-form:${t}:clear-field-error`,n=>e.clearFieldError(n.detail)),ys(`mantine-form:${t}:clear-errors`,e.clearErrors),ys(`mantine-form:${t}:reset`,e.reset),ys(`mantine-form:${t}:validate`,e.validate),ys(`mantine-form:${t}:validate-field`,n=>e.validateField(n.detail)),ys(`mantine-form:${t}:reorder-list-item`,n=>e.reorderListItem(n.detail.path,n.detail.payload)),ys(`mantine-form:${t}:remove-list-item`,n=>e.removeListItem(n.detail.path,n.detail.index)),ys(`mantine-form:${t}:insert-list-item`,n=>e.insertListItem(n.detail.path,n.detail.item,n.detail.index)),ys(`mantine-form:${t}:set-dirty`,n=>e.setDirty(n.detail)),ys(`mantine-form:${t}:set-touched`,n=>e.setTouched(n.detail)),ys(`mantine-form:${t}:reset-dirty`,n=>e.resetDirty(n.detail)),ys(`mantine-form:${t}:reset-touched`,e.resetTouched)}function oFe(t){return e=>{if(!e)t(e);else if(typeof e=="function")t(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:n}=e;n instanceof HTMLInputElement?n.type==="checkbox"?t(n.checked):t(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&t(n.value)}else t(e)}}function eN(t){return t===null||typeof t!="object"?{}:Object.keys(t).reduce((e,n)=>{const i=t[n];return i!=null&&i!==!1&&(e[n]=i),e},{})}function lFe(t){const[e,n]=I.useState(eN(t)),i=I.useRef(e),r=I.useCallback(l=>{n(c=>{const u=eN(typeof l=="function"?l(c):l);return i.current=u,u})},[]),a=I.useCallback(()=>r({}),[]),s=I.useCallback(l=>{i.current[l]!==void 0&&r(c=>{const u={...c};return delete u[l],u})},[e]),o=I.useCallback((l,c)=>{c==null||c===!1?s(l):i.current[l]!==c&&r(u=>({...u,[l]:c}))},[e]);return{errorsState:e,setErrors:r,clearErrors:a,setFieldError:o,clearFieldError:s}}function tN(t,e){if(e===null||typeof e!="object")return{};const n={...e};return Object.keys(e).forEach(i=>{i.includes(`${String(t)}.`)&&delete n[i]}),n}function BG(t,e){const n=t.substring(e.length+1).split(".")[0];return parseInt(n,10)}function zG(t,e,n,i){if(e===void 0)return n;const r=`${String(t)}`;let a=n;i===-1&&(a=tN(`${r}.${e}`,a));const s={...a},o=new Set;return Object.entries(a).filter(([l])=>{if(!l.startsWith(`${r}.`))return!1;const c=BG(l,r);return Number.isNaN(c)?!1:c>=e}).forEach(([l,c])=>{const u=BG(l,r),f=l.replace(`${r}.${u}`,`${r}.${u+i}`);s[f]=c,o.add(f),o.has(l)||delete s[l]}),s}function cFe(t,{from:e,to:n},i){const r=`${t}.${e}`,a=`${t}.${n}`,s={...i},o=new Set;return Object.keys(i).forEach(l=>{if(o.has(l))return;let c,u;if(l.startsWith(r)?(c=l,u=l.replace(r,a)):l.startsWith(a)&&(c=l.replace(a,r),u=l),c&&u){const f=s[c],h=s[u];h===void 0?delete s[c]:s[c]=h,f===void 0?delete s[u]:s[u]=f,o.add(c),o.add(u)}}),s}function jG(t,e,n){typeof n.value=="object"&&(n.value=l0(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function l0(t){if(typeof t!="object")return t;var e=0,n,i,r,a=Object.prototype.toString.call(t);if(a==="[object Object]"?r=Object.create(t.__proto__||null):a==="[object Array]"?r=Array(t.length):a==="[object Set]"?(r=new Set,t.forEach(function(s){r.add(l0(s))})):a==="[object Map]"?(r=new Map,t.forEach(function(s,o){r.set(l0(o),l0(s))})):a==="[object Date]"?r=new Date(+t):a==="[object RegExp]"?r=new RegExp(t.source,t.flags):a==="[object DataView]"?r=new t.constructor(l0(t.buffer)):a==="[object ArrayBuffer]"?r=t.slice(0):a.slice(-6)==="Array]"&&(r=new t.constructor(t)),r){for(i=Object.getOwnPropertySymbols(t);e<i.length;e++)jG(r,i[e],Object.getOwnPropertyDescriptor(t,i[e]));for(e=0,i=Object.getOwnPropertyNames(t);e<i.length;e++)Object.hasOwnProperty.call(r,n=i[e])&&r[n]===t[n]||jG(r,n,Object.getOwnPropertyDescriptor(t,n))}return r||t}function nne(t){return typeof t!="string"?[]:t.split(".")}function Ra(t,e){const n=nne(t);if(n.length===0||typeof e!="object"||e===null)return;let i=e[n[0]];for(let r=1;r<n.length&&i!=null;r+=1)i=i[n[r]];return i}function lS(t,e,n){const i=nne(t);if(i.length===0)return n;const r=l0(n);if(i.length===1)return r[i[0]]=e,r;let a=r[i[0]];for(let s=1;s<i.length-1;s+=1){if(a===void 0)return r;a=a[i[s]]}return a[i[i.length-1]]=e,r}function uFe(t,{from:e,to:n},i){const r=Ra(t,i);if(!Array.isArray(r))return i;const a=[...r],s=r[e];return a.splice(e,1),a.splice(n,0,s),lS(t,a,i)}function fFe(t,e,n,i){const r=Ra(t,i);if(!Array.isArray(r))return i;const a=[...r];return a.splice(typeof n=="number"?n:a.length,0,e),lS(t,a,i)}function hFe(t,e,n){const i=Ra(t,n);return Array.isArray(i)?lS(t,i.filter((r,a)=>a!==e),n):n}function dFe(t,e,n,i){const r=Ra(t,i);if(!Array.isArray(r)||r.length<=n)return i;const a=[...r];return a[n]=e,lS(t,a,i)}function pFe({$values:t,$errors:e,$status:n}){const i=I.useCallback((o,l)=>{n.clearFieldDirty(o),e.setErrors(c=>cFe(o,l,c)),t.setValues({values:uFe(o,l,t.refValues.current),updateState:!0})},[]),r=I.useCallback((o,l)=>{n.clearFieldDirty(o),e.setErrors(c=>zG(o,l,c,-1)),t.setValues({values:hFe(o,l,t.refValues.current),updateState:!0})},[]),a=I.useCallback((o,l,c)=>{n.clearFieldDirty(o),e.setErrors(u=>zG(o,c,u,1)),t.setValues({values:fFe(o,l,c,t.refValues.current),updateState:!0})},[]),s=I.useCallback((o,l,c)=>{n.clearFieldDirty(o),t.setValues({values:dFe(o,c,l,t.refValues.current),updateState:!0})},[]);return{reorderListItem:i,removeListItem:r,insertListItem:a,replaceListItem:s}}var mFe=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,a;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),i=a.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;r--!==0;){var s=a[r];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const FE=Rc(mFe);function px(t,e){const n=Object.keys(t);if(typeof e=="string"){const i=n.filter(r=>r.startsWith(`${e}.`));return t[e]||i.some(r=>t[r])||!1}return n.some(i=>t[i])}function gFe({initialDirty:t,initialTouched:e,mode:n,$values:i}){const[r,a]=I.useState(e),[s,o]=I.useState(t),l=I.useRef(e),c=I.useRef(t),u=I.useCallback(S=>{const A=typeof S=="function"?S(l.current):S;l.current=A,n==="controlled"&&a(A)},[]),f=I.useCallback((S,A=!1)=>{const C=typeof S=="function"?S(c.current):S;c.current=C,(n==="controlled"||A)&&o(C)},[]),h=I.useCallback(()=>u({}),[]),d=I.useCallback(S=>{const A=S?{...i.refValues.current,...S}:i.refValues.current;i.setValuesSnapshot(A),f({})},[]),g=I.useCallback((S,A)=>{u(C=>px(C,S)===A?C:{...C,[S]:A})},[]),b=I.useCallback((S,A,C)=>{f(k=>px(k,S)===A?k:{...k,[S]:A},C)},[]),y=I.useCallback((S,A)=>{const C=px(c.current,S),k=!FE(Ra(S,i.getValuesSnapshot()),A),R=tN(S,c.current);R[S]=k,f(R,C!==k)},[]),p=I.useCallback(S=>px(l.current,S),[]),x=I.useCallback(S=>f(A=>{if(typeof S!="string")return A;const C=tN(S,A);return delete C[S],FE(C,A)?A:C}),[]),_=I.useCallback(S=>{if(S){const C=Ra(S,c.current);if(typeof C=="boolean")return C;const k=Ra(S,i.refValues.current),R=Ra(S,i.valuesSnapshot.current);return!FE(k,R)}return Object.keys(c.current).length>0?px(c.current):!FE(i.refValues.current,i.valuesSnapshot.current)},[]),w=I.useCallback(()=>c.current,[]),M=I.useCallback(()=>l.current,[]);return{touchedState:r,dirtyState:s,touchedRef:l,dirtyRef:c,setTouched:u,setDirty:f,resetDirty:d,resetTouched:h,isTouched:p,setFieldTouched:g,setFieldDirty:b,setTouchedState:a,setDirtyState:o,clearFieldDirty:x,isDirty:_,getDirty:w,getTouched:M,setCalculatedFieldDirty:y}}function bFe({initialValues:t,onValuesChange:e,mode:n}){const i=I.useRef(!1),[r,a]=I.useState(t||{}),s=I.useRef(r),o=I.useRef(r),l=I.useCallback(({values:y,subscribers:p,updateState:x=!0,mergeWithPreviousValues:_=!0})=>{const w=s.current,M=y instanceof Function?y(s.current):y,S=_?{...w,...M}:M;s.current=S,x&&(a(S),n==="uncontrolled"&&(s.current=S)),e?.(S,w),p?.filter(Boolean).forEach(A=>A({updatedValues:S,previousValues:w}))},[e]),c=I.useCallback(y=>{const p=Ra(y.path,s.current),x=y.value instanceof Function?y.value(p):y.value;if(p!==x){const _=s.current,w=lS(y.path,x,s.current);l({values:w,updateState:y.updateState}),y.subscribers?.filter(Boolean).forEach(M=>M({path:y.path,updatedValues:w,previousValues:_}))}},[l]),u=I.useCallback(y=>{o.current=y},[]),f=I.useCallback((y,p)=>{i.current||(i.current=!0,l({values:y,updateState:n==="controlled"}),u(y),p())},[l]),h=I.useCallback(()=>{l({values:o.current,updateState:!0,mergeWithPreviousValues:!1})},[l]),d=I.useCallback(()=>s.current,[]),g=I.useCallback(()=>o.current,[]),b=I.useCallback((y,p)=>{const x=Ra(y,o.current);typeof x>"u"||c({path:y,value:x,updateState:n==="controlled",subscribers:p})},[c,n]);return{initialized:i,stateValues:r,refValues:s,valuesSnapshot:o,setValues:l,setFieldValue:c,resetValues:h,setValuesSnapshot:u,initialize:f,getValues:d,getValuesSnapshot:g,resetField:b}}function vFe({$status:t,cascadeUpdates:e}){const n=I.useRef({}),i=I.useCallback((a,s)=>{I.useEffect(()=>(n.current[a]=n.current[a]||[],n.current[a].push(s),()=>{n.current[a]=n.current[a].filter(o=>o!==s)}),[s])},[]),r=I.useCallback(a=>{const s=n.current[a]?.map(o=>l=>o({previousValue:Ra(a,l.previousValues),value:Ra(a,l.updatedValues),touched:t.isTouched(a),dirty:t.isDirty(a)}))??[];if(e)for(const o in n.current)(o.startsWith(`${a}.`)||a.startsWith(`${o}.`))&&s.push(...n.current[o].map(l=>c=>l({previousValue:Ra(o,c.previousValues),value:Ra(o,c.updatedValues),touched:t.isTouched(o),dirty:t.isDirty(o)})));return s},[]);return{subscribers:n,watch:i,getFieldSubscribers:r}}function HG(t,e){return t?`${t}-${e.toString()}`:e.toString()}const BE=Symbol("root-rule");function VG(t){const e=eN(t);return{hasErrors:Object.keys(e).length>0,errors:e}}function nN(t,e,n="",i={}){return typeof t!="object"||t===null?i:Object.keys(t).reduce((r,a)=>{const s=t[a],o=`${n===""?"":`${n}.`}${a}`,l=Ra(o,e);let c=!1;return typeof s=="function"&&(r[o]=s(l,e,o)),typeof s=="object"&&Array.isArray(l)&&(c=!0,l.forEach((u,f)=>nN(s,e,`${o}.${f}`,r)),BE in s&&(r[o]=s[BE](l,e,o))),typeof s=="object"&&typeof l=="object"&&l!==null&&(c||nN(s,e,o,r),BE in s&&(r[o]=s[BE](l,e,o))),r},i)}function iN(t,e){return VG(typeof t=="function"?t(e):nN(t,e))}function zE(t,e,n){if(typeof t!="string")return{hasError:!1,error:null};const i=iN(e,n),r=Object.keys(i.errors).find(a=>t.split(".").every((s,o)=>s===a.split(".")[o]));return{hasError:!!r,error:r?i.errors[r]:null}}const yFe="__MANTINE_FORM_INDEX__";function GG(t,e){return e?typeof e=="boolean"?e:Array.isArray(e)?e.includes(t.replace(/[.][0-9]+/g,`.${yFe}`)):!1:!1}function xFe({name:t,mode:e="controlled",initialValues:n,initialErrors:i={},initialDirty:r={},initialTouched:a={},clearInputErrorOnChange:s=!0,validateInputOnChange:o=!1,validateInputOnBlur:l=!1,onValuesChange:c,transformValues:u=y=>y,enhanceGetInputProps:f,validate:h,onSubmitPreventDefault:d="always",touchTrigger:g="change",cascadeUpdates:b=!1}={}){const y=lFe(i),p=bFe({initialValues:n,onValuesChange:c,mode:e}),x=gFe({initialDirty:r,initialTouched:a,$values:p,mode:e}),_=pFe({$values:p,$errors:y,$status:x}),w=vFe({$status:x,cascadeUpdates:b}),[M,S]=I.useState(0),[A,C]=I.useState({}),[k,R]=I.useState(!1),N=I.useCallback(()=>{p.resetValues(),y.clearErrors(),x.resetDirty(),x.resetTouched(),e==="uncontrolled"&&S(ue=>ue+1)},[]),P=I.useCallback(ue=>{s&&y.clearErrors(),e==="uncontrolled"&&S(Se=>Se+1),Object.keys(w.subscribers.current).forEach(Se=>{const Te=Ra(Se,p.refValues.current),Pe=Ra(Se,ue);Te!==Pe&&w.getFieldSubscribers(Se).forEach(je=>je({previousValues:ue,updatedValues:p.refValues.current}))})},[s]),j=I.useCallback(ue=>{const Se=p.refValues.current;p.initialize(ue,()=>e==="uncontrolled"&&S(Te=>Te+1)),P(Se)},[P]),z=I.useCallback((ue,Se,Te)=>{const Pe=GG(ue,o),je=Se instanceof Function?Se(Ra(ue,p.refValues.current)):Se;x.setCalculatedFieldDirty(ue,je),g==="change"&&x.setFieldTouched(ue,!0),!Pe&&s&&y.clearFieldError(ue),p.setFieldValue({path:ue,value:Se,updateState:e==="controlled",subscribers:[...w.getFieldSubscribers(ue),Pe?He=>{const pe=zE(ue,h,He.updatedValues);pe.hasError?y.setFieldError(ue,pe.error):y.clearFieldError(ue)}:null,Te?.forceUpdate!==!1&&e!=="controlled"?()=>C(He=>({...He,[ue]:(He[ue]||0)+1})):null]})},[c,h]),X=I.useCallback(ue=>{const Se=p.refValues.current;p.setValues({values:ue,updateState:e==="controlled"}),P(Se)},[c,P]),F=I.useCallback(()=>{const ue=iN(h,p.refValues.current);return y.setErrors(ue.errors),ue},[h]),H=I.useCallback(ue=>{const Se=zE(ue,h,p.refValues.current);return Se.hasError?y.setFieldError(ue,Se.error):y.clearFieldError(ue),Se},[h]),V=(ue,{type:Se="input",withError:Te=!0,withFocus:Pe=!0,...je}={})=>{const pe={onChange:oFe(ze=>z(ue,ze,{forceUpdate:!1})),"data-path":HG(t,ue)};return Te&&(pe.error=y.errorsState[ue]),Se==="checkbox"?pe[e==="controlled"?"checked":"defaultChecked"]=Ra(ue,p.refValues.current):pe[e==="controlled"?"value":"defaultValue"]=Ra(ue,p.refValues.current),Pe&&(pe.onFocus=()=>x.setFieldTouched(ue,!0),pe.onBlur=()=>{if(GG(ue,l)){const ze=zE(ue,h,p.refValues.current);ze.hasError?y.setFieldError(ue,ze.error):y.clearFieldError(ue)}}),Object.assign(pe,f?.({inputProps:pe,field:ue,options:{type:Se,withError:Te,withFocus:Pe,...je},form:le}))},W=(ue,Se)=>Te=>{d==="always"&&Te?.preventDefault();const Pe=F();if(Pe.hasErrors)d==="validation-failed"&&Te?.preventDefault(),Se?.(Pe.errors,p.refValues.current,Te);else{const je=ue?.(u(p.refValues.current),Te);je instanceof Promise&&(R(!0),je.finally(()=>R(!1)))}},B=ue=>u(ue||p.refValues.current),Y=I.useCallback(ue=>{ue.preventDefault(),N()},[]),Z=I.useCallback(ue=>ue?!zE(ue,h,p.refValues.current).hasError:!iN(h,p.refValues.current).hasErrors,[h]),G=ue=>`${M}-${String(ue)}-${A[String(ue)]||0}`,de=I.useCallback(ue=>document.querySelector(`[data-path="${HG(t,ue)}"]`),[]),oe=I.useCallback(ue=>{p.resetField(ue,[e!=="controlled"?()=>C(Se=>({...Se,[ue]:(Se[ue]||0)+1})):null])},[p.resetField,e,C]),le={watch:w.watch,initialized:p.initialized.current,values:e==="uncontrolled"?p.refValues.current:p.stateValues,getValues:p.getValues,getInitialValues:p.getValuesSnapshot,setInitialValues:p.setValuesSnapshot,resetField:oe,initialize:j,setValues:X,setFieldValue:z,submitting:k,setSubmitting:R,errors:y.errorsState,setErrors:y.setErrors,setFieldError:y.setFieldError,clearFieldError:y.clearFieldError,clearErrors:y.clearErrors,resetDirty:x.resetDirty,setTouched:x.setTouched,setDirty:x.setDirty,isTouched:x.isTouched,resetTouched:x.resetTouched,isDirty:x.isDirty,getTouched:x.getTouched,getDirty:x.getDirty,reorderListItem:_.reorderListItem,insertListItem:_.insertListItem,removeListItem:_.removeListItem,replaceListItem:_.replaceListItem,reset:N,validate:F,validateField:H,getInputProps:V,onSubmit:W,onReset:Y,isValid:Z,getTransformedValues:B,key:G,getInputNode:de};return sFe(t,le),le}function _Fe({nodeName:t,closePopoverFn:e}){const n=Ee.useContext(Si),i=n.useSceneTree(f=>f[t]?.message),r=n.sceneTreeActions.updateSceneNodeProps;if(i===void 0)return null;function a(f){return f==Number.POSITIVE_INFINITY?"Infinity":JSON.stringify(f)}function s(f){return f==="Infinity"?Number.POSITIVE_INFINITY:JSON.parse(f)}const o=i.props,l=Object.fromEntries(Object.entries(o).filter(([,f])=>!(f instanceof Uint8Array)).map(([f,h])=>[f,a(h)])),c=xFe({initialValues:{...l},validate:{...Object.fromEntries(Object.keys(l).map(f=>[f,h=>{try{return s(h),null}catch{return"Invalid JSON"}}]))}}),u=f=>{Object.entries(f).forEach(([h,d])=>{if(d!==l[h])try{const g=s(d);r(t,{[h]:g}),c.setFieldValue(h,a(g))}catch(g){console.error("Failed to parse JSON:",g)}})};return D.jsxs(st,{className:tFe,component:"form",onSubmit:c.onSubmit(u),w:"15em",children:[D.jsxs(st,{children:[D.jsxs(st,{style:{display:"flex",alignItems:"center"},children:[D.jsxs(st,{style:{fontWeight:"500",flexGrow:"1"},fz:"sm",children:[i.type.replace("Message","").replace(/([a-z])(\d[A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").trim()," ","Props"]}),D.jsx(Pr,{label:"Close props",children:D.jsx(pCe,{style:{cursor:"pointer",width:"1em",height:"1em",display:"block",opacity:"0.7"},onClick:f=>{f.stopPropagation(),e()}})})]}),D.jsx(st,{style:{opacity:"0.5"},fz:"xs",children:t})]}),D.jsx(Dc.Autosize,{mah:"30vh",scrollbarSize:6,offsetScrollbars:"present",type:"auto",children:D.jsx(st,{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:Object.entries(o).map(([f,h])=>{if(h instanceof Uint8Array||f.startsWith("_"))return null;const d=c.values[f]!==l[f];return D.jsxs(ff,{align:"center",children:[D.jsx(st,{style:{flexGrow:"1"},fz:"xs",children:f.charAt(0).toUpperCase()+f.slice(1).split("_").join(" ")}),D.jsx(ff,{gap:"xs",style:{width:"9em"},children:(()=>{try{const g=s(c.values[f]);if(f.toLowerCase().includes("color")&&Array.isArray(g)&&g.length===3&&g.every(y=>typeof y=="number")){const y=(x,_,w)=>{const M=S=>{const A=Math.round(S).toString(16);return A.length===1?"0"+A:A};return"#"+M(x)+M(_)+M(w)},p=x=>{const _=parseInt(x.slice(1,3),16),w=parseInt(x.slice(3,5),16),M=parseInt(x.slice(5,7),16);return[_,w,M]};return D.jsx(Bv,{size:"xs",styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},style:{width:"100%"},value:y(g[0],g[1],g[2]),onChange:x=>{const _=p(x);c.setFieldValue(f,a(_)),c.onSubmit(u)()},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),c.onSubmit(u)())}})}}catch{}return D.jsx(hg,{size:"xs",styles:{input:{height:"1.625rem",minHeight:"1.625rem",width:"100%"}},style:{width:"100%"},...c.getInputProps(f),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),c.onSubmit(u)())},rightSection:D.jsx(BAe,{style:{width:"1rem",height:"1rem",opacity:d?1:.3,cursor:d?"pointer":"default"},onClick:()=>{d&&c.onSubmit(u)()}})})})()})]},f)})})}),D.jsx(st,{style:{opacity:"0.4",marginTop:"0.25rem"},fz:"xs",children:"Updates from the server will overwrite local changes."})]})}function SFe(){const e=Ee.useContext(Si).useSceneTree(n=>n[""].children,Q_);return D.jsx(Dc,{className:eFe,children:D.jsx(EFe,{children:D.jsx(wFe,{children:e.map(n=>D.jsx(MFe,{nodeName:n,indentCount:0},n))})})})}const ine=Ee.createContext(null),rne=Ee.createContext(null);function wFe({children:t}){const e=Ee.useRef(!1),n=Ee.useRef(!1),i=a=>{e.current=!0,n.current=a},r=()=>{e.current=!1};return Ee.useEffect(()=>(window.addEventListener("mouseup",r),()=>{window.removeEventListener("mouseup",r)}),[r]),D.jsx(ine.Provider,{value:{paintingRef:e,paintValueRef:n,startPainting:i,stopPainting:r},children:t})}function EFe({children:t}){const[e,n]=Ee.useState(null);return D.jsx(rne.Provider,{value:{openPopoverNodeName:e,setOpenPopoverNodeName:n},children:t})}const MFe=Ee.memo(function t(e){const n=Ee.useContext(Si),i=ba(),{colorScheme:r}=Vd(),{paintingRef:a,paintValueRef:s,startPainting:o}=Ee.useContext(ine),{openPopoverNodeName:l,setOpenPopoverNodeName:c}=Ee.useContext(rne),u=C=>{C.stopPropagation();const k=!_;o(k),n.sceneTreeActions.updateNodeAttributes(e.nodeName,{overrideVisibility:k})},f=()=>{a.current&&n.sceneTreeActions.updateNodeAttributes(e.nodeName,{overrideVisibility:s.current})},h=n.useSceneTree(C=>C[e.nodeName]?.children,Q_),d=(h?.length??0)>0,[g,{toggle:b}]=Ec(!1),y=C=>{n.sceneTreeActions.updateNodeAttributes(e.nodeName,{labelVisible:C})},p=n.useSceneTree(C=>C[e.nodeName]?.visibility)??!0,x=n.useSceneTree(C=>C[e.nodeName]?.overrideVisibility),_=x!==void 0?x:p,w=n.useSceneTree(C=>C[e.nodeName]?.effectiveVisibility)??!1;Ee.useEffect(()=>()=>{y(!1)},[]);const M=_?qAe:VAe,S=()=>{c(null)},A=()=>{l===e.nodeName?c(null):c(e.nodeName)};return D.jsxs(D.Fragment,{children:[D.jsxs(st,{className:nFe,style:{cursor:d?"pointer":void 0},onClick:d?b:void 0,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[new Array(e.indentCount).fill(null).map((C,k)=>D.jsx(st,{className:iFe},k)),D.jsx(st,{style:{opacity:d?.7:.1},children:g?D.jsx(_Ae,{style:{height:"1em",width:"1em",transform:"translateY(0.1em)"}}):D.jsx(wAe,{style:{height:"1em",width:"1em",transform:"translateY(0.1em)"}})}),D.jsx(st,{style:{width:"1.5em",height:"1.5em"},children:D.jsx(Pr,{label:"Toggle visibility override",children:D.jsx(M,{style:{cursor:"pointer",opacity:w?.85:.25,width:"1.5em",height:"1.5em",display:"block",...x!==void 0&&{color:i.colors[i.primaryColor][r==="dark"?4:6],filter:`drop-shadow(0 0 2px ${i.colors[i.primaryColor][r==="dark"?4:6]}30)`}},onMouseDown:u,onMouseEnter:f})})}),D.jsxs(st,{style:{flexGrow:"1",userSelect:"none",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[D.jsx("span",{style:{opacity:"0.3"},children:"/"}),e.nodeName.split("/").at(-1)]}),x!==void 0?D.jsx(st,{className:FG,style:{width:"1.25em",height:"1.25em",display:"block",transition:"opacity 0.2s",marginRight:"0.25em"},children:D.jsx(Pr,{label:"Clear visibility override",children:D.jsx(WAe,{style:{cursor:"pointer",width:"1.25em",height:"1.25em",display:"block",opacity:.7,color:i.colors[i.primaryColor][r==="dark"?4:6],filter:`drop-shadow(0 0 2px ${i.colors[i.primaryColor][r==="dark"?4:6]}30)`},onClick:C=>{C.stopPropagation(),n.sceneTreeActions.updateNodeAttributes(e.nodeName,{overrideVisibility:void 0})}})})}):null,D.jsxs(Vo,{position:"bottom",withArrow:!0,shadow:"sm",arrowSize:10,opened:l===e.nodeName,onDismiss:S,middlewares:{flip:!0,shift:!0},withinPortal:!0,children:[D.jsx(Vo.Target,{children:D.jsx(st,{className:FG,style:{width:"1.25em",height:"1.25em",display:"block",transition:"opacity 0.2s"},children:D.jsx(Pr,{label:"Local props",children:D.jsx(nCe,{style:{cursor:"pointer",width:"1.25em",height:"1.25em",display:"block"},onClick:C=>{C.stopPropagation(),A()}})})})}),D.jsx(Vo.Dropdown,{onMouseDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation(),children:D.jsx(_Fe,{nodeName:e.nodeName,closePopoverFn:S})})]})]}),g?h?.map(C=>D.jsx(t,{nodeName:C,indentCount:e.indentCount+1},C)):null]})});function TFe({devSettingsStore:t}){const e=Ee.useContext(Si),n=t(u=>u.showStats),i=e.useGui(u=>u.theme.show_logo),r=t(u=>u.fixedDpr),a=t(u=>u.logCamera),s=t(u=>u.enableOrbitCrosshair),o=e.useGui(u=>u.theme.dark_mode),l=u=>{e.useGui.setState({theme:{...e.useGui.getState().theme,dark_mode:u}})},c=u=>{e.useGui.setState({theme:{...e.useGui.getState().theme,show_logo:u}})};return D.jsx(Ps,{withBorder:!0,p:"xs",children:D.jsxs(Pd,{gap:"xs",children:[D.jsx(vd,{radius:"xs",label:"Dark Mode",checked:o,onChange:u=>l(u.currentTarget.checked),size:"xs"}),D.jsx(vd,{radius:"xs",label:"WebGL Stats",checked:n,onChange:u=>t.setState({showStats:u.currentTarget.checked}),size:"xs"}),D.jsx(vd,{radius:"xs",label:"Show Viser Logo",checked:i,onChange:u=>c(u.currentTarget.checked),size:"xs"}),D.jsx(Pr,{label:D.jsxs(D.Fragment,{children:["Log camera position and orientation to the",D.jsx("br",{}),"Javascript console."]}),refProp:"rootRef",children:D.jsx(vd,{radius:"xs",label:"Log Camera to Console",checked:a,onChange:u=>t.setState({logCamera:u.currentTarget.checked}),size:"xs"})}),D.jsx(Pr,{label:D.jsxs(D.Fragment,{children:["Show crosshair at look-at point",D.jsx("br",{}),"when moving camera."]}),refProp:"rootRef",children:D.jsx(vd,{radius:"xs",label:"Show Orbit Crosshair",checked:s,onChange:u=>t.setState({enableOrbitCrosshair:u.currentTarget.checked}),size:"xs"})}),D.jsx(Pr,{label:D.jsxs(D.Fragment,{children:["Device pixel ratio for rendering.",D.jsx("br",{}),"Default (adaptive) behavior dynamically",D.jsx("br",{}),"reduces resolution to maintain framerates."]}),children:D.jsx(jv,{label:"Device Pixel Ratio",placeholder:"Adaptive",value:r?.toString()??"",onChange:u=>t.setState({fixedDpr:u?parseFloat(u):null}),data:[{value:"",label:"Adaptive"},{value:"0.5",label:"0.5"},{value:"1",label:"1.0"},{value:"1.5",label:"1.5"},{value:"2",label:"2.0"}],size:"xs",radius:"xs",clearable:!1})})]})})}const AFe=Ee.memo(SFe);function CFe(){const t=Ee.useContext(Si),e=t.mutable.current,n=t.useGui(a=>a.theme.control_width),[i,r]=Ee.useState(!1);return D.jsx(D.Fragment,{children:D.jsxs(Pd,{gap:"xs",mt:"0.3em",children:[D.jsx(Pr,{label:"Server URL",position:"top-start",children:D.jsx(hg,{leftSection:D.jsx(I_,{src:"./logo.svg",style:{width:"1rem",height:"auto",filter:"grayscale(100%) opacity(0.3)"}}),leftSectionWidth:"1.8rem",defaultValue:t.useGui(a=>a.server),onBlur:a=>t.useGui.setState({server:a.currentTarget.value}),onKeyDown:a=>{a.key==="Enter"&&(a.currentTarget.blur(),a.currentTarget.focus())}})}),D.jsxs(K0,{gap:"0.5em",children:[D.jsx(ks,{onClick:async()=>{if("showSaveFilePicker"in window&&(()=>{try{return window.self===window.top}catch{return!1}})()){const s=window.showSaveFilePicker({suggestedName:"render.png",types:[{accept:{"image/png":[".png"]}}]});e.canvas?.toBlob(async o=>{if(o===null){console.error("Export failed");return}const c=await(await s).createWritable();await c.write(o),await c.close()})}else e.canvas?.toBlob(s=>{if(s===null){console.error("Export failed");return}const o=URL.createObjectURL(s),l=document.createElement("a");l.href=o;const c="render.png";l.download=c,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)})},flex:1,leftSection:n==="small"?void 0:D.jsx(rCe,{size:"1rem"}),px:"0",style:{height:"1.875rem"},children:"Save Canvas"}),D.jsx(ks,{onClick:()=>{e.resetCameraView()},flex:1,leftSection:n==="small"?void 0:D.jsx($Ae,{size:"1rem"}),px:"0",style:{height:"1.875rem"},children:"Reset View"})]}),D.jsxs(K0,{gap:"md",children:[D.jsx(Pr,{label:D.jsxs(D.Fragment,{children:["Show tool for setting the look-at point and",D.jsx("br",{}),"up direction of the camera.",D.jsx("br",{}),D.jsx("br",{}),"This can be used to set the origin of the",D.jsx("br",{}),"camera's orbit controls."]}),refProp:"rootRef",position:"top-start",children:D.jsx(vh,{radius:"xs",label:"Orbit Origin Tool",onChange:a=>{t.useGui.setState({showOrbitOriginTool:a.currentTarget.checked})},styles:{label:{paddingLeft:"8px",letterSpacing:"-0.3px"},root:{flex:1}},size:"sm"})}),D.jsx(vh,{radius:"xs",label:"Dev Settings",onChange:a=>{r(a.currentTarget.checked)},styles:{label:{paddingLeft:"8px",letterSpacing:"-0.3px"},root:{flex:1}},size:"sm"})]}),D.jsx(st,{mt:"-0.4em",children:D.jsx(gh,{in:i,children:D.jsx(st,{mt:"0.4em",children:D.jsx(TFe,{devSettingsStore:t.useDevSettings})})})}),D.jsx(cg,{}),D.jsxs(st,{children:[D.jsx(Pr,{label:D.jsxs(D.Fragment,{children:["Hierarchical view of all objects in the 3D scene.",D.jsx("br",{}),"Use to override visibility and properties."]}),position:"top-start",children:D.jsx(bu,{style:{fontWeight:500},fz:"sm",children:"Scene tree"})}),D.jsx(AFe,{})]})]})})}const YC=Ee.createContext(null);function ym({children:t}){const e=Ee.useRef(null),[n,{toggle:i}]=Ec(!0);return D.jsx(YC.Provider,{value:{wrapperRef:e,expanded:n,toggleExpanded:i},children:D.jsx(D.Fragment,{children:D.jsx(Ps,{radius:"0",shadow:"0 0 1em 0 rgba(0,0,0,0.1)",style:{boxSizing:"border-box",zIndex:10,position:"fixed",bottom:0,right:0,margin:0,minHeight:"3.5em",maxHeight:"60%",width:"20em",transition:"height 0.3s linear"},component:Dc.Autosize,ref:e,children:D.jsx(st,{style:{width:"20em"},children:t})})})})}ym.Handle=function({children:e}){const n=Ee.useContext(YC);return D.jsx(st,{style:{cursor:"pointer",position:"relative",fontWeight:400,userSelect:"none",display:"flex",alignItems:"center",padding:"0 0.8em",height:"3.5em"},onClick:()=>{n.toggleExpanded()},children:e})};ym.Contents=function({children:e}){const n=Ee.useContext(YC);return D.jsxs(gh,{in:n.expanded,children:[D.jsx(cg,{mx:"xs"}),e]})};ym.HideWhenCollapsed=function({children:e}){return Ee.useContext(YC)?.expanded??!0?e:null};const RFe={move:"touchmove",end:"touchend"},kFe={move:"mousemove",end:"mouseup"};function DFe(t){return t.type==="touchmove"}function OFe(t){return t.type==="mousemove"}const JC=Ee.createContext(null);function xm({children:t,width:e}){const n=Ee.useRef(null),[i,{toggle:r}]=Ec(!0),[a,s]=Ee.useState(800),o=Ee.useRef({dragging:!1,startPosX:0,startPosY:0,startClientX:0,startClientY:0}),l=Ee.useRef({}),c=(d,g,b)=>Math.abs(d+g/2)<Math.abs(d-b+g/2)?d:d-b,u=15;function f(d,g){const b=n.current;if(b===null)return[d,g];const y=b.parentElement;if(y===null)return[d,g];let p=d,x=g;return p=Math.min(p,y.clientWidth-b.clientWidth-u),p=Math.max(p,u),x=Math.min(x,y.clientHeight-b.clientHeight-u),x=Math.max(x,u),b.style.top=`${x.toString()}px`,b.style.left=`${p.toString()}px`,[c(p,b.clientWidth,y.clientWidth),c(x,b.clientHeight,y.clientHeight)]}Ee.useEffect(()=>{const d=n.current;if(d===null)return;const g=d.parentElement;if(g===null)return;const b=new ResizeObserver(()=>{l.current.x===void 0&&(l.current.x=c(d.offsetLeft,d.clientWidth,g.clientWidth)),l.current.y===void 0&&(l.current.y=c(d.offsetTop,d.clientHeight,g.clientHeight));const y=g.clientHeight-u*2;a!==y&&s(y);let p=l.current.x,x=l.current.y;for(;p<0;)p+=g.clientWidth;for(;x<0;)x+=g.clientHeight;f(p,x)});return b.observe(d),b.observe(g),()=>{b.disconnect()}});const h=d=>{const g=o.current,b=n.current;if(!b)return;d.type=="touchstart"?(d=d,g.startClientX=d.touches[0].clientX,g.startClientY=d.touches[0].clientY):(d=d,g.startClientX=d.clientX,g.startClientY=d.clientY),g.startPosX=b.offsetLeft,g.startPosY=b.offsetTop;const y=d.type=="touchstart"?RFe:kFe;function p(x){let _=0,w=0;if(DFe(x)?(x=x,_=x.touches[0].clientX-g.startClientX,w=x.touches[0].clientY-g.startClientY):OFe(x)&&(x=x,_=x.clientX-g.startClientX,w=x.clientY-g.startClientY),Math.abs(_)<=3&&Math.abs(w)<=3)return;g.dragging=!0;const M=g.startPosX+_,S=g.startPosY+w;[l.current.x,l.current.y]=f(M,S)}window.addEventListener(y.move,p),window.addEventListener(y.end,()=>{d.type=="touchstart"&&(g.dragging=!1),window.removeEventListener(y.move,p)},{once:!0})};return D.jsx(JC.Provider,{value:{wrapperRef:n,expanded:i,width:e,maxHeight:a,toggleExpanded:r,dragHandler:h,dragInfo:o},children:D.jsx(Ps,{radius:"xs",shadow:"0.1em 0 1em 0 rgba(0,0,0,0.1)",style:{boxSizing:"border-box",width:e,zIndex:10,position:"absolute",top:"1em",right:"1em",margin:0,"& .expandIcon":{transform:"rotate(0)"},overflow:"hidden"},ref:n,children:t})})}xm.Handle=function({children:e}){const n=Ee.useContext(JC);return D.jsx(D.Fragment,{children:D.jsx(st,{style:{borderRadius:"0.2em 0.2em 0 0",lineHeight:"1.5em",cursor:"pointer",position:"relative",fontWeight:400,userSelect:"none",display:"flex",alignItems:"center",padding:"0 0.75em",height:"2.75em"},onClick:()=>{const i=n.dragInfo.current;if(i.dragging){i.dragging=!1;return}n.toggleExpanded()},onTouchStart:i=>{n.dragHandler(i)},onMouseDown:i=>{n.dragHandler(i)},children:e})})};xm.Contents=function({children:e}){const n=Ee.useContext(JC);return D.jsxs(gh,{in:n.expanded,children:[D.jsx(cg,{mx:"xs"}),D.jsx(Dc.Autosize,{mah:n.maxHeight,children:D.jsx(st,{style:{width:n.width},children:e})})]})};xm.HideWhenCollapsed=function({children:e}){return Ee.useContext(JC)?.expanded??!0?e:null};const rN=Ee.createContext(null);function y1({children:t,collapsible:e,width:n,inline:i=!1}){const[r,{toggle:a}]=Ec(!1),s=Vd(),o=D.jsx(st,{style:l=>({position:"absolute",top:0,right:r?"0em":"-3em",transitionProperty:"right",transitionDuration:"0.5s",transitionDelay:"0.25s",borderBottomLeftRadius:"0.5em",backgroundColor:Vd().colorScheme=="dark"?l.colors.dark[5]:l.colors.gray[2],padding:"0.5em"}),children:D.jsx(Ol,{onClick:l=>{l.stopPropagation(),a()},children:D.jsx(Pr,{zIndex:100,label:"Show sidebar",children:D.jsx(CAe,{})})})});return i?D.jsxs(rN.Provider,{value:{collapsible:e,toggleCollapsed:a},children:[o,D.jsx(st,{style:l=>({width:r?0:"100%",maxWidth:n,transition:"max-width 0.5s 0s, width 0.5s 0s",boxSizing:"border-box",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",borderLeft:`1px solid ${s.colorScheme==="dark"?l.colors.dark[5]:l.colors.gray[3]}`,backgroundColor:s.colorScheme==="dark"?l.colors.dark[6]:l.white}),children:t})]}):D.jsxs(rN.Provider,{value:{collapsible:e,toggleCollapsed:a},children:[o,D.jsx(Ps,{shadow:"0 0 1em 0 rgba(0,0,0,0.1)",style:{width:r?0:n,boxSizing:"content-box",transition:"width 0.5s 0s",zIndex:8}}),D.jsx(Ps,{radius:0,style:{width:r?0:n,top:0,bottom:0,right:0,position:"absolute",boxSizing:"content-box",transition:"width 0.5s 0s",zIndex:20},children:D.jsx(st,{style:{width:n,height:"100%",display:"flex",flexDirection:"column"},children:t})})]})}y1.Handle=function({children:e}){const{toggleCollapsed:n,collapsible:i}=Ee.useContext(rN),r=D.jsx(Ol,{onClick:a=>{a.stopPropagation(),n()},children:D.jsx(Pr,{zIndex:100,label:"Collapse sidebar",children:D.jsx(kAe,{stroke:1.625})})});return D.jsxs(D.Fragment,{children:[D.jsxs(st,{p:"xs",style:{lineHeight:"1.5em",fontWeight:400,position:"relative",zIndex:20,alignItems:"center",display:"flex",flexDirection:"row"},children:[e,i?r:null]}),D.jsx(cg,{mx:"xs"})]})};y1.Contents=function({children:e}){return D.jsx(Dc,{style:{flexGrow:1},children:e})};const IFe="root",NFe=Ee.memo(A4),LFe=260,PFe=12,UFe=48;function WG({control_layout:t,onLayoutMetricsChange:e,minCanvasRatio:n=.3,forcedPanelRatio:i}){const r=ba(),a=bL(`(max-width: ${r.breakpoints.xs})`),s=Ee.useContext(Si),o=s.useGui(R=>Object.keys(R.guiUuidSetFromContainerUuid.root??{}).length>0),[l,{toggle:c}]=Ec(!1),u=s.useGui(R=>R.theme.control_width),f={small:16,medium:20,large:24},d=(u&&f[u]?f[u]:20)*16,g=s.useGui(R=>{let N=0,P=0,j=0;for(const z of Object.values(R.guiConfigFromUuid))if(z?.type==="GuiColumnsMessage"){const X=z.props._column_container_ids.length,V=(z.props.column_widths&&z.props.column_widths.length===X?z.props.column_widths:Array.from({length:X},()=>1)).map(B=>B>0?B:0).reduce((B,Y)=>B+Y,0),W=X*LFe+PFe*Math.max(X-1,0);N=Math.max(N,X),P=Math.max(P,V),j=Math.max(j,W)}return{maxColumns:N,maxRatioSum:P,maxMinWidthPx:j}}),[b,y]=Ee.useState(()=>typeof window<"u"?window.innerWidth:1280);Ee.useEffect(()=>{function R(){y(window.innerWidth)}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=Math.min(.95,g.maxRatioSum||0),x=p>0?p*b:0,_=Math.max(0,Math.max(d,g.maxMinWidthPx,x)),w=Math.max(b-UFe,d),M=Math.max(0,b*(1-n));let S=Math.max(0,Math.min(w,_,M));i!==void 0&&b>0&&(S=Math.max(0,Math.min(1-n,i))*b);const A=`${S}px`;Ee.useEffect(()=>{if(!e)return;const R=b>0?S/b:0;e({widthPx:S,ratio:Math.min(1,Math.max(0,R))})},[S,b,e]);const C=D.jsx(Ol,{onClick:R=>{R.stopPropagation(),c()},style:{display:o?void 0:"none",transform:"translateY(0.05em)"},children:D.jsx(Pr,{zIndex:100,label:l?"Return to GUI":"Configuration & diagnostics",withinPortal:!0,children:l?D.jsx(bAe,{stroke:1.625}):D.jsx(mAe,{stroke:1.625})})}),k=D.jsxs(D.Fragment,{children:[D.jsx(gh,{in:!o||l,children:D.jsx(st,{p:"xs",pt:"0.375em",children:D.jsx(CFe,{})})}),D.jsx(gh,{in:o&&!l,keepMounted:!0,children:D.jsx(NFe,{containerUuid:IFe})})]});return a?D.jsxs(ym,{children:[D.jsxs(ym.Handle,{children:[D.jsx(_8,{}),D.jsxs(ym.HideWhenCollapsed,{children:[D.jsx(S8,{}),C]})]}),D.jsx(ym.Contents,{children:k})]}):t==="floating"?D.jsxs(xm,{width:A,children:[D.jsxs(xm.Handle,{children:[D.jsx(_8,{}),D.jsxs(xm.HideWhenCollapsed,{children:[D.jsx(S8,{}),C]})]}),D.jsx(xm.Contents,{children:k})]}):D.jsxs(y1,{width:A,collapsible:t==="collapsible",inline:!0,children:[D.jsxs(y1.Handle,{children:[D.jsx(_8,{}),D.jsx(S8,{}),C]}),D.jsx(y1.Contents,{children:k})]})}function _8(){const{useGui:t}=Ee.useContext(Si),e=t(i=>i.websocketConnected),n=t(i=>i.label);return D.jsxs(D.Fragment,{children:[D.jsx("div",{style:{width:"1.1em"}})," ",D.jsx(Tc,{transition:"skew-down",mounted:e,children:i=>D.jsx(NAe,{color:"#0b0",style:{position:"absolute",width:"1.25em",height:"1.25em",...i}})}),D.jsx(Tc,{transition:"skew-down",mounted:!e,children:i=>D.jsx(Zd,{size:"xs",type:"dots",color:"red",style:{position:"absolute",...i}})}),D.jsx(st,{px:"xs",style:{flexGrow:1,letterSpacing:"-0.5px"},pt:"0.1em",children:n!==""?n:e?"Connected":"Connecting..."})]})}function S8(){const t=Ee.useContext(Si),e=t.mutable.current,n=t.useGui(d=>d.websocketConnected),i=t.useGui(d=>d.shareUrl),r=t.useGui(d=>d.setShareUrl),[a,s]=Ee.useState(!1),[o,{open:l,close:c}]=Ec(!1),[u,{toggle:f}]=Ec();Ee.useEffect(()=>{i!==null&&s(!1)},[i]),Ee.useEffect(()=>{!n&&o&&c()},[n,o]);const h=Vd().colorScheme;return t.useGui(d=>d.theme).show_share_button===!1?null:D.jsxs(D.Fragment,{children:[D.jsx(Pr,{zIndex:100,label:n?"Share":"Share (needs connection)",withinPortal:!0,children:D.jsx(Ol,{onClick:d=>{d.stopPropagation(),l()},style:{transform:"translateY(0.05em)"},disabled:!n,children:D.jsx(hCe,{stroke:2,height:"1.125em",width:"1.125em"})})}),D.jsxs(Ro,{title:"Share",opened:o,onClose:c,withCloseButton:!1,zIndex:100,withinPortal:!0,onClick:d=>d.stopPropagation(),onMouseDown:d=>d.stopPropagation(),onMouseMove:d=>d.stopPropagation(),onMouseUp:d=>d.stopPropagation(),styles:{title:{fontWeight:600}},children:[i===null?D.jsx(D.Fragment,{children:a?D.jsx(Pd,{mb:"xl",children:D.jsx(Zd,{size:"xl",mx:"auto",type:"dots"})}):D.jsxs(Pd,{mb:"md",children:[D.jsx(bu,{children:"Create a public, shareable URL to this Viser instance."}),D.jsx(ks,{fullWidth:!0,onClick:()=>{e.sendMessage({type:"ShareUrlRequest"}),s(!0)},children:"Request Share URL"})]})}):D.jsxs(D.Fragment,{children:[D.jsx(bu,{children:"Share URL is connected."}),D.jsxs(Pd,{gap:"xs",my:"md",children:[D.jsx(hg,{value:i}),D.jsxs(ff,{justify:"space-between",columnGap:"0.5em",align:"center",children:[D.jsx(kY,{value:i,children:({copied:d,copy:g})=>D.jsx(ks,{style:{width:"50%"},leftSection:d?D.jsx(KU,{height:"1.375em",width:"1.375em"}):D.jsx(UAe,{height:"1.375em",width:"1.375em"}),onClick:g,variant:d?"outline":"filled",children:d?"Copied!":"Copy URL"})}),D.jsx(ks,{style:{flexGrow:1},leftSection:u?D.jsx(lCe,{}):D.jsx(uCe,{}),onClick:f,children:"QR Code"}),D.jsx(Pr,{zIndex:100,label:"Disconnect",withinPortal:!0,children:D.jsx(ks,{color:"red",onClick:()=>{e.sendMessage({type:"ShareUrlDisconnect"}),r(null)},children:D.jsx(sCe,{})})})]}),D.jsx(gh,{in:u,children:D.jsx(Q9e,{value:i,fgColor:h==="dark"?"#ffffff":"#000000",bgColor:"rgba(0,0,0,0)",level:"M",style:{width:"100%",height:"auto",margin:"1em auto 0 auto"}})})]})]}),D.jsxs(bu,{size:"xs",children:["Share links are experimental and bandwidth-limited. Problems? Consider"," ",D.jsx(Dm,{href:"https://github.com/nerfstudio-project/viser/issues",children:"reporting on GitHub"}),"."]})]})]})}var Hn,XG,c0,RT;(function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CIELab="CIELab",t.CMYK="CMYK"})(Hn||(Hn={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(XG||(XG={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(c0||(c0={})),function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(RT||(RT={}));const ane=Object.keys(RT),FFe={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},aN={BGR:Hn.RGB,ABGR:Hn.RGB,HLS:Hn.HSL,AHLS:Hn.HSL,LAB:Hn.CIELab,ALAB:Hn.CIELab,CKMY:Hn.CMYK,ACKMY:Hn.CMYK};var qG;(function(t){t.NUMBER="number",t.BOOLEAN="boolean"})(qG||(qG={}));const Wb={[Hn.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[Hn.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[Hn.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[Hn.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[Hn.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},BFe=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,vg=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,sN=/^0x([a-f\d]{1,2})$/i,zFe=/\{(\d+)\}/g,jFe="The provided string color doesn't have a correct format",HFe="The provided color object doesn't have the proper keys or format";var vl,mu,oN;(function(t){t.NONE="none",t.DEGREES="deg",t.GRADIANS="grad",t.RADIANS="rad",t.TURNS="turn"})(vl||(vl={})),function(t){t.NONE="none",t.PERCENT="percent"}(mu||(mu={})),function(t){t.DEVICE_CMYK="device-cmyk",t.CMYK="cmyk"}(oN||(oN={}));vl.NONE,mu.NONE,mu.NONE,mu.PERCENT,mu.NONE,oN.DEVICE_CMYK;const _o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),cS=t=>+`${t}`.replace(vg,"$1"),Bm=t=>vg.test(`${t}`)?cS(t):Math.min(+t,100),jE=t=>(t.length===1&&(t+=t),parseInt(t,16)),HE=t=>{const e=wn(t,0).toString(16).toUpperCase();return e.length===1?`0x0${e}`:`0x${e}`},_m=(t,e=!1)=>!e&&vg.test(t)?Math.min(255*cS(t)/100,255):sN.test(t)?(t.length===3&&(t+=t.slice(-1)),e?wn(t)/255:wn(t)):Math.min(+t,e?1:255),kT=t=>vg.test(t)?O0(125*cS(t)/100,-125,125):O0(+t,-125,125),Ad=t=>Math.min(vg.test(t)?cS(t)/100:+t,1),sne=t=>[...t].sort().join("").toUpperCase(),wn=(t,e=6)=>{const n=Math.pow(10,e);return Math.round(+t*n)/n},O0=(t,e,n)=>Math.max(e,Math.min(t,n)),one=t=>{if(typeof t=="string"){const e=t.match(BFe),n=+e[1];switch(e[2]){case vl.RADIANS:t=wn(180*n/Math.PI);break;case vl.TURNS:t=wn(360*n);break;case vl.GRADIANS:t=wn(.9*n);break;case vl.DEGREES:default:t=n}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},VFe=(t,e)=>{let n;switch(e){case vl.RADIANS:n=wn((i=>i*Math.PI/180)(t));break;case vl.TURNS:n=wn(t/360);break;case vl.GRADIANS:n=wn(10/9*t);break;case vl.DEGREES:case vl.NONE:default:n=t}return n},lne=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],GFe=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],I0=lne.map(t=>t.reduce((e,n)=>e+n,0)),w8=(t,e,n)=>(n<0&&(n+=6),n>=6&&(n-=6),wn(n<1?255*((e-t)*n+t):n<3?255*e:n<4?255*((e-t)*(4-n)+t):255*t)),WFe=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,XFe=t=>t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,cne=(t,e,n,i)=>{const r=[0,0,0],a=[t,e,n];return i.forEach((s,o)=>{s.forEach((l,c)=>{r[o]+=l*a[c]})}),r},hd=(t,e,n)=>{e/=100;const i=(n/=100)<=.5?n*(e+1):n+e-n*e,r=2*n-i;return{R:w8(r,i,(t/=60)+2),G:w8(r,i,t),B:w8(r,i,t-2)}},lN=(t,e,n,i=1)=>{t/=255,e/=255,n/=255,i=Math.min(i,1);const r=Math.max(t,e,n),a=Math.min(t,e,n),s=r-a;let o=0,l=0;const c=(r+a)/2;if(s!==0){switch(r){case t:o=(e-n)/s%6;break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4}o=wn(60*o),o<0&&(o+=360),l=s/(1-Math.abs(2*c-1))}return{H:o,S:wn(100*l),L:wn(100*c),A:i}},DT=(t,e,n)=>{const i=[t/255,e/255,n/255].map(WFe),r=cne(i[0],i[1],i[2],lne),a=((s,o,l)=>{const c=h=>h>.008856451679035631?Math.cbrt(h):h/.12841854934601665+.13793103448275862,u=c(s/I0[0]),f=c(o/I0[1]);return[116*f-16,500*(u-f),200*(f-c(l/I0[2]))]})(r[0],r[1],r[2]);return{L:a[0],a:a[1],b:a[2]}},une=(t,e,n)=>{const i=((a,s,o)=>{const l=h=>h>.20689655172413793?h**3:.12841854934601665*(h-.13793103448275862),c=(a+16)/116,u=s/500,f=o/200;return[I0[0]*l(c+u),I0[1]*l(c),I0[2]*l(c-f)]})(t,e,n),r=cne(i[0],i[1],i[2],GFe).map(XFe);return{R:O0(255*r[0],0,255),G:O0(255*r[1],0,255),B:O0(255*r[2],0,255)}},fne=(t,e,n,i)=>({R:wn(255*(1-t)*(i=1-i)),G:wn(255*(1-e)*i),B:wn(255*(1-n)*i)}),qFe=(t,e,n)=>{t/=255,e/=255,n/=255;const i=1-Math.max(t,e,n),r=1-i,a=r&&(r-e)/r,s=r&&(r-n)/r;return{C:wn(100*(r&&(r-t)/r)),M:wn(100*a),Y:wn(100*s),K:wn(100*i)}},E8=t=>t?", ":",",mx=(t,e)=>{const n=sne(Object.keys(t));return FFe[aN[n]].reduce((i,r,a)=>{const s=t[r];return s!==void 0&&i.push(e(s,a)),i},[])},gx=(t,e)=>t.replace(zFe,(n,i)=>`${e[+i-1]}`),VE=(t,e,n=!1)=>{const{alphaUnit:i,legacyCSS:r,decimals:a}=e;return i!==mu.PERCENT||r&&!n?wn(t,a):`${wn(100*t,a)}%`},rc={[Hn.HEX]:t=>{const e=mx(t,i=>(r=>{let a=wn(r,0).toString(16).toUpperCase();return a.length===1&&(a=`0${a}`),a})(wn(i))),n=e.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return gx(n,e)},[Hn.RGB]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,rgbUnit:a}=e,s=E8(r),o=mx(t,(c,u)=>a===mu.PERCENT&&u<3?`${((f,h)=>wn(f/255*100,h))(c,n)}%`:u===3?VE(c,e):wn(c,n)),l=i?o.length===4?`rgba({1}${s}{2}${s}{3}${s}{4})`:`rgb({1}${s}{2}${s}{3})`:o.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return gx(l,o)},[Hn.HSL]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,anglesUnit:a}=e,s=E8(r),o=mx(t,(c,u)=>u===0&&a!==vl.NONE?`${wn(VFe(c,a),n)}${a}`:u===3?VE(c,e):wn(c,n)),l=i?o.length===4?`hsla({1}${s}{2}%${s}{3}%${s}{4})`:`hsl({1}${s}{2}%${s}{3}%)`:o.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return gx(l,o)},[Hn.CIELab]:(t,e)=>{const{decimals:n,labUnit:i}=e,r=mx(t,(s,o)=>{if(o===0){const l=wn(Bm(s),n);return i===mu.PERCENT?`${l}%`:`${l}`}return o<3?i===mu.PERCENT?`${((l,c)=>wn(l/125*100,c))(s,n)}%`:wn(s,n):VE(s,e,!0)}),a=r.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return gx(a,r)},[Hn.CMYK]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,cmykUnit:a,cmykFunction:s}=e,o=E8(r),l=mx(t,(u,f)=>a===mu.PERCENT&&f<4?`${wn(u,n)}%`:f===4?VE(u,e):wn(u/100,n)),c=i?l.length===5?`${s}({1}${o}{2}${o}{3}${o}{4}${o}{5})`:`${s}({1}${o}{2}${o}{3}${o}{4})`:l.length===5?`${s}({1} {2} {3} {4} / {5})`:`${s}({1} {2} {3} {4})`;return gx(c,l)}},nh=t=>(typeof t=="string"&&(t=vg.test(t)?cS(t)/100:+t),isNaN(+t)||t>1?1:wn(t)),hne=t=>typeof t=="string"?(e=>{let n;if(Object.keys(Hn).some(i=>{if(Wb[i].test(e))return n=i,!0}),!n&&~ane.indexOf(e)&&(n=Hn.HEX),!n)throw new Error(jFe);return n})(t):(e=>{let n,i=!1;const r=sne(Object.keys(e));if(aN[r]&&(n=aN[r]),n&&n===Hn.RGB){const a=Object.entries(e).some(o=>!sN.test(`${o[1]}`)),s=Object.entries(e).some(o=>!(vg.test(`${o[1]}`)||!sN.test(`${o[1]}`)&&!isNaN(+o[1])&&+o[1]<=255));a&&s&&(i=!0),a||(n=Hn.HEX)}if(!n||i)throw new Error(HFe);return n})(t),KFe={[Hn.HEX](t){const e=(~ane.indexOf(t)?RT[t]:t).match(Wb.HEX),n={R:jE(e[1]||e[5]),G:jE(e[2]||e[6]),B:jE(e[3]||e[7])},i=e[4]||e[8];return i!==void 0&&(n.A=jE(i)/255),n},[Hn.RGB](t){const e=t.match(Wb.RGB),n=_m(e[1]||e[5]),i=_m(e[2]||e[6]),r=_m(e[3]||e[7]),a=e[4]||e[8],s={R:Math.min(n,255),G:Math.min(i,255),B:Math.min(r,255)};return a!==void 0&&(s.A=nh(a)),s},[Hn.HSL](t){const e=t.match(Wb.HSL),n=one(e[1]||e[5]),i=Bm(e[2]||e[6]),r=Bm(e[3]||e[7]),a=e[4]||e[8],s=hd(n,i,r);return a!==void 0&&(s.A=nh(a)),s},[Hn.CIELab](t){const e=t.match(Wb.CIELab),n=Bm(e[1]),i=kT(e[2]),r=kT(e[3]),a=e[4],s=une(n,i,r);return a!==void 0&&(s.A=nh(a)),s},[Hn.CMYK](t){const e=t.match(Wb.CMYK),n=Ad(e[1]||e[6]),i=Ad(e[2]||e[7]),r=Ad(e[3]||e[8]),a=Ad(e[4]||e[9]),s=e[5]||e[10],o=fne(n,i,r,a);return s!==void 0&&(o.A=nh(s)),o}},YFe={[Hn.HEX](t){const e={R:_m(`${t.R}`),G:_m(`${t.G}`),B:_m(`${t.B}`)};return _o(t,"A")&&(e.A=Math.min(_m(`${t.A}`,!0),1)),e},[Hn.RGB](t){return this.HEX(t)},[Hn.HSL](t){const e=Bm(`${t.S}`),n=Bm(`${t.L}`),i=hd(one(t.H),e,n);return _o(t,"A")&&(i.A=nh(t.A)),i},[Hn.CIELab](t){const e=Bm(`${t.L}`),n=kT(`${t.a}`),i=kT(`${t.b}`),r=une(e,n,i);return _o(t,"A")&&(r.A=nh(t.A)),r},[Hn.CMYK](t){const e=Ad(`${t.C}`),n=Ad(`${t.M}`),i=Ad(`${t.Y}`),r=Ad(`${t.K}`),a=fne(e,n,i,r);return _o(t,"A")&&(a.A=nh(t.A)),a}},JFe=(t,e=hne(t))=>typeof t=="string"?KFe[e](t):YFe[e](t),Ts={[Hn.HEX]:t=>({R:HE(t.R),G:HE(t.G),B:HE(t.B)}),HEXA(t){const e=Ts.HEX(t);return e.A=_o(t,"A")?HE(255*t.A):"0xFF",e},[Hn.RGB](t,e){const n=$Fe(t,e);return _o(n,"A")&&delete n.A,n},RGBA(t,e){const n=Ts.RGB(t,e);return n.A=_o(t,"A")?wn(t.A):1,n},[Hn.HSL](t,e){const n=lN(t.R,t.G,t.B);return delete n.A,ZFe(n,e)},HSLA(t,e){const n=Ts.HSL(t,e);return n.A=_o(t,"A")?wn(t.A,e):1,n},[Hn.CIELab](t,e){const n=DT(t.R,t.G,t.B);return QFe(n,e)},CIELabA(t,e){const n=Ts.CIELab(t,e);return n.A=_o(t,"A")?wn(t.A,e):1,n},[Hn.CMYK]:(t,e)=>eBe(qFe(t.R,t.G,t.B),e),CMYKA(t,e){const n=Ts.CMYK(t,e);return n.A=_o(t,"A")?wn(t.A,e):1,n}};Hn.HEX+"",Hn.RGB+"",Hn.HSL+"",Hn.CIELab+"";Hn.HEX+"",Hn.RGB+"",Hn.HSL+"",Hn.CIELab+"";const $Fe=(t,e)=>({R:wn(t.R,e),G:wn(t.G,e),B:wn(t.B,e),..._o(t,"A")?{A:wn(t.A,e)}:{}}),ZFe=(t,e)=>({H:wn(t.H,e),S:wn(t.S,e),L:wn(t.L,e),..._o(t,"A")?{A:wn(t.A,e)}:{}}),QFe=(t,e)=>({L:wn(t.L,e),a:wn(t.a,e),b:wn(t.b,e)}),eBe=(t,e)=>({C:wn(t.C,e),M:wn(t.M,e),Y:wn(t.Y,e),K:wn(t.K,e)});var dne=Symbol.for("immer-nothing"),KG=Symbol.for("immer-draftable"),cr=Symbol.for("immer-state");function pc(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var _v=Object.getPrototypeOf;function Sv(t){return!!t&&!!t[cr]}function xh(t){return t?pne(t)||Array.isArray(t)||!!t[KG]||!!t.constructor?.[KG]||ZC(t)||QC(t):!1}var tBe=Object.prototype.constructor.toString();function pne(t){if(!t||typeof t!="object")return!1;const e=_v(t);if(e===null)return!0;const n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===tBe}function s_(t,e){$C(t)===0?Reflect.ownKeys(t).forEach(n=>{e(n,t[n],t)}):t.forEach((n,i)=>e(i,n,t))}function $C(t){const e=t[cr];return e?e.type_:Array.isArray(t)?1:ZC(t)?2:QC(t)?3:0}function cN(t,e){return $C(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function mne(t,e,n){const i=$C(t);i===2?t.set(e,n):i===3?t.add(n):t[e]=n}function nBe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function ZC(t){return t instanceof Map}function QC(t){return t instanceof Set}function es(t){return t.copy_||t.base_}function uN(t,e){if(ZC(t))return new Map(t);if(QC(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=pne(t);if(e===!0||e==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[cr];let r=Reflect.ownKeys(i);for(let a=0;a<r.length;a++){const s=r[a],o=i[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(i[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[s]})}return Object.create(_v(t),i)}else{const i=_v(t);if(i!==null&&n)return{...t};const r=Object.create(i);return Object.assign(r,t)}}function O4(t,e=!1){return eR(t)||Sv(t)||!xh(t)||($C(t)>1&&(t.set=t.add=t.clear=t.delete=iBe),Object.freeze(t),e&&Object.entries(t).forEach(([n,i])=>O4(i,!0))),t}function iBe(){pc(2)}function eR(t){return Object.isFrozen(t)}var fN={};function ng(t){const e=fN[t];return e||pc(0,t),e}function rBe(t,e){fN[t]||(fN[t]=e)}var o_;function OT(){return o_}function aBe(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function YG(t,e){e&&(ng("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function hN(t){dN(t),t.drafts_.forEach(sBe),t.drafts_=null}function dN(t){t===o_&&(o_=t.parent_)}function JG(t){return o_=aBe(o_,t)}function sBe(t){const e=t[cr];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function $G(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[cr].modified_&&(hN(e),pc(4)),xh(t)&&(t=IT(e,t),e.parent_||NT(e,t)),e.patches_&&ng("Patches").generateReplacementPatches_(n[cr].base_,t,e.patches_,e.inversePatches_)):t=IT(e,n,[]),hN(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==dne?t:void 0}function IT(t,e,n){if(eR(e))return e;const i=e[cr];if(!i)return s_(e,(r,a)=>ZG(t,i,e,r,a,n)),e;if(i.scope_!==t)return e;if(!i.modified_)return NT(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const r=i.copy_;let a=r,s=!1;i.type_===3&&(a=new Set(r),r.clear(),s=!0),s_(a,(o,l)=>ZG(t,i,r,o,l,n,s)),NT(t,r,!1),n&&t.patches_&&ng("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function ZG(t,e,n,i,r,a,s){if(Sv(r)){const o=a&&e&&e.type_!==3&&!cN(e.assigned_,i)?a.concat(i):void 0,l=IT(t,r,o);if(mne(n,i,l),Sv(l))t.canAutoFreeze_=!1;else return}else s&&n.add(r);if(xh(r)&&!eR(r)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;IT(t,r),(!e||!e.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&NT(t,r)}}function NT(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&O4(e,n)}function oBe(t,e){const n=Array.isArray(t),i={type_:n?1:0,scope_:e?e.scope_:OT(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=i,a=I4;n&&(r=[i],a=l_);const{revoke:s,proxy:o}=Proxy.revocable(r,a);return i.draft_=o,i.revoke_=s,o}var I4={get(t,e){if(e===cr)return t;const n=es(t);if(!cN(n,e))return lBe(t,n,e);const i=n[e];return t.finalized_||!xh(i)?i:i===M8(t.base_,e)?(T8(t),t.copy_[e]=c_(i,t)):i},has(t,e){return e in es(t)},ownKeys(t){return Reflect.ownKeys(es(t))},set(t,e,n){const i=gne(es(t),e);if(i?.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const r=M8(es(t),e),a=r?.[cr];if(a&&a.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(nBe(n,r)&&(n!==void 0||cN(t.base_,e)))return!0;T8(t),Gf(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return M8(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,T8(t),Gf(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=es(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:n[e]}},defineProperty(){pc(11)},getPrototypeOf(t){return _v(t.base_)},setPrototypeOf(){pc(12)}},l_={};s_(I4,(t,e)=>{l_[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});l_.deleteProperty=function(t,e){return l_.set.call(this,t,e,void 0)};l_.set=function(t,e,n){return I4.set.call(this,t[0],e,n,t[0])};function M8(t,e){const n=t[cr];return(n?es(n):t)[e]}function lBe(t,e,n){const i=gne(e,n);return i?"value"in i?i.value:i.get?.call(t.draft_):void 0}function gne(t,e){if(!(e in t))return;let n=_v(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=_v(n)}}function Gf(t){t.modified_||(t.modified_=!0,t.parent_&&Gf(t.parent_))}function T8(t){t.copy_||(t.copy_=uN(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var cBe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,i)=>{if(typeof e=="function"&&typeof n!="function"){const a=n;n=e;const s=this;return function(l=a,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&pc(6),i!==void 0&&typeof i!="function"&&pc(7);let r;if(xh(e)){const a=JG(this),s=c_(e,void 0);let o=!0;try{r=n(s),o=!1}finally{o?hN(a):dN(a)}return YG(a,i),$G(r,a)}else if(!e||typeof e!="object"){if(r=n(e),r===void 0&&(r=e),r===dne&&(r=void 0),this.autoFreeze_&&O4(r,!0),i){const a=[],s=[];ng("Patches").generateReplacementPatches_(e,r,a,s),i(a,s)}return r}else pc(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(s,...o)=>this.produceWithPatches(s,l=>e(l,...o));let i,r;return[this.produce(e,n,(s,o)=>{i=s,r=o}),i,r]},typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof t?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){xh(t)||pc(8),Sv(t)&&(t=uBe(t));const e=JG(this),n=c_(t,void 0);return n[cr].isManual_=!0,dN(e),n}finishDraft(t,e){const n=t&&t[cr];(!n||!n.isManual_)&&pc(9);const{scope_:i}=n;return YG(i,e),$G(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const r=e[n];if(r.path.length===0&&r.op==="replace"){t=r.value;break}}n>-1&&(e=e.slice(n+1));const i=ng("Patches").applyPatches_;return Sv(t)?i(t,e):this.produce(t,r=>i(r,e))}};function c_(t,e){const n=ZC(t)?ng("MapSet").proxyMap_(t,e):QC(t)?ng("MapSet").proxySet_(t,e):oBe(t,e);return(e?e.scope_:OT()).drafts_.push(n),n}function uBe(t){return Sv(t)||pc(10,t),bne(t)}function bne(t){if(!xh(t)||eR(t))return t;const e=t[cr];let n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=uN(t,e.scope_.immer_.useStrictShallowCopy_)}else n=uN(t,!0);return s_(n,(i,r)=>{mne(n,i,bne(r))}),e&&(e.finalized_=!1),n}function fBe(){class t extends Map{constructor(l,c){super(),this[cr]={type_:2,parent_:c,scope_:c?c.scope_:OT(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:l,draft_:this,isManual_:!1,revoked_:!1}}get size(){return es(this[cr]).size}has(l){return es(this[cr]).has(l)}set(l,c){const u=this[cr];return s(u),(!es(u).has(l)||es(u).get(l)!==c)&&(n(u),Gf(u),u.assigned_.set(l,!0),u.copy_.set(l,c),u.assigned_.set(l,!0)),this}delete(l){if(!this.has(l))return!1;const c=this[cr];return s(c),n(c),Gf(c),c.base_.has(l)?c.assigned_.set(l,!1):c.assigned_.delete(l),c.copy_.delete(l),!0}clear(){const l=this[cr];s(l),es(l).size&&(n(l),Gf(l),l.assigned_=new Map,s_(l.base_,c=>{l.assigned_.set(c,!1)}),l.copy_.clear())}forEach(l,c){const u=this[cr];es(u).forEach((f,h,d)=>{l.call(c,this.get(h),h,this)})}get(l){const c=this[cr];s(c);const u=es(c).get(l);if(c.finalized_||!xh(u)||u!==c.base_.get(l))return u;const f=c_(u,c);return n(c),c.copy_.set(l,f),f}keys(){return es(this[cr]).keys()}values(){const l=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const c=l.next();return c.done?c:{done:!1,value:this.get(c.value)}}}}entries(){const l=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const c=l.next();if(c.done)return c;const u=this.get(c.value);return{done:!1,value:[c.value,u]}}}}[Symbol.iterator](){return this.entries()}}function e(o,l){return new t(o,l)}function n(o){o.copy_||(o.assigned_=new Map,o.copy_=new Map(o.base_))}class i extends Set{constructor(l,c){super(),this[cr]={type_:3,parent_:c,scope_:c?c.scope_:OT(),modified_:!1,finalized_:!1,copy_:void 0,base_:l,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return es(this[cr]).size}has(l){const c=this[cr];return s(c),c.copy_?!!(c.copy_.has(l)||c.drafts_.has(l)&&c.copy_.has(c.drafts_.get(l))):c.base_.has(l)}add(l){const c=this[cr];return s(c),this.has(l)||(a(c),Gf(c),c.copy_.add(l)),this}delete(l){if(!this.has(l))return!1;const c=this[cr];return s(c),a(c),Gf(c),c.copy_.delete(l)||(c.drafts_.has(l)?c.copy_.delete(c.drafts_.get(l)):!1)}clear(){const l=this[cr];s(l),es(l).size&&(a(l),Gf(l),l.copy_.clear())}values(){const l=this[cr];return s(l),a(l),l.copy_.values()}entries(){const l=this[cr];return s(l),a(l),l.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(l,c){const u=this.values();let f=u.next();for(;!f.done;)l.call(c,f.value,f.value,this),f=u.next()}}function r(o,l){return new i(o,l)}function a(o){o.copy_||(o.copy_=new Set,o.base_.forEach(l=>{if(xh(l)){const c=c_(l,o);o.drafts_.set(l,c),o.copy_.add(c)}else o.copy_.add(l)}))}function s(o){o.revoked_&&pc(3,JSON.stringify(es(o)))}rBe("MapSet",{proxyMap_:e,proxySet_:r})}var kl=new cBe,hBe=kl.produce;kl.produceWithPatches.bind(kl);kl.setAutoFreeze.bind(kl);kl.setUseStrictShallowCopy.bind(kl);kl.applyPatches.bind(kl);kl.createDraft.bind(kl);kl.finishDraft.bind(kl);const dBe=t=>(e,n,i)=>(i.setState=(r,a,...s)=>{const o=typeof r=="function"?hBe(r):r;return e(o,a,...s)},t(i.setState,n,i)),pBe=dBe,mBe=new URLSearchParams(window.location.search),gBe=mBe.get("hideViserLogo")!==null,qp={theme:{type:"ThemeConfigurationMessage",titlebar_content:null,control_layout:"floating",control_width:"medium",dark_mode:!1,show_logo:!gBe,show_share_button:!0,colors:null},label:"",server:"ws://localhost:8080",shareUrl:null,websocketConnected:!1,backgroundAvailable:!1,showOrbitOriginTool:!1,guiUuidSetFromContainerUuid:{root:{}},modals:[],guiOrderFromUuid:{},guiConfigFromUuid:{},uploadsInProgress:{}};function bBe(t){return Ee.useState(()=>$_(pBe(e=>({...qp,server:t,setTheme:n=>e(i=>{i.theme=n}),setShareUrl:n=>e(i=>{i.shareUrl=n}),addGui:n=>e(i=>{i.guiOrderFromUuid[n.uuid]=n.props.order,i.guiConfigFromUuid[n.uuid]=n,n.container_uuid in i.guiUuidSetFromContainerUuid||(i.guiUuidSetFromContainerUuid[n.container_uuid]={}),i.guiUuidSetFromContainerUuid[n.container_uuid][n.uuid]=!0}),addModal:n=>e(i=>{i.modals.push(n)}),removeModal:n=>e(i=>{i.modals=i.modals.filter(r=>r.uuid!==n)}),removeGui:n=>e(i=>{const r=i.guiConfigFromUuid[n];if(r==null){console.warn("(OK) Tried to remove non-existent component",n);return}delete i.guiUuidSetFromContainerUuid[r.container_uuid][n],delete i.guiOrderFromUuid[n],delete i.guiConfigFromUuid[n],Object.keys(i.guiUuidSetFromContainerUuid[r.container_uuid]).length==0&&delete i.guiUuidSetFromContainerUuid[r.container_uuid]}),resetGui:()=>e(n=>{n.shareUrl=qp.shareUrl,n.guiUuidSetFromContainerUuid=qp.guiUuidSetFromContainerUuid,n.modals=qp.modals,n.guiOrderFromUuid=qp.guiOrderFromUuid,n.guiConfigFromUuid=qp.guiConfigFromUuid,n.uploadsInProgress=qp.uploadsInProgress}),updateUploadState:n=>e(i=>{const{componentId:r,...a}=n;i.uploadsInProgress[r]={...i.uploadsInProgress[r],...a}}),updateGuiProps:(n,i)=>{e(r=>{const a=r.guiConfigFromUuid[n];if(a===void 0){console.error(`Tried to update non-existent component '${n}' with`,i);return}for(const[s,o]of Object.entries(i))s==="value"?r.guiConfigFromUuid[n].value=o:s in a.props?a.props[s]=o:console.error(`Tried to update nonexistent property '${s}' of GUI element ${n}!`)})}}))))[0]}const AM="websocket";function vBe(t){const e=new URLSearchParams(window.location.search),n=window.location.host.includes(t.replace("ws://","").replace("/",""))||window.location.host.includes(t.replace("wss://","").replace("/",""));n&&e.has(AM)?e.delete(AM):n||e.set(AM,t),window.history.replaceState(null,"Viser",e.size===0?window.location.href.split("?")[0]:"?"+Array.from(e.entries()).map(([i,r])=>`${i}=${r}`).join("&"))}function yBe(t){return new Worker("/assets/WebsocketServerWorker-D1Ej0OQP.js",{type:"module",name:t?.name})}function xBe(){const t=I.useContext(Si),e=t.mutable.current,n=t.useGui(a=>a.server),i=t.useGui(a=>a.resetGui),r=t.sceneTreeActions.resetScene;return vBe(n),Ee.useEffect(()=>{const a=new yBe;a.onmessage=o=>{const l=o.data;l.type==="connected"?(i(),r(),t.useGui.setState({websocketConnected:!0}),e.sendMessage=c=>{s({type:"send",message:c})}):l.type==="closed"?(i(),t.useGui.setState({websocketConnected:!1}),e.sendMessage=c=>{console.log(`Tried to send ${c.type} but websocket is not connected!`)},l.versionMismatch&&Is.show({id:"version-mismatch",title:"Connection rejected",message:`${l.closeReason}.`,color:"red",autoClose:5e3,withCloseButton:!0})):l.type==="message_batch"&&e.messageQueue.push(...l.messages)};function s(o){a.postMessage(o)}return s({type:"set_server",server:n}),()=>{s({type:"close"}),e.sendMessage=o=>console.log(`Tried to send ${o.type} but websocket is not connected!`),t.useGui.setState({websocketConnected:!1})}},[n,i,r]),null}function _Be(t){throw new Error("Didn't expect to get here",t)}function vne(t){let e=null;switch(t){case null:break;case"GitHub":e=yAe;break;case"Description":e=YAe;break;case"Keyboard":e=QAe;break;default:_Be(t)}return e}function SBe(t){const e=vne(t.icon);return D.jsx(ks,{component:"a",variant:"default",size:"compact-sm",href:t.href||void 0,target:"_blank",leftSection:e===null?null:D.jsx(e,{size:"1em"}),ml:"xs",color:"gray",children:t.text})}function wBe(t){const e=vne(t.icon);return D.jsx(ks,{m:"sm",component:"a",variant:"default",href:t.href||void 0,target:"_blank",leftSection:e===null?null:D.jsx(e,{size:"1.5em"}),ml:"sm",color:"gray",children:t.text})}function EBe(t,e){let n;t.image_url_dark==null||e==="light"?n=t.image_url_light:n=t.image_url_dark;const i=D.jsx("img",{src:n,alt:t.image_alt,style:{height:"1.8em",margin:"0 0.5em"}});return t.href==null?i:D.jsx("a",{style:{display:"block",height:"1.8em"},href:t.href,children:i})}function MBe(){const e=I.useContext(Si).useGui(o=>o.theme.titlebar_content),n=Vd().colorScheme,[i,r]=Ec(!1);if(e==null)return null;const a=e.buttons,s=e.image;return D.jsx(st,{style:{height:"3.2em",margin:0,border:"0",zIndex:10},children:D.jsxs(Ps,{shadow:"0 0 0.8em 0 rgba(0,0,0,0.1)",style:{height:"100%"},children:[D.jsxs(_P,{fluid:!0,style:()=>({height:"100%",display:"flex",alignItems:"center"}),children:[D.jsx(K0,{style:()=>({marginRight:"auto"}),children:s!==null?EBe(s,n):null}),D.jsx(K0,{display:{base:"none",xs:"flex"},style:()=>({flexWrap:"nowrap",overflowX:"scroll",msOverflowStyle:"none",scrollbarWidth:"none"}),children:a?.map((o,l)=>I.createElement(SBe,{...o,key:l}))}),D.jsx(hP,{size:"sm",opened:i,onClick:r.toggle,title:i?"Close navigation":"Open navigation",display:{base:"block",xs:"none"}})]}),D.jsx(VL,{children:D.jsx(Ps,{display:{base:"flex",xs:"none"},radius:"0",style:{flexDirection:"column",position:"absolute",top:"3.2em",zIndex:2e3,height:i?"calc(100vh - 2.375em)":"0",width:"100vw",transition:"all 0.5s",overflow:i?"scroll":"hidden",padding:i?"1rem":"0"},children:a?.map((o,l)=>I.createElement(wBe,{...o,key:l}))})})]})})}function TBe(){return I.useContext(Si).useGui(i=>i.modals,Q_).map((i,r)=>D.jsx(ABe,{conf:i,index:r},i.uuid))}function ABe({conf:t,index:e}){return D.jsx(Ro,{opened:!0,title:t.title,onClose:()=>{},withCloseButton:!1,centered:!0,zIndex:100+e,children:D.jsx(A4,{containerUuid:t.uuid})})}const N4={message:{type:"FrameMessage",name:"",props:{show_axes:!1,axes_length:.5,axes_radius:.0125,origin_radius:.025,origin_color:[236,236,0]}},children:["/WorldAxes"],clickable:!1,visibility:!0,effectiveVisibility:!0,wxyz:(()=>{const t=new Xn().setFromEuler(new vi(Math.PI/2,Math.PI,-Math.PI/2));return[t.w,t.x,t.y,t.z]})()},yne={message:{type:"FrameMessage",name:"/WorldAxes",props:{show_axes:!0,axes_length:.5,axes_radius:.0125,origin_radius:.025,origin_color:[236,236,0]}},children:[],clickable:!1,visibility:!0,effectiveVisibility:!0};function CBe(t,e){const n={addSceneNode:i=>{const r=t.getState(),a=r[i.name],s=i.name.split("/").slice(0,-1).join("/"),o=r[s],l={[i.name]:{...a,message:i,children:a?.children??[],clickable:a?.clickable??!1,labelVisible:a?.labelVisible??!1,effectiveVisibility:a?.effectiveVisibility??!0}};o&&!o.children.includes(i.name)&&(l[s]={...o,children:[...o.children,i.name]}),a&&delete e[i.name],t.setState(l)},removeSceneNode:i=>{const r=t.getState(),a=[];function s(u){a.push(u);const f=r[u];f&&f.children.forEach(s)}s(i);const o={};a.forEach(u=>{o[u]=void 0,delete e[u]});const l=i.split("/").slice(0,-1).join("/"),c=r[l];c&&(o[l]={...c,children:c.children.filter(u=>u!==i)}),t.setState(o)},updateSceneNodeProps:(i,r)=>{const a=t.getState()[i];if(a===void 0)return console.error(`Attempted to update props of non-existent node ${i}`,r),{};t.setState({[i]:{...a,message:{...a.message,props:{...a.message.props,...r}}}})},resetScene:()=>{t.setState({"":N4,"/WorldAxes":yne},!0)},updateNodeAttributes:(i,r)=>{const a=t.getState()[i];if(a===void 0){console.log(`(OK) Attempted to update attributes of non-existent node ${i}`,r);return}let s=!1;for(const o in r)if(a[o]!==r[o]){s=!0;break}s&&(t.setState({[i]:{...a,...r}}),("visibility"in r||"overrideVisibility"in r)&&n.computeEffectiveVisibility(i))},computeEffectiveVisibility:i=>{const r=t.getState(),a=r[i];if(!a)return;const s=i.split("/").slice(0,-1).join("/"),o=r[s],l=s===""?!0:o?.effectiveVisibility??!0,c=a.overrideVisibility??a.visibility??!0,u=l&&c,f={[i]:{...a,effectiveVisibility:u}};function h(d,g){const b=r[d];b&&b.children.forEach(y=>{const p=r[y];if(!p)return;const x=p.overrideVisibility??p.visibility??!0,_=g&&x;f[y]={...p,effectiveVisibility:_},h(y,_)})}h(i,u),t.setState(f)}};return n}function RBe(t){return Ee.useState(()=>{const e=$_(()=>({"":N4,"/WorldAxes":yne})),n=CBe(e,t);return{store:e,actions:n}})[0]}function kBe(){return Ee.useState(()=>$_(()=>({enableDefaultLights:!0,enableDefaultLightsShadows:!0,environmentMap:{type:"EnvironmentMapMessage",hdri:"city",background:!1,background_blurriness:0,background_intensity:1,background_wxyz:[1,0,0,0],environment_intensity:1,environment_wxyz:[1,0,0,0]}})))[0]}function DBe(){return Ee.useState(()=>{const t=new URLSearchParams(window.location.search),e=t.get("showStats")!==null,n=t.get("fixedDpr"),i=n?parseFloat(n):null,r=t.get("logCamera")!==null;return $_(()=>({showStats:e,fixedDpr:i,logCamera:r,enableOrbitCrosshair:!0}))})[0]}function bx(t,e,n){return Object.keys(t[e]).reduce((i,r)=>(i[r]=`var(--mantine-${n}-${r})`,i),{})}function QG(t,e){return t in e.breakpoints?e.breakpoints[t]:CO(t)}function OBe(t){const e=Uq(lA,t),n=bx(e,"fontSizes","font-size"),i=bx(e,"lineHeights","line-height"),r=bx(e,"shadows","shadow"),a=bx(e,"radius","radius"),s=bx(e,"spacing","spacing"),o=Object.keys(e.headings.sizes).reduce((c,u)=>(c[u]={fontSize:`var(--mantine-${u}-font-size)`,lineHeight:`var(--mantine-${u}-line-height)`,fontWeight:`var(--mantine-${u}-font-weight)`},c),{}),l=Object.keys(e.colors).reduce((c,u)=>(c[u]={0:`var(--mantine-color-${u}-0)`,1:`var(--mantine-color-${u}-1)`,2:`var(--mantine-color-${u}-2)`,3:`var(--mantine-color-${u}-3)`,4:`var(--mantine-color-${u}-4)`,5:`var(--mantine-color-${u}-5)`,6:`var(--mantine-color-${u}-6)`,7:`var(--mantine-color-${u}-7)`,8:`var(--mantine-color-${u}-8)`,9:`var(--mantine-color-${u}-9)`,filled:`var(--mantine-color-${u}-filled)`,filledHover:`var(--mantine-color-${u}-filled-hover)`,light:`var(--mantine-color-${u}-light)`,lightHover:`var(--mantine-color-${u}-light-hover)`,lightColor:`var(--mantine-color-${u}-light-color)`,outline:`var(--mantine-color-${u}-outline)`,outlineHover:`var(--mantine-color-${u}-outline-hover)`},c),{primary:"var(--mantine-primary-color-filled)",primaryColors:{0:"var(--mantine-primary-color-0)",1:"var(--mantine-primary-color-1)",2:"var(--mantine-primary-color-2)",3:"var(--mantine-primary-color-3)",4:"var(--mantine-primary-color-4)",5:"var(--mantine-primary-color-5)",6:"var(--mantine-primary-color-6)",7:"var(--mantine-primary-color-7)",8:"var(--mantine-primary-color-8)",9:"var(--mantine-primary-color-9)",filled:"var(--mantine-primary-color-filled)",filledHover:"var(--mantine-primary-color-filled-hover)",light:"var(--mantine-primary-color-light)",lightHover:"var(--mantine-primary-color-light-hover)",lightColor:"var(--mantine-primary-color-light-color)",outline:"var(--mantine-primary-color-outline)",outlineHover:"var(--mantine-primary-color-outline-hover)"},white:"var(--mantine-color-white)",black:"var(--mantine-color-black)",text:"var(--mantine-color-text)",body:"var(--mantine-color-body)",error:"var(--mantine-color-error)",placeholder:"var(--mantine-color-placeholder)",anchor:"var(--mantine-color-anchor)",default:"var(--mantine-color-default)",defaultHover:"var(--mantine-color-default-hover)",defaultColor:"var(--mantine-color-default-color)",defaultBorder:"var(--mantine-color-default-border)",dimmed:"var(--mantine-color-dimmed)",disabledBody:"var(--mantine-color-disabled)",disabledText:"var(--mantine-color-disabled-color)",disabledBorder:"var(--mantine-color-disabled-border)"});return{scale:"var(--mantine-scale)",cursorType:"var(--mantine-cursor-type)",webkitFontSmoothing:"var(--mantine-webkit-font-smoothing)",mozFontSmoothing:"var(--mantine-moz-font-smoothing)",lineHeight:"var(--mantine-line-height)",fontFamily:"var(--mantine-font-family)",fontFamilyMonospace:"var(--mantine-font-family-monospace)",fontFamilyHeadings:"var(--mantine-font-family-headings)",headingFontWeight:"var(--mantine-heading-font-weight)",radiusDefault:"var(--mantine-radius-default)",breakpoints:e.breakpoints,fontSizes:n,lineHeights:i,shadows:r,radius:a,headings:o,spacing:s,colors:l,rtlSelector:'[dir="rtl"] &',darkSelector:'[data-mantine-color-scheme="dark"] &',lightSelector:'[data-mantine-color-scheme="light"] &',smallerThan:c=>`(max-width: ${QG(c,e)})`,largerThan:c=>`(min-width: ${QG(c,e)})`}}const xne={fontFamily:"Inter",autoContrast:!0,components:{Checkbox:vh.extend({defaultProps:{radius:"xs"}}),ColorInput:Bv.extend({defaultProps:{radius:"xs"}}),Select:jv.extend({defaultProps:{radius:"sm"}}),Textarea:SA.extend({defaultProps:{radius:"xs"}}),TextInput:hg.extend({defaultProps:{radius:"xs"}}),NumberInput:ug.extend({defaultProps:{radius:"xs"}}),Paper:Ps.extend({defaultProps:{radius:"xs",shadow:"0"}}),ActionIcon:Ol.extend({defaultProps:{variant:"subtle",color:"gray",radius:"xs"}}),Button:ks.extend({defaultProps:{radius:"xs",styles:{label:{fontWeight:450}}}})}};OBe(xne);const IBe=new Set(["CameraFrustumMessage","GlbMessage","FrameMessage","BatchedAxesMessage","GridMessage","LabelMessage","BatchedLabelsMessage","Gui3DMessage","PointCloudMessage","DirectionalLightMessage","AmbientLightMessage","HemisphereLightMessage","PointLightMessage","RectAreaLightMessage","SpotLightMessage","MeshMessage","BoxMessage","IcosphereMessage","SkinnedMeshMessage","BatchedMeshesMessage","BatchedGlbMessage","TransformControlsMessage","ImageMessage","LineSegmentsMessage","CatmullRomSplineMessage","CubicBezierSplineMessage","GaussianSplatsMessage"]);function NBe(t){return IBe.has(t.type)}const LBe=new Set(["GuiFolderMessage","GuiMarkdownMessage","GuiHtmlMessage","GuiProgressBarMessage","GuiPlotlyMessage","GuiUplotMessage","GuiImageMessage","GuiTabGroupMessage","GuiColumnsMessage","GuiButtonMessage","GuiUploadButtonMessage","GuiSliderMessage","GuiMultiSliderMessage","GuiNumberMessage","GuiRgbMessage","GuiRgbaMessage","GuiCheckboxMessage","GuiVector2Message","GuiVector3Message","GuiTextMessage","GuiDropdownMessage","GuiButtonGroupMessage"]);function PBe(t){return LBe.has(t.type)}function UBe(){const t=I.useContext(Si),e=t.mutable.current,n=t.sceneTreeActions.updateSceneNodeProps,i=t.sceneTreeActions.removeSceneNode,r=t.sceneTreeActions.addSceneNode,a=t.useGui(b=>b.setTheme),s=t.useGui(b=>b.setShareUrl),o=t.useGui(b=>b.addGui),l=t.useGui(b=>b.addModal),c=t.useGui(b=>b.removeModal),u=t.useGui(b=>b.removeGui),f=t.useGui(b=>b.updateGuiProps),h=t.useGui(b=>b.updateUploadState);function d(b){const y=t.useSceneTree.getState()[b.name],p=t.useSceneTree.getState(),x=b.name.split("/").slice(0,-1).join("/");p[x]?.message===void 0&&(d({...N4.message,name:x}),t.sceneTreeActions.updateNodeAttributes(x,{visibility:!0})),r(b),b!==y?.message&&t.sceneTreeActions.updateNodeAttributes(b.name,{poseUpdateState:"waitForMakeObject"})}const g=FBe();return b=>{if(PBe(b)){o(b);return}if(NBe(b)){if(b.type==="SkinnedMeshMessage"){e.skinnedMeshState[b.name]={initialized:!1,dirty:!1,poses:[]};const y=new Float32Array(b.props.bone_wxyzs.buffer.slice(b.props.bone_wxyzs.byteOffset,b.props.bone_wxyzs.byteOffset+b.props.bone_wxyzs.byteLength)),p=new Float32Array(b.props.bone_positions.buffer.slice(b.props.bone_positions.byteOffset,b.props.bone_positions.byteOffset+b.props.bone_positions.byteLength));for(let x=0;x<b.props.bone_wxyzs.length;x++)e.skinnedMeshState[b.name].poses.push({wxyz:[y[4*x],y[4*x+1],y[4*x+2],y[4*x+3]],position:[p[3*x],p[3*x+1],p[3*x+2]]})}d(b);return}switch(b.type){case"SceneNodeUpdateMessage":{n(b.name,b.updates);return}case"ShareUrlUpdated":{s(b.share_url);return}case"GetRenderRequestMessage":{e.getRenderRequest=b,e.getRenderRequestState="triggered";return}case"SetGuiPanelLabelMessage":{t.useGui.setState({label:b.label??""});return}case"ThemeConfigurationMessage":{a(b);return}case"RunJavascriptMessage":{new Function(b.source)();return}case"NotificationMessage":{console.log(b.uuid,b.props.loading),(b.mode==="show"?Is.show:Is.update)({id:b.uuid,title:b.props.title,message:b.props.body,withCloseButton:b.props.with_close_button,loading:b.props.loading,autoClose:b.props.auto_close_seconds===null?!1:b.props.auto_close_seconds*1e3,color:CC(b.props.color)});return}case"RemoveNotificationMessage":{Is.hide(b.uuid);return}case"ScenePointerEnableMessage":{e.scenePointerInfo.enabled=b.enable?b.event_type:!1,e.canvas.style.cursor=b.enable?"pointer":"auto";return}case"EnvironmentMapMessage":{t.useEnvironment.setState({environmentMap:b});return}case"EnableLightsMessage":{t.useEnvironment.setState({enableDefaultLights:b.enabled,enableDefaultLightsShadows:b.cast_shadow});return}case"GuiModalMessage":{l(b);return}case"GuiCloseModalMessage":{c(b.uuid);return}case"SetBoneOrientationMessage":{const y=e.skinnedMeshState;y[b.name].poses[b.bone_index].wxyz=b.wxyz,y[b.name].dirty=!0;break}case"SetBonePositionMessage":{const y=e.skinnedMeshState;y[b.name].poses[b.bone_index].position=b.position,y[b.name].dirty=!0;break}case"SetCameraLookAtMessage":{const y=e.cameraControl,p=Qf(t),x=new te(b.look_at[0],b.look_at[1],b.look_at[2]);x.applyMatrix4(p),y.setTarget(x.x,x.y,x.z,!1);return}case"SetCameraUpDirectionMessage":{const y=e.camera,p=e.cameraControl,x=Qf(t),_=new te(b.position[0],b.position[1],b.position[2]).normalize().applyQuaternion(new Xn().setFromRotationMatrix(x));y.up.set(_.x,_.y,_.z);const w=new te;p.getPosition(w),p.updateCameraUp(),p.setPosition(w.x,w.y,w.z,!1);return}case"SetCameraPositionMessage":{const y=e.cameraControl,p=new te(b.position[0],b.position[1],b.position[2]),x=Qf(t);p.applyMatrix4(x),y.setPosition(p.x,p.y,p.z);return}case"SetCameraFovMessage":{const y=e.camera;y.setFocalLength(.5*y.getFilmHeight()/Math.tan(b.fov/2)),e.sendCamera!==null&&e.sendCamera();return}case"SetCameraNearMessage":{const y=e.camera;y.near=b.near,y.updateProjectionMatrix();return}case"SetCameraFarMessage":{const y=e.camera;y.far=b.far,y.updateProjectionMatrix();return}case"SetOrientationMessage":{const y=t.useSceneTree.getState()[b.name],p=y?.poseUpdateState!=="waitForMakeObject"?"needsUpdate":y?.poseUpdateState||"needsUpdate";return{targetNode:b.name,updates:{wxyz:b.wxyz,poseUpdateState:p}}}case"SetPositionMessage":{const y=t.useSceneTree.getState()[b.name],p=y?.poseUpdateState!=="waitForMakeObject"?"needsUpdate":y?.poseUpdateState||"needsUpdate";return{targetNode:b.name,updates:{position:b.position,poseUpdateState:p}}}case"SetSceneNodeVisibilityMessage":return{targetNode:b.name,updates:{visibility:b.visible}};case"BackgroundImageMessage":{if(b.rgb_data!==null){const y=URL.createObjectURL(new Blob([b.rgb_data],{type:"image/"+b.format}));new hv().load(y,p=>{URL.revokeObjectURL(y);const x=e.backgroundMaterial.uniforms.colorMap.value;e.backgroundMaterial.uniforms.colorMap.value=p,DD(x)&&x.dispose()}),e.backgroundMaterial.uniforms.enabled.value=!0}else{const y=e.backgroundMaterial.uniforms.colorMap.value;DD(y)&&y.dispose(),e.backgroundMaterial.uniforms.enabled.value=!1}if(e.backgroundMaterial.uniforms.hasDepth.value=b.depth_data!==null,b.depth_data!==null){const y=URL.createObjectURL(new Blob([b.depth_data],{type:"image/"+b.format}));new hv().load(y,p=>{URL.revokeObjectURL(y);const x=e.backgroundMaterial?.uniforms.depthMap.value;e.backgroundMaterial.uniforms.depthMap.value=p,DD(x)&&x.dispose()})}return}case"RemoveSceneNodeMessage":{console.log("Removing scene node:",b.name);const y=t.useSceneTree.getState();if(!(b.name in y)){console.log("(OK) Skipping scene node removal for "+b.name);return}i(b.name),e.skinnedMeshState[b.name]!==void 0&&delete e.skinnedMeshState[b.name];return}case"SetSceneNodeClickableMessage":return{targetNode:b.name,updates:{clickable:b.clickable}};case"GuiUpdateMessage":{f(b.uuid,b.updates);return}case"GuiRemoveMessage":{u(b.uuid);return}case"FileTransferStartDownload":case"FileTransferPart":{g(b);return}case"FileTransferPartAck":{h({componentId:b.source_component_uuid,uploadedBytes:b.transferred_bytes,totalBytes:b.total_bytes});return}default:{console.log("Received message did not match any known types:",b);return}}}}function FBe(){const t=Ee.useRef({});return e=>{const n="download-"+e.transfer_uuid;switch(e.type){case"FileTransferStartDownload":{let s=e.size_bytes;const o=["B","K","M","G","T","P"];let l=0;for(;s>=100&&l<o.length-1;)s/=1024,l+=1;t.current[e.transfer_uuid]={metadata:e,notificationId:n,parts:[],bytesDownloaded:0,displayFilesize:`${s.toFixed(1)}${o[l]}`};break}case"FileTransferPart":{const s=t.current[e.transfer_uuid];e.part_index!=s.parts.length&&console.error("A file download message was received out of order!"),s.parts.push(e),s.bytesDownloaded+=e.content.length;break}}const i=t.current[e.transfer_uuid],r=100*i.bytesDownloaded/i.metadata.size_bytes,a=i.bytesDownloaded==i.metadata.size_bytes;if((i.bytesDownloaded==0?Is.show:Is.update)({title:(a?"Received ":"Receiving ")+`${i.metadata.filename} (${i.displayFilesize})`,message:D.jsx(hf,{size:"sm",value:r}),id:n,autoClose:a&&i.metadata.save_immediately,withCloseButton:a,loading:!a,icon:a?D.jsx(KU,{}):void 0}),a){const s=window.URL.createObjectURL(new Blob(i.parts.sort((o,l)=>o.part_index-l.part_index).map(o=>o.content),{type:i.metadata.mime_type}));if(i.metadata.save_immediately){const o=document.createElement("a");o.href=s,o.download=i.metadata.filename,o.click(),o.remove(),delete t.current[e.transfer_uuid],URL.revokeObjectURL(s)}else Is.update({id:n,title:"",message:D.jsx(D.Fragment,{children:D.jsx("a",{href:s,download:i.metadata.filename,children:D.jsx(ks,{leftSection:D.jsx(jAe,{size:14}),variant:"light",size:"sm",mt:"0.05em",style:{width:"100%"},children:`${i.metadata.filename} (${i.displayFilesize})`})})}),autoClose:!1,onClose:()=>{URL.revokeObjectURL(s),delete t.current[e.transfer_uuid]}})}}}function BBe(){const t=UBe(),e=I.useContext(Si),n=e.mutable.current,i=n.messageQueue,r=Ee.useContext(tS),a=ki(s=>s.gl);return la(()=>{if(n.getRenderRequestState==="triggered")n.getRenderRequestState="pause";else if(n.getRenderRequestState==="pause"){const s=n.getRenderRequest.position,o=n.getRenderRequest.wxyz,l=n.getRenderRequest.fov,c=n.getRenderRequest.width,u=n.getRenderRequest.height,f=Qf(e),h=new sa(yc.radToDeg(l),c/u,.01,1e3);h.position.set(...s).applyMatrix4(f),h.setRotationFromQuaternion(new Xn(o[1],o[2],o[3],o[0]).premultiply(new Xn().setFromRotationMatrix(f)).multiply(new Xn().setFromAxisAngle(new te(1,0,0),Math.PI)));const d=r.meshPropsRef.current,g=d!==null?d.sortedIndexAttribute.array.slice():null;r.updateCamera.current!==null&&r.updateCamera.current(h,c,u,!0);const b=a.getSize(new wt),y=a.getClearColor(new Ut),p=a.getClearAlpha();a.setSize(c,u),a.setClearColor(16777215),a.setClearAlpha(n.getRenderRequest.format=="image/png"?0:1),a.render(n.scene,h);const x=a.domElement,_=document.createElement("canvas");_.width=c,_.height=u,_.getContext("2d").drawImage(x,0,0,c,u),a.setSize(b.x,b.y),a.setClearColor(y),a.setClearAlpha(p),g!==null&&d!==null&&(d.sortedIndexAttribute.array=g,d.sortedIndexAttribute.needsUpdate=!0),n.getRenderRequestState="in_progress",_.toBlob(async M=>{n.sendMessage({type:"GetRenderResponseMessage",payload:new Uint8Array(await M.arrayBuffer())}),n.getRenderRequestState="ready"},n.getRenderRequest.format)}if(n.getRenderRequestState==="ready"){const s=i.findIndex(h=>h.type==="GetRenderRequestMessage"),o=s!==-1?s+1:i.length,c=i.splice(0,o).map(t).reduce((h,d)=>d===void 0?h:{...h,[d.targetNode]:{...h[d.targetNode],...d.updates}},{}),u=e.useSceneTree.getState(),f={};for(const[h,d]of Object.entries(c)){if(!(h in u)){console.log(`(OK) Tried to update non-existent scene node ${h}`);continue}f[h]={...u[h],...d}}e.useSceneTree.setState(f);for(const[h,d]of Object.entries(c))"visibility"in d&&e.sceneTreeActions.computeEffectiveVisibility(h)}},-1e5),null}new TextEncoder;const zBe=4096;function _ne(t,e,n){let i=e;const r=i+n,a=[];let s="";for(;i<r;){const o=t[i++];if(!(o&128))a.push(o);else if((o&224)===192){const l=t[i++]&63;a.push((o&31)<<6|l)}else if((o&240)===224){const l=t[i++]&63,c=t[i++]&63;a.push((o&31)<<12|l<<6|c)}else if((o&248)===240){const l=t[i++]&63,c=t[i++]&63,u=t[i++]&63;let f=(o&7)<<18|l<<12|c<<6|u;f>65535&&(f-=65536,a.push(f>>>10&1023|55296),f=56320|f&1023),a.push(f)}else a.push(o);a.length>=zBe&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}const jBe=new TextDecoder,HBe=200;function VBe(t,e,n){const i=t.subarray(e,e+n);return jBe.decode(i)}function GBe(t,e,n){return n>HBe?VBe(t,e,n):_ne(t,e,n)}class GE{constructor(e,n){this.type=e,this.data=n}}class gl extends Error{constructor(e){super(e);const n=Object.create(gl.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:gl.name})}}const vx=4294967295;function WBe(t,e,n){const i=Math.floor(n/4294967296),r=n;t.setUint32(e,i),t.setUint32(e+4,r)}function Sne(t,e){const n=t.getInt32(e),i=t.getUint32(e+4);return n*4294967296+i}function XBe(t,e){const n=t.getUint32(e),i=t.getUint32(e+4);return n*4294967296+i}const qBe=-1,KBe=4294967296-1,YBe=17179869184-1;function JBe({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=YBe)if(e===0&&t<=KBe){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,i=t&4294967295,r=new Uint8Array(8),a=new DataView(r.buffer);return a.setUint32(0,e<<2|n&3),a.setUint32(4,i),r}else{const n=new Uint8Array(12),i=new DataView(n.buffer);return i.setUint32(0,e),WBe(i,4,t),n}}function $Be(t){const e=t.getTime(),n=Math.floor(e/1e3),i=(e-n*1e3)*1e6,r=Math.floor(i/1e9);return{sec:n+r,nsec:i-r*1e9}}function ZBe(t){if(t instanceof Date){const e=$Be(t);return JBe(e)}else return null}function QBe(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),i=e.getUint32(4),r=(n&3)*4294967296+i,a=n>>>2;return{sec:r,nsec:a}}case 12:{const n=Sne(e,4),i=e.getUint32(0);return{sec:n,nsec:i}}default:throw new gl(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function eze(t){const e=QBe(t);return new Date(e.sec*1e3+e.nsec/1e6)}const tze={type:qBe,encode:ZBe,decode:eze};class pN{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(tze)}register({type:e,encode:n,decode:i}){if(e>=0)this.encoders[e]=n,this.decoders[e]=i;else{const r=-1-e;this.builtInEncoders[r]=n,this.builtInDecoders[r]=i}}tryToEncode(e,n){for(let i=0;i<this.builtInEncoders.length;i++){const r=this.builtInEncoders[i];if(r!=null){const a=r(e,n);if(a!=null){const s=-1-i;return new GE(s,a)}}}for(let i=0;i<this.encoders.length;i++){const r=this.encoders[i];if(r!=null){const a=r(e,n);if(a!=null){const s=i;return new GE(s,a)}}}return e instanceof GE?e:null}decode(e,n,i){const r=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return r?r(e,n,i):new GE(n,e)}}pN.defaultCodec=new pN;function nze(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function e7(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):nze(t)?new Uint8Array(t):Uint8Array.from(t)}function A8(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const ize=16,rze=16;class aze{constructor(e=ize,n=rze){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let i=0;i<this.maxKeyLength;i++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,n,i){const r=this.caches[i-1];e:for(const a of r){const s=a.bytes;for(let o=0;o<i;o++)if(s[o]!==e[n+o])continue e;return a.str}return null}store(e,n){const i=this.caches[e.length-1],r={bytes:e,str:n};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=r:i.push(r)}decode(e,n,i){const r=this.find(e,n,i);if(r!=null)return this.hit++,r;this.miss++;const a=_ne(e,n,i),s=Uint8Array.prototype.slice.call(e,n,n+i);return this.store(s,a),a}}const mN="array",x1="map_key",wne="map_value",sze=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new gl("The type of key must be string or number but "+typeof t)};class oze{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=mN,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.getUninitializedStateFromPool();n.type=x1,n.readCount=0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===mN){const i=e;i.size=0,i.array=void 0,i.position=0,i.type=void 0}if(e.type===x1||e.type===wne){const i=e;i.size=0,i.map=void 0,i.readCount=0,i.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const yx=-1,L4=new DataView(new ArrayBuffer(0)),lze=new Uint8Array(L4.buffer);try{L4.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const t7=new RangeError("Insufficient data"),cze=new aze;class tR{constructor(e){this.totalPos=0,this.pos=0,this.view=L4,this.bytes=lze,this.headByte=yx,this.stack=new oze,this.entered=!1,this.extensionCodec=e?.extensionCodec??pN.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??vx,this.maxBinLength=e?.maxBinLength??vx,this.maxArrayLength=e?.maxArrayLength??vx,this.maxMapLength=e?.maxMapLength??vx,this.maxExtLength=e?.maxExtLength??vx,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:cze,this.mapKeyConverter=e?.mapKeyConverter??sze}clone(){return new tR({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=yx,this.stack.reset()}setBuffer(e){const n=e7(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===yx&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),i=e7(e),r=new Uint8Array(n.length+i.length);r.set(n),r.set(i,n.length),this.setBuffer(r)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:i}=this;return new RangeError(`Extra ${n.byteLength-i} of ${n.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let n=!1,i;for await(const o of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{i=this.doDecodeSync(),n=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return i}const{headByte:r,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${A8(r)} at ${s} (${a} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let i=n,r=-1;for await(const a of e){if(n&&r===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),i&&(r=this.readArraySize(),i=!1,this.complete());try{for(;yield this.doDecodeSync(),--r!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){const r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{const r=e-160;n=this.decodeString(r,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){const r=this.lookU8();n=this.decodeString(r,1)}else if(e===218){const r=this.lookU16();n=this.decodeString(r,2)}else if(e===219){const r=this.lookU32();n=this.decodeString(r,4)}else if(e===220){const r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){const r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){const r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){const r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){const r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){const r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){const r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){const r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){const r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){const r=this.lookU32();n=this.decodeExtension(r,4)}else throw new gl(`Unrecognized type byte: ${A8(e)}`);this.complete();const i=this.stack;for(;i.length>0;){const r=i.top();if(r.type===mN)if(r.array[r.position]=n,r.position++,r.position===r.size)n=r.array,i.release(r);else continue e;else if(r.type===x1){if(n==="__proto__")throw new gl("The key __proto__ is not allowed");r.key=this.mapKeyConverter(n),r.type=wne;continue e}else if(r.map[r.key]=n,r.readCount++,r.readCount===r.size)n=r.map,i.release(r);else{r.key=null,r.type=x1;continue e}}return n}}readHeadByte(){return this.headByte===yx&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=yx}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new gl(`Unrecognized array type byte: ${A8(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new gl(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new gl(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){if(e>this.maxStrLength)throw new gl(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw t7;const i=this.pos+n;let r;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?r=this.keyDecoder.decode(this.bytes,i,e):r=GBe(this.bytes,i,e),this.pos+=n+e,r}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===x1:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new gl(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw t7;const i=this.pos+n,r=this.bytes.subarray(i,i+e);return this.pos+=n+e,r}decodeExtension(e,n){if(e>this.maxExtLength)throw new gl(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const i=this.view.getInt8(this.pos+n),r=this.decodeBinary(e,n+1);return this.extensionCodec.decode(r,i,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=XBe(this.view,this.pos);return this.pos+=8,e}readI64(){const e=Sne(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function uze(t,e){return new tR(e).decode(t)}function fze(t){return t[Symbol.asyncIterator]!=null}async function*hze(t){const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)return;yield i}}finally{e.releaseLock()}}function dze(t){return fze(t)?t:hze(t)}async function pze(t,e){const n=dze(t);return new tR(e).decodeAsync(n)}var n7={},mze=function(t,e,n,i,r){var a=new Worker(n7[e]||(n7[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(s){var o=s.data,l=o.$e$;if(l){var c=new Error(l[0]);c.code=l[1],c.stack=l[2],r(c,null)}else r(null,o)},a.postMessage(n,i),a},Eo=Uint8Array,Sm=Uint16Array,Ene=Int32Array,P4=new Eo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),U4=new Eo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Mne=new Eo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tne=function(t,e){for(var n=new Sm(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];for(var r=new Ene(n[30]),i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return{b:n,r}},Ane=Tne(P4,2),F4=Ane.b,gze=Ane.r;F4[28]=258,gze[258]=28;var bze=Tne(U4,0),Cne=bze.b,LT=new Sm(32768);for(var Vr=0;Vr<32768;++Vr){var rd=(Vr&43690)>>1|(Vr&21845)<<1;rd=(rd&52428)>>2|(rd&13107)<<2,rd=(rd&61680)>>4|(rd&3855)<<4,LT[Vr]=((rd&65280)>>8|(rd&255)<<8)>>1}var N0=function(t,e,n){for(var i=t.length,r=0,a=new Sm(e);r<i;++r)t[r]&&++a[t[r]-1];var s=new Sm(e);for(r=1;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;var o;if(n){o=new Sm(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=s[t[r]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)o[LT[f]>>l]=c}else for(o=new Sm(i),r=0;r<i;++r)t[r]&&(o[r]=LT[s[t[r]-1]++]>>15-t[r]);return o},uS=new Eo(288);for(var Vr=0;Vr<144;++Vr)uS[Vr]=8;for(var Vr=144;Vr<256;++Vr)uS[Vr]=9;for(var Vr=256;Vr<280;++Vr)uS[Vr]=7;for(var Vr=280;Vr<288;++Vr)uS[Vr]=8;var Rne=new Eo(32);for(var Vr=0;Vr<32;++Vr)Rne[Vr]=5;var kne=N0(uS,9,1),Dne=N0(Rne,5,1),CM=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},ec=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&n},RM=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},One=function(t){return(t+7)/8|0},Ine=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Eo(t.subarray(e,n))},Nne=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ns=function(t,e,n){var i=new Error(e||Nne[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,ns),!n)throw i;return i},nR=function(t,e,n,i){var r=t.length,a=i?i.length:0;if(!r||e.f&&!e.l)return n||new Eo(0);var s=!n,o=s||e.i!=2,l=e.i;s&&(n=new Eo(r*3));var c=function(je){var He=n.length;if(je>He){var pe=new Eo(Math.max(He*2,je));pe.set(n),n=pe}},u=e.f||0,f=e.p||0,h=e.b||0,d=e.l,g=e.d,b=e.m,y=e.n,p=r*8;do{if(!d){u=ec(t,f,1);var x=ec(t,f+1,3);if(f+=3,x)if(x==1)d=kne,g=Dne,b=9,y=5;else if(x==2){var S=ec(t,f,31)+257,A=ec(t,f+10,15)+4,C=S+ec(t,f+5,31)+1;f+=14;for(var k=new Eo(C),R=new Eo(19),N=0;N<A;++N)R[Mne[N]]=ec(t,f+N*3,7);f+=A*3;for(var P=CM(R),j=(1<<P)-1,z=N0(R,P,1),N=0;N<C;){var X=z[ec(t,f,j)];f+=X&15;var _=X>>4;if(_<16)k[N++]=_;else{var F=0,H=0;for(_==16?(H=3+ec(t,f,3),f+=2,F=k[N-1]):_==17?(H=3+ec(t,f,7),f+=3):_==18&&(H=11+ec(t,f,127),f+=7);H--;)k[N++]=F}}var V=k.subarray(0,S),W=k.subarray(S);b=CM(V),y=CM(W),d=N0(V,b,1),g=N0(W,y,1)}else ns(1);else{var _=One(f)+4,w=t[_-4]|t[_-3]<<8,M=_+w;if(M>r){l&&ns(0);break}o&&c(h+w),n.set(t.subarray(_,M),h),e.b=h+=w,e.p=f=M*8,e.f=u;continue}if(f>p){l&&ns(0);break}}o&&c(h+131072);for(var B=(1<<b)-1,Y=(1<<y)-1,Z=f;;Z=f){var F=d[RM(t,f)&B],G=F>>4;if(f+=F&15,f>p){l&&ns(0);break}if(F||ns(2),G<256)n[h++]=G;else if(G==256){Z=f,d=null;break}else{var de=G-254;if(G>264){var N=G-257,oe=P4[N];de=ec(t,f,(1<<oe)-1)+F4[N],f+=oe}var le=g[RM(t,f)&Y],ue=le>>4;le||ns(3),f+=le&15;var W=Cne[ue];if(ue>3){var oe=U4[ue];W+=RM(t,f)&(1<<oe)-1,f+=oe}if(f>p){l&&ns(0);break}o&&c(h+131072);var Se=h+de;if(h<W){var Te=a-W,Pe=Math.min(W,Se);for(Te+h<0&&ns(3);h<Pe;++h)n[h]=i[Te+h]}for(;h<Se;++h)n[h]=n[h-W]}}e.l=d,e.p=Z,e.b=h,e.f=u,d&&(u=1,e.m=b,e.d=g,e.n=y)}while(!u);return h!=n.length&&s?Ine(n,0,h):n.subarray(0,h)},vze=new Eo(0),yze=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},i7=function(t,e,n){for(var i=t(),r=t.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<i.length;++s){var o=i[s],l=a[s];if(typeof o=="function"){e+=";"+l+"=";var c=o.toString();if(o.prototype)if(c.indexOf("[native code]")!=-1){var u=c.indexOf(" ",8)+1;e+=c.slice(u,c.indexOf("(",u))}else{e+=c;for(var f in o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString()}else e+=c}else n[l]=o}return e},WE=[],xze=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},_ze=function(t,e,n,i){if(!WE[n]){for(var r="",a={},s=t.length-1,o=0;o<s;++o)r=i7(t[o],r,a);WE[n]={c:i7(t[s],r,a),e:a}}var l=yze({},WE[n].e);return mze(WE[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,l,xze(l),i)},B4=function(){return[Eo,Sm,Ene,P4,U4,Mne,F4,Cne,kne,Dne,LT,Nne,N0,CM,ec,RM,One,Ine,ns,nR,Fne,iR,z4]},Sze=function(){return[Lne,Pne]},wze=function(){return[Une]},iR=function(t){return postMessage(t,[t.buffer])},z4=function(t){return t&&{out:t.size&&new Eo(t.size),dictionary:t.dictionary}},j4=function(t,e,n,i,r,a){var s=_ze(n,i,r,function(o,l){s.terminate(),a(o,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},Lne=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&ns(6,"invalid gzip data");var e=t[3],n=10;e&4&&(n+=(t[10]|t[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(e&2)},Pne=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Une=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&ns(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&ns(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function Eze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ns(7),j4(t,e,[B4],function(i){return iR(Fne(i.data[0],z4(i.data[1])))},1,n)}function Fne(t,e){return nR(t,{i:2},e&&e.out,e&&e.dictionary)}function Mze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ns(7),j4(t,e,[B4,Sze,function(){return[r7]}],function(i){return iR(r7(i.data[0],i.data[1]))},3,n)}function r7(t,e){var n=Lne(t);return n+8>t.length&&ns(6,"invalid gzip data"),nR(t.subarray(n,-8),{i:2},e&&e.out||new Eo(Pne(t)),e&&e.dictionary)}function Tze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ns(7),j4(t,e,[B4,wze,function(){return[a7]}],function(i){return iR(a7(i.data[0],z4(i.data[1])))},5,n)}function a7(t,e){return nR(t.subarray(Une(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function Aze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ns(7),t[0]==31&&t[1]==139&&t[2]==8?Mze(t,e,n):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?Eze(t,e,n):Tze(t,e,n)}var Cze=typeof TextDecoder<"u"&&new TextDecoder,Rze=0;try{Cze.decode(vze,{stream:!0}),Rze=1}catch{}async function kze(t,e){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch the file: ${n.statusText}`);return new Promise(i=>{const r=parseInt(n.headers.get("Content-Length"));if(typeof DecompressionStream>"u")console.log("DecompressionStream is unavailable. Using fallback."),e({downloaded:.1*r,total:r}),n.arrayBuffer().then(a=>{e({downloaded:.8*r,total:r}),Aze(new Uint8Array(a),(s,o)=>{e({downloaded:1*r,total:r}),i(uze(o))})});else{let a=0;const s=new TransformStream({transform(o,l){a+=o.length,e({downloaded:a,total:r}),l.enqueue(o)}});pze(n.body.pipeThrough(s).pipeThrough(new DecompressionStream("gzip"))).then(o=>i(o))}})}function Dze({fileUrl:t}){const e=I.useContext(Si),n=e.mutable.current,i=e.useGui(_=>_.theme.dark_mode),[r,a]=I.useState({downloaded:0,total:0}),[s,o]=I.useState("1x"),[l,c]=I.useState(!1),[u,f]=I.useState(null);function h(){const _=e.useSceneTree.getState();Object.keys(_).forEach(w=>{if(w==="")return;const M=_[w],S=M?.message;S!==void 0&&(S.type!=="FrameMessage"||S.props.show_axes)?e.sceneTreeActions.updateNodeAttributes(w,{visibility:!1,wxyz:[1,0,0,0],position:[0,0,0]}):M!==void 0&&e.sceneTreeActions.updateNodeAttributes(w,{wxyz:[1,0,0,0],position:[0,0,0]})})}const[d,g]=I.useState(0),b=ba();I.useEffect(()=>{kze(t,a).then(_=>{console.log("File loaded! Saved with Viser version:",_.viserVersion),f(_)})},[]);const y=I.useRef({currentTime:0,currentIndex:0}),p=I.useCallback(()=>{if(u===null)return;const _=y.current;for(_.currentIndex==0&&h();_.currentIndex<u.messages.length&&u.messages[_.currentIndex][0]<=_.currentTime;_.currentIndex++){const w=u.messages[_.currentIndex][1];n.messageQueue.push(w)}_.currentTime>=u.durationSeconds&&(_.currentIndex=0,_.currentTime=u.messages[0][0]),g(_.currentTime)},[u]);I.useEffect(()=>{const _=parseFloat(s);if(u!==null&&!l){let w=Date.now();const M=setInterval(()=>{const S=Date.now();y.current.currentTime+=(S-w)/1e3*_,w=S,p(),y.current.currentIndex===u.messages.length&&u.durationSeconds===0&&clearInterval(M)},1e3/120);return()=>clearInterval(M)}},[p,u,l,s,n.messageQueue,g]),I.useEffect(()=>{function _(w){w.code==="Space"&&c(!l)}return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[l]);const x=I.useCallback(_=>{_<y.current.currentTime&&(h(),y.current.currentIndex=0),y.current.currentTime=_,g(_),c(!0),p()},[u]);return u===null?D.jsx("div",{style:{position:"fixed",zIndex:1,top:0,bottom:0,left:0,right:0,backgroundColor:i?b.colors.dark[9]:"#fff"},children:D.jsx(hf,{value:r.downloaded/r.total*100,radius:0,transitionDuration:0})}):D.jsxs(Ps,{radius:"xs",shadow:"0.1em 0 1em 0 rgba(0,0,0,0.1)",style:{position:"fixed",bottom:"1em",left:"50%",transform:"translateX(-50%)",width:"25em",maxWidth:"95%",zIndex:1,padding:"0.5em",display:u.durationSeconds===0?"none":"flex",alignItems:"center",justifyContent:"space-between",gap:"0.375em"},children:[D.jsx(Ol,{size:"md",variant:"subtle",onClick:()=>c(!l),children:l?D.jsx(vCe,{height:"1.125em",width:"1.125em"}):D.jsx(gCe,{height:"1.125em",width:"1.125em"})}),D.jsx(ug,{size:"xs",hideControls:!0,value:d.toFixed(1),step:.01,styles:{wrapper:{width:"3.1em"},input:{padding:"0.2em",fontFamily:b.fontFamilyMonospace,textAlign:"center"}},onChange:_=>x(typeof _=="number"?_:parseFloat(_))}),D.jsx(LA,{thumbSize:0,radius:"xs",step:1e-4,style:{flexGrow:1},min:0,max:u.durationSeconds,value:d,onChange:x,styles:{thumb:{display:"none"}}}),D.jsx(Pr,{zIndex:10,label:"Playback speed",withinPortal:!0,children:D.jsx(jv,{size:"xs",value:s,onChange:_=>_===null?null:o(_),radius:"xs",data:["0.5x","1x","2x","4x","8x"],styles:{wrapper:{width:"3.25em"}},comboboxProps:{zIndex:5,width:"5.25em"}})})]})}var s7=function(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,a;i<r;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))},Oze=function(){function t(e,n,i){this.name=e,this.version=n,this.os=i,this.type="browser"}return t}(),Ize=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Nze=function(){function t(e,n,i,r){this.name=e,this.version=n,this.os=i,this.bot=r,this.type="bot-device"}return t}(),Lze=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Pze=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Uze=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Fze=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,o7=3,Bze=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Uze]],l7=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function zze(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Pze:typeof navigator<"u"?Hze(navigator.userAgent):Gze()}function jze(t){return t!==""&&Bze.reduce(function(e,n){var i=n[0],r=n[1];if(e)return e;var a=r.exec(t);return!!a&&[i,a]},!1)}function Hze(t){var e=jze(t);if(!e)return null;var n=e[0],i=e[1];if(n==="searchbot")return new Lze;var r=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);r?r.length<o7&&(r=s7(s7([],r,!0),Wze(o7-r.length),!0)):r=[];var a=r.join("."),s=Vze(t),o=Fze.exec(t);return o&&o[1]?new Nze(n,a,s,o[1]):new Oze(n,a,s)}function Vze(t){for(var e=0,n=l7.length;e<n;e++){var i=l7[e],r=i[0],a=i[1],s=a.exec(t);if(s)return r}return null}function Gze(){var t=typeof process<"u"&&process.version;return t?new Ize(process.version.slice(1)):null}function Wze(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}function Xze(){return I.useEffect(()=>{const t=zze();if(t===null||t.version===null)console.log("Failed to detect browser"),Is.show({title:"Could not detect browser version",message:"Your browser version could not be detected. It may not be supported.",autoClose:!1,color:"red"});else{const e=parseFloat(t.version);console.log(`Detected ${t.name} version ${e}`),(t.name==="chrome"&&e<91||t.name==="edge"&&e<91||t.name==="firefox"&&e<89||t.name==="opera"&&e<77||t.name==="safari"&&e<16.4)&&Is.show({title:"Unsuppported browser",message:`Your browser (${t.name.slice(0,1).toUpperCase()+t.name.slice(1)}/${t.version}) is outdated, which may cause problems. Consider updating.`,autoClose:!1,color:"red"})}}),null}function c7({children:t,title:e,width:n,height:i,fill:r=!1}){return D.jsxs("div",{style:{width:r?"100vw":`${n}px`,height:r?"100vh":`${i}px`,borderRadius:"10px",overflow:"hidden",border:"1px solid rgba(0,0,0,0.2)",backgroundColor:"white",transform:"translateX(-50%) translateY(-50%)",top:"50%",left:"50%",position:"absolute"},children:[D.jsxs("div",{style:{height:"36px",backgroundColor:"#f6f6f6",borderBottom:"1px solid rgba(0,0,0,0.075)",display:"flex",alignItems:"center",paddingLeft:"12px",gap:"8px"},children:[D.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:"#ff5f57"}}),D.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:"#febc2e"}}),D.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:"#28c840"}}),D.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",color:"#000",opacity:.4,fontSize:"14px",fontFamily:"-apple-system, BlinkMacSystemFont, sans-serif",fontWeight:500},children:e})]}),D.jsx("div",{style:{height:"calc(100% - 36px)"},children:t})]})}const qze="1.0.18",u7=[{login:"brentyi",html_url:"https://github.com/brentyi"},{login:"chungmin99",html_url:"https://github.com/chungmin99"},{login:"kerrj",html_url:"https://github.com/kerrj"},{login:"tancik",html_url:"https://github.com/tancik"},{login:"jonahbedouch",html_url:"https://github.com/jonahbedouch"},{login:"hangg7",html_url:"https://github.com/hangg7"},{login:"BrianSantoso",html_url:"https://github.com/BrianSantoso"},{login:"origamiman72",html_url:"https://github.com/origamiman72"},{login:"ginazhouhuiwu",html_url:"https://github.com/ginazhouhuiwu"},{login:"sea-bass",html_url:"https://github.com/sea-bass"},{login:"jkulhanek",html_url:"https://github.com/jkulhanek"},{login:"ethanweber",html_url:"https://github.com/ethanweber"},{login:"zerolover",html_url:"https://github.com/zerolover"},{login:"beckyfeng08",html_url:"https://github.com/beckyfeng08"},{login:"vye16",html_url:"https://github.com/vye16"},{login:"AdamRashid96",html_url:"https://github.com/AdamRashid96"},{login:"slecleach",html_url:"https://github.com/slecleach"},{login:"pritzza",html_url:"https://github.com/pritzza"},{login:"yzslab",html_url:"https://github.com/yzslab"},{login:"kikislater",html_url:"https://github.com/kikislater"},{login:"simonbethke",html_url:"https://github.com/simonbethke"},{login:"swnakamura",html_url:"https://github.com/swnakamura"},{login:"rowoflo",html_url:"https://github.com/rowoflo"},{login:"MosesEbere",html_url:"https://github.com/MosesEbere"},{login:"nlml",html_url:"https://github.com/nlml"},{login:"kdexd",html_url:"https://github.com/kdexd"},{login:"ojh6404",html_url:"https://github.com/ojh6404"},{login:"hongsukchoi",html_url:"https://github.com/hongsukchoi"},{login:"mcallisterdavid",html_url:"https://github.com/mcallisterdavid"},{login:"david-dorf",html_url:"https://github.com/david-dorf"},{login:"cvachha",html_url:"https://github.com/cvachha"},{login:"ArthurAllshire",html_url:"https://github.com/ArthurAllshire"},{login:"escontra",html_url:"https://github.com/escontra"},{login:"alberthli",html_url:"https://github.com/alberthli"},{login:"atonderski",html_url:"https://github.com/atonderski"}],Kze=({children:t})=>{const e=Ee.useContext(Si),[n,i]=Ee.useState(null),r=Ee.useRef(new Map),a=Ee.useRef(new Map),s=Ee.useRef(new Set),[o,l]=Ee.useState(new Set),c=Ee.useRef(new Map),u=Ee.useRef(new Set),f=Ee.useRef(0),h=Ee.useMemo(()=>new Xn,[]),d=Ee.useMemo(()=>new Xn,[]),g=Ee.useMemo(()=>new tp,[]),b=Ee.useMemo(()=>new Dt,[]),y=Ee.useMemo(()=>new te,[]),p=Ee.useMemo(()=>new te,[]),x=Ee.useMemo(()=>new te,[]),_=Ee.useMemo(()=>new Il(1,1),[]);Ee.useEffect(()=>{const N=new xl;return i(N),()=>{r.current.forEach(P=>{N.remove(P),P.dispose()})}},[]);const w=Ee.useCallback((N,P,j,z,X,F,H,V)=>{if(!n)return;let W=r.current.get(j);W||(W=new UU,W.renderOrder=1e4,r.current.set(j,W),n.add(W)),W.add(N),u.current.add(W);const B=P.split("/").slice(0,-1).join("/"),Y=`bg-${j}-${f.current++}`;c.current.set(Y,Ee.createRef()),l(G=>new Set([...G,Y]));const Z=MI(z,X,F);a.current.set(N,{nodeName:P,parentName:B,depthTest:j,batchedText:W,backgroundInstanceId:Y,backgroundDepthTest:j,fontSizeMode:z,fontScreenScale:X,fontSceneHeight:F,baseFontSize:Z,anchorX:H,anchorY:V})},[n]),M=Ee.useCallback(N=>{const P=a.current.get(N);P&&(P.batchedText.remove(N),u.current.add(P.batchedText),c.current.delete(P.backgroundInstanceId),l(j=>{const z=new Set(j);return z.delete(P.backgroundInstanceId),z}),a.current.delete(N))},[]),S=Ee.useCallback(()=>{r.current.forEach(N=>{u.current.add(N)})},[]),A=Ee.useCallback(N=>{const P=a.current.get(N);P&&u.current.add(P.batchedText)},[]),C=Ee.useCallback((N,P,j,z,X,F,H)=>{const V=a.current.get(N);if(!V)return;if(V.depthTest!==P){const B=V.nodeName;M(N),w(N,B,P,j,z,X,F,H);return}const W=MI(j,z,X);V.fontSizeMode=j,V.fontScreenScale=z,V.fontSceneHeight=X,V.baseFontSize=W,V.anchorX=F,V.anchorY=H,N.anchorX=F,N.anchorY=H,u.current.add(V.batchedText)},[w,M]),k=Ee.useMemo(()=>({registerText:w,unregisterText:M,updateText:C,syncBatchedText:S,syncText:A}),[w,M,C,S,A]);la(({camera:N})=>{n&&(u.current.forEach(P=>{P.sync()}),u.current.clear(),b.multiplyMatrices(N.projectionMatrix,N.matrixWorldInverse),g.setFromProjectionMatrix(b),OTe(n,N,h,d),r.current.forEach((P,j)=>{s.current.has(P)||DTe(P,j)&&s.current.add(P)}),a.current.forEach((P,j)=>{try{const z=e.mutable.current.nodeRefFromName[P.parentName],X=e.useSceneTree.getState()[P.nodeName];if(z&&X){const F=j.position;F.set(...X.position??[0,0,0]),F.applyMatrix4(z.matrixWorld);const H=X.effectiveVisibility??!1;H?j.fillOpacity=1:j.fillOpacity=0;let V=V6,W=G6;if(P.fontSizeMode==="screen"){p.copy(j.position),p.applyMatrix4(n.matrixWorld);const Y=ITe(N,p,x);j.fontSize=P.baseFontSize*Y,V=V6*Y*P.fontScreenScale,W=G6*Y*P.fontScreenScale}else j.fontSize=P.baseFontSize;const B=c.current.get(P.backgroundInstanceId);if(B?.current){const Y=B.current;if(H&&j.textRenderInfo){const Z=j.textRenderInfo.blockBounds,G=j.textRenderInfo.visibleBounds;if(Z&&G){const[de,oe,le,ue]=Z,[Se,Te,Pe,je]=G,He=Pe-Se,pe=je-Te,ze=He+V,Ie=pe+W,Xe=Se-V/2,we=Pe+V/2,Ae=Te-W/2,Re=je+W/2;let Ne=0;P.anchorX==="left"?Ne=de:P.anchorX==="right"?Ne=le:Ne=(de+le)/2;let Fe=0;P.anchorY==="top"?Fe=ue:P.anchorY==="bottom"?Fe=oe:Fe=(oe+ue)/2;const Qe=(Xe+we)/2,ae=(Ae+Re)/2,K=Qe-Ne,ce=ae-Fe;y.set(K,ce,0),y.applyQuaternion(d),Y.position.copy(j.position),Y.position.add(y),Y.scale.set(ze,Ie,1),Y.quaternion.copy(d)}}else Y.scale.set(0,0,0)}}else{j.fillOpacity=0;const F=c.current.get(P.backgroundInstanceId);F?.current&&F.current.scale.set(0,0,0)}j.quaternion.copy(d)}catch(z){console.error("[BatchedLabelManager] Error updating text:",z)}}))});const R=Ee.useMemo(()=>{const N=new Map;return N.set(!0,[]),N.set(!1,[]),o.forEach(P=>{const j=P.startsWith("bg-true"),z=N.get(j);z&&z.push(P)}),N},[o]);return D.jsxs(bQ.Provider,{value:k,children:[n&&D.jsx("primitive",{object:n}),D.jsxs(fT,{frustumCulled:!1,children:[D.jsx("primitive",{object:_,attach:"geometry"}),D.jsx("meshBasicMaterial",{color:j6,transparent:!0,opacity:H6,depthTest:!0,depthWrite:!1,toneMapped:!1}),R.get(!0)?.map(N=>{const P=c.current.get(N);return D.jsx(cc,{ref:P,renderOrder:1e4},N)})]}),D.jsxs(fT,{frustumCulled:!1,renderOrder:9999,children:[D.jsx("primitive",{object:_,attach:"geometry"}),D.jsx("meshBasicMaterial",{color:j6,transparent:!0,opacity:H6,depthTest:!1,depthWrite:!1,toneMapped:!1}),R.get(!1)?.map(N=>{const P=c.current.get(N);return D.jsx(cc,{ref:P},N)})]}),t]})},Yze=1;function gN(t,e){const n=t.mutable.current.viewportMetrics;if(n.width<=0||n.height<=0)return null;const i=new wt;return i.x=2*((e[0]+.5)/n.width)-1,i.y=1-2*((e[1]+.5)/n.height),i.x<1&&i.x>-1&&i.y<1&&i.y>-1?i:null}function bN(t,e){const n=t.mutable.current.viewportMetrics,i=new wt;return n.width<=0||n.height<=0?(i.set(0,0),i):(i.x=(e[0]+.5)/n.width,i.y=(e[1]+.5)/n.height,i)}const Jze=()=>{let t=window.location.href;return t=t.replace("http://","ws://"),t=t.replace("https://","wss://"),t=t.split("?")[0],t.endsWith("/")&&(t=t.slice(0,-1)),t},$ze=()=>la(()=>null,1e3);function Zze(){I.useEffect(()=>{const s=document.getElementById("root");if(!s)return;const o=s.style.transform,l=s.style.transformOrigin,c=s.style.width,u=Yze,f=`${1/u*100}%`;return s.style.transform=`scale(${u})`,s.style.transformOrigin="top left",s.style.width=f,()=>{s.style.transform=o,s.style.transformOrigin=l,s.style.width=c}},[]);const t=new URLSearchParams(window.location.search),e=t.get("dummyWindowDimensions"),n=t.get("dummyWindowTitle")??"localhost:8080",i=D.jsx("div",{style:{width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},children:D.jsx(Qze,{})});if(!e)return i;if(e==="fill")return D.jsx(c7,{title:n,width:window.innerWidth,height:window.innerHeight,fill:!0,children:i});const[r,a]=e.split("x").map(Number);return isNaN(r)||isNaN(a)?i:D.jsx(c7,{title:n,width:r,height:a,children:i})}function Qze(){const t=new URLSearchParams(window.location.search).getAll(AM),e=t.length>=1?t[0]:Jze(),n=new URLSearchParams(window.location.search),i=n.get("playbackPath"),r=n.get("darkMode")!==null,a=i===null?"websocket":"file_playback",s={},o=Ee.useRef({sendMessage:i==null?h=>console.log(`Tried to send ${h.type} but websocket is not connected!`):()=>null,sendCamera:null,resetCameraView:null,canvas:null,canvas2d:null,scene:null,camera:null,backgroundMaterial:null,cameraControl:null,viewportMetrics:WU,nodeRefFromName:s,messageQueue:[],getRenderRequestState:"ready",getRenderRequest:null,scenePointerInfo:{enabled:!1,dragStart:[0,0],dragEnd:[0,0],isDragging:!1},skinnedMeshState:{},hoveredElementsCount:0}),l=RBe(o.current.nodeRefFromName),c=kBe(),u=DBe(),f={messageSource:a,useSceneTree:l.store,sceneTreeActions:l.actions,useEnvironment:c,useGui:bBe(e),useDevSettings:u,mutable:o};return r&&(f.useGui.getState().theme.dark_mode=r),D.jsx(Si.Provider,{value:f,children:D.jsxs(eje,{children:[a==="websocket"&&D.jsx(xBe,{}),a==="file_playback"&&D.jsx(Dze,{fileUrl:i})]})})}function eje({children:t}){const e=Ee.useContext(Si),n=e.useGui(M=>M.theme.dark_mode),i=e.useGui(M=>M.theme.colors),r=e.useGui(M=>M.theme.control_layout),a=e.useGui(M=>M.theme.show_logo),s=e.useDevSettings(M=>M.showStats),{messageSource:o}=e,l=I.useMemo(()=>({...xne,...i===null?{}:{colors:{custom:i},primaryColor:"custom"}}),[i]),c=I.useMemo(()=>D.jsx(ije,{children:D.jsx(BBe,{})}),[]),u=Ee.useMemo(()=>typeof window<"u"?window.innerWidth:1280,[]),f=r==="floating",[h,d]=Ee.useState(()=>typeof window<"u"?window.innerWidth:u);Ee.useEffect(()=>{if(typeof window>"u")return;const M=()=>{d(window.innerWidth)};return window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);const g=Number.isFinite(h)?Math.max(h,1):1280,b=Ee.useMemo(()=>{if(g<=0)return{panelWidthPx:0,canvasWidthPx:0,panelRatio:0};const M=T4e+1,S=Math.max(M-1,0),A=MM*Math.max(M-1,0),C=$I*ZI+EM*S+A,k=u8*g,R=Math.max(g-k,0);let N=w4e*g;N=Math.min(Math.max(N,k),g);let P=Math.max(g-N,0);if(P<C){const F=C-P,H=Math.min(F,Math.max(N-k,0));H>0&&(N-=H,P+=H),P=Math.max(g-N,0)}P=Math.min(P,R),P<0&&(P=0);const j=Math.max(g-P,k),z=Math.max(Math.min(g-j,R),0),X=g>0?Math.min(Math.max(z/g,0),1):0;return{panelWidthPx:z,canvasWidthPx:j,panelRatio:X}},[g]),y=b.panelWidthPx,p=b.canvasWidthPx,x=b.panelRatio,_=`${Math.round(y)}px`,w=`${Math.round(p)}px`;return D.jsx(D.Fragment,{children:D.jsxs(jq,{theme:l,defaultColorScheme:n?"dark":"light",colorSchemeManager:{get:M=>M,set:()=>null,subscribe:()=>null,unsubscribe:()=>null,clear:()=>null},children:[t,D.jsx(tje,{darkMode:n}),D.jsx(nje,{}),D.jsx(Xze,{}),D.jsx(TBe,{}),D.jsxs(st,{style:{width:"100%",height:"100%",display:"flex",position:"relative",flexDirection:"column"},children:[D.jsx(MBe,{}),D.jsxs(st,{style:f?{width:"100%",position:"relative",flexGrow:1,overflow:"hidden",display:"flex"}:{width:"100%",position:"relative",flexGrow:1,overflow:"hidden",display:"flex",flexDirection:"row",alignItems:"stretch"},children:[D.jsxs(st,{style:M=>({backgroundColor:n?M.colors.dark[9]:"#fff",overflow:"hidden",height:"100%",position:"relative",display:"flex",flexDirection:"column",...f?{flexGrow:1,minWidth:0}:{flex:`0 0 ${w}`,width:w,minWidth:w,maxWidth:w}}),children:[c,a&&o==="websocket"&&D.jsx(uje,{})]}),o==="websocket"&&(f?D.jsx(WG,{control_layout:r,minCanvasRatio:u8}):D.jsx(st,{style:{flex:`0 0 ${_}`,width:_,minWidth:_,maxWidth:_,height:"100%",display:"flex",justifyContent:"stretch"},children:D.jsx(WG,{control_layout:r,minCanvasRatio:u8,forcedPanelRatio:x})}))]})]}),s&&D.jsx(U2e,{className:"stats-panel"})]})})}function tje(t){const e=Vd();return I.useEffect(()=>{e.setColorScheme(t.darkMode?"dark":"light")},[t.darkMode]),null}function nje(){return D.jsx(Mh,{position:"top-left",limit:10,containerWidth:"20em",withinPortal:!1,styles:{root:{boxShadow:"0.1em 0 1em 0 rgba(0,0,0,0.1) !important",position:"absolute",top:"1em",left:"1em",pointerEvents:"none"},notification:{pointerEvents:"all"}}})}function ije({children:t}){const e=Ee.useContext(Si),n=AC(20).send,i=ba(),{ref:r,inView:a}=Noe(),s=I.useRef(null),[o,l]=I.useState(null),c=I.useRef(null),u=Ee.useCallback(p=>{s.current=p,l(p),r(p)},[r]),f=I.useMemo(()=>D.jsx(CTe,{}),[]);I.useEffect(()=>{const p=new ResizeObserver(x=>{const{width:_,height:w}=x[0].contentRect,M=c.current;M&&(M.width=_,M.height=w)});return o&&p.observe(o),()=>{p.disconnect()}},[o]);const h=p=>{const{mutable:x}=e,_=x.current.scenePointerInfo;if(_.enabled===!1)return;const w=x.current.viewportMetrics;if(w.width<=0||w.height<=0)return;const M=p.clientX-w.left,S=p.clientY-w.top;if(_.dragStart=[M,S],_.dragEnd=_.dragStart,gN(e,_.dragEnd)===null||_.isDragging)return;_.isDragging=!0;const A=x.current.cameraControl;A&&(A.enabled=!1);const C=x.current.canvas2d.getContext("2d");C.clearRect(0,0,C.canvas.width,C.canvas.height)},d=p=>{const{mutable:x}=e,_=x.current.scenePointerInfo;if(_.enabled===!1||!_.isDragging)return;const w=x.current.viewportMetrics;if(w.width<=0||w.height<=0)return;const M=[p.clientX-w.left,p.clientY-w.top];if(gN(e,M)!==null&&(_.dragEnd=M,!(Math.abs(_.dragEnd[0]-_.dragStart[0])<=3&&Math.abs(_.dragEnd[1]-_.dragStart[1])<=3)&&_.enabled==="rect-select")){const S=x.current.canvas2d.getContext("2d");S.clearRect(0,0,S.canvas.width,S.canvas.height),S.beginPath(),S.fillStyle=i.primaryColor,S.strokeStyle="blue",S.globalAlpha=.2,S.fillRect(_.dragStart[0],_.dragStart[1],_.dragEnd[0]-_.dragStart[0],_.dragEnd[1]-_.dragStart[1]),S.globalAlpha=1,S.stroke()}},g=()=>{const{mutable:p}=e,x=p.current.scenePointerInfo,_=p.current.cameraControl;if(_&&(_.enabled=!0),x.enabled===!1||!x.isDragging)return;const w=p.current.canvas2d.getContext("2d");w.clearRect(0,0,w.canvas.width,w.canvas.height),x.enabled==="click"?rje(e,x.dragEnd,n):x.enabled==="rect-select"&&aje(e,x,n),x.isDragging=!1},b=e.useDevSettings(p=>p.fixedDpr),y=Ee.useMemo(()=>D.jsxs(D.Fragment,{children:[D.jsx(lje,{}),D.jsx(cje,{}),f,D.jsxs(QTe,{children:[D.jsx(oje,{}),t,D.jsx(Kze,{children:D.jsx(Gte,{name:""})})]}),D.jsx(sje,{})]}),[t,f]);return D.jsx(_Te,{targetRef:s,children:D.jsxs("div",{ref:u,style:{position:"relative",zIndex:0,width:"100%",height:"100%"},children:[D.jsx("canvas",{ref:p=>{c.current=p,e.mutable.current.canvas2d=p},style:{position:"absolute",zIndex:1,width:"100%",height:"100%",pointerEvents:"none"}}),D.jsxs(sEe,{camera:{position:[-3,3,-3],near:.01,far:1e3},gl:{preserveDrawingBuffer:!0},style:{width:"100%",height:"100%"},ref:p=>e.mutable.current.canvas=p,onPointerDown:h,onPointerMove:d,onPointerUp:g,shadows:!0,dpr:b??void 0,children:[!a&&D.jsx($ze,{}),y]})]})})}function rje(t,e,n){const i=new W_,r=gN(t,e);if(r===null)return;i.setFromCamera(r,t.mutable.current.camera);const a=mQ(t,i.ray),s=bN(t,e);n({type:"ScenePointerMessage",event_type:"click",ray_origin:[a.origin.x,a.origin.y,a.origin.z],ray_direction:[a.direction.x,a.direction.y,a.direction.z],screen_pos:[[s.x,s.y]]})}function aje(t,e,n){const i=bN(t,e.dragStart),r=bN(t,e.dragEnd),a=Math.min(i.x,r.x),s=Math.max(i.x,r.x),o=Math.min(i.y,r.y),l=Math.max(i.y,r.y);n({type:"ScenePointerMessage",event_type:"rect-select",ray_origin:null,ray_direction:null,screen_pos:[[a,o],[s,l]]})}function sje(){const t=Ee.useContext(Si),e=t.useEnvironment(s=>s.enableDefaultLights),n=t.useEnvironment(s=>s.enableDefaultLightsShadows),i=t.useEnvironment(s=>s.environmentMap),r=t.useSceneTree(s=>s[""]?.wxyz??[1,0,0,0],Q_),a=I.useMemo(()=>{if(i.hdri===null)return null;const s={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"},o=new Xn(r[1],r[2],r[3],r[0]),l=o.clone().invert(),c=new vi().setFromQuaternion(new Xn(i.background_wxyz[1],i.background_wxyz[2],i.background_wxyz[3],i.background_wxyz[0]).premultiply(o).multiply(l)),u=new vi().setFromQuaternion(new Xn(i.environment_wxyz[1],i.environment_wxyz[2],i.environment_wxyz[3],i.environment_wxyz[0]).premultiply(o).multiply(l));return D.jsx(iTe,{files:`hdri/${s[i.hdri]}`,background:i.background,backgroundBlurriness:i.background_blurriness,backgroundIntensity:i.background_intensity,backgroundRotation:c,environmentIntensity:i.environment_intensity,environmentRotation:u})},[i,r]);return e?D.jsxs(D.Fragment,{children:[D.jsx(QI,{lightIntensity:3,position:[-.2,1,-.2],cascades:3,castShadow:n}),D.jsx(QI,{lightIntensity:.4,position:[0,-1,0],castShadow:!1}),a]}):a}function oje(){const t=Ee.useContext(Si),e=ki(i=>i.setDpr);return t.useDevSettings(i=>i.fixedDpr)!==null?null:D.jsx(aTe,{factor:1,step:.2,bounds:i=>{const r=Math.min(i*.75,85);return[Math.max(r*.5,38),r]},onChange:({factor:i,fps:r,refreshrate:a})=>{const s=window.devicePixelRatio*(.2+.8*i);console.log(`[Performance] Setting DPR to ${s}; FPS=${r}/${a}`),e(s)}})}function lje(){const t=I.useMemo(()=>({vert:`
    varying vec2 vUv;
    void main() {
      vUv = uv;
      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
    }
    `,frag:`
    #include <packing>
    precision highp float;
    precision highp int;

    varying vec2 vUv;
    uniform sampler2D colorMap;
    uniform sampler2D depthMap;
    uniform float cameraNear;
    uniform float cameraFar;
    uniform bool enabled;
    uniform bool hasDepth;

    float readDepth(sampler2D depthMap, vec2 coord) {
      vec4 rgbPacked = texture(depthMap, coord);
      // Important: BGR format, because buffer was encoded using OpenCV.
      float depth = rgbPacked.b * 0.00255 + rgbPacked.g * 0.6528 + rgbPacked.r * 167.1168;
      return depth;
    }

    void main() {
      if (!enabled) {
        discard;
      }
      vec4 color = texture(colorMap, vUv);
      gl_FragColor = vec4(color.rgb, 1.0);

      float bufDepth;
      if(hasDepth){
        float depth = readDepth(depthMap, vUv);
        bufDepth = viewZToPerspectiveDepth(-depth, cameraNear, cameraFar);
      } else {
        bufDepth = 1.0;
      }
      gl_FragDepth = bufDepth;
    }
    `}),[]),e=I.useMemo(()=>new fs({fragmentShader:t.frag,vertexShader:t.vert,uniforms:{enabled:{value:!1},depthMap:{value:null},colorMap:{value:null},cameraNear:{value:null},cameraFar:{value:null},hasDepth:{value:!1}}}),[t]),{mutable:n}=Ee.useContext(Si);n.current.backgroundMaterial=e;const i=Ee.useRef(null);return la(({camera:r})=>{if(!(r instanceof sa)){console.error("Camera is not a perspective camera, cannot render background image.");return}const a=i.current,s=r.getWorldDirection(new te);a.position.copy(r.position).addScaledVector(s,1),a.quaternion.copy(r.quaternion);const o=r.getFocalLength();a.scale.set(r.getFilmWidth()/o,r.getFilmHeight()/o,1),e.uniforms.cameraNear.value=r.near,e.uniforms.cameraFar.value=r.far}),D.jsx("mesh",{ref:i,material:e,children:D.jsx("planeGeometry",{attach:"geometry",args:[1,1]})})}function cje(){const{mutable:t}=Ee.useContext(Si);return t.current.scene=ki(e=>e.scene),t.current.camera=ki(e=>e.camera),null}function uje(){const[t,{open:e,close:n}]=Ec(!1);return D.jsxs(D.Fragment,{children:[D.jsx(Pr,{label:`Viser ${qze}`,children:D.jsx(st,{style:{position:"absolute",bottom:"1em",left:"1em",cursor:"pointer"},component:"a",onClick:e,title:"About Viser",children:D.jsx(I_,{src:"./logo.svg",style:{width:"2.5em",height:"auto"}})})}),D.jsxs(Ro,{opened:t,onClose:n,withCloseButton:!1,size:"xl",style:{textAlign:"center"},trapFocus:!1,children:[D.jsx(st,{pt:"lg",pb:"xs",children:"Viser is a 3D visualization toolkit developed at UC Berkeley."}),D.jsxs(st,{pb:"lg",children:[D.jsx(Dm,{href:"https://viser.studio/main",target:"_blank",style:{fontWeight:"600"},children:"Documentation"}),"  •  ",D.jsx(Dm,{href:"https://github.com/nerfstudio-project/viser",target:"_blank",style:{fontWeight:"600"},children:"GitHub"})]}),D.jsx(cg,{}),D.jsxs(st,{style:{textAlign:"left",maxHeight:"120px",overflowY:"auto",lineHeight:"1",fontSize:"0.8rem",opacity:"0.75"},px:"md",pt:"sm",children:["Thanks to our contributors!"," ",u7.map((i,r)=>D.jsxs("span",{children:[D.jsx(Dm,{href:i.html_url,target:"_blank",style:{textDecoration:"none",fontSize:"0.75rem"},children:i.login}),r<u7.length-1&&", "]},i.login))]})]})]})}fBe();Coe.createRoot(document.getElementById("root")).render(D.jsx(Zze,{}));
