ai-agent-session-center 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -16
- package/dist/client/assets/{AnalyticsView-YRASbt1m.js → AnalyticsView-DVDqblSH.js} +1 -1
- package/dist/client/assets/{Charts.module-CrwDIRs9.js → Charts.module-CQf7HQCb.js} +1 -1
- package/dist/client/assets/{CyberdromeScene-CQ0JUjR0.js → CyberdromeScene-w4bk6IXJ.js} +1 -1
- package/dist/client/assets/{HistoryView-Fz2_E2lb.js → HistoryView--XwKlCyd.js} +1 -1
- package/dist/client/assets/{ProjectBrowserView-DYnCNpma.js → ProjectBrowserView-CTN5CmBa.js} +1 -1
- package/dist/client/assets/{QueueView-Ben9YLiL.js → QueueView-Bj-e0m_U.js} +1 -1
- package/dist/client/assets/{TimelineView-CtshpaEr.js → TimelineView-CoTsTAGd.js} +1 -1
- package/dist/client/assets/index-Dgi6T0Nt.js +128 -0
- package/dist/client/assets/index-DqtLpLIs.css +1 -0
- package/dist/client/assets/{useQuery-C9Q607lk.js → useQuery-5GNo2Ewt.js} +1 -1
- package/dist/client/assets/{with-selector-DNJRp3mp.js → with-selector-DTnjuyBc.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/screenshot-dashboard.png +0 -0
- package/dist/client/screenshot-project-tab.png +0 -0
- package/package.json +1 -1
- package/static/screenshot-dashboard.png +0 -0
- package/static/screenshot-mobile-history.png +0 -0
- package/static/screenshot-mobile-home.png +0 -0
- package/static/screenshot-mobile-project.png +0 -0
- package/static/screenshot-mobile-terminal.png +0 -0
- package/static/screenshot-project-tab.png +0 -0
- package/dist/client/assets/index-B1iUo-kL.js +0 -122
- package/dist/client/assets/index-C5tAimN4.css +0 -1
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CyberdromeScene-CQ0JUjR0.js","assets/with-selector-DNJRp3mp.js","assets/HistoryView-Fz2_E2lb.js","assets/useQuery-C9Q607lk.js","assets/HistoryView-Cu23DcIM.css","assets/TimelineView-CtshpaEr.js","assets/Charts.module-CrwDIRs9.js","assets/Charts-BN9-_lNy.css","assets/AnalyticsView-YRASbt1m.js","assets/QueueView-Ben9YLiL.js","assets/QueueView-QjjiV10n.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
function zT(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(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=t(r);fetch(r.href,a)}})();var PT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function id(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var dy={exports:{}},ch={};var Xx;function FT(){if(Xx)return ch;Xx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,a){var l=null;if(a!==void 0&&(l=""+a),r.key!==void 0&&(l=""+r.key),"key"in r){a={};for(var o in r)o!=="key"&&(a[o]=r[o])}else a=r;return r=a.ref,{$$typeof:n,type:i,key:l,ref:r!==void 0?r:null,props:a}}return ch.Fragment=e,ch.jsx=t,ch.jsxs=t,ch}var Zx;function UT(){return Zx||(Zx=1,dy.exports=FT()),dy.exports}var T=UT(),fy={exports:{}},Vt={};var Jx;function jT(){if(Jx)return Vt;Jx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),m=Symbol.iterator;function g(U){return U===null||typeof U!="object"?null:(U=m&&U[m]||U["@@iterator"],typeof U=="function"?U:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,v={};function x(U,X,V){this.props=U,this.context=X,this.refs=v,this.updater=V||_}x.prototype.isReactComponent={},x.prototype.setState=function(U,X){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,X,"setState")},x.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function S(){}S.prototype=x.prototype;function b(U,X,V){this.props=U,this.context=X,this.refs=v,this.updater=V||_}var C=b.prototype=new S;C.constructor=b,w(C,x.prototype),C.isPureReactComponent=!0;var O=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function L(U,X,V){var _e=V.ref;return{$$typeof:n,type:U,key:X,ref:_e!==void 0?_e:null,props:V}}function j(U,X){return L(U.type,X,U.props)}function K(U){return typeof U=="object"&&U!==null&&U.$$typeof===n}function Y(U){var X={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(V){return X[V]})}var H=/\/+/g;function Q(U,X){return typeof U=="object"&&U!==null&&U.key!=null?Y(""+U.key):X.toString(36)}function te(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(X){U.status==="pending"&&(U.status="fulfilled",U.value=X)},function(X){U.status==="pending"&&(U.status="rejected",U.reason=X)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function $(U,X,V,_e,Ee){var Ie=typeof U;(Ie==="undefined"||Ie==="boolean")&&(U=null);var ae=!1;if(U===null)ae=!0;else switch(Ie){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(U.$$typeof){case n:case e:ae=!0;break;case p:return ae=U._init,$(ae(U._payload),X,V,_e,Ee)}}if(ae)return Ee=Ee(U),ae=_e===""?"."+Q(U,0):_e,O(Ee)?(V="",ae!=null&&(V=ae.replace(H,"$&/")+"/"),$(Ee,X,V,"",function(ye){return ye})):Ee!=null&&(K(Ee)&&(Ee=j(Ee,V+(Ee.key==null||U&&U.key===Ee.key?"":(""+Ee.key).replace(H,"$&/")+"/")+ae)),X.push(Ee)),1;ae=0;var ee=_e===""?".":_e+":";if(O(U))for(var Te=0;Te<U.length;Te++)_e=U[Te],Ie=ee+Q(_e,Te),ae+=$(_e,X,V,Ie,Ee);else if(Te=g(U),typeof Te=="function")for(U=Te.call(U),Te=0;!(_e=U.next()).done;)_e=_e.value,Ie=ee+Q(_e,Te++),ae+=$(_e,X,V,Ie,Ee);else if(Ie==="object"){if(typeof U.then=="function")return $(te(U),X,V,_e,Ee);throw X=String(U),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ae}function J(U,X,V){if(U==null)return U;var _e=[],Ee=0;return $(U,_e,"","",function(Ie){return X.call(V,Ie,Ee++)}),_e}function re(U){if(U._status===-1){var X=U._result;X=X(),X.then(function(V){(U._status===0||U._status===-1)&&(U._status=1,U._result=V)},function(V){(U._status===0||U._status===-1)&&(U._status=2,U._result=V)}),U._status===-1&&(U._status=0,U._result=X)}if(U._status===1)return U._result.default;throw U._result}var F=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},B={map:J,forEach:function(U,X,V){J(U,function(){X.apply(this,arguments)},V)},count:function(U){var X=0;return J(U,function(){X++}),X},toArray:function(U){return J(U,function(X){return X})||[]},only:function(U){if(!K(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Vt.Activity=f,Vt.Children=B,Vt.Component=x,Vt.Fragment=t,Vt.Profiler=r,Vt.PureComponent=b,Vt.StrictMode=i,Vt.Suspense=u,Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Vt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return D.H.useMemoCache(U)}},Vt.cache=function(U){return function(){return U.apply(null,arguments)}},Vt.cacheSignal=function(){return null},Vt.cloneElement=function(U,X,V){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var _e=w({},U.props),Ee=U.key;if(X!=null)for(Ie in X.key!==void 0&&(Ee=""+X.key),X)!N.call(X,Ie)||Ie==="key"||Ie==="__self"||Ie==="__source"||Ie==="ref"&&X.ref===void 0||(_e[Ie]=X[Ie]);var Ie=arguments.length-2;if(Ie===1)_e.children=V;else if(1<Ie){for(var ae=Array(Ie),ee=0;ee<Ie;ee++)ae[ee]=arguments[ee+2];_e.children=ae}return L(U.type,Ee,_e)},Vt.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:a,_context:U},U},Vt.createElement=function(U,X,V){var _e,Ee={},Ie=null;if(X!=null)for(_e in X.key!==void 0&&(Ie=""+X.key),X)N.call(X,_e)&&_e!=="key"&&_e!=="__self"&&_e!=="__source"&&(Ee[_e]=X[_e]);var ae=arguments.length-2;if(ae===1)Ee.children=V;else if(1<ae){for(var ee=Array(ae),Te=0;Te<ae;Te++)ee[Te]=arguments[Te+2];Ee.children=ee}if(U&&U.defaultProps)for(_e in ae=U.defaultProps,ae)Ee[_e]===void 0&&(Ee[_e]=ae[_e]);return L(U,Ie,Ee)},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(U){return{$$typeof:o,render:U}},Vt.isValidElement=K,Vt.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:re}},Vt.memo=function(U,X){return{$$typeof:h,type:U,compare:X===void 0?null:X}},Vt.startTransition=function(U){var X=D.T,V={};D.T=V;try{var _e=U(),Ee=D.S;Ee!==null&&Ee(V,_e),typeof _e=="object"&&_e!==null&&typeof _e.then=="function"&&_e.then(M,F)}catch(Ie){F(Ie)}finally{X!==null&&V.types!==null&&(X.types=V.types),D.T=X}},Vt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Vt.use=function(U){return D.H.use(U)},Vt.useActionState=function(U,X,V){return D.H.useActionState(U,X,V)},Vt.useCallback=function(U,X){return D.H.useCallback(U,X)},Vt.useContext=function(U){return D.H.useContext(U)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(U,X){return D.H.useDeferredValue(U,X)},Vt.useEffect=function(U,X){return D.H.useEffect(U,X)},Vt.useEffectEvent=function(U){return D.H.useEffectEvent(U)},Vt.useId=function(){return D.H.useId()},Vt.useImperativeHandle=function(U,X,V){return D.H.useImperativeHandle(U,X,V)},Vt.useInsertionEffect=function(U,X){return D.H.useInsertionEffect(U,X)},Vt.useLayoutEffect=function(U,X){return D.H.useLayoutEffect(U,X)},Vt.useMemo=function(U,X){return D.H.useMemo(U,X)},Vt.useOptimistic=function(U,X){return D.H.useOptimistic(U,X)},Vt.useReducer=function(U,X,V){return D.H.useReducer(U,X,V)},Vt.useRef=function(U){return D.H.useRef(U)},Vt.useState=function(U){return D.H.useState(U)},Vt.useSyncExternalStore=function(U,X,V){return D.H.useSyncExternalStore(U,X,V)},Vt.useTransition=function(){return D.H.useTransition()},Vt.version="19.2.4",Vt}var Qx;function R0(){return Qx||(Qx=1,fy.exports=jT()),fy.exports}var W=R0();const Oh=id(W),OW=zT({__proto__:null,default:Oh},[W]);var py={exports:{}},uh={},my={exports:{}},gy={};var eS;function HT(){return eS||(eS=1,(function(n){function e($,J){var re=$.length;$.push(J);e:for(;0<re;){var F=re-1>>>1,B=$[F];if(0<r(B,J))$[F]=J,$[re]=B,re=F;else break e}}function t($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var J=$[0],re=$.pop();if(re!==J){$[0]=re;e:for(var F=0,B=$.length,U=B>>>1;F<U;){var X=2*(F+1)-1,V=$[X],_e=X+1,Ee=$[_e];if(0>r(V,re))_e<B&&0>r(Ee,V)?($[F]=Ee,$[_e]=re,F=_e):($[F]=V,$[X]=re,F=X);else if(_e<B&&0>r(Ee,re))$[F]=Ee,$[_e]=re,F=_e;else break e}}return J}function r($,J){var re=$.sortIndex-J.sortIndex;return re!==0?re:$.id-J.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;n.unstable_now=function(){return a.now()}}else{var l=Date,o=l.now();n.unstable_now=function(){return l.now()-o}}var u=[],h=[],p=1,f=null,m=3,g=!1,_=!1,w=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function C($){for(var J=t(h);J!==null;){if(J.callback===null)i(h);else if(J.startTime<=$)i(h),J.sortIndex=J.expirationTime,e(u,J);else break;J=t(h)}}function O($){if(w=!1,C($),!_)if(t(u)!==null)_=!0,M||(M=!0,Y());else{var J=t(h);J!==null&&te(O,J.startTime-$)}}var M=!1,D=-1,N=5,L=-1;function j(){return v?!0:!(n.unstable_now()-L<N)}function K(){if(v=!1,M){var $=n.unstable_now();L=$;var J=!0;try{e:{_=!1,w&&(w=!1,S(D),D=-1),g=!0;var re=m;try{t:{for(C($),f=t(u);f!==null&&!(f.expirationTime>$&&j());){var F=f.callback;if(typeof F=="function"){f.callback=null,m=f.priorityLevel;var B=F(f.expirationTime<=$);if($=n.unstable_now(),typeof B=="function"){f.callback=B,C($),J=!0;break t}f===t(u)&&i(u),C($)}else i(u);f=t(u)}if(f!==null)J=!0;else{var U=t(h);U!==null&&te(O,U.startTime-$),J=!1}}break e}finally{f=null,m=re,g=!1}J=void 0}}finally{J?Y():M=!1}}}var Y;if(typeof b=="function")Y=function(){b(K)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Q=H.port2;H.port1.onmessage=K,Y=function(){Q.postMessage(null)}}else Y=function(){x(K,0)};function te($,J){D=x(function(){$(n.unstable_now())},J)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_next=function($){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var re=m;m=J;try{return $()}finally{m=re}},n.unstable_requestPaint=function(){v=!0},n.unstable_runWithPriority=function($,J){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var re=m;m=$;try{return J()}finally{m=re}},n.unstable_scheduleCallback=function($,J,re){var F=n.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?F+re:F):re=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=re+B,$={id:p++,callback:J,priorityLevel:$,startTime:re,expirationTime:B,sortIndex:-1},re>F?($.sortIndex=re,e(h,$),t(u)===null&&$===t(h)&&(w?(S(D),D=-1):w=!0,te(O,re-F))):($.sortIndex=B,e(u,$),_||g||(_=!0,M||(M=!0,Y()))),$},n.unstable_shouldYield=j,n.unstable_wrapCallback=function($){var J=m;return function(){var re=m;m=J;try{return $.apply(this,arguments)}finally{m=re}}}})(gy)),gy}var tS;function qT(){return tS||(tS=1,my.exports=HT()),my.exports}var yy={exports:{}},Wi={};var nS;function VT(){if(nS)return Wi;nS=1;var n=R0();function e(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function a(u,h,p){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:f==null?null:""+f,children:u,containerInfo:h,implementation:p}}var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Wi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Wi.createPortal=function(u,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return a(u,h,null,p)},Wi.flushSync=function(u){var h=l.T,p=i.p;try{if(l.T=null,i.p=2,u)return u()}finally{l.T=h,i.p=p,i.d.f()}},Wi.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(u,h))},Wi.prefetchDNS=function(u){typeof u=="string"&&i.d.D(u)},Wi.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var p=h.as,f=o(p,h.crossOrigin),m=typeof h.integrity=="string"?h.integrity:void 0,g=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?i.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:m,fetchPriority:g}):p==="script"&&i.d.X(u,{crossOrigin:f,integrity:m,fetchPriority:g,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Wi.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=o(h.as,h.crossOrigin);i.d.M(u,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(u)},Wi.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,f=o(p,h.crossOrigin);i.d.L(u,p,{crossOrigin:f,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Wi.preloadModule=function(u,h){if(typeof u=="string")if(h){var p=o(h.as,h.crossOrigin);i.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(u)},Wi.requestFormReset=function(u){i.d.r(u)},Wi.unstable_batchedUpdates=function(u,h){return u(h)},Wi.useFormState=function(u,h,p){return l.H.useFormState(u,h,p)},Wi.useFormStatus=function(){return l.H.useHostTransitionStatus()},Wi.version="19.2.4",Wi}var iS;function pE(){if(iS)return yy.exports;iS=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),yy.exports=VT(),yy.exports}var rS;function WT(){if(rS)return uh;rS=1;var n=qT(),e=R0(),t=pE();function i(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var c=s,d=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(d=c.return),s=c.return;while(s)}return c.tag===3?d:null}function l(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function o(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function u(s){if(a(s)!==s)throw Error(i(188))}function h(s){var c=s.alternate;if(!c){if(c=a(s),c===null)throw Error(i(188));return c!==s?null:s}for(var d=s,y=c;;){var A=d.return;if(A===null)break;var k=A.alternate;if(k===null){if(y=A.return,y!==null){d=y;continue}break}if(A.child===k.child){for(k=A.child;k;){if(k===d)return u(A),s;if(k===y)return u(A),c;k=k.sibling}throw Error(i(188))}if(d.return!==y.return)d=A,y=k;else{for(var P=!1,Z=A.child;Z;){if(Z===d){P=!0,d=A,y=k;break}if(Z===y){P=!0,y=A,d=k;break}Z=Z.sibling}if(!P){for(Z=k.child;Z;){if(Z===d){P=!0,d=k,y=A;break}if(Z===y){P=!0,y=k,d=A;break}Z=Z.sibling}if(!P)throw Error(i(189))}}if(d.alternate!==y)throw Error(i(190))}if(d.tag!==3)throw Error(i(188));return d.stateNode.current===d?s:c}function p(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=p(s),c!==null)return c;s=s.sibling}return null}var f=Object.assign,m=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),b=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=K&&s[K]||s["@@iterator"],typeof s=="function"?s:null)}var H=Symbol.for("react.client.reference");function Q(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===H?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case x:return"Profiler";case v:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case _:return"Portal";case b:return s.displayName||"Context";case S:return(s._context.displayName||"Context")+".Consumer";case C:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return c=s.displayName||null,c!==null?c:Q(s.type)||"Memo";case N:c=s._payload,s=s._init;try{return Q(s(c))}catch{}}return null}var te=Array.isArray,$=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},F=[],B=-1;function U(s){return{current:s}}function X(s){0>B||(s.current=F[B],F[B]=null,B--)}function V(s,c){B++,F[B]=s.current,s.current=c}var _e=U(null),Ee=U(null),Ie=U(null),ae=U(null);function ee(s,c){switch(V(Ie,c),V(Ee,s),V(_e,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?bx(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=bx(c),s=vx(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}X(_e),V(_e,s)}function Te(){X(_e),X(Ee),X(Ie)}function ye(s){s.memoizedState!==null&&V(ae,s);var c=_e.current,d=vx(c,s.type);c!==d&&(V(Ee,s),V(_e,d))}function Me(s){Ee.current===s&&(X(_e),X(Ee)),ae.current===s&&(X(ae),sh._currentValue=re)}var we,it;function De(s){if(we===void 0)try{throw Error()}catch(d){var c=d.stack.trim().match(/\n( *(at )?)/);we=c&&c[1]||"",it=-1<d.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+we+s+it}var Pe=!1;function Fe(s,c){if(!s||Pe)return"";Pe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var He=function(){throw Error()};if(Object.defineProperty(He.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(He,[])}catch(Ne){var Oe=Ne}Reflect.construct(s,[],He)}else{try{He.call()}catch(Ne){Oe=Ne}s.call(He.prototype)}}else{try{throw Error()}catch(Ne){Oe=Ne}(He=s())&&typeof He.catch=="function"&&He.catch(function(){})}}catch(Ne){if(Ne&&Oe&&typeof Ne.stack=="string")return[Ne.stack,Oe.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=y.DetermineComponentFrameRoot(),P=k[0],Z=k[1];if(P&&Z){var oe=P.split(`
|
|
5
|
-
`),ke=Z.split(`
|
|
6
|
-
`);for(A=y=0;y<oe.length&&!oe[y].includes("DetermineComponentFrameRoot");)y++;for(;A<ke.length&&!ke[A].includes("DetermineComponentFrameRoot");)A++;if(y===oe.length||A===ke.length)for(y=oe.length-1,A=ke.length-1;1<=y&&0<=A&&oe[y]!==ke[A];)A--;for(;1<=y&&0<=A;y--,A--)if(oe[y]!==ke[A]){if(y!==1||A!==1)do if(y--,A--,0>A||oe[y]!==ke[A]){var Be=`
|
|
7
|
-
`+oe[y].replace(" at new "," at ");return s.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",s.displayName)),Be}while(1<=y&&0<=A);break}}}finally{Pe=!1,Error.prepareStackTrace=d}return(d=s?s.displayName||s.name:"")?De(d):""}function je(s,c){switch(s.tag){case 26:case 27:case 5:return De(s.type);case 16:return De("Lazy");case 13:return s.child!==c&&c!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Fe(s.type,!1);case 11:return Fe(s.type.render,!1);case 1:return Fe(s.type,!0);case 31:return De("Activity");default:return""}}function st(s){try{var c="",d=null;do c+=je(s,d),d=s,s=s.return;while(s);return c}catch(y){return`
|
|
8
|
-
Error generating stack: `+y.message+`
|
|
9
|
-
`+y.stack}}var Rt=Object.prototype.hasOwnProperty,bt=n.unstable_scheduleCallback,Lt=n.unstable_cancelCallback,sn=n.unstable_shouldYield,jt=n.unstable_requestPaint,Pt=n.unstable_now,Cn=n.unstable_getCurrentPriorityLevel,Ce=n.unstable_ImmediatePriority,qe=n.unstable_UserBlockingPriority,ft=n.unstable_NormalPriority,Ct=n.unstable_LowPriority,Bt=n.unstable_IdlePriority,Nn=n.log,Ft=n.unstable_setDisableYieldValue,Pn=null,jn=null;function Vn(s){if(typeof Nn=="function"&&Ft(s),jn&&typeof jn.setStrictMode=="function")try{jn.setStrictMode(Pn,s)}catch{}}var Je=Math.clz32?Math.clz32:ta,Fi=Math.log,Jn=Math.LN2;function ta(s){return s>>>=0,s===0?32:31-(Fi(s)/Jn|0)|0}var nt=256,As=262144,ks=4194304;function Ai(s){var c=s&42;if(c!==0)return c;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function le(s,c,d){var y=s.pendingLanes;if(y===0)return 0;var A=0,k=s.suspendedLanes,P=s.pingedLanes;s=s.warmLanes;var Z=y&134217727;return Z!==0?(y=Z&~k,y!==0?A=Ai(y):(P&=Z,P!==0?A=Ai(P):d||(d=Z&~s,d!==0&&(A=Ai(d))))):(Z=y&~k,Z!==0?A=Ai(Z):P!==0?A=Ai(P):d||(d=y&~s,d!==0&&(A=Ai(d)))),A===0?0:c!==0&&c!==A&&(c&k)===0&&(k=A&-A,d=c&-c,k>=d||k===32&&(d&4194048)!==0)?c:A}function ze(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function rt(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Dt(){var s=ks;return ks<<=1,(ks&62914560)===0&&(ks=4194304),s}function yn(s){for(var c=[],d=0;31>d;d++)c.push(s);return c}function dn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function pt(s,c,d,y,A,k){var P=s.pendingLanes;s.pendingLanes=d,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=d,s.entangledLanes&=d,s.errorRecoveryDisabledLanes&=d,s.shellSuspendCounter=0;var Z=s.entanglements,oe=s.expirationTimes,ke=s.hiddenUpdates;for(d=P&~d;0<d;){var Be=31-Je(d),He=1<<Be;Z[Be]=0,oe[Be]=-1;var Oe=ke[Be];if(Oe!==null)for(ke[Be]=null,Be=0;Be<Oe.length;Be++){var Ne=Oe[Be];Ne!==null&&(Ne.lane&=-536870913)}d&=~He}y!==0&&ct(s,y,0),k!==0&&A===0&&s.tag!==0&&(s.suspendedLanes|=k&~(P&~c))}function ct(s,c,d){s.pendingLanes|=c,s.suspendedLanes&=~c;var y=31-Je(c);s.entangledLanes|=c,s.entanglements[y]=s.entanglements[y]|1073741824|d&261930}function ot(s,c){var d=s.entangledLanes|=c;for(s=s.entanglements;d;){var y=31-Je(d),A=1<<y;A&c|s[y]&c&&(s[y]|=c),d&=~A}}function en(s,c){var d=c&-c;return d=(d&42)!==0?1:Hn(d),(d&(s.suspendedLanes|c))!==0?0:d}function Hn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ur(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function rs(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:qx(s.type))}function ss(s,c){var d=J.p;try{return J.p=s,c()}finally{J.p=d}}var Fr=Math.random().toString(36).slice(2),Tn="__reactFiber$"+Fr,Qn="__reactProps$"+Fr,Di="__reactContainer$"+Fr,Ts="__reactEvents$"+Fr,Dl="__reactListeners$"+Fr,Ji="__reactHandles$"+Fr,Uo="__reactResources$"+Fr,Qi="__reactMarker$"+Fr;function Va(s){delete s[Tn],delete s[Qn],delete s[Ts],delete s[Dl],delete s[Ji]}function xi(s){var c=s[Tn];if(c)return c;for(var d=s.parentNode;d;){if(c=d[Di]||d[Tn]){if(d=c.alternate,c.child!==null||d!==null&&d.child!==null)for(s=kx(s);s!==null;){if(d=s[Tn])return d;s=kx(s)}return c}s=d,d=s.parentNode}return null}function En(s){if(s=s[Tn]||s[Di]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function Ui(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(i(33))}function ki(s){var c=s[Uo];return c||(c=s[Uo]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function ei(s){s[Qi]=!0}var as=new Set,Ur={};function vr(s,c){Ye(s,c),Ye(s+"Capture",c)}function Ye(s,c){for(Ur[s]=c,s=0;s<c.length;s++)as.add(c[s])}var gt=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]*$"),Xt={},fn={};function Yn(s){return Rt.call(fn,s)?!0:Rt.call(Xt,s)?!1:gt.test(s)?fn[s]=!0:(Xt[s]=!0,!1)}function Tt(s,c,d){if(Yn(c))if(d===null)s.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+d)}}function ji(s,c,d){if(d===null)s.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+d)}}function Ii(s,c,d,y){if(y===null)s.removeAttribute(d);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(d);return}s.setAttributeNS(c,d,""+y)}}function An(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Si(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function jo(s,c,d){var y=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var A=y.get,k=y.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return A.call(this)},set:function(P){d=""+P,k.call(this,P)}}),Object.defineProperty(s,c,{enumerable:y.enumerable}),{getValue:function(){return d},setValue:function(P){d=""+P},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function na(s){if(!s._valueTracker){var c=Si(s)?"checked":"value";s._valueTracker=jo(s,c,""+s[c])}}function Wa(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var d=c.getValue(),y="";return s&&(y=Si(s)?s.checked?"true":"false":s.value),s=y,s!==d?(c.setValue(s),!0):!1}function mn(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var ia=/[\n"\\]/g;function hi(s){return s.replace(ia,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function jr(s,c,d,y,A,k,P,Z){s.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.type=P:s.removeAttribute("type"),c!=null?P==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+An(c)):s.value!==""+An(c)&&(s.value=""+An(c)):P!=="submit"&&P!=="reset"||s.removeAttribute("value"),c!=null?Ms(s,P,An(c)):d!=null?Ms(s,P,An(d)):y!=null&&s.removeAttribute("value"),A==null&&k!=null&&(s.defaultChecked=!!k),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?s.name=""+An(Z):s.removeAttribute("name")}function os(s,c,d,y,A,k,P,Z){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),c!=null||d!=null){if(!(k!=="submit"&&k!=="reset"||c!=null)){na(s);return}d=d!=null?""+An(d):"",c=c!=null?""+An(c):d,Z||c===s.value||(s.value=c),s.defaultValue=c}y=y??A,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=Z?s.checked:!!y,s.defaultChecked=!!y,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(s.name=P),na(s)}function Ms(s,c,d){c==="number"&&mn(s.ownerDocument)===s||s.defaultValue===""+d||(s.defaultValue=""+d)}function ri(s,c,d,y){if(s=s.options,c){c={};for(var A=0;A<d.length;A++)c["$"+d[A]]=!0;for(d=0;d<s.length;d++)A=c.hasOwnProperty("$"+s[d].value),s[d].selected!==A&&(s[d].selected=A),A&&y&&(s[d].defaultSelected=!0)}else{for(d=""+An(d),c=null,A=0;A<s.length;A++){if(s[A].value===d){s[A].selected=!0,y&&(s[A].defaultSelected=!0);return}c!==null||s[A].disabled||(c=s[A])}c!==null&&(c.selected=!0)}}function Ho(s,c,d){if(c!=null&&(c=""+An(c),c!==s.value&&(s.value=c),d==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=d!=null?""+An(d):""}function ls(s,c,d,y){if(c==null){if(y!=null){if(d!=null)throw Error(i(92));if(te(y)){if(1<y.length)throw Error(i(93));y=y[0]}d=y}d==null&&(d=""),c=d}d=An(c),s.defaultValue=d,y=s.textContent,y===d&&y!==""&&y!==null&&(s.value=y),na(s)}function Et(s,c){if(c){var d=s.firstChild;if(d&&d===s.lastChild&&d.nodeType===3){d.nodeValue=c;return}}s.textContent=c}var Il=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 At(s,c,d){var y=c.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?y?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":y?s.setProperty(c,d):typeof d!="number"||d===0||Il.has(c)?c==="float"?s.cssFloat=d:s[c]=(""+d).trim():s[c]=d+"px"}function _n(s,c,d){if(c!=null&&typeof c!="object")throw Error(i(62));if(s=s.style,d!=null){for(var y in d)!d.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?s.setProperty(y,""):y==="float"?s.cssFloat="":s[y]="");for(var A in c)y=c[A],c.hasOwnProperty(A)&&d[A]!==y&&At(s,A,y)}else for(var k in c)c.hasOwnProperty(k)&&At(s,k,c[k])}function Rs(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cs=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"]]),wi=/^[\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 er(s){return wi.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Qe(){}var dt=null;function Ut(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var tn=null,Gt=null;function ti(s){var c=En(s);if(c&&(s=c.stateNode)){var d=s[Qn]||null;e:switch(s=c.stateNode,c.type){case"input":if(jr(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),c=d.name,d.type==="radio"&&c!=null){for(d=s;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+hi(""+c)+'"][type="radio"]'),c=0;c<d.length;c++){var y=d[c];if(y!==s&&y.form===s.form){var A=y[Qn]||null;if(!A)throw Error(i(90));jr(y,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(c=0;c<d.length;c++)y=d[c],y.form===s.form&&Wa(y)}break e;case"textarea":Ho(s,d.value,d.defaultValue);break e;case"select":c=d.value,c!=null&&ri(s,!!d.multiple,c,!1)}}}var us=!1;function Os(s,c,d){if(us)return s(c,d);us=!0;try{var y=s(c);return y}finally{if(us=!1,(tn!==null||Gt!==null)&&(tf(),tn&&(c=tn,s=Gt,Gt=tn=null,ti(c),s)))for(c=0;c<s.length;c++)ti(s[c])}}function ra(s,c){var d=s.stateNode;if(d===null)return null;var y=d[Qn]||null;if(y===null)return null;d=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(d&&typeof d!="function")throw Error(i(231,c,typeof d));return d}var Ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=!1;if(Ti)try{var Hi={};Object.defineProperty(Hi,"passive",{get:function(){yu=!0}}),window.addEventListener("test",Hi,Hi),window.removeEventListener("test",Hi,Hi)}catch{yu=!1}var Hr=null,Ll=null,$a=null;function Ga(){if($a)return $a;var s,c=Ll,d=c.length,y,A="value"in Hr?Hr.value:Hr.textContent,k=A.length;for(s=0;s<d&&c[s]===A[s];s++);var P=d-s;for(y=1;y<=P&&c[d-y]===A[k-y];y++);return $a=A.slice(s,1<y?1-y:void 0)}function Ka(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function qo(){return!0}function fd(){return!1}function di(s){function c(d,y,A,k,P){this._reactName=d,this._targetInst=A,this.type=y,this.nativeEvent=k,this.target=P,this.currentTarget=null;for(var Z in s)s.hasOwnProperty(Z)&&(d=s[Z],this[Z]=d?d(k):k[Z]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?qo:fd,this.isPropagationStopped=fd,this}return f(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=qo)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=qo)},persist:function(){},isPersistent:qo}),c}var sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=di(sa),Ns=f({},sa,{view:0,detail:0}),zl=di(Ns),Vo,_u,Wo,Pl=f({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:aa,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Wo&&(Wo&&s.type==="mousemove"?(Vo=s.screenX-Wo.screenX,_u=s.screenY-Wo.screenY):_u=Vo=0,Wo=s),Vo)},movementY:function(s){return"movementY"in s?s.movementY:_u}}),Fl=di(Pl),bu=f({},Pl,{dataTransfer:0}),pd=di(bu),Ul=f({},Ns,{relatedTarget:0}),Ya=di(Ul),jl=f({},sa,{animationName:0,elapsedTime:0,pseudoElement:0}),md=di(jl),wm=f({},sa,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Xa=di(wm),vu=f({},sa,{data:0}),Hl=di(vu),xu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Su={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"},Mi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $o(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=Mi[s])?!!c[s]:!1}function aa(){return $o}var gd=f({},Ns,{key:function(s){if(s.key){var c=xu[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=Ka(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Su[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:aa,charCode:function(s){return s.type==="keypress"?Ka(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Ka(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),ql=di(gd),yd=f({},Pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wu=di(yd),Vl=f({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:aa}),Cu=di(Vl),oa=f({},sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Eu=di(oa),Au=f({},Pl,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Wl=di(Au),ku=f({},sa,{newState:0,oldState:0}),_d=di(ku),Cm=[9,13,27,32],Go=Ti&&"CompositionEvent"in window,Ds=null;Ti&&"documentMode"in document&&(Ds=document.documentMode);var Em=Ti&&"TextEvent"in window&&!Ds,$l=Ti&&(!Go||Ds&&8<Ds&&11>=Ds),Gl=" ",bd=!1;function Tu(s,c){switch(s){case"keyup":return Cm.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vd(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var la=!1;function xd(s,c){switch(s){case"compositionend":return vd(c);case"keypress":return c.which!==32?null:(bd=!0,Gl);case"textInput":return s=c.data,s===Gl&&bd?null:s;default:return null}}function Am(s,c){if(la)return s==="compositionend"||!Go&&Tu(s,c)?(s=Ga(),$a=Ll=Hr=null,la=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return $l&&c.locale!=="ko"?null:c.data;default:return null}}var Sd={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 Kl(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!Sd[s.type]:c==="textarea"}function Mu(s,c,d,y){tn?Gt?Gt.push(y):Gt=[y]:tn=y,c=cf(c,"onChange"),0<c.length&&(d=new Bl("onChange","change",null,d,y),s.push({event:d,listeners:c}))}var Za=null,Ko=null;function km(s){fx(s,0)}function Yl(s){var c=Ui(s);if(Wa(c))return s}function Yo(s,c){if(s==="change")return c}var qr=!1;if(Ti){var Wn;if(Ti){var Ja="oninput"in document;if(!Ja){var ca=document.createElement("div");ca.setAttribute("oninput","return;"),Ja=typeof ca.oninput=="function"}Wn=Ja}else Wn=!1;qr=Wn&&(!document.documentMode||9<document.documentMode)}function wd(){Za&&(Za.detachEvent("onpropertychange",Xl),Ko=Za=null)}function Xl(s){if(s.propertyName==="value"&&Yl(Ko)){var c=[];Mu(c,Ko,s,Ut(s)),Os(km,c)}}function Cd(s,c,d){s==="focusin"?(wd(),Za=c,Ko=d,Za.attachEvent("onpropertychange",Xl)):s==="focusout"&&wd()}function ua(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Yl(Ko)}function Ru(s,c){if(s==="click")return Yl(c)}function Qa(s,c){if(s==="input"||s==="change")return Yl(c)}function Is(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var qi=typeof Object.is=="function"?Object.is:Is;function E(s,c){if(qi(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var d=Object.keys(s),y=Object.keys(c);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++){var A=d[y];if(!Rt.call(c,A)||!qi(s[A],c[A]))return!1}return!0}function R(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function I(s,c){var d=R(s);s=0;for(var y;d;){if(d.nodeType===3){if(y=s+d.textContent.length,s<=c&&y>=c)return{node:d,offset:c-s};s=y}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=R(d)}}function z(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?z(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function q(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=mn(s.document);c instanceof s.HTMLIFrameElement;){try{var d=typeof c.contentWindow.location.href=="string"}catch{d=!1}if(d)s=c.contentWindow;else break;c=mn(s.document)}return c}function G(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var ne=Ti&&"documentMode"in document&&11>=document.documentMode,ie=null,ue=null,ve=null,he=!1;function ce(s,c,d){var y=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;he||ie==null||ie!==mn(y)||(y=ie,"selectionStart"in y&&G(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ve&&E(ve,y)||(ve=y,y=cf(ue,"onSelect"),0<y.length&&(c=new Bl("onSelect","select",null,c,d),s.push({event:c,listeners:y}),c.target=ie)))}function pe(s,c){var d={};return d[s.toLowerCase()]=c.toLowerCase(),d["Webkit"+s]="webkit"+c,d["Moz"+s]="moz"+c,d}var ge={animationend:pe("Animation","AnimationEnd"),animationiteration:pe("Animation","AnimationIteration"),animationstart:pe("Animation","AnimationStart"),transitionrun:pe("Transition","TransitionRun"),transitionstart:pe("Transition","TransitionStart"),transitioncancel:pe("Transition","TransitionCancel"),transitionend:pe("Transition","TransitionEnd")},de={},fe={};Ti&&(fe=document.createElement("div").style,"AnimationEvent"in window||(delete ge.animationend.animation,delete ge.animationiteration.animation,delete ge.animationstart.animation),"TransitionEvent"in window||delete ge.transitionend.transition);function Se(s){if(de[s])return de[s];if(!ge[s])return s;var c=ge[s],d;for(d in c)if(c.hasOwnProperty(d)&&d in fe)return de[s]=c[d];return s}var Re=Se("animationend"),xe=Se("animationiteration"),Le=Se("animationstart"),Ve=Se("transitionrun"),et=Se("transitionstart"),tt=Se("transitioncancel"),$e=Se("transitionend"),ut=new Map,at="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(" ");at.push("scrollEnd");function Ge(s,c){ut.set(s,c),vr(c,[s])}var ht=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},zt=[],nn=0,vt=0;function qt(){for(var s=nn,c=vt=nn=0;c<s;){var d=zt[c];zt[c++]=null;var y=zt[c];zt[c++]=null;var A=zt[c];zt[c++]=null;var k=zt[c];if(zt[c++]=null,y!==null&&A!==null){var P=y.pending;P===null?A.next=A:(A.next=P.next,P.next=A),y.pending=A}k!==0&&Ls(d,A,k)}}function Dn(s,c,d,y){zt[nn++]=s,zt[nn++]=c,zt[nn++]=d,zt[nn++]=y,vt|=y,s.lanes|=y,s=s.alternate,s!==null&&(s.lanes|=y)}function Vi(s,c,d,y){return Dn(s,c,d,y),eo(s)}function Mn(s,c){return Dn(s,null,null,c),eo(s)}function Ls(s,c,d){s.lanes|=d;var y=s.alternate;y!==null&&(y.lanes|=d);for(var A=!1,k=s.return;k!==null;)k.childLanes|=d,y=k.alternate,y!==null&&(y.childLanes|=d),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(A=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,A&&c!==null&&(A=31-Je(d),s=k.hiddenUpdates,y=s[A],y===null?s[A]=[c]:y.push(c),c.lane=d|536870912),k):null}function eo(s){if(50<Ju)throw Ju=0,Bg=null,Error(i(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var Zl={};function vk(s,c,d,y){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xr(s,c,d,y){return new vk(s,c,d,y)}function Tm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ha(s,c){var d=s.alternate;return d===null?(d=xr(s.tag,c,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=c,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&65011712,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,c=s.dependencies,d.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d.refCleanup=s.refCleanup,d}function Yb(s,c){s.flags&=65011714;var d=s.alternate;return d===null?(s.childLanes=0,s.lanes=c,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=d.childLanes,s.lanes=d.lanes,s.child=d.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=d.memoizedProps,s.memoizedState=d.memoizedState,s.updateQueue=d.updateQueue,s.type=d.type,c=d.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function Ed(s,c,d,y,A,k){var P=0;if(y=s,typeof s=="function")Tm(s)&&(P=1);else if(typeof s=="string")P=ET(s,d,_e.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=xr(31,d,c,A),s.elementType=L,s.lanes=k,s;case w:return Xo(d.children,A,k,c);case v:P=8,A|=24;break;case x:return s=xr(12,d,c,A|2),s.elementType=x,s.lanes=k,s;case O:return s=xr(13,d,c,A),s.elementType=O,s.lanes=k,s;case M:return s=xr(19,d,c,A),s.elementType=M,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case b:P=10;break e;case S:P=9;break e;case C:P=11;break e;case D:P=14;break e;case N:P=16,y=null;break e}P=29,d=Error(i(130,s===null?"null":typeof s,"")),y=null}return c=xr(P,d,c,A),c.elementType=s,c.type=y,c.lanes=k,c}function Xo(s,c,d,y){return s=xr(7,s,y,c),s.lanes=d,s}function Mm(s,c,d){return s=xr(6,s,null,c),s.lanes=d,s}function Xb(s){var c=xr(18,null,null,0);return c.stateNode=s,c}function Rm(s,c,d){return c=xr(4,s.children!==null?s.children:[],s.key,c),c.lanes=d,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var Zb=new WeakMap;function Vr(s,c){if(typeof s=="object"&&s!==null){var d=Zb.get(s);return d!==void 0?d:(c={value:s,source:c,stack:st(c)},Zb.set(s,c),c)}return{value:s,source:c,stack:st(c)}}var Jl=[],Ql=0,Ad=null,Ou=0,Wr=[],$r=0,to=null,Bs=1,zs="";function da(s,c){Jl[Ql++]=Ou,Jl[Ql++]=Ad,Ad=s,Ou=c}function Jb(s,c,d){Wr[$r++]=Bs,Wr[$r++]=zs,Wr[$r++]=to,to=s;var y=Bs;s=zs;var A=32-Je(y)-1;y&=~(1<<A),d+=1;var k=32-Je(c)+A;if(30<k){var P=A-A%5;k=(y&(1<<P)-1).toString(32),y>>=P,A-=P,Bs=1<<32-Je(c)+A|d<<A|y,zs=k+s}else Bs=1<<k|d<<A|y,zs=s}function Om(s){s.return!==null&&(da(s,1),Jb(s,1,0))}function Nm(s){for(;s===Ad;)Ad=Jl[--Ql],Jl[Ql]=null,Ou=Jl[--Ql],Jl[Ql]=null;for(;s===to;)to=Wr[--$r],Wr[$r]=null,zs=Wr[--$r],Wr[$r]=null,Bs=Wr[--$r],Wr[$r]=null}function Qb(s,c){Wr[$r++]=Bs,Wr[$r++]=zs,Wr[$r++]=to,Bs=c.id,zs=c.overflow,to=s}var Li=null,$n=null,hn=!1,no=null,Gr=!1,Dm=Error(i(519));function io(s){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nu(Vr(c,s)),Dm}function ev(s){var c=s.stateNode,d=s.type,y=s.memoizedProps;switch(c[Tn]=s,c[Qn]=y,d){case"dialog":on("cancel",c),on("close",c);break;case"iframe":case"object":case"embed":on("load",c);break;case"video":case"audio":for(d=0;d<eh.length;d++)on(eh[d],c);break;case"source":on("error",c);break;case"img":case"image":case"link":on("error",c),on("load",c);break;case"details":on("toggle",c);break;case"input":on("invalid",c),os(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":on("invalid",c);break;case"textarea":on("invalid",c),ls(c,y.value,y.defaultValue,y.children)}d=y.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||c.textContent===""+d||y.suppressHydrationWarning===!0||yx(c.textContent,d)?(y.popover!=null&&(on("beforetoggle",c),on("toggle",c)),y.onScroll!=null&&on("scroll",c),y.onScrollEnd!=null&&on("scrollend",c),y.onClick!=null&&(c.onclick=Qe),c=!0):c=!1,c||io(s,!0)}function tv(s){for(Li=s.return;Li;)switch(Li.tag){case 5:case 31:case 13:Gr=!1;return;case 27:case 3:Gr=!0;return;default:Li=Li.return}}function ec(s){if(s!==Li)return!1;if(!hn)return tv(s),hn=!0,!1;var c=s.tag,d;if((d=c!==3&&c!==27)&&((d=c===5)&&(d=s.type,d=!(d!=="form"&&d!=="button")||Zg(s.type,s.memoizedProps)),d=!d),d&&$n&&io(s),tv(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));$n=Ax(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));$n=Ax(s)}else c===27?(c=$n,_o(s.type)?(s=ny,ny=null,$n=s):$n=c):$n=Li?Yr(s.stateNode.nextSibling):null;return!0}function Zo(){$n=Li=null,hn=!1}function Im(){var s=no;return s!==null&&(pr===null?pr=s:pr.push.apply(pr,s),no=null),s}function Nu(s){no===null?no=[s]:no.push(s)}var Lm=U(null),Jo=null,fa=null;function ro(s,c,d){V(Lm,c._currentValue),c._currentValue=d}function pa(s){s._currentValue=Lm.current,X(Lm)}function Bm(s,c,d){for(;s!==null;){var y=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),s===d)break;s=s.return}}function zm(s,c,d,y){var A=s.child;for(A!==null&&(A.return=s);A!==null;){var k=A.dependencies;if(k!==null){var P=A.child;k=k.firstContext;e:for(;k!==null;){var Z=k;k=A;for(var oe=0;oe<c.length;oe++)if(Z.context===c[oe]){k.lanes|=d,Z=k.alternate,Z!==null&&(Z.lanes|=d),Bm(k.return,d,s),y||(P=null);break e}k=Z.next}}else if(A.tag===18){if(P=A.return,P===null)throw Error(i(341));P.lanes|=d,k=P.alternate,k!==null&&(k.lanes|=d),Bm(P,d,s),P=null}else P=A.child;if(P!==null)P.return=A;else for(P=A;P!==null;){if(P===s){P=null;break}if(A=P.sibling,A!==null){A.return=P.return,P=A;break}P=P.return}A=P}}function tc(s,c,d,y){s=null;for(var A=c,k=!1;A!==null;){if(!k){if((A.flags&524288)!==0)k=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var P=A.alternate;if(P===null)throw Error(i(387));if(P=P.memoizedProps,P!==null){var Z=A.type;qi(A.pendingProps.value,P.value)||(s!==null?s.push(Z):s=[Z])}}else if(A===ae.current){if(P=A.alternate,P===null)throw Error(i(387));P.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(s!==null?s.push(sh):s=[sh])}A=A.return}s!==null&&zm(c,s,d,y),c.flags|=262144}function kd(s){for(s=s.firstContext;s!==null;){if(!qi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Qo(s){Jo=s,fa=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Bi(s){return nv(Jo,s)}function Td(s,c){return Jo===null&&Qo(s),nv(s,c)}function nv(s,c){var d=c._currentValue;if(c={context:c,memoizedValue:d,next:null},fa===null){if(s===null)throw Error(i(308));fa=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else fa=fa.next=c;return d}var xk=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(d,y){s.push(y)}};this.abort=function(){c.aborted=!0,s.forEach(function(d){return d()})}},Sk=n.unstable_scheduleCallback,wk=n.unstable_NormalPriority,fi={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pm(){return{controller:new xk,data:new Map,refCount:0}}function Du(s){s.refCount--,s.refCount===0&&Sk(wk,function(){s.controller.abort()})}var Iu=null,Fm=0,nc=0,ic=null;function Ck(s,c){if(Iu===null){var d=Iu=[];Fm=0,nc=Hg(),ic={status:"pending",value:void 0,then:function(y){d.push(y)}}}return Fm++,c.then(iv,iv),c}function iv(){if(--Fm===0&&Iu!==null){ic!==null&&(ic.status="fulfilled");var s=Iu;Iu=null,nc=0,ic=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function Ek(s,c){var d=[],y={status:"pending",value:null,reason:null,then:function(A){d.push(A)}};return s.then(function(){y.status="fulfilled",y.value=c;for(var A=0;A<d.length;A++)(0,d[A])(c)},function(A){for(y.status="rejected",y.reason=A,A=0;A<d.length;A++)(0,d[A])(void 0)}),y}var rv=$.S;$.S=function(s,c){j1=Pt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&Ck(s,c),rv!==null&&rv(s,c)};var el=U(null);function Um(){var s=el.current;return s!==null?s:Fn.pooledCache}function Md(s,c){c===null?V(el,el.current):V(el,c.pool)}function sv(){var s=Um();return s===null?null:{parent:fi._currentValue,pool:s}}var rc=Error(i(460)),jm=Error(i(474)),Rd=Error(i(542)),Od={then:function(){}};function av(s){return s=s.status,s==="fulfilled"||s==="rejected"}function ov(s,c,d){switch(d=s[d],d===void 0?s.push(c):d!==c&&(c.then(Qe,Qe),c=d),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,cv(s),s;default:if(typeof c.status=="string")c.then(Qe,Qe);else{if(s=Fn,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=c,s.status="pending",s.then(function(y){if(c.status==="pending"){var A=c;A.status="fulfilled",A.value=y}},function(y){if(c.status==="pending"){var A=c;A.status="rejected",A.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,cv(s),s}throw nl=c,rc}}function tl(s){try{var c=s._init;return c(s._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(nl=d,rc):d}}var nl=null;function lv(){if(nl===null)throw Error(i(459));var s=nl;return nl=null,s}function cv(s){if(s===rc||s===Rd)throw Error(i(483))}var sc=null,Lu=0;function Nd(s){var c=Lu;return Lu+=1,sc===null&&(sc=[]),ov(sc,s,c)}function Bu(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function Dd(s,c){throw c.$$typeof===m?Error(i(525)):(s=Object.prototype.toString.call(c),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function uv(s){function c(be,me){if(s){var Ae=be.deletions;Ae===null?(be.deletions=[me],be.flags|=16):Ae.push(me)}}function d(be,me){if(!s)return null;for(;me!==null;)c(be,me),me=me.sibling;return null}function y(be){for(var me=new Map;be!==null;)be.key!==null?me.set(be.key,be):me.set(be.index,be),be=be.sibling;return me}function A(be,me){return be=ha(be,me),be.index=0,be.sibling=null,be}function k(be,me,Ae){return be.index=Ae,s?(Ae=be.alternate,Ae!==null?(Ae=Ae.index,Ae<me?(be.flags|=67108866,me):Ae):(be.flags|=67108866,me)):(be.flags|=1048576,me)}function P(be){return s&&be.alternate===null&&(be.flags|=67108866),be}function Z(be,me,Ae,Ue){return me===null||me.tag!==6?(me=Mm(Ae,be.mode,Ue),me.return=be,me):(me=A(me,Ae),me.return=be,me)}function oe(be,me,Ae,Ue){var St=Ae.type;return St===w?Be(be,me,Ae.props.children,Ue,Ae.key):me!==null&&(me.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===N&&tl(St)===me.type)?(me=A(me,Ae.props),Bu(me,Ae),me.return=be,me):(me=Ed(Ae.type,Ae.key,Ae.props,null,be.mode,Ue),Bu(me,Ae),me.return=be,me)}function ke(be,me,Ae,Ue){return me===null||me.tag!==4||me.stateNode.containerInfo!==Ae.containerInfo||me.stateNode.implementation!==Ae.implementation?(me=Rm(Ae,be.mode,Ue),me.return=be,me):(me=A(me,Ae.children||[]),me.return=be,me)}function Be(be,me,Ae,Ue,St){return me===null||me.tag!==7?(me=Xo(Ae,be.mode,Ue,St),me.return=be,me):(me=A(me,Ae),me.return=be,me)}function He(be,me,Ae){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return me=Mm(""+me,be.mode,Ae),me.return=be,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return Ae=Ed(me.type,me.key,me.props,null,be.mode,Ae),Bu(Ae,me),Ae.return=be,Ae;case _:return me=Rm(me,be.mode,Ae),me.return=be,me;case N:return me=tl(me),He(be,me,Ae)}if(te(me)||Y(me))return me=Xo(me,be.mode,Ae,null),me.return=be,me;if(typeof me.then=="function")return He(be,Nd(me),Ae);if(me.$$typeof===b)return He(be,Td(be,me),Ae);Dd(be,me)}return null}function Oe(be,me,Ae,Ue){var St=me!==null?me.key:null;if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return St!==null?null:Z(be,me,""+Ae,Ue);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case g:return Ae.key===St?oe(be,me,Ae,Ue):null;case _:return Ae.key===St?ke(be,me,Ae,Ue):null;case N:return Ae=tl(Ae),Oe(be,me,Ae,Ue)}if(te(Ae)||Y(Ae))return St!==null?null:Be(be,me,Ae,Ue,null);if(typeof Ae.then=="function")return Oe(be,me,Nd(Ae),Ue);if(Ae.$$typeof===b)return Oe(be,me,Td(be,Ae),Ue);Dd(be,Ae)}return null}function Ne(be,me,Ae,Ue,St){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint")return be=be.get(Ae)||null,Z(me,be,""+Ue,St);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case g:return be=be.get(Ue.key===null?Ae:Ue.key)||null,oe(me,be,Ue,St);case _:return be=be.get(Ue.key===null?Ae:Ue.key)||null,ke(me,be,Ue,St);case N:return Ue=tl(Ue),Ne(be,me,Ae,Ue,St)}if(te(Ue)||Y(Ue))return be=be.get(Ae)||null,Be(me,be,Ue,St,null);if(typeof Ue.then=="function")return Ne(be,me,Ae,Nd(Ue),St);if(Ue.$$typeof===b)return Ne(be,me,Ae,Td(me,Ue),St);Dd(me,Ue)}return null}function mt(be,me,Ae,Ue){for(var St=null,bn=null,_t=me,Zt=me=0,un=null;_t!==null&&Zt<Ae.length;Zt++){_t.index>Zt?(un=_t,_t=null):un=_t.sibling;var vn=Oe(be,_t,Ae[Zt],Ue);if(vn===null){_t===null&&(_t=un);break}s&&_t&&vn.alternate===null&&c(be,_t),me=k(vn,me,Zt),bn===null?St=vn:bn.sibling=vn,bn=vn,_t=un}if(Zt===Ae.length)return d(be,_t),hn&&da(be,Zt),St;if(_t===null){for(;Zt<Ae.length;Zt++)_t=He(be,Ae[Zt],Ue),_t!==null&&(me=k(_t,me,Zt),bn===null?St=_t:bn.sibling=_t,bn=_t);return hn&&da(be,Zt),St}for(_t=y(_t);Zt<Ae.length;Zt++)un=Ne(_t,be,Zt,Ae[Zt],Ue),un!==null&&(s&&un.alternate!==null&&_t.delete(un.key===null?Zt:un.key),me=k(un,me,Zt),bn===null?St=un:bn.sibling=un,bn=un);return s&&_t.forEach(function(wo){return c(be,wo)}),hn&&da(be,Zt),St}function Ot(be,me,Ae,Ue){if(Ae==null)throw Error(i(151));for(var St=null,bn=null,_t=me,Zt=me=0,un=null,vn=Ae.next();_t!==null&&!vn.done;Zt++,vn=Ae.next()){_t.index>Zt?(un=_t,_t=null):un=_t.sibling;var wo=Oe(be,_t,vn.value,Ue);if(wo===null){_t===null&&(_t=un);break}s&&_t&&wo.alternate===null&&c(be,_t),me=k(wo,me,Zt),bn===null?St=wo:bn.sibling=wo,bn=wo,_t=un}if(vn.done)return d(be,_t),hn&&da(be,Zt),St;if(_t===null){for(;!vn.done;Zt++,vn=Ae.next())vn=He(be,vn.value,Ue),vn!==null&&(me=k(vn,me,Zt),bn===null?St=vn:bn.sibling=vn,bn=vn);return hn&&da(be,Zt),St}for(_t=y(_t);!vn.done;Zt++,vn=Ae.next())vn=Ne(_t,be,Zt,vn.value,Ue),vn!==null&&(s&&vn.alternate!==null&&_t.delete(vn.key===null?Zt:vn.key),me=k(vn,me,Zt),bn===null?St=vn:bn.sibling=vn,bn=vn);return s&&_t.forEach(function(BT){return c(be,BT)}),hn&&da(be,Zt),St}function Bn(be,me,Ae,Ue){if(typeof Ae=="object"&&Ae!==null&&Ae.type===w&&Ae.key===null&&(Ae=Ae.props.children),typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case g:e:{for(var St=Ae.key;me!==null;){if(me.key===St){if(St=Ae.type,St===w){if(me.tag===7){d(be,me.sibling),Ue=A(me,Ae.props.children),Ue.return=be,be=Ue;break e}}else if(me.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===N&&tl(St)===me.type){d(be,me.sibling),Ue=A(me,Ae.props),Bu(Ue,Ae),Ue.return=be,be=Ue;break e}d(be,me);break}else c(be,me);me=me.sibling}Ae.type===w?(Ue=Xo(Ae.props.children,be.mode,Ue,Ae.key),Ue.return=be,be=Ue):(Ue=Ed(Ae.type,Ae.key,Ae.props,null,be.mode,Ue),Bu(Ue,Ae),Ue.return=be,be=Ue)}return P(be);case _:e:{for(St=Ae.key;me!==null;){if(me.key===St)if(me.tag===4&&me.stateNode.containerInfo===Ae.containerInfo&&me.stateNode.implementation===Ae.implementation){d(be,me.sibling),Ue=A(me,Ae.children||[]),Ue.return=be,be=Ue;break e}else{d(be,me);break}else c(be,me);me=me.sibling}Ue=Rm(Ae,be.mode,Ue),Ue.return=be,be=Ue}return P(be);case N:return Ae=tl(Ae),Bn(be,me,Ae,Ue)}if(te(Ae))return mt(be,me,Ae,Ue);if(Y(Ae)){if(St=Y(Ae),typeof St!="function")throw Error(i(150));return Ae=St.call(Ae),Ot(be,me,Ae,Ue)}if(typeof Ae.then=="function")return Bn(be,me,Nd(Ae),Ue);if(Ae.$$typeof===b)return Bn(be,me,Td(be,Ae),Ue);Dd(be,Ae)}return typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint"?(Ae=""+Ae,me!==null&&me.tag===6?(d(be,me.sibling),Ue=A(me,Ae),Ue.return=be,be=Ue):(d(be,me),Ue=Mm(Ae,be.mode,Ue),Ue.return=be,be=Ue),P(be)):d(be,me)}return function(be,me,Ae,Ue){try{Lu=0;var St=Bn(be,me,Ae,Ue);return sc=null,St}catch(_t){if(_t===rc||_t===Rd)throw _t;var bn=xr(29,_t,null,be.mode);return bn.lanes=Ue,bn.return=be,bn}}}var il=uv(!0),hv=uv(!1),so=!1;function Hm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qm(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ao(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function oo(s,c,d){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(kn&2)!==0){var A=y.pending;return A===null?c.next=c:(c.next=A.next,A.next=c),y.pending=c,c=eo(s),Ls(s,null,d),c}return Dn(s,y,c,d),eo(s)}function zu(s,c,d){if(c=c.updateQueue,c!==null&&(c=c.shared,(d&4194048)!==0)){var y=c.lanes;y&=s.pendingLanes,d|=y,c.lanes=d,ot(s,d)}}function Vm(s,c){var d=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var A=null,k=null;if(d=d.firstBaseUpdate,d!==null){do{var P={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};k===null?A=k=P:k=k.next=P,d=d.next}while(d!==null);k===null?A=k=c:k=k.next=c}else A=k=c;d={baseState:y.baseState,firstBaseUpdate:A,lastBaseUpdate:k,shared:y.shared,callbacks:y.callbacks},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=c}var Wm=!1;function Pu(){if(Wm){var s=ic;if(s!==null)throw s}}function Fu(s,c,d,y){Wm=!1;var A=s.updateQueue;so=!1;var k=A.firstBaseUpdate,P=A.lastBaseUpdate,Z=A.shared.pending;if(Z!==null){A.shared.pending=null;var oe=Z,ke=oe.next;oe.next=null,P===null?k=ke:P.next=ke,P=oe;var Be=s.alternate;Be!==null&&(Be=Be.updateQueue,Z=Be.lastBaseUpdate,Z!==P&&(Z===null?Be.firstBaseUpdate=ke:Z.next=ke,Be.lastBaseUpdate=oe))}if(k!==null){var He=A.baseState;P=0,Be=ke=oe=null,Z=k;do{var Oe=Z.lane&-536870913,Ne=Oe!==Z.lane;if(Ne?(cn&Oe)===Oe:(y&Oe)===Oe){Oe!==0&&Oe===nc&&(Wm=!0),Be!==null&&(Be=Be.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var mt=s,Ot=Z;Oe=c;var Bn=d;switch(Ot.tag){case 1:if(mt=Ot.payload,typeof mt=="function"){He=mt.call(Bn,He,Oe);break e}He=mt;break e;case 3:mt.flags=mt.flags&-65537|128;case 0:if(mt=Ot.payload,Oe=typeof mt=="function"?mt.call(Bn,He,Oe):mt,Oe==null)break e;He=f({},He,Oe);break e;case 2:so=!0}}Oe=Z.callback,Oe!==null&&(s.flags|=64,Ne&&(s.flags|=8192),Ne=A.callbacks,Ne===null?A.callbacks=[Oe]:Ne.push(Oe))}else Ne={lane:Oe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Be===null?(ke=Be=Ne,oe=He):Be=Be.next=Ne,P|=Oe;if(Z=Z.next,Z===null){if(Z=A.shared.pending,Z===null)break;Ne=Z,Z=Ne.next,Ne.next=null,A.lastBaseUpdate=Ne,A.shared.pending=null}}while(!0);Be===null&&(oe=He),A.baseState=oe,A.firstBaseUpdate=ke,A.lastBaseUpdate=Be,k===null&&(A.shared.lanes=0),fo|=P,s.lanes=P,s.memoizedState=He}}function dv(s,c){if(typeof s!="function")throw Error(i(191,s));s.call(c)}function fv(s,c){var d=s.callbacks;if(d!==null)for(s.callbacks=null,s=0;s<d.length;s++)dv(d[s],c)}var ac=U(null),Id=U(0);function pv(s,c){s=wa,V(Id,s),V(ac,c),wa=s|c.baseLanes}function $m(){V(Id,wa),V(ac,ac.current)}function Gm(){wa=Id.current,X(ac),X(Id)}var Sr=U(null),Kr=null;function lo(s){var c=s.alternate;V(li,li.current&1),V(Sr,s),Kr===null&&(c===null||ac.current!==null||c.memoizedState!==null)&&(Kr=s)}function Km(s){V(li,li.current),V(Sr,s),Kr===null&&(Kr=s)}function mv(s){s.tag===22?(V(li,li.current),V(Sr,s),Kr===null&&(Kr=s)):co()}function co(){V(li,li.current),V(Sr,Sr.current)}function wr(s){X(Sr),Kr===s&&(Kr=null),X(li)}var li=U(0);function Ld(s){for(var c=s;c!==null;){if(c.tag===13){var d=c.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||ey(d)||ty(d)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ma=0,Kt=null,In=null,pi=null,Bd=!1,oc=!1,rl=!1,zd=0,Uu=0,lc=null,Ak=0;function si(){throw Error(i(321))}function Ym(s,c){if(c===null)return!1;for(var d=0;d<c.length&&d<s.length;d++)if(!qi(s[d],c[d]))return!1;return!0}function Xm(s,c,d,y,A,k){return ma=k,Kt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,$.H=s===null||s.memoizedState===null?Jv:hg,rl=!1,k=d(y,A),rl=!1,oc&&(k=yv(c,d,y,A)),gv(s),k}function gv(s){$.H=qu;var c=In!==null&&In.next!==null;if(ma=0,pi=In=Kt=null,Bd=!1,Uu=0,lc=null,c)throw Error(i(300));s===null||mi||(s=s.dependencies,s!==null&&kd(s)&&(mi=!0))}function yv(s,c,d,y){Kt=s;var A=0;do{if(oc&&(lc=null),Uu=0,oc=!1,25<=A)throw Error(i(301));if(A+=1,pi=In=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}$.H=Qv,k=c(d,y)}while(oc);return k}function kk(){var s=$.H,c=s.useState()[0];return c=typeof c.then=="function"?ju(c):c,s=s.useState()[0],(In!==null?In.memoizedState:null)!==s&&(Kt.flags|=1024),c}function Zm(){var s=zd!==0;return zd=0,s}function Jm(s,c,d){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~d}function Qm(s){if(Bd){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}Bd=!1}ma=0,pi=In=Kt=null,oc=!1,Uu=zd=0,lc=null}function tr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pi===null?Kt.memoizedState=pi=s:pi=pi.next=s,pi}function ci(){if(In===null){var s=Kt.alternate;s=s!==null?s.memoizedState:null}else s=In.next;var c=pi===null?Kt.memoizedState:pi.next;if(c!==null)pi=c,In=s;else{if(s===null)throw Kt.alternate===null?Error(i(467)):Error(i(310));In=s,s={memoizedState:In.memoizedState,baseState:In.baseState,baseQueue:In.baseQueue,queue:In.queue,next:null},pi===null?Kt.memoizedState=pi=s:pi=pi.next=s}return pi}function Pd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ju(s){var c=Uu;return Uu+=1,lc===null&&(lc=[]),s=ov(lc,s,c),c=Kt,(pi===null?c.memoizedState:pi.next)===null&&(c=c.alternate,$.H=c===null||c.memoizedState===null?Jv:hg),s}function Fd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return ju(s);if(s.$$typeof===b)return Bi(s)}throw Error(i(438,String(s)))}function eg(s){var c=null,d=Kt.updateQueue;if(d!==null&&(c=d.memoCache),c==null){var y=Kt.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(A){return A.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),d===null&&(d=Pd(),Kt.updateQueue=d),d.memoCache=c,d=c.data[c.index],d===void 0)for(d=c.data[c.index]=Array(s),y=0;y<s;y++)d[y]=j;return c.index++,d}function ga(s,c){return typeof c=="function"?c(s):c}function Ud(s){var c=ci();return tg(c,In,s)}function tg(s,c,d){var y=s.queue;if(y===null)throw Error(i(311));y.lastRenderedReducer=d;var A=s.baseQueue,k=y.pending;if(k!==null){if(A!==null){var P=A.next;A.next=k.next,k.next=P}c.baseQueue=A=k,y.pending=null}if(k=s.baseState,A===null)s.memoizedState=k;else{c=A.next;var Z=P=null,oe=null,ke=c,Be=!1;do{var He=ke.lane&-536870913;if(He!==ke.lane?(cn&He)===He:(ma&He)===He){var Oe=ke.revertLane;if(Oe===0)oe!==null&&(oe=oe.next={lane:0,revertLane:0,gesture:null,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null}),He===nc&&(Be=!0);else if((ma&Oe)===Oe){ke=ke.next,Oe===nc&&(Be=!0);continue}else He={lane:0,revertLane:ke.revertLane,gesture:null,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},oe===null?(Z=oe=He,P=k):oe=oe.next=He,Kt.lanes|=Oe,fo|=Oe;He=ke.action,rl&&d(k,He),k=ke.hasEagerState?ke.eagerState:d(k,He)}else Oe={lane:He,revertLane:ke.revertLane,gesture:ke.gesture,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},oe===null?(Z=oe=Oe,P=k):oe=oe.next=Oe,Kt.lanes|=He,fo|=He;ke=ke.next}while(ke!==null&&ke!==c);if(oe===null?P=k:oe.next=Z,!qi(k,s.memoizedState)&&(mi=!0,Be&&(d=ic,d!==null)))throw d;s.memoizedState=k,s.baseState=P,s.baseQueue=oe,y.lastRenderedState=k}return A===null&&(y.lanes=0),[s.memoizedState,y.dispatch]}function ng(s){var c=ci(),d=c.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=s;var y=d.dispatch,A=d.pending,k=c.memoizedState;if(A!==null){d.pending=null;var P=A=A.next;do k=s(k,P.action),P=P.next;while(P!==A);qi(k,c.memoizedState)||(mi=!0),c.memoizedState=k,c.baseQueue===null&&(c.baseState=k),d.lastRenderedState=k}return[k,y]}function _v(s,c,d){var y=Kt,A=ci(),k=hn;if(k){if(d===void 0)throw Error(i(407));d=d()}else d=c();var P=!qi((In||A).memoizedState,d);if(P&&(A.memoizedState=d,mi=!0),A=A.queue,sg(xv.bind(null,y,A,s),[s]),A.getSnapshot!==c||P||pi!==null&&pi.memoizedState.tag&1){if(y.flags|=2048,cc(9,{destroy:void 0},vv.bind(null,y,A,d,c),null),Fn===null)throw Error(i(349));k||(ma&127)!==0||bv(y,c,d)}return d}function bv(s,c,d){s.flags|=16384,s={getSnapshot:c,value:d},c=Kt.updateQueue,c===null?(c=Pd(),Kt.updateQueue=c,c.stores=[s]):(d=c.stores,d===null?c.stores=[s]:d.push(s))}function vv(s,c,d,y){c.value=d,c.getSnapshot=y,Sv(c)&&wv(s)}function xv(s,c,d){return d(function(){Sv(c)&&wv(s)})}function Sv(s){var c=s.getSnapshot;s=s.value;try{var d=c();return!qi(s,d)}catch{return!0}}function wv(s){var c=Mn(s,2);c!==null&&mr(c,s,2)}function ig(s){var c=tr();if(typeof s=="function"){var d=s;if(s=d(),rl){Vn(!0);try{d()}finally{Vn(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:s},c}function Cv(s,c,d,y){return s.baseState=d,tg(s,In,typeof y=="function"?y:ga)}function Tk(s,c,d,y,A){if(qd(s))throw Error(i(485));if(s=c.action,s!==null){var k={payload:A,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(P){k.listeners.push(P)}};$.T!==null?d(!0):k.isTransition=!1,y(k),d=c.pending,d===null?(k.next=c.pending=k,Ev(c,k)):(k.next=d.next,c.pending=d.next=k)}}function Ev(s,c){var d=c.action,y=c.payload,A=s.state;if(c.isTransition){var k=$.T,P={};$.T=P;try{var Z=d(A,y),oe=$.S;oe!==null&&oe(P,Z),Av(s,c,Z)}catch(ke){rg(s,c,ke)}finally{k!==null&&P.types!==null&&(k.types=P.types),$.T=k}}else try{k=d(A,y),Av(s,c,k)}catch(ke){rg(s,c,ke)}}function Av(s,c,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(y){kv(s,c,y)},function(y){return rg(s,c,y)}):kv(s,c,d)}function kv(s,c,d){c.status="fulfilled",c.value=d,Tv(c),s.state=d,c=s.pending,c!==null&&(d=c.next,d===c?s.pending=null:(d=d.next,c.next=d,Ev(s,d)))}function rg(s,c,d){var y=s.pending;if(s.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=d,Tv(c),c=c.next;while(c!==y)}s.action=null}function Tv(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function Mv(s,c){return c}function Rv(s,c){if(hn){var d=Fn.formState;if(d!==null){e:{var y=Kt;if(hn){if($n){t:{for(var A=$n,k=Gr;A.nodeType!==8;){if(!k){A=null;break t}if(A=Yr(A.nextSibling),A===null){A=null;break t}}k=A.data,A=k==="F!"||k==="F"?A:null}if(A){$n=Yr(A.nextSibling),y=A.data==="F!";break e}}io(y)}y=!1}y&&(c=d[0])}}return d=tr(),d.memoizedState=d.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mv,lastRenderedState:c},d.queue=y,d=Yv.bind(null,Kt,y),y.dispatch=d,y=ig(!1),k=ug.bind(null,Kt,!1,y.queue),y=tr(),A={state:c,dispatch:null,action:s,pending:null},y.queue=A,d=Tk.bind(null,Kt,A,k,d),A.dispatch=d,y.memoizedState=s,[c,d,!1]}function Ov(s){var c=ci();return Nv(c,In,s)}function Nv(s,c,d){if(c=tg(s,c,Mv)[0],s=Ud(ga)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=ju(c)}catch(P){throw P===rc?Rd:P}else y=c;c=ci();var A=c.queue,k=A.dispatch;return d!==c.memoizedState&&(Kt.flags|=2048,cc(9,{destroy:void 0},Mk.bind(null,A,d),null)),[y,k,s]}function Mk(s,c){s.action=c}function Dv(s){var c=ci(),d=In;if(d!==null)return Nv(c,d,s);ci(),c=c.memoizedState,d=ci();var y=d.queue.dispatch;return d.memoizedState=s,[c,y,!1]}function cc(s,c,d,y){return s={tag:s,create:d,deps:y,inst:c,next:null},c=Kt.updateQueue,c===null&&(c=Pd(),Kt.updateQueue=c),d=c.lastEffect,d===null?c.lastEffect=s.next=s:(y=d.next,d.next=s,s.next=y,c.lastEffect=s),s}function Iv(){return ci().memoizedState}function jd(s,c,d,y){var A=tr();Kt.flags|=s,A.memoizedState=cc(1|c,{destroy:void 0},d,y===void 0?null:y)}function Hd(s,c,d,y){var A=ci();y=y===void 0?null:y;var k=A.memoizedState.inst;In!==null&&y!==null&&Ym(y,In.memoizedState.deps)?A.memoizedState=cc(c,k,d,y):(Kt.flags|=s,A.memoizedState=cc(1|c,k,d,y))}function Lv(s,c){jd(8390656,8,s,c)}function sg(s,c){Hd(2048,8,s,c)}function Rk(s){Kt.flags|=4;var c=Kt.updateQueue;if(c===null)c=Pd(),Kt.updateQueue=c,c.events=[s];else{var d=c.events;d===null?c.events=[s]:d.push(s)}}function Bv(s){var c=ci().memoizedState;return Rk({ref:c,nextImpl:s}),function(){if((kn&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function zv(s,c){return Hd(4,2,s,c)}function Pv(s,c){return Hd(4,4,s,c)}function Fv(s,c){if(typeof c=="function"){s=s();var d=c(s);return function(){typeof d=="function"?d():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function Uv(s,c,d){d=d!=null?d.concat([s]):null,Hd(4,4,Fv.bind(null,c,s),d)}function ag(){}function jv(s,c){var d=ci();c=c===void 0?null:c;var y=d.memoizedState;return c!==null&&Ym(c,y[1])?y[0]:(d.memoizedState=[s,c],s)}function Hv(s,c){var d=ci();c=c===void 0?null:c;var y=d.memoizedState;if(c!==null&&Ym(c,y[1]))return y[0];if(y=s(),rl){Vn(!0);try{s()}finally{Vn(!1)}}return d.memoizedState=[y,c],y}function og(s,c,d){return d===void 0||(ma&1073741824)!==0&&(cn&261930)===0?s.memoizedState=c:(s.memoizedState=d,s=q1(),Kt.lanes|=s,fo|=s,d)}function qv(s,c,d,y){return qi(d,c)?d:ac.current!==null?(s=og(s,d,y),qi(s,c)||(mi=!0),s):(ma&42)===0||(ma&1073741824)!==0&&(cn&261930)===0?(mi=!0,s.memoizedState=d):(s=q1(),Kt.lanes|=s,fo|=s,c)}function Vv(s,c,d,y,A){var k=J.p;J.p=k!==0&&8>k?k:8;var P=$.T,Z={};$.T=Z,ug(s,!1,c,d);try{var oe=A(),ke=$.S;if(ke!==null&&ke(Z,oe),oe!==null&&typeof oe=="object"&&typeof oe.then=="function"){var Be=Ek(oe,y);Hu(s,c,Be,Ar(s))}else Hu(s,c,y,Ar(s))}catch(He){Hu(s,c,{then:function(){},status:"rejected",reason:He},Ar())}finally{J.p=k,P!==null&&Z.types!==null&&(P.types=Z.types),$.T=P}}function Ok(){}function lg(s,c,d,y){if(s.tag!==5)throw Error(i(476));var A=Wv(s).queue;Vv(s,A,c,re,d===null?Ok:function(){return $v(s),d(y)})}function Wv(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:re},next:null};var d={};return c.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:d},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function $v(s){var c=Wv(s);c.next===null&&(c=s.alternate.memoizedState),Hu(s,c.next.queue,{},Ar())}function cg(){return Bi(sh)}function Gv(){return ci().memoizedState}function Kv(){return ci().memoizedState}function Nk(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var d=Ar();s=ao(d);var y=oo(c,s,d);y!==null&&(mr(y,c,d),zu(y,c,d)),c={cache:Pm()},s.payload=c;return}c=c.return}}function Dk(s,c,d){var y=Ar();d={lane:y,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},qd(s)?Xv(c,d):(d=Vi(s,c,d,y),d!==null&&(mr(d,s,y),Zv(d,c,y)))}function Yv(s,c,d){var y=Ar();Hu(s,c,d,y)}function Hu(s,c,d,y){var A={lane:y,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(qd(s))Xv(c,A);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var P=c.lastRenderedState,Z=k(P,d);if(A.hasEagerState=!0,A.eagerState=Z,qi(Z,P))return Dn(s,c,A,0),Fn===null&&qt(),!1}catch{}if(d=Vi(s,c,A,y),d!==null)return mr(d,s,y),Zv(d,c,y),!0}return!1}function ug(s,c,d,y){if(y={lane:2,revertLane:Hg(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},qd(s)){if(c)throw Error(i(479))}else c=Vi(s,d,y,2),c!==null&&mr(c,s,2)}function qd(s){var c=s.alternate;return s===Kt||c!==null&&c===Kt}function Xv(s,c){oc=Bd=!0;var d=s.pending;d===null?c.next=c:(c.next=d.next,d.next=c),s.pending=c}function Zv(s,c,d){if((d&4194048)!==0){var y=c.lanes;y&=s.pendingLanes,d|=y,c.lanes=d,ot(s,d)}}var qu={readContext:Bi,use:Fd,useCallback:si,useContext:si,useEffect:si,useImperativeHandle:si,useLayoutEffect:si,useInsertionEffect:si,useMemo:si,useReducer:si,useRef:si,useState:si,useDebugValue:si,useDeferredValue:si,useTransition:si,useSyncExternalStore:si,useId:si,useHostTransitionStatus:si,useFormState:si,useActionState:si,useOptimistic:si,useMemoCache:si,useCacheRefresh:si};qu.useEffectEvent=si;var Jv={readContext:Bi,use:Fd,useCallback:function(s,c){return tr().memoizedState=[s,c===void 0?null:c],s},useContext:Bi,useEffect:Lv,useImperativeHandle:function(s,c,d){d=d!=null?d.concat([s]):null,jd(4194308,4,Fv.bind(null,c,s),d)},useLayoutEffect:function(s,c){return jd(4194308,4,s,c)},useInsertionEffect:function(s,c){jd(4,2,s,c)},useMemo:function(s,c){var d=tr();c=c===void 0?null:c;var y=s();if(rl){Vn(!0);try{s()}finally{Vn(!1)}}return d.memoizedState=[y,c],y},useReducer:function(s,c,d){var y=tr();if(d!==void 0){var A=d(c);if(rl){Vn(!0);try{d(c)}finally{Vn(!1)}}}else A=c;return y.memoizedState=y.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},y.queue=s,s=s.dispatch=Dk.bind(null,Kt,s),[y.memoizedState,s]},useRef:function(s){var c=tr();return s={current:s},c.memoizedState=s},useState:function(s){s=ig(s);var c=s.queue,d=Yv.bind(null,Kt,c);return c.dispatch=d,[s.memoizedState,d]},useDebugValue:ag,useDeferredValue:function(s,c){var d=tr();return og(d,s,c)},useTransition:function(){var s=ig(!1);return s=Vv.bind(null,Kt,s.queue,!0,!1),tr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,d){var y=Kt,A=tr();if(hn){if(d===void 0)throw Error(i(407));d=d()}else{if(d=c(),Fn===null)throw Error(i(349));(cn&127)!==0||bv(y,c,d)}A.memoizedState=d;var k={value:d,getSnapshot:c};return A.queue=k,Lv(xv.bind(null,y,k,s),[s]),y.flags|=2048,cc(9,{destroy:void 0},vv.bind(null,y,k,d,c),null),d},useId:function(){var s=tr(),c=Fn.identifierPrefix;if(hn){var d=zs,y=Bs;d=(y&~(1<<32-Je(y)-1)).toString(32)+d,c="_"+c+"R_"+d,d=zd++,0<d&&(c+="H"+d.toString(32)),c+="_"}else d=Ak++,c="_"+c+"r_"+d.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:cg,useFormState:Rv,useActionState:Rv,useOptimistic:function(s){var c=tr();c.memoizedState=c.baseState=s;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=d,c=ug.bind(null,Kt,!0,d),d.dispatch=c,[s,c]},useMemoCache:eg,useCacheRefresh:function(){return tr().memoizedState=Nk.bind(null,Kt)},useEffectEvent:function(s){var c=tr(),d={impl:s};return c.memoizedState=d,function(){if((kn&2)!==0)throw Error(i(440));return d.impl.apply(void 0,arguments)}}},hg={readContext:Bi,use:Fd,useCallback:jv,useContext:Bi,useEffect:sg,useImperativeHandle:Uv,useInsertionEffect:zv,useLayoutEffect:Pv,useMemo:Hv,useReducer:Ud,useRef:Iv,useState:function(){return Ud(ga)},useDebugValue:ag,useDeferredValue:function(s,c){var d=ci();return qv(d,In.memoizedState,s,c)},useTransition:function(){var s=Ud(ga)[0],c=ci().memoizedState;return[typeof s=="boolean"?s:ju(s),c]},useSyncExternalStore:_v,useId:Gv,useHostTransitionStatus:cg,useFormState:Ov,useActionState:Ov,useOptimistic:function(s,c){var d=ci();return Cv(d,In,s,c)},useMemoCache:eg,useCacheRefresh:Kv};hg.useEffectEvent=Bv;var Qv={readContext:Bi,use:Fd,useCallback:jv,useContext:Bi,useEffect:sg,useImperativeHandle:Uv,useInsertionEffect:zv,useLayoutEffect:Pv,useMemo:Hv,useReducer:ng,useRef:Iv,useState:function(){return ng(ga)},useDebugValue:ag,useDeferredValue:function(s,c){var d=ci();return In===null?og(d,s,c):qv(d,In.memoizedState,s,c)},useTransition:function(){var s=ng(ga)[0],c=ci().memoizedState;return[typeof s=="boolean"?s:ju(s),c]},useSyncExternalStore:_v,useId:Gv,useHostTransitionStatus:cg,useFormState:Dv,useActionState:Dv,useOptimistic:function(s,c){var d=ci();return In!==null?Cv(d,In,s,c):(d.baseState=s,[s,d.queue.dispatch])},useMemoCache:eg,useCacheRefresh:Kv};Qv.useEffectEvent=Bv;function dg(s,c,d,y){c=s.memoizedState,d=d(y,c),d=d==null?c:f({},c,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}var fg={enqueueSetState:function(s,c,d){s=s._reactInternals;var y=Ar(),A=ao(y);A.payload=c,d!=null&&(A.callback=d),c=oo(s,A,y),c!==null&&(mr(c,s,y),zu(c,s,y))},enqueueReplaceState:function(s,c,d){s=s._reactInternals;var y=Ar(),A=ao(y);A.tag=1,A.payload=c,d!=null&&(A.callback=d),c=oo(s,A,y),c!==null&&(mr(c,s,y),zu(c,s,y))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var d=Ar(),y=ao(d);y.tag=2,c!=null&&(y.callback=c),c=oo(s,y,d),c!==null&&(mr(c,s,d),zu(c,s,d))}};function e1(s,c,d,y,A,k,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,k,P):c.prototype&&c.prototype.isPureReactComponent?!E(d,y)||!E(A,k):!0}function t1(s,c,d,y){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(d,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(d,y),c.state!==s&&fg.enqueueReplaceState(c,c.state,null)}function sl(s,c){var d=c;if("ref"in c){d={};for(var y in c)y!=="ref"&&(d[y]=c[y])}if(s=s.defaultProps){d===c&&(d=f({},d));for(var A in s)d[A]===void 0&&(d[A]=s[A])}return d}function n1(s){ht(s)}function i1(s){console.error(s)}function r1(s){ht(s)}function Vd(s,c){try{var d=s.onUncaughtError;d(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function s1(s,c,d){try{var y=s.onCaughtError;y(d.value,{componentStack:d.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function pg(s,c,d){return d=ao(d),d.tag=3,d.payload={element:null},d.callback=function(){Vd(s,c)},d}function a1(s){return s=ao(s),s.tag=3,s}function o1(s,c,d,y){var A=d.type.getDerivedStateFromError;if(typeof A=="function"){var k=y.value;s.payload=function(){return A(k)},s.callback=function(){s1(c,d,y)}}var P=d.stateNode;P!==null&&typeof P.componentDidCatch=="function"&&(s.callback=function(){s1(c,d,y),typeof A!="function"&&(po===null?po=new Set([this]):po.add(this));var Z=y.stack;this.componentDidCatch(y.value,{componentStack:Z!==null?Z:""})})}function Ik(s,c,d,y,A){if(d.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=d.alternate,c!==null&&tc(c,d,A,!0),d=Sr.current,d!==null){switch(d.tag){case 31:case 13:return Kr===null?nf():d.alternate===null&&ai===0&&(ai=3),d.flags&=-257,d.flags|=65536,d.lanes=A,y===Od?d.flags|=16384:(c=d.updateQueue,c===null?d.updateQueue=new Set([y]):c.add(y),Fg(s,y,A)),!1;case 22:return d.flags|=65536,y===Od?d.flags|=16384:(c=d.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},d.updateQueue=c):(d=c.retryQueue,d===null?c.retryQueue=new Set([y]):d.add(y)),Fg(s,y,A)),!1}throw Error(i(435,d.tag))}return Fg(s,y,A),nf(),!1}if(hn)return c=Sr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=A,y!==Dm&&(s=Error(i(422),{cause:y}),Nu(Vr(s,d)))):(y!==Dm&&(c=Error(i(423),{cause:y}),Nu(Vr(c,d))),s=s.current.alternate,s.flags|=65536,A&=-A,s.lanes|=A,y=Vr(y,d),A=pg(s.stateNode,y,A),Vm(s,A),ai!==4&&(ai=2)),!1;var k=Error(i(520),{cause:y});if(k=Vr(k,d),Zu===null?Zu=[k]:Zu.push(k),ai!==4&&(ai=2),c===null)return!0;y=Vr(y,d),d=c;do{switch(d.tag){case 3:return d.flags|=65536,s=A&-A,d.lanes|=s,s=pg(d.stateNode,y,s),Vm(d,s),!1;case 1:if(c=d.type,k=d.stateNode,(d.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(po===null||!po.has(k))))return d.flags|=65536,A&=-A,d.lanes|=A,A=a1(A),o1(A,s,d,y),Vm(d,A),!1}d=d.return}while(d!==null);return!1}var mg=Error(i(461)),mi=!1;function zi(s,c,d,y){c.child=s===null?hv(c,null,d,y):il(c,s.child,d,y)}function l1(s,c,d,y,A){d=d.render;var k=c.ref;if("ref"in y){var P={};for(var Z in y)Z!=="ref"&&(P[Z]=y[Z])}else P=y;return Qo(c),y=Xm(s,c,d,P,k,A),Z=Zm(),s!==null&&!mi?(Jm(s,c,A),ya(s,c,A)):(hn&&Z&&Om(c),c.flags|=1,zi(s,c,y,A),c.child)}function c1(s,c,d,y,A){if(s===null){var k=d.type;return typeof k=="function"&&!Tm(k)&&k.defaultProps===void 0&&d.compare===null?(c.tag=15,c.type=k,u1(s,c,k,y,A)):(s=Ed(d.type,null,y,c,c.mode,A),s.ref=c.ref,s.return=c,c.child=s)}if(k=s.child,!wg(s,A)){var P=k.memoizedProps;if(d=d.compare,d=d!==null?d:E,d(P,y)&&s.ref===c.ref)return ya(s,c,A)}return c.flags|=1,s=ha(k,y),s.ref=c.ref,s.return=c,c.child=s}function u1(s,c,d,y,A){if(s!==null){var k=s.memoizedProps;if(E(k,y)&&s.ref===c.ref)if(mi=!1,c.pendingProps=y=k,wg(s,A))(s.flags&131072)!==0&&(mi=!0);else return c.lanes=s.lanes,ya(s,c,A)}return gg(s,c,d,y,A)}function h1(s,c,d,y){var A=y.children,k=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((c.flags&128)!==0){if(k=k!==null?k.baseLanes|d:d,s!==null){for(y=c.child=s.child,A=0;y!==null;)A=A|y.lanes|y.childLanes,y=y.sibling;y=A&~k}else y=0,c.child=null;return d1(s,c,k,d,y)}if((d&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&Md(c,k!==null?k.cachePool:null),k!==null?pv(c,k):$m(),mv(c);else return y=c.lanes=536870912,d1(s,c,k!==null?k.baseLanes|d:d,d,y)}else k!==null?(Md(c,k.cachePool),pv(c,k),co(),c.memoizedState=null):(s!==null&&Md(c,null),$m(),co());return zi(s,c,A,d),c.child}function Vu(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function d1(s,c,d,y,A){var k=Um();return k=k===null?null:{parent:fi._currentValue,pool:k},c.memoizedState={baseLanes:d,cachePool:k},s!==null&&Md(c,null),$m(),mv(c),s!==null&&tc(s,c,y,!0),c.childLanes=A,null}function Wd(s,c){return c=Gd({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function f1(s,c,d){return il(c,s.child,null,d),s=Wd(c,c.pendingProps),s.flags|=2,wr(c),c.memoizedState=null,s}function Lk(s,c,d){var y=c.pendingProps,A=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(hn){if(y.mode==="hidden")return s=Wd(c,y),c.lanes=536870912,Vu(null,s);if(Km(c),(s=$n)?(s=Ex(s,Gr),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:to!==null?{id:Bs,overflow:zs}:null,retryLane:536870912,hydrationErrors:null},d=Xb(s),d.return=c,c.child=d,Li=c,$n=null)):s=null,s===null)throw io(c);return c.lanes=536870912,null}return Wd(c,y)}var k=s.memoizedState;if(k!==null){var P=k.dehydrated;if(Km(c),A)if(c.flags&256)c.flags&=-257,c=f1(s,c,d);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(i(558));else if(mi||tc(s,c,d,!1),A=(d&s.childLanes)!==0,mi||A){if(y=Fn,y!==null&&(P=en(y,d),P!==0&&P!==k.retryLane))throw k.retryLane=P,Mn(s,P),mr(y,s,P),mg;nf(),c=f1(s,c,d)}else s=k.treeContext,$n=Yr(P.nextSibling),Li=c,hn=!0,no=null,Gr=!1,s!==null&&Qb(c,s),c=Wd(c,y),c.flags|=4096;return c}return s=ha(s.child,{mode:y.mode,children:y.children}),s.ref=c.ref,c.child=s,s.return=c,s}function $d(s,c){var d=c.ref;if(d===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(i(284));(s===null||s.ref!==d)&&(c.flags|=4194816)}}function gg(s,c,d,y,A){return Qo(c),d=Xm(s,c,d,y,void 0,A),y=Zm(),s!==null&&!mi?(Jm(s,c,A),ya(s,c,A)):(hn&&y&&Om(c),c.flags|=1,zi(s,c,d,A),c.child)}function p1(s,c,d,y,A,k){return Qo(c),c.updateQueue=null,d=yv(c,y,d,A),gv(s),y=Zm(),s!==null&&!mi?(Jm(s,c,k),ya(s,c,k)):(hn&&y&&Om(c),c.flags|=1,zi(s,c,d,k),c.child)}function m1(s,c,d,y,A){if(Qo(c),c.stateNode===null){var k=Zl,P=d.contextType;typeof P=="object"&&P!==null&&(k=Bi(P)),k=new d(y,k),c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=fg,c.stateNode=k,k._reactInternals=c,k=c.stateNode,k.props=y,k.state=c.memoizedState,k.refs={},Hm(c),P=d.contextType,k.context=typeof P=="object"&&P!==null?Bi(P):Zl,k.state=c.memoizedState,P=d.getDerivedStateFromProps,typeof P=="function"&&(dg(c,d,P,y),k.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(P=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),P!==k.state&&fg.enqueueReplaceState(k,k.state,null),Fu(c,y,k,A),Pu(),k.state=c.memoizedState),typeof k.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(s===null){k=c.stateNode;var Z=c.memoizedProps,oe=sl(d,Z);k.props=oe;var ke=k.context,Be=d.contextType;P=Zl,typeof Be=="object"&&Be!==null&&(P=Bi(Be));var He=d.getDerivedStateFromProps;Be=typeof He=="function"||typeof k.getSnapshotBeforeUpdate=="function",Z=c.pendingProps!==Z,Be||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(Z||ke!==P)&&t1(c,k,y,P),so=!1;var Oe=c.memoizedState;k.state=Oe,Fu(c,y,k,A),Pu(),ke=c.memoizedState,Z||Oe!==ke||so?(typeof He=="function"&&(dg(c,d,He,y),ke=c.memoizedState),(oe=so||e1(c,d,oe,y,Oe,ke,P))?(Be||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(c.flags|=4194308)):(typeof k.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=ke),k.props=y,k.state=ke,k.context=P,y=oe):(typeof k.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{k=c.stateNode,qm(s,c),P=c.memoizedProps,Be=sl(d,P),k.props=Be,He=c.pendingProps,Oe=k.context,ke=d.contextType,oe=Zl,typeof ke=="object"&&ke!==null&&(oe=Bi(ke)),Z=d.getDerivedStateFromProps,(ke=typeof Z=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P!==He||Oe!==oe)&&t1(c,k,y,oe),so=!1,Oe=c.memoizedState,k.state=Oe,Fu(c,y,k,A),Pu();var Ne=c.memoizedState;P!==He||Oe!==Ne||so||s!==null&&s.dependencies!==null&&kd(s.dependencies)?(typeof Z=="function"&&(dg(c,d,Z,y),Ne=c.memoizedState),(Be=so||e1(c,d,Be,y,Oe,Ne,oe)||s!==null&&s.dependencies!==null&&kd(s.dependencies))?(ke||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(y,Ne,oe),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(y,Ne,oe)),typeof k.componentDidUpdate=="function"&&(c.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof k.componentDidUpdate!="function"||P===s.memoizedProps&&Oe===s.memoizedState||(c.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&Oe===s.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Ne),k.props=y,k.state=Ne,k.context=oe,y=Be):(typeof k.componentDidUpdate!="function"||P===s.memoizedProps&&Oe===s.memoizedState||(c.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&Oe===s.memoizedState||(c.flags|=1024),y=!1)}return k=y,$d(s,c),y=(c.flags&128)!==0,k||y?(k=c.stateNode,d=y&&typeof d.getDerivedStateFromError!="function"?null:k.render(),c.flags|=1,s!==null&&y?(c.child=il(c,s.child,null,A),c.child=il(c,null,d,A)):zi(s,c,d,A),c.memoizedState=k.state,s=c.child):s=ya(s,c,A),s}function g1(s,c,d,y){return Zo(),c.flags|=256,zi(s,c,d,y),c.child}var yg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _g(s){return{baseLanes:s,cachePool:sv()}}function bg(s,c,d){return s=s!==null?s.childLanes&~d:0,c&&(s|=Er),s}function y1(s,c,d){var y=c.pendingProps,A=!1,k=(c.flags&128)!==0,P;if((P=k)||(P=s!==null&&s.memoizedState===null?!1:(li.current&2)!==0),P&&(A=!0,c.flags&=-129),P=(c.flags&32)!==0,c.flags&=-33,s===null){if(hn){if(A?lo(c):co(),(s=$n)?(s=Ex(s,Gr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:to!==null?{id:Bs,overflow:zs}:null,retryLane:536870912,hydrationErrors:null},d=Xb(s),d.return=c,c.child=d,Li=c,$n=null)):s=null,s===null)throw io(c);return ty(s)?c.lanes=32:c.lanes=536870912,null}var Z=y.children;return y=y.fallback,A?(co(),A=c.mode,Z=Gd({mode:"hidden",children:Z},A),y=Xo(y,A,d,null),Z.return=c,y.return=c,Z.sibling=y,c.child=Z,y=c.child,y.memoizedState=_g(d),y.childLanes=bg(s,P,d),c.memoizedState=yg,Vu(null,y)):(lo(c),vg(c,Z))}var oe=s.memoizedState;if(oe!==null&&(Z=oe.dehydrated,Z!==null)){if(k)c.flags&256?(lo(c),c.flags&=-257,c=xg(s,c,d)):c.memoizedState!==null?(co(),c.child=s.child,c.flags|=128,c=null):(co(),Z=y.fallback,A=c.mode,y=Gd({mode:"visible",children:y.children},A),Z=Xo(Z,A,d,null),Z.flags|=2,y.return=c,Z.return=c,y.sibling=Z,c.child=y,il(c,s.child,null,d),y=c.child,y.memoizedState=_g(d),y.childLanes=bg(s,P,d),c.memoizedState=yg,c=Vu(null,y));else if(lo(c),ty(Z)){if(P=Z.nextSibling&&Z.nextSibling.dataset,P)var ke=P.dgst;P=ke,y=Error(i(419)),y.stack="",y.digest=P,Nu({value:y,source:null,stack:null}),c=xg(s,c,d)}else if(mi||tc(s,c,d,!1),P=(d&s.childLanes)!==0,mi||P){if(P=Fn,P!==null&&(y=en(P,d),y!==0&&y!==oe.retryLane))throw oe.retryLane=y,Mn(s,y),mr(P,s,y),mg;ey(Z)||nf(),c=xg(s,c,d)}else ey(Z)?(c.flags|=192,c.child=s.child,c=null):(s=oe.treeContext,$n=Yr(Z.nextSibling),Li=c,hn=!0,no=null,Gr=!1,s!==null&&Qb(c,s),c=vg(c,y.children),c.flags|=4096);return c}return A?(co(),Z=y.fallback,A=c.mode,oe=s.child,ke=oe.sibling,y=ha(oe,{mode:"hidden",children:y.children}),y.subtreeFlags=oe.subtreeFlags&65011712,ke!==null?Z=ha(ke,Z):(Z=Xo(Z,A,d,null),Z.flags|=2),Z.return=c,y.return=c,y.sibling=Z,c.child=y,Vu(null,y),y=c.child,Z=s.child.memoizedState,Z===null?Z=_g(d):(A=Z.cachePool,A!==null?(oe=fi._currentValue,A=A.parent!==oe?{parent:oe,pool:oe}:A):A=sv(),Z={baseLanes:Z.baseLanes|d,cachePool:A}),y.memoizedState=Z,y.childLanes=bg(s,P,d),c.memoizedState=yg,Vu(s.child,y)):(lo(c),d=s.child,s=d.sibling,d=ha(d,{mode:"visible",children:y.children}),d.return=c,d.sibling=null,s!==null&&(P=c.deletions,P===null?(c.deletions=[s],c.flags|=16):P.push(s)),c.child=d,c.memoizedState=null,d)}function vg(s,c){return c=Gd({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function Gd(s,c){return s=xr(22,s,null,c),s.lanes=0,s}function xg(s,c,d){return il(c,s.child,null,d),s=vg(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function _1(s,c,d){s.lanes|=c;var y=s.alternate;y!==null&&(y.lanes|=c),Bm(s.return,c,d)}function Sg(s,c,d,y,A,k){var P=s.memoizedState;P===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:A,treeForkCount:k}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=d,P.tailMode=A,P.treeForkCount=k)}function b1(s,c,d){var y=c.pendingProps,A=y.revealOrder,k=y.tail;y=y.children;var P=li.current,Z=(P&2)!==0;if(Z?(P=P&1|2,c.flags|=128):P&=1,V(li,P),zi(s,c,y,d),y=hn?Ou:0,!Z&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&_1(s,d,c);else if(s.tag===19)_1(s,d,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(A){case"forwards":for(d=c.child,A=null;d!==null;)s=d.alternate,s!==null&&Ld(s)===null&&(A=d),d=d.sibling;d=A,d===null?(A=c.child,c.child=null):(A=d.sibling,d.sibling=null),Sg(c,!1,A,d,k,y);break;case"backwards":case"unstable_legacy-backwards":for(d=null,A=c.child,c.child=null;A!==null;){if(s=A.alternate,s!==null&&Ld(s)===null){c.child=A;break}s=A.sibling,A.sibling=d,d=A,A=s}Sg(c,!0,d,null,k,y);break;case"together":Sg(c,!1,null,null,void 0,y);break;default:c.memoizedState=null}return c.child}function ya(s,c,d){if(s!==null&&(c.dependencies=s.dependencies),fo|=c.lanes,(d&c.childLanes)===0)if(s!==null){if(tc(s,c,d,!1),(d&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(i(153));if(c.child!==null){for(s=c.child,d=ha(s,s.pendingProps),c.child=d,d.return=c;s.sibling!==null;)s=s.sibling,d=d.sibling=ha(s,s.pendingProps),d.return=c;d.sibling=null}return c.child}function wg(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&kd(s)))}function Bk(s,c,d){switch(c.tag){case 3:ee(c,c.stateNode.containerInfo),ro(c,fi,s.memoizedState.cache),Zo();break;case 27:case 5:ye(c);break;case 4:ee(c,c.stateNode.containerInfo);break;case 10:ro(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Km(c),null;break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(lo(c),c.flags|=128,null):(d&c.child.childLanes)!==0?y1(s,c,d):(lo(c),s=ya(s,c,d),s!==null?s.sibling:null);lo(c);break;case 19:var A=(s.flags&128)!==0;if(y=(d&c.childLanes)!==0,y||(tc(s,c,d,!1),y=(d&c.childLanes)!==0),A){if(y)return b1(s,c,d);c.flags|=128}if(A=c.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),V(li,li.current),y)break;return null;case 22:return c.lanes=0,h1(s,c,d,c.pendingProps);case 24:ro(c,fi,s.memoizedState.cache)}return ya(s,c,d)}function v1(s,c,d){if(s!==null)if(s.memoizedProps!==c.pendingProps)mi=!0;else{if(!wg(s,d)&&(c.flags&128)===0)return mi=!1,Bk(s,c,d);mi=(s.flags&131072)!==0}else mi=!1,hn&&(c.flags&1048576)!==0&&Jb(c,Ou,c.index);switch(c.lanes=0,c.tag){case 16:e:{var y=c.pendingProps;if(s=tl(c.elementType),c.type=s,typeof s=="function")Tm(s)?(y=sl(s,y),c.tag=1,c=m1(null,c,s,y,d)):(c.tag=0,c=gg(null,c,s,y,d));else{if(s!=null){var A=s.$$typeof;if(A===C){c.tag=11,c=l1(null,c,s,y,d);break e}else if(A===D){c.tag=14,c=c1(null,c,s,y,d);break e}}throw c=Q(s)||s,Error(i(306,c,""))}}return c;case 0:return gg(s,c,c.type,c.pendingProps,d);case 1:return y=c.type,A=sl(y,c.pendingProps),m1(s,c,y,A,d);case 3:e:{if(ee(c,c.stateNode.containerInfo),s===null)throw Error(i(387));y=c.pendingProps;var k=c.memoizedState;A=k.element,qm(s,c),Fu(c,y,null,d);var P=c.memoizedState;if(y=P.cache,ro(c,fi,y),y!==k.cache&&zm(c,[fi],d,!0),Pu(),y=P.element,k.isDehydrated)if(k={element:y,isDehydrated:!1,cache:P.cache},c.updateQueue.baseState=k,c.memoizedState=k,c.flags&256){c=g1(s,c,y,d);break e}else if(y!==A){A=Vr(Error(i(424)),c),Nu(A),c=g1(s,c,y,d);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,$n=Yr(s.firstChild),Li=c,hn=!0,no=null,Gr=!0,d=hv(c,null,y,d),c.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Zo(),y===A){c=ya(s,c,d);break e}zi(s,c,y,d)}c=c.child}return c;case 26:return $d(s,c),s===null?(d=Ox(c.type,null,c.pendingProps,null))?c.memoizedState=d:hn||(d=c.type,s=c.pendingProps,y=uf(Ie.current).createElement(d),y[Tn]=c,y[Qn]=s,Pi(y,d,s),ei(y),c.stateNode=y):c.memoizedState=Ox(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return ye(c),s===null&&hn&&(y=c.stateNode=Tx(c.type,c.pendingProps,Ie.current),Li=c,Gr=!0,A=$n,_o(c.type)?(ny=A,$n=Yr(y.firstChild)):$n=A),zi(s,c,c.pendingProps.children,d),$d(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&hn&&((A=y=$n)&&(y=dT(y,c.type,c.pendingProps,Gr),y!==null?(c.stateNode=y,Li=c,$n=Yr(y.firstChild),Gr=!1,A=!0):A=!1),A||io(c)),ye(c),A=c.type,k=c.pendingProps,P=s!==null?s.memoizedProps:null,y=k.children,Zg(A,k)?y=null:P!==null&&Zg(A,P)&&(c.flags|=32),c.memoizedState!==null&&(A=Xm(s,c,kk,null,null,d),sh._currentValue=A),$d(s,c),zi(s,c,y,d),c.child;case 6:return s===null&&hn&&((s=d=$n)&&(d=fT(d,c.pendingProps,Gr),d!==null?(c.stateNode=d,Li=c,$n=null,s=!0):s=!1),s||io(c)),null;case 13:return y1(s,c,d);case 4:return ee(c,c.stateNode.containerInfo),y=c.pendingProps,s===null?c.child=il(c,null,y,d):zi(s,c,y,d),c.child;case 11:return l1(s,c,c.type,c.pendingProps,d);case 7:return zi(s,c,c.pendingProps,d),c.child;case 8:return zi(s,c,c.pendingProps.children,d),c.child;case 12:return zi(s,c,c.pendingProps.children,d),c.child;case 10:return y=c.pendingProps,ro(c,c.type,y.value),zi(s,c,y.children,d),c.child;case 9:return A=c.type._context,y=c.pendingProps.children,Qo(c),A=Bi(A),y=y(A),c.flags|=1,zi(s,c,y,d),c.child;case 14:return c1(s,c,c.type,c.pendingProps,d);case 15:return u1(s,c,c.type,c.pendingProps,d);case 19:return b1(s,c,d);case 31:return Lk(s,c,d);case 22:return h1(s,c,d,c.pendingProps);case 24:return Qo(c),y=Bi(fi),s===null?(A=Um(),A===null&&(A=Fn,k=Pm(),A.pooledCache=k,k.refCount++,k!==null&&(A.pooledCacheLanes|=d),A=k),c.memoizedState={parent:y,cache:A},Hm(c),ro(c,fi,A)):((s.lanes&d)!==0&&(qm(s,c),Fu(c,null,null,d),Pu()),A=s.memoizedState,k=c.memoizedState,A.parent!==y?(A={parent:y,cache:y},c.memoizedState=A,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=A),ro(c,fi,y)):(y=k.cache,ro(c,fi,y),y!==A.cache&&zm(c,[fi],d,!0))),zi(s,c,c.pendingProps.children,d),c.child;case 29:throw c.pendingProps}throw Error(i(156,c.tag))}function _a(s){s.flags|=4}function Cg(s,c,d,y,A){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(A&335544128)===A)if(s.stateNode.complete)s.flags|=8192;else if(G1())s.flags|=8192;else throw nl=Od,jm}else s.flags&=-16777217}function x1(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Bx(c))if(G1())s.flags|=8192;else throw nl=Od,jm}function Kd(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?Dt():536870912,s.lanes|=c,fc|=c)}function Wu(s,c){if(!hn)switch(s.tailMode){case"hidden":c=s.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function Gn(s){var c=s.alternate!==null&&s.alternate.child===s.child,d=0,y=0;if(c)for(var A=s.child;A!==null;)d|=A.lanes|A.childLanes,y|=A.subtreeFlags&65011712,y|=A.flags&65011712,A.return=s,A=A.sibling;else for(A=s.child;A!==null;)d|=A.lanes|A.childLanes,y|=A.subtreeFlags,y|=A.flags,A.return=s,A=A.sibling;return s.subtreeFlags|=y,s.childLanes=d,c}function zk(s,c,d){var y=c.pendingProps;switch(Nm(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gn(c),null;case 1:return Gn(c),null;case 3:return d=c.stateNode,y=null,s!==null&&(y=s.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),pa(fi),Te(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(s===null||s.child===null)&&(ec(c)?_a(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Im())),Gn(c),null;case 26:var A=c.type,k=c.memoizedState;return s===null?(_a(c),k!==null?(Gn(c),x1(c,k)):(Gn(c),Cg(c,A,null,y,d))):k?k!==s.memoizedState?(_a(c),Gn(c),x1(c,k)):(Gn(c),c.flags&=-16777217):(s=s.memoizedProps,s!==y&&_a(c),Gn(c),Cg(c,A,s,y,d)),null;case 27:if(Me(c),d=Ie.current,A=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==y&&_a(c);else{if(!y){if(c.stateNode===null)throw Error(i(166));return Gn(c),null}s=_e.current,ec(c)?ev(c):(s=Tx(A,y,d),c.stateNode=s,_a(c))}return Gn(c),null;case 5:if(Me(c),A=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==y&&_a(c);else{if(!y){if(c.stateNode===null)throw Error(i(166));return Gn(c),null}if(k=_e.current,ec(c))ev(c);else{var P=uf(Ie.current);switch(k){case 1:k=P.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:k=P.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":k=P.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":k=P.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":k=P.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof y.is=="string"?P.createElement("select",{is:y.is}):P.createElement("select"),y.multiple?k.multiple=!0:y.size&&(k.size=y.size);break;default:k=typeof y.is=="string"?P.createElement(A,{is:y.is}):P.createElement(A)}}k[Tn]=c,k[Qn]=y;e:for(P=c.child;P!==null;){if(P.tag===5||P.tag===6)k.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===c)break e;for(;P.sibling===null;){if(P.return===null||P.return===c)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}c.stateNode=k;e:switch(Pi(k,A,y),A){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&_a(c)}}return Gn(c),Cg(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,d),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==y&&_a(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(i(166));if(s=Ie.current,ec(c)){if(s=c.stateNode,d=c.memoizedProps,y=null,A=Li,A!==null)switch(A.tag){case 27:case 5:y=A.memoizedProps}s[Tn]=c,s=!!(s.nodeValue===d||y!==null&&y.suppressHydrationWarning===!0||yx(s.nodeValue,d)),s||io(c,!0)}else s=uf(s).createTextNode(y),s[Tn]=c,c.stateNode=s}return Gn(c),null;case 31:if(d=c.memoizedState,s===null||s.memoizedState!==null){if(y=ec(c),d!==null){if(s===null){if(!y)throw Error(i(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Tn]=c}else Zo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Gn(c),s=!1}else d=Im(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=d),s=!0;if(!s)return c.flags&256?(wr(c),c):(wr(c),null);if((c.flags&128)!==0)throw Error(i(558))}return Gn(c),null;case 13:if(y=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=ec(c),y!==null&&y.dehydrated!==null){if(s===null){if(!A)throw Error(i(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(i(317));A[Tn]=c}else Zo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Gn(c),A=!1}else A=Im(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return c.flags&256?(wr(c),c):(wr(c),null)}return wr(c),(c.flags&128)!==0?(c.lanes=d,c):(d=y!==null,s=s!==null&&s.memoizedState!==null,d&&(y=c.child,A=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(A=y.alternate.memoizedState.cachePool.pool),k=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(k=y.memoizedState.cachePool.pool),k!==A&&(y.flags|=2048)),d!==s&&d&&(c.child.flags|=8192),Kd(c,c.updateQueue),Gn(c),null);case 4:return Te(),s===null&&$g(c.stateNode.containerInfo),Gn(c),null;case 10:return pa(c.type),Gn(c),null;case 19:if(X(li),y=c.memoizedState,y===null)return Gn(c),null;if(A=(c.flags&128)!==0,k=y.rendering,k===null)if(A)Wu(y,!1);else{if(ai!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(k=Ld(s),k!==null){for(c.flags|=128,Wu(y,!1),s=k.updateQueue,c.updateQueue=s,Kd(c,s),c.subtreeFlags=0,s=d,d=c.child;d!==null;)Yb(d,s),d=d.sibling;return V(li,li.current&1|2),hn&&da(c,y.treeForkCount),c.child}s=s.sibling}y.tail!==null&&Pt()>Qd&&(c.flags|=128,A=!0,Wu(y,!1),c.lanes=4194304)}else{if(!A)if(s=Ld(k),s!==null){if(c.flags|=128,A=!0,s=s.updateQueue,c.updateQueue=s,Kd(c,s),Wu(y,!0),y.tail===null&&y.tailMode==="hidden"&&!k.alternate&&!hn)return Gn(c),null}else 2*Pt()-y.renderingStartTime>Qd&&d!==536870912&&(c.flags|=128,A=!0,Wu(y,!1),c.lanes=4194304);y.isBackwards?(k.sibling=c.child,c.child=k):(s=y.last,s!==null?s.sibling=k:c.child=k,y.last=k)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=Pt(),s.sibling=null,d=li.current,V(li,A?d&1|2:d&1),hn&&da(c,y.treeForkCount),s):(Gn(c),null);case 22:case 23:return wr(c),Gm(),y=c.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(d&536870912)!==0&&(c.flags&128)===0&&(Gn(c),c.subtreeFlags&6&&(c.flags|=8192)):Gn(c),d=c.updateQueue,d!==null&&Kd(c,d.retryQueue),d=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==d&&(c.flags|=2048),s!==null&&X(el),null;case 24:return d=null,s!==null&&(d=s.memoizedState.cache),c.memoizedState.cache!==d&&(c.flags|=2048),pa(fi),Gn(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function Pk(s,c){switch(Nm(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return pa(fi),Te(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return Me(c),null;case 31:if(c.memoizedState!==null){if(wr(c),c.alternate===null)throw Error(i(340));Zo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(wr(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Zo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return X(li),null;case 4:return Te(),null;case 10:return pa(c.type),null;case 22:case 23:return wr(c),Gm(),s!==null&&X(el),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return pa(fi),null;case 25:return null;default:return null}}function S1(s,c){switch(Nm(c),c.tag){case 3:pa(fi),Te();break;case 26:case 27:case 5:Me(c);break;case 4:Te();break;case 31:c.memoizedState!==null&&wr(c);break;case 13:wr(c);break;case 19:X(li);break;case 10:pa(c.type);break;case 22:case 23:wr(c),Gm(),s!==null&&X(el);break;case 24:pa(fi)}}function $u(s,c){try{var d=c.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var A=y.next;d=A;do{if((d.tag&s)===s){y=void 0;var k=d.create,P=d.inst;y=k(),P.destroy=y}d=d.next}while(d!==A)}}catch(Z){On(c,c.return,Z)}}function uo(s,c,d){try{var y=c.updateQueue,A=y!==null?y.lastEffect:null;if(A!==null){var k=A.next;y=k;do{if((y.tag&s)===s){var P=y.inst,Z=P.destroy;if(Z!==void 0){P.destroy=void 0,A=c;var oe=d,ke=Z;try{ke()}catch(Be){On(A,oe,Be)}}}y=y.next}while(y!==k)}}catch(Be){On(c,c.return,Be)}}function w1(s){var c=s.updateQueue;if(c!==null){var d=s.stateNode;try{fv(c,d)}catch(y){On(s,s.return,y)}}}function C1(s,c,d){d.props=sl(s.type,s.memoizedProps),d.state=s.memoizedState;try{d.componentWillUnmount()}catch(y){On(s,c,y)}}function Gu(s,c){try{var d=s.ref;if(d!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof d=="function"?s.refCleanup=d(y):d.current=y}}catch(A){On(s,c,A)}}function Ps(s,c){var d=s.ref,y=s.refCleanup;if(d!==null)if(typeof y=="function")try{y()}catch(A){On(s,c,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(A){On(s,c,A)}else d.current=null}function E1(s){var c=s.type,d=s.memoizedProps,y=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":d.autoFocus&&y.focus();break e;case"img":d.src?y.src=d.src:d.srcSet&&(y.srcset=d.srcSet)}}catch(A){On(s,s.return,A)}}function Eg(s,c,d){try{var y=s.stateNode;aT(y,s.type,d,c),y[Qn]=c}catch(A){On(s,s.return,A)}}function A1(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&_o(s.type)||s.tag===4}function Ag(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||A1(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&_o(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function kg(s,c,d){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(s,c):(c=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,c.appendChild(s),d=d._reactRootContainer,d!=null||c.onclick!==null||(c.onclick=Qe));else if(y!==4&&(y===27&&_o(s.type)&&(d=s.stateNode,c=null),s=s.child,s!==null))for(kg(s,c,d),s=s.sibling;s!==null;)kg(s,c,d),s=s.sibling}function Yd(s,c,d){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?d.insertBefore(s,c):d.appendChild(s);else if(y!==4&&(y===27&&_o(s.type)&&(d=s.stateNode),s=s.child,s!==null))for(Yd(s,c,d),s=s.sibling;s!==null;)Yd(s,c,d),s=s.sibling}function k1(s){var c=s.stateNode,d=s.memoizedProps;try{for(var y=s.type,A=c.attributes;A.length;)c.removeAttributeNode(A[0]);Pi(c,y,d),c[Tn]=s,c[Qn]=d}catch(k){On(s,s.return,k)}}var ba=!1,gi=!1,Tg=!1,T1=typeof WeakSet=="function"?WeakSet:Set,Ri=null;function Fk(s,c){if(s=s.containerInfo,Yg=yf,s=q(s),G(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var y=d.getSelection&&d.getSelection();if(y&&y.rangeCount!==0){d=y.anchorNode;var A=y.anchorOffset,k=y.focusNode;y=y.focusOffset;try{d.nodeType,k.nodeType}catch{d=null;break e}var P=0,Z=-1,oe=-1,ke=0,Be=0,He=s,Oe=null;t:for(;;){for(var Ne;He!==d||A!==0&&He.nodeType!==3||(Z=P+A),He!==k||y!==0&&He.nodeType!==3||(oe=P+y),He.nodeType===3&&(P+=He.nodeValue.length),(Ne=He.firstChild)!==null;)Oe=He,He=Ne;for(;;){if(He===s)break t;if(Oe===d&&++ke===A&&(Z=P),Oe===k&&++Be===y&&(oe=P),(Ne=He.nextSibling)!==null)break;He=Oe,Oe=He.parentNode}He=Ne}d=Z===-1||oe===-1?null:{start:Z,end:oe}}else d=null}d=d||{start:0,end:0}}else d=null;for(Xg={focusedElem:s,selectionRange:d},yf=!1,Ri=c;Ri!==null;)if(c=Ri,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Ri=s;else for(;Ri!==null;){switch(c=Ri,k=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(d=0;d<s.length;d++)A=s[d],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,d=c,A=k.memoizedProps,k=k.memoizedState,y=d.stateNode;try{var mt=sl(d.type,A);s=y.getSnapshotBeforeUpdate(mt,k),y.__reactInternalSnapshotBeforeUpdate=s}catch(Ot){On(d,d.return,Ot)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,d=s.nodeType,d===9)Qg(s);else if(d===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Qg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=c.sibling,s!==null){s.return=c.return,Ri=s;break}Ri=c.return}}function M1(s,c,d){var y=d.flags;switch(d.tag){case 0:case 11:case 15:xa(s,d),y&4&&$u(5,d);break;case 1:if(xa(s,d),y&4)if(s=d.stateNode,c===null)try{s.componentDidMount()}catch(P){On(d,d.return,P)}else{var A=sl(d.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(A,c,s.__reactInternalSnapshotBeforeUpdate)}catch(P){On(d,d.return,P)}}y&64&&w1(d),y&512&&Gu(d,d.return);break;case 3:if(xa(s,d),y&64&&(s=d.updateQueue,s!==null)){if(c=null,d.child!==null)switch(d.child.tag){case 27:case 5:c=d.child.stateNode;break;case 1:c=d.child.stateNode}try{fv(s,c)}catch(P){On(d,d.return,P)}}break;case 27:c===null&&y&4&&k1(d);case 26:case 5:xa(s,d),c===null&&y&4&&E1(d),y&512&&Gu(d,d.return);break;case 12:xa(s,d);break;case 31:xa(s,d),y&4&&N1(s,d);break;case 13:xa(s,d),y&4&&D1(s,d),y&64&&(s=d.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(d=Kk.bind(null,d),pT(s,d))));break;case 22:if(y=d.memoizedState!==null||ba,!y){c=c!==null&&c.memoizedState!==null||gi,A=ba;var k=gi;ba=y,(gi=c)&&!k?Sa(s,d,(d.subtreeFlags&8772)!==0):xa(s,d),ba=A,gi=k}break;case 30:break;default:xa(s,d)}}function R1(s){var c=s.alternate;c!==null&&(s.alternate=null,R1(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Va(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Xn=null,hr=!1;function va(s,c,d){for(d=d.child;d!==null;)O1(s,c,d),d=d.sibling}function O1(s,c,d){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(Pn,d)}catch{}switch(d.tag){case 26:gi||Ps(d,c),va(s,c,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:gi||Ps(d,c);var y=Xn,A=hr;_o(d.type)&&(Xn=d.stateNode,hr=!1),va(s,c,d),nh(d.stateNode),Xn=y,hr=A;break;case 5:gi||Ps(d,c);case 6:if(y=Xn,A=hr,Xn=null,va(s,c,d),Xn=y,hr=A,Xn!==null)if(hr)try{(Xn.nodeType===9?Xn.body:Xn.nodeName==="HTML"?Xn.ownerDocument.body:Xn).removeChild(d.stateNode)}catch(k){On(d,c,k)}else try{Xn.removeChild(d.stateNode)}catch(k){On(d,c,k)}break;case 18:Xn!==null&&(hr?(s=Xn,wx(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,d.stateNode),xc(s)):wx(Xn,d.stateNode));break;case 4:y=Xn,A=hr,Xn=d.stateNode.containerInfo,hr=!0,va(s,c,d),Xn=y,hr=A;break;case 0:case 11:case 14:case 15:uo(2,d,c),gi||uo(4,d,c),va(s,c,d);break;case 1:gi||(Ps(d,c),y=d.stateNode,typeof y.componentWillUnmount=="function"&&C1(d,c,y)),va(s,c,d);break;case 21:va(s,c,d);break;case 22:gi=(y=gi)||d.memoizedState!==null,va(s,c,d),gi=y;break;default:va(s,c,d)}}function N1(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{xc(s)}catch(d){On(c,c.return,d)}}}function D1(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{xc(s)}catch(d){On(c,c.return,d)}}function Uk(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new T1),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new T1),c;default:throw Error(i(435,s.tag))}}function Xd(s,c){var d=Uk(s);c.forEach(function(y){if(!d.has(y)){d.add(y);var A=Yk.bind(null,s,y);y.then(A,A)}})}function dr(s,c){var d=c.deletions;if(d!==null)for(var y=0;y<d.length;y++){var A=d[y],k=s,P=c,Z=P;e:for(;Z!==null;){switch(Z.tag){case 27:if(_o(Z.type)){Xn=Z.stateNode,hr=!1;break e}break;case 5:Xn=Z.stateNode,hr=!1;break e;case 3:case 4:Xn=Z.stateNode.containerInfo,hr=!0;break e}Z=Z.return}if(Xn===null)throw Error(i(160));O1(k,P,A),Xn=null,hr=!1,k=A.alternate,k!==null&&(k.return=null),A.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)I1(c,s),c=c.sibling}var hs=null;function I1(s,c){var d=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:dr(c,s),fr(s),y&4&&(uo(3,s,s.return),$u(3,s),uo(5,s,s.return));break;case 1:dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),y&64&&ba&&(s=s.updateQueue,s!==null&&(y=s.callbacks,y!==null&&(d=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=d===null?y:d.concat(y))));break;case 26:var A=hs;if(dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),y&4){var k=d!==null?d.memoizedState:null;if(y=s.memoizedState,d===null)if(y===null)if(s.stateNode===null){e:{y=s.type,d=s.memoizedProps,A=A.ownerDocument||A;t:switch(y){case"title":k=A.getElementsByTagName("title")[0],(!k||k[Qi]||k[Tn]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=A.createElement(y),A.head.insertBefore(k,A.querySelector("head > title"))),Pi(k,y,d),k[Tn]=s,ei(k),y=k;break e;case"link":var P=Ix("link","href",A).get(y+(d.href||""));if(P){for(var Z=0;Z<P.length;Z++)if(k=P[Z],k.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&k.getAttribute("rel")===(d.rel==null?null:d.rel)&&k.getAttribute("title")===(d.title==null?null:d.title)&&k.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){P.splice(Z,1);break t}}k=A.createElement(y),Pi(k,y,d),A.head.appendChild(k);break;case"meta":if(P=Ix("meta","content",A).get(y+(d.content||""))){for(Z=0;Z<P.length;Z++)if(k=P[Z],k.getAttribute("content")===(d.content==null?null:""+d.content)&&k.getAttribute("name")===(d.name==null?null:d.name)&&k.getAttribute("property")===(d.property==null?null:d.property)&&k.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&k.getAttribute("charset")===(d.charSet==null?null:d.charSet)){P.splice(Z,1);break t}}k=A.createElement(y),Pi(k,y,d),A.head.appendChild(k);break;default:throw Error(i(468,y))}k[Tn]=s,ei(k),y=k}s.stateNode=y}else Lx(A,s.type,s.stateNode);else s.stateNode=Dx(A,y,s.memoizedProps);else k!==y?(k===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):k.count--,y===null?Lx(A,s.type,s.stateNode):Dx(A,y,s.memoizedProps)):y===null&&s.stateNode!==null&&Eg(s,s.memoizedProps,d.memoizedProps)}break;case 27:dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),d!==null&&y&4&&Eg(s,s.memoizedProps,d.memoizedProps);break;case 5:if(dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),s.flags&32){A=s.stateNode;try{Et(A,"")}catch(mt){On(s,s.return,mt)}}y&4&&s.stateNode!=null&&(A=s.memoizedProps,Eg(s,A,d!==null?d.memoizedProps:A)),y&1024&&(Tg=!0);break;case 6:if(dr(c,s),fr(s),y&4){if(s.stateNode===null)throw Error(i(162));y=s.memoizedProps,d=s.stateNode;try{d.nodeValue=y}catch(mt){On(s,s.return,mt)}}break;case 3:if(ff=null,A=hs,hs=hf(c.containerInfo),dr(c,s),hs=A,fr(s),y&4&&d!==null&&d.memoizedState.isDehydrated)try{xc(c.containerInfo)}catch(mt){On(s,s.return,mt)}Tg&&(Tg=!1,L1(s));break;case 4:y=hs,hs=hf(s.stateNode.containerInfo),dr(c,s),fr(s),hs=y;break;case 12:dr(c,s),fr(s);break;case 31:dr(c,s),fr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Xd(s,y)));break;case 13:dr(c,s),fr(s),s.child.flags&8192&&s.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Jd=Pt()),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Xd(s,y)));break;case 22:A=s.memoizedState!==null;var oe=d!==null&&d.memoizedState!==null,ke=ba,Be=gi;if(ba=ke||A,gi=Be||oe,dr(c,s),gi=Be,ba=ke,fr(s),y&8192)e:for(c=s.stateNode,c._visibility=A?c._visibility&-2:c._visibility|1,A&&(d===null||oe||ba||gi||al(s)),d=null,c=s;;){if(c.tag===5||c.tag===26){if(d===null){oe=d=c;try{if(k=oe.stateNode,A)P=k.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none";else{Z=oe.stateNode;var He=oe.memoizedProps.style,Oe=He!=null&&He.hasOwnProperty("display")?He.display:null;Z.style.display=Oe==null||typeof Oe=="boolean"?"":(""+Oe).trim()}}catch(mt){On(oe,oe.return,mt)}}}else if(c.tag===6){if(d===null){oe=c;try{oe.stateNode.nodeValue=A?"":oe.memoizedProps}catch(mt){On(oe,oe.return,mt)}}}else if(c.tag===18){if(d===null){oe=c;try{var Ne=oe.stateNode;A?Cx(Ne,!0):Cx(oe.stateNode,!1)}catch(mt){On(oe,oe.return,mt)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=s.updateQueue,y!==null&&(d=y.retryQueue,d!==null&&(y.retryQueue=null,Xd(s,d))));break;case 19:dr(c,s),fr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Xd(s,y)));break;case 30:break;case 21:break;default:dr(c,s),fr(s)}}function fr(s){var c=s.flags;if(c&2){try{for(var d,y=s.return;y!==null;){if(A1(y)){d=y;break}y=y.return}if(d==null)throw Error(i(160));switch(d.tag){case 27:var A=d.stateNode,k=Ag(s);Yd(s,k,A);break;case 5:var P=d.stateNode;d.flags&32&&(Et(P,""),d.flags&=-33);var Z=Ag(s);Yd(s,Z,P);break;case 3:case 4:var oe=d.stateNode.containerInfo,ke=Ag(s);kg(s,ke,oe);break;default:throw Error(i(161))}}catch(Be){On(s,s.return,Be)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function L1(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;L1(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function xa(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)M1(s,c.alternate,c),c=c.sibling}function al(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:uo(4,c,c.return),al(c);break;case 1:Ps(c,c.return);var d=c.stateNode;typeof d.componentWillUnmount=="function"&&C1(c,c.return,d),al(c);break;case 27:nh(c.stateNode);case 26:case 5:Ps(c,c.return),al(c);break;case 22:c.memoizedState===null&&al(c);break;case 30:al(c);break;default:al(c)}s=s.sibling}}function Sa(s,c,d){for(d=d&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,A=s,k=c,P=k.flags;switch(k.tag){case 0:case 11:case 15:Sa(A,k,d),$u(4,k);break;case 1:if(Sa(A,k,d),y=k,A=y.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(ke){On(y,y.return,ke)}if(y=k,A=y.updateQueue,A!==null){var Z=y.stateNode;try{var oe=A.shared.hiddenCallbacks;if(oe!==null)for(A.shared.hiddenCallbacks=null,A=0;A<oe.length;A++)dv(oe[A],Z)}catch(ke){On(y,y.return,ke)}}d&&P&64&&w1(k),Gu(k,k.return);break;case 27:k1(k);case 26:case 5:Sa(A,k,d),d&&y===null&&P&4&&E1(k),Gu(k,k.return);break;case 12:Sa(A,k,d);break;case 31:Sa(A,k,d),d&&P&4&&N1(A,k);break;case 13:Sa(A,k,d),d&&P&4&&D1(A,k);break;case 22:k.memoizedState===null&&Sa(A,k,d),Gu(k,k.return);break;case 30:break;default:Sa(A,k,d)}c=c.sibling}}function Mg(s,c){var d=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==d&&(s!=null&&s.refCount++,d!=null&&Du(d))}function Rg(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Du(s))}function ds(s,c,d,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)B1(s,c,d,y),c=c.sibling}function B1(s,c,d,y){var A=c.flags;switch(c.tag){case 0:case 11:case 15:ds(s,c,d,y),A&2048&&$u(9,c);break;case 1:ds(s,c,d,y);break;case 3:ds(s,c,d,y),A&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Du(s)));break;case 12:if(A&2048){ds(s,c,d,y),s=c.stateNode;try{var k=c.memoizedProps,P=k.id,Z=k.onPostCommit;typeof Z=="function"&&Z(P,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(oe){On(c,c.return,oe)}}else ds(s,c,d,y);break;case 31:ds(s,c,d,y);break;case 13:ds(s,c,d,y);break;case 23:break;case 22:k=c.stateNode,P=c.alternate,c.memoizedState!==null?k._visibility&2?ds(s,c,d,y):Ku(s,c):k._visibility&2?ds(s,c,d,y):(k._visibility|=2,uc(s,c,d,y,(c.subtreeFlags&10256)!==0||!1)),A&2048&&Mg(P,c);break;case 24:ds(s,c,d,y),A&2048&&Rg(c.alternate,c);break;default:ds(s,c,d,y)}}function uc(s,c,d,y,A){for(A=A&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var k=s,P=c,Z=d,oe=y,ke=P.flags;switch(P.tag){case 0:case 11:case 15:uc(k,P,Z,oe,A),$u(8,P);break;case 23:break;case 22:var Be=P.stateNode;P.memoizedState!==null?Be._visibility&2?uc(k,P,Z,oe,A):Ku(k,P):(Be._visibility|=2,uc(k,P,Z,oe,A)),A&&ke&2048&&Mg(P.alternate,P);break;case 24:uc(k,P,Z,oe,A),A&&ke&2048&&Rg(P.alternate,P);break;default:uc(k,P,Z,oe,A)}c=c.sibling}}function Ku(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var d=s,y=c,A=y.flags;switch(y.tag){case 22:Ku(d,y),A&2048&&Mg(y.alternate,y);break;case 24:Ku(d,y),A&2048&&Rg(y.alternate,y);break;default:Ku(d,y)}c=c.sibling}}var Yu=8192;function hc(s,c,d){if(s.subtreeFlags&Yu)for(s=s.child;s!==null;)z1(s,c,d),s=s.sibling}function z1(s,c,d){switch(s.tag){case 26:hc(s,c,d),s.flags&Yu&&s.memoizedState!==null&&AT(d,hs,s.memoizedState,s.memoizedProps);break;case 5:hc(s,c,d);break;case 3:case 4:var y=hs;hs=hf(s.stateNode.containerInfo),hc(s,c,d),hs=y;break;case 22:s.memoizedState===null&&(y=s.alternate,y!==null&&y.memoizedState!==null?(y=Yu,Yu=16777216,hc(s,c,d),Yu=y):hc(s,c,d));break;default:hc(s,c,d)}}function P1(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function Xu(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var y=c[d];Ri=y,U1(y,s)}P1(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)F1(s),s=s.sibling}function F1(s){switch(s.tag){case 0:case 11:case 15:Xu(s),s.flags&2048&&uo(9,s,s.return);break;case 3:Xu(s);break;case 12:Xu(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,Zd(s)):Xu(s);break;default:Xu(s)}}function Zd(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var y=c[d];Ri=y,U1(y,s)}P1(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:uo(8,c,c.return),Zd(c);break;case 22:d=c.stateNode,d._visibility&2&&(d._visibility&=-3,Zd(c));break;default:Zd(c)}s=s.sibling}}function U1(s,c){for(;Ri!==null;){var d=Ri;switch(d.tag){case 0:case 11:case 15:uo(8,d,c);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var y=d.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Du(d.memoizedState.cache)}if(y=d.child,y!==null)y.return=d,Ri=y;else e:for(d=s;Ri!==null;){y=Ri;var A=y.sibling,k=y.return;if(R1(y),y===d){Ri=null;break e}if(A!==null){A.return=k,Ri=A;break e}Ri=k}}}var jk={getCacheForType:function(s){var c=Bi(fi),d=c.data.get(s);return d===void 0&&(d=s(),c.data.set(s,d)),d},cacheSignal:function(){return Bi(fi).controller.signal}},Hk=typeof WeakMap=="function"?WeakMap:Map,kn=0,Fn=null,an=null,cn=0,Rn=0,Cr=null,ho=!1,dc=!1,Og=!1,wa=0,ai=0,fo=0,ol=0,Ng=0,Er=0,fc=0,Zu=null,pr=null,Dg=!1,Jd=0,j1=0,Qd=1/0,ef=null,po=null,Ci=0,mo=null,pc=null,Ca=0,Ig=0,Lg=null,H1=null,Ju=0,Bg=null;function Ar(){return(kn&2)!==0&&cn!==0?cn&-cn:$.T!==null?Hg():rs()}function q1(){if(Er===0)if((cn&536870912)===0||hn){var s=As;As<<=1,(As&3932160)===0&&(As=262144),Er=s}else Er=536870912;return s=Sr.current,s!==null&&(s.flags|=32),Er}function mr(s,c,d){(s===Fn&&(Rn===2||Rn===9)||s.cancelPendingCommit!==null)&&(mc(s,0),go(s,cn,Er,!1)),dn(s,d),((kn&2)===0||s!==Fn)&&(s===Fn&&((kn&2)===0&&(ol|=d),ai===4&&go(s,cn,Er,!1)),Fs(s))}function V1(s,c,d){if((kn&6)!==0)throw Error(i(327));var y=!d&&(c&127)===0&&(c&s.expiredLanes)===0||ze(s,c),A=y?Wk(s,c):Pg(s,c,!0),k=y;do{if(A===0){dc&&!y&&go(s,c,0,!1);break}else{if(d=s.current.alternate,k&&!qk(d)){A=Pg(s,c,!1),k=!1;continue}if(A===2){if(k=c,s.errorRecoveryDisabledLanes&k)var P=0;else P=s.pendingLanes&-536870913,P=P!==0?P:P&536870912?536870912:0;if(P!==0){c=P;e:{var Z=s;A=Zu;var oe=Z.current.memoizedState.isDehydrated;if(oe&&(mc(Z,P).flags|=256),P=Pg(Z,P,!1),P!==2){if(Og&&!oe){Z.errorRecoveryDisabledLanes|=k,ol|=k,A=4;break e}k=pr,pr=A,k!==null&&(pr===null?pr=k:pr.push.apply(pr,k))}A=P}if(k=!1,A!==2)continue}}if(A===1){mc(s,0),go(s,c,0,!0);break}e:{switch(y=s,k=A,k){case 0:case 1:throw Error(i(345));case 4:if((c&4194048)!==c)break;case 6:go(y,c,Er,!ho);break e;case 2:pr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((c&62914560)===c&&(A=Jd+300-Pt(),10<A)){if(go(y,c,Er,!ho),le(y,0,!0)!==0)break e;Ca=c,y.timeoutHandle=xx(W1.bind(null,y,d,pr,ef,Dg,c,Er,ol,fc,ho,k,"Throttled",-0,0),A);break e}W1(y,d,pr,ef,Dg,c,Er,ol,fc,ho,k,null,-0,0)}}break}while(!0);Fs(s)}function W1(s,c,d,y,A,k,P,Z,oe,ke,Be,He,Oe,Ne){if(s.timeoutHandle=-1,He=c.subtreeFlags,He&8192||(He&16785408)===16785408){He={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qe},z1(c,k,He);var mt=(k&62914560)===k?Jd-Pt():(k&4194048)===k?j1-Pt():0;if(mt=kT(He,mt),mt!==null){Ca=k,s.cancelPendingCommit=mt(Q1.bind(null,s,c,k,d,y,A,P,Z,oe,Be,He,null,Oe,Ne)),go(s,k,P,!ke);return}}Q1(s,c,k,d,y,A,P,Z,oe)}function qk(s){for(var c=s;;){var d=c.tag;if((d===0||d===11||d===15)&&c.flags&16384&&(d=c.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var y=0;y<d.length;y++){var A=d[y],k=A.getSnapshot;A=A.value;try{if(!qi(k(),A))return!1}catch{return!1}}if(d=c.child,c.subtreeFlags&16384&&d!==null)d.return=c,c=d;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function go(s,c,d,y){c&=~Ng,c&=~ol,s.suspendedLanes|=c,s.pingedLanes&=~c,y&&(s.warmLanes|=c),y=s.expirationTimes;for(var A=c;0<A;){var k=31-Je(A),P=1<<k;y[k]=-1,A&=~P}d!==0&&ct(s,d,c)}function tf(){return(kn&6)===0?(Qu(0),!1):!0}function zg(){if(an!==null){if(Rn===0)var s=an.return;else s=an,fa=Jo=null,Qm(s),sc=null,Lu=0,s=an;for(;s!==null;)S1(s.alternate,s),s=s.return;an=null}}function mc(s,c){var d=s.timeoutHandle;d!==-1&&(s.timeoutHandle=-1,cT(d)),d=s.cancelPendingCommit,d!==null&&(s.cancelPendingCommit=null,d()),Ca=0,zg(),Fn=s,an=d=ha(s.current,null),cn=c,Rn=0,Cr=null,ho=!1,dc=ze(s,c),Og=!1,fc=Er=Ng=ol=fo=ai=0,pr=Zu=null,Dg=!1,(c&8)!==0&&(c|=c&32);var y=s.entangledLanes;if(y!==0)for(s=s.entanglements,y&=c;0<y;){var A=31-Je(y),k=1<<A;c|=s[A],y&=~k}return wa=c,qt(),d}function $1(s,c){Kt=null,$.H=qu,c===rc||c===Rd?(c=lv(),Rn=3):c===jm?(c=lv(),Rn=4):Rn=c===mg?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Cr=c,an===null&&(ai=1,Vd(s,Vr(c,s.current)))}function G1(){var s=Sr.current;return s===null?!0:(cn&4194048)===cn?Kr===null:(cn&62914560)===cn||(cn&536870912)!==0?s===Kr:!1}function K1(){var s=$.H;return $.H=qu,s===null?qu:s}function Y1(){var s=$.A;return $.A=jk,s}function nf(){ai=4,ho||(cn&4194048)!==cn&&Sr.current!==null||(dc=!0),(fo&134217727)===0&&(ol&134217727)===0||Fn===null||go(Fn,cn,Er,!1)}function Pg(s,c,d){var y=kn;kn|=2;var A=K1(),k=Y1();(Fn!==s||cn!==c)&&(ef=null,mc(s,c)),c=!1;var P=ai;e:do try{if(Rn!==0&&an!==null){var Z=an,oe=Cr;switch(Rn){case 8:zg(),P=6;break e;case 3:case 2:case 9:case 6:Sr.current===null&&(c=!0);var ke=Rn;if(Rn=0,Cr=null,gc(s,Z,oe,ke),d&&dc){P=0;break e}break;default:ke=Rn,Rn=0,Cr=null,gc(s,Z,oe,ke)}}Vk(),P=ai;break}catch(Be){$1(s,Be)}while(!0);return c&&s.shellSuspendCounter++,fa=Jo=null,kn=y,$.H=A,$.A=k,an===null&&(Fn=null,cn=0,qt()),P}function Vk(){for(;an!==null;)X1(an)}function Wk(s,c){var d=kn;kn|=2;var y=K1(),A=Y1();Fn!==s||cn!==c?(ef=null,Qd=Pt()+500,mc(s,c)):dc=ze(s,c);e:do try{if(Rn!==0&&an!==null){c=an;var k=Cr;t:switch(Rn){case 1:Rn=0,Cr=null,gc(s,c,k,1);break;case 2:case 9:if(av(k)){Rn=0,Cr=null,Z1(c);break}c=function(){Rn!==2&&Rn!==9||Fn!==s||(Rn=7),Fs(s)},k.then(c,c);break e;case 3:Rn=7;break e;case 4:Rn=5;break e;case 7:av(k)?(Rn=0,Cr=null,Z1(c)):(Rn=0,Cr=null,gc(s,c,k,7));break;case 5:var P=null;switch(an.tag){case 26:P=an.memoizedState;case 5:case 27:var Z=an;if(P?Bx(P):Z.stateNode.complete){Rn=0,Cr=null;var oe=Z.sibling;if(oe!==null)an=oe;else{var ke=Z.return;ke!==null?(an=ke,rf(ke)):an=null}break t}}Rn=0,Cr=null,gc(s,c,k,5);break;case 6:Rn=0,Cr=null,gc(s,c,k,6);break;case 8:zg(),ai=6;break e;default:throw Error(i(462))}}$k();break}catch(Be){$1(s,Be)}while(!0);return fa=Jo=null,$.H=y,$.A=A,kn=d,an!==null?0:(Fn=null,cn=0,qt(),ai)}function $k(){for(;an!==null&&!sn();)X1(an)}function X1(s){var c=v1(s.alternate,s,wa);s.memoizedProps=s.pendingProps,c===null?rf(s):an=c}function Z1(s){var c=s,d=c.alternate;switch(c.tag){case 15:case 0:c=p1(d,c,c.pendingProps,c.type,void 0,cn);break;case 11:c=p1(d,c,c.pendingProps,c.type.render,c.ref,cn);break;case 5:Qm(c);default:S1(d,c),c=an=Yb(c,wa),c=v1(d,c,wa)}s.memoizedProps=s.pendingProps,c===null?rf(s):an=c}function gc(s,c,d,y){fa=Jo=null,Qm(c),sc=null,Lu=0;var A=c.return;try{if(Ik(s,A,c,d,cn)){ai=1,Vd(s,Vr(d,s.current)),an=null;return}}catch(k){if(A!==null)throw an=A,k;ai=1,Vd(s,Vr(d,s.current)),an=null;return}c.flags&32768?(hn||y===1?s=!0:dc||(cn&536870912)!==0?s=!1:(ho=s=!0,(y===2||y===9||y===3||y===6)&&(y=Sr.current,y!==null&&y.tag===13&&(y.flags|=16384))),J1(c,s)):rf(c)}function rf(s){var c=s;do{if((c.flags&32768)!==0){J1(c,ho);return}s=c.return;var d=zk(c.alternate,c,wa);if(d!==null){an=d;return}if(c=c.sibling,c!==null){an=c;return}an=c=s}while(c!==null);ai===0&&(ai=5)}function J1(s,c){do{var d=Pk(s.alternate,s);if(d!==null){d.flags&=32767,an=d;return}if(d=s.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!c&&(s=s.sibling,s!==null)){an=s;return}an=s=d}while(s!==null);ai=6,an=null}function Q1(s,c,d,y,A,k,P,Z,oe){s.cancelPendingCommit=null;do sf();while(Ci!==0);if((kn&6)!==0)throw Error(i(327));if(c!==null){if(c===s.current)throw Error(i(177));if(k=c.lanes|c.childLanes,k|=vt,pt(s,d,k,P,Z,oe),s===Fn&&(an=Fn=null,cn=0),pc=c,mo=s,Ca=d,Ig=k,Lg=A,H1=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,Xk(ft,function(){return rx(),null})):(s.callbackNode=null,s.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=$.T,$.T=null,A=J.p,J.p=2,P=kn,kn|=4;try{Fk(s,c,d)}finally{kn=P,J.p=A,$.T=y}}Ci=1,ex(),tx(),nx()}}function ex(){if(Ci===1){Ci=0;var s=mo,c=pc,d=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||d){d=$.T,$.T=null;var y=J.p;J.p=2;var A=kn;kn|=4;try{I1(c,s);var k=Xg,P=q(s.containerInfo),Z=k.focusedElem,oe=k.selectionRange;if(P!==Z&&Z&&Z.ownerDocument&&z(Z.ownerDocument.documentElement,Z)){if(oe!==null&&G(Z)){var ke=oe.start,Be=oe.end;if(Be===void 0&&(Be=ke),"selectionStart"in Z)Z.selectionStart=ke,Z.selectionEnd=Math.min(Be,Z.value.length);else{var He=Z.ownerDocument||document,Oe=He&&He.defaultView||window;if(Oe.getSelection){var Ne=Oe.getSelection(),mt=Z.textContent.length,Ot=Math.min(oe.start,mt),Bn=oe.end===void 0?Ot:Math.min(oe.end,mt);!Ne.extend&&Ot>Bn&&(P=Bn,Bn=Ot,Ot=P);var be=I(Z,Ot),me=I(Z,Bn);if(be&&me&&(Ne.rangeCount!==1||Ne.anchorNode!==be.node||Ne.anchorOffset!==be.offset||Ne.focusNode!==me.node||Ne.focusOffset!==me.offset)){var Ae=He.createRange();Ae.setStart(be.node,be.offset),Ne.removeAllRanges(),Ot>Bn?(Ne.addRange(Ae),Ne.extend(me.node,me.offset)):(Ae.setEnd(me.node,me.offset),Ne.addRange(Ae))}}}}for(He=[],Ne=Z;Ne=Ne.parentNode;)Ne.nodeType===1&&He.push({element:Ne,left:Ne.scrollLeft,top:Ne.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<He.length;Z++){var Ue=He[Z];Ue.element.scrollLeft=Ue.left,Ue.element.scrollTop=Ue.top}}yf=!!Yg,Xg=Yg=null}finally{kn=A,J.p=y,$.T=d}}s.current=c,Ci=2}}function tx(){if(Ci===2){Ci=0;var s=mo,c=pc,d=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||d){d=$.T,$.T=null;var y=J.p;J.p=2;var A=kn;kn|=4;try{M1(s,c.alternate,c)}finally{kn=A,J.p=y,$.T=d}}Ci=3}}function nx(){if(Ci===4||Ci===3){Ci=0,jt();var s=mo,c=pc,d=Ca,y=H1;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Ci=5:(Ci=0,pc=mo=null,ix(s,s.pendingLanes));var A=s.pendingLanes;if(A===0&&(po=null),ur(d),c=c.stateNode,jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(Pn,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=$.T,A=J.p,J.p=2,$.T=null;try{for(var k=s.onRecoverableError,P=0;P<y.length;P++){var Z=y[P];k(Z.value,{componentStack:Z.stack})}}finally{$.T=c,J.p=A}}(Ca&3)!==0&&sf(),Fs(s),A=s.pendingLanes,(d&261930)!==0&&(A&42)!==0?s===Bg?Ju++:(Ju=0,Bg=s):Ju=0,Qu(0)}}function ix(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Du(c)))}function sf(){return ex(),tx(),nx(),rx()}function rx(){if(Ci!==5)return!1;var s=mo,c=Ig;Ig=0;var d=ur(Ca),y=$.T,A=J.p;try{J.p=32>d?32:d,$.T=null,d=Lg,Lg=null;var k=mo,P=Ca;if(Ci=0,pc=mo=null,Ca=0,(kn&6)!==0)throw Error(i(331));var Z=kn;if(kn|=4,F1(k.current),B1(k,k.current,P,d),kn=Z,Qu(0,!1),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(Pn,k)}catch{}return!0}finally{J.p=A,$.T=y,ix(s,c)}}function sx(s,c,d){c=Vr(d,c),c=pg(s.stateNode,c,2),s=oo(s,c,2),s!==null&&(dn(s,2),Fs(s))}function On(s,c,d){if(s.tag===3)sx(s,s,d);else for(;c!==null;){if(c.tag===3){sx(c,s,d);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(po===null||!po.has(y))){s=Vr(d,s),d=a1(2),y=oo(c,d,2),y!==null&&(o1(d,y,c,s),dn(y,2),Fs(y));break}}c=c.return}}function Fg(s,c,d){var y=s.pingCache;if(y===null){y=s.pingCache=new Hk;var A=new Set;y.set(c,A)}else A=y.get(c),A===void 0&&(A=new Set,y.set(c,A));A.has(d)||(Og=!0,A.add(d),s=Gk.bind(null,s,c,d),c.then(s,s))}function Gk(s,c,d){var y=s.pingCache;y!==null&&y.delete(c),s.pingedLanes|=s.suspendedLanes&d,s.warmLanes&=~d,Fn===s&&(cn&d)===d&&(ai===4||ai===3&&(cn&62914560)===cn&&300>Pt()-Jd?(kn&2)===0&&mc(s,0):Ng|=d,fc===cn&&(fc=0)),Fs(s)}function ax(s,c){c===0&&(c=Dt()),s=Mn(s,c),s!==null&&(dn(s,c),Fs(s))}function Kk(s){var c=s.memoizedState,d=0;c!==null&&(d=c.retryLane),ax(s,d)}function Yk(s,c){var d=0;switch(s.tag){case 31:case 13:var y=s.stateNode,A=s.memoizedState;A!==null&&(d=A.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(c),ax(s,d)}function Xk(s,c){return bt(s,c)}var af=null,yc=null,Ug=!1,of=!1,jg=!1,yo=0;function Fs(s){s!==yc&&s.next===null&&(yc===null?af=yc=s:yc=yc.next=s),of=!0,Ug||(Ug=!0,Jk())}function Qu(s,c){if(!jg&&of){jg=!0;do for(var d=!1,y=af;y!==null;){if(s!==0){var A=y.pendingLanes;if(A===0)var k=0;else{var P=y.suspendedLanes,Z=y.pingedLanes;k=(1<<31-Je(42|s)+1)-1,k&=A&~(P&~Z),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(d=!0,ux(y,k))}else k=cn,k=le(y,y===Fn?k:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(k&3)===0||ze(y,k)||(d=!0,ux(y,k));y=y.next}while(d);jg=!1}}function Zk(){ox()}function ox(){of=Ug=!1;var s=0;yo!==0&&lT()&&(s=yo);for(var c=Pt(),d=null,y=af;y!==null;){var A=y.next,k=lx(y,c);k===0?(y.next=null,d===null?af=A:d.next=A,A===null&&(yc=d)):(d=y,(s!==0||(k&3)!==0)&&(of=!0)),y=A}Ci!==0&&Ci!==5||Qu(s),yo!==0&&(yo=0)}function lx(s,c){for(var d=s.suspendedLanes,y=s.pingedLanes,A=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var P=31-Je(k),Z=1<<P,oe=A[P];oe===-1?((Z&d)===0||(Z&y)!==0)&&(A[P]=rt(Z,c)):oe<=c&&(s.expiredLanes|=Z),k&=~Z}if(c=Fn,d=cn,d=le(s,s===c?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y=s.callbackNode,d===0||s===c&&(Rn===2||Rn===9)||s.cancelPendingCommit!==null)return y!==null&&y!==null&&Lt(y),s.callbackNode=null,s.callbackPriority=0;if((d&3)===0||ze(s,d)){if(c=d&-d,c===s.callbackPriority)return c;switch(y!==null&&Lt(y),ur(d)){case 2:case 8:d=qe;break;case 32:d=ft;break;case 268435456:d=Bt;break;default:d=ft}return y=cx.bind(null,s),d=bt(d,y),s.callbackPriority=c,s.callbackNode=d,c}return y!==null&&y!==null&&Lt(y),s.callbackPriority=2,s.callbackNode=null,2}function cx(s,c){if(Ci!==0&&Ci!==5)return s.callbackNode=null,s.callbackPriority=0,null;var d=s.callbackNode;if(sf()&&s.callbackNode!==d)return null;var y=cn;return y=le(s,s===Fn?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y===0?null:(V1(s,y,c),lx(s,Pt()),s.callbackNode!=null&&s.callbackNode===d?cx.bind(null,s):null)}function ux(s,c){if(sf())return null;V1(s,c,!0)}function Jk(){uT(function(){(kn&6)!==0?bt(Ce,Zk):ox()})}function Hg(){if(yo===0){var s=nc;s===0&&(s=nt,nt<<=1,(nt&261888)===0&&(nt=256)),yo=s}return yo}function hx(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:er(""+s)}function dx(s,c){var d=c.ownerDocument.createElement("input");return d.name=c.name,d.value=c.value,s.id&&d.setAttribute("form",s.id),c.parentNode.insertBefore(d,c),s=new FormData(s),d.parentNode.removeChild(d),s}function Qk(s,c,d,y,A){if(c==="submit"&&d&&d.stateNode===A){var k=hx((A[Qn]||null).action),P=y.submitter;P&&(c=(c=P[Qn]||null)?hx(c.formAction):P.getAttribute("formAction"),c!==null&&(k=c,P=null));var Z=new Bl("action","action",null,y,A);s.push({event:Z,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(yo!==0){var oe=P?dx(A,P):new FormData(A);lg(d,{pending:!0,data:oe,method:A.method,action:k},null,oe)}}else typeof k=="function"&&(Z.preventDefault(),oe=P?dx(A,P):new FormData(A),lg(d,{pending:!0,data:oe,method:A.method,action:k},k,oe))},currentTarget:A}]})}}for(var qg=0;qg<at.length;qg++){var Vg=at[qg],eT=Vg.toLowerCase(),tT=Vg[0].toUpperCase()+Vg.slice(1);Ge(eT,"on"+tT)}Ge(Re,"onAnimationEnd"),Ge(xe,"onAnimationIteration"),Ge(Le,"onAnimationStart"),Ge("dblclick","onDoubleClick"),Ge("focusin","onFocus"),Ge("focusout","onBlur"),Ge(Ve,"onTransitionRun"),Ge(et,"onTransitionStart"),Ge(tt,"onTransitionCancel"),Ge($e,"onTransitionEnd"),Ye("onMouseEnter",["mouseout","mouseover"]),Ye("onMouseLeave",["mouseout","mouseover"]),Ye("onPointerEnter",["pointerout","pointerover"]),Ye("onPointerLeave",["pointerout","pointerover"]),vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eh="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(" "),nT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eh));function fx(s,c){c=(c&4)!==0;for(var d=0;d<s.length;d++){var y=s[d],A=y.event;y=y.listeners;e:{var k=void 0;if(c)for(var P=y.length-1;0<=P;P--){var Z=y[P],oe=Z.instance,ke=Z.currentTarget;if(Z=Z.listener,oe!==k&&A.isPropagationStopped())break e;k=Z,A.currentTarget=ke;try{k(A)}catch(Be){ht(Be)}A.currentTarget=null,k=oe}else for(P=0;P<y.length;P++){if(Z=y[P],oe=Z.instance,ke=Z.currentTarget,Z=Z.listener,oe!==k&&A.isPropagationStopped())break e;k=Z,A.currentTarget=ke;try{k(A)}catch(Be){ht(Be)}A.currentTarget=null,k=oe}}}}function on(s,c){var d=c[Ts];d===void 0&&(d=c[Ts]=new Set);var y=s+"__bubble";d.has(y)||(px(c,s,2,!1),d.add(y))}function Wg(s,c,d){var y=0;c&&(y|=4),px(d,s,y,c)}var lf="_reactListening"+Math.random().toString(36).slice(2);function $g(s){if(!s[lf]){s[lf]=!0,as.forEach(function(d){d!=="selectionchange"&&(nT.has(d)||Wg(d,!1,s),Wg(d,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[lf]||(c[lf]=!0,Wg("selectionchange",!1,c))}}function px(s,c,d,y){switch(qx(c)){case 2:var A=RT;break;case 8:A=OT;break;default:A=oy}d=A.bind(null,c,d,s),A=void 0,!yu||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(A=!0),y?A!==void 0?s.addEventListener(c,d,{capture:!0,passive:A}):s.addEventListener(c,d,!0):A!==void 0?s.addEventListener(c,d,{passive:A}):s.addEventListener(c,d,!1)}function Gg(s,c,d,y,A){var k=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var P=y.tag;if(P===3||P===4){var Z=y.stateNode.containerInfo;if(Z===A)break;if(P===4)for(P=y.return;P!==null;){var oe=P.tag;if((oe===3||oe===4)&&P.stateNode.containerInfo===A)return;P=P.return}for(;Z!==null;){if(P=xi(Z),P===null)return;if(oe=P.tag,oe===5||oe===6||oe===26||oe===27){y=k=P;continue e}Z=Z.parentNode}}y=y.return}Os(function(){var ke=k,Be=Ut(d),He=[];e:{var Oe=ut.get(s);if(Oe!==void 0){var Ne=Bl,mt=s;switch(s){case"keypress":if(Ka(d)===0)break e;case"keydown":case"keyup":Ne=ql;break;case"focusin":mt="focus",Ne=Ya;break;case"focusout":mt="blur",Ne=Ya;break;case"beforeblur":case"afterblur":Ne=Ya;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ne=Fl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ne=pd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ne=Cu;break;case Re:case xe:case Le:Ne=md;break;case $e:Ne=Eu;break;case"scroll":case"scrollend":Ne=zl;break;case"wheel":Ne=Wl;break;case"copy":case"cut":case"paste":Ne=Xa;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ne=wu;break;case"toggle":case"beforetoggle":Ne=_d}var Ot=(c&4)!==0,Bn=!Ot&&(s==="scroll"||s==="scrollend"),be=Ot?Oe!==null?Oe+"Capture":null:Oe;Ot=[];for(var me=ke,Ae;me!==null;){var Ue=me;if(Ae=Ue.stateNode,Ue=Ue.tag,Ue!==5&&Ue!==26&&Ue!==27||Ae===null||be===null||(Ue=ra(me,be),Ue!=null&&Ot.push(th(me,Ue,Ae))),Bn)break;me=me.return}0<Ot.length&&(Oe=new Ne(Oe,mt,null,d,Be),He.push({event:Oe,listeners:Ot}))}}if((c&7)===0){e:{if(Oe=s==="mouseover"||s==="pointerover",Ne=s==="mouseout"||s==="pointerout",Oe&&d!==dt&&(mt=d.relatedTarget||d.fromElement)&&(xi(mt)||mt[Di]))break e;if((Ne||Oe)&&(Oe=Be.window===Be?Be:(Oe=Be.ownerDocument)?Oe.defaultView||Oe.parentWindow:window,Ne?(mt=d.relatedTarget||d.toElement,Ne=ke,mt=mt?xi(mt):null,mt!==null&&(Bn=a(mt),Ot=mt.tag,mt!==Bn||Ot!==5&&Ot!==27&&Ot!==6)&&(mt=null)):(Ne=null,mt=ke),Ne!==mt)){if(Ot=Fl,Ue="onMouseLeave",be="onMouseEnter",me="mouse",(s==="pointerout"||s==="pointerover")&&(Ot=wu,Ue="onPointerLeave",be="onPointerEnter",me="pointer"),Bn=Ne==null?Oe:Ui(Ne),Ae=mt==null?Oe:Ui(mt),Oe=new Ot(Ue,me+"leave",Ne,d,Be),Oe.target=Bn,Oe.relatedTarget=Ae,Ue=null,xi(Be)===ke&&(Ot=new Ot(be,me+"enter",mt,d,Be),Ot.target=Ae,Ot.relatedTarget=Bn,Ue=Ot),Bn=Ue,Ne&&mt)t:{for(Ot=iT,be=Ne,me=mt,Ae=0,Ue=be;Ue;Ue=Ot(Ue))Ae++;Ue=0;for(var St=me;St;St=Ot(St))Ue++;for(;0<Ae-Ue;)be=Ot(be),Ae--;for(;0<Ue-Ae;)me=Ot(me),Ue--;for(;Ae--;){if(be===me||me!==null&&be===me.alternate){Ot=be;break t}be=Ot(be),me=Ot(me)}Ot=null}else Ot=null;Ne!==null&&mx(He,Oe,Ne,Ot,!1),mt!==null&&Bn!==null&&mx(He,Bn,mt,Ot,!0)}}e:{if(Oe=ke?Ui(ke):window,Ne=Oe.nodeName&&Oe.nodeName.toLowerCase(),Ne==="select"||Ne==="input"&&Oe.type==="file")var bn=Yo;else if(Kl(Oe))if(qr)bn=Qa;else{bn=ua;var _t=Cd}else Ne=Oe.nodeName,!Ne||Ne.toLowerCase()!=="input"||Oe.type!=="checkbox"&&Oe.type!=="radio"?ke&&Rs(ke.elementType)&&(bn=Yo):bn=Ru;if(bn&&(bn=bn(s,ke))){Mu(He,bn,d,Be);break e}_t&&_t(s,Oe,ke),s==="focusout"&&ke&&Oe.type==="number"&&ke.memoizedProps.value!=null&&Ms(Oe,"number",Oe.value)}switch(_t=ke?Ui(ke):window,s){case"focusin":(Kl(_t)||_t.contentEditable==="true")&&(ie=_t,ue=ke,ve=null);break;case"focusout":ve=ue=ie=null;break;case"mousedown":he=!0;break;case"contextmenu":case"mouseup":case"dragend":he=!1,ce(He,d,Be);break;case"selectionchange":if(ne)break;case"keydown":case"keyup":ce(He,d,Be)}var Zt;if(Go)e:{switch(s){case"compositionstart":var un="onCompositionStart";break e;case"compositionend":un="onCompositionEnd";break e;case"compositionupdate":un="onCompositionUpdate";break e}un=void 0}else la?Tu(s,d)&&(un="onCompositionEnd"):s==="keydown"&&d.keyCode===229&&(un="onCompositionStart");un&&($l&&d.locale!=="ko"&&(la||un!=="onCompositionStart"?un==="onCompositionEnd"&&la&&(Zt=Ga()):(Hr=Be,Ll="value"in Hr?Hr.value:Hr.textContent,la=!0)),_t=cf(ke,un),0<_t.length&&(un=new Hl(un,s,null,d,Be),He.push({event:un,listeners:_t}),Zt?un.data=Zt:(Zt=vd(d),Zt!==null&&(un.data=Zt)))),(Zt=Em?xd(s,d):Am(s,d))&&(un=cf(ke,"onBeforeInput"),0<un.length&&(_t=new Hl("onBeforeInput","beforeinput",null,d,Be),He.push({event:_t,listeners:un}),_t.data=Zt)),Qk(He,s,ke,d,Be)}fx(He,c)})}function th(s,c,d){return{instance:s,listener:c,currentTarget:d}}function cf(s,c){for(var d=c+"Capture",y=[];s!==null;){var A=s,k=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||k===null||(A=ra(s,d),A!=null&&y.unshift(th(s,A,k)),A=ra(s,c),A!=null&&y.push(th(s,A,k))),s.tag===3)return y;s=s.return}return[]}function iT(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function mx(s,c,d,y,A){for(var k=c._reactName,P=[];d!==null&&d!==y;){var Z=d,oe=Z.alternate,ke=Z.stateNode;if(Z=Z.tag,oe!==null&&oe===y)break;Z!==5&&Z!==26&&Z!==27||ke===null||(oe=ke,A?(ke=ra(d,k),ke!=null&&P.unshift(th(d,ke,oe))):A||(ke=ra(d,k),ke!=null&&P.push(th(d,ke,oe)))),d=d.return}P.length!==0&&s.push({event:c,listeners:P})}var rT=/\r\n?/g,sT=/\u0000|\uFFFD/g;function gx(s){return(typeof s=="string"?s:""+s).replace(rT,`
|
|
10
|
-
`).replace(sT,"")}function yx(s,c){return c=gx(c),gx(s)===c}function Ln(s,c,d,y,A,k){switch(d){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||Et(s,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&Et(s,""+y);break;case"className":ji(s,"class",y);break;case"tabIndex":ji(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":ji(s,d,y);break;case"style":_n(s,y,k);break;case"data":if(c!=="object"){ji(s,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||d!=="href")){s.removeAttribute(d);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(d);break}y=er(""+y),s.setAttribute(d,y);break;case"action":case"formAction":if(typeof y=="function"){s.setAttribute(d,"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 k=="function"&&(d==="formAction"?(c!=="input"&&Ln(s,c,"name",A.name,A,null),Ln(s,c,"formEncType",A.formEncType,A,null),Ln(s,c,"formMethod",A.formMethod,A,null),Ln(s,c,"formTarget",A.formTarget,A,null)):(Ln(s,c,"encType",A.encType,A,null),Ln(s,c,"method",A.method,A,null),Ln(s,c,"target",A.target,A,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(d);break}y=er(""+y),s.setAttribute(d,y);break;case"onClick":y!=null&&(s.onclick=Qe);break;case"onScroll":y!=null&&on("scroll",s);break;case"onScrollEnd":y!=null&&on("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(d=y.__html,d!=null){if(A.children!=null)throw Error(i(60));s.innerHTML=d}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}d=er(""+y),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(d,""+y):s.removeAttribute(d);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":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(d,""):s.removeAttribute(d);break;case"capture":case"download":y===!0?s.setAttribute(d,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(d,y):s.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(d,y):s.removeAttribute(d);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(d):s.setAttribute(d,y);break;case"popover":on("beforetoggle",s),on("toggle",s),Tt(s,"popover",y);break;case"xlinkActuate":Ii(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Ii(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Ii(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Ii(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Ii(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Ii(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Ii(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Ii(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Ii(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":Tt(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=cs.get(d)||d,Tt(s,d,y))}}function Kg(s,c,d,y,A,k){switch(d){case"style":_n(s,y,k);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(d=y.__html,d!=null){if(A.children!=null)throw Error(i(60));s.innerHTML=d}}break;case"children":typeof y=="string"?Et(s,y):(typeof y=="number"||typeof y=="bigint")&&Et(s,""+y);break;case"onScroll":y!=null&&on("scroll",s);break;case"onScrollEnd":y!=null&&on("scrollend",s);break;case"onClick":y!=null&&(s.onclick=Qe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ur.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(A=d.endsWith("Capture"),c=d.slice(2,A?d.length-7:void 0),k=s[Qn]||null,k=k!=null?k[d]:null,typeof k=="function"&&s.removeEventListener(c,k,A),typeof y=="function")){typeof k!="function"&&k!==null&&(d in s?s[d]=null:s.hasAttribute(d)&&s.removeAttribute(d)),s.addEventListener(c,y,A);break e}d in s?s[d]=y:y===!0?s.setAttribute(d,""):Tt(s,d,y)}}}function Pi(s,c,d){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":on("error",s),on("load",s);var y=!1,A=!1,k;for(k in d)if(d.hasOwnProperty(k)){var P=d[k];if(P!=null)switch(k){case"src":y=!0;break;case"srcSet":A=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:Ln(s,c,k,P,d,null)}}A&&Ln(s,c,"srcSet",d.srcSet,d,null),y&&Ln(s,c,"src",d.src,d,null);return;case"input":on("invalid",s);var Z=k=P=A=null,oe=null,ke=null;for(y in d)if(d.hasOwnProperty(y)){var Be=d[y];if(Be!=null)switch(y){case"name":A=Be;break;case"type":P=Be;break;case"checked":oe=Be;break;case"defaultChecked":ke=Be;break;case"value":k=Be;break;case"defaultValue":Z=Be;break;case"children":case"dangerouslySetInnerHTML":if(Be!=null)throw Error(i(137,c));break;default:Ln(s,c,y,Be,d,null)}}os(s,k,Z,oe,ke,P,A,!1);return;case"select":on("invalid",s),y=P=k=null;for(A in d)if(d.hasOwnProperty(A)&&(Z=d[A],Z!=null))switch(A){case"value":k=Z;break;case"defaultValue":P=Z;break;case"multiple":y=Z;default:Ln(s,c,A,Z,d,null)}c=k,d=P,s.multiple=!!y,c!=null?ri(s,!!y,c,!1):d!=null&&ri(s,!!y,d,!0);return;case"textarea":on("invalid",s),k=A=y=null;for(P in d)if(d.hasOwnProperty(P)&&(Z=d[P],Z!=null))switch(P){case"value":y=Z;break;case"defaultValue":A=Z;break;case"children":k=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(91));break;default:Ln(s,c,P,Z,d,null)}ls(s,y,A,k);return;case"option":for(oe in d)d.hasOwnProperty(oe)&&(y=d[oe],y!=null)&&(oe==="selected"?s.selected=y&&typeof y!="function"&&typeof y!="symbol":Ln(s,c,oe,y,d,null));return;case"dialog":on("beforetoggle",s),on("toggle",s),on("cancel",s),on("close",s);break;case"iframe":case"object":on("load",s);break;case"video":case"audio":for(y=0;y<eh.length;y++)on(eh[y],s);break;case"image":on("error",s),on("load",s);break;case"details":on("toggle",s);break;case"embed":case"source":case"link":on("error",s),on("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ke in d)if(d.hasOwnProperty(ke)&&(y=d[ke],y!=null))switch(ke){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:Ln(s,c,ke,y,d,null)}return;default:if(Rs(c)){for(Be in d)d.hasOwnProperty(Be)&&(y=d[Be],y!==void 0&&Kg(s,c,Be,y,d,void 0));return}}for(Z in d)d.hasOwnProperty(Z)&&(y=d[Z],y!=null&&Ln(s,c,Z,y,d,null))}function aT(s,c,d,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var A=null,k=null,P=null,Z=null,oe=null,ke=null,Be=null;for(Ne in d){var He=d[Ne];if(d.hasOwnProperty(Ne)&&He!=null)switch(Ne){case"checked":break;case"value":break;case"defaultValue":oe=He;default:y.hasOwnProperty(Ne)||Ln(s,c,Ne,null,y,He)}}for(var Oe in y){var Ne=y[Oe];if(He=d[Oe],y.hasOwnProperty(Oe)&&(Ne!=null||He!=null))switch(Oe){case"type":k=Ne;break;case"name":A=Ne;break;case"checked":ke=Ne;break;case"defaultChecked":Be=Ne;break;case"value":P=Ne;break;case"defaultValue":Z=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(i(137,c));break;default:Ne!==He&&Ln(s,c,Oe,Ne,y,He)}}jr(s,P,Z,oe,ke,Be,k,A);return;case"select":Ne=P=Z=Oe=null;for(k in d)if(oe=d[k],d.hasOwnProperty(k)&&oe!=null)switch(k){case"value":break;case"multiple":Ne=oe;default:y.hasOwnProperty(k)||Ln(s,c,k,null,y,oe)}for(A in y)if(k=y[A],oe=d[A],y.hasOwnProperty(A)&&(k!=null||oe!=null))switch(A){case"value":Oe=k;break;case"defaultValue":Z=k;break;case"multiple":P=k;default:k!==oe&&Ln(s,c,A,k,y,oe)}c=Z,d=P,y=Ne,Oe!=null?ri(s,!!d,Oe,!1):!!y!=!!d&&(c!=null?ri(s,!!d,c,!0):ri(s,!!d,d?[]:"",!1));return;case"textarea":Ne=Oe=null;for(Z in d)if(A=d[Z],d.hasOwnProperty(Z)&&A!=null&&!y.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:Ln(s,c,Z,null,y,A)}for(P in y)if(A=y[P],k=d[P],y.hasOwnProperty(P)&&(A!=null||k!=null))switch(P){case"value":Oe=A;break;case"defaultValue":Ne=A;break;case"children":break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(91));break;default:A!==k&&Ln(s,c,P,A,y,k)}Ho(s,Oe,Ne);return;case"option":for(var mt in d)Oe=d[mt],d.hasOwnProperty(mt)&&Oe!=null&&!y.hasOwnProperty(mt)&&(mt==="selected"?s.selected=!1:Ln(s,c,mt,null,y,Oe));for(oe in y)Oe=y[oe],Ne=d[oe],y.hasOwnProperty(oe)&&Oe!==Ne&&(Oe!=null||Ne!=null)&&(oe==="selected"?s.selected=Oe&&typeof Oe!="function"&&typeof Oe!="symbol":Ln(s,c,oe,Oe,y,Ne));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 Ot in d)Oe=d[Ot],d.hasOwnProperty(Ot)&&Oe!=null&&!y.hasOwnProperty(Ot)&&Ln(s,c,Ot,null,y,Oe);for(ke in y)if(Oe=y[ke],Ne=d[ke],y.hasOwnProperty(ke)&&Oe!==Ne&&(Oe!=null||Ne!=null))switch(ke){case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(i(137,c));break;default:Ln(s,c,ke,Oe,y,Ne)}return;default:if(Rs(c)){for(var Bn in d)Oe=d[Bn],d.hasOwnProperty(Bn)&&Oe!==void 0&&!y.hasOwnProperty(Bn)&&Kg(s,c,Bn,void 0,y,Oe);for(Be in y)Oe=y[Be],Ne=d[Be],!y.hasOwnProperty(Be)||Oe===Ne||Oe===void 0&&Ne===void 0||Kg(s,c,Be,Oe,y,Ne);return}}for(var be in d)Oe=d[be],d.hasOwnProperty(be)&&Oe!=null&&!y.hasOwnProperty(be)&&Ln(s,c,be,null,y,Oe);for(He in y)Oe=y[He],Ne=d[He],!y.hasOwnProperty(He)||Oe===Ne||Oe==null&&Ne==null||Ln(s,c,He,Oe,y,Ne)}function _x(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oT(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,d=performance.getEntriesByType("resource"),y=0;y<d.length;y++){var A=d[y],k=A.transferSize,P=A.initiatorType,Z=A.duration;if(k&&Z&&_x(P)){for(P=0,Z=A.responseEnd,y+=1;y<d.length;y++){var oe=d[y],ke=oe.startTime;if(ke>Z)break;var Be=oe.transferSize,He=oe.initiatorType;Be&&_x(He)&&(oe=oe.responseEnd,P+=Be*(oe<Z?1:(Z-ke)/(oe-ke)))}if(--y,c+=8*(k+P)/(A.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Yg=null,Xg=null;function uf(s){return s.nodeType===9?s:s.ownerDocument}function bx(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vx(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function Zg(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Jg=null;function lT(){var s=window.event;return s&&s.type==="popstate"?s===Jg?!1:(Jg=s,!0):(Jg=null,!1)}var xx=typeof setTimeout=="function"?setTimeout:void 0,cT=typeof clearTimeout=="function"?clearTimeout:void 0,Sx=typeof Promise=="function"?Promise:void 0,uT=typeof queueMicrotask=="function"?queueMicrotask:typeof Sx<"u"?function(s){return Sx.resolve(null).then(s).catch(hT)}:xx;function hT(s){setTimeout(function(){throw s})}function _o(s){return s==="head"}function wx(s,c){var d=c,y=0;do{var A=d.nextSibling;if(s.removeChild(d),A&&A.nodeType===8)if(d=A.data,d==="/$"||d==="/&"){if(y===0){s.removeChild(A),xc(c);return}y--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")y++;else if(d==="html")nh(s.ownerDocument.documentElement);else if(d==="head"){d=s.ownerDocument.head,nh(d);for(var k=d.firstChild;k;){var P=k.nextSibling,Z=k.nodeName;k[Qi]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&k.rel.toLowerCase()==="stylesheet"||d.removeChild(k),k=P}}else d==="body"&&nh(s.ownerDocument.body);d=A}while(d);xc(c)}function Cx(s,c){var d=s;s=0;do{var y=d.nextSibling;if(d.nodeType===1?c?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(c?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),y&&y.nodeType===8)if(d=y.data,d==="/$"){if(s===0)break;s--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||s++;d=y}while(d)}function Qg(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var d=c;switch(c=c.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Qg(d),Va(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}s.removeChild(d)}}function dT(s,c,d,y){for(;s.nodeType===1;){var A=d;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(y){if(!s[Qi])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==A.rel||s.getAttribute("href")!==(A.href==null||A.href===""?null:A.href)||s.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin)||s.getAttribute("title")!==(A.title==null?null:A.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(A.src==null?null:A.src)||s.getAttribute("type")!==(A.type==null?null:A.type)||s.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var k=A.name==null?null:""+A.name;if(A.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Yr(s.nextSibling),s===null)break}return null}function fT(s,c,d){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!d||(s=Yr(s.nextSibling),s===null))return null;return s}function Ex(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Yr(s.nextSibling),s===null))return null;return s}function ey(s){return s.data==="$?"||s.data==="$~"}function ty(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function pT(s,c){var d=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||d.readyState!=="loading")c();else{var y=function(){c(),d.removeEventListener("DOMContentLoaded",y)};d.addEventListener("DOMContentLoaded",y),s._reactRetry=y}}function Yr(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var ny=null;function Ax(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var d=s.data;if(d==="/$"||d==="/&"){if(c===0)return Yr(s.nextSibling);c--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||c++}s=s.nextSibling}return null}function kx(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var d=s.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(c===0)return s;c--}else d!=="/$"&&d!=="/&"||c++}s=s.previousSibling}return null}function Tx(s,c,d){switch(c=uf(d),s){case"html":if(s=c.documentElement,!s)throw Error(i(452));return s;case"head":if(s=c.head,!s)throw Error(i(453));return s;case"body":if(s=c.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function nh(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Va(s)}var Xr=new Map,Mx=new Set;function hf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ea=J.d;J.d={f:mT,r:gT,D:yT,C:_T,L:bT,m:vT,X:ST,S:xT,M:wT};function mT(){var s=Ea.f(),c=tf();return s||c}function gT(s){var c=En(s);c!==null&&c.tag===5&&c.type==="form"?$v(c):Ea.r(s)}var _c=typeof document>"u"?null:document;function Rx(s,c,d){var y=_c;if(y&&typeof c=="string"&&c){var A=hi(c);A='link[rel="'+s+'"][href="'+A+'"]',typeof d=="string"&&(A+='[crossorigin="'+d+'"]'),Mx.has(A)||(Mx.add(A),s={rel:s,crossOrigin:d,href:c},y.querySelector(A)===null&&(c=y.createElement("link"),Pi(c,"link",s),ei(c),y.head.appendChild(c)))}}function yT(s){Ea.D(s),Rx("dns-prefetch",s,null)}function _T(s,c){Ea.C(s,c),Rx("preconnect",s,c)}function bT(s,c,d){Ea.L(s,c,d);var y=_c;if(y&&s&&c){var A='link[rel="preload"][as="'+hi(c)+'"]';c==="image"&&d&&d.imageSrcSet?(A+='[imagesrcset="'+hi(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(A+='[imagesizes="'+hi(d.imageSizes)+'"]')):A+='[href="'+hi(s)+'"]';var k=A;switch(c){case"style":k=bc(s);break;case"script":k=vc(s)}Xr.has(k)||(s=f({rel:"preload",href:c==="image"&&d&&d.imageSrcSet?void 0:s,as:c},d),Xr.set(k,s),y.querySelector(A)!==null||c==="style"&&y.querySelector(ih(k))||c==="script"&&y.querySelector(rh(k))||(c=y.createElement("link"),Pi(c,"link",s),ei(c),y.head.appendChild(c)))}}function vT(s,c){Ea.m(s,c);var d=_c;if(d&&s){var y=c&&typeof c.as=="string"?c.as:"script",A='link[rel="modulepreload"][as="'+hi(y)+'"][href="'+hi(s)+'"]',k=A;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=vc(s)}if(!Xr.has(k)&&(s=f({rel:"modulepreload",href:s},c),Xr.set(k,s),d.querySelector(A)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(rh(k)))return}y=d.createElement("link"),Pi(y,"link",s),ei(y),d.head.appendChild(y)}}}function xT(s,c,d){Ea.S(s,c,d);var y=_c;if(y&&s){var A=ki(y).hoistableStyles,k=bc(s);c=c||"default";var P=A.get(k);if(!P){var Z={loading:0,preload:null};if(P=y.querySelector(ih(k)))Z.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":c},d),(d=Xr.get(k))&&iy(s,d);var oe=P=y.createElement("link");ei(oe),Pi(oe,"link",s),oe._p=new Promise(function(ke,Be){oe.onload=ke,oe.onerror=Be}),oe.addEventListener("load",function(){Z.loading|=1}),oe.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,df(P,c,y)}P={type:"stylesheet",instance:P,count:1,state:Z},A.set(k,P)}}}function ST(s,c){Ea.X(s,c);var d=_c;if(d&&s){var y=ki(d).hoistableScripts,A=vc(s),k=y.get(A);k||(k=d.querySelector(rh(A)),k||(s=f({src:s,async:!0},c),(c=Xr.get(A))&&ry(s,c),k=d.createElement("script"),ei(k),Pi(k,"link",s),d.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},y.set(A,k))}}function wT(s,c){Ea.M(s,c);var d=_c;if(d&&s){var y=ki(d).hoistableScripts,A=vc(s),k=y.get(A);k||(k=d.querySelector(rh(A)),k||(s=f({src:s,async:!0,type:"module"},c),(c=Xr.get(A))&&ry(s,c),k=d.createElement("script"),ei(k),Pi(k,"link",s),d.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},y.set(A,k))}}function Ox(s,c,d,y){var A=(A=Ie.current)?hf(A):null;if(!A)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(c=bc(d.href),d=ki(A).hoistableStyles,y=d.get(c),y||(y={type:"style",instance:null,count:0,state:null},d.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){s=bc(d.href);var k=ki(A).hoistableStyles,P=k.get(s);if(P||(A=A.ownerDocument||A,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,P),(k=A.querySelector(ih(s)))&&!k._p&&(P.instance=k,P.state.loading=5),Xr.has(s)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Xr.set(s,d),k||CT(A,s,d,P.state))),c&&y===null)throw Error(i(528,""));return P}if(c&&y!==null)throw Error(i(529,""));return null;case"script":return c=d.async,d=d.src,typeof d=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=vc(d),d=ki(A).hoistableScripts,y=d.get(c),y||(y={type:"script",instance:null,count:0,state:null},d.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function bc(s){return'href="'+hi(s)+'"'}function ih(s){return'link[rel="stylesheet"]['+s+"]"}function Nx(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function CT(s,c,d,y){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=s.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),Pi(c,"link",d),ei(c),s.head.appendChild(c))}function vc(s){return'[src="'+hi(s)+'"]'}function rh(s){return"script[async]"+s}function Dx(s,c,d){if(c.count++,c.instance===null)switch(c.type){case"style":var y=s.querySelector('style[data-href~="'+hi(d.href)+'"]');if(y)return c.instance=y,ei(y),y;var A=f({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),ei(y),Pi(y,"style",A),df(y,d.precedence,s),c.instance=y;case"stylesheet":A=bc(d.href);var k=s.querySelector(ih(A));if(k)return c.state.loading|=4,c.instance=k,ei(k),k;y=Nx(d),(A=Xr.get(A))&&iy(y,A),k=(s.ownerDocument||s).createElement("link"),ei(k);var P=k;return P._p=new Promise(function(Z,oe){P.onload=Z,P.onerror=oe}),Pi(k,"link",y),c.state.loading|=4,df(k,d.precedence,s),c.instance=k;case"script":return k=vc(d.src),(A=s.querySelector(rh(k)))?(c.instance=A,ei(A),A):(y=d,(A=Xr.get(k))&&(y=f({},d),ry(y,A)),s=s.ownerDocument||s,A=s.createElement("script"),ei(A),Pi(A,"link",y),s.head.appendChild(A),c.instance=A);case"void":return null;default:throw Error(i(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,df(y,d.precedence,s));return c.instance}function df(s,c,d){for(var y=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=y.length?y[y.length-1]:null,k=A,P=0;P<y.length;P++){var Z=y[P];if(Z.dataset.precedence===c)k=Z;else if(k!==A)break}k?k.parentNode.insertBefore(s,k.nextSibling):(c=d.nodeType===9?d.head:d,c.insertBefore(s,c.firstChild))}function iy(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function ry(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var ff=null;function Ix(s,c,d){if(ff===null){var y=new Map,A=ff=new Map;A.set(d,y)}else A=ff,y=A.get(d),y||(y=new Map,A.set(d,y));if(y.has(s))return y;for(y.set(s,null),d=d.getElementsByTagName(s),A=0;A<d.length;A++){var k=d[A];if(!(k[Qi]||k[Tn]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var P=k.getAttribute(c)||"";P=s+P;var Z=y.get(P);Z?Z.push(k):y.set(P,[k])}}return y}function Lx(s,c,d){s=s.ownerDocument||s,s.head.insertBefore(d,c==="title"?s.querySelector("head > title"):null)}function ET(s,c,d){if(d===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(s=c.disabled,typeof c.precedence=="string"&&s==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function Bx(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function AT(s,c,d,y){if(d.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var A=bc(y.href),k=c.querySelector(ih(A));if(k){c=k._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=pf.bind(s),c.then(s,s)),d.state.loading|=4,d.instance=k,ei(k);return}k=c.ownerDocument||c,y=Nx(y),(A=Xr.get(A))&&iy(y,A),k=k.createElement("link"),ei(k);var P=k;P._p=new Promise(function(Z,oe){P.onload=Z,P.onerror=oe}),Pi(k,"link",y),d.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(d,c),(c=d.state.preload)&&(d.state.loading&3)===0&&(s.count++,d=pf.bind(s),c.addEventListener("load",d),c.addEventListener("error",d))}}var sy=0;function kT(s,c){return s.stylesheets&&s.count===0&&gf(s,s.stylesheets),0<s.count||0<s.imgCount?function(d){var y=setTimeout(function(){if(s.stylesheets&&gf(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+c);0<s.imgBytes&&sy===0&&(sy=62500*oT());var A=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&gf(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>sy?50:800)+c);return s.unsuspend=d,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(A)}}:null}function pf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var mf=null;function gf(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,mf=new Map,c.forEach(TT,s),mf=null,pf.call(s))}function TT(s,c){if(!(c.state.loading&4)){var d=mf.get(s);if(d)var y=d.get(null);else{d=new Map,mf.set(s,d);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<A.length;k++){var P=A[k];(P.nodeName==="LINK"||P.getAttribute("media")!=="not all")&&(d.set(P.dataset.precedence,P),y=P)}y&&d.set(null,y)}A=c.instance,P=A.getAttribute("data-precedence"),k=d.get(P)||y,k===y&&d.set(null,A),d.set(P,A),this.count++,y=pf.bind(this),A.addEventListener("load",y),A.addEventListener("error",y),k?k.parentNode.insertBefore(A,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(A,s.firstChild)),c.state.loading|=4}}var sh={$$typeof:b,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function MT(s,c,d,y,A,k,P,Z,oe){this.tag=1,this.containerInfo=s,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=yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yn(0),this.hiddenUpdates=yn(null),this.identifierPrefix=y,this.onUncaughtError=A,this.onCaughtError=k,this.onRecoverableError=P,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=oe,this.incompleteTransitions=new Map}function zx(s,c,d,y,A,k,P,Z,oe,ke,Be,He){return s=new MT(s,c,d,P,oe,ke,Be,He,Z),c=1,k===!0&&(c|=24),k=xr(3,null,null,c),s.current=k,k.stateNode=s,c=Pm(),c.refCount++,s.pooledCache=c,c.refCount++,k.memoizedState={element:y,isDehydrated:d,cache:c},Hm(k),s}function Px(s){return s?(s=Zl,s):Zl}function Fx(s,c,d,y,A,k){A=Px(A),y.context===null?y.context=A:y.pendingContext=A,y=ao(c),y.payload={element:d},k=k===void 0?null:k,k!==null&&(y.callback=k),d=oo(s,y,c),d!==null&&(mr(d,s,c),zu(d,s,c))}function Ux(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<c?d:c}}function ay(s,c){Ux(s,c),(s=s.alternate)&&Ux(s,c)}function jx(s){if(s.tag===13||s.tag===31){var c=Mn(s,67108864);c!==null&&mr(c,s,67108864),ay(s,67108864)}}function Hx(s){if(s.tag===13||s.tag===31){var c=Ar();c=Hn(c);var d=Mn(s,c);d!==null&&mr(d,s,c),ay(s,c)}}var yf=!0;function RT(s,c,d,y){var A=$.T;$.T=null;var k=J.p;try{J.p=2,oy(s,c,d,y)}finally{J.p=k,$.T=A}}function OT(s,c,d,y){var A=$.T;$.T=null;var k=J.p;try{J.p=8,oy(s,c,d,y)}finally{J.p=k,$.T=A}}function oy(s,c,d,y){if(yf){var A=ly(y);if(A===null)Gg(s,c,y,_f,d),Vx(s,y);else if(DT(A,s,c,d,y))y.stopPropagation();else if(Vx(s,y),c&4&&-1<NT.indexOf(s)){for(;A!==null;){var k=En(A);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var P=Ai(k.pendingLanes);if(P!==0){var Z=k;for(Z.pendingLanes|=2,Z.entangledLanes|=2;P;){var oe=1<<31-Je(P);Z.entanglements[1]|=oe,P&=~oe}Fs(k),(kn&6)===0&&(Qd=Pt()+500,Qu(0))}}break;case 31:case 13:Z=Mn(k,2),Z!==null&&mr(Z,k,2),tf(),ay(k,2)}if(k=ly(y),k===null&&Gg(s,c,y,_f,d),k===A)break;A=k}A!==null&&y.stopPropagation()}else Gg(s,c,y,null,d)}}function ly(s){return s=Ut(s),cy(s)}var _f=null;function cy(s){if(_f=null,s=xi(s),s!==null){var c=a(s);if(c===null)s=null;else{var d=c.tag;if(d===13){if(s=l(c),s!==null)return s;s=null}else if(d===31){if(s=o(c),s!==null)return s;s=null}else if(d===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return _f=s,null}function qx(s){switch(s){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(Cn()){case Ce:return 2;case qe:return 8;case ft:case Ct:return 32;case Bt:return 268435456;default:return 32}default:return 32}}var uy=!1,bo=null,vo=null,xo=null,ah=new Map,oh=new Map,So=[],NT="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 Vx(s,c){switch(s){case"focusin":case"focusout":bo=null;break;case"dragenter":case"dragleave":vo=null;break;case"mouseover":case"mouseout":xo=null;break;case"pointerover":case"pointerout":ah.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":oh.delete(c.pointerId)}}function lh(s,c,d,y,A,k){return s===null||s.nativeEvent!==k?(s={blockedOn:c,domEventName:d,eventSystemFlags:y,nativeEvent:k,targetContainers:[A]},c!==null&&(c=En(c),c!==null&&jx(c)),s):(s.eventSystemFlags|=y,c=s.targetContainers,A!==null&&c.indexOf(A)===-1&&c.push(A),s)}function DT(s,c,d,y,A){switch(c){case"focusin":return bo=lh(bo,s,c,d,y,A),!0;case"dragenter":return vo=lh(vo,s,c,d,y,A),!0;case"mouseover":return xo=lh(xo,s,c,d,y,A),!0;case"pointerover":var k=A.pointerId;return ah.set(k,lh(ah.get(k)||null,s,c,d,y,A)),!0;case"gotpointercapture":return k=A.pointerId,oh.set(k,lh(oh.get(k)||null,s,c,d,y,A)),!0}return!1}function Wx(s){var c=xi(s.target);if(c!==null){var d=a(c);if(d!==null){if(c=d.tag,c===13){if(c=l(d),c!==null){s.blockedOn=c,ss(s.priority,function(){Hx(d)});return}}else if(c===31){if(c=o(d),c!==null){s.blockedOn=c,ss(s.priority,function(){Hx(d)});return}}else if(c===3&&d.stateNode.current.memoizedState.isDehydrated){s.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}s.blockedOn=null}function bf(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var d=ly(s.nativeEvent);if(d===null){d=s.nativeEvent;var y=new d.constructor(d.type,d);dt=y,d.target.dispatchEvent(y),dt=null}else return c=En(d),c!==null&&jx(c),s.blockedOn=d,!1;c.shift()}return!0}function $x(s,c,d){bf(s)&&d.delete(c)}function IT(){uy=!1,bo!==null&&bf(bo)&&(bo=null),vo!==null&&bf(vo)&&(vo=null),xo!==null&&bf(xo)&&(xo=null),ah.forEach($x),oh.forEach($x)}function vf(s,c){s.blockedOn===c&&(s.blockedOn=null,uy||(uy=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,IT)))}var xf=null;function Gx(s){xf!==s&&(xf=s,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){xf===s&&(xf=null);for(var c=0;c<s.length;c+=3){var d=s[c],y=s[c+1],A=s[c+2];if(typeof y!="function"){if(cy(y||d)===null)continue;break}var k=En(d);k!==null&&(s.splice(c,3),c-=3,lg(k,{pending:!0,data:A,method:d.method,action:y},y,A))}}))}function xc(s){function c(oe){return vf(oe,s)}bo!==null&&vf(bo,s),vo!==null&&vf(vo,s),xo!==null&&vf(xo,s),ah.forEach(c),oh.forEach(c);for(var d=0;d<So.length;d++){var y=So[d];y.blockedOn===s&&(y.blockedOn=null)}for(;0<So.length&&(d=So[0],d.blockedOn===null);)Wx(d),d.blockedOn===null&&So.shift();if(d=(s.ownerDocument||s).$$reactFormReplay,d!=null)for(y=0;y<d.length;y+=3){var A=d[y],k=d[y+1],P=A[Qn]||null;if(typeof k=="function")P||Gx(d);else if(P){var Z=null;if(k&&k.hasAttribute("formAction")){if(A=k,P=k[Qn]||null)Z=P.formAction;else if(cy(A)!==null)continue}else Z=P.action;typeof Z=="function"?d[y+1]=Z:(d.splice(y,3),y-=3),Gx(d)}}}function Kx(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(P){return A=P})},focusReset:"manual",scroll:"manual"})}function c(){A!==null&&(A(),A=null),y||setTimeout(d,20)}function d(){if(!y&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,A=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(d,100),function(){y=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),A!==null&&(A(),A=null)}}}function hy(s){this._internalRoot=s}Sf.prototype.render=hy.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(i(409));var d=c.current,y=Ar();Fx(d,y,s,c,null,null)},Sf.prototype.unmount=hy.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;Fx(s.current,2,null,s,null,null),tf(),c[Di]=null}};function Sf(s){this._internalRoot=s}Sf.prototype.unstable_scheduleHydration=function(s){if(s){var c=rs();s={blockedOn:null,target:s,priority:c};for(var d=0;d<So.length&&c!==0&&c<So[d].priority;d++);So.splice(d,0,s),d===0&&Wx(s)}};var Yx=e.version;if(Yx!=="19.2.4")throw Error(i(527,Yx,"19.2.4"));J.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=h(c),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var LT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wf.isDisabled&&wf.supportsFiber)try{Pn=wf.inject(LT),jn=wf}catch{}}return uh.createRoot=function(s,c){if(!r(s))throw Error(i(299));var d=!1,y="",A=n1,k=i1,P=r1;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(A=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(P=c.onRecoverableError)),c=zx(s,1,!1,null,null,d,y,null,A,k,P,Kx),s[Di]=c.current,$g(s),new hy(c)},uh.hydrateRoot=function(s,c,d){if(!r(s))throw Error(i(299));var y=!1,A="",k=n1,P=i1,Z=r1,oe=null;return d!=null&&(d.unstable_strictMode===!0&&(y=!0),d.identifierPrefix!==void 0&&(A=d.identifierPrefix),d.onUncaughtError!==void 0&&(k=d.onUncaughtError),d.onCaughtError!==void 0&&(P=d.onCaughtError),d.onRecoverableError!==void 0&&(Z=d.onRecoverableError),d.formState!==void 0&&(oe=d.formState)),c=zx(s,1,!0,c,d??null,y,A,oe,k,P,Z,Kx),c.context=Px(null),d=c.current,y=Ar(),y=Hn(y),A=ao(y),A.callback=null,oo(d,A,y),d=y,c.current.lanes=d,dn(c,d),Fs(c),s[Di]=c.current,$g(s),new Sf(c)},uh.version="19.2.4",uh}var sS;function $T(){if(sS)return py.exports;sS=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),py.exports=WT(),py.exports}var GT=$T();const KT="modulepreload",YT=function(n){return"/"+n},aS={},ou=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let u=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=l?.nonce||l?.getAttribute("nonce");r=u(t.map(h=>{if(h=YT(h),h in aS)return;aS[h]=!0;const p=h.endsWith(".css"),f=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":KT,p||(m.as="script"),m.crossOrigin="",m.href=h,o&&m.setAttribute("nonce",o),document.head.appendChild(m),p)return new Promise((g,_)=>{m.addEventListener("load",g),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var oS="popstate";function XT(n={}){function e(i,r){let{pathname:a,search:l,hash:o}=i.location;return W_("",{pathname:a,search:l,hash:o},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:Vh(r)}return JT(e,t,null,n)}function Zn(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function ns(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function ZT(){return Math.random().toString(36).substring(2,10)}function lS(n,e){return{usr:n.state,key:n.key,idx:e}}function W_(n,e,t=null,i){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof e=="string"?lu(e):e,state:t,key:e&&e.key||i||ZT()}}function Vh({pathname:n="/",search:e="",hash:t=""}){return e&&e!=="?"&&(n+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(n+=t.charAt(0)==="#"?t:"#"+t),n}function lu(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substring(t),n=n.substring(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substring(i),n=n.substring(0,i)),n&&(e.pathname=n)}return e}function JT(n,e,t,i={}){let{window:r=document.defaultView,v5Compat:a=!1}=i,l=r.history,o="POP",u=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function f(){o="POP";let v=p(),x=v==null?null:v-h;h=v,u&&u({action:o,location:w.location,delta:x})}function m(v,x){o="PUSH";let S=W_(w.location,v,x);h=p()+1;let b=lS(S,h),C=w.createHref(S);try{l.pushState(b,"",C)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;r.location.assign(C)}a&&u&&u({action:o,location:w.location,delta:1})}function g(v,x){o="REPLACE";let S=W_(w.location,v,x);h=p();let b=lS(S,h),C=w.createHref(S);l.replaceState(b,"",C),a&&u&&u({action:o,location:w.location,delta:0})}function _(v){return QT(v)}let w={get action(){return o},get location(){return n(r,l)},listen(v){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(oS,f),u=v,()=>{r.removeEventListener(oS,f),u=null}},createHref(v){return e(r,v)},createURL:_,encodeLocation(v){let x=_(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:g,go(v){return l.go(v)}};return w}function QT(n,e=!1){let t="http://localhost";typeof window<"u"&&(t=window.location.origin!=="null"?window.location.origin:window.location.href),Zn(t,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:Vh(n);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=t+i),new URL(i,t)}function mE(n,e,t="/"){return eM(n,e,t,!1)}function eM(n,e,t,i){let r=typeof e=="string"?lu(e):e,a=Ua(r.pathname||"/",t);if(a==null)return null;let l=gE(n);tM(l);let o=null;for(let u=0;o==null&&u<l.length;++u){let h=dM(a);o=uM(l[u],h,i)}return o}function gE(n,e=[],t=[],i="",r=!1){let a=(l,o,u=r,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(i)&&u)return;Zn(p.relativePath.startsWith(i),`Absolute route path "${p.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(i.length)}let f=Ba([i,p.relativePath]),m=t.concat(p);l.children&&l.children.length>0&&(Zn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),gE(l.children,e,m,f,u)),!(l.path==null&&!l.index)&&e.push({path:f,score:lM(f,l.index),routesMeta:m})};return n.forEach((l,o)=>{if(l.path===""||!l.path?.includes("?"))a(l,o);else for(let u of yE(l.path))a(l,o,!0,u)}),e}function yE(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),a=t.replace(/\?$/,"");if(i.length===0)return r?[a,""]:[a];let l=yE(i.join("/")),o=[];return o.push(...l.map(u=>u===""?a:[a,u].join("/"))),r&&o.push(...l),o.map(u=>n.startsWith("/")&&u===""?"/":u)}function tM(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:cM(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}var nM=/^:[\w-]+$/,iM=3,rM=2,sM=1,aM=10,oM=-2,cS=n=>n==="*";function lM(n,e){let t=n.split("/"),i=t.length;return t.some(cS)&&(i+=oM),e&&(i+=rM),t.filter(r=>!cS(r)).reduce((r,a)=>r+(nM.test(a)?iM:a===""?sM:aM),i)}function cM(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function uM(n,e,t=!1){let{routesMeta:i}=n,r={},a="/",l=[];for(let o=0;o<i.length;++o){let u=i[o],h=o===i.length-1,p=a==="/"?e:e.slice(a.length)||"/",f=Lp({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},p),m=u.route;if(!f&&h&&t&&!i[i.length-1].route.index&&(f=Lp({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(r,f.params),l.push({params:r,pathname:Ba([a,f.pathname]),pathnameBase:gM(Ba([a,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(a=Ba([a,f.pathnameBase]))}return l}function Lp(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=hM(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let a=r[0],l=a.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:i.reduce((h,{paramName:p,isOptional:f},m)=>{if(p==="*"){let _=o[m]||"";l=a.slice(0,a.length-_.length).replace(/(.)\/+$/,"$1")}const g=o[m];return f&&!g?h[p]=void 0:h[p]=(g||"").replace(/%2F/g,"/"),h},{}),pathname:a,pathnameBase:l,pattern:n}}function hM(n,e=!1,t=!0){ns(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,u)=>(i.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function dM(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ns(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),n}}function Ua(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}var fM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function pM(n,e="/"){let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?lu(n):n,a;return t?(t=t.replace(/\/\/+/g,"/"),t.startsWith("/")?a=uS(t.substring(1),"/"):a=uS(t,e)):a=e,{pathname:a,search:yM(i),hash:_M(r)}}function uS(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function _y(n,e,t,i){return`Cannot include a '${n}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mM(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function O0(n){let e=mM(n);return e.map((t,i)=>i===e.length-1?t.pathname:t.pathnameBase)}function N0(n,e,t,i=!1){let r;typeof n=="string"?r=lu(n):(r={...n},Zn(!r.pathname||!r.pathname.includes("?"),_y("?","pathname","search",r)),Zn(!r.pathname||!r.pathname.includes("#"),_y("#","pathname","hash",r)),Zn(!r.search||!r.search.includes("#"),_y("#","search","hash",r)));let a=n===""||r.pathname==="",l=a?"/":r.pathname,o;if(l==null)o=t;else{let f=e.length-1;if(!i&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),f-=1;r.pathname=m.join("/")}o=f>=0?e[f]:"/"}let u=pM(r,o),h=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&t.endsWith("/");return!u.pathname.endsWith("/")&&(h||p)&&(u.pathname+="/"),u}var Ba=n=>n.join("/").replace(/\/\/+/g,"/"),gM=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),yM=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,_M=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,bM=class{constructor(n,e,t,i=!1){this.status=n,this.statusText=e||"",this.internal=i,t instanceof Error?(this.data=t.toString(),this.error=t):this.data=t}};function vM(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function xM(n){return n.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var _E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bE(n,e){let t=n;if(typeof t!="string"||!fM.test(t))return{absoluteURL:void 0,isExternal:!1,to:t};let i=t,r=!1;if(_E)try{let a=new URL(window.location.href),l=t.startsWith("//")?new URL(a.protocol+t):new URL(t),o=Ua(l.pathname,e);l.origin===a.origin&&o!=null?t=o+l.search+l.hash:r=!0}catch{ns(!1,`<Link to="${t}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:t}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var vE=["POST","PUT","PATCH","DELETE"];new Set(vE);var SM=["GET",...vE];new Set(SM);var cu=W.createContext(null);cu.displayName="DataRouter";var sm=W.createContext(null);sm.displayName="DataRouterState";var wM=W.createContext(!1),xE=W.createContext({isTransitioning:!1});xE.displayName="ViewTransition";var CM=W.createContext(new Map);CM.displayName="Fetchers";var EM=W.createContext(null);EM.displayName="Await";var zr=W.createContext(null);zr.displayName="Navigation";var rd=W.createContext(null);rd.displayName="Location";var ws=W.createContext({outlet:null,matches:[],isDataRoute:!1});ws.displayName="Route";var D0=W.createContext(null);D0.displayName="RouteError";var SE="REACT_ROUTER_ERROR",AM="REDIRECT",kM="ROUTE_ERROR_RESPONSE";function TM(n){if(n.startsWith(`${SE}:${AM}:{`))try{let e=JSON.parse(n.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function MM(n){if(n.startsWith(`${SE}:${kM}:{`))try{let e=JSON.parse(n.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new bM(e.status,e.statusText,e.data)}catch{}}function RM(n,{relative:e}={}){Zn(uu(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:i}=W.useContext(zr),{hash:r,pathname:a,search:l}=sd(n,{relative:e}),o=a;return t!=="/"&&(o=a==="/"?t:Ba([t,a])),i.createHref({pathname:o,search:l,hash:r})}function uu(){return W.useContext(rd)!=null}function ja(){return Zn(uu(),"useLocation() may be used only in the context of a <Router> component."),W.useContext(rd).location}var wE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function CE(n){W.useContext(zr).static||W.useLayoutEffect(n)}function I0(){let{isDataRoute:n}=W.useContext(ws);return n?WM():OM()}function OM(){Zn(uu(),"useNavigate() may be used only in the context of a <Router> component.");let n=W.useContext(cu),{basename:e,navigator:t}=W.useContext(zr),{matches:i}=W.useContext(ws),{pathname:r}=ja(),a=JSON.stringify(O0(i)),l=W.useRef(!1);return CE(()=>{l.current=!0}),W.useCallback((u,h={})=>{if(ns(l.current,wE),!l.current)return;if(typeof u=="number"){t.go(u);return}let p=N0(u,JSON.parse(a),r,h.relative==="path");n==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:Ba([e,p.pathname])),(h.replace?t.replace:t.push)(p,h.state,h)},[e,t,a,r,n])}var NM=W.createContext(null);function DM(n){let e=W.useContext(ws).outlet;return W.useMemo(()=>e&&W.createElement(NM.Provider,{value:n},e),[e,n])}function sd(n,{relative:e}={}){let{matches:t}=W.useContext(ws),{pathname:i}=ja(),r=JSON.stringify(O0(t));return W.useMemo(()=>N0(n,JSON.parse(r),i,e==="path"),[n,r,i,e])}function IM(n,e){return EE(n,e)}function EE(n,e,t,i,r){Zn(uu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=W.useContext(zr),{matches:l}=W.useContext(ws),o=l[l.length-1],u=o?o.params:{},h=o?o.pathname:"/",p=o?o.pathnameBase:"/",f=o&&o.route;{let S=f&&f.path||"";kE(h,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
-
|
|
12
|
-
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=ja(),g;if(e){let S=typeof e=="string"?lu(e):e;Zn(p==="/"||S.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=m;let _=g.pathname||"/",w=_;if(p!=="/"){let S=p.replace(/^\//,"").split("/");w="/"+_.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=mE(n,{pathname:w});ns(f||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ns(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=FM(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},u,S.params),pathname:Ba([p,a.encodeLocation?a.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?p:Ba([p,a.encodeLocation?a.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),l,t,i,r);return e&&x?W.createElement(rd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},x):x}function LM(){let n=VM(),e=vM(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",n),l=W.createElement(W.Fragment,null,W.createElement("p",null,"💿 Hey developer 👋"),W.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",W.createElement("code",{style:a},"ErrorBoundary")," or"," ",W.createElement("code",{style:a},"errorElement")," prop on your route.")),W.createElement(W.Fragment,null,W.createElement("h2",null,"Unexpected Application Error!"),W.createElement("h3",{style:{fontStyle:"italic"}},e),t?W.createElement("pre",{style:r},t):null,l)}var BM=W.createElement(LM,null),AE=class extends W.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){this.props.onError?this.props.onError(n,e):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const t=MM(n.digest);t&&(n=t)}let e=n!==void 0?W.createElement(ws.Provider,{value:this.props.routeContext},W.createElement(D0.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?W.createElement(zM,{error:n},e):e}};AE.contextType=wM;var by=new WeakMap;function zM({children:n,error:e}){let{basename:t}=W.useContext(zr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=TM(e.digest);if(i){let r=by.get(e);if(r)throw r;let a=bE(i.location,t);if(_E&&!by.get(e))if(a.isExternal||i.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:i.replace}));throw by.set(e,l),l}return W.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return n}function PM({routeContext:n,match:e,children:t}){let i=W.useContext(cu);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),W.createElement(ws.Provider,{value:n},t)}function FM(n,e=[],t=null,i=null,r=null){if(n==null){if(!t)return null;if(t.errors)n=t.matches;else if(e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let a=n,l=t?.errors;if(l!=null){let p=a.findIndex(f=>f.route.id&&l?.[f.route.id]!==void 0);Zn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let o=!1,u=-1;if(t)for(let p=0;p<a.length;p++){let f=a[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=p),f.route.id){let{loaderData:m,errors:g}=t,_=f.route.loader&&!m.hasOwnProperty(f.route.id)&&(!g||g[f.route.id]===void 0);if(f.route.lazy||_){o=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}let h=t&&i?(p,f)=>{i(p,{location:t.location,params:t.matches?.[0]?.params??{},unstable_pattern:xM(t.matches),errorInfo:f})}:void 0;return a.reduceRight((p,f,m)=>{let g,_=!1,w=null,v=null;t&&(g=l&&f.route.id?l[f.route.id]:void 0,w=f.route.errorElement||BM,o&&(u<0&&m===0?(kE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,v=null):u===m&&(_=!0,v=f.route.hydrateFallbackElement||null)));let x=e.concat(a.slice(0,m+1)),S=()=>{let b;return g?b=w:_?b=v:f.route.Component?b=W.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=p,W.createElement(PM,{match:f,routeContext:{outlet:p,matches:x,isDataRoute:t!=null},children:b})};return t&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?W.createElement(AE,{location:t.location,revalidation:t.revalidation,component:w,error:g,children:S(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:h}):S()},null)}function L0(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function UM(n){let e=W.useContext(cu);return Zn(e,L0(n)),e}function jM(n){let e=W.useContext(sm);return Zn(e,L0(n)),e}function HM(n){let e=W.useContext(ws);return Zn(e,L0(n)),e}function B0(n){let e=HM(n),t=e.matches[e.matches.length-1];return Zn(t.route.id,`${n} can only be used on routes that contain a unique "id"`),t.route.id}function qM(){return B0("useRouteId")}function VM(){let n=W.useContext(D0),e=jM("useRouteError"),t=B0("useRouteError");return n!==void 0?n:e.errors?.[t]}function WM(){let{router:n}=UM("useNavigate"),e=B0("useNavigate"),t=W.useRef(!1);return CE(()=>{t.current=!0}),W.useCallback(async(r,a={})=>{ns(t.current,wE),t.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:e,...a}))},[n,e])}var hS={};function kE(n,e,t){!e&&!hS[n]&&(hS[n]=!0,ns(!1,t))}W.memo($M);function $M({routes:n,future:e,state:t,onError:i}){return EE(n,void 0,t,i,e)}function GM({to:n,replace:e,state:t,relative:i}){Zn(uu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=W.useContext(zr);ns(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=W.useContext(ws),{pathname:l}=ja(),o=I0(),u=N0(n,O0(a),l,i==="path"),h=JSON.stringify(u);return W.useEffect(()=>{o(JSON.parse(h),{replace:e,state:t,relative:i})},[o,h,i,e,t]),null}function KM(n){return DM(n.context)}function Da(n){Zn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function YM({basename:n="/",children:e=null,location:t,navigationType:i="POP",navigator:r,static:a=!1,unstable_useTransitions:l}){Zn(!uu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=n.replace(/^\/*/,"/"),u=W.useMemo(()=>({basename:o,navigator:r,static:a,unstable_useTransitions:l,future:{}}),[o,r,a,l]);typeof t=="string"&&(t=lu(t));let{pathname:h="/",search:p="",hash:f="",state:m=null,key:g="default"}=t,_=W.useMemo(()=>{let w=Ua(h,o);return w==null?null:{location:{pathname:w,search:p,hash:f,state:m,key:g},navigationType:i}},[o,h,p,f,m,g,i]);return ns(_!=null,`<Router basename="${o}"> is not able to match the URL "${h}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:W.createElement(zr.Provider,{value:u},W.createElement(rd.Provider,{children:e,value:_}))}function XM({children:n,location:e}){return IM($_(n),e)}function $_(n,e=[]){let t=[];return W.Children.forEach(n,(i,r)=>{if(!W.isValidElement(i))return;let a=[...e,r];if(i.type===W.Fragment){t.push.apply(t,$_(i.props.children,a));return}Zn(i.type===Da,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Zn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||a.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=$_(i.props.children,a)),t.push(l)}),t}var kp="get",Tp="application/x-www-form-urlencoded";function am(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function ZM(n){return am(n)&&n.tagName.toLowerCase()==="button"}function JM(n){return am(n)&&n.tagName.toLowerCase()==="form"}function QM(n){return am(n)&&n.tagName.toLowerCase()==="input"}function eR(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function tR(n,e){return n.button===0&&(!e||e==="_self")&&!eR(n)}function G_(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let i=n[t];return e.concat(Array.isArray(i)?i.map(r=>[t,r]):[[t,i]])},[]))}function nR(n,e){let t=G_(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(a=>{t.append(r,a)})}),t}var Cf=null;function iR(){if(Cf===null)try{new FormData(document.createElement("form"),0),Cf=!1}catch{Cf=!0}return Cf}var rR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vy(n){return n!=null&&!rR.has(n)?(ns(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tp}"`),null):n}function sR(n,e){let t,i,r,a,l;if(JM(n)){let o=n.getAttribute("action");i=o?Ua(o,e):null,t=n.getAttribute("method")||kp,r=vy(n.getAttribute("enctype"))||Tp,a=new FormData(n)}else if(ZM(n)||QM(n)&&(n.type==="submit"||n.type==="image")){let o=n.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=n.getAttribute("formaction")||o.getAttribute("action");if(i=u?Ua(u,e):null,t=n.getAttribute("formmethod")||o.getAttribute("method")||kp,r=vy(n.getAttribute("formenctype"))||vy(o.getAttribute("enctype"))||Tp,a=new FormData(o,n),!iR()){let{name:h,type:p,value:f}=n;if(p==="image"){let m=h?`${h}.`:"";a.append(`${m}x`,"0"),a.append(`${m}y`,"0")}else h&&a.append(h,f)}}else{if(am(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=kp,i=null,r=Tp,l=n}return a&&r==="text/plain"&&(l=a,a=void 0),{action:i,method:t.toLowerCase(),encType:r,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function z0(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function aR(n,e,t,i){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return t?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&Ua(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function oR(n,e){if(n.id in e)return e[n.id];try{let t=await import(n.module);return e[n.id]=t,t}catch(t){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lR(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function cR(n,e,t){let i=await Promise.all(n.map(async r=>{let a=e.routes[r.route.id];if(a){let l=await oR(a,t);return l.links?l.links():[]}return[]}));return fR(i.flat(1).filter(lR).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function dS(n,e,t,i,r,a){let l=(u,h)=>t[h]?u.route.id!==t[h].route.id:!0,o=(u,h)=>t[h].pathname!==u.pathname||t[h].route.path?.endsWith("*")&&t[h].params["*"]!==u.params["*"];return a==="assets"?e.filter((u,h)=>l(u,h)||o(u,h)):a==="data"?e.filter((u,h)=>{let p=i.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(l(u,h)||o(u,h))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:t[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function uR(n,e,{includeHydrateFallback:t}={}){return hR(n.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),t&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))}function hR(n){return[...new Set(n)]}function dR(n){let e={},t=Object.keys(n).sort();for(let i of t)e[i]=n[i];return e}function fR(n,e){let t=new Set;return new Set(e),n.reduce((i,r)=>{let a=JSON.stringify(dR(r));return t.has(a)||(t.add(a),i.push({key:a,link:r})),i},[])}function TE(){let n=W.useContext(cu);return z0(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function pR(){let n=W.useContext(sm);return z0(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var P0=W.createContext(void 0);P0.displayName="FrameworkContext";function ME(){let n=W.useContext(P0);return z0(n,"You must render this element inside a <HydratedRouter> element"),n}function mR(n,e){let t=W.useContext(P0),[i,r]=W.useState(!1),[a,l]=W.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:h,onMouseLeave:p,onTouchStart:f}=e,m=W.useRef(null);W.useEffect(()=>{if(n==="render"&&l(!0),n==="viewport"){let w=x=>{x.forEach(S=>{l(S.isIntersecting)})},v=new IntersectionObserver(w,{threshold:.5});return m.current&&v.observe(m.current),()=>{v.disconnect()}}},[n]),W.useEffect(()=>{if(i){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[i]);let g=()=>{r(!0)},_=()=>{r(!1),l(!1)};return t?n!=="intent"?[a,m,{}]:[a,m,{onFocus:hh(o,g),onBlur:hh(u,_),onMouseEnter:hh(h,g),onMouseLeave:hh(p,_),onTouchStart:hh(f,g)}]:[!1,m,{}]}function hh(n,e){return t=>{n&&n(t),t.defaultPrevented||e(t)}}function gR({page:n,...e}){let{router:t}=TE(),i=W.useMemo(()=>mE(t.routes,n,t.basename),[t.routes,n,t.basename]);return i?W.createElement(_R,{page:n,matches:i,...e}):null}function yR(n){let{manifest:e,routeModules:t}=ME(),[i,r]=W.useState([]);return W.useEffect(()=>{let a=!1;return cR(n,e,t).then(l=>{a||r(l)}),()=>{a=!0}},[n,e,t]),i}function _R({page:n,matches:e,...t}){let i=ja(),{future:r,manifest:a,routeModules:l}=ME(),{basename:o}=TE(),{loaderData:u,matches:h}=pR(),p=W.useMemo(()=>dS(n,e,h,a,i,"data"),[n,e,h,a,i]),f=W.useMemo(()=>dS(n,e,h,a,i,"assets"),[n,e,h,a,i]),m=W.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let w=new Set,v=!1;if(e.forEach(S=>{let b=a.routes[S.route.id];!b||!b.hasLoader||(!p.some(C=>C.route.id===S.route.id)&&S.route.id in u&&l[S.route.id]?.shouldRevalidate||b.hasClientLoader?v=!0:w.add(S.route.id))}),w.size===0)return[];let x=aR(n,o,r.unstable_trailingSlashAwareDataRequests,"data");return v&&w.size>0&&x.searchParams.set("_routes",e.filter(S=>w.has(S.route.id)).map(S=>S.route.id).join(",")),[x.pathname+x.search]},[o,r.unstable_trailingSlashAwareDataRequests,u,i,a,p,e,n,l]),g=W.useMemo(()=>uR(f,a),[f,a]),_=yR(f);return W.createElement(W.Fragment,null,m.map(w=>W.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...t})),g.map(w=>W.createElement("link",{key:w,rel:"modulepreload",href:w,...t})),_.map(({key:w,link:v})=>W.createElement("link",{key:w,nonce:t.nonce,...v,crossOrigin:v.crossOrigin??t.crossOrigin})))}function bR(...n){return e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var vR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vR&&(window.__reactRouterVersion="7.13.0")}catch{}function xR({basename:n,children:e,unstable_useTransitions:t,window:i}){let r=W.useRef();r.current==null&&(r.current=XT({window:i,v5Compat:!0}));let a=r.current,[l,o]=W.useState({action:a.action,location:a.location}),u=W.useCallback(h=>{t===!1?o(h):W.startTransition(()=>o(h))},[t]);return W.useLayoutEffect(()=>a.listen(u),[a,u]),W.createElement(YM,{basename:n,children:e,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:t})}var RE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,OE=W.forwardRef(function({onClick:e,discover:t="render",prefetch:i="none",relative:r,reloadDocument:a,replace:l,state:o,target:u,to:h,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:m,...g},_){let{basename:w,unstable_useTransitions:v}=W.useContext(zr),x=typeof h=="string"&&RE.test(h),S=bE(h,w);h=S.to;let b=RM(h,{relative:r}),[C,O,M]=mR(i,g),D=CR(h,{replace:l,state:o,target:u,preventScrollReset:p,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:v});function N(j){e&&e(j),j.defaultPrevented||D(j)}let L=W.createElement("a",{...g,...M,href:S.absoluteURL||b,onClick:S.isExternal||a?e:N,ref:bR(_,O),target:u,"data-discover":!x&&t==="render"?"true":void 0});return C&&!x?W.createElement(W.Fragment,null,L,W.createElement(gR,{page:b})):L});OE.displayName="Link";var NE=W.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:i="",end:r=!1,style:a,to:l,viewTransition:o,children:u,...h},p){let f=sd(l,{relative:h.relative}),m=ja(),g=W.useContext(sm),{navigator:_,basename:w}=W.useContext(zr),v=g!=null&&MR(f)&&o===!0,x=_.encodeLocation?_.encodeLocation(f).pathname:f.pathname,S=m.pathname,b=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;t||(S=S.toLowerCase(),b=b?b.toLowerCase():null,x=x.toLowerCase()),b&&w&&(b=Ua(b,w)||b);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let O=S===x||!r&&S.startsWith(x)&&S.charAt(C)==="/",M=b!=null&&(b===x||!r&&b.startsWith(x)&&b.charAt(x.length)==="/"),D={isActive:O,isPending:M,isTransitioning:v},N=O?e:void 0,L;typeof i=="function"?L=i(D):L=[i,O?"active":null,M?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let j=typeof a=="function"?a(D):a;return W.createElement(OE,{...h,"aria-current":N,className:L,ref:p,style:j,to:l,viewTransition:o},typeof u=="function"?u(D):u)});NE.displayName="NavLink";var SR=W.forwardRef(({discover:n="render",fetcherKey:e,navigate:t,reloadDocument:i,replace:r,state:a,method:l=kp,action:o,onSubmit:u,relative:h,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:m,...g},_)=>{let{unstable_useTransitions:w}=W.useContext(zr),v=kR(),x=TR(o,{relative:h}),S=l.toLowerCase()==="get"?"get":"post",b=typeof o=="string"&&RE.test(o),C=O=>{if(u&&u(O),O.defaultPrevented)return;O.preventDefault();let M=O.nativeEvent.submitter,D=M?.getAttribute("formmethod")||l,N=()=>v(M||O.currentTarget,{fetcherKey:e,method:D,navigate:t,replace:r,state:a,relative:h,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:m});w&&t!==!1?W.startTransition(()=>N()):N()};return W.createElement("form",{ref:_,method:S,action:x,onSubmit:i?u:C,...g,"data-discover":!b&&n==="render"?"true":void 0})});SR.displayName="Form";function wR(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function DE(n){let e=W.useContext(cu);return Zn(e,wR(n)),e}function CR(n,{target:e,replace:t,state:i,preventScrollReset:r,relative:a,viewTransition:l,unstable_defaultShouldRevalidate:o,unstable_useTransitions:u}={}){let h=I0(),p=ja(),f=sd(n,{relative:a});return W.useCallback(m=>{if(tR(m,e)){m.preventDefault();let g=t!==void 0?t:Vh(p)===Vh(f),_=()=>h(n,{replace:g,state:i,preventScrollReset:r,relative:a,viewTransition:l,unstable_defaultShouldRevalidate:o});u?W.startTransition(()=>_()):_()}},[p,h,f,t,i,e,n,r,a,l,o,u])}function NW(n){ns(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=W.useRef(G_(n)),t=W.useRef(!1),i=ja(),r=W.useMemo(()=>nR(i.search,t.current?null:e.current),[i.search]),a=I0(),l=W.useCallback((o,u)=>{const h=G_(typeof o=="function"?o(new URLSearchParams(r)):o);t.current=!0,a("?"+h,u)},[a,r]);return[r,l]}var ER=0,AR=()=>`__${String(++ER)}__`;function kR(){let{router:n}=DE("useSubmit"),{basename:e}=W.useContext(zr),t=qM(),i=n.fetch,r=n.navigate;return W.useCallback(async(a,l={})=>{let{action:o,method:u,encType:h,formData:p,body:f}=sR(a,e);if(l.navigate===!1){let m=l.fetcherKey||AR();await i(m,t,l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:f,formMethod:l.method||u,formEncType:l.encType||h,flushSync:l.flushSync})}else await r(l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:f,formMethod:l.method||u,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:t,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,t])}function TR(n,{relative:e}={}){let{basename:t}=W.useContext(zr),i=W.useContext(ws);Zn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),a={...sd(n||".",{relative:e})},l=ja();if(n==null){a.search=l.search;let o=new URLSearchParams(a.search),u=o.getAll("index");if(u.some(p=>p==="")){o.delete("index"),u.filter(f=>f).forEach(f=>o.append("index",f));let p=o.toString();a.search=p?`?${p}`:""}}return(!n||n===".")&&r.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(a.pathname=a.pathname==="/"?t:Ba([t,a.pathname])),Vh(a)}function MR(n,{relative:e}={}){let t=W.useContext(xE);Zn(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=DE("useViewTransitionState"),r=sd(n,{relative:e});if(!t.isTransitioning)return!1;let a=Ua(t.currentLocation.pathname,i)||t.currentLocation.pathname,l=Ua(t.nextLocation.pathname,i)||t.nextLocation.pathname;return Lp(r.pathname,l)!=null||Lp(r.pathname,a)!=null}var om=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},RR={setTimeout:(n,e)=>setTimeout(n,e),clearTimeout:n=>clearTimeout(n),setInterval:(n,e)=>setInterval(n,e),clearInterval:n=>clearInterval(n)},OR=class{#e=RR;#n=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,e){return this.#e.setTimeout(n,e)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,e){return this.#e.setInterval(n,e)}clearInterval(n){this.#e.clearInterval(n)}},K_=new OR;function NR(n){setTimeout(n,0)}var lm=typeof window>"u"||"Deno"in globalThis;function _s(){}function DR(n,e){return typeof n=="function"?n(e):n}function IR(n){return typeof n=="number"&&n>=0&&n!==1/0}function LR(n,e){return Math.max(n+(e||0)-Date.now(),0)}function Y_(n,e){return typeof n=="function"?n(e):n}function BR(n,e){return typeof n=="function"?n(e):n}function fS(n,e){const{type:t="all",exact:i,fetchStatus:r,predicate:a,queryKey:l,stale:o}=n;if(l){if(i){if(e.queryHash!==F0(l,e.options))return!1}else if(!$h(e.queryKey,l))return!1}if(t!=="all"){const u=e.isActive();if(t==="active"&&!u||t==="inactive"&&u)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||r&&r!==e.state.fetchStatus||a&&!a(e))}function pS(n,e){const{exact:t,status:i,predicate:r,mutationKey:a}=n;if(a){if(!e.options.mutationKey)return!1;if(t){if(Wh(e.options.mutationKey)!==Wh(a))return!1}else if(!$h(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function F0(n,e){return(e?.queryKeyHashFn||Wh)(n)}function Wh(n){return JSON.stringify(n,(e,t)=>X_(t)?Object.keys(t).sort().reduce((i,r)=>(i[r]=t[r],i),{}):t)}function $h(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(t=>$h(n[t],e[t])):!1}var zR=Object.prototype.hasOwnProperty;function IE(n,e,t=0){if(n===e)return n;if(t>500)return e;const i=mS(n)&&mS(e);if(!i&&!(X_(n)&&X_(e)))return e;const a=(i?n:Object.keys(n)).length,l=i?e:Object.keys(e),o=l.length,u=i?new Array(o):{};let h=0;for(let p=0;p<o;p++){const f=i?p:l[p],m=n[f],g=e[f];if(m===g){u[f]=m,(i?p<a:zR.call(n,f))&&h++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[f]=g;continue}const _=IE(m,g,t+1);u[f]=_,_===m&&h++}return a===o&&h===a?n:u}function DW(n,e){if(!e||Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}function mS(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function X_(n){if(!gS(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!gS(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function gS(n){return Object.prototype.toString.call(n)==="[object Object]"}function PR(n){return new Promise(e=>{K_.setTimeout(e,n)})}function FR(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?IE(n,e):e}function UR(n,e,t=0){const i=[...n,e];return t&&i.length>t?i.slice(1):i}function jR(n,e,t=0){const i=[e,...n];return t&&i.length>t?i.slice(0,-1):i}var U0=Symbol();function LE(n,e){return!n.queryFn&&e?.initialPromise?()=>e.initialPromise:!n.queryFn||n.queryFn===U0?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function IW(n,e){return typeof n=="function"?n(...e):!!n}function HR(n,e,t){let i=!1,r;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?t():r.addEventListener("abort",t,{once:!0})),r)}),n}var qR=class extends om{#e;#n;#t;constructor(){super(),this.#t=n=>{if(!lm&&window.addEventListener){const e=()=>n();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(n){this.#t=n,this.#n?.(),this.#n=n(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(e=>{e(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},BE=new qR;function VR(){let n,e;const t=new Promise((r,a)=>{n=r,e=a});t.status="pending",t.catch(()=>{});function i(r){Object.assign(t,r),delete t.resolve,delete t.reject}return t.resolve=r=>{i({status:"fulfilled",value:r}),n(r)},t.reject=r=>{i({status:"rejected",reason:r}),e(r)},t}var WR=NR;function $R(){let n=[],e=0,t=o=>{o()},i=o=>{o()},r=WR;const a=o=>{e?n.push(o):r(()=>{t(o)})},l=()=>{const o=n;n=[],o.length&&r(()=>{i(()=>{o.forEach(u=>{t(u)})})})};return{batch:o=>{let u;e++;try{u=o()}finally{e--,e||l()}return u},batchCalls:o=>(...u)=>{a(()=>{o(...u)})},schedule:a,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{i=o},setScheduler:o=>{r=o}}}var rr=$R(),GR=class extends om{#e=!0;#n;#t;constructor(){super(),this.#t=n=>{if(!lm&&window.addEventListener){const e=()=>n(!0),t=()=>n(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(n){this.#t=n,this.#n?.(),this.#n=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(t=>{t(n)}))}isOnline(){return this.#e}},Bp=new GR;function KR(n){return Math.min(1e3*2**n,3e4)}function zE(n){return(n??"online")==="online"?Bp.isOnline():!0}var Z_=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function PE(n){let e=!1,t=0,i;const r=VR(),a=()=>r.status!=="pending",l=w=>{if(!a()){const v=new Z_(w);m(v),n.onCancel?.(v)}},o=()=>{e=!0},u=()=>{e=!1},h=()=>BE.isFocused()&&(n.networkMode==="always"||Bp.isOnline())&&n.canRun(),p=()=>zE(n.networkMode)&&n.canRun(),f=w=>{a()||(i?.(),r.resolve(w))},m=w=>{a()||(i?.(),r.reject(w))},g=()=>new Promise(w=>{i=v=>{(a()||h())&&w(v)},n.onPause?.()}).then(()=>{i=void 0,a()||n.onContinue?.()}),_=()=>{if(a())return;let w;const v=t===0?n.initialPromise:void 0;try{w=v??n.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(f).catch(x=>{if(a())return;const S=n.retry??(lm?0:3),b=n.retryDelay??KR,C=typeof b=="function"?b(t,x):b,O=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,x);if(e||!O){m(x);return}t++,n.onFail?.(t,x),PR(C).then(()=>h()?void 0:g()).then(()=>{e?m(x):_()})})};return{promise:r,status:()=>r.status,cancel:l,continue:()=>(i?.(),r),cancelRetry:o,continueRetry:u,canStart:p,start:()=>(p()?_():g().then(_),r)}}var FE=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),IR(this.gcTime)&&(this.#e=K_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(lm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(K_.clearTimeout(this.#e),this.#e=void 0)}},YR=class extends FE{#e;#n;#t;#r;#i;#a;#o;constructor(n){super(),this.#o=!1,this.#a=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#r=n.client,this.#t=this.#r.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#e=_S(this.options),this.state=n.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(n){if(this.options={...this.#a,...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=_S(this.options);e.data!==void 0&&(this.setState(yS(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(n,e){const t=FR(this.state.data,n,this.options);return this.#s({data:t,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),t}setState(n,e){this.#s({type:"setState",state:n,setStateOptions:e})}cancel(n){const e=this.#i?.promise;return this.#i?.cancel(n),e?e.then(_s).catch(_s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(n=>BR(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===U0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Y_(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!LR(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(e=>e!==n),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(n,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(n&&this.setOptions(n),!this.options.queryFn){const o=this.observers.find(u=>u.options.queryFn);o&&this.setOptions(o.options)}const t=new AbortController,i=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#o=!0,t.signal)})},r=()=>{const o=LE(this.options,e),h=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(p),p})();return this.#o=!1,this.options.persister?this.options.persister(o,h,this):o(h)},l=(()=>{const o={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:r};return i(o),o})();this.options.behavior?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=PE({initialPromise:e?.initialPromise,fn:l.fetchFn,onCancel:o=>{o instanceof Z_&&o.revert&&this.setState({...this.#n,fetchStatus:"idle"}),t.abort()},onFail:(o,u)=>{this.#s({type:"failed",failureCount:o,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const o=await this.#i.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#t.config.onSuccess?.(o,this),this.#t.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof Z_){if(o.silent)return this.#i.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#s({type:"error",error:o}),this.#t.config.onError?.(o,this),this.#t.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#s(n){const e=t=>{switch(n.type){case"failed":return{...t,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...XR(t.data,this.options),fetchMeta:n.meta??null};case"success":const i={...t,...yS(n.data,n.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?i:void 0,i;case"error":const r=n.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...n.state}}};this.state=e(this.state),rr.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:n})})}};function XR(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zE(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function yS(n,e){return{data:n,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _S(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,i=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}function bS(n){return{onFetch:(e,t)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],l=e.state.data?.pageParams||[];let o={pages:[],pageParams:[]},u=0;const h=async()=>{let p=!1;const f=_=>{HR(_,()=>e.signal,()=>p=!0)},m=LE(e.options,e.fetchOptions),g=async(_,w,v)=>{if(p)return Promise.reject();if(w==null&&_.pages.length)return Promise.resolve(_);const S=(()=>{const M={client:e.client,queryKey:e.queryKey,pageParam:w,direction:v?"backward":"forward",meta:e.options.meta};return f(M),M})(),b=await m(S),{maxPages:C}=e.options,O=v?jR:UR;return{pages:O(_.pages,b,C),pageParams:O(_.pageParams,w,C)}};if(r&&a.length){const _=r==="backward",w=_?ZR:vS,v={pages:a,pageParams:l},x=w(i,v);o=await g(v,x,_)}else{const _=n??a.length;do{const w=u===0?l[0]??i.initialPageParam:vS(i,o);if(u>0&&w==null)break;o=await g(o,w),u++}while(u<_)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=h}}}function vS(n,{pages:e,pageParams:t}){const i=e.length-1;return e.length>0?n.getNextPageParam(e[i],e,t[i],t):void 0}function ZR(n,{pages:e,pageParams:t}){return e.length>0?n.getPreviousPageParam?.(e[0],e,t[0],t):void 0}var JR=class extends FE{#e;#n;#t;#r;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#t=n.mutationCache,this.#n=[],this.state=n.state||QR(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#n.includes(n)||(this.#n.push(n),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#n=this.#n.filter(e=>e!==n),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(n){const e=()=>{this.#i({type:"continue"})},t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=PE({fn:()=>this.options.mutationFn?this.options.mutationFn(n,t):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#i({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const i=this.state.status==="pending",r=!this.#r.canStart();try{if(i)e();else{this.#i({type:"pending",variables:n,isPaused:r}),this.#t.config.onMutate&&await this.#t.config.onMutate(n,this,t);const l=await this.options.onMutate?.(n,t);l!==this.state.context&&this.#i({type:"pending",context:l,variables:n,isPaused:r})}const a=await this.#r.start();return await this.#t.config.onSuccess?.(a,n,this.state.context,this,t),await this.options.onSuccess?.(a,n,this.state.context,t),await this.#t.config.onSettled?.(a,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(a,null,n,this.state.context,t),this.#i({type:"success",data:a}),a}catch(a){try{await this.#t.config.onError?.(a,n,this.state.context,this,t)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,n,this.state.context,t)}catch(l){Promise.reject(l)}try{await this.#t.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,t)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,n,this.state.context,t)}catch(l){Promise.reject(l)}throw this.#i({type:"error",error:a}),a}finally{this.#t.runNext(this)}}#i(n){const e=t=>{switch(n.type){case"failed":return{...t,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...t,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:n.error,failureCount:t.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=e(this.state),rr.batch(()=>{this.#n.forEach(t=>{t.onMutationUpdate(n)}),this.#t.notify({mutation:this,type:"updated",action:n})})}};function QR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var eO=class extends om{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(n,e,t){const i=new JR({client:n,mutationCache:this,mutationId:++this.#t,options:n.defaultMutationOptions(e),state:t});return this.add(i),i}add(n){this.#e.add(n);const e=Ef(n);if(typeof e=="string"){const t=this.#n.get(e);t?t.push(n):this.#n.set(e,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const e=Ef(n);if(typeof e=="string"){const t=this.#n.get(e);if(t)if(t.length>1){const i=t.indexOf(n);i!==-1&&t.splice(i,1)}else t[0]===n&&this.#n.delete(e)}}this.notify({type:"removed",mutation:n})}canRun(n){const e=Ef(n);if(typeof e=="string"){const i=this.#n.get(e)?.find(r=>r.state.status==="pending");return!i||i===n}else return!0}runNext(n){const e=Ef(n);return typeof e=="string"?this.#n.get(e)?.find(i=>i!==n&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){rr.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(n){const e={exact:!0,...n};return this.getAll().find(t=>pS(e,t))}findAll(n={}){return this.getAll().filter(e=>pS(n,e))}notify(n){rr.batch(()=>{this.listeners.forEach(e=>{e(n)})})}resumePausedMutations(){const n=this.getAll().filter(e=>e.state.isPaused);return rr.batch(()=>Promise.all(n.map(e=>e.continue().catch(_s))))}};function Ef(n){return n.options.scope?.id}var tO=class extends om{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,e,t){const i=e.queryKey,r=e.queryHash??F0(i,e);let a=this.get(r);return a||(a=new YR({client:n,queryKey:i,queryHash:r,options:n.defaultQueryOptions(e),state:t,defaultOptions:n.getQueryDefaults(i)}),this.add(a)),a}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const e=this.#e.get(n.queryHash);e&&(n.destroy(),e===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){rr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const e={exact:!0,...n};return this.getAll().find(t=>fS(e,t))}findAll(n={}){const e=this.getAll();return Object.keys(n).length>0?e.filter(t=>fS(n,t)):e}notify(n){rr.batch(()=>{this.listeners.forEach(e=>{e(n)})})}onFocus(){rr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){rr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},nO=class{#e;#n;#t;#r;#i;#a;#o;#s;constructor(n={}){this.#e=n.queryCache||new tO,this.#n=n.mutationCache||new eO,this.#t=n.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=BE.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Bp.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#n.findAll({...n,status:"pending"}).length}getQueryData(n){const e=this.defaultQueryOptions({queryKey:n});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),t=this.#e.build(this,e),i=t.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&t.isStaleByTime(Y_(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:e,state:t})=>{const i=t.data;return[e,i]})}setQueryData(n,e,t){const i=this.defaultQueryOptions({queryKey:n}),a=this.#e.get(i.queryHash)?.state.data,l=DR(e,a);if(l!==void 0)return this.#e.build(this,i).setData(l,{...t,manual:!0})}setQueriesData(n,e,t){return rr.batch(()=>this.#e.findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,e,t)]))}getQueryState(n){const e=this.defaultQueryOptions({queryKey:n});return this.#e.get(e.queryHash)?.state}removeQueries(n){const e=this.#e;rr.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=this.#e;return rr.batch(()=>(t.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const t={revert:!0,...e},i=rr.batch(()=>this.#e.findAll(n).map(r=>r.cancel(t)));return Promise.all(i).then(_s).catch(_s)}invalidateQueries(n,e={}){return rr.batch(()=>(this.#e.findAll(n).forEach(t=>{t.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},e)))}refetchQueries(n,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},i=rr.batch(()=>this.#e.findAll(n).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let a=r.fetch(void 0,t);return t.throwOnError||(a=a.catch(_s)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(_s)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=this.#e.build(this,e);return t.isStaleByTime(Y_(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(_s).catch(_s)}fetchInfiniteQuery(n){return n.behavior=bS(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(_s).catch(_s)}ensureInfiniteQueryData(n){return n.behavior=bS(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Bp.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(n){this.#t=n}setQueryDefaults(n,e){this.#r.set(Wh(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...this.#r.values()],t={};return e.forEach(i=>{$h(n,i.queryKey)&&Object.assign(t,i.defaultOptions)}),t}setMutationDefaults(n,e){this.#i.set(Wh(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...this.#i.values()],t={};return e.forEach(i=>{$h(n,i.mutationKey)&&Object.assign(t,i.defaultOptions)}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...this.#t.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=F0(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===U0&&(e.enabled=!1),e}defaultMutationOptions(n){return n?._defaulted?n:{...this.#t.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},UE=W.createContext(void 0),LW=n=>{const e=W.useContext(UE);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},iO=({client:n,children:e})=>(W.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),T.jsx(UE.Provider,{value:n,children:e}));const j0="auth_token",rO=300*1e3;function Bh(){try{return localStorage.getItem(j0)}catch{return null}}function jE(n){try{localStorage.setItem(j0,n)}catch{}}function xy(){try{localStorage.removeItem(j0)}catch{}}function BW(n,e){const t=Bh();if(t){const i=new Headers(e?.headers);return i.has("Authorization")||i.set("Authorization",`Bearer ${t}`),fetch(n,{...e,headers:i})}return fetch(n,e)}async function sO(){try{const n=Bh();if(!n)return null;const e=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}}),t=await e.json();return e.ok&&t.success&&t.token?(jE(t.token),t.token):null}catch{return null}}function aO(){const[n,e]=W.useState({token:Bh(),loading:!0,needsLogin:!1}),t=W.useRef(null),i=W.useCallback(l=>{t.current&&clearTimeout(t.current);const o=Math.max(l*1e3-rO,3e4);t.current=setTimeout(async()=>{const u=await sO();u?(e(h=>({...h,token:u})),i(3600)):(xy(),e({token:null,loading:!1,needsLogin:!0}))},o)},[]);W.useEffect(()=>{let l=!1;async function o(){try{const p=await(await fetch("/api/auth/status")).json();if(l)return;!p.passwordRequired||p.authenticated?(e({token:Bh(),loading:!1,needsLogin:!1}),p.passwordRequired&&p.authenticated&&Bh()&&i(3600)):e({token:null,loading:!1,needsLogin:!0})}catch{l||e({token:null,loading:!1,needsLogin:!0})}}o();function u(){t.current&&clearTimeout(t.current),xy(),e({token:null,loading:!1,needsLogin:!0})}return document.addEventListener("ws-auth-failed",u),()=>{l=!0,t.current&&clearTimeout(t.current),document.removeEventListener("ws-auth-failed",u)}},[i]);const r=W.useCallback(async l=>{try{const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:l})}),u=await o.json();return o.ok&&u.success?(u.token&&jE(u.token),e({token:u.token??null,loading:!1,needsLogin:!1}),u.expiresIn&&i(u.expiresIn),{success:!0}):{success:!1,error:u.error||"Authentication failed"}}catch{return{success:!1,error:"Connection error -- is the server running?"}}},[i]),a=W.useCallback(()=>{t.current&&clearTimeout(t.current),xy(),fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),e({token:null,loading:!1,needsLogin:!0})},[]);return{...n,login:r,logout:a}}const oO=1e3,lO=1e4;class H0{ws=null;options;reconnectAttempt=0;reconnectTimer=null;disposed=!1;lastSeq=0;constructor(e){this.options=e}connect(){if(this.disposed)return;const e=new URL(this.options.url,window.location.origin);e.protocol=e.protocol==="https:"?"wss:":"ws:",this.options.token&&e.searchParams.set("token",this.options.token),this.ws=new WebSocket(e.toString()),this.ws.onopen=()=>{this.reconnectAttempt=0,this.options.onStatus("connected"),this.lastSeq>0&&this.send({type:"replay",sinceSeq:this.lastSeq})},this.ws.onmessage=t=>{try{const i=JSON.parse(t.data);i.type==="snapshot"&&"seq"in i&&(this.lastSeq=i.seq),this.options.onMessage(i)}catch{}},this.ws.onclose=t=>{if(!this.disposed){if(t.code===4001){this.options.onStatus("disconnected"),document.dispatchEvent(new CustomEvent("ws-auth-failed"));return}this.options.onStatus("reconnecting"),this.scheduleReconnect()}},this.ws.onerror=()=>{}}static MAX_BUFFERED=64*1024;send(e){if(this.ws?.readyState===WebSocket.OPEN){if(this.ws.bufferedAmount>H0.MAX_BUFFERED&&e.type!=="terminal_input")return;this.ws.send(JSON.stringify(e))}}setToken(e){this.options.token=e}getRawSocket(){return this.ws}getLastSeq(){return this.lastSeq}dispose(){this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null,this.ws.onopen=null,this.ws.close(),this.ws=null)}scheduleReconnect(){if(this.disposed)return;const e=Math.min(oO*Math.pow(2,this.reconnectAttempt),lO);this.reconnectAttempt++,this.options.onStatus("reconnecting"),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}}const xS=n=>{let e;const t=new Set,i=(h,p)=>{const f=typeof h=="function"?h(e):h;if(!Object.is(f,e)){const m=e;e=p??(typeof f!="object"||f===null)?f:Object.assign({},e,f),t.forEach(g=>g(e,m))}},r=()=>e,o={setState:i,getState:r,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h))},u=e=n(i,r,o);return o},cO=(n=>n?xS(n):xS),uO=n=>n;function hO(n,e=uO){const t=Oh.useSyncExternalStore(n.subscribe,Oh.useCallback(()=>e(n.getState()),[n,e]),Oh.useCallback(()=>e(n.getInitialState()),[n,e]));return Oh.useDebugValue(t),t}const SS=n=>{const e=cO(n),t=i=>hO(e,i);return Object.assign(t,e),t},Tl=(n=>n?SS(n):SS),gn=Tl(n=>({sessions:new Map,selectedSessionId:null,addSession:e=>n(t=>{const i=new Map(t.sessions);return i.set(e.sessionId,e),{sessions:i}}),removeSession:e=>n(t=>{const i=new Map(t.sessions);i.delete(e);const r=t.selectedSessionId===e?null:t.selectedSessionId;return{sessions:i,selectedSessionId:r}}),updateSession:e=>n(t=>{const i=new Map(t.sessions);e.replacesId&&i.delete(e.replacesId),i.set(e.sessionId,e);let r=t.selectedSessionId;return e.replacesId&&t.selectedSessionId===e.replacesId&&(r=e.sessionId),{sessions:i,selectedSessionId:r}}),selectSession:e=>n({selectedSessionId:e}),deselectSession:()=>n({selectedSessionId:null}),setSessions:e=>n({sessions:e})}));var Mp={exports:{}},dO=Mp.exports,wS;function fO(){return wS||(wS=1,(function(n,e){((t,i)=>{n.exports=i()})(dO,function(){var t=function(E,R){return(t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(I,z){I.__proto__=z}:function(I,z){for(var q in z)Object.prototype.hasOwnProperty.call(z,q)&&(I[q]=z[q])}))(E,R)},i=function(){return(i=Object.assign||function(E){for(var R,I=1,z=arguments.length;I<z;I++)for(var q in R=arguments[I])Object.prototype.hasOwnProperty.call(R,q)&&(E[q]=R[q]);return E}).apply(this,arguments)};function r(E,R,I){for(var z,q=0,G=R.length;q<G;q++)!z&&q in R||((z=z||Array.prototype.slice.call(R,0,q))[q]=R[q]);return E.concat(z||Array.prototype.slice.call(R))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:PT,l=Object.keys,o=Array.isArray;function u(E,R){return typeof R=="object"&&l(R).forEach(function(I){E[I]=R[I]}),E}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var h=Object.getPrototypeOf,p={}.hasOwnProperty;function f(E,R){return p.call(E,R)}function m(E,R){typeof R=="function"&&(R=R(h(E))),(typeof Reflect>"u"?l:Reflect.ownKeys)(R).forEach(function(I){_(E,I,R[I])})}var g=Object.defineProperty;function _(E,R,I,z){g(E,R,u(I&&f(I,"get")&&typeof I.get=="function"?{get:I.get,set:I.set,configurable:!0}:{value:I,configurable:!0,writable:!0},z))}function w(E){return{from:function(R){return E.prototype=Object.create(R.prototype),_(E.prototype,"constructor",E),{extend:m.bind(null,E.prototype)}}}}var v=Object.getOwnPropertyDescriptor,x=[].slice;function S(E,R,I){return x.call(E,R,I)}function b(E,R){return R(E)}function C(E){if(!E)throw new Error("Assertion Failed")}function O(E){a.setImmediate?setImmediate(E):setTimeout(E,0)}function M(E,R){if(typeof R=="string"&&f(E,R))return E[R];if(!R)return E;if(typeof R!="string"){for(var I=[],z=0,q=R.length;z<q;++z){var G=M(E,R[z]);I.push(G)}return I}var ne,ie=R.indexOf(".");return ie===-1||(ne=E[R.substr(0,ie)])==null?void 0:M(ne,R.substr(ie+1))}function D(E,R,I){if(E&&R!==void 0&&!("isFrozen"in Object&&Object.isFrozen(E)))if(typeof R!="string"&&"length"in R){C(typeof I!="string"&&"length"in I);for(var z=0,q=R.length;z<q;++z)D(E,R[z],I[z])}else{var G,ne,ie=R.indexOf(".");ie!==-1?(G=R.substr(0,ie),(ie=R.substr(ie+1))===""?I===void 0?o(E)&&!isNaN(parseInt(G))?E.splice(G,1):delete E[G]:E[G]=I:D(ne=(ne=E[G])&&f(E,G)?ne:E[G]={},ie,I)):I===void 0?o(E)&&!isNaN(parseInt(R))?E.splice(R,1):delete E[R]:E[R]=I}}function N(E){var R,I={};for(R in E)f(E,R)&&(I[R]=E[R]);return I}var L=[].concat;function j(E){return L.apply([],E)}var X="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(j([8,16,32,64].map(function(E){return["Int","Uint","Float"].map(function(R){return R+E+"Array"})}))).filter(function(E){return a[E]}),K=new Set(X.map(function(E){return a[E]})),Y=null;function H(E){return Y=new WeakMap,E=(function R(I){if(!I||typeof I!="object")return I;var z=Y.get(I);if(z)return z;if(o(I)){z=[],Y.set(I,z);for(var q=0,G=I.length;q<G;++q)z.push(R(I[q]))}else if(K.has(I.constructor))z=I;else{var ne,ie=h(I);for(ne in z=ie===Object.prototype?{}:Object.create(ie),Y.set(I,z),I)f(I,ne)&&(z[ne]=R(I[ne]))}return z})(E),Y=null,E}var Q={}.toString;function te(E){return Q.call(E).slice(8,-1)}var $=typeof Symbol<"u"?Symbol.iterator:"@@iterator",J=typeof $=="symbol"?function(E){var R;return E!=null&&(R=E[$])&&R.apply(E)}:function(){return null};function re(E,R){R=E.indexOf(R),0<=R&&E.splice(R,1)}var F={};function B(E){var R,I,z,q;if(arguments.length===1){if(o(E))return E.slice();if(this===F&&typeof E=="string")return[E];if(q=J(E))for(I=[];!(z=q.next()).done;)I.push(z.value);else{if(E==null)return[E];if(typeof(R=E.length)!="number")return[E];for(I=new Array(R);R--;)I[R]=E[R]}}else for(R=arguments.length,I=new Array(R);R--;)I[R]=arguments[R];return I}var U=typeof Symbol<"u"?function(E){return E[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},X=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ce=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(X),V={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function _e(E,R){this.name=E,this.message=R}function Ee(E,R){return E+". Errors: "+Object.keys(R).map(function(I){return R[I].toString()}).filter(function(I,z,q){return q.indexOf(I)===z}).join(`
|
|
13
|
-
`)}function Ie(E,R,I,z){this.failures=R,this.failedKeys=z,this.successCount=I,this.message=Ee(E,R)}function ae(E,R){this.name="BulkError",this.failures=Object.keys(R).map(function(I){return R[I]}),this.failuresByPos=R,this.message=Ee(E,this.failures)}w(_e).from(Error).extend({toString:function(){return this.name+": "+this.message}}),w(Ie).from(_e),w(ae).from(_e);var ee=Ce.reduce(function(E,R){return E[R]=R+"Error",E},{}),Te=_e,ye=Ce.reduce(function(E,R){var I=R+"Error";function z(q,G){this.name=I,q?typeof q=="string"?(this.message="".concat(q).concat(G?`
|
|
14
|
-
`+G:""),this.inner=G||null):typeof q=="object"&&(this.message="".concat(q.name," ").concat(q.message),this.inner=q):(this.message=V[R]||I,this.inner=null)}return w(z).from(Te),E[R]=z,E},{}),Me=(ye.Syntax=SyntaxError,ye.Type=TypeError,ye.Range=RangeError,X.reduce(function(E,R){return E[R+"Error"]=ye[R],E},{}));X=Ce.reduce(function(E,R){return["Syntax","Type","Range"].indexOf(R)===-1&&(E[R+"Error"]=ye[R]),E},{});function we(){}function it(E){return E}function De(E,R){return E==null||E===it?R:function(I){return R(E(I))}}function Pe(E,R){return function(){E.apply(this,arguments),R.apply(this,arguments)}}function Fe(E,R){return E===we?R:function(){var I=E.apply(this,arguments),z=(I!==void 0&&(arguments[0]=I),this.onsuccess),q=this.onerror,G=(this.onsuccess=null,this.onerror=null,R.apply(this,arguments));return z&&(this.onsuccess=this.onsuccess?Pe(z,this.onsuccess):z),q&&(this.onerror=this.onerror?Pe(q,this.onerror):q),G!==void 0?G:I}}function je(E,R){return E===we?R:function(){E.apply(this,arguments);var I=this.onsuccess,z=this.onerror;this.onsuccess=this.onerror=null,R.apply(this,arguments),I&&(this.onsuccess=this.onsuccess?Pe(I,this.onsuccess):I),z&&(this.onerror=this.onerror?Pe(z,this.onerror):z)}}function st(E,R){return E===we?R:function(q){var z=E.apply(this,arguments),q=(u(q,z),this.onsuccess),G=this.onerror,ne=(this.onsuccess=null,this.onerror=null,R.apply(this,arguments));return q&&(this.onsuccess=this.onsuccess?Pe(q,this.onsuccess):q),G&&(this.onerror=this.onerror?Pe(G,this.onerror):G),z===void 0?ne===void 0?void 0:ne:u(z,ne)}}function Rt(E,R){return E===we?R:function(){return R.apply(this,arguments)!==!1&&E.apply(this,arguments)}}function bt(E,R){return E===we?R:function(){var I=E.apply(this,arguments);if(I&&typeof I.then=="function"){for(var z=this,q=arguments.length,G=new Array(q);q--;)G[q]=arguments[q];return I.then(function(){return R.apply(z,G)})}return R.apply(this,arguments)}}X.ModifyError=Ie,X.DexieError=_e,X.BulkError=ae;var Lt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function sn(E){Lt=E}var jt={},Pt=100,Cn=typeof Promise>"u"?[]:(Ce=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Cn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),h(Cn),Ce]:[Ce,h(Ce),Ce]),Ce=Cn[0],ca=Cn[1],ca=ca&&ca.then,qe=Ce&&Ce.constructor,ft=!!Cn[2],Ct=function(E,R){Fi.push([E,R]),Nn&&(queueMicrotask(Dt),Nn=!1)},Bt=!0,Nn=!0,Ft=[],Pn=[],jn=it,Vn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:we,pgp:!1,env:{},finalize:we},Je=Vn,Fi=[],Jn=0,ta=[];function nt(E){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var R=this._PSD=Je;if(typeof E!="function"){if(E!==jt)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Ai(this,this._value)}else this._state=null,this._value=null,++R.ref,(function I(z,q){try{q(function(G){if(z._state===null){if(G===z)throw new TypeError("A promise cannot be resolved with itself.");var ne=z._lib&&yn();G&&typeof G.then=="function"?I(z,function(ie,ue){G instanceof nt?G._then(ie,ue):G.then(ie,ue)}):(z._state=!0,z._value=G,le(z)),ne&&dn()}},Ai.bind(null,z))}catch(G){Ai(z,G)}})(this,E)}var As={get:function(){var E=Je,R=ss;function I(z,q){var G=this,ne=!E.global&&(E!==Je||R!==ss),ie=ne&&!Di(),ue=new nt(function(ve,he){ze(G,new ks(Va(z,E,ne,ie),Va(q,E,ne,ie),ve,he,E))});return this._consoleTask&&(ue._consoleTask=this._consoleTask),ue}return I.prototype=jt,I},set:function(E){_(this,"then",E&&E.prototype===jt?As:{get:function(){return E},set:As.set})}};function ks(E,R,I,z,q){this.onFulfilled=typeof E=="function"?E:null,this.onRejected=typeof R=="function"?R:null,this.resolve=I,this.reject=z,this.psd=q}function Ai(E,R){var I,z;Pn.push(R),E._state===null&&(I=E._lib&&yn(),R=jn(R),E._state=!1,E._value=R,z=E,Ft.some(function(q){return q._value===z._value})||Ft.push(z),le(E),I)&&dn()}function le(E){var R=E._listeners;E._listeners=[];for(var I=0,z=R.length;I<z;++I)ze(E,R[I]);var q=E._PSD;--q.ref||q.finalize(),Jn===0&&(++Jn,Ct(function(){--Jn==0&&pt()},[]))}function ze(E,R){if(E._state===null)E._listeners.push(R);else{var I=E._state?R.onFulfilled:R.onRejected;if(I===null)return(E._state?R.resolve:R.reject)(E._value);++R.psd.ref,++Jn,Ct(rt,[I,E,R])}}function rt(E,R,I){try{var z,q=R._value;!R._state&&Pn.length&&(Pn=[]),z=Lt&&R._consoleTask?R._consoleTask.run(function(){return E(q)}):E(q),R._state||Pn.indexOf(q)!==-1||(G=>{for(var ne=Ft.length;ne;)if(Ft[--ne]._value===G._value)return Ft.splice(ne,1)})(R),I.resolve(z)}catch(G){I.reject(G)}finally{--Jn==0&&pt(),--I.psd.ref||I.psd.finalize()}}function Dt(){Qi(Vn,function(){yn()&&dn()})}function yn(){var E=Bt;return Nn=Bt=!1,E}function dn(){var E,R,I;do for(;0<Fi.length;)for(E=Fi,Fi=[],I=E.length,R=0;R<I;++R){var z=E[R];z[0].apply(null,z[1])}while(0<Fi.length);Nn=Bt=!0}function pt(){for(var E=Ft,R=(Ft=[],E.forEach(function(z){z._PSD.onunhandled.call(null,z._value,z)}),ta.slice(0)),I=R.length;I;)R[--I]()}function ct(E){return new nt(jt,!1,E)}function ot(E,R){var I=Je;return function(){var z=yn(),q=Je;try{return Ji(I,!0),E.apply(this,arguments)}catch(G){R&&R(G)}finally{Ji(q,!1),z&&dn()}}}m(nt.prototype,{then:As,_then:function(E,R){ze(this,new ks(null,null,E,R,Je))},catch:function(E){var R,I;return arguments.length===1?this.then(null,E):(R=E,I=arguments[1],typeof R=="function"?this.then(null,function(z){return(z instanceof R?I:ct)(z)}):this.then(null,function(z){return(z&&z.name===R?I:ct)(z)}))},finally:function(E){return this.then(function(R){return nt.resolve(E()).then(function(){return R})},function(R){return nt.resolve(E()).then(function(){return ct(R)})})},timeout:function(E,R){var I=this;return E<1/0?new nt(function(z,q){var G=setTimeout(function(){return q(new ye.Timeout(R))},E);I.then(z,q).finally(clearTimeout.bind(null,G))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&_(nt.prototype,Symbol.toStringTag,"Dexie.Promise"),Vn.env=Uo(),m(nt,{all:function(){var E=B.apply(null,arguments).map(Ts);return new nt(function(R,I){E.length===0&&R([]);var z=E.length;E.forEach(function(q,G){return nt.resolve(q).then(function(ne){E[G]=ne,--z||R(E)},I)})})},resolve:function(E){return E instanceof nt?E:E&&typeof E.then=="function"?new nt(function(R,I){E.then(R,I)}):new nt(jt,!0,E)},reject:ct,race:function(){var E=B.apply(null,arguments).map(Ts);return new nt(function(R,I){E.map(function(z){return nt.resolve(z).then(R,I)})})},PSD:{get:function(){return Je},set:function(E){return Je=E}},totalEchoes:{get:function(){return ss}},newPSD:Tn,usePSD:Qi,scheduler:{get:function(){return Ct},set:function(E){Ct=E}},rejectionMapper:{get:function(){return jn},set:function(E){jn=E}},follow:function(E,R){return new nt(function(I,z){return Tn(function(q,G){var ne=Je;ne.unhandleds=[],ne.onunhandled=G,ne.finalize=Pe(function(){var ie,ue=this;ie=function(){ue.unhandleds.length===0?q():G(ue.unhandleds[0])},ta.push(function ve(){ie(),ta.splice(ta.indexOf(ve),1)}),++Jn,Ct(function(){--Jn==0&&pt()},[])},ne.finalize),E()},R,I,z)})}}),qe&&(qe.allSettled&&_(nt,"allSettled",function(){var E=B.apply(null,arguments).map(Ts);return new nt(function(R){E.length===0&&R([]);var I=E.length,z=new Array(I);E.forEach(function(q,G){return nt.resolve(q).then(function(ne){return z[G]={status:"fulfilled",value:ne}},function(ne){return z[G]={status:"rejected",reason:ne}}).then(function(){return--I||R(z)})})})}),qe.any&&typeof AggregateError<"u"&&_(nt,"any",function(){var E=B.apply(null,arguments).map(Ts);return new nt(function(R,I){E.length===0&&I(new AggregateError([]));var z=E.length,q=new Array(z);E.forEach(function(G,ne){return nt.resolve(G).then(function(ie){return R(ie)},function(ie){q[ne]=ie,--z||I(new AggregateError(q))})})})}),qe.withResolvers)&&(nt.withResolvers=qe.withResolvers);var en={awaits:0,echoes:0,id:0},Hn=0,ur=[],rs=0,ss=0,Fr=0;function Tn(E,ne,I,z){var q=Je,G=Object.create(q),ne=(G.parent=q,G.ref=0,G.global=!1,G.id=++Fr,Vn.env,G.env=ft?{Promise:nt,PromiseProp:{value:nt,configurable:!0,writable:!0},all:nt.all,race:nt.race,allSettled:nt.allSettled,any:nt.any,resolve:nt.resolve,reject:nt.reject}:{},ne&&u(G,ne),++q.ref,G.finalize=function(){--this.parent.ref||this.parent.finalize()},Qi(G,E,I,z));return G.ref===0&&G.finalize(),ne}function Qn(){return en.id||(en.id=++Hn),++en.awaits,en.echoes+=Pt,en.id}function Di(){return!!en.awaits&&(--en.awaits==0&&(en.id=0),en.echoes=en.awaits*Pt,!0)}function Ts(E){return en.echoes&&E&&E.constructor===qe?(Qn(),E.then(function(R){return Di(),R},function(R){return Di(),En(R)})):E}function Dl(){var E=ur[ur.length-1];ur.pop(),Ji(E,!1)}function Ji(E,R){var I,z,q=Je;(R?!en.echoes||rs++&&E===Je:!rs||--rs&&E===Je)||queueMicrotask(R?(function(G){++ss,en.echoes&&--en.echoes!=0||(en.echoes=en.awaits=en.id=0),ur.push(Je),Ji(G,!0)}).bind(null,E):Dl),E!==Je&&(Je=E,q===Vn&&(Vn.env=Uo()),ft)&&(I=Vn.env.Promise,z=E.env,q.global||E.global)&&(Object.defineProperty(a,"Promise",z.PromiseProp),I.all=z.all,I.race=z.race,I.resolve=z.resolve,I.reject=z.reject,z.allSettled&&(I.allSettled=z.allSettled),z.any)&&(I.any=z.any)}function Uo(){var E=a.Promise;return ft?{Promise:E,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:E.all,race:E.race,allSettled:E.allSettled,any:E.any,resolve:E.resolve,reject:E.reject}:{}}function Qi(E,R,I,z,q){var G=Je;try{return Ji(E,!0),R(I,z,q)}finally{Ji(G,!1)}}function Va(E,R,I,z){return typeof E!="function"?E:function(){var q=Je;I&&Qn(),Ji(R,!0);try{return E.apply(this,arguments)}finally{Ji(q,!1),z&&queueMicrotask(Di)}}}function xi(E){Promise===qe&&en.echoes===0?rs===0?E():enqueueNativeMicroTask(E):setTimeout(E,0)}(""+ca).indexOf("[native code]")===-1&&(Qn=Di=we);var En=nt.reject,Ui="",ki="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",ei="String expected.",as=[],Ur="__dbnames",vr="readonly",Ye="readwrite";function gt(E,R){return E?R?function(){return E.apply(this,arguments)&&R.apply(this,arguments)}:E:R}var Xt={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function fn(E){return typeof E!="string"||/\./.test(E)?function(R){return R}:function(R){return R[E]===void 0&&E in R&&delete(R=H(R))[E],R}}function Yn(){throw ye.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Tt(E,R){try{var I=ji(E),z=ji(R);if(I!==z)return I==="Array"?1:z==="Array"?-1:I==="binary"?1:z==="binary"?-1:I==="string"?1:z==="string"?-1:I==="Date"?1:z!=="Date"?NaN:-1;switch(I){case"number":case"Date":case"string":return R<E?1:E<R?-1:0;case"binary":for(var q=Ii(E),G=Ii(R),ne=q.length,ie=G.length,ue=ne<ie?ne:ie,ve=0;ve<ue;++ve)if(q[ve]!==G[ve])return q[ve]<G[ve]?-1:1;return ne===ie?0:ne<ie?-1:1;case"Array":for(var he=E,ce=R,pe=he.length,ge=ce.length,de=pe<ge?pe:ge,fe=0;fe<de;++fe){var Se=Tt(he[fe],ce[fe]);if(Se!==0)return Se}return pe===ge?0:pe<ge?-1:1}}catch{}return NaN}function ji(E){var R=typeof E;return R=="object"&&(ArrayBuffer.isView(E)||(R=te(E))==="ArrayBuffer")?"binary":R}function Ii(E){return E instanceof Uint8Array?E:ArrayBuffer.isView(E)?new Uint8Array(E.buffer,E.byteOffset,E.byteLength):new Uint8Array(E)}function An(E,R,I){var z=E.schema.yProps;return z?(R&&0<I.numFailures&&(R=R.filter(function(q,G){return!I.failures[G]})),Promise.all(z.map(function(q){return q=q.updatesTable,R?E.db.table(q).where("k").anyOf(R).delete():E.db.table(q).clear()})).then(function(){return I})):I}jo.prototype.execute=function(E){var R=this["@@propmod"];if(R.add!==void 0){var I=R.add;if(o(I))return r(r([],o(E)?E:[],!0),I).sort();if(typeof I=="number")return(Number(E)||0)+I;if(typeof I=="bigint")try{return BigInt(E)+I}catch{return BigInt(0)+I}throw new TypeError("Invalid term ".concat(I))}if(R.remove!==void 0){var z=R.remove;if(o(z))return o(E)?E.filter(function(q){return!z.includes(q)}).sort():[];if(typeof z=="number")return Number(E)-z;if(typeof z=="bigint")try{return BigInt(E)-z}catch{return BigInt(0)-z}throw new TypeError("Invalid subtrahend ".concat(z))}return I=(I=R.replacePrefix)==null?void 0:I[0],I&&typeof E=="string"&&E.startsWith(I)?R.replacePrefix[1]+E.substring(I.length):E};var Si=jo;function jo(E){this["@@propmod"]=E}function na(E,R){for(var I=l(R),z=I.length,q=!1,G=0;G<z;++G){var ne=I[G],ie=R[ne],ue=M(E,ne);ie instanceof Si?(D(E,ne,ie.execute(ue)),q=!0):ue!==ie&&(D(E,ne,ie),q=!0)}return q}mn.prototype._trans=function(E,R,I){var z=this._tx||Je.trans,q=this.name,G=Lt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(E==="readonly"?"read":"write"," ").concat(this.name));function ne(ve,he,ce){if(ce.schema[q])return R(ce.idbtrans,ce);throw new ye.NotFound("Table "+q+" not part of transaction")}var ie=yn();try{var ue=z&&z.db._novip===this.db._novip?z===Je.trans?z._promise(E,ne,I):Tn(function(){return z._promise(E,ne,I)},{trans:z,transless:Je.transless||Je}):(function ve(he,ce,pe,ge){if(he.idbdb&&(he._state.openComplete||Je.letThrough||he._vip)){var de=he._createTransaction(ce,pe,he._dbSchema);try{de.create(),he._state.PR1398_maxLoop=3}catch(fe){return fe.name===ee.InvalidState&&he.isOpen()&&0<--he._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),he.close({disableAutoOpen:!1}),he.open().then(function(){return ve(he,ce,pe,ge)})):En(fe)}return de._promise(ce,function(fe,Se){return Tn(function(){return Je.trans=de,ge(fe,Se,de)})}).then(function(fe){if(ce==="readwrite")try{de.idbtrans.commit()}catch{}return ce==="readonly"?fe:de._completion.then(function(){return fe})})}if(he._state.openComplete)return En(new ye.DatabaseClosed(he._state.dbOpenError));if(!he._state.isBeingOpened){if(!he._state.autoOpen)return En(new ye.DatabaseClosed);he.open().catch(we)}return he._state.dbReadyPromise.then(function(){return ve(he,ce,pe,ge)})})(this.db,E,[this.name],ne);return G&&(ue._consoleTask=G,ue=ue.catch(function(ve){return console.trace(ve),En(ve)})),ue}finally{ie&&dn()}},mn.prototype.get=function(E,R){var I=this;return E&&E.constructor===Object?this.where(E).first(R):E==null?En(new ye.Type("Invalid argument to Table.get()")):this._trans("readonly",function(z){return I.core.get({trans:z,key:E}).then(function(q){return I.hook.reading.fire(q)})}).then(R)},mn.prototype.where=function(E){if(typeof E=="string")return new this.db.WhereClause(this,E);if(o(E))return new this.db.WhereClause(this,"[".concat(E.join("+"),"]"));var R=l(E);if(R.length===1)return this.where(R[0]).equals(E[R[0]]);var I=this.schema.indexes.concat(this.schema.primKey).filter(function(ie){if(ie.compound&&R.every(function(ve){return 0<=ie.keyPath.indexOf(ve)})){for(var ue=0;ue<R.length;++ue)if(R.indexOf(ie.keyPath[ue])===-1)return!1;return!0}return!1}).sort(function(ie,ue){return ie.keyPath.length-ue.keyPath.length})[0];if(I&&this.db._maxKey!==Ui)return ne=I.keyPath.slice(0,R.length),this.where(ne).equals(ne.map(function(ie){return E[ie]}));!I&&Lt&&console.warn("The query ".concat(JSON.stringify(E)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(R.join("+"),"]"));var z=this.schema.idxByName;function q(ie,ue){return Tt(ie,ue)===0}var ne=R.reduce(function(he,ue){var ve=he[0],he=he[1],ce=z[ue],pe=E[ue];return[ve||ce,ve||!ce?gt(he,ce&&ce.multi?function(ge){return ge=M(ge,ue),o(ge)&&ge.some(function(de){return q(pe,de)})}:function(ge){return q(pe,M(ge,ue))}):he]},[null,null]),G=ne[0],ne=ne[1];return G?this.where(G.name).equals(E[G.keyPath]).filter(ne):I?this.filter(ne):this.where(R).equals("")},mn.prototype.filter=function(E){return this.toCollection().and(E)},mn.prototype.count=function(E){return this.toCollection().count(E)},mn.prototype.offset=function(E){return this.toCollection().offset(E)},mn.prototype.limit=function(E){return this.toCollection().limit(E)},mn.prototype.each=function(E){return this.toCollection().each(E)},mn.prototype.toArray=function(E){return this.toCollection().toArray(E)},mn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},mn.prototype.orderBy=function(E){return new this.db.Collection(new this.db.WhereClause(this,o(E)?"[".concat(E.join("+"),"]"):E))},mn.prototype.reverse=function(){return this.toCollection().reverse()},mn.prototype.mapToClass=function(E){for(var R=this.db,I=this.name,z=((this.schema.mappedClass=E).prototype instanceof Yn&&(E=(ne=>{var ie=he,ue=ne;if(typeof ue!="function"&&ue!==null)throw new TypeError("Class extends value "+String(ue)+" is not a constructor or null");function ve(){this.constructor=ie}function he(){return ne!==null&&ne.apply(this,arguments)||this}return t(ie,ue),ie.prototype=ue===null?Object.create(ue):(ve.prototype=ue.prototype,new ve),Object.defineProperty(he.prototype,"db",{get:function(){return R},enumerable:!1,configurable:!0}),he.prototype.table=function(){return I},he})(E)),new Set),q=E.prototype;q;q=h(q))Object.getOwnPropertyNames(q).forEach(function(ne){return z.add(ne)});function G(ne){if(!ne)return ne;var ie,ue=Object.create(E.prototype);for(ie in ne)if(!z.has(ie))try{ue[ie]=ne[ie]}catch{}return ue}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=G,this.hook("reading",G),E},mn.prototype.defineClass=function(){return this.mapToClass(function(E){u(this,E)})},mn.prototype.add=function(E,R){var I=this,z=this.schema.primKey,q=z.auto,G=z.keyPath,ne=E;return G&&q&&(ne=fn(G)(E)),this._trans("readwrite",function(ie){return I.core.mutate({trans:ie,type:"add",keys:R!=null?[R]:null,values:[ne]})}).then(function(ie){return ie.numFailures?nt.reject(ie.failures[0]):ie.lastResult}).then(function(ie){if(G)try{D(E,G,ie)}catch{}return ie})},mn.prototype.upsert=function(E,R){var I=this,z=this.schema.primKey.keyPath;return this._trans("readwrite",function(q){return I.core.get({trans:q,key:E}).then(function(G){var ne=G??{};return na(ne,R),z&&D(ne,z,E),I.core.mutate({trans:q,type:"put",values:[ne],keys:[E],upsert:!0,updates:{keys:[E],changeSpecs:[R]}}).then(function(ie){return ie.numFailures?nt.reject(ie.failures[0]):!!G})})})},mn.prototype.update=function(E,R){return typeof E!="object"||o(E)?this.where(":id").equals(E).modify(R):(E=M(E,this.schema.primKey.keyPath))===void 0?En(new ye.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(E).modify(R)},mn.prototype.put=function(E,R){var I=this,z=this.schema.primKey,q=z.auto,G=z.keyPath,ne=E;return G&&q&&(ne=fn(G)(E)),this._trans("readwrite",function(ie){return I.core.mutate({trans:ie,type:"put",values:[ne],keys:R!=null?[R]:null})}).then(function(ie){return ie.numFailures?nt.reject(ie.failures[0]):ie.lastResult}).then(function(ie){if(G)try{D(E,G,ie)}catch{}return ie})},mn.prototype.delete=function(E){var R=this;return this._trans("readwrite",function(I){return R.core.mutate({trans:I,type:"delete",keys:[E]}).then(function(z){return An(R,[E],z)}).then(function(z){return z.numFailures?nt.reject(z.failures[0]):void 0})})},mn.prototype.clear=function(){var E=this;return this._trans("readwrite",function(R){return E.core.mutate({trans:R,type:"deleteRange",range:Xt}).then(function(I){return An(E,null,I)})}).then(function(R){return R.numFailures?nt.reject(R.failures[0]):void 0})},mn.prototype.bulkGet=function(E){var R=this;return this._trans("readonly",function(I){return R.core.getMany({keys:E,trans:I}).then(function(z){return z.map(function(q){return R.hook.reading.fire(q)})})})},mn.prototype.bulkAdd=function(E,R,I){var z=this,q=Array.isArray(R)?R:void 0,G=(I=I||(q?void 0:R))?I.allKeys:void 0;return this._trans("readwrite",function(ne){var ie=z.schema.primKey,ve=ie.auto,ie=ie.keyPath;if(ie&&q)throw new ye.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(q&&q.length!==E.length)throw new ye.InvalidArgument("Arguments objects and keys must have the same length");var ue=E.length,ve=ie&&ve?E.map(fn(ie)):E;return z.core.mutate({trans:ne,type:"add",keys:q,values:ve,wantResults:G}).then(function(he){var ce=he.numFailures,pe=he.failures;if(ce===0)return G?he.results:he.lastResult;throw new ae("".concat(z.name,".bulkAdd(): ").concat(ce," of ").concat(ue," operations failed"),pe)})})},mn.prototype.bulkPut=function(E,R,I){var z=this,q=Array.isArray(R)?R:void 0,G=(I=I||(q?void 0:R))?I.allKeys:void 0;return this._trans("readwrite",function(ne){var ie=z.schema.primKey,ve=ie.auto,ie=ie.keyPath;if(ie&&q)throw new ye.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(q&&q.length!==E.length)throw new ye.InvalidArgument("Arguments objects and keys must have the same length");var ue=E.length,ve=ie&&ve?E.map(fn(ie)):E;return z.core.mutate({trans:ne,type:"put",keys:q,values:ve,wantResults:G}).then(function(he){var ce=he.numFailures,pe=he.failures;if(ce===0)return G?he.results:he.lastResult;throw new ae("".concat(z.name,".bulkPut(): ").concat(ce," of ").concat(ue," operations failed"),pe)})})},mn.prototype.bulkUpdate=function(E){var R=this,I=this.core,z=E.map(function(ne){return ne.key}),q=E.map(function(ne){return ne.changes}),G=[];return this._trans("readwrite",function(ne){return I.getMany({trans:ne,keys:z,cache:"clone"}).then(function(ie){var ue=[],ve=[],he=(E.forEach(function(ce,pe){var ge=ce.key,de=ce.changes,fe=ie[pe];if(fe){for(var Se=0,Re=Object.keys(de);Se<Re.length;Se++){var xe=Re[Se],Le=de[xe];if(xe===R.schema.primKey.keyPath){if(Tt(Le,ge)!==0)throw new ye.Constraint("Cannot update primary key in bulkUpdate()")}else D(fe,xe,Le)}G.push(pe),ue.push(ge),ve.push(fe)}}),ue.length);return I.mutate({trans:ne,type:"put",keys:ue,values:ve,updates:{keys:z,changeSpecs:q}}).then(function(ce){var pe=ce.numFailures,ge=ce.failures;if(pe===0)return he;for(var de=0,fe=Object.keys(ge);de<fe.length;de++){var Se,Re=fe[de],xe=G[Number(Re)];xe!=null&&(Se=ge[Re],delete ge[Re],ge[xe]=Se)}throw new ae("".concat(R.name,".bulkUpdate(): ").concat(pe," of ").concat(he," operations failed"),ge)})})})},mn.prototype.bulkDelete=function(E){var R=this,I=E.length;return this._trans("readwrite",function(z){return R.core.mutate({trans:z,type:"delete",keys:E}).then(function(q){return An(R,E,q)})}).then(function(z){var q=z.numFailures,G=z.failures;if(q===0)return z.lastResult;throw new ae("".concat(R.name,".bulkDelete(): ").concat(q," of ").concat(I," operations failed"),G)})};var Wa=mn;function mn(){}function ia(E){function R(ne,ie){if(ie){for(var ue=arguments.length,ve=new Array(ue-1);--ue;)ve[ue-1]=arguments[ue];return I[ne].subscribe.apply(null,ve),E}if(typeof ne=="string")return I[ne]}var I={};R.addEventType=G;for(var z=1,q=arguments.length;z<q;++z)G(arguments[z]);return R;function G(ne,ie,ue){var ve,he;if(typeof ne!="object")return ie=ie||Rt,he={subscribers:[],fire:ue=ue||we,subscribe:function(ce){he.subscribers.indexOf(ce)===-1&&(he.subscribers.push(ce),he.fire=ie(he.fire,ce))},unsubscribe:function(ce){he.subscribers=he.subscribers.filter(function(pe){return pe!==ce}),he.fire=he.subscribers.reduce(ie,ue)}},I[ne]=R[ne]=he;l(ve=ne).forEach(function(ce){var pe=ve[ce];if(o(pe))G(ce,ve[ce][0],ve[ce][1]);else{if(pe!=="asap")throw new ye.InvalidArgument("Invalid event config");var ge=G(ce,it,function(){for(var de=arguments.length,fe=new Array(de);de--;)fe[de]=arguments[de];ge.subscribers.forEach(function(Se){O(function(){Se.apply(null,fe)})})})}})}}function hi(E,R){return w(R).from({prototype:E}),R}function jr(E,R){return!(E.filter||E.algorithm||E.or)&&(R?E.justLimit:!E.replayFilter)}function os(E,R){E.filter=gt(E.filter,R)}function Ms(E,R,I){var z=E.replayFilter;E.replayFilter=z?function(){return gt(z(),R())}:R,E.justLimit=I&&!z}function ri(E,R){if(E.isPrimKey)return R.primaryKey;var I=R.getIndexByKeyPath(E.index);if(I)return I;throw new ye.Schema("KeyPath "+E.index+" on object store "+R.name+" is not indexed")}function Ho(E,R,I){var z=ri(E,R.schema);return R.openCursor({trans:I,values:!E.keysOnly,reverse:E.dir==="prev",unique:!!E.unique,query:{index:z,range:E.range}})}function ls(E,R,I,z){var q,G,ne=E.replayFilter?gt(E.filter,E.replayFilter()):E.filter;return E.or?(q={},G=function(ie,ue,ve){var he,ce;ne&&!ne(ue,ve,function(pe){return ue.stop(pe)},function(pe){return ue.fail(pe)})||((ce=""+(he=ue.primaryKey))=="[object ArrayBuffer]"&&(ce=""+new Uint8Array(he)),f(q,ce))||(q[ce]=!0,R(ie,ue,ve))},Promise.all([E.or._iterate(G,I),Et(Ho(E,z,I),E.algorithm,G,!E.keysOnly&&E.valueMapper)])):Et(Ho(E,z,I),gt(E.algorithm,ne),R,!E.keysOnly&&E.valueMapper)}function Et(E,R,I,z){var q=ot(z?function(G,ne,ie){return I(z(G),ne,ie)}:I);return E.then(function(G){if(G)return G.start(function(){var ne=function(){return G.continue()};R&&!R(G,function(ie){return ne=ie},function(ie){G.stop(ie),ne=we},function(ie){G.fail(ie),ne=we})||q(G.value,G,function(ie){return ne=ie}),ne()})})}At.prototype._read=function(E,R){var I=this._ctx;return I.error?I.table._trans(null,En.bind(null,I.error)):I.table._trans("readonly",E).then(R)},At.prototype._write=function(E){var R=this._ctx;return R.error?R.table._trans(null,En.bind(null,R.error)):R.table._trans("readwrite",E,"locked")},At.prototype._addAlgorithm=function(E){var R=this._ctx;R.algorithm=gt(R.algorithm,E)},At.prototype._iterate=function(E,R){return ls(this._ctx,E,R,this._ctx.table.core)},At.prototype.clone=function(E){var R=Object.create(this.constructor.prototype),I=Object.create(this._ctx);return E&&u(I,E),R._ctx=I,R},At.prototype.raw=function(){return this._ctx.valueMapper=null,this},At.prototype.each=function(E){var R=this._ctx;return this._read(function(I){return ls(R,E,I,R.table.core)})},At.prototype.count=function(E){var R=this;return this._read(function(I){var z,q=R._ctx,G=q.table.core;return jr(q,!0)?G.count({trans:I,query:{index:ri(q,G.schema),range:q.range}}).then(function(ne){return Math.min(ne,q.limit)}):(z=0,ls(q,function(){return++z,!1},I,G).then(function(){return z}))}).then(E)},At.prototype.sortBy=function(E,R){var I=E.split(".").reverse(),z=I[0],q=I.length-1;function G(ue,ve){return ve?G(ue[I[ve]],ve-1):ue[z]}var ne=this._ctx.dir==="next"?1:-1;function ie(ue,ve){return Tt(G(ue,q),G(ve,q))*ne}return this.toArray(function(ue){return ue.sort(ie)}).then(R)},At.prototype.toArray=function(E){var R=this;return this._read(function(I){var z,q,G,ne=R._ctx;return ne.dir==="next"&&jr(ne,!0)&&0<ne.limit?(z=ne.valueMapper,q=ri(ne,ne.table.core.schema),ne.table.core.query({trans:I,limit:ne.limit,values:!0,query:{index:q,range:ne.range}}).then(function(ie){return ie=ie.result,z?ie.map(z):ie})):(G=[],ls(ne,function(ie){return G.push(ie)},I,ne.table.core).then(function(){return G}))},E)},At.prototype.offset=function(E){var R=this._ctx;return E<=0||(R.offset+=E,jr(R)?Ms(R,function(){var I=E;return function(z,q){return I===0||(I===1?--I:q(function(){z.advance(I),I=0}),!1)}}):Ms(R,function(){var I=E;return function(){return--I<0}})),this},At.prototype.limit=function(E){return this._ctx.limit=Math.min(this._ctx.limit,E),Ms(this._ctx,function(){var R=E;return function(I,z,q){return--R<=0&&z(q),0<=R}},!0),this},At.prototype.until=function(E,R){return os(this._ctx,function(I,z,q){return!E(I.value)||(z(q),R)}),this},At.prototype.first=function(E){return this.limit(1).toArray(function(R){return R[0]}).then(E)},At.prototype.last=function(E){return this.reverse().first(E)},At.prototype.filter=function(E){var R;return os(this._ctx,function(I){return E(I.value)}),(R=this._ctx).isMatch=gt(R.isMatch,E),this},At.prototype.and=function(E){return this.filter(E)},At.prototype.or=function(E){return new this.db.WhereClause(this._ctx.table,E,this)},At.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},At.prototype.desc=function(){return this.reverse()},At.prototype.eachKey=function(E){var R=this._ctx;return R.keysOnly=!R.isMatch,this.each(function(I,z){E(z.key,z)})},At.prototype.eachUniqueKey=function(E){return this._ctx.unique="unique",this.eachKey(E)},At.prototype.eachPrimaryKey=function(E){var R=this._ctx;return R.keysOnly=!R.isMatch,this.each(function(I,z){E(z.primaryKey,z)})},At.prototype.keys=function(E){var R=this._ctx,I=(R.keysOnly=!R.isMatch,[]);return this.each(function(z,q){I.push(q.key)}).then(function(){return I}).then(E)},At.prototype.primaryKeys=function(E){var R=this._ctx;if(R.dir==="next"&&jr(R,!0)&&0<R.limit)return this._read(function(z){var q=ri(R,R.table.core.schema);return R.table.core.query({trans:z,values:!1,limit:R.limit,query:{index:q,range:R.range}})}).then(function(z){return z.result}).then(E);R.keysOnly=!R.isMatch;var I=[];return this.each(function(z,q){I.push(q.primaryKey)}).then(function(){return I}).then(E)},At.prototype.uniqueKeys=function(E){return this._ctx.unique="unique",this.keys(E)},At.prototype.firstKey=function(E){return this.limit(1).keys(function(R){return R[0]}).then(E)},At.prototype.lastKey=function(E){return this.reverse().firstKey(E)},At.prototype.distinct=function(){var E,R=this._ctx,R=R.index&&R.table.schema.idxByName[R.index];return R&&R.multi&&(E={},os(this._ctx,function(z){var z=z.primaryKey.toString(),q=f(E,z);return E[z]=!0,!q})),this},At.prototype.modify=function(E){var R=this,I=this._ctx;return this._write(function(z){function q(fe,Se){var Re=Se.failures;pe+=fe-Se.numFailures;for(var xe=0,Le=l(Re);xe<Le.length;xe++){var Ve=Le[xe];ce.push(Re[Ve])}}var G=typeof E=="function"?E:function(fe){return na(fe,E)},ne=I.table.core,he=ne.schema.primaryKey,ie=he.outbound,ue=he.extractKey,ve=200,he=R.db._options.modifyChunkSize,ce=(he&&(ve=typeof he=="object"?he[ne.name]||he["*"]||200:he),[]),pe=0,ge=[],de=E===_n;return R.clone().primaryKeys().then(function(fe){function Se(xe){var Le=Math.min(ve,fe.length-xe),Ve=fe.slice(xe,xe+Le);return(de?Promise.resolve([]):ne.getMany({trans:z,keys:Ve,cache:"immutable"})).then(function(et){var tt=[],$e=[],ut=ie?[]:null,at=de?Ve:[];if(!de)for(var Ge=0;Ge<Le;++Ge){var ht=et[Ge],zt={value:H(ht),primKey:fe[xe+Ge]};G.call(zt,zt.value,zt)!==!1&&(zt.value==null?at.push(fe[xe+Ge]):ie||Tt(ue(ht),ue(zt.value))===0?($e.push(zt.value),ie&&ut.push(fe[xe+Ge])):(at.push(fe[xe+Ge]),tt.push(zt.value)))}return Promise.resolve(0<tt.length&&ne.mutate({trans:z,type:"add",values:tt}).then(function(nn){for(var vt in nn.failures)at.splice(parseInt(vt),1);q(tt.length,nn)})).then(function(){return(0<$e.length||Re&&typeof E=="object")&&ne.mutate({trans:z,type:"put",keys:ut,values:$e,criteria:Re,changeSpec:typeof E!="function"&&E,isAdditionalChunk:0<xe}).then(function(nn){return q($e.length,nn)})}).then(function(){return(0<at.length||Re&&de)&&ne.mutate({trans:z,type:"delete",keys:at,criteria:Re,isAdditionalChunk:0<xe}).then(function(nn){return An(I.table,at,nn)}).then(function(nn){return q(at.length,nn)})}).then(function(){return fe.length>xe+Le&&Se(xe+ve)})})}var Re=jr(I)&&I.limit===1/0&&(typeof E!="function"||de)&&{index:I.index,range:I.range};return Se(0).then(function(){if(0<ce.length)throw new Ie("Error modifying one or more objects",ce,pe,ge);return fe.length})})})},At.prototype.delete=function(){var E=this._ctx,R=E.range;return!jr(E)||E.table.schema.yProps||!E.isPrimKey&&R.type!==3?this.modify(_n):this._write(function(I){var z=E.table.core.schema.primaryKey,q=R;return E.table.core.count({trans:I,query:{index:z,range:q}}).then(function(G){return E.table.core.mutate({trans:I,type:"deleteRange",range:q}).then(function(ue){var ie=ue.failures,ue=ue.numFailures;if(ue)throw new Ie("Could not delete some values",Object.keys(ie).map(function(ve){return ie[ve]}),G-ue);return G-ue})})})};var Il=At;function At(){}var _n=function(E,R){return R.value=null};function Rs(E,R){return E<R?-1:E===R?0:1}function cs(E,R){return R<E?-1:E===R?0:1}function wi(E,R,I){return E=E instanceof tn?new E.Collection(E):E,E._ctx.error=new(I||TypeError)(R),E}function er(E){return new E.Collection(E,function(){return Ut("")}).limit(0)}function Qe(ge,R,I,z){var q,G,ne,ie,ue,ve,he,ce=I.length;if(!I.every(function(fe){return typeof fe=="string"}))return wi(ge,ei);function pe(fe){q=fe==="next"?function(Re){return Re.toUpperCase()}:function(Re){return Re.toLowerCase()},G=fe==="next"?function(Re){return Re.toLowerCase()}:function(Re){return Re.toUpperCase()},ne=fe==="next"?Rs:cs;var Se=I.map(function(Re){return{lower:G(Re),upper:q(Re)}}).sort(function(Re,xe){return ne(Re.lower,xe.lower)});ie=Se.map(function(Re){return Re.upper}),ue=Se.map(function(Re){return Re.lower}),he=(ve=fe)==="next"?"":z}pe("next");var ge=new ge.Collection(ge,function(){return dt(ie[0],ue[ce-1]+z)}),de=(ge._ondirectionchange=function(fe){pe(fe)},0);return ge._addAlgorithm(function(fe,Se,Re){var xe=fe.key;if(typeof xe=="string"){var Le=G(xe);if(R(Le,ue,de))return!0;for(var Ve=null,et=de;et<ce;++et){var tt=(($e,ut,at,Ge,ht,zt)=>{for(var nn=Math.min($e.length,Ge.length),vt=-1,qt=0;qt<nn;++qt){var Dn=ut[qt];if(Dn!==Ge[qt])return ht($e[qt],at[qt])<0?$e.substr(0,qt)+at[qt]+at.substr(qt+1):ht($e[qt],Ge[qt])<0?$e.substr(0,qt)+Ge[qt]+at.substr(qt+1):0<=vt?$e.substr(0,vt)+ut[vt]+at.substr(vt+1):null;ht($e[qt],Dn)<0&&(vt=qt)}return nn<Ge.length&&zt==="next"?$e+at.substr($e.length):nn<$e.length&&zt==="prev"?$e.substr(0,at.length):vt<0?null:$e.substr(0,vt)+Ge[vt]+at.substr(vt+1)})(xe,Le,ie[et],ue[et],ne,ve);tt===null&&Ve===null?de=et+1:(Ve===null||0<ne(Ve,tt))&&(Ve=tt)}Se(Ve!==null?function(){fe.continue(Ve+he)}:Re)}return!1}),ge}function dt(E,R,I,z){return{type:2,lower:E,upper:R,lowerOpen:I,upperOpen:z}}function Ut(E){return{type:1,lower:E,upper:E}}Object.defineProperty(Gt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Gt.prototype.between=function(E,R,I,z){I=I!==!1,z=z===!0;try{return 0<this._cmp(E,R)||this._cmp(E,R)===0&&(I||z)&&(!I||!z)?er(this):new this.Collection(this,function(){return dt(E,R,!I,!z)})}catch{return wi(this,ki)}},Gt.prototype.equals=function(E){return E==null?wi(this,ki):new this.Collection(this,function(){return Ut(E)})},Gt.prototype.above=function(E){return E==null?wi(this,ki):new this.Collection(this,function(){return dt(E,void 0,!0)})},Gt.prototype.aboveOrEqual=function(E){return E==null?wi(this,ki):new this.Collection(this,function(){return dt(E,void 0,!1)})},Gt.prototype.below=function(E){return E==null?wi(this,ki):new this.Collection(this,function(){return dt(void 0,E,!1,!0)})},Gt.prototype.belowOrEqual=function(E){return E==null?wi(this,ki):new this.Collection(this,function(){return dt(void 0,E)})},Gt.prototype.startsWith=function(E){return typeof E!="string"?wi(this,ei):this.between(E,E+Ui,!0,!0)},Gt.prototype.startsWithIgnoreCase=function(E){return E===""?this.startsWith(E):Qe(this,function(R,I){return R.indexOf(I[0])===0},[E],Ui)},Gt.prototype.equalsIgnoreCase=function(E){return Qe(this,function(R,I){return R===I[0]},[E],"")},Gt.prototype.anyOfIgnoreCase=function(){var E=B.apply(F,arguments);return E.length===0?er(this):Qe(this,function(R,I){return I.indexOf(R)!==-1},E,"")},Gt.prototype.startsWithAnyOfIgnoreCase=function(){var E=B.apply(F,arguments);return E.length===0?er(this):Qe(this,function(R,I){return I.some(function(z){return R.indexOf(z)===0})},E,Ui)},Gt.prototype.anyOf=function(){var E,R,I=this,z=B.apply(F,arguments),q=this._cmp;try{z.sort(q)}catch{return wi(this,ki)}return z.length===0?er(this):((E=new this.Collection(this,function(){return dt(z[0],z[z.length-1])}))._ondirectionchange=function(G){q=G==="next"?I._ascending:I._descending,z.sort(q)},R=0,E._addAlgorithm(function(G,ne,ie){for(var ue=G.key;0<q(ue,z[R]);)if(++R===z.length)return ne(ie),!1;return q(ue,z[R])===0||(ne(function(){G.continue(z[R])}),!1)}),E)},Gt.prototype.notEqual=function(E){return this.inAnyRange([[-1/0,E],[E,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Gt.prototype.noneOf=function(){var E=B.apply(F,arguments);if(E.length===0)return new this.Collection(this);try{E.sort(this._ascending)}catch{return wi(this,ki)}var R=E.reduce(function(I,z){return I?I.concat([[I[I.length-1][1],z]]):[[-1/0,z]]},null);return R.push([E[E.length-1],this.db._maxKey]),this.inAnyRange(R,{includeLowers:!1,includeUppers:!1})},Gt.prototype.inAnyRange=function(E,Re){var I=this,z=this._cmp,q=this._ascending,G=this._descending,ne=this._min,ie=this._max;if(E.length===0)return er(this);if(!E.every(function(xe){return xe[0]!==void 0&&xe[1]!==void 0&&q(xe[0],xe[1])<=0}))return wi(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ye.InvalidArgument);var ue=!Re||Re.includeLowers!==!1,ve=Re&&Re.includeUppers===!0,he,ce=q;function pe(xe,Le){return ce(xe[0],Le[0])}try{(he=E.reduce(function(xe,Le){for(var Ve=0,et=xe.length;Ve<et;++Ve){var tt=xe[Ve];if(z(Le[0],tt[1])<0&&0<z(Le[1],tt[0])){tt[0]=ne(tt[0],Le[0]),tt[1]=ie(tt[1],Le[1]);break}}return Ve===et&&xe.push(Le),xe},[])).sort(pe)}catch{return wi(this,ki)}var ge=0,de=ve?function(xe){return 0<q(xe,he[ge][1])}:function(xe){return 0<=q(xe,he[ge][1])},fe=ue?function(xe){return 0<G(xe,he[ge][0])}:function(xe){return 0<=G(xe,he[ge][0])},Se=de,Re=new this.Collection(this,function(){return dt(he[0][0],he[he.length-1][1],!ue,!ve)});return Re._ondirectionchange=function(xe){ce=xe==="next"?(Se=de,q):(Se=fe,G),he.sort(pe)},Re._addAlgorithm(function(xe,Le,Ve){for(var et,tt=xe.key;Se(tt);)if(++ge===he.length)return Le(Ve),!1;return!de(et=tt)&&!fe(et)||(I._cmp(tt,he[ge][1])===0||I._cmp(tt,he[ge][0])===0||Le(function(){ce===q?xe.continue(he[ge][0]):xe.continue(he[ge][1])}),!1)}),Re},Gt.prototype.startsWithAnyOf=function(){var E=B.apply(F,arguments);return E.every(function(R){return typeof R=="string"})?E.length===0?er(this):this.inAnyRange(E.map(function(R){return[R,R+Ui]})):wi(this,"startsWithAnyOf() only works with strings")};var tn=Gt;function Gt(){}function ti(E){return ot(function(R){return us(R),E(R.target.error),!1})}function us(E){E.stopPropagation&&E.stopPropagation(),E.preventDefault&&E.preventDefault()}var Os="storagemutated",ra="x-storagemutated-1",Ti=ia(null,Os),yu=(Hi.prototype._lock=function(){return C(!Je.global),++this._reculock,this._reculock!==1||Je.global||(Je.lockOwnerFor=this),this},Hi.prototype._unlock=function(){if(C(!Je.global),--this._reculock==0)for(Je.global||(Je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var E=this._blockedFuncs.shift();try{Qi(E[1],E[0])}catch{}}return this},Hi.prototype._locked=function(){return this._reculock&&Je.lockOwnerFor!==this},Hi.prototype.create=function(E){var R=this;if(this.mode){var I=this.db.idbdb,z=this.db._state.dbOpenError;if(C(!this.idbtrans),!E&&!I)switch(z&&z.name){case"DatabaseClosedError":throw new ye.DatabaseClosed(z);case"MissingAPIError":throw new ye.MissingAPI(z.message,z);default:throw new ye.OpenFailed(z)}if(!this.active)throw new ye.TransactionInactive;C(this._completion._state===null),(E=this.idbtrans=E||(this.db.core||I).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ot(function(q){us(q),R._reject(E.error)}),E.onabort=ot(function(q){us(q),R.active&&R._reject(new ye.Abort(E.error)),R.active=!1,R.on("abort").fire(q)}),E.oncomplete=ot(function(){R.active=!1,R._resolve(),"mutatedParts"in E&&Ti.storagemutated.fire(E.mutatedParts)})}return this},Hi.prototype._promise=function(E,R,I){var z,q=this;return E==="readwrite"&&this.mode!=="readwrite"?En(new ye.ReadOnly("Transaction is readonly")):this.active?this._locked()?new nt(function(G,ne){q._blockedFuncs.push([function(){q._promise(E,R,I).then(G,ne)},Je])}):I?Tn(function(){var G=new nt(function(ne,ie){q._lock();var ue=R(ne,ie,q);ue&&ue.then&&ue.then(ne,ie)});return G.finally(function(){return q._unlock()}),G._lib=!0,G}):((z=new nt(function(G,ne){var ie=R(G,ne,q);ie&&ie.then&&ie.then(G,ne)}))._lib=!0,z):En(new ye.TransactionInactive)},Hi.prototype._root=function(){return this.parent?this.parent._root():this},Hi.prototype.waitFor=function(E){var R,I=this._root(),z=nt.resolve(E),q=(I._waitingFor?I._waitingFor=I._waitingFor.then(function(){return z}):(I._waitingFor=z,I._waitingQueue=[],R=I.idbtrans.objectStore(I.storeNames[0]),(function G(){for(++I._spinCount;I._waitingQueue.length;)I._waitingQueue.shift()();I._waitingFor&&(R.get(-1/0).onsuccess=G)})()),I._waitingFor);return new nt(function(G,ne){z.then(function(ie){return I._waitingQueue.push(ot(G.bind(null,ie)))},function(ie){return I._waitingQueue.push(ot(ne.bind(null,ie)))}).finally(function(){I._waitingFor===q&&(I._waitingFor=null)})})},Hi.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ye.Abort))},Hi.prototype.table=function(E){var R=this._memoizedTables||(this._memoizedTables={});if(f(R,E))return R[E];var I=this.schema[E];if(I)return(I=new this.db.Table(E,I,this)).core=this.db.core.table(E),R[E]=I;throw new ye.NotFound("Table "+E+" not part of transaction")},Hi);function Hi(){}function Hr(E,R,I,z,q,G,ne,ie){return{name:E,keyPath:R,unique:I,multi:z,auto:q,compound:G,src:(I&&!ne?"&":"")+(z?"*":"")+(q?"++":"")+Ll(R),type:ie}}function Ll(E){return typeof E=="string"?E:E?"["+[].join.call(E,"+")+"]":""}function $a(E,R,I){return{name:E,primKey:R,indexes:I,mappedClass:null,idxByName:(z=function(q){return[q.name,q]},I.reduce(function(q,G,ne){return G=z(G,ne),G&&(q[G[0]]=G[1]),q},{}))};var z}var Ga=function(E){try{return E.only([[]]),Ga=function(){return[[]]},[[]]}catch{return Ga=function(){return Ui},Ui}};function Ka(E){return E==null?function(){}:typeof E=="string"?(R=E).split(".").length===1?function(I){return I[R]}:function(I){return M(I,R)}:function(I){return M(I,E)};var R}function qo(E){return[].slice.call(E)}var fd=0;function di(E){return E==null?":id":typeof E=="string"?E:"[".concat(E.join("+"),"]")}function sa(E,R,ue){function z(de){if(de.type===3)return null;if(de.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ce=de.lower,pe=de.upper,ge=de.lowerOpen,de=de.upperOpen;return ce===void 0?pe===void 0?null:R.upperBound(pe,!!de):pe===void 0?R.lowerBound(ce,!!ge):R.bound(ce,pe,!!ge,!!de)}function q(he){var ce,pe=he.name;return{name:pe,schema:he,mutate:function(ge){var de=ge.trans,fe=ge.type,Se=ge.keys,Re=ge.values,xe=ge.range;return new Promise(function(Le,Ve){Le=ot(Le);var et=de.objectStore(pe),tt=et.keyPath==null,$e=fe==="put"||fe==="add";if(!$e&&fe!=="delete"&&fe!=="deleteRange")throw new Error("Invalid operation type: "+fe);var ut,at=(Se||Re||{length:1}).length;if(Se&&Re&&Se.length!==Re.length)throw new Error("Given keys array must have same length as given values array.");if(at===0)return Le({numFailures:0,failures:{},results:[],lastResult:void 0});function Ge(Mn){++nn,us(Mn)}var ht=[],zt=[],nn=0;if(fe==="deleteRange"){if(xe.type===4)return Le({numFailures:nn,failures:zt,results:[],lastResult:void 0});xe.type===3?ht.push(ut=et.clear()):ht.push(ut=et.delete(z(xe)))}else{var tt=$e?tt?[Re,Se]:[Re,null]:[Se,null],vt=tt[0],qt=tt[1];if($e)for(var Dn=0;Dn<at;++Dn)ht.push(ut=qt&&qt[Dn]!==void 0?et[fe](vt[Dn],qt[Dn]):et[fe](vt[Dn])),ut.onerror=Ge;else for(Dn=0;Dn<at;++Dn)ht.push(ut=et[fe](vt[Dn])),ut.onerror=Ge}function Vi(Mn){Mn=Mn.target.result,ht.forEach(function(Ls,eo){return Ls.error!=null&&(zt[eo]=Ls.error)}),Le({numFailures:nn,failures:zt,results:fe==="delete"?Se:ht.map(function(Ls){return Ls.result}),lastResult:Mn})}ut.onerror=function(Mn){Ge(Mn),Vi(Mn)},ut.onsuccess=Vi})},getMany:function(ge){var de=ge.trans,fe=ge.keys;return new Promise(function(Se,Re){Se=ot(Se);for(var xe,Le=de.objectStore(pe),Ve=fe.length,et=new Array(Ve),tt=0,$e=0,ut=function(ht){ht=ht.target,et[ht._pos]=ht.result,++$e===tt&&Se(et)},at=ti(Re),Ge=0;Ge<Ve;++Ge)fe[Ge]!=null&&((xe=Le.get(fe[Ge]))._pos=Ge,xe.onsuccess=ut,xe.onerror=at,++tt);tt===0&&Se(et)})},get:function(ge){var de=ge.trans,fe=ge.key;return new Promise(function(Se,Re){Se=ot(Se);var xe=de.objectStore(pe).get(fe);xe.onsuccess=function(Le){return Se(Le.target.result)},xe.onerror=ti(Re)})},query:(ce=ie,function(ge){return new Promise(function(de,fe){de=ot(de);var Se,Re,xe,$e=ge.trans,Le=ge.values,Ve=ge.limit,tt=ge.query,et=Ve===1/0?void 0:Ve,ut=tt.index,tt=tt.range,$e=$e.objectStore(pe),$e=ut.isPrimaryKey?$e:$e.index(ut.name),ut=z(tt);if(Ve===0)return de({result:[]});ce?((tt=Le?$e.getAll(ut,et):$e.getAllKeys(ut,et)).onsuccess=function(at){return de({result:at.target.result})},tt.onerror=ti(fe)):(Se=0,Re=!Le&&"openKeyCursor"in $e?$e.openKeyCursor(ut):$e.openCursor(ut),xe=[],Re.onsuccess=function(at){var Ge=Re.result;return!Ge||(xe.push(Le?Ge.value:Ge.primaryKey),++Se===Ve)?de({result:xe}):void Ge.continue()},Re.onerror=ti(fe))})}),openCursor:function(ge){var de=ge.trans,fe=ge.values,Se=ge.query,Re=ge.reverse,xe=ge.unique;return new Promise(function(Le,Ve){Le=ot(Le);var $e=Se.index,et=Se.range,tt=de.objectStore(pe),tt=$e.isPrimaryKey?tt:tt.index($e.name),$e=Re?xe?"prevunique":"prev":xe?"nextunique":"next",ut=!fe&&"openKeyCursor"in tt?tt.openKeyCursor(z(et),$e):tt.openCursor(z(et),$e);ut.onerror=ti(Ve),ut.onsuccess=ot(function(at){var Ge,ht,zt,nn,vt=ut.result;vt?(vt.___id=++fd,vt.done=!1,Ge=vt.continue.bind(vt),ht=(ht=vt.continuePrimaryKey)&&ht.bind(vt),zt=vt.advance.bind(vt),nn=function(){throw new Error("Cursor not stopped")},vt.trans=de,vt.stop=vt.continue=vt.continuePrimaryKey=vt.advance=function(){throw new Error("Cursor not started")},vt.fail=ot(Ve),vt.next=function(){var qt=this,Dn=1;return this.start(function(){return Dn--?qt.continue():qt.stop()}).then(function(){return qt})},vt.start=function(qt){function Dn(){if(ut.result)try{qt()}catch(Mn){vt.fail(Mn)}else vt.done=!0,vt.start=function(){throw new Error("Cursor behind last entry")},vt.stop()}var Vi=new Promise(function(Mn,Ls){Mn=ot(Mn),ut.onerror=ti(Ls),vt.fail=Ls,vt.stop=function(eo){vt.stop=vt.continue=vt.continuePrimaryKey=vt.advance=nn,Mn(eo)}});return ut.onsuccess=ot(function(Mn){ut.onsuccess=Dn,Dn()}),vt.continue=Ge,vt.continuePrimaryKey=ht,vt.advance=zt,Dn(),Vi},Le(vt)):Le(null)},Ve)})},count:function(ge){var de=ge.query,fe=ge.trans,Se=de.index,Re=de.range;return new Promise(function(xe,Le){var Ve=fe.objectStore(pe),Ve=Se.isPrimaryKey?Ve:Ve.index(Se.name),et=z(Re),et=et?Ve.count(et):Ve.count();et.onsuccess=ot(function(tt){return xe(tt.target.result)}),et.onerror=ti(Le)})}}}G=ue,ne=qo((ue=E).objectStoreNames);var G,ue={schema:{name:ue.name,tables:ne.map(function(he){return G.objectStore(he)}).map(function(he){var ce=he.keyPath,pe=he.autoIncrement,de=o(ce),ge={},de={name:he.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ce==null,compound:de,keyPath:ce,autoIncrement:pe,unique:!0,extractKey:Ka(ce)},indexes:qo(he.indexNames).map(function(fe){return he.index(fe)}).map(function(xe){var Le=xe.name,Se=xe.unique,Re=xe.multiEntry,xe=xe.keyPath,Le={name:Le,compound:o(xe),keyPath:xe,unique:Se,multiEntry:Re,extractKey:Ka(xe)};return ge[di(xe)]=Le}),getIndexByKeyPath:function(fe){return ge[di(fe)]}};return ge[":id"]=de.primaryKey,ce!=null&&(ge[di(ce)]=de.primaryKey),de})},hasGetAll:0<ne.length&&"getAll"in G.objectStore(ne[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},ne=ue.schema,ie=ue.hasGetAll,ue=ne.tables.map(q),ve={};return ue.forEach(function(he){return ve[he.name]=he}),{stack:"dbcore",transaction:E.transaction.bind(E),table:function(he){if(ve[he])return ve[he];throw new Error("Table '".concat(he,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Ga(R),schema:ne}}function Bl(E,R,I,z){return I=I.IDBKeyRange,R=sa(R,I,z),{dbcore:E.dbcore.reduce(function(q,G){return G=G.create,i(i({},q),G(q))},R)}}function Ns(E,R){var I=R.db,I=Bl(E._middlewares,I,E._deps,R);E.core=I.dbcore,E.tables.forEach(function(z){var q=z.name;E.core.schema.tables.some(function(G){return G.name===q})&&(z.core=E.core.table(q),E[q]instanceof E.Table)&&(E[q].core=z.core)})}function zl(E,R,I,z){I.forEach(function(q){var G=z[q];R.forEach(function(ne){var ie=(function ue(ve,he){return v(ve,he)||(ve=h(ve))&&ue(ve,he)})(ne,q);(!ie||"value"in ie&&ie.value===void 0)&&(ne===E.Transaction.prototype||ne instanceof E.Transaction?_(ne,q,{get:function(){return this.table(q)},set:function(ue){g(this,q,{value:ue,writable:!0,configurable:!0,enumerable:!0})}}):ne[q]=new E.Table(q,G))})})}function Vo(E,R){R.forEach(function(I){for(var z in I)I[z]instanceof E.Table&&delete I[z]})}function _u(E,R){return E._cfg.version-R._cfg.version}function Wo(E,R,I,z){var q=E._dbSchema,G=(I.objectStoreNames.contains("$meta")&&!q.$meta&&(q.$meta=$a("$meta",md("")[0],[]),E._storeNames.push("$meta")),E._createTransaction("readwrite",E._storeNames,q)),ne=(G.create(I),G._completion.catch(z),G._reject.bind(G)),ie=Je.transless||Je;Tn(function(){if(Je.trans=G,Je.transless=ie,R!==0)return Ns(E,I),ve=R,((ue=G).storeNames.includes("$meta")?ue.table("$meta").get("version").then(function(he){return he??ve}):nt.resolve(ve)).then(function(Se){var ce=E,pe=Se,ge=G,de=I,fe=[],Se=ce._versions,Re=ce._dbSchema=Ya(0,ce.idbdb,de);return(Se=Se.filter(function(xe){return xe._cfg.version>=pe})).length===0?nt.resolve():(Se.forEach(function(xe){fe.push(function(){var Le,Ve,et,tt=Re,$e=xe._cfg.dbschema,ut=(jl(ce,tt,de),jl(ce,$e,de),Re=ce._dbSchema=$e,Fl(tt,$e)),at=(ut.add.forEach(function(Ge){bu(de,Ge[0],Ge[1].primKey,Ge[1].indexes)}),ut.change.forEach(function(Ge){if(Ge.recreate)throw new ye.Upgrade("Not yet support for changing primary key");var ht=de.objectStore(Ge.name);Ge.add.forEach(function(zt){return Ul(ht,zt)}),Ge.change.forEach(function(zt){ht.deleteIndex(zt.name),Ul(ht,zt)}),Ge.del.forEach(function(zt){return ht.deleteIndex(zt)})}),xe._cfg.contentUpgrade);if(at&&xe._cfg.version>pe)return Ns(ce,de),ge._memoizedTables={},Le=N($e),ut.del.forEach(function(Ge){Le[Ge]=tt[Ge]}),Vo(ce,[ce.Transaction.prototype]),zl(ce,[ce.Transaction.prototype],l(Le),Le),ge.schema=Le,(Ve=U(at))&&Qn(),$e=nt.follow(function(){var Ge;(et=at(ge))&&Ve&&(Ge=Di.bind(null,null),et.then(Ge,Ge))}),et&&typeof et.then=="function"?nt.resolve(et):$e.then(function(){return et})}),fe.push(function(Le){var Ve,et,tt=xe._cfg.dbschema;Ve=tt,et=Le,[].slice.call(et.db.objectStoreNames).forEach(function($e){return Ve[$e]==null&&et.db.deleteObjectStore($e)}),Vo(ce,[ce.Transaction.prototype]),zl(ce,[ce.Transaction.prototype],ce._storeNames,ce._dbSchema),ge.schema=ce._dbSchema}),fe.push(function(Le){ce.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(ce.idbdb.version/10)===xe._cfg.version?(ce.idbdb.deleteObjectStore("$meta"),delete ce._dbSchema.$meta,ce._storeNames=ce._storeNames.filter(function(Ve){return Ve!=="$meta"})):Le.objectStore("$meta").put(xe._cfg.version,"version"))})}),(function xe(){return fe.length?nt.resolve(fe.shift()(ge.idbtrans)).then(xe):nt.resolve()})().then(function(){pd(Re,de)}))}).catch(ne);var ue,ve;l(q).forEach(function(he){bu(I,he,q[he].primKey,q[he].indexes)}),Ns(E,I),nt.follow(function(){return E.on.populate.fire(G)}).catch(ne)})}function Pl(E,R){pd(E._dbSchema,R),R.db.version%10!=0||R.objectStoreNames.contains("$meta")||R.db.createObjectStore("$meta").add(Math.ceil(R.db.version/10-1),"version");var I=Ya(0,E.idbdb,R);jl(E,E._dbSchema,R);for(var z=0,q=Fl(I,E._dbSchema).change;z<q.length;z++){var G=(ne=>{if(ne.change.length||ne.recreate)return console.warn("Unable to patch indexes of table ".concat(ne.name," because it has changes on the type of index or primary key.")),{value:void 0};var ie=R.objectStore(ne.name);ne.add.forEach(function(ue){Lt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(ne.name,".").concat(ue.src)),Ul(ie,ue)})})(q[z]);if(typeof G=="object")return G.value}}function Fl(E,R){var I,z={del:[],add:[],change:[]};for(I in E)R[I]||z.del.push(I);for(I in R){var q=E[I],G=R[I];if(q){var ne={name:I,def:G,recreate:!1,del:[],add:[],change:[]};if(""+(q.primKey.keyPath||"")!=""+(G.primKey.keyPath||"")||q.primKey.auto!==G.primKey.auto)ne.recreate=!0,z.change.push(ne);else{var ie=q.idxByName,ue=G.idxByName,ve=void 0;for(ve in ie)ue[ve]||ne.del.push(ve);for(ve in ue){var he=ie[ve],ce=ue[ve];he?he.src!==ce.src&&ne.change.push(ce):ne.add.push(ce)}(0<ne.del.length||0<ne.add.length||0<ne.change.length)&&z.change.push(ne)}}else z.add.push([I,G])}return z}function bu(E,R,I,z){var q=E.db.createObjectStore(R,I.keyPath?{keyPath:I.keyPath,autoIncrement:I.auto}:{autoIncrement:I.auto});z.forEach(function(G){return Ul(q,G)})}function pd(E,R){l(E).forEach(function(I){R.db.objectStoreNames.contains(I)||(Lt&&console.debug("Dexie: Creating missing table",I),bu(R,I,E[I].primKey,E[I].indexes))})}function Ul(E,R){E.createIndex(R.name,R.keyPath,{unique:R.unique,multiEntry:R.multi})}function Ya(E,R,I){var z={};return S(R.objectStoreNames,0).forEach(function(q){for(var G=I.objectStore(q),ne=Hr(Ll(ve=G.keyPath),ve||"",!0,!1,!!G.autoIncrement,ve&&typeof ve!="string",!0),ie=[],ue=0;ue<G.indexNames.length;++ue){var he=G.index(G.indexNames[ue]),ve=he.keyPath,he=Hr(he.name,ve,!!he.unique,!!he.multiEntry,!1,ve&&typeof ve!="string",!1);ie.push(he)}z[q]=$a(q,ne,ie)}),z}function jl(E,R,I){for(var z=I.db.objectStoreNames,q=0;q<z.length;++q){var G=z[q],ne=I.objectStore(G);E._hasGetAll="getAll"in ne;for(var ie=0;ie<ne.indexNames.length;++ie){var ue,ve=ne.indexNames[ie],he=ne.index(ve).keyPath,he=typeof he=="string"?he:"["+S(he).join("+")+"]";R[G]&&(ue=R[G].idxByName[he])&&(ue.name=ve,delete R[G].idxByName[he],R[G].idxByName[ve]=ue)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(E._hasGetAll=!1)}function md(E){return E.split(",").map(function(R,I){var q=R.split(":"),z=(z=q[1])==null?void 0:z.trim(),q=(R=q[0].trim()).replace(/([&*]|\+\+)/g,""),G=/^\[/.test(q)?q.match(/^\[(.*)\]$/)[1].split("+"):q;return Hr(q,G||null,/\&/.test(R),/\*/.test(R),/\+\+/.test(R),o(G),I===0,z)})}Xa.prototype._createTableSchema=$a,Xa.prototype._parseIndexSyntax=md,Xa.prototype._parseStoresSpec=function(E,R){var I=this;l(E).forEach(function(z){if(E[z]!==null){var q=I._parseIndexSyntax(E[z]),G=q.shift();if(!G)throw new ye.Schema("Invalid schema for table "+z+": "+E[z]);if(G.unique=!0,G.multi)throw new ye.Schema("Primary key cannot be multiEntry*");q.forEach(function(ne){if(ne.auto)throw new ye.Schema("Only primary key can be marked as autoIncrement (++)");if(!ne.keyPath)throw new ye.Schema("Index must have a name and cannot be an empty string")}),G=I._createTableSchema(z,G,q),R[z]=G}})},Xa.prototype.stores=function(I){var R=this.db,I=(this._cfg.storesSource=this._cfg.storesSource?u(this._cfg.storesSource,I):I,R._versions),z={},q={};return I.forEach(function(G){u(z,G._cfg.storesSource),q=G._cfg.dbschema={},G._parseStoresSpec(z,q)}),R._dbSchema=q,Vo(R,[R._allTables,R,R.Transaction.prototype]),zl(R,[R._allTables,R,R.Transaction.prototype,this._cfg.tables],l(q),q),R._storeNames=l(q),this},Xa.prototype.upgrade=function(E){return this._cfg.contentUpgrade=bt(this._cfg.contentUpgrade||we,E),this};var wm=Xa;function Xa(){}function vu(E,R){var I=E._dbNamesDB;return I||(I=E._dbNamesDB=new qr(Ur,{addons:[],indexedDB:E,IDBKeyRange:R})).version(1).stores({dbnames:"name"}),I.table("dbnames")}function Hl(E){return E&&typeof E.databases=="function"}function xu(E){return Tn(function(){return Je.letThrough=!0,E()})}function Su(E){return!("from"in E)}var Mi=function(E,R){var I;if(!this)return I=new Mi,E&&"d"in E&&u(I,E),I;u(this,arguments.length?{d:1,from:E,to:1<arguments.length?R:E}:{d:0})};function $o(E,R,I){var z=Tt(R,I);if(!isNaN(z)){if(0<z)throw RangeError();if(Su(E))return u(E,{from:R,to:I,d:1});var z=E.l,q=E.r;if(Tt(I,E.from)<0)return z?$o(z,R,I):E.l={from:R,to:I,d:1,l:null,r:null},yd(E);if(0<Tt(R,E.to))return q?$o(q,R,I):E.r={from:R,to:I,d:1,l:null,r:null},yd(E);Tt(R,E.from)<0&&(E.from=R,E.l=null,E.d=q?q.d+1:1),0<Tt(I,E.to)&&(E.to=I,E.r=null,E.d=E.l?E.l.d+1:1),R=!E.r,z&&!E.l&&aa(E,z),q&&R&&aa(E,q)}}function aa(E,R){Su(R)||(function I(z,q){var G=q.from,ne=q.l,ie=q.r;$o(z,G,q.to),ne&&I(z,ne),ie&&I(z,ie)})(E,R)}function gd(E,R){var I=ql(R),z=I.next();if(!z.done)for(var q=z.value,G=ql(E),ne=G.next(q.from),ie=ne.value;!z.done&&!ne.done;){if(Tt(ie.from,q.to)<=0&&0<=Tt(ie.to,q.from))return!0;Tt(q.from,ie.from)<0?q=(z=I.next(ie.from)).value:ie=(ne=G.next(q.from)).value}return!1}function ql(E){var R=Su(E)?null:{s:0,n:E};return{next:function(I){for(var z=0<arguments.length;R;)switch(R.s){case 0:if(R.s=1,z)for(;R.n.l&&Tt(I,R.n.from)<0;)R={up:R,n:R.n.l,s:1};else for(;R.n.l;)R={up:R,n:R.n.l,s:1};case 1:if(R.s=2,!z||Tt(I,R.n.to)<=0)return{value:R.n,done:!1};case 2:if(R.n.r){R.s=3,R={up:R,n:R.n.r,s:0};continue}case 3:R=R.up}return{done:!0}}}}function yd(E){var R,I,z,q=(((q=E.r)==null?void 0:q.d)||0)-(((q=E.l)==null?void 0:q.d)||0),q=1<q?"r":q<-1?"l":"";q&&(R=q=="r"?"l":"r",I=i({},E),z=E[q],E.from=z.from,E.to=z.to,E[q]=z[q],I[q]=z[R],(E[R]=I).d=wu(I)),E.d=wu(E)}function wu(I){var R=I.r,I=I.l;return(R?I?Math.max(R.d,I.d):R.d:I?I.d:0)+1}function Vl(E,R){return l(R).forEach(function(I){E[I]?aa(E[I],R[I]):E[I]=(function z(q){var G,ne,ie={};for(G in q)f(q,G)&&(ne=q[G],ie[G]=!ne||typeof ne!="object"||K.has(ne.constructor)?ne:z(ne));return ie})(R[I])}),E}function Cu(E,R){return E.all||R.all||Object.keys(E).some(function(I){return R[I]&&gd(R[I],E[I])})}m(Mi.prototype,((Ce={add:function(E){return aa(this,E),this},addKey:function(E){return $o(this,E,E),this},addKeys:function(E){var R=this;return E.forEach(function(I){return $o(R,I,I)}),this},hasKey:function(E){var R=ql(this).next(E).value;return R&&Tt(R.from,E)<=0&&0<=Tt(R.to,E)}})[$]=function(){return ql(this)},Ce));var oa={},Eu={},Au=!1;function Wl(E){Vl(Eu,E),Au||(Au=!0,setTimeout(function(){Au=!1,ku(Eu,!(Eu={}))},0))}function ku(E,R){R===void 0&&(R=!1);var I=new Set;if(E.all)for(var z=0,q=Object.values(oa);z<q.length;z++)_d(ie=q[z],E,I,R);else for(var G in E){var ne,ie,G=/^idb\:\/\/(.*)\/(.*)\//.exec(G);G&&(ne=G[1],G=G[2],ie=oa["idb://".concat(ne,"/").concat(G)])&&_d(ie,E,I,R)}I.forEach(function(ue){return ue()})}function _d(E,R,I,z){for(var q=[],G=0,ne=Object.entries(E.queries.query);G<ne.length;G++){for(var ie=ne[G],ue=ie[0],ve=[],he=0,ce=ie[1];he<ce.length;he++){var pe=ce[he];Cu(R,pe.obsSet)?pe.subscribers.forEach(function(Se){return I.add(Se)}):z&&ve.push(pe)}z&&q.push([ue,ve])}if(z)for(var ge=0,de=q;ge<de.length;ge++){var fe=de[ge],ue=fe[0],ve=fe[1];E.queries.query[ue]=ve}}function Cm(E){var R=E._state,I=E._deps.indexedDB;if(R.isBeingOpened||E.idbdb)return R.dbReadyPromise.then(function(){return R.dbOpenError?En(R.dbOpenError):E});R.isBeingOpened=!0,R.dbOpenError=null,R.openComplete=!1;var z=R.openCanceller,q=Math.round(10*E.verno),G=!1;function ne(){if(R.openCanceller!==z)throw new ye.DatabaseClosed("db.open() was cancelled")}function ie(){return new nt(function(pe,ge){if(ne(),!I)throw new ye.MissingAPI;var de=E.name,fe=R.autoSchema||!q?I.open(de):I.open(de,q);if(!fe)throw new ye.MissingAPI;fe.onerror=ti(ge),fe.onblocked=ot(E._fireOnBlocked),fe.onupgradeneeded=ot(function(Se){var Re;he=fe.transaction,R.autoSchema&&!E._options.allowEmptyDB?(fe.onerror=us,he.abort(),fe.result.close(),(Re=I.deleteDatabase(de)).onsuccess=Re.onerror=ot(function(){ge(new ye.NoSuchDatabase("Database ".concat(de," doesnt exist")))})):(he.onerror=ti(ge),Re=Se.oldVersion>Math.pow(2,62)?0:Se.oldVersion,ce=Re<1,E.idbdb=fe.result,G&&Pl(E,he),Wo(E,Re/10,he,ge))},ge),fe.onsuccess=ot(function(){he=null;var Se,Re,xe,Le,Ve,et,tt=E.idbdb=fe.result,$e=S(tt.objectStoreNames);if(0<$e.length)try{var ut=tt.transaction((Ve=$e).length===1?Ve[0]:Ve,"readonly");if(R.autoSchema)et=tt,Le=ut,(xe=E).verno=et.version/10,Le=xe._dbSchema=Ya(0,et,Le),xe._storeNames=S(et.objectStoreNames,0),zl(xe,[xe._allTables],l(Le),Le);else if(jl(E,E._dbSchema,ut),Re=ut,((Re=Fl(Ya(0,(Se=E).idbdb,Re),Se._dbSchema)).add.length||Re.change.some(function(at){return at.add.length||at.change.length}))&&!G)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),tt.close(),q=tt.version+1,G=!0,pe(ie());Ns(E,ut)}catch{}as.push(E),tt.onversionchange=ot(function(at){R.vcFired=!0,E.on("versionchange").fire(at)}),tt.onclose=ot(function(){E.close({disableAutoOpen:!1})}),ce&&($e=E._deps,Ve=de,Hl(et=$e.indexedDB)||Ve===Ur||vu(et,$e.IDBKeyRange).put({name:Ve}).catch(we)),pe()},ge)}).catch(function(pe){switch(pe?.name){case"UnknownError":if(0<R.PR1398_maxLoop)return R.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),ie();break;case"VersionError":if(0<q)return q=0,ie()}return nt.reject(pe)})}var ue,ve=R.dbReadyResolve,he=null,ce=!1;return nt.race([z,(typeof navigator>"u"?nt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(pe){function ge(){return indexedDB.databases().finally(pe)}ue=setInterval(ge,100),ge()}).finally(function(){return clearInterval(ue)}):Promise.resolve()).then(ie)]).then(function(){return ne(),R.onReadyBeingFired=[],nt.resolve(xu(function(){return E.on.ready.fire(E.vip)})).then(function pe(){var ge;if(0<R.onReadyBeingFired.length)return ge=R.onReadyBeingFired.reduce(bt,we),R.onReadyBeingFired=[],nt.resolve(xu(function(){return ge(E.vip)})).then(pe)})}).finally(function(){R.openCanceller===z&&(R.onReadyBeingFired=null,R.isBeingOpened=!1)}).catch(function(pe){R.dbOpenError=pe;try{he&&he.abort()}catch{}return z===R.openCanceller&&E._close(),En(pe)}).finally(function(){R.openComplete=!0,ve()}).then(function(){var pe;return ce&&(pe={},E.tables.forEach(function(ge){ge.schema.indexes.forEach(function(de){de.name&&(pe["idb://".concat(E.name,"/").concat(ge.name,"/").concat(de.name)]=new Mi(-1/0,[[[]]]))}),pe["idb://".concat(E.name,"/").concat(ge.name,"/")]=pe["idb://".concat(E.name,"/").concat(ge.name,"/:dels")]=new Mi(-1/0,[[[]]])}),Ti(Os).fire(pe),ku(pe,!0)),E})}function Go(E){function R(G){return E.next(G)}var I=q(R),z=q(function(G){return E.throw(G)});function q(G){return function(ie){var ie=G(ie),ue=ie.value;return ie.done?ue:ue&&typeof ue.then=="function"?ue.then(I,z):o(ue)?Promise.all(ue).then(I,z):I(ue)}}return q(R)()}function Ds(E,R,I){for(var z=o(E)?E.slice():[E],q=0;q<I;++q)z.push(R);return z}var Em={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(E){return i(i({},E),{table:function(z){var I=E.table(z),z=I.schema,q={},G=[];function ne(pe,ge,de){var xe=di(pe),fe=q[xe]=q[xe]||[],Se=pe==null?0:typeof pe=="string"?1:pe.length,Re=0<ge,xe=i(i({},de),{name:Re?"".concat(xe,"(virtual-from:").concat(de.name,")"):de.name,lowLevelIndex:de,isVirtual:Re,keyTail:ge,keyLength:Se,extractKey:Ka(pe),unique:!Re&&de.unique});return fe.push(xe),xe.isPrimaryKey||G.push(xe),1<Se&&ne(Se===2?pe[0]:pe.slice(0,Se-1),ge+1,de),fe.sort(function(Le,Ve){return Le.keyTail-Ve.keyTail}),xe}var ie=ne(z.primaryKey.keyPath,0,z.primaryKey);q[":id"]=[ie];for(var ue=0,ve=z.indexes;ue<ve.length;ue++){var he=ve[ue];ne(he.keyPath,0,he)}function ce(pe){var ge,de=pe.query.index;return de.isVirtual?i(i({},pe),{query:{index:de.lowLevelIndex,range:(ge=pe.query.range,de=de.keyTail,{type:ge.type===1?2:ge.type,lower:Ds(ge.lower,ge.lowerOpen?E.MAX_KEY:E.MIN_KEY,de),lowerOpen:!0,upper:Ds(ge.upper,ge.upperOpen?E.MIN_KEY:E.MAX_KEY,de),upperOpen:!0})}}):pe}return i(i({},I),{schema:i(i({},z),{primaryKey:ie,indexes:G,getIndexByKeyPath:function(pe){return(pe=q[di(pe)])&&pe[0]}}),count:function(pe){return I.count(ce(pe))},query:function(pe){return I.query(ce(pe))},openCursor:function(pe){var ge=pe.query.index,de=ge.keyTail,fe=ge.keyLength;return ge.isVirtual?I.openCursor(ce(pe)).then(function(Re){return Re&&Se(Re)}):I.openCursor(pe);function Se(Re){return Object.create(Re,{continue:{value:function(xe){xe!=null?Re.continue(Ds(xe,pe.reverse?E.MAX_KEY:E.MIN_KEY,de)):pe.unique?Re.continue(Re.key.slice(0,fe).concat(pe.reverse?E.MIN_KEY:E.MAX_KEY,de)):Re.continue()}},continuePrimaryKey:{value:function(xe,Le){Re.continuePrimaryKey(Ds(xe,E.MAX_KEY,de),Le)}},primaryKey:{get:function(){return Re.primaryKey}},key:{get:function(){var xe=Re.key;return fe===1?xe[0]:xe.slice(0,fe)}},value:{get:function(){return Re.value}}})}}})}})}};function $l(E,R,I,z){return I=I||{},z=z||"",l(E).forEach(function(q){var G,ne,ie;f(R,q)?(G=E[q],ne=R[q],typeof G=="object"&&typeof ne=="object"&&G&&ne?(ie=te(G))!==te(ne)?I[z+q]=R[q]:ie==="Object"?$l(G,ne,I,z+q+"."):G!==ne&&(I[z+q]=R[q]):G!==ne&&(I[z+q]=R[q])):I[z+q]=void 0}),l(R).forEach(function(q){f(E,q)||(I[z+q]=R[q])}),I}function Gl(E,R){return R.type==="delete"?R.keys:R.keys||R.values.map(E.extractKey)}var bd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(E){return i(i({},E),{table:function(R){var I=E.table(R),z=I.schema.primaryKey;return i(i({},I),{mutate:function(q){var G=Je.trans,ne=G.table(R).hook,ie=ne.deleting,ue=ne.creating,ve=ne.updating;switch(q.type){case"add":if(ue.fire===we)break;return G._promise("readwrite",function(){return he(q)},!0);case"put":if(ue.fire===we&&ve.fire===we)break;return G._promise("readwrite",function(){return he(q)},!0);case"delete":if(ie.fire===we)break;return G._promise("readwrite",function(){return he(q)},!0);case"deleteRange":if(ie.fire===we)break;return G._promise("readwrite",function(){return(function ce(pe,ge,de){return I.query({trans:pe,values:!1,query:{index:z,range:ge},limit:de}).then(function(fe){var Se=fe.result;return he({type:"delete",keys:Se,trans:pe}).then(function(Re){return 0<Re.numFailures?Promise.reject(Re.failures[0]):Se.length<de?{failures:[],numFailures:0,lastResult:void 0}:ce(pe,i(i({},ge),{lower:Se[Se.length-1],lowerOpen:!0}),de)})})})(q.trans,q.range,1e4)},!0)}return I.mutate(q);function he(ce){var pe,ge,de,fe=Je.trans,Se=ce.keys||Gl(z,ce);if(Se)return(ce=ce.type==="add"||ce.type==="put"?i(i({},ce),{keys:Se}):i({},ce)).type!=="delete"&&(ce.values=r([],ce.values)),ce.keys&&(ce.keys=r([],ce.keys)),pe=I,de=Se,((ge=ce).type==="add"?Promise.resolve([]):pe.getMany({trans:ge.trans,keys:de,cache:"immutable"})).then(function(Re){var xe=Se.map(function(Le,Ve){var et,tt,$e,ut=Re[Ve],at={onerror:null,onsuccess:null};return ce.type==="delete"?ie.fire.call(at,Le,ut,fe):ce.type==="add"||ut===void 0?(et=ue.fire.call(at,Le,ce.values[Ve],fe),Le==null&&et!=null&&(ce.keys[Ve]=Le=et,z.outbound||D(ce.values[Ve],z.keyPath,Le))):(et=$l(ut,ce.values[Ve]),(tt=ve.fire.call(at,et,Le,ut,fe))&&($e=ce.values[Ve],Object.keys(tt).forEach(function(Ge){f($e,Ge)?$e[Ge]=tt[Ge]:D($e,Ge,tt[Ge])}))),at});return I.mutate(ce).then(function(Le){for(var Ve=Le.failures,et=Le.results,tt=Le.numFailures,Le=Le.lastResult,$e=0;$e<Se.length;++$e){var ut=(et||Se)[$e],at=xe[$e];ut==null?at.onerror&&at.onerror(Ve[$e]):at.onsuccess&&at.onsuccess(ce.type==="put"&&Re[$e]?ce.values[$e]:ut)}return{failures:Ve,results:et,numFailures:tt,lastResult:Le}}).catch(function(Le){return xe.forEach(function(Ve){return Ve.onerror&&Ve.onerror(Le)}),Promise.reject(Le)})});throw new Error("Keys missing")}}})}})}};function Tu(E,R,I){try{if(!R||R.keys.length<E.length)return null;for(var z=[],q=0,G=0;q<R.keys.length&&G<E.length;++q)Tt(R.keys[q],E[G])===0&&(z.push(I?H(R.values[q]):R.values[q]),++G);return z.length===E.length?z:null}catch{return null}}var vd={stack:"dbcore",level:-1,create:function(E){return{table:function(R){var I=E.table(R);return i(i({},I),{getMany:function(z){var q;return z.cache?(q=Tu(z.keys,z.trans._cache,z.cache==="clone"))?nt.resolve(q):I.getMany(z).then(function(G){return z.trans._cache={keys:z.keys,values:z.cache==="clone"?H(G):G},G}):I.getMany(z)},mutate:function(z){return z.type!=="add"&&(z.trans._cache=null),I.mutate(z)}})}}}};function la(E,R){return E.trans.mode==="readonly"&&!!E.subscr&&!E.trans.explicit&&E.trans.db._options.cache!=="disabled"&&!R.schema.primaryKey.outbound}function xd(E,R){switch(E){case"query":return R.values&&!R.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Am={stack:"dbcore",level:0,name:"Observability",create:function(E){var R=E.schema.name,I=new Mi(E.MIN_KEY,E.MAX_KEY);return i(i({},E),{transaction:function(z,q,G){if(Je.subscr&&q!=="readonly")throw new ye.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Je.querier));return E.transaction(z,q,G)},table:function(z){function q(Se){var fe,Se=Se.query;return[fe=Se.index,new Mi((fe=(Se=Se.range).lower)!=null?fe:E.MIN_KEY,(fe=Se.upper)!=null?fe:E.MAX_KEY)]}var G=E.table(z),ne=G.schema,ie=ne.primaryKey,ue=ne.indexes,ve=ie.extractKey,he=ie.outbound,ce=ie.autoIncrement&&ue.filter(function(de){return de.compound&&de.keyPath.includes(ie.keyPath)}),pe=i(i({},G),{mutate:function(de){function fe(ht){return ht="idb://".concat(R,"/").concat(z,"/").concat(ht),Ve[ht]||(Ve[ht]=new Mi)}var Se,Re,xe,Le=de.trans,Ve=de.mutatedParts||(de.mutatedParts={}),et=fe(""),tt=fe(":dels"),$e=de.type,at=de.type==="deleteRange"?[de.range]:de.type==="delete"?[de.keys]:de.values.length<50?[Gl(ie,de).filter(function(ht){return ht}),de.values]:[],ut=at[0],at=at[1],Ge=de.trans._cache;return o(ut)?(et.addKeys(ut),($e=$e==="delete"||ut.length===at.length?Tu(ut,Ge):null)||tt.addKeys(ut),($e||at)&&(Se=fe,Re=$e,xe=at,ne.indexes.forEach(function(ht){var zt=Se(ht.name||"");function nn(qt){return qt!=null?ht.extractKey(qt):null}function vt(qt){ht.multiEntry&&o(qt)?qt.forEach(function(Dn){return zt.addKey(Dn)}):zt.addKey(qt)}(Re||xe).forEach(function(qt,Mn){var Vi=Re&&nn(Re[Mn]),Mn=xe&&nn(xe[Mn]);Tt(Vi,Mn)!==0&&(Vi!=null&&vt(Vi),Mn!=null)&&vt(Mn)})}))):ut?(at={from:(Ge=ut.lower)!=null?Ge:E.MIN_KEY,to:($e=ut.upper)!=null?$e:E.MAX_KEY},tt.add(at),et.add(at)):(et.add(I),tt.add(I),ne.indexes.forEach(function(ht){return fe(ht.name).add(I)})),G.mutate(de).then(function(ht){return!ut||de.type!=="add"&&de.type!=="put"||(et.addKeys(ht.results),ce&&ce.forEach(function(zt){for(var nn=de.values.map(function(Vi){return zt.extractKey(Vi)}),vt=zt.keyPath.findIndex(function(Vi){return Vi===ie.keyPath}),qt=0,Dn=ht.results.length;qt<Dn;++qt)nn[qt][vt]=ht.results[qt];fe(zt.name).addKeys(nn)})),Le.mutatedParts=Vl(Le.mutatedParts||{},Ve),ht})}}),ge={get:function(de){return[ie,new Mi(de.key)]},getMany:function(de){return[ie,new Mi().addKeys(de.keys)]},count:q,query:q,openCursor:q};return l(ge).forEach(function(de){pe[de]=function(fe){var Se=Je.subscr,Re=!!Se,xe=la(Je,G)&&xd(de,fe)?fe.obsSet={}:Se;if(Re){var Le,Se=function(at){return at="idb://".concat(R,"/").concat(z,"/").concat(at),xe[at]||(xe[at]=new Mi)},Ve=Se(""),et=Se(":dels"),Re=ge[de](fe),tt=Re[0],Re=Re[1];if((de==="query"&&tt.isPrimaryKey&&!fe.values?et:Se(tt.name||"")).add(Re),!tt.isPrimaryKey){if(de!=="count")return Le=de==="query"&&he&&fe.values&&G.query(i(i({},fe),{values:!1})),G[de].apply(this,arguments).then(function(at){if(de==="query"){if(he&&fe.values)return Le.then(function(nn){return nn=nn.result,Ve.addKeys(nn),at});var Ge=fe.values?at.result.map(ve):at.result;(fe.values?Ve:et).addKeys(Ge)}else{var ht,zt;if(de==="openCursor")return zt=fe.values,(ht=at)&&Object.create(ht,{key:{get:function(){return et.addKey(ht.primaryKey),ht.key}},primaryKey:{get:function(){var nn=ht.primaryKey;return et.addKey(nn),nn}},value:{get:function(){return zt&&Ve.addKey(ht.primaryKey),ht.value}}})}return at});et.add(I)}}return G[de].apply(this,arguments)}}),pe}})}};function Sd(E,R,I){var z;return I.numFailures===0?R:R.type==="deleteRange"||(z=R.keys?R.keys.length:"values"in R&&R.values?R.values.length:1,I.numFailures===z)?null:(z=i({},R),o(z.keys)&&(z.keys=z.keys.filter(function(q,G){return!(G in I.failures)})),"values"in z&&o(z.values)&&(z.values=z.values.filter(function(q,G){return!(G in I.failures)})),z)}function Kl(E,R){return I=E,((z=R).lower===void 0||(z.lowerOpen?0<Tt(I,z.lower):0<=Tt(I,z.lower)))&&(I=E,(z=R).upper===void 0||(z.upperOpen?Tt(I,z.upper)<0:Tt(I,z.upper)<=0));var I,z}function Mu(E,R,I,z,q,G){var ne,ie,ue,ve,he,ce;return!I||I.length===0||(ne=R.query.index,ie=ne.multiEntry,ue=R.query.range,ve=z.schema.primaryKey.extractKey,he=ne.extractKey,ce=(ne.lowLevelIndex||ne).extractKey,(z=I.reduce(function(pe,ge){var de=pe,fe=[];if(ge.type==="add"||ge.type==="put")for(var Se=new Mi,Re=ge.values.length-1;0<=Re;--Re){var xe,Le=ge.values[Re],Ve=ve(Le);!Se.hasKey(Ve)&&(xe=he(Le),ie&&o(xe)?xe.some(function(at){return Kl(at,ue)}):Kl(xe,ue))&&(Se.addKey(Ve),fe.push(Le))}switch(ge.type){case"add":var et=new Mi().addKeys(R.values?pe.map(function(Ge){return ve(Ge)}):pe),de=pe.concat(R.values?fe.filter(function(Ge){return Ge=ve(Ge),!et.hasKey(Ge)&&(et.addKey(Ge),!0)}):fe.map(function(Ge){return ve(Ge)}).filter(function(Ge){return!et.hasKey(Ge)&&(et.addKey(Ge),!0)}));break;case"put":var tt=new Mi().addKeys(ge.values.map(function(Ge){return ve(Ge)}));de=pe.filter(function(Ge){return!tt.hasKey(R.values?ve(Ge):Ge)}).concat(R.values?fe:fe.map(function(Ge){return ve(Ge)}));break;case"delete":var $e=new Mi().addKeys(ge.keys);de=pe.filter(function(Ge){return!$e.hasKey(R.values?ve(Ge):Ge)});break;case"deleteRange":var ut=ge.range;de=pe.filter(function(Ge){return!Kl(ve(Ge),ut)})}return de},E))===E)?E:(z.sort(function(pe,ge){return Tt(ce(pe),ce(ge))||Tt(ve(pe),ve(ge))}),R.limit&&R.limit<1/0&&(z.length>R.limit?z.length=R.limit:E.length===R.limit&&z.length<R.limit&&(q.dirty=!0)),G?Object.freeze(z):z)}function Za(E,R){return Tt(E.lower,R.lower)===0&&Tt(E.upper,R.upper)===0&&!!E.lowerOpen==!!R.lowerOpen&&!!E.upperOpen==!!R.upperOpen}function Ko(E,R){return((I,z,q,G)=>{if(I===void 0)return z!==void 0?-1:0;if(z===void 0)return 1;if((I=Tt(I,z))===0){if(q&&G)return 0;if(q)return 1;if(G)return-1}return I})(E.lower,R.lower,E.lowerOpen,R.lowerOpen)<=0&&0<=((I,z,q,G)=>{if(I===void 0)return z!==void 0?1:0;if(z===void 0)return-1;if((I=Tt(I,z))===0){if(q&&G)return 0;if(q)return-1;if(G)return 1}return I})(E.upper,R.upper,E.upperOpen,R.upperOpen)}function km(E,R,I,z){E.subscribers.add(I),z.addEventListener("abort",function(){var q,G;E.subscribers.delete(I),E.subscribers.size===0&&(q=E,G=R,setTimeout(function(){q.subscribers.size===0&&re(G,q)},3e3))})}var Yl={stack:"dbcore",level:0,name:"Cache",create:function(E){var R=E.schema.name;return i(i({},E),{transaction:function(I,z,q){var G,ne,ie=E.transaction(I,z,q);return z==="readwrite"&&(q=(G=new AbortController).signal,ie.addEventListener("abort",(ne=function(ue){return function(){if(G.abort(),z==="readwrite"){for(var ve=new Set,he=0,ce=I;he<ce.length;he++){var pe=ce[he],ge=oa["idb://".concat(R,"/").concat(pe)];if(ge){var de=E.table(pe),fe=ge.optimisticOps.filter(function(ht){return ht.trans===ie});if(ie._explicit&&ue&&ie.mutatedParts)for(var Se=0,Re=Object.values(ge.queries.query);Se<Re.length;Se++)for(var xe=0,Le=(tt=Re[Se]).slice();xe<Le.length;xe++)Cu(($e=Le[xe]).obsSet,ie.mutatedParts)&&(re(tt,$e),$e.subscribers.forEach(function(ht){return ve.add(ht)}));else if(0<fe.length){ge.optimisticOps=ge.optimisticOps.filter(function(ht){return ht.trans!==ie});for(var Ve=0,et=Object.values(ge.queries.query);Ve<et.length;Ve++)for(var tt,$e,ut,at=0,Ge=(tt=et[Ve]).slice();at<Ge.length;at++)($e=Ge[at]).res!=null&&ie.mutatedParts&&(ue&&!$e.dirty?(ut=Object.isFrozen($e.res),ut=Mu($e.res,$e.req,fe,de,$e,ut),$e.dirty?(re(tt,$e),$e.subscribers.forEach(function(ht){return ve.add(ht)})):ut!==$e.res&&($e.res=ut,$e.promise=nt.resolve({result:ut}))):($e.dirty&&re(tt,$e),$e.subscribers.forEach(function(ht){return ve.add(ht)})))}}}ve.forEach(function(ht){return ht()})}}})(!1),{signal:q}),ie.addEventListener("error",ne(!1),{signal:q}),ie.addEventListener("complete",ne(!0),{signal:q})),ie},table:function(I){var z=E.table(I),q=z.schema.primaryKey;return i(i({},z),{mutate:function(G){var ne,ie=Je.trans;return!q.outbound&&ie.db._options.cache!=="disabled"&&!ie.explicit&&ie.idbtrans.mode==="readwrite"&&(ne=oa["idb://".concat(R,"/").concat(I)])?(ie=z.mutate(G),G.type!=="add"&&G.type!=="put"||!(50<=G.values.length||Gl(q,G).some(function(ue){return ue==null}))?(ne.optimisticOps.push(G),G.mutatedParts&&Wl(G.mutatedParts),ie.then(function(ue){0<ue.numFailures&&(re(ne.optimisticOps,G),(ue=Sd(0,G,ue))&&ne.optimisticOps.push(ue),G.mutatedParts)&&Wl(G.mutatedParts)}),ie.catch(function(){re(ne.optimisticOps,G),G.mutatedParts&&Wl(G.mutatedParts)})):ie.then(function(ue){var ve=Sd(0,i(i({},G),{values:G.values.map(function(he,ce){var pe;return ue.failures[ce]?he:(D(pe=(pe=q.keyPath)!=null&&pe.includes(".")?H(he):i({},he),q.keyPath,ue.results[ce]),pe)})}),ue);ne.optimisticOps.push(ve),queueMicrotask(function(){return G.mutatedParts&&Wl(G.mutatedParts)})}),ie):z.mutate(G)},query:function(G){var ne,ie,ue,ve,he,ce,pe;return la(Je,z)&&xd("query",G)?(ne=((ue=Je.trans)==null?void 0:ue.db._options.cache)==="immutable",ie=(ue=Je).requery,ue=ue.signal,ce=((ge,de,fe,Se)=>{var Re=oa["idb://".concat(ge,"/").concat(de)];if(!Re)return[];if(!(ge=Re.queries[fe]))return[null,!1,Re,null];var xe=ge[(Se.query?Se.query.index.name:null)||""];if(!xe)return[null,!1,Re,null];switch(fe){case"query":var Le=xe.find(function(Ve){return Ve.req.limit===Se.limit&&Ve.req.values===Se.values&&Za(Ve.req.query.range,Se.query.range)});return Le?[Le,!0,Re,xe]:[xe.find(function(Ve){return("limit"in Ve.req?Ve.req.limit:1/0)>=Se.limit&&(!Se.values||Ve.req.values)&&Ko(Ve.req.query.range,Se.query.range)}),!1,Re,xe];case"count":return Le=xe.find(function(Ve){return Za(Ve.req.query.range,Se.query.range)}),[Le,!!Le,Re,xe]}})(R,I,"query",G),pe=ce[0],ve=ce[2],he=ce[3],pe&&ce[1]?pe.obsSet=G.obsSet:(ce=z.query(G).then(function(ge){var de=ge.result;if(pe&&(pe.res=de),ne){for(var fe=0,Se=de.length;fe<Se;++fe)Object.freeze(de[fe]);Object.freeze(de)}else ge.result=H(de);return ge}).catch(function(ge){return he&&pe&&re(he,pe),Promise.reject(ge)}),pe={obsSet:G.obsSet,promise:ce,subscribers:new Set,type:"query",req:G,dirty:!1},he?he.push(pe):(he=[pe],(ve=ve||(oa["idb://".concat(R,"/").concat(I)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[G.query.index.name||""]=he)),km(pe,he,ie,ue),pe.promise.then(function(ge){return{result:Mu(ge.result,G,ve?.optimisticOps,z,pe,ne)}})):z.query(G)}})}})}};function Yo(E,R){return new Proxy(E,{get:function(I,z,q){return z==="db"?R:Reflect.get(I,z,q)}})}Wn.prototype.version=function(E){if(isNaN(E)||E<.1)throw new ye.Type("Given version is not a positive number");if(E=Math.round(10*E)/10,this.idbdb||this._state.isBeingOpened)throw new ye.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,E);var R=this._versions,I=R.filter(function(z){return z._cfg.version===E})[0];return I||(I=new this.Version(E),R.push(I),R.sort(_u),I.stores({}),this._state.autoSchema=!1),I},Wn.prototype._whenReady=function(E){var R=this;return this.idbdb&&(this._state.openComplete||Je.letThrough||this._vip)?E():new nt(function(I,z){if(R._state.openComplete)return z(new ye.DatabaseClosed(R._state.dbOpenError));if(!R._state.isBeingOpened){if(!R._state.autoOpen)return void z(new ye.DatabaseClosed);R.open().catch(we)}R._state.dbReadyPromise.then(I,z)}).then(E)},Wn.prototype.use=function(q){var R=q.stack,I=q.create,z=q.level,q=q.name,G=(q&&this.unuse({stack:R,name:q}),this._middlewares[R]||(this._middlewares[R]=[]));return G.push({stack:R,create:I,level:z??10,name:q}),G.sort(function(ne,ie){return ne.level-ie.level}),this},Wn.prototype.unuse=function(E){var R=E.stack,I=E.name,z=E.create;return R&&this._middlewares[R]&&(this._middlewares[R]=this._middlewares[R].filter(function(q){return z?q.create!==z:!!I&&q.name!==I})),this},Wn.prototype.open=function(){var E=this;return Qi(Vn,function(){return Cm(E)})},Wn.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var E=this._state,R=as.indexOf(this);if(0<=R&&as.splice(R,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}E.isBeingOpened||(E.dbReadyPromise=new nt(function(I){E.dbReadyResolve=I}),E.openCanceller=new nt(function(I,z){E.cancelOpen=z}))},Wn.prototype.close=function(R){var R=(R===void 0?{disableAutoOpen:!0}:R).disableAutoOpen,I=this._state;R?(I.isBeingOpened&&I.cancelOpen(new ye.DatabaseClosed),this._close(),I.autoOpen=!1,I.dbOpenError=new ye.DatabaseClosed):(this._close(),I.autoOpen=this._options.autoOpen||I.isBeingOpened,I.openComplete=!1,I.dbOpenError=null)},Wn.prototype.delete=function(E){var R=this,I=(E===void 0&&(E={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),z=this._state;return new nt(function(q,G){function ne(){R.close(E);var ie=R._deps.indexedDB.deleteDatabase(R.name);ie.onsuccess=ot(function(){var ue,ve,he;ue=R._deps,ve=R.name,Hl(he=ue.indexedDB)||ve===Ur||vu(he,ue.IDBKeyRange).delete(ve).catch(we),q()}),ie.onerror=ti(G),ie.onblocked=R._fireOnBlocked}if(I)throw new ye.InvalidArgument("Invalid closeOptions argument to db.delete()");z.isBeingOpened?z.dbReadyPromise.then(ne):ne()})},Wn.prototype.backendDB=function(){return this.idbdb},Wn.prototype.isOpen=function(){return this.idbdb!==null},Wn.prototype.hasBeenClosed=function(){var E=this._state.dbOpenError;return E&&E.name==="DatabaseClosed"},Wn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Wn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Wn.prototype,"tables",{get:function(){var E=this;return l(this._allTables).map(function(R){return E._allTables[R]})},enumerable:!1,configurable:!0}),Wn.prototype.transaction=function(){var E=(function(R,I,z){var q=arguments.length;if(q<2)throw new ye.InvalidArgument("Too few arguments");for(var G=new Array(q-1);--q;)G[q-1]=arguments[q];return z=G.pop(),[R,j(G),z]}).apply(this,arguments);return this._transaction.apply(this,E)},Wn.prototype._transaction=function(E,R,I){var z,q,G=this,ne=Je.trans,ie=(ne&&ne.db===this&&E.indexOf("!")===-1||(ne=null),E.indexOf("?")!==-1);E=E.replace("!","").replace("?","");try{if(q=R.map(function(ve){if(ve=ve instanceof G.Table?ve.name:ve,typeof ve!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ve}),E=="r"||E===vr)z=vr;else{if(E!="rw"&&E!=Ye)throw new ye.InvalidArgument("Invalid transaction mode: "+E);z=Ye}if(ne){if(ne.mode===vr&&z===Ye){if(!ie)throw new ye.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");ne=null}ne&&q.forEach(function(ve){if(ne&&ne.storeNames.indexOf(ve)===-1){if(!ie)throw new ye.SubTransaction("Table "+ve+" not included in parent transaction.");ne=null}}),ie&&ne&&!ne.active&&(ne=null)}}catch(ve){return ne?ne._promise(null,function(he,ce){ce(ve)}):En(ve)}var ue=(function ve(he,ce,pe,ge,de){return nt.resolve().then(function(){var xe=Je.transless||Je,fe=he._createTransaction(ce,pe,he._dbSchema,ge),xe=(fe.explicit=!0,{trans:fe,transless:xe});if(ge)fe.idbtrans=ge.idbtrans;else try{fe.create(),fe.idbtrans._explicit=!0,he._state.PR1398_maxLoop=3}catch(Le){return Le.name===ee.InvalidState&&he.isOpen()&&0<--he._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),he.close({disableAutoOpen:!1}),he.open().then(function(){return ve(he,ce,pe,null,de)})):En(Le)}var Se,Re=U(de),xe=(Re&&Qn(),nt.follow(function(){var Le;(Se=de.call(fe,fe))&&(Re?(Le=Di.bind(null,null),Se.then(Le,Le)):typeof Se.next=="function"&&typeof Se.throw=="function"&&(Se=Go(Se)))},xe));return(Se&&typeof Se.then=="function"?nt.resolve(Se).then(function(Le){return fe.active?Le:En(new ye.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Se})).then(function(Le){return ge&&fe._resolve(),fe._completion.then(function(){return Le})}).catch(function(Le){return fe._reject(Le),En(Le)})})}).bind(null,this,z,q,ne,I);return ne?ne._promise(z,ue,"lock"):Je.trans?Qi(Je.transless,function(){return G._whenReady(ue)}):this._whenReady(ue)},Wn.prototype.table=function(E){if(f(this._allTables,E))return this._allTables[E];throw new ye.InvalidTable("Table ".concat(E," does not exist"))};var qr=Wn;function Wn(E,R){var I,z,q,G,ne,ie=this,ue=(this._middlewares={},this.verno=0,Wn.dependencies),ue=(this._options=R=i({addons:Wn.addons,autoOpen:!0,indexedDB:ue.indexedDB,IDBKeyRange:ue.IDBKeyRange,cache:"cloned"},R),this._deps={indexedDB:R.indexedDB,IDBKeyRange:R.IDBKeyRange},R.addons),ve=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:we,dbReadyPromise:null,cancelOpen:we,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:R.autoOpen}),he=(ve.dbReadyPromise=new nt(function(ce){ve.dbReadyResolve=ce}),ve.openCanceller=new nt(function(ce,pe){ve.cancelOpen=pe}),this._state=ve,this.name=E,this.on=ia(this,"populate","blocked","versionchange","close",{ready:[bt,we]}),this.once=function(ce,pe){var ge=function(){for(var de=[],fe=0;fe<arguments.length;fe++)de[fe]=arguments[fe];ie.on(ce).unsubscribe(ge),pe.apply(ie,de)};return ie.on(ce,ge)},this.on.ready.subscribe=b(this.on.ready.subscribe,function(ce){return function(pe,ge){Wn.vip(function(){var de,fe=ie._state;fe.openComplete?(fe.dbOpenError||nt.resolve().then(pe),ge&&ce(pe)):fe.onReadyBeingFired?(fe.onReadyBeingFired.push(pe),ge&&ce(pe)):(ce(pe),de=ie,ge||ce(function Se(){de.on.ready.unsubscribe(pe),de.on.ready.unsubscribe(Se)}))})}}),this.Collection=(I=this,hi(Il.prototype,function(Se,fe){this.db=I;var ge=Xt,de=null;if(fe)try{ge=fe()}catch(xe){de=xe}var fe=Se._ctx,Se=fe.table,Re=Se.hook.reading.fire;this._ctx={table:Se,index:fe.index,isPrimKey:!fe.index||Se.schema.primKey.keyPath&&fe.index===Se.schema.primKey.name,range:ge,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:de,or:fe.or,valueMapper:Re!==it?Re:null}})),this.Table=(z=this,hi(Wa.prototype,function(ce,pe,ge){this.db=z,this._tx=ge,this.name=ce,this.schema=pe,this.hook=z._allTables[ce]?z._allTables[ce].hook:ia(null,{creating:[Fe,we],reading:[De,it],updating:[st,we],deleting:[je,we]})})),this.Transaction=(q=this,hi(yu.prototype,function(ce,pe,ge,de,fe){var Se=this;ce!=="readonly"&&pe.forEach(function(Re){Re=(Re=ge[Re])==null?void 0:Re.yProps,Re&&(pe=pe.concat(Re.map(function(xe){return xe.updatesTable})))}),this.db=q,this.mode=ce,this.storeNames=pe,this.schema=ge,this.chromeTransactionDurability=de,this.idbtrans=null,this.on=ia(this,"complete","error","abort"),this.parent=fe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new nt(function(Re,xe){Se._resolve=Re,Se._reject=xe}),this._completion.then(function(){Se.active=!1,Se.on.complete.fire()},function(Re){var xe=Se.active;return Se.active=!1,Se.on.error.fire(Re),Se.parent?Se.parent._reject(Re):xe&&Se.idbtrans&&Se.idbtrans.abort(),En(Re)})})),this.Version=(G=this,hi(wm.prototype,function(ce){this.db=G,this._cfg={version:ce,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(ne=this,hi(tn.prototype,function(ce,pe,ge){if(this.db=ne,this._ctx={table:ce,index:pe===":id"?null:pe,or:ge},this._cmp=this._ascending=Tt,this._descending=function(de,fe){return Tt(fe,de)},this._max=function(de,fe){return 0<Tt(de,fe)?de:fe},this._min=function(de,fe){return Tt(de,fe)<0?de:fe},this._IDBKeyRange=ne._deps.IDBKeyRange,!this._IDBKeyRange)throw new ye.MissingAPI})),this.on("versionchange",function(ce){0<ce.newVersion?console.warn("Another connection wants to upgrade database '".concat(ie.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(ie.name,"'. Closing db now to resume the delete request.")),ie.close({disableAutoOpen:!1})}),this.on("blocked",function(ce){!ce.newVersion||ce.newVersion<ce.oldVersion?console.warn("Dexie.delete('".concat(ie.name,"') was blocked")):console.warn("Upgrade '".concat(ie.name,"' blocked by other connection holding version ").concat(ce.oldVersion/10))}),this._maxKey=Ga(R.IDBKeyRange),this._createTransaction=function(ce,pe,ge,de){return new ie.Transaction(ce,pe,ge,ie._options.chromeTransactionDurability,de)},this._fireOnBlocked=function(ce){ie.on("blocked").fire(ce),as.filter(function(pe){return pe.name===ie.name&&pe!==ie&&!pe._state.vcFired}).map(function(pe){return pe.on("versionchange").fire(ce)})},this.use(vd),this.use(Yl),this.use(Am),this.use(Em),this.use(bd),new Proxy(this,{get:function(ce,pe,ge){var de;return pe==="_vip"||(pe==="table"?function(fe){return Yo(ie.table(fe),he)}:(de=Reflect.get(ce,pe,ge))instanceof Wa?Yo(de,he):pe==="tables"?de.map(function(fe){return Yo(fe,he)}):pe==="_createTransaction"?function(){return Yo(de.apply(this,arguments),he)}:de)}}));this.vip=he,ue.forEach(function(ce){return ce(ie)})}var Ja,ca=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",wd=(Xl.prototype.subscribe=function(E,R,I){return this._subscribe(E&&typeof E!="function"?E:{next:E,error:R,complete:I})},Xl.prototype[ca]=function(){return this},Xl);function Xl(E){this._subscribe=E}try{Ja={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{Ja={indexedDB:null,IDBKeyRange:null}}function Cd(E){var R,I=!1,z=new wd(function(q){var G=U(E),ne,ie=!1,ue={},ve={},he={get closed(){return ie},unsubscribe:function(){ie||(ie=!0,ne&&ne.abort(),ce&&Ti.storagemutated.unsubscribe(ge))}},ce=(q.start&&q.start(he),!1),pe=function(){return xi(de)},ge=function(fe){Vl(ue,fe),Cu(ve,ue)&&pe()},de=function(){var fe,Se,Re;!ie&&Ja.indexedDB&&(ue={},fe={},ne&&ne.abort(),ne=new AbortController,Re=(xe=>{var Le=yn();try{G&&Qn();var Ve=Tn(E,xe);return Ve=G?Ve.finally(Di):Ve}finally{Le&&dn()}})(Se={subscr:fe,signal:ne.signal,requery:pe,querier:E,trans:null}),Promise.resolve(Re).then(function(xe){I=!0,R=xe,ie||Se.signal.aborted||(ue={},(Le=>{for(var Ve in Le)if(f(Le,Ve))return;return 1})(ve=fe)||ce||(Ti(Os,ge),ce=!0),xi(function(){return!ie&&q.next&&q.next(xe)}))},function(xe){I=!1,["DatabaseClosedError","AbortError"].includes(xe?.name)||ie||xi(function(){ie||q.error&&q.error(xe)})}))};return setTimeout(pe,0),he});return z.hasValue=function(){return I},z.getValue=function(){return R},z}var ua=qr;function Ru(E){var R=Is;try{Is=!0,Ti.storagemutated.fire(E),ku(E,!0)}finally{Is=R}}m(ua,i(i({},X),{delete:function(E){return new ua(E,{addons:[]}).delete()},exists:function(E){return new ua(E,{addons:[]}).open().then(function(R){return R.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(E){try{return R=ua.dependencies,I=R.indexedDB,R=R.IDBKeyRange,(Hl(I)?Promise.resolve(I.databases()).then(function(z){return z.map(function(q){return q.name}).filter(function(q){return q!==Ur})}):vu(I,R).toCollection().primaryKeys()).then(E)}catch{return En(new ye.MissingAPI)}var R,I},defineClass:function(){return function(E){u(this,E)}},ignoreTransaction:function(E){return Je.trans?Qi(Je.transless,E):E()},vip:xu,async:function(E){return function(){try{var R=Go(E.apply(this,arguments));return R&&typeof R.then=="function"?R:nt.resolve(R)}catch(I){return En(I)}}},spawn:function(E,R,I){try{var z=Go(E.apply(I,R||[]));return z&&typeof z.then=="function"?z:nt.resolve(z)}catch(q){return En(q)}},currentTransaction:{get:function(){return Je.trans||null}},waitFor:function(E,R){return E=nt.resolve(typeof E=="function"?ua.ignoreTransaction(E):E).timeout(R||6e4),Je.trans?Je.trans.waitFor(E):E},Promise:nt,debug:{get:function(){return Lt},set:function(E){sn(E)}},derive:w,extend:u,props:m,override:b,Events:ia,on:Ti,liveQuery:Cd,extendObservabilitySet:Vl,getByKeyPath:M,setByKeyPath:D,delByKeyPath:function(E,R){typeof R=="string"?D(E,R,void 0):"length"in R&&[].map.call(R,function(I){D(E,I,void 0)})},shallowClone:N,deepClone:H,getObjectDiff:$l,cmp:Tt,asap:O,minKey:-1/0,addons:[],connections:as,errnames:ee,dependencies:Ja,cache:oa,semVer:"4.3.0",version:"4.3.0".split(".").map(function(E){return parseInt(E)}).reduce(function(E,R,I){return E+R/Math.pow(10,2*I)})})),ua.maxKey=Ga(ua.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ti(Os,function(E){Is||(E=new CustomEvent(ra,{detail:E}),Is=!0,dispatchEvent(E),Is=!1)}),addEventListener(ra,function(E){E=E.detail,Is||Ru(E)}));var Qa,Is=!1,qi=function(){};return typeof BroadcastChannel<"u"&&((qi=function(){(Qa=new BroadcastChannel(ra)).onmessage=function(E){return E.data&&Ru(E.data)}})(),typeof Qa.unref=="function"&&Qa.unref(),Ti(Os,function(E){Is||Qa.postMessage(E)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(E){if(!qr.disableBfCache&&E.persisted){Lt&&console.debug("Dexie: handling persisted pagehide"),Qa?.close();for(var R=0,I=as;R<I.length;R++)I[R].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(E){!qr.disableBfCache&&E.persisted&&(Lt&&console.debug("Dexie: handling persisted pageshow"),qi(),Ru({all:new Mi(-1/0,[[]])}))})),nt.rejectionMapper=function(E,R){return!E||E instanceof _e||E instanceof TypeError||E instanceof SyntaxError||!E.name||!Me[E.name]?E:(R=new Me[E.name](R||E.message,E),"stack"in E&&_(R,"stack",{get:function(){return this.inner.stack}}),R)},sn(Lt),i(qr,Object.freeze({__proto__:null,Dexie:qr,Entity:Yn,PropModification:Si,RangeSet:Mi,add:function(E){return new Si({add:E})},cmp:Tt,default:qr,liveQuery:Cd,mergeRanges:aa,rangesOverlap:gd,remove:function(E){return new Si({remove:E})},replacePrefix:function(E,R){return new Si({replacePrefix:[E,R]})}}),{default:qr}),qr})})(Mp)),Mp.exports}var pO=fO();const J_=id(pO),CS=Symbol.for("Dexie"),zp=globalThis[CS]||(globalThis[CS]=J_);if(J_.semVer!==zp.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${J_.semVer} and ${zp.semVer}`);const{liveQuery:zW,mergeRanges:PW,rangesOverlap:FW,RangeSet:UW,cmp:jW,Entity:HW,PropModification:qW,replacePrefix:VW,add:WW,remove:$W,DexieYProvider:GW}=zp;class mO extends zp{sessions;prompts;responses;toolCalls;events;notes;promptQueue;alerts;sshProfiles;settings;summaryPrompts;teams;constructor(){super("claude-dashboard"),this.version(2).stores({sessions:"id, status, projectPath, startedAt, lastActivityAt, archived",prompts:"++id, sessionId, timestamp, [sessionId+timestamp]",responses:"++id, sessionId, timestamp, [sessionId+timestamp]",toolCalls:"++id, sessionId, timestamp, toolName, [sessionId+timestamp]",events:"++id, sessionId, timestamp, [sessionId+timestamp]",notes:"++id, sessionId",promptQueue:"++id, sessionId, [sessionId+position]",alerts:"++id, sessionId",sshProfiles:"++id, name",settings:"key",summaryPrompts:"++id, isDefault",teams:"id"})}}const $t=new mO;async function ES(n){if(!n?.sessionId)return;const e={id:n.sessionId,projectPath:n.projectPath||"",projectName:n.projectName||"Unknown",title:n.title||"",status:n.status||"idle",model:n.model||"",source:typeof n.source=="string"?n.source:"hook",startedAt:n.startedAt||Date.now(),lastActivityAt:n.lastActivityAt||Date.now(),endedAt:n.endedAt??null,totalToolCalls:n.totalToolCalls||0,totalPrompts:n.promptHistory?.length||0,archived:n.archived||0,summary:n.summary??null,characterModel:n.characterModel??null,accentColor:n.accentColor??null,teamId:n.teamId??null,teamRole:n.teamRole??null,terminalId:n.terminalId??null,queueCount:n.queueCount||0,label:n.label??null};if(await $t.sessions.put(e),n.promptHistory?.length){const t=await $t.prompts.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.promptHistory.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,text:a.text,timestamp:a.timestamp}));r.length>0&&await $t.prompts.bulkAdd(r)}if(n.toolLog?.length){const t=await $t.toolCalls.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.toolLog.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,toolName:a.tool,toolInputSummary:a.input,timestamp:a.timestamp}));r.length>0&&await $t.toolCalls.bulkAdd(r)}if(n.responseLog?.length){const t=await $t.responses.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.responseLog.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,textExcerpt:a.text,timestamp:a.timestamp}));r.length>0&&await $t.responses.bulkAdd(r)}if(n.events?.length){const t=await $t.events.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.events.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,eventType:a.type,detail:a.detail||"",timestamp:a.timestamp}));r.length>0&&await $t.events.bulkAdd(r)}}const HE=["prompts","responses","toolCalls","events","notes","promptQueue","alerts"];async function gO(n,e){for(const t of HE){const i=$t.table(t),r=await i.where("sessionId").equals(n).toArray();r.length!==0&&await $t.transaction("rw",i,async()=>{for(const a of r)await i.update(a.id,{sessionId:e})})}}async function yO(n){await $t.sessions.delete(n);for(const e of HE){const t=$t.table(e),r=(await t.where("sessionId").equals(n).toArray()).map(a=>a.id).filter(a=>a!=null);r.length>0&&await t.bulkDelete(r)}}const Q_=new Set,bs=Tl(n=>({queues:new Map,add:(e,t)=>n(i=>{const r=new Map(i.queues),a=[...r.get(e)??[],t];return r.set(e,a),{queues:r}}),remove:(e,t)=>n(i=>{const r=new Map(i.queues),a=(r.get(e)??[]).filter(l=>l.id!==t);return r.set(e,a),{queues:r}}),reorder:(e,t)=>n(i=>{const r=new Map(i.queues),a=r.get(e)??[],l=new Map(a.map(u=>[u.id,u])),o=t.map((u,h)=>{const p=l.get(u);return p?{...p,position:h}:null}).filter(u=>u!==null);return r.set(e,o),{queues:r}}),moveToSession:(e,t,i)=>n(r=>{const a=new Map(r.queues),l=a.get(t)??[],o=[...a.get(i)??[]],u=new Set(e),h=[],p=[];for(const m of l)u.has(m.id)?h.push(m):p.push(m);let f=o.length>0?Math.max(...o.map(m=>m.position)):-1;for(const m of h)f++,o.push({...m,sessionId:i,position:f});return a.set(t,p),a.set(i,o),{queues:a}}),setQueue:(e,t)=>n(i=>{const r=new Map(i.queues);return r.set(e,t),{queues:r}}),migrateSession:(e,t)=>n(i=>{const r=i.queues.get(e);if(!r||r.length===0)return i;const a=new Map(i.queues);return a.delete(e),a.set(t,r.map(l=>({...l,sessionId:t}))),{queues:a}}),loadFromDb:async()=>{try{const e=await $t.promptQueue.toArray();if(e.length===0)return;const t=new Map;for(const i of e){const r=t.get(i.sessionId)??[];r.push({id:i.id,sessionId:i.sessionId,text:i.text,position:i.position,createdAt:i.createdAt}),t.set(i.sessionId,r)}for(const i of t.keys())Q_.add(i);for(const[i,r]of t)r.sort((a,l)=>a.position-l.position),bs.getState().setQueue(i,r);setTimeout(()=>Q_.clear(),0)}catch{}}}));let Sy=new Map;bs.subscribe(n=>{const e=n.queues,t=[];for(const[i,r]of e)Sy.get(i)!==r&&t.push(i);for(const i of Sy.keys())e.has(i)||t.push(i);Sy=e;for(const i of t){if(Q_.has(i))continue;const r=e.get(i)??[];_O(i,r)}});async function _O(n,e){try{const i=(await $t.promptQueue.where("sessionId").equals(n).toArray()).map(r=>r.id).filter(r=>r!=null);i.length>0&&await $t.promptQueue.bulkDelete(i),e.length>0&&await $t.promptQueue.bulkAdd(e.map((r,a)=>({sessionId:n,text:r.text,position:a,createdAt:r.createdAt})))}catch{}}const e0=Tl(n=>({connected:!1,reconnecting:!1,lastSeq:0,client:null,setConnected:e=>n({connected:e}),setReconnecting:e=>n({reconnecting:e}),setLastSeq:e=>n({lastSeq:e}),setClient:e=>n({client:e})})),AS={sessionStart:"chime",sessionEnd:"cascade",promptSubmit:"ping",taskComplete:"fanfare",toolRead:"click",toolWrite:"blip",toolEdit:"blip",toolBash:"buzz",toolGrep:"click",toolGlob:"click",toolWebFetch:"swoosh",toolTask:"ding",toolOther:"click",approvalNeeded:"alarm",inputNeeded:"chime",alert:"alarm",kill:"thud",archive:"ding",subagentStart:"chirp",subagentStop:"ping"},bO={sessionStart:"Session Start",sessionEnd:"Session End",promptSubmit:"Prompt Submit",taskComplete:"Task Complete",toolRead:"Tool: Read",toolWrite:"Tool: Write",toolEdit:"Tool: Edit",toolBash:"Tool: Bash",toolGrep:"Tool: Grep",toolGlob:"Tool: Glob",toolWebFetch:"Tool: WebFetch",toolTask:"Tool: Task",toolOther:"Tool: Other",approvalNeeded:"Approval Needed",inputNeeded:"Input Needed",alert:"Alert",kill:"Kill",archive:"Archive",subagentStart:"Subagent Start",subagentStop:"Subagent Stop"},vO=[{label:"Session Events",actions:["sessionStart","sessionEnd","promptSubmit","taskComplete"]},{label:"Tool Calls",actions:["toolRead","toolWrite","toolEdit","toolBash","toolGrep","toolGlob","toolWebFetch","toolTask","toolOther"]},{label:"System",actions:["approvalNeeded","inputNeeded","alert","kill","archive","subagentStart","subagentStop"]}];class xO{ctx=null;unlocked=!1;volume=.5;actionOverrides={};getCtx(){return this.ctx||(this.ctx=new AudioContext),this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{}),this.ctx}playTone(e,t,i="sine",r=1){const a=this.getCtx(),l=a.createOscillator(),o=a.createGain();l.type=i,l.frequency.setValueAtTime(e,a.currentTime),o.gain.setValueAtTime(r*this.volume*.3,a.currentTime),o.gain.exponentialRampToValueAtTime(.001,a.currentTime+t),l.connect(o),o.connect(a.destination),l.start(a.currentTime),l.stop(a.currentTime+t)}playSequence(e,t=.1,i=.15,r="sine"){e.forEach((a,l)=>{setTimeout(()=>this.playTone(a,i,r),l*t*1e3)})}sounds={chirp:()=>this.playTone(1200,.08,"sine"),ping:()=>this.playTone(660,.2,"sine"),chime:()=>this.playSequence([523,659,784],.08,.2),ding:()=>this.playTone(800,.25,"triangle"),blip:()=>this.playTone(880,.05,"square",.5),swoosh:()=>{const e=this.getCtx(),t=e.createOscillator(),i=e.createGain();t.type="sine",t.frequency.setValueAtTime(300,e.currentTime),t.frequency.exponentialRampToValueAtTime(1200,e.currentTime+.25),i.gain.setValueAtTime(this.volume*.25,e.currentTime),i.gain.exponentialRampToValueAtTime(.001,e.currentTime+.3),t.connect(i),i.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.3)},click:()=>this.playTone(1200,.03,"square",.2),beep:()=>this.playTone(440,.15,"square",.4),warble:()=>{const e=this.getCtx(),t=e.createOscillator(),i=e.createOscillator(),r=e.createGain(),a=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,e.currentTime),i.type="sine",i.frequency.setValueAtTime(12,e.currentTime),r.gain.setValueAtTime(50,e.currentTime),i.connect(r),r.connect(t.frequency),a.gain.setValueAtTime(this.volume*.25,e.currentTime),a.gain.exponentialRampToValueAtTime(.001,e.currentTime+.3),t.connect(a),a.connect(e.destination),t.start(e.currentTime),i.start(e.currentTime),t.stop(e.currentTime+.3),i.stop(e.currentTime+.3)},buzz:()=>this.playTone(200,.12,"sawtooth",.4),cascade:()=>this.playSequence([784,659,523,392],.1,.2),fanfare:()=>this.playSequence([523,659,784,1047,1319],.08,.2),alarm:()=>this.playSequence([880,660,880,660],.15,.15,"square"),thud:()=>{const e=this.getCtx(),t=e.createOscillator(),i=e.createGain();t.type="sine",t.frequency.setValueAtTime(80,e.currentTime),t.frequency.exponentialRampToValueAtTime(30,e.currentTime+.3),i.gain.setValueAtTime(this.volume*.5,e.currentTime),i.gain.exponentialRampToValueAtTime(.001,e.currentTime+.35),t.connect(i),i.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.35)},urgentAlarm:()=>{const e=this.getCtx(),t=e.currentTime;for(let i=0;i<3;i++){const r=i*.4,a=e.createOscillator(),l=e.createGain();a.type="square",a.frequency.setValueAtTime(1e3,t+r),a.frequency.setValueAtTime(800,t+r+.1),a.frequency.setValueAtTime(1e3,t+r+.2),l.gain.setValueAtTime(this.volume*.5,t+r),l.gain.setValueAtTime(this.volume*.5,t+r+.25),l.gain.exponentialRampToValueAtTime(.001,t+r+.3),a.connect(l),l.connect(e.destination),a.start(t+r),a.stop(t+r+.3);const o=e.createOscillator(),u=e.createGain();o.type="sawtooth",o.frequency.setValueAtTime(200,t+r),u.gain.setValueAtTime(this.volume*.3,t+r),u.gain.exponentialRampToValueAtTime(.001,t+r+.3),o.connect(u),u.connect(e.destination),o.start(t+r),o.stop(t+r+.3)}},none:()=>{}};unlock(){this.unlocked=!0,this.ctx?.state==="suspended"&&this.ctx.resume().catch(()=>{})}isUnlocked(){return this.unlocked}setVolume(e){this.volume=Math.max(0,Math.min(1,e))}getVolume(){return this.volume}setActionSound(e,t){this.actionOverrides={...this.actionOverrides,[e]:t}}getActionSound(e){return this.actionOverrides[e]??AS[e]??"none"}getActionSounds(){return{...AS,...this.actionOverrides}}loadOverrides(e){this.actionOverrides={...e}}getSoundNames(){return Object.keys(this.sounds)}play(e){if(!this.unlocked)return!1;const t=this.getActionSound(e),i=this.sounds[t];return i&&i(),t!=="none"}preview(e){const t=this.sounds[e];t&&t()}dispose(){this.ctx&&(this.ctx.close().catch(()=>{}),this.ctx=null),this.unlocked=!1}}const vs=new xO,SO=[{name:"command-center",label:"Command Center",colors:["#0a0a1a","#00e5ff","#ff9100"]},{name:"cyberpunk",label:"Cyberpunk",colors:["#0d0221","#ff00ff","#00ffff"]},{name:"warm",label:"Warm",colors:["#faf6f1","#d97706","#b87333"]},{name:"dracula",label:"Dracula",colors:["#282a36","#bd93f9","#50fa7b"]},{name:"solarized",label:"Solarized",colors:["#002b36","#2aa198","#cb4b16"]},{name:"nord",label:"Nord",colors:["#2e3440","#88c0d0","#d08770"]},{name:"monokai",label:"Monokai",colors:["#272822","#66d9ef","#f92672"]},{name:"light",label:"Light",colors:["#f0f2f5","#0ea5e9","#3b82f6"]},{name:"blonde",label:"Blonde",colors:["#fdf8ef","#ca8a04","#a16207"]}],Af={claude:{enabled:!0,volume:.7,actions:{sessionStart:"chime",sessionEnd:"cascade",promptSubmit:"ping",taskComplete:"fanfare",toolRead:"click",toolWrite:"blip",toolEdit:"blip",toolBash:"click",toolGrep:"click",toolGlob:"click",toolWebFetch:"ping",toolTask:"chime",toolOther:"click",approvalNeeded:"alarm",inputNeeded:"chime",alert:"alarm",kill:"thud",archive:"ping",subagentStart:"chirp",subagentStop:"ping"}},gemini:{enabled:!0,volume:.7,actions:{sessionStart:"ding",sessionEnd:"cascade",promptSubmit:"chirp",taskComplete:"fanfare",toolRead:"click",toolWrite:"swoosh",toolEdit:"swoosh",toolBash:"ding",toolGrep:"click",toolGlob:"click",toolWebFetch:"swoosh",toolTask:"ding",toolOther:"chirp",approvalNeeded:"alarm",inputNeeded:"ding",alert:"alarm",kill:"thud",archive:"swoosh",subagentStart:"chirp",subagentStop:"ding"}},codex:{enabled:!0,volume:.5,actions:{sessionStart:"blip",sessionEnd:"beep",promptSubmit:"click",taskComplete:"blip",toolRead:"click",toolWrite:"blip",toolEdit:"blip",toolBash:"beep",toolGrep:"click",toolGlob:"click",toolWebFetch:"click",toolTask:"beep",toolOther:"click",approvalNeeded:"alarm",inputNeeded:"beep",alert:"alarm",kill:"thud",archive:"click",subagentStart:"blip",subagentStop:"beep"}},openclaw:{enabled:!0,volume:.7,actions:{sessionStart:"fanfare",sessionEnd:"cascade",promptSubmit:"buzz",taskComplete:"fanfare",toolRead:"click",toolWrite:"buzz",toolEdit:"buzz",toolBash:"buzz",toolGrep:"click",toolGlob:"click",toolWebFetch:"swoosh",toolTask:"buzz",toolOther:"buzz",approvalNeeded:"urgentAlarm",inputNeeded:"fanfare",alert:"urgentAlarm",kill:"thud",archive:"cascade",subagentStart:"fanfare",subagentStop:"cascade"}}},wO={enabled:!1,volume:.3,preset:"off",roomSounds:!1,roomVolume:.2},Co={soundSettings:{enabled:!0,volume:.5,muteApproval:!1,muteInput:!1,perCli:{claude:{...Af.claude},gemini:{...Af.gemini},codex:{...Af.codex},openclaw:{...Af.openclaw}}},ambientSettings:{...wO},labelAlarms:{labels:[],soundEnabled:!0},theme:"dark",compactMode:!1,showArchived:!1,groupBy:"none",sortBy:"activity",themeName:"command-center",fontSize:13,scanlineEnabled:!0,animationIntensity:100,animationSpeed:100,characterModel:"robot",soundActions:{},movementActions:{},hookDensity:"medium",scene3dEnabled:!0,activityFeedVisible:!0,toastEnabled:!0,autoSendQueue:!1,defaultTerminalTheme:"auto",anthropicApiKey:"",openaiApiKey:"",geminiApiKey:"",autosaveVisible:!1};function wy(n){n==="command-center"?document.body.removeAttribute("data-theme"):document.body.setAttribute("data-theme",n)}function Cy(n){document.documentElement.style.fontSize=n+"px"}function Ey(n){document.body.classList.toggle("no-scanlines",!n)}function Ay(n){document.documentElement.style.setProperty("--anim-intensity",String(n/100))}function ky(n){document.documentElement.style.setProperty("--anim-speed",String(n/100))}const Wt=Tl((n,e)=>({...Co,loadFromDb:t=>{n({...t});const i=e();wy(i.themeName),Cy(i.fontSize),Ey(i.scanlineEnabled),Ay(i.animationIntensity),ky(i.animationSpeed)},saveToDb:()=>({...e()}),updateSoundSettings:t=>{n(i=>({soundSettings:{...i.soundSettings,...t}})),e().persistSetting("soundSettings",JSON.stringify(e().soundSettings))},updateCliSoundConfig:(t,i)=>{n(r=>{const a=r.soundSettings.perCli,l=a[t];return l?{soundSettings:{...r.soundSettings,perCli:{...a,[t]:{...l,...i}}}}:{}}),e().persistSetting("soundSettings",JSON.stringify(e().soundSettings))},setCliActionSound:(t,i,r)=>{n(a=>{const l=a.soundSettings.perCli,o=l[t];return o?{soundSettings:{...a.soundSettings,perCli:{...l,[t]:{...o,actions:{...o.actions,[i]:r}}}}}:{}}),e().persistSetting("soundSettings",JSON.stringify(e().soundSettings))},updateAmbientSettings:t=>{n(i=>({ambientSettings:{...i.ambientSettings,...t}})),e().persistSetting("ambientSettings",JSON.stringify(e().ambientSettings))},updateLabelAlarms:t=>{n(i=>({labelAlarms:{...i.labelAlarms,...t}})),e().persistSetting("labelAlarms",JSON.stringify(e().labelAlarms))},setThemeName:t=>{wy(t),n({themeName:t}),e().persistSetting("themeName",t)},setTheme:t=>n({theme:t}),setFontSize:t=>{Cy(t),n({fontSize:t}),e().persistSetting("fontSize",t)},setScanlineEnabled:t=>{Ey(t),n({scanlineEnabled:t}),e().persistSetting("scanlineEnabled",t)},setAnimationIntensity:t=>{Ay(t),n({animationIntensity:t}),e().persistSetting("animationIntensity",t)},setAnimationSpeed:t=>{ky(t),n({animationSpeed:t}),e().persistSetting("animationSpeed",t)},setCharacterModel:t=>{n({characterModel:t}),e().persistSetting("characterModel",t)},setHookDensity:t=>{n({hookDensity:t}),e().persistSetting("hookDensity",t)},setCompactMode:t=>n({compactMode:t}),setShowArchived:t=>n({showArchived:t}),setGroupBy:t=>n({groupBy:t}),setSortBy:t=>n({sortBy:t}),setScene3dEnabled:t=>{n({scene3dEnabled:t}),e().persistSetting("scene3dEnabled",t)},setActivityFeedVisible:t=>{n({activityFeedVisible:t}),e().persistSetting("activityFeedVisible",t)},setToastEnabled:t=>{n({toastEnabled:t}),e().persistSetting("toastEnabled",t)},setAutoSendQueue:t=>{n({autoSendQueue:t}),e().persistSetting("autoSendQueue",t)},setDefaultTerminalTheme:t=>{n({defaultTerminalTheme:t}),e().persistSetting("defaultTerminalTheme",t)},setSoundAction:(t,i)=>{n(a=>({soundActions:{...a.soundActions,[t]:i}}));const r=e().soundActions;e().persistSetting("soundActions",JSON.stringify(r))},setMovementAction:(t,i)=>{n(a=>({movementActions:{...a.movementActions,[t]:i}}));const r=e().movementActions;e().persistSetting("movementActions",JSON.stringify(r))},setApiKey:(t,i)=>{const r={anthropic:"anthropicApiKey",openai:"openaiApiKey",gemini:"geminiApiKey"};n({[r[t]]:i}),e().persistSetting(r[t],i)},persistSetting:async(t,i)=>{try{if(typeof i=="object"&&i!==null)try{JSON.stringify(i)}catch{return}await $t.settings.put({key:t,value:i,updatedAt:Date.now()}),e().flashAutosave()}catch{}},flashAutosave:()=>{n({autosaveVisible:!0}),setTimeout(()=>n({autosaveVisible:!1}),2e3)},resetDefaults:()=>{n({...Co}),wy(Co.themeName),Cy(Co.fontSize),Ey(Co.scanlineEnabled),Ay(Co.animationIntensity),ky(Co.animationSpeed);const t=e();for(const[i,r]of Object.entries(Co))typeof r!="function"&&t.persistSetting(i,typeof r=="object"?JSON.stringify(r):r)}}));function CO(n){const e=(n.model||"").toLowerCase();if(e.includes("claude")||e.includes("opus")||e.includes("sonnet")||e.includes("haiku"))return"claude";if(e.includes("gemini")||e.includes("gemma"))return"gemini";if(e.includes("gpt")||e.includes("codex")||e.includes("o1")||e.includes("o3")||e.includes("o4"))return"codex";if(e.includes("openclaw")||e.includes("claw"))return"openclaw";const t=n.events||[];return t.some(l=>l.type==="BeforeAgent"||l.type==="AfterAgent"||l.type==="BeforeTool"||l.type==="AfterTool")?"gemini":t.some(l=>l.type==="agent-turn-complete")?"codex":t.some(l=>l.type==="SessionStart"||l.type==="PreToolUse"||l.type==="PostToolUse"||l.type==="UserPromptSubmit")?"claude":null}const EO={Read:"toolRead",Write:"toolWrite",Edit:"toolEdit",Bash:"toolBash",Grep:"toolGrep",Glob:"toolGlob",WebFetch:"toolWebFetch",Task:"toolTask"},Sc=new Map,Ty=new Map,Rp=new Set;function $s(n,e){const t=Wt.getState();if(!t.soundSettings.enabled)return;const i=CO(n),r=t.soundSettings.perCli,a=i?r[i]:void 0;if(a&&a.enabled){const l=a.actions[e]??"none";if(l!=="none"){const o=vs.getVolume();vs.setVolume(t.soundSettings.volume*a.volume),vs.preview(l),vs.setVolume(o)}return}vs.play(e)}function AO(n){const e=n.events;if(!e||e.length===0||Rp.has(n.sessionId))return;const t=e[e.length-1];if(t)switch(t.type){case"SessionStart":$s(n,"sessionStart");break;case"UserPromptSubmit":$s(n,"promptSubmit");break;case"PreToolUse":{const i=t.tool_name||"",r=EO[i]||"toolOther";$s(n,r);break}case"Stop":$s(n,"taskComplete");break;case"SessionEnd":$s(n,"sessionEnd");break;case"SubagentStart":$s(n,"subagentStart");break;case"SubagentStop":$s(n,"subagentStop");break}}function kO(n,e){const t=n.sessionId;if(n.status==="approval"&&!Rp.has(t)){if(!Sc.has(t)){$s(n,"approvalNeeded");const r=setInterval(()=>{const a=e().get(t);if(!a||a.status!=="approval"||Rp.has(t)){clearInterval(r),Sc.delete(t);return}$s(a,"approvalNeeded")},1e4);Sc.set(t,r)}}else if(n.status!=="approval"&&Sc.has(t)){const r=Sc.get(t);clearInterval(r),Sc.delete(t)}const i=`input-${t}`;n.status==="input"&&!Rp.has(t)?Ty.has(i)||($s(n,"inputNeeded"),Ty.set(i,!0)):n.status!=="input"&&Ty.delete(i)}function TO(n){const e=W.useRef(null);return W.useEffect(()=>{const{addSession:t,updateSession:i,removeSession:r,setSessions:a}=gn.getState(),{setConnected:l,setReconnecting:o,setLastSeq:u}=e0.getState();function h(g){switch(g.type){case"snapshot":{const _=new Map;for(const[w,v]of Object.entries(g.sessions)){const x=v.sessionId||w,S=_.get(x);(!S||(v.lastActivityAt||0)>(S.lastActivityAt||0))&&_.set(x,v)}a(_),u(g.seq);for(const w of _.values())ES(w).catch(()=>{});$t.sessions.toCollection().primaryKeys().then(w=>{const v=new Set(_.keys()),x=w.filter(S=>!v.has(String(S)));x.length>0&&$t.sessions.bulkDelete(x).catch(()=>{})}).catch(()=>{});break}case"session_update":{const{session:_}=g;_.replacesId&&(bs.getState().migrateSession(_.replacesId,_.sessionId),gO(_.replacesId,_.sessionId).then(()=>$t.sessions.delete(_.replacesId)).catch(()=>{})),i(_),ES(_).catch(()=>{}),AO(_),kO(_,()=>gn.getState().sessions);break}case"session_removed":{r(g.sessionId);break}case"clearBrowserDb":{$t.delete().then(()=>$t.open()).catch(()=>{});break}}}function p(g){l(g==="connected"),o(g==="reconnecting")}const{setClient:f}=e0.getState(),m=new H0({url:"/ws",token:n,onMessage:h,onStatus:p});return e.current=m,f(m),m.connect(),()=>{m.dispose(),e.current=null,f(null)}},[n]),e.current}const MO="_screen_lsklh_6",RO="_card_lsklh_12",OO="_input_lsklh_38",NO="_btn_lsklh_59",DO="_error_lsklh_80",dh={screen:MO,card:RO,input:OO,btn:NO,error:DO};function IO({onLogin:n}){const[e,t]=W.useState(""),[i,r]=W.useState(""),[a,l]=W.useState(!1),o=W.useRef(null);W.useEffect(()=>{o.current?.focus()},[]);async function u(h){if(h.preventDefault(),!e){r("Please enter a password");return}l(!0),r("");const p=await n(e);p.success||(r(p.error??"Authentication failed"),t(""),o.current?.focus()),l(!1)}return T.jsx("div",{className:dh.screen,children:T.jsxs("form",{className:dh.card,onSubmit:u,children:[T.jsx("h2",{children:"AI Agent Session Center"}),T.jsx("p",{children:"Enter password to continue"}),T.jsx("input",{ref:o,type:"password",value:e,onChange:h=>t(h.target.value),placeholder:"Password",autoComplete:"current-password",className:dh.input,disabled:a}),i&&T.jsx("p",{className:dh.error,children:i}),T.jsx("button",{type:"submit",disabled:a,className:dh.btn,children:a?"Authenticating...":"Login"})]})})}const bi=Tl(n=>({activeModal:null,detailPanelOpen:!1,activityFeedOpen:!1,openModal:e=>n({activeModal:e}),closeModal:()=>n({activeModal:null}),setDetailPanelOpen:e=>n({detailPanelOpen:e}),setActivityFeedOpen:e=>n({activityFeedOpen:e})})),LO="_overlay_12hnn_10",BO="_panel_12hnn_19",zO="_actions_12hnn_27",PO="_closeBtn_12hnn_29",FO="_alertInputRow_12hnn_33",UO="_alertInput_12hnn_33",jO="_newSessionPanel_12hnn_41",HO="_newSessionBody_12hnn_49",qO="_newSessionFooter_12hnn_60",VO="_sshField_12hnn_71",WO="_sshFieldRow_12hnn_75",$O="_sshFieldGrow_12hnn_76",GO="_sshFieldSmall_12hnn_77",KO="_sshFieldHint_12hnn_78",YO="_sshFieldRequired_12hnn_79",XO="_sshFieldError_12hnn_80",ZO="_active_12hnn_87",JO="_quickSessionPanel_12hnn_104",QO="_quickSessionHeader_12hnn_105",e3="_quickSessionBody_12hnn_107",t3="_quickSessionHint_12hnn_108",n3="_quickSessionFooter_12hnn_109",i3="_quickLabelChips_12hnn_112",r3="_quickLabelChip_12hnn_112",s3="_labelText_12hnn_116",a3="_labelDelete_12hnn_117",o3="_quickLabelEmpty_12hnn_120",l3="_quickLabelInputRow_12hnn_122",c3="_quickWorkdirRow_12hnn_126",u3="_shortcutsPanel_12hnn_133",h3="_shortcutsHeader_12hnn_134",d3="_shortcutsBody_12hnn_136",f3="_shortcutsSection_12hnn_137",p3="_shortcutList_12hnn_138",m3="_shortcutRow_12hnn_139",g3="_toastContainer_12hnn_145",y3="_toast_12hnn_145",_3="_toastMsg_12hnn_152",lt={overlay:LO,panel:BO,actions:zO,closeBtn:PO,alertInputRow:FO,alertInput:UO,newSessionPanel:jO,newSessionBody:HO,newSessionFooter:qO,sshField:VO,sshFieldRow:WO,sshFieldGrow:$O,sshFieldSmall:GO,sshFieldHint:KO,sshFieldRequired:YO,sshFieldError:XO,active:ZO,quickSessionPanel:JO,quickSessionHeader:QO,quickSessionBody:e3,quickSessionHint:t3,quickSessionFooter:n3,quickLabelChips:i3,quickLabelChip:r3,labelText:s3,labelDelete:a3,quickLabelEmpty:o3,quickLabelInputRow:l3,quickWorkdirRow:c3,shortcutsPanel:u3,shortcutsHeader:h3,shortcutsBody:d3,shortcutsSection:f3,shortcutList:p3,shortcutRow:m3,toastContainer:g3,toast:y3,toastMsg:_3};function cm({modalId:n,children:e,title:t,onClose:i,panelClassName:r}){const a=bi(m=>m.activeModal),l=bi(m=>m.closeModal),o=W.useRef(null),u=W.useRef(null),h=a===n,p=W.useCallback(()=>{l(),i?.()},[l,i]);if(W.useEffect(()=>{if(!h)return;function m(g){g.key==="Escape"&&(g.stopPropagation(),p())}return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[h,p]),W.useEffect(()=>{if(!h||!u.current)return;const m=u.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),g=m[0],_=m[m.length-1];g?.focus();function w(v){if(v.key==="Tab"){if(m.length===0){v.preventDefault();return}v.shiftKey?document.activeElement===g&&(v.preventDefault(),_?.focus()):document.activeElement===_&&(v.preventDefault(),g?.focus())}}return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[h]),!h)return null;function f(m){m.target===o.current&&p()}return T.jsx("div",{ref:o,onClick:f,className:lt.overlay,children:T.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":t,className:`${lt.panel}${r?` ${r}`:""}`,children:[t&&T.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[T.jsx("h3",{children:t}),T.jsx("button",{onClick:p,"aria-label":"Close",className:lt.closeBtn,children:"x"})]}),e]})})}const qE="182",KW={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},YW={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},XW=0,ZW=1,JW=2,QW=3,e$=0,t$=1,n$=2,i$=3,t0=0,VE=1,r$=2,b3=0,kS=1,s$=2,a$=3,o$=4,l$=5,TS=100,c$=101,u$=102,h$=103,d$=104,f$=200,p$=201,m$=202,g$=203,MS=204,RS=205,y$=206,_$=207,b$=208,v$=209,x$=210,S$=211,w$=212,C$=213,E$=214,A$=0,k$=1,T$=2,OS=3,M$=4,R$=5,O$=6,N$=7,q0=0,D$=1,I$=2,L$=0,B$=1,z$=2,P$=3,F$=4,U$=5,j$=6,H$=7,NS="attached",v3="detached",V0=300,um=301,x3=302,S3=303,w3=304,C3=306,n0=1e3,Ks=1001,i0=1002,Br=1003,E3=1004,q$=1004,A3=1005,V$=1005,ts=1006,k3=1007,W$=1007,hm=1008,$$=1008,W0=1009,T3=1010,M3=1011,R3=1012,O3=1013,dm=1014,iu=1015,N3=1016,D3=1017,I3=1018,G$=1020,L3=35902,B3=35899,z3=1021,P3=1022,Gh=1023,r0=1026,F3=1027,WE=1028,$E=1029,U3=1030,j3=1031,K$=1032,H3=1033,q3=33776,V3=33777,W3=33778,$3=33779,G3=35840,K3=35841,Y3=35842,X3=35843,Z3=36196,J3=37492,Q3=37496,eN=37488,tN=37489,nN=37490,iN=37491,rN=37808,sN=37809,aN=37810,oN=37811,lN=37812,cN=37813,uN=37814,hN=37815,dN=37816,fN=37817,pN=37818,mN=37819,gN=37820,yN=37821,_N=36492,bN=36494,vN=36495,xN=36283,SN=36284,wN=36285,CN=36286,EN=2200,AN=2201,kN=2202,Pp=2300,s0=2301,My=2302,Zc=2400,Jc=2401,Fp=2402,$0=2500,GE=2501,Y$=0,X$=1,Z$=2,TN=3200,J$=3201,Q$=3202,eG=3203,hu=0,tG=1,KE="",Jr="srgb",DS="srgb-linear",IS="linear",Ry="srgb",nG="",iG="rg",rG="ga",sG=0,wc=7680,aG=7681,oG=7682,lG=7683,cG=34055,uG=34056,hG=5386,dG=512,fG=513,pG=514,mG=515,gG=516,yG=517,_G=518,LS=519,bG=512,vG=513,xG=514,SG=515,wG=516,CG=517,EG=518,AG=519,Up=35044,kG=35048,TG=35040,MG=35045,RG=35049,OG=35041,NG=35046,DG=35050,IG=35042,LG="100",BG="300 es",Ys=2e3,Kh=2001,zG={COMPUTE:"compute",RENDER:"render"},PG={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},FG={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function MN(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const RN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Qc(n,e){return new RN[n](e)}function YE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function jp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function UG(){const n=jp("canvas");return n.style.display="block",n}const BS={};let Bo=null;function jG(n){Bo=n}function HG(){return Bo}function zS(...n){const e="THREE."+n.shift();Bo?Bo("log",e,...n):console.log(e,...n)}function Nt(...n){const e="THREE."+n.shift();Bo?Bo("warn",e,...n):console.warn(e,...n)}function Sn(...n){const e="THREE."+n.shift();Bo?Bo("error",e,...n):console.error(e,...n)}function PS(...n){const e=n.join(" ");e in BS||(BS[e]=!0,Nt(...n))}function qG(n,e,t){return new Promise(function(i,r){function a(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,t);break;default:i()}}setTimeout(a,t)})}class Po{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,l=r.length;a<l;a++)r[a].call(this,e);e.target=null}}}const $i=["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 FS=1234567;const Cl=Math.PI/180,Yh=180/Math.PI;function Dr(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return($i[n&255]+$i[n>>8&255]+$i[n>>16&255]+$i[n>>24&255]+"-"+$i[e&255]+$i[e>>8&255]+"-"+$i[e>>16&15|64]+$i[e>>24&255]+"-"+$i[t&63|128]+$i[t>>8&255]+"-"+$i[t>>16&255]+$i[t>>24&255]+$i[i&255]+$i[i>>8&255]+$i[i>>16&255]+$i[i>>24&255]).toLowerCase()}function It(n,e,t){return Math.max(e,Math.min(t,n))}function G0(n,e){return(n%e+e)%e}function ON(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function NN(n,e,t){return n!==e?(t-n)/(e-n):0}function zh(n,e,t){return(1-t)*n+t*e}function DN(n,e,t,i){return zh(n,e,1-Math.exp(-t*i))}function IN(n,e=1){return e-Math.abs(G0(n,e*2)-e)}function LN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function BN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function zN(n,e){return n+Math.floor(Math.random()*(e-n+1))}function PN(n,e){return n+Math.random()*(e-n)}function FN(n){return n*(.5-Math.random())}function UN(n){n!==void 0&&(FS=n);let e=FS+=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 jN(n){return n*Cl}function HN(n){return n*Yh}function qN(n){return(n&n-1)===0&&n!==0}function VN(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function WN(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function $N(n,e,t,i,r){const a=Math.cos,l=Math.sin,o=a(t/2),u=l(t/2),h=a((e+i)/2),p=l((e+i)/2),f=a((e-i)/2),m=l((e-i)/2),g=a((i-e)/2),_=l((i-e)/2);switch(r){case"XYX":n.set(o*p,u*f,u*m,o*h);break;case"YZY":n.set(u*m,o*p,u*f,o*h);break;case"ZXZ":n.set(u*f,u*m,o*p,o*h);break;case"XZX":n.set(o*p,u*_,u*g,o*h);break;case"YXY":n.set(u*g,o*p,u*_,o*h);break;case"ZYZ":n.set(u*_,u*g,o*p,o*h);break;default:Nt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function sr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Yt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const VG={DEG2RAD:Cl,RAD2DEG:Yh,generateUUID:Dr,clamp:It,euclideanModulo:G0,mapLinear:ON,inverseLerp:NN,lerp:zh,damp:DN,pingpong:IN,smoothstep:LN,smootherstep:BN,randInt:zN,randFloat:PN,randFloatSpread:FN,seededRandom:UN,degToRad:jN,radToDeg:HN,isPowerOfTwo:qN,ceilPowerOfTwo:VN,floorPowerOfTwo:WN,setQuaternionFromProperEuler:$N,normalize:Yt,denormalize:sr};class Ze{constructor(e=0,t=0){Ze.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(It(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(It(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),a=this.x-e.x,l=this.y-e.y;return this.x=a*i-l*r+e.x,this.y=a*r+l*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ir{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,a,l,o){let u=i[r+0],h=i[r+1],p=i[r+2],f=i[r+3],m=a[l+0],g=a[l+1],_=a[l+2],w=a[l+3];if(o<=0){e[t+0]=u,e[t+1]=h,e[t+2]=p,e[t+3]=f;return}if(o>=1){e[t+0]=m,e[t+1]=g,e[t+2]=_,e[t+3]=w;return}if(f!==w||u!==m||h!==g||p!==_){let v=u*m+h*g+p*_+f*w;v<0&&(m=-m,g=-g,_=-_,w=-w,v=-v);let x=1-o;if(v<.9995){const S=Math.acos(v),b=Math.sin(S);x=Math.sin(x*S)/b,o=Math.sin(o*S)/b,u=u*x+m*o,h=h*x+g*o,p=p*x+_*o,f=f*x+w*o}else{u=u*x+m*o,h=h*x+g*o,p=p*x+_*o,f=f*x+w*o;const S=1/Math.sqrt(u*u+h*h+p*p+f*f);u*=S,h*=S,p*=S,f*=S}}e[t]=u,e[t+1]=h,e[t+2]=p,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,a,l){const o=i[r],u=i[r+1],h=i[r+2],p=i[r+3],f=a[l],m=a[l+1],g=a[l+2],_=a[l+3];return e[t]=o*_+p*f+u*g-h*m,e[t+1]=u*_+p*m+h*f-o*g,e[t+2]=h*_+p*g+o*m-u*f,e[t+3]=p*_-o*f-u*m-h*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,a=e._z,l=e._order,o=Math.cos,u=Math.sin,h=o(i/2),p=o(r/2),f=o(a/2),m=u(i/2),g=u(r/2),_=u(a/2);switch(l){case"XYZ":this._x=m*p*f+h*g*_,this._y=h*g*f-m*p*_,this._z=h*p*_+m*g*f,this._w=h*p*f-m*g*_;break;case"YXZ":this._x=m*p*f+h*g*_,this._y=h*g*f-m*p*_,this._z=h*p*_-m*g*f,this._w=h*p*f+m*g*_;break;case"ZXY":this._x=m*p*f-h*g*_,this._y=h*g*f+m*p*_,this._z=h*p*_+m*g*f,this._w=h*p*f-m*g*_;break;case"ZYX":this._x=m*p*f-h*g*_,this._y=h*g*f+m*p*_,this._z=h*p*_-m*g*f,this._w=h*p*f+m*g*_;break;case"YZX":this._x=m*p*f+h*g*_,this._y=h*g*f+m*p*_,this._z=h*p*_-m*g*f,this._w=h*p*f-m*g*_;break;case"XZY":this._x=m*p*f-h*g*_,this._y=h*g*f-m*p*_,this._z=h*p*_+m*g*f,this._w=h*p*f+m*g*_;break;default:Nt("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],a=t[8],l=t[1],o=t[5],u=t[9],h=t[2],p=t[6],f=t[10],m=i+o+f;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(p-u)*g,this._y=(a-h)*g,this._z=(l-r)*g}else if(i>o&&i>f){const g=2*Math.sqrt(1+i-o-f);this._w=(p-u)/g,this._x=.25*g,this._y=(r+l)/g,this._z=(a+h)/g}else if(o>f){const g=2*Math.sqrt(1+o-i-f);this._w=(a-h)/g,this._x=(r+l)/g,this._y=.25*g,this._z=(u+p)/g}else{const g=2*Math.sqrt(1+f-i-o);this._w=(l-r)/g,this._x=(a+h)/g,this._y=(u+p)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,a=e._z,l=e._w,o=t._x,u=t._y,h=t._z,p=t._w;return this._x=i*p+l*o+r*h-a*u,this._y=r*p+l*u+a*o-i*h,this._z=a*p+l*h+i*u-r*o,this._w=l*p-i*o-r*u-a*h,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let i=e._x,r=e._y,a=e._z,l=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,a=-a,l=-l,o=-o);let u=1-t;if(o<.9995){const h=Math.acos(o),p=Math.sin(h);u=Math.sin(u*h)/p,t=Math.sin(t*h)/p,this._x=this._x*u+i*t,this._y=this._y*u+r*t,this._z=this._z*u+a*t,this._w=this._w*u+l*t,this._onChangeCallback()}else this._x=this._x*u+i*t,this._y=this._y*u+r*t,this._z=this._z*u+a*t,this._w=this._w*u+l*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class se{constructor(e=0,t=0,i=0){se.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(US.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(US.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*r,this.y=a[1]*t+a[4]*i+a[7]*r,this.z=a[2]*t+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,a=e.elements,l=1/(a[3]*t+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*r+a[12])*l,this.y=(a[1]*t+a[5]*i+a[9]*r+a[13])*l,this.z=(a[2]*t+a[6]*i+a[10]*r+a[14])*l,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,a=e.x,l=e.y,o=e.z,u=e.w,h=2*(l*r-o*i),p=2*(o*t-a*r),f=2*(a*i-l*t);return this.x=t+u*h+l*f-o*p,this.y=i+u*p+o*h-a*f,this.z=r+u*f+a*p-l*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r,this.y=a[1]*t+a[5]*i+a[9]*r,this.z=a[2]*t+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,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this.z=It(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this.z=It(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(It(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,a=e.z,l=t.x,o=t.y,u=t.z;return this.x=r*u-a*o,this.y=a*l-i*u,this.z=i*o-r*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Oy.copy(this).projectOnVector(e),this.sub(Oy)}reflect(e){return this.sub(Oy.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(It(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Oy=new se,US=new Ir;class Js{constructor(e,t,i,r,a,l,o,u,h){Js.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,a,l,o,u,h)}set(e,t,i,r,a,l,o,u,h){const p=this.elements;return p[0]=e,p[1]=r,p[2]=o,p[3]=t,p[4]=a,p[5]=u,p[6]=i,p[7]=l,p[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,a=this.elements,l=i[0],o=i[3],u=i[6],h=i[1],p=i[4],f=i[7],m=i[2],g=i[5],_=i[8],w=r[0],v=r[3],x=r[6],S=r[1],b=r[4],C=r[7],O=r[2],M=r[5],D=r[8];return a[0]=l*w+o*S+u*O,a[3]=l*v+o*b+u*M,a[6]=l*x+o*C+u*D,a[1]=h*w+p*S+f*O,a[4]=h*v+p*b+f*M,a[7]=h*x+p*C+f*D,a[2]=m*w+g*S+_*O,a[5]=m*v+g*b+_*M,a[8]=m*x+g*C+_*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],l=e[4],o=e[5],u=e[6],h=e[7],p=e[8];return t*l*p-t*o*h-i*a*p+i*o*u+r*a*h-r*l*u}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],l=e[4],o=e[5],u=e[6],h=e[7],p=e[8],f=p*l-o*h,m=o*u-p*a,g=h*a-l*u,_=t*f+i*m+r*g;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=f*w,e[1]=(r*h-p*i)*w,e[2]=(o*i-r*l)*w,e[3]=m*w,e[4]=(p*t-r*u)*w,e[5]=(r*a-o*t)*w,e[6]=g*w,e[7]=(i*u-h*t)*w,e[8]=(l*t-i*a)*w,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,a,l,o){const u=Math.cos(a),h=Math.sin(a);return this.set(i*u,i*h,-i*(u*l+h*o)+l+e,-r*h,r*u,-r*(-h*l+u*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ny.makeScale(e,t)),this}rotate(e){return this.premultiply(Ny.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ny.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Ny=new Js,jS=new Js().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),HS=new Js().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function GN(){const n={enabled:!0,workingColorSpace:DS,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Ry&&(r.r=za(r.r),r.g=za(r.g),r.b=za(r.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Ry&&(r.r=eu(r.r),r.g=eu(r.g),r.b=eu(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===KE?IS:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},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,l){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return PS("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return PS("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[DS]:{primaries:e,whitePoint:i,transfer:IS,toXYZ:jS,fromXYZ:HS,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Jr},outputColorSpaceConfig:{drawingBufferColorSpace:Jr}},[Jr]:{primaries:e,whitePoint:i,transfer:Ry,toXYZ:jS,fromXYZ:HS,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Jr}}}),n}const Rr=GN();function za(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function eu(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Cc;class KN{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Cc===void 0&&(Cc=jp("canvas")),Cc.width=e.width,Cc.height=e.height;const r=Cc.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Cc}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=jp("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let l=0;l<a.length;l++)a[l]=za(a[l]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(za(t[i]/255)*255):t[i]=za(t[i]);return{data:t,width:e.width,height:e.height}}else return Nt("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let YN=0;class Sl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:YN++}),this.uuid=Dr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&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 l=0,o=r.length;l<o;l++)r[l].isDataTexture?a.push(Dy(r[l].image)):a.push(Dy(r[l]))}else a=Dy(r);i.url=a}return t||(e.images[this.uuid]=i),i}}function Dy(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?KN.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(Nt("Texture: Unable to serialize Texture."),{})}let XN=0;const Iy=new se;class vi extends Po{constructor(e=vi.DEFAULT_IMAGE,t=vi.DEFAULT_MAPPING,i=Ks,r=Ks,a=ts,l=hm,o=Gh,u=W0,h=vi.DEFAULT_ANISOTROPY,p=KE){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:XN++}),this.uuid=Dr(),this.name="",this.source=new Sl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=a,this.minFilter=l,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=u,this.offset=new Ze(0,0),this.repeat=new Ze(1,1),this.center=new Ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Js,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,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(Iy).x}get height(){return this.source.getSize(Iy).y}get depth(){return this.source.getSize(Iy).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){Nt(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){Nt(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==V0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case n0:e.x=e.x-Math.floor(e.x);break;case Ks:e.x=e.x<0?0:1;break;case i0: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 n0:e.y=e.y-Math.floor(e.y);break;case Ks:e.y=e.y<0?0:1;break;case i0: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++}}vi.DEFAULT_IMAGE=null;vi.DEFAULT_MAPPING=V0;vi.DEFAULT_ANISOTROPY=1;class is{constructor(e=0,t=0,i=0,r=1){is.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,a=this.w,l=e.elements;return this.x=l[0]*t+l[4]*i+l[8]*r+l[12]*a,this.y=l[1]*t+l[5]*i+l[9]*r+l[13]*a,this.z=l[2]*t+l[6]*i+l[10]*r+l[14]*a,this.w=l[3]*t+l[7]*i+l[11]*r+l[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 t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,a;const u=e.elements,h=u[0],p=u[4],f=u[8],m=u[1],g=u[5],_=u[9],w=u[2],v=u[6],x=u[10];if(Math.abs(p-m)<.01&&Math.abs(f-w)<.01&&Math.abs(_-v)<.01){if(Math.abs(p+m)<.1&&Math.abs(f+w)<.1&&Math.abs(_+v)<.1&&Math.abs(h+g+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(h+1)/2,C=(g+1)/2,O=(x+1)/2,M=(p+m)/4,D=(f+w)/4,N=(_+v)/4;return b>C&&b>O?b<.01?(i=0,r=.707106781,a=.707106781):(i=Math.sqrt(b),r=M/i,a=D/i):C>O?C<.01?(i=.707106781,r=0,a=.707106781):(r=Math.sqrt(C),i=M/r,a=N/r):O<.01?(i=.707106781,r=.707106781,a=0):(a=Math.sqrt(O),i=D/a,r=N/a),this.set(i,r,a,t),this}let S=Math.sqrt((v-_)*(v-_)+(f-w)*(f-w)+(m-p)*(m-p));return Math.abs(S)<.001&&(S=1),this.x=(v-_)/S,this.y=(f-w)/S,this.z=(m-p)/S,this.w=Math.acos((h+g+x-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this.z=It(this.z,e.z,t.z),this.w=It(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this.z=It(this.z,e,t),this.w=It(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(It(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class XE extends Po{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ts,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=t,this.depth=i.depth,this.scissor=new is(0,0,e,t),this.scissorTest=!1,this.viewport=new is(0,0,e,t);const r={width:e,height:t,depth:i.depth},a=new vi(r);this.textures=[];const l=i.count;for(let o=0;o<l;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 t={minFilter:ts,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}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,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,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=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new Sl(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 K0 extends XE{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class ZN extends vi{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Br,this.minFilter=Br,this.wrapR=Ks,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class WG extends K0{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new ZN(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class ZE extends vi{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Br,this.minFilter=Br,this.wrapR=Ks,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class $G extends K0{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new ZE(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class or{constructor(e=new se(1/0,1/0,1/0),t=new se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(fs.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(fs.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=fs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=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,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const a=i.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let l=0,o=a.count;l<o;l++)e.isMesh===!0?e.getVertexPosition(l,fs):fs.fromBufferAttribute(a,l),fs.applyMatrix4(e.matrixWorld),this.expandByPoint(fs);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),kf.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),kf.copy(i.boundingBox)),kf.applyMatrix4(e.matrixWorld),this.union(kf)}const r=e.children;for(let a=0,l=r.length;a<l;a++)this.expandByObject(r[a],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fs),fs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fh),Tf.subVectors(this.max,fh),Ec.subVectors(e.a,fh),Ac.subVectors(e.b,fh),kc.subVectors(e.c,fh),Eo.subVectors(Ac,Ec),Ao.subVectors(kc,Ac),ll.subVectors(Ec,kc);let t=[0,-Eo.z,Eo.y,0,-Ao.z,Ao.y,0,-ll.z,ll.y,Eo.z,0,-Eo.x,Ao.z,0,-Ao.x,ll.z,0,-ll.x,-Eo.y,Eo.x,0,-Ao.y,Ao.x,0,-ll.y,ll.x,0];return!Ly(t,Ec,Ac,kc,Tf)||(t=[1,0,0,0,1,0,0,0,1],!Ly(t,Ec,Ac,kc,Tf))?!1:(Mf.crossVectors(Eo,Ao),t=[Mf.x,Mf.y,Mf.z],Ly(t,Ec,Ac,kc,Tf))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fs).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:(Aa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Aa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Aa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Aa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Aa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Aa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Aa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Aa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Aa),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 Aa=[new se,new se,new se,new se,new se,new se,new se,new se],fs=new se,kf=new or,Ec=new se,Ac=new se,kc=new se,Eo=new se,Ao=new se,ll=new se,fh=new se,Tf=new se,Mf=new se,cl=new se;function Ly(n,e,t,i,r){for(let a=0,l=n.length-3;a<=l;a+=3){cl.fromArray(n,a);const o=r.x*Math.abs(cl.x)+r.y*Math.abs(cl.y)+r.z*Math.abs(cl.z),u=e.dot(cl),h=t.dot(cl),p=i.dot(cl);if(Math.max(-Math.max(u,h,p),Math.min(u,h,p))>o)return!1}return!0}const JN=new or,ph=new se,By=new se;class Xi{constructor(e=new se,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):JN.setFromPoints(e).getCenter(i);let r=0;for(let a=0,l=e.length;a<l;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 t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(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;ph.subVectors(e,this.center);const t=ph.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(ph,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):(By.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ph.copy(e.center).add(By)),this.expandByPoint(ph.copy(e.center).sub(By))),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 ka=new se,zy=new se,Rf=new se,ko=new se,Py=new se,Of=new se,Fy=new se;class ad{constructor(e=new se,t=new se(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ka)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ka.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ka.copy(this.origin).addScaledVector(this.direction,t),ka.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){zy.copy(e).add(t).multiplyScalar(.5),Rf.copy(t).sub(e).normalize(),ko.copy(this.origin).sub(zy);const a=e.distanceTo(t)*.5,l=-this.direction.dot(Rf),o=ko.dot(this.direction),u=-ko.dot(Rf),h=ko.lengthSq(),p=Math.abs(1-l*l);let f,m,g,_;if(p>0)if(f=l*u-o,m=l*o-u,_=a*p,f>=0)if(m>=-_)if(m<=_){const w=1/p;f*=w,m*=w,g=f*(f+l*m+2*o)+m*(l*f+m+2*u)+h}else m=a,f=Math.max(0,-(l*m+o)),g=-f*f+m*(m+2*u)+h;else m=-a,f=Math.max(0,-(l*m+o)),g=-f*f+m*(m+2*u)+h;else m<=-_?(f=Math.max(0,-(-l*a+o)),m=f>0?-a:Math.min(Math.max(-a,-u),a),g=-f*f+m*(m+2*u)+h):m<=_?(f=0,m=Math.min(Math.max(-a,-u),a),g=m*(m+2*u)+h):(f=Math.max(0,-(l*a+o)),m=f>0?a:Math.min(Math.max(-a,-u),a),g=-f*f+m*(m+2*u)+h);else m=l>0?-a:a,f=Math.max(0,-(l*m+o)),g=-f*f+m*(m+2*u)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(zy).addScaledVector(Rf,m),g}intersectSphere(e,t){ka.subVectors(e.center,this.origin);const i=ka.dot(this.direction),r=ka.dot(ka)-i*i,a=e.radius*e.radius;if(r>a)return null;const l=Math.sqrt(a-r),o=i-l,u=i+l;return u<0?null:o<0?this.at(u,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,a,l,o,u;const h=1/this.direction.x,p=1/this.direction.y,f=1/this.direction.z,m=this.origin;return h>=0?(i=(e.min.x-m.x)*h,r=(e.max.x-m.x)*h):(i=(e.max.x-m.x)*h,r=(e.min.x-m.x)*h),p>=0?(a=(e.min.y-m.y)*p,l=(e.max.y-m.y)*p):(a=(e.max.y-m.y)*p,l=(e.min.y-m.y)*p),i>l||a>r||((a>i||isNaN(i))&&(i=a),(l<r||isNaN(r))&&(r=l),f>=0?(o=(e.min.z-m.z)*f,u=(e.max.z-m.z)*f):(o=(e.max.z-m.z)*f,u=(e.min.z-m.z)*f),i>u||o>r)||((o>i||i!==i)&&(i=o),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,ka)!==null}intersectTriangle(e,t,i,r,a){Py.subVectors(t,e),Of.subVectors(i,e),Fy.crossVectors(Py,Of);let l=this.direction.dot(Fy),o;if(l>0){if(r)return null;o=1}else if(l<0)o=-1,l=-l;else return null;ko.subVectors(this.origin,e);const u=o*this.direction.dot(Of.crossVectors(ko,Of));if(u<0)return null;const h=o*this.direction.dot(Py.cross(ko));if(h<0||u+h>l)return null;const p=-o*ko.dot(Fy);return p<0?null:this.at(p/l,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 Qt{constructor(e,t,i,r,a,l,o,u,h,p,f,m,g,_,w,v){Qt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,a,l,o,u,h,p,f,m,g,_,w,v)}set(e,t,i,r,a,l,o,u,h,p,f,m,g,_,w,v){const x=this.elements;return x[0]=e,x[4]=t,x[8]=i,x[12]=r,x[1]=a,x[5]=l,x[9]=o,x[13]=u,x[2]=h,x[6]=p,x[10]=f,x[14]=m,x[3]=g,x[7]=_,x[11]=w,x[15]=v,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 Qt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/Tc.setFromMatrixColumn(e,0).length(),a=1/Tc.setFromMatrixColumn(e,1).length(),l=1/Tc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*l,t[9]=i[9]*l,t[10]=i[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,a=e.z,l=Math.cos(i),o=Math.sin(i),u=Math.cos(r),h=Math.sin(r),p=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){const m=l*p,g=l*f,_=o*p,w=o*f;t[0]=u*p,t[4]=-u*f,t[8]=h,t[1]=g+_*h,t[5]=m-w*h,t[9]=-o*u,t[2]=w-m*h,t[6]=_+g*h,t[10]=l*u}else if(e.order==="YXZ"){const m=u*p,g=u*f,_=h*p,w=h*f;t[0]=m+w*o,t[4]=_*o-g,t[8]=l*h,t[1]=l*f,t[5]=l*p,t[9]=-o,t[2]=g*o-_,t[6]=w+m*o,t[10]=l*u}else if(e.order==="ZXY"){const m=u*p,g=u*f,_=h*p,w=h*f;t[0]=m-w*o,t[4]=-l*f,t[8]=_+g*o,t[1]=g+_*o,t[5]=l*p,t[9]=w-m*o,t[2]=-l*h,t[6]=o,t[10]=l*u}else if(e.order==="ZYX"){const m=l*p,g=l*f,_=o*p,w=o*f;t[0]=u*p,t[4]=_*h-g,t[8]=m*h+w,t[1]=u*f,t[5]=w*h+m,t[9]=g*h-_,t[2]=-h,t[6]=o*u,t[10]=l*u}else if(e.order==="YZX"){const m=l*u,g=l*h,_=o*u,w=o*h;t[0]=u*p,t[4]=w-m*f,t[8]=_*f+g,t[1]=f,t[5]=l*p,t[9]=-o*p,t[2]=-h*p,t[6]=g*f+_,t[10]=m-w*f}else if(e.order==="XZY"){const m=l*u,g=l*h,_=o*u,w=o*h;t[0]=u*p,t[4]=-f,t[8]=h*p,t[1]=m*f+w,t[5]=l*p,t[9]=g*f-_,t[2]=_*f-g,t[6]=o*p,t[10]=w*f+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(QN,e,eD)}lookAt(e,t,i){const r=this.elements;return kr.subVectors(e,t),kr.lengthSq()===0&&(kr.z=1),kr.normalize(),To.crossVectors(i,kr),To.lengthSq()===0&&(Math.abs(i.z)===1?kr.x+=1e-4:kr.z+=1e-4,kr.normalize(),To.crossVectors(i,kr)),To.normalize(),Nf.crossVectors(kr,To),r[0]=To.x,r[4]=Nf.x,r[8]=kr.x,r[1]=To.y,r[5]=Nf.y,r[9]=kr.y,r[2]=To.z,r[6]=Nf.z,r[10]=kr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,a=this.elements,l=i[0],o=i[4],u=i[8],h=i[12],p=i[1],f=i[5],m=i[9],g=i[13],_=i[2],w=i[6],v=i[10],x=i[14],S=i[3],b=i[7],C=i[11],O=i[15],M=r[0],D=r[4],N=r[8],L=r[12],j=r[1],K=r[5],Y=r[9],H=r[13],Q=r[2],te=r[6],$=r[10],J=r[14],re=r[3],F=r[7],B=r[11],U=r[15];return a[0]=l*M+o*j+u*Q+h*re,a[4]=l*D+o*K+u*te+h*F,a[8]=l*N+o*Y+u*$+h*B,a[12]=l*L+o*H+u*J+h*U,a[1]=p*M+f*j+m*Q+g*re,a[5]=p*D+f*K+m*te+g*F,a[9]=p*N+f*Y+m*$+g*B,a[13]=p*L+f*H+m*J+g*U,a[2]=_*M+w*j+v*Q+x*re,a[6]=_*D+w*K+v*te+x*F,a[10]=_*N+w*Y+v*$+x*B,a[14]=_*L+w*H+v*J+x*U,a[3]=S*M+b*j+C*Q+O*re,a[7]=S*D+b*K+C*te+O*F,a[11]=S*N+b*Y+C*$+O*B,a[15]=S*L+b*H+C*J+O*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],a=e[12],l=e[1],o=e[5],u=e[9],h=e[13],p=e[2],f=e[6],m=e[10],g=e[14],_=e[3],w=e[7],v=e[11],x=e[15],S=u*g-h*m,b=o*g-h*f,C=o*m-u*f,O=l*g-h*p,M=l*m-u*p,D=l*f-o*p;return t*(w*S-v*b+x*C)-i*(_*S-v*O+x*M)+r*(_*b-w*O+x*D)-a*(_*C-w*M+v*D)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],l=e[4],o=e[5],u=e[6],h=e[7],p=e[8],f=e[9],m=e[10],g=e[11],_=e[12],w=e[13],v=e[14],x=e[15],S=f*v*h-w*m*h+w*u*g-o*v*g-f*u*x+o*m*x,b=_*m*h-p*v*h-_*u*g+l*v*g+p*u*x-l*m*x,C=p*w*h-_*f*h+_*o*g-l*w*g-p*o*x+l*f*x,O=_*f*u-p*w*u-_*o*m+l*w*m+p*o*v-l*f*v,M=t*S+i*b+r*C+a*O;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/M;return e[0]=S*D,e[1]=(w*m*a-f*v*a-w*r*g+i*v*g+f*r*x-i*m*x)*D,e[2]=(o*v*a-w*u*a+w*r*h-i*v*h-o*r*x+i*u*x)*D,e[3]=(f*u*a-o*m*a-f*r*h+i*m*h+o*r*g-i*u*g)*D,e[4]=b*D,e[5]=(p*v*a-_*m*a+_*r*g-t*v*g-p*r*x+t*m*x)*D,e[6]=(_*u*a-l*v*a-_*r*h+t*v*h+l*r*x-t*u*x)*D,e[7]=(l*m*a-p*u*a+p*r*h-t*m*h-l*r*g+t*u*g)*D,e[8]=C*D,e[9]=(_*f*a-p*w*a-_*i*g+t*w*g+p*i*x-t*f*x)*D,e[10]=(l*w*a-_*o*a+_*i*h-t*w*h-l*i*x+t*o*x)*D,e[11]=(p*o*a-l*f*a-p*i*h+t*f*h+l*i*g-t*o*g)*D,e[12]=O*D,e[13]=(p*w*r-_*f*r+_*i*m-t*w*m-p*i*v+t*f*v)*D,e[14]=(_*o*r-l*w*r-_*i*u+t*w*u+l*i*v-t*o*v)*D,e[15]=(l*f*r-p*o*r+p*i*u-t*f*u-l*i*m+t*o*m)*D,this}scale(e){const t=this.elements,i=e.x,r=e.y,a=e.z;return t[0]*=i,t[4]*=r,t[8]*=a,t[1]*=i,t[5]*=r,t[9]*=a,t[2]*=i,t[6]*=r,t[10]*=a,t[3]*=i,t[7]*=r,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),a=1-i,l=e.x,o=e.y,u=e.z,h=a*l,p=a*o;return this.set(h*l+i,h*o-r*u,h*u+r*o,0,h*o+r*u,p*o+i,p*u-r*l,0,h*u-r*o,p*u+r*l,a*u*u+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,a,l){return this.set(1,i,a,0,e,1,l,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,a=t._x,l=t._y,o=t._z,u=t._w,h=a+a,p=l+l,f=o+o,m=a*h,g=a*p,_=a*f,w=l*p,v=l*f,x=o*f,S=u*h,b=u*p,C=u*f,O=i.x,M=i.y,D=i.z;return r[0]=(1-(w+x))*O,r[1]=(g+C)*O,r[2]=(_-b)*O,r[3]=0,r[4]=(g-C)*M,r[5]=(1-(m+x))*M,r[6]=(v+S)*M,r[7]=0,r[8]=(_+b)*D,r[9]=(v-S)*D,r[10]=(1-(m+w))*D,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),t.identity(),this;let a=Tc.set(r[0],r[1],r[2]).length();const l=Tc.set(r[4],r[5],r[6]).length(),o=Tc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),ps.copy(this);const h=1/a,p=1/l,f=1/o;return ps.elements[0]*=h,ps.elements[1]*=h,ps.elements[2]*=h,ps.elements[4]*=p,ps.elements[5]*=p,ps.elements[6]*=p,ps.elements[8]*=f,ps.elements[9]*=f,ps.elements[10]*=f,t.setFromRotationMatrix(ps),i.x=a,i.y=l,i.z=o,this}makePerspective(e,t,i,r,a,l,o=Ys,u=!1){const h=this.elements,p=2*a/(t-e),f=2*a/(i-r),m=(t+e)/(t-e),g=(i+r)/(i-r);let _,w;if(u)_=a/(l-a),w=l*a/(l-a);else if(o===Ys)_=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(o===Kh)_=-l/(l-a),w=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=p,h[4]=0,h[8]=m,h[12]=0,h[1]=0,h[5]=f,h[9]=g,h[13]=0,h[2]=0,h[6]=0,h[10]=_,h[14]=w,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,i,r,a,l,o=Ys,u=!1){const h=this.elements,p=2/(t-e),f=2/(i-r),m=-(t+e)/(t-e),g=-(i+r)/(i-r);let _,w;if(u)_=1/(l-a),w=l/(l-a);else if(o===Ys)_=-2/(l-a),w=-(l+a)/(l-a);else if(o===Kh)_=-1/(l-a),w=-a/(l-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=p,h[4]=0,h[8]=0,h[12]=m,h[1]=0,h[5]=f,h[9]=0,h[13]=g,h[2]=0,h[6]=0,h[10]=_,h[14]=w,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Tc=new se,ps=new Qt,QN=new se(0,0,0),eD=new se(1,1,1),To=new se,Nf=new se,kr=new se,qS=new Qt,VS=new Ir;class Zs{constructor(e=0,t=0,i=0,r=Zs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,a=r[0],l=r[4],o=r[8],u=r[1],h=r[5],p=r[9],f=r[2],m=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(It(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-p,g),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-It(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(o,g),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-f,a),this._z=0);break;case"ZXY":this._x=Math.asin(It(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-f,g),this._z=Math.atan2(-l,h)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-It(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,h));break;case"YZX":this._z=Math.asin(It(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,h),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(o,g));break;case"XZY":this._z=Math.asin(-It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-p,g),this._y=0);break;default:Nt("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return qS.makeRotationFromQuaternion(e),this.setFromRotationMatrix(qS,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return VS.setFromEuler(this),this.setFromQuaternion(VS,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Zs.DEFAULT_ORDER="XYZ";class JE{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 tD=0;const WS=new se,Mc=new Ir,Ta=new Qt,Df=new se,mh=new se,nD=new se,iD=new Ir,$S=new se(1,0,0),GS=new se(0,1,0),KS=new se(0,0,1),YS={type:"added"},rD={type:"removed"},Rc={type:"childadded",child:null},Uy={type:"childremoved",child:null};class wn extends Po{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tD++}),this.uuid=Dr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=wn.DEFAULT_UP.clone();const e=new se,t=new Zs,i=new Ir,r=new se(1,1,1);function a(){i.setFromEuler(t,!1)}function l(){t.setFromQuaternion(i,void 0,!1)}t._onChange(a),i._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Qt},normalMatrix:{value:new Js}}),this.matrix=new Qt,this.matrixWorld=new Qt,this.matrixAutoUpdate=wn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=wn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new JE,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Mc.setFromAxisAngle(e,t),this.quaternion.multiply(Mc),this}rotateOnWorldAxis(e,t){return Mc.setFromAxisAngle(e,t),this.quaternion.premultiply(Mc),this}rotateX(e){return this.rotateOnAxis($S,e)}rotateY(e){return this.rotateOnAxis(GS,e)}rotateZ(e){return this.rotateOnAxis(KS,e)}translateOnAxis(e,t){return WS.copy(e).applyQuaternion(this.quaternion),this.position.add(WS.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis($S,e)}translateY(e){return this.translateOnAxis(GS,e)}translateZ(e){return this.translateOnAxis(KS,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ta.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Df.copy(e):Df.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),mh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ta.lookAt(mh,Df,this.up):Ta.lookAt(Df,mh,this.up),this.quaternion.setFromRotationMatrix(Ta),r&&(Ta.extractRotation(r.matrixWorld),Mc.setFromRotationMatrix(Ta),this.quaternion.premultiply(Mc.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Sn("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(YS),Rc.child=e,this.dispatchEvent(Rc),Rc.child=null):Sn("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 t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(rD),Uy.child=e,this.dispatchEvent(Uy),Uy.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),Ta.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ta.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ta),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(YS),Rc.child=e,this.dispatchEvent(Rc),Rc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const l=this.children[i].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,e,nD),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,iD,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(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 t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){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)),t===!0){const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(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,u){return o[u.uuid]===void 0&&(o[u.uuid]=u.toJSON(e)),u.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 u=o.shapes;if(Array.isArray(u))for(let h=0,p=u.length;h<p;h++){const f=u[h];a(e.shapes,f)}else a(e.shapes,u)}}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 u=0,h=this.material.length;u<h;u++)o.push(a(e.materials,this.material[u]));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 u=this.animations[o];r.animations.push(a(e.animations,u))}}if(t){const o=l(e.geometries),u=l(e.materials),h=l(e.textures),p=l(e.images),f=l(e.shapes),m=l(e.skeletons),g=l(e.animations),_=l(e.nodes);o.length>0&&(i.geometries=o),u.length>0&&(i.materials=u),h.length>0&&(i.textures=h),p.length>0&&(i.images=p),f.length>0&&(i.shapes=f),m.length>0&&(i.skeletons=m),g.length>0&&(i.animations=g),_.length>0&&(i.nodes=_)}return i.object=r,i;function l(o){const u=[];for(const h in o){const p=o[h];delete p.metadata,u.push(p)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}wn.DEFAULT_UP=new se(0,1,0);wn.DEFAULT_MATRIX_AUTO_UPDATE=!0;wn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ms=new se,Ma=new se,jy=new se,Ra=new se,Oc=new se,Nc=new se,XS=new se,Hy=new se,qy=new se,Vy=new se,Wy=new is,$y=new is,Gy=new is;class Or{constructor(e=new se,t=new se,i=new se){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),ms.subVectors(e,t),r.cross(ms);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,t,i,r,a){ms.subVectors(r,t),Ma.subVectors(i,t),jy.subVectors(e,t);const l=ms.dot(ms),o=ms.dot(Ma),u=ms.dot(jy),h=Ma.dot(Ma),p=Ma.dot(jy),f=l*h-o*o;if(f===0)return a.set(0,0,0),null;const m=1/f,g=(h*u-o*p)*m,_=(l*p-o*u)*m;return a.set(1-g-_,_,g)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Ra)===null?!1:Ra.x>=0&&Ra.y>=0&&Ra.x+Ra.y<=1}static getInterpolation(e,t,i,r,a,l,o,u){return this.getBarycoord(e,t,i,r,Ra)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,Ra.x),u.addScaledVector(l,Ra.y),u.addScaledVector(o,Ra.z),u)}static getInterpolatedAttribute(e,t,i,r,a,l){return Wy.setScalar(0),$y.setScalar(0),Gy.setScalar(0),Wy.fromBufferAttribute(e,t),$y.fromBufferAttribute(e,i),Gy.fromBufferAttribute(e,r),l.setScalar(0),l.addScaledVector(Wy,a.x),l.addScaledVector($y,a.y),l.addScaledVector(Gy,a.z),l}static isFrontFacing(e,t,i,r){return ms.subVectors(i,t),Ma.subVectors(e,t),ms.cross(Ma).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ms.subVectors(this.c,this.b),Ma.subVectors(this.a,this.b),ms.cross(Ma).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Or.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Or.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,a){return Or.getInterpolation(e,this.a,this.b,this.c,t,i,r,a)}containsPoint(e){return Or.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Or.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,a=this.c;let l,o;Oc.subVectors(r,i),Nc.subVectors(a,i),Hy.subVectors(e,i);const u=Oc.dot(Hy),h=Nc.dot(Hy);if(u<=0&&h<=0)return t.copy(i);qy.subVectors(e,r);const p=Oc.dot(qy),f=Nc.dot(qy);if(p>=0&&f<=p)return t.copy(r);const m=u*f-p*h;if(m<=0&&u>=0&&p<=0)return l=u/(u-p),t.copy(i).addScaledVector(Oc,l);Vy.subVectors(e,a);const g=Oc.dot(Vy),_=Nc.dot(Vy);if(_>=0&&g<=_)return t.copy(a);const w=g*h-u*_;if(w<=0&&h>=0&&_<=0)return o=h/(h-_),t.copy(i).addScaledVector(Nc,o);const v=p*_-g*f;if(v<=0&&f-p>=0&&g-_>=0)return XS.subVectors(a,r),o=(f-p)/(f-p+(g-_)),t.copy(r).addScaledVector(XS,o);const x=1/(v+w+m);return l=w*x,o=m*x,t.copy(i).addScaledVector(Oc,l).addScaledVector(Nc,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const QE={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},Mo={h:0,s:0,l:0},If={h:0,s:0,l:0};function Ky(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Ht{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Jr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rr.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Rr.workingColorSpace){return this.r=e,this.g=t,this.b=i,Rr.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Rr.workingColorSpace){if(e=G0(e,1),t=It(t,0,1),i=It(i,0,1),t===0)this.r=this.g=this.b=i;else{const a=i<=.5?i*(1+t):i+t-i*t,l=2*i-a;this.r=Ky(l,a,e+1/3),this.g=Ky(l,a,e),this.b=Ky(l,a,e-1/3)}return Rr.colorSpaceToWorking(this,r),this}setStyle(e,t=Jr){function i(a){a!==void 0&&parseFloat(a)<1&&Nt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const l=r[1],o=r[2];switch(l){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,t);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,t);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,t);break;default:Nt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(a,16),t);Nt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Jr){const i=QE[e.toLowerCase()];return i!==void 0?this.setHex(i,t):Nt("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=za(e.r),this.g=za(e.g),this.b=za(e.b),this}copyLinearToSRGB(e){return this.r=eu(e.r),this.g=eu(e.g),this.b=eu(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Jr){return Rr.workingToColorSpace(Gi.copy(this),e),Math.round(It(Gi.r*255,0,255))*65536+Math.round(It(Gi.g*255,0,255))*256+Math.round(It(Gi.b*255,0,255))}getHexString(e=Jr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rr.workingColorSpace){Rr.workingToColorSpace(Gi.copy(this),t);const i=Gi.r,r=Gi.g,a=Gi.b,l=Math.max(i,r,a),o=Math.min(i,r,a);let u,h;const p=(o+l)/2;if(o===l)u=0,h=0;else{const f=l-o;switch(h=p<=.5?f/(l+o):f/(2-l-o),l){case i:u=(r-a)/f+(r<a?6:0);break;case r:u=(a-i)/f+2;break;case a:u=(i-r)/f+4;break}u/=6}return e.h=u,e.s=h,e.l=p,e}getRGB(e,t=Rr.workingColorSpace){return Rr.workingToColorSpace(Gi.copy(this),t),e.r=Gi.r,e.g=Gi.g,e.b=Gi.b,e}getStyle(e=Jr){Rr.workingToColorSpace(Gi.copy(this),e);const t=Gi.r,i=Gi.g,r=Gi.b;return e!==Jr?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Mo),this.setHSL(Mo.h+e,Mo.s+t,Mo.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Mo),e.getHSL(If);const i=zh(Mo.h,If.h,t),r=zh(Mo.s,If.s,t),a=zh(Mo.l,If.l,t);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 t=this.r,i=this.g,r=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*r,this.g=a[1]*t+a[4]*i+a[7]*r,this.b=a[2]*t+a[5]*i+a[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Gi=new Ht;Ht.NAMES=QE;let sD=0;class lr extends Po{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:sD++}),this.uuid=Dr(),this.name="",this.type="Material",this.blending=kS,this.side=t0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=MS,this.blendDst=RS,this.blendEquation=TS,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ht(0,0,0),this.blendAlpha=0,this.depthFunc=OS,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=LS,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=wc,this.stencilZFail=wc,this.stencilZPass=wc,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 t in e){const i=e[t];if(i===void 0){Nt(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){Nt(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==kS&&(i.blending=this.blending),this.side!==t0&&(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!==MS&&(i.blendSrc=this.blendSrc),this.blendDst!==RS&&(i.blendDst=this.blendDst),this.blendEquation!==TS&&(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!==OS&&(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!==LS&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==wc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==wc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==wc&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(a){const l=[];for(const o in a){const u=a[o];delete u.metadata,l.push(u)}return l}if(t){const a=r(e.textures),l=r(e.images);a.length>0&&(i.textures=a),l.length>0&&(i.images=l)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let a=0;a!==r;++a)i[a]=t[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.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class du extends lr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ht(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 Zs,this.combine=q0,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 Ia=aD();function aD(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let u=0;u<256;++u){const h=u-127;h<-27?(i[u]=0,i[u|256]=32768,r[u]=24,r[u|256]=24):h<-14?(i[u]=1024>>-h-14,i[u|256]=1024>>-h-14|32768,r[u]=-h-1,r[u|256]=-h-1):h<=15?(i[u]=h+15<<10,i[u|256]=h+15<<10|32768,r[u]=13,r[u|256]=13):h<128?(i[u]=31744,i[u|256]=64512,r[u]=24,r[u|256]=24):(i[u]=31744,i[u|256]=64512,r[u]=13,r[u|256]=13)}const a=new Uint32Array(2048),l=new Uint32Array(64),o=new Uint32Array(64);for(let u=1;u<1024;++u){let h=u<<13,p=0;for(;(h&8388608)===0;)h<<=1,p-=8388608;h&=-8388609,p+=947912704,a[u]=h|p}for(let u=1024;u<2048;++u)a[u]=939524096+(u-1024<<13);for(let u=1;u<31;++u)l[u]=u<<23;l[31]=1199570944,l[32]=2147483648;for(let u=33;u<63;++u)l[u]=2147483648+(u-32<<23);l[63]=3347054592;for(let u=1;u<64;++u)u!==32&&(o[u]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:l,offsetTable:o}}function yr(n){Math.abs(n)>65504&&Nt("DataUtils.toHalfFloat(): Value out of range."),n=It(n,-65504,65504),Ia.floatView[0]=n;const e=Ia.uint32View[0],t=e>>23&511;return Ia.baseTable[t]+((e&8388607)>>Ia.shiftTable[t])}function Nh(n){const e=n>>10;return Ia.uint32View[0]=Ia.mantissaTable[Ia.offsetTable[e]+(n&1023)]+Ia.exponentTable[e],Ia.floatView[0]}class GG{static toHalfFloat(e){return yr(e)}static fromHalfFloat(e){return Nh(e)}}const yi=new se,Lf=new Ze;let oD=0;class ii{constructor(e,t,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:oD++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Up,this.updateRanges=[],this.gpuType=iu,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Lf.fromBufferAttribute(this,t),Lf.applyMatrix3(e),this.setXY(t,Lf.x,Lf.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.applyMatrix3(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.applyMatrix4(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.applyNormalMatrix(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.transformDirection(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=sr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Yt(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=sr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=sr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=sr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=sr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array),r=Yt(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,a){return e*=this.itemSize,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array),r=Yt(r,this.array),a=Yt(a,this.array)),this.array[e+0]=t,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!==Up&&(e.usage=this.usage),e}}class KG extends ii{constructor(e,t,i){super(new Int8Array(e),t,i)}}class YG extends ii{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class XG extends ii{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class ZG extends ii{constructor(e,t,i){super(new Int16Array(e),t,i)}}class lD extends ii{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class JG extends ii{constructor(e,t,i){super(new Int32Array(e),t,i)}}class cD extends ii{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class QG extends ii{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=Nh(this.array[e*this.itemSize]);return this.normalized&&(t=sr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize]=yr(t),this}getY(e){let t=Nh(this.array[e*this.itemSize+1]);return this.normalized&&(t=sr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize+1]=yr(t),this}getZ(e){let t=Nh(this.array[e*this.itemSize+2]);return this.normalized&&(t=sr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize+2]=yr(t),this}getW(e){let t=Nh(this.array[e*this.itemSize+3]);return this.normalized&&(t=sr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Yt(t,this.array)),this.array[e*this.itemSize+3]=yr(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array)),this.array[e+0]=yr(t),this.array[e+1]=yr(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array),r=Yt(r,this.array)),this.array[e+0]=yr(t),this.array[e+1]=yr(i),this.array[e+2]=yr(r),this}setXYZW(e,t,i,r,a){return e*=this.itemSize,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array),r=Yt(r,this.array),a=Yt(a,this.array)),this.array[e+0]=yr(t),this.array[e+1]=yr(i),this.array[e+2]=yr(r),this.array[e+3]=yr(a),this}}class yt extends ii{constructor(e,t,i){super(new Float32Array(e),t,i)}}let uD=0;const Zr=new Qt,Yy=new wn,Dc=new se,Tr=new or,gh=new or,Oi=new se;class rn extends Po{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:uD++}),this.uuid=Dr(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(MN(e)?cD:lD)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const a=new Js().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 Zr.makeRotationFromQuaternion(e),this.applyMatrix4(Zr),this}rotateX(e){return Zr.makeRotationX(e),this.applyMatrix4(Zr),this}rotateY(e){return Zr.makeRotationY(e),this.applyMatrix4(Zr),this}rotateZ(e){return Zr.makeRotationZ(e),this.applyMatrix4(Zr),this}translate(e,t,i){return Zr.makeTranslation(e,t,i),this.applyMatrix4(Zr),this}scale(e,t,i){return Zr.makeScale(e,t,i),this.applyMatrix4(Zr),this}lookAt(e){return Yy.lookAt(e),Yy.updateMatrix(),this.applyMatrix4(Yy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Dc).negate(),this.translate(Dc.x,Dc.y,Dc.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,a=e.length;r<a;r++){const l=e[r];i.push(l.x,l.y,l.z||0)}this.setAttribute("position",new yt(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const a=e[r];t.setXYZ(r,a.x,a.y,a.z||0)}e.length>t.count&&Nt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new or);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Sn("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new se(-1/0,-1/0,-1/0),new se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const a=t[i];Tr.setFromBufferAttribute(a),this.morphTargetsRelative?(Oi.addVectors(this.boundingBox.min,Tr.min),this.boundingBox.expandByPoint(Oi),Oi.addVectors(this.boundingBox.max,Tr.max),this.boundingBox.expandByPoint(Oi)):(this.boundingBox.expandByPoint(Tr.min),this.boundingBox.expandByPoint(Tr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Sn('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 Xi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Sn("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new se,1/0);return}if(e){const i=this.boundingSphere.center;if(Tr.setFromBufferAttribute(e),t)for(let a=0,l=t.length;a<l;a++){const o=t[a];gh.setFromBufferAttribute(o),this.morphTargetsRelative?(Oi.addVectors(Tr.min,gh.min),Tr.expandByPoint(Oi),Oi.addVectors(Tr.max,gh.max),Tr.expandByPoint(Oi)):(Tr.expandByPoint(gh.min),Tr.expandByPoint(gh.max))}Tr.getCenter(i);let r=0;for(let a=0,l=e.count;a<l;a++)Oi.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(Oi));if(t)for(let a=0,l=t.length;a<l;a++){const o=t[a],u=this.morphTargetsRelative;for(let h=0,p=o.count;h<p;h++)Oi.fromBufferAttribute(o,h),u&&(Dc.fromBufferAttribute(e,h),Oi.add(Dc)),r=Math.max(r,i.distanceToSquared(Oi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Sn('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Sn("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,a=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ii(new Float32Array(4*i.count),4));const l=this.getAttribute("tangent"),o=[],u=[];for(let N=0;N<i.count;N++)o[N]=new se,u[N]=new se;const h=new se,p=new se,f=new se,m=new Ze,g=new Ze,_=new Ze,w=new se,v=new se;function x(N,L,j){h.fromBufferAttribute(i,N),p.fromBufferAttribute(i,L),f.fromBufferAttribute(i,j),m.fromBufferAttribute(a,N),g.fromBufferAttribute(a,L),_.fromBufferAttribute(a,j),p.sub(h),f.sub(h),g.sub(m),_.sub(m);const K=1/(g.x*_.y-_.x*g.y);isFinite(K)&&(w.copy(p).multiplyScalar(_.y).addScaledVector(f,-g.y).multiplyScalar(K),v.copy(f).multiplyScalar(g.x).addScaledVector(p,-_.x).multiplyScalar(K),o[N].add(w),o[L].add(w),o[j].add(w),u[N].add(v),u[L].add(v),u[j].add(v))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let N=0,L=S.length;N<L;++N){const j=S[N],K=j.start,Y=j.count;for(let H=K,Q=K+Y;H<Q;H+=3)x(e.getX(H+0),e.getX(H+1),e.getX(H+2))}const b=new se,C=new se,O=new se,M=new se;function D(N){O.fromBufferAttribute(r,N),M.copy(O);const L=o[N];b.copy(L),b.sub(O.multiplyScalar(O.dot(L))).normalize(),C.crossVectors(M,L);const K=C.dot(u[N])<0?-1:1;l.setXYZW(N,b.x,b.y,b.z,K)}for(let N=0,L=S.length;N<L;++N){const j=S[N],K=j.start,Y=j.count;for(let H=K,Q=K+Y;H<Q;H+=3)D(e.getX(H+0)),D(e.getX(H+1)),D(e.getX(H+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new ii(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let m=0,g=i.count;m<g;m++)i.setXYZ(m,0,0,0);const r=new se,a=new se,l=new se,o=new se,u=new se,h=new se,p=new se,f=new se;if(e)for(let m=0,g=e.count;m<g;m+=3){const _=e.getX(m+0),w=e.getX(m+1),v=e.getX(m+2);r.fromBufferAttribute(t,_),a.fromBufferAttribute(t,w),l.fromBufferAttribute(t,v),p.subVectors(l,a),f.subVectors(r,a),p.cross(f),o.fromBufferAttribute(i,_),u.fromBufferAttribute(i,w),h.fromBufferAttribute(i,v),o.add(p),u.add(p),h.add(p),i.setXYZ(_,o.x,o.y,o.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(v,h.x,h.y,h.z)}else for(let m=0,g=t.count;m<g;m+=3)r.fromBufferAttribute(t,m+0),a.fromBufferAttribute(t,m+1),l.fromBufferAttribute(t,m+2),p.subVectors(l,a),f.subVectors(r,a),p.cross(f),i.setXYZ(m+0,p.x,p.y,p.z),i.setXYZ(m+1,p.x,p.y,p.z),i.setXYZ(m+2,p.x,p.y,p.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Oi.fromBufferAttribute(e,t),Oi.normalize(),e.setXYZ(t,Oi.x,Oi.y,Oi.z)}toNonIndexed(){function e(o,u){const h=o.array,p=o.itemSize,f=o.normalized,m=new h.constructor(u.length*p);let g=0,_=0;for(let w=0,v=u.length;w<v;w++){o.isInterleavedBufferAttribute?g=u[w]*o.data.stride+o.offset:g=u[w]*p;for(let x=0;x<p;x++)m[_++]=h[g++]}return new ii(m,p,f)}if(this.index===null)return Nt("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new rn,i=this.index.array,r=this.attributes;for(const o in r){const u=r[o],h=e(u,i);t.setAttribute(o,h)}const a=this.morphAttributes;for(const o in a){const u=[],h=a[o];for(let p=0,f=h.length;p<f;p++){const m=h[p],g=e(m,i);u.push(g)}t.morphAttributes[o]=u}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let o=0,u=l.length;o<u;o++){const h=l[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}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 u=this.parameters;for(const h in u)u[h]!==void 0&&(e[h]=u[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const u in i){const h=i[u];e.data.attributes[u]=h.toJSON(e.data)}const r={};let a=!1;for(const u in this.morphAttributes){const h=this.morphAttributes[u],p=[];for(let f=0,m=h.length;f<m;f++){const g=h[f];p.push(g.toJSON(e.data))}p.length>0&&(r[u]=p,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const 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 t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const h in r){const p=r[h];this.setAttribute(h,p.clone(t))}const a=e.morphAttributes;for(const h in a){const p=[],f=a[h];for(let m=0,g=f.length;m<g;m++)p.push(f[m].clone(t));this.morphAttributes[h]=p}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let h=0,p=l.length;h<p;h++){const f=l[h];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ZS=new Qt,ul=new ad,Bf=new Xi,JS=new se,zf=new se,Pf=new se,Ff=new se,Xy=new se,Uf=new se,QS=new se,jf=new se;class Cs extends wn{constructor(e=new rn,t=new du){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(a&&o){Uf.set(0,0,0);for(let u=0,h=a.length;u<h;u++){const p=o[u],f=a[u];p!==0&&(Xy.fromBufferAttribute(f,e),l?Uf.addScaledVector(Xy,p):Uf.addScaledVector(Xy.sub(t),p))}t.add(Uf)}return t}raycast(e,t){const i=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Bf.copy(i.boundingSphere),Bf.applyMatrix4(a),ul.copy(e.ray).recast(e.near),!(Bf.containsPoint(ul.origin)===!1&&(ul.intersectSphere(Bf,JS)===null||ul.origin.distanceToSquared(JS)>(e.far-e.near)**2))&&(ZS.copy(a).invert(),ul.copy(e.ray).applyMatrix4(ZS),!(i.boundingBox!==null&&ul.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,ul)))}_computeIntersections(e,t,i){let r;const a=this.geometry,l=this.material,o=a.index,u=a.attributes.position,h=a.attributes.uv,p=a.attributes.uv1,f=a.attributes.normal,m=a.groups,g=a.drawRange;if(o!==null)if(Array.isArray(l))for(let _=0,w=m.length;_<w;_++){const v=m[_],x=l[v.materialIndex],S=Math.max(v.start,g.start),b=Math.min(o.count,Math.min(v.start+v.count,g.start+g.count));for(let C=S,O=b;C<O;C+=3){const M=o.getX(C),D=o.getX(C+1),N=o.getX(C+2);r=Hf(this,x,e,i,h,p,f,M,D,N),r&&(r.faceIndex=Math.floor(C/3),r.face.materialIndex=v.materialIndex,t.push(r))}}else{const _=Math.max(0,g.start),w=Math.min(o.count,g.start+g.count);for(let v=_,x=w;v<x;v+=3){const S=o.getX(v),b=o.getX(v+1),C=o.getX(v+2);r=Hf(this,l,e,i,h,p,f,S,b,C),r&&(r.faceIndex=Math.floor(v/3),t.push(r))}}else if(u!==void 0)if(Array.isArray(l))for(let _=0,w=m.length;_<w;_++){const v=m[_],x=l[v.materialIndex],S=Math.max(v.start,g.start),b=Math.min(u.count,Math.min(v.start+v.count,g.start+g.count));for(let C=S,O=b;C<O;C+=3){const M=C,D=C+1,N=C+2;r=Hf(this,x,e,i,h,p,f,M,D,N),r&&(r.faceIndex=Math.floor(C/3),r.face.materialIndex=v.materialIndex,t.push(r))}}else{const _=Math.max(0,g.start),w=Math.min(u.count,g.start+g.count);for(let v=_,x=w;v<x;v+=3){const S=v,b=v+1,C=v+2;r=Hf(this,l,e,i,h,p,f,S,b,C),r&&(r.faceIndex=Math.floor(v/3),t.push(r))}}}}function hD(n,e,t,i,r,a,l,o){let u;if(e.side===VE?u=i.intersectTriangle(l,a,r,!0,o):u=i.intersectTriangle(r,a,l,e.side===t0,o),u===null)return null;jf.copy(o),jf.applyMatrix4(n.matrixWorld);const h=t.ray.origin.distanceTo(jf);return h<t.near||h>t.far?null:{distance:h,point:jf.clone(),object:n}}function Hf(n,e,t,i,r,a,l,o,u,h){n.getVertexPosition(o,zf),n.getVertexPosition(u,Pf),n.getVertexPosition(h,Ff);const p=hD(n,e,t,i,zf,Pf,Ff,QS);if(p){const f=new se;Or.getBarycoord(QS,zf,Pf,Ff,f),r&&(p.uv=Or.getInterpolatedAttribute(r,o,u,h,f,new Ze)),a&&(p.uv1=Or.getInterpolatedAttribute(a,o,u,h,f,new Ze)),l&&(p.normal=Or.getInterpolatedAttribute(l,o,u,h,f,new se),p.normal.dot(i.direction)>0&&p.normal.multiplyScalar(-1));const m={a:o,b:u,c:h,normal:new se,materialIndex:0};Or.getNormal(zf,Pf,Ff,m.normal),p.face=m,p.barycoord=f}return p}class Kn extends rn{constructor(e=1,t=1,i=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:a,depthSegments:l};const o=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],h=[],p=[],f=[];let m=0,g=0;_("z","y","x",-1,-1,i,t,e,l,a,0),_("z","y","x",1,-1,i,t,-e,l,a,1),_("x","z","y",1,1,e,i,t,r,l,2),_("x","z","y",1,-1,e,i,-t,r,l,3),_("x","y","z",1,-1,e,t,i,r,a,4),_("x","y","z",-1,-1,e,t,-i,r,a,5),this.setIndex(u),this.setAttribute("position",new yt(h,3)),this.setAttribute("normal",new yt(p,3)),this.setAttribute("uv",new yt(f,2));function _(w,v,x,S,b,C,O,M,D,N,L){const j=C/D,K=O/N,Y=C/2,H=O/2,Q=M/2,te=D+1,$=N+1;let J=0,re=0;const F=new se;for(let B=0;B<$;B++){const U=B*K-H;for(let X=0;X<te;X++){const V=X*j-Y;F[w]=V*S,F[v]=U*b,F[x]=Q,h.push(F.x,F.y,F.z),F[w]=0,F[v]=0,F[x]=M>0?1:-1,p.push(F.x,F.y,F.z),f.push(X/D),f.push(1-B/N),J+=1}}for(let B=0;B<N;B++)for(let U=0;U<D;U++){const X=m+U+te*B,V=m+U+te*(B+1),_e=m+(U+1)+te*(B+1),Ee=m+(U+1)+te*B;u.push(X,V,Ee),u.push(V,_e,Ee),re+=6}o.addGroup(g,re,L),g+=re,m+=J}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Kn(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function fm(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(Nt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function dD(n){const e={};for(let t=0;t<n.length;t++){const i=fm(n[t]);for(const r in i)e[r]=i[r]}return e}function fD(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function eK(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rr.workingColorSpace}const tK={clone:fm,merge:dD};var pD=`void main() {
|
|
15
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
16
|
-
}`,mD=`void main() {
|
|
17
|
-
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
18
|
-
}`;class Y0 extends lr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=pD,this.fragmentShader=mD,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=fm(e.uniforms),this.uniformsGroups=fD(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const l=this.uniforms[r].value;l&&l.isTexture?t.uniforms[r]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[r]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[r]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[r]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[r]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[r]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[r]={type:"m4",value:l.toArray()}:t.uniforms[r]={value:l}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class X0 extends wn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Qt,this.projectionMatrix=new Qt,this.projectionMatrixInverse=new Qt,this.coordinateSystem=Ys,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ro=new se,ew=new Ze,tw=new Ze;class Qr extends X0{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Yh*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Cl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Yh*2*Math.atan(Math.tan(Cl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Ro.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ro.x,Ro.y).multiplyScalar(-e/Ro.z),Ro.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ro.x,Ro.y).multiplyScalar(-e/Ro.z)}getViewSize(e,t){return this.getViewBounds(e,ew,tw),t.subVectors(tw,ew)}setViewOffset(e,t,i,r,a,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Cl*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,a=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const u=l.fullWidth,h=l.fullHeight;a+=l.offsetX*r/u,t-=l.offsetY*i/h,r*=l.width/u,i*=l.height/h}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ic=-90,Lc=1;class gD extends wn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Qr(Ic,Lc,e,t);r.layers=this.layers,this.add(r);const a=new Qr(Ic,Lc,e,t);a.layers=this.layers,this.add(a);const l=new Qr(Ic,Lc,e,t);l.layers=this.layers,this.add(l);const o=new Qr(Ic,Lc,e,t);o.layers=this.layers,this.add(o);const u=new Qr(Ic,Lc,e,t);u.layers=this.layers,this.add(u);const h=new Qr(Ic,Lc,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,a,l,o,u]=t;for(const h of t)this.remove(h);if(e===Ys)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),l.up.set(0,0,1),l.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===Kh)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),l.up.set(0,0,-1),l.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,l,o,u,h,p]=this.children,f=e.getRenderTarget(),m=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;const w=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,a),e.setRenderTarget(i,1,r),e.render(t,l),e.setRenderTarget(i,2,r),e.render(t,o),e.setRenderTarget(i,3,r),e.render(t,u),e.setRenderTarget(i,4,r),e.render(t,h),i.texture.generateMipmaps=w,e.setRenderTarget(i,5,r),e.render(t,p),e.setRenderTarget(f,m,g),e.xr.enabled=_,i.texture.needsPMREMUpdate=!0}}class Z0 extends vi{constructor(e=[],t=um,i,r,a,l,o,u,h,p){super(e,t,i,r,a,l,o,u,h,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class nK extends K0{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Z0(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
19
|
-
|
|
20
|
-
varying vec3 vWorldDirection;
|
|
21
|
-
|
|
22
|
-
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
23
|
-
|
|
24
|
-
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
void main() {
|
|
29
|
-
|
|
30
|
-
vWorldDirection = transformDirection( position, modelMatrix );
|
|
31
|
-
|
|
32
|
-
#include <begin_vertex>
|
|
33
|
-
#include <project_vertex>
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
`,fragmentShader:`
|
|
37
|
-
|
|
38
|
-
uniform sampler2D tEquirect;
|
|
39
|
-
|
|
40
|
-
varying vec3 vWorldDirection;
|
|
41
|
-
|
|
42
|
-
#include <common>
|
|
43
|
-
|
|
44
|
-
void main() {
|
|
45
|
-
|
|
46
|
-
vec3 direction = normalize( vWorldDirection );
|
|
47
|
-
|
|
48
|
-
vec2 sampleUV = equirectUv( direction );
|
|
49
|
-
|
|
50
|
-
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
`},r=new Kn(5,5,5),a=new Y0({name:"CubemapFromEquirect",uniforms:fm(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:VE,blending:b3});a.uniforms.tEquirect.value=t;const l=new Cs(r,a),o=t.minFilter;return t.minFilter===hm&&(t.minFilter=ts),new gD(1,10,this).update(e,l),t.minFilter=o,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,i=!0,r=!0){const a=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,i,r);e.setRenderTarget(a)}}class Dh extends wn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yD={type:"move"};class iK{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Dh,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 Dh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Dh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,a=null,l=null;const o=this._targetRay,u=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){l=!0;for(const w of e.hand.values()){const v=t.getJointPose(w,i),x=this._getHandJoint(h,w);v!==null&&(x.matrix.fromArray(v.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=v.radius),x.visible=v!==null}const p=h.joints["index-finger-tip"],f=h.joints["thumb-tip"],m=p.position.distanceTo(f.position),g=.02,_=.005;h.inputState.pinching&&m>g+_?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&m<=g-_&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));o!==null&&(r=t.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(yD)))}return o!==null&&(o.visible=r!==null),u!==null&&(u.visible=a!==null),h!==null&&(h.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Dh;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class J0{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ht(e),this.density=t}clone(){return new J0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Q0{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ht(e),this.near=t,this.far=i}clone(){return new Q0(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class _D extends wn{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 Zs,this.environmentIntensity=1,this.environmentRotation=new Zs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class eb{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Up,this.updateRanges=[],this.version=0,this.uuid=Dr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,a=this.stride;r<a;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Dr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,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=Dr()),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 nr=new se;class ru{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,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 t=0,i=this.data.count;t<i;t++)nr.fromBufferAttribute(this,t),nr.applyMatrix4(e),this.setXYZ(t,nr.x,nr.y,nr.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)nr.fromBufferAttribute(this,t),nr.applyNormalMatrix(e),this.setXYZ(t,nr.x,nr.y,nr.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)nr.fromBufferAttribute(this,t),nr.transformDirection(e),this.setXYZ(t,nr.x,nr.y,nr.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=sr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Yt(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Yt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Yt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Yt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Yt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=sr(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=sr(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=sr(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=sr(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array),r=Yt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Yt(t,this.array),i=Yt(i,this.array),r=Yt(r,this.array),a=Yt(a,this.array)),this.data.array[e+0]=t,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){zS("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[r+a])}return new ii(new this.array.constructor(t),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 ru(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){zS("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[r+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,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 e2 extends lr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ht(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 Bc;const yh=new se,zc=new se,Pc=new se,Fc=new Ze,_h=new Ze,t2=new Qt,qf=new se,bh=new se,Vf=new se,nw=new Ze,Zy=new Ze,iw=new Ze;class bD extends wn{constructor(e=new e2){if(super(),this.isSprite=!0,this.type="Sprite",Bc===void 0){Bc=new rn;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new eb(t,5);Bc.setIndex([0,1,2,0,2,3]),Bc.setAttribute("position",new ru(i,3,0,!1)),Bc.setAttribute("uv",new ru(i,2,3,!1))}this.geometry=Bc,this.material=e,this.center=new Ze(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Sn('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),zc.setFromMatrixScale(this.matrixWorld),t2.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Pc.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&zc.multiplyScalar(-Pc.z);const i=this.material.rotation;let r,a;i!==0&&(a=Math.cos(i),r=Math.sin(i));const l=this.center;Wf(qf.set(-.5,-.5,0),Pc,l,zc,r,a),Wf(bh.set(.5,-.5,0),Pc,l,zc,r,a),Wf(Vf.set(.5,.5,0),Pc,l,zc,r,a),nw.set(0,0),Zy.set(1,0),iw.set(1,1);let o=e.ray.intersectTriangle(qf,bh,Vf,!1,yh);if(o===null&&(Wf(bh.set(-.5,.5,0),Pc,l,zc,r,a),Zy.set(0,1),o=e.ray.intersectTriangle(qf,Vf,bh,!1,yh),o===null))return;const u=e.ray.origin.distanceTo(yh);u<e.near||u>e.far||t.push({distance:u,point:yh.clone(),uv:Or.getInterpolation(yh,qf,bh,Vf,nw,Zy,iw,new Ze),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Wf(n,e,t,i,r,a){Fc.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(_h.x=a*Fc.x-r*Fc.y,_h.y=r*Fc.x+a*Fc.y):_h.copy(Fc),n.copy(e),n.x+=_h.x,n.y+=_h.y,n.applyMatrix4(t2)}const $f=new se,rw=new se;class vD extends wn{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 t=e.levels;for(let i=0,r=t.length;i<r;i++){const a=t[i];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);const r=this.levels;let a;for(a=0;a<r.length&&!(t<r[a].distance);a++);return r.splice(a,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){const r=t.splice(i,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),e<a)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){$f.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo($f);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){$f.setFromMatrixPosition(e.matrixWorld),rw.setFromMatrixPosition(this.matrixWorld);const i=$f.distanceTo(rw)/e.zoom;t[0].object.visible=!0;let r,a;for(r=1,a=t.length;r<a;r++){let l=t[r].distance;if(t[r].object.visible&&(l-=l*t[r].hysteresis),i>=l)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<a;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,a=i.length;r<a;r++){const l=i[r];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}const sw=new se,aw=new is,ow=new is,xD=new se,lw=new Qt,Gf=new se,Jy=new Xi,cw=new Qt,Qy=new ad;class SD extends Cs{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=NS,this.bindMatrix=new Qt,this.bindMatrixInverse=new Qt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new or),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Gf),this.boundingBox.expandByPoint(Gf)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Xi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Gf),this.boundingSphere.expandByPoint(Gf)}copy(e,t){return super.copy(e,t),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,t){const i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Jy.copy(this.boundingSphere),Jy.applyMatrix4(r),e.ray.intersectsSphere(Jy)!==!1&&(cw.copy(r).invert(),Qy.copy(e.ray).applyMatrix4(cw),!(this.boundingBox!==null&&Qy.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Qy)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new is,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===NS?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===v3?this.bindMatrixInverse.copy(this.bindMatrix).invert():Nt("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;aw.fromBufferAttribute(r.attributes.skinIndex,e),ow.fromBufferAttribute(r.attributes.skinWeight,e),sw.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let a=0;a<4;a++){const l=ow.getComponent(a);if(l!==0){const o=aw.getComponent(a);lw.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),t.addScaledVector(xD.copy(sw).applyMatrix4(lw),l)}}return t.applyMatrix4(this.bindMatrixInverse)}}class n2 extends wn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Pa extends vi{constructor(e=null,t=1,i=1,r,a,l,o,u,h=Br,p=Br,f,m){super(null,l,o,u,h,p,r,a,f,m),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const uw=new Qt,wD=new Qt;class tb{constructor(e=[],t=[]){this.uuid=Dr(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){Nt("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 Qt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Qt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;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,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let a=0,l=e.length;a<l;a++){const o=e[a]?e[a].matrixWorld:wD;uw.multiplyMatrices(o,t[a]),uw.toArray(i,a*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new tb(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 t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Pa(t,e,e,Gh,iu);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const a=e.bones[i];let l=t[a];l===void 0&&(Nt("Skeleton: No bone found with UUID:",a),l=new n2),this.bones.push(l),this.boneInverses.push(new Qt().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 t=this.bones,i=this.boneInverses;for(let r=0,a=t.length;r<a;r++){const l=t[r];e.bones.push(l.uuid);const o=i[r];e.boneInverses.push(o.toArray())}return e}}class Xh extends ii{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Uc=new Qt,hw=new Qt,Kf=[],dw=new or,CD=new Qt,vh=new Cs,xh=new Xi;class ED extends Cs{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Xh(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,CD)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new or),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Uc),dw.copy(e.boundingBox).applyMatrix4(Uc),this.boundingBox.union(dw)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Xi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Uc),xh.copy(e.boundingSphere).applyMatrix4(Uc),this.boundingSphere.union(xh)}copy(e,t){return super.copy(e,t),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,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,a=i.length+1,l=e*a+1;for(let o=0;o<i.length;o++)i[o]=r[l+o]}raycast(e,t){const i=this.matrixWorld,r=this.count;if(vh.geometry=this.geometry,vh.material=this.material,vh.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),xh.copy(this.boundingSphere),xh.applyMatrix4(i),e.ray.intersectsSphere(xh)!==!1))for(let a=0;a<r;a++){this.getMatrixAt(a,Uc),hw.multiplyMatrices(i,Uc),vh.matrixWorld=hw,vh.raycast(e,Kf);for(let l=0,o=Kf.length;l<o;l++){const u=Kf[l];u.instanceId=a,u.object=this,t.push(u)}Kf.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Xh(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new Pa(new Float32Array(r*this.count),r,this.count,WE,iu));const a=this.morphTexture.source.data.data;let l=0;for(let h=0;h<i.length;h++)l+=i[h];const o=this.geometry.morphTargetsRelative?1:1-l,u=r*e;a[u]=o,a.set(i,u+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const e_=new se,AD=new se,kD=new Js;class jc{constructor(e=new se(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=e_.subVectors(i,t).cross(AD.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(e_),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||kD.getNormalMatrix(e),r=this.coplanarPoint(e_).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 hl=new Xi,TD=new Ze(.5,.5),Yf=new se;class nb{constructor(e=new jc,t=new jc,i=new jc,r=new jc,a=new jc,l=new jc){this.planes=[e,t,i,r,a,l]}set(e,t,i,r,a,l){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(a),o[5].copy(l),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ys,i=!1){const r=this.planes,a=e.elements,l=a[0],o=a[1],u=a[2],h=a[3],p=a[4],f=a[5],m=a[6],g=a[7],_=a[8],w=a[9],v=a[10],x=a[11],S=a[12],b=a[13],C=a[14],O=a[15];if(r[0].setComponents(h-l,g-p,x-_,O-S).normalize(),r[1].setComponents(h+l,g+p,x+_,O+S).normalize(),r[2].setComponents(h+o,g+f,x+w,O+b).normalize(),r[3].setComponents(h-o,g-f,x-w,O-b).normalize(),i)r[4].setComponents(u,m,v,C).normalize(),r[5].setComponents(h-u,g-m,x-v,O-C).normalize();else if(r[4].setComponents(h-u,g-m,x-v,O-C).normalize(),t===Ys)r[5].setComponents(h+u,g+m,x+v,O+C).normalize();else if(t===Kh)r[5].setComponents(u,m,v,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),hl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),hl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(hl)}intersectsSprite(e){hl.center.set(0,0,0);const t=TD.distanceTo(e.center);return hl.radius=.7071067811865476+t,hl.applyMatrix4(e.matrixWorld),this.intersectsSphere(hl)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Yf.x=r.normal.x>0?e.max.x:e.min.x,Yf.y=r.normal.y>0?e.max.y:e.min.y,Yf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Yf)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Us=new Qt,js=new nb;class ib{constructor(){this.coordinateSystem=Ys}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(Us.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),js.setFromProjectionMatrix(Us,r.coordinateSystem,r.reversedDepth),js.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(Us.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),js.setFromProjectionMatrix(Us,r.coordinateSystem,r.reversedDepth),js.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(Us.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),js.setFromProjectionMatrix(Us,r.coordinateSystem,r.reversedDepth),js.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(Us.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),js.setFromProjectionMatrix(Us,r.coordinateSystem,r.reversedDepth),js.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(Us.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),js.setFromProjectionMatrix(Us,r.coordinateSystem,r.reversedDepth),js.containsPoint(e))return!0}return!1}clone(){return new ib}}function t_(n,e){return n-e}function MD(n,e){return n.z-e.z}function RD(n,e){return e.z-n.z}class OD{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,r){const a=this.pool,l=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];l.push(o),this.index++,o.start=e,o.count=t,o.z=i,o.index=r}reset(){this.list.length=0,this.index=0}}const gr=new Qt,ND=new Ht(1,1,1),fw=new nb,DD=new ib,Xf=new or,dl=new Xi,Sh=new se,pw=new se,ID=new se,n_=new OD,Ki=new Cs,Zf=[];function LD(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let a=0;a<r;a++)for(let l=0;l<i;l++)e.setComponent(a+t,l,n.getComponent(a,l))}else e.array.set(n.array,t*i);e.needsUpdate=!0}function fl(n,e){if(n.constructor!==e.constructor){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)e[i]=n[i]}else{const t=Math.min(n.length,e.length);e.set(new n.constructor(n.buffer,0,t))}}class BD extends Cs{constructor(e,t,i=t*2,r){super(new rn,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=t,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 t=new Float32Array(e*e*4),i=new Pa(t,e,e,Gh,iu);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),i=new Pa(t,e,e,$E,dm);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),i=new Pa(t,e,e,Gh,iu);i.colorSpace=Rr.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const t=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const l=e.getAttribute(a),{array:o,itemSize:u,normalized:h}=l,p=new o.constructor(i*u),f=new ii(p,u,h);t.setAttribute(a,f)}if(e.getIndex()!==null){const a=i>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new ii(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.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=t.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 t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[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 or);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const a=t[i].geometryIndex;this.getMatrixAt(i,gr),this.getBoundingBoxAt(a,Xf).applyMatrix4(gr),e.union(Xf)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Xi);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const a=t[i].geometryIndex;this.getMatrixAt(i,gr),this.getBoundingSphereAt(a,dl).applyMatrix4(gr),e.union(dl)}}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(t_),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const a=this._matricesTexture;gr.identity().toArray(a.image.data,r*16),a.needsUpdate=!0;const l=this._colorsTexture;return l&&(ND.toArray(l.image.data,r*4),l.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-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=t===-1?e.getAttribute("position").count:t;const l=e.getIndex();if(l!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?l.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 u;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(t_),u=this._availableGeometryIds.shift(),a[u]=r):(u=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(u,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,u}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,a=i.getIndex(),l=t.getIndex(),o=this._geometryInfo[e];if(r&&l.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const u=o.vertexStart,h=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const p in i.attributes){const f=t.getAttribute(p),m=i.getAttribute(p);LD(f,m,u);const g=f.itemSize;for(let _=f.count,w=h;_<w;_++){const v=u+_;for(let x=0;x<g;x++)m.setComponent(v,x,0)}m.needsUpdate=!0,m.addUpdateRange(u*g,h*g)}if(r){const p=o.indexStart,f=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(let m=0;m<l.count;m++)a.setX(p+m,u+l.getX(m));for(let m=l.count,g=f;m<g;m++)a.setX(p+m,u);a.needsUpdate=!0,a.addUpdateRange(p,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,t.boundingBox!==null&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,t.boundingSphere!==null&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[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 t[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,t=0;const i=this._geometryInfo,r=i.map((l,o)=>o).sort((l,o)=>i[l].vertexStart-i[o].vertexStart),a=this.geometry;for(let l=0,o=i.length;l<o;l++){const u=r[l],h=i[u];if(h.active!==!1){if(a.index!==null){if(h.indexStart!==t){const{indexStart:p,vertexStart:f,reservedIndexCount:m}=h,g=a.index,_=g.array,w=e-f;for(let v=p;v<p+m;v++)_[v]=_[v]+w;g.array.copyWithin(t,p,p+m),g.addUpdateRange(t,m),g.needsUpdate=!0,h.indexStart=t}t+=h.reservedIndexCount}if(h.vertexStart!==e){const{vertexStart:p,reservedVertexCount:f}=h,m=a.attributes;for(const g in m){const _=m[g],{array:w,itemSize:v}=_;w.copyWithin(e*v,p*v,(p+f)*v),_.addUpdateRange(e*v,f*v),_.needsUpdate=!0}h.vertexStart=e}e+=h.reservedVertexCount,h.start=a.index?h.indexStart:h.vertexStart,this._nextIndexStart=a.index?h.indexStart+h.reservedIndexCount:0,this._nextVertexStart=h.vertexStart+h.reservedVertexCount}}return this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const a=new or,l=i.index,o=i.attributes.position;for(let u=r.start,h=r.start+r.count;u<h;u++){let p=u;l&&(p=l.getX(p)),a.expandByPoint(Sh.fromBufferAttribute(o,p))}r.boundingBox=a}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const a=new Xi;this.getBoundingBoxAt(e,Xf),Xf.getCenter(a.center);const l=i.index,o=i.attributes.position;let u=0;for(let h=r.start,p=r.start+r.count;h<p;h++){let f=h;l&&(f=l.getX(f)),Sh.fromBufferAttribute(o,f),u=Math.max(u,a.center.distanceToSquared(Sh))}a.radius=Math.sqrt(u),r.boundingSphere=a}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const i=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),i.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){const t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(t_);t[t.length-1]===i.length-1;)i.pop(),t.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);fl(this._multiDrawCounts,r),fl(this._multiDrawStarts,a),this._multiDrawCounts=r,this._multiDrawStarts=a,this._maxInstanceCount=e;const l=this._indirectTexture,o=this._matricesTexture,u=this._colorsTexture;l.dispose(),this._initIndirectTexture(),fl(l.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),fl(o.image.data,this._matricesTexture.image.data),u&&(u.dispose(),this._initColorsTexture(),fl(u.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){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 ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(u=>u.indexStart+u.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new rn,this._initializeGeometry(a));const l=this.geometry;a.index&&fl(a.index.array,l.index.array);for(const o in a.attributes)fl(a.attributes[o].array,l.attributes[o].array)}raycast(e,t){const i=this._instanceInfo,r=this._geometryInfo,a=this.matrixWorld,l=this.geometry;Ki.material=this.material,Ki.geometry.index=l.index,Ki.geometry.attributes=l.attributes,Ki.geometry.boundingBox===null&&(Ki.geometry.boundingBox=new or),Ki.geometry.boundingSphere===null&&(Ki.geometry.boundingSphere=new Xi);for(let o=0,u=i.length;o<u;o++){if(!i[o].visible||!i[o].active)continue;const h=i[o].geometryIndex,p=r[h];Ki.geometry.setDrawRange(p.start,p.count),this.getMatrixAt(o,Ki.matrixWorld).premultiply(a),this.getBoundingBoxAt(h,Ki.geometry.boundingBox),this.getBoundingSphereAt(h,Ki.geometry.boundingSphere),Ki.raycast(e,Zf);for(let f=0,m=Zf.length;f<m;f++){const g=Zf[f];g.object=this,g.batchId=o,t.push(g)}Zf.length=0}Ki.material=null,Ki.geometry.index=null,Ki.geometry.attributes={},Ki.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(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),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,t,i,r,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=r.getIndex(),o=l===null?1:l.array.BYTES_PER_ELEMENT,u=this._instanceInfo,h=this._multiDrawStarts,p=this._multiDrawCounts,f=this._geometryInfo,m=this.perObjectFrustumCulled,g=this._indirectTexture,_=g.image.data,w=i.isArrayCamera?DD:fw;m&&!i.isArrayCamera&&(gr.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),fw.setFromProjectionMatrix(gr,i.coordinateSystem,i.reversedDepth));let v=0;if(this.sortObjects){gr.copy(this.matrixWorld).invert(),Sh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(gr),pw.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(gr);for(let b=0,C=u.length;b<C;b++)if(u[b].visible&&u[b].active){const O=u[b].geometryIndex;this.getMatrixAt(b,gr),this.getBoundingSphereAt(O,dl).applyMatrix4(gr);let M=!1;if(m&&(M=!w.intersectsSphere(dl,i)),!M){const D=f[O],N=ID.subVectors(dl.center,Sh).dot(pw);n_.push(D.start,D.count,N,b)}}const x=n_.list,S=this.customSort;S===null?x.sort(a.transparent?RD:MD):S.call(this,x,i);for(let b=0,C=x.length;b<C;b++){const O=x[b];h[v]=O.start*o,p[v]=O.count,_[v]=O.index,v++}n_.reset()}else for(let x=0,S=u.length;x<S;x++)if(u[x].visible&&u[x].active){const b=u[x].geometryIndex;let C=!1;if(m&&(this.getMatrixAt(x,gr),this.getBoundingSphereAt(b,dl).applyMatrix4(gr),C=!w.intersectsSphere(dl,i)),!C){const O=f[b];h[v]=O.start*o,p[v]=O.count,_[v]=x,v++}}g.needsUpdate=!0,this._multiDrawCount=v,this._visibilityChanged=!1}onBeforeShadow(e,t,i,r,a,l){this.onBeforeRender(e,null,r,a,l)}}class cr extends lr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ht(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 Hp=new se,qp=new se,mw=new Qt,wh=new ad,Jf=new Xi,i_=new se,gw=new se;class El extends wn{constructor(e=new rn,t=new cr){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,a=t.count;r<a;r++)Hp.fromBufferAttribute(t,r-1),qp.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Hp.distanceTo(qp);e.setAttribute("lineDistance",new yt(i,1))}else Nt("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,a=e.params.Line.threshold,l=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Jf.copy(i.boundingSphere),Jf.applyMatrix4(r),Jf.radius+=a,e.ray.intersectsSphere(Jf)===!1)return;mw.copy(r).invert(),wh.copy(e.ray).applyMatrix4(mw);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),u=o*o,h=this.isLineSegments?2:1,p=i.index,m=i.attributes.position;if(p!==null){const g=Math.max(0,l.start),_=Math.min(p.count,l.start+l.count);for(let w=g,v=_-1;w<v;w+=h){const x=p.getX(w),S=p.getX(w+1),b=Qf(this,e,wh,u,x,S,w);b&&t.push(b)}if(this.isLineLoop){const w=p.getX(_-1),v=p.getX(g),x=Qf(this,e,wh,u,w,v,_-1);x&&t.push(x)}}else{const g=Math.max(0,l.start),_=Math.min(m.count,l.start+l.count);for(let w=g,v=_-1;w<v;w+=h){const x=Qf(this,e,wh,u,w,w+1,w);x&&t.push(x)}if(this.isLineLoop){const w=Qf(this,e,wh,u,_-1,g,_-1);w&&t.push(w)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function Qf(n,e,t,i,r,a,l){const o=n.geometry.attributes.position;if(Hp.fromBufferAttribute(o,r),qp.fromBufferAttribute(o,a),t.distanceSqToSegment(Hp,qp,i_,gw)>i)return;i_.applyMatrix4(n.matrixWorld);const h=e.ray.origin.distanceTo(i_);if(!(h<e.near||h>e.far))return{distance:h,point:gw.clone().applyMatrix4(n.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:n}}const yw=new se,_w=new se;class Ha extends El{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,a=t.count;r<a;r+=2)yw.fromBufferAttribute(t,r),_w.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+yw.distanceTo(_w);e.setAttribute("lineDistance",new yt(i,1))}else Nt("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class zD extends El{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class i2 extends lr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ht(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 bw=new Qt,a0=new ad,ep=new Xi,tp=new se;class PD extends wn{constructor(e=new rn,t=new i2){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,a=e.params.Points.threshold,l=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),ep.copy(i.boundingSphere),ep.applyMatrix4(r),ep.radius+=a,e.ray.intersectsSphere(ep)===!1)return;bw.copy(r).invert(),a0.copy(e.ray).applyMatrix4(bw);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),u=o*o,h=i.index,f=i.attributes.position;if(h!==null){const m=Math.max(0,l.start),g=Math.min(h.count,l.start+l.count);for(let _=m,w=g;_<w;_++){const v=h.getX(_);tp.fromBufferAttribute(f,v),vw(tp,v,u,r,e,t,this)}}else{const m=Math.max(0,l.start),g=Math.min(f.count,l.start+l.count);for(let _=m,w=g;_<w;_++)tp.fromBufferAttribute(f,_),vw(tp,_,u,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function vw(n,e,t,i,r,a,l){const o=a0.distanceSqToPoint(n);if(o<t){const u=new se;a0.closestPointToPoint(n,u),u.applyMatrix4(i);const h=r.ray.origin.distanceTo(u);if(h<r.near||h>r.far)return;a.push({distance:h,distanceToRay:Math.sqrt(o),point:u,index:e,face:null,faceIndex:null,barycoord:null,object:l})}}class FD extends vi{constructor(e,t,i,r,a=ts,l=ts,o,u,h){super(e,t,i,r,a,l,o,u,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const p=this;function f(){p.needsUpdate=!0,p._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),this._requestVideoFrameCallbackId=0),super.dispose()}}class rK extends FD{constructor(e,t,i,r,a,l,o,u){super({},e,t,i,r,a,l,o,u),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class sK extends vi{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Br,this.minFilter=Br,this.generateMipmaps=!1,this.needsUpdate=!0}}class rb extends vi{constructor(e,t,i,r,a,l,o,u,h,p,f,m){super(null,l,o,u,h,p,r,a,f,m),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class aK extends rb{constructor(e,t,i,r,a,l){super(e,t,i,a,l),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Ks,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class oK extends rb{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,um),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class lK extends vi{constructor(e,t,i,r,a,l,o,u,h){super(e,t,i,r,a,l,o,u,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class UD extends vi{constructor(e,t,i=dm,r,a,l,o=Br,u=Br,h,p=r0,f=1){if(p!==r0&&p!==F3)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:t,depth:f};super(m,r,a,l,o,u,p,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Sl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class cK extends UD{constructor(e,t=dm,i=um,r,a,l=Br,o=Br,u,h=r0){const p={width:e,height:e,depth:1},f=[p,p,p,p,p,p];super(e,e,t,i,r,a,l,o,u,h),this.image=f,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class uK extends vi{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class sb extends rn{constructor(e=1,t=1,i=4,r=8,a=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r,heightSegments:a},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),a=Math.max(1,Math.floor(a));const l=[],o=[],u=[],h=[],p=t/2,f=Math.PI/2*e,m=t,g=2*f+m,_=i*2+a,w=r+1,v=new se,x=new se;for(let S=0;S<=_;S++){let b=0,C=0,O=0,M=0;if(S<=i){const L=S/i,j=L*Math.PI/2;C=-p-e*Math.cos(j),O=e*Math.sin(j),M=-e*Math.cos(j),b=L*f}else if(S<=i+a){const L=(S-i)/a;C=-p+L*t,O=e,M=0,b=f+L*m}else{const L=(S-i-a)/i,j=L*Math.PI/2;C=p+e*Math.sin(j),O=e*Math.cos(j),M=e*Math.sin(j),b=f+m+L*f}const D=Math.max(0,Math.min(1,b/g));let N=0;S===0?N=.5/r:S===_&&(N=-.5/r);for(let L=0;L<=r;L++){const j=L/r,K=j*Math.PI*2,Y=Math.sin(K),H=Math.cos(K);x.x=-O*H,x.y=C,x.z=O*Y,o.push(x.x,x.y,x.z),v.set(-O*H,M,O*Y),v.normalize(),u.push(v.x,v.y,v.z),h.push(j+N,D)}if(S>0){const L=(S-1)*w;for(let j=0;j<r;j++){const K=L+j,Y=L+j+1,H=S*w+j,Q=S*w+j+1;l.push(K,Y,H),l.push(Y,Q,H)}}}this.setIndex(l),this.setAttribute("position",new yt(o,3)),this.setAttribute("normal",new yt(u,3)),this.setAttribute("uv",new yt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sb(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class ab extends rn{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const a=[],l=[],o=[],u=[],h=new se,p=new Ze;l.push(0,0,0),o.push(0,0,1),u.push(.5,.5);for(let f=0,m=3;f<=t;f++,m+=3){const g=i+f/t*r;h.x=e*Math.cos(g),h.y=e*Math.sin(g),l.push(h.x,h.y,h.z),o.push(0,0,1),p.x=(l[m]/e+1)/2,p.y=(l[m+1]/e+1)/2,u.push(p.x,p.y)}for(let f=1;f<=t;f++)a.push(f,f+1,0);this.setIndex(a),this.setAttribute("position",new yt(l,3)),this.setAttribute("normal",new yt(o,3)),this.setAttribute("uv",new yt(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ab(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class od extends rn{constructor(e=1,t=1,i=1,r=32,a=1,l=!1,o=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:a,openEnded:l,thetaStart:o,thetaLength:u};const h=this;r=Math.floor(r),a=Math.floor(a);const p=[],f=[],m=[],g=[];let _=0;const w=[],v=i/2;let x=0;S(),l===!1&&(e>0&&b(!0),t>0&&b(!1)),this.setIndex(p),this.setAttribute("position",new yt(f,3)),this.setAttribute("normal",new yt(m,3)),this.setAttribute("uv",new yt(g,2));function S(){const C=new se,O=new se;let M=0;const D=(t-e)/i;for(let N=0;N<=a;N++){const L=[],j=N/a,K=j*(t-e)+e;for(let Y=0;Y<=r;Y++){const H=Y/r,Q=H*u+o,te=Math.sin(Q),$=Math.cos(Q);O.x=K*te,O.y=-j*i+v,O.z=K*$,f.push(O.x,O.y,O.z),C.set(te,D,$).normalize(),m.push(C.x,C.y,C.z),g.push(H,1-j),L.push(_++)}w.push(L)}for(let N=0;N<r;N++)for(let L=0;L<a;L++){const j=w[L][N],K=w[L+1][N],Y=w[L+1][N+1],H=w[L][N+1];(e>0||L!==0)&&(p.push(j,K,H),M+=3),(t>0||L!==a-1)&&(p.push(K,Y,H),M+=3)}h.addGroup(x,M,0),x+=M}function b(C){const O=_,M=new Ze,D=new se;let N=0;const L=C===!0?e:t,j=C===!0?1:-1;for(let Y=1;Y<=r;Y++)f.push(0,v*j,0),m.push(0,j,0),g.push(.5,.5),_++;const K=_;for(let Y=0;Y<=r;Y++){const Q=Y/r*u+o,te=Math.cos(Q),$=Math.sin(Q);D.x=L*$,D.y=v*j,D.z=L*te,f.push(D.x,D.y,D.z),m.push(0,j,0),M.x=te*.5+.5,M.y=$*.5*j+.5,g.push(M.x,M.y),_++}for(let Y=0;Y<r;Y++){const H=O+Y,Q=K+Y;C===!0?p.push(Q,Q+1,H):p.push(Q+1,Q,H),N+=3}h.addGroup(x,N,C===!0?1:2),x+=N}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new od(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class pm extends od{constructor(e=1,t=1,i=32,r=1,a=!1,l=0,o=Math.PI*2){super(0,e,t,i,r,a,l,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:l,thetaLength:o}}static fromJSON(e){return new pm(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ml extends rn{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const a=[],l=[];o(r),h(i),p(),this.setAttribute("position",new yt(a,3)),this.setAttribute("normal",new yt(a.slice(),3)),this.setAttribute("uv",new yt(l,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(S){const b=new se,C=new se,O=new se;for(let M=0;M<t.length;M+=3)g(t[M+0],b),g(t[M+1],C),g(t[M+2],O),u(b,C,O,S)}function u(S,b,C,O){const M=O+1,D=[];for(let N=0;N<=M;N++){D[N]=[];const L=S.clone().lerp(C,N/M),j=b.clone().lerp(C,N/M),K=M-N;for(let Y=0;Y<=K;Y++)Y===0&&N===M?D[N][Y]=L:D[N][Y]=L.clone().lerp(j,Y/K)}for(let N=0;N<M;N++)for(let L=0;L<2*(M-N)-1;L++){const j=Math.floor(L/2);L%2===0?(m(D[N][j+1]),m(D[N+1][j]),m(D[N][j])):(m(D[N][j+1]),m(D[N+1][j+1]),m(D[N+1][j]))}}function h(S){const b=new se;for(let C=0;C<a.length;C+=3)b.x=a[C+0],b.y=a[C+1],b.z=a[C+2],b.normalize().multiplyScalar(S),a[C+0]=b.x,a[C+1]=b.y,a[C+2]=b.z}function p(){const S=new se;for(let b=0;b<a.length;b+=3){S.x=a[b+0],S.y=a[b+1],S.z=a[b+2];const C=v(S)/2/Math.PI+.5,O=x(S)/Math.PI+.5;l.push(C,1-O)}_(),f()}function f(){for(let S=0;S<l.length;S+=6){const b=l[S+0],C=l[S+2],O=l[S+4],M=Math.max(b,C,O),D=Math.min(b,C,O);M>.9&&D<.1&&(b<.2&&(l[S+0]+=1),C<.2&&(l[S+2]+=1),O<.2&&(l[S+4]+=1))}}function m(S){a.push(S.x,S.y,S.z)}function g(S,b){const C=S*3;b.x=e[C+0],b.y=e[C+1],b.z=e[C+2]}function _(){const S=new se,b=new se,C=new se,O=new se,M=new Ze,D=new Ze,N=new Ze;for(let L=0,j=0;L<a.length;L+=9,j+=6){S.set(a[L+0],a[L+1],a[L+2]),b.set(a[L+3],a[L+4],a[L+5]),C.set(a[L+6],a[L+7],a[L+8]),M.set(l[j+0],l[j+1]),D.set(l[j+2],l[j+3]),N.set(l[j+4],l[j+5]),O.copy(S).add(b).add(C).divideScalar(3);const K=v(O);w(M,j+0,S,K),w(D,j+2,b,K),w(N,j+4,C,K)}}function w(S,b,C,O){O<0&&S.x===1&&(l[b]=S.x-1),C.x===0&&C.z===0&&(l[b]=O/2/Math.PI+.5)}function v(S){return Math.atan2(S.z,-S.x)}function x(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ml(e.vertices,e.indices,e.radius,e.detail)}}class ob extends Ml{constructor(e=1,t=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],l=[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,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ob(e.radius,e.detail)}}const np=new se,ip=new se,r_=new se,rp=new Or;class Ih extends rn{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),a=Math.cos(Cl*t),l=e.getIndex(),o=e.getAttribute("position"),u=l?l.count:o.count,h=[0,0,0],p=["a","b","c"],f=new Array(3),m={},g=[];for(let _=0;_<u;_+=3){l?(h[0]=l.getX(_),h[1]=l.getX(_+1),h[2]=l.getX(_+2)):(h[0]=_,h[1]=_+1,h[2]=_+2);const{a:w,b:v,c:x}=rp;if(w.fromBufferAttribute(o,h[0]),v.fromBufferAttribute(o,h[1]),x.fromBufferAttribute(o,h[2]),rp.getNormal(r_),f[0]=`${Math.round(w.x*r)},${Math.round(w.y*r)},${Math.round(w.z*r)}`,f[1]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,f[2]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let S=0;S<3;S++){const b=(S+1)%3,C=f[S],O=f[b],M=rp[p[S]],D=rp[p[b]],N=`${C}_${O}`,L=`${O}_${C}`;L in m&&m[L]?(r_.dot(m[L].normal)<=a&&(g.push(M.x,M.y,M.z),g.push(D.x,D.y,D.z)),m[L]=null):N in m||(m[N]={index0:h[S],index1:h[b],normal:r_.clone()})}}for(const _ in m)if(m[_]){const{index0:w,index1:v}=m[_];np.fromBufferAttribute(o,w),ip.fromBufferAttribute(o,v),g.push(np.x,np.y,np.z),g.push(ip.x,ip.y,ip.z)}this.setAttribute("position",new yt(g,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Qs{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Nt("Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),a=0;t.push(0);for(let l=1;l<=e;l++)i=this.getPoint(l/e),a+=i.distanceTo(r),t.push(a),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let r=0;const a=i.length;let l;t?l=t:l=e*i[a-1];let o=0,u=a-1,h;for(;o<=u;)if(r=Math.floor(o+(u-o)/2),h=i[r]-l,h<0)o=r+1;else if(h>0)u=r-1;else{u=r;break}if(r=u,i[r]===l)return r/(a-1);const p=i[r],m=i[r+1]-p,g=(l-p)/m;return(r+g)/(a-1)}getTangent(e,t){let r=e-1e-4,a=e+1e-4;r<0&&(r=0),a>1&&(a=1);const l=this.getPoint(r),o=this.getPoint(a),u=t||(l.isVector2?new Ze:new se);return u.copy(o).sub(l).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new se,r=[],a=[],l=[],o=new se,u=new Qt;for(let g=0;g<=e;g++){const _=g/e;r[g]=this.getTangentAt(_,new se)}a[0]=new se,l[0]=new se;let h=Number.MAX_VALUE;const p=Math.abs(r[0].x),f=Math.abs(r[0].y),m=Math.abs(r[0].z);p<=h&&(h=p,i.set(1,0,0)),f<=h&&(h=f,i.set(0,1,0)),m<=h&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),a[0].crossVectors(r[0],o),l[0].crossVectors(r[0],a[0]);for(let g=1;g<=e;g++){if(a[g]=a[g-1].clone(),l[g]=l[g-1].clone(),o.crossVectors(r[g-1],r[g]),o.length()>Number.EPSILON){o.normalize();const _=Math.acos(It(r[g-1].dot(r[g]),-1,1));a[g].applyMatrix4(u.makeRotationAxis(o,_))}l[g].crossVectors(r[g],a[g])}if(t===!0){let g=Math.acos(It(a[0].dot(a[e]),-1,1));g/=e,r[0].dot(o.crossVectors(a[0],a[e]))>0&&(g=-g);for(let _=1;_<=e;_++)a[_].applyMatrix4(u.makeRotationAxis(r[_],g*_)),l[_].crossVectors(r[_],a[_])}return{tangents:r,normals:a,binormals:l}}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 lb extends Qs{constructor(e=0,t=0,i=1,r=1,a=0,l=Math.PI*2,o=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=a,this.aEndAngle=l,this.aClockwise=o,this.aRotation=u}getPoint(e,t=new Ze){const i=t,r=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const l=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(l?a=0:a=r),this.aClockwise===!0&&!l&&(a===r?a=-r:a=a-r);const o=this.aStartAngle+e*a;let u=this.aX+this.xRadius*Math.cos(o),h=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const p=Math.cos(this.aRotation),f=Math.sin(this.aRotation),m=u-this.aX,g=h-this.aY;u=m*p-g*f+this.aX,h=m*f+g*p+this.aY}return i.set(u,h)}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 jD extends lb{constructor(e,t,i,r,a,l){super(e,t,i,i,r,a,l),this.isArcCurve=!0,this.type="ArcCurve"}}function cb(){let n=0,e=0,t=0,i=0;function r(a,l,o,u){n=a,e=o,t=-3*a+3*l-2*o-u,i=2*a-2*l+o+u}return{initCatmullRom:function(a,l,o,u,h){r(l,o,h*(o-a),h*(u-l))},initNonuniformCatmullRom:function(a,l,o,u,h,p,f){let m=(l-a)/h-(o-a)/(h+p)+(o-l)/p,g=(o-l)/p-(u-l)/(p+f)+(u-o)/f;m*=p,g*=p,r(l,o,m,g)},calc:function(a){const l=a*a,o=l*a;return n+e*a+t*l+i*o}}}const sp=new se,s_=new cb,a_=new cb,o_=new cb;class HD extends Qs{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new se){const i=t,r=this.points,a=r.length,l=(a-(this.closed?0:1))*e;let o=Math.floor(l),u=l-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:u===0&&o===a-1&&(o=a-2,u=1);let h,p;this.closed||o>0?h=r[(o-1)%a]:(sp.subVectors(r[0],r[1]).add(r[0]),h=sp);const f=r[o%a],m=r[(o+1)%a];if(this.closed||o+2<a?p=r[(o+2)%a]:(sp.subVectors(r[a-1],r[a-2]).add(r[a-1]),p=sp),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let _=Math.pow(h.distanceToSquared(f),g),w=Math.pow(f.distanceToSquared(m),g),v=Math.pow(m.distanceToSquared(p),g);w<1e-4&&(w=1),_<1e-4&&(_=w),v<1e-4&&(v=w),s_.initNonuniformCatmullRom(h.x,f.x,m.x,p.x,_,w,v),a_.initNonuniformCatmullRom(h.y,f.y,m.y,p.y,_,w,v),o_.initNonuniformCatmullRom(h.z,f.z,m.z,p.z,_,w,v)}else this.curveType==="catmullrom"&&(s_.initCatmullRom(h.x,f.x,m.x,p.x,this.tension),a_.initCatmullRom(h.y,f.y,m.y,p.y,this.tension),o_.initCatmullRom(h.z,f.z,m.z,p.z,this.tension));return i.set(s_.calc(u),a_.calc(u),o_.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];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 t=0,i=this.points.length;t<i;t++){const r=this.points[t];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 t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new se().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function xw(n,e,t,i,r){const a=(i-e)*.5,l=(r-t)*.5,o=n*n,u=n*o;return(2*t-2*i+a+l)*u+(-3*t+3*i-2*a-l)*o+a*n+t}function qD(n,e){const t=1-n;return t*t*e}function VD(n,e){return 2*(1-n)*n*e}function WD(n,e){return n*n*e}function Ph(n,e,t,i){return qD(n,e)+VD(n,t)+WD(n,i)}function $D(n,e){const t=1-n;return t*t*t*e}function GD(n,e){const t=1-n;return 3*t*t*n*e}function KD(n,e){return 3*(1-n)*n*n*e}function YD(n,e){return n*n*n*e}function Fh(n,e,t,i,r){return $D(n,e)+GD(n,t)+KD(n,i)+YD(n,r)}class r2 extends Qs{constructor(e=new Ze,t=new Ze,i=new Ze,r=new Ze){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Ze){const i=t,r=this.v0,a=this.v1,l=this.v2,o=this.v3;return i.set(Fh(e,r.x,a.x,l.x,o.x),Fh(e,r.y,a.y,l.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 XD extends Qs{constructor(e=new se,t=new se,i=new se,r=new se){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new se){const i=t,r=this.v0,a=this.v1,l=this.v2,o=this.v3;return i.set(Fh(e,r.x,a.x,l.x,o.x),Fh(e,r.y,a.y,l.y,o.y),Fh(e,r.z,a.z,l.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 s2 extends Qs{constructor(e=new Ze,t=new Ze){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ze){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Ze){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){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 ZD extends Qs{constructor(e=new se,t=new se){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new se){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new se){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){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 a2 extends Qs{constructor(e=new Ze,t=new Ze,i=new Ze){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Ze){const i=t,r=this.v0,a=this.v1,l=this.v2;return i.set(Ph(e,r.x,a.x,l.x),Ph(e,r.y,a.y,l.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 o2 extends Qs{constructor(e=new se,t=new se,i=new se){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new se){const i=t,r=this.v0,a=this.v1,l=this.v2;return i.set(Ph(e,r.x,a.x,l.x),Ph(e,r.y,a.y,l.y),Ph(e,r.z,a.z,l.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 l2 extends Qs{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Ze){const i=t,r=this.points,a=(r.length-1)*e,l=Math.floor(a),o=a-l,u=r[l===0?l:l-1],h=r[l],p=r[l>r.length-2?r.length-1:l+1],f=r[l>r.length-3?r.length-1:l+2];return i.set(xw(o,u.x,h.x,p.x,f.x),xw(o,u.y,h.y,p.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Ze().fromArray(r))}return this}}var Vp=Object.freeze({__proto__:null,ArcCurve:jD,CatmullRomCurve3:HD,CubicBezierCurve:r2,CubicBezierCurve3:XD,EllipseCurve:lb,LineCurve:s2,LineCurve3:ZD,QuadraticBezierCurve:a2,QuadraticBezierCurve3:o2,SplineCurve:l2});class JD extends Qs{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Vp[i](t,e))}return this}getPoint(e,t){const i=e*this.getLength(),r=this.getCurveLengths();let a=0;for(;a<r.length;){if(r[a]>=i){const l=r[a]-i,o=this.curves[a],u=o.getLength(),h=u===0?0:1-l/u;return o.getPointAt(h,t)}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 t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,a=this.curves;r<a.length;r++){const l=a[r],o=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,u=l.getPoints(o);for(let h=0;h<u.length;h++){const p=u[h];i&&i.equals(p)||(t.push(p),i=p)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Vp[r.type]().fromJSON(r))}return this}}class o0 extends JD{constructor(e){super(),this.type="Path",this.currentPoint=new Ze,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new s2(this.currentPoint.clone(),new Ze(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const a=new a2(this.currentPoint.clone(),new Ze(e,t),new Ze(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,a,l){const o=new r2(this.currentPoint.clone(),new Ze(e,t),new Ze(i,r),new Ze(a,l));return this.curves.push(o),this.currentPoint.set(a,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new l2(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,a,l){const o=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+o,t+u,i,r,a,l),this}absarc(e,t,i,r,a,l){return this.absellipse(e,t,i,i,r,a,l),this}ellipse(e,t,i,r,a,l,o,u){const h=this.currentPoint.x,p=this.currentPoint.y;return this.absellipse(e+h,t+p,i,r,a,l,o,u),this}absellipse(e,t,i,r,a,l,o,u){const h=new lb(e,t,i,r,a,l,o,u);if(this.curves.length>0){const f=h.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(h);const p=h.getPoint(1);return this.currentPoint.copy(p),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 tu extends o0{constructor(e){super(e),this.uuid=Dr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new o0().fromJSON(r))}return this}}function QD(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let a=c2(n,0,r,t,!0);const l=[];if(!a||a.next===a.prev)return l;let o,u,h;if(i&&(a=rI(n,e,a,t)),n.length>80*t){o=n[0],u=n[1];let p=o,f=u;for(let m=t;m<r;m+=t){const g=n[m],_=n[m+1];g<o&&(o=g),_<u&&(u=_),g>p&&(p=g),_>f&&(f=_)}h=Math.max(p-o,f-u),h=h!==0?32767/h:0}return Zh(a,l,t,o,u,h,0),l}function c2(n,e,t,i,r){let a;if(r===mI(n,e,t,i)>0)for(let l=e;l<t;l+=i)a=Sw(l/i|0,n[l],n[l+1],a);else for(let l=t-i;l>=e;l-=i)a=Sw(l/i|0,n[l],n[l+1],a);return a&&su(a,a.next)&&(Qh(a),a=a.next),a}function Al(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(su(t,t.next)||ni(t.prev,t,t.next)===0)){if(Qh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Zh(n,e,t,i,r,a,l){if(!n)return;!l&&a&&cI(n,i,r,a);let o=n;for(;n.prev!==n.next;){const u=n.prev,h=n.next;if(a?tI(n,i,r,a):eI(n)){e.push(u.i,n.i,h.i),Qh(n),n=h.next,o=h.next;continue}if(n=h,n===o){l?l===1?(n=nI(Al(n),e),Zh(n,e,t,i,r,a,2)):l===2&&iI(n,e,t,i,r,a):Zh(Al(n),e,t,i,r,a,1);break}}}function eI(n){const e=n.prev,t=n,i=n.next;if(ni(e,t,i)>=0)return!1;const r=e.x,a=t.x,l=i.x,o=e.y,u=t.y,h=i.y,p=Math.min(r,a,l),f=Math.min(o,u,h),m=Math.max(r,a,l),g=Math.max(o,u,h);let _=i.next;for(;_!==e;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&Lh(r,o,a,u,l,h,_.x,_.y)&&ni(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function tI(n,e,t,i){const r=n.prev,a=n,l=n.next;if(ni(r,a,l)>=0)return!1;const o=r.x,u=a.x,h=l.x,p=r.y,f=a.y,m=l.y,g=Math.min(o,u,h),_=Math.min(p,f,m),w=Math.max(o,u,h),v=Math.max(p,f,m),x=l0(g,_,e,t,i),S=l0(w,v,e,t,i);let b=n.prevZ,C=n.nextZ;for(;b&&b.z>=x&&C&&C.z<=S;){if(b.x>=g&&b.x<=w&&b.y>=_&&b.y<=v&&b!==r&&b!==l&&Lh(o,p,u,f,h,m,b.x,b.y)&&ni(b.prev,b,b.next)>=0||(b=b.prevZ,C.x>=g&&C.x<=w&&C.y>=_&&C.y<=v&&C!==r&&C!==l&&Lh(o,p,u,f,h,m,C.x,C.y)&&ni(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;b&&b.z>=x;){if(b.x>=g&&b.x<=w&&b.y>=_&&b.y<=v&&b!==r&&b!==l&&Lh(o,p,u,f,h,m,b.x,b.y)&&ni(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=S;){if(C.x>=g&&C.x<=w&&C.y>=_&&C.y<=v&&C!==r&&C!==l&&Lh(o,p,u,f,h,m,C.x,C.y)&&ni(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function nI(n,e){let t=n;do{const i=t.prev,r=t.next.next;!su(i,r)&&h2(i,t,t.next,r)&&Jh(i,r)&&Jh(r,i)&&(e.push(i.i,t.i,r.i),Qh(t),Qh(t.next),t=n=r),t=t.next}while(t!==n);return Al(t)}function iI(n,e,t,i,r,a){let l=n;do{let o=l.next.next;for(;o!==l.prev;){if(l.i!==o.i&&dI(l,o)){let u=d2(l,o);l=Al(l,l.next),u=Al(u,u.next),Zh(l,e,t,i,r,a,0),Zh(u,e,t,i,r,a,0);return}o=o.next}l=l.next}while(l!==n)}function rI(n,e,t,i){const r=[];for(let a=0,l=e.length;a<l;a++){const o=e[a]*i,u=a<l-1?e[a+1]*i:n.length,h=c2(n,o,u,i,!1);h===h.next&&(h.steiner=!0),r.push(hI(h))}r.sort(sI);for(let a=0;a<r.length;a++)t=aI(r[a],t);return t}function sI(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const i=(n.next.y-n.y)/(n.next.x-n.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=i-r}return t}function aI(n,e){const t=oI(n,e);if(!t)return e;const i=d2(t,n);return Al(i,i.next),Al(t,t.next)}function oI(n,e){let t=e;const i=n.x,r=n.y;let a=-1/0,l;if(su(n,t))return t;do{if(su(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const f=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>a&&(a=f,l=t.x<t.next.x?t:t.next,f===i))return l}t=t.next}while(t!==e);if(!l)return null;const o=l,u=l.x,h=l.y;let p=1/0;t=l;do{if(i>=t.x&&t.x>=u&&i!==t.x&&u2(r<h?i:a,r,u,h,r<h?a:i,r,t.x,t.y)){const f=Math.abs(r-t.y)/(i-t.x);Jh(t,n)&&(f<p||f===p&&(t.x>l.x||t.x===l.x&&lI(l,t)))&&(l=t,p=f)}t=t.next}while(t!==o);return l}function lI(n,e){return ni(n.prev,n,e.prev)<0&&ni(e.next,n,n.next)<0}function cI(n,e,t,i){let r=n;do r.z===0&&(r.z=l0(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,uI(r)}function uI(n){let e,t=1;do{let i=n,r;n=null;let a=null;for(e=0;i;){e++;let l=i,o=0;for(let h=0;h<t&&(o++,l=l.nextZ,!!l);h++);let u=t;for(;o>0||u>0&&l;)o!==0&&(u===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,o--):(r=l,l=l.nextZ,u--),a?a.nextZ=r:n=r,r.prevZ=a,a=r;i=l}a.nextZ=null,t*=2}while(e>1);return n}function l0(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function hI(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function u2(n,e,t,i,r,a,l,o){return(r-l)*(e-o)>=(n-l)*(a-o)&&(n-l)*(i-o)>=(t-l)*(e-o)&&(t-l)*(a-o)>=(r-l)*(i-o)}function Lh(n,e,t,i,r,a,l,o){return!(n===l&&e===o)&&u2(n,e,t,i,r,a,l,o)}function dI(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!fI(n,e)&&(Jh(n,e)&&Jh(e,n)&&pI(n,e)&&(ni(n.prev,n,e.prev)||ni(n,e.prev,e))||su(n,e)&&ni(n.prev,n,n.next)>0&&ni(e.prev,e,e.next)>0)}function ni(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function su(n,e){return n.x===e.x&&n.y===e.y}function h2(n,e,t,i){const r=op(ni(n,e,t)),a=op(ni(n,e,i)),l=op(ni(t,i,n)),o=op(ni(t,i,e));return!!(r!==a&&l!==o||r===0&&ap(n,t,e)||a===0&&ap(n,i,e)||l===0&&ap(t,n,i)||o===0&&ap(t,e,i))}function ap(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function op(n){return n>0?1:n<0?-1:0}function fI(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&h2(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Jh(n,e){return ni(n.prev,n,n.next)<0?ni(n,e,n.next)>=0&&ni(n,n.prev,e)>=0:ni(n,e,n.prev)<0||ni(n,n.next,e)<0}function pI(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,a=(n.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&r<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function d2(n,e){const t=c0(n.i,n.x,n.y),i=c0(e.i,e.x,e.y),r=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,a.next=i,i.prev=a,i}function Sw(n,e,t,i){const r=c0(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Qh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function c0(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function mI(n,e,t,i){let r=0;for(let a=e,l=t-i;a<t;a+=i)r+=(n[l]-n[a])*(n[a+1]+n[l+1]),l=a;return r}class gI{static triangulate(e,t,i=2){return QD(e,t,i)}}class Xs{static area(e){const t=e.length;let i=0;for(let r=t-1,a=0;a<t;r=a++)i+=e[r].x*e[a].y-e[a].x*e[r].y;return i*.5}static isClockWise(e){return Xs.area(e)<0}static triangulateShape(e,t){const i=[],r=[],a=[];ww(e),Cw(i,e);let l=e.length;t.forEach(ww);for(let u=0;u<t.length;u++)r.push(l),l+=t[u].length,Cw(i,t[u]);const o=gI.triangulate(i,r);for(let u=0;u<o.length;u+=3)a.push(o.slice(u,u+3));return a}}function ww(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Cw(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class ub extends rn{constructor(e=new tu([new Ze(.5,.5),new Ze(-.5,.5),new Ze(-.5,-.5),new Ze(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],a=[];for(let o=0,u=e.length;o<u;o++){const h=e[o];l(h)}this.setAttribute("position",new yt(r,3)),this.setAttribute("uv",new yt(a,2)),this.computeVertexNormals();function l(o){const u=[],h=t.curveSegments!==void 0?t.curveSegments:12,p=t.steps!==void 0?t.steps:1,f=t.depth!==void 0?t.depth:1;let m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,_=t.bevelSize!==void 0?t.bevelSize:g-.1,w=t.bevelOffset!==void 0?t.bevelOffset:0,v=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,S=t.UVGenerator!==void 0?t.UVGenerator:yI;let b,C=!1,O,M,D,N;if(x){b=x.getSpacedPoints(p),C=!0,m=!1;const De=x.isCatmullRomCurve3?x.closed:!1;O=x.computeFrenetFrames(p,De),M=new se,D=new se,N=new se}m||(v=0,g=0,_=0,w=0);const L=o.extractPoints(h);let j=L.shape;const K=L.holes;if(!Xs.isClockWise(j)){j=j.reverse();for(let De=0,Pe=K.length;De<Pe;De++){const Fe=K[De];Xs.isClockWise(Fe)&&(K[De]=Fe.reverse())}}function H(De){const Fe=10000000000000001e-36;let je=De[0];for(let st=1;st<=De.length;st++){const Rt=st%De.length,bt=De[Rt],Lt=bt.x-je.x,sn=bt.y-je.y,jt=Lt*Lt+sn*sn,Pt=Math.max(Math.abs(bt.x),Math.abs(bt.y),Math.abs(je.x),Math.abs(je.y)),Cn=Fe*Pt*Pt;if(jt<=Cn){De.splice(Rt,1),st--;continue}je=bt}}H(j),K.forEach(H);const Q=K.length,te=j;for(let De=0;De<Q;De++){const Pe=K[De];j=j.concat(Pe)}function $(De,Pe,Fe){return Pe||Sn("ExtrudeGeometry: vec does not exist"),De.clone().addScaledVector(Pe,Fe)}const J=j.length;function re(De,Pe,Fe){let je,st,Rt;const bt=De.x-Pe.x,Lt=De.y-Pe.y,sn=Fe.x-De.x,jt=Fe.y-De.y,Pt=bt*bt+Lt*Lt,Cn=bt*jt-Lt*sn;if(Math.abs(Cn)>Number.EPSILON){const Ce=Math.sqrt(Pt),qe=Math.sqrt(sn*sn+jt*jt),ft=Pe.x-Lt/Ce,Ct=Pe.y+bt/Ce,Bt=Fe.x-jt/qe,Nn=Fe.y+sn/qe,Ft=((Bt-ft)*jt-(Nn-Ct)*sn)/(bt*jt-Lt*sn);je=ft+bt*Ft-De.x,st=Ct+Lt*Ft-De.y;const Pn=je*je+st*st;if(Pn<=2)return new Ze(je,st);Rt=Math.sqrt(Pn/2)}else{let Ce=!1;bt>Number.EPSILON?sn>Number.EPSILON&&(Ce=!0):bt<-Number.EPSILON?sn<-Number.EPSILON&&(Ce=!0):Math.sign(Lt)===Math.sign(jt)&&(Ce=!0),Ce?(je=-Lt,st=bt,Rt=Math.sqrt(Pt)):(je=bt,st=Lt,Rt=Math.sqrt(Pt/2))}return new Ze(je/Rt,st/Rt)}const F=[];for(let De=0,Pe=te.length,Fe=Pe-1,je=De+1;De<Pe;De++,Fe++,je++)Fe===Pe&&(Fe=0),je===Pe&&(je=0),F[De]=re(te[De],te[Fe],te[je]);const B=[];let U,X=F.concat();for(let De=0,Pe=Q;De<Pe;De++){const Fe=K[De];U=[];for(let je=0,st=Fe.length,Rt=st-1,bt=je+1;je<st;je++,Rt++,bt++)Rt===st&&(Rt=0),bt===st&&(bt=0),U[je]=re(Fe[je],Fe[Rt],Fe[bt]);B.push(U),X=X.concat(U)}let V;if(v===0)V=Xs.triangulateShape(te,K);else{const De=[],Pe=[];for(let Fe=0;Fe<v;Fe++){const je=Fe/v,st=g*Math.cos(je*Math.PI/2),Rt=_*Math.sin(je*Math.PI/2)+w;for(let bt=0,Lt=te.length;bt<Lt;bt++){const sn=$(te[bt],F[bt],Rt);Te(sn.x,sn.y,-st),je===0&&De.push(sn)}for(let bt=0,Lt=Q;bt<Lt;bt++){const sn=K[bt];U=B[bt];const jt=[];for(let Pt=0,Cn=sn.length;Pt<Cn;Pt++){const Ce=$(sn[Pt],U[Pt],Rt);Te(Ce.x,Ce.y,-st),je===0&&jt.push(Ce)}je===0&&Pe.push(jt)}}V=Xs.triangulateShape(De,Pe)}const _e=V.length,Ee=_+w;for(let De=0;De<J;De++){const Pe=m?$(j[De],X[De],Ee):j[De];C?(D.copy(O.normals[0]).multiplyScalar(Pe.x),M.copy(O.binormals[0]).multiplyScalar(Pe.y),N.copy(b[0]).add(D).add(M),Te(N.x,N.y,N.z)):Te(Pe.x,Pe.y,0)}for(let De=1;De<=p;De++)for(let Pe=0;Pe<J;Pe++){const Fe=m?$(j[Pe],X[Pe],Ee):j[Pe];C?(D.copy(O.normals[De]).multiplyScalar(Fe.x),M.copy(O.binormals[De]).multiplyScalar(Fe.y),N.copy(b[De]).add(D).add(M),Te(N.x,N.y,N.z)):Te(Fe.x,Fe.y,f/p*De)}for(let De=v-1;De>=0;De--){const Pe=De/v,Fe=g*Math.cos(Pe*Math.PI/2),je=_*Math.sin(Pe*Math.PI/2)+w;for(let st=0,Rt=te.length;st<Rt;st++){const bt=$(te[st],F[st],je);Te(bt.x,bt.y,f+Fe)}for(let st=0,Rt=K.length;st<Rt;st++){const bt=K[st];U=B[st];for(let Lt=0,sn=bt.length;Lt<sn;Lt++){const jt=$(bt[Lt],U[Lt],je);C?Te(jt.x,jt.y+b[p-1].y,b[p-1].x+Fe):Te(jt.x,jt.y,f+Fe)}}}Ie(),ae();function Ie(){const De=r.length/3;if(m){let Pe=0,Fe=J*Pe;for(let je=0;je<_e;je++){const st=V[je];ye(st[2]+Fe,st[1]+Fe,st[0]+Fe)}Pe=p+v*2,Fe=J*Pe;for(let je=0;je<_e;je++){const st=V[je];ye(st[0]+Fe,st[1]+Fe,st[2]+Fe)}}else{for(let Pe=0;Pe<_e;Pe++){const Fe=V[Pe];ye(Fe[2],Fe[1],Fe[0])}for(let Pe=0;Pe<_e;Pe++){const Fe=V[Pe];ye(Fe[0]+J*p,Fe[1]+J*p,Fe[2]+J*p)}}i.addGroup(De,r.length/3-De,0)}function ae(){const De=r.length/3;let Pe=0;ee(te,Pe),Pe+=te.length;for(let Fe=0,je=K.length;Fe<je;Fe++){const st=K[Fe];ee(st,Pe),Pe+=st.length}i.addGroup(De,r.length/3-De,1)}function ee(De,Pe){let Fe=De.length;for(;--Fe>=0;){const je=Fe;let st=Fe-1;st<0&&(st=De.length-1);for(let Rt=0,bt=p+v*2;Rt<bt;Rt++){const Lt=J*Rt,sn=J*(Rt+1),jt=Pe+je+Lt,Pt=Pe+st+Lt,Cn=Pe+st+sn,Ce=Pe+je+sn;Me(jt,Pt,Cn,Ce)}}}function Te(De,Pe,Fe){u.push(De),u.push(Pe),u.push(Fe)}function ye(De,Pe,Fe){we(De),we(Pe),we(Fe);const je=r.length/3,st=S.generateTopUV(i,r,je-3,je-2,je-1);it(st[0]),it(st[1]),it(st[2])}function Me(De,Pe,Fe,je){we(De),we(Pe),we(je),we(Pe),we(Fe),we(je);const st=r.length/3,Rt=S.generateSideWallUV(i,r,st-6,st-3,st-2,st-1);it(Rt[0]),it(Rt[1]),it(Rt[3]),it(Rt[1]),it(Rt[2]),it(Rt[3])}function we(De){r.push(u[De*3+0]),r.push(u[De*3+1]),r.push(u[De*3+2])}function it(De){a.push(De.x),a.push(De.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return _I(t,i,e)}static fromJSON(e,t){const i=[];for(let a=0,l=e.shapes.length;a<l;a++){const o=t[e.shapes[a]];i.push(o)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Vp[r.type]().fromJSON(r)),new ub(i,e.options)}}const yI={generateTopUV:function(n,e,t,i,r){const a=e[t*3],l=e[t*3+1],o=e[i*3],u=e[i*3+1],h=e[r*3],p=e[r*3+1];return[new Ze(a,l),new Ze(o,u),new Ze(h,p)]},generateSideWallUV:function(n,e,t,i,r,a){const l=e[t*3],o=e[t*3+1],u=e[t*3+2],h=e[i*3],p=e[i*3+1],f=e[i*3+2],m=e[r*3],g=e[r*3+1],_=e[r*3+2],w=e[a*3],v=e[a*3+1],x=e[a*3+2];return Math.abs(o-p)<Math.abs(l-h)?[new Ze(l,1-u),new Ze(h,1-f),new Ze(m,1-_),new Ze(w,1-x)]:[new Ze(o,1-u),new Ze(p,1-f),new Ze(g,1-_),new Ze(v,1-x)]}};function _I(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const a=n[i];t.shapes.push(a.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class hb extends Ml{constructor(e=1,t=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,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new hb(e.radius,e.detail)}}class db extends rn{constructor(e=[new Ze(0,-.5),new Ze(.5,0),new Ze(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=It(r,0,Math.PI*2);const a=[],l=[],o=[],u=[],h=[],p=1/t,f=new se,m=new Ze,g=new se,_=new se,w=new se;let v=0,x=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:v=e[S+1].x-e[S].x,x=e[S+1].y-e[S].y,g.x=x*1,g.y=-v,g.z=x*0,w.copy(g),g.normalize(),u.push(g.x,g.y,g.z);break;case e.length-1:u.push(w.x,w.y,w.z);break;default:v=e[S+1].x-e[S].x,x=e[S+1].y-e[S].y,g.x=x*1,g.y=-v,g.z=x*0,_.copy(g),g.x+=w.x,g.y+=w.y,g.z+=w.z,g.normalize(),u.push(g.x,g.y,g.z),w.copy(_)}for(let S=0;S<=t;S++){const b=i+S*p*r,C=Math.sin(b),O=Math.cos(b);for(let M=0;M<=e.length-1;M++){f.x=e[M].x*C,f.y=e[M].y,f.z=e[M].x*O,l.push(f.x,f.y,f.z),m.x=S/t,m.y=M/(e.length-1),o.push(m.x,m.y);const D=u[3*M+0]*C,N=u[3*M+1],L=u[3*M+0]*O;h.push(D,N,L)}}for(let S=0;S<t;S++)for(let b=0;b<e.length-1;b++){const C=b+S*e.length,O=C,M=C+e.length,D=C+e.length+1,N=C+1;a.push(O,M,N),a.push(D,N,M)}this.setIndex(a),this.setAttribute("position",new yt(l,3)),this.setAttribute("uv",new yt(o,2)),this.setAttribute("normal",new yt(h,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new db(e.points,e.segments,e.phiStart,e.phiLength)}}class mm extends Ml{constructor(e=1,t=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,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new mm(e.radius,e.detail)}}class fb extends rn{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const a=e/2,l=t/2,o=Math.floor(i),u=Math.floor(r),h=o+1,p=u+1,f=e/o,m=t/u,g=[],_=[],w=[],v=[];for(let x=0;x<p;x++){const S=x*m-l;for(let b=0;b<h;b++){const C=b*f-a;_.push(C,-S,0),w.push(0,0,1),v.push(b/o),v.push(1-x/u)}}for(let x=0;x<u;x++)for(let S=0;S<o;S++){const b=S+h*x,C=S+h*(x+1),O=S+1+h*(x+1),M=S+1+h*x;g.push(b,C,M),g.push(C,O,M)}this.setIndex(g),this.setAttribute("position",new yt(_,3)),this.setAttribute("normal",new yt(w,3)),this.setAttribute("uv",new yt(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fb(e.width,e.height,e.widthSegments,e.heightSegments)}}class pb extends rn{constructor(e=.5,t=1,i=32,r=1,a=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:l},i=Math.max(3,i),r=Math.max(1,r);const o=[],u=[],h=[],p=[];let f=e;const m=(t-e)/r,g=new se,_=new Ze;for(let w=0;w<=r;w++){for(let v=0;v<=i;v++){const x=a+v/i*l;g.x=f*Math.cos(x),g.y=f*Math.sin(x),u.push(g.x,g.y,g.z),h.push(0,0,1),_.x=(g.x/t+1)/2,_.y=(g.y/t+1)/2,p.push(_.x,_.y)}f+=m}for(let w=0;w<r;w++){const v=w*(i+1);for(let x=0;x<i;x++){const S=x+v,b=S,C=S+i+1,O=S+i+2,M=S+1;o.push(b,C,M),o.push(C,O,M)}}this.setIndex(o),this.setAttribute("position",new yt(u,3)),this.setAttribute("normal",new yt(h,3)),this.setAttribute("uv",new yt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pb(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class mb extends rn{constructor(e=new tu([new Ze(0,.5),new Ze(-.5,-.5),new Ze(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],a=[],l=[];let o=0,u=0;if(Array.isArray(e)===!1)h(e);else for(let p=0;p<e.length;p++)h(e[p]),this.addGroup(o,u,p),o+=u,u=0;this.setIndex(i),this.setAttribute("position",new yt(r,3)),this.setAttribute("normal",new yt(a,3)),this.setAttribute("uv",new yt(l,2));function h(p){const f=r.length/3,m=p.extractPoints(t);let g=m.shape;const _=m.holes;Xs.isClockWise(g)===!1&&(g=g.reverse());for(let v=0,x=_.length;v<x;v++){const S=_[v];Xs.isClockWise(S)===!0&&(_[v]=S.reverse())}const w=Xs.triangulateShape(g,_);for(let v=0,x=_.length;v<x;v++){const S=_[v];g=g.concat(S)}for(let v=0,x=g.length;v<x;v++){const S=g[v];r.push(S.x,S.y,0),a.push(0,0,1),l.push(S.x,S.y)}for(let v=0,x=w.length;v<x;v++){const S=w[v],b=S[0]+f,C=S[1]+f,O=S[2]+f;i.push(b,C,O),u+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return bI(t,e)}static fromJSON(e,t){const i=[];for(let r=0,a=e.shapes.length;r<a;r++){const l=t[e.shapes[r]];i.push(l)}return new mb(i,e.curveSegments)}}function bI(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class xs extends rn{constructor(e=1,t=32,i=16,r=0,a=Math.PI*2,l=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:a,thetaStart:l,thetaLength:o},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(l+o,Math.PI);let h=0;const p=[],f=new se,m=new se,g=[],_=[],w=[],v=[];for(let x=0;x<=i;x++){const S=[],b=x/i;let C=0;x===0&&l===0?C=.5/t:x===i&&u===Math.PI&&(C=-.5/t);for(let O=0;O<=t;O++){const M=O/t;f.x=-e*Math.cos(r+M*a)*Math.sin(l+b*o),f.y=e*Math.cos(l+b*o),f.z=e*Math.sin(r+M*a)*Math.sin(l+b*o),_.push(f.x,f.y,f.z),m.copy(f).normalize(),w.push(m.x,m.y,m.z),v.push(M+C,1-b),S.push(h++)}p.push(S)}for(let x=0;x<i;x++)for(let S=0;S<t;S++){const b=p[x][S+1],C=p[x][S],O=p[x+1][S],M=p[x+1][S+1];(x!==0||l>0)&&g.push(b,C,M),(x!==i-1||u<Math.PI)&&g.push(C,O,M)}this.setIndex(g),this.setAttribute("position",new yt(_,3)),this.setAttribute("normal",new yt(w,3)),this.setAttribute("uv",new yt(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xs(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class gb extends Ml{constructor(e=1,t=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,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new gb(e.radius,e.detail)}}class yb extends rn{constructor(e=1,t=.4,i=12,r=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:a},i=Math.floor(i),r=Math.floor(r);const l=[],o=[],u=[],h=[],p=new se,f=new se,m=new se;for(let g=0;g<=i;g++)for(let _=0;_<=r;_++){const w=_/r*a,v=g/i*Math.PI*2;f.x=(e+t*Math.cos(v))*Math.cos(w),f.y=(e+t*Math.cos(v))*Math.sin(w),f.z=t*Math.sin(v),o.push(f.x,f.y,f.z),p.x=e*Math.cos(w),p.y=e*Math.sin(w),m.subVectors(f,p).normalize(),u.push(m.x,m.y,m.z),h.push(_/r),h.push(g/i)}for(let g=1;g<=i;g++)for(let _=1;_<=r;_++){const w=(r+1)*g+_-1,v=(r+1)*(g-1)+_-1,x=(r+1)*(g-1)+_,S=(r+1)*g+_;l.push(w,v,S),l.push(v,x,S)}this.setIndex(l),this.setAttribute("position",new yt(o,3)),this.setAttribute("normal",new yt(u,3)),this.setAttribute("uv",new yt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yb(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class _b extends rn{constructor(e=1,t=.4,i=64,r=8,a=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:a,q:l},i=Math.floor(i),r=Math.floor(r);const o=[],u=[],h=[],p=[],f=new se,m=new se,g=new se,_=new se,w=new se,v=new se,x=new se;for(let b=0;b<=i;++b){const C=b/i*a*Math.PI*2;S(C,a,l,e,g),S(C+.01,a,l,e,_),v.subVectors(_,g),x.addVectors(_,g),w.crossVectors(v,x),x.crossVectors(w,v),w.normalize(),x.normalize();for(let O=0;O<=r;++O){const M=O/r*Math.PI*2,D=-t*Math.cos(M),N=t*Math.sin(M);f.x=g.x+(D*x.x+N*w.x),f.y=g.y+(D*x.y+N*w.y),f.z=g.z+(D*x.z+N*w.z),u.push(f.x,f.y,f.z),m.subVectors(f,g).normalize(),h.push(m.x,m.y,m.z),p.push(b/i),p.push(O/r)}}for(let b=1;b<=i;b++)for(let C=1;C<=r;C++){const O=(r+1)*(b-1)+(C-1),M=(r+1)*b+(C-1),D=(r+1)*b+C,N=(r+1)*(b-1)+C;o.push(O,M,N),o.push(M,D,N)}this.setIndex(o),this.setAttribute("position",new yt(u,3)),this.setAttribute("normal",new yt(h,3)),this.setAttribute("uv",new yt(p,2));function S(b,C,O,M,D){const N=Math.cos(b),L=Math.sin(b),j=O/C*b,K=Math.cos(j);D.x=M*(2+K)*.5*N,D.y=M*(2+K)*L*.5,D.z=M*Math.sin(j)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _b(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class bb extends rn{constructor(e=new o2(new se(-1,-1,0),new se(-1,1,0),new se(1,1,0)),t=64,i=1,r=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:a};const l=e.computeFrenetFrames(t,a);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const o=new se,u=new se,h=new Ze;let p=new se;const f=[],m=[],g=[],_=[];w(),this.setIndex(_),this.setAttribute("position",new yt(f,3)),this.setAttribute("normal",new yt(m,3)),this.setAttribute("uv",new yt(g,2));function w(){for(let b=0;b<t;b++)v(b);v(a===!1?t:0),S(),x()}function v(b){p=e.getPointAt(b/t,p);const C=l.normals[b],O=l.binormals[b];for(let M=0;M<=r;M++){const D=M/r*Math.PI*2,N=Math.sin(D),L=-Math.cos(D);u.x=L*C.x+N*O.x,u.y=L*C.y+N*O.y,u.z=L*C.z+N*O.z,u.normalize(),m.push(u.x,u.y,u.z),o.x=p.x+i*u.x,o.y=p.y+i*u.y,o.z=p.z+i*u.z,f.push(o.x,o.y,o.z)}}function x(){for(let b=1;b<=t;b++)for(let C=1;C<=r;C++){const O=(r+1)*(b-1)+(C-1),M=(r+1)*b+(C-1),D=(r+1)*b+C,N=(r+1)*(b-1)+C;_.push(O,M,N),_.push(M,D,N)}}function S(){for(let b=0;b<=t;b++)for(let C=0;C<=r;C++)h.x=b/t,h.y=C/r,g.push(h.x,h.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 bb(new Vp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class vI extends rn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new se,a=new se;if(e.index!==null){const l=e.attributes.position,o=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:o.count,materialIndex:0}]);for(let h=0,p=u.length;h<p;++h){const f=u[h],m=f.start,g=f.count;for(let _=m,w=m+g;_<w;_+=3)for(let v=0;v<3;v++){const x=o.getX(_+v),S=o.getX(_+(v+1)%3);r.fromBufferAttribute(l,x),a.fromBufferAttribute(l,S),Ew(r,a,i)===!0&&(t.push(r.x,r.y,r.z),t.push(a.x,a.y,a.z))}}}else{const l=e.attributes.position;for(let o=0,u=l.count/3;o<u;o++)for(let h=0;h<3;h++){const p=3*o+h,f=3*o+(h+1)%3;r.fromBufferAttribute(l,p),a.fromBufferAttribute(l,f),Ew(r,a,i)===!0&&(t.push(r.x,r.y,r.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new yt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Ew(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var Aw=Object.freeze({__proto__:null,BoxGeometry:Kn,CapsuleGeometry:sb,CircleGeometry:ab,ConeGeometry:pm,CylinderGeometry:od,DodecahedronGeometry:ob,EdgesGeometry:Ih,ExtrudeGeometry:ub,IcosahedronGeometry:hb,LatheGeometry:db,OctahedronGeometry:mm,PlaneGeometry:fb,PolyhedronGeometry:Ml,RingGeometry:pb,ShapeGeometry:mb,SphereGeometry:xs,TetrahedronGeometry:gb,TorusGeometry:yb,TorusKnotGeometry:_b,TubeGeometry:bb,WireframeGeometry:vI});class xI extends lr{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ht(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 SI extends Y0{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ld extends lr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ht(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 Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Ze(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 Zs,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 wI extends ld{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 Ze(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return It(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ht(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 Ht(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ht(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 CI extends lr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ht(16777215),this.specular=new Ht(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Zs,this.combine=q0,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 EI extends lr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ht(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Ze(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 AI extends lr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Ze(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 kI extends lr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Zs,this.combine=q0,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 TI extends lr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=TN,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 MI extends lr{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 RI extends lr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ht(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class OI extends cr{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 wl(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function f2(n){function e(r,a){return n[r]-n[a]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function u0(n,e,t){const i=n.length,r=new n.constructor(i);for(let a=0,l=0;l!==i;++a){const o=t[a]*e;for(let u=0;u!==e;++u)r[l++]=n[o+u]}return r}function vb(n,e,t,i){let r=1,a=n[0];for(;a!==void 0&&a[i]===void 0;)a=n[r++];if(a===void 0)return;let l=a[i];if(l!==void 0)if(Array.isArray(l))do l=a[i],l!==void 0&&(e.push(a.time),t.push(...l)),a=n[r++];while(a!==void 0);else if(l.toArray!==void 0)do l=a[i],l!==void 0&&(e.push(a.time),l.toArray(t,t.length)),a=n[r++];while(a!==void 0);else do l=a[i],l!==void 0&&(e.push(a.time),t.push(l)),a=n[r++];while(a!==void 0)}function NI(n,e,t,i,r=30){const a=n.clone();a.name=e;const l=[];for(let u=0;u<a.tracks.length;++u){const h=a.tracks[u],p=h.getValueSize(),f=[],m=[];for(let g=0;g<h.times.length;++g){const _=h.times[g]*r;if(!(_<t||_>=i)){f.push(h.times[g]);for(let w=0;w<p;++w)m.push(h.values[g*p+w])}}f.length!==0&&(h.times=wl(f,h.times.constructor),h.values=wl(m,h.values.constructor),l.push(h))}a.tracks=l;let o=1/0;for(let u=0;u<a.tracks.length;++u)o>a.tracks[u].times[0]&&(o=a.tracks[u].times[0]);for(let u=0;u<a.tracks.length;++u)a.tracks[u].shift(-1*o);return a.resetDuration(),a}function DI(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,a=e/i;for(let l=0;l<r;++l){const o=t.tracks[l],u=o.ValueTypeName;if(u==="bool"||u==="string")continue;const h=n.tracks.find(function(x){return x.name===o.name&&x.ValueTypeName===u});if(h===void 0)continue;let p=0;const f=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=f/3);let m=0;const g=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=g/3);const _=o.times.length-1;let w;if(a<=o.times[0]){const x=p,S=f-p;w=o.values.slice(x,S)}else if(a>=o.times[_]){const x=_*f+p,S=x+f-p;w=o.values.slice(x,S)}else{const x=o.createInterpolant(),S=p,b=f-p;x.evaluate(a),w=x.resultBuffer.slice(S,b)}u==="quaternion"&&new Ir().fromArray(w).normalize().conjugate().toArray(w);const v=h.times.length;for(let x=0;x<v;++x){const S=x*g+m;if(u==="quaternion")Ir.multiplyQuaternionsFlat(h.values,S,w,0,h.values,S);else{const b=g-m*2;for(let C=0;C<b;++C)h.values[S+C]-=w[C]}}}return n.blendMode=GE,n}class hK{static convertArray(e,t){return wl(e,t)}static isTypedArray(e){return YE(e)}static getKeyframeOrder(e){return f2(e)}static sortedArray(e,t,i){return u0(e,t,i)}static flattenJSON(e,t,i,r){vb(e,t,i,r)}static subclip(e,t,i,r,a=30){return NI(e,t,i,r,a)}static makeClipAdditive(e,t=0,i=e,r=30){return DI(e,t,i,r)}}class gm{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],a=t[i-1];e:{t:{let l;n:{i:if(!(e<r)){for(let o=i+2;;){if(r===void 0){if(e<a)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(a=r,r=t[++i],e<r)break t}l=t.length;break n}if(!(e>=a)){const o=t[1];e<o&&(i=2,a=o);for(let u=i-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===u)break;if(r=a,a=t[--i-1],e>=a)break t}l=i,i=0;break n}break e}for(;i<l;){const o=i+l>>>1;e<t[o]?l=o:i=o+1}if(r=t[i],a=t[i-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.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 t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r;for(let l=0;l!==r;++l)t[l]=i[a+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class II extends gm{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Zc,endingEnd:Zc}}intervalChanged_(e,t,i){const r=this.parameterPositions;let a=e-2,l=e+1,o=r[a],u=r[l];if(o===void 0)switch(this.getSettings_().endingStart){case Jc:a=e,o=2*t-i;break;case Fp:a=r.length-2,o=t+r[a]-r[a+1];break;default:a=e,o=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Jc:l=e,u=2*i-t;break;case Fp:l=1,u=i+r[1]-r[0];break;default:l=e-1,u=t}const h=(i-t)*.5,p=this.valueSize;this._weightPrev=h/(t-o),this._weightNext=h/(u-i),this._offsetPrev=a*p,this._offsetNext=l*p}interpolate_(e,t,i,r){const a=this.resultBuffer,l=this.sampleValues,o=this.valueSize,u=e*o,h=u-o,p=this._offsetPrev,f=this._offsetNext,m=this._weightPrev,g=this._weightNext,_=(i-t)/(r-t),w=_*_,v=w*_,x=-m*v+2*m*w-m*_,S=(1+m)*v+(-1.5-2*m)*w+(-.5+m)*_+1,b=(-1-g)*v+(1.5+g)*w+.5*_,C=g*v-g*w;for(let O=0;O!==o;++O)a[O]=x*l[p+O]+S*l[h+O]+b*l[u+O]+C*l[f+O];return a}}class p2 extends gm{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const a=this.resultBuffer,l=this.sampleValues,o=this.valueSize,u=e*o,h=u-o,p=(i-t)/(r-t),f=1-p;for(let m=0;m!==o;++m)a[m]=l[h+m]*f+l[u+m]*p;return a}}class LI extends gm{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Es{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=wl(t,this.TimeBufferType),this.values=wl(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:wl(e.times,Array),values:wl(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new LI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new p2(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new II(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Pp:t=this.InterpolantFactoryMethodDiscrete;break;case s0:t=this.InterpolantFactoryMethodLinear;break;case My:t=this.InterpolantFactoryMethodSmooth;break}if(t===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 Nt("KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pp;case this.InterpolantFactoryMethodLinear:return s0;case this.InterpolantFactoryMethodSmooth:return My}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let a=0,l=r-1;for(;a!==r&&i[a]<e;)++a;for(;l!==-1&&i[l]>t;)--l;if(++l,a!==0||l!==r){a>=l&&(l=Math.max(l,1),a=l-1);const o=this.getValueSize();this.times=i.slice(a,l),this.values=this.values.slice(a*o,l*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Sn("KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,a=i.length;a===0&&(Sn("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let o=0;o!==a;o++){const u=i[o];if(typeof u=="number"&&isNaN(u)){Sn("KeyframeTrack: Time is not a valid number.",this,o,u),e=!1;break}if(l!==null&&l>u){Sn("KeyframeTrack: Out of order keys.",this,o,u,l),e=!1;break}l=u}if(r!==void 0&&YE(r))for(let o=0,u=r.length;o!==u;++o){const h=r[o];if(isNaN(h)){Sn("KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===My,a=e.length-1;let l=1;for(let o=1;o<a;++o){let u=!1;const h=e[o],p=e[o+1];if(h!==p&&(o!==1||h!==e[0]))if(r)u=!0;else{const f=o*i,m=f-i,g=f+i;for(let _=0;_!==i;++_){const w=t[f+_];if(w!==t[m+_]||w!==t[g+_]){u=!0;break}}}if(u){if(o!==l){e[l]=e[o];const f=o*i,m=l*i;for(let g=0;g!==i;++g)t[m+g]=t[f+g]}++l}}if(a>0){e[l]=e[a];for(let o=a*i,u=l*i,h=0;h!==i;++h)t[u+h]=t[o+h];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Es.prototype.ValueTypeName="";Es.prototype.TimeBufferType=Float32Array;Es.prototype.ValueBufferType=Float32Array;Es.prototype.DefaultInterpolation=s0;class fu extends Es{constructor(e,t,i){super(e,t,i)}}fu.prototype.ValueTypeName="bool";fu.prototype.ValueBufferType=Array;fu.prototype.DefaultInterpolation=Pp;fu.prototype.InterpolantFactoryMethodLinear=void 0;fu.prototype.InterpolantFactoryMethodSmooth=void 0;class m2 extends Es{constructor(e,t,i,r){super(e,t,i,r)}}m2.prototype.ValueTypeName="color";class Wp extends Es{constructor(e,t,i,r){super(e,t,i,r)}}Wp.prototype.ValueTypeName="number";class BI extends gm{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const a=this.resultBuffer,l=this.sampleValues,o=this.valueSize,u=(i-t)/(r-t);let h=e*o;for(let p=h+o;h!==p;h+=4)Ir.slerpFlat(a,0,l,h-o,l,h,u);return a}}class ym extends Es{constructor(e,t,i,r){super(e,t,i,r)}InterpolantFactoryMethodLinear(e){return new BI(this.times,this.values,this.getValueSize(),e)}}ym.prototype.ValueTypeName="quaternion";ym.prototype.InterpolantFactoryMethodSmooth=void 0;class pu extends Es{constructor(e,t,i){super(e,t,i)}}pu.prototype.ValueTypeName="string";pu.prototype.ValueBufferType=Array;pu.prototype.DefaultInterpolation=Pp;pu.prototype.InterpolantFactoryMethodLinear=void 0;pu.prototype.InterpolantFactoryMethodSmooth=void 0;class $p extends Es{constructor(e,t,i,r){super(e,t,i,r)}}$p.prototype.ValueTypeName="vector";class Gp{constructor(e="",t=-1,i=[],r=$0){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Dr(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let l=0,o=i.length;l!==o;++l)t.push(PI(i[l]).scale(r));const a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a.userData=JSON.parse(e.userData||"{}"),a}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let a=0,l=i.length;a!==l;++a)t.push(Es.toJSON(i[a]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const a=t.length,l=[];for(let o=0;o<a;o++){let u=[],h=[];u.push((o+a-1)%a,o,(o+1)%a),h.push(0,1,0);const p=f2(u);u=u0(u,1,p),h=u0(h,1,p),!r&&u[0]===0&&(u.push(a),h.push(h[0])),l.push(new Wp(".morphTargetInfluences["+t[o].name+"]",u,h).scale(1/i))}return new this(e,-1,l)}static findByName(e,t){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===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,u=e.length;o<u;o++){const h=e[o],p=h.name.match(a);if(p&&p.length>1){const f=p[1];let m=r[f];m||(r[f]=m=[]),m.push(h)}}const l=[];for(const o in r)l.push(this.CreateFromMorphTargetSequence(o,r[o],t,i));return l}static parseAnimation(e,t){if(Nt("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Sn("AnimationClip: No animation in JSONLoader data."),null;const i=function(f,m,g,_,w){if(g.length!==0){const v=[],x=[];vb(g,v,x,_),v.length!==0&&w.push(new f(m,v,x))}},r=[],a=e.name||"default",l=e.fps||30,o=e.blendMode;let u=e.length||-1;const h=e.hierarchy||[];for(let f=0;f<h.length;f++){const m=h[f].keys;if(!(!m||m.length===0))if(m[0].morphTargets){const g={};let _;for(_=0;_<m.length;_++)if(m[_].morphTargets)for(let w=0;w<m[_].morphTargets.length;w++)g[m[_].morphTargets[w]]=-1;for(const w in g){const v=[],x=[];for(let S=0;S!==m[_].morphTargets.length;++S){const b=m[_];v.push(b.time),x.push(b.morphTarget===w?1:0)}r.push(new Wp(".morphTargetInfluence["+w+"]",v,x))}u=g.length*l}else{const g=".bones["+t[f].name+"]";i($p,g+".position",m,"pos",r),i(ym,g+".quaternion",m,"rot",r),i($p,g+".scale",m,"scl",r)}}return r.length===0?null:new this(a,u,r,o)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const a=this.tracks[i];t=Math.max(t,a.times[a.times.length-1])}return this.duration=t,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 t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let i=0;i<this.tracks.length;i++)e.push(this.tracks[i].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function zI(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wp;case"vector":case"vector2":case"vector3":case"vector4":return $p;case"color":return m2;case"quaternion":return ym;case"bool":case"boolean":return fu;case"string":return pu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function PI(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=zI(n.type);if(n.times===void 0){const t=[],i=[];vb(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const La={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class g2{constructor(e,t,i){const r=this;let a=!1,l=0,o=0,u;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this._abortController=null,this.itemStart=function(p){o++,a===!1&&r.onStart!==void 0&&r.onStart(p,l,o),a=!0},this.itemEnd=function(p){l++,r.onProgress!==void 0&&r.onProgress(p,l,o),l===o&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(p){r.onError!==void 0&&r.onError(p)},this.resolveURL=function(p){return u?u(p):p},this.setURLModifier=function(p){return u=p,this},this.addHandler=function(p,f){return h.push(p,f),this},this.removeHandler=function(p){const f=h.indexOf(p);return f!==-1&&h.splice(f,2),this},this.getHandler=function(p){for(let f=0,m=h.length;f<m;f+=2){const g=h[f],_=h[f+1];if(g.global&&(g.lastIndex=0),g.test(p))return _}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const FI=new g2;class Pr{constructor(e){this.manager=e!==void 0?e:FI,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,a){i.load(e,r,t,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}}Pr.DEFAULT_MATERIAL_NAME="__DEFAULT";const Oa={};class UI extends Error{constructor(e,t){super(e),this.response=t}}class zo extends Pr{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=La.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(Oa[e]!==void 0){Oa[e].push({onLoad:t,onProgress:i,onError:r});return}Oa[e]=[],Oa[e].push({onLoad:t,onProgress:i,onError:r});const l=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,u=this.responseType;fetch(l).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&Nt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const p=Oa[e],f=h.body.getReader(),m=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),g=m?parseInt(m):0,_=g!==0;let w=0;const v=new ReadableStream({start(x){S();function S(){f.read().then(({done:b,value:C})=>{if(b)x.close();else{w+=C.byteLength;const O=new ProgressEvent("progress",{lengthComputable:_,loaded:w,total:g});for(let M=0,D=p.length;M<D;M++){const N=p[M];N.onProgress&&N.onProgress(O)}x.enqueue(C),S()}},b=>{x.error(b)})}}});return new Response(v)}else throw new UI(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(u){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(p=>new DOMParser().parseFromString(p,o));case"json":return h.json();default:if(o==="")return h.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),m=f&&f[1]?f[1].toLowerCase():void 0,g=new TextDecoder(m);return h.arrayBuffer().then(_=>g.decode(_))}}}).then(h=>{La.add(`file:${e}`,h);const p=Oa[e];delete Oa[e];for(let f=0,m=p.length;f<m;f++){const g=p[f];g.onLoad&&g.onLoad(h)}}).catch(h=>{const p=Oa[e];if(p===void 0)throw this.manager.itemError(e),h;delete Oa[e];for(let f=0,m=p.length;f<m;f++){const g=p[f];g.onError&&g.onError(h)}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 dK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new zo(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(o){try{t(a.parse(JSON.parse(o)))}catch(u){r?r(u):Sn(u),a.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=Gp.parse(e[i]);t.push(r)}return t}}class fK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=[],o=new rb,u=new zo(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(a.withCredentials);let h=0;function p(f){u.load(e[f],function(m){const g=a.parse(m,!0);l[f]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},h+=1,h===6&&(g.mipmapCount===1&&(o.minFilter=ts),o.image=l,o.format=g.format,o.needsUpdate=!0,t&&t(o))},i,r)}if(Array.isArray(e))for(let f=0,m=e.length;f<m;++f)p(f);else u.load(e,function(f){const m=a.parse(f,!0);if(m.isCubemap){const g=m.mipmaps.length/m.mipmapCount;for(let _=0;_<g;_++){l[_]={mipmaps:[]};for(let w=0;w<m.mipmapCount;w++)l[_].mipmaps.push(m.mipmaps[_*m.mipmapCount+w]),l[_].format=m.format,l[_].width=m.width,l[_].height=m.height}o.image=l}else o.image.width=m.width,o.image.height=m.height,o.mipmaps=m.mipmaps;m.mipmapCount===1&&(o.minFilter=ts),o.format=m.format,o.needsUpdate=!0,t&&t(o)},i,r);return o}}const Hc=new WeakMap;class Kp extends Pr{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,l=La.get(`image:${e}`);if(l!==void 0){if(l.complete===!0)a.manager.itemStart(e),setTimeout(function(){t&&t(l),a.manager.itemEnd(e)},0);else{let f=Hc.get(l);f===void 0&&(f=[],Hc.set(l,f)),f.push({onLoad:t,onError:r})}return l}const o=jp("img");function u(){p(),t&&t(this);const f=Hc.get(this)||[];for(let m=0;m<f.length;m++){const g=f[m];g.onLoad&&g.onLoad(this)}Hc.delete(this),a.manager.itemEnd(e)}function h(f){p(),r&&r(f),La.remove(`image:${e}`);const m=Hc.get(this)||[];for(let g=0;g<m.length;g++){const _=m[g];_.onError&&_.onError(f)}Hc.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function p(){o.removeEventListener("load",u,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",u,!1),o.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),La.add(`image:${e}`,o),a.manager.itemStart(e),o.src=e,o}}class pK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=new Z0;a.colorSpace=Jr;const l=new Kp(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let o=0;function u(h){l.load(e[h],function(p){a.images[h]=p,o++,o===6&&(a.needsUpdate=!0,t&&t(a))},void 0,r)}for(let h=0;h<e.length;++h)u(h);return a}}class mK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new Pa,o=new zo(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(a.withCredentials),o.load(e,function(u){let h;try{h=a.parse(u)}catch(p){if(r!==void 0)r(p);else{p(p);return}}h.image!==void 0?l.image=h.image:h.data!==void 0&&(l.image.width=h.width,l.image.height=h.height,l.image.data=h.data),l.wrapS=h.wrapS!==void 0?h.wrapS:Ks,l.wrapT=h.wrapT!==void 0?h.wrapT:Ks,l.magFilter=h.magFilter!==void 0?h.magFilter:ts,l.minFilter=h.minFilter!==void 0?h.minFilter:ts,l.anisotropy=h.anisotropy!==void 0?h.anisotropy:1,h.colorSpace!==void 0&&(l.colorSpace=h.colorSpace),h.flipY!==void 0&&(l.flipY=h.flipY),h.format!==void 0&&(l.format=h.format),h.type!==void 0&&(l.type=h.type),h.mipmaps!==void 0&&(l.mipmaps=h.mipmaps,l.minFilter=hm),h.mipmapCount===1&&(l.minFilter=ts),h.generateMipmaps!==void 0&&(l.generateMipmaps=h.generateMipmaps),l.needsUpdate=!0,t&&t(l,h)},i,r),l}}class gK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=new vi,l=new Kp(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(o){a.image=o,a.needsUpdate=!0,t!==void 0&&t(a)},i,r),a}}class Rl extends wn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ht(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class jI extends Rl{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(wn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ht(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const l_=new Qt,kw=new se,Tw=new se;class xb{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ze(512,512),this.mapType=W0,this.map=null,this.mapPass=null,this.matrix=new Qt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new nb,this._frameExtents=new Ze(1,1),this._viewportCount=1,this._viewports=[new is(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;kw.setFromMatrixPosition(e.matrixWorld),t.position.copy(kw),Tw.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Tw),t.updateMatrixWorld(),l_.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(l_,t.coordinateSystem,t.reversedDepth),t.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(l_)}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 HI extends xb{constructor(){super(new Qr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,i=Yh*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||t.far;(i!==t.fov||r!==t.aspect||a!==t.far)&&(t.fov=i,t.aspect=r,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class qI extends Rl{constructor(e,t,i=0,r=Math.PI/3,a=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(wn.DEFAULT_UP),this.updateMatrix(),this.target=new wn,this.distance=i,this.angle=r,this.penumbra=a,this.decay=l,this.map=null,this.shadow=new HI}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class VI extends xb{constructor(){super(new Qr(90,1,.5,500)),this.isPointLightShadow=!0}}class WI extends Rl{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new VI}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class y2 extends X0{constructor(e=-1,t=1,i=1,r=-1,a=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=a,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,a,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=i-e,l=i+e,o=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=h*this.view.offsetX,l=a+h*this.view.width,o-=p*this.view.offsetY,u=o-p*this.view.height}this.projectionMatrix.makeOrthographic(a,l,o,u,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class $I extends xb{constructor(){super(new y2(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class GI extends Rl{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(wn.DEFAULT_UP),this.updateMatrix(),this.target=new wn,this.shadow=new $I}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class KI extends Rl{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class YI extends Rl{constructor(e,t,i=10,r=10){super(e,t),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 t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class _2{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new se)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,a=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*r),t.addScaledVector(l[2],.488603*a),t.addScaledVector(l[3],.488603*i),t.addScaledVector(l[4],1.092548*(i*r)),t.addScaledVector(l[5],1.092548*(r*a)),t.addScaledVector(l[6],.315392*(3*a*a-1)),t.addScaledVector(l[7],1.092548*(i*a)),t.addScaledVector(l[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,a=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],2*.511664*r),t.addScaledVector(l[2],2*.511664*a),t.addScaledVector(l[3],2*.511664*i),t.addScaledVector(l[4],2*.429043*i*r),t.addScaledVector(l[5],2*.429043*r*a),t.addScaledVector(l[6],.743125*a*a-.247708),t.addScaledVector(l[7],2*.429043*i*a),t.addScaledVector(l[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,a=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*a,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*a,t[6]=.315392*(3*a*a-1),t[7]=1.092548*i*a,t[8]=.546274*(i*i-r*r)}}class XI extends Rl{constructor(e=new _2,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Sb extends Pr{constructor(e){super(e),this.textures={}}load(e,t,i,r){const a=this,l=new zo(a.manager);l.setPath(a.path),l.setRequestHeader(a.requestHeader),l.setWithCredentials(a.withCredentials),l.load(e,function(o){try{t(a.parse(JSON.parse(o)))}catch(u){r?r(u):Sn(u),a.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(a){return t[a]===void 0&&Nt("MaterialLoader: Undefined texture",a),t[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 Ht().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.allowOverride!==void 0&&(r.allowOverride=e.allowOverride),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 l=e.uniforms[a];switch(r.uniforms[a]={},l.type){case"t":r.uniforms[a].value=i(l.value);break;case"c":r.uniforms[a].value=new Ht().setHex(l.value);break;case"v2":r.uniforms[a].value=new Ze().fromArray(l.value);break;case"v3":r.uniforms[a].value=new se().fromArray(l.value);break;case"v4":r.uniforms[a].value=new is().fromArray(l.value);break;case"m3":r.uniforms[a].value=new Js().fromArray(l.value);break;case"m4":r.uniforms[a].value=new Qt().fromArray(l.value);break;default:r.uniforms[a].value=l.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 Ze().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 Ze().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 Sb.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:xI,SpriteMaterial:e2,RawShaderMaterial:SI,ShaderMaterial:Y0,PointsMaterial:i2,MeshPhysicalMaterial:wI,MeshStandardMaterial:ld,MeshPhongMaterial:CI,MeshToonMaterial:EI,MeshNormalMaterial:AI,MeshLambertMaterial:kI,MeshDepthMaterial:TI,MeshDistanceMaterial:MI,MeshBasicMaterial:du,MeshMatcapMaterial:RI,LineDashedMaterial:OI,LineBasicMaterial:cr,Material:lr};return new t[e]}}class Mw{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ZI extends rn{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 JI extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new zo(a.manager);l.setPath(a.path),l.setRequestHeader(a.requestHeader),l.setWithCredentials(a.withCredentials),l.load(e,function(o){try{t(a.parse(JSON.parse(o)))}catch(u){r?r(u):Sn(u),a.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(g,_){if(t[_]!==void 0)return t[_];const v=g.interleavedBuffers[_],x=a(g,v.buffer),S=Qc(v.type,x),b=new eb(S,v.stride);return b.uuid=v.uuid,t[_]=b,b}function a(g,_){if(i[_]!==void 0)return i[_];const v=g.arrayBuffers[_],x=new Uint32Array(v).buffer;return i[_]=x,x}const l=e.isInstancedBufferGeometry?new ZI:new rn,o=e.data.index;if(o!==void 0){const g=Qc(o.type,o.array);l.setIndex(new ii(g,1))}const u=e.data.attributes;for(const g in u){const _=u[g];let w;if(_.isInterleavedBufferAttribute){const v=r(e.data,_.data);w=new ru(v,_.itemSize,_.offset,_.normalized)}else{const v=Qc(_.type,_.array),x=_.isInstancedBufferAttribute?Xh:ii;w=new x(v,_.itemSize,_.normalized)}_.name!==void 0&&(w.name=_.name),_.usage!==void 0&&w.setUsage(_.usage),l.setAttribute(g,w)}const h=e.data.morphAttributes;if(h)for(const g in h){const _=h[g],w=[];for(let v=0,x=_.length;v<x;v++){const S=_[v];let b;if(S.isInterleavedBufferAttribute){const C=r(e.data,S.data);b=new ru(C,S.itemSize,S.offset,S.normalized)}else{const C=Qc(S.type,S.array);b=new ii(C,S.itemSize,S.normalized)}S.name!==void 0&&(b.name=S.name),w.push(b)}l.morphAttributes[g]=w}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const f=e.data.groups||e.data.drawcalls||e.data.offsets;if(f!==void 0)for(let g=0,_=f.length;g!==_;++g){const w=f[g];l.addGroup(w.start,w.count,w.materialIndex)}const m=e.data.boundingSphere;return m!==void 0&&(l.boundingSphere=new Xi().fromJSON(m)),e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}class yK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=this.path===""?Mw.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const o=new zo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){let h=null;try{h=JSON.parse(u)}catch(f){r!==void 0&&r(f),f("ObjectLoader: Can't parse "+e+".",f.message);return}const p=h.metadata;if(p===void 0||p.type===void 0||p.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),Sn("ObjectLoader: Can't load "+e);return}a.parse(h,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Mw.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const a=new zo(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);const l=await a.loadAsync(e,t),o=JSON.parse(l),u=o.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(o)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,r),l=this.parseImages(e.images,function(){t!==void 0&&t(h)}),o=this.parseTextures(e.textures,l),u=this.parseMaterials(e.materials,o),h=this.parseObject(e.object,a,u,o,i),p=this.parseSkeletons(e.skeletons,h);if(this.bindSkeletons(h,p),this.bindLightTargets(h),t!==void 0){let f=!1;for(const m in l)if(l[m].data instanceof HTMLImageElement){f=!0;break}f===!1&&t(h)}return h}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),a=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,l),u=this.parseObject(e.object,r,o,l,t),h=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,h),this.bindLightTargets(u),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const a=new tu().fromJSON(e[i]);t[a.uuid]=a}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(a){a.isBone&&(r[a.uuid]=a)}),e!==void 0)for(let a=0,l=e.length;a<l;a++){const o=new tb().fromJSON(e[a],r);i[o.uuid]=o}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new JI;for(let a=0,l=e.length;a<l;a++){let o;const u=e[a];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(u);break;default:u.type in Aw?o=Aw[u.type].fromJSON(u,t):Nt(`ObjectLoader: Unsupported geometry type "${u.type}"`)}o.uuid=u.uuid,u.name!==void 0&&(o.name=u.name),u.userData!==void 0&&(o.userData=u.userData),i[u.uuid]=o}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const a=new Sb;a.setTextures(t);for(let l=0,o=e.length;l<o;l++){const u=e[l];i[u.uuid]===void 0&&(i[u.uuid]=a.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],a=Gp.parse(r);t[a.uuid]=a}return t}parseImages(e,t){const i=this,r={};let a;function l(u){return i.manager.itemStart(u),a.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function o(u){if(typeof u=="string"){const h=u,p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:i.resourcePath+h;return l(p)}else return u.data?{data:Qc(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new g2(t);a=new Kp(u),a.setCrossOrigin(this.crossOrigin);for(let h=0,p=e.length;h<p;h++){const f=e[h],m=f.url;if(Array.isArray(m)){const g=[];for(let _=0,w=m.length;_<w;_++){const v=m[_],x=o(v);x!==null&&(x instanceof HTMLImageElement?g.push(x):g.push(new Pa(x.data,x.width,x.height)))}r[f.uuid]=new Sl(g)}else{const g=o(f.url);r[f.uuid]=new Sl(g)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function a(l){if(typeof l=="string"){const o=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:t.resourcePath+o;return await r.loadAsync(u)}else return l.data?{data:Qc(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){r=new Kp(this.manager),r.setCrossOrigin(this.crossOrigin);for(let l=0,o=e.length;l<o;l++){const u=e[l],h=u.url;if(Array.isArray(h)){const p=[];for(let f=0,m=h.length;f<m;f++){const g=h[f],_=await a(g);_!==null&&(_ instanceof HTMLImageElement?p.push(_):p.push(new Pa(_.data,_.width,_.height)))}i[u.uuid]=new Sl(p)}else{const p=await a(u.url);i[u.uuid]=new Sl(p)}}}return i}parseTextures(e,t){function i(a,l){return typeof a=="number"?a:(Nt("ObjectLoader.parseTexture: Constant should be in numeric form.",a),l[a])}const r={};if(e!==void 0)for(let a=0,l=e.length;a<l;a++){const o=e[a];o.image===void 0&&Nt('ObjectLoader: No "image" specified for',o.uuid),t[o.image]===void 0&&Nt("ObjectLoader: Undefined image",o.image);const u=t[o.image],h=u.data;let p;Array.isArray(h)?(p=new Z0,h.length===6&&(p.needsUpdate=!0)):(h&&h.data?p=new Pa:p=new vi,h&&(p.needsUpdate=!0)),p.source=u,p.uuid=o.uuid,o.name!==void 0&&(p.name=o.name),o.mapping!==void 0&&(p.mapping=i(o.mapping,QI)),o.channel!==void 0&&(p.channel=o.channel),o.offset!==void 0&&p.offset.fromArray(o.offset),o.repeat!==void 0&&p.repeat.fromArray(o.repeat),o.center!==void 0&&p.center.fromArray(o.center),o.rotation!==void 0&&(p.rotation=o.rotation),o.wrap!==void 0&&(p.wrapS=i(o.wrap[0],Rw),p.wrapT=i(o.wrap[1],Rw)),o.format!==void 0&&(p.format=o.format),o.internalFormat!==void 0&&(p.internalFormat=o.internalFormat),o.type!==void 0&&(p.type=o.type),o.colorSpace!==void 0&&(p.colorSpace=o.colorSpace),o.minFilter!==void 0&&(p.minFilter=i(o.minFilter,Ow)),o.magFilter!==void 0&&(p.magFilter=i(o.magFilter,Ow)),o.anisotropy!==void 0&&(p.anisotropy=o.anisotropy),o.flipY!==void 0&&(p.flipY=o.flipY),o.generateMipmaps!==void 0&&(p.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(p.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(p.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(p.compareFunction=o.compareFunction),o.userData!==void 0&&(p.userData=o.userData),r[o.uuid]=p}return r}parseObject(e,t,i,r,a){let l;function o(m){return t[m]===void 0&&Nt("ObjectLoader: Undefined geometry",m),t[m]}function u(m){if(m!==void 0){if(Array.isArray(m)){const g=[];for(let _=0,w=m.length;_<w;_++){const v=m[_];i[v]===void 0&&Nt("ObjectLoader: Undefined material",v),g.push(i[v])}return g}return i[m]===void 0&&Nt("ObjectLoader: Undefined material",m),i[m]}}function h(m){return r[m]===void 0&&Nt("ObjectLoader: Undefined texture",m),r[m]}let p,f;switch(e.type){case"Scene":l=new _D,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Ht(e.background):l.background=h(e.background)),e.environment!==void 0&&(l.environment=h(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new Q0(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new J0(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&l.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(l.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&l.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":l=new Qr(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new y2(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new KI(e.color,e.intensity);break;case"DirectionalLight":l=new GI(e.color,e.intensity),l.target=e.target||"";break;case"PointLight":l=new WI(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new YI(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new qI(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),l.target=e.target||"";break;case"HemisphereLight":l=new jI(e.color,e.groundColor,e.intensity);break;case"LightProbe":const m=new _2().fromArray(e.sh);l=new XI(m,e.intensity);break;case"SkinnedMesh":p=o(e.geometry),f=u(e.material),l=new SD(p,f),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":p=o(e.geometry),f=u(e.material),l=new Cs(p,f);break;case"InstancedMesh":p=o(e.geometry),f=u(e.material);const g=e.count,_=e.instanceMatrix,w=e.instanceColor;l=new ED(p,f,g),l.instanceMatrix=new Xh(new Float32Array(_.array),16),w!==void 0&&(l.instanceColor=new Xh(new Float32Array(w.array),w.itemSize));break;case"BatchedMesh":p=o(e.geometry),f=u(e.material),l=new BD(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,f),l.geometry=p,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._geometryInfo=e.geometryInfo.map(v=>{let x=null,S=null;return v.boundingBox!==void 0&&(x=new or().fromJSON(v.boundingBox)),v.boundingSphere!==void 0&&(S=new Xi().fromJSON(v.boundingSphere)),{...v,boundingBox:x,boundingSphere:S}}),l._instanceInfo=e.instanceInfo,l._availableInstanceIds=e._availableInstanceIds,l._availableGeometryIds=e._availableGeometryIds,l._nextIndexStart=e.nextIndexStart,l._nextVertexStart=e.nextVertexStart,l._geometryCount=e.geometryCount,l._maxInstanceCount=e.maxInstanceCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._matricesTexture=h(e.matricesTexture.uuid),l._indirectTexture=h(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(l._colorsTexture=h(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(l.boundingSphere=new Xi().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(l.boundingBox=new or().fromJSON(e.boundingBox));break;case"LOD":l=new vD;break;case"Line":l=new El(o(e.geometry),u(e.material));break;case"LineLoop":l=new zD(o(e.geometry),u(e.material));break;case"LineSegments":l=new Ha(o(e.geometry),u(e.material));break;case"PointCloud":case"Points":l=new PD(o(e.geometry),u(e.material));break;case"Sprite":l=new bD(u(e.material));break;case"Group":l=new Dh;break;case"Bone":l=new n2;break;default:l=new wn}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(l.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let g=0;g<m.length;g++)l.add(this.parseObject(m[g],t,i,r,a))}if(e.animations!==void 0){const m=e.animations;for(let g=0;g<m.length;g++){const _=m[g];l.animations.push(a[_])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const m=e.levels;for(let g=0;g<m.length;g++){const _=m[g],w=l.getObjectByProperty("uuid",_.object);w!==void 0&&l.addLevel(w,_.distance,_.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?Nt("ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const i=t.target,r=e.getObjectByProperty("uuid",i);r!==void 0?t.target=r:t.target=new wn}})}}const QI={UVMapping:V0,CubeReflectionMapping:um,CubeRefractionMapping:x3,EquirectangularReflectionMapping:S3,EquirectangularRefractionMapping:w3,CubeUVReflectionMapping:C3},Rw={RepeatWrapping:n0,ClampToEdgeWrapping:Ks,MirroredRepeatWrapping:i0},Ow={NearestFilter:Br,NearestMipmapNearestFilter:E3,NearestMipmapLinearFilter:A3,LinearFilter:ts,LinearMipmapNearestFilter:k3,LinearMipmapLinearFilter:hm},c_=new WeakMap;class _K extends Pr{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&Nt("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&Nt("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,l=La.get(`image-bitmap:${e}`);if(l!==void 0){if(a.manager.itemStart(e),l.then){l.then(h=>{if(c_.has(l)===!0)r&&r(c_.get(l)),a.manager.itemError(e),a.manager.itemEnd(e);else return t&&t(h),a.manager.itemEnd(e),h});return}return setTimeout(function(){t&&t(l),a.manager.itemEnd(e)},0),l}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 u=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(h){return La.add(`image-bitmap:${e}`,h),t&&t(h),a.manager.itemEnd(e),h}).catch(function(h){r&&r(h),c_.set(u,h),La.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});La.add(`image-bitmap:${e}`,u),a.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let lp,b2=class{static getContext(){return lp===void 0&&(lp=new(window.AudioContext||window.webkitAudioContext)),lp}static setContext(e){lp=e}};class vK extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new zo(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{const h=u.slice(0);b2.getContext().decodeAudioData(h,function(f){t(f)}).catch(o)}catch(h){o(h)}},i,r);function o(u){r?r(u):Sn(u),a.manager.itemError(e)}}}const Nw=new Qt,Dw=new Qt,pl=new Qt;class xK{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,pl.copy(e.projectionMatrix);const r=t.eyeSep/2,a=r*t.near/t.focus,l=t.near*Math.tan(Cl*t.fov*.5)/t.zoom;let o,u;Dw.elements[12]=-r,Nw.elements[12]=r,o=-l*t.aspect+a,u=l*t.aspect+a,pl.elements[0]=2*t.near/(u-o),pl.elements[8]=(u+o)/(u-o),this.cameraL.projectionMatrix.copy(pl),o=-l*t.aspect-a,u=l*t.aspect-a,pl.elements[0]=2*t.near/(u-o),pl.elements[8]=(u+o)/(u-o),this.cameraR.projectionMatrix.copy(pl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Dw),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Nw)}}class SK extends Qr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class e5{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 t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const ml=new se,u_=new Ir,t5=new se,gl=new se,yl=new se;class wK extends wn{constructor(){super(),this.type="AudioListener",this.context=b2.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new e5}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ml,u_,t5),gl.set(0,0,-1).applyQuaternion(u_),yl.set(0,1,0).applyQuaternion(u_),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ml.x,i),t.positionY.linearRampToValueAtTime(ml.y,i),t.positionZ.linearRampToValueAtTime(ml.z,i),t.forwardX.linearRampToValueAtTime(gl.x,i),t.forwardY.linearRampToValueAtTime(gl.y,i),t.forwardZ.linearRampToValueAtTime(gl.z,i),t.upX.linearRampToValueAtTime(yl.x,i),t.upY.linearRampToValueAtTime(yl.y,i),t.upZ.linearRampToValueAtTime(yl.z,i)}else t.setPosition(ml.x,ml.y,ml.z),t.setOrientation(gl.x,gl.y,gl.z,yl.x,yl.y,yl.z)}}class n5 extends wn{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){Nt("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){Nt("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){Nt("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){Nt("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,t=this.filters.length;e<t;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,t=this.filters.length;e<t;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){Nt("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?(Nt("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){Nt("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,t){return super.copy(e,t),e.sourceType!=="buffer"?(Nt("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 _l=new se,Iw=new Ir,i5=new se,bl=new se;class CK extends n5{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,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(_l,Iw,i5),bl.set(0,0,1).applyQuaternion(Iw);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_l.x,i),t.positionY.linearRampToValueAtTime(_l.y,i),t.positionZ.linearRampToValueAtTime(_l.z,i),t.orientationX.linearRampToValueAtTime(bl.x,i),t.orientationY.linearRampToValueAtTime(bl.y,i),t.orientationZ.linearRampToValueAtTime(bl.z,i)}else t.setPosition(_l.x,_l.y,_l.z),t.setOrientation(bl.x,bl.y,bl.z)}}class EK{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,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 t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class r5{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,a,l;switch(t){case"quaternion":r=this._slerp,a=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,a=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,a=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=a,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,a=e*r+r;let l=this.cumulativeWeight;if(l===0){for(let o=0;o!==r;++o)i[a+o]=i[o];l=t}else{l+=t;const o=t/l;this._mixBufferRegion(i,a,0,o,r)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,a=this.cumulativeWeight,l=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){const u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-a,t)}l>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,h=t+t;u!==h;++u)if(i[u]!==i[u+t]){o.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let a=i,l=r;a!==l;++a)t[a]=t[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,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,a){if(r>=.5)for(let l=0;l!==a;++l)e[t+l]=e[i+l]}_slerp(e,t,i,r){Ir.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,a){const l=this._workIndex*a;Ir.multiplyQuaternionsFlat(e,l,e,t,e,i),Ir.slerpFlat(e,t,e,t,e,l,r)}_lerp(e,t,i,r,a){const l=1-r;for(let o=0;o!==a;++o){const u=t+o;e[u]=e[u]*l+e[i+o]*r}}_lerpAdditive(e,t,i,r,a){for(let l=0;l!==a;++l){const o=t+l;e[o]=e[o]+e[i+l]*r}}}const wb="\\[\\]\\.:\\/",s5=new RegExp("["+wb+"]","g"),Cb="[^"+wb+"]",a5="[^"+wb.replace("\\.","")+"]",o5=/((?:WC+[\/:])*)/.source.replace("WC",Cb),l5=/(WCOD+)?/.source.replace("WCOD",a5),c5=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cb),u5=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cb),h5=new RegExp("^"+o5+l5+c5+u5+"$"),d5=["material","materials","bones","map"];class f5{constructor(e,t,i){const r=i||xn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=i.length;r!==a;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class xn{constructor(e,t,i){this.path=t,this.parsedPath=i||xn.parseTrackName(t),this.node=xn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new xn.Composite(e,t,i):new xn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(s5,"")}static parseTrackName(e){const t=h5.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const a=i.nodeName.substring(r+1);d5.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,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(a){for(let l=0;l<a.length;l++){const o=a[l];if(o.name===t||o.uuid===t)return o;const u=i(o.children);if(u)return u}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let a=t.propertyIndex;if(e||(e=xn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Nt("PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let h=t.objectIndex;switch(i){case"materials":if(!e.material){Sn("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){Sn("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){Sn("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let p=0;p<e.length;p++)if(e[p].name===h){h=p;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){Sn("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){Sn("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){Sn("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(h!==void 0){if(e[h]===void 0){Sn("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const l=e[r];if(l===void 0){const h=t.nodeName;Sn("PropertyBinding: Trying to update property for track: "+h+"."+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 u=this.BindingType.Direct;if(a!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){Sn("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){Sn("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])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=a}else l.fromArray!==void 0&&l.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}xn.Composite=f5;xn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};xn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};xn.prototype.GetterByBindingType=[xn.prototype._getValue_direct,xn.prototype._getValue_array,xn.prototype._getValue_arrayElement,xn.prototype._getValue_toArray];xn.prototype.SetterByBindingTypeAndVersioning=[[xn.prototype._setValue_direct,xn.prototype._setValue_direct_setNeedsUpdate,xn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[xn.prototype._setValue_array,xn.prototype._setValue_array_setNeedsUpdate,xn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[xn.prototype._setValue_arrayElement,xn.prototype._setValue_arrayElement_setNeedsUpdate,xn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[xn.prototype._setValue_fromArray,xn.prototype._setValue_fromArray_setNeedsUpdate,xn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class AK{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Dr(),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 t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,a=this._bindings,l=a.length;let o,u=e.length,h=this.nCachedObjects_;for(let p=0,f=arguments.length;p!==f;++p){const m=arguments[p],g=m.uuid;let _=t[g];if(_===void 0){_=u++,t[g]=_,e.push(m);for(let w=0,v=l;w!==v;++w)a[w].push(new xn(m,i[w],r[w]))}else if(_<h){o=e[_];const w=--h,v=e[w];t[v.uuid]=_,e[_]=v,t[g]=w,e[w]=m;for(let x=0,S=l;x!==S;++x){const b=a[x],C=b[w];let O=b[_];b[_]=C,O===void 0&&(O=new xn(m,i[x],r[x])),b[w]=O}}else e[_]!==o&&Sn("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_;for(let l=0,o=arguments.length;l!==o;++l){const u=arguments[l],h=u.uuid,p=t[h];if(p!==void 0&&p>=a){const f=a++,m=e[f];t[m.uuid]=p,e[p]=m,t[h]=f,e[f]=u;for(let g=0,_=r;g!==_;++g){const w=i[g],v=w[f],x=w[p];w[p]=v,w[f]=x}}}this.nCachedObjects_=a}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_,l=e.length;for(let o=0,u=arguments.length;o!==u;++o){const h=arguments[o],p=h.uuid,f=t[p];if(f!==void 0)if(delete t[p],f<a){const m=--a,g=e[m],_=--l,w=e[_];t[g.uuid]=f,e[f]=g,t[w.uuid]=m,e[m]=w,e.pop();for(let v=0,x=r;v!==x;++v){const S=i[v],b=S[m],C=S[_];S[f]=b,S[m]=C,S.pop()}}else{const m=--l,g=e[m];m>0&&(t[g.uuid]=f),e[f]=g,e.pop();for(let _=0,w=r;_!==w;++_){const v=i[_];v[f]=v[m],v.pop()}}}this.nCachedObjects_=a}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const a=this._bindings;if(r!==void 0)return a[r];const l=this._paths,o=this._parsedPaths,u=this._objects,h=u.length,p=this.nCachedObjects_,f=new Array(h);r=a.length,i[e]=r,l.push(e),o.push(t),a.push(f);for(let m=p,g=u.length;m!==g;++m){const _=u[m];f[m]=new xn(_,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,a=this._parsedPaths,l=this._bindings,o=l.length-1,u=l[o],h=e[o];t[h]=i,l[i]=u,l.pop(),a[i]=a[o],a.pop(),r[i]=r[o],r.pop()}}}class p5{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const a=t.tracks,l=a.length,o=new Array(l),u={endingStart:Zc,endingEnd:Zc};for(let h=0;h!==l;++h){const p=a[h].createInterpolant(null);o[h]=p,p.settings=u}this._interpolantSettings=u,this._interpolants=o,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=AN,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const r=this._clip.duration,a=e._clip.duration,l=a/r,o=r/a;e.warp(1,l,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,a=r.time,l=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const u=o.parameterPositions,h=o.sampleValues;return u[0]=a,u[1]=a+i,h[0]=e/l,h[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const u=(e-a)*i;u<0||i===0?t=0:(this._startTime=null,t=i*u)}t*=this._updateTimeScale(e);const l=this._updateTime(t),o=this._updateWeight(e);if(o>0){const u=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case GE:for(let p=0,f=u.length;p!==f;++p)u[p].evaluate(l),h[p].accumulateAdditive(o);break;case $0:default:for(let p=0,f=u.length;p!==f;++p)u[p].evaluate(l),h[p].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,a=this._loopCount;const l=i===kN;if(e===0)return a===-1?r:l&&(a&1)===1?t-r:r;if(i===EN){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),r>=t||r<0){const o=Math.floor(r/t);r-=t*o,a+=Math.abs(o);const u=this.repetitions-a;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const h=e<0;this._setEndings(h,!h,l)}else this._setEndings(!1,!1,l);this._loopCount=a,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(l&&(a&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Jc,r.endingEnd=Jc):(e?r.endingStart=this.zeroSlopeAtStart?Jc:Zc:r.endingStart=Fp,t?r.endingEnd=this.zeroSlopeAtEnd?Jc:Zc:r.endingEnd=Fp)}_scheduleFading(e,t,i){const r=this._mixer,a=r.time;let l=this._weightInterpolant;l===null&&(l=r._lendControlInterpolant(),this._weightInterpolant=l);const o=l.parameterPositions,u=l.sampleValues;return o[0]=a,u[0]=t,o[1]=a+e,u[1]=i,this}}const m5=new Float32Array(1);class kK extends Po{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,a=r.length,l=e._propertyBindings,o=e._interpolants,u=i.uuid,h=this._bindingsByRootAndName;let p=h[u];p===void 0&&(p={},h[u]=p);for(let f=0;f!==a;++f){const m=r[f],g=m.name;let _=p[g];if(_!==void 0)++_.referenceCount,l[f]=_;else{if(_=l[f],_!==void 0){_._cacheIndex===null&&(++_.referenceCount,this._addInactiveBinding(_,u,g));continue}const w=t&&t._propertyBindings[f].binding.parsedPath;_=new r5(xn.create(i,g,w),m.ValueTypeName,m.getValueSize()),++_.referenceCount,this._addInactiveBinding(_,u,g),l[f]=_}o[f].resultBuffer=_.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 t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const a=t[i];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const a=t[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 t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,a=this._actionsByClip;let l=a[t];if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[t]=l;else{const o=l.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),l.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const a=e._clip.uuid,l=this._actionsByClip,o=l[a],u=o.knownActions,h=u[u.length-1],p=e._byClipCacheIndex;h._byClipCacheIndex=p,u[p]=h,u.pop(),e._byClipCacheIndex=null;const f=o.actionByRoot,m=(e._localRoot||this._root).uuid;delete f[m],u.length===0&&delete l[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const a=t[i];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,a=this._bindings;let l=r[t];l===void 0&&(l={},r[t]=l),l[i]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,a=i.path,l=this._bindingsByRootAndName,o=l[r],u=t[t.length-1],h=e._cacheIndex;u._cacheIndex=h,t[h]=u,t.pop(),delete o[a],Object.keys(o).length===0&&delete l[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new p2(new Float32Array(2),new Float32Array(2),1,m5),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,a=t[r];e.__cacheIndex=r,t[r]=e,a.__cacheIndex=i,t[i]=a}clipAction(e,t,i){const r=t||this._root,a=r.uuid;let l=typeof e=="string"?Gp.findByName(r,e):e;const o=l!==null?l.uuid:e,u=this._actionsByClip[o];let h=null;if(i===void 0&&(l!==null?i=l.blendMode:i=$0),u!==void 0){const f=u.actionByRoot[a];if(f!==void 0&&f.blendMode===i)return f;h=u.knownActions[0],l===null&&(l=h._clip)}if(l===null)return null;const p=new p5(this,l,t,i);return this._bindAction(p,h),this._addInactiveAction(p,o,a),p}existingAction(e,t){const i=t||this._root,r=i.uuid,a=typeof e=="string"?Gp.findByName(i,e):e,l=a?a.uuid:e,o=this._actionsByClip[l];return o!==void 0&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,a=Math.sign(e),l=this._accuIndex^=1;for(let h=0;h!==i;++h)t[h]._update(r,e,a,l);const o=this._bindings,u=this._nActiveBindings;for(let h=0;h!==u;++h)o[h].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,a=r[i];if(a!==void 0){const l=a.knownActions;for(let o=0,u=l.length;o!==u;++o){const h=l[o];this._deactivateAction(h);const p=h._cacheIndex,f=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,f._cacheIndex=p,t[p]=f,t.pop(),this._removeInactiveBindingsForAction(h)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const l in i){const o=i[l].actionByRoot,u=o[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const r=this._bindingsByRootAndName,a=r[t];if(a!==void 0)for(const l in a){const o=a[l];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class TK extends XE{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new ZE(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class v2{constructor(e){this.value=e}clone(){return new v2(this.value.clone===void 0?this.value:this.value.clone())}}let g5=0;class MK extends Po{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:g5++}),this.name="",this.usage=Up,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,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 t=e.uniforms;this.uniforms.length=0;for(let i=0,r=t.length;i<r;i++){const a=Array.isArray(t[i])?t[i]:[t[i]];for(let l=0;l<a.length;l++)this.uniforms.push(a[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class RK extends eb{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class OK{constructor(e,t,i,r,a,l=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=a,this.normalized=l,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const Lw=new Qt;class NK{constructor(e,t,i=0,r=1/0){this.ray=new ad(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new JE,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):Sn("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Lw.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Lw),this}intersectObject(e,t=!0,i=[]){return h0(e,this,i,t),i.sort(Bw),i}intersectObjects(e,t=!0,i=[]){for(let r=0,a=e.length;r<a;r++)h0(e[r],this,i,t);return i.sort(Bw),i}}function Bw(n,e){return n.distance-e.distance}function h0(n,e,t,i){let r=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(r=!1),r===!0&&i===!0){const a=n.children;for(let l=0,o=a.length;l<o;l++)h0(a[l],e,t,!0)}}class DK{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=y5.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 y5(){this._document.hidden===!1&&this.reset()}class IK{constructor(e=1,t=0,i=0){this.radius=e,this.phi=t,this.theta=i}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=It(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(It(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class LK{constructor(e=1,t=0,i=0){this.radius=e,this.theta=t,this.y=i}set(e,t,i){return this.radius=e,this.theta=t,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,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}class x2{constructor(e,t,i,r){x2.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){const a=this.elements;return a[0]=e,a[2]=t,a[1]=i,a[3]=r,this}}const zw=new Ze;class BK{constructor(e=new Ze(1/0,1/0),t=new Ze(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=zw.copy(t).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,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,zw).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 Pw=new se,cp=new se,qc=new se,Vc=new se,h_=new se,_5=new se,b5=new se;class zK{constructor(e=new se,t=new se){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Pw.subVectors(e,this.start),cp.subVectors(this.end,this.start);const i=cp.dot(cp);let a=cp.dot(Pw)/i;return t&&(a=It(a,0,1)),a}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,t=_5,i=b5){const r=10000000000000001e-32;let a,l;const o=this.start,u=e.start,h=this.end,p=e.end;qc.subVectors(h,o),Vc.subVectors(p,u),h_.subVectors(o,u);const f=qc.dot(qc),m=Vc.dot(Vc),g=Vc.dot(h_);if(f<=r&&m<=r)return t.copy(o),i.copy(u),t.sub(i),t.dot(t);if(f<=r)a=0,l=g/m,l=It(l,0,1);else{const _=qc.dot(h_);if(m<=r)l=0,a=It(-_/f,0,1);else{const w=qc.dot(Vc),v=f*m-w*w;v!==0?a=It((w*g-_*m)/v,0,1):a=0,l=(w*a+g)/m,l<0?(l=0,a=It(-_/f,0,1)):l>1&&(l=1,a=It((w-_)/f,0,1))}}return t.copy(o).add(qc.multiplyScalar(a)),i.copy(u).add(Vc.multiplyScalar(l)),t.sub(i),t.dot(t)}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 Fw=new se;class PK extends wn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new rn,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 l=0,o=1,u=32;l<u;l++,o++){const h=l/u*Math.PI*2,p=o/u*Math.PI*2;r.push(Math.cos(h),Math.sin(h),1,Math.cos(p),Math.sin(p),1)}i.setAttribute("position",new yt(r,3));const a=new cr({fog:!1,toneMapped:!1});this.cone=new Ha(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,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Fw.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Fw),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Oo=new se,up=new Qt,d_=new Qt;class FK extends Ha{constructor(e){const t=S2(e),i=new rn,r=[],a=[];for(let h=0;h<t.length;h++){const p=t[h];p.parent&&p.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 yt(r,3)),i.setAttribute("color",new yt(a,3));const l=new cr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new Ht(255),u=new Ht(65280);this.setColors(o,u)}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");d_.copy(this.root.matrixWorld).invert();for(let a=0,l=0;a<t.length;a++){const o=t[a];o.parent&&o.parent.isBone&&(up.multiplyMatrices(d_,o.matrixWorld),Oo.setFromMatrixPosition(up),r.setXYZ(l,Oo.x,Oo.y,Oo.z),up.multiplyMatrices(d_,o.parent.matrixWorld),Oo.setFromMatrixPosition(up),r.setXYZ(l+1,Oo.x,Oo.y,Oo.z),l+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){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,t.r,t.g,t.b);return r.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function S2(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push(...S2(n.children[t]));return e}class UK extends Cs{constructor(e,t,i){const r=new xs(t,4,2),a=new du({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 v5=new se,Uw=new Ht,jw=new Ht;class jK extends wn{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new mm(t);r.rotateY(Math.PI*.5),this.material=new du({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const a=r.getAttribute("position"),l=new Float32Array(a.count*3);r.setAttribute("color",new ii(l,3)),this.add(new Cs(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 t=e.geometry.getAttribute("color");Uw.copy(this.light.color),jw.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const a=i<r/2?Uw:jw;t.setXYZ(i,a.r,a.g,a.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(v5.setFromMatrixPosition(this.light.matrixWorld).negate())}}class HK extends Ha{constructor(e=10,t=10,i=4473924,r=8947848){i=new Ht(i),r=new Ht(r);const a=t/2,l=e/t,o=e/2,u=[],h=[];for(let m=0,g=0,_=-o;m<=t;m++,_+=l){u.push(-o,0,_,o,0,_),u.push(_,0,-o,_,0,o);const w=m===a?i:r;w.toArray(h,g),g+=3,w.toArray(h,g),g+=3,w.toArray(h,g),g+=3,w.toArray(h,g),g+=3}const p=new rn;p.setAttribute("position",new yt(u,3)),p.setAttribute("color",new yt(h,3));const f=new cr({vertexColors:!0,toneMapped:!1});super(p,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class qK extends Ha{constructor(e=10,t=16,i=8,r=64,a=4473924,l=8947848){a=new Ht(a),l=new Ht(l);const o=[],u=[];if(t>1)for(let f=0;f<t;f++){const m=f/t*(Math.PI*2),g=Math.sin(m)*e,_=Math.cos(m)*e;o.push(0,0,0),o.push(g,0,_);const w=f&1?a:l;u.push(w.r,w.g,w.b),u.push(w.r,w.g,w.b)}for(let f=0;f<i;f++){const m=f&1?a:l,g=e-e/i*f;for(let _=0;_<r;_++){let w=_/r*(Math.PI*2),v=Math.sin(w)*g,x=Math.cos(w)*g;o.push(v,0,x),u.push(m.r,m.g,m.b),w=(_+1)/r*(Math.PI*2),v=Math.sin(w)*g,x=Math.cos(w)*g,o.push(v,0,x),u.push(m.r,m.g,m.b)}}const h=new rn;h.setAttribute("position",new yt(o,3)),h.setAttribute("color",new yt(u,3));const p=new cr({vertexColors:!0,toneMapped:!1});super(h,p),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Hw=new se,hp=new se,qw=new se;class VK extends wn{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new rn;r.setAttribute("position",new yt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const a=new cr({fog:!1,toneMapped:!1});this.lightPlane=new El(r,a),this.add(this.lightPlane),r=new rn,r.setAttribute("position",new yt([0,0,0,0,0,1],3)),this.targetLine=new El(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),Hw.setFromMatrixPosition(this.light.matrixWorld),hp.setFromMatrixPosition(this.light.target.matrixWorld),qw.subVectors(hp,Hw),this.lightPlane.lookAt(hp),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(hp),this.targetLine.scale.z=qw.length()}}const dp=new se,oi=new X0;class WK extends Ha{constructor(e){const t=new rn,i=new cr({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],a=[],l={};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(_,w){u(_),u(w)}function u(_){r.push(0,0,0),a.push(0,0,0),l[_]===void 0&&(l[_]=[]),l[_].push(r.length/3-1)}t.setAttribute("position",new yt(r,3)),t.setAttribute("color",new yt(a,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const h=new Ht(16755200),p=new Ht(16711680),f=new Ht(43775),m=new Ht(16777215),g=new Ht(3355443);this.setColors(h,p,f,m,g)}setColors(e,t,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,t.r,t.g,t.b),o.setXYZ(25,t.r,t.g,t.b),o.setXYZ(26,t.r,t.g,t.b),o.setXYZ(27,t.r,t.g,t.b),o.setXYZ(28,t.r,t.g,t.b),o.setXYZ(29,t.r,t.g,t.b),o.setXYZ(30,t.r,t.g,t.b),o.setXYZ(31,t.r,t.g,t.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,t=this.pointMap,i=1,r=1;let a,l;if(oi.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,l=0;else if(this.camera.coordinateSystem===Ys)a=-1,l=1;else if(this.camera.coordinateSystem===Kh)a=0,l=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);ui("c",t,e,oi,0,0,a),ui("t",t,e,oi,0,0,l),ui("n1",t,e,oi,-i,-r,a),ui("n2",t,e,oi,i,-r,a),ui("n3",t,e,oi,-i,r,a),ui("n4",t,e,oi,i,r,a),ui("f1",t,e,oi,-i,-r,l),ui("f2",t,e,oi,i,-r,l),ui("f3",t,e,oi,-i,r,l),ui("f4",t,e,oi,i,r,l),ui("u1",t,e,oi,i*.7,r*1.1,a),ui("u2",t,e,oi,-i*.7,r*1.1,a),ui("u3",t,e,oi,0,r*2,a),ui("cf1",t,e,oi,-i,0,l),ui("cf2",t,e,oi,i,0,l),ui("cf3",t,e,oi,0,-r,l),ui("cf4",t,e,oi,0,r,l),ui("cn1",t,e,oi,-i,0,a),ui("cn2",t,e,oi,i,0,a),ui("cn3",t,e,oi,0,-r,a),ui("cn4",t,e,oi,0,r,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ui(n,e,t,i,r,a,l){dp.set(r,a,l).unproject(i);const o=e[n];if(o!==void 0){const u=t.getAttribute("position");for(let h=0,p=o.length;h<p;h++)u.setXYZ(o[h],dp.x,dp.y,dp.z)}}const fp=new or;class $K extends Ha{constructor(e,t=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(24),a=new rn;a.setIndex(new ii(i,1)),a.setAttribute("position",new ii(r,3)),super(a,new cr({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&fp.setFromObject(this.object),fp.isEmpty())return;const e=fp.min,t=fp.max,i=this.geometry.attributes.position,r=i.array;r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=t.y,r[5]=t.z,r[6]=e.x,r[7]=e.y,r[8]=t.z,r[9]=t.x,r[10]=e.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=e.z,r[15]=e.x,r[16]=t.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=t.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,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class GK extends Ha{constructor(e,t=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 rn;a.setIndex(new ii(i,1)),a.setAttribute("position",new yt(r,3)),super(a,new cr({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class KK extends El{constructor(e,t=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],l=new rn;l.setAttribute("position",new yt(a,3)),l.computeBoundingSphere(),super(l,new cr({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],u=new rn;u.setAttribute("position",new yt(o,3)),u.computeBoundingSphere(),this.add(new Cs(u,new du({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 Vw=new se;let pp,f_;class YK extends wn{constructor(e=new se(0,0,1),t=new se(0,0,0),i=1,r=16776960,a=i*.2,l=a*.2){super(),this.type="ArrowHelper",pp===void 0&&(pp=new rn,pp.setAttribute("position",new yt([0,0,0,0,1,0],3)),f_=new pm(.5,1,5,1),f_.translate(0,-.5,0)),this.position.copy(t),this.line=new El(pp,new cr({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Cs(f_,new du({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,a,l)}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{Vw.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Vw,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class XK extends Ha{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new rn;r.setAttribute("position",new yt(t,3)),r.setAttribute("color",new yt(i,3));const a=new cr({vertexColors:!0,toneMapped:!1});super(r,a),this.type="AxesHelper"}setColors(e,t,i){const r=new Ht,a=this.geometry.attributes.color.array;return r.set(e),r.toArray(a,0),r.toArray(a,3),r.set(t),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 ZK{constructor(){this.type="ShapePath",this.color=new Ht,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new o0,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,a,l){return this.currentPath.bezierCurveTo(e,t,i,r,a,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(x){const S=[];for(let b=0,C=x.length;b<C;b++){const O=x[b],M=new tu;M.curves=O.curves,S.push(M)}return S}function i(x,S){const b=S.length;let C=!1;for(let O=b-1,M=0;M<b;O=M++){let D=S[O],N=S[M],L=N.x-D.x,j=N.y-D.y;if(Math.abs(j)>Number.EPSILON){if(j<0&&(D=S[M],L=-L,N=S[O],j=-j),x.y<D.y||x.y>N.y)continue;if(x.y===D.y){if(x.x===D.x)return!0}else{const K=j*(x.x-D.x)-L*(x.y-D.y);if(K===0)return!0;if(K<0)continue;C=!C}}else{if(x.y!==D.y)continue;if(N.x<=x.x&&x.x<=D.x||D.x<=x.x&&x.x<=N.x)return!0}}return C}const r=Xs.isClockWise,a=this.subPaths;if(a.length===0)return[];let l,o,u;const h=[];if(a.length===1)return o=a[0],u=new tu,u.curves=o.curves,h.push(u),h;let p=!r(a[0].getPoints());p=e?!p:p;const f=[],m=[];let g=[],_=0,w;m[_]=void 0,g[_]=[];for(let x=0,S=a.length;x<S;x++)o=a[x],w=o.getPoints(),l=r(w),l=e?!l:l,l?(!p&&m[_]&&_++,m[_]={s:new tu,p:w},m[_].s.curves=o.curves,p&&_++,g[_]=[]):g[_].push({h:o,p:w[0]});if(!m[0])return t(a);if(m.length>1){let x=!1,S=0;for(let b=0,C=m.length;b<C;b++)f[b]=[];for(let b=0,C=m.length;b<C;b++){const O=g[b];for(let M=0;M<O.length;M++){const D=O[M];let N=!0;for(let L=0;L<m.length;L++)i(D.p,m[L].p)&&(b!==L&&S++,N?(N=!1,f[L].push(D)):x=!0);N&&f[b].push(D)}}S>0&&x===!1&&(g=f)}let v;for(let x=0,S=m.length;x<S;x++){u=m[x].s,h.push(u),v=g[x];for(let b=0,C=v.length;b<C;b++)u.holes.push(v[b].h)}return h}}class JK extends Po{constructor(e,t=null){super(),this.object=e,this.domElement=t,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){Nt("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function x5(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function S5(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function w5(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function C5(n,e,t,i){const r=E5(i);switch(t){case z3:return n*e;case WE:return n*e/r.components*r.byteLength;case $E:return n*e/r.components*r.byteLength;case U3:return n*e*2/r.components*r.byteLength;case j3:return n*e*2/r.components*r.byteLength;case P3:return n*e*3/r.components*r.byteLength;case Gh:return n*e*4/r.components*r.byteLength;case H3:return n*e*4/r.components*r.byteLength;case q3:case V3:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case W3:case $3:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case K3:case X3:return Math.max(n,16)*Math.max(e,8)/4;case G3:case Y3:return Math.max(n,8)*Math.max(e,8)/2;case Z3:case J3:case eN:case tN:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Q3:case nN:case iN:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case rN:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case sN:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case aN:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case oN:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case lN:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case cN:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case uN:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case hN:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case dN:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case fN:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case pN:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case mN:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case gN:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case yN:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case _N:case bN:case vN:return Math.ceil(n/4)*Math.ceil(e/4)*16;case xN:case SN:return Math.ceil(n/4)*Math.ceil(e/4)*8;case wN:case CN:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function E5(n){switch(n){case W0:case T3:return{byteLength:1,components:1};case R3:case M3:case N3:return{byteLength:2,components:1};case D3:case I3:return{byteLength:2,components:4};case dm:case O3:case iu:return{byteLength:4,components:1};case L3:case B3:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class QK{static contain(e,t){return x5(e,t)}static cover(e,t){return S5(e,t)}static fill(e){return w5(e)}static getByteLength(e,t,i,r){return C5(e,t,i,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:qE}}));typeof window<"u"&&(window.__THREE__?Nt("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=qE);const Yp={robot:{type:"robot",label:"Robot",description:"Standard humanoid robot",head:{},torso:{},armL:{},armR:{},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.2},mech:{type:"mech",label:"Mech",description:"Bulkier torso, wider stance, angular head",head:{geometry:new Kn(.34,.2,.3),position:[0,1.36,0]},torso:{geometry:new Kn(.42,.44,.26),position:[0,.87,0]},armL:{geometry:new Kn(.11,.3,.11),position:[-.27,1.07,0]},armR:{geometry:new Kn(.11,.3,.11),position:[.27,1.07,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.2},drone:{type:"drone",label:"Drone",description:"Smaller hovering unit with antenna array",head:{geometry:new xs(.14,8,8),position:[0,1.2,0]},torso:{geometry:new Kn(.28,.18,.28),position:[0,.95,0]},armL:{geometry:new Kn(.22,.04,.06),position:[-.25,.95,0]},armR:{geometry:new Kn(.22,.04,.06),position:[.25,.95,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.3},spider:{type:"spider",label:"Spider",description:"Low body with 4 stubby legs",head:{geometry:new xs(.12,8,8),position:[0,.85,.1]},torso:{geometry:new Kn(.36,.14,.32),position:[0,.65,0]},armL:{geometry:new Kn(.06,.22,.06),position:[-.2,.65,-.12],scale:[1,1,1]},armR:{geometry:new Kn(.06,.22,.06),position:[.2,.65,-.12],scale:[1,1,1]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.05},orb:{type:"orb",label:"Orb",description:"Spherical body with stubby arms and short legs",head:{geometry:new xs(.1,8,8),position:[0,1.28,0]},torso:{geometry:new xs(.22,12,12),position:[0,.92,0]},armL:{geometry:new Kn(.06,.18,.06),position:[-.24,.92,0]},armR:{geometry:new Kn(.06,.18,.06),position:[.24,.92,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.2},tank:{type:"tank",label:"Tank",description:"Wide body with one thick arm, treads for legs",head:{geometry:new Kn(.24,.18,.22),position:[0,1.24,0]},torso:{geometry:new Kn(.44,.3,.26),position:[0,.87,0]},armL:{visible:!1},armR:{geometry:new Kn(.14,.34,.14),position:[.3,.87,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.15}},A5=["robot","mech","drone","spider","orb","tank"];function eY(n){return Yp[n]??Yp.robot}function w2(n){return Yp[n]?.label??"Robot"}function k5(n){return Yp[n]?.description??""}const T5="_panel_9dulv_7",M5="_section_9dulv_12",R5="_tabs_9dulv_18",O5="_tab_9dulv_18",N5="_active_9dulv_21",D5="_autosaveIndicator_9dulv_30",I5="_visible_9dulv_31",L5="_themeGrid_9dulv_36",B5="_themeSwatch_9dulv_37",z5="_swatchColors_9dulv_40",P5="_swatchLabel_9dulv_42",F5="_fontSizeControl_9dulv_46",U5="_fontBtn_9dulv_47",j5="_fontSizeDisplay_9dulv_49",H5="_fontSizeSlider_9dulv_50",q5="_soundControls_9dulv_76",V5="_toggleLabel_9dulv_77",W5="_toggleSwitch_9dulv_80",$5="_volumeControl_9dulv_85",G5="_volumeDisplay_9dulv_87",K5="_soundActionGrid_9dulv_90",Y5="_soundCategoryLabel_9dulv_94",X5="_soundActionRow_9dulv_95",Z5="_soundActionLabel_9dulv_97",J5="_soundActionSelect_9dulv_98",Q5="_soundPreviewBtn_9dulv_101",eL="_densityControl_9dulv_106",tL="_densityBtn_9dulv_107",nL="_densityBtnLabel_9dulv_110",iL="_densityBtnDesc_9dulv_111",rL="_densityActions_9dulv_112",sL="_densityStatus_9dulv_113",aL="_hookStatusDot_9dulv_114",oL="_installed_9dulv_115",lL="_advancedActions_9dulv_118",cL="_settingsHint_9dulv_119",uL="_apiKeyRow_9dulv_122",hL="_apiKeyInput_9dulv_123",dL="_apiKeyToggle_9dulv_125",Ke={panel:T5,section:M5,tabs:R5,tab:O5,active:N5,autosaveIndicator:D5,visible:I5,themeGrid:L5,themeSwatch:B5,swatchColors:z5,swatchLabel:P5,fontSizeControl:F5,fontBtn:U5,fontSizeDisplay:j5,fontSizeSlider:H5,soundControls:q5,toggleLabel:V5,toggleSwitch:W5,volumeControl:$5,volumeDisplay:G5,soundActionGrid:K5,soundCategoryLabel:Y5,soundActionRow:X5,soundActionLabel:Z5,soundActionSelect:J5,soundPreviewBtn:Q5,densityControl:eL,densityBtn:tL,densityBtnLabel:nL,densityBtnDesc:iL,densityActions:rL,densityStatus:sL,hookStatusDot:aL,installed:oL,advancedActions:lL,settingsHint:cL,apiKeyRow:uL,apiKeyInput:hL,apiKeyToggle:dL};function fL(){const n=Wt(m=>m.themeName),e=Wt(m=>m.fontSize),t=Wt(m=>m.scanlineEnabled),i=Wt(m=>m.animationIntensity),r=Wt(m=>m.animationSpeed),a=Wt(m=>m.characterModel),l=Wt(m=>m.setThemeName),o=Wt(m=>m.setFontSize),u=Wt(m=>m.setScanlineEnabled),h=Wt(m=>m.setAnimationIntensity),p=Wt(m=>m.setAnimationSpeed),f=Wt(m=>m.setCharacterModel);return T.jsxs("div",{children:[T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Theme"}),T.jsx("div",{className:Ke.themeGrid,children:SO.map(m=>T.jsxs("button",{className:`${Ke.themeSwatch}${n===m.name?` ${Ke.active}`:""}`,onClick:()=>l(m.name),title:m.label,children:[T.jsx("div",{className:Ke.swatchColors,children:m.colors.map((g,_)=>T.jsx("span",{style:{background:g}},_))}),T.jsx("span",{className:Ke.swatchLabel,children:m.label})]},m.name))})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"3D Character Model"}),T.jsx("p",{style:{fontSize:"10px",color:"var(--text-dim)",marginBottom:"8px"},children:"Choose the robot model shown in the Cyberdrome"}),T.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:A5.map(m=>{const g=a===m;return T.jsxs("button",{onClick:()=>f(m),title:k5(m),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",padding:"8px 4px",borderRadius:"4px",cursor:"pointer",transition:"all 0.15s ease",border:g?"1px solid var(--accent-cyan, #00e5ff)":"1px solid var(--border-subtle, rgba(255,255,255,0.08))",background:g?"rgba(0, 229, 255, 0.1)":"rgba(255, 255, 255, 0.02)",color:g?"var(--accent-cyan, #00e5ff)":"var(--text-secondary, #8888aa)",fontFamily:"var(--font-mono)",fontSize:"10px",letterSpacing:"0.5px"},children:[T.jsx(pL,{type:m,active:g}),T.jsx("span",{style:{textTransform:"uppercase",fontWeight:g?700:400},children:w2(m)})]},m)})})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Font Size"}),T.jsxs("div",{className:Ke.fontSizeControl,children:[T.jsx("button",{className:Ke.fontBtn,onClick:()=>o(Math.max(10,e-1)),children:"A-"}),T.jsxs("span",{className:Ke.fontSizeDisplay,children:[e,"px"]}),T.jsx("button",{className:Ke.fontBtn,onClick:()=>o(Math.min(20,e+1)),children:"A+"}),T.jsx("input",{type:"range",className:Ke.fontSizeSlider,min:10,max:20,step:1,value:e,onChange:m=>o(Number(m.target.value))})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Scanline Effect"}),T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:t,onChange:m=>u(m.target.checked)}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Enable scanline overlay"})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Animation"}),T.jsx("label",{style:{fontSize:"11px",color:"var(--text-secondary)",marginBottom:"6px",display:"block"},children:"Intensity (range of 3D robot movement)"}),T.jsxs("div",{className:Ke.volumeControl,children:[T.jsx("span",{children:"Low"}),T.jsx("input",{type:"range",min:0,max:200,step:10,value:i,onChange:m=>h(Number(m.target.value))}),T.jsxs("span",{style:{minWidth:"40px",textAlign:"right"},children:[i,"%"]})]}),T.jsx("label",{style:{fontSize:"11px",color:"var(--text-secondary)",marginBottom:"6px",marginTop:"8px",display:"block"},children:"Speed (3D robot animation speed)"}),T.jsxs("div",{className:Ke.volumeControl,children:[T.jsx("span",{children:"Slow"}),T.jsx("input",{type:"range",min:30,max:200,step:10,value:r,onChange:m=>p(Number(m.target.value))}),T.jsxs("span",{style:{minWidth:"40px",textAlign:"right"},children:[r,"%"]})]})]})]})}function pL({type:n,active:e}){const t=e?"#00e5ff":"#666",i=28;switch(n){case"robot":return T.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[T.jsx("rect",{x:"8",y:"2",width:"8",height:"6",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("rect",{x:"7",y:"9",width:"10",height:"8",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"9",y1:"17",x2:"9",y2:"22",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"15",y1:"17",x2:"15",y2:"22",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"5",y1:"12",x2:"7",y2:"12",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"17",y1:"12",x2:"19",y2:"12",stroke:t,strokeWidth:"1.5"})]});case"mech":return T.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[T.jsx("rect",{x:"7",y:"2",width:"10",height:"5",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("rect",{x:"5",y:"8",width:"14",height:"9",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"8",y1:"17",x2:"7",y2:"22",stroke:t,strokeWidth:"2"}),T.jsx("line",{x1:"16",y1:"17",x2:"17",y2:"22",stroke:t,strokeWidth:"2"}),T.jsx("line",{x1:"3",y1:"11",x2:"5",y2:"11",stroke:t,strokeWidth:"2"}),T.jsx("line",{x1:"19",y1:"11",x2:"21",y2:"11",stroke:t,strokeWidth:"2"})]});case"drone":return T.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[T.jsx("circle",{cx:"12",cy:"10",r:"4",stroke:t,strokeWidth:"1.5"}),T.jsx("rect",{x:"8",y:"12",width:"8",height:"4",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"4",y1:"13",x2:"8",y2:"13",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"16",y1:"13",x2:"20",y2:"13",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"6",stroke:t,strokeWidth:"1.5"}),T.jsx("circle",{cx:"12",cy:"3",r:"1",fill:t})]});case"spider":return T.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[T.jsx("ellipse",{cx:"12",cy:"12",rx:"6",ry:"3",stroke:t,strokeWidth:"1.5"}),T.jsx("circle",{cx:"12",cy:"9",r:"2.5",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"7",y1:"13",x2:"3",y2:"18",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"17",y1:"13",x2:"21",y2:"18",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"8",y1:"14",x2:"5",y2:"20",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"16",y1:"14",x2:"19",y2:"20",stroke:t,strokeWidth:"1.5"})]});case"orb":return T.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[T.jsx("circle",{cx:"12",cy:"11",r:"6",stroke:t,strokeWidth:"1.5"}),T.jsx("circle",{cx:"12",cy:"5",r:"2",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"9",y1:"17",x2:"8",y2:"21",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"15",y1:"17",x2:"16",y2:"21",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"6",y1:"10",x2:"3",y2:"9",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"18",y1:"10",x2:"21",y2:"9",stroke:t,strokeWidth:"1.5"})]});case"tank":return T.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[T.jsx("rect",{x:"7",y:"3",width:"8",height:"5",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("rect",{x:"4",y:"9",width:"14",height:"7",rx:"1",stroke:t,strokeWidth:"1.5"}),T.jsx("rect",{x:"5",y:"17",width:"5",height:"3",rx:"0.5",stroke:t,strokeWidth:"1.5"}),T.jsx("rect",{x:"14",y:"17",width:"5",height:"3",rx:"0.5",stroke:t,strokeWidth:"1.5"}),T.jsx("line",{x1:"18",y1:"11",x2:"22",y2:"11",stroke:t,strokeWidth:"2"})]});default:return null}}class mL{ctx=null;nodes=null;currentPreset="off";volume=.3;getCtx(){return this.ctx||(this.ctx=new AudioContext),this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{}),this.ctx}createNoiseBuffer(e){const t=e.sampleRate,i=e.createBuffer(1,t,t),r=i.getChannelData(0);for(let a=0;a<t;a++)r[a]=Math.random()*2-1;return i}createNoiseSource(e){const t=e.createBufferSource();return t.buffer=this.createNoiseBuffer(e),t.loop=!0,t}buildRain(e,t){const i=[],r=[],a=[],l=[],o=this.createNoiseSource(e),u=e.createGain();u.gain.setValueAtTime(.4,e.currentTime);const h=e.createBiquadFilter();h.type="bandpass",h.frequency.setValueAtTime(3e3,e.currentTime),h.Q.setValueAtTime(.5,e.currentTime);const p=e.createBiquadFilter();p.type="highshelf",p.frequency.setValueAtTime(6e3,e.currentTime),p.gain.setValueAtTime(-6,e.currentTime),o.connect(h),h.connect(p),p.connect(u),u.connect(t),o.start(),i.push(o),r.push(u);const f=setInterval(()=>{if(!this.ctx||this.currentPreset!=="rain")return;const m=2e3+Math.random()*3e3,g=e.createOscillator(),_=e.createGain();g.type="sine",g.frequency.setValueAtTime(m,e.currentTime),g.frequency.exponentialRampToValueAtTime(m*.5,e.currentTime+.05),_.gain.setValueAtTime(.06*Math.random(),e.currentTime),_.gain.exponentialRampToValueAtTime(.001,e.currentTime+.06),g.connect(_),_.connect(t),g.start(e.currentTime),g.stop(e.currentTime+.06)},80+Math.random()*120);return a.push(f),{sources:i,gains:r,master:t,intervals:a,timeouts:l}}buildLofi(e,t){const i=[],r=[],a=e.createOscillator();a.type="sine",a.frequency.setValueAtTime(60,e.currentTime);const l=e.createOscillator();l.type="sine",l.frequency.setValueAtTime(.3,e.currentTime);const o=e.createGain();o.gain.setValueAtTime(5,e.currentTime),l.connect(o),o.connect(a.frequency);const u=e.createGain();u.gain.setValueAtTime(.35,e.currentTime),a.connect(u),u.connect(t),a.start(),l.start(),i.push(a,l),r.push(u,o);const h=this.createNoiseSource(e),p=e.createGain();p.gain.setValueAtTime(.08,e.currentTime);const f=e.createBiquadFilter();return f.type="lowpass",f.frequency.setValueAtTime(400,e.currentTime),h.connect(f),f.connect(p),p.connect(t),h.start(),i.push(h),r.push(p),{sources:i,gains:r,master:t,intervals:[],timeouts:[]}}buildServerRoom(e,t){const i=[],r=[],a=this.createNoiseSource(e),l=e.createGain();l.gain.setValueAtTime(.25,e.currentTime);const o=e.createBiquadFilter();o.type="bandpass",o.frequency.setValueAtTime(500,e.currentTime),o.Q.setValueAtTime(.3,e.currentTime),a.connect(o),o.connect(l),l.connect(t),a.start(),i.push(a),r.push(l);const u=e.createOscillator();u.type="triangle",u.frequency.setValueAtTime(120,e.currentTime);const h=e.createOscillator();h.type="sine",h.frequency.setValueAtTime(.1,e.currentTime);const p=e.createGain();p.gain.setValueAtTime(3,e.currentTime),h.connect(p),p.connect(u.frequency);const f=e.createGain();f.gain.setValueAtTime(.15,e.currentTime),u.connect(f),f.connect(t),u.start(),h.start(),i.push(u,h),r.push(f,p);const m=e.createOscillator();m.type="sine",m.frequency.setValueAtTime(8e3,e.currentTime);const g=e.createGain();return g.gain.setValueAtTime(.02,e.currentTime),m.connect(g),g.connect(t),m.start(),i.push(m),r.push(g),{sources:i,gains:r,master:t,intervals:[],timeouts:[]}}buildDeepSpace(e,t){const i=[],r=[],a=e.createOscillator();a.type="sine",a.frequency.setValueAtTime(40,e.currentTime);const l=e.createOscillator();l.type="sine",l.frequency.setValueAtTime(.05,e.currentTime);const o=e.createGain();o.gain.setValueAtTime(8,e.currentTime),l.connect(o),o.connect(a.frequency);const u=e.createGain();u.gain.setValueAtTime(.3,e.currentTime),a.connect(u);const h=e.createConvolver(),p=e.sampleRate*3,f=e.createBuffer(2,p,e.sampleRate);for(let _=0;_<2;_++){const w=f.getChannelData(_);for(let v=0;v<p;v++)w[v]=(Math.random()*2-1)*Math.pow(1-v/p,2.5)}h.buffer=f,u.connect(h),h.connect(t),a.start(),l.start(),i.push(a,l),r.push(u,o);const m=e.createOscillator();m.type="sine",m.frequency.setValueAtTime(80,e.currentTime);const g=e.createGain();return g.gain.setValueAtTime(.08,e.currentTime),m.connect(g),g.connect(h),m.start(),i.push(m),r.push(g),{sources:i,gains:r,master:t,intervals:[],timeouts:[]}}buildCoffeeShop(e,t){const i=[],r=[],a=[],l=[],o=this.createNoiseSource(e),u=e.createGain();u.gain.setValueAtTime(.15,e.currentTime);const h=e.createBiquadFilter();h.type="lowpass",h.frequency.setValueAtTime(1200,e.currentTime);const p=e.createBiquadFilter();p.type="highpass",p.frequency.setValueAtTime(200,e.currentTime),o.connect(p),p.connect(h),h.connect(u),u.connect(t),o.start(),i.push(o),r.push(u);const f=setInterval(()=>{if(!this.ctx||this.currentPreset!=="coffeeShop")return;const m=1500+Math.random()*2e3,g=e.createOscillator(),_=e.createGain();g.type="triangle",g.frequency.setValueAtTime(m,e.currentTime),_.gain.setValueAtTime(.03*Math.random(),e.currentTime),_.gain.exponentialRampToValueAtTime(.001,e.currentTime+.2),g.connect(_),_.connect(t),g.start(e.currentTime),g.stop(e.currentTime+.2)},2e3+Math.random()*4e3);return a.push(f),{sources:i,gains:r,master:t,intervals:a,timeouts:l}}start(e,t){if(this.stop(),e==="off")return;t!==void 0&&(this.volume=Math.max(0,Math.min(1,t)));const i=this.getCtx();this.currentPreset=e;const r=i.createGain();r.gain.setValueAtTime(this.volume,i.currentTime),r.connect(i.destination);const l={rain:(o,u)=>this.buildRain(o,u),lofi:(o,u)=>this.buildLofi(o,u),serverRoom:(o,u)=>this.buildServerRoom(o,u),deepSpace:(o,u)=>this.buildDeepSpace(o,u),coffeeShop:(o,u)=>this.buildCoffeeShop(o,u)}[e];l&&(this.nodes=l(i,r))}stop(){if(this.nodes){for(const e of this.nodes.intervals)clearInterval(e);for(const e of this.nodes.timeouts)clearTimeout(e);for(const e of this.nodes.sources)try{e.stop()}catch{}for(const e of this.nodes.gains)e.disconnect();this.nodes.master.disconnect(),this.nodes=null,this.currentPreset="off"}}setVolume(e){if(this.volume=Math.max(0,Math.min(1,e)),this.nodes){const t=this.getCtx();this.nodes.master.gain.setValueAtTime(this.volume,t.currentTime)}}getVolume(){return this.volume}getCurrentPreset(){return this.currentPreset}isPlaying(){return this.nodes!==null&&this.currentPreset!=="off"}dispose(){this.stop(),this.ctx&&(this.ctx.close().catch(()=>{}),this.ctx=null)}}const Ch=new mL,Ww=[{id:"claude",label:"Claude"},{id:"gemini",label:"Gemini"},{id:"codex",label:"Codex"},{id:"openclaw",label:"OpenClaw"}],gL=vs.getSoundNames(),yL=[{value:"off",label:"Off"},{value:"rain",label:"Rain"},{value:"lofi",label:"Lo-fi Hum"},{value:"serverRoom",label:"Server Room"},{value:"deepSpace",label:"Deep Space"},{value:"coffeeShop",label:"Coffee Shop"}];function _L(){const[n,e]=W.useState("claude"),t=Wt(b=>b.soundSettings.enabled),i=Wt(b=>b.soundSettings.volume),r=Wt(b=>b.updateSoundSettings),a=Wt(b=>b.soundSettings.perCli),l=Wt(b=>b.updateCliSoundConfig),o=Wt(b=>b.setCliActionSound),u=Wt(b=>b.ambientSettings),h=Wt(b=>b.updateAmbientSettings),p=Wt(b=>b.activityFeedVisible),f=Wt(b=>b.setActivityFeedVisible),m=Wt(b=>b.toastEnabled),g=Wt(b=>b.setToastEnabled),_=a[n];function w(b){vs.preview(b)}function v(b){h({preset:b}),b==="off"?Ch.stop():u.enabled&&Ch.start(b,u.volume)}function x(b){h({enabled:b}),b&&u.preset!=="off"?Ch.start(u.preset,u.volume):Ch.stop()}function S(b){h({volume:b}),Ch.setVolume(b)}return T.jsxs("div",{children:[T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Master Sound"}),T.jsxs("div",{className:Ke.soundControls,children:[T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:t,onChange:b=>r({enabled:b.target.checked})}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Enable sound effects"})]}),T.jsxs("div",{className:Ke.volumeControl,children:[T.jsx("span",{children:"Master Volume"}),T.jsx("input",{type:"range",min:0,max:1,step:.05,value:i,onChange:b=>r({volume:Number(b.target.value)})}),T.jsxs("span",{className:Ke.volumeDisplay,children:[Math.round(i*100),"%"]})]})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Per-CLI Sound Profiles"}),T.jsx("div",{className:Ke.tabs,style:{marginBottom:0,paddingLeft:0},children:Ww.map(b=>T.jsx("button",{className:`${Ke.tab}${n===b.id?` ${Ke.active}`:""}`,onClick:()=>e(b.id),children:b.label},b.id))}),T.jsxs("div",{style:{padding:"12px 0"},children:[T.jsxs("div",{className:Ke.soundControls,style:{marginBottom:12},children:[T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:_.enabled,onChange:b=>l(n,{enabled:b.target.checked})}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsxs("span",{children:["Enable ",Ww.find(b=>b.id===n)?.label," sounds"]})]}),T.jsxs("div",{className:Ke.volumeControl,children:[T.jsx("span",{children:"Volume"}),T.jsx("input",{type:"range",min:0,max:1,step:.05,value:_.volume,onChange:b=>l(n,{volume:Number(b.target.value)})}),T.jsxs("span",{className:Ke.volumeDisplay,children:[Math.round(_.volume*100),"%"]})]})]}),T.jsx("div",{className:Ke.soundActionGrid,children:vO.map(b=>T.jsxs("div",{children:[T.jsx("div",{className:Ke.soundCategoryLabel,children:b.label}),b.actions.map(C=>{const O=_.actions[C]??"none";return T.jsxs("div",{className:Ke.soundActionRow,children:[T.jsx("span",{className:Ke.soundActionLabel,children:bO[C]}),T.jsx("select",{className:Ke.soundActionSelect,value:O,onChange:M=>o(n,C,M.target.value),children:gL.map(M=>T.jsx("option",{value:M,children:M},M))}),T.jsx("button",{className:Ke.soundPreviewBtn,title:"Preview sound",onClick:()=>w(O),children:"▶"})]},C)})]},b.label))})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Ambient & White Noise"}),T.jsxs("div",{className:Ke.soundControls,children:[T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:u.enabled,onChange:b=>x(b.target.checked)}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Enable ambient sounds"})]}),T.jsxs("div",{className:Ke.volumeControl,children:[T.jsx("span",{children:"Volume"}),T.jsx("input",{type:"range",min:0,max:1,step:.05,value:u.volume,onChange:b=>S(Number(b.target.value))}),T.jsxs("span",{className:Ke.volumeDisplay,children:[Math.round(u.volume*100),"%"]})]}),T.jsxs("div",{className:Ke.soundActionRow,style:{padding:0},children:[T.jsx("span",{className:Ke.soundActionLabel,children:"Preset"}),T.jsx("select",{className:Ke.soundActionSelect,style:{width:140},value:u.preset,onChange:b=>v(b.target.value),children:yL.map(b=>T.jsx("option",{value:b.value,children:b.label},b.value))})]}),T.jsxs("label",{className:Ke.toggleLabel,style:{marginTop:8},children:[T.jsx("input",{type:"checkbox",checked:u.roomSounds,onChange:b=>h({roomSounds:b.target.checked})}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Room activity sounds"})]}),u.roomSounds&&T.jsxs("div",{className:Ke.volumeControl,children:[T.jsx("span",{children:"Room Volume"}),T.jsx("input",{type:"range",min:0,max:1,step:.05,value:u.roomVolume,onChange:b=>h({roomVolume:Number(b.target.value)})}),T.jsxs("span",{className:Ke.volumeDisplay,children:[Math.round(u.roomVolume*100),"%"]})]})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Notifications"}),T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:p,onChange:b=>f(b.target.checked)}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Show activity feed"})]}),T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:m,onChange:b=>g(b.target.checked)}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Show toast notifications"})]})]})]})}const bL=[{value:"high",label:"High",desc:"All events (full monitoring)"},{value:"medium",label:"Medium",desc:"Balanced (default)"},{value:"low",label:"Low",desc:"Minimal (start/stop only)"}];function vL(){const n=Wt(b=>b.hookDensity),e=Wt(b=>b.setHookDensity),t=Wt(b=>b.autoSendQueue),i=Wt(b=>b.setAutoSendQueue),r=Wt(b=>b.defaultTerminalTheme),a=Wt(b=>b.setDefaultTerminalTheme),[l,o]=W.useState(null),[u,h]=W.useState(n==="off"?"medium":n),[p,f]=W.useState(!1),[m,g]=W.useState(!1),[_,w]=W.useState(null),v=W.useCallback(async()=>{try{const C=await(await fetch("/api/hooks/status")).json();o(C),C.installed&&C.density!=="off"&&C.density!=="custom"&&h(C.density)}catch{o(null)}},[]);W.useEffect(()=>{v()},[v]);async function x(){f(!0),w(null);try{const b=await fetch("/api/hooks/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({density:u})}),C=await b.json();if(!b.ok)throw new Error(C.error||"Install failed");e(u),await v()}catch(b){w(b instanceof Error?b.message:"Install failed")}finally{f(!1)}}async function S(){g(!0),w(null);try{const b=await fetch("/api/hooks/uninstall",{method:"POST"}),C=await b.json();if(!b.ok)throw new Error(C.error||"Uninstall failed");e("off"),await v()}catch(b){w(b instanceof Error?b.message:"Uninstall failed")}finally{g(!1)}}return T.jsxs("div",{children:[T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Hook Density"}),T.jsx("p",{className:Ke.settingsHint,children:"Controls which Claude events are monitored. Higher density provides more detail but slightly increases hook overhead."}),T.jsx("div",{className:Ke.densityControl,children:bL.map(b=>T.jsxs("button",{className:`${Ke.densityBtn}${u===b.value?` ${Ke.active}`:""}`,onClick:()=>h(b.value),children:[T.jsx("span",{className:Ke.densityBtnLabel,children:b.label}),T.jsx("span",{className:Ke.densityBtnDesc,children:b.desc})]},b.value))}),T.jsxs("div",{className:Ke.densityActions,children:[T.jsx("button",{className:Ke.fontBtn,onClick:x,disabled:p,children:p?"Installing...":l?.installed?"Re-install":"Install"}),l?.installed&&T.jsx("button",{className:Ke.fontBtn,onClick:S,disabled:m,children:m?"Removing...":"Uninstall"})]}),T.jsxs("div",{className:Ke.densityStatus,children:[T.jsx("span",{className:`${Ke.hookStatusDot}${l?.installed?` ${Ke.installed}`:""}`}),l?.installed?T.jsxs("span",{children:["Installed: ",T.jsx("strong",{children:l.density})," (",l.events.length," events)"]}):T.jsx("span",{children:"Not installed"})]}),_&&T.jsx("div",{style:{color:"var(--accent-red)",fontSize:"11px",marginTop:"8px"},children:_})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Queue"}),T.jsxs("label",{className:Ke.toggleLabel,children:[T.jsx("input",{type:"checkbox",checked:t,onChange:b=>i(b.target.checked)}),T.jsx("span",{className:Ke.toggleSwitch}),T.jsx("span",{children:"Auto-send queued prompts when session becomes idle"})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Default Terminal Theme"}),T.jsxs("select",{style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-accent)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",padding:"6px 10px",borderRadius:"4px",outline:"none",cursor:"pointer"},value:r,onChange:b=>a(b.target.value),children:[T.jsx("option",{value:"auto",children:"Auto (match dashboard)"}),T.jsx("option",{value:"dark",children:"Dark"}),T.jsx("option",{value:"light",children:"Light"}),T.jsx("option",{value:"solarized-dark",children:"Solarized Dark"}),T.jsx("option",{value:"solarized-light",children:"Solarized Light"}),T.jsx("option",{value:"dracula",children:"Dracula"}),T.jsx("option",{value:"monokai",children:"Monokai"})]})]})]})}function p_({label:n,provider:e,placeholder:t}){const i={anthropic:"anthropicApiKey",openai:"openaiApiKey",gemini:"geminiApiKey"},r=Wt(w=>w[i[e]]),a=Wt(w=>w.setApiKey),[l,o]=W.useState(!1),[u,h]=W.useState(r),[p,f]=W.useState(r?"Key saved in browser":""),[m,g]=W.useState("");function _(){const w=u.trim();a(e,w),w?(f("Saved"),g("var(--accent-green, #4caf50)")):(f("Cleared"),g("var(--text-dim)")),setTimeout(()=>{f(w?"Key saved in browser":""),g("")},2e3)}return T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:n}),T.jsxs("div",{className:Ke.apiKeyRow,children:[T.jsx("input",{type:l?"text":"password",className:Ke.apiKeyInput,placeholder:t,value:u,onChange:w=>h(w.target.value)}),T.jsx("button",{className:Ke.apiKeyToggle,onClick:()=>o(!l),children:l?"HIDE":"SHOW"}),T.jsx("button",{className:Ke.fontBtn,onClick:_,children:"Save"})]}),p&&T.jsx("div",{style:{fontSize:"10px",color:m||"var(--text-dim)",marginTop:"4px"},children:p})]})}function xL(){return T.jsxs("div",{children:[T.jsx("p",{className:Ke.settingsHint,children:"API keys are stored in your browser only (IndexedDB). They are never sent to the server except when explicitly used for summarization or AI features."}),T.jsx(p_,{label:"Anthropic API Key",provider:"anthropic",placeholder:"sk-ant-..."}),T.jsx(p_,{label:"OpenAI API Key",provider:"openai",placeholder:"sk-..."}),T.jsx(p_,{label:"Google (Gemini) API Key",provider:"gemini",placeholder:"AI..."})]})}function SL(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function wL(){const[n,e]=W.useState([]),[t,i]=W.useState(null),[r,a]=W.useState(""),[l,o]=W.useState(""),u=W.useCallback(async()=>{try{const _=await $t.summaryPrompts.toArray();e(_)}catch{e([])}},[]);W.useEffect(()=>{u()},[u]);async function h(){const _=r.trim(),w=l.trim();if(!_||!w)return;const v=Date.now();if(t!==null){const x=await $t.summaryPrompts.get(t);x&&await $t.summaryPrompts.put({...x,name:_,prompt:w,updatedAt:v})}else await $t.summaryPrompts.add({name:_,prompt:w,isDefault:0,createdAt:v,updatedAt:v});a(""),o(""),i(null),await u()}async function p(_){const w=await $t.summaryPrompts.toArray();for(const x of w)x.isDefault&&x.id!==_&&await $t.summaryPrompts.put({...x,isDefault:0,updatedAt:Date.now()});const v=w.find(x=>x.id===_);v&&await $t.summaryPrompts.put({...v,isDefault:1,updatedAt:Date.now()}),await u()}async function f(_){const w=await $t.summaryPrompts.get(_);w&&(i(_),a(w.name),o(w.prompt))}async function m(_){await $t.summaryPrompts.delete(_),await u()}function g(){i(null),a(""),o("")}return T.jsx("div",{children:T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Summary Prompt Templates"}),T.jsx("p",{className:Ke.settingsHint,children:"Manage templates for AI-generated session summaries. Star a template to make it the default."}),T.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px",marginBottom:"14px",maxHeight:"300px",overflowY:"auto"},children:n.length===0?T.jsx("div",{style:{color:"var(--text-dim)",padding:"8px",fontSize:"12px"},children:"No prompt templates"}):n.map(_=>T.jsxs("div",{style:{padding:"8px 12px",border:`1px solid ${_.isDefault?"rgba(0, 229, 255, 0.25)":"var(--border-subtle)"}`,borderRadius:"6px",background:"var(--bg-card)"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[T.jsx("button",{onClick:()=>_.id!=null&&p(_.id),title:_.isDefault?"Default":"Set as default",style:{background:"none",border:"none",color:_.isDefault?"var(--accent-cyan)":"var(--text-dim)",cursor:"pointer",fontSize:"14px",padding:"0 2px"},children:"★"}),T.jsx("span",{style:{flex:1,fontSize:"12px",fontWeight:500,color:"var(--text-primary)"},children:SL(_.name)}),_.isDefault?T.jsx("span",{style:{fontSize:"9px",padding:"1px 5px",borderRadius:"3px",background:"rgba(0, 229, 255, 0.1)",color:"var(--accent-cyan)",border:"1px solid rgba(0, 229, 255, 0.2)",textTransform:"uppercase"},children:"DEFAULT"}):null,T.jsx("button",{onClick:()=>_.id!=null&&f(_.id),title:"Edit",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",cursor:"pointer",borderRadius:"3px",padding:"1px 5px",fontSize:"12px"},children:"✎"}),T.jsx("button",{onClick:()=>_.id!=null&&m(_.id),title:"Delete",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",cursor:"pointer",borderRadius:"3px",padding:"1px 5px",fontSize:"12px"},children:"×"})]}),T.jsxs("div",{style:{fontSize:"10px",color:"var(--text-dim)",marginTop:"4px",lineHeight:1.3,maxHeight:"28px",overflow:"hidden"},children:[_.prompt.substring(0,120),_.prompt.length>120?"...":""]})]},_.id))}),T.jsxs("div",{style:{marginTop:"10px"},children:[T.jsx("input",{type:"text",placeholder:"Template name",value:r,onChange:_=>a(_.target.value),style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-subtle)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",borderRadius:"6px",padding:"8px 10px",marginBottom:"8px",outline:"none",boxSizing:"border-box"}}),T.jsx("textarea",{placeholder:"Prompt template text...",value:l,onChange:_=>o(_.target.value),rows:4,style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-subtle)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",borderRadius:"6px",padding:"8px 10px",marginBottom:"8px",resize:"vertical",outline:"none",boxSizing:"border-box"}}),T.jsxs("div",{style:{display:"flex",gap:"8px"},children:[T.jsx("button",{className:Ke.fontBtn,onClick:h,children:t!==null?"Update Template":"Add Template"}),t!==null&&T.jsx("button",{className:Ke.fontBtn,onClick:g,children:"Cancel"})]})]})]})})}const CL=[{id:"appearance",label:"APPEARANCE"},{id:"sound",label:"SOUND"},{id:"hooks",label:"HOOKS"},{id:"apikeys",label:"API KEYS"},{id:"advanced",label:"ADVANCED"}];function EL(){const[n,e]=W.useState("appearance"),t=Wt(o=>o.autosaveVisible),i=Wt(o=>o.resetDefaults),r=W.useRef(null);function a(){const o=Wt.getState(),u={},h=new Set(["loadFromDb","saveToDb","updateSoundSettings","updateLabelAlarms","setThemeName","setTheme","setFontSize","setScanlineEnabled","setAnimationIntensity","setAnimationSpeed","setCharacterModel","setHookDensity","setCompactMode","setShowArchived","setGroupBy","setSortBy","setActivityFeedVisible","setToastEnabled","setAutoSendQueue","setDefaultTerminalTheme","setSoundAction","setMovementAction","setApiKey","persistSetting","flashAutosave","resetDefaults","autosaveVisible"]);for(const[g,_]of Object.entries(o))!h.has(g)&&typeof _!="function"&&(u[g]=_);const p=new Blob([JSON.stringify(u,null,2)],{type:"application/json"}),f=URL.createObjectURL(p),m=document.createElement("a");m.href=f,m.download="claude-dashboard-settings.json",m.click(),URL.revokeObjectURL(f)}async function l(o){try{const u=await o.text(),h=JSON.parse(u),p=Wt.getState();p.loadFromDb(h);for(const[f,m]of Object.entries(h))typeof m!="function"&&await p.persistSetting(f,typeof m=="object"?JSON.stringify(m):m)}catch{}}return T.jsx(cm,{modalId:"settings",title:"Settings",children:T.jsxs("div",{className:Ke.panel,children:[T.jsx("div",{className:`${Ke.autosaveIndicator}${t?` ${Ke.visible}`:""}`,style:{marginBottom:"8px"},children:"SAVED"}),T.jsx("div",{className:Ke.tabs,children:CL.map(o=>T.jsx("button",{className:`${Ke.tab}${n===o.id?` ${Ke.active}`:""}`,onClick:()=>e(o.id),children:o.label},o.id))}),T.jsxs("div",{style:{padding:"16px 0",overflowY:"auto",maxHeight:"55vh"},children:[n==="appearance"&&T.jsx(fL,{}),n==="sound"&&T.jsx(_L,{}),n==="hooks"&&T.jsx(vL,{}),n==="apikeys"&&T.jsx(xL,{}),n==="advanced"&&T.jsx(kL,{onExport:a,onImportClick:()=>r.current?.click(),onReset:i})]}),T.jsx("input",{ref:r,type:"file",accept:".json",style:{display:"none"},onChange:o=>{const u=o.target.files?.[0];u&&l(u),o.target.value=""}})]})})}function AL(){const n=bi(e=>e.openModal);return T.jsx("button",{onClick:()=>n("settings"),title:"Settings",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",fontSize:"18px",cursor:"pointer",padding:"4px 10px",borderRadius:"4px",transition:"all 0.2s",marginLeft:"8px"},children:"⚙"})}function kL({onExport:n,onImportClick:e,onReset:t}){return T.jsxs("div",{children:[T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Summary Prompts"}),T.jsx(wL,{})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Import / Export"}),T.jsx("p",{className:Ke.settingsHint,children:"Export all settings to a JSON file, or import settings from a previously exported file."}),T.jsxs("div",{className:Ke.advancedActions,children:[T.jsx("button",{className:Ke.fontBtn,onClick:n,children:"Export Settings"}),T.jsx("button",{className:Ke.fontBtn,onClick:e,children:"Import Settings"})]})]}),T.jsxs("div",{className:Ke.section,children:[T.jsx("h4",{children:"Reset"}),T.jsx("p",{className:Ke.settingsHint,children:"Reset all settings to their default values. This cannot be undone."}),T.jsx("button",{className:Ke.fontBtn,style:{color:"var(--accent-red)",borderColor:"var(--accent-red)"},onClick:t,children:"Reset to Defaults"})]})]})}const TL="_header_19eax_6",ML="_title_19eax_18",RL="_stats_19eax_35",m_={header:TL,title:ML,stats:RL};function OL(){return T.jsxs("header",{className:m_.header,children:[T.jsx("div",{className:m_.title,children:"AI AGENT SESSION CENTER"}),T.jsx("div",{className:m_.stats,children:T.jsx(AL,{})})]})}function NL(n,e,t=!0){W.useEffect(()=>{if(!t)return;function i(r){n.current&&!n.current.contains(r.target)&&e()}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,e,t])}const DL=3e3,d0=new Set;function kt(n,e="info",t=DL){const i={id:`${Date.now()}-${Math.random().toString(36).slice(2,6)}`,message:n,type:e,duration:t};for(const r of d0)r(i)}const IL={info:"var(--accent-cyan, #00e5ff)",success:"var(--accent-green, #00ff88)",error:"var(--accent-red, #ff3355)",warning:"var(--accent-orange, #ff9100)"};function LL(){const[n,e]=W.useState([]),t=W.useCallback(i=>{e(r=>[...r,i])},[]);return W.useEffect(()=>(d0.add(t),()=>{d0.delete(t)}),[t]),W.useEffect(()=>{if(n.length===0)return;const i=n.map(r=>setTimeout(()=>{e(a=>a.filter(l=>l.id!==r.id))},r.duration));return()=>i.forEach(clearTimeout)},[n]),n.length===0?null:T.jsx("div",{className:lt.toastContainer,children:n.map(i=>T.jsx("div",{className:lt.toast,style:{borderColor:IL[i.type]},children:T.jsx("span",{className:lt.toastMsg,children:i.message})},i.id))})}const BL="workdir-history";function $w(){try{return JSON.parse(localStorage.getItem(BL)||"[]")}catch{return[]}}function zL(n,e){const t=new Set(n),i=[...n];for(const r of e)t.has(r)||(t.add(r),i.push(r));return i}function Eb(){const[n,e]=W.useState(()=>$w());return W.useEffect(()=>{let t=!1;return fetch("/api/known-projects").then(i=>i.json()).then(i=>{if(t)return;const r=$w();e(zL(r,i.paths??[]))}).catch(()=>{}),()=>{t=!0}},[]),n}const PL="_wrapper_1lqre_6",FL="_triggerBtn_1lqre_10",UL="_open_1lqre_30",jL="_dropdown_1lqre_37",HL="_dropdownHeader_1lqre_62",qL="_dirItem_1lqre_75",VL="_dirInfo_1lqre_94",WL="_dirName_1lqre_102",$L="_dirPath_1lqre_112",GL="_dirRemove_1lqre_121",KL="_empty_1lqre_146",gs={wrapper:PL,triggerBtn:FL,open:UL,dropdown:jL,dropdownHeader:HL,dirItem:qL,dirInfo:VL,dirName:WL,dirPath:$L,dirRemove:GL,empty:KL},C2="workdir-history",YL="lastSession";function XL(){try{return JSON.parse(localStorage.getItem(C2)||"[]")}catch{return[]}}function ZL(n){localStorage.setItem(C2,JSON.stringify(n))}function JL(){try{return JSON.parse(localStorage.getItem(YL)||"{}")}catch{return{}}}function Gw(n){const e=n.replace(/\/+$/,"");if(e==="~"||e==="/")return e;const t=e.split("/");return t[t.length-1]||e}function QL(){const[n,e]=W.useState(!1),[t,i]=W.useState([]),r=Eb(),a=W.useRef(null),l=W.useCallback(()=>e(!1),[]);NL(a,l,n),W.useEffect(()=>{if(n){const h=XL(),p=new Set(h),f=[...h];for(const m of r)p.has(m)||(p.add(m),f.push(m));i(f)}},[n,r]),W.useEffect(()=>{if(!n)return;function h(p){p.key==="Escape"&&(p.stopPropagation(),l())}return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n,l]);async function o(h){l();const p=JL();try{const m=await(await fetch("/api/terminals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:p.host||window.location.hostname||"localhost",port:p.port||void 0,username:p.username||void 0,authMethod:p.authMethod||void 0,privateKeyPath:p.privateKeyPath||void 0,workingDir:h,command:p.command||"claude"})})).json();m.ok?(m.terminalId&&gn.getState().selectSession(m.terminalId),kt(`Session launched in ${Gw(h)}`,"success")):kt(m.error||"Failed to launch session","error")}catch{kt("Network error launching session","error")}}function u(h,p){p.stopPropagation();const f=t.filter(m=>m!==h);i(f),ZL(f)}return T.jsxs("div",{className:gs.wrapper,ref:a,children:[T.jsx("button",{className:`${gs.triggerBtn} ${n?gs.open:""}`,onClick:()=>e(h=>!h),title:"Recent working directories",children:"DIRS"}),n&&T.jsxs("div",{className:gs.dropdown,children:[T.jsx("div",{className:gs.dropdownHeader,children:"Recent Directories"}),t.length===0?T.jsx("div",{className:gs.empty,children:"No directory history yet. Launch a session to start recording."}):t.map(h=>T.jsxs("div",{className:gs.dirItem,onClick:()=>o(h),title:`Launch session in ${h}`,children:[T.jsxs("div",{className:gs.dirInfo,children:[T.jsx("span",{className:gs.dirName,children:Gw(h)}),T.jsx("span",{className:gs.dirPath,children:h})]}),T.jsx("button",{className:gs.dirRemove,onClick:p=>u(h,p),title:"Remove from history",children:"x"})]},h))]})]})}const eB="_nav_agtd9_8",tB="_navBtn_agtd9_20",nB="_active_agtd9_28",iB="_spacer_agtd9_30",rB="_actions_agtd9_34",sB="_actionsItems_agtd9_35",aB="_qaBtn_agtd9_45",oB="_terminal_agtd9_54",lB="_quick_agtd9_56",cB="_shortcutsBtn_agtd9_61",ys={nav:eB,navBtn:tB,active:nB,spacer:iB,actions:rB,actionsItems:sB,qaBtn:aB,terminal:oB,quick:lB,shortcutsBtn:cB},uB=[{to:"/",label:"LIVE"},{to:"/history",label:"HISTORY"},{to:"/timeline",label:"TIMELINE"},{to:"/analytics",label:"ANALYTICS"},{to:"/queue",label:"QUEUE"}];function hB(){const n=bi(e=>e.openModal);return T.jsxs("nav",{className:ys.nav,children:[T.jsxs("div",{className:ys.actions,children:[T.jsxs("div",{className:ys.actionsItems,children:[T.jsx("button",{className:`${ys.qaBtn} ${ys.terminal}`,onClick:()=>n("new-session"),children:"+ NEW"}),T.jsx("button",{className:`${ys.qaBtn} ${ys.quick}`,onClick:()=>n("quick-session"),children:"QUICK"}),T.jsx(QL,{})]}),T.jsx("button",{className:ys.shortcutsBtn,onClick:()=>n("shortcuts"),title:"Keyboard shortcuts (?)",children:"?"})]}),T.jsx("div",{className:ys.spacer}),uB.map(e=>T.jsx(NE,{to:e.to,end:e.to==="/",className:({isActive:t})=>`${ys.navBtn} ${t?ys.active:""}`,children:e.label},e.to))]})}const dB="_feed_ffix7_29",fB="_feedHeader_ffix7_36",pB="_feedEntries_ffix7_43",mB="_entry_ffix7_48",gB="_feedTime_ffix7_54",yB="_feedProject_ffix7_55",_B="_feedDetail_ffix7_56",bB="_collapseBtn_ffix7_62",vB="_collapsed_ffix7_69",Hs={feed:dB,feedHeader:fB,feedEntries:pB,entry:mB,feedTime:gB,feedProject:yB,feedDetail:_B,collapseBtn:bB,collapsed:vB};function xB(){const n=gn(l=>l.sessions),e=bi(l=>l.activityFeedOpen),t=bi(l=>l.setActivityFeedOpen),i=gn(l=>l.selectSession),[r]=W.useState(50),a=W.useMemo(()=>{const l=[];for(const o of n.values())for(const u of o.events)l.push({sessionId:o.sessionId,projectName:o.projectName||"Unknown",type:u.type,detail:u.detail,timestamp:u.timestamp});return l.sort((o,u)=>u.timestamp-o.timestamp),l.slice(0,r)},[n,r]);return T.jsxs("div",{className:`${Hs.feed} ${e?"":Hs.collapsed}`,children:[T.jsxs("div",{className:Hs.feedHeader,children:[T.jsxs("span",{children:["ACTIVITY FEED (",a.length,")"]}),T.jsx("button",{className:Hs.collapseBtn,onClick:()=>t(!e),children:e?"▼":"▲"})]}),e&&T.jsxs("div",{className:Hs.feedEntries,children:[a.length===0&&T.jsx("div",{className:Hs.entry,style:{textAlign:"center",color:"var(--text-dim)"},children:"No activity yet"}),a.map((l,o)=>T.jsxs("div",{onClick:()=>i(l.sessionId),className:Hs.entry,style:{cursor:"pointer"},children:[T.jsx("span",{className:Hs.feedTime,children:new Date(l.timestamp).toLocaleTimeString()}),T.jsx("span",{className:Hs.feedProject,children:l.projectName}),T.jsxs("span",{className:Hs.feedDetail,children:["[",l.type,"] ",l.detail]})]},`${l.sessionId}-${l.timestamp}-${o}`))]})]})}const SB="_wrapper_1rshg_1",wB="_inputWrapper_1rshg_5",CB="_input_1rshg_5",EB="_arrowBtn_1rshg_30",AB="_arrowBtnOpen_1rshg_52",kB="_dropdown_1rshg_57",TB="_item_1rshg_84",MB="_itemHighlighted_1rshg_101",RB="_empty_1rshg_107",qs={wrapper:SB,inputWrapper:wB,input:CB,arrowBtn:EB,arrowBtnOpen:AB,dropdown:kB,item:TB,itemHighlighted:MB,empty:RB};function xl({value:n,onChange:e,items:t,placeholder:i,className:r}){const[a,l]=W.useState(!1),[o,u]=W.useState(-1),[h,p]=W.useState(!1),f=W.useRef(null),m=W.useRef(null),g=W.useRef(null);W.useEffect(()=>{if(!a)return;function b(C){f.current&&!f.current.contains(C.target)&&l(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);const _=W.useMemo(()=>{if(h||!n.trim())return t;const b=n.toLowerCase();return t.filter(C=>C.toLowerCase().includes(b))},[t,n,h]);W.useEffect(()=>{u(-1)},[_]),W.useEffect(()=>{o>=0&&m.current&&m.current.children[o]?.scrollIntoView({block:"nearest"})},[o]);function w(b){e(b.target.value),p(!1),a||l(!0)}function v(){a?l(!1):(p(!0),l(!0),g.current?.focus())}function x(b){e(b),l(!1),u(-1)}function S(b){b.key==="ArrowDown"?(b.preventDefault(),a||(p(!0),l(!0)),u(C=>C<_.length-1?C+1:0)):b.key==="ArrowUp"?(b.preventDefault(),a||(p(!0),l(!0)),u(C=>C>0?C-1:_.length-1)):b.key==="Enter"?a&&o>=0&&o<_.length&&(b.preventDefault(),x(_[o])):b.key==="Escape"&&a&&(b.stopPropagation(),l(!1))}return T.jsxs("div",{ref:f,className:`${qs.wrapper} ${r??""}`,children:[T.jsxs("div",{className:qs.inputWrapper,children:[T.jsx("input",{ref:g,value:n,onChange:w,onKeyDown:S,placeholder:i,className:qs.input,role:"combobox","aria-expanded":a,"aria-activedescendant":o>=0?`cb-item-${o}`:void 0,"aria-autocomplete":"list"}),T.jsx("button",{type:"button",className:`${qs.arrowBtn}${a?` ${qs.arrowBtnOpen}`:""}`,onClick:v,tabIndex:-1,"aria-label":"Toggle dropdown",children:"▾"})]}),a&&_.length>0&&T.jsx("ul",{ref:m,className:qs.dropdown,role:"listbox",children:_.map((b,C)=>T.jsx("li",{id:`cb-item-${C}`,role:"option","aria-selected":C===o,className:`${qs.item} ${C===o?qs.itemHighlighted:""}`,onMouseDown:O=>{O.preventDefault(),x(b)},onMouseEnter:()=>u(C),children:b},b))}),a&&_.length===0&&T.jsx("div",{className:qs.dropdown,children:T.jsx("div",{className:qs.empty,children:"No matches"})})]})}const E2="workdir-history",OB=20,A2="lastSession";function NB(){try{return JSON.parse(localStorage.getItem(A2)||"{}")}catch{return{}}}function DB(n){try{localStorage.setItem(A2,JSON.stringify(n))}catch{}}function IB(){try{return JSON.parse(localStorage.getItem(E2)||"[]")}catch{return[]}}function LB(n){if(!n)return;const e=IB().filter(t=>t!==n);e.unshift(n),localStorage.setItem(E2,JSON.stringify(e.slice(0,OB)))}const k2="command-history",BB=20,zB=["claude","claude --resume","claude --continue","claude --model sonnet","claude --model opus","claude --dangerously-skip-permissions","claude --verbose","gemini","codex","aider"];function T2(){try{return JSON.parse(localStorage.getItem(k2)||"[]")}catch{return[]}}function PB(){const n=T2(),e=new Set(n),t=[...n];for(const i of zB)e.has(i)||t.push(i);return t}function FB(n){if(!n)return;const e=T2().filter(t=>t!==n);e.unshift(n),localStorage.setItem(k2,JSON.stringify(e.slice(0,BB)))}function UB(){const n=bi(Ee=>Ee.closeModal),[e]=W.useState(()=>NB()),[t,i]=W.useState(e.host||window.location.hostname||""),[r,a]=W.useState(String(e.port||22)),[l,o]=W.useState(e.username||""),[u,h]=W.useState(e.authMethod||"key"),[p,f]=W.useState(e.privateKeyPath||""),[m,g]=W.useState(""),[_,w]=W.useState(e.workingDir||"~"),[v,x]=W.useState(e.command||""),[S,b]=W.useState(""),[C,O]=W.useState(""),[M,D]=W.useState(""),[N,L]=W.useState(!1),[j,K]=W.useState({}),[Y,H]=W.useState([]),Q=Eb(),te=W.useMemo(()=>PB(),[]);W.useEffect(()=>{fetch("/api/ssh-keys").then(Ee=>Ee.json()).then(Ee=>H(Ee.keys??[])).catch(()=>{})},[]);const $=Ee=>()=>K(Ie=>({...Ie,[Ee]:!0})),J=Number(r),re=Number.isInteger(J)&&J>=1&&J<=65535,F=t.trim().length>0,B=l.trim().length>0,U=_.trim().length>0,X=v.trim().length>0,V=re&&F&&B&&U&&X;async function _e(){if(K({host:!0,port:!0,username:!0,workingDir:!0,command:!0}),N||!V)return;L(!0);const Ee={host:t||window.location.hostname||"localhost",port:J||22,username:l||"",authMethod:u,privateKeyPath:u==="key"&&p?p:void 0,password:u==="password"&&m?m:void 0,workingDir:_||"~",command:v||void 0,apiKey:S||void 0,sessionTitle:C||void 0,label:M||void 0};try{const ae=await(await fetch("/api/terminals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ee)})).json();ae.ok?(LB(_),v&&FB(v),DB({host:Ee.host,port:Ee.port,username:Ee.username,authMethod:u,privateKeyPath:u==="key"?p:void 0,workingDir:_||"~",command:v||void 0}),ae.terminalId&&gn.getState().selectSession(ae.terminalId),kt("Terminal session created","success"),n()):kt(ae.error||"Failed to create terminal","error")}catch{kt("Network error creating terminal","error")}finally{L(!1)}}return T.jsxs(cm,{modalId:"new-session",title:"New Terminal Session",panelClassName:lt.newSessionPanel,children:[T.jsxs("div",{className:lt.newSessionBody,children:[T.jsxs("div",{className:lt.sshFieldRow,children:[T.jsxs("div",{className:`${lt.sshField} ${lt.sshFieldGrow}`,children:[T.jsxs("label",{children:["Host ",T.jsx("span",{className:lt.sshFieldRequired,children:"*"})]}),T.jsx("input",{value:t,onChange:Ee=>i(Ee.target.value),onBlur:$("host"),placeholder:"hostname / IP / domain",style:j.host&&!F?{borderColor:"#ff5555"}:void 0}),j.host&&!F&&T.jsx("span",{className:lt.sshFieldError,children:"Required"})]}),T.jsxs("div",{className:`${lt.sshField} ${lt.sshFieldSmall}`,children:[T.jsxs("label",{children:["Port ",T.jsx("span",{className:lt.sshFieldRequired,children:"*"})]}),T.jsx("input",{value:r,onChange:Ee=>a(Ee.target.value),onBlur:$("port"),placeholder:"22",style:r&&!re?{borderColor:"#ff5555"}:void 0}),r&&!re&&T.jsx("span",{className:lt.sshFieldError,children:"1-65535"})]})]}),T.jsxs("div",{className:lt.sshField,children:[T.jsxs("label",{children:["Username ",T.jsx("span",{className:lt.sshFieldRequired,children:"*"})]}),T.jsx("input",{value:l,onChange:Ee=>o(Ee.target.value),onBlur:$("username"),placeholder:"e.g. root",style:j.username&&!B?{borderColor:"#ff5555"}:void 0}),j.username&&!B&&T.jsx("span",{className:lt.sshFieldError,children:"Required"})]}),T.jsxs("div",{className:lt.sshField,children:[T.jsx("label",{children:"Auth Method"}),T.jsx(xl,{value:u==="key"?"SSH Key":"Password",onChange:Ee=>h(Ee==="Password"?"password":"key"),items:["SSH Key","Password"],placeholder:"SSH Key"})]}),u==="key"?T.jsxs("div",{className:lt.sshField,children:[T.jsxs("label",{children:["Private Key Path ",T.jsx("span",{className:lt.sshFieldHint,children:"(optional)"})]}),T.jsx(xl,{value:p,onChange:f,items:Y.map(Ee=>Ee.path),placeholder:"Default (~/.ssh/id_*)"})]}):T.jsxs("div",{className:lt.sshField,children:[T.jsx("label",{children:"Password"}),T.jsx("input",{type:"password",value:m,onChange:Ee=>g(Ee.target.value),placeholder:"SSH password"})]}),T.jsxs("div",{className:lt.sshField,children:[T.jsxs("label",{children:["Working Directory ",T.jsx("span",{className:lt.sshFieldRequired,children:"*"})]}),T.jsx(xl,{value:_,onChange:w,items:Q,placeholder:"~"}),j.workingDir&&!U&&T.jsx("span",{className:lt.sshFieldError,children:"Required"})]}),T.jsxs("div",{className:lt.sshField,children:[T.jsxs("label",{children:["Command ",T.jsx("span",{className:lt.sshFieldRequired,children:"*"})," ",T.jsx("span",{className:lt.sshFieldHint,children:"(runs after connect)"})]}),T.jsx(xl,{value:v,onChange:x,items:te,placeholder:"e.g. claude"}),j.command&&!X&&T.jsx("span",{className:lt.sshFieldError,children:"Required"})]}),T.jsxs("div",{className:lt.sshFieldRow,children:[T.jsxs("div",{className:`${lt.sshField} ${lt.sshFieldGrow}`,children:[T.jsx("label",{children:"Session Title"}),T.jsx("input",{value:C,onChange:Ee=>O(Ee.target.value),placeholder:"Optional"})]}),T.jsxs("div",{className:`${lt.sshField} ${lt.sshFieldGrow}`,children:[T.jsx("label",{children:"Label"}),T.jsx(xl,{value:M,onChange:D,items:["ONEOFF","HEAVY","IMPORTANT"],placeholder:"None"})]})]}),T.jsxs("div",{className:lt.sshField,children:[T.jsxs("label",{children:["API Key ",T.jsx("span",{className:lt.sshFieldHint,children:"(override ANTHROPIC_API_KEY)"})]}),T.jsx("input",{type:"password",value:S,onChange:Ee=>b(Ee.target.value),placeholder:"Optional"})]})]}),T.jsxs("div",{className:lt.newSessionFooter,children:[T.jsx("button",{type:"button",className:lt.closeBtn,onClick:()=>n(),style:{fontSize:"11px",letterSpacing:"1px"},children:"CANCEL"}),T.jsx("button",{type:"button",onClick:_e,disabled:N||!V,style:{padding:"6px 16px",background:"rgba(0, 229, 255, 0.15)",border:"1px solid var(--accent-cyan)",borderRadius:"4px",color:"var(--accent-cyan)",fontFamily:"var(--font-mono)",fontSize:"11px",fontWeight:700,letterSpacing:"1px",cursor:N?"not-allowed":"pointer",opacity:N?.5:1},children:N?"CREATING...":"CREATE"})]})]})}const Kw=["claude","claude --resume","claude --continue","claude --model sonnet","claude --model opus","gemini","codex","aider"],jB="command-history";function HB(){try{const n=JSON.parse(localStorage.getItem(jB)||"[]"),e=new Set(n),t=[...n];for(const i of Kw)e.has(i)||t.push(i);return t}catch{return Kw}}const M2="custom-labels";function qB(){try{return JSON.parse(localStorage.getItem(M2)||"[]")}catch{return[]}}function Yw(n){localStorage.setItem(M2,JSON.stringify(n))}const VB="workdir-history";function WB(){try{return JSON.parse(localStorage.getItem(VB)||"[]")}catch{return[]}}const mp=["ONEOFF","HEAVY","IMPORTANT"];function $B(){const n=bi(N=>N.closeModal),[e,t]=W.useState(""),[i,r]=W.useState(""),[a,l]=W.useState(qB),[o,u]=W.useState(""),[h,p]=W.useState(()=>WB()[0]||"~"),[f,m]=W.useState("claude"),[g,_]=W.useState(!1),w=Eb(),v=W.useMemo(()=>HB(),[]),x=h.trim().length>0,S=f.trim().length>0,b=x&&S,C=W.useMemo(()=>[...mp,...a.filter(N=>!mp.includes(N))],[a]);function O(){const N=i.trim().toUpperCase();if(!N||C.includes(N))return;const L=[...a,N];l(L),Yw(L),r(""),t(N)}function M(N){if(mp.includes(N))return;const L=a.filter(j=>j!==N);l(L),Yw(L),e===N&&t("")}async function D(){if(!(g||!b)){_(!0);try{const L=await(await fetch("/api/terminals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:window.location.hostname||"localhost",workingDir:h||"~",command:f||"claude",label:e||void 0,sessionTitle:o.trim()||void 0})})).json();L.ok?(kt(`Quick session launched${e?` [${e}]`:""}`,"success"),L.terminalId&&gn.getState().selectSession(L.terminalId),n()):kt(L.error||"Failed to launch session","error")}catch{kt("Network error launching session","error")}finally{_(!1)}}}return T.jsx(cm,{modalId:"quick-session",children:T.jsxs("div",{className:lt.quickSessionPanel,children:[T.jsx("div",{className:lt.quickSessionHeader,children:T.jsx("h3",{children:"QUICK LAUNCH"})}),T.jsxs("div",{className:lt.quickSessionBody,children:[T.jsx("p",{className:lt.quickSessionHint,children:"Launch a local Claude session with optional label"}),T.jsxs("div",{className:lt.quickLabelChips,children:[C.length===0&&T.jsx("span",{className:lt.quickLabelEmpty,children:"No labels configured"}),C.map(N=>T.jsxs("button",{type:"button",className:`${lt.quickLabelChip} ${e===N?lt.active:""}`,onClick:()=>t(e===N?"":N),children:[T.jsx("span",{className:lt.labelText,children:N}),!mp.includes(N)&&T.jsx("span",{className:lt.labelDelete,onClick:L=>{L.stopPropagation(),M(N)},children:"x"})]},N))]}),T.jsx("div",{className:lt.quickLabelInputRow,children:T.jsx("input",{value:i,onChange:N=>r(N.target.value),onKeyDown:N=>N.key==="Enter"&&O(),placeholder:"Add custom label..."})}),T.jsxs("div",{className:lt.quickWorkdirRow,children:[T.jsxs("label",{children:["Session Title ",T.jsx("span",{style:{opacity:.4,fontWeight:400},children:"(optional)"})]}),T.jsx("input",{value:o,onChange:N=>u(N.target.value),placeholder:"Auto-generated if empty"})]}),T.jsxs("div",{className:lt.quickWorkdirRow,children:[T.jsxs("label",{children:["Working Directory ",T.jsx("span",{style:{color:"var(--accent-cyan)",fontWeight:700},children:"*"})]}),T.jsx(xl,{value:h,onChange:p,items:w,placeholder:"~"})]}),T.jsxs("div",{className:lt.quickWorkdirRow,children:[T.jsxs("label",{children:["Command ",T.jsx("span",{style:{color:"var(--accent-cyan)",fontWeight:700},children:"*"})]}),T.jsx(xl,{value:f,onChange:m,items:v,placeholder:"e.g. claude"})]})]}),T.jsxs("div",{className:lt.quickSessionFooter,children:[T.jsx("button",{type:"button",onClick:()=>n(),style:{padding:"6px 14px",background:"transparent",border:"1px solid var(--border-subtle)",borderRadius:"4px",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"11px",letterSpacing:"1px",cursor:"pointer"},children:"CANCEL"}),T.jsx("button",{type:"button",onClick:D,disabled:g||!b,style:{padding:"6px 16px",background:"rgba(0, 229, 255, 0.15)",border:"1px solid var(--accent-cyan)",borderRadius:"4px",color:"var(--accent-cyan)",fontFamily:"var(--font-mono)",fontSize:"11px",fontWeight:700,letterSpacing:"1px",cursor:g||!b?"not-allowed":"pointer",opacity:g||!b?.5:1},children:g?"LAUNCHING...":"LAUNCH"})]})]})})}const GB=[{section:"Navigation",items:[{key:"/",description:"Focus search"},{key:"Escape",description:"Close modal / deselect session"},{key:"?",description:"Toggle this panel"}]},{section:"Actions",items:[{key:"T",description:"New terminal session"},{key:"S",description:"Toggle settings"},{key:"M",description:"Mute / unmute all"}]},{section:"Terminal",items:[{key:"Alt+Cmd/Ctrl+R",description:"Refresh terminal"},{key:"Alt+F11",description:"Toggle fullscreen"}]},{section:"Selected Session",items:[{key:"K",description:"Kill selected session"},{key:"A",description:"Archive selected session"}]}];function KB(){return T.jsx(cm,{modalId:"shortcuts",children:T.jsxs("div",{className:lt.shortcutsPanel,children:[T.jsx("div",{className:lt.shortcutsHeader,children:T.jsx("h3",{children:"KEYBOARD SHORTCUTS"})}),T.jsx("div",{className:lt.shortcutsBody,children:GB.map(n=>T.jsxs("div",{className:lt.shortcutsSection,children:[T.jsx("h4",{children:n.section}),T.jsx("div",{className:lt.shortcutList,children:n.items.map(e=>T.jsxs("div",{className:lt.shortcutRow,children:[T.jsx("span",{children:e.description}),T.jsx("kbd",{children:e.key})]},e.key))})]},n.section))})]})})}const YB="_overlay_o56rg_9",XB="_panel_o56rg_20",ZB="_resizing_o56rg_32",JB="_resizeHandle_o56rg_35",QB="_active_o56rg_40",e4="_closeBtn_o56rg_45",t4="_collapseBtn_o56rg_55",n4="_headerCompact_o56rg_66",i4="_headerCompactName_o56rg_74",r4="_header_o56rg_66",s4="_charPreview_o56rg_94",a4="_headerText_o56rg_97",o4="_headerTop_o56rg_98",l4="_headerTitles_o56rg_99",c4="_titleRow_o56rg_102",u4="_meta_o56rg_111",h4="_detailStatusBadge_o56rg_112",d4="_detailModel_o56rg_113",f4="_detailDuration_o56rg_114",p4="_tabs_o56rg_119",m4="_tab_o56rg_119",g4="_splitToggle_o56rg_127",y4="_tabSplit_o56rg_142",_4="_splitView_o56rg_146",b4="_splitLeft_o56rg_152",v4="_splitDivider_o56rg_160",x4="_splitRight_o56rg_172",S4="_tabContent_o56rg_183",w4="_tabEmpty_o56rg_187",C4="_convEntry_o56rg_191",E4="_convUser_o56rg_192",A4="_convRole_o56rg_196",k4="_convTime_o56rg_201",T4="_convText_o56rg_202",M4="_convHeader_o56rg_206",R4="_convCopy_o56rg_207",O4="_activityEntry_o56rg_218",N4="_activityTool_o56rg_219",D4="_activityEvent_o56rg_220",I4="_activityResponse_o56rg_221",L4="_activityTime_o56rg_223",B4="_activityBadge_o56rg_224",z4="_activityBadgeTool_o56rg_225",P4="_activityBadgeEvent_o56rg_226",F4="_activityBadgeResponse_o56rg_227",U4="_activityDetail_o56rg_228",j4="_ctrlBar_o56rg_234",H4="_ctrlBtn_o56rg_235",q4="_resume_o56rg_237",V4="_kill_o56rg_240",W4="_archive_o56rg_242",$4="_alert_o56rg_248",G4="_summarize_o56rg_250",K4="_ctrlSelect_o56rg_256",Y4="_notesCompose_o56rg_262",X4="_noteTextarea_o56rg_263",Z4="_saveNote_o56rg_265",J4="_noteEntry_o56rg_267",Q4="_noteMeta_o56rg_268",e6="_noteTime_o56rg_269",t6="_noteDelete_o56rg_270",n6="_noteText_o56rg_263",i6="_summaryText_o56rg_275",r6="_prevSessionSection_o56rg_278",s6="_prevSessionHeader_o56rg_279",a6="_prevSessionToggle_o56rg_281",o6="_collapsed_o56rg_282",l6="_prevSessionContent_o56rg_283",c6="_prevSessionEntry_o56rg_285",u6="_terminalWithQueue_o56rg_289",h6="_terminalSection_o56rg_296",We={overlay:YB,panel:XB,resizing:ZB,resizeHandle:JB,active:QB,closeBtn:e4,collapseBtn:t4,headerCompact:n4,headerCompactName:i4,header:r4,charPreview:s4,headerText:a4,headerTop:o4,headerTitles:l4,titleRow:c4,meta:u4,detailStatusBadge:h4,detailModel:d4,detailDuration:f4,tabs:p4,tab:m4,splitToggle:g4,tabSplit:y4,splitView:_4,splitLeft:b4,splitDivider:v4,splitRight:x4,tabContent:S4,tabEmpty:w4,convEntry:C4,convUser:E4,convRole:A4,convTime:k4,convText:T4,convHeader:M4,convCopy:R4,activityEntry:O4,activityTool:N4,activityEvent:D4,activityResponse:I4,activityTime:L4,activityBadge:B4,activityBadgeTool:z4,activityBadgeEvent:P4,activityBadgeResponse:F4,activityDetail:U4,ctrlBar:j4,ctrlBtn:H4,resume:q4,kill:V4,archive:W4,delete:"_delete_o56rg_244",alert:$4,summarize:G4,ctrlSelect:K4,notesCompose:Y4,noteTextarea:X4,saveNote:Z4,noteEntry:J4,noteMeta:Q4,noteTime:e6,noteDelete:t6,noteText:n6,summaryText:i6,prevSessionSection:r6,prevSessionHeader:s6,prevSessionToggle:a6,collapsed:o6,prevSessionContent:l6,prevSessionEntry:c6,terminalWithQueue:u6,terminalSection:h6},R2="detail-panel-width";function d6(n,e,t){try{const i=localStorage.getItem(R2);if(i){const r=Number(i);if(Number.isFinite(r))return Math.min(t,Math.max(e,r))}}catch{}return n}function f6({children:n,initialWidth:e=400,minWidth:t=280,maxWidth:i=800,side:r="right",className:a}){const l=W.useRef(null),[o,u]=W.useState(!1),h=W.useRef(d6(e,t,i)),p=W.useCallback(f=>{f.preventDefault();const m=l.current;if(!m)return;u(!0);const g=f.clientX,_=m.getBoundingClientRect().width;function w(x){if(!m)return;const S=r==="right"?g-x.clientX:x.clientX-g,b=Math.min(i,Math.max(t,_+S));m.style.width=`${b}px`}function v(){if(u(!1),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",v),document.body.style.cursor="",document.body.style.userSelect="",m){const x=m.getBoundingClientRect().width;h.current=x;try{localStorage.setItem(R2,String(Math.round(x)))}catch{}}}document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",v)},[t,i,r]);return T.jsxs("div",{ref:l,className:`${We.panel} ${o?We.resizing:""} ${a??""}`,style:{width:`${h.current}px`},children:[T.jsx("div",{onMouseDown:p,className:`${We.resizeHandle} ${o?We.active:""}`,style:{[r==="right"?"left":"right"]:"-3px"}}),n]})}const Xw="active-tab",Zw="split-terminal-project",Jw="split-ratio",p6=700,m6=[{id:"terminal",label:"TERMINAL"},{id:"conversation",label:"PROMPTS"},{id:"project",label:"PROJECT"},{id:"queue",label:"QUEUE"},{id:"notes",label:"NOTES"},{id:"activity",label:"ACTIVITY"},{id:"summary",label:"SUMMARY"}];function g6(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[T.jsx("rect",{x:"1",y:"1",width:"5",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),T.jsx("rect",{x:"8",y:"1",width:"5",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function y6(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[T.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),T.jsx("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1.3",strokeDasharray:"2 1.5"})]})}function _6({left:n,right:e}){const t=W.useRef(null),[i,r]=W.useState(()=>{try{const l=localStorage.getItem(Jw);return l?parseFloat(l):.5}catch{return .5}}),a=W.useCallback(l=>{l.preventDefault();const o=t.current;if(!o)return;const u=l.clientX,h=i,p=o.offsetWidth,f=g=>{const _=g.clientX-u,w=Math.max(.15,Math.min(.85,h+_/p));r(w)},m=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",m),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem(Jw,String(i))}catch{}};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",f),document.addEventListener("mouseup",m)},[i]);return T.jsxs("div",{className:We.splitView,ref:t,children:[T.jsx("div",{className:We.splitLeft,style:{flex:`0 0 ${i*100}%`},children:n}),T.jsx("div",{className:We.splitDivider,onMouseDown:a}),T.jsx("div",{className:We.splitRight,style:{flex:1},children:e})]})}function b6({terminalContent:n,promptsContent:e,notesContent:t,activityContent:i,summaryContent:r,queueContent:a,projectContent:l,onTabChange:o}){const[u,h]=W.useState(()=>{try{return localStorage.getItem(Xw)||"terminal"}catch{return"terminal"}}),[p,f]=W.useState(()=>{try{return localStorage.getItem(Zw)==="1"}catch{return!1}}),m=typeof window<"u"&&window.innerWidth>=p6,g=W.useCallback(S=>{h(S);try{localStorage.setItem(Xw,S)}catch{}o?.(S)},[o]),_=W.useCallback(()=>{f(S=>{const b=!S;try{localStorage.setItem(Zw,b?"1":"0")}catch{}return b})},[]),w=p&&m,v=w&&(u==="terminal"||u==="project")?"split":u,x={terminal:n,conversation:e,project:l,queue:a,notes:t,activity:i,summary:r,split:T.jsx(_6,{left:n,right:l})};return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:We.tabs,children:m6.map(S=>{const b=w&&(S.id==="terminal"||S.id==="project")?u==="terminal"||u==="project":u===S.id;return T.jsxs("button",{className:`${We.tab}${b?` ${We.active}`:""}${w&&(S.id==="terminal"||S.id==="project")?` ${We.tabSplit}`:""}`,onClick:()=>g(S.id),"data-tab":S.id,children:[S.label,S.id==="project"&&m&&T.jsx("span",{className:We.splitToggle,onClick:C=>{C.stopPropagation(),_(),!p&&u!=="terminal"&&u!=="project"&&g("project")},title:p?"Separate tabs":"Merge Terminal + Project",children:p?T.jsx(y6,{}):T.jsx(g6,{})})]},S.id)})}),T.jsx("div",{className:We.tabContent,children:x[v]})]})}function Op(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function v6({prev:n,index:e}){const[t,i]=W.useState(!0),r=[...n.promptHistory||[]].sort((o,u)=>u.timestamp-o.timestamp),a=n.startedAt?Op(n.startedAt):"?",l=n.endedAt?Op(n.endedAt):"?";return T.jsxs("div",{className:`${We.prevSessionSection}${t?` ${We.collapsed}`:""}`,children:[T.jsxs("div",{className:We.prevSessionHeader,onClick:()=>i(o=>!o),children:[T.jsx("span",{className:We.prevSessionToggle,children:"▶"}),"Previous Session #",e+1," (",a," - ",l,") ·"," ",r.length," prompts"]}),!t&&T.jsx("div",{className:We.prevSessionContent,children:r.length>0?r.map((o,u)=>T.jsxs("div",{className:`${We.convEntry} ${We.convUser} ${We.prevSessionEntry}`,children:[T.jsxs("div",{className:We.convHeader,children:[T.jsxs("span",{className:We.convRole,children:["#",r.length-u]}),T.jsx("span",{className:We.convTime,children:Op(o.timestamp)})]}),T.jsx("div",{className:We.convText,children:o.text})]},o.timestamp)):T.jsx("div",{className:We.tabEmpty,children:"No prompts in this session"})})]})}function x6({text:n}){const[e,t]=W.useState(!1),i=W.useCallback(async r=>{r.stopPropagation();try{await navigator.clipboard.writeText(n.trim()),t(!0),setTimeout(()=>t(!1),1500)}catch{}},[n]);return T.jsx("button",{className:We.convCopy,onClick:i,children:e?"COPIED":"COPY"})}function S6({prompts:n,previousSessions:e,searchQuery:t}){const i=[...n].sort((a,l)=>l.timestamp-a.timestamp),r=t?.toLowerCase()||"";return T.jsxs("div",{children:[e&&e.length>0&&[...e].reverse().map((a,l)=>T.jsx(v6,{prev:a,index:l},a.sessionId)),i.length>0?i.map((a,l)=>{const o=r&&a.text.toLowerCase().includes(r);return T.jsxs("div",{className:`${We.convEntry} ${We.convUser}${o?" search-highlight":""}`,children:[T.jsxs("div",{className:We.convHeader,children:[T.jsxs("span",{className:We.convRole,children:["#",i.length-l]}),T.jsx("span",{className:We.convTime,children:Op(a.timestamp)}),T.jsx(x6,{text:a.text})]}),T.jsx("div",{className:We.convText,children:a.text})]},a.timestamp)}):e&&e.length>0?null:T.jsx("div",{className:We.tabEmpty,children:"No prompts yet"})]})}function g_(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function w6({events:n,toolLog:e,responseLog:t,searchQuery:i}){const r=[];for(const l of n)r.push({kind:"event",type:l.type,detail:l.detail,timestamp:l.timestamp});for(const l of e)r.push({kind:"tool",tool:l.tool,input:l.input,timestamp:l.timestamp});for(const l of t)r.push({kind:"response",text:l.text,timestamp:l.timestamp});r.sort((l,o)=>o.timestamp-l.timestamp);const a=i?.toLowerCase()||"";return r.length===0?T.jsx("div",{className:We.tabEmpty,children:"No activity yet"}):T.jsx("div",{children:r.map((l,o)=>{const u=`${l.kind}-${l.timestamp}-${o}`,h=l.kind==="tool"?`${l.tool} ${l.input}`:l.kind==="response"?l.text:`${l.type} ${l.detail}`,p=a&&(h||"").toLowerCase().includes(a);return l.kind==="tool"?T.jsxs("div",{className:`${We.activityEntry} ${We.activityTool}${p?" search-highlight":""}`,children:[T.jsx("span",{className:We.activityTime,children:g_(l.timestamp)}),T.jsx("span",{className:`${We.activityBadge} ${We.activityBadgeTool}`,children:l.tool}),T.jsx("span",{className:We.activityDetail,children:l.input})]},u):l.kind==="response"?T.jsxs("div",{className:`${We.activityEntry} ${We.activityResponse}${p?" search-highlight":""}`,children:[T.jsx("span",{className:We.activityTime,children:g_(l.timestamp)}),T.jsx("span",{className:`${We.activityBadge} ${We.activityBadgeResponse}`,children:"RESPONSE"}),T.jsx("span",{className:We.activityDetail,children:l.text})]},u):T.jsxs("div",{className:`${We.activityEntry} ${We.activityEvent}${p?" search-highlight":""}`,children:[T.jsx("span",{className:We.activityTime,children:g_(l.timestamp)}),T.jsx("span",{className:`${We.activityBadge} ${We.activityBadgeEvent}`,children:l.type}),T.jsx("span",{className:We.activityDetail,children:l.detail})]},u)})})}function C6(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function E6({sessionId:n}){const[e,t]=W.useState([]),[i,r]=W.useState(""),[a,l]=W.useState(!1),[o,u]=W.useState(!1),h=W.useCallback(async()=>{try{u(!1);const m=await fetch(`/api/db/sessions/${n}/notes`);if(m.ok){const g=await m.json();t(g.notes||[])}else u(!0),kt("Failed to load notes","error")}catch{u(!0),kt("Network error loading notes","error")}},[n]);W.useEffect(()=>{h()},[h]);const p=W.useCallback(async()=>{const m=i.trim();if(!(!m||a)){l(!0);try{(await fetch(`/api/db/sessions/${n}/notes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:m})})).ok?(r(""),await h()):kt("Failed to save note","error")}catch{kt("Failed to save note","error")}finally{l(!1)}}},[n,i,a,h]),f=W.useCallback(async m=>{try{await fetch(`/api/db/sessions/${n}/notes/${m}`,{method:"DELETE"}),await h()}catch{kt("Failed to delete note","error")}},[n,h]);return T.jsxs("div",{children:[T.jsxs("div",{className:We.notesCompose,children:[T.jsx("textarea",{className:We.noteTextarea,placeholder:"Add a note...",rows:3,value:i,onChange:m=>r(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&p()}}),T.jsx("button",{className:`${We.ctrlBtn} ${We.saveNote}`,onClick:p,disabled:a||!i.trim(),children:a?"SAVING...":"SAVE NOTE"})]}),e.length>0?e.sort((m,g)=>g.createdAt-m.createdAt).map(m=>T.jsxs("div",{className:We.noteEntry,children:[T.jsxs("div",{className:We.noteMeta,children:[T.jsx("span",{className:We.noteTime,children:C6(m.createdAt)}),T.jsx("button",{className:We.noteDelete,onClick:()=>f(m.id),title:"Delete note",children:"DELETE"})]}),T.jsx("div",{className:We.noteText,children:m.text})]},m.id)):o?T.jsxs("div",{className:We.tabEmpty,children:["Failed to load notes — ",T.jsx("button",{onClick:h,style:{background:"none",border:"none",color:"var(--accent-cyan)",cursor:"pointer",fontFamily:"inherit"},children:"retry"})]}):T.jsx("div",{className:We.tabEmpty,children:"No notes yet"})]})}function A6({summary:n}){return n?T.jsx("div",{className:We.summaryText,children:n.split(`
|
|
54
|
-
`).map((e,t)=>T.jsxs("span",{children:[e,t<n.split(`
|
|
55
|
-
`).length-1&&T.jsx("br",{})]},t))}):T.jsx("div",{className:We.tabEmpty,children:"No summary yet — click SUMMARIZE to generate one with AI"})}const k6="_wrapper_fspke_9",T6="_placeholder_fspke_13",M6="_reconnectPlaceholderBtn_fspke_20",R6="_toolbar_fspke_45",O6="_themeSelect_fspke_50",N6="_toolbarBtn_fspke_57",D6="_reconnectBtn_fspke_73",I6="_container_fspke_86",L6="_queuePanel_fspke_101",B6="_queueToggle_fspke_107",z6="_queueToggleArrow_fspke_115",P6="_collapsed_fspke_116",F6="_queueCount_fspke_117",U6="_queueBody_fspke_119",j6="_queueCompose_fspke_123",H6="_queueTextarea_fspke_124",q6="_queueAddBtn_fspke_127",V6="_queueList_fspke_130",W6="_queueListEmpty_fspke_132",$6="_queueItem_fspke_135",G6="_queuePos_fspke_140",K6="_queueText_fspke_124",Y6="_queueActions_fspke_142",X6="_queueActionBtn_fspke_144",Z6="_queueSend_fspke_146",J6="_queueEdit_fspke_148",Q6="_queueDelete_fspke_150",ez="_queueMove_fspke_152",tz="_dragging_fspke_158",nz="_queueEditTextarea_fspke_164",iz="_saving_fspke_166",rz="_terminalArea_fspke_180",sz="_fullscreenArea_fspke_192",az="_mobileScrollOverlay_fspke_200",oz="_mobileScrollBtn_fspke_216",lz="_fullscreenOverlay_fspke_269",cz="_fullscreenTopbar_fspke_270",uz="_fullscreenTitle_fspke_276",hz="_fullscreenContainer_fspke_279",wt={wrapper:k6,placeholder:T6,reconnectPlaceholderBtn:M6,toolbar:R6,themeSelect:O6,toolbarBtn:N6,reconnectBtn:D6,container:I6,queuePanel:L6,queueToggle:B6,queueToggleArrow:z6,collapsed:P6,queueCount:F6,queueBody:U6,queueCompose:j6,queueTextarea:H6,queueAddBtn:q6,queueList:V6,queueListEmpty:W6,queueItem:$6,queuePos:G6,queueText:K6,queueActions:Y6,queueActionBtn:X6,queueSend:Z6,queueEdit:J6,queueDelete:Q6,queueMove:ez,dragging:tz,queueEditTextarea:nz,saving:iz,terminalArea:rz,fullscreenArea:sz,mobileScrollOverlay:az,mobileScrollBtn:oz,fullscreenOverlay:lz,fullscreenTopbar:cz,fullscreenTitle:uz,fullscreenContainer:hz};let dz=Date.now();function fz(){return dz++}const pz=[];function O2({sessionId:n,sessionStatus:e,terminalId:t,onQueueCountChange:i}){const r=bs(J=>J.queues.get(n)??pz),a=bs(J=>J.add),l=bs(J=>J.remove),o=bs(J=>J.reorder),u=bs(J=>J.moveToSession),h=gn(J=>J.sessions),[p,f]=W.useState(""),[m,g]=W.useState(null),[_,w]=W.useState(""),[v,x]=W.useState(!1),[S,b]=W.useState(null),[C,O]=W.useState(null),M=W.useRef(e);W.useEffect(()=>{g(null),w(""),b(null)},[n]),W.useEffect(()=>{i?.(n,r.length)},[r.length,n,i]);const D=W.useCallback(async J=>{if(!t)return kt("No terminal attached","error"),!1;try{return(await fetch(`/api/terminals/${t}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:J+`
|
|
56
|
-
`})})).ok?!0:(kt("Failed to send to terminal","error"),!1)}catch{return kt("Network error sending to terminal","error"),!1}},[t]);W.useEffect(()=>{const J=M.current;if(M.current=e,J===e||!(e==="waiting"||e==="input")||r.length===0||!t)return;const F=r[0];D(F.text).then(B=>{B&&(l(n,F.id),kt("Auto-sent queued prompt","info",2e3))})},[e,r,n,t,l,D]);const N=W.useCallback(()=>{const J=p.trim();if(!J)return;const re={id:fz(),sessionId:n,text:J,position:r.length,createdAt:Date.now()};a(n,re),f("")},[p,n,r.length,a]),L=W.useCallback(J=>{g(J.id),w(J.text)},[]),j=W.useCallback(()=>{if(m===null)return;const J=_.trim();if(!J)l(n,m);else{const re=r.findIndex(F=>F.id===m);if(re>=0){const F={...r[re],text:J},B=[...r];B[re]=F,bs.getState().reorder(n,B.map(U=>U.id)),bs.getState().setQueue(n,B)}}g(null),w("")},[m,_,r,n,l]),K=W.useCallback(async J=>{await D(J.text)&&l(n,J.id)},[D,l,n]),Y=W.useCallback(J=>{S!==null&&(u([S],n,J),b(null),kt("Prompt moved","info",2e3))},[S,n,u]),H=W.useCallback(J=>{O(J)},[]),Q=W.useCallback((J,re)=>{if(J.preventDefault(),C===null||C===re)return;const F=[...r],[B]=F.splice(C,1);F.splice(re,0,B),F.length===r.length&&(o(n,F.map(U=>U.id)),O(re))},[C,r,o,n]),te=W.useCallback(()=>{O(null)},[]),$=Array.from(h.entries()).filter(([J])=>J!==n);return T.jsxs("div",{className:`${wt.queuePanel}${v?` ${wt.collapsed}`:""}`,children:[T.jsxs("button",{className:wt.queueToggle,onClick:()=>x(!v),children:[T.jsx("span",{className:wt.queueToggleArrow,children:"▶"}),"QUEUE"," ",T.jsxs("span",{className:wt.queueCount,children:["(",r.length,")"]})]}),T.jsxs("div",{className:wt.queueBody,children:[T.jsxs("div",{className:wt.queueCompose,children:[T.jsx("textarea",{className:wt.queueTextarea,placeholder:"Add a prompt to the queue...",rows:2,value:p,onChange:J=>f(J.target.value),onKeyDown:J=>{J.key==="Enter"&&(J.metaKey||J.ctrlKey)&&(J.preventDefault(),N())}}),T.jsx("button",{className:`${wt.toolbarBtn} ${wt.queueAddBtn}`,onClick:N,disabled:!p.trim(),children:"ADD"})]}),T.jsx("div",{className:wt.queueList,children:r.length===0?T.jsx("div",{className:wt.queueListEmpty,children:"Queue is empty. Add prompts to auto-send when session is waiting."}):r.map((J,re)=>T.jsxs("div",{className:`${wt.queueItem}${C===re?` ${wt.dragging}`:""}`,draggable:!0,onDragStart:()=>H(re),onDragOver:F=>Q(F,re),onDragEnd:te,children:[T.jsx("span",{className:wt.queuePos,children:re+1}),m===J.id?T.jsx("textarea",{className:wt.queueEditTextarea,value:_,onChange:F=>w(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.metaKey||F.ctrlKey)&&(F.preventDefault(),j()),F.key==="Escape"&&(g(null),w(""))},autoFocus:!0,rows:2}):T.jsx("span",{className:wt.queueText,children:J.text}),T.jsx("div",{className:wt.queueActions,children:m===J.id?T.jsx("button",{className:`${wt.queueActionBtn} ${wt.queueEdit} ${wt.saving}`,onClick:j,children:"SAVE"}):T.jsxs(T.Fragment,{children:[T.jsx("button",{className:`${wt.queueActionBtn} ${wt.queueSend}`,onClick:()=>K(J),title:"Send now",children:"SEND"}),T.jsx("button",{className:`${wt.queueActionBtn} ${wt.queueEdit}`,onClick:()=>L(J),title:"Edit",children:"EDIT"}),T.jsx("button",{className:`${wt.queueActionBtn} ${wt.queueMove}`,onClick:()=>b(S===J.id?null:J.id),title:"Move to another session",children:"MOVE"}),T.jsx("button",{className:`${wt.queueActionBtn} ${wt.queueDelete}`,onClick:()=>l(n,J.id),title:"Remove",children:"DEL"})]})}),S===J.id&&T.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,background:"var(--surface-card, #12122a)",border:"1px solid var(--border-subtle, rgba(255,255,255,0.08))",borderRadius:"4px",padding:"4px",maxHeight:"160px",overflowY:"auto"},children:$.length===0?T.jsx("div",{style:{padding:"8px",color:"var(--text-dim)",fontSize:"10px",textAlign:"center"},children:"No other sessions"}):$.map(([F,B])=>T.jsxs("button",{onClick:()=>Y(F),style:{display:"block",width:"100%",padding:"4px 8px",background:"transparent",border:"none",color:"var(--text-primary, #e0e0e0)",fontFamily:"var(--font-mono)",fontSize:"10px",textAlign:"left",cursor:"pointer",borderRadius:"3px"},onMouseEnter:U=>{U.target.style.background="rgba(0,229,255,0.1)"},onMouseLeave:U=>{U.target.style.background="transparent"},children:[B.projectName||F.slice(0,8),B.title?` — ${B.title}`:""]},F))})]},J.id))})]})]})}function mz(n,e){const t={};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const gz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_z={};function Qw(n,e){return(_z.jsx?yz:gz).test(n)}const bz=/[ \t\n\f\r]/g;function vz(n){return typeof n=="object"?n.type==="text"?eC(n.value):!1:eC(n)}function eC(n){return n.replace(bz,"")===""}class cd{constructor(e,t,i){this.normal=t,this.property=e,i&&(this.space=i)}}cd.prototype.normal={};cd.prototype.property={};cd.prototype.space=void 0;function N2(n,e){const t={},i={};for(const r of n)Object.assign(t,r.property),Object.assign(i,r.normal);return new cd(t,i,e)}function f0(n){return n.toLowerCase()}class br{constructor(e,t){this.attribute=t,this.property=e}}br.prototype.attribute="";br.prototype.booleanish=!1;br.prototype.boolean=!1;br.prototype.commaOrSpaceSeparated=!1;br.prototype.commaSeparated=!1;br.prototype.defined=!1;br.prototype.mustUseProperty=!1;br.prototype.number=!1;br.prototype.overloadedBoolean=!1;br.prototype.property="";br.prototype.spaceSeparated=!1;br.prototype.space=void 0;let xz=0;const Jt=Ol(),_i=Ol(),p0=Ol(),Xe=Ol(),qn=Ol(),nu=Ol(),Mr=Ol();function Ol(){return 2**++xz}const m0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Jt,booleanish:_i,commaOrSpaceSeparated:Mr,commaSeparated:nu,number:Xe,overloadedBoolean:p0,spaceSeparated:qn},Symbol.toStringTag,{value:"Module"})),y_=Object.keys(m0);class Ab extends br{constructor(e,t,i,r){let a=-1;if(super(e,t),tC(this,"space",r),typeof i=="number")for(;++a<y_.length;){const l=y_[a];tC(this,y_[a],(i&m0[l])===m0[l])}}}Ab.prototype.defined=!0;function tC(n,e,t){t&&(n[e]=t)}function mu(n){const e={},t={};for(const[i,r]of Object.entries(n.properties)){const a=new Ab(i,n.transform(n.attributes||{},i),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),e[i]=a,t[f0(i)]=i,t[f0(a.attribute)]=i}return new cd(e,t,n.space)}const D2=mu({properties:{ariaActiveDescendant:null,ariaAtomic:_i,ariaAutoComplete:null,ariaBusy:_i,ariaChecked:_i,ariaColCount:Xe,ariaColIndex:Xe,ariaColSpan:Xe,ariaControls:qn,ariaCurrent:null,ariaDescribedBy:qn,ariaDetails:null,ariaDisabled:_i,ariaDropEffect:qn,ariaErrorMessage:null,ariaExpanded:_i,ariaFlowTo:qn,ariaGrabbed:_i,ariaHasPopup:null,ariaHidden:_i,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qn,ariaLevel:Xe,ariaLive:null,ariaModal:_i,ariaMultiLine:_i,ariaMultiSelectable:_i,ariaOrientation:null,ariaOwns:qn,ariaPlaceholder:null,ariaPosInSet:Xe,ariaPressed:_i,ariaReadOnly:_i,ariaRelevant:null,ariaRequired:_i,ariaRoleDescription:qn,ariaRowCount:Xe,ariaRowIndex:Xe,ariaRowSpan:Xe,ariaSelected:_i,ariaSetSize:Xe,ariaSort:null,ariaValueMax:Xe,ariaValueMin:Xe,ariaValueNow:Xe,ariaValueText:null,role:null},transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function I2(n,e){return e in n?n[e]:e}function L2(n,e){return I2(n,e.toLowerCase())}const Sz=mu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nu,acceptCharset:qn,accessKey:qn,action:null,allow:null,allowFullScreen:Jt,allowPaymentRequest:Jt,allowUserMedia:Jt,alt:null,as:null,async:Jt,autoCapitalize:null,autoComplete:qn,autoFocus:Jt,autoPlay:Jt,blocking:qn,capture:null,charSet:null,checked:Jt,cite:null,className:qn,cols:Xe,colSpan:null,content:null,contentEditable:_i,controls:Jt,controlsList:qn,coords:Xe|nu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Jt,defer:Jt,dir:null,dirName:null,disabled:Jt,download:p0,draggable:_i,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Jt,formTarget:null,headers:qn,height:Xe,hidden:p0,high:Xe,href:null,hrefLang:null,htmlFor:qn,httpEquiv:qn,id:null,imageSizes:null,imageSrcSet:null,inert:Jt,inputMode:null,integrity:null,is:null,isMap:Jt,itemId:null,itemProp:qn,itemRef:qn,itemScope:Jt,itemType:qn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Jt,low:Xe,manifest:null,max:null,maxLength:Xe,media:null,method:null,min:null,minLength:Xe,multiple:Jt,muted:Jt,name:null,nonce:null,noModule:Jt,noValidate:Jt,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:Jt,optimum:Xe,pattern:null,ping:qn,placeholder:null,playsInline:Jt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Jt,referrerPolicy:null,rel:qn,required:Jt,reversed:Jt,rows:Xe,rowSpan:Xe,sandbox:qn,scope:null,scoped:Jt,seamless:Jt,selected:Jt,shadowRootClonable:Jt,shadowRootDelegatesFocus:Jt,shadowRootMode:null,shape:null,size:Xe,sizes:null,slot:null,span:Xe,spellCheck:_i,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Xe,step:null,style:null,tabIndex:Xe,target:null,title:null,translate:null,type:null,typeMustMatch:Jt,useMap:null,value:_i,width:Xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qn,axis:null,background:null,bgColor:null,border:Xe,borderColor:null,bottomMargin:Xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Jt,declare:Jt,event:null,face:null,frame:null,frameBorder:null,hSpace:Xe,leftMargin:Xe,link:null,longDesc:null,lowSrc:null,marginHeight:Xe,marginWidth:Xe,noResize:Jt,noHref:Jt,noShade:Jt,noWrap:Jt,object:null,profile:null,prompt:null,rev:null,rightMargin:Xe,rules:null,scheme:null,scrolling:_i,standby:null,summary:null,text:null,topMargin:Xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Jt,disableRemotePlayback:Jt,prefix:null,property:null,results:Xe,security:null,unselectable:null},space:"html",transform:L2}),wz=mu({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:Mr,accentHeight:Xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Xe,amplitude:Xe,arabicForm:null,ascent:Xe,attributeName:null,attributeType:null,azimuth:Xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Xe,by:null,calcMode:null,capHeight:Xe,className:qn,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:Xe,diffuseConstant:Xe,direction:null,display:null,dur:null,divisor:Xe,dominantBaseline:null,download:Jt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Xe,enableBackground:null,end:null,event:null,exponent:Xe,externalResourcesRequired:null,fill:null,fillOpacity:Xe,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:nu,g2:nu,glyphName:nu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Xe,horizOriginX:Xe,horizOriginY:Xe,id:null,ideographic:Xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Xe,k:Xe,k1:Xe,k2:Xe,k3:Xe,k4:Xe,kernelMatrix:Mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Xe,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:Xe,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:Xe,overlineThickness:Xe,paintOrder:null,panose1:null,path:null,pathLength:Xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Xe,pointsAtY:Xe,pointsAtZ:Xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mr,rev:Mr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mr,requiredFeatures:Mr,requiredFonts:Mr,requiredFormats:Mr,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:Xe,specularExponent:Xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Xe,strikethroughThickness:Xe,string:null,stroke:null,strokeDashArray:Mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Xe,strokeOpacity:Xe,strokeWidth:null,style:null,surfaceScale:Xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mr,tabIndex:Xe,tableValues:null,target:null,targetX:Xe,targetY:Xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Xe,underlineThickness:Xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Xe,values:null,vAlphabetic:Xe,vMathematical:Xe,vectorEffect:null,vHanging:Xe,vIdeographic:Xe,version:null,vertAdvY:Xe,vertOriginX:Xe,vertOriginY:Xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:I2}),B2=mu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()}}),z2=mu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:L2}),P2=mu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()}}),Cz={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"},Ez=/[A-Z]/g,nC=/-[a-z]/g,Az=/^data[-\w.:]+$/i;function kz(n,e){const t=f0(e);let i=e,r=br;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Az.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(nC,Mz);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!nC.test(a)){let l=a.replace(Ez,Tz);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}r=Ab}return new r(i,e)}function Tz(n){return"-"+n.toLowerCase()}function Mz(n){return n.charAt(1).toUpperCase()}const Rz=N2([D2,Sz,B2,z2,P2],"html"),kb=N2([D2,wz,B2,z2,P2],"svg");function Oz(n){return n.join(" ").trim()}var Wc={},__,iC;function Nz(){if(iC)return __;iC=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
57
|
-
`,h="/",p="*",f="",m="comment",g="declaration";function _(v,x){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];x=x||{};var S=1,b=1;function C(Q){var te=Q.match(e);te&&(S+=te.length);var $=Q.lastIndexOf(u);b=~$?Q.length-$:b+Q.length}function O(){var Q={line:S,column:b};return function(te){return te.position=new M(Q),L(),te}}function M(Q){this.start=Q,this.end={line:S,column:b},this.source=x.source}M.prototype.content=v;function D(Q){var te=new Error(x.source+":"+S+":"+b+": "+Q);if(te.reason=Q,te.filename=x.source,te.line=S,te.column=b,te.source=v,!x.silent)throw te}function N(Q){var te=Q.exec(v);if(te){var $=te[0];return C($),v=v.slice($.length),te}}function L(){N(t)}function j(Q){var te;for(Q=Q||[];te=K();)te!==!1&&Q.push(te);return Q}function K(){var Q=O();if(!(h!=v.charAt(0)||p!=v.charAt(1))){for(var te=2;f!=v.charAt(te)&&(p!=v.charAt(te)||h!=v.charAt(te+1));)++te;if(te+=2,f===v.charAt(te-1))return D("End of comment missing");var $=v.slice(2,te-2);return b+=2,C($),v=v.slice(te),b+=2,Q({type:m,comment:$})}}function Y(){var Q=O(),te=N(i);if(te){if(K(),!N(r))return D("property missing ':'");var $=N(a),J=Q({type:g,property:w(te[0].replace(n,f)),value:$?w($[0].replace(n,f)):f});return N(l),J}}function H(){var Q=[];j(Q);for(var te;te=Y();)te!==!1&&(Q.push(te),j(Q));return Q}return L(),H()}function w(v){return v?v.replace(o,f):f}return __=_,__}var rC;function Dz(){if(rC)return Wc;rC=1;var n=Wc&&Wc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.default=t;const e=n(Nz());function t(i,r){let a=null;if(!i||typeof i!="string")return a;const l=(0,e.default)(i),o=typeof r=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:p}=u;o?r(h,p,u):p&&(a=a||{},a[h]=p)}),a}return Wc}var Eh={},sC;function Iz(){if(sC)return Eh;sC=1,Object.defineProperty(Eh,"__esModule",{value:!0}),Eh.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(h){return!h||t.test(h)||n.test(h)},l=function(h,p){return p.toUpperCase()},o=function(h,p){return"".concat(p,"-")},u=function(h,p){return p===void 0&&(p={}),a(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(r,o):h=h.replace(i,o),h.replace(e,l))};return Eh.camelCase=u,Eh}var Ah,aC;function Lz(){if(aC)return Ah;aC=1;var n=Ah&&Ah.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=n(Dz()),t=Iz();function i(r,a){var l={};return!r||typeof r!="string"||(0,e.default)(r,function(o,u){o&&u&&(l[(0,t.camelCase)(o,a)]=u)}),l}return i.default=i,Ah=i,Ah}var Bz=Lz();const zz=id(Bz),F2=U2("end"),Tb=U2("start");function U2(n){return e;function e(t){const i=t&&t.position&&t.position[n]||{};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 Pz(n){const e=Tb(n),t=F2(n);if(e&&t)return{start:e,end:t}}function Uh(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?oC(n.position):"start"in n||"end"in n?oC(n):"line"in n||"column"in n?g0(n):""}function g0(n){return lC(n&&n.line)+":"+lC(n&&n.column)}function oC(n){return g0(n&&n.start)+"-"+g0(n&&n.end)}function lC(n){return n&&typeof n=="number"?n:1}class Zi extends Error{constructor(e,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let r="",a={},l=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof e=="string"?r=e:!a.cause&&e&&(l=!0,r=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof i=="string"){const u=i.indexOf(":");u===-1?a.ruleId=i:(a.source=i.slice(0,u),a.ruleId=i.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.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=Uh(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=l&&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}}Zi.prototype.file="";Zi.prototype.name="";Zi.prototype.reason="";Zi.prototype.message="";Zi.prototype.stack="";Zi.prototype.column=void 0;Zi.prototype.line=void 0;Zi.prototype.ancestors=void 0;Zi.prototype.cause=void 0;Zi.prototype.fatal=void 0;Zi.prototype.place=void 0;Zi.prototype.ruleId=void 0;Zi.prototype.source=void 0;const Mb={}.hasOwnProperty,Fz=new Map,Uz=/[A-Z]/g,jz=new Set(["table","tbody","thead","tfoot","tr"]),Hz=new Set(["td","th"]),j2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qz(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Zz(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Xz(t,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?kb:Rz,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=H2(r,n,void 0);return a&&typeof a!="string"?a:r.create(n,r.Fragment,{children:a||void 0},void 0)}function H2(n,e,t){if(e.type==="element")return Vz(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Wz(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Gz(n,e,t);if(e.type==="mdxjsEsm")return $z(n,e);if(e.type==="root")return Kz(n,e,t);if(e.type==="text")return Yz(n,e)}function Vz(n,e,t){const i=n.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=kb,n.schema=r),n.ancestors.push(e);const a=V2(n,e.tagName,!1),l=Jz(n,e);let o=Ob(n,e);return jz.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!vz(u):!0})),q2(n,l,a,e),Rb(l,o),n.ancestors.pop(),n.schema=i,n.create(e,a,l,t)}function Wz(n,e){if(e.data&&e.data.estree&&n.evaluater){const i=e.data.estree.body[0];return i.type,n.evaluater.evaluateExpression(i.expression)}ed(n,e.position)}function $z(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);ed(n,e.position)}function Gz(n,e,t){const i=n.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=kb,n.schema=r),n.ancestors.push(e);const a=e.name===null?n.Fragment:V2(n,e.name,!0),l=Qz(n,e),o=Ob(n,e);return q2(n,l,a,e),Rb(l,o),n.ancestors.pop(),n.schema=i,n.create(e,a,l,t)}function Kz(n,e,t){const i={};return Rb(i,Ob(n,e)),n.create(e,n.Fragment,i,t)}function Yz(n,e){return e.value}function q2(n,e,t,i){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=i)}function Rb(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function Xz(n,e,t){return i;function i(r,a,l,o){const h=Array.isArray(l.children)?t:e;return o?h(a,l,o):h(a,l)}}function Zz(n,e){return t;function t(i,r,a,l){const o=Array.isArray(a.children),u=Tb(i);return e(r,a,l,o,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function Jz(n,e){const t={};let i,r;for(r in e.properties)if(r!=="children"&&Mb.call(e.properties,r)){const a=eP(n,r,e.properties[r]);if(a){const[l,o]=a;n.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&Hz.has(e.tagName)?i=o:t[l]=o}}if(i){const a=t.style||(t.style={});a[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function Qz(n,e){const t={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&n.evaluater){const a=i.data.estree.body[0];a.type;const l=a.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,n.evaluater.evaluateExpression(o.argument))}else ed(n,e.position);else{const r=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&n.evaluater){const o=i.value.data.estree.body[0];o.type,a=n.evaluater.evaluateExpression(o.expression)}else ed(n,e.position);else a=i.value===null?!0:i.value;t[r]=a}return t}function Ob(n,e){const t=[];let i=-1;const r=n.passKeys?new Map:Fz;for(;++i<e.children.length;){const a=e.children[i];let l;if(n.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const h=r.get(u)||0;l=u+"-"+h,r.set(u,h+1)}}const o=H2(n,a,l);o!==void 0&&t.push(o)}return t}function eP(n,e,t){const i=kz(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?mz(t):Oz(t)),i.property==="style"){let r=typeof t=="object"?t:tP(n,String(t));return n.stylePropertyNameCase==="css"&&(r=nP(r)),["style",r]}return[n.elementAttributeNameCase==="react"&&i.space?Cz[i.property]||i.property:i.attribute,t]}}function tP(n,e){try{return zz(e,{reactCompat:!0})}catch(t){if(n.ignoreInvalidStyle)return{};const i=t,r=new Zi("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=n.filePath||void 0,r.url=j2+"#cannot-parse-style-attribute",r}}function V2(n,e,t){let i;if(!t)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let a=-1,l;for(;++a<r.length;){const o=Qw(r[a])?{type:"Identifier",name:r[a]}:{type:"Literal",value:r[a]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}i=l}else i=Qw(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return Mb.call(n.components,r)?n.components[r]:r}if(n.evaluater)return n.evaluater.evaluateExpression(i);ed(n)}function ed(n,e){const t=new Zi("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=j2+"#cannot-handle-mdx-estrees-without-createevaluater",t}function nP(n){const e={};let t;for(t in n)Mb.call(n,t)&&(e[iP(t)]=n[t]);return e}function iP(n){let e=n.replace(Uz,rP);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function rP(n){return"-"+n.toLowerCase()}const b_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},sP={};function Nb(n,e){const t=sP,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,r=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return W2(n,i,r)}function W2(n,e,t){if(aP(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return cC(n.children,e,t)}return Array.isArray(n)?cC(n,e,t):""}function cC(n,e,t){const i=[];let r=-1;for(;++r<n.length;)i[r]=W2(n[r],e,t);return i.join("")}function aP(n){return!!(n&&typeof n=="object")}const uC=document.createElement("i");function Db(n){const e="&"+n+";";uC.innerHTML=e;const t=uC.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function Lr(n,e,t,i){const r=n.length;let a=0,l;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,t=t>0?t:0,i.length<1e4)l=Array.from(i),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);a<i.length;)l=i.slice(a,a+1e4),l.unshift(e,0),n.splice(...l),a+=1e4,e+=1e4}function es(n,e){return n.length>0?(Lr(n,n.length,0,e),n):e}const hC={}.hasOwnProperty;function $2(n){const e={};let t=-1;for(;++t<n.length;)oP(e,n[t]);return e}function oP(n,e){let t;for(t in e){const r=(hC.call(n,t)?n[t]:void 0)||(n[t]={}),a=e[t];let l;if(a)for(l in a){hC.call(r,l)||(r[l]=[]);const o=a[l];lP(r[l],Array.isArray(o)?o:o?[o]:[])}}}function lP(n,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?n:i).push(e[t]);Lr(n,0,0,i)}function G2(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ss(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ar=Fo(/[A-Za-z]/),Yi=Fo(/[\dA-Za-z]/),cP=Fo(/[#-'*+\--9=?A-Z^-~]/);function Xp(n){return n!==null&&(n<32||n===127)}const y0=Fo(/\d/),uP=Fo(/[\dA-Fa-f]/),hP=Fo(/[!-/:-@[-`{-~]/);function Mt(n){return n!==null&&n<-2}function Un(n){return n!==null&&(n<0||n===32)}function ln(n){return n===-2||n===-1||n===32}const _m=Fo(new RegExp("\\p{P}|\\p{S}","u")),kl=Fo(/\s/);function Fo(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function gu(n){const e=[];let t=-1,i=0,r=0;for(;++t<n.length;){const a=n.charCodeAt(t);let l="";if(a===37&&Yi(n.charCodeAt(t+1))&&Yi(n.charCodeAt(t+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const o=n.charCodeAt(t+1);a<56320&&o>56319&&o<57344?(l=String.fromCharCode(a,o),r=1):l="�"}else l=String.fromCharCode(a);l&&(e.push(n.slice(i,t),encodeURIComponent(l)),i=t+r+1,l=""),r&&(t+=r,r=0)}return e.join("")+n.slice(i)}function pn(n,e,t,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(u){return ln(u)?(n.enter(t),o(u)):e(u)}function o(u){return ln(u)&&a++<r?(n.consume(u),o):(n.exit(t),e(u))}}const dP={tokenize:fP};function fP(n){const e=n.attempt(this.parser.constructs.contentInitial,i,r);let t;return e;function i(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),pn(n,e,"linePrefix")}function r(o){return n.enter("paragraph"),a(o)}function a(o){const u=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(o)}function l(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return Mt(o)?(n.consume(o),n.exit("chunkText"),a):(n.consume(o),l)}}const pP={tokenize:mP},dC={tokenize:gP};function mP(n){const e=this,t=[];let i=0,r,a,l;return o;function o(b){if(i<t.length){const C=t[i];return e.containerState=C[1],n.attempt(C[0].continuation,u,h)(b)}return h(b)}function u(b){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&S();const C=e.events.length;let O=C,M;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){M=e.events[O][1].end;break}x(i);let D=C;for(;D<e.events.length;)e.events[D][1].end={...M},D++;return Lr(e.events,O+1,0,e.events.slice(C)),e.events.length=D,h(b)}return o(b)}function h(b){if(i===t.length){if(!r)return m(b);if(r.currentConstruct&&r.currentConstruct.concrete)return _(b);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(dC,p,f)(b)}function p(b){return r&&S(),x(i),m(b)}function f(b){return e.parser.lazy[e.now().line]=i!==t.length,l=e.now().offset,_(b)}function m(b){return e.containerState={},n.attempt(dC,g,_)(b)}function g(b){return i++,t.push([e.currentConstruct,e.containerState]),m(b)}function _(b){if(b===null){r&&S(),x(0),n.consume(b);return}return r=r||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),w(b)}function w(b){if(b===null){v(n.exit("chunkFlow"),!0),x(0),n.consume(b);return}return Mt(b)?(n.consume(b),v(n.exit("chunkFlow")),i=0,e.interrupt=void 0,o):(n.consume(b),w)}function v(b,C){const O=e.sliceStream(b);if(C&&O.push(null),b.previous=a,a&&(a.next=b),a=b,r.defineSkip(b.start),r.write(O),e.parser.lazy[b.start.line]){let M=r.events.length;for(;M--;)if(r.events[M][1].start.offset<l&&(!r.events[M][1].end||r.events[M][1].end.offset>l))return;const D=e.events.length;let N=D,L,j;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){if(L){j=e.events[N][1].end;break}L=!0}for(x(i),M=D;M<e.events.length;)e.events[M][1].end={...j},M++;Lr(e.events,N+1,0,e.events.slice(D)),e.events.length=M}}function x(b){let C=t.length;for(;C-- >b;){const O=t[C];e.containerState=O[1],O[0].exit.call(e,n)}t.length=b}function S(){r.write([null]),a=void 0,r=void 0,e.containerState._closeFlow=void 0}}function gP(n,e,t){return pn(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function au(n){if(n===null||Un(n)||kl(n))return 1;if(_m(n))return 2}function bm(n,e,t){const i=[];let r=-1;for(;++r<n.length;){const a=n[r].resolveAll;a&&!i.includes(a)&&(e=a(e,t),i.push(a))}return e}const _0={name:"attention",resolveAll:yP,tokenize:_P};function yP(n,e){let t=-1,i,r,a,l,o,u,h,p;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(i=t;i--;)if(n[i][0]==="exit"&&n[i][1].type==="attentionSequence"&&n[i][1]._open&&e.sliceSerialize(n[i][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[i][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[i][1].end.offset-n[i][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;u=n[i][1].end.offset-n[i][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const f={...n[i][1].end},m={...n[t][1].start};fC(f,-u),fC(m,u),l={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...n[i][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:m},a={type:u>1?"strongText":"emphasisText",start:{...n[i][1].end},end:{...n[t][1].start}},r={type:u>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},n[i][1].end={...l.start},n[t][1].start={...o.end},h=[],n[i][1].end.offset-n[i][1].start.offset&&(h=es(h,[["enter",n[i][1],e],["exit",n[i][1],e]])),h=es(h,[["enter",r,e],["enter",l,e],["exit",l,e],["enter",a,e]]),h=es(h,bm(e.parser.constructs.insideSpan.null,n.slice(i+1,t),e)),h=es(h,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",r,e]]),n[t][1].end.offset-n[t][1].start.offset?(p=2,h=es(h,[["enter",n[t][1],e],["exit",n[t][1],e]])):p=0,Lr(n,i-1,t-i+3,h),t=i+h.length-p-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function _P(n,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,r=au(i);let a;return l;function l(u){return a=u,n.enter("attentionSequence"),o(u)}function o(u){if(u===a)return n.consume(u),o;const h=n.exit("attentionSequence"),p=au(u),f=!p||p===2&&r||t.includes(u),m=!r||r===2&&p||t.includes(i);return h._open=!!(a===42?f:f&&(r||!m)),h._close=!!(a===42?m:m&&(p||!f)),e(u)}}function fC(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const bP={name:"autolink",tokenize:vP};function vP(n,e,t){let i=0;return r;function r(g){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(g),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),a}function a(g){return ar(g)?(n.consume(g),l):g===64?t(g):h(g)}function l(g){return g===43||g===45||g===46||Yi(g)?(i=1,o(g)):h(g)}function o(g){return g===58?(n.consume(g),i=0,u):(g===43||g===45||g===46||Yi(g))&&i++<32?(n.consume(g),o):(i=0,h(g))}function u(g){return g===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(g),n.exit("autolinkMarker"),n.exit("autolink"),e):g===null||g===32||g===60||Xp(g)?t(g):(n.consume(g),u)}function h(g){return g===64?(n.consume(g),p):cP(g)?(n.consume(g),h):t(g)}function p(g){return Yi(g)?f(g):t(g)}function f(g){return g===46?(n.consume(g),i=0,p):g===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(g),n.exit("autolinkMarker"),n.exit("autolink"),e):m(g)}function m(g){if((g===45||Yi(g))&&i++<63){const _=g===45?m:f;return n.consume(g),_}return t(g)}}const ud={partial:!0,tokenize:xP};function xP(n,e,t){return i;function i(a){return ln(a)?pn(n,r,"linePrefix")(a):r(a)}function r(a){return a===null||Mt(a)?e(a):t(a)}}const K2={continuation:{tokenize:wP},exit:CP,name:"blockQuote",tokenize:SP};function SP(n,e,t){const i=this;return r;function r(l){if(l===62){const o=i.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),a}return t(l)}function a(l){return ln(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function wP(n,e,t){const i=this;return r;function r(l){return ln(l)?pn(n,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return n.attempt(K2,e,t)(l)}}function CP(n){n.exit("blockQuote")}const Y2={name:"characterEscape",tokenize:EP};function EP(n,e,t){return i;function i(a){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(a),n.exit("escapeMarker"),r}function r(a){return hP(a)?(n.enter("characterEscapeValue"),n.consume(a),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(a)}}const X2={name:"characterReference",tokenize:AP};function AP(n,e,t){const i=this;let r=0,a,l;return o;function o(f){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),u}function u(f){return f===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(f),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),a=31,l=Yi,p(f))}function h(f){return f===88||f===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(f),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),a=6,l=uP,p):(n.enter("characterReferenceValue"),a=7,l=y0,p(f))}function p(f){if(f===59&&r){const m=n.exit("characterReferenceValue");return l===Yi&&!Db(i.sliceSerialize(m))?t(f):(n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(f)&&r++<a?(n.consume(f),p):t(f)}}const pC={partial:!0,tokenize:TP},mC={concrete:!0,name:"codeFenced",tokenize:kP};function kP(n,e,t){const i=this,r={partial:!0,tokenize:O};let a=0,l=0,o;return u;function u(M){return h(M)}function h(M){const D=i.events[i.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=M,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===o?(l++,n.consume(M),p):l<3?t(M):(n.exit("codeFencedFenceSequence"),ln(M)?pn(n,f,"whitespace")(M):f(M))}function f(M){return M===null||Mt(M)?(n.exit("codeFencedFence"),i.interrupt?e(M):n.check(pC,w,C)(M)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||Mt(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),f(M)):ln(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),pn(n,g,"whitespace")(M)):M===96&&M===o?t(M):(n.consume(M),m)}function g(M){return M===null||Mt(M)?f(M):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),_(M))}function _(M){return M===null||Mt(M)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),f(M)):M===96&&M===o?t(M):(n.consume(M),_)}function w(M){return n.attempt(r,C,v)(M)}function v(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),x}function x(M){return a>0&&ln(M)?pn(n,S,"linePrefix",a+1)(M):S(M)}function S(M){return M===null||Mt(M)?n.check(pC,w,C)(M):(n.enter("codeFlowValue"),b(M))}function b(M){return M===null||Mt(M)?(n.exit("codeFlowValue"),S(M)):(n.consume(M),b)}function C(M){return n.exit("codeFenced"),e(M)}function O(M,D,N){let L=0;return j;function j(te){return M.enter("lineEnding"),M.consume(te),M.exit("lineEnding"),K}function K(te){return M.enter("codeFencedFence"),ln(te)?pn(M,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):Y(te)}function Y(te){return te===o?(M.enter("codeFencedFenceSequence"),H(te)):N(te)}function H(te){return te===o?(L++,M.consume(te),H):L>=l?(M.exit("codeFencedFenceSequence"),ln(te)?pn(M,Q,"whitespace")(te):Q(te)):N(te)}function Q(te){return te===null||Mt(te)?(M.exit("codeFencedFence"),D(te)):N(te)}}}function TP(n,e,t){const i=this;return r;function r(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),a)}function a(l){return i.parser.lazy[i.now().line]?t(l):e(l)}}const v_={name:"codeIndented",tokenize:RP},MP={partial:!0,tokenize:OP};function RP(n,e,t){const i=this;return r;function r(h){return n.enter("codeIndented"),pn(n,a,"linePrefix",5)(h)}function a(h){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):t(h)}function l(h){return h===null?u(h):Mt(h)?n.attempt(MP,l,u)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Mt(h)?(n.exit("codeFlowValue"),l(h)):(n.consume(h),o)}function u(h){return n.exit("codeIndented"),e(h)}}function OP(n,e,t){const i=this;return r;function r(l){return i.parser.lazy[i.now().line]?t(l):Mt(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),r):pn(n,a,"linePrefix",5)(l)}function a(l){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):Mt(l)?r(l):t(l)}}const NP={name:"codeText",previous:IP,resolve:DP,tokenize:LP};function DP(n){let e=n.length-4,t=3,i,r;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(i=t;++i<e;)if(n[i][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(i=t-1,e++;++i<=e;)r===void 0?i!==e&&n[i][1].type!=="lineEnding"&&(r=i):(i===e||n[i][1].type==="lineEnding")&&(n[r][1].type="codeTextData",i!==r+2&&(n[r][1].end=n[i-1][1].end,n.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return n}function IP(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LP(n,e,t){let i=0,r,a;return l;function l(f){return n.enter("codeText"),n.enter("codeTextSequence"),o(f)}function o(f){return f===96?(n.consume(f),i++,o):(n.exit("codeTextSequence"),u(f))}function u(f){return f===null?t(f):f===32?(n.enter("space"),n.consume(f),n.exit("space"),u):f===96?(a=n.enter("codeTextSequence"),r=0,p(f)):Mt(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):(n.enter("codeTextData"),h(f))}function h(f){return f===null||f===32||f===96||Mt(f)?(n.exit("codeTextData"),u(f)):(n.consume(f),h)}function p(f){return f===96?(n.consume(f),r++,p):r===i?(n.exit("codeTextSequence"),n.exit("codeText"),e(f)):(a.type="codeTextData",h(f))}}class BP{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,t){const i=t??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,t,i){const r=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&kh(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),kh(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),kh(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 t=this.left.splice(e,Number.POSITIVE_INFINITY);kh(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);kh(this.left,t.reverse())}}}function kh(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function Z2(n){const e={};let t=-1,i,r,a,l,o,u,h;const p=new BP(n);for(;++t<p.length;){for(;t in e;)t=e[t];if(i=p.get(t),t&&i[1].type==="chunkFlow"&&p.get(t-1)[1].type==="listItemPrefix"&&(u=i[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,zP(p,t)),t=e[t],h=!0);else if(i[1]._container){for(a=t,r=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(p.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(i[1].end={...p.get(r)[1].start},o=p.slice(r,t),o.unshift(i),p.splice(r,t-r+1,o))}}return Lr(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function zP(n,e){const t=n.get(e)[1],i=n.get(e)[2];let r=e-1;const a=[];let l=t._tokenizer;l||(l=i.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,u=[],h={};let p,f,m=-1,g=t,_=0,w=0;const v=[w];for(;g;){for(;n.get(++r)[1]!==g;);a.push(r),g._tokenizer||(p=i.sliceStream(g),g.next||p.push(null),f&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=t;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(w=m+1,v.push(w),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):v.pop(),m=v.length;m--;){const x=o.slice(v[m],v[m+1]),S=a.pop();u.push([S,S+x.length-1]),n.splice(S,2,x)}for(u.reverse(),m=-1;++m<u.length;)h[_+u[m][0]]=_+u[m][1],_+=u[m][1]-u[m][0]-1;return h}const PP={resolve:UP,tokenize:jP},FP={partial:!0,tokenize:HP};function UP(n){return Z2(n),n}function jP(n,e){let t;return i;function i(o){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),r(o)}function r(o){return o===null?a(o):Mt(o)?n.check(FP,l,a)(o):(n.consume(o),r)}function a(o){return n.exit("chunkContent"),n.exit("content"),e(o)}function l(o){return n.consume(o),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}function HP(n,e,t){const i=this;return r;function r(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),pn(n,a,"linePrefix")}function a(l){if(l===null||Mt(l))return t(l);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(l):n.interrupt(i.parser.constructs.flow,t,e)(l)}}function J2(n,e,t,i,r,a,l,o,u){const h=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(x){return x===60?(n.enter(i),n.enter(r),n.enter(a),n.consume(x),n.exit(a),m):x===null||x===32||x===41||Xp(x)?t(x):(n.enter(i),n.enter(l),n.enter(o),n.enter("chunkString",{contentType:"string"}),w(x))}function m(x){return x===62?(n.enter(a),n.consume(x),n.exit(a),n.exit(r),n.exit(i),e):(n.enter(o),n.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===62?(n.exit("chunkString"),n.exit(o),m(x)):x===null||x===60||Mt(x)?t(x):(n.consume(x),x===92?_:g)}function _(x){return x===60||x===62||x===92?(n.consume(x),g):g(x)}function w(x){return!p&&(x===null||x===41||Un(x))?(n.exit("chunkString"),n.exit(o),n.exit(l),n.exit(i),e(x)):p<h&&x===40?(n.consume(x),p++,w):x===41?(n.consume(x),p--,w):x===null||x===32||x===40||Xp(x)?t(x):(n.consume(x),x===92?v:w)}function v(x){return x===40||x===41||x===92?(n.consume(x),w):w(x)}}function Q2(n,e,t,i,r,a){const l=this;let o=0,u;return h;function h(g){return n.enter(i),n.enter(r),n.consume(g),n.exit(r),n.enter(a),p}function p(g){return o>999||g===null||g===91||g===93&&!u||g===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(g):g===93?(n.exit(a),n.enter(r),n.consume(g),n.exit(r),n.exit(i),e):Mt(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||Mt(g)||o++>999?(n.exit("chunkString"),p(g)):(n.consume(g),u||(u=!ln(g)),g===92?m:f)}function m(g){return g===91||g===92||g===93?(n.consume(g),o++,f):f(g)}}function eA(n,e,t,i,r,a){let l;return o;function o(m){return m===34||m===39||m===40?(n.enter(i),n.enter(r),n.consume(m),n.exit(r),l=m===40?41:m,u):t(m)}function u(m){return m===l?(n.enter(r),n.consume(m),n.exit(r),n.exit(i),e):(n.enter(a),h(m))}function h(m){return m===l?(n.exit(a),u(l)):m===null?t(m):Mt(m)?(n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),pn(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===l||m===null||Mt(m)?(n.exit("chunkString"),h(m)):(n.consume(m),m===92?f:p)}function f(m){return m===l||m===92?(n.consume(m),p):p(m)}}function jh(n,e){let t;return i;function i(r){return Mt(r)?(n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),t=!0,i):ln(r)?pn(n,i,t?"linePrefix":"lineSuffix")(r):e(r)}}const qP={name:"definition",tokenize:WP},VP={partial:!0,tokenize:$P};function WP(n,e,t){const i=this;let r;return a;function a(g){return n.enter("definition"),l(g)}function l(g){return Q2.call(i,n,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return r=Ss(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===58?(n.enter("definitionMarker"),n.consume(g),n.exit("definitionMarker"),u):t(g)}function u(g){return Un(g)?jh(n,h)(g):h(g)}function h(g){return J2(n,p,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return n.attempt(VP,f,f)(g)}function f(g){return ln(g)?pn(n,m,"whitespace")(g):m(g)}function m(g){return g===null||Mt(g)?(n.exit("definition"),i.parser.defined.push(r),e(g)):t(g)}}function $P(n,e,t){return i;function i(o){return Un(o)?jh(n,r)(o):t(o)}function r(o){return eA(n,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ln(o)?pn(n,l,"whitespace")(o):l(o)}function l(o){return o===null||Mt(o)?e(o):t(o)}}const GP={name:"hardBreakEscape",tokenize:KP};function KP(n,e,t){return i;function i(a){return n.enter("hardBreakEscape"),n.consume(a),r}function r(a){return Mt(a)?(n.exit("hardBreakEscape"),e(a)):t(a)}}const YP={name:"headingAtx",resolve:XP,tokenize:ZP};function XP(n,e){let t=n.length-2,i=3,r,a;return n[i][1].type==="whitespace"&&(i+=2),t-2>i&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&n[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(r={type:"atxHeadingText",start:n[i][1].start,end:n[t][1].end},a={type:"chunkText",start:n[i][1].start,end:n[t][1].end,contentType:"text"},Lr(n,i,t-i+1,[["enter",r,e],["enter",a,e],["exit",a,e],["exit",r,e]])),n}function ZP(n,e,t){let i=0;return r;function r(p){return n.enter("atxHeading"),a(p)}function a(p){return n.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(n.consume(p),l):p===null||Un(p)?(n.exit("atxHeadingSequence"),o(p)):t(p)}function o(p){return p===35?(n.enter("atxHeadingSequence"),u(p)):p===null||Mt(p)?(n.exit("atxHeading"),e(p)):ln(p)?pn(n,o,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function u(p){return p===35?(n.consume(p),u):(n.exit("atxHeadingSequence"),o(p))}function h(p){return p===null||p===35||Un(p)?(n.exit("atxHeadingText"),o(p)):(n.consume(p),h)}}const JP=["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"],gC=["pre","script","style","textarea"],QP={concrete:!0,name:"htmlFlow",resolveTo:n8,tokenize:i8},e8={partial:!0,tokenize:s8},t8={partial:!0,tokenize:r8};function n8(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function i8(n,e,t){const i=this;let r,a,l,o,u;return h;function h(V){return p(V)}function p(V){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(V),f}function f(V){return V===33?(n.consume(V),m):V===47?(n.consume(V),a=!0,w):V===63?(n.consume(V),r=3,i.interrupt?e:B):ar(V)?(n.consume(V),l=String.fromCharCode(V),v):t(V)}function m(V){return V===45?(n.consume(V),r=2,g):V===91?(n.consume(V),r=5,o=0,_):ar(V)?(n.consume(V),r=4,i.interrupt?e:B):t(V)}function g(V){return V===45?(n.consume(V),i.interrupt?e:B):t(V)}function _(V){const _e="CDATA[";return V===_e.charCodeAt(o++)?(n.consume(V),o===_e.length?i.interrupt?e:Y:_):t(V)}function w(V){return ar(V)?(n.consume(V),l=String.fromCharCode(V),v):t(V)}function v(V){if(V===null||V===47||V===62||Un(V)){const _e=V===47,Ee=l.toLowerCase();return!_e&&!a&&gC.includes(Ee)?(r=1,i.interrupt?e(V):Y(V)):JP.includes(l.toLowerCase())?(r=6,_e?(n.consume(V),x):i.interrupt?e(V):Y(V)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(V):a?S(V):b(V))}return V===45||Yi(V)?(n.consume(V),l+=String.fromCharCode(V),v):t(V)}function x(V){return V===62?(n.consume(V),i.interrupt?e:Y):t(V)}function S(V){return ln(V)?(n.consume(V),S):j(V)}function b(V){return V===47?(n.consume(V),j):V===58||V===95||ar(V)?(n.consume(V),C):ln(V)?(n.consume(V),b):j(V)}function C(V){return V===45||V===46||V===58||V===95||Yi(V)?(n.consume(V),C):O(V)}function O(V){return V===61?(n.consume(V),M):ln(V)?(n.consume(V),O):b(V)}function M(V){return V===null||V===60||V===61||V===62||V===96?t(V):V===34||V===39?(n.consume(V),u=V,D):ln(V)?(n.consume(V),M):N(V)}function D(V){return V===u?(n.consume(V),u=null,L):V===null||Mt(V)?t(V):(n.consume(V),D)}function N(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||Un(V)?O(V):(n.consume(V),N)}function L(V){return V===47||V===62||ln(V)?b(V):t(V)}function j(V){return V===62?(n.consume(V),K):t(V)}function K(V){return V===null||Mt(V)?Y(V):ln(V)?(n.consume(V),K):t(V)}function Y(V){return V===45&&r===2?(n.consume(V),$):V===60&&r===1?(n.consume(V),J):V===62&&r===4?(n.consume(V),U):V===63&&r===3?(n.consume(V),B):V===93&&r===5?(n.consume(V),F):Mt(V)&&(r===6||r===7)?(n.exit("htmlFlowData"),n.check(e8,X,H)(V)):V===null||Mt(V)?(n.exit("htmlFlowData"),H(V)):(n.consume(V),Y)}function H(V){return n.check(t8,Q,X)(V)}function Q(V){return n.enter("lineEnding"),n.consume(V),n.exit("lineEnding"),te}function te(V){return V===null||Mt(V)?H(V):(n.enter("htmlFlowData"),Y(V))}function $(V){return V===45?(n.consume(V),B):Y(V)}function J(V){return V===47?(n.consume(V),l="",re):Y(V)}function re(V){if(V===62){const _e=l.toLowerCase();return gC.includes(_e)?(n.consume(V),U):Y(V)}return ar(V)&&l.length<8?(n.consume(V),l+=String.fromCharCode(V),re):Y(V)}function F(V){return V===93?(n.consume(V),B):Y(V)}function B(V){return V===62?(n.consume(V),U):V===45&&r===2?(n.consume(V),B):Y(V)}function U(V){return V===null||Mt(V)?(n.exit("htmlFlowData"),X(V)):(n.consume(V),U)}function X(V){return n.exit("htmlFlow"),e(V)}}function r8(n,e,t){const i=this;return r;function r(l){return Mt(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),a):t(l)}function a(l){return i.parser.lazy[i.now().line]?t(l):e(l)}}function s8(n,e,t){return i;function i(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),n.attempt(ud,e,t)}}const a8={name:"htmlText",tokenize:o8};function o8(n,e,t){const i=this;let r,a,l;return o;function o(B){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(B),u}function u(B){return B===33?(n.consume(B),h):B===47?(n.consume(B),O):B===63?(n.consume(B),b):ar(B)?(n.consume(B),N):t(B)}function h(B){return B===45?(n.consume(B),p):B===91?(n.consume(B),a=0,_):ar(B)?(n.consume(B),S):t(B)}function p(B){return B===45?(n.consume(B),g):t(B)}function f(B){return B===null?t(B):B===45?(n.consume(B),m):Mt(B)?(l=f,J(B)):(n.consume(B),f)}function m(B){return B===45?(n.consume(B),g):f(B)}function g(B){return B===62?$(B):B===45?m(B):f(B)}function _(B){const U="CDATA[";return B===U.charCodeAt(a++)?(n.consume(B),a===U.length?w:_):t(B)}function w(B){return B===null?t(B):B===93?(n.consume(B),v):Mt(B)?(l=w,J(B)):(n.consume(B),w)}function v(B){return B===93?(n.consume(B),x):w(B)}function x(B){return B===62?$(B):B===93?(n.consume(B),x):w(B)}function S(B){return B===null||B===62?$(B):Mt(B)?(l=S,J(B)):(n.consume(B),S)}function b(B){return B===null?t(B):B===63?(n.consume(B),C):Mt(B)?(l=b,J(B)):(n.consume(B),b)}function C(B){return B===62?$(B):b(B)}function O(B){return ar(B)?(n.consume(B),M):t(B)}function M(B){return B===45||Yi(B)?(n.consume(B),M):D(B)}function D(B){return Mt(B)?(l=D,J(B)):ln(B)?(n.consume(B),D):$(B)}function N(B){return B===45||Yi(B)?(n.consume(B),N):B===47||B===62||Un(B)?L(B):t(B)}function L(B){return B===47?(n.consume(B),$):B===58||B===95||ar(B)?(n.consume(B),j):Mt(B)?(l=L,J(B)):ln(B)?(n.consume(B),L):$(B)}function j(B){return B===45||B===46||B===58||B===95||Yi(B)?(n.consume(B),j):K(B)}function K(B){return B===61?(n.consume(B),Y):Mt(B)?(l=K,J(B)):ln(B)?(n.consume(B),K):L(B)}function Y(B){return B===null||B===60||B===61||B===62||B===96?t(B):B===34||B===39?(n.consume(B),r=B,H):Mt(B)?(l=Y,J(B)):ln(B)?(n.consume(B),Y):(n.consume(B),Q)}function H(B){return B===r?(n.consume(B),r=void 0,te):B===null?t(B):Mt(B)?(l=H,J(B)):(n.consume(B),H)}function Q(B){return B===null||B===34||B===39||B===60||B===61||B===96?t(B):B===47||B===62||Un(B)?L(B):(n.consume(B),Q)}function te(B){return B===47||B===62||Un(B)?L(B):t(B)}function $(B){return B===62?(n.consume(B),n.exit("htmlTextData"),n.exit("htmlText"),e):t(B)}function J(B){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),re}function re(B){return ln(B)?pn(n,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return n.enter("htmlTextData"),l(B)}}const Ib={name:"labelEnd",resolveAll:h8,resolveTo:d8,tokenize:f8},l8={tokenize:p8},c8={tokenize:m8},u8={tokenize:g8};function h8(n){let e=-1;const t=[];for(;++e<n.length;){const i=n[e][1];if(t.push(n[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return n.length!==t.length&&Lr(n,0,n.length,t),n}function d8(n,e){let t=n.length,i=0,r,a,l,o;for(;t--;)if(r=n[t][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;n[t][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=t,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(l=t);const u={type:n[a][1].type==="labelLink"?"link":"image",start:{...n[a][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[a][1].start},end:{...n[l][1].end}},p={type:"labelText",start:{...n[a+i+2][1].end},end:{...n[l-2][1].start}};return o=[["enter",u,e],["enter",h,e]],o=es(o,n.slice(a+1,a+i+3)),o=es(o,[["enter",p,e]]),o=es(o,bm(e.parser.constructs.insideSpan.null,n.slice(a+i+4,l-3),e)),o=es(o,[["exit",p,e],n[l-2],n[l-1],["exit",h,e]]),o=es(o,n.slice(l+1)),o=es(o,[["exit",u,e]]),Lr(n,a,n.length,o),n}function f8(n,e,t){const i=this;let r=i.events.length,a,l;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(m){return a?a._inactive?f(m):(l=i.parser.defined.includes(Ss(i.sliceSerialize({start:a.end,end:i.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),n.exit("labelEnd"),u):t(m)}function u(m){return m===40?n.attempt(l8,p,l?p:f)(m):m===91?n.attempt(c8,p,l?h:f)(m):l?p(m):f(m)}function h(m){return n.attempt(u8,p,f)(m)}function p(m){return e(m)}function f(m){return a._balanced=!0,t(m)}}function p8(n,e,t){return i;function i(f){return n.enter("resource"),n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),r}function r(f){return Un(f)?jh(n,a)(f):a(f)}function a(f){return f===41?p(f):J2(n,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return Un(f)?jh(n,u)(f):p(f)}function o(f){return t(f)}function u(f){return f===34||f===39||f===40?eA(n,h,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):p(f)}function h(f){return Un(f)?jh(n,p)(f):p(f)}function p(f){return f===41?(n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),n.exit("resource"),e):t(f)}}function m8(n,e,t){const i=this;return r;function r(o){return Q2.call(i,n,a,l,"reference","referenceMarker","referenceString")(o)}function a(o){return i.parser.defined.includes(Ss(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(o):t(o)}function l(o){return t(o)}}function g8(n,e,t){return i;function i(a){return n.enter("reference"),n.enter("referenceMarker"),n.consume(a),n.exit("referenceMarker"),r}function r(a){return a===93?(n.enter("referenceMarker"),n.consume(a),n.exit("referenceMarker"),n.exit("reference"),e):t(a)}}const y8={name:"labelStartImage",resolveAll:Ib.resolveAll,tokenize:_8};function _8(n,e,t){const i=this;return r;function r(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),a}function a(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),l):t(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(o):e(o)}}const b8={name:"labelStartLink",resolveAll:Ib.resolveAll,tokenize:v8};function v8(n,e,t){const i=this;return r;function r(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(l):e(l)}}const x_={name:"lineEnding",tokenize:x8};function x8(n,e){return t;function t(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),pn(n,e,"linePrefix")}}const Np={name:"thematicBreak",tokenize:S8};function S8(n,e,t){let i=0,r;return a;function a(h){return n.enter("thematicBreak"),l(h)}function l(h){return r=h,o(h)}function o(h){return h===r?(n.enter("thematicBreakSequence"),u(h)):i>=3&&(h===null||Mt(h))?(n.exit("thematicBreak"),e(h)):t(h)}function u(h){return h===r?(n.consume(h),i++,u):(n.exit("thematicBreakSequence"),ln(h)?pn(n,o,"whitespace")(h):o(h))}}const _r={continuation:{tokenize:A8},exit:T8,name:"list",tokenize:E8},w8={partial:!0,tokenize:M8},C8={partial:!0,tokenize:k8};function E8(n,e,t){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,l=0;return o;function o(g){const _=i.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!i.containerState.marker||g===i.containerState.marker:y0(g)){if(i.containerState.type||(i.containerState.type=_,n.enter(_,{_container:!0})),_==="listUnordered")return n.enter("listItemPrefix"),g===42||g===45?n.check(Np,t,h)(g):h(g);if(!i.interrupt||g===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),u(g)}return t(g)}function u(g){return y0(g)&&++l<10?(n.consume(g),u):(!i.interrupt||l<2)&&(i.containerState.marker?g===i.containerState.marker:g===41||g===46)?(n.exit("listItemValue"),h(g)):t(g)}function h(g){return n.enter("listItemMarker"),n.consume(g),n.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||g,n.check(ud,i.interrupt?t:p,n.attempt(w8,m,f))}function p(g){return i.containerState.initialBlankLine=!0,a++,m(g)}function f(g){return ln(g)?(n.enter("listItemPrefixWhitespace"),n.consume(g),n.exit("listItemPrefixWhitespace"),m):t(g)}function m(g){return i.containerState.size=a+i.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(g)}}function A8(n,e,t){const i=this;return i.containerState._closeFlow=void 0,n.check(ud,r,a);function r(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,pn(n,e,"listItemIndent",i.containerState.size+1)(o)}function a(o){return i.containerState.furtherBlankLines||!ln(o)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(o)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,n.attempt(C8,e,l)(o))}function l(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,pn(n,n.attempt(_r,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function k8(n,e,t){const i=this;return pn(n,r,"listItemIndent",i.containerState.size+1);function r(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?e(a):t(a)}}function T8(n){n.exit(this.containerState.type)}function M8(n,e,t){const i=this;return pn(n,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const l=i.events[i.events.length-1];return!ln(a)&&l&&l[1].type==="listItemPrefixWhitespace"?e(a):t(a)}}const yC={name:"setextUnderline",resolveTo:R8,tokenize:O8};function R8(n,e){let t=n.length,i,r,a;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){i=t;break}n[t][1].type==="paragraph"&&(r=t)}else n[t][1].type==="content"&&n.splice(t,1),!a&&n[t][1].type==="definition"&&(a=t);const l={type:"setextHeading",start:{...n[i][1].start},end:{...n[n.length-1][1].end}};return n[r][1].type="setextHeadingText",a?(n.splice(r,0,["enter",l,e]),n.splice(a+1,0,["exit",n[i][1],e]),n[i][1].end={...n[a][1].end}):n[i][1]=l,n.push(["exit",l,e]),n}function O8(n,e,t){const i=this;let r;return a;function a(h){let p=i.events.length,f;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){f=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(n.enter("setextHeadingLine"),r=h,l(h)):t(h)}function l(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===r?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),ln(h)?pn(n,u,"lineSuffix")(h):u(h))}function u(h){return h===null||Mt(h)?(n.exit("setextHeadingLine"),e(h)):t(h)}}const N8={tokenize:D8};function D8(n){const e=this,t=n.attempt(ud,i,n.attempt(this.parser.constructs.flowInitial,r,pn(n,n.attempt(this.parser.constructs.flow,r,n.attempt(PP,r)),"linePrefix")));return t;function i(a){if(a===null){n.consume(a);return}return n.enter("lineEndingBlank"),n.consume(a),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function r(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const I8={resolveAll:nA()},L8=tA("string"),B8=tA("text");function tA(n){return{resolveAll:nA(n==="text"?z8:void 0),tokenize:e};function e(t){const i=this,r=this.parser.constructs[n],a=t.attempt(r,l,o);return l;function l(p){return h(p)?a(p):o(p)}function o(p){if(p===null){t.consume(p);return}return t.enter("data"),t.consume(p),u}function u(p){return h(p)?(t.exit("data"),a(p)):(t.consume(p),u)}function h(p){if(p===null)return!0;const f=r[p];let m=-1;if(f)for(;++m<f.length;){const g=f[m];if(!g.previous||g.previous.call(i,i.previous))return!0}return!1}}}function nA(n){return e;function e(t,i){let r=-1,a;for(;++r<=t.length;)a===void 0?t[r]&&t[r][1].type==="data"&&(a=r,r++):(!t[r]||t[r][1].type!=="data")&&(r!==a+2&&(t[a][1].end=t[r-1][1].end,t.splice(a+2,r-a-2),r=a+2),a=void 0);return n?n(t,i):t}}function z8(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const i=n[t-1][1],r=e.sliceStream(i);let a=r.length,l=-1,o=0,u;for(;a--;){const h=r[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(h===-2)u=!0,o++;else if(h!==-1){a++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(o=0),o){const h={type:t===n.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(n.splice(t,0,["enter",h,e],["exit",h,e]),t+=2)}t++}return n}const P8={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:K2},F8={91:qP},U8={[-2]:v_,[-1]:v_,32:v_},j8={35:YP,42:Np,45:[yC,Np],60:QP,61:yC,95:Np,96:mC,126:mC},H8={38:X2,92:Y2},q8={[-5]:x_,[-4]:x_,[-3]:x_,33:y8,38:X2,42:_0,60:[bP,a8],91:b8,92:[GP,Y2],93:Ib,95:_0,96:NP},V8={null:[_0,I8]},W8={null:[42,95]},$8={null:[]},G8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:W8,contentInitial:F8,disable:$8,document:P8,flow:j8,flowInitial:U8,insideSpan:V8,string:H8,text:q8},Symbol.toStringTag,{value:"Module"}));function K8(n,e,t){let i={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const r={},a=[];let l=[],o=[];const u={attempt:D(O),check:D(M),consume:S,enter:b,exit:C,interrupt:D(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:_,parser:n,previous:null,sliceSerialize:m,sliceStream:g,write:f};let p=e.tokenize.call(h,u);return e.resolveAll&&a.push(e),h;function f(K){return l=es(l,K),v(),l[l.length-1]!==null?[]:(N(e,0),h.events=bm(a,h.events,h),h.events)}function m(K,Y){return X8(g(K),Y)}function g(K){return Y8(l,K)}function _(){const{_bufferIndex:K,_index:Y,line:H,column:Q,offset:te}=i;return{_bufferIndex:K,_index:Y,line:H,column:Q,offset:te}}function w(K){r[K.line]=K.column,j()}function v(){let K;for(;i._index<l.length;){const Y=l[i._index];if(typeof Y=="string")for(K=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===K&&i._bufferIndex<Y.length;)x(Y.charCodeAt(i._bufferIndex));else x(Y)}}function x(K){p=p(K)}function S(K){Mt(K)?(i.line++,i.column=1,i.offset+=K===-3?2:1,j()):K!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=K}function b(K,Y){const H=Y||{};return H.type=K,H.start=_(),h.events.push(["enter",H,h]),o.push(H),H}function C(K){const Y=o.pop();return Y.end=_(),h.events.push(["exit",Y,h]),Y}function O(K,Y){N(K,Y.from)}function M(K,Y){Y.restore()}function D(K,Y){return H;function H(Q,te,$){let J,re,F,B;return Array.isArray(Q)?X(Q):"tokenize"in Q?X([Q]):U(Q);function U(Ie){return ae;function ae(ee){const Te=ee!==null&&Ie[ee],ye=ee!==null&&Ie.null,Me=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return X(Me)(ee)}}function X(Ie){return J=Ie,re=0,Ie.length===0?$:V(Ie[re])}function V(Ie){return ae;function ae(ee){return B=L(),F=Ie,Ie.partial||(h.currentConstruct=Ie),Ie.name&&h.parser.constructs.disable.null.includes(Ie.name)?Ee():Ie.tokenize.call(Y?Object.assign(Object.create(h),Y):h,u,_e,Ee)(ee)}}function _e(Ie){return K(F,B),te}function Ee(Ie){return B.restore(),++re<J.length?V(J[re]):$}}}function N(K,Y){K.resolveAll&&!a.includes(K)&&a.push(K),K.resolve&&Lr(h.events,Y,h.events.length-Y,K.resolve(h.events.slice(Y),h)),K.resolveTo&&(h.events=K.resolveTo(h.events,h))}function L(){const K=_(),Y=h.previous,H=h.currentConstruct,Q=h.events.length,te=Array.from(o);return{from:Q,restore:$};function $(){i=K,h.previous=Y,h.currentConstruct=H,h.events.length=Q,o=te,j()}}function j(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Y8(n,e){const t=e.start._index,i=e.start._bufferIndex,r=e.end._index,a=e.end._bufferIndex;let l;if(t===r)l=[n[t].slice(i,a)];else{if(l=n.slice(t,r),i>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(i):l.shift()}a>0&&l.push(n[r].slice(0,a))}return l}function X8(n,e){let t=-1;const i=[];let r;for(;++t<n.length;){const a=n[t];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
58
|
-
`;break}case-3:{l=`\r
|
|
59
|
-
`;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&r)continue;l=" ";break}default:l=String.fromCharCode(a)}r=a===-2,i.push(l)}return i.join("")}function Z8(n){const i={constructs:$2([G8,...(n||{}).extensions||[]]),content:r(dP),defined:[],document:r(pP),flow:r(N8),lazy:{},string:r(L8),text:r(B8)};return i;function r(a){return l;function l(o){return K8(i,a,o)}}}function J8(n){for(;!Z2(n););return n}const _C=/[\0\t\n\r]/g;function Q8(){let n=1,e="",t=!0,i;return r;function r(a,l,o){const u=[];let h,p,f,m,g;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),f=0,e="",t&&(a.charCodeAt(0)===65279&&f++,t=void 0);f<a.length;){if(_C.lastIndex=f,h=_C.exec(a),m=h&&h.index!==void 0?h.index:a.length,g=a.charCodeAt(m),!h){e=a.slice(f);break}if(g===10&&f===m&&i)u.push(-3),i=void 0;else switch(i&&(u.push(-5),i=void 0),f<m&&(u.push(a.slice(f,m)),n+=m-f),g){case 0:{u.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,u.push(-2);n++<p;)u.push(-1);break}case 10:{u.push(-4),n=1;break}default:i=!0,n=1}f=m+1}return o&&(i&&u.push(-5),e&&u.push(e),u.push(null)),u}}const eF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tF(n){return n.replace(eF,nF)}function nF(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const r=t.charCodeAt(1),a=r===120||r===88;return G2(t.slice(a?2:1),a?16:10)}return Db(t)||n}const iA={}.hasOwnProperty;function iF(n,e,t){return e&&typeof e=="object"&&(t=e,e=void 0),rF(t)(J8(Z8(t).document().write(Q8()(n,e,!0))))}function rF(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rt),autolinkProtocol:L,autolinkEmail:L,atxHeading:a(Pe),blockQuote:a(ye),characterEscape:L,characterReference:L,codeFenced:a(Me),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Me,l),codeText:a(we,l),codeTextData:L,data:L,codeFlowValue:L,definition:a(it),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(De),hardBreakEscape:a(Fe),hardBreakTrailing:a(Fe),htmlFlow:a(je,l),htmlFlowData:L,htmlText:a(je,l),htmlTextData:L,image:a(st),label:l,link:a(Rt),listItem:a(Lt),listItemValue:m,listOrdered:a(bt,f),listUnordered:a(bt),paragraph:a(sn),reference:V,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Pe),strong:a(jt),thematicBreak:a(Cn)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:Te,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:Ie,characterReference:ae,codeFenced:u(v),codeFencedFence:w,codeFencedFenceInfo:g,codeFencedFenceMeta:_,codeFlowValue:j,codeIndented:u(x),codeText:u(te),codeTextData:j,data:j,definition:u(),definitionDestinationString:C,definitionLabelString:S,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(Y),hardBreakTrailing:u(Y),htmlFlow:u(H),htmlFlowData:j,htmlText:u(Q),htmlTextData:j,image:u(J),label:F,labelText:re,lineEnding:K,link:u($),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:_e,resourceDestinationString:B,resourceTitleString:U,resource:X,setextHeading:u(N),setextHeadingLineSequence:D,setextHeadingText:M,strong:u(),thematicBreak:u()}};rA(e,(n||{}).mdastExtensions||[]);const t={};return i;function i(Ce){let qe={type:"root",children:[]};const ft={stack:[qe],tokenStack:[],config:e,enter:o,exit:h,buffer:l,resume:p,data:t},Ct=[];let Bt=-1;for(;++Bt<Ce.length;)if(Ce[Bt][1].type==="listOrdered"||Ce[Bt][1].type==="listUnordered")if(Ce[Bt][0]==="enter")Ct.push(Bt);else{const Nn=Ct.pop();Bt=r(Ce,Nn,Bt)}for(Bt=-1;++Bt<Ce.length;){const Nn=e[Ce[Bt][0]];iA.call(Nn,Ce[Bt][1].type)&&Nn[Ce[Bt][1].type].call(Object.assign({sliceSerialize:Ce[Bt][2].sliceSerialize},ft),Ce[Bt][1])}if(ft.tokenStack.length>0){const Nn=ft.tokenStack[ft.tokenStack.length-1];(Nn[1]||bC).call(ft,void 0,Nn[0])}for(qe.position={start:No(Ce.length>0?Ce[0][1].start:{line:1,column:1,offset:0}),end:No(Ce.length>0?Ce[Ce.length-2][1].end:{line:1,column:1,offset:0})},Bt=-1;++Bt<e.transforms.length;)qe=e.transforms[Bt](qe)||qe;return qe}function r(Ce,qe,ft){let Ct=qe-1,Bt=-1,Nn=!1,Ft,Pn,jn,Vn;for(;++Ct<=ft;){const Je=Ce[Ct];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Bt++:Bt--,Vn=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Ft&&!Vn&&!Bt&&!jn&&(jn=Ct),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!Bt&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Bt===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Ft){let Fi=Ct;for(Pn=void 0;Fi--;){const Jn=Ce[Fi];if(Jn[1].type==="lineEnding"||Jn[1].type==="lineEndingBlank"){if(Jn[0]==="exit")continue;Pn&&(Ce[Pn][1].type="lineEndingBlank",Nn=!0),Jn[1].type="lineEnding",Pn=Fi}else if(!(Jn[1].type==="linePrefix"||Jn[1].type==="blockQuotePrefix"||Jn[1].type==="blockQuotePrefixWhitespace"||Jn[1].type==="blockQuoteMarker"||Jn[1].type==="listItemIndent"))break}jn&&(!Pn||jn<Pn)&&(Ft._spread=!0),Ft.end=Object.assign({},Pn?Ce[Pn][1].start:Je[1].end),Ce.splice(Pn||Ct,0,["exit",Ft,Je[2]]),Ct++,ft++}if(Je[1].type==="listItemPrefix"){const Fi={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Ft=Fi,Ce.splice(Ct,0,["enter",Fi,Je[2]]),Ct++,ft++,jn=void 0,Vn=!0}}}return Ce[qe][1]._spread=Nn,ft}function a(Ce,qe){return ft;function ft(Ct){o.call(this,Ce(Ct),Ct),qe&&qe.call(this,Ct)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(Ce,qe,ft){this.stack[this.stack.length-1].children.push(Ce),this.stack.push(Ce),this.tokenStack.push([qe,ft||void 0]),Ce.position={start:No(qe.start),end:void 0}}function u(Ce){return qe;function qe(ft){Ce&&Ce.call(this,ft),h.call(this,ft)}}function h(Ce,qe){const ft=this.stack.pop(),Ct=this.tokenStack.pop();if(Ct)Ct[0].type!==Ce.type&&(qe?qe.call(this,Ce,Ct[0]):(Ct[1]||bC).call(this,Ce,Ct[0]));else throw new Error("Cannot close `"+Ce.type+"` ("+Uh({start:Ce.start,end:Ce.end})+"): it’s not open");ft.position.end=No(Ce.end)}function p(){return Nb(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(Ce){if(this.data.expectingFirstListItemValue){const qe=this.stack[this.stack.length-2];qe.start=Number.parseInt(this.sliceSerialize(Ce),10),this.data.expectingFirstListItemValue=void 0}}function g(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.lang=Ce}function _(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.meta=Ce}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.value=Ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.value=Ce.replace(/(\r?\n|\r)$/g,"")}function S(Ce){const qe=this.resume(),ft=this.stack[this.stack.length-1];ft.label=qe,ft.identifier=Ss(this.sliceSerialize(Ce)).toLowerCase()}function b(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.title=Ce}function C(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.url=Ce}function O(Ce){const qe=this.stack[this.stack.length-1];if(!qe.depth){const ft=this.sliceSerialize(Ce).length;qe.depth=ft}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function D(Ce){const qe=this.stack[this.stack.length-1];qe.depth=this.sliceSerialize(Ce).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function L(Ce){const ft=this.stack[this.stack.length-1].children;let Ct=ft[ft.length-1];(!Ct||Ct.type!=="text")&&(Ct=Pt(),Ct.position={start:No(Ce.start),end:void 0},ft.push(Ct)),this.stack.push(Ct)}function j(Ce){const qe=this.stack.pop();qe.value+=this.sliceSerialize(Ce),qe.position.end=No(Ce.end)}function K(Ce){const qe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ft=qe.children[qe.children.length-1];ft.position.end=No(Ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(qe.type)&&(L.call(this,Ce),j.call(this,Ce))}function Y(){this.data.atHardBreak=!0}function H(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.value=Ce}function Q(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.value=Ce}function te(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.value=Ce}function $(){const Ce=this.stack[this.stack.length-1];if(this.data.inReference){const qe=this.data.referenceType||"shortcut";Ce.type+="Reference",Ce.referenceType=qe,delete Ce.url,delete Ce.title}else delete Ce.identifier,delete Ce.label;this.data.referenceType=void 0}function J(){const Ce=this.stack[this.stack.length-1];if(this.data.inReference){const qe=this.data.referenceType||"shortcut";Ce.type+="Reference",Ce.referenceType=qe,delete Ce.url,delete Ce.title}else delete Ce.identifier,delete Ce.label;this.data.referenceType=void 0}function re(Ce){const qe=this.sliceSerialize(Ce),ft=this.stack[this.stack.length-2];ft.label=tF(qe),ft.identifier=Ss(qe).toLowerCase()}function F(){const Ce=this.stack[this.stack.length-1],qe=this.resume(),ft=this.stack[this.stack.length-1];if(this.data.inReference=!0,ft.type==="link"){const Ct=Ce.children;ft.children=Ct}else ft.alt=qe}function B(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.url=Ce}function U(){const Ce=this.resume(),qe=this.stack[this.stack.length-1];qe.title=Ce}function X(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function _e(Ce){const qe=this.resume(),ft=this.stack[this.stack.length-1];ft.label=qe,ft.identifier=Ss(this.sliceSerialize(Ce)).toLowerCase(),this.data.referenceType="full"}function Ee(Ce){this.data.characterReferenceType=Ce.type}function Ie(Ce){const qe=this.sliceSerialize(Ce),ft=this.data.characterReferenceType;let Ct;ft?(Ct=G2(qe,ft==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ct=Db(qe);const Bt=this.stack[this.stack.length-1];Bt.value+=Ct}function ae(Ce){const qe=this.stack.pop();qe.position.end=No(Ce.end)}function ee(Ce){j.call(this,Ce);const qe=this.stack[this.stack.length-1];qe.url=this.sliceSerialize(Ce)}function Te(Ce){j.call(this,Ce);const qe=this.stack[this.stack.length-1];qe.url="mailto:"+this.sliceSerialize(Ce)}function ye(){return{type:"blockquote",children:[]}}function Me(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function it(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function Fe(){return{type:"break"}}function je(){return{type:"html",value:""}}function st(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function bt(Ce){return{type:"list",ordered:Ce.type==="listOrdered",start:null,spread:Ce._spread,children:[]}}function Lt(Ce){return{type:"listItem",spread:Ce._spread,checked:null,children:[]}}function sn(){return{type:"paragraph",children:[]}}function jt(){return{type:"strong",children:[]}}function Pt(){return{type:"text",value:""}}function Cn(){return{type:"thematicBreak"}}}function No(n){return{line:n.line,column:n.column,offset:n.offset}}function rA(n,e){let t=-1;for(;++t<e.length;){const i=e[t];Array.isArray(i)?rA(n,i):sF(n,i)}}function sF(n,e){let t;for(t in e)if(iA.call(e,t))switch(t){case"canContainEols":{const i=e[t];i&&n[t].push(...i);break}case"transforms":{const i=e[t];i&&n[t].push(...i);break}case"enter":case"exit":{const i=e[t];i&&Object.assign(n[t],i);break}}}function bC(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+Uh({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+Uh({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Uh({start:e.start,end:e.end})+") is still open")}function aF(n){const e=this;e.parser=t;function t(i){return iF(i,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function oF(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function lF(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:`
|
|
60
|
-
`}]}function cF(n,e){const t=e.value?e.value+`
|
|
61
|
-
`:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:t}]};return e.meta&&(a.data={meta:e.meta}),n.patch(e,a),a=n.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},n.patch(e,a),a}function uF(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function hF(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function dF(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=gu(i.toLowerCase()),a=n.footnoteOrder.indexOf(i);let l,o=n.footnoteCounts.get(i);o===void 0?(o=0,n.footnoteOrder.push(i),l=n.footnoteOrder.length):l=a+1,o+=1,n.footnoteCounts.set(i,o);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+r,id:t+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};n.patch(e,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return n.patch(e,h),n.applyData(e,h)}function fF(n,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function pF(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function sA(n,e){const t=e.referenceType;let i="]";if(t==="collapsed"?i+="[]":t==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=n.all(e),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const l=r[r.length-1];return l&&l.type==="text"?l.value+=i:r.push({type:"text",value:i}),r}function mF(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return sA(n,e);const r={src:gu(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 n.patch(e,a),n.applyData(e,a)}function gF(n,e){const t={src:gu(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"img",properties:t,children:[]};return n.patch(e,i),n.applyData(e,i)}function yF(n,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};n.patch(e,t);const i={type:"element",tagName:"code",properties:{},children:[t]};return n.patch(e,i),n.applyData(e,i)}function _F(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return sA(n,e);const r={href:gu(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:n.all(e)};return n.patch(e,a),n.applyData(e,a)}function bF(n,e){const t={href:gu(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"a",properties:t,children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function vF(n,e,t){const i=n.all(e),r=t?xF(t):aA(e),a={},l=[];if(typeof e.checked=="boolean"){const p=i[0];let f;p&&p.type==="element"&&p.tagName==="p"?f=p:(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 p=i[o];(r||o!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
62
|
-
`}),p.type==="element"&&p.tagName==="p"&&!r?l.push(...p.children):l.push(p)}const u=i[i.length-1];u&&(r||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
|
|
63
|
-
`});const h={type:"element",tagName:"li",properties:a,children:l};return n.patch(e,h),n.applyData(e,h)}function xF(n){let e=!1;if(n.type==="list"){e=n.spread||!1;const t=n.children;let i=-1;for(;!e&&++i<t.length;)e=aA(t[i])}return e}function aA(n){const e=n.spread;return e??n.children.length>1}function SF(n,e){const t={},i=n.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++r<i.length;){const l=i[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:n.wrap(i,!0)};return n.patch(e,a),n.applyData(e,a)}function wF(n,e){const t={type:"element",tagName:"p",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function CF(n,e){const t={type:"root",children:n.wrap(n.all(e))};return n.patch(e,t),n.applyData(e,t)}function EF(n,e){const t={type:"element",tagName:"strong",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function AF(n,e){const t=n.all(e),i=t.shift(),r=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:n.wrap([i],!0)};n.patch(e.children[0],l),r.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:n.wrap(t,!0)},o=Tb(e.children[1]),u=F2(e.children[e.children.length-1]);o&&u&&(l.position={start:o,end:u}),r.push(l)}const a={type:"element",tagName:"table",properties:{},children:n.wrap(r,!0)};return n.patch(e,a),n.applyData(e,a)}function kF(n,e,t){const i=t?t.children:void 0,a=(i?i.indexOf(e):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,o=l?l.length:e.children.length;let u=-1;const h=[];for(;++u<o;){const f=e.children[u],m={},g=l?l[u]:void 0;g&&(m.align=g);let _={type:"element",tagName:a,properties:m,children:[]};f&&(_.children=n.all(f),n.patch(f,_),_=n.applyData(f,_)),h.push(_)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(e,p),n.applyData(e,p)}function TF(n,e){const t={type:"element",tagName:"td",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}const vC=9,xC=32;function MF(n){const e=String(n),t=/\r?\n|\r/g;let i=t.exec(e),r=0;const a=[];for(;i;)a.push(SC(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return a.push(SC(e.slice(r),r>0,!1)),a.join("")}function SC(n,e,t){let i=0,r=n.length;if(e){let a=n.codePointAt(i);for(;a===vC||a===xC;)i++,a=n.codePointAt(i)}if(t){let a=n.codePointAt(r-1);for(;a===vC||a===xC;)r--,a=n.codePointAt(r-1)}return r>i?n.slice(i,r):""}function RF(n,e){const t={type:"text",value:MF(String(e.value))};return n.patch(e,t),n.applyData(e,t)}function OF(n,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(e,t),n.applyData(e,t)}const NF={blockquote:oF,break:lF,code:cF,delete:uF,emphasis:hF,footnoteReference:dF,heading:fF,html:pF,imageReference:mF,image:gF,inlineCode:yF,linkReference:_F,link:bF,listItem:vF,list:SF,paragraph:wF,root:CF,strong:EF,table:AF,tableCell:TF,tableRow:kF,text:RF,thematicBreak:OF,toml:gp,yaml:gp,definition:gp,footnoteDefinition:gp};function gp(){}const oA=-1,vm=0,Hh=1,Zp=2,Lb=3,Bb=4,zb=5,Pb=6,lA=7,cA=8,wC=typeof self=="object"?self:globalThis,DF=(n,e)=>{const t=(r,a)=>(n.set(a,r),r),i=r=>{if(n.has(r))return n.get(r);const[a,l]=e[r];switch(a){case vm:case oA:return t(l,r);case Hh:{const o=t([],r);for(const u of l)o.push(i(u));return o}case Zp:{const o=t({},r);for(const[u,h]of l)o[i(u)]=i(h);return o}case Lb:return t(new Date(l),r);case Bb:{const{source:o,flags:u}=l;return t(new RegExp(o,u),r)}case zb:{const o=t(new Map,r);for(const[u,h]of l)o.set(i(u),i(h));return o}case Pb:{const o=t(new Set,r);for(const u of l)o.add(i(u));return o}case lA:{const{name:o,message:u}=l;return t(new wC[o](u),r)}case cA:return t(BigInt(l),r);case"BigInt":return t(Object(BigInt(l)),r);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return t(new DataView(o),l)}}return t(new wC[a](l),r)};return i},CC=n=>DF(new Map,n)(0),$c="",{toString:IF}={},{keys:LF}=Object,Th=n=>{const e=typeof n;if(e!=="object"||!n)return[vm,e];const t=IF.call(n).slice(8,-1);switch(t){case"Array":return[Hh,$c];case"Object":return[Zp,$c];case"Date":return[Lb,$c];case"RegExp":return[Bb,$c];case"Map":return[zb,$c];case"Set":return[Pb,$c];case"DataView":return[Hh,t]}return t.includes("Array")?[Hh,t]:t.includes("Error")?[lA,t]:[Zp,t]},yp=([n,e])=>n===vm&&(e==="function"||e==="symbol"),BF=(n,e,t,i)=>{const r=(l,o)=>{const u=i.push(l)-1;return t.set(o,u),u},a=l=>{if(t.has(l))return t.get(l);let[o,u]=Th(l);switch(o){case vm:{let p=l;switch(u){case"bigint":o=cA,p=l.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return r([oA],l)}return r([o,p],l)}case Hh:{if(u){let m=l;return u==="DataView"?m=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(l)),r([u,[...m]],l)}const p=[],f=r([o,p],l);for(const m of l)p.push(a(m));return f}case Zp:{if(u)switch(u){case"BigInt":return r([u,l.toString()],l);case"Boolean":case"Number":case"String":return r([u,l.valueOf()],l)}if(e&&"toJSON"in l)return a(l.toJSON());const p=[],f=r([o,p],l);for(const m of LF(l))(n||!yp(Th(l[m])))&&p.push([a(m),a(l[m])]);return f}case Lb:return r([o,l.toISOString()],l);case Bb:{const{source:p,flags:f}=l;return r([o,{source:p,flags:f}],l)}case zb:{const p=[],f=r([o,p],l);for(const[m,g]of l)(n||!(yp(Th(m))||yp(Th(g))))&&p.push([a(m),a(g)]);return f}case Pb:{const p=[],f=r([o,p],l);for(const m of l)(n||!yp(Th(m)))&&p.push(a(m));return f}}const{message:h}=l;return r([o,{name:u,message:h}],l)};return a},EC=(n,{json:e,lossy:t}={})=>{const i=[];return BF(!(e||t),!!e,new Map,i)(n),i},Jp=typeof structuredClone=="function"?(n,e)=>e&&("json"in e||"lossy"in e)?CC(EC(n,e)):structuredClone(n):(n,e)=>CC(EC(n,e));function zF(n,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function PF(n,e){return"Back to reference "+(n+1)+(e>1?"-"+e:"")}function FF(n){const e=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",t=n.options.footnoteBackContent||zF,i=n.options.footnoteBackLabel||PF,r=n.options.footnoteLabel||"Footnotes",a=n.options.footnoteLabelTagName||"h2",l=n.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[u]);if(!h)continue;const p=n.all(h),f=String(h.identifier).toUpperCase(),m=gu(f.toLowerCase());let g=0;const _=[],w=n.footnoteCounts.get(f);for(;w!==void 0&&++g<=w;){_.length>0&&_.push({type:"text",value:" "});let S=typeof t=="string"?t:t(u,g);typeof S=="string"&&(S={type:"text",value:S}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(u,g),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const v=p[p.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const S=v.children[v.children.length-1];S&&S.type==="text"?S.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(..._)}else p.push(..._);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+m},children:n.wrap(p,!0)};n.patch(h,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Jp(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
64
|
-
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(o,!0)},{type:"text",value:`
|
|
65
|
-
`}]}}const hd=(function(n){if(n==null)return qF;if(typeof n=="function")return xm(n);if(typeof n=="object")return Array.isArray(n)?UF(n):jF(n);if(typeof n=="string")return HF(n);throw new Error("Expected function, string, or object as test")});function UF(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=hd(n[t]);return xm(i);function i(...r){let a=-1;for(;++a<e.length;)if(e[a].apply(this,r))return!0;return!1}}function jF(n){const e=n;return xm(t);function t(i){const r=i;let a;for(a in n)if(r[a]!==e[a])return!1;return!0}}function HF(n){return xm(e);function e(t){return t&&t.type===n}}function xm(n){return e;function e(t,i,r){return!!(VF(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function qF(){return!0}function VF(n){return n!==null&&typeof n=="object"&&"type"in n}const uA=[],WF=!0,b0=!1,$F="skip";function hA(n,e,t,i){let r;typeof e=="function"&&typeof t!="function"?(i=t,t=e):r=e;const a=hd(r),l=i?-1:1;o(n,void 0,[])();function o(u,h,p){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const g=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=uA,_,w,v;if((!e||a(u,h,p[p.length-1]||void 0))&&(g=GF(t(u,p)),g[0]===b0))return g;if("children"in u&&u.children){const x=u;if(x.children&&g[0]!==$F)for(w=(i?x.children.length:-1)+l,v=p.concat(x);w>-1&&w<x.children.length;){const S=x.children[w];if(_=o(S,w,v)(),_[0]===b0)return _;w=typeof _[1]=="number"?_[1]:w+l}}return g}}}function GF(n){return Array.isArray(n)?n:typeof n=="number"?[WF,n]:n==null?uA:[n]}function Sm(n,e,t,i){let r,a,l;typeof e=="function"&&typeof t!="function"?(a=void 0,l=e,r=t):(a=e,l=t,r=i),hA(n,a,o,r);function o(u,h){const p=h[h.length-1],f=p?p.children.indexOf(u):void 0;return l(u,f,p)}}const v0={}.hasOwnProperty,KF={};function YF(n,e){const t=e||KF,i=new Map,r=new Map,a=new Map,l={...NF,...t.handlers},o={all:h,applyData:ZF,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:l,one:u,options:t,patch:XF,wrap:QF};return Sm(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const f=p.type==="definition"?i:r,m=String(p.identifier).toUpperCase();f.has(m)||f.set(m,p)}}),o;function u(p,f){const m=p.type,g=o.handlers[m];if(v0.call(o.handlers,m)&&g)return g(o,p,f);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in p){const{children:w,...v}=p,x=Jp(v);return x.children=o.all(p),x}return Jp(p)}return(o.options.unknownHandler||JF)(o,p,f)}function h(p){const f=[];if("children"in p){const m=p.children;let g=-1;for(;++g<m.length;){const _=o.one(m[g],p);if(_){if(g&&m[g-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=AC(_.value)),!Array.isArray(_)&&_.type==="element")){const w=_.children[0];w&&w.type==="text"&&(w.value=AC(w.value))}Array.isArray(_)?f.push(..._):f.push(_)}}}return f}}function XF(n,e){n.position&&(e.position=Pz(n))}function ZF(n,e){let t=e;if(n&&n.data){const i=n.data.hName,r=n.data.hChildren,a=n.data.hProperties;if(typeof i=="string")if(t.type==="element")t.tagName=i;else{const l="children"in t?t.children:[t];t={type:"element",tagName:i,properties:{},children:l}}t.type==="element"&&a&&Object.assign(t.properties,Jp(a)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function JF(n,e){const t=e.data||{},i="value"in e&&!(v0.call(t,"hProperties")||v0.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function QF(n,e){const t=[];let i=-1;for(e&&t.push({type:"text",value:`
|
|
66
|
-
`});++i<n.length;)i&&t.push({type:"text",value:`
|
|
67
|
-
`}),t.push(n[i]);return e&&n.length>0&&t.push({type:"text",value:`
|
|
68
|
-
`}),t}function AC(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function kC(n,e){const t=YF(n,e),i=t.one(n,void 0),r=FF(t),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:`
|
|
69
|
-
`},r),a}function e9(n,e){return n&&"run"in n?async function(t,i){const r=kC(t,{file:i,...e});await n.run(r,i)}:function(t,i){return kC(t,{file:i,...n||e})}}function TC(n){if(n)throw n}var S_,MC;function t9(){if(MC)return S_;MC=1;var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},a=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var p=n.call(h,"constructor"),f=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!f)return!1;var m;for(m in h);return typeof m>"u"||n.call(h,m)},l=function(h,p){t&&p.name==="__proto__"?t(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},o=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(i)return i(h,p).value}else return;return h[p]};return S_=function u(){var h,p,f,m,g,_,w=arguments[0],v=1,x=arguments.length,S=!1;for(typeof w=="boolean"&&(S=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});v<x;++v)if(h=arguments[v],h!=null)for(p in h)f=o(w,p),m=o(h,p),w!==m&&(S&&m&&(a(m)||(g=r(m)))?(g?(g=!1,_=f&&r(f)?f:[]):_=f&&a(f)?f:{},l(w,{name:p,newValue:u(S,_,m)})):typeof m<"u"&&l(w,{name:p,newValue:m}));return w},S_}var n9=t9();const w_=id(n9);function x0(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function i9(){const n=[],e={run:t,use:i};return e;function t(...r){let a=-1;const l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...r);function o(u,...h){const p=n[++a];let f=-1;if(u){l(u);return}for(;++f<r.length;)(h[f]===null||h[f]===void 0)&&(h[f]=r[f]);r=h,p?r9(p,o)(...h):l(null,...h)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return n.push(r),e}}function r9(n,e){let t;return i;function i(...l){const o=n.length>l.length;let u;o&&l.push(r);try{u=n.apply(this,l)}catch(h){const p=h;if(o&&t)throw p;return r(p)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,r):u instanceof Error?r(u):a(u))}function r(l,...o){t||(t=!0,e(l,...o))}function a(l){r(null,l)}}const Ws={basename:s9,dirname:a9,extname:o9,join:l9,sep:"/"};function s9(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');dd(n);let t=0,i=-1,r=n.length,a;if(e===void 0||e.length===0||e.length>n.length){for(;r--;)if(n.codePointAt(r)===47){if(a){t=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":n.slice(t,i)}if(e===n)return"";let l=-1,o=e.length-1;for(;r--;)if(n.codePointAt(r)===47){if(a){t=r+1;break}}else l<0&&(a=!0,l=r+1),o>-1&&(n.codePointAt(r)===e.codePointAt(o--)?o<0&&(i=r):(o=-1,i=l));return t===i?i=l:i<0&&(i=n.length),n.slice(t,i)}function a9(n){if(dd(n),n.length===0)return".";let e=-1,t=n.length,i;for(;--t;)if(n.codePointAt(t)===47){if(i){e=t;break}}else i||(i=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function o9(n){dd(n);let e=n.length,t=-1,i=0,r=-1,a=0,l;for(;e--;){const o=n.codePointAt(e);if(o===47){if(l){i=e+1;break}continue}t<0&&(l=!0,t=e+1),o===46?r<0?r=e:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||t<0||a===0||a===1&&r===t-1&&r===i+1?"":n.slice(r,t)}function l9(...n){let e=-1,t;for(;++e<n.length;)dd(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":c9(t)}function c9(n){dd(n);const e=n.codePointAt(0)===47;let t=u9(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function u9(n,e){let t="",i=0,r=-1,a=0,l=-1,o,u;for(;++l<=n.length;){if(l<n.length)o=n.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(r===l-1||a===1))if(r!==l-1&&a===2){if(t.length<2||i!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",i=0):(t=t.slice(0,u),i=t.length-1-t.lastIndexOf("/")),r=l,a=0;continue}}else if(t.length>0){t="",i=0,r=l,a=0;continue}}e&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+n.slice(r+1,l):t=n.slice(r+1,l),i=l-r-1;r=l,a=0}else o===46&&a>-1?a++:a=-1}return t}function dd(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const h9={cwd:d9};function d9(){return"/"}function S0(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function f9(n){if(typeof n=="string")n=new URL(n);else if(!S0(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return p9(n)}function p9(n){if(n.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=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const i=e.codePointAt(t+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 C_=["history","path","basename","stem","extname","dirname"];class dA{constructor(e){let t;e?S0(e)?t={path:e}:typeof e=="string"||m9(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":h9.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<C_.length;){const a=C_[i];a in t&&t[a]!==void 0&&t[a]!==null&&(this[a]=a==="history"?[...t[a]]:t[a])}let r;for(r in t)C_.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path=="string"?Ws.basename(this.path):void 0}set basename(e){A_(e,"basename"),E_(e,"basename"),this.path=Ws.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ws.dirname(this.path):void 0}set dirname(e){RC(this.basename,"dirname"),this.path=Ws.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ws.extname(this.path):void 0}set extname(e){if(E_(e,"extname"),RC(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=Ws.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){S0(e)&&(e=f9(e)),A_(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ws.basename(this.path,this.extname):void 0}set stem(e){A_(e,"stem"),E_(e,"stem"),this.path=Ws.join(this.dirname||"",e+(this.extname||""))}fail(e,t,i){const r=this.message(e,t,i);throw r.fatal=!0,r}info(e,t,i){const r=this.message(e,t,i);return r.fatal=void 0,r}message(e,t,i){const r=new Zi(e,t,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 E_(n,e){if(n&&n.includes(Ws.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ws.sep+"`")}function A_(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function RC(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function m9(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const g9=(function(n){const i=this.constructor.prototype,r=i[n],a=function(){return r.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),y9={}.hasOwnProperty;class Fb extends g9{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=i9()}copy(){const e=new Fb;let t=-1;for(;++t<this.attachers.length;){const i=this.attachers[t];e.use(...i)}return e.data(w_(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(M_("data",this.frozen),this.namespace[e]=t,this):y9.call(this.namespace,e)&&this.namespace[e]||void 0:e?(M_("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[t,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=t.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 t=_p(e),i=this.parser||this.Parser;return k_("parse",i),i(String(t),t)}process(e,t){const i=this;return this.freeze(),k_("process",this.parser||this.Parser),T_("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(a,l){const o=_p(e),u=i.parse(o);i.run(u,o,function(p,f,m){if(p||!f||!m)return h(p);const g=f,_=i.stringify(g,m);v9(_)?m.value=_:m.result=_,h(p,m)});function h(p,f){p||!f?l(p):a?a(f):t(void 0,f)}}}processSync(e){let t=!1,i;return this.freeze(),k_("processSync",this.parser||this.Parser),T_("processSync",this.compiler||this.Compiler),this.process(e,r),NC("processSync","process",t),i;function r(a,l){t=!0,TC(a),i=l}}run(e,t,i){OC(e),this.freeze();const r=this.transformers;return!i&&typeof t=="function"&&(i=t,t=void 0),i?a(void 0,i):new Promise(a);function a(l,o){const u=_p(t);r.run(e,u,h);function h(p,f,m){const g=f||e;p?o(p):l?l(g):i(void 0,g,m)}}}runSync(e,t){let i=!1,r;return this.run(e,t,a),NC("runSync","run",i),r;function a(l,o){TC(l),r=o,i=!0}}stringify(e,t){this.freeze();const i=_p(t),r=this.compiler||this.Compiler;return T_("stringify",r),OC(e),r(e,i)}use(e,...t){const i=this.attachers,r=this.namespace;if(M_("use",this.frozen),e!=null)if(typeof e=="function")u(e,t);else if(typeof e=="object")Array.isArray(e)?o(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(h){if(typeof h=="function")u(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...f]=h;u(p,f)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(r.settings=w_(!0,r.settings,h.settings))}function o(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const f=h[p];a(f)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function u(h,p){let f=-1,m=-1;for(;++f<i.length;)if(i[f][0]===h){m=f;break}if(m===-1)i.push([h,...p]);else if(p.length>0){let[g,..._]=p;const w=i[m][1];x0(w)&&x0(g)&&(g=w_(!0,w,g)),i[m]=[h,g,..._]}}}}const _9=new Fb().freeze();function k_(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function T_(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function M_(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function OC(n){if(!x0(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function NC(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function _p(n){return b9(n)?n:new dA(n)}function b9(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function v9(n){return typeof n=="string"||x9(n)}function x9(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const S9="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",DC=[],IC={allowDangerousHtml:!0},w9=/^(https?|ircs?|mailto|xmpp)$/i,C9=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function E9(n){const e=A9(n),t=k9(n);return T9(e.runSync(e.parse(t),t),n)}function A9(n){const e=n.rehypePlugins||DC,t=n.remarkPlugins||DC,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...IC}:IC;return _9().use(aF).use(t).use(e9,i).use(e)}function k9(n){const e=n.children||"",t=new dA;return typeof e=="string"&&(t.value=e),t}function T9(n,e){const t=e.allowedElements,i=e.allowElement,r=e.components,a=e.disallowedElements,l=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||M9;for(const p of C9)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+S9+p.id,void 0);return Sm(n,h),qz(n,{Fragment:T.Fragment,components:r,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function h(p,f,m){if(p.type==="raw"&&m&&typeof f=="number")return l?m.children.splice(f,1):m.children[f]={type:"text",value:p.value},f;if(p.type==="element"){let g;for(g in b_)if(Object.hasOwn(b_,g)&&Object.hasOwn(p.properties,g)){const _=p.properties[g],w=b_[g];(w===null||w.includes(p.tagName))&&(p.properties[g]=u(String(_||""),g,p))}}if(p.type==="element"){let g=t?!t.includes(p.tagName):a?a.includes(p.tagName):!1;if(!g&&i&&typeof f=="number"&&(g=!i(p,f,m)),g&&m&&typeof f=="number")return o&&p.children?m.children.splice(f,1,...p.children):m.children.splice(f,1),f}}}function M9(n){const e=n.indexOf(":"),t=n.indexOf("?"),i=n.indexOf("#"),r=n.indexOf("/");return e===-1||r!==-1&&e>r||t!==-1&&e>t||i!==-1&&e>i||w9.test(n.slice(0,e))?n:""}function LC(n,e){const t=String(n);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=t.indexOf(e);for(;r!==-1;)i++,r=t.indexOf(e,r+e.length);return i}function R9(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function O9(n,e,t){const r=hd((t||{}).ignore||[]),a=N9(e);let l=-1;for(;++l<a.length;)hA(n,"text",o);function o(h,p){let f=-1,m;for(;++f<p.length;){const g=p[f],_=m?m.children:void 0;if(r(g,_?_.indexOf(g):void 0,m))return;m=g}if(m)return u(h,p)}function u(h,p){const f=p[p.length-1],m=a[l][0],g=a[l][1];let _=0;const v=f.children.indexOf(h);let x=!1,S=[];m.lastIndex=0;let b=m.exec(h.value);for(;b;){const C=b.index,O={index:b.index,input:b.input,stack:[...p,h]};let M=g(...b,O);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?m.lastIndex=C+1:(_!==C&&S.push({type:"text",value:h.value.slice(_,C)}),Array.isArray(M)?S.push(...M):M&&S.push(M),_=C+b[0].length,x=!0),!m.global)break;b=m.exec(h.value)}return x?(_<h.value.length&&S.push({type:"text",value:h.value.slice(_)}),f.children.splice(v,1,...S)):S=[h],v+S.length}}function N9(n){const e=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!n[0]||Array.isArray(n[0])?n:[n];let i=-1;for(;++i<t.length;){const r=t[i];e.push([D9(r[0]),I9(r[1])])}return e}function D9(n){return typeof n=="string"?new RegExp(R9(n),"g"):n}function I9(n){return typeof n=="function"?n:function(){return n}}const R_="phrasing",O_=["autolink","link","image","label"];function L9(){return{transforms:[H9],enter:{literalAutolink:z9,literalAutolinkEmail:N_,literalAutolinkHttp:N_,literalAutolinkWww:N_},exit:{literalAutolink:j9,literalAutolinkEmail:U9,literalAutolinkHttp:P9,literalAutolinkWww:F9}}}function B9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:R_,notInConstruct:O_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:R_,notInConstruct:O_},{character:":",before:"[ps]",after:"\\/",inConstruct:R_,notInConstruct:O_}]}}function z9(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function N_(n){this.config.enter.autolinkProtocol.call(this,n)}function P9(n){this.config.exit.autolinkProtocol.call(this,n)}function F9(n){this.config.exit.data.call(this,n);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(n)}function U9(n){this.config.exit.autolinkEmail.call(this,n)}function j9(n){this.exit(n)}function H9(n){O9(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,q9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),V9]],{ignore:["link","linkReference"]})}function q9(n,e,t,i,r){let a="";if(!fA(r)||(/^w/i.test(e)&&(t=e+t,e="",a="http://"),!W9(t)))return!1;const l=$9(t+i);if(!l[0])return!1;const o={type:"link",title:null,url:a+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function V9(n,e,t,i){return!fA(i,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function W9(n){const e=n.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 $9(n){const e=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!e)return[n,void 0];n=n.slice(0,e.index);let t=e[0],i=t.indexOf(")");const r=LC(n,"(");let a=LC(n,")");for(;i!==-1&&r>a;)n+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[n,t]}function fA(n,e){const t=n.input.charCodeAt(n.index-1);return(n.index===0||kl(t)||_m(t))&&(!e||t!==47)}pA.peek=t7;function G9(){this.buffer()}function K9(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Y9(){this.buffer()}function X9(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Z9(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ss(this.sliceSerialize(n)).toLowerCase(),t.label=e}function J9(n){this.exit(n)}function Q9(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ss(this.sliceSerialize(n)).toLowerCase(),t.label=e}function e7(n){this.exit(n)}function t7(){return"["}function pA(n,e,t,i){const r=t.createTracker(i);let a=r.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return a+=r.move(t.safe(t.associationId(n),{after:"]",before:a})),o(),l(),a+=r.move("]"),a}function n7(){return{enter:{gfmFootnoteCallString:G9,gfmFootnoteCall:K9,gfmFootnoteDefinitionLabelString:Y9,gfmFootnoteDefinition:X9},exit:{gfmFootnoteCallString:Z9,gfmFootnoteCall:J9,gfmFootnoteDefinitionLabelString:Q9,gfmFootnoteDefinition:e7}}}function i7(n){let e=!1;return n&&n.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:pA},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,r,a,l){const o=a.createTracker(l);let u=o.move("[^");const h=a.enter("footnoteDefinition"),p=a.enter("label");return u+=o.move(a.safe(a.associationId(i),{before:u,after:"]"})),p(),u+=o.move("]:"),i.children&&i.children.length>0&&(o.shift(4),u+=o.move((e?`
|
|
70
|
-
`:" ")+a.indentLines(a.containerFlow(i,o.current()),e?mA:r7))),h(),u}}function r7(n,e,t){return e===0?n:mA(n,e,t)}function mA(n,e,t){return(t?"":" ")+n}const s7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];gA.peek=u7;function a7(){return{canContainEols:["delete"],enter:{strikethrough:l7},exit:{strikethrough:c7}}}function o7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:s7}],handlers:{delete:gA}}}function l7(n){this.enter({type:"delete",children:[]},n)}function c7(n){this.exit(n)}function gA(n,e,t,i){const r=t.createTracker(i),a=t.enter("strikethrough");let l=r.move("~~");return l+=t.containerPhrasing(n,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),a(),l}function u7(){return"~"}function h7(n){return n.length}function d7(n,e){const t=e||{},i=(t.align||[]).concat(),r=t.stringLength||h7,a=[],l=[],o=[],u=[];let h=0,p=-1;for(;++p<n.length;){const w=[],v=[];let x=-1;for(n[p].length>h&&(h=n[p].length);++x<n[p].length;){const S=f7(n[p][x]);if(t.alignDelimiters!==!1){const b=r(S);v[x]=b,(u[x]===void 0||b>u[x])&&(u[x]=b)}w.push(S)}l[p]=w,o[p]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++f<h;)a[f]=BC(i[f]);else{const w=BC(i);for(;++f<h;)a[f]=w}f=-1;const m=[],g=[];for(;++f<h;){const w=a[f];let v="",x="";w===99?(v=":",x=":"):w===108?v=":":w===114&&(x=":");let S=t.alignDelimiters===!1?1:Math.max(1,u[f]-v.length-x.length);const b=v+"-".repeat(S)+x;t.alignDelimiters!==!1&&(S=v.length+S+x.length,S>u[f]&&(u[f]=S),g[f]=S),m[f]=b}l.splice(1,0,m),o.splice(1,0,g),p=-1;const _=[];for(;++p<l.length;){const w=l[p],v=o[p];f=-1;const x=[];for(;++f<h;){const S=w[f]||"";let b="",C="";if(t.alignDelimiters!==!1){const O=u[f]-(v[f]||0),M=a[f];M===114?b=" ".repeat(O):M===99?O%2?(b=" ".repeat(O/2+.5),C=" ".repeat(O/2-.5)):(b=" ".repeat(O/2),C=b):C=" ".repeat(O)}t.delimiterStart!==!1&&!f&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&S==="")&&(t.delimiterStart!==!1||f)&&x.push(" "),t.alignDelimiters!==!1&&x.push(b),x.push(S),t.alignDelimiters!==!1&&x.push(C),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||f!==h-1)&&x.push("|")}_.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return _.join(`
|
|
71
|
-
`)}function f7(n){return n==null?"":String(n)}function BC(n){const e=typeof n=="string"?n.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function p7(n,e,t,i){const r=t.enter("blockquote"),a=t.createTracker(i);a.move("> "),a.shift(2);const l=t.indentLines(t.containerFlow(n,a.current()),m7);return r(),l}function m7(n,e,t){return">"+(t?"":" ")+n}function g7(n,e){return zC(n,e.inConstruct,!0)&&!zC(n,e.notInConstruct,!1)}function zC(n,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let i=-1;for(;++i<e.length;)if(n.includes(e[i]))return!0;return!1}function PC(n,e,t,i){let r=-1;for(;++r<t.unsafe.length;)if(t.unsafe[r].character===`
|
|
72
|
-
`&&g7(t.stack,t.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
73
|
-
`}function y7(n,e){const t=String(n);let i=t.indexOf(e),r=i,a=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++a>l&&(l=a):a=1,r=i+e.length,i=t.indexOf(e,r);return l}function _7(n,e){return!!(e.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function b7(n){const e=n.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function v7(n,e,t,i){const r=b7(t),a=n.value||"",l=r==="`"?"GraveAccent":"Tilde";if(_7(n,t)){const f=t.enter("codeIndented"),m=t.indentLines(a,x7);return f(),m}const o=t.createTracker(i),u=r.repeat(Math.max(y7(a,r)+1,3)),h=t.enter("codeFenced");let p=o.move(u);if(n.lang){const f=t.enter(`codeFencedLang${l}`);p+=o.move(t.safe(n.lang,{before:p,after:" ",encode:["`"],...o.current()})),f()}if(n.lang&&n.meta){const f=t.enter(`codeFencedMeta${l}`);p+=o.move(" "),p+=o.move(t.safe(n.meta,{before:p,after:`
|
|
74
|
-
`,encode:["`"],...o.current()})),f()}return p+=o.move(`
|
|
75
|
-
`),a&&(p+=o.move(a+`
|
|
76
|
-
`)),p+=o.move(u),h(),p}function x7(n,e,t){return(t?"":" ")+n}function Ub(n){const e=n.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function S7(n,e,t,i){const r=Ub(t),a=r==='"'?"Quote":"Apostrophe",l=t.enter("definition");let o=t.enter("label");const u=t.createTracker(i);let h=u.move("[");return h+=u.move(t.safe(t.associationId(n),{before:h,after:"]",...u.current()})),h+=u.move("]: "),o(),!n.url||/[\0- \u007F]/.test(n.url)?(o=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(o=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":`
|
|
77
|
-
`,...u.current()}))),o(),n.title&&(o=t.enter(`title${a}`),h+=u.move(" "+r),h+=u.move(t.safe(n.title,{before:h,after:r,...u.current()})),h+=u.move(r),o()),l(),h}function w7(n){const e=n.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function td(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Qp(n,e,t){const i=au(n),r=au(e);return i===void 0?r===void 0?t==="_"?{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}}yA.peek=C7;function yA(n,e,t,i){const r=w7(t),a=t.enter("emphasis"),l=t.createTracker(i),o=l.move(r);let u=l.move(t.containerPhrasing(n,{after:r,before:o,...l.current()}));const h=u.charCodeAt(0),p=Qp(i.before.charCodeAt(i.before.length-1),h,r);p.inside&&(u=td(h)+u.slice(1));const f=u.charCodeAt(u.length-1),m=Qp(i.after.charCodeAt(0),f,r);m.inside&&(u=u.slice(0,-1)+td(f));const g=l.move(r);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},o+u+g}function C7(n,e,t){return t.options.emphasis||"*"}function E7(n,e){let t=!1;return Sm(n,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return t=!0,b0}),!!((!n.depth||n.depth<3)&&Nb(n)&&(e.options.setext||t))}function A7(n,e,t,i){const r=Math.max(Math.min(6,n.depth||1),1),a=t.createTracker(i);if(E7(n,t)){const p=t.enter("headingSetext"),f=t.enter("phrasing"),m=t.containerPhrasing(n,{...a.current(),before:`
|
|
78
|
-
`,after:`
|
|
79
|
-
`});return f(),p(),m+`
|
|
80
|
-
`+(r===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
81
|
-
`))+1))}const l="#".repeat(r),o=t.enter("headingAtx"),u=t.enter("phrasing");a.move(l+" ");let h=t.containerPhrasing(n,{before:"# ",after:`
|
|
82
|
-
`,...a.current()});return/^[\t ]/.test(h)&&(h=td(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,t.options.closeAtx&&(h+=" "+l),u(),o(),h}_A.peek=k7;function _A(n){return n.value||""}function k7(){return"<"}bA.peek=T7;function bA(n,e,t,i){const r=Ub(t),a=r==='"'?"Quote":"Apostrophe",l=t.enter("image");let o=t.enter("label");const u=t.createTracker(i);let h=u.move("![");return h+=u.move(t.safe(n.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(o=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":")",...u.current()}))),o(),n.title&&(o=t.enter(`title${a}`),h+=u.move(" "+r),h+=u.move(t.safe(n.title,{before:h,after:r,...u.current()})),h+=u.move(r),o()),h+=u.move(")"),l(),h}function T7(){return"!"}vA.peek=M7;function vA(n,e,t,i){const r=n.referenceType,a=t.enter("imageReference");let l=t.enter("label");const o=t.createTracker(i);let u=o.move("![");const h=t.safe(n.alt,{before:u,after:"]",...o.current()});u+=o.move(h+"]["),l();const p=t.stack;t.stack=[],l=t.enter("reference");const f=t.safe(t.associationId(n),{before:u,after:"]",...o.current()});return l(),t.stack=p,a(),r==="full"||!h||h!==f?u+=o.move(f+"]"):r==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function M7(){return"!"}xA.peek=R7;function xA(n,e,t){let i=n.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<t.unsafe.length;){const l=t.unsafe[a],o=t.compilePattern(l);let u;if(l.atBreak)for(;u=o.exec(i);){let h=u.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(u.index+1)}}return r+i+r}function R7(){return"`"}function SA(n,e){const t=Nb(n);return!!(!e.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(t===n.url||"mailto:"+t===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}wA.peek=O7;function wA(n,e,t,i){const r=Ub(t),a=r==='"'?"Quote":"Apostrophe",l=t.createTracker(i);let o,u;if(SA(n,t)){const p=t.stack;t.stack=[],o=t.enter("autolink");let f=l.move("<");return f+=l.move(t.containerPhrasing(n,{before:f,after:">",...l.current()})),f+=l.move(">"),o(),t.stack=p,f}o=t.enter("link"),u=t.enter("label");let h=l.move("[");return h+=l.move(t.containerPhrasing(n,{before:h,after:"](",...l.current()})),h+=l.move("]("),u(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(u=t.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(t.safe(n.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(u=t.enter("destinationRaw"),h+=l.move(t.safe(n.url,{before:h,after:n.title?" ":")",...l.current()}))),u(),n.title&&(u=t.enter(`title${a}`),h+=l.move(" "+r),h+=l.move(t.safe(n.title,{before:h,after:r,...l.current()})),h+=l.move(r),u()),h+=l.move(")"),o(),h}function O7(n,e,t){return SA(n,t)?"<":"["}CA.peek=N7;function CA(n,e,t,i){const r=n.referenceType,a=t.enter("linkReference");let l=t.enter("label");const o=t.createTracker(i);let u=o.move("[");const h=t.containerPhrasing(n,{before:u,after:"]",...o.current()});u+=o.move(h+"]["),l();const p=t.stack;t.stack=[],l=t.enter("reference");const f=t.safe(t.associationId(n),{before:u,after:"]",...o.current()});return l(),t.stack=p,a(),r==="full"||!h||h!==f?u+=o.move(f+"]"):r==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function N7(){return"["}function jb(n){const e=n.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function D7(n){const e=jb(n),t=n.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function I7(n){const e=n.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function EA(n){const e=n.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function L7(n,e,t,i){const r=t.enter("list"),a=t.bulletCurrent;let l=n.ordered?I7(t):jb(t);const o=n.ordered?l==="."?")":".":D7(t);let u=e&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!n.ordered){const p=n.children?n.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),EA(t)===l&&p){let f=-1;for(;++f<n.children.length;){const m=n.children[f];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=o),t.bulletCurrent=l;const h=t.containerFlow(n,i);return t.bulletLastUsed=l,t.bulletCurrent=a,r(),h}function B7(n){const e=n.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 z7(n,e,t,i){const r=B7(t);let a=t.bulletCurrent||jb(t);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(n))+a);let l=a.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||n.spread))&&(l=Math.ceil(l/4)*4);const o=t.createTracker(i);o.move(a+" ".repeat(l-a.length)),o.shift(l);const u=t.enter("listItem"),h=t.indentLines(t.containerFlow(n,o.current()),p);return u(),h;function p(f,m,g){return m?(g?"":" ".repeat(l))+f:(g?a:a+" ".repeat(l-a.length))+f}}function P7(n,e,t,i){const r=t.enter("paragraph"),a=t.enter("phrasing"),l=t.containerPhrasing(n,i);return a(),r(),l}const F7=hd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function U7(n,e,t,i){return(n.children.some(function(l){return F7(l)})?t.containerPhrasing:t.containerFlow).call(t,n,i)}function j7(n){const e=n.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}AA.peek=H7;function AA(n,e,t,i){const r=j7(t),a=t.enter("strong"),l=t.createTracker(i),o=l.move(r+r);let u=l.move(t.containerPhrasing(n,{after:r,before:o,...l.current()}));const h=u.charCodeAt(0),p=Qp(i.before.charCodeAt(i.before.length-1),h,r);p.inside&&(u=td(h)+u.slice(1));const f=u.charCodeAt(u.length-1),m=Qp(i.after.charCodeAt(0),f,r);m.inside&&(u=u.slice(0,-1)+td(f));const g=l.move(r+r);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},o+u+g}function H7(n,e,t){return t.options.strong||"*"}function q7(n,e,t,i){return t.safe(n.value,i)}function V7(n){const e=n.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 W7(n,e,t){const i=(EA(t)+(t.options.ruleSpaces?" ":"")).repeat(V7(t));return t.options.ruleSpaces?i.slice(0,-1):i}const kA={blockquote:p7,break:PC,code:v7,definition:S7,emphasis:yA,hardBreak:PC,heading:A7,html:_A,image:bA,imageReference:vA,inlineCode:xA,link:wA,linkReference:CA,list:L7,listItem:z7,paragraph:P7,root:U7,strong:AA,text:q7,thematicBreak:W7};function $7(){return{enter:{table:G7,tableData:FC,tableHeader:FC,tableRow:Y7},exit:{codeText:X7,table:K7,tableData:D_,tableHeader:D_,tableRow:D_}}}function G7(n){const e=n._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},n),this.data.inTable=!0}function K7(n){this.exit(n),this.data.inTable=void 0}function Y7(n){this.enter({type:"tableRow",children:[]},n)}function D_(n){this.exit(n)}function FC(n){this.enter({type:"tableCell",children:[]},n)}function X7(n){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Z7));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(n)}function Z7(n,e){return e==="|"?e:n}function J7(n){const e=n||{},t=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,a=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
83
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:u,tableRow:o}};function l(g,_,w,v){return h(p(g,w,v),g.align)}function o(g,_,w,v){const x=f(g,w,v),S=h([x]);return S.slice(0,S.indexOf(`
|
|
84
|
-
`))}function u(g,_,w,v){const x=w.enter("tableCell"),S=w.enter("phrasing"),b=w.containerPhrasing(g,{...v,before:a,after:a});return S(),x(),b}function h(g,_){return d7(g,{align:_,alignDelimiters:i,padding:t,stringLength:r})}function p(g,_,w){const v=g.children;let x=-1;const S=[],b=_.enter("table");for(;++x<v.length;)S[x]=f(v[x],_,w);return b(),S}function f(g,_,w){const v=g.children;let x=-1;const S=[],b=_.enter("tableRow");for(;++x<v.length;)S[x]=u(v[x],g,_,w);return b(),S}function m(g,_,w){let v=kA.inlineCode(g,_,w);return w.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function Q7(){return{exit:{taskListCheckValueChecked:UC,taskListCheckValueUnchecked:UC,paragraph:tU}}}function eU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nU}}}function UC(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function tU(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const i=t.children[0];if(i&&i.type==="text"){const r=e.children;let a=-1,l;for(;++a<r.length;){const o=r[a];if(o.type==="paragraph"){l=o;break}}l===t&&(i.value=i.value.slice(1),i.value.length===0?t.children.shift():t.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,t.position.start=Object.assign({},i.position.start)))}}this.exit(n)}function nU(n,e,t,i){const r=n.children[0],a=typeof n.checked=="boolean"&&r&&r.type==="paragraph",l="["+(n.checked?"x":" ")+"] ",o=t.createTracker(i);a&&o.move(l);let u=kA.listItem(n,e,t,{...i,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),u;function h(p){return p+l}}function iU(){return[L9(),n7(),a7(),$7(),Q7()]}function rU(n){return{extensions:[B9(),i7(n),o7(),J7(n),eU()]}}const sU={tokenize:hU,partial:!0},TA={tokenize:dU,partial:!0},MA={tokenize:fU,partial:!0},RA={tokenize:pU,partial:!0},aU={tokenize:mU,partial:!0},OA={name:"wwwAutolink",tokenize:cU,previous:DA},NA={name:"protocolAutolink",tokenize:uU,previous:IA},qa={name:"emailAutolink",tokenize:lU,previous:LA},ea={};function oU(){return{text:ea}}let vl=48;for(;vl<123;)ea[vl]=qa,vl++,vl===58?vl=65:vl===91&&(vl=97);ea[43]=qa;ea[45]=qa;ea[46]=qa;ea[95]=qa;ea[72]=[qa,NA];ea[104]=[qa,NA];ea[87]=[qa,OA];ea[119]=[qa,OA];function lU(n,e,t){const i=this;let r,a;return l;function l(f){return!w0(f)||!LA.call(i,i.previous)||Hb(i.events)?t(f):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(f))}function o(f){return w0(f)?(n.consume(f),o):f===64?(n.consume(f),u):t(f)}function u(f){return f===46?n.check(aU,p,h)(f):f===45||f===95||Yi(f)?(a=!0,n.consume(f),u):p(f)}function h(f){return n.consume(f),r=!0,u}function p(f){return a&&r&&ar(i.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),e(f)):t(f)}}function cU(n,e,t){const i=this;return r;function r(l){return l!==87&&l!==119||!DA.call(i,i.previous)||Hb(i.events)?t(l):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(sU,n.attempt(TA,n.attempt(MA,a),t),t)(l))}function a(l){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),e(l)}}function uU(n,e,t){const i=this;let r="",a=!1;return l;function l(f){return(f===72||f===104)&&IA.call(i,i.previous)&&!Hb(i.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),r+=String.fromCodePoint(f),n.consume(f),o):t(f)}function o(f){if(ar(f)&&r.length<5)return r+=String.fromCodePoint(f),n.consume(f),o;if(f===58){const m=r.toLowerCase();if(m==="http"||m==="https")return n.consume(f),u}return t(f)}function u(f){return f===47?(n.consume(f),a?h:(a=!0,u)):t(f)}function h(f){return f===null||Xp(f)||Un(f)||kl(f)||_m(f)?t(f):n.attempt(TA,n.attempt(MA,p),t)(f)}function p(f){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),e(f)}}function hU(n,e,t){let i=0;return r;function r(l){return(l===87||l===119)&&i<3?(i++,n.consume(l),r):l===46&&i===3?(n.consume(l),a):t(l)}function a(l){return l===null?t(l):e(l)}}function dU(n,e,t){let i,r,a;return l;function l(h){return h===46||h===95?n.check(RA,u,o)(h):h===null||Un(h)||kl(h)||h!==45&&_m(h)?u(h):(a=!0,n.consume(h),l)}function o(h){return h===95?i=!0:(r=i,i=void 0),n.consume(h),l}function u(h){return r||i||!a?t(h):e(h)}}function fU(n,e){let t=0,i=0;return r;function r(l){return l===40?(t++,n.consume(l),r):l===41&&i<t?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?n.check(RA,e,a)(l):l===null||Un(l)||kl(l)?e(l):(n.consume(l),r)}function a(l){return l===41&&i++,n.consume(l),r}}function pU(n,e,t){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?(n.consume(o),i):o===38?(n.consume(o),a):o===93?(n.consume(o),r):o===60||o===null||Un(o)||kl(o)?e(o):t(o)}function r(o){return o===null||o===40||o===91||Un(o)||kl(o)?e(o):i(o)}function a(o){return ar(o)?l(o):t(o)}function l(o){return o===59?(n.consume(o),i):ar(o)?(n.consume(o),l):t(o)}}function mU(n,e,t){return i;function i(a){return n.consume(a),r}function r(a){return Yi(a)?t(a):e(a)}}function DA(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||Un(n)}function IA(n){return!ar(n)}function LA(n){return!(n===47||w0(n))}function w0(n){return n===43||n===45||n===46||n===95||Yi(n)}function Hb(n){let e=n.length,t=!1;for(;e--;){const i=n[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){t=!0;break}if(i._gfmAutolinkLiteralWalkedInto){t=!1;break}}return n.length>0&&!t&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const gU={tokenize:CU,partial:!0};function yU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xU,continuation:{tokenize:SU},exit:wU}},text:{91:{name:"gfmFootnoteCall",tokenize:vU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_U,resolveTo:bU}}}}function _U(n,e,t){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;r--;){const u=i.events[r][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!l||!l._balanced)return t(u);const h=Ss(i.sliceSerialize({start:l.end,end:i.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?t(u):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),e(u))}}function bU(n,e){let t=n.length;for(;t--;)if(n[t][1].type==="labelImage"&&n[t][0]==="enter"){n[t][1];break}n[t+1][1].type="data",n[t+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},n[t+3][1].start),end:Object.assign({},n[n.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},n[t+3][1].end),end:Object.assign({},n[t+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},n[n.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[n[t+1],n[t+2],["enter",i,e],n[t+3],n[t+4],["enter",r,e],["exit",r,e],["enter",a,e],["enter",l,e],["exit",l,e],["exit",a,e],n[n.length-2],n[n.length-1],["exit",i,e]];return n.splice(t,n.length-t+1,...o),n}function vU(n,e,t){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,l;return o;function o(f){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(f),n.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?t(f):(n.enter("gfmFootnoteCallMarker"),n.consume(f),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(f){if(a>999||f===93&&!l||f===null||f===91||Un(f))return t(f);if(f===93){n.exit("chunkString");const m=n.exit("gfmFootnoteCallString");return r.includes(Ss(i.sliceSerialize(m)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(f),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),e):t(f)}return Un(f)||(l=!0),a++,n.consume(f),f===92?p:h}function p(f){return f===91||f===92||f===93?(n.consume(f),a++,h):h(f)}}function xU(n,e,t){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,o;return u;function u(_){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(_),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(_){return _===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(_),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):t(_)}function p(_){if(l>999||_===93&&!o||_===null||_===91||Un(_))return t(_);if(_===93){n.exit("chunkString");const w=n.exit("gfmFootnoteDefinitionLabelString");return a=Ss(i.sliceSerialize(w)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(_),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),m}return Un(_)||(o=!0),l++,n.consume(_),_===92?f:p}function f(_){return _===91||_===92||_===93?(n.consume(_),l++,p):p(_)}function m(_){return _===58?(n.enter("definitionMarker"),n.consume(_),n.exit("definitionMarker"),r.includes(a)||r.push(a),pn(n,g,"gfmFootnoteDefinitionWhitespace")):t(_)}function g(_){return e(_)}}function SU(n,e,t){return n.check(ud,e,n.attempt(gU,e,t))}function wU(n){n.exit("gfmFootnoteDefinition")}function CU(n,e,t){const i=this;return pn(n,r,"gfmFootnoteDefinitionIndent",5);function r(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(a):t(a)}}function EU(n){let t=(n||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return t==null&&(t=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(l,o){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let h=u;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[u][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[u][1].end)},f={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[u][1].start)},m=[["enter",p,o],["enter",l[h][1],o],["exit",l[h][1],o],["enter",f,o]],g=o.parser.constructs.insideSpan.null;g&&Lr(m,m.length,0,bm(g,l.slice(h+1,u),o)),Lr(m,m.length,0,[["exit",f,o],["enter",l[u][1],o],["exit",l[u][1],o],["exit",p,o]]),Lr(l,h-1,u-h+3,m),u=h+m.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function a(l,o,u){const h=this.previous,p=this.events;let f=0;return m;function m(_){return h===126&&p[p.length-1][1].type!=="characterEscape"?u(_):(l.enter("strikethroughSequenceTemporary"),g(_))}function g(_){const w=au(h);if(_===126)return f>1?u(_):(l.consume(_),f++,g);if(f<2&&!t)return u(_);const v=l.exit("strikethroughSequenceTemporary"),x=au(_);return v._open=!x||x===2&&!!w,v._close=!w||w===2&&!!x,o(_)}}}class AU{constructor(){this.map=[]}add(e,t,i){kU(this,e,t,i)}consume(e){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const i=[];for(;t>0;)t-=1,i.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][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 kU(n,e,t,i){let r=0;if(!(t===0&&i.length===0)){for(;r<n.map.length;){if(n.map[r][0]===e){n.map[r][1]+=t,n.map[r][2].push(...i);return}r+=1}n.map.push([e,t,i])}}function TU(n,e){let t=!1;const i=[];for(;e<n.length;){const r=n[e];if(t){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(n[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(n[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"&&(t=!0);e+=1}return i}function MU(){return{flow:{null:{name:"table",tokenize:RU,resolveAll:OU}}}}function RU(n,e,t){const i=this;let r=0,a=0,l;return o;function o(j){let K=i.events.length-1;for(;K>-1;){const Q=i.events[K][1].type;if(Q==="lineEnding"||Q==="linePrefix")K--;else break}const Y=K>-1?i.events[K][1].type:null,H=Y==="tableHead"||Y==="tableRow"?M:u;return H===M&&i.parser.lazy[i.now().line]?t(j):H(j)}function u(j){return n.enter("tableHead"),n.enter("tableRow"),h(j)}function h(j){return j===124||(l=!0,a+=1),p(j)}function p(j){return j===null?t(j):Mt(j)?a>1?(a=0,i.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),g):t(j):ln(j)?pn(n,p,"whitespace")(j):(a+=1,l&&(l=!1,r+=1),j===124?(n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),l=!0,p):(n.enter("data"),f(j)))}function f(j){return j===null||j===124||Un(j)?(n.exit("data"),p(j)):(n.consume(j),j===92?m:f)}function m(j){return j===92||j===124?(n.consume(j),f):f(j)}function g(j){return i.interrupt=!1,i.parser.lazy[i.now().line]?t(j):(n.enter("tableDelimiterRow"),l=!1,ln(j)?pn(n,_,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):_(j))}function _(j){return j===45||j===58?v(j):j===124?(l=!0,n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),w):O(j)}function w(j){return ln(j)?pn(n,v,"whitespace")(j):v(j)}function v(j){return j===58?(a+=1,l=!0,n.enter("tableDelimiterMarker"),n.consume(j),n.exit("tableDelimiterMarker"),x):j===45?(a+=1,x(j)):j===null||Mt(j)?C(j):O(j)}function x(j){return j===45?(n.enter("tableDelimiterFiller"),S(j)):O(j)}function S(j){return j===45?(n.consume(j),S):j===58?(l=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(j),n.exit("tableDelimiterMarker"),b):(n.exit("tableDelimiterFiller"),b(j))}function b(j){return ln(j)?pn(n,C,"whitespace")(j):C(j)}function C(j){return j===124?_(j):j===null||Mt(j)?!l||r!==a?O(j):(n.exit("tableDelimiterRow"),n.exit("tableHead"),e(j)):O(j)}function O(j){return t(j)}function M(j){return n.enter("tableRow"),D(j)}function D(j){return j===124?(n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),D):j===null||Mt(j)?(n.exit("tableRow"),e(j)):ln(j)?pn(n,D,"whitespace")(j):(n.enter("data"),N(j))}function N(j){return j===null||j===124||Un(j)?(n.exit("data"),D(j)):(n.consume(j),j===92?L:N)}function L(j){return j===92||j===124?(n.consume(j),N):N(j)}}function OU(n,e){let t=-1,i=!0,r=0,a=[0,0,0,0],l=[0,0,0,0],o=!1,u=0,h,p,f;const m=new AU;for(;++t<n.length;){const g=n[t],_=g[1];g[0]==="enter"?_.type==="tableHead"?(o=!1,u!==0&&(jC(m,e,u,h,p),p=void 0,u=0),h={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},m.add(t,0,[["enter",h,e]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(i=!0,f=void 0,a=[0,0,0,0],l=[0,t+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},m.add(t,0,[["enter",p,e]])),r=_.type==="tableDelimiterRow"?2:p?3:1):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],f=bp(m,e,a,r,void 0,f),a=[0,0,0,0]),l[2]=t)):_.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],f=bp(m,e,a,r,void 0,f)),a=l,l=[a[1],t,0,0])):_.type==="tableHead"?(o=!0,u=t):_.type==="tableRow"||_.type==="tableDelimiterRow"?(u=t,a[1]!==0?(l[0]=l[1],f=bp(m,e,a,r,t,f)):l[1]!==0&&(f=bp(m,e,l,r,t,f)),r=0):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(l[3]=t)}for(u!==0&&jC(m,e,u,h,p),m.consume(e.events),t=-1;++t<e.events.length;){const g=e.events[t];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=TU(e.events,t))}return n}function bp(n,e,t,i,r,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",o="tableContent";t[0]!==0&&(a.end=Object.assign({},Gc(e.events,t[0])),n.add(t[0],0,[["exit",a,e]]));const u=Gc(e.events,t[1]);if(a={type:l,start:Object.assign({},u),end:Object.assign({},u)},n.add(t[1],0,[["enter",a,e]]),t[2]!==0){const h=Gc(e.events,t[2]),p=Gc(e.events,t[3]),f={type:o,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(t[2],0,[["enter",f,e]]),i!==2){const m=e.events[t[2]],g=e.events[t[3]];if(m[1].end=Object.assign({},g[1].end),m[1].type="chunkText",m[1].contentType="text",t[3]>t[2]+1){const _=t[2]+1,w=t[3]-t[2]-1;n.add(_,w,[])}}n.add(t[3]+1,0,[["exit",f,e]])}return r!==void 0&&(a.end=Object.assign({},Gc(e.events,r)),n.add(r,0,[["exit",a,e]]),a=void 0),a}function jC(n,e,t,i,r){const a=[],l=Gc(e.events,t);r&&(r.end=Object.assign({},l),a.push(["exit",r,e])),i.end=Object.assign({},l),a.push(["exit",i,e]),n.add(t+1,0,a)}function Gc(n,e){const t=n[e],i=t[0]==="enter"?"start":"end";return t[1][i]}const NU={name:"tasklistCheck",tokenize:IU};function DU(){return{text:{91:NU}}}function IU(n,e,t){const i=this;return r;function r(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?t(u):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),a)}function a(u){return Un(u)?(n.enter("taskListCheckValueUnchecked"),n.consume(u),n.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(n.enter("taskListCheckValueChecked"),n.consume(u),n.exit("taskListCheckValueChecked"),l):t(u)}function l(u){return u===93?(n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),o):t(u)}function o(u){return Mt(u)?e(u):ln(u)?n.check({tokenize:LU},e,t)(u):t(u)}}function LU(n,e,t){return pn(n,i,"whitespace");function i(r){return r===null?t(r):e(r)}}function BU(n){return $2([oU(),yU(),EU(n),MU(),DU()])}const zU={};function PU(n){const e=this,t=n||zU,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(BU(t)),a.push(iU()),l.push(rU(t))}const HC=(function(n,e,t){const i=hd(t);if(!n||!n.type||!n.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=n.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<n.children.length;)if(i(n.children[e],e,n))return n.children[e]}),Nl=(function(n){if(n==null)return jU;if(typeof n=="string")return UU(n);if(typeof n=="object")return FU(n);if(typeof n=="function")return qb(n);throw new Error("Expected function, string, or array as `test`")});function FU(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=Nl(n[t]);return qb(i);function i(...r){let a=-1;for(;++a<e.length;)if(e[a].apply(this,r))return!0;return!1}}function UU(n){return qb(e);function e(t){return t.tagName===n}}function qb(n){return e;function e(t,i,r){return!!(HU(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function jU(n){return!!(n&&typeof n=="object"&&"type"in n&&n.type==="element"&&"tagName"in n&&typeof n.tagName=="string")}function HU(n){return n!==null&&typeof n=="object"&&"type"in n&&"tagName"in n}const qC=/\n/g,VC=/[\t ]+/g,C0=Nl("br"),WC=Nl(XU),qU=Nl("p"),$C=Nl("tr"),VU=Nl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",YU,ZU]),BA=Nl(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function WU(n,e){const t=e||{},i="children"in n?n.children:[],r=BA(n),a=FA(n,{whitespace:t.whitespace||"normal"}),l=[];(n.type==="text"||n.type==="comment")&&l.push(...PA(n,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<i.length;)l.push(...zA(i[o],n,{whitespace:a,breakBefore:o?void 0:r,breakAfter:o<i.length-1?C0(i[o+1]):r}));const u=[];let h;for(o=-1;++o<l.length;){const p=l[o];typeof p=="number"?h!==void 0&&p>h&&(h=p):p&&(h!==void 0&&h>-1&&u.push(`
|
|
85
|
-
`.repeat(h)||" "),h=-1,u.push(p))}return u.join("")}function zA(n,e,t){return n.type==="element"?$U(n,e,t):n.type==="text"?t.whitespace==="normal"?PA(n,t):GU(n):[]}function $U(n,e,t){const i=FA(n,t),r=n.children||[];let a=-1,l=[];if(VU(n))return l;let o,u;for(C0(n)||$C(n)&&HC(e,n,$C)?u=`
|
|
86
|
-
`:qU(n)?(o=2,u=2):BA(n)&&(o=1,u=1);++a<r.length;)l=l.concat(zA(r[a],n,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?C0(r[a+1]):u}));return WC(n)&&HC(e,n,WC)&&l.push(" "),o&&l.unshift(o),u&&l.push(u),l}function PA(n,e){const t=String(n.value),i=[],r=[];let a=0;for(;a<=t.length;){qC.lastIndex=a;const u=qC.exec(t),h=u&&"index"in u?u.index:t.length;i.push(KU(t.slice(a,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?e.breakBefore:!0,h===t.length?e.breakAfter:!0)),a=h+1}let l=-1,o;for(;++l<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(r.push(i[l]),o=void 0):i[l]?(typeof o=="number"&&r.push(o),r.push(i[l]),o=0):(l===0||l===i.length-1)&&r.push(0);return r}function GU(n){return[String(n.value)]}function KU(n,e,t){const i=[];let r=0,a;for(;r<n.length;){VC.lastIndex=r;const l=VC.exec(n);a=l?l.index:n.length,!r&&!a&&l&&!e&&i.push(""),r!==a&&i.push(n.slice(r,a)),r=l?a+l[0].length:a}return r!==a&&!t&&i.push(""),i.join(" ")}function FA(n,e){if(n.type==="element"){const t=n.properties||{};switch(n.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function YU(n){return!!(n.properties||{}).hidden}function XU(n){return n.tagName==="td"||n.tagName==="th"}function ZU(n){return n.tagName==="dialog"&&!(n.properties||{}).open}function JU(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(r)+n.IDENT_RE,relevance:0},g=e.optional(r)+n.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:w,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},O={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},M=[O,f,o,t,n.C_BLOCK_COMMENT_MODE,p,h],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:M.concat([{begin:/\(/,end:/\)/,keywords:C,contains:M.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+l+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:C,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,p]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,h,p,o,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,h,p,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,N,O,M,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",o]},{begin:n.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function QU(n){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=JU(n),i=t.keywords;return i.type=[...i.type,...e.type],i.literal=[...i.literal,...e.literal],i.built_in=[...i.built_in,...e.built_in],i._hints=e._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function ej(n){const e=n.regex,t={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},a=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,r]};r.contains.push(o);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},p={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],x={match:/(\/[a-z._-]+)+/},S=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],O=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:v,built_in:[...S,...b,"set","shopt",...C,...O]},contains:[g,n.SHEBANG(),_,f,a,l,x,o,u,h,p,t]}}function tj(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(r)+n.IDENT_RE,relevance:0},g=e.optional(r)+n.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},x=[f,o,t,n.C_BLOCK_COMMENT_MODE,p,h],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:x.concat([{begin:/\(/,end:/\)/,keywords:v,contains:x.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+l+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,h,p,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,h,p,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"</",contains:[].concat(S,b,x,[f,{begin:n.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:f,strings:h,keywords:v}}}function nj(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(r)+n.IDENT_RE,relevance:0},g=e.optional(r)+n.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:w,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},O={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},M=[O,f,o,t,n.C_BLOCK_COMMENT_MODE,p,h],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:M.concat([{begin:/\(/,end:/\)/,keywords:C,contains:M.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+l+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:C,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,p]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,h,p,o,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,h,p,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,N,O,M,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",o]},{begin:n.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ij(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:r.concat(a),built_in:e,literal:i},o=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},p={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=n.inherit(p,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:l},g=n.inherit(m,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},w={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},v=n.inherit(w,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});m.contains=[w,_,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,u,n.C_BLOCK_COMMENT_MODE],g.contains=[v,_,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,u,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const x={variants:[h,w,_,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},x,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[x,u,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},C]}}const rj=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),sj=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],aj=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],oj=[...sj,...aj],lj=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),cj=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),uj=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hj=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function dj(n){const e=n.regex,t=rj(n),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",o=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,i,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+cj.join("|")+")"},{begin:":(:)?("+uj.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hj.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:lj.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+oj.join("|")+")\\b"}]}}function fj(n){const e=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function pj(n){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"string",variants:[n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[n.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}function mj(n){const e=n.regex,t=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[n.HASH_COMMENT_MODE,n.QUOTE_STRING_MODE,n.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(t,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function gj(n){const e=n.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:n.NUMBER_RE}]},i=n.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[i,a,r,l,t,"self"],relevance:0},u=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,p=/'[^']*'/,f=e.either(u,h,p),m=e.concat(f,"(\\s*\\.\\s*",f,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:m,className:"attr",starts:{end:/$/,contains:[i,o,a,r,l,t]}}]}}var Kc="[0-9](_*[0-9])*",vp=`\\.(${Kc})`,xp="[0-9a-fA-F](_*[0-9a-fA-F])*",GC={className:"number",variants:[{begin:`(\\b(${Kc})((${vp})|\\.)?|(${vp}))[eE][+-]?(${Kc})[fFdD]?\\b`},{begin:`\\b(${Kc})((${vp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${vp})[fFdD]?\\b`},{begin:`\\b(${Kc})[fFdD]\\b`},{begin:`\\b0[xX]((${xp})\\.?|(${xp})?\\.(${xp}))[pP][+-]?(${Kc})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${xp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function UA(n,e,t){return t===-1?"":n.replace(e,i=>UA(n,e,t-1))}function yj(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=t+UA("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[p,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[h,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,GC,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},GC,h]}}const KC="[A-Za-z$_][0-9A-Za-z$_]*",_j=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],bj=["true","false","null","undefined","NaN","Infinity"],jA=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],HA=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qA=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xj=[].concat(qA,jA,HA);function Sj(n){const e=n.regex,t=(re,{after:F})=>{const B="</"+re[0].slice(1);return re.input.indexOf(B,F)!==-1},i=KC,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(re,F)=>{const B=re[0].length+re.index,U=re.input[B];if(U==="<"||U===","){F.ignoreMatch();return}U===">"&&(t(re,{after:B})||F.ignoreMatch());let X;const V=re.input.substring(B);if(X=V.match(/^\s*=/)){F.ignoreMatch();return}if((X=V.match(/^\s+extends\s+/))&&X.index===0){F.ignoreMatch();return}}},o={$pattern:KC,keyword:_j,literal:bj,built_in:xj,"variable.language":vj},u="[0-9](_?[0-9])*",h=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},S={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},b=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,{match:/\$\d+/},f];m.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const C=[].concat(S,m.contains),O=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(C)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O},D={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...jA,...HA]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(re){return e.concat("(?!",re.join("|"),")")}const H={match:e.concat(/\b/,Y([...qA,"super","import"].map(re=>`${re}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},$="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead($)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,S,{match:/\$\d+/},f,N,{scope:"attr",match:i+e.lookahead(":"),relevance:0},J,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,n.REGEXP_MODE,{className:"function",begin:$,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,n.inherit(n.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},H,K,D,te,{match:/\$[(.]/}]}}function wj(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[e,t,n.QUOTE_STRING_MODE,r,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Yc="[0-9](_*[0-9])*",Sp=`\\.(${Yc})`,wp="[0-9a-fA-F](_*[0-9a-fA-F])*",Cj={className:"number",variants:[{begin:`(\\b(${Yc})((${Sp})|\\.)?|(${Sp}))[eE][+-]?(${Yc})[fFdD]?\\b`},{begin:`\\b(${Yc})((${Sp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Sp})[fFdD]?\\b`},{begin:`\\b(${Yc})[fFdD]\\b`},{begin:`\\b0[xX]((${wp})\\.?|(${wp})?\\.(${wp}))[pP][+-]?(${Yc})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${wp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ej(n){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,r]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,a,r]}]};r.contains.push(l);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(l,{className:"string"}),"self"]}]},h=Cj,p=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=f;return m.variants[1].contains=[f],f.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,p,t,i,o,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,n.C_LINE_COMMENT_MODE,p],relevance:0},n.C_LINE_COMMENT_MODE,p,o,u,l,n.C_NUMBER_MODE]},p]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,u]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
87
|
-
`},h]}}const Aj=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kj=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Tj=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Mj=[...kj,...Tj],Rj=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),VA=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),WA=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Oj=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Nj=VA.concat(WA).sort().reverse();function Dj(n){const e=Aj(n),t=Nj,i="and or not only",r="[\\w-]+",a="("+r+"|@\\{"+r+"\\})",l=[],o=[],u=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},h=function(b,C,O){return{className:b,begin:C,relevance:O}},p={$pattern:/[a-z-]+/,keyword:i,attribute:Rj.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:p,relevance:0};o.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,f,h("variable","@@?"+r,10),h("variable","@\\{"+r+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const m=o.concat({begin:/\{/,end:/\}/,contains:l}),g={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},_={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Oj.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:p,returnEnd:!0,contains:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:m}},x={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,g,h("keyword","all\\b"),h("variable","@\\{"+r+"\\}"),{begin:"\\b("+Mj.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,h("selector-tag",a,0),h("selector-id","#"+a),h("selector-class","\\."+a,0),h("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+VA.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+WA.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},S={begin:r+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[x]};return l.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,w,v,S,_,x,g,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function Ij(n){const e="\\[=*\\[",t="\\]=*\\]",i={begin:e,end:t,contains:["self"]},r=[n.COMMENT("--(?!"+e+")","$"),n.COMMENT("--"+e,t,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:n.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[n.inherit(n.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},n.C_NUMBER_MODE,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{className:"string",begin:e,end:t,contains:[i],relevance:5}])}}function Lj(n){const e={className:"variable",variants:[{begin:"\\$\\("+n.UNDERSCORE_IDENT_RE+"\\)",contains:[n.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,e]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,t]},r={begin:"^"+n.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[n.HASH_COMMENT_MODE,e,t,i,r,a,l]}}function Bj(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=n.inherit(h,{contains:[]}),m=n.inherit(p,{contains:[]});h.contains.push(m),p.contains.push(f);let g=[t,u];return[h,p,f,m].forEach(x=>{x.contains=x.contains.concat(g)}),g=g.concat(h,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},t,a,h,p,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},r,i,u,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function zj(n){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"</",contains:[e,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,n.C_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}function Pj(n){const e=n.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:t.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},l={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},p=[n.BACKSLASH_ESCAPE,a,u],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(w,v,x="\\1")=>{const S=x==="\\1"?x:e.concat(x,v);return e.concat(e.concat("(?:",w,")"),v,/(?:\\.|[^\\\/])*?/,S,/(?:\\.|[^\\\/])*?/,x,i)},g=(w,v,x)=>e.concat(e.concat("(?:",w,")"),v,/(?:\\.|[^\\\/])*?/,x,i),_=[u,n.HASH_COMMENT_MODE,n.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:p,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+n.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[n.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",e.either(...f,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:g("(?:m|qr)?",/\//,/\//)},{begin:g("m|qr",e.either(...f,{capture:!0}),/\1/)},{begin:g("m|qr",/\(/,/\)/)},{begin:g("m|qr",/\[/,/\]/)},{begin:g("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,o,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=_,l.contains=_,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:_}}function Fj(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,i=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),r=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),a=e.concat(/[A-Z]+/,t),l={scope:"variable",match:"\\$+"+i},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=n.inherit(n.APOS_STRING_MODE,{illegal:null}),p=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(u)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(Q,te)=>{te.data._beginMatch=Q[1]||Q[2]},"on:end":(Q,te)=>{te.data._beginMatch!==Q[1]&&te.ignoreMatch()}},m=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),g=`[
|
|
88
|
-
]`,_={scope:"string",variants:[p,h,f,m]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],x=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:x,literal:(Q=>{const te=[];return Q.forEach($=>{te.push($),$.toLowerCase()===$?te.push($.toUpperCase()):te.push($.toLowerCase())}),te})(v),built_in:S},O=Q=>Q.map(te=>te.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,e.concat(g,"+"),e.concat("(?!",O(S).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},D=e.concat(i,"\\b(?!\\()"),N={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[r,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:e.concat(i,e.lookahead(":"),e.lookahead(/(?!::)/))},j={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[L,l,N,n.C_BLOCK_COMMENT_MODE,_,w,M]},K={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",O(x).join("\\b|"),"|",O(S).join("\\b|"),"\\b)"),i,e.concat(g,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[j]};j.contains.push(K);const Y=[L,N,n.C_BLOCK_COMMENT_MODE,_,w,M],H={begin:e.concat(/#\[\s*\\?/,e.either(r,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:r},{match:a}]}]};return{case_insensitive:!1,keywords:C,contains:[H,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},l,K,N,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},M,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",H,l,N,n.C_BLOCK_COMMENT_MODE,_,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},_,w]}}function Uj(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function jj(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Hj(n){const e=n.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},p={begin:/\{\{/,relevance:0},f={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u,p,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u,p,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,p,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,p,h]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",g=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,_=`\\b|${i.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${g}))[eE][+-]?(${m})[jJ]?(?=${_})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${m})[jJ](?=${_})`}]},v={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",u,w,f,n.HASH_COMMENT_MODE]}]};return h.contains=[f,w,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[u,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,x,f]}]}}function qj(n){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Vj(n){const e=n.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[n.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),n.HASH_COMMENT_MODE,{scope:"string",contains:[n.BACKSLASH_ESCAPE],variants:[n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[a,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Wj(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=e.concat(i,/(::\w+)*/),l={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},h=[n.COMMENT("#","$",{contains:[o]}),n.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],p={className:"subst",begin:/#\{/,end:/\}/,keywords:l},f={className:"string",contains:[n.BACKSLASH_ESCAPE,p],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,p]})]}]},m="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},M=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:l},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:t}],relevance:0},_,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,p],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,h),relevance:0}].concat(u,h);p.contains=M,w.contains=M;const j=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:M}}];return h.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(j).concat(h).concat(M)}}function $j(n){const e=n.regex,t=/(r#)?/,i=e.concat(t,n.UNDERSCORE_IDENT_RE),r=e.concat(t,n.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,e.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:p,keyword:o,literal:u,built_in:h},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:p}},{className:"punctuation",begin:"->"},a]}}const Gj=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Kj=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Yj=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Xj=[...Kj,...Yj],Zj=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Jj=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Qj=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),eH=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function tH(n){const e=Gj(n),t=Qj,i=Jj,r="@[a-z-]+",a="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Xj.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+eH.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Zj.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function nH(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function iH(n){const e=n.regex,t=n.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=p,_=[...h,...u].filter(O=>!p.includes(O)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function S(O){return e.concat(/\b/,e.either(...O.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:S(m),relevance:0};function C(O,{exceptions:M,when:D}={}){const N=D;return M=M||[],O.map(L=>L.match(/\|\d+$/)||M.includes(L)?L:N(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:C(_,{when:O=>O.length<3}),literal:a,type:o,built_in:f},contains:[{scope:"type",match:S(l)},b,x,w,i,r,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,v]}}function $A(n){return n?typeof n=="string"?n:n.source:null}function Mh(n){return zn("(?=",n,")")}function zn(...n){return n.map(t=>$A(t)).join("")}function rH(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function ir(...n){return"("+(rH(n).capture?"":"?:")+n.map(i=>$A(i)).join("|")+")"}const Vb=n=>zn(/\b/,n,/\w$/.test(n)?/\b/:/\B/),sH=["Protocol","Type"].map(Vb),YC=["init","self"].map(Vb),aH=["Any","Self"],I_=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],XC=["false","nil","true"],oH=["assignment","associativity","higherThan","left","lowerThan","none","right"],lH=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ZC=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],GA=ir(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),KA=ir(GA,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),L_=zn(GA,KA,"*"),YA=ir(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),em=ir(YA,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Vs=zn(YA,em,"*"),Cp=zn(/[A-Z]/,em,"*"),cH=["attached","autoclosure",zn(/convention\(/,ir("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",zn(/objc\(/,Vs,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],uH=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function hH(n){const e={match:/\s+/,relevance:0},t=n.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[n.C_LINE_COMMENT_MODE,t],r={match:[/\./,ir(...sH,...YC)],className:{2:"keyword"}},a={match:zn(/\./,ir(...I_)),relevance:0},l=I_.filter(Fe=>typeof Fe=="string").concat(["_|0"]),o=I_.filter(Fe=>typeof Fe!="string").concat(aH).map(Vb),u={variants:[{className:"keyword",match:ir(...o,...YC)}]},h={$pattern:ir(/\b\w+/,/#\w+/),keyword:l.concat(lH),literal:XC},p=[r,a,u],f={match:zn(/\./,ir(...ZC)),relevance:0},m={className:"built_in",match:zn(/\b/,ir(...ZC),/(?=\()/)},g=[f,m],_={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:L_},{match:`\\.(\\.|${KA})+`}]},v=[_,w],x="([0-9]_*)+",S="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${x})(\\.(${x}))?([eE][+-]?(${x}))?\\b`},{match:`\\b0x(${S})(\\.(${S}))?([pP][+-]?(${x}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},C=(Fe="")=>({className:"subst",variants:[{match:zn(/\\/,Fe,/[0\\tnr"']/)},{match:zn(/\\/,Fe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),O=(Fe="")=>({className:"subst",match:zn(/\\/,Fe,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(Fe="")=>({className:"subst",label:"interpol",begin:zn(/\\/,Fe,/\(/),end:/\)/}),D=(Fe="")=>({begin:zn(Fe,/"""/),end:zn(/"""/,Fe),contains:[C(Fe),O(Fe),M(Fe)]}),N=(Fe="")=>({begin:zn(Fe,/"/),end:zn(/"/,Fe),contains:[C(Fe),M(Fe)]}),L={className:"string",variants:[D(),D("#"),D("##"),D("###"),N(),N("#"),N("##"),N("###")]},j=[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}],K={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:j},Y=Fe=>{const je=zn(Fe,/\//),st=zn(/\//,Fe);return{begin:je,end:st,contains:[...j,{scope:"comment",begin:`#(?!.*${st})`,end:/$/}]}},H={scope:"regexp",variants:[Y("###"),Y("##"),Y("#"),K]},Q={match:zn(/`/,Vs,/`/)},te={className:"variable",match:/\$\d+/},$={className:"variable",match:`\\$${em}+`},J=[Q,te,$],re={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:uH,contains:[...v,b,L]}]}},F={scope:"keyword",match:zn(/@/,ir(...cH),Mh(ir(/\(/,/\s+/)))},B={scope:"meta",match:zn(/@/,Vs)},U=[re,F,B],X={match:Mh(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:zn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,em,"+")},{className:"type",match:Cp,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:zn(/\s+&\s+/,Mh(Cp)),relevance:0}]},V={begin:/</,end:/>/,keywords:h,contains:[...i,...p,...U,_,X]};X.contains.push(V);const _e={match:zn(Vs,/\s*:/),keywords:"_|0",relevance:0},Ee={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",_e,...i,H,...p,...g,...v,b,L,...J,...U,X]},Ie={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,X]},ae={begin:ir(Mh(zn(Vs,/\s*:/)),Mh(zn(Vs,/\s+/,Vs,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Vs}]},ee={begin:/\(/,end:/\)/,keywords:h,contains:[ae,...i,...p,...v,b,L,...U,X,Ee],endsParent:!0,illegal:/["']/},Te={match:[/(func|macro)/,/\s+/,ir(Q.match,Vs,L_)],className:{1:"keyword",3:"title.function"},contains:[Ie,ee,e],illegal:[/\[/,/%/]},ye={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ie,ee,e],illegal:/\[|%/},Me={match:[/operator/,/\s+/,L_],className:{1:"keyword",3:"title"}},we={begin:[/precedencegroup/,/\s+/,Cp],className:{1:"keyword",3:"title"},contains:[X],keywords:[...oH,...XC],end:/}/},it={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},De={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Pe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Vs,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[Ie,...p,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Cp},...p],relevance:0}]};for(const Fe of L.variants){const je=Fe.contains.find(Rt=>Rt.label==="interpol");je.keywords=h;const st=[...p,...g,...v,b,L,...J];je.contains=[...st,{begin:/\(/,end:/\)/,contains:["self",...st]}]}return{name:"Swift",keywords:h,contains:[...i,Te,ye,it,De,Pe,Me,we,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},H,...p,...g,...v,b,L,...J,...U,X,Ee]}}const tm="[A-Za-z$_][0-9A-Za-z$_]*",XA=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ZA=["true","false","null","undefined","NaN","Infinity"],JA=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],QA=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ek=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nk=[].concat(ek,JA,QA);function dH(n){const e=n.regex,t=(re,{after:F})=>{const B="</"+re[0].slice(1);return re.input.indexOf(B,F)!==-1},i=tm,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(re,F)=>{const B=re[0].length+re.index,U=re.input[B];if(U==="<"||U===","){F.ignoreMatch();return}U===">"&&(t(re,{after:B})||F.ignoreMatch());let X;const V=re.input.substring(B);if(X=V.match(/^\s*=/)){F.ignoreMatch();return}if((X=V.match(/^\s+extends\s+/))&&X.index===0){F.ignoreMatch();return}}},o={$pattern:tm,keyword:XA,literal:ZA,built_in:nk,"variable.language":tk},u="[0-9](_?[0-9])*",h=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},S={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},b=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,{match:/\$\d+/},f];m.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const C=[].concat(S,m.contains),O=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(C)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O},D={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...JA,...QA]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(re){return e.concat("(?!",re.join("|"),")")}const H={match:e.concat(/\b/,Y([...ek,"super","import"].map(re=>`${re}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},$="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead($)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,S,{match:/\$\d+/},f,N,{scope:"attr",match:i+e.lookahead(":"),relevance:0},J,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,n.REGEXP_MODE,{className:"function",begin:$,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,n.inherit(n.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},H,K,D,te,{match:/\$[(.]/}]}}function fH(n){const e=n.regex,t=dH(n),i=tm,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:tm,keyword:XA.concat(u),literal:ZA,built_in:nk.concat(r),"variable.language":tk},p={className:"meta",begin:"@"+i},f=(w,v,x)=>{const S=w.contains.findIndex(b=>b.label===v);if(S===-1)throw new Error("can not find mode to replace");w.contains.splice(S,1,x)};Object.assign(t.keywords,h),t.exports.PARAMS_CONTAINS.push(p);const m=t.contains.find(w=>w.scope==="attr"),g=Object.assign({},m,{match:e.concat(i,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,m,g]),t.contains=t.contains.concat([p,a,l,g]),f(t,"shebang",n.SHEBANG()),f(t,"use_strict",o);const _=t.contains.find(w=>w.label==="func.def");return _.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function pH(n){const e=n.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,r),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,e.either(a,r),/ +/,e.either(l,o),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},p={className:"label",begin:/^\w+:/},f=n.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=n.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,i,u,h,p,f,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function mH(n){n.regex;const e=n.COMMENT(/\(;/,/;\)/);e.contains.push("self");const t=n.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[t,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,l,r,n.QUOTE_STRING_MODE,u,h,o]}}function gH(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=n.inherit(a,{begin:/\(/,end:/\)/}),o=n.inherit(n.APOS_STRING_MODE,{className:"string"}),u=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,u,o,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,l,u,o]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:h}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function yH(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,r]},o=n.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},_={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},m,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},_,w,a,l],x=[...v];return x.pop(),x.push(o),g.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const _H={arduino:QU,bash:ej,c:tj,cpp:nj,csharp:ij,css:dj,diff:fj,go:pj,graphql:mj,ini:gj,java:yj,javascript:Sj,json:wj,kotlin:Ej,less:Dj,lua:Ij,makefile:Lj,markdown:Bj,objectivec:zj,perl:Pj,php:Fj,"php-template":Uj,plaintext:jj,python:Hj,"python-repl":qj,r:Vj,ruby:Wj,rust:$j,scss:tH,shell:nH,sql:iH,swift:hH,typescript:fH,vbnet:pH,wasm:mH,xml:gH,yaml:yH};var B_,JC;function bH(){if(JC)return B_;JC=1;function n(le){return le instanceof Map?le.clear=le.delete=le.set=function(){throw new Error("map is read-only")}:le instanceof Set&&(le.add=le.clear=le.delete=function(){throw new Error("set is read-only")}),Object.freeze(le),Object.getOwnPropertyNames(le).forEach(ze=>{const rt=le[ze],Dt=typeof rt;(Dt==="object"||Dt==="function")&&!Object.isFrozen(rt)&&n(rt)}),le}class e{constructor(ze){ze.data===void 0&&(ze.data={}),this.data=ze.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(le){return le.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(le,...ze){const rt=Object.create(null);for(const Dt in le)rt[Dt]=le[Dt];return ze.forEach(function(Dt){for(const yn in Dt)rt[yn]=Dt[yn]}),rt}const r="</span>",a=le=>!!le.scope,l=(le,{prefix:ze})=>{if(le.startsWith("language:"))return le.replace("language:","language-");if(le.includes(".")){const rt=le.split(".");return[`${ze}${rt.shift()}`,...rt.map((Dt,yn)=>`${Dt}${"_".repeat(yn+1)}`)].join(" ")}return`${ze}${le}`};class o{constructor(ze,rt){this.buffer="",this.classPrefix=rt.classPrefix,ze.walk(this)}addText(ze){this.buffer+=t(ze)}openNode(ze){if(!a(ze))return;const rt=l(ze.scope,{prefix:this.classPrefix});this.span(rt)}closeNode(ze){a(ze)&&(this.buffer+=r)}value(){return this.buffer}span(ze){this.buffer+=`<span class="${ze}">`}}const u=(le={})=>{const ze={children:[]};return Object.assign(ze,le),ze};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ze){this.top.children.push(ze)}openNode(ze){const rt=u({scope:ze});this.add(rt),this.stack.push(rt)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ze){return this.constructor._walk(ze,this.rootNode)}static _walk(ze,rt){return typeof rt=="string"?ze.addText(rt):rt.children&&(ze.openNode(rt),rt.children.forEach(Dt=>this._walk(ze,Dt)),ze.closeNode(rt)),ze}static _collapse(ze){typeof ze!="string"&&ze.children&&(ze.children.every(rt=>typeof rt=="string")?ze.children=[ze.children.join("")]:ze.children.forEach(rt=>{h._collapse(rt)}))}}class p extends h{constructor(ze){super(),this.options=ze}addText(ze){ze!==""&&this.add(ze)}startScope(ze){this.openNode(ze)}endScope(){this.closeNode()}__addSublanguage(ze,rt){const Dt=ze.root;rt&&(Dt.scope=`language:${rt}`),this.add(Dt)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(le){return le?typeof le=="string"?le:le.source:null}function m(le){return w("(?=",le,")")}function g(le){return w("(?:",le,")*")}function _(le){return w("(?:",le,")?")}function w(...le){return le.map(rt=>f(rt)).join("")}function v(le){const ze=le[le.length-1];return typeof ze=="object"&&ze.constructor===Object?(le.splice(le.length-1,1),ze):{}}function x(...le){return"("+(v(le).capture?"":"?:")+le.map(Dt=>f(Dt)).join("|")+")"}function S(le){return new RegExp(le.toString()+"|").exec("").length-1}function b(le,ze){const rt=le&&le.exec(ze);return rt&&rt.index===0}const C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function O(le,{joinWith:ze}){let rt=0;return le.map(Dt=>{rt+=1;const yn=rt;let dn=f(Dt),pt="";for(;dn.length>0;){const ct=C.exec(dn);if(!ct){pt+=dn;break}pt+=dn.substring(0,ct.index),dn=dn.substring(ct.index+ct[0].length),ct[0][0]==="\\"&&ct[1]?pt+="\\"+String(Number(ct[1])+yn):(pt+=ct[0],ct[0]==="("&&rt++)}return pt}).map(Dt=>`(${Dt})`).join(ze)}const M=/\b\B/,D="[a-zA-Z]\\w*",N="[a-zA-Z_]\\w*",L="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",K="\\b(0b[01]+)",Y="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",H=(le={})=>{const ze=/^#![ ]*\//;return le.binary&&(le.begin=w(ze,/.*\b/,le.binary,/\b.*/)),i({scope:"meta",begin:ze,end:/$/,relevance:0,"on:begin":(rt,Dt)=>{rt.index!==0&&Dt.ignoreMatch()}},le)},Q={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},$={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},J={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},re=function(le,ze,rt={}){const Dt=i({scope:"comment",begin:le,end:ze,contains:[]},rt);Dt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const yn=x("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Dt.contains.push({begin:w(/[ ]+/,"(",yn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Dt},F=re("//","$"),B=re("/\\*","\\*/"),U=re("#","$"),X={scope:"number",begin:L,relevance:0},V={scope:"number",begin:j,relevance:0},_e={scope:"number",begin:K,relevance:0},Ee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]},Ie={scope:"title",begin:D,relevance:0},ae={scope:"title",begin:N,relevance:0},ee={begin:"\\.\\s*"+N,relevance:0};var ye=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:Q,BINARY_NUMBER_MODE:_e,BINARY_NUMBER_RE:K,COMMENT:re,C_BLOCK_COMMENT_MODE:B,C_LINE_COMMENT_MODE:F,C_NUMBER_MODE:V,C_NUMBER_RE:j,END_SAME_AS_BEGIN:function(le){return Object.assign(le,{"on:begin":(ze,rt)=>{rt.data._beginMatch=ze[1]},"on:end":(ze,rt)=>{rt.data._beginMatch!==ze[1]&&rt.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:D,MATCH_NOTHING_RE:M,METHOD_GUARD:ee,NUMBER_MODE:X,NUMBER_RE:L,PHRASAL_WORDS_MODE:J,QUOTE_STRING_MODE:$,REGEXP_MODE:Ee,RE_STARTERS_RE:Y,SHEBANG:H,TITLE_MODE:Ie,UNDERSCORE_IDENT_RE:N,UNDERSCORE_TITLE_MODE:ae});function Me(le,ze){le.input[le.index-1]==="."&&ze.ignoreMatch()}function we(le,ze){le.className!==void 0&&(le.scope=le.className,delete le.className)}function it(le,ze){ze&&le.beginKeywords&&(le.begin="\\b("+le.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",le.__beforeBegin=Me,le.keywords=le.keywords||le.beginKeywords,delete le.beginKeywords,le.relevance===void 0&&(le.relevance=0))}function De(le,ze){Array.isArray(le.illegal)&&(le.illegal=x(...le.illegal))}function Pe(le,ze){if(le.match){if(le.begin||le.end)throw new Error("begin & end are not supported with match");le.begin=le.match,delete le.match}}function Fe(le,ze){le.relevance===void 0&&(le.relevance=1)}const je=(le,ze)=>{if(!le.beforeMatch)return;if(le.starts)throw new Error("beforeMatch cannot be used with starts");const rt=Object.assign({},le);Object.keys(le).forEach(Dt=>{delete le[Dt]}),le.keywords=rt.keywords,le.begin=w(rt.beforeMatch,m(rt.begin)),le.starts={relevance:0,contains:[Object.assign(rt,{endsParent:!0})]},le.relevance=0,delete rt.beforeMatch},st=["of","and","for","in","not","or","if","then","parent","list","value"],Rt="keyword";function bt(le,ze,rt=Rt){const Dt=Object.create(null);return typeof le=="string"?yn(rt,le.split(" ")):Array.isArray(le)?yn(rt,le):Object.keys(le).forEach(function(dn){Object.assign(Dt,bt(le[dn],ze,dn))}),Dt;function yn(dn,pt){ze&&(pt=pt.map(ct=>ct.toLowerCase())),pt.forEach(function(ct){const ot=ct.split("|");Dt[ot[0]]=[dn,Lt(ot[0],ot[1])]})}}function Lt(le,ze){return ze?Number(ze):sn(le)?0:1}function sn(le){return st.includes(le.toLowerCase())}const jt={},Pt=le=>{console.error(le)},Cn=(le,...ze)=>{console.log(`WARN: ${le}`,...ze)},Ce=(le,ze)=>{jt[`${le}/${ze}`]||(console.log(`Deprecated as of ${le}. ${ze}`),jt[`${le}/${ze}`]=!0)},qe=new Error;function ft(le,ze,{key:rt}){let Dt=0;const yn=le[rt],dn={},pt={};for(let ct=1;ct<=ze.length;ct++)pt[ct+Dt]=yn[ct],dn[ct+Dt]=!0,Dt+=S(ze[ct-1]);le[rt]=pt,le[rt]._emit=dn,le[rt]._multi=!0}function Ct(le){if(Array.isArray(le.begin)){if(le.skip||le.excludeBegin||le.returnBegin)throw Pt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qe;if(typeof le.beginScope!="object"||le.beginScope===null)throw Pt("beginScope must be object"),qe;ft(le,le.begin,{key:"beginScope"}),le.begin=O(le.begin,{joinWith:""})}}function Bt(le){if(Array.isArray(le.end)){if(le.skip||le.excludeEnd||le.returnEnd)throw Pt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qe;if(typeof le.endScope!="object"||le.endScope===null)throw Pt("endScope must be object"),qe;ft(le,le.end,{key:"endScope"}),le.end=O(le.end,{joinWith:""})}}function Nn(le){le.scope&&typeof le.scope=="object"&&le.scope!==null&&(le.beginScope=le.scope,delete le.scope)}function Ft(le){Nn(le),typeof le.beginScope=="string"&&(le.beginScope={_wrap:le.beginScope}),typeof le.endScope=="string"&&(le.endScope={_wrap:le.endScope}),Ct(le),Bt(le)}function Pn(le){function ze(pt,ct){return new RegExp(f(pt),"m"+(le.case_insensitive?"i":"")+(le.unicodeRegex?"u":"")+(ct?"g":""))}class rt{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ct,ot){ot.position=this.position++,this.matchIndexes[this.matchAt]=ot,this.regexes.push([ot,ct]),this.matchAt+=S(ct)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ct=this.regexes.map(ot=>ot[1]);this.matcherRe=ze(O(ct,{joinWith:"|"}),!0),this.lastIndex=0}exec(ct){this.matcherRe.lastIndex=this.lastIndex;const ot=this.matcherRe.exec(ct);if(!ot)return null;const en=ot.findIndex((ur,rs)=>rs>0&&ur!==void 0),Hn=this.matchIndexes[en];return ot.splice(0,en),Object.assign(ot,Hn)}}class Dt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ct){if(this.multiRegexes[ct])return this.multiRegexes[ct];const ot=new rt;return this.rules.slice(ct).forEach(([en,Hn])=>ot.addRule(en,Hn)),ot.compile(),this.multiRegexes[ct]=ot,ot}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ct,ot){this.rules.push([ct,ot]),ot.type==="begin"&&this.count++}exec(ct){const ot=this.getMatcher(this.regexIndex);ot.lastIndex=this.lastIndex;let en=ot.exec(ct);if(this.resumingScanAtSamePosition()&&!(en&&en.index===this.lastIndex)){const Hn=this.getMatcher(0);Hn.lastIndex=this.lastIndex+1,en=Hn.exec(ct)}return en&&(this.regexIndex+=en.position+1,this.regexIndex===this.count&&this.considerAll()),en}}function yn(pt){const ct=new Dt;return pt.contains.forEach(ot=>ct.addRule(ot.begin,{rule:ot,type:"begin"})),pt.terminatorEnd&&ct.addRule(pt.terminatorEnd,{type:"end"}),pt.illegal&&ct.addRule(pt.illegal,{type:"illegal"}),ct}function dn(pt,ct){const ot=pt;if(pt.isCompiled)return ot;[we,Pe,Ft,je].forEach(Hn=>Hn(pt,ct)),le.compilerExtensions.forEach(Hn=>Hn(pt,ct)),pt.__beforeBegin=null,[it,De,Fe].forEach(Hn=>Hn(pt,ct)),pt.isCompiled=!0;let en=null;return typeof pt.keywords=="object"&&pt.keywords.$pattern&&(pt.keywords=Object.assign({},pt.keywords),en=pt.keywords.$pattern,delete pt.keywords.$pattern),en=en||/\w+/,pt.keywords&&(pt.keywords=bt(pt.keywords,le.case_insensitive)),ot.keywordPatternRe=ze(en,!0),ct&&(pt.begin||(pt.begin=/\B|\b/),ot.beginRe=ze(ot.begin),!pt.end&&!pt.endsWithParent&&(pt.end=/\B|\b/),pt.end&&(ot.endRe=ze(ot.end)),ot.terminatorEnd=f(ot.end)||"",pt.endsWithParent&&ct.terminatorEnd&&(ot.terminatorEnd+=(pt.end?"|":"")+ct.terminatorEnd)),pt.illegal&&(ot.illegalRe=ze(pt.illegal)),pt.contains||(pt.contains=[]),pt.contains=[].concat(...pt.contains.map(function(Hn){return Vn(Hn==="self"?pt:Hn)})),pt.contains.forEach(function(Hn){dn(Hn,ot)}),pt.starts&&dn(pt.starts,ct),ot.matcher=yn(ot),ot}if(le.compilerExtensions||(le.compilerExtensions=[]),le.contains&&le.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return le.classNameAliases=i(le.classNameAliases||{}),dn(le)}function jn(le){return le?le.endsWithParent||jn(le.starts):!1}function Vn(le){return le.variants&&!le.cachedVariants&&(le.cachedVariants=le.variants.map(function(ze){return i(le,{variants:null},ze)})),le.cachedVariants?le.cachedVariants:jn(le)?i(le,{starts:le.starts?i(le.starts):null}):Object.isFrozen(le)?i(le):le}var Je="11.11.1";class Fi extends Error{constructor(ze,rt){super(ze),this.name="HTMLInjectionError",this.html=rt}}const Jn=t,ta=i,nt=Symbol("nomatch"),As=7,ks=function(le){const ze=Object.create(null),rt=Object.create(null),Dt=[];let yn=!0;const dn="Could not find the language '{}', did you forget to load/include a language module?",pt={disableAutodetect:!0,name:"Plain text",contains:[]};let ct={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function ot(Ye){return ct.noHighlightRe.test(Ye)}function en(Ye){let gt=Ye.className+" ";gt+=Ye.parentNode?Ye.parentNode.className:"";const Xt=ct.languageDetectRe.exec(gt);if(Xt){const fn=xi(Xt[1]);return fn||(Cn(dn.replace("{}",Xt[1])),Cn("Falling back to no-highlight mode for this block.",Ye)),fn?Xt[1]:"no-highlight"}return gt.split(/\s+/).find(fn=>ot(fn)||xi(fn))}function Hn(Ye,gt,Xt){let fn="",Yn="";typeof gt=="object"?(fn=Ye,Xt=gt.ignoreIllegals,Yn=gt.language):(Ce("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ce("10.7.0",`Please use highlight(code, options) instead.
|
|
89
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Yn=Ye,fn=gt),Xt===void 0&&(Xt=!0);const Tt={code:fn,language:Yn};Ur("before:highlight",Tt);const ji=Tt.result?Tt.result:ur(Tt.language,Tt.code,Xt);return ji.code=Tt.code,Ur("after:highlight",ji),ji}function ur(Ye,gt,Xt,fn){const Yn=Object.create(null);function Tt(Qe,dt){return Qe.keywords[dt]}function ji(){if(!Et.keywords){At.addText(_n);return}let Qe=0;Et.keywordPatternRe.lastIndex=0;let dt=Et.keywordPatternRe.exec(_n),Ut="";for(;dt;){Ut+=_n.substring(Qe,dt.index);const tn=ri.case_insensitive?dt[0].toLowerCase():dt[0],Gt=Tt(Et,tn);if(Gt){const[ti,us]=Gt;if(At.addText(Ut),Ut="",Yn[tn]=(Yn[tn]||0)+1,Yn[tn]<=As&&(Rs+=us),ti.startsWith("_"))Ut+=dt[0];else{const Os=ri.classNameAliases[ti]||ti;Si(dt[0],Os)}}else Ut+=dt[0];Qe=Et.keywordPatternRe.lastIndex,dt=Et.keywordPatternRe.exec(_n)}Ut+=_n.substring(Qe),At.addText(Ut)}function Ii(){if(_n==="")return;let Qe=null;if(typeof Et.subLanguage=="string"){if(!ze[Et.subLanguage]){At.addText(_n);return}Qe=ur(Et.subLanguage,_n,!0,Il[Et.subLanguage]),Il[Et.subLanguage]=Qe._top}else Qe=ss(_n,Et.subLanguage.length?Et.subLanguage:null);Et.relevance>0&&(Rs+=Qe.relevance),At.__addSublanguage(Qe._emitter,Qe.language)}function An(){Et.subLanguage!=null?Ii():ji(),_n=""}function Si(Qe,dt){Qe!==""&&(At.startScope(dt),At.addText(Qe),At.endScope())}function jo(Qe,dt){let Ut=1;const tn=dt.length-1;for(;Ut<=tn;){if(!Qe._emit[Ut]){Ut++;continue}const Gt=ri.classNameAliases[Qe[Ut]]||Qe[Ut],ti=dt[Ut];Gt?Si(ti,Gt):(_n=ti,ji(),_n=""),Ut++}}function na(Qe,dt){return Qe.scope&&typeof Qe.scope=="string"&&At.openNode(ri.classNameAliases[Qe.scope]||Qe.scope),Qe.beginScope&&(Qe.beginScope._wrap?(Si(_n,ri.classNameAliases[Qe.beginScope._wrap]||Qe.beginScope._wrap),_n=""):Qe.beginScope._multi&&(jo(Qe.beginScope,dt),_n="")),Et=Object.create(Qe,{parent:{value:Et}}),Et}function Wa(Qe,dt,Ut){let tn=b(Qe.endRe,Ut);if(tn){if(Qe["on:end"]){const Gt=new e(Qe);Qe["on:end"](dt,Gt),Gt.isMatchIgnored&&(tn=!1)}if(tn){for(;Qe.endsParent&&Qe.parent;)Qe=Qe.parent;return Qe}}if(Qe.endsWithParent)return Wa(Qe.parent,dt,Ut)}function mn(Qe){return Et.matcher.regexIndex===0?(_n+=Qe[0],1):(er=!0,0)}function ia(Qe){const dt=Qe[0],Ut=Qe.rule,tn=new e(Ut),Gt=[Ut.__beforeBegin,Ut["on:begin"]];for(const ti of Gt)if(ti&&(ti(Qe,tn),tn.isMatchIgnored))return mn(dt);return Ut.skip?_n+=dt:(Ut.excludeBegin&&(_n+=dt),An(),!Ut.returnBegin&&!Ut.excludeBegin&&(_n=dt)),na(Ut,Qe),Ut.returnBegin?0:dt.length}function hi(Qe){const dt=Qe[0],Ut=gt.substring(Qe.index),tn=Wa(Et,Qe,Ut);if(!tn)return nt;const Gt=Et;Et.endScope&&Et.endScope._wrap?(An(),Si(dt,Et.endScope._wrap)):Et.endScope&&Et.endScope._multi?(An(),jo(Et.endScope,Qe)):Gt.skip?_n+=dt:(Gt.returnEnd||Gt.excludeEnd||(_n+=dt),An(),Gt.excludeEnd&&(_n=dt));do Et.scope&&At.closeNode(),!Et.skip&&!Et.subLanguage&&(Rs+=Et.relevance),Et=Et.parent;while(Et!==tn.parent);return tn.starts&&na(tn.starts,Qe),Gt.returnEnd?0:dt.length}function jr(){const Qe=[];for(let dt=Et;dt!==ri;dt=dt.parent)dt.scope&&Qe.unshift(dt.scope);Qe.forEach(dt=>At.openNode(dt))}let os={};function Ms(Qe,dt){const Ut=dt&&dt[0];if(_n+=Qe,Ut==null)return An(),0;if(os.type==="begin"&&dt.type==="end"&&os.index===dt.index&&Ut===""){if(_n+=gt.slice(dt.index,dt.index+1),!yn){const tn=new Error(`0 width match regex (${Ye})`);throw tn.languageName=Ye,tn.badRule=os.rule,tn}return 1}if(os=dt,dt.type==="begin")return ia(dt);if(dt.type==="illegal"&&!Xt){const tn=new Error('Illegal lexeme "'+Ut+'" for mode "'+(Et.scope||"<unnamed>")+'"');throw tn.mode=Et,tn}else if(dt.type==="end"){const tn=hi(dt);if(tn!==nt)return tn}if(dt.type==="illegal"&&Ut==="")return _n+=`
|
|
90
|
-
`,1;if(wi>1e5&&wi>dt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _n+=Ut,Ut.length}const ri=xi(Ye);if(!ri)throw Pt(dn.replace("{}",Ye)),new Error('Unknown language: "'+Ye+'"');const Ho=Pn(ri);let ls="",Et=fn||Ho;const Il={},At=new ct.__emitter(ct);jr();let _n="",Rs=0,cs=0,wi=0,er=!1;try{if(ri.__emitTokens)ri.__emitTokens(gt,At);else{for(Et.matcher.considerAll();;){wi++,er?er=!1:Et.matcher.considerAll(),Et.matcher.lastIndex=cs;const Qe=Et.matcher.exec(gt);if(!Qe)break;const dt=gt.substring(cs,Qe.index),Ut=Ms(dt,Qe);cs=Qe.index+Ut}Ms(gt.substring(cs))}return At.finalize(),ls=At.toHTML(),{language:Ye,value:ls,relevance:Rs,illegal:!1,_emitter:At,_top:Et}}catch(Qe){if(Qe.message&&Qe.message.includes("Illegal"))return{language:Ye,value:Jn(gt),illegal:!0,relevance:0,_illegalBy:{message:Qe.message,index:cs,context:gt.slice(cs-100,cs+100),mode:Qe.mode,resultSoFar:ls},_emitter:At};if(yn)return{language:Ye,value:Jn(gt),illegal:!1,relevance:0,errorRaised:Qe,_emitter:At,_top:Et};throw Qe}}function rs(Ye){const gt={value:Jn(Ye),illegal:!1,relevance:0,_top:pt,_emitter:new ct.__emitter(ct)};return gt._emitter.addText(Ye),gt}function ss(Ye,gt){gt=gt||ct.languages||Object.keys(ze);const Xt=rs(Ye),fn=gt.filter(xi).filter(Ui).map(An=>ur(An,Ye,!1));fn.unshift(Xt);const Yn=fn.sort((An,Si)=>{if(An.relevance!==Si.relevance)return Si.relevance-An.relevance;if(An.language&&Si.language){if(xi(An.language).supersetOf===Si.language)return 1;if(xi(Si.language).supersetOf===An.language)return-1}return 0}),[Tt,ji]=Yn,Ii=Tt;return Ii.secondBest=ji,Ii}function Fr(Ye,gt,Xt){const fn=gt&&rt[gt]||Xt;Ye.classList.add("hljs"),Ye.classList.add(`language-${fn}`)}function Tn(Ye){let gt=null;const Xt=en(Ye);if(ot(Xt))return;if(Ur("before:highlightElement",{el:Ye,language:Xt}),Ye.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ye);return}if(Ye.children.length>0&&(ct.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Ye)),ct.throwUnescapedHTML))throw new Fi("One of your code blocks includes unescaped HTML.",Ye.innerHTML);gt=Ye;const fn=gt.textContent,Yn=Xt?Hn(fn,{language:Xt,ignoreIllegals:!0}):ss(fn);Ye.innerHTML=Yn.value,Ye.dataset.highlighted="yes",Fr(Ye,Xt,Yn.language),Ye.result={language:Yn.language,re:Yn.relevance,relevance:Yn.relevance},Yn.secondBest&&(Ye.secondBest={language:Yn.secondBest.language,relevance:Yn.secondBest.relevance}),Ur("after:highlightElement",{el:Ye,result:Yn,text:fn})}function Qn(Ye){ct=ta(ct,Ye)}const Di=()=>{Ji(),Ce("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ts(){Ji(),Ce("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Dl=!1;function Ji(){function Ye(){Ji()}if(document.readyState==="loading"){Dl||window.addEventListener("DOMContentLoaded",Ye,!1),Dl=!0;return}document.querySelectorAll(ct.cssSelector).forEach(Tn)}function Uo(Ye,gt){let Xt=null;try{Xt=gt(le)}catch(fn){if(Pt("Language definition for '{}' could not be registered.".replace("{}",Ye)),yn)Pt(fn);else throw fn;Xt=pt}Xt.name||(Xt.name=Ye),ze[Ye]=Xt,Xt.rawDefinition=gt.bind(null,le),Xt.aliases&&En(Xt.aliases,{languageName:Ye})}function Qi(Ye){delete ze[Ye];for(const gt of Object.keys(rt))rt[gt]===Ye&&delete rt[gt]}function Va(){return Object.keys(ze)}function xi(Ye){return Ye=(Ye||"").toLowerCase(),ze[Ye]||ze[rt[Ye]]}function En(Ye,{languageName:gt}){typeof Ye=="string"&&(Ye=[Ye]),Ye.forEach(Xt=>{rt[Xt.toLowerCase()]=gt})}function Ui(Ye){const gt=xi(Ye);return gt&&!gt.disableAutodetect}function ki(Ye){Ye["before:highlightBlock"]&&!Ye["before:highlightElement"]&&(Ye["before:highlightElement"]=gt=>{Ye["before:highlightBlock"](Object.assign({block:gt.el},gt))}),Ye["after:highlightBlock"]&&!Ye["after:highlightElement"]&&(Ye["after:highlightElement"]=gt=>{Ye["after:highlightBlock"](Object.assign({block:gt.el},gt))})}function ei(Ye){ki(Ye),Dt.push(Ye)}function as(Ye){const gt=Dt.indexOf(Ye);gt!==-1&&Dt.splice(gt,1)}function Ur(Ye,gt){const Xt=Ye;Dt.forEach(function(fn){fn[Xt]&&fn[Xt](gt)})}function vr(Ye){return Ce("10.7.0","highlightBlock will be removed entirely in v12.0"),Ce("10.7.0","Please use highlightElement now."),Tn(Ye)}Object.assign(le,{highlight:Hn,highlightAuto:ss,highlightAll:Ji,highlightElement:Tn,highlightBlock:vr,configure:Qn,initHighlighting:Di,initHighlightingOnLoad:Ts,registerLanguage:Uo,unregisterLanguage:Qi,listLanguages:Va,getLanguage:xi,registerAliases:En,autoDetection:Ui,inherit:ta,addPlugin:ei,removePlugin:as}),le.debugMode=function(){yn=!1},le.safeMode=function(){yn=!0},le.versionString=Je,le.regex={concat:w,lookahead:m,either:x,optional:_,anyNumberOfTimes:g};for(const Ye in ye)typeof ye[Ye]=="object"&&n(ye[Ye]);return Object.assign(le,ye),le},Ai=ks({});return Ai.newInstance=()=>ks({}),B_=Ai,Ai.HighlightJS=Ai,Ai.default=Ai,B_}var vH=bH();const xH=id(vH),QC={},SH="hljs-";function wH(n){const e=xH.newInstance();return n&&a(n),{highlight:t,highlightAuto:i,listLanguages:r,register:a,registerAlias:l,registered:o};function t(u,h,p){const f=p||QC,m=typeof f.prefix=="string"?f.prefix:SH;if(!e.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");e.configure({__emitter:CH,classPrefix:m});const g=e.highlight(h,{ignoreIllegals:!0,language:u});if(g.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:g.errorRaised});const _=g._emitter.root,w=_.data;return w.language=g.language,w.relevance=g.relevance,_}function i(u,h){const f=(h||QC).subset||r();let m=-1,g=0,_;for(;++m<f.length;){const w=f[m];if(!e.getLanguage(w))continue;const v=t(w,u,h);v.data&&v.data.relevance!==void 0&&v.data.relevance>g&&(g=v.data.relevance,_=v)}return _||{type:"root",children:[],data:{language:void 0,relevance:g}}}function r(){return e.listLanguages()}function a(u,h){if(typeof u=="string")e.registerLanguage(u,h);else{let p;for(p in u)Object.hasOwn(u,p)&&e.registerLanguage(p,u[p])}}function l(u,h){if(typeof u=="string")e.registerAliases(typeof h=="string"?h:[...h],{languageName:u});else{let p;for(p in u)if(Object.hasOwn(u,p)){const f=u[p];e.registerAliases(typeof f=="string"?f:[...f],{languageName:p})}}}function o(u){return!!e.getLanguage(u)}}class CH{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const t=this.stack[this.stack.length-1],i=t.children[t.children.length-1];i&&i.type==="text"?i.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const i=this.stack[this.stack.length-1],r=e.root.children;t?i.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):i.children.push(...r)}openNode(e){const t=this,i=e.split(".").map(function(l,o){return o?l+"_".repeat(o):t.options.classPrefix+l}),r=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const EH={};function AH(n){const e=n||EH,t=e.aliases,i=e.detect||!1,r=e.languages||_H,a=e.plainText,l=e.prefix,o=e.subset;let u="hljs";const h=wH(r);if(t&&h.registerAlias(t),l){const p=l.indexOf("-");u=p===-1?l:l.slice(0,p)}return function(p,f){Sm(p,"element",function(m,g,_){if(m.tagName!=="code"||!_||_.type!=="element"||_.tagName!=="pre")return;const w=kH(m);if(w===!1||!w&&!i||w&&a&&a.includes(w))return;Array.isArray(m.properties.className)||(m.properties.className=[]),m.properties.className.includes(u)||m.properties.className.unshift(u);const v=WU(m,{whitespace:"pre"});let x;try{x=w?h.highlight(w,v,{prefix:l}):h.highlightAuto(v,{prefix:l,subset:o})}catch(S){const b=S;if(w&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+w+"`, it’s not registered",{ancestors:[_,m],cause:b,place:m.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!w&&x.data&&x.data.language&&m.properties.className.push("language-"+x.data.language),x.children.length>0&&(m.children=x.children)})}}function kH(n){const e=n.properties.className;let t=-1;if(!Array.isArray(e))return;let i;for(;++t<e.length;){const r=String(e[t]);if(r==="no-highlight"||r==="nohighlight")return!1;!i&&r.slice(0,5)==="lang-"&&(i=r.slice(5)),!i&&r.slice(0,9)==="language-"&&(i=r.slice(9))}return i}const TH="_projectTab_1dpnj_7",MH="_iconBar_1dpnj_16",RH="_iconBtn_1dpnj_25",OH="_toolbar_1dpnj_123",NH="_backBtn_1dpnj_132",DH="_breadcrumb_1dpnj_157",IH="_breadSep_1dpnj_169",LH="_breadBtn_1dpnj_174",BH="_breadCurrent_1dpnj_189",zH="_inlineInput_1dpnj_196",PH="_inlineInputField_1dpnj_200",FH="_content_1dpnj_218",UH="_empty_1dpnj_229",jH="_fileList_1dpnj_239",HH="_fileEntry_1dpnj_244",qH="_fileIcon_1dpnj_268",VH="_fileName_1dpnj_275",WH="_fileSize_1dpnj_283",$H="_fileChevron_1dpnj_290",GH="_fileViewer_1dpnj_299",KH="_newFileEditor_1dpnj_305",YH="_newFileHeader_1dpnj_312",XH="_newFileName_1dpnj_321",ZH="_newFileActions_1dpnj_330",JH="_newFileSave_1dpnj_336",QH="_newFileCancel_1dpnj_336",eq="_newFileTextarea_1dpnj_364",tq="_searchOverlay_1dpnj_385",nq="_searchModal_1dpnj_399",iq="_searchInput_1dpnj_409",rq="_searchResults_1dpnj_424",sq="_searchHint_1dpnj_431",aq="_searchItem_1dpnj_439",oq="_searchItemActive_1dpnj_455",lq="_searchName_1dpnj_459",cq="_searchPath_1dpnj_465",uq="_markdown_1dpnj_478",hq="_codeBlock_1dpnj_710",dq="_subTabContainer_1dpnj_792",fq="_subTabBar_1dpnj_799",pq="_subTab_1dpnj_792",mq="_subTabActive_1dpnj_836",gq="_subTabLabel_1dpnj_842",yq="_subTabClose_1dpnj_850",_q="_subTabContent_1dpnj_868",bq="_subTabPanel_1dpnj_874",vq="_standalone_1dpnj_881",xq="_standaloneHeader_1dpnj_890",Sq="_standaloneTitle_1dpnj_900",wq="_standalonePath_1dpnj_908",Cq="_standaloneContent_1dpnj_916",Eq="_standaloneEmpty_1dpnj_923",xt={projectTab:TH,iconBar:MH,iconBtn:RH,toolbar:OH,backBtn:NH,breadcrumb:DH,breadSep:IH,breadBtn:LH,breadCurrent:BH,inlineInput:zH,inlineInputField:PH,content:FH,empty:UH,fileList:jH,fileEntry:HH,fileIcon:qH,fileName:VH,fileSize:WH,fileChevron:$H,fileViewer:GH,newFileEditor:KH,newFileHeader:YH,newFileName:XH,newFileActions:ZH,newFileSave:JH,newFileCancel:QH,newFileTextarea:eq,searchOverlay:tq,searchModal:nq,searchInput:iq,searchResults:rq,searchHint:sq,searchItem:aq,searchItemActive:oq,searchName:lq,searchPath:cq,markdown:uq,codeBlock:hq,subTabContainer:dq,subTabBar:fq,subTab:pq,subTabActive:mq,subTabLabel:gq,subTabClose:yq,subTabContent:_q,subTabPanel:bq,standalone:vq,standaloneHeader:xq,standaloneTitle:Sq,standalonePath:wq,standaloneContent:Cq,standaloneEmpty:Eq};function eE(n){return n==null?"":n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function ik(n,e){if(e==="dir")return"📁";const t=n.split(".").pop()?.toLowerCase()??"";return{md:"📝",mdx:"📝",txt:"📄",ts:"🔵",tsx:"🔵",js:"🟡",jsx:"🟡",json:"📋",yaml:"📋",yml:"📋",toml:"📋",css:"🎨",scss:"🎨",html:"🌐",py:"🐍",go:"🐹",rs:"⚙",java:"☕",sh:"📟",bash:"📟",zsh:"📟",sql:"🗃",graphql:"🗃",svg:"🖼",png:"🖼",jpg:"🖼",gif:"🖼",env:"🔒",lock:"🔒"}[t]||"📄"}function tE(n){const e=n.split(".").pop()?.toLowerCase();return e?{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",go:"go",rs:"rust",java:"java",rb:"ruby",sh:"bash",bash:"bash",zsh:"bash",css:"css",scss:"scss",html:"html",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",xml:"xml",swift:"swift",kt:"kotlin",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp"}[e]:void 0}function Aq(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[T.jsx("circle",{cx:"7",cy:"7",r:"5"}),T.jsx("line",{x1:"11",y1:"11",x2:"14.5",y2:"14.5"})]})}function kq(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[T.jsx("path",{d:"M3 1h6l4 4v10H3V1z"}),T.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"13"}),T.jsx("line",{x1:"5",y1:"10",x2:"11",y2:"10"})]})}function Tq(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[T.jsx("path",{d:"M1 3h5l2 2h7v9H1V3z"}),T.jsx("line",{x1:"8",y1:"8",x2:"8",y2:"12"}),T.jsx("line",{x1:"6",y1:"10",x2:"10",y2:"10"})]})}function Mq(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[T.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),T.jsx("line",{x1:"1",y1:"5.5",x2:"15",y2:"5.5"}),T.jsx("line",{x1:"5.5",y1:"5.5",x2:"5.5",y2:"14"})]})}function Rq(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[T.jsx("path",{d:"M2 8a6 6 0 0 1 10.5-4"}),T.jsx("path",{d:"M14 8a6 6 0 0 1-10.5 4"}),T.jsx("polyline",{points:"12 1 13 4 10 4.5"}),T.jsx("polyline",{points:"4 15 3 12 6 11.5"})]})}function Oq({projectPath:n,onSelect:e,onClose:t}){const[i,r]=W.useState(""),[a,l]=W.useState([]),[o,u]=W.useState(0),[h,p]=W.useState(!1),f=W.useRef(null),m=W.useRef(void 0);W.useEffect(()=>{f.current?.focus()},[]),W.useEffect(()=>{if(!i.trim()){l([]);return}return clearTimeout(m.current),m.current=setTimeout(async()=>{p(!0);try{const _=await fetch(`/api/files/search?root=${encodeURIComponent(n)}&q=${encodeURIComponent(i.trim())}`);if(_.ok){const w=await _.json();l(w.results||[]),u(0)}}catch{}p(!1)},200),()=>clearTimeout(m.current)},[i,n]);const g=W.useCallback(_=>{if(_.key==="Escape"){t();return}if(_.key==="ArrowDown"){_.preventDefault(),u(w=>Math.min(w+1,a.length-1));return}if(_.key==="ArrowUp"){_.preventDefault(),u(w=>Math.max(w-1,0));return}if(_.key==="Enter"&&a[o]){e(a[o]);return}},[a,o,e,t]);return T.jsx("div",{className:xt.searchOverlay,onClick:t,children:T.jsxs("div",{className:xt.searchModal,onClick:_=>_.stopPropagation(),children:[T.jsx("input",{ref:f,className:xt.searchInput,value:i,onChange:_=>r(_.target.value),onKeyDown:g,placeholder:"Search files by name...",spellCheck:!1}),T.jsxs("div",{className:xt.searchResults,children:[h&&T.jsx("div",{className:xt.searchHint,children:"Searching..."}),!h&&i&&a.length===0&&T.jsx("div",{className:xt.searchHint,children:"No matches"}),a.map((_,w)=>T.jsxs("button",{className:`${xt.searchItem} ${w===o?xt.searchItemActive:""}`,onClick:()=>e(_),onMouseEnter:()=>u(w),children:[T.jsx("span",{className:xt.fileIcon,children:ik(_.name,_.type)}),T.jsx("span",{className:xt.searchName,children:_.name}),T.jsx("span",{className:xt.searchPath,children:_.path})]},_.path))]})]})})}function nE({placeholder:n,onSubmit:e,onCancel:t}){const[i,r]=W.useState(""),a=W.useRef(null);W.useEffect(()=>{a.current?.focus()},[]);const l=W.useCallback(o=>{o.key==="Escape"&&t(),o.key==="Enter"&&i.trim()&&e(i.trim())},[i,e,t]);return T.jsx("div",{className:xt.inlineInput,children:T.jsx("input",{ref:a,className:xt.inlineInputField,value:i,onChange:o=>r(o.target.value),onKeyDown:l,onBlur:t,placeholder:n,spellCheck:!1})})}function Nq({projectPath:n,initialPath:e,onOpenBrowserTab:t,onPathChange:i}){const[r,a]=W.useState(e||"/"),[l,o]=W.useState([]),[u,h]=W.useState(null),[p,f]=W.useState(!1),[m,g]=W.useState(null),[_,w]=W.useState([]),[v,x]=W.useState(null),[S,b]=W.useState(!1),[C,O]=W.useState(!1),[M,D]=W.useState(!1),[N,L]=W.useState(null),[j,K]=W.useState(""),[Y,H]=W.useState(.5),Q=W.useRef(!1),te=W.useRef(null),$=W.useCallback(async Me=>{f(!0),g(null),h(null),x(null),L(null);try{const we=await fetch(`/api/files/list?root=${encodeURIComponent(n)}&path=${encodeURIComponent(Me)}`);if(!we.ok){const De=await we.json().catch(()=>({error:we.statusText}));throw new Error(De.error||we.statusText)}const it=await we.json();o(it.items),a(Me),i?.(Me,!1)}catch(we){const it=we instanceof Error?we.message:String(we);g(it),o([])}finally{f(!1)}},[n,i]),J=W.useCallback(async Me=>{f(!0),g(null),L(null);try{const we=await fetch(`/api/files/read?root=${encodeURIComponent(n)}&path=${encodeURIComponent(Me)}`);if(!we.ok){const Pe=await we.json().catch(()=>({error:we.statusText}));throw new Error(Pe.error||we.statusText)}const it=await we.json();h(it),a(Me),i?.(Me,!0);const De=Me.split("/").pop()||Me;w(Pe=>Pe.some(Fe=>Fe.path===Me)?Pe:[...Pe,{path:Me,name:De}]),x(Me)}catch(we){const it=we instanceof Error?we.message:String(we);g(it)}finally{f(!1)}},[n,i]);W.useEffect(()=>{n&&$(e||"/")},[n]);const re=W.useCallback(()=>{if(u||N){const we=r.split("/").filter(Boolean);we.pop(),$("/"+we.join("/"));return}if(r==="/")return;const Me=r.split("/").filter(Boolean);Me.pop(),$("/"+Me.join("/"))},[r,u,N,$]),F=W.useCallback(Me=>{const we=r==="/"?"/"+Me.name:r+"/"+Me.name;Me.type==="dir"?$(we):J(we)},[r,$,J]);W.useCallback(Me=>{x(Me.path),J(Me.path)},[J]),W.useCallback((Me,we)=>{we.stopPropagation(),w(it=>{const De=it.filter(Pe=>Pe.path!==Me);if(v===Me)if(De.length>0){const Pe=De[De.length-1];x(Pe.path),J(Pe.path)}else{x(null),h(null);const Pe=Me.split("/").filter(Boolean);Pe.pop(),$("/"+Pe.join("/"))}return De})},[v,J,$]);const B=W.useCallback(Me=>{b(!1),Me.type==="dir"?$(Me.path):J(Me.path)},[$,J]),U=W.useCallback(async Me=>{O(!1);const we=r==="/"?"/"+Me:r+"/"+Me;L(we),K(""),h(null)},[r]),X=W.useCallback(async()=>{if(N)try{const Me=await fetch("/api/files/write",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:n,path:N,content:j})});if(!Me.ok){const we=await Me.json().catch(()=>({error:"Write failed"}));g(we.error||"Write failed");return}L(null),J(N)}catch(Me){g(Me instanceof Error?Me.message:String(Me))}},[N,j,n,J]),V=W.useCallback(()=>{L(null),K("")},[]),_e=W.useCallback(async Me=>{D(!1);const we=r==="/"?"/"+Me:r+"/"+Me;try{const it=await fetch("/api/files/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:n,path:we})});if(!it.ok){const De=await it.json().catch(()=>({error:"Mkdir failed"}));g(De.error||"Mkdir failed");return}$(r)}catch(it){g(it instanceof Error?it.message:String(it))}},[r,n,$]),Ee=W.useCallback(()=>{u?J(r):$(r)},[r,u,$,J]),Ie=W.useCallback(()=>{const Me=u?r.split("/").slice(0,-1).join("/")||"/":r;t?t(n,Me):window.open(`/project-browser?path=${encodeURIComponent(n)}`,"_blank")},[n,r,u,t]);W.useCallback(Me=>{Me.preventDefault(),Q.current=!0;const we=Me.clientX,it=Y,De=te.current;if(!De)return;const Pe=De.offsetWidth,Fe=st=>{if(!Q.current)return;const Rt=st.clientX-we,bt=Math.max(.2,Math.min(.8,it+Rt/Pe));H(bt)},je=()=>{Q.current=!1,document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",je),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",je)},[Y]);const ae=r.split("/").filter(Boolean),ee=n.split("/").filter(Boolean).pop()||n,Te=u&&v,ye=N!==null;return W.useMemo(()=>{if(Te||ye){const we=(Te?r:N).split("/").filter(Boolean);return we.pop(),"/"+we.join("/")}return r},[Te,ye,r,N]),T.jsxs("div",{className:xt.projectTab,children:[T.jsxs("div",{className:xt.iconBar,children:[T.jsx("button",{className:xt.iconBtn,onClick:()=>b(!0),title:"Search files (fuzzy)",children:T.jsx(Aq,{})}),T.jsx("button",{className:xt.iconBtn,onClick:()=>O(!0),title:"New file",children:T.jsx(kq,{})}),T.jsx("button",{className:xt.iconBtn,onClick:()=>D(!0),title:"New folder",children:T.jsx(Tq,{})}),T.jsx("button",{className:xt.iconBtn,onClick:Ee,title:"Refresh",children:T.jsx(Rq,{})}),T.jsx("button",{className:xt.iconBtn,onClick:Ie,title:"Open project in new tab",children:T.jsx(Mq,{})})]}),T.jsxs("div",{className:xt.toolbar,children:[T.jsx("button",{className:xt.backBtn,onClick:re,disabled:r==="/"&&!u&&!N,title:"Go up",children:"←"}),T.jsxs("div",{className:xt.breadcrumb,children:[T.jsx("button",{className:xt.breadBtn,onClick:()=>{h(null),x(null),L(null),$("/")},children:ee}),ae.map((Me,we)=>{const it=we===ae.length-1,De="/"+ae.slice(0,we+1).join("/");return T.jsxs("span",{children:[T.jsx("span",{className:xt.breadSep,children:"/"}),it&&!Te&&!ye?T.jsx("span",{className:xt.breadCurrent,children:Me}):T.jsx("button",{className:xt.breadBtn,onClick:()=>{h(null),x(null),L(null),$(De)},children:Me})]},De)})]})]}),C&&T.jsx(nE,{placeholder:"filename.ext",onSubmit:U,onCancel:()=>O(!1)}),M&&T.jsx(nE,{placeholder:"folder name",onSubmit:_e,onCancel:()=>D(!1)}),T.jsxs("div",{className:xt.content,ref:te,children:[p&&T.jsx("div",{className:xt.empty,children:"Loading..."}),m&&T.jsx("div",{className:xt.empty,style:{color:"var(--accent-red)"},children:m}),!p&&!m&&ye&&T.jsxs("div",{className:xt.newFileEditor,children:[T.jsxs("div",{className:xt.newFileHeader,children:[T.jsx("span",{className:xt.newFileName,children:N}),T.jsxs("div",{className:xt.newFileActions,children:[T.jsx("button",{className:xt.newFileSave,onClick:X,children:"Save"}),T.jsx("button",{className:xt.newFileCancel,onClick:V,children:"Cancel"})]})]}),T.jsx("textarea",{className:xt.newFileTextarea,value:j,onChange:Me=>K(Me.target.value),placeholder:"Type file content...",autoFocus:!0,spellCheck:!1})]}),!p&&!m&&!u&&!ye&&l.length===0&&T.jsx("div",{className:xt.empty,children:"EMPTY DIRECTORY"}),!p&&!m&&!u&&!ye&&l.length>0&&T.jsx("div",{className:xt.fileList,children:l.map(Me=>T.jsxs("button",{className:xt.fileEntry,onClick:()=>F(Me),children:[T.jsx("span",{className:xt.fileIcon,children:ik(Me.name,Me.type)}),T.jsx("span",{className:xt.fileName,children:Me.name}),Me.type==="file"&&Me.size!=null&&T.jsx("span",{className:xt.fileSize,children:eE(Me.size)}),Me.type==="dir"&&T.jsx("span",{className:xt.fileChevron,children:"›"})]},Me.name))}),!p&&!m&&u&&!ye&&T.jsx("div",{className:xt.fileViewer,children:u.binary?T.jsxs("div",{className:xt.empty,children:["Binary file (",eE(u.size),")"]}):u.ext==="md"||u.ext==="mdx"?T.jsx("div",{className:xt.markdown,children:T.jsx(E9,{remarkPlugins:[PU],rehypePlugins:[AH],components:{a:({children:Me,...we})=>T.jsx("a",{...we,target:"_blank",rel:"noopener noreferrer",children:Me})},children:u.content||""})}):T.jsx("pre",{className:xt.codeBlock,children:T.jsx("code",{className:tE(u.path)?`language-${tE(u.path)}`:"",children:u.content})})})]}),S&&T.jsx(Oq,{projectPath:n,onSelect:B,onClose:()=>b(!1)})]})}function Dq({projectPath:n}){const e=n.split("/").filter(Boolean).pop()||"project",[t,i]=W.useState(()=>[{id:"default",label:e,projectPath:n}]),[r,a]=W.useState("default"),l=W.useCallback((p,f)=>{const m=f.split("/").filter(Boolean),g=m.length>0?m[m.length-1]:p.split("/").filter(Boolean).pop()||"project",_=`sub-${Date.now()}`;i(w=>[...w,{id:_,label:g,projectPath:p,initialPath:f}]),a(_)},[]),o=W.useCallback((p,f)=>{f.stopPropagation(),i(m=>{const g=m.filter(_=>_.id!==p);if(g.length===0){const _={id:`sub-${Date.now()}`,label:e,projectPath:n};return a(_.id),[_]}return r===p&&a(g[g.length-1].id),g})},[r,e,n]),u=W.useCallback((p,f,m)=>{const g=f.split("/").filter(Boolean),_=g.length>0?g[g.length-1]:n.split("/").filter(Boolean).pop()||"project";i(w=>w.map(v=>v.id===p?{...v,label:_}:v))},[n]),h=t.length>1;return T.jsxs("div",{className:xt.subTabContainer,children:[h&&T.jsx("div",{className:xt.subTabBar,children:t.map(p=>T.jsxs("button",{className:`${xt.subTab} ${r===p.id?xt.subTabActive:""}`,onClick:()=>a(p.id),children:[T.jsx("span",{className:xt.subTabLabel,children:p.label}),T.jsx("span",{className:xt.subTabClose,onClick:f=>o(p.id,f),title:"Close tab",children:"×"})]},p.id))}),T.jsx("div",{className:xt.subTabContent,children:t.map(p=>T.jsx("div",{className:xt.subTabPanel,style:{display:r===p.id?"flex":"none"},children:T.jsx(Nq,{projectPath:p.projectPath,initialPath:p.initialPath,onOpenBrowserTab:l,onPathChange:(f,m)=>u(p.id,f,m)})},p.id))})]})}const rk="session-rooms";function iE(){try{const n=localStorage.getItem(rk);if(n)return JSON.parse(n)}catch{}return[]}function Do(n){try{localStorage.setItem(rk,JSON.stringify(n))}catch{}}const Gs=Tl((n,e)=>({rooms:iE(),createRoom:t=>{const i=`room-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,r=e().rooms,a=new Set(r.map(u=>u.roomIndex).filter(u=>u!=null));let l=0;for(;a.has(l);)l++;const o={id:i,name:t,sessionIds:[],collapsed:!1,createdAt:Date.now(),roomIndex:l};return n(u=>{const h=[...u.rooms,o];return Do(h),{rooms:h}}),i},renameRoom:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id===t?{...l,name:i}:l);return Do(a),{rooms:a}}),deleteRoom:t=>n(i=>{const r=i.rooms.filter(a=>a.id!==t);return Do(r),{rooms:r}}),addSession:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id!==t||l.sessionIds.includes(i)?l:{...l,sessionIds:[...l.sessionIds,i]});return Do(a),{rooms:a}}),removeSession:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id!==t?l:{...l,sessionIds:l.sessionIds.filter(o=>o!==i)});return Do(a),{rooms:a}}),moveSession:(t,i,r)=>n(a=>{if(i===r)return a;const l=a.rooms.map(o=>o.id===i?{...o,sessionIds:o.sessionIds.filter(u=>u!==t)}:o.id===r?o.sessionIds.includes(t)?o:{...o,sessionIds:[...o.sessionIds,t]}:o);return Do(l),{rooms:l}}),toggleCollapse:t=>n(i=>{const r=i.rooms.map(a=>a.id===t?{...a,collapsed:!a.collapsed}:a);return Do(r),{rooms:r}}),setRoomIndex:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id===t?{...l,roomIndex:i}:l);return Do(a),{rooms:a}}),getRoomForSession:t=>e().rooms.find(i=>i.sessionIds.includes(t)),loadFromStorage:()=>{const t=iE();return n({rooms:t}),t}})),Wb="kill-confirm";function Iq(){const n=bi(m=>m.activeModal),e=bi(m=>m.closeModal),t=gn(m=>m.selectedSessionId),i=gn(m=>m.sessions),r=gn(m=>m.deselectSession),[a,l]=W.useState(!1);if(!(n===Wb)||!t)return null;const u=i.get(t),h=u?.projectName||t.slice(0,8),p=()=>{e()},f=async()=>{if(!a){l(!0);try{const g=await(await fetch(`/api/sessions/${t}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})})).json();if(g.ok){if(u?.terminalId)try{await fetch(`/api/terminals/${u.terminalId}`,{method:"DELETE"})}catch{kt("Failed to close terminal","error")}kt(`PID ${g.pid||"N/A"} terminated`,"success"),r()}else kt(g.error||"Kill failed","error")}catch(m){kt(m.message,"error")}finally{l(!1),e()}}};return T.jsx("div",{className:lt.overlay,onClick:p,children:T.jsxs("div",{className:lt.panel,onClick:m=>m.stopPropagation(),children:[T.jsx("h3",{children:"Kill Session"}),T.jsxs("p",{children:['Kill session for "',h,'"? This will terminate the Claude process (SIGTERM then SIGKILL).']}),T.jsxs("div",{className:lt.actions,children:[T.jsx("button",{className:lt.closeBtn,onClick:p,style:{fontSize:"12px",padding:"6px 14px"},children:"CANCEL"}),T.jsx("button",{onClick:f,disabled:a,style:{background:"rgba(255, 51, 85, 0.15)",border:"1px solid rgba(255, 51, 85, 0.3)",color:"var(--accent-red, #ff3355)",fontFamily:"var(--font-mono)",fontSize:"12px",fontWeight:700,letterSpacing:"1px",padding:"6px 14px",borderRadius:"4px",cursor:a?"not-allowed":"pointer"},children:a?"KILLING...":"KILL"})]})]})})}const $b="alert-modal";function Lq(){const n=bi(h=>h.activeModal),e=bi(h=>h.closeModal),t=gn(h=>h.selectedSessionId),[i,r]=W.useState(5);if(!(n===$b)||!t)return null;const l=()=>{e()},o=Number.isFinite(i)&&i>=1&&i<=999,u=async()=>{if(o){e();try{const h=Date.now();await $t.alerts.add({sessionId:t,type:"timer",message:`Alert after ${i} minutes`,createdAt:h}),kt(`Alert set for ${i} minutes`,"success")}catch(h){kt(h.message,"error")}}};return T.jsx("div",{className:lt.overlay,onClick:l,children:T.jsxs("div",{className:lt.panel,onClick:h=>h.stopPropagation(),children:[T.jsx("h3",{children:"Set Alert"}),T.jsx("p",{children:"Get notified after a duration of inactivity."}),T.jsxs("div",{className:lt.alertInputRow,children:[T.jsx("input",{type:"number",className:lt.alertInput,value:i,onChange:h=>r(parseInt(h.target.value,10)||0),min:1,max:999}),T.jsx("span",{children:"minutes"})]}),!o&&i!==0&&T.jsx("p",{style:{color:"#ff5555",fontSize:11,margin:"0 0 12px"},children:"Enter a value between 1 and 999"}),T.jsxs("div",{className:lt.actions,children:[T.jsx("button",{className:lt.closeBtn,onClick:l,style:{fontSize:"12px",padding:"6px 14px"},children:"CANCEL"}),T.jsx("button",{onClick:u,disabled:!o,style:{background:"rgba(255, 145, 0, 0.15)",border:"1px solid rgba(255, 145, 0, 0.3)",color:"var(--accent-orange, #ff9100)",fontFamily:"var(--font-mono)",fontSize:"12px",fontWeight:700,letterSpacing:"1px",padding:"6px 14px",borderRadius:"4px",cursor:i<1?"not-allowed":"pointer"},children:"SET ALERT"})]})]})})}const Gb="summarize-modal";function Bq(){const n=bi(H=>H.activeModal),e=bi(H=>H.closeModal),t=gn(H=>H.selectedSessionId),i=gn(H=>H.sessions),[r,a]=W.useState([]),[l,o]=W.useState(null),[u,h]=W.useState(!1),[p,f]=W.useState(null),[m,g]=W.useState(""),[_,w]=W.useState(""),[v,x]=W.useState(!1),S=n===Gb;W.useEffect(()=>{S&&b()},[S]);const b=W.useCallback(async()=>{const H=await $t.summaryPrompts.toArray();a(H);const Q=H.find(te=>te.isDefault);Q?.id!=null&&o(Q.id)},[]),C=()=>{e(),h(!1),f(null),g(""),w("")};if(!S||!t)return null;const O=i.get(t),M=()=>{if(!O)return"";let H=`Project: ${O.projectName||O.projectPath||"Unknown"}
|
|
91
|
-
`;H+=`Status: ${O.status}
|
|
92
|
-
`,H+=`Started: ${new Date(O.startedAt).toISOString()}
|
|
93
|
-
`,O.endedAt&&(H+=`Ended: ${new Date(O.endedAt).toISOString()}
|
|
94
|
-
`),H+=`
|
|
95
|
-
--- PROMPTS ---
|
|
96
|
-
`;for(const Q of O.promptHistory||[])H+=`[${new Date(Q.timestamp).toISOString()}] ${Q.text}
|
|
97
|
-
|
|
98
|
-
`;H+=`
|
|
99
|
-
--- TOOL CALLS ---
|
|
100
|
-
`;for(const Q of O.toolLog||[])H+=`[${new Date(Q.timestamp).toISOString()}] ${Q.tool}: ${Q.input||""}
|
|
101
|
-
`;H+=`
|
|
102
|
-
--- RESPONSES ---
|
|
103
|
-
`;for(const Q of O.responseLog||[])H+=`[${new Date(Q.timestamp).toISOString()}] ${Q.text||""}
|
|
104
|
-
|
|
105
|
-
`;return H},D=async(H,Q)=>{if(v)return;const te=t;x(!0),C();try{const $=M();let J=Q||"";if(!J&&H){const B=await $t.summaryPrompts.get(H);B&&(J=B.prompt)}const F=await(await fetch(`/api/sessions/${te}/summarize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:$,promptTemplate:J})})).json();if(F.ok){const U=gn.getState().selectedSessionId===te?"AI summary generated & session archived":`Summary generated for session ${te?.slice(0,8)}`;kt(U,"success")}else kt(F.error||"Summarize failed","error")}catch($){kt($.message,"error")}finally{x(!1)}},N=async H=>{const Q=await $t.summaryPrompts.toArray();for(const te of Q)te.isDefault&&te.id!==H&&await $t.summaryPrompts.update(te.id,{isDefault:0});await $t.summaryPrompts.update(H,{isDefault:1}),await b(),kt("Default prompt set","success")},L=H=>{f(H.id??null),g(H.name),w(H.prompt),h(!0)},j=async H=>{await $t.summaryPrompts.delete(H),await b(),kt("Prompt template removed","info")},K=async()=>{const H=m.trim(),Q=_.trim();if(!H||!Q){kt("Name and prompt are required","warning");return}const te=Date.now();p!=null?(await $t.summaryPrompts.update(p,{name:H,prompt:Q,updatedAt:te}),kt("Template updated","success")):(await $t.summaryPrompts.add({name:H,prompt:Q,isDefault:0,createdAt:te,updatedAt:te}),kt("Template saved","success")),h(!1),f(null),g(""),w(""),await b()},Y=()=>{const H=_.trim();if(!H){kt("Write a prompt first","warning");return}D(null,H)};return T.jsx("div",{className:lt.overlay,onClick:C,children:T.jsxs("div",{className:lt.panel,style:{maxWidth:"520px"},onClick:H=>H.stopPropagation(),children:[T.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[T.jsx("h3",{children:"Summarize Session"}),T.jsx("button",{className:lt.closeBtn,onClick:C,children:"×"})]}),T.jsxs("div",{style:{maxHeight:"240px",overflowY:"auto",marginBottom:"12px"},children:[r.length===0&&T.jsx("p",{style:{textAlign:"center",color:"var(--text-dim)",fontSize:"11px"},children:"No prompt templates yet. Create one below."}),r.map(H=>T.jsxs("div",{onClick:()=>o(H.id??null),style:{padding:"10px 12px",marginBottom:"6px",border:`1px solid ${l===H.id?"var(--accent-cyan)":"var(--border-subtle)"}`,borderRadius:"6px",background:l===H.id?"rgba(0, 229, 255, 0.08)":"transparent",cursor:"pointer",transition:"all 0.15s"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[T.jsx("span",{style:{fontSize:"12px",fontWeight:600,color:"var(--text-primary)"},children:H.name}),H.isDefault?T.jsx("span",{style:{fontSize:"9px",fontWeight:700,letterSpacing:"1px",padding:"1px 6px",borderRadius:"3px",color:"var(--accent-cyan)",background:"rgba(0, 229, 255, 0.1)"},children:"DEFAULT"}):null,T.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"4px"},children:[T.jsx("button",{onClick:Q=>{Q.stopPropagation(),N(H.id)},title:"Set as default",style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:"14px",padding:"2px"},children:"★"}),T.jsx("button",{onClick:Q=>{Q.stopPropagation(),L(H)},title:"Edit",style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:"14px",padding:"2px"},children:"✎"}),T.jsx("button",{onClick:Q=>{Q.stopPropagation(),j(H.id)},title:"Delete",style:{background:"none",border:"none",color:"var(--accent-red)",cursor:"pointer",fontSize:"14px",padding:"2px"},children:"×"})]})]}),T.jsxs("div",{style:{fontSize:"11px",color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[H.prompt.substring(0,150),H.prompt.length>150?"...":""]})]},H.id))]}),u&&T.jsxs("div",{style:{marginBottom:"12px",padding:"12px",border:"1px solid var(--border-subtle)",borderRadius:"6px"},children:[T.jsx("input",{type:"text",placeholder:"Template name",value:m,onChange:H=>g(H.target.value),style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-accent)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",padding:"6px 8px",borderRadius:"4px",marginBottom:"8px",outline:"none"}}),T.jsx("textarea",{placeholder:"Write your summary prompt...",value:_,onChange:H=>w(H.target.value),rows:4,style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-accent)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",padding:"8px",borderRadius:"4px",resize:"vertical",outline:"none"}}),T.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"8px",justifyContent:"flex-end"},children:[T.jsx("button",{onClick:K,style:{background:"rgba(0, 229, 255, 0.12)",border:"1px solid rgba(0, 229, 255, 0.3)",color:"var(--accent-cyan)",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:700,letterSpacing:"1px",padding:"4px 10px",borderRadius:"4px",cursor:"pointer"},children:p!=null?"UPDATE":"SAVE"}),T.jsx("button",{onClick:Y,style:{background:"rgba(255, 204, 0, 0.12)",border:"1px solid rgba(255, 204, 0, 0.3)",color:"#ffcc00",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:700,letterSpacing:"1px",padding:"4px 10px",borderRadius:"4px",cursor:"pointer"},children:"USE ONCE"})]})]}),T.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[T.jsx("button",{onClick:()=>{h(!u),u&&(f(null),g(""),w(""))},style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:600,letterSpacing:"0.5px",padding:"6px 12px",borderRadius:"4px",cursor:"pointer"},children:u?"HIDE FORM":"CUSTOM PROMPT"}),T.jsx("button",{onClick:()=>D(l,null),disabled:!l||v,style:{background:l?"rgba(255, 204, 0, 0.15)":"transparent",border:"1px solid rgba(255, 204, 0, 0.3)",color:"#ffcc00",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:700,letterSpacing:"1px",padding:"6px 14px",borderRadius:"4px",cursor:l&&!v?"pointer":"not-allowed",opacity:l?1:.5},children:v?"SUMMARIZING...":"SUMMARIZE"})]})]})})}const sk=["ONEOFF","HEAVY","IMPORTANT"],zq={ONEOFF:"#ff9100",HEAVY:"#ff3355",IMPORTANT:"#aa66ff"},E0="session-labels";function Pq(){try{return JSON.parse(localStorage.getItem(E0)||"[]").filter(e=>!sk.includes(e)).slice(0,5)}catch{return[]}}function Fq(n){try{const e=JSON.parse(localStorage.getItem(E0)||"[]"),t=e.indexOf(n);t!==-1&&e.splice(t,1),e.unshift(n),localStorage.setItem(E0,JSON.stringify(e.slice(0,30)))}catch{}}function Uq({sessionId:n,currentLabel:e}){const t=gn(h=>h.updateSession),i=gn(h=>h.sessions),[r,a]=W.useState(e),l=Pq(),o=[...sk,...l],u=W.useCallback(async h=>{const p=r===h?"":h;a(p);const f=i.get(n);f&&t({...f,label:p});try{if(!(await fetch(`/api/sessions/${n}/label`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:p})})).ok)throw new Error("Server error")}catch{a(r===h?h:r);const m=i.get(n);m&&t({...m,label:r===h?h:r}),kt("Failed to save label","error")}p&&Fq(p)},[n,r,i,t]);return T.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:o.map(h=>{const p=h===r,f=zq[h]||"var(--text-secondary)";return T.jsx("button",{onClick:()=>u(h),style:{display:"inline-flex",alignItems:"center",gap:"4px",background:p?`${f}1a`:"transparent",border:`1px solid ${p?f:"var(--border-subtle)"}`,color:p?f:"var(--text-dim)",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:600,letterSpacing:"0.5px",padding:"3px 8px",borderRadius:"10px",cursor:"pointer",transition:"all 0.15s"},children:h},h)})})}function jq({session:n}){const e=gn(b=>b.deselectSession),t=gn(b=>b.removeSession);gn(b=>b.updateSession),gn(b=>b.selectSession);const i=bi(b=>b.openModal),r=Gs(b=>b.rooms),a=Gs(b=>b.addSession),l=Gs(b=>b.removeSession),[o,u]=W.useState(!1),h=W.useRef(null),p=n.status==="ended";W.useEffect(()=>()=>{h.current?.abort()},[n.sessionId]);const f=W.useCallback(async()=>{if(o||!p)return;h.current?.abort();const b=new AbortController;h.current=b,u(!0);try{const O=await(await fetch(`/api/sessions/${n.sessionId}/resume`,{method:"POST",headers:{"Content-Type":"application/json"},signal:b.signal})).json();O.ok?kt("Resuming Claude session in terminal","success"):kt(O.error||"Resume failed","error")}catch(C){if(C.name==="AbortError")return;kt(C.message,"error")}finally{u(!1)}},[n.sessionId,o,p]),m=W.useCallback(()=>{i(Wb)},[i]),g=W.useCallback(async()=>{try{const b=await $t.sessions.get(n.sessionId);b&&await $t.sessions.update(n.sessionId,{status:"ended",archived:1,endedAt:b.endedAt||Date.now()}),(await fetch(`/api/sessions/${n.sessionId}`,{method:"DELETE"})).ok||kt("Server archive failed, archived locally","warning"),e(),t(n.sessionId),kt("Session archived to history","success")}catch(b){kt(b.message,"error")}},[n.sessionId,e,t]),_=W.useCallback(async()=>{const b=n.title||n.projectName||n.sessionId.slice(0,8);if(window.confirm(`Permanently delete session "${b}"?
|
|
106
|
-
This cannot be undone.`))try{await fetch(`/api/sessions/${n.sessionId}`,{method:"DELETE"}),await yO(n.sessionId),e(),t(n.sessionId),kt(`Session "${b}" permanently removed`,"success")}catch(C){kt(C.message,"error")}},[n.sessionId,n.title,n.projectName,e,t]),w=W.useCallback(()=>{i(Gb)},[i]),v=W.useCallback(()=>{i($b)},[i]),x=W.useCallback(b=>{const C=b.target.value;if(C==="__new__"){const O=window.prompt("New room name:");if(O?.trim()){const M=Gs.getState().createRoom(O.trim());Gs.getState().addSession(M,n.sessionId),kt(`Created and assigned to "${O.trim()}"`,"success")}return}for(const O of r)O.sessionIds.includes(n.sessionId)&&l(O.id,n.sessionId);C?(a(C,n.sessionId),kt("Moved to room","info")):kt("Removed from room","info")},[n.sessionId,r,a,l]),S=r.find(b=>b.sessionIds.includes(n.sessionId))?.id||"";return T.jsxs("div",{children:[T.jsxs("div",{className:We.ctrlBar,children:[p&&T.jsx("button",{className:`${We.ctrlBtn} ${We.resume}`,onClick:f,disabled:o,children:o?"RESUMING...":"RESUME"}),T.jsx("button",{className:`${We.ctrlBtn} ${We.kill}`,onClick:m,children:"KILL"}),T.jsx("button",{className:`${We.ctrlBtn} ${We.archive}`,onClick:g,children:"ARCHIVE"}),T.jsx("button",{className:`${We.ctrlBtn} ${We.delete}`,onClick:_,children:"DELETE"}),T.jsx("button",{className:`${We.ctrlBtn} ${We.summarize}`,onClick:w,children:"SUMMARIZE"}),T.jsx("button",{className:`${We.ctrlBtn} ${We.alert}`,onClick:v,children:"ALERT"}),T.jsxs("select",{className:We.ctrlSelect,value:S,onChange:x,children:[T.jsx("option",{value:"",children:"No room"}),r.map(b=>T.jsx("option",{value:b.id,children:b.name},b.id)),T.jsx("option",{value:"__new__",children:"+ New Room"})]})]}),T.jsx("div",{style:{padding:"8px 20px",borderBottom:"1px solid var(--border-subtle)"},children:T.jsx(Uq,{sessionId:n.sessionId,currentLabel:n.label||""})})]})}var Hq=pE(),z_={exports:{}},rE;function qq(){return rE||(rE=1,(function(n,e){(function(t,i){n.exports=i()})(globalThis,(()=>(()=>{var t={4567:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var L=S.length-1;L>=0;L--)(M=S[L])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=u(9042),m=u(9924),g=u(844),_=u(4725),w=u(2585),v=u(3656);let x=o.AccessibilityManager=class extends g.Disposable{constructor(S,b,C,O){super(),this._terminal=S,this._coreBrowserService=C,this._renderService=O,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let M=0;M<this._terminal.rows;M++)this._rowElements[M]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[M]);if(this._topBoundaryFocusListener=M=>this._handleBoundaryFocus(M,0),this._bottomBoundaryFocusListener=M=>this._handleBoundaryFocus(M,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((M=>this._handleResize(M.rows)))),this.register(this._terminal.onRender((M=>this._refreshRows(M.start,M.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((M=>this._handleChar(M)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
107
|
-
`)))),this.register(this._terminal.onA11yTab((M=>this._handleTab(M)))),this.register(this._terminal.onKey((M=>this._handleKey(M.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,g.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(S){for(let b=0;b<S;b++)this._handleChar(" ")}_handleChar(S){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==S&&(this._charsToAnnounce+=S):this._charsToAnnounce+=S,S===`
|
|
108
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(S){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(S)||this._charsToConsume.push(S)}_refreshRows(S,b){this._liveRegionDebouncer.refresh(S,b,this._terminal.rows)}_renderRows(S,b){const C=this._terminal.buffer,O=C.lines.length.toString();for(let M=S;M<=b;M++){const D=C.lines.get(C.ydisp+M),N=[],L=D?.translateToString(!0,void 0,void 0,N)||"",j=(C.ydisp+M+1).toString(),K=this._rowElements[M];K&&(L.length===0?(K.innerText=" ",this._rowColumns.set(K,[0,1])):(K.textContent=L,this._rowColumns.set(K,N)),K.setAttribute("aria-posinset",j),K.setAttribute("aria-setsize",O))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(S,b){const C=S.target,O=this._rowElements[b===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||S.relatedTarget!==O)return;let M,D;if(b===0?(M=C,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(M=this._rowElements.shift(),D=C,this._rowContainer.removeChild(M)),M.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),S.preventDefault(),S.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const S=document.getSelection();if(!S)return;if(S.isCollapsed)return void(this._rowContainer.contains(S.anchorNode)&&this._terminal.clearSelection());if(!S.anchorNode||!S.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:S.anchorNode,offset:S.anchorOffset},C={node:S.focusNode,offset:S.focusOffset};if((b.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===C.node&&b.offset>C.offset)&&([b,C]=[C,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const O=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(O)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:O,offset:O.textContent?.length??0}),!this._rowContainer.contains(C.node))return;const M=({node:L,offset:j})=>{const K=L instanceof Text?L.parentNode:L;let Y=parseInt(K?.getAttribute("aria-posinset"),10)-1;if(isNaN(Y))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(K);if(!H)return console.warn("columns is null. Race condition?"),null;let Q=j<H.length?H[j]:H.slice(-1)[0]+1;return Q>=this._terminal.cols&&(++Y,Q=0),{row:Y,column:Q}},D=M(b),N=M(C);if(D&&N){if(D.row>N.row||D.row===N.row&&D.column>=N.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(N.row-D.row)*this._terminal.cols-D.column+N.column)}}_handleResize(S){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>S;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const S=this._coreBrowserService.mainDocument.createElement("div");return S.setAttribute("role","listitem"),S.tabIndex=-1,this._refreshRowDimensions(S),S}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let S=0;S<this._terminal.rows;S++)this._refreshRowDimensions(this._rowElements[S])}}_refreshRowDimensions(S){S.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=x=h([p(1,w.IInstantiationService),p(2,_.ICoreBrowserService),p(3,_.IRenderService)],x)},3614:(l,o)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function h(m,g){return g?"\x1B[200~"+m+"\x1B[201~":m}function p(m,g,_,w){m=h(m=u(m),_.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),_.triggerDataEvent(m,!0),g.value=""}function f(m,g,_){const w=_.getBoundingClientRect(),v=m.clientX-w.left-10,x=m.clientY-w.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${x}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=u,o.bracketTextForPaste=h,o.copyHandler=function(m,g){m.clipboardData&&m.clipboardData.setData("text/plain",g.selectionText),m.preventDefault()},o.handlePasteEvent=function(m,g,_,w){m.stopPropagation(),m.clipboardData&&p(m.clipboardData.getData("text/plain"),g,_,w)},o.paste=p,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(m,g,_,w,v){f(m,g,_),v&&w.rightClickSelect(m),g.value=w.selectionText,g.select()}},7239:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=u(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,f,m){this._css.set(p,f,m)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,m){this._color.set(p,f,m)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(u,h,p,f){u.addEventListener(h,p,f);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(h,p,f))}}}},3551:function(l,o,u){var h=this&&this.__decorate||function(x,S,b,C){var O,M=arguments.length,D=M<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,S,b,C);else for(var N=x.length-1;N>=0;N--)(O=x[N])&&(D=(M<3?O(D):M>3?O(S,b,D):O(S,b))||D);return M>3&&D&&Object.defineProperty(S,b,D),D},p=this&&this.__param||function(x,S){return function(b,C){S(b,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=u(3656),m=u(8460),g=u(844),_=u(2585),w=u(4725);let v=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(x,S,b,C,O){super(),this._element=x,this._mouseService=S,this._renderService=b,this._bufferService=C,this._linkProviderService=O,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(x){this._lastMouseEvent=x;const S=this._positionFromMouseEvent(x,this._element,this._mouseService);if(!S)return;this._isMouseOut=!1;const b=x.composedPath();for(let C=0;C<b.length;C++){const O=b[C];if(O.classList.contains("xterm"))break;if(O.classList.contains("xterm-hover"))return}this._lastBufferCell&&S.x===this._lastBufferCell.x&&S.y===this._lastBufferCell.y||(this._handleHover(S),this._lastBufferCell=S)}_handleHover(x){if(this._activeLine!==x.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(x,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,x)||(this._clearCurrentLink(),this._askForLink(x,!0))}_askForLink(x,S){this._activeProviderReplies&&S||(this._activeProviderReplies?.forEach((C=>{C?.forEach((O=>{O.link.dispose&&O.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=x.y);let b=!1;for(const[C,O]of this._linkProviderService.linkProviders.entries())S?this._activeProviderReplies?.get(C)&&(b=this._checkLinkProviderResult(C,x,b)):O.provideLinks(x.y,(M=>{if(this._isMouseOut)return;const D=M?.map((N=>({link:N})));this._activeProviderReplies?.set(C,D),b=this._checkLinkProviderResult(C,x,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(x.y,this._activeProviderReplies)}))}_removeIntersectingLinks(x,S){const b=new Set;for(let C=0;C<S.size;C++){const O=S.get(C);if(O)for(let M=0;M<O.length;M++){const D=O[M],N=D.link.range.start.y<x?0:D.link.range.start.x,L=D.link.range.end.y>x?this._bufferService.cols:D.link.range.end.x;for(let j=N;j<=L;j++){if(b.has(j)){O.splice(M--,1);break}b.add(j)}}}}_checkLinkProviderResult(x,S,b){if(!this._activeProviderReplies)return b;const C=this._activeProviderReplies.get(x);let O=!1;for(let M=0;M<x;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(O=!0);if(!O&&C){const M=C.find((D=>this._linkAtPosition(D.link,S)));M&&(b=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let M=0;M<this._activeProviderReplies.size;M++){const D=this._activeProviderReplies.get(M)?.find((N=>this._linkAtPosition(N.link,S)));if(D){b=!0,this._handleNewLink(D);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(x){if(!this._currentLink)return;const S=this._positionFromMouseEvent(x,this._element,this._mouseService);S&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,S)&&this._currentLink.link.activate(x,this._currentLink.link.text)}_clearCurrentLink(x,S){this._currentLink&&this._lastMouseEvent&&(!x||!S||this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=S)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(x){if(!this._lastMouseEvent)return;const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._linkAtPosition(x.link,S)&&(this._currentLink=x,this._currentLink.state={decorations:{underline:x.link.decorations===void 0||x.link.decorations.underline,pointerCursor:x.link.decorations===void 0||x.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,x.link,this._lastMouseEvent),x.link.decorations={},Object.defineProperties(x.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(x.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const C=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,O=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=O&&(this._clearCurrentLink(C,O),this._lastMouseEvent)){const M=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);M&&this._askForLink(M,!1)}}))))}_linkHover(x,S,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!0),this._currentLink.state.decorations.pointerCursor&&x.classList.add("xterm-cursor-pointer")),S.hover&&S.hover(b,S.text)}_fireUnderlineEvent(x,S){const b=x.range,C=this._bufferService.buffer.ydisp,O=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-C-1,b.end.x,b.end.y-C-1,void 0);(S?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(O)}_linkLeave(x,S,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!1),this._currentLink.state.decorations.pointerCursor&&x.classList.remove("xterm-cursor-pointer")),S.leave&&S.leave(b,S.text)}_linkAtPosition(x,S){const b=x.range.start.y*this._bufferService.cols+x.range.start.x,C=x.range.end.y*this._bufferService.cols+x.range.end.x,O=S.y*this._bufferService.cols+S.x;return b<=O&&O<=C}_positionFromMouseEvent(x,S,b){const C=b.getCoords(x,S,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(x,S,b,C,O){return{x1:x,y1:S,x2:b,y2:C,cols:this._bufferService.cols,fg:O}}};o.Linkifier=v=h([p(1,w.IMouseService),p(2,w.IRenderService),p(3,_.IBufferService),p(4,w.ILinkProviderService)],v)},9042:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,o,u){var h=this&&this.__decorate||function(w,v,x,S){var b,C=arguments.length,O=C<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(w,v,x,S);else for(var M=w.length-1;M>=0;M--)(b=w[M])&&(O=(C<3?b(O):C>3?b(v,x,O):b(v,x))||O);return C>3&&O&&Object.defineProperty(v,x,O),O},p=this&&this.__param||function(w,v){return function(x,S){v(x,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=u(511),m=u(2585);let g=o.OscLinkProvider=class{constructor(w,v,x){this._bufferService=w,this._optionsService=v,this._oscLinkService=x}provideLinks(w,v){const x=this._bufferService.buffer.lines.get(w-1);if(!x)return void v(void 0);const S=[],b=this._optionsService.rawOptions.linkHandler,C=new f.CellData,O=x.getTrimmedLength();let M=-1,D=-1,N=!1;for(let L=0;L<O;L++)if(D!==-1||x.hasContent(L)){if(x.loadCell(L,C),C.hasExtendedAttrs()&&C.extended.urlId){if(D===-1){D=L,M=C.extended.urlId;continue}N=C.extended.urlId!==M}else D!==-1&&(N=!0);if(N||D!==-1&&L===O-1){const j=this._oscLinkService.getLinkData(M)?.uri;if(j){const K={start:{x:D+1,y:w},end:{x:L+(N||L!==O-1?0:1),y:w}};let Y=!1;if(!b?.allowNonHttpProtocols)try{const H=new URL(j);["http:","https:"].includes(H.protocol)||(Y=!0)}catch{Y=!0}Y||S.push({text:j,range:K,activate:(H,Q)=>b?b.activate(H,Q,K):_(0,Q),hover:(H,Q)=>b?.hover?.(H,Q,K),leave:(H,Q)=>b?.leave?.(H,Q,K)})}N=!1,C.hasExtendedAttrs()&&C.extended.urlId?(D=L,M=C.extended.urlId):(D=-1,M=-1)}}v(S)}};function _(w,v){if(confirm(`Do you want to navigate to ${v}?
|
|
109
|
-
|
|
110
|
-
WARNING: This link could potentially be dangerous`)){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=h([p(0,m.IBufferService),p(1,m.IOptionsService),p(2,m.IOscLinkService)],g)},6193:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,p){this._rowCount=p,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=u(3614),p=u(3656),f=u(3551),m=u(9042),g=u(3730),_=u(1680),w=u(3107),v=u(5744),x=u(2950),S=u(1296),b=u(428),C=u(4269),O=u(5114),M=u(8934),D=u(3230),N=u(9312),L=u(4725),j=u(6731),K=u(8055),Y=u(8969),H=u(8460),Q=u(844),te=u(6114),$=u(8437),J=u(2584),re=u(7399),F=u(5941),B=u(9074),U=u(2585),X=u(5435),V=u(4567),_e=u(779);class Ee extends Y.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ae={}){super(ae),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(U.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(_e.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((ee,Te)=>this.refresh(ee,Te)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((ee=>this._reportWindowsOptions(ee)))),this.register(this._inputHandler.onColor((ee=>this._handleColorEvent(ee)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((ee=>this._afterResize(ee.cols,ee.rows)))),this.register((0,Q.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(ae){if(this._themeService)for(const ee of ae){let Te,ye="";switch(ee.index){case 256:Te="foreground",ye="10";break;case 257:Te="background",ye="11";break;case 258:Te="cursor",ye="12";break;default:Te="ansi",ye="4;"+ee.index}switch(ee.type){case 0:const Me=K.color.toColorRGB(Te==="ansi"?this._themeService.colors.ansi[ee.index]:this._themeService.colors[Te]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${ye};${(0,F.toRgbString)(Me)}${J.C1_ESCAPED.ST}`);break;case 1:if(Te==="ansi")this._themeService.modifyColors((we=>we.ansi[ee.index]=K.channels.toColor(...ee.color)));else{const we=Te;this._themeService.modifyColors((it=>it[we]=K.channels.toColor(...ee.color)))}break;case 2:this._themeService.restoreColor(ee.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ae){ae?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ae){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ae=this.buffer.ybase+this.buffer.y,ee=this.buffer.lines.get(ae);if(!ee)return;const Te=Math.min(this.buffer.x,this.cols-1),ye=this._renderService.dimensions.css.cell.height,Me=ee.getWidth(Te),we=this._renderService.dimensions.css.cell.width*Me,it=this.buffer.y*this._renderService.dimensions.css.cell.height,De=Te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=De+"px",this.textarea.style.top=it+"px",this.textarea.style.width=we+"px",this.textarea.style.height=ye+"px",this.textarea.style.lineHeight=ye+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(ee=>{this.hasSelection()&&(0,h.copyHandler)(ee,this._selectionService)})));const ae=ee=>(0,h.handlePasteEvent)(ee,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",ae)),this.register((0,p.addDisposableDomListener)(this.element,"paste",ae)),te.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ee=>{ee.button===2&&(0,h.rightClickHandler)(ee,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(ee=>{(0,h.rightClickHandler)(ee,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(ee=>{ee.button===1&&(0,h.moveTextAreaUnderMouseCursor)(ee,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(ae=>this._keyUp(ae)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(ae=>this._keyDown(ae)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(ae=>this._keyPress(ae)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(ae=>this._compositionHelper.compositionupdate(ae)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(ae=>this._inputEvent(ae)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ae){if(!ae)throw new Error("Terminal requires a parent element.");if(ae.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ae.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ae.appendChild(this.element);const ee=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ee.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(Te=>this.updateCursorStyle(Te)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ee.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),te.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(O.CoreBrowserService,this.textarea,ae.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(Te=>this._handleTextAreaFocus(Te)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(j.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Te=>this._onRender.fire(Te)))),this.onResize((Te=>this._renderService.resize(Te.cols,Te.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(x.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(M.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(ee);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(_.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Te=>this.scrollLines(Te.amount,Te.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(N.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Te=>this.scrollLines(Te.amount,Te.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Te=>this._renderService.handleSelectionChanged(Te.start,Te.end,Te.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Te=>{this.textarea.value=Te,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Te=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(Te=>this._selectionService.handleMouseDown(Te)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Te=>this._handleScreenReaderModeOptionChange(Te)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Te=>{!this._overviewRulerRenderer&&Te&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(S.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ae=this,ee=this.element;function Te(we){const it=ae._mouseService.getMouseReportCoords(we,ae.screenElement);if(!it)return!1;let De,Pe;switch(we.overrideType||we.type){case"mousemove":Pe=32,we.buttons===void 0?(De=3,we.button!==void 0&&(De=we.button<3?we.button:3)):De=1&we.buttons?0:4&we.buttons?1:2&we.buttons?2:3;break;case"mouseup":Pe=0,De=we.button<3?we.button:3;break;case"mousedown":Pe=1,De=we.button<3?we.button:3;break;case"wheel":if(ae._customWheelEventHandler&&ae._customWheelEventHandler(we)===!1||ae.viewport.getLinesScrolled(we)===0)return!1;Pe=we.deltaY<0?0:1,De=4;break;default:return!1}return!(Pe===void 0||De===void 0||De>4)&&ae.coreMouseService.triggerMouseEvent({col:it.col,row:it.row,x:it.x,y:it.y,button:De,action:Pe,ctrl:we.ctrlKey,alt:we.altKey,shift:we.shiftKey})}const ye={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Me={mouseup:we=>(Te(we),we.buttons||(this._document.removeEventListener("mouseup",ye.mouseup),ye.mousedrag&&this._document.removeEventListener("mousemove",ye.mousedrag)),this.cancel(we)),wheel:we=>(Te(we),this.cancel(we,!0)),mousedrag:we=>{we.buttons&&Te(we)},mousemove:we=>{we.buttons||Te(we)}};this.register(this.coreMouseService.onProtocolChange((we=>{we?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(we)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&we?ye.mousemove||(ee.addEventListener("mousemove",Me.mousemove),ye.mousemove=Me.mousemove):(ee.removeEventListener("mousemove",ye.mousemove),ye.mousemove=null),16&we?ye.wheel||(ee.addEventListener("wheel",Me.wheel,{passive:!1}),ye.wheel=Me.wheel):(ee.removeEventListener("wheel",ye.wheel),ye.wheel=null),2&we?ye.mouseup||(ye.mouseup=Me.mouseup):(this._document.removeEventListener("mouseup",ye.mouseup),ye.mouseup=null),4&we?ye.mousedrag||(ye.mousedrag=Me.mousedrag):(this._document.removeEventListener("mousemove",ye.mousedrag),ye.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(ee,"mousedown",(we=>{if(we.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(we))return Te(we),ye.mouseup&&this._document.addEventListener("mouseup",ye.mouseup),ye.mousedrag&&this._document.addEventListener("mousemove",ye.mousedrag),this.cancel(we)}))),this.register((0,p.addDisposableDomListener)(ee,"wheel",(we=>{if(!ye.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(we)===!1)return!1;if(!this.buffer.hasScrollback){const it=this.viewport.getLinesScrolled(we);if(it===0)return;const De=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(we.deltaY<0?"A":"B");let Pe="";for(let Fe=0;Fe<Math.abs(it);Fe++)Pe+=De;return this.coreService.triggerDataEvent(Pe,!0),this.cancel(we,!0)}return this.viewport.handleWheel(we)?this.cancel(we):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(ee,"touchstart",(we=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(we),this.cancel(we)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(ee,"touchmove",(we=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(we)?void 0:this.cancel(we)}),{passive:!1}))}refresh(ae,ee){this._renderService?.refreshRows(ae,ee)}updateCursorStyle(ae){this._selectionService?.shouldColumnSelect(ae)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ae,ee,Te=0){Te===1?(super.scrollLines(ae,ee,Te),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(ae)}paste(ae){(0,h.paste)(ae,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ae){this._customKeyEventHandler=ae}attachCustomWheelEventHandler(ae){this._customWheelEventHandler=ae}registerLinkProvider(ae){return this._linkProviderService.registerLinkProvider(ae)}registerCharacterJoiner(ae){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const ee=this._characterJoinerService.register(ae);return this.refresh(0,this.rows-1),ee}deregisterCharacterJoiner(ae){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ae)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ae){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ae)}registerDecoration(ae){return this._decorationService.registerDecoration(ae)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ae,ee,Te){this._selectionService.setSelection(ae,ee,Te)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(ae,ee){this._selectionService?.selectLines(ae,ee)}_keyDown(ae){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ae)===!1)return!1;const ee=this.browser.isMac&&this.options.macOptionIsMeta&&ae.altKey;if(!ee&&!this._compositionHelper.keydown(ae))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;ee||ae.key!=="Dead"&&ae.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Te=(0,re.evaluateKeyboardEvent)(ae,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ae),Te.type===3||Te.type===2){const ye=this.rows-1;return this.scrollLines(Te.type===2?-ye:ye),this.cancel(ae,!0)}return Te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ae)||(Te.cancel&&this.cancel(ae,!0),!Te.key||!!(ae.key&&!ae.ctrlKey&&!ae.altKey&&!ae.metaKey&&ae.key.length===1&&ae.key.charCodeAt(0)>=65&&ae.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Te.key!==J.C0.ETX&&Te.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Te.key,domEvent:ae}),this._showCursor(),this.coreService.triggerDataEvent(Te.key,!0),!this.optionsService.rawOptions.screenReaderMode||ae.altKey||ae.ctrlKey?this.cancel(ae,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ae,ee){const Te=ae.isMac&&!this.options.macOptionIsMeta&&ee.altKey&&!ee.ctrlKey&&!ee.metaKey||ae.isWindows&&ee.altKey&&ee.ctrlKey&&!ee.metaKey||ae.isWindows&&ee.getModifierState("AltGraph");return ee.type==="keypress"?Te:Te&&(!ee.keyCode||ee.keyCode>47)}_keyUp(ae){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ae)===!1||((function(ee){return ee.keyCode===16||ee.keyCode===17||ee.keyCode===18})(ae)||this.focus(),this.updateCursorStyle(ae),this._keyPressHandled=!1)}_keyPress(ae){let ee;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ae)===!1)return!1;if(this.cancel(ae),ae.charCode)ee=ae.charCode;else if(ae.which===null||ae.which===void 0)ee=ae.keyCode;else{if(ae.which===0||ae.charCode===0)return!1;ee=ae.which}return!(!ee||(ae.altKey||ae.ctrlKey||ae.metaKey)&&!this._isThirdLevelShift(this.browser,ae)||(ee=String.fromCharCode(ee),this._onKey.fire({key:ee,domEvent:ae}),this._showCursor(),this.coreService.triggerDataEvent(ee,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ae){if(ae.data&&ae.inputType==="insertText"&&(!ae.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const ee=ae.data;return this.coreService.triggerDataEvent(ee,!0),this.cancel(ae),!0}return!1}resize(ae,ee){ae!==this.cols||ee!==this.rows?super.resize(ae,ee):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ae,ee){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let ae=1;ae<this.rows;ae++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const ae=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=ae,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(ae){if(this._renderService)switch(ae){case X.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const ee=this._renderService.dimensions.css.canvas.width.toFixed(0),Te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${Te};${ee}t`);break;case X.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ye=this._renderService.dimensions.css.cell.width.toFixed(0),Me=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${Me};${ye}t`)}}cancel(ae,ee){if(this.options.cancelEvents||ee)return ae.preventDefault(),ae.stopPropagation(),!1}}o.Terminal=Ee},9924:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,p){this._rowCount=p,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=f-this._lastRefreshMs,g=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(l,o,u){var h=this&&this.__decorate||function(x,S,b,C){var O,M=arguments.length,D=M<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,S,b,C);else for(var N=x.length-1;N>=0;N--)(O=x[N])&&(D=(M<3?O(D):M>3?O(S,b,D):O(S,b))||D);return M>3&&D&&Object.defineProperty(S,b,D),D},p=this&&this.__param||function(x,S){return function(b,C){S(b,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=u(3656),m=u(4725),g=u(8460),_=u(844),w=u(2585);let v=o.Viewport=class extends _.Disposable{constructor(x,S,b,C,O,M,D,N){super(),this._viewportElement=x,this._scrollArea=S,this._bufferService=b,this._optionsService=C,this._charSizeService=O,this._renderService=M,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(N.colors),this.register(N.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(x){this._viewportElement.style.backgroundColor=x.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(x){if(x)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const S=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==S&&(this._lastRecordedBufferHeight=S,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const x=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==x&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=x),this._refreshAnimationFrame=null}syncScrollArea(x=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(x);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(x)}_handleScroll(x){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const S=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const x=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(x*(this._smoothScrollState.target-this._smoothScrollState.origin)),x<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(x,S){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(S<0&&this._viewportElement.scrollTop!==0||S>0&&b<this._lastRecordedBufferHeight)||(x.cancelable&&x.preventDefault(),!1)}handleWheel(x){const S=this._getPixelsScrolled(x);return S!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+S:this._smoothScrollState.target+=S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=S,this._bubbleScroll(x,S))}scrollLines(x){if(x!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const S=x*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!1})}_getPixelsScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let S=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_LINE?S*=this._currentRowHeight:x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._currentRowHeight*this._bufferService.rows),S}getBufferElements(x,S){let b,C="";const O=[],M=S??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let N=x;N<M;N++){const L=D.get(N);if(!L)continue;const j=D.get(N+1)?.isWrapped;if(C+=L.translateToString(!j),!j||N===D.length-1){const K=document.createElement("div");K.textContent=C,O.push(K),C.length>0&&(b=K),C=""}}return{bufferElements:O,cursorElement:b}}getLinesScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let S=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(S/=this._currentRowHeight+0,this._wheelPartialScroll+=S,S=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._bufferService.rows),S}_applyScrollModifier(x,S){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&S.altKey||b==="ctrl"&&S.ctrlKey||b==="shift"&&S.shiftKey?x*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:x*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(x){this._lastTouchY=x.touches[0].pageY}handleTouchMove(x){const S=this._lastTouchY-x.touches[0].pageY;return this._lastTouchY=x.touches[0].pageY,S!==0&&(this._viewportElement.scrollTop+=S,this._bubbleScroll(x,S))}};o.Viewport=v=h([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,m.ICharSizeService),p(5,m.IRenderService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],v)},3107:function(l,o,u){var h=this&&this.__decorate||function(w,v,x,S){var b,C=arguments.length,O=C<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(w,v,x,S);else for(var M=w.length-1;M>=0;M--)(b=w[M])&&(O=(C<3?b(O):C>3?b(v,x,O):b(v,x))||O);return C>3&&O&&Object.defineProperty(v,x,O),O},p=this&&this.__param||function(w,v){return function(x,S){v(x,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=u(4725),m=u(844),g=u(2585);let _=o.BufferDecorationRenderer=class extends m.Disposable{constructor(w,v,x,S,b){super(),this._screenElement=w,this._bufferService=v,this._coreBrowserService=x,this._decorationService=S,this._renderService=b,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,m.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),v.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const x=w.options.x??0;return x&&x>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(w,v),v}_refreshStyle(w){const v=w.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let x=this._decorationElements.get(w);x||(x=this._createElement(w),w.element=x,this._decorationElements.set(w,x),this._container.appendChild(x),w.onDispose((()=>{this._decorationElements.delete(w),x.remove()}))),x.style.top=v*this._renderService.dimensions.css.cell.height+"px",x.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(x)}}_refreshXPosition(w,v=w.element){if(!v)return;const x=w.options.x??0;(w.options.anchor||"left")==="right"?v.style.right=x?x*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=x?x*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=_=h([p(1,g.IBufferService),p(2,f.ICoreBrowserService),p(3,g.IDecorationService),p(4,f.IRenderService)],_)},5871:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,p){return h>=u.startBufferLine-this._linePadding[p||"full"]&&h<=u.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(l,o,u){var h=this&&this.__decorate||function(b,C,O,M){var D,N=arguments.length,L=N<3?C:M===null?M=Object.getOwnPropertyDescriptor(C,O):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,C,O,M);else for(var j=b.length-1;j>=0;j--)(D=b[j])&&(L=(N<3?D(L):N>3?D(C,O,L):D(C,O))||L);return N>3&&L&&Object.defineProperty(C,O,L),L},p=this&&this.__param||function(b,C){return function(O,M){C(O,M,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=u(5871),m=u(4725),g=u(844),_=u(2585),w={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0};let S=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,C,O,M,D,N,L){super(),this._viewportElement=b,this._screenElement=C,this._bufferService=O,this._decorationService=M,this._renderService=D,this._optionsService=N,this._coreBrowserService=L,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const j=this._canvas.getContext("2d");if(!j)throw new Error("Ctx cannot be null");this._ctx=j,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=b,v.center=C,v.right=b,this._refreshDrawHeightConstants(),x.full=0,x.left=0,x.center=v.left,x.right=v.left+v.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);w.left=C,w.center=C,w.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const C of b)C.position!=="full"&&this._renderColorZone(C);for(const C of b)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(x[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),v[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,C){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=S=h([p(2,_.IBufferService),p(3,_.IDecorationService),p(4,m.IRenderService),p(5,_.IOptionsService),p(6,m.ICoreBrowserService)],S)},2950:function(l,o,u){var h=this&&this.__decorate||function(w,v,x,S){var b,C=arguments.length,O=C<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(w,v,x,S);else for(var M=w.length-1;M>=0;M--)(b=w[M])&&(O=(C<3?b(O):C>3?b(v,x,O):b(v,x))||O);return C>3&&O&&Object.defineProperty(v,x,O),O},p=this&&this.__param||function(w,v){return function(x,S){v(x,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=u(4725),m=u(2585),g=u(2584);let _=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,v,x,S,b,C){this._textarea=w,this._compositionView=v,this._bufferService=x,this._optionsService=S,this._coreService=b,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let x;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,x=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),x.length>0&&this._coreService.triggerDataEvent(x,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,x=v.replace(w,"");this._dataAlreadySent=x,v.length>w.length?this._coreService.triggerDataEvent(x,!0):v.length<w.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):v.length===w.length&&v!==w&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),x=this._renderService.dimensions.css.cell.height,S=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=S+"px",this._compositionView.style.height=x+"px",this._compositionView.style.lineHeight=x+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const C=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=S+"px",this._textarea.style.width=Math.max(C.width,1)+"px",this._textarea.style.height=Math.max(C.height,1)+"px",this._textarea.style.lineHeight=C.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=_=h([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,m.ICoreService),p(5,f.IRenderService)],_)},9806:(l,o)=>{function u(h,p,f){const m=f.getBoundingClientRect(),g=h.getComputedStyle(f),_=parseInt(g.getPropertyValue("padding-left")),w=parseInt(g.getPropertyValue("padding-top"));return[p.clientX-m.left-_,p.clientY-m.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=u,o.getCoords=function(h,p,f,m,g,_,w,v,x){if(!_)return;const S=u(h,p,f);return S?(S[0]=Math.ceil((S[0]+(x?w/2:0))/w),S[1]=Math.ceil(S[1]/v),S[0]=Math.min(Math.max(S[0],1),m+(x?1:0)),S[1]=Math.min(Math.max(S[1],1),g),S):void 0}},9504:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=u(2584);function p(v,x,S,b){const C=v-f(v,S),O=x-f(x,S),M=Math.abs(C-O)-(function(D,N,L){let j=0;const K=D-f(D,L),Y=N-f(N,L);for(let H=0;H<Math.abs(K-Y);H++){const Q=m(D,N)==="A"?-1:1;L.buffer.lines.get(K+Q*H)?.isWrapped&&j++}return j})(v,x,S);return w(M,_(m(v,x),b))}function f(v,x){let S=0,b=x.buffer.lines.get(v),C=b?.isWrapped;for(;C&&v>=0&&v<x.rows;)S++,b=x.buffer.lines.get(--v),C=b?.isWrapped;return S}function m(v,x){return v>x?"A":"B"}function g(v,x,S,b,C,O){let M=v,D=x,N="";for(;M!==S||D!==b;)M+=C?1:-1,C&&M>O.cols-1?(N+=O.buffer.translateBufferLineToString(D,!1,v,M),M=0,v=0,D++):!C&&M<0&&(N+=O.buffer.translateBufferLineToString(D,!1,0,v+1),M=O.cols-1,v=M,D--);return N+O.buffer.translateBufferLineToString(D,!1,v,M)}function _(v,x){const S=x?"O":"[";return h.C0.ESC+S+v}function w(v,x){v=Math.floor(v);let S="";for(let b=0;b<v;b++)S+=x;return S}o.moveToCellSequence=function(v,x,S,b){const C=S.buffer.x,O=S.buffer.y;if(!S.buffer.hasScrollback)return(function(N,L,j,K,Y,H){return p(L,K,Y,H).length===0?"":w(g(N,L,N,L-f(L,Y),!1,Y).length,_("D",H))})(C,O,0,x,S,b)+p(O,x,S,b)+(function(N,L,j,K,Y,H){let Q;Q=p(L,K,Y,H).length>0?K-f(K,Y):L;const te=K,$=(function(J,re,F,B,U,X){let V;return V=p(F,B,U,X).length>0?B-f(B,U):re,J<F&&V<=B||J>=F&&V<B?"C":"D"})(N,L,j,K,Y,H);return w(g(N,Q,j,te,$==="C",Y).length,_($,H))})(C,O,v,x,S,b);let M;if(O===x)return M=C>v?"D":"C",w(Math.abs(C-v),_(M,b));M=O>x?"D":"C";const D=Math.abs(O-x);return w((function(N,L){return L.cols-N})(O>x?v:C,S)+(D-1)*S.cols+1+((O>x?C:v)-1),_(M,b))}},1296:function(l,o,u){var h=this&&this.__decorate||function(H,Q,te,$){var J,re=arguments.length,F=re<3?Q:$===null?$=Object.getOwnPropertyDescriptor(Q,te):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(H,Q,te,$);else for(var B=H.length-1;B>=0;B--)(J=H[B])&&(F=(re<3?J(F):re>3?J(Q,te,F):J(Q,te))||F);return re>3&&F&&Object.defineProperty(Q,te,F),F},p=this&&this.__param||function(H,Q){return function(te,$){Q(te,$,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=u(3787),m=u(2550),g=u(2223),_=u(6171),w=u(6052),v=u(4725),x=u(8055),S=u(8460),b=u(844),C=u(2585),O="xterm-dom-renderer-owner-",M="xterm-rows",D="xterm-fg-",N="xterm-bg-",L="xterm-focus",j="xterm-selection";let K=1,Y=o.DomRenderer=class extends b.Disposable{constructor(H,Q,te,$,J,re,F,B,U,X,V,_e,Ee){super(),this._terminal=H,this._document=Q,this._element=te,this._screenElement=$,this._viewportElement=J,this._helperContainer=re,this._linkifier2=F,this._charSizeService=U,this._optionsService=X,this._bufferService=V,this._coreBrowserService=_e,this._themeService=Ee,this._terminalClass=K++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new S.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(M),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,_.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Ie=>this._injectCss(Ie)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(O+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Ie=>this._handleLinkHover(Ie)))),this.register(this._linkifier2.onHideLinkUnderline((Ie=>this._handleLinkLeave(Ie)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(O+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${M} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${M} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${M} .xterm-dim { color: ${x.color.multiplyOpacity(H.foreground,.5).css};}`,Q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const te=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${$} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${J} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,Q+=`${this._terminalSelector} .${M}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${M}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${M}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[re,F]of H.ansi.entries())Q+=`${this._terminalSelector} .${D}${re} { color: ${F.css}; }${this._terminalSelector} .${D}${re}.xterm-dim { color: ${x.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${N}${re} { background-color: ${F.css}; }`;Q+=`${this._terminalSelector} .${D}${g.INVERTED_DEFAULT_COLOR} { color: ${x.color.opaque(H.background).css}; }${this._terminalSelector} .${D}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${x.color.multiplyOpacity(x.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${N}${g.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,Q){for(let te=this._rowElements.length;te<=Q;te++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,Q){this._refreshRowElements(H,Q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,Q,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,Q,te),this.renderRows(0,this._bufferService.rows-1),!H||!Q)return;this._selectionRenderModel.update(this._terminal,H,Q,te);const $=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,re=this._selectionRenderModel.viewportCappedStartRow,F=this._selectionRenderModel.viewportCappedEndRow;if(re>=this._bufferService.rows||F<0)return;const B=this._document.createDocumentFragment();if(te){const U=H[0]>Q[0];B.appendChild(this._createSelectionElement(re,U?Q[0]:H[0],U?H[0]:Q[0],F-re+1))}else{const U=$===re?H[0]:0,X=re===J?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(re,U,X));const V=F-re-1;if(B.appendChild(this._createSelectionElement(re+1,0,this._bufferService.cols,V)),re!==F){const _e=J===F?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(F,0,_e))}}this._selectionContainer.appendChild(B)}_createSelectionElement(H,Q,te,$=1){const J=this._document.createElement("div"),re=Q*this.dimensions.css.cell.width;let F=this.dimensions.css.cell.width*(te-Q);return re+F>this.dimensions.css.canvas.width&&(F=this.dimensions.css.canvas.width-re),J.style.height=$*this.dimensions.css.cell.height+"px",J.style.top=H*this.dimensions.css.cell.height+"px",J.style.left=`${re}px`,J.style.width=`${F}px`,J}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,Q){const te=this._bufferService.buffer,$=te.ybase+te.y,J=Math.min(te.x,this._bufferService.cols-1),re=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let U=H;U<=Q;U++){const X=U+te.ydisp,V=this._rowElements[U],_e=te.lines.get(X);if(!V||!_e)break;V.replaceChildren(...this._rowFactory.createRow(_e,X,X===$,F,B,J,re,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${O}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,Q,te,$,J,re){te<0&&(H=0),$<0&&(Q=0);const F=this._bufferService.rows-1;te=Math.max(Math.min(te,F),0),$=Math.max(Math.min($,F),0),J=Math.min(J,this._bufferService.cols);const B=this._bufferService.buffer,U=B.ybase+B.y,X=Math.min(B.x,J-1),V=this._optionsService.rawOptions.cursorBlink,_e=this._optionsService.rawOptions.cursorStyle,Ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let Ie=te;Ie<=$;++Ie){const ae=Ie+B.ydisp,ee=this._rowElements[Ie],Te=B.lines.get(ae);if(!ee||!Te)break;ee.replaceChildren(...this._rowFactory.createRow(Te,ae,ae===U,_e,Ee,X,V,this.dimensions.css.cell.width,this._widthCache,re?Ie===te?H:0:-1,re?(Ie===$?Q:J)-1:-1))}}};o.DomRenderer=Y=h([p(7,C.IInstantiationService),p(8,v.ICharSizeService),p(9,C.IOptionsService),p(10,C.IBufferService),p(11,v.ICoreBrowserService),p(12,v.IThemeService)],Y)},3787:function(l,o,u){var h=this&&this.__decorate||function(M,D,N,L){var j,K=arguments.length,Y=K<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,N):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(M,D,N,L);else for(var H=M.length-1;H>=0;H--)(j=M[H])&&(Y=(K<3?j(Y):K>3?j(D,N,Y):j(D,N))||Y);return K>3&&Y&&Object.defineProperty(D,N,Y),Y},p=this&&this.__param||function(M,D){return function(N,L){D(N,L,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=u(2223),m=u(643),g=u(511),_=u(2585),w=u(8055),v=u(4725),x=u(4269),S=u(6171),b=u(3734);let C=o.DomRendererRowFactory=class{constructor(M,D,N,L,j,K,Y){this._document=M,this._characterJoinerService=D,this._optionsService=N,this._coreBrowserService=L,this._coreService=j,this._decorationService=K,this._themeService=Y,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(M,D,N){this._selectionStart=M,this._selectionEnd=D,this._columnSelectMode=N}createRow(M,D,N,L,j,K,Y,H,Q,te,$){const J=[],re=this._characterJoinerService.getJoinedCharacters(D),F=this._themeService.colors;let B,U=M.getNoBgTrimmedLength();N&&U<K+1&&(U=K+1);let X=0,V="",_e=0,Ee=0,Ie=0,ae=!1,ee=0,Te=!1,ye=0;const Me=[],we=te!==-1&&$!==-1;for(let it=0;it<U;it++){M.loadCell(it,this._workCell);let De=this._workCell.getWidth();if(De===0)continue;let Pe=!1,Fe=it,je=this._workCell;if(re.length>0&&it===re[0][0]){Pe=!0;const Ft=re.shift();je=new x.JoinedCellData(this._workCell,M.translateToString(!0,Ft[0],Ft[1]),Ft[1]-Ft[0]),Fe=Ft[1]-1,De=je.getWidth()}const st=this._isCellInSelection(it,D),Rt=N&&it===K,bt=we&&it>=te&&it<=$;let Lt=!1;this._decorationService.forEachDecorationAtCell(it,D,void 0,(Ft=>{Lt=!0}));let sn=je.getChars()||m.WHITESPACE_CELL_CHAR;if(sn===" "&&(je.isUnderline()||je.isOverline())&&(sn=" "),ye=De*H-Q.get(sn,je.isBold(),je.isItalic()),B){if(X&&(st&&Te||!st&&!Te&&je.bg===_e)&&(st&&Te&&F.selectionForeground||je.fg===Ee)&&je.extended.ext===Ie&&bt===ae&&ye===ee&&!Rt&&!Pe&&!Lt){je.isInvisible()?V+=m.WHITESPACE_CELL_CHAR:V+=sn,X++;continue}X&&(B.textContent=V),B=this._document.createElement("span"),X=0,V=""}else B=this._document.createElement("span");if(_e=je.bg,Ee=je.fg,Ie=je.extended.ext,ae=bt,ee=ye,Te=st,Pe&&K>=it&&K<=Fe&&(K=it),!this._coreService.isCursorHidden&&Rt&&this._coreService.isCursorInitialized){if(Me.push("xterm-cursor"),this._coreBrowserService.isFocused)Y&&Me.push("xterm-cursor-blink"),Me.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(j)switch(j){case"outline":Me.push("xterm-cursor-outline");break;case"block":Me.push("xterm-cursor-block");break;case"bar":Me.push("xterm-cursor-bar");break;case"underline":Me.push("xterm-cursor-underline")}}if(je.isBold()&&Me.push("xterm-bold"),je.isItalic()&&Me.push("xterm-italic"),je.isDim()&&Me.push("xterm-dim"),V=je.isInvisible()?m.WHITESPACE_CELL_CHAR:je.getChars()||m.WHITESPACE_CELL_CHAR,je.isUnderline()&&(Me.push(`xterm-underline-${je.extended.underlineStyle}`),V===" "&&(V=" "),!je.isUnderlineColorDefault()))if(je.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(je.getUnderlineColor()).join(",")})`;else{let Ft=je.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&je.isBold()&&Ft<8&&(Ft+=8),B.style.textDecorationColor=F.ansi[Ft].css}je.isOverline()&&(Me.push("xterm-overline"),V===" "&&(V=" ")),je.isStrikethrough()&&Me.push("xterm-strikethrough"),bt&&(B.style.textDecoration="underline");let jt=je.getFgColor(),Pt=je.getFgColorMode(),Cn=je.getBgColor(),Ce=je.getBgColorMode();const qe=!!je.isInverse();if(qe){const Ft=jt;jt=Cn,Cn=Ft;const Pn=Pt;Pt=Ce,Ce=Pn}let ft,Ct,Bt,Nn=!1;switch(this._decorationService.forEachDecorationAtCell(it,D,void 0,(Ft=>{Ft.options.layer!=="top"&&Nn||(Ft.backgroundColorRGB&&(Ce=50331648,Cn=Ft.backgroundColorRGB.rgba>>8&16777215,ft=Ft.backgroundColorRGB),Ft.foregroundColorRGB&&(Pt=50331648,jt=Ft.foregroundColorRGB.rgba>>8&16777215,Ct=Ft.foregroundColorRGB),Nn=Ft.options.layer==="top")})),!Nn&&st&&(ft=this._coreBrowserService.isFocused?F.selectionBackgroundOpaque:F.selectionInactiveBackgroundOpaque,Cn=ft.rgba>>8&16777215,Ce=50331648,Nn=!0,F.selectionForeground&&(Pt=50331648,jt=F.selectionForeground.rgba>>8&16777215,Ct=F.selectionForeground)),Nn&&Me.push("xterm-decoration-top"),Ce){case 16777216:case 33554432:Bt=F.ansi[Cn],Me.push(`xterm-bg-${Cn}`);break;case 50331648:Bt=w.channels.toColor(Cn>>16,Cn>>8&255,255&Cn),this._addStyle(B,`background-color:#${O((Cn>>>0).toString(16),"0",6)}`);break;default:qe?(Bt=F.foreground,Me.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Bt=F.background}switch(ft||je.isDim()&&(ft=w.color.multiplyOpacity(Bt,.5)),Pt){case 16777216:case 33554432:je.isBold()&&jt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(jt+=8),this._applyMinimumContrast(B,Bt,F.ansi[jt],je,ft,void 0)||Me.push(`xterm-fg-${jt}`);break;case 50331648:const Ft=w.channels.toColor(jt>>16&255,jt>>8&255,255&jt);this._applyMinimumContrast(B,Bt,Ft,je,ft,Ct)||this._addStyle(B,`color:#${O(jt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Bt,F.foreground,je,ft,Ct)||qe&&Me.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Me.length&&(B.className=Me.join(" "),Me.length=0),Rt||Pe||Lt?B.textContent=V:X++,ye!==this.defaultSpacing&&(B.style.letterSpacing=`${ye}px`),J.push(B),it=Fe}return B&&X&&(B.textContent=V),J}_applyMinimumContrast(M,D,N,L,j,K){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,S.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const Y=this._getContrastCache(L);let H;if(j||K||(H=Y.getColor(D.rgba,N.rgba)),H===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);H=w.color.ensureContrastRatio(j||D,K||N,Q),Y.setColor((j||D).rgba,(K||N).rgba,H??null)}return!!H&&(this._addStyle(M,`color:${H.css}`),!0)}_getContrastCache(M){return M.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(M,D){M.setAttribute("style",`${M.getAttribute("style")||""}${D};`)}_isCellInSelection(M,D){const N=this._selectionStart,L=this._selectionEnd;return!(!N||!L)&&(this._columnSelectMode?N[0]<=L[0]?M>=N[0]&&D>=N[1]&&M<L[0]&&D<=L[1]:M<N[0]&&D>=N[1]&&M>=L[0]&&D<=L[1]:D>N[1]&&D<L[1]||N[1]===L[1]&&D===N[1]&&M>=N[0]&&M<L[0]||N[1]<L[1]&&D===L[1]&&M<L[0]||N[1]<L[1]&&D===N[1]&&M>=N[0])}};function O(M,D,N){for(;M.length<N;)M=D+M;return M}o.DomRendererRowFactory=C=h([p(1,v.ICharacterJoinerService),p(2,_.IOptionsService),p(3,v.ICoreBrowserService),p(4,_.ICoreService),p(5,_.IDecorationService),p(6,v.IThemeService)],C)},2550:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=u.createElement("span");p.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[p,f,m,g],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(m),this._container.appendChild(g),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,h,p,f){u===this._font&&h===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=p,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,p){let f=0;if(!h&&!p&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const _=this._measure(u,0);return _>0&&(this._flat[f]=_),_}let m=u;h&&(m+="B"),p&&(m+="I");let g=this._holey.get(m);if(g===void 0){let _=0;h&&(_|=1),p&&(_|=2),g=this._measure(u,_),g>0&&this._holey.set(m,g)}return g}_measure(u,h){const p=this._measureElements[h];return p.textContent=u.repeat(32),p.offsetWidth/32}}},2223:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(l,o)=>{function u(p){return 57508<=p&&p<=57558}function h(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=u,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=h,o.allowRescaling=function(p,f,m,g){return f===1&&m>Math.ceil(1.5*g)&&p!==void 0&&p>255&&!h(p)&&!u(p)&&!(function(_){return 57344<=_&&_<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return u(p)||(function(f){return 9472<=f&&f<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,f,m=0){return(p-(2*Math.round(f)-m))%(2*Math.round(f))}},6052:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,f,m,g=!1){if(this.selectionStart=f,this.selectionEnd=m,!f||!m||f[0]===m[0]&&f[1]===m[1])return void this.clear();const _=p.buffers.active.ydisp,w=f[1]-_,v=m[1]-_,x=Math.max(w,0),S=Math.min(v,p.rows-1);x>=p.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=w,this.viewportEndRow=v,this.viewportCappedStartRow=x,this.viewportCappedEndRow=S,this.startCol=f[0],this.endCol=m[0])}isCellSelected(p,f,m){return!!this.hasSelection&&(m-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&m>=this.viewportCappedStartRow&&f<this.endCol&&m<=this.viewportCappedEndRow:f<this.startCol&&m>=this.viewportCappedStartRow&&f>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new u}},456:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var L=S.length-1;L>=0;L--)(M=S[L])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=u(2585),m=u(8460),g=u(844);let _=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(S,b,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new x(this._optionsService))}catch{this._measureStrategy=this.register(new v(S,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const S=this._measureStrategy.measure();S.width===this.width&&S.height===this.height||(this.width=S.width,this.height=S.height,this._onCharSizeChange.fire())}};o.CharSizeService=_=h([p(2,f.IOptionsService)],_);class w extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,C){b!==void 0&&b>0&&C!==void 0&&C>0&&(this._result.width=b,this._result.height=C)}}class v extends w{constructor(b,C,O){super(),this._document=b,this._parentElement=C,this._optionsService=O,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class x extends w{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(l,o,u){var h=this&&this.__decorate||function(x,S,b,C){var O,M=arguments.length,D=M<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,S,b,C);else for(var N=x.length-1;N>=0;N--)(O=x[N])&&(D=(M<3?O(D):M>3?O(S,b,D):O(S,b))||D);return M>3&&D&&Object.defineProperty(S,b,D),D},p=this&&this.__param||function(x,S){return function(b,C){S(b,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=u(3734),m=u(643),g=u(511),_=u(2585);class w extends f.AttributeData{constructor(S,b,C){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=b,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(S){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=w;let v=o.CharacterJoinerService=class ak{constructor(S){this._bufferService=S,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(S){const b={id:this._nextCharacterJoinerId++,handler:S};return this._characterJoiners.push(b),b.id}deregister(S){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===S)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(S){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(S);if(!b||b.length===0)return[];const C=[],O=b.translateToString(!0);let M=0,D=0,N=0,L=b.getFg(0),j=b.getBg(0);for(let K=0;K<b.getTrimmedLength();K++)if(b.loadCell(K,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==j){if(K-M>1){const Y=this._getJoinedRanges(O,N,D,b,M);for(let H=0;H<Y.length;H++)C.push(Y[H])}M=K,N=D,L=this._workCell.fg,j=this._workCell.bg}D+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-M>1){const K=this._getJoinedRanges(O,N,D,b,M);for(let Y=0;Y<K.length;Y++)C.push(K[Y])}return C}_getJoinedRanges(S,b,C,O,M){const D=S.substring(b,C);let N=[];try{N=this._characterJoiners[0].handler(D)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const j=this._characterJoiners[L].handler(D);for(let K=0;K<j.length;K++)ak._mergeRanges(N,j[K])}catch(j){console.error(j)}return this._stringRangesToCellRanges(N,O,M),N}_stringRangesToCellRanges(S,b,C){let O=0,M=!1,D=0,N=S[O];if(N){for(let L=C;L<this._bufferService.cols;L++){const j=b.getWidth(L),K=b.getString(L).length||m.WHITESPACE_CELL_CHAR.length;if(j!==0){if(!M&&N[0]<=D&&(N[0]=L,M=!0),N[1]<=D){if(N[1]=L,N=S[++O],!N)break;N[0]<=D?(N[0]=L,M=!0):M=!1}D+=K}}N&&(N[1]=this._bufferService.cols)}}static _mergeRanges(S,b){let C=!1;for(let O=0;O<S.length;O++){const M=S[O];if(C){if(b[1]<=M[0])return S[O-1][1]=b[1],S;if(b[1]<=M[1])return S[O-1][1]=Math.max(b[1],M[1]),S.splice(O,1),S;S.splice(O,1),O--}else{if(b[1]<=M[0])return S.splice(O,0,b),S;if(b[1]<=M[1])return M[0]=Math.min(b[0],M[0]),S;b[0]<M[1]&&(M[0]=Math.min(b[0],M[0]),C=!0)}}return C?S[S.length-1][1]=b[1]:S.push(b),S}};o.CharacterJoinerService=v=h([p(0,_.IBufferService)],v)},5114:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=u(844),p=u(8460),f=u(3656);class m extends h.Disposable{constructor(w,v,x){super(),this._textarea=w,this._window=v,this.mainDocument=x,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((S=>this._screenDprMonitor.setWindow(S)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=m;class g extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=u(844);class p extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const g=this.linkProviders.indexOf(m);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=p},8934:function(l,o,u){var h=this&&this.__decorate||function(_,w,v,x){var S,b=arguments.length,C=b<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(_,w,v,x);else for(var O=_.length-1;O>=0;O--)(S=_[O])&&(C=(b<3?S(C):b>3?S(w,v,C):S(w,v))||C);return b>3&&C&&Object.defineProperty(w,v,C),C},p=this&&this.__param||function(_,w){return function(v,x){w(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=u(4725),m=u(9806);let g=o.MouseService=class{constructor(_,w){this._renderService=_,this._charSizeService=w}getCoords(_,w,v,x,S){return(0,m.getCoords)(window,_,w,v,x,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,S)}getMouseReportCoords(_,w){const v=(0,m.getCoordsRelativeToElement)(window,_,w);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=g=h([p(0,f.IRenderService),p(1,f.ICharSizeService)],g)},3230:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var L=S.length-1;L>=0;L--)(M=S[L])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=u(6193),m=u(4725),g=u(8460),_=u(844),w=u(7226),v=u(2585);let x=o.RenderService=class extends _.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(S,b,C,O,M,D,N,L){super(),this._rowCount=S,this._charSizeService=O,this._renderer=this.register(new _.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new _.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((j,K)=>this._renderRows(j,K)),N),this.register(this._renderDebouncer),this.register(N.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(M.onDecorationRegistered((()=>this._fullRefresh()))),this.register(M.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(N.window,b),this.register(N.onWindowChange((j=>this._registerIntersectionObserver(j,b))))}_registerIntersectionObserver(S,b){if("IntersectionObserver"in S){const C=new S.IntersectionObserver((O=>this._handleIntersectionChange(O[O.length-1])),{threshold:0});C.observe(b),this._observerDisposable.value=(0,_.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(S){this._isPaused=S.isIntersecting===void 0?S.intersectionRatio===0:!S.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(S,b,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(S,b,this._rowCount))}_renderRows(S,b){this._renderer.value&&(S=Math.min(S,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(S,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:S,end:b}),this._onRender.fire({start:S,end:b}),this._isNextRenderRedrawOnly=!0)}resize(S,b){this._rowCount=b,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(S){this._renderer.value=S,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(S){return this._renderDebouncer.addRefreshCallback(S)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(S,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(S,b))):this._renderer.value.handleResize(S,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(S,b,C){this._selectionState.start=S,this._selectionState.end=b,this._selectionState.columnSelectMode=C,this._renderer.value?.handleSelectionChanged(S,b,C)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};o.RenderService=x=h([p(2,v.IOptionsService),p(3,m.ICharSizeService),p(4,v.IDecorationService),p(5,v.IBufferService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],x)},9312:function(l,o,u){var h=this&&this.__decorate||function(N,L,j,K){var Y,H=arguments.length,Q=H<3?L:K===null?K=Object.getOwnPropertyDescriptor(L,j):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(N,L,j,K);else for(var te=N.length-1;te>=0;te--)(Y=N[te])&&(Q=(H<3?Y(Q):H>3?Y(L,j,Q):Y(L,j))||Q);return H>3&&Q&&Object.defineProperty(L,j,Q),Q},p=this&&this.__param||function(N,L){return function(j,K){L(j,K,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=u(9806),m=u(9504),g=u(456),_=u(4725),w=u(8460),v=u(844),x=u(6114),S=u(4841),b=u(511),C=u(2585),O=" ",M=new RegExp(O,"g");let D=o.SelectionService=class extends v.Disposable{constructor(N,L,j,K,Y,H,Q,te,$){super(),this._element=N,this._screenElement=L,this._linkifier=j,this._bufferService=K,this._coreService=Y,this._mouseService=H,this._optionsService=Q,this._renderService=te,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const N=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!N||!L||N[0]===L[0]&&N[1]===L[1])}get selectionText(){const N=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!N||!L)return"";const j=this._bufferService.buffer,K=[];if(this._activeSelectionMode===3){if(N[0]===L[0])return"";const Y=N[0]<L[0]?N[0]:L[0],H=N[0]<L[0]?L[0]:N[0];for(let Q=N[1];Q<=L[1];Q++){const te=j.translateBufferLineToString(Q,!0,Y,H);K.push(te)}}else{const Y=N[1]===L[1]?L[0]:void 0;K.push(j.translateBufferLineToString(N[1],!0,N[0],Y));for(let H=N[1]+1;H<=L[1]-1;H++){const Q=j.lines.get(H),te=j.translateBufferLineToString(H,!0);Q?.isWrapped?K[K.length-1]+=te:K.push(te)}if(N[1]!==L[1]){const H=j.lines.get(L[1]),Q=j.translateBufferLineToString(L[1],!0,0,L[0]);H&&H.isWrapped?K[K.length-1]+=Q:K.push(Q)}}return K.map((Y=>Y.replace(M," "))).join(x.isWindows?`\r
|
|
111
|
-
`:`
|
|
112
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),x.isLinux&&N&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(N){const L=this._getMouseBufferCoords(N),j=this._model.finalSelectionStart,K=this._model.finalSelectionEnd;return!!(j&&K&&L)&&this._areCoordsInSelection(L,j,K)}isCellInSelection(N,L){const j=this._model.finalSelectionStart,K=this._model.finalSelectionEnd;return!(!j||!K)&&this._areCoordsInSelection([N,L],j,K)}_areCoordsInSelection(N,L,j){return N[1]>L[1]&&N[1]<j[1]||L[1]===j[1]&&N[1]===L[1]&&N[0]>=L[0]&&N[0]<j[0]||L[1]<j[1]&&N[1]===j[1]&&N[0]<j[0]||L[1]<j[1]&&N[1]===L[1]&&N[0]>=L[0]}_selectWordAtCursor(N,L){const j=this._linkifier.currentLink?.link?.range;if(j)return this._model.selectionStart=[j.start.x-1,j.start.y-1],this._model.selectionStartLength=(0,S.getRangeLength)(j,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const K=this._getMouseBufferCoords(N);return!!K&&(this._selectWordAt(K,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,L){this._model.clearSelection(),N=Math.max(N,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const L=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(N){let L=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const j=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=j?0:(L>j&&(L-=j),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(N){return x.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const L=this._getMouseBufferCoords(N);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(N){return N.altKey&&!(x.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(N),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const j=this._bufferService.buffer;if(this._model.selectionEnd[1]<j.lines.length){const K=j.lines.get(this._model.selectionEnd[1]);K&&K.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const N=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const L=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const j=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(j&&j[0]!==void 0&&j[1]!==void 0){const K=(0,m.moveToCellSequence)(j[0]-1,j[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(K,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,j=!(!N||!L||N[0]===L[0]&&N[1]===L[1]);j?N&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,L,j)):this._oldHasSelection&&this._fireOnSelectionChange(N,L,j)}_fireOnSelectionChange(N,L,j){this._oldSelectionStart=N,this._oldSelectionEnd=L,this._oldHasSelection=j,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(N,L){let j=L;for(let K=0;L>=K;K++){const Y=N.loadCell(K,this._workCell).getChars().length;this._workCell.getWidth()===0?j--:Y>1&&L!==K&&(j+=Y-1)}return j}setSelection(N,L,j){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,L],this._model.selectionStartLength=j,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,L,j=!0,K=!0){if(N[0]>=this._bufferService.cols)return;const Y=this._bufferService.buffer,H=Y.lines.get(N[1]);if(!H)return;const Q=Y.translateBufferLineToString(N[1],!1);let te=this._convertViewportColToCharacterIndex(H,N[0]),$=te;const J=N[0]-te;let re=0,F=0,B=0,U=0;if(Q.charAt(te)===" "){for(;te>0&&Q.charAt(te-1)===" ";)te--;for(;$<Q.length&&Q.charAt($+1)===" ";)$++}else{let _e=N[0],Ee=N[0];H.getWidth(_e)===0&&(re++,_e--),H.getWidth(Ee)===2&&(F++,Ee++);const Ie=H.getString(Ee).length;for(Ie>1&&(U+=Ie-1,$+=Ie-1);_e>0&&te>0&&!this._isCharWordSeparator(H.loadCell(_e-1,this._workCell));){H.loadCell(_e-1,this._workCell);const ae=this._workCell.getChars().length;this._workCell.getWidth()===0?(re++,_e--):ae>1&&(B+=ae-1,te-=ae-1),te--,_e--}for(;Ee<H.length&&$+1<Q.length&&!this._isCharWordSeparator(H.loadCell(Ee+1,this._workCell));){H.loadCell(Ee+1,this._workCell);const ae=this._workCell.getChars().length;this._workCell.getWidth()===2?(F++,Ee++):ae>1&&(U+=ae-1,$+=ae-1),$++,Ee++}}$++;let X=te+J-re+B,V=Math.min(this._bufferService.cols,$-te+re+F-B-U);if(L||Q.slice(te,$).trim()!==""){if(j&&X===0&&H.getCodePoint(0)!==32){const _e=Y.lines.get(N[1]-1);if(_e&&H.isWrapped&&_e.getCodePoint(this._bufferService.cols-1)!==32){const Ee=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(Ee){const Ie=this._bufferService.cols-Ee.start;X-=Ie,V+=Ie}}}if(K&&X+V===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const _e=Y.lines.get(N[1]+1);if(_e?.isWrapped&&_e.getCodePoint(0)!==32){const Ee=this._getWordAt([0,N[1]+1],!1,!1,!0);Ee&&(V+=Ee.length)}}return{start:X,length:V}}}_selectWordAt(N,L){const j=this._getWordAt(N,L);if(j){for(;j.start<0;)j.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[j.start,N[1]],this._model.selectionStartLength=j.length}}_selectToWordAt(N){const L=this._getWordAt(N,!0);if(L){let j=N[1];for(;L.start<0;)L.start+=this._bufferService.cols,j--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,j++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,j]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const L=this._bufferService.buffer.getWrappedRangeForLine(N),j={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,S.getRangeLength)(j,this._bufferService.cols)}};o.SelectionService=D=h([p(3,C.IBufferService),p(4,C.ICoreService),p(5,_.IMouseService),p(6,C.IOptionsService),p(7,_.IRenderService),p(8,_.ICoreBrowserService)],D)},4725:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=u(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(l,o,u){var h=this&&this.__decorate||function(D,N,L,j){var K,Y=arguments.length,H=Y<3?N:j===null?j=Object.getOwnPropertyDescriptor(N,L):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(D,N,L,j);else for(var Q=D.length-1;Q>=0;Q--)(K=D[Q])&&(H=(Y<3?K(H):Y>3?K(N,L,H):K(N,L))||H);return Y>3&&H&&Object.defineProperty(N,L,H),H},p=this&&this.__param||function(D,N){return function(L,j){N(L,j,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),m=u(8055),g=u(8460),_=u(844),w=u(2585),v=m.css.toColor("#ffffff"),x=m.css.toColor("#000000"),S=m.css.toColor("#ffffff"),b=m.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let L=0;L<216;L++){const j=N[L/36%6|0],K=N[L/6%6|0],Y=N[L%6];D.push({css:m.channels.toCss(j,K,Y),rgba:m.channels.toRgba(j,K,Y)})}for(let L=0;L<24;L++){const j=8+10*L;D.push({css:m.channels.toCss(j,j,j),rgba:m.channels.toRgba(j,j,j)})}return D})());let O=o.ThemeService=class extends _.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:x,cursor:S,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:m.color.blend(x,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:m.color.blend(x,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const N=this._colors;if(N.foreground=M(D.foreground,v),N.background=M(D.background,x),N.cursor=M(D.cursor,S),N.cursorAccent=M(D.cursorAccent,b),N.selectionBackgroundTransparent=M(D.selectionBackground,C),N.selectionBackgroundOpaque=m.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=M(D.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=m.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=D.selectionForeground?M(D.selectionForeground,m.NULL_COLOR):void 0,N.selectionForeground===m.NULL_COLOR&&(N.selectionForeground=void 0),m.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=m.color.opacity(N.selectionBackgroundTransparent,.3)),m.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=m.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=o.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=M(D.black,o.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=M(D.red,o.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=M(D.green,o.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=M(D.yellow,o.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=M(D.blue,o.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=M(D.magenta,o.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=M(D.cyan,o.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=M(D.white,o.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=M(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=M(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=M(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=M(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=M(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=M(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=M(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=M(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const L=Math.min(N.ansi.length-16,D.extendedAnsi.length);for(let j=0;j<L;j++)N.ansi[j+16]=M(D.extendedAnsi[j],o.DEFAULT_ANSI_COLORS[j+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let N=0;N<this._restoreColors.ansi.length;++N)this._colors.ansi[N]=this._restoreColors.ansi[N]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function M(D,N){if(D!==void 0)try{return m.css.toColor(D)}catch{}return N}o.ThemeService=O=h([p(0,w.IOptionsService)],O)},6349:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=u(8460),p=u(844);class f extends p.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const _=new Array(g);for(let w=0;w<Math.min(g,this.length);w++)_[w]=this._array[this._getCyclicIndex(w)];this._array=_,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let _=this._length;_<g;_++)this._array[_]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,_){this._array[this._getCyclicIndex(g)]=_}push(g){this._array[this._getCyclicIndex(this._length)]=g,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(g,_,...w){if(_){for(let v=g;v<this._length-_;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+_)];this._length-=_,this.onDeleteEmitter.fire({index:g,amount:_})}for(let v=this._length-1;v>=g;v--)this._array[this._getCyclicIndex(v+w.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<w.length;v++)this._array[this._getCyclicIndex(g+v)]=w[v];if(w.length&&this.onInsertEmitter.fire({index:g,amount:w.length}),this._length+w.length>this._maxLength){const v=this._length+w.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=w.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,_,w){if(!(_<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let x=_-1;x>=0;x--)this.set(g+x+w,this.get(g+x));const v=g+_+w-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<_;v++)this.set(g+v+w,this.get(g+v))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=f},1439:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function u(h,p=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const m in h)f[m]=p<=1?h[m]:h[m]&&u(h[m],p-1);return f}},8055:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let u=0,h=0,p=0,f=0;var m,g,_,w,v;function x(b){const C=b.toString(16);return C.length<2?"0"+C:C}function S(b,C){return b<C?(C+.05)/(b+.05):(b+.05)/(C+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(C,O,M,D){return D!==void 0?`#${x(C)}${x(O)}${x(M)}${x(D)}`:`#${x(C)}${x(O)}${x(M)}`},b.toRgba=function(C,O,M,D=255){return(C<<24|O<<16|M<<8|D)>>>0},b.toColor=function(C,O,M,D){return{css:b.toCss(C,O,M,D),rgba:b.toRgba(C,O,M,D)}}})(m||(o.channels=m={})),(function(b){function C(O,M){return f=Math.round(255*M),[u,h,p]=v.toChannels(O.rgba),{css:m.toCss(u,h,p,f),rgba:m.toRgba(u,h,p,f)}}b.blend=function(O,M){if(f=(255&M.rgba)/255,f===1)return{css:M.css,rgba:M.rgba};const D=M.rgba>>24&255,N=M.rgba>>16&255,L=M.rgba>>8&255,j=O.rgba>>24&255,K=O.rgba>>16&255,Y=O.rgba>>8&255;return u=j+Math.round((D-j)*f),h=K+Math.round((N-K)*f),p=Y+Math.round((L-Y)*f),{css:m.toCss(u,h,p),rgba:m.toRgba(u,h,p)}},b.isOpaque=function(O){return(255&O.rgba)==255},b.ensureContrastRatio=function(O,M,D){const N=v.ensureContrastRatio(O.rgba,M.rgba,D);if(N)return m.toColor(N>>24&255,N>>16&255,N>>8&255)},b.opaque=function(O){const M=(255|O.rgba)>>>0;return[u,h,p]=v.toChannels(M),{css:m.toCss(u,h,p),rgba:M}},b.opacity=C,b.multiplyOpacity=function(O,M){return f=255&O.rgba,C(O,f*M/255)},b.toColorRGB=function(O){return[O.rgba>>24&255,O.rgba>>16&255,O.rgba>>8&255]}})(g||(o.color=g={})),(function(b){let C,O;try{const M=document.createElement("canvas");M.width=1,M.height=1;const D=M.getContext("2d",{willReadFrequently:!0});D&&(C=D,C.globalCompositeOperation="copy",O=C.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(M){if(M.match(/#[\da-f]{3,8}/i))switch(M.length){case 4:return u=parseInt(M.slice(1,2).repeat(2),16),h=parseInt(M.slice(2,3).repeat(2),16),p=parseInt(M.slice(3,4).repeat(2),16),m.toColor(u,h,p);case 5:return u=parseInt(M.slice(1,2).repeat(2),16),h=parseInt(M.slice(2,3).repeat(2),16),p=parseInt(M.slice(3,4).repeat(2),16),f=parseInt(M.slice(4,5).repeat(2),16),m.toColor(u,h,p,f);case 7:return{css:M,rgba:(parseInt(M.slice(1),16)<<8|255)>>>0};case 9:return{css:M,rgba:parseInt(M.slice(1),16)>>>0}}const D=M.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),h=parseInt(D[2]),p=parseInt(D[3]),f=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),m.toColor(u,h,p,f);if(!C||!O)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=O,C.fillStyle=M,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[u,h,p,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(u,h,p,f),css:M}}})(_||(o.css=_={})),(function(b){function C(O,M,D){const N=O/255,L=M/255,j=D/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}b.relativeLuminance=function(O){return C(O>>16&255,O>>8&255,255&O)},b.relativeLuminance2=C})(w||(o.rgb=w={})),(function(b){function C(M,D,N){const L=M>>24&255,j=M>>16&255,K=M>>8&255;let Y=D>>24&255,H=D>>16&255,Q=D>>8&255,te=S(w.relativeLuminance2(Y,H,Q),w.relativeLuminance2(L,j,K));for(;te<N&&(Y>0||H>0||Q>0);)Y-=Math.max(0,Math.ceil(.1*Y)),H-=Math.max(0,Math.ceil(.1*H)),Q-=Math.max(0,Math.ceil(.1*Q)),te=S(w.relativeLuminance2(Y,H,Q),w.relativeLuminance2(L,j,K));return(Y<<24|H<<16|Q<<8|255)>>>0}function O(M,D,N){const L=M>>24&255,j=M>>16&255,K=M>>8&255;let Y=D>>24&255,H=D>>16&255,Q=D>>8&255,te=S(w.relativeLuminance2(Y,H,Q),w.relativeLuminance2(L,j,K));for(;te<N&&(Y<255||H<255||Q<255);)Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),H=Math.min(255,H+Math.ceil(.1*(255-H))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),te=S(w.relativeLuminance2(Y,H,Q),w.relativeLuminance2(L,j,K));return(Y<<24|H<<16|Q<<8|255)>>>0}b.blend=function(M,D){if(f=(255&D)/255,f===1)return D;const N=D>>24&255,L=D>>16&255,j=D>>8&255,K=M>>24&255,Y=M>>16&255,H=M>>8&255;return u=K+Math.round((N-K)*f),h=Y+Math.round((L-Y)*f),p=H+Math.round((j-H)*f),m.toRgba(u,h,p)},b.ensureContrastRatio=function(M,D,N){const L=w.relativeLuminance(M>>8),j=w.relativeLuminance(D>>8);if(S(L,j)<N){if(j<L){const H=C(M,D,N),Q=S(L,w.relativeLuminance(H>>8));if(Q<N){const te=O(M,D,N);return Q>S(L,w.relativeLuminance(te>>8))?H:te}return H}const K=O(M,D,N),Y=S(L,w.relativeLuminance(K>>8));if(Y<N){const H=C(M,D,N);return Y>S(L,w.relativeLuminance(H>>8))?K:H}return K}},b.reduceLuminance=C,b.increaseLuminance=O,b.toChannels=function(M){return[M>>24&255,M>>16&255,M>>8&255,255&M]}})(v||(o.rgba=v={})),o.toPaddedHex=x,o.contrastRatio=S},8969:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=u(844),p=u(2585),f=u(4348),m=u(7866),g=u(744),_=u(7302),w=u(6975),v=u(8460),x=u(1753),S=u(1480),b=u(7994),C=u(9282),O=u(5435),M=u(5981),D=u(2660);let N=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((K=>{this._onScrollApi?.fire(K.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(K){for(const Y in K)this.optionsService.options[Y]=K[Y]}constructor(K){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new _.OptionsService(K)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(x.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(S.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new O.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((Y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((Y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new M.WriteBuffer(((Y,H)=>this._inputHandler.parse(Y,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(K,Y){this._writeBuffer.write(K,Y)}writeSync(K,Y){this._logService.logLevel<=p.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync(K,Y)}input(K,Y=!0){this.coreService.triggerDataEvent(K,Y)}resize(K,Y){isNaN(K)||isNaN(Y)||(K=Math.max(K,g.MINIMUM_COLS),Y=Math.max(Y,g.MINIMUM_ROWS),this._bufferService.resize(K,Y))}scroll(K,Y=!1){this._bufferService.scroll(K,Y)}scrollLines(K,Y,H){this._bufferService.scrollLines(K,Y,H)}scrollPages(K){this.scrollLines(K*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(K){const Y=K-this._bufferService.buffer.ydisp;Y!==0&&this.scrollLines(Y)}registerEscHandler(K,Y){return this._inputHandler.registerEscHandler(K,Y)}registerDcsHandler(K,Y){return this._inputHandler.registerDcsHandler(K,Y)}registerCsiHandler(K,Y){return this._inputHandler.registerCsiHandler(K,Y)}registerOscHandler(K,Y){return this._inputHandler.registerOscHandler(K,Y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let K=!1;const Y=this.optionsService.rawOptions.windowsPty;Y&&Y.buildNumber!==void 0&&Y.buildNumber!==void 0?K=Y.backend==="conpty"&&Y.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(K=!0),K?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const K=[];K.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),K.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const Y of K)Y.dispose()}))}}}o.CoreTerminal=L},8460:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const p=[];for(let f=0;f<this._listeners.length;f++)p.push(this._listeners[f]);for(let f=0;f<p.length;f++)p[f].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,h){return u((p=>h.fire(p)))},o.runAndSubscribe=function(u,h){return h(void 0),u((p=>h(p)))}},5435:function(l,o,u){var h=this&&this.__decorate||function(re,F,B,U){var X,V=arguments.length,_e=V<3?F:U===null?U=Object.getOwnPropertyDescriptor(F,B):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_e=Reflect.decorate(re,F,B,U);else for(var Ee=re.length-1;Ee>=0;Ee--)(X=re[Ee])&&(_e=(V<3?X(_e):V>3?X(F,B,_e):X(F,B))||_e);return V>3&&_e&&Object.defineProperty(F,B,_e),_e},p=this&&this.__param||function(re,F){return function(B,U){F(B,U,re)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=u(2584),m=u(7116),g=u(2015),_=u(844),w=u(482),v=u(8437),x=u(8460),S=u(643),b=u(511),C=u(3734),O=u(2585),M=u(1480),D=u(6242),N=u(6351),L=u(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},K=131072;function Y(re,F){if(re>24)return F.setWinLines||!1;switch(re){case 1:return!!F.restoreWin;case 2:return!!F.minimizeWin;case 3:return!!F.setWinPosition;case 4:return!!F.setWinSizePixels;case 5:return!!F.raiseWin;case 6:return!!F.lowerWin;case 7:return!!F.refreshWin;case 8:return!!F.setWinSizeChars;case 9:return!!F.maximizeWin;case 10:return!!F.fullscreenWin;case 11:return!!F.getWinState;case 13:return!!F.getWinPosition;case 14:return!!F.getWinSizePixels;case 15:return!!F.getScreenSizePixels;case 16:return!!F.getCellSizePixels;case 18:return!!F.getWinSizeChars;case 19:return!!F.getScreenSizeChars;case 20:return!!F.getIconTitle;case 21:return!!F.getWinTitle;case 22:return!!F.pushTitle;case 23:return!!F.popTitle;case 24:return!!F.setWinLines}return!1}var H;(function(re){re[re.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",re[re.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let Q=0;class te extends _.Disposable{getAttrData(){return this._curAttrData}constructor(F,B,U,X,V,_e,Ee,Ie,ae=new g.EscapeSequenceParser){super(),this._bufferService=F,this._charsetService=B,this._coreService=U,this._logService=X,this._optionsService=V,this._oscLinkService=_e,this._coreMouseService=Ee,this._unicodeService=Ie,this._parser=ae,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new x.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new x.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new x.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new x.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new x.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new x.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new x.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new x.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new x.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new x.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new x.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new x.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((ee=>this._activeBuffer=ee.activeBuffer))),this._parser.setCsiHandlerFallback(((ee,Te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(ee),params:Te.toArray()})})),this._parser.setEscHandlerFallback((ee=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(ee)})})),this._parser.setExecuteHandlerFallback((ee=>{this._logService.debug("Unknown EXECUTE code: ",{code:ee})})),this._parser.setOscHandlerFallback(((ee,Te,ye)=>{this._logService.debug("Unknown OSC code: ",{identifier:ee,action:Te,data:ye})})),this._parser.setDcsHandlerFallback(((ee,Te,ye)=>{Te==="HOOK"&&(ye=ye.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(ee),action:Te,payload:ye})})),this._parser.setPrintHandler(((ee,Te,ye)=>this.print(ee,Te,ye))),this._parser.registerCsiHandler({final:"@"},(ee=>this.insertChars(ee))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(ee=>this.scrollLeft(ee))),this._parser.registerCsiHandler({final:"A"},(ee=>this.cursorUp(ee))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(ee=>this.scrollRight(ee))),this._parser.registerCsiHandler({final:"B"},(ee=>this.cursorDown(ee))),this._parser.registerCsiHandler({final:"C"},(ee=>this.cursorForward(ee))),this._parser.registerCsiHandler({final:"D"},(ee=>this.cursorBackward(ee))),this._parser.registerCsiHandler({final:"E"},(ee=>this.cursorNextLine(ee))),this._parser.registerCsiHandler({final:"F"},(ee=>this.cursorPrecedingLine(ee))),this._parser.registerCsiHandler({final:"G"},(ee=>this.cursorCharAbsolute(ee))),this._parser.registerCsiHandler({final:"H"},(ee=>this.cursorPosition(ee))),this._parser.registerCsiHandler({final:"I"},(ee=>this.cursorForwardTab(ee))),this._parser.registerCsiHandler({final:"J"},(ee=>this.eraseInDisplay(ee,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(ee=>this.eraseInDisplay(ee,!0))),this._parser.registerCsiHandler({final:"K"},(ee=>this.eraseInLine(ee,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(ee=>this.eraseInLine(ee,!0))),this._parser.registerCsiHandler({final:"L"},(ee=>this.insertLines(ee))),this._parser.registerCsiHandler({final:"M"},(ee=>this.deleteLines(ee))),this._parser.registerCsiHandler({final:"P"},(ee=>this.deleteChars(ee))),this._parser.registerCsiHandler({final:"S"},(ee=>this.scrollUp(ee))),this._parser.registerCsiHandler({final:"T"},(ee=>this.scrollDown(ee))),this._parser.registerCsiHandler({final:"X"},(ee=>this.eraseChars(ee))),this._parser.registerCsiHandler({final:"Z"},(ee=>this.cursorBackwardTab(ee))),this._parser.registerCsiHandler({final:"`"},(ee=>this.charPosAbsolute(ee))),this._parser.registerCsiHandler({final:"a"},(ee=>this.hPositionRelative(ee))),this._parser.registerCsiHandler({final:"b"},(ee=>this.repeatPrecedingCharacter(ee))),this._parser.registerCsiHandler({final:"c"},(ee=>this.sendDeviceAttributesPrimary(ee))),this._parser.registerCsiHandler({prefix:">",final:"c"},(ee=>this.sendDeviceAttributesSecondary(ee))),this._parser.registerCsiHandler({final:"d"},(ee=>this.linePosAbsolute(ee))),this._parser.registerCsiHandler({final:"e"},(ee=>this.vPositionRelative(ee))),this._parser.registerCsiHandler({final:"f"},(ee=>this.hVPosition(ee))),this._parser.registerCsiHandler({final:"g"},(ee=>this.tabClear(ee))),this._parser.registerCsiHandler({final:"h"},(ee=>this.setMode(ee))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(ee=>this.setModePrivate(ee))),this._parser.registerCsiHandler({final:"l"},(ee=>this.resetMode(ee))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(ee=>this.resetModePrivate(ee))),this._parser.registerCsiHandler({final:"m"},(ee=>this.charAttributes(ee))),this._parser.registerCsiHandler({final:"n"},(ee=>this.deviceStatus(ee))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(ee=>this.deviceStatusPrivate(ee))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(ee=>this.softReset(ee))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(ee=>this.setCursorStyle(ee))),this._parser.registerCsiHandler({final:"r"},(ee=>this.setScrollRegion(ee))),this._parser.registerCsiHandler({final:"s"},(ee=>this.saveCursor(ee))),this._parser.registerCsiHandler({final:"t"},(ee=>this.windowOptions(ee))),this._parser.registerCsiHandler({final:"u"},(ee=>this.restoreCursor(ee))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(ee=>this.insertColumns(ee))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(ee=>this.deleteColumns(ee))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(ee=>this.selectProtected(ee))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(ee=>this.requestMode(ee,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(ee=>this.requestMode(ee,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((ee=>(this.setTitle(ee),this.setIconName(ee),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((ee=>this.setIconName(ee)))),this._parser.registerOscHandler(2,new D.OscHandler((ee=>this.setTitle(ee)))),this._parser.registerOscHandler(4,new D.OscHandler((ee=>this.setOrReportIndexedColor(ee)))),this._parser.registerOscHandler(8,new D.OscHandler((ee=>this.setHyperlink(ee)))),this._parser.registerOscHandler(10,new D.OscHandler((ee=>this.setOrReportFgColor(ee)))),this._parser.registerOscHandler(11,new D.OscHandler((ee=>this.setOrReportBgColor(ee)))),this._parser.registerOscHandler(12,new D.OscHandler((ee=>this.setOrReportCursorColor(ee)))),this._parser.registerOscHandler(104,new D.OscHandler((ee=>this.restoreIndexedColor(ee)))),this._parser.registerOscHandler(110,new D.OscHandler((ee=>this.restoreFgColor(ee)))),this._parser.registerOscHandler(111,new D.OscHandler((ee=>this.restoreBgColor(ee)))),this._parser.registerOscHandler(112,new D.OscHandler((ee=>this.restoreCursorColor(ee)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const ee in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:ee},(()=>this.selectCharset("("+ee))),this._parser.registerEscHandler({intermediates:")",final:ee},(()=>this.selectCharset(")"+ee))),this._parser.registerEscHandler({intermediates:"*",final:ee},(()=>this.selectCharset("*"+ee))),this._parser.registerEscHandler({intermediates:"+",final:ee},(()=>this.selectCharset("+"+ee))),this._parser.registerEscHandler({intermediates:"-",final:ee},(()=>this.selectCharset("-"+ee))),this._parser.registerEscHandler({intermediates:".",final:ee},(()=>this.selectCharset("."+ee))),this._parser.registerEscHandler({intermediates:"/",final:ee},(()=>this.selectCharset("/"+ee)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((ee=>(this._logService.error("Parsing error: ",ee),ee))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((ee,Te)=>this.requestStatusString(ee,Te))))}_preserveStack(F,B,U,X){this._parseStack.paused=!0,this._parseStack.cursorStartX=F,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=U,this._parseStack.position=X}_logSlowResolvingAsync(F){this._logService.logLevel<=O.LogLevelEnum.WARN&&Promise.race([F,new Promise(((B,U)=>setTimeout((()=>U("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(F,B){let U,X=this._activeBuffer.x,V=this._activeBuffer.y,_e=0;const Ee=this._parseStack.paused;if(Ee){if(U=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(U),U;X=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,F.length>K&&(_e=this._parseStack.position+K)}if(this._logService.logLevel<=O.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof F=="string"?` "${F}"`:` "${Array.prototype.map.call(F,(ee=>String.fromCharCode(ee))).join("")}"`),typeof F=="string"?F.split("").map((ee=>ee.charCodeAt(0))):F),this._parseBuffer.length<F.length&&this._parseBuffer.length<K&&(this._parseBuffer=new Uint32Array(Math.min(F.length,K))),Ee||this._dirtyRowTracker.clearRange(),F.length>K)for(let ee=_e;ee<F.length;ee+=K){const Te=ee+K<F.length?ee+K:F.length,ye=typeof F=="string"?this._stringDecoder.decode(F.substring(ee,Te),this._parseBuffer):this._utf8Decoder.decode(F.subarray(ee,Te),this._parseBuffer);if(U=this._parser.parse(this._parseBuffer,ye))return this._preserveStack(X,V,ye,ee),this._logSlowResolvingAsync(U),U}else if(!Ee){const ee=typeof F=="string"?this._stringDecoder.decode(F,this._parseBuffer):this._utf8Decoder.decode(F,this._parseBuffer);if(U=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(X,V,ee,0),this._logSlowResolvingAsync(U),U}this._activeBuffer.x===X&&this._activeBuffer.y===V||this._onCursorMove.fire();const Ie=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),ae=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);ae<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(ae,this._bufferService.rows-1),Math.min(Ie,this._bufferService.rows-1))}print(F,B,U){let X,V;const _e=this._charsetService.charset,Ee=this._optionsService.rawOptions.screenReaderMode,Ie=this._bufferService.cols,ae=this._coreService.decPrivateModes.wraparound,ee=this._coreService.modes.insertMode,Te=this._curAttrData;let ye=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&U-B>0&&ye.getWidth(this._activeBuffer.x-1)===2&&ye.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Te);let Me=this._parser.precedingJoinState;for(let we=B;we<U;++we){if(X=F[we],X<127&&_e){const Fe=_e[String.fromCharCode(X)];Fe&&(X=Fe.charCodeAt(0))}const it=this._unicodeService.charProperties(X,Me);V=M.UnicodeService.extractWidth(it);const De=M.UnicodeService.extractShouldJoin(it),Pe=De?M.UnicodeService.extractWidth(Me):0;if(Me=it,Ee&&this._onA11yChar.fire((0,w.stringFromCodePoint)(X)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-Pe>Ie){if(ae){const Fe=ye;let je=this._activeBuffer.x-Pe;for(this._activeBuffer.x=Pe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ye=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Pe>0&&ye instanceof v.BufferLine&&ye.copyCellsFrom(Fe,je,0,Pe,!1);je<Ie;)Fe.setCellFromCodepoint(je++,0,1,Te)}else if(this._activeBuffer.x=Ie-1,V===2)continue}if(De&&this._activeBuffer.x){const Fe=ye.getWidth(this._activeBuffer.x-1)?1:2;ye.addCodepointToCell(this._activeBuffer.x-Fe,X,V);for(let je=V-Pe;--je>=0;)ye.setCellFromCodepoint(this._activeBuffer.x++,0,0,Te)}else if(ee&&(ye.insertCells(this._activeBuffer.x,V-Pe,this._activeBuffer.getNullCell(Te)),ye.getWidth(Ie-1)===2&&ye.setCellFromCodepoint(Ie-1,S.NULL_CELL_CODE,S.NULL_CELL_WIDTH,Te)),ye.setCellFromCodepoint(this._activeBuffer.x++,X,V,Te),V>0)for(;--V;)ye.setCellFromCodepoint(this._activeBuffer.x++,0,0,Te)}this._parser.precedingJoinState=Me,this._activeBuffer.x<Ie&&U-B>0&&ye.getWidth(this._activeBuffer.x)===0&&!ye.hasContent(this._activeBuffer.x)&&ye.setCellFromCodepoint(this._activeBuffer.x,0,1,Te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(F,B){return F.final!=="t"||F.prefix||F.intermediates?this._parser.registerCsiHandler(F,B):this._parser.registerCsiHandler(F,(U=>!Y(U.params[0],this._optionsService.rawOptions.windowOptions)||B(U)))}registerDcsHandler(F,B){return this._parser.registerDcsHandler(F,new N.DcsHandler(B))}registerEscHandler(F,B){return this._parser.registerEscHandler(F,B)}registerOscHandler(F,B){return this._parser.registerOscHandler(F,new D.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const F=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-F),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(F=this._bufferService.cols-1){this._activeBuffer.x=Math.min(F,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(F,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=F,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=F,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(F,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+F,this._activeBuffer.y+B)}cursorUp(F){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,F.params[0]||1)):this._moveCursor(0,-(F.params[0]||1)),!0}cursorDown(F){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,F.params[0]||1)):this._moveCursor(0,F.params[0]||1),!0}cursorForward(F){return this._moveCursor(F.params[0]||1,0),!0}cursorBackward(F){return this._moveCursor(-(F.params[0]||1),0),!0}cursorNextLine(F){return this.cursorDown(F),this._activeBuffer.x=0,!0}cursorPrecedingLine(F){return this.cursorUp(F),this._activeBuffer.x=0,!0}cursorCharAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(F){return this._setCursor(F.length>=2?(F.params[1]||1)-1:0,(F.params[0]||1)-1),!0}charPosAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(F){return this._moveCursor(F.params[0]||1,0),!0}linePosAbsolute(F){return this._setCursor(this._activeBuffer.x,(F.params[0]||1)-1),!0}vPositionRelative(F){return this._moveCursor(0,F.params[0]||1),!0}hVPosition(F){return this.cursorPosition(F),!0}tabClear(F){const B=F.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=F.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=F.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(F){const B=F.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(F,B,U,X=!1,V=!1){const _e=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);_e.replaceCells(B,U,this._activeBuffer.getNullCell(this._eraseAttrData()),V),X&&(_e.isWrapped=!1)}_resetBufferLine(F,B=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);U&&(U.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+F),U.isWrapped=!1)}eraseInDisplay(F,B=!1){let U;switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:for(U=this._activeBuffer.y,this._dirtyRowTracker.markDirty(U),this._eraseInBufferLine(U++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);U<this._bufferService.rows;U++)this._resetBufferLine(U,B);this._dirtyRowTracker.markDirty(U);break;case 1:for(U=this._activeBuffer.y,this._dirtyRowTracker.markDirty(U),this._eraseInBufferLine(U,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(U+1).isWrapped=!1);U--;)this._resetBufferLine(U,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(U=this._bufferService.rows,this._dirtyRowTracker.markDirty(U-1);U--;)this._resetBufferLine(U,B);this._dirtyRowTracker.markDirty(0);break;case 3:const X=this._activeBuffer.lines.length-this._bufferService.rows;X>0&&(this._activeBuffer.lines.trimStart(X),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-X,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-X,0),this._onScroll.fire(0))}return!0}eraseInLine(F,B=!1){switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(F){this._restrictCursor();let B=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=this._activeBuffer.ybase+this._activeBuffer.y,X=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-X+1;for(;B--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(F){this._restrictCursor();let B=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=this._activeBuffer.ybase+this._activeBuffer.y;let X;for(X=this._bufferService.rows-1-this._activeBuffer.scrollBottom,X=this._bufferService.rows-1+this._activeBuffer.ybase-X;B--;)this._activeBuffer.lines.splice(U,1),this._activeBuffer.lines.splice(X,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(F){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(F){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(F){let B=F.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(F){let B=F.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let U=this._activeBuffer.scrollTop;U<=this._activeBuffer.scrollBottom;++U){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);X.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),X.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let U=this._activeBuffer.scrollTop;U<=this._activeBuffer.scrollBottom;++U){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);X.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),X.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let U=this._activeBuffer.scrollTop;U<=this._activeBuffer.scrollBottom;++U){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);X.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),X.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=F.params[0]||1;for(let U=this._activeBuffer.scrollTop;U<=this._activeBuffer.scrollBottom;++U){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);X.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),X.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(F){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(F.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(F){const B=this._parser.precedingJoinState;if(!B)return!0;const U=F.params[0]||1,X=M.UnicodeService.extractWidth(B),V=this._activeBuffer.x-X,_e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),Ee=new Uint32Array(_e.length*U);let Ie=0;for(let ee=0;ee<_e.length;){const Te=_e.codePointAt(ee)||0;Ee[Ie++]=Te,ee+=Te>65535?2:1}let ae=Ie;for(let ee=1;ee<U;++ee)Ee.copyWithin(ae,0,Ie),ae+=Ie;return this.print(Ee,0,ae),!0}sendDeviceAttributesPrimary(F){return F.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(F){return F.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(F.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(F){return(this._optionsService.rawOptions.termName+"").indexOf(F)===0}setMode(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(F){for(let B=0;B<F.length;B++)switch(F.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),F.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(F,B){const U=this._coreService.decPrivateModes,{activeProtocol:X,activeEncoding:V}=this._coreMouseService,_e=this._coreService,{buffers:Ee,cols:Ie}=this._bufferService,{active:ae,alt:ee}=Ee,Te=this._optionsService.rawOptions,ye=De=>De?1:2,Me=F.params[0];return we=Me,it=B?Me===2?4:Me===4?ye(_e.modes.insertMode):Me===12?3:Me===20?ye(Te.convertEol):0:Me===1?ye(U.applicationCursorKeys):Me===3?Te.windowOptions.setWinLines?Ie===80?2:Ie===132?1:0:0:Me===6?ye(U.origin):Me===7?ye(U.wraparound):Me===8?3:Me===9?ye(X==="X10"):Me===12?ye(Te.cursorBlink):Me===25?ye(!_e.isCursorHidden):Me===45?ye(U.reverseWraparound):Me===66?ye(U.applicationKeypad):Me===67?4:Me===1e3?ye(X==="VT200"):Me===1002?ye(X==="DRAG"):Me===1003?ye(X==="ANY"):Me===1004?ye(U.sendFocus):Me===1005?4:Me===1006?ye(V==="SGR"):Me===1015?4:Me===1016?ye(V==="SGR_PIXELS"):Me===1048?1:Me===47||Me===1047||Me===1049?ye(ae===ee):Me===2004?ye(U.bracketedPasteMode):0,_e.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${we};${it}$y`),!0;var we,it}_updateAttrColor(F,B,U,X,V){return B===2?(F|=50331648,F&=-16777216,F|=C.AttributeData.fromColorRGB([U,X,V])):B===5&&(F&=-50331904,F|=33554432|255&U),F}_extractColor(F,B,U){const X=[0,0,-1,0,0,0];let V=0,_e=0;do{if(X[_e+V]=F.params[B+_e],F.hasSubParams(B+_e)){const Ee=F.getSubParams(B+_e);let Ie=0;do X[1]===5&&(V=1),X[_e+Ie+1+V]=Ee[Ie];while(++Ie<Ee.length&&Ie+_e+1+V<X.length);break}if(X[1]===5&&_e+V>=2||X[1]===2&&_e+V>=5)break;X[1]&&(V=1)}while(++_e+B<F.length&&_e+V<X.length);for(let Ee=2;Ee<X.length;++Ee)X[Ee]===-1&&(X[Ee]=0);switch(X[0]){case 38:U.fg=this._updateAttrColor(U.fg,X[1],X[3],X[4],X[5]);break;case 48:U.bg=this._updateAttrColor(U.bg,X[1],X[3],X[4],X[5]);break;case 58:U.extended=U.extended.clone(),U.extended.underlineColor=this._updateAttrColor(U.extended.underlineColor,X[1],X[3],X[4],X[5])}return _e}_processUnderline(F,B){B.extended=B.extended.clone(),(!~F||F>5)&&(F=1),B.extended.underlineStyle=F,B.fg|=268435456,F===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(F){F.fg=v.DEFAULT_ATTR_DATA.fg,F.bg=v.DEFAULT_ATTR_DATA.bg,F.extended=F.extended.clone(),F.extended.underlineStyle=0,F.extended.underlineColor&=-67108864,F.updateExtended()}charAttributes(F){if(F.length===1&&F.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=F.length;let U;const X=this._curAttrData;for(let V=0;V<B;V++)U=F.params[V],U>=30&&U<=37?(X.fg&=-50331904,X.fg|=16777216|U-30):U>=40&&U<=47?(X.bg&=-50331904,X.bg|=16777216|U-40):U>=90&&U<=97?(X.fg&=-50331904,X.fg|=16777224|U-90):U>=100&&U<=107?(X.bg&=-50331904,X.bg|=16777224|U-100):U===0?this._processSGR0(X):U===1?X.fg|=134217728:U===3?X.bg|=67108864:U===4?(X.fg|=268435456,this._processUnderline(F.hasSubParams(V)?F.getSubParams(V)[0]:1,X)):U===5?X.fg|=536870912:U===7?X.fg|=67108864:U===8?X.fg|=1073741824:U===9?X.fg|=2147483648:U===2?X.bg|=134217728:U===21?this._processUnderline(2,X):U===22?(X.fg&=-134217729,X.bg&=-134217729):U===23?X.bg&=-67108865:U===24?(X.fg&=-268435457,this._processUnderline(0,X)):U===25?X.fg&=-536870913:U===27?X.fg&=-67108865:U===28?X.fg&=-1073741825:U===29?X.fg&=2147483647:U===39?(X.fg&=-67108864,X.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):U===49?(X.bg&=-67108864,X.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):U===38||U===48||U===58?V+=this._extractColor(F,V,X):U===53?X.bg|=1073741824:U===55?X.bg&=-1073741825:U===59?(X.extended=X.extended.clone(),X.extended.underlineColor=-1,X.updateExtended()):U===100?(X.fg&=-67108864,X.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,X.bg&=-67108864,X.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",U);return!0}deviceStatus(F){switch(F.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,U=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${B};${U}R`)}return!0}deviceStatusPrivate(F){if(F.params[0]===6){const B=this._activeBuffer.y+1,U=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${B};${U}R`)}return!0}softReset(F){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(F){const B=F.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const U=B%2==1;return this._optionsService.options.cursorBlink=U,!0}setScrollRegion(F){const B=F.params[0]||1;let U;return(F.length<2||(U=F.params[1])>this._bufferService.rows||U===0)&&(U=this._bufferService.rows),U>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=U-1,this._setCursor(0,0)),!0}windowOptions(F){if(!Y(F.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=F.length>1?F.params[1]:0;switch(F.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(F){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(F){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(F){return this._windowTitle=F,this._onTitleChange.fire(F),!0}setIconName(F){return this._iconName=F,!0}setOrReportIndexedColor(F){const B=[],U=F.split(";");for(;U.length>1;){const X=U.shift(),V=U.shift();if(/^\d+$/.exec(X)){const _e=parseInt(X);if(J(_e))if(V==="?")B.push({type:0,index:_e});else{const Ee=(0,L.parseColor)(V);Ee&&B.push({type:1,index:_e,color:Ee})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(F){const B=F.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(F,B){this._getCurrentLinkId()&&this._finishHyperlink();const U=F.split(":");let X;const V=U.findIndex((_e=>_e.startsWith("id=")));return V!==-1&&(X=U[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:X,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(F,B){const U=F.split(";");for(let X=0;X<U.length&&!(B>=this._specialColors.length);++X,++B)if(U[X]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const V=(0,L.parseColor)(U[X]);V&&this._onColor.fire([{type:1,index:this._specialColors[B],color:V}])}return!0}setOrReportFgColor(F){return this._setOrReportSpecialColor(F,0)}setOrReportBgColor(F){return this._setOrReportSpecialColor(F,1)}setOrReportCursorColor(F){return this._setOrReportSpecialColor(F,2)}restoreIndexedColor(F){if(!F)return this._onColor.fire([{type:2}]),!0;const B=[],U=F.split(";");for(let X=0;X<U.length;++X)if(/^\d+$/.exec(U[X])){const V=parseInt(U[X]);J(V)&&B.push({type:2,index:V})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(F){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(F){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(F){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),!0}selectCharset(F){return F.length!==2?(this.selectDefaultCharset(),!0):(F[0]==="/"||this._charsetService.setgCharset(j[F[0]],m.CHARSETS[F[1]]||m.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const F=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,F,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(F){return this._charsetService.setgLevel(F),!0}screenAlignmentPattern(){const F=new b.CellData;F.content=4194373,F.fg=this._curAttrData.fg,F.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const U=this._activeBuffer.ybase+this._activeBuffer.y+B,X=this._activeBuffer.lines.get(U);X&&(X.fill(F),X.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(F,B){const U=this._bufferService.buffer,X=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${V}${f.C0.ESC}\\`),!0))(F==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:F==='"p'?'P1$r61;1"p':F==="r"?`P1$r${U.scrollTop+1};${U.scrollBottom+1}r`:F==="m"?"P1$r0m":F===" q"?`P1$r${{block:2,underline:4,bar:6}[X.cursorStyle]-(X.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(F,B){this._dirtyRowTracker.markRangeDirty(F,B)}}o.InputHandler=te;let $=class{constructor(re){this._bufferService=re,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(re){re<this.start?this.start=re:re>this.end&&(this.end=re)}markRangeDirty(re,F){re>F&&(Q=re,re=F,F=Q),re<this.start&&(this.start=re),F>this.end&&(this.end=F)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(re){return 0<=re&&re<256}$=h([p(0,O.IBufferService)],$)},844:(l,o)=>{function u(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const p=this._disposables.indexOf(h);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=u,o.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(p,f,m){this._data[p]||(this._data[p]={}),this._data[p][f]=m}get(p,f){return this._data[p]?this._data[p][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=u,o.FourKeyMap=class{constructor(){this._data=new u}set(h,p,f,m,g){this._data.get(h,p)||this._data.set(h,p,new u),this._data.get(h,p).set(f,m,g)}get(h,p,f,m){return this._data.get(h,p)?.get(f,m)}clear(){this._data.clear()}}},6114:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const u=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=u.includes("Firefox"),o.isLegacyEdge=u.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(u),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=u.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(u)},6106:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let u=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const p=this._getKey(h);if(p===void 0||(u=this._search(p),u===-1)||this._getKey(this._array[u])!==p)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===p);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,p){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do p(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let p=0,f=this._array.length-1;for(;f>=p;){let m=p+f>>1;const g=this._getKey(this._array[m]);if(g>h)f=m-1;else{if(!(g<h)){for(;m>0&&this._getKey(this._array[m-1])===h;)m--;return m}p=m+1}}return p}}},7226:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=u(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(g){this._idleCallback=void 0;let _=0,w=0,v=g.timeRemaining(),x=0;for(;this._i<this._tasks.length;){if(_=Date.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,Date.now()-_),w=Math.max(_,w),x=g.timeRemaining(),1.5*w>x)return v-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-_))}ms`),void this._start();v=x}this.clear()}}class f extends p{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const _=Date.now()+g;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=u(643);o.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),m=f?.get(p.cols-1),g=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);g&&m&&(g.isWrapped=m[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&m[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,m=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=m}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=u(6349),p=u(7226),f=u(3734),m=u(8437),g=u(4634),_=u(511),w=u(643),v=u(4863),x=u(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(S,b,C){this._hasScrollback=S,this._optionsService=b,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=x.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(S){return S?(this._nullCell.fg=S.fg,this._nullCell.bg=S.bg,this._nullCell.extended=S.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(S){return S?(this._whitespaceCell.fg=S.fg,this._whitespaceCell.bg=S.bg,this._whitespaceCell.extended=S.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(S,b){return new m.BufferLine(this._bufferService.cols,this.getNullCell(S),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const S=this.ybase+this.y-this.ydisp;return S>=0&&S<this._rows}_getCorrectBufferLength(S){if(!this._hasScrollback)return S;const b=S+this._optionsService.rawOptions.scrollback;return b>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(S){if(this.lines.length===0){S===void 0&&(S=m.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(S))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(S,b){const C=this.getNullCell(m.DEFAULT_ATTR_DATA);let O=0;const M=this._getCorrectBufferLength(b);if(M>this.lines.maxLength&&(this.lines.maxLength=M),this.lines.length>0){if(this._cols<S)for(let N=0;N<this.lines.length;N++)O+=+this.lines.get(N).resize(S,C);let D=0;if(this._rows<b)for(let N=this._rows;N<b;N++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(S,C)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(S,C)));else for(let N=this._rows;N>b;N--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(M<this.lines.maxLength){const N=this.lines.length-M;N>0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=M}this.x=Math.min(this.x,S-1),this.y=Math.min(this.y,b-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,S-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(S,b),this._cols>S))for(let D=0;D<this.lines.length;D++)O+=+this.lines.get(D).resize(S,C);this._cols=S,this._rows=b,this._memoryCleanupQueue.clear(),O>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let S=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,S=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return S}get _isReflowEnabled(){const S=this._optionsService.rawOptions.windowsPty;return S&&S.buildNumber?this._hasScrollback&&S.backend==="conpty"&&S.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(S,b){this._cols!==S&&(S>this._cols?this._reflowLarger(S,b):this._reflowSmaller(S,b))}_reflowLarger(S,b){const C=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,S,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(C.length>0){const O=(0,g.reflowLargerCreateNewLayout)(this.lines,C);(0,g.reflowLargerApplyNewLayout)(this.lines,O.layout),this._reflowLargerAdjustViewport(S,b,O.countRemoved)}}_reflowLargerAdjustViewport(S,b,C){const O=this.getNullCell(m.DEFAULT_ATTR_DATA);let M=C;for(;M-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new m.BufferLine(S,O))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-C,0)}_reflowSmaller(S,b){const C=this.getNullCell(m.DEFAULT_ATTR_DATA),O=[];let M=0;for(let D=this.lines.length-1;D>=0;D--){let N=this.lines.get(D);if(!N||!N.isWrapped&&N.getTrimmedLength()<=S)continue;const L=[N];for(;N.isWrapped&&D>0;)N=this.lines.get(--D),L.unshift(N);const j=this.ybase+this.y;if(j>=D&&j<D+L.length)continue;const K=L[L.length-1].getTrimmedLength(),Y=(0,g.reflowSmallerGetNewLineLengths)(L,this._cols,S),H=Y.length-L.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const te=[];for(let U=0;U<H;U++){const X=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);te.push(X)}te.length>0&&(O.push({start:D+L.length+M,newLines:te}),M+=te.length),L.push(...te);let $=Y.length-1,J=Y[$];J===0&&($--,J=Y[$]);let re=L.length-H-1,F=K;for(;re>=0;){const U=Math.min(F,J);if(L[$]===void 0)break;if(L[$].copyCellsFrom(L[re],F-U,J-U,U,!0),J-=U,J===0&&($--,J=Y[$]),F-=U,F===0){re--;const X=Math.max(re,0);F=(0,g.getWrappedLineTrimmedLength)(L,X,this._cols)}}for(let U=0;U<L.length;U++)Y[U]<S&&L[U].setCell(Y[U],C);let B=H-Q;for(;B-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+M)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+b-1)}if(O.length>0){const D=[],N=[];for(let $=0;$<this.lines.length;$++)N.push(this.lines.get($));const L=this.lines.length;let j=L-1,K=0,Y=O[K];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+M);let H=0;for(let $=Math.min(this.lines.maxLength-1,L+M-1);$>=0;$--)if(Y&&Y.start>j+H){for(let J=Y.newLines.length-1;J>=0;J--)this.lines.set($--,Y.newLines[J]);$++,D.push({index:j+1,amount:Y.newLines.length}),H+=Y.newLines.length,Y=O[++K]}else this.lines.set($,N[j--]);let Q=0;for(let $=D.length-1;$>=0;$--)D[$].index+=Q,this.lines.onInsertEmitter.fire(D[$]),Q+=D[$].amount;const te=Math.max(0,L+M-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(S,b,C=0,O){const M=this.lines.get(S);return M?M.translateToString(b,C,O):""}getWrappedRangeForLine(S){let b=S,C=S;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;C+1<this.lines.length&&this.lines.get(C+1).isWrapped;)C++;return{first:b,last:C}}setupTabStops(S){for(S!=null?this.tabs[S]||(S=this.prevStop(S)):(this.tabs={},S=0);S<this._cols;S+=this._optionsService.rawOptions.tabStopWidth)this.tabs[S]=!0}prevStop(S){for(S==null&&(S=this.x);!this.tabs[--S]&&S>0;);return S>=this._cols?this._cols-1:S<0?0:S}nextStop(S){for(S==null&&(S=this.x);!this.tabs[++S]&&S<this._cols;);return S>=this._cols?this._cols-1:S<0?0:S}clearMarkers(S){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===S&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].dispose(),this.markers.splice(S--,1);this._isClearing=!1}addMarker(S){const b=new v.Marker(S);return this.markers.push(b),b.register(this.lines.onTrim((C=>{b.line-=C,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((C=>{b.line>=C.index&&(b.line+=C.amount)}))),b.register(this.lines.onDelete((C=>{b.line>=C.index&&b.line<C.index+C.amount&&b.dispose(),b.line>C.index&&(b.line-=C.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(S){this._isClearing||this.markers.splice(this.markers.indexOf(S),1)}}},8437:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=u(3734),p=u(511),f=u(643),m=u(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let g=0;class _{constructor(v,x,S=!1){this.isWrapped=S,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const b=x||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C<v;++C)this.setCell(C,b);this.length=v}get(v){const x=this._data[3*v+0],S=2097151&x;return[this._data[3*v+1],2097152&x?this._combined[v]:S?(0,m.stringFromCodePoint)(S):"",x>>22,2097152&x?this._combined[v].charCodeAt(this._combined[v].length-1):S]}set(v,x){this._data[3*v+1]=x[f.CHAR_DATA_ATTR_INDEX],x[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=x[1],this._data[3*v+0]=2097152|v|x[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const x=this._data[3*v+0];return 2097152&x?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&x}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const x=this._data[3*v+0];return 2097152&x?this._combined[v]:2097151&x?(0,m.stringFromCodePoint)(2097151&x):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,x){return g=3*v,x.content=this._data[g+0],x.fg=this._data[g+1],x.bg=this._data[g+2],2097152&x.content&&(x.combinedData=this._combined[v]),268435456&x.bg&&(x.extended=this._extendedAttrs[v]),x}setCell(v,x){2097152&x.content&&(this._combined[v]=x.combinedData),268435456&x.bg&&(this._extendedAttrs[v]=x.extended),this._data[3*v+0]=x.content,this._data[3*v+1]=x.fg,this._data[3*v+2]=x.bg}setCellFromCodepoint(v,x,S,b){268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=x|S<<22,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}addCodepointToCell(v,x,S){let b=this._data[3*v+0];2097152&b?this._combined[v]+=(0,m.stringFromCodePoint)(x):2097151&b?(this._combined[v]=(0,m.stringFromCodePoint)(2097151&b)+(0,m.stringFromCodePoint)(x),b&=-2097152,b|=2097152):b=x|4194304,S&&(b&=-12582913,b|=S<<22),this._data[3*v+0]=b}insertCells(v,x,S){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,S),x<this.length-v){const b=new p.CellData;for(let C=this.length-v-x-1;C>=0;--C)this.setCell(v+x+C,this.loadCell(v+C,b));for(let C=0;C<x;++C)this.setCell(v+C,S)}else for(let b=v;b<this.length;++b)this.setCell(b,S);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,S)}deleteCells(v,x,S){if(v%=this.length,x<this.length-v){const b=new p.CellData;for(let C=0;C<this.length-v-x;++C)this.setCell(v+C,this.loadCell(v+x+C,b));for(let C=this.length-x;C<this.length;++C)this.setCell(C,S)}else for(let b=v;b<this.length;++b)this.setCell(b,S);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,S),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,S)}replaceCells(v,x,S,b=!1){if(b)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,S),x<this.length&&this.getWidth(x-1)===2&&!this.isProtected(x)&&this.setCellFromCodepoint(x,0,1,S);v<x&&v<this.length;)this.isProtected(v)||this.setCell(v,S),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,S),x<this.length&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x,0,1,S);v<x&&v<this.length;)this.setCell(v++,S)}resize(v,x){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const S=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*S)this._data=new Uint32Array(this._data.buffer,0,S);else{const b=new Uint32Array(S);b.set(this._data),this._data=b}for(let b=this.length;b<v;++b)this.setCell(b,x)}else{this._data=this._data.subarray(0,S);const b=Object.keys(this._combined);for(let O=0;O<b.length;O++){const M=parseInt(b[O],10);M>=v&&delete this._combined[M]}const C=Object.keys(this._extendedAttrs);for(let O=0;O<C.length;O++){const M=parseInt(C[O],10);M>=v&&delete this._extendedAttrs[M]}}return this.length=v,4*S*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,x=!1){if(x)for(let S=0;S<this.length;++S)this.isProtected(S)||this.setCell(S,v);else{this._combined={},this._extendedAttrs={};for(let S=0;S<this.length;++S)this.setCell(S,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const x in v._combined)this._combined[x]=v._combined[x];this._extendedAttrs={};for(const x in v._extendedAttrs)this._extendedAttrs[x]=v._extendedAttrs[x];this.isWrapped=v.isWrapped}clone(){const v=new _(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const x in this._combined)v._combined[x]=this._combined[x];for(const x in this._extendedAttrs)v._extendedAttrs[x]=this._extendedAttrs[x];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,x,S,b,C){const O=v._data;if(C)for(let D=b-1;D>=0;D--){for(let N=0;N<3;N++)this._data[3*(S+D)+N]=O[3*(x+D)+N];268435456&O[3*(x+D)+2]&&(this._extendedAttrs[S+D]=v._extendedAttrs[x+D])}else for(let D=0;D<b;D++){for(let N=0;N<3;N++)this._data[3*(S+D)+N]=O[3*(x+D)+N];268435456&O[3*(x+D)+2]&&(this._extendedAttrs[S+D]=v._extendedAttrs[x+D])}const M=Object.keys(v._combined);for(let D=0;D<M.length;D++){const N=parseInt(M[D],10);N>=x&&(this._combined[N-x+S]=v._combined[N])}}translateToString(v,x,S,b){x=x??0,S=S??this.length,v&&(S=Math.min(S,this.getTrimmedLength())),b&&(b.length=0);let C="";for(;x<S;){const O=this._data[3*x+0],M=2097151&O,D=2097152&O?this._combined[x]:M?(0,m.stringFromCodePoint)(M):f.WHITESPACE_CELL_CHAR;if(C+=D,b)for(let N=0;N<D.length;++N)b.push(x);x+=O>>22||1}return b&&b.push(x),C}}o.BufferLine=_},4841:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(l,o)=>{function u(h,p,f){if(p===h.length-1)return h[p].getTrimmedLength();const m=!h[p].hasContent(f-1)&&h[p].getWidth(f-1)===1,g=h[p+1].getWidth(0)===2;return m&&g?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,p,f,m,g){const _=[];for(let w=0;w<h.length-1;w++){let v=w,x=h.get(++v);if(!x.isWrapped)continue;const S=[h.get(w)];for(;v<h.length&&x.isWrapped;)S.push(x),x=h.get(++v);if(m>=w&&m<v){w+=S.length-1;continue}let b=0,C=u(S,b,p),O=1,M=0;for(;O<S.length;){const N=u(S,O,p),L=N-M,j=f-C,K=Math.min(L,j);S[b].copyCellsFrom(S[O],M,C,K,!1),C+=K,C===f&&(b++,C=0),M+=K,M===N&&(O++,M=0),C===0&&b!==0&&S[b-1].getWidth(f-1)===2&&(S[b].copyCellsFrom(S[b-1],f-1,C++,1,!1),S[b-1].setCell(f-1,g))}S[b].replaceCells(C,f,g);let D=0;for(let N=S.length-1;N>0&&(N>b||S[N].getTrimmedLength()===0);N--)D++;D>0&&(_.push(w+S.length-D),_.push(D)),w+=S.length-1}return _},o.reflowLargerCreateNewLayout=function(h,p){const f=[];let m=0,g=p[m],_=0;for(let w=0;w<h.length;w++)if(g===w){const v=p[++m];h.onDeleteEmitter.fire({index:w-_,amount:v}),w+=v-1,_+=v,g=p[++m]}else f.push(w);return{layout:f,countRemoved:_}},o.reflowLargerApplyNewLayout=function(h,p){const f=[];for(let m=0;m<p.length;m++)f.push(h.get(p[m]));for(let m=0;m<f.length;m++)h.set(m,f[m]);h.length=p.length},o.reflowSmallerGetNewLineLengths=function(h,p,f){const m=[],g=h.map(((x,S)=>u(h,S,p))).reduce(((x,S)=>x+S));let _=0,w=0,v=0;for(;v<g;){if(g-v<f){m.push(g-v);break}_+=f;const x=u(h,w,p);_>x&&(_-=x,w++);const S=h[w].getWidth(_-1)===2;S&&_--;const b=S?f-1:f;m.push(b),v+=b}return m},o.getWrappedLineTrimmedLength=u},5295:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=u(8460),p=u(844),f=u(9092);class m extends p.Disposable{constructor(_,w){super(),this._optionsService=_,this._bufferService=w,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(_){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(_),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(_,w){this._normal.resize(_,w),this._alt.resize(_,w),this.setupTabStops(_)}setupTabStops(_){this._normal.setupTabStops(_),this._alt.setupTabStops(_)}}o.BufferSet=m},511:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=u(482),p=u(643),f=u(3734);class m extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const w=new m;return w.setFromCharData(_),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(_){this.fg=_[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(_[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(_[p.CHAR_DATA_CHAR_INDEX].length===2){const v=_[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const x=_[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=x&&x<=57343?this.content=1024*(v-55296)+x-56320+65536|_[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=_[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=_[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=m},643:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=u(8460),p=u(844);class f{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=f,f._nextId=1},7116:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,o)=>{var u,h,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
113
|
-
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(o.C0=u={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(h||(o.C1=h={})),(function(f){f.ST=`${u.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=u(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(f,m,g,_){const w={type:0,cancel:!1,key:void 0},v=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=m?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=m?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=m?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=m?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(w.key=h.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=h.C0.ESC+"[Z";break}w.key=h.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,w.cancel=!0;break;case 27:w.key=h.C0.ESC,f.altKey&&(w.key=h.C0.ESC+h.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(g?"b":"[1;5D"))):w.key=m?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(g?"f":"[1;5C"))):w.key=m?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"A",g||w.key!==h.C0.ESC+"[1;3A"||(w.key=h.C0.ESC+"[1;5A")):w.key=m?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"B",g||w.key!==h.C0.ESC+"[1;3B"||(w.key=h.C0.ESC+"[1;5B")):w.key=m?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=h.C0.ESC+"[2~");break;case 46:w.key=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=v?h.C0.ESC+"[1;"+(v+1)+"H":m?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=v?h.C0.ESC+"[1;"+(v+1)+"F":m?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=h.C0.ESC+"[5;"+(v+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=h.C0.ESC+"[6;"+(v+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(g&&!_||!f.altKey||f.metaKey)!g||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=h.C0.US),f.key==="@"&&(w.key=h.C0.NUL)):f.keyCode===65&&(w.type=1);else{const x=p[f.keyCode],S=x?.[f.shiftKey?1:0];if(S)w.key=h.C0.ESC+S;else if(f.keyCode>=65&&f.keyCode<=90){const b=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(b);f.shiftKey&&(C=C.toUpperCase()),w.key=h.C0.ESC+C}else if(f.keyCode===32)w.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let b=f.code.slice(3,4);f.shiftKey||(b=b.toLowerCase()),w.key=h.C0.ESC+b,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=h.C0.DEL:f.keyCode===219?w.key=h.C0.ESC:f.keyCode===220?w.key=h.C0.FS:f.keyCode===221&&(w.key=h.C0.GS)}return w}},482:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},o.utf32ToString=function(u,h=0,p=u.length){let f="";for(let m=h;m<p;++m){let g=u[m];g>65535?(g-=65536,f+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):f+=String.fromCharCode(g)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const p=u.length;if(!p)return 0;let f=0,m=0;if(this._interim){const g=u.charCodeAt(m++);56320<=g&&g<=57343?h[f++]=1024*(this._interim-55296)+g-56320+65536:(h[f++]=this._interim,h[f++]=g),this._interim=0}for(let g=m;g<p;++g){const _=u.charCodeAt(g);if(55296<=_&&_<=56319){if(++g>=p)return this._interim=_,f;const w=u.charCodeAt(g);56320<=w&&w<=57343?h[f++]=1024*(_-55296)+w-56320+65536:(h[f++]=_,h[f++]=w)}else _!==65279&&(h[f++]=_)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const p=u.length;if(!p)return 0;let f,m,g,_,w=0,v=0,x=0;if(this.interim[0]){let C=!1,O=this.interim[0];O&=(224&O)==192?31:(240&O)==224?15:7;let M,D=0;for(;(M=63&this.interim[++D])&&D<4;)O<<=6,O|=M;const N=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=N-D;for(;x<L;){if(x>=p)return 0;if(M=u[x++],(192&M)!=128){x--,C=!0;break}this.interim[D++]=M,O<<=6,O|=63&M}C||(N===2?O<128?x--:h[w++]=O:N===3?O<2048||O>=55296&&O<=57343||O===65279||(h[w++]=O):O<65536||O>1114111||(h[w++]=O)),this.interim.fill(0)}const S=p-4;let b=x;for(;b<p;){for(;!(!(b<S)||128&(f=u[b])||128&(m=u[b+1])||128&(g=u[b+2])||128&(_=u[b+3]));)h[w++]=f,h[w++]=m,h[w++]=g,h[w++]=_,b+=4;if(f=u[b++],f<128)h[w++]=f;else if((224&f)==192){if(b>=p)return this.interim[0]=f,w;if(m=u[b++],(192&m)!=128){b--;continue}if(v=(31&f)<<6|63&m,v<128){b--;continue}h[w++]=v}else if((240&f)==224){if(b>=p)return this.interim[0]=f,w;if(m=u[b++],(192&m)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=m,w;if(g=u[b++],(192&g)!=128){b--;continue}if(v=(15&f)<<12|(63&m)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;h[w++]=v}else if((248&f)==240){if(b>=p)return this.interim[0]=f,w;if(m=u[b++],(192&m)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=m,w;if(g=u[b++],(192&g)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=m,this.interim[2]=g,w;if(_=u[b++],(192&_)!=128){b--;continue}if(v=(7&f)<<18|(63&m)<<12|(63&g)<<6|63&_,v<65536||v>1114111)continue;h[w++]=v}}return w}}},225:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=u(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;o.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let g=0;g<p.length;++g)m.fill(0,p[g][0],p[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:(function(_,w){let v,x=0,S=w.length-1;if(_<w[0][0]||_>w[S][1])return!1;for(;S>=x;)if(v=x+S>>1,_>w[v][1])x=v+1;else{if(!(_<w[v][0]))return!0;S=v-1}return!1})(g,f)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,_){let w=this.wcwidth(g),v=w===0&&_!==0;if(v){const x=h.UnicodeService.extractWidth(_);x===0?v=!1:x>w&&(w=x)}return h.UnicodeService.createPropertyValue(0,w,v)}}},5981:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=u(8460),p=u(844);class f extends p.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,_){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(_),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(_)}_innerWrite(g=0,_=!0){const w=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],x=this._action(v,_);if(x){const b=C=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(w,C);return void x.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(b)}const S=this._callbacks[this._bufferOffset];if(S&&S(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=f},5941:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function p(f,m){const g=f.toString(16),_=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}o.parseColor=function(f){if(!f)return;let m=f.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=u.exec(m);if(g){const _=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/_*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/_*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/_*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),h.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,_=[0,0,0];for(let w=0;w<3;++w){const v=parseInt(m.slice(g*w,g*w+g),16);_[w]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return _}},o.toRgbString=function(f,m=16){const[g,_,w]=f;return`rgb:${p(g,m)}/${p(_,m)}/${p(w,m)}`}},5770:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=u(482),p=u(8742),f=u(5770),m=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(_,w){this._handlers[_]===void 0&&(this._handlers[_]=[]);const v=this._handlers[_];return v.push(w),{dispose:()=>{const x=v.indexOf(w);x!==-1&&v.splice(x,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(_,w){if(this.reset(),this._ident=_,this._active=this._handlers[_]||m,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(_,w,v){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(_,w,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(_,w,v))}unhook(_,w=!0){if(this._active.length){let v=!1,x=this._active.length-1,S=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,v=w,S=this._stack.fallThrough,this._stack.paused=!1),!S&&v===!1){for(;x>=0&&(v=this._active[x].unhook(_),v!==!0);x--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,v;x--}for(;x>=0;x--)if(v=this._active[x].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",_);this._active=m,this._ident=0}};const g=new p.Params;g.addParam(0),o.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=g,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():g,this._data="",this._hitLimit=!1}put(_,w,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(_,w,v),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let w=!1;if(this._hitLimit)w=!1;else if(_&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((v=>(this._params=g,this._data="",this._hitLimit=!1,v)));return this._params=g,this._data="",this._hitLimit=!1,w}}},2015:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=u(844),p=u(8742),f=u(6242),m=u(6351);class g{constructor(x){this.table=new Uint8Array(x)}setDefault(x,S){this.table.fill(x<<4|S)}add(x,S,b,C){this.table[S<<8|x]=b<<4|C}addMany(x,S,b,C){for(let O=0;O<x.length;O++)this.table[S<<8|x[O]]=b<<4|C}}o.TransitionTable=g;const _=160;o.VT500_TRANSITION_TABLE=(function(){const v=new g(4095),x=Array.apply(null,Array(256)).map(((D,N)=>N)),S=(D,N)=>x.slice(D,N),b=S(32,127),C=S(0,24);C.push(25),C.push.apply(C,S(28,32));const O=S(0,14);let M;for(M in v.setDefault(1,0),v.addMany(b,0,2,0),O)v.addMany([24,26,153,154],M,3,0),v.addMany(S(128,144),M,3,0),v.addMany(S(144,152),M,3,0),v.add(156,M,0,0),v.add(27,M,11,1),v.add(157,M,4,8),v.addMany([152,158,159],M,0,7),v.add(155,M,11,3),v.add(144,M,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(b,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(S(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(b,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(S(64,127),3,7,0),v.addMany(S(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(S(48,60),4,8,4),v.addMany(S(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(S(32,64),6,0,6),v.add(127,6,0,6),v.addMany(S(64,127),6,0,0),v.addMany(S(32,48),3,9,5),v.addMany(S(32,48),5,9,5),v.addMany(S(48,64),5,0,6),v.addMany(S(64,127),5,7,0),v.addMany(S(32,48),4,9,5),v.addMany(S(32,48),1,9,2),v.addMany(S(32,48),2,9,2),v.addMany(S(48,127),2,10,0),v.addMany(S(48,80),1,10,0),v.addMany(S(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(S(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(S(28,32),9,0,9),v.addMany(S(32,48),9,9,12),v.addMany(S(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(S(32,128),11,0,11),v.addMany(S(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(S(28,32),10,0,10),v.addMany(S(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(S(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(S(28,32),12,0,12),v.addMany(S(32,48),12,9,12),v.addMany(S(48,64),12,0,11),v.addMany(S(64,127),12,12,13),v.addMany(S(64,127),10,12,13),v.addMany(S(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(b,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(_,0,2,0),v.add(_,8,5,8),v.add(_,6,0,6),v.add(_,11,0,11),v.add(_,13,13,13),v})();class w extends h.Disposable{constructor(x=o.VT500_TRANSITION_TABLE){super(),this._transitions=x,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(S,b,C)=>{},this._executeHandlerFb=S=>{},this._csiHandlerFb=(S,b)=>{},this._escHandlerFb=S=>{},this._errorHandlerFb=S=>S,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(x,S=[64,126]){let b=0;if(x.prefix){if(x.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=x.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(x.intermediates){if(x.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let O=0;O<x.intermediates.length;++O){const M=x.intermediates.charCodeAt(O);if(32>M||M>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=M}}if(x.final.length!==1)throw new Error("final must be a single byte");const C=x.final.charCodeAt(0);if(S[0]>C||C>S[1])throw new Error(`final must be in range ${S[0]} .. ${S[1]}`);return b<<=8,b|=C,b}identToString(x){const S=[];for(;x;)S.push(String.fromCharCode(255&x)),x>>=8;return S.reverse().join("")}setPrintHandler(x){this._printHandler=x}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(x,S){const b=this._identifier(x,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const C=this._escHandlers[b];return C.push(S),{dispose:()=>{const O=C.indexOf(S);O!==-1&&C.splice(O,1)}}}clearEscHandler(x){this._escHandlers[this._identifier(x,[48,126])]&&delete this._escHandlers[this._identifier(x,[48,126])]}setEscHandlerFallback(x){this._escHandlerFb=x}setExecuteHandler(x,S){this._executeHandlers[x.charCodeAt(0)]=S}clearExecuteHandler(x){this._executeHandlers[x.charCodeAt(0)]&&delete this._executeHandlers[x.charCodeAt(0)]}setExecuteHandlerFallback(x){this._executeHandlerFb=x}registerCsiHandler(x,S){const b=this._identifier(x);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const C=this._csiHandlers[b];return C.push(S),{dispose:()=>{const O=C.indexOf(S);O!==-1&&C.splice(O,1)}}}clearCsiHandler(x){this._csiHandlers[this._identifier(x)]&&delete this._csiHandlers[this._identifier(x)]}setCsiHandlerFallback(x){this._csiHandlerFb=x}registerDcsHandler(x,S){return this._dcsParser.registerHandler(this._identifier(x),S)}clearDcsHandler(x){this._dcsParser.clearHandler(this._identifier(x))}setDcsHandlerFallback(x){this._dcsParser.setHandlerFallback(x)}registerOscHandler(x,S){return this._oscParser.registerHandler(x,S)}clearOscHandler(x){this._oscParser.clearHandler(x)}setOscHandlerFallback(x){this._oscParser.setHandlerFallback(x)}setErrorHandler(x){this._errorHandler=x}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(x,S,b,C,O){this._parseStack.state=x,this._parseStack.handlers=S,this._parseStack.handlerPos=b,this._parseStack.transition=C,this._parseStack.chunkPos=O}parse(x,S,b){let C,O=0,M=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const N=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&L>-1){for(;L>=0&&(C=N[L](this._params),C!==!0);L--)if(C instanceof Promise)return this._parseStack.handlerPos=L,C}this._parseStack.handlers=[];break;case 4:if(b===!1&&L>-1){for(;L>=0&&(C=N[L](),C!==!0);L--)if(C instanceof Promise)return this._parseStack.handlerPos=L,C}this._parseStack.handlers=[];break;case 6:if(O=x[this._parseStack.chunkPos],C=this._dcsParser.unhook(O!==24&&O!==26,b),C)return C;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(O=x[this._parseStack.chunkPos],C=this._oscParser.end(O!==24&&O!==26,b),C)return C;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let N=D;N<S;++N){switch(O=x[N],M=this._transitions.table[this.currentState<<8|(O<160?O:_)],M>>4){case 2:for(let H=N+1;;++H){if(H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}if(++H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}if(++H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}if(++H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}}break;case 3:this._executeHandlers[O]?this._executeHandlers[O]():this._executeHandlerFb(O),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:N,code:O,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|O];let j=L?L.length-1:-1;for(;j>=0&&(C=L[j](this._params),C!==!0);j--)if(C instanceof Promise)return this._preserveStack(3,L,j,M,N),C;j<0&&this._csiHandlerFb(this._collect<<8|O,this._params),this.precedingJoinState=0;break;case 8:do switch(O){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(O-48)}while(++N<S&&(O=x[N])>47&&O<60);N--;break;case 9:this._collect<<=8,this._collect|=O;break;case 10:const K=this._escHandlers[this._collect<<8|O];let Y=K?K.length-1:-1;for(;Y>=0&&(C=K[Y](),C!==!0);Y--)if(C instanceof Promise)return this._preserveStack(4,K,Y,M,N),C;Y<0&&this._escHandlerFb(this._collect<<8|O),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|O,this._params);break;case 13:for(let H=N+1;;++H)if(H>=S||(O=x[H])===24||O===26||O===27||O>127&&O<_){this._dcsParser.put(x,N,H),N=H-1;break}break;case 14:if(C=this._dcsParser.unhook(O!==24&&O!==26),C)return this._preserveStack(6,[],0,M,N),C;O===27&&(M|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let H=N+1;;H++)if(H>=S||(O=x[H])<32||O>127&&O<_){this._oscParser.put(x,N,H),N=H-1;break}break;case 6:if(C=this._oscParser.end(O!==24&&O!==26),C)return this._preserveStack(5,[],0,M,N),C;O===27&&(M|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&M}}}o.EscapeSequenceParser=w},6242:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=u(5770),p=u(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const _=this._handlers[m];return _.push(g),{dispose:()=>{const w=_.indexOf(g);w!==-1&&_.splice(w,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,g,_){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(m,g,_);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(m,g,_))}start(){this.reset(),this._state=1}put(m,g,_){if(this._state!==3){if(this._state===1)for(;g<_;){const w=m[g++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&_-g>0&&this._put(m,g,_)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,w=this._active.length-1,v=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,_=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;w>=0&&(_=this._active[w].end(m),_!==!0);w--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,_;w--}for(;w>=0;w--)if(_=this._active[w].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",m);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,_){this._hitLimit||(this._data+=(0,p.utf32ToString)(m,g,_),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then((_=>(this._data="",this._hitLimit=!1,_)));return this._data="",this._hitLimit=!1,g}}},8742:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const u=2147483647;class h{static fromArray(f){const m=new h;if(!f.length)return m;for(let g=Array.isArray(f[0])?1:0;g<f.length;++g){const _=f[g];if(Array.isArray(_))for(let w=0;w<_.length;++w)m.addSubParam(_[w]);else m.addParam(_)}return m}constructor(f=32,m=32){if(this.maxLength=f,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let m=0;m<this.length;++m){f.push(this.params[m]);const g=this._subParamsIdx[m]>>8,_=255&this._subParamsIdx[m];_-g>0&&f.push(Array.prototype.slice.call(this._subParams,g,_))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const m=this._subParamsIdx[f]>>8,g=255&this._subParamsIdx[f];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const f={};for(let m=0;m<this.length;++m){const g=this._subParamsIdx[m]>>8,_=255&this._subParamsIdx[m];_-g>0&&(f[m]=this._subParams.slice(g,_))}return f}addDigit(f){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,_=g[m-1];g[m-1]=~_?Math.min(10*_+f,u):f}}o.Params=h},5741:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===u){h=p;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=u(3785),p=u(511);o.BufferApiView=class{constructor(f,m){this._buffer=f,this.type=m}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const m=this._buffer.lines.get(f);if(m)return new h.BufferLineApiView(m)}getNullCell(){return new p.CellData}}},3785:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=u(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new h.CellData)}translateToString(p,f,m){return this._line.translateToString(p,f,m)}}},8285:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=u(8771),p=u(8460),f=u(844);class m extends f.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=m},7975:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(p=>h(p.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((p,f)=>h(p,f.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(l,o,u){var h=this&&this.__decorate||function(v,x,S,b){var C,O=arguments.length,M=O<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,x,S,b);else for(var D=v.length-1;D>=0;D--)(C=v[D])&&(M=(O<3?C(M):O>3?C(x,S,M):C(x,S))||M);return O>3&&M&&Object.defineProperty(x,S,M),M},p=this&&this.__param||function(v,x){return function(S,b){x(S,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=u(8460),m=u(844),g=u(5295),_=u(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(v,this))}resize(v,x){this.cols=v,this.rows=x,this.buffers.resize(v,x),this._onResize.fire({cols:v,rows:x})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,x=!1){const S=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===v.fg&&b.getBg(0)===v.bg||(b=S.getBlankLine(v,x),this._cachedBlankLine=b),b.isWrapped=x;const C=S.ybase+S.scrollTop,O=S.ybase+S.scrollBottom;if(S.scrollTop===0){const M=S.lines.isFull;O===S.lines.length-1?M?S.lines.recycle().copyFrom(b):S.lines.push(b.clone()):S.lines.splice(O+1,0,b.clone()),M?this.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this.isUserScrolling||S.ydisp++)}else{const M=O-C+1;S.lines.shiftElements(C+1,M-1,-1),S.lines.set(O,b.clone())}this.isUserScrolling||(S.ydisp=S.ybase),this._onScroll.fire(S.ydisp)}scrollLines(v,x,S){const b=this.buffer;if(v<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else v+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const C=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+v,b.ybase),0),C!==b.ydisp&&(x||this._onScroll.fire(b.ydisp))}};o.BufferService=w=h([p(0,_.IOptionsService)],w)},7994:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(l,o,u){var h=this&&this.__decorate||function(b,C,O,M){var D,N=arguments.length,L=N<3?C:M===null?M=Object.getOwnPropertyDescriptor(C,O):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,C,O,M);else for(var j=b.length-1;j>=0;j--)(D=b[j])&&(L=(N<3?D(L):N>3?D(C,O,L):D(C,O))||L);return N>3&&L&&Object.defineProperty(C,O,L),L},p=this&&this.__param||function(b,C){return function(O,M){C(O,M,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=u(2585),m=u(8460),g=u(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,C){let O=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(O|=64,O|=b.action):(O|=3&b.button,4&b.button&&(O|=64),8&b.button&&(O|=128),b.action===32?O|=32:b.action!==0||C||(O|=3)),O}const v=String.fromCharCode,x={DEFAULT:b=>{const C=[w(b,!1)+32,b.col+32,b.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:b=>{const C=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${C}`},SGR_PIXELS:b=>{const C=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${C}`}};let S=o.CoreMouseService=class extends g.Disposable{constructor(b,C){super(),this._bufferService=b,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const O of Object.keys(_))this.addProtocol(O,_[O]);for(const O of Object.keys(x))this.addEncoding(O,x[O]);this.reset()}addProtocol(b,C){this._protocols[b]=C}addEncoding(b,C){this._encodings[b]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const C=this._encodings[this._activeEncoding](b);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,C,O){if(O){if(b.x!==C.x||b.y!==C.y)return!1}else if(b.col!==C.col||b.row!==C.row)return!1;return b.button===C.button&&b.action===C.action&&b.ctrl===C.ctrl&&b.alt===C.alt&&b.shift===C.shift}};o.CoreMouseService=S=h([p(0,f.IBufferService),p(1,f.ICoreService)],S)},6975:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var L=S.length-1;L>=0;L--)(M=S[L])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=u(1439),m=u(8460),g=u(844),_=u(2585),w=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let x=o.CoreService=class extends g.Disposable{constructor(S,b,C){super(),this._bufferService=S,this._logService=b,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(v)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(v)}triggerDataEvent(S,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${S}"`,(()=>S.split("").map((O=>O.charCodeAt(0))))),this._onData.fire(S)}triggerBinaryEvent(S){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${S}"`,(()=>S.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(S))}};o.CoreService=x=h([p(0,_.IBufferService),p(1,_.ILogService),p(2,_.IOptionsService)],x)},9074:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=u(8055),p=u(8460),f=u(844),m=u(6106);let g=0,_=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((S=>S?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(S){if(S.marker.isDisposed)return;const b=new v(S);if(b){const C=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),C.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const S of this._decorations.values())S.dispose();this._decorations.clear()}*getDecorationsAtCell(S,b,C){let O=0,M=0;for(const D of this._decorations.getKeyIterator(b))O=D.options.x??0,M=O+(D.options.width??1),S>=O&&S<M&&(!C||(D.options.layer??"bottom")===C)&&(yield D)}forEachDecorationAtCell(S,b,C,O){this._decorations.forEachByKey(b,(M=>{g=M.options.x??0,_=g+(M.options.width??1),S>=g&&S<_&&(!C||(M.options.layer??"bottom")===C)&&O(M)}))}}o.DecorationService=w;class v extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(S){super(),this.options=S,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=S.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=u(2585),p=u(8343);class f{constructor(...g){this._entries=new Map;for(const[_,w]of g)this.set(_,w)}set(g,_){const w=this._entries.get(g);return this._entries.set(g,_),w}forEach(g){for(const[_,w]of this._entries.entries())g(_,w)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const _=(0,p.getServiceDependencies)(m).sort(((x,S)=>x.index-S.index)),w=[];for(const x of _){const S=this._services.get(x.id);if(!S)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${x.id}.`);w.push(S)}const v=_.length>0?_[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new m(...g,...w)}}},7866:function(l,o,u){var h=this&&this.__decorate||function(v,x,S,b){var C,O=arguments.length,M=O<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,x,S,b);else for(var D=v.length-1;D>=0;D--)(C=v[D])&&(M=(O<3?C(M):O>3?C(x,S,M):C(x,S))||M);return O>3&&M&&Object.defineProperty(x,S,M),M},p=this&&this.__param||function(v,x){return function(S,b){x(S,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=u(844),m=u(2585),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let _,w=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),_=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let x=0;x<v.length;x++)typeof v[x]=="function"&&(v[x]=v[x]())}_log(v,x,S){this._evalLazyOptionalParams(S),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+x,...S)}trace(v,...x){this._logLevel<=m.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,v,x)}debug(v,...x){this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,v,x)}info(v,...x){this._logLevel<=m.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,v,x)}warn(v,...x){this._logLevel<=m.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,v,x)}error(v,...x){this._logLevel<=m.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,v,x)}};o.LogService=w=h([p(0,m.IOptionsService)],w),o.setTraceLogger=function(v){_=v},o.traceCall=function(v,x,S){if(typeof S.value!="function")throw new Error("not supported");const b=S.value;S.value=function(...C){if(_.logLevel!==m.LogLevelEnum.TRACE)return b.apply(this,C);_.trace(`GlyphRenderer#${b.name}(${C.map((M=>JSON.stringify(M))).join(", ")})`);const O=b.apply(this,C);return _.trace(`GlyphRenderer#${b.name} return`,O),O}}},7302:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=u(8460),p=u(844),f=u(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const x in w)if(x in v)try{const S=w[x];v[x]=this._sanitizeAndValidateOption(x,S)}catch(S){console.error(S)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,v){return this.onOptionChange((x=>{x===w&&v(this.rawOptions[w])}))}onMultipleOptionChange(w,v){return this.onOptionChange((x=>{w.indexOf(x)!==-1&&v()}))}_setupOptions(){const w=x=>{if(!(x in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);return this.rawOptions[x]},v=(x,S)=>{if(!(x in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);S=this._sanitizeAndValidateOption(x,S),this.rawOptions[x]!==S&&(this.rawOptions[x]=S,this._onOptionChange.fire(x))};for(const x in this.rawOptions){const S={get:w.bind(this,x),set:v.bind(this,x)};Object.defineProperty(this.options,x,S)}}_sanitizeAndValidateOption(w,v){switch(w){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[w]),!(function(x){return x==="block"||x==="underline"||x==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${w}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=m.includes(v)?v:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${w} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${w} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=g},2660:function(l,o,u){var h=this&&this.__decorate||function(g,_,w,v){var x,S=arguments.length,b=S<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,w):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(g,_,w,v);else for(var C=g.length-1;C>=0;C--)(x=g[C])&&(b=(S<3?x(b):S>3?x(_,w,b):x(_,w))||b);return S>3&&b&&Object.defineProperty(_,w,b),b},p=this&&this.__param||function(g,_){return function(w,v){_(w,v,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=u(2585);let m=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const _=this._bufferService.buffer;if(g.id===void 0){const C=_.addMarker(_.ybase+_.y),O={data:g,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(O,C))),this._dataByLinkId.set(O.id,O),O.id}const w=g,v=this._getEntryIdKey(w),x=this._entriesWithId.get(v);if(x)return this.addLineToLink(x.id,_.ybase+_.y),x.id;const S=_.addMarker(_.ybase+_.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(b,S))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(g,_){const w=this._dataByLinkId.get(g);if(w&&w.lines.every((v=>v.line!==_))){const v=this._bufferService.buffer.addMarker(_);w.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(w,v)))}}getLinkData(g){return this._dataByLinkId.get(g)?.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,_){const w=g.lines.indexOf(_);w!==-1&&(g.lines.splice(w,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=m=h([p(0,f.IBufferService)],m)},8343:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const u="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[h]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const f=function(m,g,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,v,x){v[u]===v?v[h].push({id:w,index:x}):(v[h]=[{id:w,index:x}],v[u]=v)})(f,m,_)};return f.toString=()=>p,o.serviceRegistry.set(p,f),f}},2585:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=u(8343);var p;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=u(8460),p=u(225);class f{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,_,w=!1){return(16777215&g)<<3|(3&_)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const g=new p.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let _=0,w=0;const v=g.length;for(let x=0;x<v;++x){let S=g.charCodeAt(x);if(55296<=S&&S<=56319){if(++x>=v)return _+this.wcwidth(S);const O=g.charCodeAt(x);56320<=O&&O<=57343?S=1024*(S-55296)+O-56320+65536:_+=this.wcwidth(O)}const b=this.charProperties(S,w);let C=f.extractWidth(b);f.extractShouldJoin(b)&&(C-=f.extractWidth(w)),_+=C,w=b}return _}charProperties(g,_){return this._activeProvider.charProperties(g,_)}}o.UnicodeService=f}},i={};function r(l){var o=i[l];if(o!==void 0)return o.exports;var u=i[l]={exports:{}};return t[l].call(u.exports,u,u.exports,r),u.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const o=r(9042),u=r(3236),h=r(844),p=r(5741),f=r(8285),m=r(7975),g=r(7090),_=["cols","rows"];class w extends h.Disposable{constructor(x){super(),this._core=this.register(new u.Terminal(x)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const S=C=>this._core.options[C],b=(C,O)=>{this._checkReadonlyOptions(C),this._core.options[C]=O};for(const C in this._core.options){const O={get:S.bind(this,C),set:b.bind(this,C)};Object.defineProperty(this._publicOptions,C,O)}}_checkReadonlyOptions(x){if(_.includes(x))throw new Error(`Option "${x}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const x=this._core.coreService.decPrivateModes;let S="none";switch(this._core.coreMouseService.activeProtocol){case"X10":S="x10";break;case"VT200":S="vt200";break;case"DRAG":S="drag";break;case"ANY":S="any"}return{applicationCursorKeysMode:x.applicationCursorKeys,applicationKeypadMode:x.applicationKeypad,bracketedPasteMode:x.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:S,originMode:x.origin,reverseWraparoundMode:x.reverseWraparound,sendFocusMode:x.sendFocus,wraparoundMode:x.wraparound}}get options(){return this._publicOptions}set options(x){for(const S in x)this._publicOptions[S]=x[S]}blur(){this._core.blur()}focus(){this._core.focus()}input(x,S=!0){this._core.input(x,S)}resize(x,S){this._verifyIntegers(x,S),this._core.resize(x,S)}open(x){this._core.open(x)}attachCustomKeyEventHandler(x){this._core.attachCustomKeyEventHandler(x)}attachCustomWheelEventHandler(x){this._core.attachCustomWheelEventHandler(x)}registerLinkProvider(x){return this._core.registerLinkProvider(x)}registerCharacterJoiner(x){return this._checkProposedApi(),this._core.registerCharacterJoiner(x)}deregisterCharacterJoiner(x){this._checkProposedApi(),this._core.deregisterCharacterJoiner(x)}registerMarker(x=0){return this._verifyIntegers(x),this._core.registerMarker(x)}registerDecoration(x){return this._checkProposedApi(),this._verifyPositiveIntegers(x.x??0,x.width??0,x.height??0),this._core.registerDecoration(x)}hasSelection(){return this._core.hasSelection()}select(x,S,b){this._verifyIntegers(x,S,b),this._core.select(x,S,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(x,S){this._verifyIntegers(x,S),this._core.selectLines(x,S)}dispose(){super.dispose()}scrollLines(x){this._verifyIntegers(x),this._core.scrollLines(x)}scrollPages(x){this._verifyIntegers(x),this._core.scrollPages(x)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(x){this._verifyIntegers(x),this._core.scrollToLine(x)}clear(){this._core.clear()}write(x,S){this._core.write(x,S)}writeln(x,S){this._core.write(x),this._core.write(`\r
|
|
114
|
-
`,S)}paste(x){this._core.paste(x)}refresh(x,S){this._verifyIntegers(x,S),this._core.refresh(x,S)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(x){this._addonManager.loadAddon(this,x)}static get strings(){return o}_verifyIntegers(...x){for(const S of x)if(S===1/0||isNaN(S)||S%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...x){for(const S of x)if(S&&(S===1/0||isNaN(S)||S%1!=0||S<0))throw new Error("This API only accepts positive integers")}}l.Terminal=w})(),a})()))})(z_)),z_.exports}var Vq=qq();var Wq=2,$q=1,Gq=class{activate(n){this._terminal=n}dispose(){}fit(){let n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;let e=this._terminal._core;(this._terminal.rows!==n.rows||this._terminal.cols!==n.cols)&&(e._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let n=this._terminal._core._renderService.dimensions;if(n.css.cell.width===0||n.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,t=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(t.getPropertyValue("height")),r=Math.max(0,parseInt(t.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),l={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},o=l.top+l.bottom,u=l.right+l.left,h=i-o,p=r-u-e;return{cols:Math.max(Wq,Math.floor(p/n.css.cell.width)),rows:Math.max($q,Math.floor(h/n.css.cell.height))}}};var P_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Kq=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Ei;function Yq(n,e){let t=0,i=e.length-1,r;if(n<e[0][0]||n>e[i][1])return!1;for(;i>=t;)if(r=t+i>>1,n>e[r][1])t=r+1;else if(n<e[r][0])i=r-1;else return!0;return!1}var Xq=class{constructor(){if(this.version="6",!Ei){Ei=new Uint8Array(65536),Ei.fill(1),Ei[0]=0,Ei.fill(0,1,32),Ei.fill(0,127,160),Ei.fill(2,4352,4448),Ei[9001]=2,Ei[9002]=2,Ei.fill(2,11904,42192),Ei[12351]=1,Ei.fill(2,44032,55204),Ei.fill(2,63744,64256),Ei.fill(2,65040,65050),Ei.fill(2,65072,65136),Ei.fill(2,65280,65377),Ei.fill(2,65504,65511);for(let n=0;n<P_.length;++n)Ei.fill(0,P_[n][0],P_[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?Ei[n]:Yq(n,Kq)?0:n>=131072&&n<=196605||n>=196608&&n<=262141?2:1}charProperties(n,e){let t=this.wcwidth(n),i=t===0&&e!==0;if(i){let r=im.extractWidth(e);r===0?i=!1:r>t&&(t=r)}return im.createPropertyValue(0,t,i)}},Zq=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(n){setTimeout(()=>{throw n.stack?sE.isErrorNoTelemetry(n)?new sE(n.message+`
|
|
115
|
-
|
|
116
|
-
`+n.stack):new Error(n.message+`
|
|
117
|
-
|
|
118
|
-
`+n.stack):n},0)}}addListener(n){return this.listeners.push(n),()=>{this._removeListener(n)}}emit(n){this.listeners.forEach(e=>{e(n)})}_removeListener(n){this.listeners.splice(this.listeners.indexOf(n),1)}setUnexpectedErrorHandler(n){this.unexpectedErrorHandler=n}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(n){this.unexpectedErrorHandler(n),this.emit(n)}onUnexpectedExternalError(n){this.unexpectedErrorHandler(n)}},Jq=new Zq;function F_(n){Qq(n)||Jq.onUnexpectedError(n)}var A0="Canceled";function Qq(n){return n instanceof eV?!0:n instanceof Error&&n.name===A0&&n.message===A0}var eV=class extends Error{constructor(){super(A0),this.name=this.message}},sE=class k0 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof k0)return e;let t=new k0;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function tV(n,e){let t=this,i=!1,r;return function(){return i||(i=!0,e||(r=n.apply(t,arguments))),r}}var nV;(n=>{function e(a){return a<0}n.isLessThan=e;function t(a){return a<=0}n.isLessThanOrEqual=t;function i(a){return a>0}n.isGreaterThan=i;function r(a){return a===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(nV||={});var ok;(n=>{function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}n.is=e;let t=Object.freeze([]);function i(){return t}n.empty=i;function*r(C){yield C}n.single=r;function a(C){return e(C)?C:r(C)}n.wrap=a;function l(C){return C||t}n.from=l;function*o(C){for(let O=C.length-1;O>=0;O--)yield C[O]}n.reverse=o;function u(C){return!C||C[Symbol.iterator]().next().done===!0}n.isEmpty=u;function h(C){return C[Symbol.iterator]().next().value}n.first=h;function p(C,O){let M=0;for(let D of C)if(O(D,M++))return!0;return!1}n.some=p;function f(C,O){for(let M of C)if(O(M))return M}n.find=f;function*m(C,O){for(let M of C)O(M)&&(yield M)}n.filter=m;function*g(C,O){let M=0;for(let D of C)yield O(D,M++)}n.map=g;function*_(C,O){let M=0;for(let D of C)yield*O(D,M++)}n.flatMap=_;function*w(...C){for(let O of C)yield*O}n.concat=w;function v(C,O,M){let D=M;for(let N of C)D=O(D,N);return D}n.reduce=v;function*x(C,O,M=C.length){for(O<0&&(O+=C.length),M<0?M+=C.length:M>C.length&&(M=C.length);O<M;O++)yield C[O]}n.slice=x;function S(C,O=Number.POSITIVE_INFINITY){let M=[];if(O===0)return[M,C];let D=C[Symbol.iterator]();for(let N=0;N<O;N++){let L=D.next();if(L.done)return[M,n.empty()];M.push(L.value)}return[M,{[Symbol.iterator](){return D}}]}n.consume=S;async function b(C){let O=[];for await(let M of C)O.push(M);return Promise.resolve(O)}n.asyncToArray=b})(ok||={});function lk(n){if(ok.is(n)){let e=[];for(let t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function iV(...n){return ck(()=>lk(n))}function ck(n){return{dispose:tV(()=>{n()})}}var uk=class hk{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lk(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?hk.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};uk.DISABLE_DISPOSED_WARNING=!1;var Kb=uk,nm=class{constructor(){this._store=new Kb,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};nm.None=Object.freeze({dispose(){}});var rV=globalThis.performance&&typeof globalThis.performance.now=="function",sV=class dk{static create(e){return new dk(e)}constructor(e){this._now=rV&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},aV;(n=>{n.None=()=>nm.None;function e(Y,H){return f(Y,()=>{},0,void 0,!0,void 0,H)}n.defer=e;function t(Y){return(H,Q=null,te)=>{let $=!1,J;return J=Y(re=>{if(!$)return J?J.dispose():$=!0,H.call(Q,re)},null,te),$&&J.dispose(),J}}n.once=t;function i(Y,H,Q){return h((te,$=null,J)=>Y(re=>te.call($,H(re)),null,J),Q)}n.map=i;function r(Y,H,Q){return h((te,$=null,J)=>Y(re=>{H(re),te.call($,re)},null,J),Q)}n.forEach=r;function a(Y,H,Q){return h((te,$=null,J)=>Y(re=>H(re)&&te.call($,re),null,J),Q)}n.filter=a;function l(Y){return Y}n.signal=l;function o(...Y){return(H,Q=null,te)=>{let $=iV(...Y.map(J=>J(re=>H.call(Q,re))));return p($,te)}}n.any=o;function u(Y,H,Q,te){let $=Q;return i(Y,J=>($=H($,J),$),te)}n.reduce=u;function h(Y,H){let Q,te={onWillAddFirstListener(){Q=Y($.fire,$)},onDidRemoveLastListener(){Q?.dispose()}},$=new Io(te);return H?.add($),$.event}function p(Y,H){return H instanceof Array?H.push(Y):H&&H.add(Y),Y}function f(Y,H,Q=100,te=!1,$=!1,J,re){let F,B,U,X=0,V,_e={leakWarningThreshold:J,onWillAddFirstListener(){F=Y(Ie=>{X++,B=H(B,Ie),te&&!U&&(Ee.fire(B),B=void 0),V=()=>{let ae=B;B=void 0,U=void 0,(!te||X>1)&&Ee.fire(ae),X=0},typeof Q=="number"?(clearTimeout(U),U=setTimeout(V,Q)):U===void 0&&(U=0,queueMicrotask(V))})},onWillRemoveListener(){$&&X>0&&V?.()},onDidRemoveLastListener(){V=void 0,F.dispose()}},Ee=new Io(_e);return re?.add(Ee),Ee.event}n.debounce=f;function m(Y,H=0,Q){return n.debounce(Y,(te,$)=>te?(te.push($),te):[$],H,void 0,!0,void 0,Q)}n.accumulate=m;function g(Y,H=(te,$)=>te===$,Q){let te=!0,$;return a(Y,J=>{let re=te||!H(J,$);return te=!1,$=J,re},Q)}n.latch=g;function _(Y,H,Q){return[n.filter(Y,H,Q),n.filter(Y,te=>!H(te),Q)]}n.split=_;function w(Y,H=!1,Q=[],te){let $=Q.slice(),J=Y(B=>{$?$.push(B):F.fire(B)});te&&te.add(J);let re=()=>{$?.forEach(B=>F.fire(B)),$=null},F=new Io({onWillAddFirstListener(){J||(J=Y(B=>F.fire(B)),te&&te.add(J))},onDidAddFirstListener(){$&&(H?setTimeout(re):re())},onDidRemoveLastListener(){J&&J.dispose(),J=null}});return te&&te.add(F),F.event}n.buffer=w;function v(Y,H){return(Q,te,$)=>{let J=H(new S);return Y(function(re){let F=J.evaluate(re);F!==x&&Q.call(te,F)},void 0,$)}}n.chain=v;let x=Symbol("HaltChainable");class S{constructor(){this.steps=[]}map(H){return this.steps.push(H),this}forEach(H){return this.steps.push(Q=>(H(Q),Q)),this}filter(H){return this.steps.push(Q=>H(Q)?Q:x),this}reduce(H,Q){let te=Q;return this.steps.push($=>(te=H(te,$),te)),this}latch(H=(Q,te)=>Q===te){let Q=!0,te;return this.steps.push($=>{let J=Q||!H($,te);return Q=!1,te=$,J?$:x}),this}evaluate(H){for(let Q of this.steps)if(H=Q(H),H===x)break;return H}}function b(Y,H,Q=te=>te){let te=(...F)=>re.fire(Q(...F)),$=()=>Y.on(H,te),J=()=>Y.removeListener(H,te),re=new Io({onWillAddFirstListener:$,onDidRemoveLastListener:J});return re.event}n.fromNodeEventEmitter=b;function C(Y,H,Q=te=>te){let te=(...F)=>re.fire(Q(...F)),$=()=>Y.addEventListener(H,te),J=()=>Y.removeEventListener(H,te),re=new Io({onWillAddFirstListener:$,onDidRemoveLastListener:J});return re.event}n.fromDOMEventEmitter=C;function O(Y){return new Promise(H=>t(Y)(H))}n.toPromise=O;function M(Y){let H=new Io;return Y.then(Q=>{H.fire(Q)},()=>{H.fire(void 0)}).finally(()=>{H.dispose()}),H.event}n.fromPromise=M;function D(Y,H){return Y(Q=>H.fire(Q))}n.forward=D;function N(Y,H,Q){return H(Q),Y(te=>H(te))}n.runAndSubscribe=N;class L{constructor(H,Q){this._observable=H,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{H.addObserver(this)},onDidRemoveLastListener:()=>{H.removeObserver(this)}};this.emitter=new Io(te),Q&&Q.add(this.emitter)}beginUpdate(H){this._counter++}handlePossibleChange(H){}handleChange(H,Q){this._hasChanged=!0}endUpdate(H){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function j(Y,H){return new L(Y,H).emitter.event}n.fromObservable=j;function K(Y){return(H,Q,te)=>{let $=0,J=!1,re={beginUpdate(){$++},endUpdate(){$--,$===0&&(Y.reportChanges(),J&&(J=!1,H.call(Q)))},handlePossibleChange(){},handleChange(){J=!0}};Y.addObserver(re),Y.reportChanges();let F={dispose(){Y.removeObserver(re)}};return te instanceof Kb?te.add(F):Array.isArray(te)&&te.push(F),F}}n.fromObservableLight=K})(aV||={});var T0=class M0{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${M0._idPool++}`,M0.all.add(this)}start(e){this._stopWatch=new sV,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};T0.all=new Set,T0._idPool=0;var oV=T0,lV=-1,fk=class pk{constructor(e,t,i=(pk._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[a,l]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${l}):`;console.warn(o),console.warn(a);let u=new hV(o,a);this._errorHandler(u)}return()=>{let a=this._stacks.get(e.value)||0;this._stacks.set(e.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[i,r]of this._stacks)(!e||t<r)&&(e=[i,r],t=r);return e}};fk._idPool=1;var cV=fk,uV=class mk{constructor(e){this.value=e}static create(){let e=new Error;return new mk(e.stack??"")}print(){console.warn(this.value.split(`
|
|
119
|
-
`).slice(2).join(`
|
|
120
|
-
`))}},hV=class extends Error{constructor(n,e){super(n),this.name="ListenerLeakError",this.stack=e}},dV=class extends Error{constructor(n,e){super(n),this.name="ListenerRefusalError",this.stack=e}},fV=0,U_=class{constructor(n){this.value=n,this.id=fV++}},pV=2,mV,Io=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new cV(n?.onListenerError??F_,this._options?.leakWarningThreshold??lV):void 0,this._perfMon=this._options?._profName?new oV(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(n,e,t)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new dV(`${l}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||F_)(u),nm.None}if(this._disposed)return nm.None;e&&(n=n.bind(e));let i=new U_(n),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=uV.create(),r=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof U_?(this._deliveryQueue??=new gV,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=ck(()=>{r?.(),this._removeListener(i)});return t instanceof Kb?t.add(a):Array.isArray(t)&&t.push(a),a},this._event}_removeListener(n){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,t=e.indexOf(n);if(t===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[t]=void 0;let i=this._deliveryQueue.current===this;if(this._size*pV<=e.length){let r=0;for(let a=0;a<e.length;a++)e[a]?e[r++]=e[a]:i&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=r}}_deliver(n,e){if(!n)return;let t=this._options?.onListenerError||F_;if(!t){n.value(e);return}try{n.value(e)}catch(i){t(i)}}_deliverQueue(n){let e=n.current._listeners;for(;n.i<n.end;)this._deliver(e[n.i++],n.value);n.reset()}fire(n){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof U_)this._deliver(this._listeners,n);else{let e=this._deliveryQueue;e.enqueue(this,n,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},gV=class{constructor(){this.i=-1,this.end=0}enqueue(n,e,t){this.i=0,this.end=t,this.current=n,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},im=class Dp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Io,this.onChange=this._onChange.event;let e=new Xq;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,i=!1){return(e&16777215)<<3|(t&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,i=0,r=e.length;for(let a=0;a<r;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=r)return t+this.wcwidth(l);let h=e.charCodeAt(a);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:t+=this.wcwidth(h)}let o=this.charProperties(l,i),u=Dp.extractWidth(o);Dp.extractShouldJoin(o)&&(u-=Dp.extractWidth(i)),t+=u,i=o}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},j_=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],yV=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],H_=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_V=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],Na;function aE(n,e){let t=0,i=e.length-1,r;if(n<e[0][0]||n>e[i][1])return!1;for(;i>=t;)if(r=t+i>>1,n>e[r][1])t=r+1;else if(n<e[r][0])i=r-1;else return!0;return!1}var bV=class{constructor(){if(this.version="11",!Na){Na=new Uint8Array(65536),Na.fill(1),Na[0]=0,Na.fill(0,1,32),Na.fill(0,127,160);for(let n=0;n<j_.length;++n)Na.fill(0,j_[n][0],j_[n][1]+1);for(let n=0;n<H_.length;++n)Na.fill(2,H_[n][0],H_[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?Na[n]:aE(n,yV)?0:aE(n,_V)?2:1}charProperties(n,e){let t=this.wcwidth(n),i=t===0&&e!==0;if(i){let r=im.extractWidth(e);r===0?i=!1:r>t&&(t=r)}return im.createPropertyValue(0,t,i)}},vV=class{activate(n){n.unicode.register(new bV)}dispose(){}};var xV=class{constructor(n,e,t,i={}){this._terminal=n,this._regex=e,this._handler=t,this._options=i}provideLinks(n,e){let t=wV.computeLink(n,this._regex,this._terminal,this._handler);e(this._addCallbacks(t))}_addCallbacks(n){return n.map(e=>(e.leave=this._options.leave,e.hover=(t,i)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,i,r)}},e))}};function SV(n){try{let e=new URL(n),t=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return n.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())}catch{return!1}}var wV=class Ip{static computeLink(e,t,i,r){let a=new RegExp(t.source,(t.flags||"")+"g"),[l,o]=Ip._getWindowedLineStrings(e-1,i),u=l.join(""),h,p=[];for(;h=a.exec(u);){let f=h[0];if(!SV(f))continue;let[m,g]=Ip._mapStrIdx(i,o,0,h.index),[_,w]=Ip._mapStrIdx(i,m,g,f.length);if(m===-1||g===-1||_===-1||w===-1)continue;let v={start:{x:g+1,y:m+1},end:{x:w,y:_+1}};p.push({range:v,text:f,activate:r})}return p}static _getWindowedLineStrings(e,t){let i,r=e,a=e,l=0,o="",u=[];if(i=t.buffer.active.getLine(e)){let h=i.translateToString(!0);if(i.isWrapped&&h[0]!==" "){for(l=0;(i=t.buffer.active.getLine(--r))&&l<2048&&(o=i.translateToString(!0),l+=o.length,u.push(o),!(!i.isWrapped||o.indexOf(" ")!==-1)););u.reverse()}for(u.push(h),l=0;(i=t.buffer.active.getLine(++a))&&i.isWrapped&&l<2048&&(o=i.translateToString(!0),l+=o.length,u.push(o),o.indexOf(" ")===-1););}return[u,r]}static _mapStrIdx(e,t,i,r){let a=e.buffer.active,l=a.getNullCell(),o=i;for(;r;){let u=a.getLine(t);if(!u)return[-1,-1];for(let h=o;h<u.length;++h){u.getCell(h,l);let p=l.getChars();if(l.getWidth()&&(r-=p.length||1,h===u.length-1&&p==="")){let f=a.getLine(t+1);f&&f.isWrapped&&(f.getCell(0,l),l.getWidth()===2&&(r+=1))}if(r<0)return[t,h]}t++,o=0}return[t,o]}},CV=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function EV(n,e){let t=window.open();if(t){try{t.opener=null}catch{}t.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var AV=class{constructor(n=EV,e={}){this._handler=n,this._options=e}activate(n){this._terminal=n;let e=this._options,t=e.urlRegex||CV;this._linkProvider=this._terminal.registerLinkProvider(new xV(this._terminal,t,this._handler,e))}dispose(){this._linkProvider?.dispose()}};const Ni={default:{background:"#0a0a1a",foreground:"#e0e0e0",cursor:"#e0e0e0",cursorAccent:"#0a0a1a",selectionBackground:"rgba(0,229,255,0.3)",selectionForeground:"#ffffff",black:"#0a0a1a",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#00e5ff",white:"#e0e0e0",brightBlack:"#555555",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"},dark:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1e1e1e",selectionBackground:"rgba(255,255,255,0.15)",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"},monokai:{background:"#272822",foreground:"#f8f8f2",cursor:"#f8f8f2",cursorAccent:"#272822",selectionBackground:"rgba(73,72,62,0.6)",selectionForeground:"#ffffff",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#f4bf75",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#f92672",brightGreen:"#a6e22e",brightYellow:"#f4bf75",brightBlue:"#66d9ef",brightMagenta:"#ae81ff",brightCyan:"#a1efe4",brightWhite:"#f9f8f5"},dracula:{background:"#282a36",foreground:"#f8f8f2",cursor:"#f8f8f2",cursorAccent:"#282a36",selectionBackground:"rgba(68,71,90,0.6)",selectionForeground:"#ffffff",black:"#21222c",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"},"solarized-dark":{background:"#002b36",foreground:"#839496",cursor:"#839496",cursorAccent:"#002b36",selectionBackground:"rgba(7,54,66,0.6)",selectionForeground:"#93a1a1",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#586e75",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"},nord:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",cursorAccent:"#2e3440",selectionBackground:"rgba(67,76,94,0.6)",selectionForeground:"#eceff4",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"},"github-dark":{background:"#0d1117",foreground:"#c9d1d9",cursor:"#c9d1d9",cursorAccent:"#0d1117",selectionBackground:"rgba(56,139,253,0.25)",selectionForeground:"#ffffff",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"}};function kV(){const n=getComputedStyle(document.body),e=r=>n.getPropertyValue(r).trim(),t=e("--bg-primary")||Ni.default.background,i=e("--text-primary")||Ni.default.foreground;return{background:t,foreground:i,cursor:i,cursorAccent:t,selectionBackground:"rgba(255,255,255,0.18)",selectionForeground:"#ffffff",black:t,red:e("--accent-red")||Ni.default.red,green:e("--accent-green")||Ni.default.green,yellow:e("--accent-orange")||Ni.default.yellow,blue:e("--accent-cyan")||Ni.default.blue,magenta:e("--accent-purple")||Ni.default.magenta,cyan:e("--accent-cyan")||Ni.default.cyan,white:i,brightBlack:e("--text-dim")||Ni.default.brightBlack,brightRed:e("--accent-red")||Ni.default.brightRed,brightGreen:e("--accent-green")||Ni.default.brightGreen,brightYellow:e("--accent-orange")||Ni.default.brightYellow,brightBlue:e("--accent-cyan")||Ni.default.brightBlue,brightMagenta:e("--accent-purple")||Ni.default.brightMagenta,brightCyan:e("--accent-cyan")||Ni.default.brightCyan,brightWhite:"#ffffff"}}function TV(){return Object.keys(Ni)}function q_(n){return n==="auto"?kV():Ni[n]||Ni.default}function MV(n){const e=n.buffer.active;return e.viewportY>=e.baseY}function RV(){const n=window.innerWidth;return n<=480?11:n<=640?12:14}function Xc(n,e,t,i){n&&n.readyState===1&&t>0&&i>0&&n.send(JSON.stringify({type:"terminal_resize",terminalId:e,cols:t,rows:i}))}function oE(n,e,t,i,r){requestAnimationFrame(()=>{!r.current||r.current.terminalId!==e||(i.fit(),Xc(n,e,t.cols,t.rows),t.refresh(0,t.rows-1),r.current&&(r.current.layoutReady=!0))})}function OV({ws:n,themeName:e="auto"}){const t=W.useRef(null),i=W.useRef(null),r=W.useRef(new Map),a=W.useRef(new Map),l=W.useRef(e),o=W.useRef(n),u=W.useRef(null),h=W.useRef(null),[p,f]=W.useState(!1),[m,g]=W.useState(null),[_,w]=W.useState(!1);W.useEffect(()=>{l.current=e},[e]),W.useEffect(()=>{if(o.current=n,i.current&&n&&n.readyState===1){const{terminalId:$}=i.current;u.current&&u.current!==$&&n.send(JSON.stringify({type:"terminal_disconnect",terminalId:u.current})),n.send(JSON.stringify({type:"terminal_subscribe",terminalId:$})),u.current=$}},[n]);const v=W.useCallback(()=>{if(h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i.current){const{terminalId:$}=i.current;r.current.delete(`__active__${$}`),i.current.resizeObserver.disconnect(),i.current.term.dispose(),i.current=null}t.current&&(t.current.innerHTML=""),f(!1),g(null),w(!1),document.body.classList.remove("terminal-focused")},[]),x=W.useCallback($=>{v();const J=t.current;if(!J)return;const re=J;re.innerHTML="";const F=(()=>{try{return localStorage.getItem("terminal-theme")||"auto"}catch{return"auto"}})();l.current=F;const B=q_(F);re.style.background=B.background||"",r.current.delete($),a.current.delete($),o.current&&o.current.readyState===1&&(u.current&&u.current!==$&&o.current.send(JSON.stringify({type:"terminal_disconnect",terminalId:u.current})),o.current.send(JSON.stringify({type:"terminal_subscribe",terminalId:$})),u.current=$);function U(V){re.offsetWidth>0&&re.offsetHeight>0?X():V>0&&requestAnimationFrame(()=>setTimeout(()=>U(V-1),50))}function X(){const V=new Vq.Terminal({cursorBlink:!1,cursorStyle:"bar",fontSize:RV(),fontFamily:"'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Menlo', monospace",fontWeight:"400",fontWeightBold:"700",lineHeight:1.15,letterSpacing:0,theme:q_(l.current),allowProposedApi:!0,scrollback:5e3,convertEol:!1,drawBoldTextInBrightColors:!0,minimumContrastRatio:1}),_e=new Gq;V.loadAddon(_e);try{const ae=new vV;V.loadAddon(ae),V.unicode.activeVersion="11"}catch{}try{const ae=new AV;V.loadAddon(ae)}catch{}V.open(re),V.attachCustomKeyEventHandler(ae=>ae.key==="Escape"?(ae.preventDefault(),ae.type==="keydown"&&o.current&&o.current.readyState===1&&o.current.send(JSON.stringify({type:"terminal_input",terminalId:$,data:"\x1B"})),!1):!0),_e.fit(),Xc(o.current,$,V.cols,V.rows),V.onData(ae=>{o.current&&o.current.readyState===1&&o.current.send(JSON.stringify({type:"terminal_input",terminalId:$,data:ae}))}),V.onBinary(ae=>{o.current&&o.current.readyState===1&&o.current.send(JSON.stringify({type:"terminal_input",terminalId:$,data:ae}))});let Ee=null;const Ie=new ResizeObserver(()=>{Ee&&clearTimeout(Ee),Ee=setTimeout(()=>{_e.fit(),Xc(o.current,$,V.cols,V.rows)},200)});Ie.observe(re),i.current={terminalId:$,term:V,fitAddon:_e,resizeObserver:Ie,layoutReady:!1},f(!0),g($),V.focus(),document.body.classList.add("terminal-focused"),oE(o.current,$,V,_e,i),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!i.current||i.current.terminalId!==$)return;const ae=r.current.get($);if(ae&&ae.length>0){for(const ee of ae){const Te=Uint8Array.from(atob(ee),ye=>ye.charCodeAt(0));V.write(Te)}r.current.delete($),a.current.delete($)}})})}U(60)},[v]),S=W.useCallback(($,J)=>{if(i.current&&i.current.terminalId===$){const re=r.current.get(`__active__${$}`)||[];re.push(J),r.current.set(`__active__${$}`,re),h.current===null&&(h.current=requestAnimationFrame(()=>{if(h.current=null,!i.current)return;const F=i.current.terminalId,B=r.current.get(`__active__${F}`);if(!B||B.length===0)return;r.current.delete(`__active__${F}`);const{term:U}=i.current,X=MV(U);for(const V of B){const _e=Uint8Array.from(atob(V),Ee=>Ee.charCodeAt(0));U.write(_e)}X&&U.scrollToBottom()}))}else{const re=Date.now();a.current.set($,re);for(const[B,U]of a.current)re-U>6e4&&(r.current.delete(B),a.current.delete(B));const F=r.current.get($)||[];F.push(J),F.length>500&&F.shift(),r.current.set($,F)}},[]),b=W.useCallback($=>{i.current&&i.current.terminalId===$&&requestAnimationFrame(()=>{if(!i.current||!i.current.fitAddon)return;const J=i.current.term.cols,re=i.current.term.rows;i.current.fitAddon.fit();const F=i.current.term.cols,B=i.current.term.rows;(F!==J||B!==re)&&Xc(o.current,$,F,B)})},[]),C=W.useCallback(($,J)=>{i.current&&i.current.terminalId===$&&i.current.term.write(`\r
|
|
121
|
-
\x1B[31m--- Terminal ${J||"closed"} ---\x1B[0m\r
|
|
122
|
-
`)},[]),O=W.useCallback(()=>{!i.current||!o.current||o.current.readyState!==1||(o.current.send(JSON.stringify({type:"terminal_input",terminalId:i.current.terminalId,data:"\x1B"})),i.current.term.focus())},[]),M=W.useCallback(()=>{!i.current||!o.current||o.current.readyState!==1||(o.current.send(JSON.stringify({type:"terminal_input",terminalId:i.current.terminalId,data:"\x1B[A"})),i.current.term.focus())},[]),D=W.useCallback(()=>{!i.current||!o.current||o.current.readyState!==1||(o.current.send(JSON.stringify({type:"terminal_input",terminalId:i.current.terminalId,data:"\x1B[B"})),i.current.term.focus())},[]),N=W.useCallback(async()=>{if(!i.current||!o.current||o.current.readyState!==1)return;const{terminalId:$}=i.current;let J=null;if(navigator.clipboard?.readText)try{J=await navigator.clipboard.readText()}catch{}if(!J)try{const re=document.createElement("textarea");re.style.position="fixed",re.style.left="-9999px",re.style.opacity="0",document.body.appendChild(re),re.focus(),document.execCommand("paste"),J=re.value,document.body.removeChild(re)}catch{}J||(J=window.prompt("Paste text to send to terminal:")),J&&(o.current.send(JSON.stringify({type:"terminal_input",terminalId:$,data:J})),i.current?.term.focus())},[]),L=W.useCallback(()=>{if(!i.current)return;const{terminalId:$,term:J,fitAddon:re}=i.current;requestAnimationFrame(()=>{!i.current||i.current.terminalId!==$||(re.fit(),Xc(o.current,$,J.cols,J.rows),J.refresh(0,J.rows-1),J.scrollToBottom())})},[]),j=W.useCallback(()=>{w($=>!$)},[]),K=W.useCallback($=>{if(!i.current)return;const{terminalId:J,term:re,fitAddon:F,resizeObserver:B}=i.current,U=re.element;if(!U||U.parentElement===$)return;$.appendChild(U),B.disconnect();let X=null;const V=new ResizeObserver(()=>{X&&clearTimeout(X),X=setTimeout(()=>{i.current&&(i.current.fitAddon.fit(),Xc(o.current,i.current.terminalId,i.current.term.cols,i.current.term.rows))},200)});V.observe($),i.current.resizeObserver=V,requestAnimationFrame(()=>{!i.current||i.current.terminalId!==J||(oE(o.current,J,re,F,i),re.focus())})},[]),Y=W.useCallback(()=>{i.current&&i.current.term.scrollToBottom()},[]),H=W.useCallback(()=>{i.current&&i.current.term.scrollPages(-1)},[]),Q=W.useCallback(()=>{i.current&&i.current.term.scrollPages(1)},[]),te=W.useCallback($=>{l.current=$;try{localStorage.setItem("terminal-theme",$)}catch{}if(i.current){const J=q_($);i.current.term.options.theme=J}},[]);return W.useEffect(()=>()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i.current&&(i.current.resizeObserver.disconnect(),i.current.term.dispose(),i.current=null)},[]),W.useEffect(()=>{const $=J=>{J.key==="F11"&&J.altKey&&i.current&&(J.preventDefault(),w(re=>!re))};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[]),{containerRef:t,attach:x,detach:v,isAttached:p,activeTerminalId:m,toggleFullscreen:j,isFullscreen:_,sendEscape:O,sendArrowUp:M,sendArrowDown:D,pasteToTerminal:N,refitTerminal:L,setTheme:te,handleTerminalOutput:S,handleTerminalReady:b,handleTerminalClosed:C,reparent:K,scrollToBottom:Y,scrollPageUp:H,scrollPageDown:Q}}function NV(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),T.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]})}function DV(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),T.jsx("polyline",{points:"5 12 12 5 19 12"})]})}function IV(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),T.jsx("polyline",{points:"19 12 12 19 5 12"})]})}function LV(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("polyline",{points:"15 3 21 3 21 9"}),T.jsx("polyline",{points:"9 21 3 21 3 15"}),T.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function BV(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("polyline",{points:"4 14 10 14 10 20"}),T.jsx("polyline",{points:"20 10 14 10 14 4"}),T.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function zV(){return T.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),T.jsx("text",{x:"12",y:"15",textAnchor:"middle",fill:"currentColor",stroke:"none",fontSize:"8",fontWeight:"700",fontFamily:"sans-serif",children:"ESC"})]})}function lE({themeName:n,onThemeChange:e,onFullscreen:t,onSendEscape:i,onSendArrowUp:r,onSendArrowDown:a,onPaste:l,onReconnect:o,isFullscreen:u,showReconnect:h=!1}){const p=TV(),f=W.useCallback(m=>{e(m.target.value)},[e]);return T.jsxs("div",{className:wt.toolbar,children:[T.jsxs("select",{className:wt.themeSelect,value:n,onChange:f,title:"Terminal theme",children:[T.jsx("option",{value:"auto",children:"Auto"}),p.map(m=>T.jsx("option",{value:m,children:m.charAt(0).toUpperCase()+m.slice(1)},m))]}),T.jsx("button",{className:wt.toolbarBtn,onClick:i,title:"Send Escape key to terminal",children:T.jsx(zV,{})}),T.jsx("button",{className:wt.toolbarBtn,onClick:l,title:"Paste clipboard to terminal",children:T.jsx(NV,{})}),T.jsx("button",{className:wt.toolbarBtn,onClick:r,title:"Send Up arrow key to terminal",children:T.jsx(DV,{})}),T.jsx("button",{className:wt.toolbarBtn,onClick:a,title:"Send Down arrow key to terminal",children:T.jsx(IV,{})}),T.jsx("button",{className:wt.toolbarBtn,onClick:t,title:u?"Exit fullscreen (Alt+F11)":"Fullscreen (Alt+F11)",children:u?T.jsx(BV,{}):T.jsx(LV,{})}),h&&o&&T.jsx("button",{className:`${wt.toolbarBtn} ${wt.reconnectBtn}`,onClick:o,title:"Reconnect terminal",children:"RECONNECT"})]})}const PV="200px";function FV({terminalId:n,ws:e,showReconnect:t=!1,onReconnect:i}){const[r,a]=W.useState(()=>{try{return localStorage.getItem("terminal-theme")||"auto"}catch{return"auto"}}),l=W.useRef(null),{containerRef:o,attach:u,detach:h,isFullscreen:p,toggleFullscreen:f,sendEscape:m,sendArrowUp:g,sendArrowDown:_,pasteToTerminal:w,refitTerminal:v,setTheme:x,handleTerminalOutput:S,handleTerminalReady:b,handleTerminalClosed:C,reparent:O,scrollPageUp:M,scrollPageDown:D}=OV({ws:e,themeName:r});W.useEffect(()=>{n?u(n):h()},[n,u,h]),W.useEffect(()=>{requestAnimationFrame(()=>{p&&l.current?O(l.current):!p&&o.current&&O(o.current)})},[p,O,o]),W.useEffect(()=>{if(!e)return;const L=j=>{try{const K=JSON.parse(j.data);K.type==="terminal_output"&&K.terminalId?S(K.terminalId,K.data):K.type==="terminal_ready"&&K.terminalId?b(K.terminalId):K.type==="terminal_closed"&&K.terminalId&&C(K.terminalId,K.reason)}catch{}};return e.addEventListener("message",L),()=>e.removeEventListener("message",L)},[e,S,b,C]),W.useEffect(()=>{const L=()=>{document.visibilityState==="visible"&&v()};return document.addEventListener("visibilitychange",L),()=>document.removeEventListener("visibilitychange",L)},[v]);const N=W.useCallback(L=>{a(L),x(L)},[x]);return n?T.jsxs("div",{className:wt.wrapper,children:[T.jsx(lE,{themeName:r,onThemeChange:N,onFullscreen:f,onSendEscape:m,onSendArrowUp:g,onSendArrowDown:_,onPaste:w,onReconnect:i,isFullscreen:p,showReconnect:t}),T.jsxs("div",{className:wt.terminalArea,children:[T.jsx("div",{ref:o,className:wt.container,style:{minHeight:PV}}),T.jsxs("div",{className:wt.mobileScrollOverlay,children:[T.jsx("button",{className:wt.mobileScrollBtn,onClick:M,title:"Scroll terminal up","aria-label":"Scroll terminal up",children:T.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("polyline",{points:"18 15 12 9 6 15"})})}),T.jsx("button",{className:wt.mobileScrollBtn,onClick:D,title:"Scroll terminal down","aria-label":"Scroll terminal down",children:T.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})]}),Hq.createPortal(T.jsxs("div",{className:wt.fullscreenOverlay,style:{display:p?"flex":"none"},children:[T.jsxs("div",{className:wt.fullscreenTopbar,children:[T.jsx("span",{className:wt.fullscreenTitle,children:"Terminal"}),T.jsx(lE,{themeName:r,onThemeChange:N,onFullscreen:f,onSendEscape:m,onSendArrowUp:g,onSendArrowDown:_,onPaste:w,onReconnect:i,isFullscreen:p,showReconnect:t})]}),T.jsxs("div",{className:wt.fullscreenArea,children:[T.jsx("div",{ref:l,className:wt.fullscreenContainer}),T.jsxs("div",{className:wt.mobileScrollOverlay,children:[T.jsx("button",{className:wt.mobileScrollBtn,onClick:M,title:"Scroll terminal up","aria-label":"Scroll terminal up",children:T.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("polyline",{points:"18 15 12 9 6 15"})})}),T.jsx("button",{className:wt.mobileScrollBtn,onClick:D,title:"Scroll terminal down","aria-label":"Scroll terminal down",children:T.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})]})]}),document.body)]}):T.jsx("div",{className:wt.placeholder,children:T.jsxs("div",{children:["No terminal attached. Create an SSH session or select a session with a terminal.",i&&T.jsx("button",{className:wt.reconnectPlaceholderBtn,onClick:i,children:"Reconnect Terminal"})]})})}const rm=["#00f0ff","#ff00aa","#a855f7","#00ff88","#ff4444","#ffaa00","#00aaff","#ff66ff","#44ff44","#ff8800","#8855ff","#00ffcc","#ff0066","#ccff00","#ff5577","#33ddff"],Ep={head:new Kn(.28,.24,.26),visor:new Kn(.24,.065,.02),antenna:new od(.007,.007,.14,4),aTip:new xs(.02,6,6),torso:new Kn(.32,.38,.2),core:new xs(.032,8,8),joint:new xs(.035,8,8),arm:new Kn(.08,.26,.08),leg:new Kn(.09,.28,.09),foot:new Kn(.1,.045,.12)};new Ih(Ep.head),new Ih(Ep.torso),new Ih(Ep.arm),new Ih(Ep.leg);const nY=new ld({color:"#2a2a3e",roughness:.3,metalness:.85}),iY=new ld({color:"#1c1c2c",roughness:.4,metalness:.7});function UV(n){const e=new Ht(n);return new ld({color:e,emissive:e,emissiveIntensity:2,roughness:.2,metalness:.3})}function jV(n){return new cr({color:n,transparent:!0,opacity:.3})}const rY=rm.map(n=>UV(n)),sY=rm.map(n=>jV(n));function HV(n){if(!n||isNaN(n)||n<0)return"";const e=Math.floor(n/1e3),t=Math.floor(e/60),i=Math.floor(t/60);return i>0?`${i}h ${t%60}m`:t>0?`${t}m ${e%60}s`:`${e}s`}function qV(n){return n==="ended"?"DISCONNECTED":n==="approval"?"APPROVAL NEEDED":n==="input"?"WAITING FOR INPUT":n==="waiting"?"WAITING":n.toUpperCase()}function V_({modalId:n,children:e}){return bi(i=>i.activeModal)!==n?null:T.jsx(T.Fragment,{children:e})}function VV({session:n}){const e=e0(l=>l.client),t=W.useMemo(()=>e?.getRawSocket()??null,[e]),i=n.source==="ssh",r=i&&n.status==="ended",a=W.useCallback(()=>{fetch(`/api/sessions/${n.sessionId}/reconnect-terminal`,{method:"POST"}).catch(()=>{})},[n.sessionId]);return T.jsxs("div",{className:We.terminalWithQueue,children:[T.jsx("div",{className:We.terminalSection,children:T.jsx(FV,{terminalId:n.terminalId,ws:t,showReconnect:r,onReconnect:i?a:void 0})}),T.jsx(O2,{sessionId:n.sessionId,sessionStatus:n.status,terminalId:n.terminalId})]})}function WV(){const n=gn(_=>_.selectedSessionId),e=gn(_=>_.sessions),t=gn(_=>_.deselectSession),i=n?e.get(n):void 0;W.useEffect(()=>{if(!n)return;const _=w=>{w.key==="Escape"&&!w.target?.closest?.(".xterm")&&t()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n,t]),W.useEffect(()=>{if(n)try{localStorage.setItem("selected-session",n)}catch{}else try{localStorage.removeItem("selected-session")}catch{}},[n]);const r=W.useCallback(_=>{_.target===_.currentTarget&&t()},[t]),[a,l]=W.useState(!1);if(!i)return null;const o=HV(Date.now()-i.startedAt),u=qV(i.status),h=i.status==="ended",p=(i.characterModel||"robot").toLowerCase(),f=i.accentColor||rm[(i.colorIndex??0)%rm.length],m=w2(p),g={idle:"#00ff88",prompting:"#00e5ff",working:"#ff9100",waiting:"#00e5ff",approval:"#ffdd00",input:"#aa66ff",ended:"#ff4444",connecting:"#666"};return T.jsx("div",{className:We.overlay,onClick:r,children:T.jsxs(f6,{initialWidth:480,minWidth:320,maxWidth:Math.round(window.innerWidth*.95),side:"right",children:[T.jsx("button",{className:We.closeBtn,onClick:t,title:"Close",children:"×"}),T.jsx("button",{className:We.collapseBtn,onClick:()=>l(_=>!_),title:a?"Expand header":"Collapse header",children:a?"▼":"▲"}),a?T.jsxs("div",{className:We.headerCompact,children:[T.jsx("span",{className:We.headerCompactName,children:i.projectName}),T.jsx("span",{className:`${We.detailStatusBadge} ${h?"disconnected":i.status}`,children:u}),o&&T.jsx("span",{className:We.detailDuration,children:o})]}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:We.header,children:[T.jsxs("div",{className:We.charPreview,style:{width:64,height:80,borderRadius:6,border:`1px solid ${g[i.status]??"#666"}40`,background:`${g[i.status]??"#666"}10`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4},children:[T.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:`${f}30`,border:`2px solid ${f}`,boxShadow:`0 0 8px ${f}40`}}),T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:8,fontWeight:700,letterSpacing:.5,color:f,textTransform:"uppercase",opacity:.8},children:m})]}),T.jsxs("div",{className:We.headerText,children:[T.jsx("div",{className:We.headerTop,children:T.jsxs("div",{className:We.headerTitles,children:[T.jsx("h3",{children:i.projectName}),i.title&&T.jsx("div",{className:We.titleRow,children:T.jsx("span",{style:{fontSize:"11px",color:"var(--text-dim)",fontStyle:"italic"},children:i.title})})]})}),T.jsxs("div",{className:We.meta,children:[T.jsx("span",{className:`${We.detailStatusBadge} ${h?"disconnected":i.status}`,children:u}),i.model&&T.jsx("span",{className:We.detailModel,children:i.model}),o&&T.jsx("span",{className:We.detailDuration,children:o})]})]})]}),T.jsx(jq,{session:i})]}),T.jsx(b6,{terminalContent:T.jsx(VV,{session:i}),promptsContent:T.jsx(S6,{prompts:i.promptHistory||[],previousSessions:i.previousSessions}),notesContent:T.jsx(E6,{sessionId:i.sessionId}),activityContent:T.jsx(w6,{events:i.events||[],toolLog:i.toolLog||[],responseLog:i.responseLog||[]}),summaryContent:T.jsx(A6,{summary:i.summary}),queueContent:T.jsx(O2,{sessionId:i.sessionId,sessionStatus:i.status,terminalId:i.terminalId}),projectContent:i.projectPath?T.jsx(Dq,{projectPath:i.projectPath}):T.jsx("div",{className:We.tabEmpty,children:"No project path detected for this session"})}),T.jsx(V_,{modalId:Wb,children:T.jsx(Iq,{})}),T.jsx(V_,{modalId:$b,children:T.jsx(Lq,{})}),T.jsx(V_,{modalId:Gb,children:T.jsx(Bq,{})})]})})}function $V(n){const e=n.target?.tagName;return!!(e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||n.target?.isContentEditable)}let Ap=!1;const GV=new Set;function KV(){Ap=!Ap;for(const n of GV)n(Ap);return Ap}function YV(){const n=bi(i=>i.openModal),e=bi(i=>i.closeModal),t=bi(i=>i.activeModal);W.useEffect(()=>{function i(r){const a=bi.getState().activeModal,l=gn.getState().selectedSessionId;if(r.key==="Escape"){if(a)e();else{if(r.target?.closest?.(".xterm"))return;l&&gn.getState().deselectSession()}return}if(!$V(r)){if(r.key==="F11"&&r.altKey){r.preventDefault(),document.fullscreenElement?document.exitFullscreen().catch(()=>{}):document.documentElement.requestFullscreen().catch(()=>{});return}if(!(r.ctrlKey||r.metaKey||r.altKey))switch(r.key){case"/":{r.preventDefault(),document.querySelector("[data-search-input]")?.focus();break}case"?":r.preventDefault(),a==="shortcuts"?e():n("shortcuts");break;case"S":case"s":r.preventDefault(),a==="settings"?e():n("settings");break;case"T":case"t":r.preventDefault(),n("new-session");break;case"K":case"k":l&&(r.preventDefault(),XV(l));break;case"A":case"a":l&&(r.preventDefault(),ZV(l));break;case"M":case"m":{r.preventDefault();const o=KV();kt(o?"Sound muted":"Sound unmuted","info",1500);break}}}}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n,e,t])}async function XV(n){try{const t=await(await fetch(`/api/sessions/${n}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})})).json();t.ok?kt("Session killed","info"):kt(t.error||"Failed to kill session","error")}catch{kt("Network error","error")}}async function ZV(n){try{const t=await(await fetch(`/api/sessions/${n}/archive`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();t.ok?kt("Session archived","info"):kt(t.error||"Failed to archive session","error")}catch{kt("Network error","error")}}function JV(){const n=W.useRef(!1);W.useEffect(()=>{n.current||(n.current=!0,(async()=>{try{const t=await $t.settings.toArray();if(t.length===0)return;const i={};for(const r of t){const{key:a,value:l}=r;if(typeof l=="string")try{const o=JSON.parse(l);if(typeof o=="object"&&o!==null){i[a]=o;continue}}catch{}i[a]=l}Wt.getState().loadFromDb(i)}catch{}})())},[]);const e=Wt(t=>t.soundSettings.volume);W.useEffect(()=>{vs.setVolume(e)},[e]),W.useEffect(()=>{if(vs.isUnlocked())return;function t(){vs.unlock(),document.removeEventListener("click",t),document.removeEventListener("keydown",t),document.removeEventListener("touchstart",t)}return document.addEventListener("click",t),document.addEventListener("keydown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("click",t),document.removeEventListener("keydown",t),document.removeEventListener("touchstart",t)}},[])}const QV={idle:"#00ff88",prompting:"#00e5ff",working:"#ff9100",waiting:"#00e5ff",approval:"#ffdd00",input:"#aa66ff",ended:"#ff4444",connecting:"#666"},cE={working:0,prompting:1,approval:2,input:2,waiting:3,idle:4,connecting:5,ended:6};function uE(n){return[...n].sort((e,t)=>{const i=cE[e.status]??5,r=cE[t.status]??5;return i!==r?i-r:(e.title||"Unnamed").localeCompare(t.title||"Unnamed")})}function eW({session:n,isSelected:e,onSelect:t,onClose:i,onTitleSave:r}){const a=QV[n.status]??"#888",l=n.title||"Unnamed",o=n.label,[u,h]=W.useState(!1),[p,f]=W.useState(l),m=W.useRef(null);W.useEffect(()=>{u&&(m.current?.focus(),m.current?.select())},[u]);const g=()=>{h(!1);const _=p.trim();_&&_!==l?r(n.sessionId,_):f(l)};return T.jsxs("button",{"data-session-id":n.sessionId,"data-status":n.status,onClick:()=>{u||t(n.sessionId)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 10px",border:e?`1px solid ${a}`:"1px solid rgba(255,255,255,0.06)",borderRadius:3,background:e?`rgba(${nW(a)},0.12)`:"rgba(255,255,255,0.02)",cursor:u?"default":"pointer",textAlign:"left",fontFamily:"'JetBrains Mono', monospace",transition:"all 0.15s ease"},onMouseEnter:_=>{e||(_.currentTarget.style.background="rgba(255,255,255,0.06)",_.currentTarget.style.borderColor="rgba(255,255,255,0.15)")},onMouseLeave:_=>{e||(_.currentTarget.style.background="rgba(255,255,255,0.02)",_.currentTarget.style.borderColor="rgba(255,255,255,0.06)")},children:[T.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:a,boxShadow:`0 0 6px ${a}`,flexShrink:0,alignSelf:"flex-start",marginTop:4}}),T.jsxs("div",{style:{flex:1,minWidth:0},children:[o&&T.jsx("span",{style:{display:"inline-block",fontSize:9,letterSpacing:.5,color:"rgba(0,240,255,0.9)",background:"rgba(0,240,255,0.1)",border:"1px solid rgba(0,240,255,0.2)",borderRadius:2,padding:"0px 4px",marginBottom:2,lineHeight:1.5,textTransform:"uppercase"},children:o}),u?T.jsx("input",{ref:m,value:p,onChange:_=>f(_.target.value),onBlur:g,onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),g()),_.key==="Escape"&&(f(l),h(!1))},onClick:_=>_.stopPropagation(),style:{width:"100%",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(0,240,255,0.4)",borderRadius:2,color:"#fff",fontSize:12,fontFamily:"inherit",padding:"1px 4px",outline:"none",lineHeight:1.3}}):T.jsx("div",{style:{fontSize:12,color:e?"#fff":"rgba(255,255,255,0.75)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.3},children:l}),T.jsx("div",{style:{fontSize:10,color:a,letterSpacing:1,textTransform:"uppercase",lineHeight:1.3},children:n.status})]}),!u&&T.jsx("span",{role:"button",tabIndex:-1,onClick:_=>{_.stopPropagation(),f(l),h(!0)},onKeyDown:_=>{_.key==="Enter"&&(_.stopPropagation(),f(l),h(!0))},style:{flexShrink:0,width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2,color:"rgba(255,255,255,0.2)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:_=>{_.currentTarget.style.color="rgba(0,240,255,0.8)"},onMouseLeave:_=>{_.currentTarget.style.color="rgba(255,255,255,0.2)"},children:T.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("path",{d:"M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),T.jsx("path",{d:"m15 5 4 4"})]})}),T.jsx("span",{role:"button",tabIndex:-1,onClick:_=>{_.stopPropagation(),i(n.sessionId)},onKeyDown:_=>{_.key==="Enter"&&(_.stopPropagation(),i(n.sessionId))},style:{flexShrink:0,width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2,fontSize:10,lineHeight:1,color:"rgba(255,255,255,0.25)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:_=>{_.currentTarget.style.color="#ff4444",_.currentTarget.style.background="rgba(255,68,68,0.15)"},onMouseLeave:_=>{_.currentTarget.style.color="rgba(255,255,255,0.25)",_.currentTarget.style.background="transparent"},children:"✕"})]})}function tW({name:n,count:e,collapsed:t,onToggle:i}){return T.jsxs("div",{onClick:i,style:{display:"flex",alignItems:"center",gap:6,padding:"6px 4px 4px",cursor:"pointer",userSelect:"none"},children:[T.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.35)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.15s ease",transform:t?"rotate(-90deg)":"rotate(0deg)",flexShrink:0},children:T.jsx("polyline",{points:"6 9 12 15 18 9"})}),T.jsx("span",{style:{fontSize:11,letterSpacing:1.5,color:"rgba(255,255,255,0.4)",textTransform:"uppercase",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),T.jsx("span",{style:{fontSize:10,color:"rgba(255,255,255,0.25)",fontFamily:"'JetBrains Mono', monospace"},children:e})]})}function nW(n){const e=n.replace("#",""),t=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);return`${t},${i},${r}`}const gk="sidebar-filter-mode";function iW(){try{const n=localStorage.getItem(gk);return n==="all"||n==="ssh"||n==="others"?n:"all"}catch{return"all"}}function rW(n){try{localStorage.setItem(gk,n)}catch{}}function sW(){const n=gn(C=>C.sessions),e=gn(C=>C.selectedSessionId),t=gn(C=>C.removeSession),i=gn(C=>C.updateSession),r=Gs(C=>C.rooms),[a,l]=W.useState(!1),[o,u]=W.useState(new Set),[h,p]=W.useState(iW),f=W.useCallback(C=>{u(O=>{const M=new Set(O);return M.has(C)?M.delete(C):M.add(C),M})},[]),m=W.useCallback(C=>{p(C),rW(C)},[]),g=W.useMemo(()=>{const C=[...n.values()].filter(L=>!(L.status==="ended"||h==="ssh"&&L.source!=="ssh"||h==="others"&&L.source==="ssh")),O=new Set,M=[],D=[...r].filter(L=>L.roomIndex!=null).sort((L,j)=>(L.roomIndex??0)-(j.roomIndex??0));for(const L of D){const j=C.filter(K=>L.sessionIds.includes(K.sessionId));if(j.length>0){for(const K of j)O.add(K.sessionId);M.push({id:L.id,name:L.name,sessions:uE(j)})}}const N=C.filter(L=>!O.has(L.sessionId));return N.length>0&&M.push({id:"__common__",name:"Common Area",sessions:uE(N)}),M},[n,r,h]),_=W.useMemo(()=>g.reduce((C,O)=>C+O.sessions.length,0),[g]),w=gn(C=>C.selectSession),v=W.useCallback(C=>{w(C),window.dispatchEvent(new CustomEvent("robot-select",{detail:{sessionId:C}}))},[w]),x=W.useCallback(C=>{t(C),fetch(`/api/sessions/${C}`,{method:"DELETE"}).catch(()=>{})},[t]),S=W.useCallback((C,O)=>{const M=n.get(C);M&&i({...M,title:O}),fetch(`/api/sessions/${C}/title`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:O})}).catch(()=>{})},[n,i]);return W.useMemo(()=>[...n.values()].some(C=>C.status!=="ended"),[n])?T.jsxs("div",{style:{position:"absolute",top:16,left:20,width:a?"auto":280,maxHeight:"calc(100vh - 100px)",overflowY:a?"hidden":"auto",background:"color-mix(in srgb, var(--bg-panel) 85%, transparent)",backdropFilter:"blur(20px)",border:"1px solid var(--border-accent)",borderRadius:4,padding:a?"10px 12px":"14px 12px",pointerEvents:"all",zIndex:11,boxShadow:"0 0 12px var(--glow-accent), inset 0 0 24px var(--glow-accent)",transition:"width 0.2s ease, padding 0.2s ease"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",marginBottom:a?0:4,paddingLeft:2,userSelect:"none"},onClick:()=>l(C=>!C),children:[T.jsxs("span",{style:{fontSize:12,letterSpacing:2,color:"rgba(0,240,255,0.4)",textTransform:"uppercase",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",flex:1},children:["Agents (",_,")"]}),T.jsx("div",{onClick:C=>C.stopPropagation(),style:{display:"flex",borderRadius:3,overflow:"hidden",border:"1px solid rgba(255,255,255,0.1)",marginRight:6},children:["all","ssh","others"].map(C=>{const O=h===C,M=C==="all"?"ALL":C==="ssh"?"SSH":"OTHERS";return T.jsx("button",{onClick:()=>m(C),style:{fontSize:9,letterSpacing:.5,padding:"2px 6px",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"all 0.15s ease",background:O?"rgba(0,240,255,0.15)":"transparent",color:O?"rgba(0,240,255,0.9)":"rgba(255,255,255,0.3)",border:"none",borderRight:C!=="others"?"1px solid rgba(255,255,255,0.08)":"none",lineHeight:1.4},children:M},C)})}),T.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(0,240,255,0.4)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:a?"rotate(-90deg)":"rotate(0deg)"},children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!a&&T.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:_===0?T.jsxs("div",{style:{padding:"16px 8px",textAlign:"center",fontSize:11,color:"rgba(255,255,255,0.25)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:.5},children:["No ",h==="ssh"?"SSH":h==="others"?"other":""," sessions"]}):g.map(C=>{const O=o.has(C.id);return T.jsxs("div",{children:[T.jsx(tW,{name:C.name,count:C.sessions.length,collapsed:O,onToggle:()=>f(C.id)}),!O&&T.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3,paddingLeft:4},children:C.sessions.map(M=>T.jsx(eW,{session:M,isSelected:e===M.sessionId,onSelect:v,onClose:x,onTitleSave:S},M.sessionId))})]},C.id)})})]}):null}const aW=[18,16,18],oW=[0,1,0];let lW=1;const cW=Tl(n=>({pendingTarget:null,isAnimating:!1,flyTo:(e,t)=>n({pendingTarget:{position:e,lookAt:t,requestId:lW++},isAnimating:!0}),completeAnimation:()=>n({pendingTarget:null,isAnimating:!1})})),yk=8,nd=2,hE=yk+nd,Lo=yk/2,Nr=4,aY=2,oY=.08,lY=1.5;function cY(n){const e=[];for(const t of n){const[i]=t.center;e.push({roomIndex:t.index,side:"south",outside:new se(i,0,t.bounds.maxZ+1),inside:new se(i,0,t.bounds.maxZ-1)}),e.push({roomIndex:t.index,side:"north",outside:new se(i,0,t.bounds.minZ-1),inside:new se(i,0,t.bounds.minZ+1)})}return e}function uY(n,e,t,i,r,a){if(i===r)return[t];if(i<0&&r<0)return[t];const l=[];function o(u,h,p){const f=a.filter(_=>_.roomIndex===u);if(f.length===0)return;let m=f[0],g=(m.outside.x-h)**2+(m.outside.z-p)**2;for(let _=1;_<f.length;_++){const w=(f[_].outside.x-h)**2+(f[_].outside.z-p)**2;w<g&&(m=f[_],g=w)}return m}if(i>=0){const u=o(i,t.x,t.z);u&&(l.push(u.inside.clone()),l.push(u.outside.clone()))}if(r>=0){const u=o(r,n,e);u&&(l.push(u.outside.clone()),l.push(u.inside.clone()))}return l.push(t),l}function Fa(n){const e=n%Nr,t=Math.floor(n/Nr),i=(e-(Nr-1)/2)*hE,r=t*hE;return[i,0,r]}function _k(n){const[e,,t]=Fa(n);return{minX:e-Lo,maxX:e+Lo,minZ:t-Lo,maxZ:t+Lo}}const dE=14,uW=10,fE=Math.PI/4;function hW(n){const[e,,t]=Fa(n);return{lookAt:[e,1,t],position:[e+Math.sin(fE)*dE,uW,t+Math.cos(fE)*dE]}}function hY(n){return n.filter(e=>e.roomIndex!=null).map(e=>({index:e.roomIndex,roomId:e.id,name:e.name,center:Fa(e.roomIndex),bounds:_k(e.roomIndex),stripColor:e.roomIndex%2===0?0:1}))}function dW(n){const e=[];for(const t of n){const[i,,r]=t.center,a=5,l=1.2,o=r-(a-1)*l/2;for(let u=0;u<a;u++){const h=o+u*l;e.push({x:i-3,z:h,rotation:Math.PI/2,zone:t.index}),e.push({x:i+3,z:h,rotation:-Math.PI/2,zone:t.index})}}return e}function dY(n){return dW(n).map((t,i)=>{const r=t.x+.65*Math.sin(t.rotation),a=t.z+.65*Math.cos(t.rotation);return{idx:i,zone:t.zone,seatPos:new se(r,0,a),faceRot:t.rotation+Math.PI,occupantId:null}})}function fY(n,e){const t=[];if(n.length===0)for(let i=0;i<5;i++)for(let r=0;r<2;r++)t.push({x:(r-.5)*3,z:3+i*1.5,rotation:r===0?Math.PI/2:-Math.PI/2});else{const i=Math.max(...n.map(f=>Math.floor(f.index/Nr))),r=Math.min(Nr-1,Math.max(...n.map(f=>f.index%Nr))),a=Math.min(...n.map(f=>f.index%Nr)),o=Fa(i*Nr)[2]+Lo+nd+3,u=Fa(a),h=Fa(r),p=(u[0]+h[0])/2;for(let f=0;f<5;f++)for(let m=0;m<2;m++)t.push({x:p+(m-.5)*3,z:o+f*1.5,rotation:m===0?Math.PI/2:-Math.PI/2})}return t.map((i,r)=>{const a=i.x+.65*Math.sin(i.rotation),l=i.z+.65*Math.cos(i.rotation);return{idx:e+r,zone:-1,seatPos:new se(a,0,l),faceRot:i.rotation+Math.PI,occupantId:null}})}function pY(n,e,t){for(const i of t)if(n+.25>i.minX&&n-.25<i.maxX&&e+.25>i.minZ&&e-.25<i.maxZ)return!0;return!1}function fW(n){if(n.length===0)return 15;let e=10;for(const t of n){const[i,,r]=t.center;e=Math.max(e,Math.abs(i)+Lo+2,Math.abs(r)+Lo+2)}if(n.length>0){const t=Math.max(...n.map(a=>Math.floor(a.index/Nr))),i=Fa(t*Nr);e=Math.max(e,Math.abs(i[2])+Lo+nd+8);const r=Math.min(...n.map(a=>a.bounds.minZ));e=Math.max(e,Math.abs(r)+nd+8)}return e}function mY(n,e,t){for(const i of t){const r=i.bounds;if(n>=r.minX&&n<=r.maxX&&e>=r.minZ&&e<=r.maxZ)return i.index}return-1}function gY(n){const e=_k(n),t=new se;return t.set(e.minX+.8+Math.random()*(e.maxX-e.minX-1.6),0,e.minZ+.8+Math.random()*(e.maxZ-e.minZ-1.6)),t}function yY(n){const e=new se,t=Math.min(n,5);return e.set((Math.random()-.5)*t*2,0,(Math.random()-.5)*t*2),e}const pW=10,Rh=pW/2;function _Y(n){let e,t;if(n.length===0)e=-8,t=0;else{e=Math.min(...n.map(p=>p.bounds.minZ))-nd-Rh-1;const l=Math.min(...n.map(p=>p.index%Nr)),o=Math.min(Nr-1,Math.max(...n.map(p=>p.index%Nr))),u=Fa(l),h=Fa(o);t=(u[0]+h[0])/2}const i=[],r=3;for(let a=0;a<2;a++)for(let l=0;l<2;l++){const o=t+(l-.5)*r,u=e+(a-.5)*r;i.push({pos:new se(o-.8,0,u),faceRot:Math.PI/2}),i.push({pos:new se(o+.8,0,u),faceRot:-Math.PI/2})}return[{type:"coffee",center:[t,0,e],bounds:{minX:t-Rh,maxX:t+Rh,minZ:e-Rh,maxZ:e+Rh},stations:i}]}function bY(n,e){const t=[];let i=e;for(const r of n)for(const l of r.stations)t.push({idx:i,zone:-2,seatPos:l.pos.clone(),faceRot:l.faceRot,occupantId:null}),i++;return t}function vY(n){const e=fW(n);return Math.max(20,e*2+6)}const qh={fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",fontSize:10,letterSpacing:1.5,textTransform:"uppercase",padding:"7px 12px",borderRadius:2,cursor:"pointer",transition:"all 0.15s ease"};function mW(){const n=Gs(S=>S.rooms),e=Gs(S=>S.createRoom),t=Gs(S=>S.renameRoom),i=Gs(S=>S.deleteRoom),r=gn(S=>S.sessions),a=cW(S=>S.flyTo),[l,o]=W.useState(!1),[u,h]=W.useState(null),[p,f]=W.useState(""),m=W.useCallback(()=>{const S=n.length+1;e(`Room ${S}`)},[n.length,e]),g=W.useCallback(S=>{h(S.id),f(S.name)},[]),_=W.useCallback(()=>{u&&p.trim()&&t(u,p.trim()),h(null),f("")},[u,p,t]),w=W.useCallback(S=>{const b=hW(S);a(b.position,b.lookAt)},[a]),v=W.useCallback(()=>{a(aW,oW)},[a]),x=W.useMemo(()=>[...n].sort((S,b)=>(S.roomIndex??999)-(b.roomIndex??999)),[n]);return T.jsxs("div",{style:{marginTop:10,borderTop:"1px solid rgba(0,240,255,0.1)",paddingTop:8},children:[T.jsxs("button",{onClick:()=>o(!l),style:{...qh,display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"4px 0",border:"none",background:"none",color:"rgba(0,240,255,0.5)",fontSize:9,letterSpacing:2},children:[T.jsxs("span",{children:["Rooms (",n.length,")"]}),T.jsx("span",{style:{fontSize:10},children:l?"▴":"▾"})]}),l&&T.jsxs("div",{style:{marginTop:6,display:"flex",flexDirection:"column",gap:6},children:[T.jsx("button",{onClick:v,style:{...qh,width:"100%",border:"1px solid rgba(0,240,255,0.28)",background:"rgba(0,240,255,0.06)",color:"#00f0ff",display:"flex",alignItems:"center",justifyContent:"center",gap:6},onMouseEnter:S=>{S.currentTarget.style.background="rgba(0,240,255,0.16)",S.currentTarget.style.borderColor="rgba(0,240,255,0.5)"},onMouseLeave:S=>{S.currentTarget.style.background="rgba(0,240,255,0.06)",S.currentTarget.style.borderColor="rgba(0,240,255,0.28)"},children:"Overview"}),x.map(S=>{const b=S.sessionIds.filter(C=>{const O=r.get(C);return O&&O.status!=="ended"}).length;return T.jsxs("div",{onClick:()=>{u!==S.id&&S.roomIndex!=null&&w(S.roomIndex)},style:{padding:"6px 8px",borderRadius:3,border:"1px solid rgba(0,240,255,0.2)",background:"rgba(0,240,255,0.04)",cursor:u===S.id?"default":"pointer"},onMouseEnter:C=>{u!==S.id&&(C.currentTarget.style.background="rgba(0,240,255,0.1)",C.currentTarget.style.borderColor="rgba(0,240,255,0.4)")},onMouseLeave:C=>{C.currentTarget.style.background="rgba(0,240,255,0.04)",C.currentTarget.style.borderColor="rgba(0,240,255,0.2)"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[u===S.id?T.jsx("input",{value:p,onChange:C=>f(C.target.value),onBlur:_,onKeyDown:C=>{C.key==="Enter"&&_()},onClick:C=>C.stopPropagation(),autoFocus:!0,style:{flex:1,background:"rgba(0,0,0,0.3)",border:"1px solid rgba(0,240,255,0.3)",color:"#fff",fontSize:10,fontFamily:"'JetBrains Mono', monospace",padding:"2px 4px",borderRadius:2,outline:"none"}}):T.jsx("span",{style:{fontSize:10,fontFamily:"'JetBrains Mono', monospace",color:"#ddd",flex:1},children:S.name}),u!==S.id&&T.jsxs("div",{style:{display:"flex",gap:2},children:[T.jsx("button",{onClick:C=>{C.stopPropagation(),g(S)},style:{background:"none",border:"none",color:"rgba(0,240,255,0.4)",cursor:"pointer",fontSize:10,minWidth:44,minHeight:44,display:"flex",alignItems:"center",justifyContent:"center"},title:"Rename",children:"✎"}),T.jsx("button",{onClick:C=>{C.stopPropagation(),i(S.id)},style:{background:"none",border:"none",color:"rgba(255,68,68,0.5)",cursor:"pointer",fontSize:10,minWidth:44,minHeight:44,display:"flex",alignItems:"center",justifyContent:"center"},title:"Delete room",children:"×"})]})]}),b>0&&T.jsxs("div",{style:{marginTop:4,fontSize:9,fontFamily:"'JetBrains Mono', monospace",color:"rgba(255,255,255,0.35)",padding:"1px 4px"},children:[b," session",b!==1?"s":""]})]},S.id)}),n.length===0&&T.jsx("div",{style:{fontSize:9,color:"rgba(255,255,255,0.2)",textAlign:"center",padding:"6px 0",fontFamily:"'Share Tech Mono', monospace"},children:"No rooms yet"}),T.jsx("button",{onClick:m,style:{...qh,width:"100%",border:"1px dashed rgba(0,255,136,0.3)",background:"rgba(0,255,136,0.04)",color:"#00ff88"},onMouseEnter:S=>{S.currentTarget.style.background="rgba(0,255,136,0.12)",S.currentTarget.style.borderColor="rgba(0,255,136,0.5)"},onMouseLeave:S=>{S.currentTarget.style.background="rgba(0,255,136,0.04)",S.currentTarget.style.borderColor="rgba(0,255,136,0.3)"},children:"+ New Room"})]})]})}function gW({sessionCount:n}){const e=Wt(l=>l.soundSettings.enabled),t=Wt(l=>l.updateSoundSettings),i=Wt(l=>l.scene3dEnabled),r=Wt(l=>l.setScene3dEnabled),a=()=>{const l=!e;t({enabled:l}),l&&vs.unlock()};return T.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:10},children:T.jsxs("div",{style:{position:"absolute",bottom:16,right:20,background:"color-mix(in srgb, var(--bg-panel) 85%, transparent)",backdropFilter:"blur(20px)",border:"1px solid var(--border-accent)",borderRadius:4,padding:"14px 18px",pointerEvents:"all",minWidth:200,maxWidth:260,maxHeight:"calc(100vh - 80px)",overflowY:"auto",boxShadow:"0 0 12px var(--glow-accent), inset 0 0 24px var(--glow-accent)"},children:[T.jsx("div",{style:{fontSize:9,letterSpacing:2,color:"rgba(0,240,255,0.4)",textTransform:"uppercase",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace"},children:"Units Online"}),T.jsx("div",{style:{fontFamily:"'Orbitron', 'JetBrains Mono', sans-serif",fontSize:28,fontWeight:700,color:"#fff",margin:"2px 0 10px",lineHeight:1},children:n}),T.jsx("button",{onClick:a,style:{...qh,width:"100%",border:`1px solid ${e?"rgba(0,240,255,0.28)":"rgba(255,68,68,0.4)"}`,background:e?"rgba(0,240,255,0.08)":"rgba(255,68,68,0.12)",color:e?"#00f0ff":"#ff4444"},onMouseEnter:l=>{l.currentTarget.style.background=e?"rgba(0,240,255,0.16)":"rgba(255,68,68,0.2)"},onMouseLeave:l=>{l.currentTarget.style.background=e?"rgba(0,240,255,0.08)":"rgba(255,68,68,0.12)"},children:e?"Sound On":"Muted"}),T.jsx("button",{onClick:()=>r(!i),title:i?"Disable 3D scene to save CPU/GPU":"Enable 3D scene",style:{...qh,width:"100%",marginTop:6,border:`1px solid ${i?"rgba(0,240,255,0.28)":"rgba(255,145,0,0.4)"}`,background:i?"rgba(0,240,255,0.08)":"rgba(255,145,0,0.12)",color:i?"#00f0ff":"#ff9100"},onMouseEnter:l=>{l.currentTarget.style.background=i?"rgba(0,240,255,0.16)":"rgba(255,145,0,0.2)"},onMouseLeave:l=>{l.currentTarget.style.background=i?"rgba(0,240,255,0.08)":"rgba(255,145,0,0.12)"},children:i?"3D On":"3D Off"}),T.jsx(mW,{}),T.jsx("div",{style:{fontSize:8,color:"rgba(255,255,255,0.16)",marginTop:10,lineHeight:1.6,textAlign:"center",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace"},children:"Drag to orbit · Scroll to zoom"})]})})}const yW=W.lazy(()=>ou(()=>import("./CyberdromeScene-CQ0JUjR0.js"),__vite__mapDeps([0,1])));class _W extends W.Component{state={hasError:!1,error:""};static getDerivedStateFromError(e){return{hasError:!0,error:e.message}}componentDidCatch(e,t){console.error("3D Scene crashed:",e,t.componentStack)}render(){return this.state.hasError?T.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",background:"#0e0c1a",color:"#ff4444",fontFamily:"'JetBrains Mono', monospace",fontSize:12,letterSpacing:1,gap:16},children:[T.jsx("div",{children:"3D SCENE ERROR"}),T.jsx("div",{style:{color:"#888",maxWidth:400,textAlign:"center"},children:this.state.error}),T.jsx("button",{onClick:()=>this.setState({hasError:!1,error:""}),style:{background:"#1a1a2e",border:"1px solid #00f0ff",color:"#00f0ff",padding:"8px 16px",cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"RETRY"})]}):this.props.children}}function bW(){const n=gn(t=>t.sessions),e=Array.from(n.values()).filter(t=>t.status!=="ended").length;return T.jsxs("div",{style:{position:"absolute",inset:0,background:"var(--bg-primary, #0a0a1a)"},children:[T.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(255,255,255,0.06)",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",fontSize:14,letterSpacing:4,textTransform:"uppercase",userSelect:"none"},children:"3D Scene Paused"}),T.jsx(gW,{sessionCount:e}),T.jsx(sW,{})]})}function vW(){return Wt(e=>e.scene3dEnabled)?T.jsx("div",{style:{position:"absolute",inset:0},children:T.jsx(_W,{children:T.jsx(W.Suspense,{fallback:T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",background:"#0e0c1a",color:"#00f0ff",fontFamily:"'JetBrains Mono', monospace",fontSize:12,letterSpacing:2},children:"INITIALIZING CYBERDROME..."}),children:T.jsx(yW,{})})})}):T.jsx("div",{style:{position:"absolute",inset:0},children:T.jsx(bW,{})})}const xW=W.lazy(()=>ou(()=>import("./HistoryView-Fz2_E2lb.js"),__vite__mapDeps([2,3,4]))),SW=W.lazy(()=>ou(()=>import("./TimelineView-CtshpaEr.js"),__vite__mapDeps([5,3,6,1,7]))),wW=W.lazy(()=>ou(()=>import("./AnalyticsView-YRASbt1m.js"),__vite__mapDeps([8,3,6,1,7]))),CW=W.lazy(()=>ou(()=>import("./QueueView-Ben9YLiL.js"),__vite__mapDeps([9,10]))),EW=W.lazy(()=>ou(()=>import("./ProjectBrowserView-DYnCNpma.js"),[])),AW=new nO({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function kW(){return YV(),T.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[T.jsx(OL,{}),T.jsx(hB,{}),T.jsx("main",{style:{flex:1,minHeight:0,overflow:"hidden",position:"relative"},children:T.jsx(W.Suspense,{fallback:T.jsx("div",{style:{padding:"2rem",color:"#8888aa",textAlign:"center"},children:"Loading..."}),children:T.jsx(KM,{})})}),T.jsx(xB,{}),T.jsx(LL,{}),T.jsx(EL,{}),T.jsx(UB,{}),T.jsx($B,{}),T.jsx(KB,{}),T.jsx(WV,{})]})}function TW({token:n}){return JV(),TO(n),T.jsx(xR,{children:T.jsxs(XM,{children:[T.jsx(Da,{path:"/project-browser",element:T.jsx(W.Suspense,{fallback:T.jsx("div",{style:{padding:"2rem",color:"#8888aa",background:"#0a0a1a",height:"100vh"},children:"Loading..."}),children:T.jsx(EW,{})})}),T.jsxs(Da,{element:T.jsx(kW,{}),children:[T.jsx(Da,{path:"/",element:T.jsx(vW,{})}),T.jsx(Da,{path:"/history",element:T.jsx(xW,{})}),T.jsx(Da,{path:"/timeline",element:T.jsx(SW,{})}),T.jsx(Da,{path:"/analytics",element:T.jsx(wW,{})}),T.jsx(Da,{path:"/queue",element:T.jsx(CW,{})}),T.jsx(Da,{path:"*",element:T.jsx(GM,{to:"/",replace:!0})})]})]})})}function MW(){const{token:n,loading:e,needsLogin:t,login:i}=aO();return e?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh",background:"#0a0a1a",color:"#8888aa",fontFamily:"'JetBrains Mono', monospace"},children:"Connecting..."}):t?T.jsx(IO,{onLogin:i}):T.jsx(TW,{token:n})}function RW(){return T.jsx(iO,{client:AW,children:T.jsx(MW,{})})}bs.getState().loadFromDb();const bk=document.getElementById("root");if(!bk)throw new Error("Root element not found");GT.createRoot(bk).render(T.jsx(W.StrictMode,{children:T.jsx(RW,{})}));export{qG as $,xt as A,UG as B,Jr as C,Ht as D,se as E,nb as F,qE as G,Sn as H,Nt as I,zS as J,PS as K,K0 as L,Qt as M,L$ as N,Rr as O,Nq as P,hm as Q,OW as R,om as S,N3 as T,W0 as U,is as V,Ys as W,r$ as X,VE as Y,t0 as Z,DS as _,BW as a,n$ as a$,rn as a0,yt as a1,SI as a2,Cs as a3,y2 as a4,Ry as a5,Po as a6,Ze as a7,Qr as a8,SK as a9,b$ as aA,x$ as aB,MS as aC,m$ as aD,p$ as aE,f$ as aF,i0 as aG,n0 as aH,k3 as aI,A3 as aJ,E3 as aK,Br as aL,CG as aM,wG as aN,EG as aO,xG as aP,SG as aQ,vG as aR,AG as aS,bG as aT,jc as aU,Js as aV,TI as aW,MI as aX,Y0 as aY,ii as aZ,t$ as a_,iK as aa,Gh as ab,F3 as ac,r0 as ad,G$ as ae,dm as af,UD as ag,Yh as ah,Pa as ai,U3 as aj,ts as ak,Ks as al,KE as am,OS as an,u$ as ao,c$ as ap,TS as aq,E$ as ar,C$ as as,w$ as at,S$ as au,_$ as av,v$ as aw,RS as ax,g$ as ay,y$ as az,Hq as b,A$ as b$,b3 as b0,i$ as b1,iu as b2,nK as b3,cK as b4,H3 as b5,j3 as b6,$E as b7,R3 as b8,D3 as b9,rN as bA,sN as bB,aN as bC,oN as bD,lN as bE,cN as bF,uN as bG,hN as bH,dN as bI,fN as bJ,pN as bK,mN as bL,gN as bM,yN as bN,_N as bO,bN as bP,vN as bQ,xN as bR,SN as bS,wN as bT,CN as bU,N$ as bV,O$ as bW,R$ as bX,M$ as bY,T$ as bZ,k$ as b_,I3 as ba,uK as bb,fb as bc,L3 as bd,B3 as be,T3 as bf,M3 as bg,O3 as bh,z3 as bi,P3 as bj,WE as bk,q3 as bl,V3 as bm,W3 as bn,$3 as bo,G3 as bp,K3 as bq,Y3 as br,X3 as bs,Z3 as bt,J3 as bu,Q3 as bv,eN as bw,tN as bx,nN as by,iN as bz,R0 as c,XK as c$,XW as c0,ZW as c1,JW as c2,kS as c3,l$ as c4,o$ as c5,a$ as c6,s$ as c7,S3 as c8,w3 as c9,JE as cA,Z0 as cB,ZE as cC,jp as cD,I$ as cE,D$ as cF,q0 as cG,vi as cH,h$ as cI,d$ as cJ,GE as cK,LS as cL,KI as cM,p5 as cN,Gp as cO,dK as cP,kK as cQ,AK as cR,hK as cS,jD as cT,YK as cU,NS as cV,n5 as cW,EK as cX,b2 as cY,wK as cZ,vK as c_,ZN as ca,tK as cb,C3 as cc,hu as cd,tG as ce,eK as cf,Kn as cg,fm as ch,Zs as ci,U$ as cj,H$ as ck,j$ as cl,F$ as cm,P$ as cn,z$ as co,B$ as cp,C5 as cq,IS as cr,um as cs,x3 as ct,du as cu,cD as cv,lD as cw,MN as cx,BG as cy,dD as cz,BR as d,HK as d$,TN as d0,e$ as d1,BD as d2,n2 as d3,fu as d4,BK as d5,or as d6,GK as d7,$K as d8,JI as d9,mK as dA,GG as dB,lG as dC,uG as dD,FI as dE,v3 as dF,GI as dG,VK as dH,LI as dI,ob as dJ,DG as dK,kG as dL,RG as dM,Ih as dN,lb as dO,pG as dP,ub as dQ,zo as dR,QG as dS,Q0 as dT,J0 as dU,sK as dV,ib as dW,OK as dX,LG as dY,_G as dZ,gG as d_,La as da,X0 as db,WK as dc,lK as dd,sb as de,HD as df,ab as dg,e5 as dh,m2 as di,aK as dj,oK as dk,rb as dl,fK as dm,pm as dn,JK as dp,gD as dq,pK as dr,r2 as ds,XD as dt,II as du,QW as dv,Qs as dw,JD as dx,od as dy,LK as dz,Y_ as e,q$ as e$,Dh as e0,jI as e1,jK as e2,hb as e3,_K as e4,Kp as e5,KN as e6,oG as e7,cG as e8,Xh as e9,s2 as eA,ZD as eB,OI as eC,zD as eD,Ha as eE,p2 as eF,$$ as eG,W$ as eH,Pr as eI,Mw as eJ,g2 as eK,EN as eL,kN as eM,AN as eN,KW as eO,lr as eP,Sb as eQ,VG as eR,x2 as eS,kI as eT,RI as eU,AI as eV,CI as eW,wI as eX,ld as eY,EI as eZ,V$ as e_,ZI as ea,RK as eb,ED as ec,ZG as ed,JG as ee,KG as ef,eb as eg,ru as eh,gm as ei,Pp as ej,s0 as ek,My as el,FG as em,PG as en,hG as eo,wc as ep,Es as eq,vD as er,db as es,mG as et,fG as eu,Rl as ev,XI as ew,El as ex,zK as ey,cr as ez,IR as f,pu as f$,dG as f0,nG as f1,$0 as f2,rG as f3,iG as f4,yG as f5,Wp as f6,wn as f7,yK as f8,mm as f9,pb as fA,_D as fB,xI as fC,tu as fD,mb as fE,ZK as fF,Xs as fG,tb as fH,FK as fI,SD as fJ,Sl as fK,Xi as fL,xs as fM,IK as fN,_2 as fO,l2 as fP,qI as fQ,PK as fR,bD as fS,e2 as fT,NG as fU,Up as fV,MG as fW,xK as fX,IG as fY,TG as fZ,OG as f_,o0 as fa,KK as fb,WI as fc,UK as fd,PD as fe,i2 as ff,qK as fg,Ml as fh,CK as fi,xn as fj,r5 as fk,a2 as fl,o2 as fm,Ir as fn,ym as fo,BI as fp,J$ as fq,Q$ as fr,K$ as fs,eG as ft,ad as fu,NK as fv,YI as fw,XE as fx,TK as fy,aG as fz,id as g,bY as g$,YW as g0,gb as g1,gK as g2,QK as g3,DK as g4,zG as g5,yb as g6,_b as g7,Or as g8,Z$ as g9,rm as gA,aY as gB,fY as gC,Lo as gD,oY as gE,lY as gF,eY as gG,sY as gH,rY as gI,jV as gJ,UV as gK,nY as gL,Wt as gM,Ep as gN,iY as gO,gY as gP,mY as gQ,pY as gR,uY as gS,yY as gT,CO as gU,Fa as gV,cW as gW,Gs as gX,hY as gY,_Y as gZ,dY as g_,X$ as ga,Y$ as gb,bb as gc,V0 as gd,YG as ge,XG as gf,v2 as gg,MK as gh,$p as gi,rK as gj,FD as gk,$G as gl,WG as gm,Kh as gn,vI as go,Fp as gp,Zc as gq,Jc as gr,sG as gs,HG as gt,jG as gu,cO as gv,Oh as gw,qT as gx,vY as gy,dW as gz,K_ as h,cY as h0,fW as h1,gW as h2,sW as h3,lm as i,T as j,BE as k,XR as l,FR as m,_s as n,rr as o,VR as p,IW as q,W as r,DW as s,LR as t,LW as u,bs as v,gn as w,kt as x,wt as y,NW as z};
|