vibe-replay 0.1.4 → 0.1.5
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/assets/viewer.html +64 -64
- package/dist/index.js +948 -371
- package/package.json +1 -1
package/assets/viewer.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<title>vibe-replay</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
|
-
<script type="module" crossorigin>(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const m of u)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(u){const m={};return u.integrity&&(m.integrity=u.integrity),u.referrerPolicy&&(m.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?m.credentials="include":u.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(u){if(u.ep)return;u.ep=!0;const m=i(u);fetch(u.href,m)}})();function
|
|
8
|
+
<script type="module" crossorigin>(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const m of u)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(u){const m={};return u.integrity&&(m.integrity=u.integrity),u.referrerPolicy&&(m.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?m.credentials="include":u.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(u){if(u.ep)return;u.ep=!0;const m=i(u);fetch(u.href,m)}})();function Rh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Qc={exports:{}},Ls={};/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-jsx-runtime.production.js
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/var
|
|
16
|
+
*/var Gp;function Lb(){if(Gp)return Ls;Gp=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(o,u,m){var p=null;if(m!==void 0&&(p=""+m),u.key!==void 0&&(p=""+u.key),"key"in u){m={};for(var g in u)g!=="key"&&(m[g]=u[g])}else m=u;return u=m.ref,{$$typeof:l,type:o,key:p,ref:u!==void 0?u:null,props:m}}return Ls.Fragment=r,Ls.jsx=i,Ls.jsxs=i,Ls}var qp;function zb(){return qp||(qp=1,Qc.exports=Lb()),Qc.exports}var n=zb(),Xc={exports:{}},Ce={};/**
|
|
17
17
|
* @license React
|
|
18
18
|
* react.production.js
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the MIT license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/var
|
|
24
|
+
*/var Yp;function Bb(){if(Yp)return Ce;Yp=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.iterator;function j(T){return T===null||typeof T!="object"?null:(T=C&&T[C]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function E(T,_,V){this.props=T,this.context=_,this.refs=k,this.updater=V||w}E.prototype.isReactComponent={},E.prototype.setState=function(T,_){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,_,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function M(){}M.prototype=E.prototype;function A(T,_,V){this.props=T,this.context=_,this.refs=k,this.updater=V||w}var R=A.prototype=new M;R.constructor=A,S(R,E.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function $(){}var H={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function ae(T,_,V){var J=V.ref;return{$$typeof:l,type:T,key:_,ref:J!==void 0?J:null,props:V}}function ue(T,_){return ae(T.type,_,T.props)}function oe(T){return typeof T=="object"&&T!==null&&T.$$typeof===l}function te(T){var _={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return _[V]})}var xe=/\/+/g;function de(T,_){return typeof T=="object"&&T!==null&&T.key!=null?te(""+T.key):_.toString(36)}function pe(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then($,$):(T.status="pending",T.then(function(_){T.status==="pending"&&(T.status="fulfilled",T.value=_)},function(_){T.status==="pending"&&(T.status="rejected",T.reason=_)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function U(T,_,V,J,P){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var G=!1;if(T===null)G=!0;else switch(he){case"bigint":case"string":case"number":G=!0;break;case"object":switch(T.$$typeof){case l:case r:G=!0;break;case h:return G=T._init,U(G(T._payload),_,V,J,P)}}if(G)return P=P(T),G=J===""?"."+de(T,0):J,O(P)?(V="",G!=null&&(V=G.replace(xe,"$&/")+"/"),U(P,_,V,"",function(be){return be})):P!=null&&(oe(P)&&(P=ue(P,V+(P.key==null||T&&T.key===P.key?"":(""+P.key).replace(xe,"$&/")+"/")+G)),_.push(P)),1;G=0;var F=J===""?".":J+":";if(O(T))for(var me=0;me<T.length;me++)J=T[me],he=F+de(J,me),G+=U(J,_,V,he,P);else if(me=j(T),typeof me=="function")for(T=me.call(T),me=0;!(J=T.next()).done;)J=J.value,he=F+de(J,me++),G+=U(J,_,V,he,P);else if(he==="object"){if(typeof T.then=="function")return U(pe(T),_,V,J,P);throw _=String(T),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return G}function z(T,_,V){if(T==null)return T;var J=[],P=0;return U(T,J,"","",function(he){return _.call(V,he,P++)}),J}function Q(T){if(T._status===-1){var _=T._result;_=_(),_.then(function(V){(T._status===0||T._status===-1)&&(T._status=1,T._result=V)},function(V){(T._status===0||T._status===-1)&&(T._status=2,T._result=V)}),T._status===-1&&(T._status=0,T._result=_)}if(T._status===1)return T._result.default;throw T._result}var ne=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},W={map:z,forEach:function(T,_,V){z(T,function(){_.apply(this,arguments)},V)},count:function(T){var _=0;return z(T,function(){_++}),_},toArray:function(T){return z(T,function(_){return _})||[]},only:function(T){if(!oe(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ce.Activity=v,Ce.Children=W,Ce.Component=E,Ce.Fragment=i,Ce.Profiler=u,Ce.PureComponent=A,Ce.StrictMode=o,Ce.Suspense=f,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(T){return H.H.useMemoCache(T)}},Ce.cache=function(T){return function(){return T.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(T,_,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var J=S({},T.props),P=T.key;if(_!=null)for(he in _.key!==void 0&&(P=""+_.key),_)!K.call(_,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&_.ref===void 0||(J[he]=_[he]);var he=arguments.length-2;if(he===1)J.children=V;else if(1<he){for(var G=Array(he),F=0;F<he;F++)G[F]=arguments[F+2];J.children=G}return ae(T.type,P,J)},Ce.createContext=function(T){return T={$$typeof:p,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:m,_context:T},T},Ce.createElement=function(T,_,V){var J,P={},he=null;if(_!=null)for(J in _.key!==void 0&&(he=""+_.key),_)K.call(_,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(P[J]=_[J]);var G=arguments.length-2;if(G===1)P.children=V;else if(1<G){for(var F=Array(G),me=0;me<G;me++)F[me]=arguments[me+2];P.children=F}if(T&&T.defaultProps)for(J in G=T.defaultProps,G)P[J]===void 0&&(P[J]=G[J]);return ae(T,he,P)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(T){return{$$typeof:g,render:T}},Ce.isValidElement=oe,Ce.lazy=function(T){return{$$typeof:h,_payload:{_status:-1,_result:T},_init:Q}},Ce.memo=function(T,_){return{$$typeof:x,type:T,compare:_===void 0?null:_}},Ce.startTransition=function(T){var _=H.T,V={};H.T=V;try{var J=T(),P=H.S;P!==null&&P(V,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then($,ne)}catch(he){ne(he)}finally{_!==null&&V.types!==null&&(_.types=V.types),H.T=_}},Ce.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Ce.use=function(T){return H.H.use(T)},Ce.useActionState=function(T,_,V){return H.H.useActionState(T,_,V)},Ce.useCallback=function(T,_){return H.H.useCallback(T,_)},Ce.useContext=function(T){return H.H.useContext(T)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(T,_){return H.H.useDeferredValue(T,_)},Ce.useEffect=function(T,_){return H.H.useEffect(T,_)},Ce.useEffectEvent=function(T){return H.H.useEffectEvent(T)},Ce.useId=function(){return H.H.useId()},Ce.useImperativeHandle=function(T,_,V){return H.H.useImperativeHandle(T,_,V)},Ce.useInsertionEffect=function(T,_){return H.H.useInsertionEffect(T,_)},Ce.useLayoutEffect=function(T,_){return H.H.useLayoutEffect(T,_)},Ce.useMemo=function(T,_){return H.H.useMemo(T,_)},Ce.useOptimistic=function(T,_){return H.H.useOptimistic(T,_)},Ce.useReducer=function(T,_,V){return H.H.useReducer(T,_,V)},Ce.useRef=function(T){return H.H.useRef(T)},Ce.useState=function(T){return H.H.useState(T)},Ce.useSyncExternalStore=function(T,_,V){return H.H.useSyncExternalStore(T,_,V)},Ce.useTransition=function(){return H.H.useTransition()},Ce.version="19.2.4",Ce}var Fp;function Eu(){return Fp||(Fp=1,Xc.exports=Bb()),Xc.exports}var y=Eu();const $b=Rh(y);var Ic={exports:{}},zs={},Jc={exports:{}},Kc={};/**
|
|
25
25
|
* @license React
|
|
26
26
|
* scheduler.production.js
|
|
27
27
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the MIT license found in the
|
|
31
31
|
* LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var
|
|
32
|
+
*/var Zp;function Ub(){return Zp||(Zp=1,(function(l){function r(U,z){var Q=U.length;U.push(z);e:for(;0<Q;){var ne=Q-1>>>1,W=U[ne];if(0<u(W,z))U[ne]=z,U[Q]=W,Q=ne;else break e}}function i(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var z=U[0],Q=U.pop();if(Q!==z){U[0]=Q;e:for(var ne=0,W=U.length,T=W>>>1;ne<T;){var _=2*(ne+1)-1,V=U[_],J=_+1,P=U[J];if(0>u(V,Q))J<W&&0>u(P,V)?(U[ne]=P,U[J]=Q,ne=J):(U[ne]=V,U[_]=Q,ne=_);else if(J<W&&0>u(P,Q))U[ne]=P,U[J]=Q,ne=J;else break e}}return z}function u(U,z){var Q=U.sortIndex-z.sortIndex;return Q!==0?Q:U.id-z.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var p=Date,g=p.now();l.unstable_now=function(){return p.now()-g}}var f=[],x=[],h=1,v=null,C=3,j=!1,w=!1,S=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(U){for(var z=i(x);z!==null;){if(z.callback===null)o(x);else if(z.startTime<=U)o(x),z.sortIndex=z.expirationTime,r(f,z);else break;z=i(x)}}function O(U){if(S=!1,R(U),!w)if(i(f)!==null)w=!0,$||($=!0,te());else{var z=i(x);z!==null&&pe(O,z.startTime-U)}}var $=!1,H=-1,K=5,ae=-1;function ue(){return k?!0:!(l.unstable_now()-ae<K)}function oe(){if(k=!1,$){var U=l.unstable_now();ae=U;var z=!0;try{e:{w=!1,S&&(S=!1,M(H),H=-1),j=!0;var Q=C;try{t:{for(R(U),v=i(f);v!==null&&!(v.expirationTime>U&&ue());){var ne=v.callback;if(typeof ne=="function"){v.callback=null,C=v.priorityLevel;var W=ne(v.expirationTime<=U);if(U=l.unstable_now(),typeof W=="function"){v.callback=W,R(U),z=!0;break t}v===i(f)&&o(f),R(U)}else o(f);v=i(f)}if(v!==null)z=!0;else{var T=i(x);T!==null&&pe(O,T.startTime-U),z=!1}}break e}finally{v=null,C=Q,j=!1}z=void 0}}finally{z?te():$=!1}}}var te;if(typeof A=="function")te=function(){A(oe)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,de=xe.port2;xe.port1.onmessage=oe,te=function(){de.postMessage(null)}}else te=function(){E(oe,0)};function pe(U,z){H=E(function(){U(l.unstable_now())},z)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(U){U.callback=null},l.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<U?Math.floor(1e3/U):5},l.unstable_getCurrentPriorityLevel=function(){return C},l.unstable_next=function(U){switch(C){case 1:case 2:case 3:var z=3;break;default:z=C}var Q=C;C=z;try{return U()}finally{C=Q}},l.unstable_requestPaint=function(){k=!0},l.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Q=C;C=U;try{return z()}finally{C=Q}},l.unstable_scheduleCallback=function(U,z,Q){var ne=l.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ne+Q:ne):Q=ne,U){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=Q+W,U={id:h++,callback:z,priorityLevel:U,startTime:Q,expirationTime:W,sortIndex:-1},Q>ne?(U.sortIndex=Q,r(x,U),i(f)===null&&U===i(x)&&(S?(M(H),H=-1):S=!0,pe(O,Q-ne))):(U.sortIndex=W,r(f,U),w||j||(w=!0,$||($=!0,te()))),U},l.unstable_shouldYield=ue,l.unstable_wrapCallback=function(U){var z=C;return function(){var Q=C;C=z;try{return U.apply(this,arguments)}finally{C=Q}}}})(Kc)),Kc}var Vp;function Hb(){return Vp||(Vp=1,Jc.exports=Ub()),Jc.exports}var Pc={exports:{}},zt={};/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-dom.production.js
|
|
35
35
|
*
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var
|
|
40
|
+
*/var Qp;function Gb(){if(Qp)return zt;Qp=1;var l=Eu();function r(f){var x="https://react.dev/errors/"+f;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)x+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+f+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function m(f,x,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:v==null?null:""+v,children:f,containerInfo:x,implementation:h}}var p=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(f,x){if(f==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,zt.createPortal=function(f,x){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(r(299));return m(f,x,null,h)},zt.flushSync=function(f){var x=p.T,h=o.p;try{if(p.T=null,o.p=2,f)return f()}finally{p.T=x,o.p=h,o.d.f()}},zt.preconnect=function(f,x){typeof f=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(f,x))},zt.prefetchDNS=function(f){typeof f=="string"&&o.d.D(f)},zt.preinit=function(f,x){if(typeof f=="string"&&x&&typeof x.as=="string"){var h=x.as,v=g(h,x.crossOrigin),C=typeof x.integrity=="string"?x.integrity:void 0,j=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;h==="style"?o.d.S(f,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:v,integrity:C,fetchPriority:j}):h==="script"&&o.d.X(f,{crossOrigin:v,integrity:C,fetchPriority:j,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},zt.preinitModule=function(f,x){if(typeof f=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var h=g(x.as,x.crossOrigin);o.d.M(f,{crossOrigin:h,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(f)},zt.preload=function(f,x){if(typeof f=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var h=x.as,v=g(h,x.crossOrigin);o.d.L(f,h,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},zt.preloadModule=function(f,x){if(typeof f=="string")if(x){var h=g(x.as,x.crossOrigin);o.d.m(f,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:h,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(f)},zt.requestFormReset=function(f){o.d.r(f)},zt.unstable_batchedUpdates=function(f,x){return f(x)},zt.useFormState=function(f,x,h){return p.H.useFormState(f,x,h)},zt.useFormStatus=function(){return p.H.useHostTransitionStatus()},zt.version="19.2.4",zt}var Xp;function Mh(){if(Xp)return Pc.exports;Xp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Pc.exports=Gb(),Pc.exports}/**
|
|
41
41
|
* @license React
|
|
42
42
|
* react-dom-client.production.js
|
|
43
43
|
*
|
|
@@ -45,67 +45,67 @@
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var
|
|
48
|
+
*/var Ip;function qb(){if(Ip)return zs;Ip=1;var l=Hb(),r=Eu(),i=Mh();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(m(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return f(c),e;if(d===s)return f(c),t;d=d.sibling}throw Error(o(188))}if(a.return!==s.return)a=c,s=d;else{for(var b=!1,N=c.child;N;){if(N===a){b=!0,a=c,s=d;break}if(N===s){b=!0,s=c,a=d;break}N=N.sibling}if(!b){for(N=d.child;N;){if(N===a){b=!0,a=d,s=c;break}if(N===s){b=!0,s=d,a=c;break}N=N.sibling}if(!b)throw Error(o(189))}}if(a.alternate!==s)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,C=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case E:return"Profiler";case k:return"StrictMode";case O:return"Suspense";case $:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case A:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var pe=Array.isArray,U=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},ne=[],W=-1;function T(e){return{current:e}}function _(e){0>W||(e.current=ne[W],ne[W]=null,W--)}function V(e,t){W++,ne[W]=e.current,e.current=t}var J=T(null),P=T(null),he=T(null),G=T(null);function F(e,t){switch(V(he,t),V(P,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_(J),V(J,e)}function me(){_(J),_(P),_(he)}function be(e){e.memoizedState!==null&&V(G,e);var t=J.current,a=dp(t,e.type);t!==a&&(V(P,e),V(J,a))}function Qe(e){P.current===e&&(_(J),_(P)),G.current===e&&(_(G),Ms._currentValue=Q)}var lt,Ct;function Fe(e){if(lt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lt=t&&t[1]||"",Ct=-1<a.stack.indexOf(`
|
|
49
49
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
50
|
-
`+
|
|
51
|
-
`),
|
|
52
|
-
`);for(c=s=0;s<
|
|
53
|
-
`+
|
|
50
|
+
`+lt+e+Ct}var it=!1;function Bt(e,t){if(!e||it)return"";it=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(X){var Z=X}Reflect.construct(e,[],se)}else{try{se.call()}catch(X){Z=X}e.call(se.prototype)}}else{try{throw Error()}catch(X){Z=X}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(X){if(X&&Z&&typeof X.stack=="string")return[X.stack,Z.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),b=d[0],N=d[1];if(b&&N){var D=b.split(`
|
|
51
|
+
`),Y=N.split(`
|
|
52
|
+
`);for(c=s=0;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;for(;c<Y.length&&!Y[c].includes("DetermineComponentFrameRoot");)c++;if(s===D.length||c===Y.length)for(s=D.length-1,c=Y.length-1;1<=s&&0<=c&&D[s]!==Y[c];)c--;for(;1<=s&&0<=c;s--,c--)if(D[s]!==Y[c]){if(s!==1||c!==1)do if(s--,c--,0>c||D[s]!==Y[c]){var ee=`
|
|
53
|
+
`+D[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=c);break}}}finally{it=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fe(a):""}function kn(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return e.child!==t&&t!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Bt(e.type,!1);case 11:return Bt(e.type.render,!1);case 1:return Bt(e.type,!0);case 31:return Fe("Activity");default:return""}}function qt(e){try{var t="",a=null;do t+=kn(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
|
|
54
54
|
Error generating stack: `+s.message+`
|
|
55
|
-
`+s.stack}}var bn=Object.prototype.hasOwnProperty,dn=l.unstable_scheduleCallback,Rt=l.unstable_cancelCallback,Dt=l.unstable_shouldYield,Ft=l.unstable_requestPaint,Ge=l.unstable_now,Q=l.unstable_getCurrentPriorityLevel,ve=l.unstable_ImmediatePriority,Ae=l.unstable_UserBlockingPriority,Te=l.unstable_NormalPriority,$e=l.unstable_LowPriority,Ie=l.unstable_IdlePriority,ee=l.log,le=l.unstable_setDisableYieldValue,fe=null,ke=null;function Ne(e){if(typeof ee=="function"&&le(e),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(fe,e)}catch{}}var Re=Math.clz32?Math.clz32:rt,Je=Math.log,ze=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(Je(e)/ze|0)|0}var mn=256,Jn=262144,Tn=4194304;function yn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ka(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~d,s!==0?c=yn(s):(b&=N,b!==0?c=yn(b):a||(a=N&~e,a!==0&&(c=yn(a))))):(N=s&~d,N!==0?c=yn(N):b!==0?c=yn(b):a||(a=s&~e,a!==0&&(c=yn(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Kn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ys(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 qu(){var e=Tn;return Tn<<=1,(Tn&62914560)===0&&(Tn=4194304),e}function Ti(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function $l(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Nx(e,t,a,s,c,d){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,M=e.expirationTimes,G=e.hiddenUpdates;for(a=b&~a;0<a;){var W=31-Re(a),re=1<<W;N[W]=0,M[W]=-1;var Y=G[W];if(Y!==null)for(G[W]=null,W=0;W<Y.length;W++){var Z=Y[W];Z!==null&&(Z.lane&=-536870913)}a&=~re}s!==0&&Yu(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function Yu(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Re(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Fu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-Re(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function Zu(e,t){var a=t&-t;return a=(a&42)!==0?1:Ai(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ai(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ri(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Vu(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:Dp(e.type))}function Qu(e,t){var a=L.p;try{return L.p=e,t()}finally{L.p=a}}var Pn=Math.random().toString(36).slice(2),St="__reactFiber$"+Pn,zt="__reactProps$"+Pn,Qa="__reactContainer$"+Pn,Mi="__reactEvents$"+Pn,kx="__reactListeners$"+Pn,Sx="__reactHandles$"+Pn,Xu="__reactResources$"+Pn,Ul="__reactMarker$"+Pn;function Di(e){delete e[St],delete e[zt],delete e[Mi],delete e[kx],delete e[Sx]}function Xa(e){var t=e[St];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Qa]||a[St]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=xp(e);e!==null;){if(a=e[St])return a;e=xp(e)}return t}e=a,a=e.parentNode}return null}function Ia(e){if(e=e[St]||e[Qa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Hl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ja(e){var t=e[Xu];return t||(t=e[Xu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[Ul]=!0}var Iu=new Set,Ju={};function Sa(e,t){Ka(e,t),Ka(e+"Capture",t)}function Ka(e,t){for(Ju[e]=t,e=0;e<t.length;e++)Iu.add(t[e])}var Cx=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]*$"),Ku={},Pu={};function Ex(e){return bn.call(Pu,e)?!0:bn.call(Ku,e)?!1:Cx.test(e)?Pu[e]=!0:(Ku[e]=!0,!1)}function Fs(e,t,a){if(Ex(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Zs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function An(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function Wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tx(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){a=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _i(e){if(!e._valueTracker){var t=Wu(e)?"checked":"value";e._valueTracker=Tx(e,t,""+e[t])}}function ed(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=Wu(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Vs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ax=/[\n"\\]/g;function en(e){return e.replace(Ax,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oi(e,t,a,s,c,d,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Wt(t)):e.value!==""+Wt(t)&&(e.value=""+Wt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Li(e,b,Wt(t)):a!=null?Li(e,b,Wt(a)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Wt(N):e.removeAttribute("name")}function td(e,t,a,s,c,d,b,N){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){_i(e);return}a=a!=null?""+Wt(a):"",t=t!=null?""+Wt(t):a,N||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=N?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),_i(e)}function Li(e,t,a){t==="number"&&Vs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Pa(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+Wt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function nd(e,t,a){if(t!=null&&(t=""+Wt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Wt(a):""}function ad(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(o(92));if(me(s)){if(1<s.length)throw Error(o(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=Wt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),_i(e)}function Wa(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Rx=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 ld(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||Rx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function sd(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&ld(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&ld(e,d,t[d])}function zi(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Mx=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"]]),Dx=/^[\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 Qs(e){return Dx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rn(){}var Bi=null;function $i(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var el=null,tl=null;function rd(e){var t=Ia(e);if(t&&(e=t.stateNode)){var a=e[zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+en(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[zt]||null;if(!c)throw Error(o(90));Oi(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&ed(s)}break e;case"textarea":nd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Pa(e,!!a.multiple,t,!1)}}}var Ui=!1;function id(e,t,a){if(Ui)return e(t,a);Ui=!0;try{var s=e(t);return s}finally{if(Ui=!1,(el!==null||tl!==null)&&(Or(),el&&(t=el,e=tl,tl=el=null,rd(t),e)))for(t=0;t<e.length;t++)rd(e[t])}}function Gl(e,t){var a=e.stateNode;if(a===null)return null;var s=a[zt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hi=!1;if(Mn)try{var ql={};Object.defineProperty(ql,"passive",{get:function(){Hi=!0}}),window.addEventListener("test",ql,ql),window.removeEventListener("test",ql,ql)}catch{Hi=!1}var Wn=null,Gi=null,Xs=null;function od(){if(Xs)return Xs;var e,t=Gi,a=t.length,s,c="value"in Wn?Wn.value:Wn.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var b=a-e;for(s=1;s<=b&&t[a-s]===c[d-s];s++);return Xs=c.slice(e,1<s?1-s:void 0)}function Is(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Js(){return!0}function cd(){return!1}function Bt(e){function t(a,s,c,d,b){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(d):d[N]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Js:cd,this.isPropagationStopped=cd,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Js)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Js)},persist:function(){},isPersistent:Js}),t}var Ca={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ks=Bt(Ca),Yl=v({},Ca,{view:0,detail:0}),_x=Bt(Yl),qi,Yi,Fl,Ps=v({},Yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Fl&&(Fl&&e.type==="mousemove"?(qi=e.screenX-Fl.screenX,Yi=e.screenY-Fl.screenY):Yi=qi=0,Fl=e),qi)},movementY:function(e){return"movementY"in e?e.movementY:Yi}}),ud=Bt(Ps),Ox=v({},Ps,{dataTransfer:0}),Lx=Bt(Ox),zx=v({},Yl,{relatedTarget:0}),Fi=Bt(zx),Bx=v({},Ca,{animationName:0,elapsedTime:0,pseudoElement:0}),$x=Bt(Bx),Ux=v({},Ca,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hx=Bt(Ux),Gx=v({},Ca,{data:0}),dd=Bt(Gx),qx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yx={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"},Fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fx[e])?!!t[e]:!1}function Zi(){return Zx}var Vx=v({},Yl,{key:function(e){if(e.key){var t=qx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Is(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zi,charCode:function(e){return e.type==="keypress"?Is(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Is(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qx=Bt(Vx),Xx=v({},Ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),md=Bt(Xx),Ix=v({},Yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zi}),Jx=Bt(Ix),Kx=v({},Ca,{propertyName:0,elapsedTime:0,pseudoElement:0}),Px=Bt(Kx),Wx=v({},Ps,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),eg=Bt(Wx),tg=v({},Ca,{newState:0,oldState:0}),ng=Bt(tg),ag=[9,13,27,32],Vi=Mn&&"CompositionEvent"in window,Zl=null;Mn&&"documentMode"in document&&(Zl=document.documentMode);var lg=Mn&&"TextEvent"in window&&!Zl,fd=Mn&&(!Vi||Zl&&8<Zl&&11>=Zl),pd=" ",hd=!1;function xd(e,t){switch(e){case"keyup":return ag.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nl=!1;function sg(e,t){switch(e){case"compositionend":return gd(t);case"keypress":return t.which!==32?null:(hd=!0,pd);case"textInput":return e=t.data,e===pd&&hd?null:e;default:return null}}function rg(e,t){if(nl)return e==="compositionend"||!Vi&&xd(e,t)?(e=od(),Xs=Gi=Wn=null,nl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fd&&t.locale!=="ko"?null:t.data;default:return null}}var ig={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 bd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ig[e.type]:t==="textarea"}function yd(e,t,a,s){el?tl?tl.push(s):tl=[s]:el=s,t=Gr(t,"onChange"),0<t.length&&(a=new Ks("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Vl=null,Ql=null;function og(e){np(e,0)}function Ws(e){var t=Hl(e);if(ed(t))return e}function vd(e,t){if(e==="change")return t}var jd=!1;if(Mn){var Qi;if(Mn){var Xi="oninput"in document;if(!Xi){var wd=document.createElement("div");wd.setAttribute("oninput","return;"),Xi=typeof wd.oninput=="function"}Qi=Xi}else Qi=!1;jd=Qi&&(!document.documentMode||9<document.documentMode)}function Nd(){Vl&&(Vl.detachEvent("onpropertychange",kd),Ql=Vl=null)}function kd(e){if(e.propertyName==="value"&&Ws(Ql)){var t=[];yd(t,Ql,e,$i(e)),id(og,t)}}function cg(e,t,a){e==="focusin"?(Nd(),Vl=t,Ql=a,Vl.attachEvent("onpropertychange",kd)):e==="focusout"&&Nd()}function ug(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(Ql)}function dg(e,t){if(e==="click")return Ws(t)}function mg(e,t){if(e==="input"||e==="change")return Ws(t)}function fg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:fg;function Xl(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!bn.call(t,c)||!Zt(e[c],t[c]))return!1}return!0}function Sd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cd(e,t){var a=Sd(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Sd(a)}}function Ed(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ed(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Td(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Vs(e.document)}return t}function Ii(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var pg=Mn&&"documentMode"in document&&11>=document.documentMode,al=null,Ji=null,Il=null,Ki=!1;function Ad(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ki||al==null||al!==Vs(s)||(s=al,"selectionStart"in s&&Ii(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Il&&Xl(Il,s)||(Il=s,s=Gr(Ji,"onSelect"),0<s.length&&(t=new Ks("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=al)))}function Ea(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ll={animationend:Ea("Animation","AnimationEnd"),animationiteration:Ea("Animation","AnimationIteration"),animationstart:Ea("Animation","AnimationStart"),transitionrun:Ea("Transition","TransitionRun"),transitionstart:Ea("Transition","TransitionStart"),transitioncancel:Ea("Transition","TransitionCancel"),transitionend:Ea("Transition","TransitionEnd")},Pi={},Rd={};Mn&&(Rd=document.createElement("div").style,"AnimationEvent"in window||(delete ll.animationend.animation,delete ll.animationiteration.animation,delete ll.animationstart.animation),"TransitionEvent"in window||delete ll.transitionend.transition);function Ta(e){if(Pi[e])return Pi[e];if(!ll[e])return e;var t=ll[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Rd)return Pi[e]=t[a];return e}var Md=Ta("animationend"),Dd=Ta("animationiteration"),_d=Ta("animationstart"),hg=Ta("transitionrun"),xg=Ta("transitionstart"),gg=Ta("transitioncancel"),Od=Ta("transitionend"),Ld=new Map,Wi="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(" ");Wi.push("scrollEnd");function fn(e,t){Ld.set(e,t),Sa(t,[e])}var er=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},tn=[],sl=0,eo=0;function tr(){for(var e=sl,t=eo=sl=0;t<e;){var a=tn[t];tn[t++]=null;var s=tn[t];tn[t++]=null;var c=tn[t];tn[t++]=null;var d=tn[t];if(tn[t++]=null,s!==null&&c!==null){var b=s.pending;b===null?c.next=c:(c.next=b.next,b.next=c),s.pending=c}d!==0&&zd(a,c,d)}}function nr(e,t,a,s){tn[sl++]=e,tn[sl++]=t,tn[sl++]=a,tn[sl++]=s,eo|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function to(e,t,a,s){return nr(e,t,a,s),ar(e)}function Aa(e,t){return nr(e,null,null,t),ar(e)}function zd(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,s=d.alternate,s!==null&&(s.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-Re(a),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),d):null}function ar(e){if(50<gs)throw gs=0,dc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rl={};function bg(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,a,s){return new bg(e,t,a,s)}function no(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dn(e,t){var a=e.alternate;return a===null?(a=Vt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Bd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lr(e,t,a,s,c,d){var b=0;if(s=e,typeof e=="function")no(e)&&(b=1);else if(typeof e=="string")b=Nb(e,a,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case de:return e=Vt(31,a,t,c),e.elementType=de,e.lanes=d,e;case k:return Ra(a.children,c,d,t);case S:b=8,c|=24;break;case T:return e=Vt(12,a,t,c|2),e.elementType=T,e.lanes=d,e;case O:return e=Vt(13,a,t,c),e.elementType=O,e.lanes=d,e;case $:return e=Vt(19,a,t,c),e.elementType=$,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:b=10;break e;case A:b=9;break e;case D:b=11;break e;case q:b=14;break e;case ne:b=16,s=null;break e}b=29,a=Error(o(130,e===null?"null":typeof e,"")),s=null}return t=Vt(b,a,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function Ra(e,t,a,s){return e=Vt(7,e,s,t),e.lanes=a,e}function ao(e,t,a){return e=Vt(6,e,null,t),e.lanes=a,e}function $d(e){var t=Vt(18,null,null,0);return t.stateNode=e,t}function lo(e,t,a){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ud=new WeakMap;function nn(e,t){if(typeof e=="object"&&e!==null){var a=Ud.get(e);return a!==void 0?a:(t={value:e,source:t,stack:at(t)},Ud.set(e,t),t)}return{value:e,source:t,stack:at(t)}}var il=[],ol=0,sr=null,Jl=0,an=[],ln=0,ea=null,vn=1,jn="";function _n(e,t){il[ol++]=Jl,il[ol++]=sr,sr=e,Jl=t}function Hd(e,t,a){an[ln++]=vn,an[ln++]=jn,an[ln++]=ea,ea=e;var s=vn;e=jn;var c=32-Re(s)-1;s&=~(1<<c),a+=1;var d=32-Re(t)+c;if(30<d){var b=c-c%5;d=(s&(1<<b)-1).toString(32),s>>=b,c-=b,vn=1<<32-Re(t)+c|a<<c|s,jn=d+e}else vn=1<<d|a<<c|s,jn=e}function so(e){e.return!==null&&(_n(e,1),Hd(e,1,0))}function ro(e){for(;e===sr;)sr=il[--ol],il[ol]=null,Jl=il[--ol],il[ol]=null;for(;e===ea;)ea=an[--ln],an[ln]=null,jn=an[--ln],an[ln]=null,vn=an[--ln],an[ln]=null}function Gd(e,t){an[ln++]=vn,an[ln++]=jn,an[ln++]=ea,vn=t.id,jn=t.overflow,ea=e}var Ct=null,lt=null,Be=!1,ta=null,sn=!1,io=Error(o(519));function na(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kl(nn(t,e)),io}function qd(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[St]=e,t[zt]=s,a){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(a=0;a<ys.length;a++)De(ys[a],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),td(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),ad(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||rp(t.textContent,a)?(s.popover!=null&&(De("beforetoggle",t),De("toggle",t)),s.onScroll!=null&&De("scroll",t),s.onScrollEnd!=null&&De("scrollend",t),s.onClick!=null&&(t.onclick=Rn),t=!0):t=!1,t||na(e,!0)}function Yd(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:Ct=Ct.return}}function cl(e){if(e!==Ct)return!1;if(!Be)return Yd(e),Be=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Cc(e.type,e.memoizedProps)),a=!a),a&<&&na(e),Yd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));lt=hp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));lt=hp(e)}else t===27?(t=lt,xa(e.type)?(e=Mc,Mc=null,lt=e):lt=t):lt=Ct?on(e.stateNode.nextSibling):null;return!0}function Ma(){lt=Ct=null,Be=!1}function oo(){var e=ta;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),ta=null),e}function Kl(e){ta===null?ta=[e]:ta.push(e)}var co=E(null),Da=null,On=null;function aa(e,t,a){F(co,t._currentValue),t._currentValue=a}function Ln(e){e._currentValue=co.current,_(co)}function uo(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function mo(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var b=c.child;d=d.firstContext;e:for(;d!==null;){var N=d;d=c;for(var M=0;M<t.length;M++)if(N.context===t[M]){d.lanes|=a,N=d.alternate,N!==null&&(N.lanes|=a),uo(d.return,a,e),s||(b=null);break e}d=N.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(o(341));b.lanes|=a,d=b.alternate,d!==null&&(d.lanes|=a),uo(b,a,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function ul(e,t,a,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var N=c.type;Zt(c.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(c===he.current){if(b=c.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ks):e=[ks])}c=c.return}e!==null&&mo(t,e,a,s),t.flags|=262144}function rr(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _a(e){Da=e,On=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Et(e){return Fd(Da,e)}function ir(e,t){return Da===null&&_a(e),Fd(e,t)}function Fd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},On===null){if(e===null)throw Error(o(308));On=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else On=On.next=t;return a}var yg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},vg=l.unstable_scheduleCallback,jg=l.unstable_NormalPriority,xt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fo(){return{controller:new yg,data:new Map,refCount:0}}function Pl(e){e.refCount--,e.refCount===0&&vg(jg,function(){e.controller.abort()})}var Wl=null,po=0,dl=0,ml=null;function wg(e,t){if(Wl===null){var a=Wl=[];po=0,dl=gc(),ml={status:"pending",value:void 0,then:function(s){a.push(s)}}}return po++,t.then(Zd,Zd),t}function Zd(){if(--po===0&&Wl!==null){ml!==null&&(ml.status="fulfilled");var e=Wl;Wl=null,dl=0,ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ng(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var Vd=B.S;B.S=function(e,t){Rf=Ge(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wg(e,t),Vd!==null&&Vd(e,t)};var Oa=E(null);function ho(){var e=Oa.current;return e!==null?e:tt.pooledCache}function or(e,t){t===null?F(Oa,Oa.current):F(Oa,t.pool)}function Qd(){var e=ho();return e===null?null:{parent:xt._currentValue,pool:e}}var fl=Error(o(460)),xo=Error(o(474)),cr=Error(o(542)),ur={then:function(){}};function Xd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Id(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Rn,Rn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kd(e),e;default:if(typeof t.status=="string")t.then(Rn,Rn);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kd(e),e}throw za=t,fl}}function La(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(za=a,fl):a}}var za=null;function Jd(){if(za===null)throw Error(o(459));var e=za;return za=null,e}function Kd(e){if(e===fl||e===cr)throw Error(o(483))}var pl=null,es=0;function dr(e){var t=es;return es+=1,pl===null&&(pl=[]),Id(pl,e,t)}function ts(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mr(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Pd(e){function t(U,z){if(e){var H=U.deletions;H===null?(U.deletions=[z],U.flags|=16):H.push(z)}}function a(U,z){if(!e)return null;for(;z!==null;)t(U,z),z=z.sibling;return null}function s(U){for(var z=new Map;U!==null;)U.key!==null?z.set(U.key,U):z.set(U.index,U),U=U.sibling;return z}function c(U,z){return U=Dn(U,z),U.index=0,U.sibling=null,U}function d(U,z,H){return U.index=H,e?(H=U.alternate,H!==null?(H=H.index,H<z?(U.flags|=67108866,z):H):(U.flags|=67108866,z)):(U.flags|=1048576,z)}function b(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function N(U,z,H,ae){return z===null||z.tag!==6?(z=ao(H,U.mode,ae),z.return=U,z):(z=c(z,H),z.return=U,z)}function M(U,z,H,ae){var ye=H.type;return ye===k?W(U,z,H.props.children,ae,H.key):z!==null&&(z.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ne&&La(ye)===z.type)?(z=c(z,H.props),ts(z,H),z.return=U,z):(z=lr(H.type,H.key,H.props,null,U.mode,ae),ts(z,H),z.return=U,z)}function G(U,z,H,ae){return z===null||z.tag!==4||z.stateNode.containerInfo!==H.containerInfo||z.stateNode.implementation!==H.implementation?(z=lo(H,U.mode,ae),z.return=U,z):(z=c(z,H.children||[]),z.return=U,z)}function W(U,z,H,ae,ye){return z===null||z.tag!==7?(z=Ra(H,U.mode,ae,ye),z.return=U,z):(z=c(z,H),z.return=U,z)}function re(U,z,H){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=ao(""+z,U.mode,H),z.return=U,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case j:return H=lr(z.type,z.key,z.props,null,U.mode,H),ts(H,z),H.return=U,H;case w:return z=lo(z,U.mode,H),z.return=U,z;case ne:return z=La(z),re(U,z,H)}if(me(z)||te(z))return z=Ra(z,U.mode,H,null),z.return=U,z;if(typeof z.then=="function")return re(U,dr(z),H);if(z.$$typeof===R)return re(U,ir(U,z),H);mr(U,z)}return null}function Y(U,z,H,ae){var ye=z!==null?z.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return ye!==null?null:N(U,z,""+H,ae);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case j:return H.key===ye?M(U,z,H,ae):null;case w:return H.key===ye?G(U,z,H,ae):null;case ne:return H=La(H),Y(U,z,H,ae)}if(me(H)||te(H))return ye!==null?null:W(U,z,H,ae,null);if(typeof H.then=="function")return Y(U,z,dr(H),ae);if(H.$$typeof===R)return Y(U,z,ir(U,H),ae);mr(U,H)}return null}function Z(U,z,H,ae,ye){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return U=U.get(H)||null,N(z,U,""+ae,ye);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case j:return U=U.get(ae.key===null?H:ae.key)||null,M(z,U,ae,ye);case w:return U=U.get(ae.key===null?H:ae.key)||null,G(z,U,ae,ye);case ne:return ae=La(ae),Z(U,z,H,ae,ye)}if(me(ae)||te(ae))return U=U.get(H)||null,W(z,U,ae,ye,null);if(typeof ae.then=="function")return Z(U,z,H,dr(ae),ye);if(ae.$$typeof===R)return Z(U,z,H,ir(z,ae),ye);mr(z,ae)}return null}function xe(U,z,H,ae){for(var ye=null,qe=null,ge=z,Ee=z=0,Oe=null;ge!==null&&Ee<H.length;Ee++){ge.index>Ee?(Oe=ge,ge=null):Oe=ge.sibling;var Ye=Y(U,ge,H[Ee],ae);if(Ye===null){ge===null&&(ge=Oe);break}e&&ge&&Ye.alternate===null&&t(U,ge),z=d(Ye,z,Ee),qe===null?ye=Ye:qe.sibling=Ye,qe=Ye,ge=Oe}if(Ee===H.length)return a(U,ge),Be&&_n(U,Ee),ye;if(ge===null){for(;Ee<H.length;Ee++)ge=re(U,H[Ee],ae),ge!==null&&(z=d(ge,z,Ee),qe===null?ye=ge:qe.sibling=ge,qe=ge);return Be&&_n(U,Ee),ye}for(ge=s(ge);Ee<H.length;Ee++)Oe=Z(ge,U,Ee,H[Ee],ae),Oe!==null&&(e&&Oe.alternate!==null&&ge.delete(Oe.key===null?Ee:Oe.key),z=d(Oe,z,Ee),qe===null?ye=Oe:qe.sibling=Oe,qe=Oe);return e&&ge.forEach(function(ja){return t(U,ja)}),Be&&_n(U,Ee),ye}function je(U,z,H,ae){if(H==null)throw Error(o(151));for(var ye=null,qe=null,ge=z,Ee=z=0,Oe=null,Ye=H.next();ge!==null&&!Ye.done;Ee++,Ye=H.next()){ge.index>Ee?(Oe=ge,ge=null):Oe=ge.sibling;var ja=Y(U,ge,Ye.value,ae);if(ja===null){ge===null&&(ge=Oe);break}e&&ge&&ja.alternate===null&&t(U,ge),z=d(ja,z,Ee),qe===null?ye=ja:qe.sibling=ja,qe=ja,ge=Oe}if(Ye.done)return a(U,ge),Be&&_n(U,Ee),ye;if(ge===null){for(;!Ye.done;Ee++,Ye=H.next())Ye=re(U,Ye.value,ae),Ye!==null&&(z=d(Ye,z,Ee),qe===null?ye=Ye:qe.sibling=Ye,qe=Ye);return Be&&_n(U,Ee),ye}for(ge=s(ge);!Ye.done;Ee++,Ye=H.next())Ye=Z(ge,U,Ee,Ye.value,ae),Ye!==null&&(e&&Ye.alternate!==null&&ge.delete(Ye.key===null?Ee:Ye.key),z=d(Ye,z,Ee),qe===null?ye=Ye:qe.sibling=Ye,qe=Ye);return e&&ge.forEach(function(Ob){return t(U,Ob)}),Be&&_n(U,Ee),ye}function We(U,z,H,ae){if(typeof H=="object"&&H!==null&&H.type===k&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case j:e:{for(var ye=H.key;z!==null;){if(z.key===ye){if(ye=H.type,ye===k){if(z.tag===7){a(U,z.sibling),ae=c(z,H.props.children),ae.return=U,U=ae;break e}}else if(z.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ne&&La(ye)===z.type){a(U,z.sibling),ae=c(z,H.props),ts(ae,H),ae.return=U,U=ae;break e}a(U,z);break}else t(U,z);z=z.sibling}H.type===k?(ae=Ra(H.props.children,U.mode,ae,H.key),ae.return=U,U=ae):(ae=lr(H.type,H.key,H.props,null,U.mode,ae),ts(ae,H),ae.return=U,U=ae)}return b(U);case w:e:{for(ye=H.key;z!==null;){if(z.key===ye)if(z.tag===4&&z.stateNode.containerInfo===H.containerInfo&&z.stateNode.implementation===H.implementation){a(U,z.sibling),ae=c(z,H.children||[]),ae.return=U,U=ae;break e}else{a(U,z);break}else t(U,z);z=z.sibling}ae=lo(H,U.mode,ae),ae.return=U,U=ae}return b(U);case ne:return H=La(H),We(U,z,H,ae)}if(me(H))return xe(U,z,H,ae);if(te(H)){if(ye=te(H),typeof ye!="function")throw Error(o(150));return H=ye.call(H),je(U,z,H,ae)}if(typeof H.then=="function")return We(U,z,dr(H),ae);if(H.$$typeof===R)return We(U,z,ir(U,H),ae);mr(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,z!==null&&z.tag===6?(a(U,z.sibling),ae=c(z,H),ae.return=U,U=ae):(a(U,z),ae=ao(H,U.mode,ae),ae.return=U,U=ae),b(U)):a(U,z)}return function(U,z,H,ae){try{es=0;var ye=We(U,z,H,ae);return pl=null,ye}catch(ge){if(ge===fl||ge===cr)throw ge;var qe=Vt(29,ge,null,U.mode);return qe.lanes=ae,qe.return=U,qe}finally{}}}var Ba=Pd(!0),Wd=Pd(!1),la=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ra(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ze&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=ar(e),zd(e,null,a),t}return nr(e,s,t,a),ar(e)}function ns(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Fu(e,a)}}function yo(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=b:d=d.next=b,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var vo=!1;function as(){if(vo){var e=ml;if(e!==null)throw e}}function ls(e,t,a,s){vo=!1;var c=e.updateQueue;la=!1;var d=c.firstBaseUpdate,b=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var M=N,G=M.next;M.next=null,b===null?d=G:b.next=G,b=M;var W=e.alternate;W!==null&&(W=W.updateQueue,N=W.lastBaseUpdate,N!==b&&(N===null?W.firstBaseUpdate=G:N.next=G,W.lastBaseUpdate=M))}if(d!==null){var re=c.baseState;b=0,W=G=M=null,N=d;do{var Y=N.lane&-536870913,Z=Y!==N.lane;if(Z?(_e&Y)===Y:(s&Y)===Y){Y!==0&&Y===dl&&(vo=!0),W!==null&&(W=W.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=e,je=N;Y=t;var We=a;switch(je.tag){case 1:if(xe=je.payload,typeof xe=="function"){re=xe.call(We,re,Y);break e}re=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=je.payload,Y=typeof xe=="function"?xe.call(We,re,Y):xe,Y==null)break e;re=v({},re,Y);break e;case 2:la=!0}}Y=N.callback,Y!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=c.callbacks,Z===null?c.callbacks=[Y]:Z.push(Y))}else Z={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},W===null?(G=W=Z,M=re):W=W.next=Z,b|=Y;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,c.lastBaseUpdate=Z,c.shared.pending=null}}while(!0);W===null&&(M=re),c.baseState=M,c.firstBaseUpdate=G,c.lastBaseUpdate=W,d===null&&(c.shared.lanes=0),da|=b,e.lanes=b,e.memoizedState=re}}function em(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function tm(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)em(a[e],t)}var hl=E(null),fr=E(0);function nm(e,t){e=Fn,F(fr,e),F(hl,t),Fn=e|t.baseLanes}function jo(){F(fr,Fn),F(hl,hl.current)}function wo(){Fn=fr.current,_(hl),_(fr)}var Qt=E(null),rn=null;function ia(e){var t=e.alternate;F(mt,mt.current&1),F(Qt,e),rn===null&&(t===null||hl.current!==null||t.memoizedState!==null)&&(rn=e)}function No(e){F(mt,mt.current),F(Qt,e),rn===null&&(rn=e)}function am(e){e.tag===22?(F(mt,mt.current),F(Qt,e),rn===null&&(rn=e)):oa()}function oa(){F(mt,mt.current),F(Qt,Qt.current)}function Xt(e){_(Qt),rn===e&&(rn=null),_(mt)}var mt=E(0);function pr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ac(a)||Rc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zn=0,Ce=null,Ke=null,gt=null,hr=!1,xl=!1,$a=!1,xr=0,ss=0,gl=null,kg=0;function ot(){throw Error(o(321))}function ko(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Zt(e[a],t[a]))return!1;return!0}function So(e,t,a,s,c,d){return zn=d,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?Hm:Ho,$a=!1,d=a(s,c),$a=!1,xl&&(d=sm(t,a,s,c)),lm(e),d}function lm(e){B.H=os;var t=Ke!==null&&Ke.next!==null;if(zn=0,gt=Ke=Ce=null,hr=!1,ss=0,gl=null,t)throw Error(o(300));e===null||bt||(e=e.dependencies,e!==null&&rr(e)&&(bt=!0))}function sm(e,t,a,s){Ce=e;var c=0;do{if(xl&&(gl=null),ss=0,xl=!1,25<=c)throw Error(o(301));if(c+=1,gt=Ke=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}B.H=Gm,d=t(a,s)}while(xl);return d}function Sg(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?rs(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Co(){var e=xr!==0;return xr=0,e}function Eo(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function To(e){if(hr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hr=!1}zn=0,gt=Ke=Ce=null,xl=!1,ss=xr=0,gl=null}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Ce.memoizedState=gt=e:gt=gt.next=e,gt}function ft(){if(Ke===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=gt===null?Ce.memoizedState:gt.next;if(t!==null)gt=t,Ke=e;else{if(e===null)throw Ce.alternate===null?Error(o(467)):Error(o(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},gt===null?Ce.memoizedState=gt=e:gt=gt.next=e}return gt}function gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=ss;return ss+=1,gl===null&&(gl=[]),e=Id(gl,e,t),t=Ce,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?Hm:Ho),e}function br(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return rs(e);if(e.$$typeof===R)return Et(e)}throw Error(o(438,String(e)))}function Ao(e){var t=null,a=Ce.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Ce.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=gr(),Ce.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=oe;return t.index++,a}function Bn(e,t){return typeof t=="function"?t(e):t}function yr(e){var t=ft();return Ro(t,Ke,e)}function Ro(e,t,a){var s=e.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=a;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var b=c.next;c.next=d.next,d.next=b}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var N=b=null,M=null,G=t,W=!1;do{var re=G.lane&-536870913;if(re!==G.lane?(_e&re)===re:(zn&re)===re){var Y=G.revertLane;if(Y===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),re===dl&&(W=!0);else if((zn&Y)===Y){G=G.next,Y===dl&&(W=!0);continue}else re={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(N=M=re,b=d):M=M.next=re,Ce.lanes|=Y,da|=Y;re=G.action,$a&&a(d,re),d=G.hasEagerState?G.eagerState:a(d,re)}else Y={lane:re,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(N=M=Y,b=d):M=M.next=Y,Ce.lanes|=re,da|=re;G=G.next}while(G!==null&&G!==t);if(M===null?b=d:M.next=N,!Zt(d,e.memoizedState)&&(bt=!0,W&&(a=ml,a!==null)))throw a;e.memoizedState=d,e.baseState=b,e.baseQueue=M,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Mo(e){var t=ft(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var b=c=c.next;do d=e(d,b.action),b=b.next;while(b!==c);Zt(d,t.memoizedState)||(bt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,s]}function rm(e,t,a){var s=Ce,c=ft(),d=Be;if(d){if(a===void 0)throw Error(o(407));a=a()}else a=t();var b=!Zt((Ke||c).memoizedState,a);if(b&&(c.memoizedState=a,bt=!0),c=c.queue,Oo(cm.bind(null,s,c,e),[e]),c.getSnapshot!==t||b||gt!==null&>.memoizedState.tag&1){if(s.flags|=2048,bl(9,{destroy:void 0},om.bind(null,s,c,a,t),null),tt===null)throw Error(o(349));d||(zn&127)!==0||im(s,t,a)}return a}function im(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ce.updateQueue,t===null?(t=gr(),Ce.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function om(e,t,a,s){t.value=a,t.getSnapshot=s,um(t)&&dm(e)}function cm(e,t,a){return a(function(){um(t)&&dm(e)})}function um(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Zt(e,a)}catch{return!0}}function dm(e){var t=Aa(e,2);t!==null&&qt(t,e,2)}function Do(e){var t=_t();if(typeof e=="function"){var a=e;if(e=a(),$a){Ne(!0);try{a()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:e},t}function mm(e,t,a,s){return e.baseState=a,Ro(e,Ke,typeof s=="function"?s:Bn)}function Cg(e,t,a,s,c){if(wr(e))throw Error(o(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};B.T!==null?a(!0):d.isTransition=!1,s(d),a=t.pending,a===null?(d.next=t.pending=d,fm(t,d)):(d.next=a.next,t.pending=a.next=d)}}function fm(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=B.T,b={};B.T=b;try{var N=a(c,s),M=B.S;M!==null&&M(b,N),pm(e,t,N)}catch(G){_o(e,t,G)}finally{d!==null&&b.types!==null&&(d.types=b.types),B.T=d}}else try{d=a(c,s),pm(e,t,d)}catch(G){_o(e,t,G)}}function pm(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){hm(e,t,s)},function(s){return _o(e,t,s)}):hm(e,t,a)}function hm(e,t,a){t.status="fulfilled",t.value=a,xm(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,fm(e,a)))}function _o(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,xm(t),t=t.next;while(t!==s)}e.action=null}function xm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gm(e,t){return t}function bm(e,t){if(Be){var a=tt.formState;if(a!==null){e:{var s=Ce;if(Be){if(lt){t:{for(var c=lt,d=sn;c.nodeType!==8;){if(!d){c=null;break t}if(c=on(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){lt=on(c.nextSibling),s=c.data==="F!";break e}}na(s)}s=!1}s&&(t=a[0])}}return a=_t(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gm,lastRenderedState:t},a.queue=s,a=Bm.bind(null,Ce,s),s.dispatch=a,s=Do(!1),d=Uo.bind(null,Ce,!1,s.queue),s=_t(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=Cg.bind(null,Ce,c,d,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function ym(e){var t=ft();return vm(t,Ke,e)}function vm(e,t,a){if(t=Ro(e,t,gm)[0],e=yr(Bn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=rs(t)}catch(b){throw b===fl?cr:b}else s=t;t=ft();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Ce.flags|=2048,bl(9,{destroy:void 0},Eg.bind(null,c,a),null)),[s,d,e]}function Eg(e,t){e.action=t}function jm(e){var t=ft(),a=Ke;if(a!==null)return vm(t,a,e);ft(),t=t.memoizedState,a=ft();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function bl(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=gr(),Ce.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function wm(){return ft().memoizedState}function vr(e,t,a,s){var c=_t();Ce.flags|=e,c.memoizedState=bl(1|t,{destroy:void 0},a,s===void 0?null:s)}function jr(e,t,a,s){var c=ft();s=s===void 0?null:s;var d=c.memoizedState.inst;Ke!==null&&s!==null&&ko(s,Ke.memoizedState.deps)?c.memoizedState=bl(t,d,a,s):(Ce.flags|=e,c.memoizedState=bl(1|t,d,a,s))}function Nm(e,t){vr(8390656,8,e,t)}function Oo(e,t){jr(2048,8,e,t)}function Tg(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=gr(),Ce.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function km(e){var t=ft().memoizedState;return Tg({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Sm(e,t){return jr(4,2,e,t)}function Cm(e,t){return jr(4,4,e,t)}function Em(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tm(e,t,a){a=a!=null?a.concat([e]):null,jr(4,4,Em.bind(null,t,e),a)}function Lo(){}function Am(e,t){var a=ft();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&ko(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Rm(e,t){var a=ft();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&ko(t,s[1]))return s[0];if(s=e(),$a){Ne(!0);try{e()}finally{Ne(!1)}}return a.memoizedState=[s,t],s}function zo(e,t,a){return a===void 0||(zn&1073741824)!==0&&(_e&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Df(),Ce.lanes|=e,da|=e,a)}function Mm(e,t,a,s){return Zt(a,t)?a:hl.current!==null?(e=zo(e,a,s),Zt(e,t)||(bt=!0),e):(zn&42)===0||(zn&1073741824)!==0&&(_e&261930)===0?(bt=!0,e.memoizedState=a):(e=Df(),Ce.lanes|=e,da|=e,t)}function Dm(e,t,a,s,c){var d=L.p;L.p=d!==0&&8>d?d:8;var b=B.T,N={};B.T=N,Uo(e,!1,t,a);try{var M=c(),G=B.S;if(G!==null&&G(N,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var W=Ng(M,s);is(e,t,W,Kt(e))}else is(e,t,s,Kt(e))}catch(re){is(e,t,{then:function(){},status:"rejected",reason:re},Kt())}finally{L.p=d,b!==null&&N.types!==null&&(b.types=N.types),B.T=b}}function Ag(){}function Bo(e,t,a,s){if(e.tag!==5)throw Error(o(476));var c=_m(e).queue;Dm(e,c,t,P,a===null?Ag:function(){return Om(e),a(s)})}function _m(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:P},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Om(e){var t=_m(e);t.next===null&&(t=e.alternate.memoizedState),is(e,t.next.queue,{},Kt())}function $o(){return Et(ks)}function Lm(){return ft().memoizedState}function zm(){return ft().memoizedState}function Rg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Kt();e=sa(a);var s=ra(t,e,a);s!==null&&(qt(s,t,a),ns(s,t,a)),t={cache:fo()},e.payload=t;return}t=t.return}}function Mg(e,t,a){var s=Kt();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wr(e)?$m(t,a):(a=to(e,t,a,s),a!==null&&(qt(a,e,s),Um(a,t,s)))}function Bm(e,t,a){var s=Kt();is(e,t,a,s)}function is(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wr(e))$m(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var b=t.lastRenderedState,N=d(b,a);if(c.hasEagerState=!0,c.eagerState=N,Zt(N,b))return nr(e,t,c,0),tt===null&&tr(),!1}catch{}finally{}if(a=to(e,t,c,s),a!==null)return qt(a,e,s),Um(a,t,s),!0}return!1}function Uo(e,t,a,s){if(s={lane:2,revertLane:gc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wr(e)){if(t)throw Error(o(479))}else t=to(e,a,s,2),t!==null&&qt(t,e,2)}function wr(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function $m(e,t){xl=hr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Um(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Fu(e,a)}}var os={readContext:Et,use:br,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};os.useEffectEvent=ot;var Hm={readContext:Et,use:br,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Nm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,vr(4194308,4,Em.bind(null,t,e),a)},useLayoutEffect:function(e,t){return vr(4194308,4,e,t)},useInsertionEffect:function(e,t){vr(4,2,e,t)},useMemo:function(e,t){var a=_t();t=t===void 0?null:t;var s=e();if($a){Ne(!0);try{e()}finally{Ne(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=_t();if(a!==void 0){var c=a(t);if($a){Ne(!0);try{a(t)}finally{Ne(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=Mg.bind(null,Ce,e),[s.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:function(e){e=Do(e);var t=e.queue,a=Bm.bind(null,Ce,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Lo,useDeferredValue:function(e,t){var a=_t();return zo(a,e,t)},useTransition:function(){var e=Do(!1);return e=Dm.bind(null,Ce,e.queue,!0,!1),_t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Ce,c=_t();if(Be){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),tt===null)throw Error(o(349));(_e&127)!==0||im(s,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Nm(cm.bind(null,s,d,e),[e]),s.flags|=2048,bl(9,{destroy:void 0},om.bind(null,s,d,a,t),null),a},useId:function(){var e=_t(),t=tt.identifierPrefix;if(Be){var a=jn,s=vn;a=(s&~(1<<32-Re(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=xr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=kg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$o,useFormState:bm,useActionState:bm,useOptimistic:function(e){var t=_t();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Uo.bind(null,Ce,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return _t().memoizedState=Rg.bind(null,Ce)},useEffectEvent:function(e){var t=_t(),a={impl:e};return t.memoizedState=a,function(){if((Ze&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},Ho={readContext:Et,use:br,useCallback:Am,useContext:Et,useEffect:Oo,useImperativeHandle:Tm,useInsertionEffect:Sm,useLayoutEffect:Cm,useMemo:Rm,useReducer:yr,useRef:wm,useState:function(){return yr(Bn)},useDebugValue:Lo,useDeferredValue:function(e,t){var a=ft();return Mm(a,Ke.memoizedState,e,t)},useTransition:function(){var e=yr(Bn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:rs(e),t]},useSyncExternalStore:rm,useId:Lm,useHostTransitionStatus:$o,useFormState:ym,useActionState:ym,useOptimistic:function(e,t){var a=ft();return mm(a,Ke,e,t)},useMemoCache:Ao,useCacheRefresh:zm};Ho.useEffectEvent=km;var Gm={readContext:Et,use:br,useCallback:Am,useContext:Et,useEffect:Oo,useImperativeHandle:Tm,useInsertionEffect:Sm,useLayoutEffect:Cm,useMemo:Rm,useReducer:Mo,useRef:wm,useState:function(){return Mo(Bn)},useDebugValue:Lo,useDeferredValue:function(e,t){var a=ft();return Ke===null?zo(a,e,t):Mm(a,Ke.memoizedState,e,t)},useTransition:function(){var e=Mo(Bn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:rs(e),t]},useSyncExternalStore:rm,useId:Lm,useHostTransitionStatus:$o,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var a=ft();return Ke!==null?mm(a,Ke,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ao,useCacheRefresh:zm};Gm.useEffectEvent=km;function Go(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var qo={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=Kt(),c=sa(s);c.payload=t,a!=null&&(c.callback=a),t=ra(e,c,s),t!==null&&(qt(t,e,s),ns(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=Kt(),c=sa(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ra(e,c,s),t!==null&&(qt(t,e,s),ns(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Kt(),s=sa(a);s.tag=2,t!=null&&(s.callback=t),t=ra(e,s,a),t!==null&&(qt(t,e,a),ns(t,e,a))}};function qm(e,t,a,s,c,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):t.prototype&&t.prototype.isPureReactComponent?!Xl(a,s)||!Xl(c,d):!0}function Ym(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&qo.enqueueReplaceState(t,t.state,null)}function Ua(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=v({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Fm(e){er(e)}function Zm(e){console.error(e)}function Vm(e){er(e)}function Nr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Qm(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Yo(e,t,a){return a=sa(a),a.tag=3,a.payload={element:null},a.callback=function(){Nr(e,t)},a}function Xm(e){return e=sa(e),e.tag=3,e}function Im(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){Qm(t,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Qm(t,a,s),typeof c!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function Dg(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&ul(t,a,c,!0),a=Qt.current,a!==null){switch(a.tag){case 31:case 13:return rn===null?Lr():a.alternate===null&&ct===0&&(ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===ur?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),pc(e,s,c)),!1;case 22:return a.flags|=65536,s===ur?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),pc(e,s,c)),!1}throw Error(o(435,a.tag))}return pc(e,s,c),Lr(),!1}if(Be)return t=Qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==io&&(e=Error(o(422),{cause:s}),Kl(nn(e,a)))):(s!==io&&(t=Error(o(423),{cause:s}),Kl(nn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=nn(s,a),c=Yo(e.stateNode,s,c),yo(e,c),ct!==4&&(ct=2)),!1;var d=Error(o(520),{cause:s});if(d=nn(d,a),xs===null?xs=[d]:xs.push(d),ct!==4&&(ct=2),t===null)return!0;s=nn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Yo(a.stateNode,s,e),yo(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ma===null||!ma.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Xm(c),Im(c,e,a,s),yo(a,c),!1}a=a.return}while(a!==null);return!1}var Fo=Error(o(461)),bt=!1;function Tt(e,t,a,s){t.child=e===null?Wd(t,null,a,s):Ba(t,e.child,a,s)}function Jm(e,t,a,s,c){a=a.render;var d=t.ref;if("ref"in s){var b={};for(var N in s)N!=="ref"&&(b[N]=s[N])}else b=s;return _a(t),s=So(e,t,a,b,d,c),N=Co(),e!==null&&!bt?(Eo(e,t,c),$n(e,t,c)):(Be&&N&&so(t),t.flags|=1,Tt(e,t,s,c),t.child)}function Km(e,t,a,s,c){if(e===null){var d=a.type;return typeof d=="function"&&!no(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,Pm(e,t,d,s,c)):(e=lr(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Po(e,c)){var b=d.memoizedProps;if(a=a.compare,a=a!==null?a:Xl,a(b,s)&&e.ref===t.ref)return $n(e,t,c)}return t.flags|=1,e=Dn(d,s),e.ref=t.ref,e.return=t,t.child=e}function Pm(e,t,a,s,c){if(e!==null){var d=e.memoizedProps;if(Xl(d,s)&&e.ref===t.ref)if(bt=!1,t.pendingProps=s=d,Po(e,c))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,$n(e,t,c)}return Zo(e,t,a,s,c)}function Wm(e,t,a,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return ef(e,t,d,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&or(t,d!==null?d.cachePool:null),d!==null?nm(t,d):jo(),am(t);else return s=t.lanes=536870912,ef(e,t,d!==null?d.baseLanes|a:a,a,s)}else d!==null?(or(t,d.cachePool),nm(t,d),oa(),t.memoizedState=null):(e!==null&&or(t,null),jo(),oa());return Tt(e,t,c,a),t.child}function cs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ef(e,t,a,s,c){var d=ho();return d=d===null?null:{parent:xt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&or(t,null),jo(),am(t),e!==null&&ul(e,t,s,!0),t.childLanes=c,null}function kr(e,t){return t=Cr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function tf(e,t,a){return Ba(t,e.child,null,a),e=kr(t,t.pendingProps),e.flags|=2,Xt(t),t.memoizedState=null,e}function _g(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(s.mode==="hidden")return e=kr(t,s),t.lanes=536870912,cs(null,e);if(No(t),(e=lt)?(e=pp(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ea!==null?{id:vn,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},a=$d(e),a.return=t,t.child=a,Ct=t,lt=null)):e=null,e===null)throw na(t);return t.lanes=536870912,null}return kr(t,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(No(t),c)if(t.flags&256)t.flags&=-257,t=tf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(bt||ul(e,t,a,!1),c=(a&e.childLanes)!==0,bt||c){if(s=tt,s!==null&&(b=Zu(s,a),b!==0&&b!==d.retryLane))throw d.retryLane=b,Aa(e,b),qt(s,e,b),Fo;Lr(),t=tf(e,t,a)}else e=d.treeContext,lt=on(b.nextSibling),Ct=t,Be=!0,ta=null,sn=!1,e!==null&&Gd(t,e),t=kr(t,s),t.flags|=4096;return t}return e=Dn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Zo(e,t,a,s,c){return _a(t),a=So(e,t,a,s,void 0,c),s=Co(),e!==null&&!bt?(Eo(e,t,c),$n(e,t,c)):(Be&&s&&so(t),t.flags|=1,Tt(e,t,a,c),t.child)}function nf(e,t,a,s,c,d){return _a(t),t.updateQueue=null,a=sm(t,s,a,c),lm(e),s=Co(),e!==null&&!bt?(Eo(e,t,d),$n(e,t,d)):(Be&&s&&so(t),t.flags|=1,Tt(e,t,a,d),t.child)}function af(e,t,a,s,c){if(_a(t),t.stateNode===null){var d=rl,b=a.contextType;typeof b=="object"&&b!==null&&(d=Et(b)),d=new a(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=qo,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},go(t),b=a.contextType,d.context=typeof b=="object"&&b!==null?Et(b):rl,d.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Go(t,a,b,s),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&qo.enqueueReplaceState(d,d.state,null),ls(t,s,d,c),as(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var N=t.memoizedProps,M=Ua(a,N);d.props=M;var G=d.context,W=a.contextType;b=rl,typeof W=="object"&&W!==null&&(b=Et(W));var re=a.getDerivedStateFromProps;W=typeof re=="function"||typeof d.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,W||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(N||G!==b)&&Ym(t,d,s,b),la=!1;var Y=t.memoizedState;d.state=Y,ls(t,s,d,c),as(),G=t.memoizedState,N||Y!==G||la?(typeof re=="function"&&(Go(t,a,re,s),G=t.memoizedState),(M=la||qm(t,a,M,s,Y,G,b))?(W||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=G),d.props=s,d.state=G,d.context=b,s=M):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,bo(e,t),b=t.memoizedProps,W=Ua(a,b),d.props=W,re=t.pendingProps,Y=d.context,G=a.contextType,M=rl,typeof G=="object"&&G!==null&&(M=Et(G)),N=a.getDerivedStateFromProps,(G=typeof N=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==re||Y!==M)&&Ym(t,d,s,M),la=!1,Y=t.memoizedState,d.state=Y,ls(t,s,d,c),as();var Z=t.memoizedState;b!==re||Y!==Z||la||e!==null&&e.dependencies!==null&&rr(e.dependencies)?(typeof N=="function"&&(Go(t,a,N,s),Z=t.memoizedState),(W=la||qm(t,a,W,s,Y,Z,M)||e!==null&&e.dependencies!==null&&rr(e.dependencies))?(G||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,Z,M),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,Z,M)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=Z),d.props=s,d.state=Z,d.context=M,s=W):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Sr(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=Ba(t,e.child,null,c),t.child=Ba(t,null,a,c)):Tt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=$n(e,t,c),e}function lf(e,t,a,s){return Ma(),t.flags|=256,Tt(e,t,a,s),t.child}var Vo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qo(e){return{baseLanes:e,cachePool:Qd()}}function Xo(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Jt),e}function sf(e,t,a){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(c?ia(t):oa(),(e=lt)?(e=pp(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ea!==null?{id:vn,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},a=$d(e),a.return=t,t.child=a,Ct=t,lt=null)):e=null,e===null)throw na(t);return Rc(e)?t.lanes=32:t.lanes=536870912,null}var N=s.children;return s=s.fallback,c?(oa(),c=t.mode,N=Cr({mode:"hidden",children:N},c),s=Ra(s,c,a,null),N.return=t,s.return=t,N.sibling=s,t.child=N,s=t.child,s.memoizedState=Qo(a),s.childLanes=Xo(e,b,a),t.memoizedState=Vo,cs(null,s)):(ia(t),Io(t,N))}var M=e.memoizedState;if(M!==null&&(N=M.dehydrated,N!==null)){if(d)t.flags&256?(ia(t),t.flags&=-257,t=Jo(e,t,a)):t.memoizedState!==null?(oa(),t.child=e.child,t.flags|=128,t=null):(oa(),N=s.fallback,c=t.mode,s=Cr({mode:"visible",children:s.children},c),N=Ra(N,c,a,null),N.flags|=2,s.return=t,N.return=t,s.sibling=N,t.child=s,Ba(t,e.child,null,a),s=t.child,s.memoizedState=Qo(a),s.childLanes=Xo(e,b,a),t.memoizedState=Vo,t=cs(null,s));else if(ia(t),Rc(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var G=b.dgst;b=G,s=Error(o(419)),s.stack="",s.digest=b,Kl({value:s,source:null,stack:null}),t=Jo(e,t,a)}else if(bt||ul(e,t,a,!1),b=(a&e.childLanes)!==0,bt||b){if(b=tt,b!==null&&(s=Zu(b,a),s!==0&&s!==M.retryLane))throw M.retryLane=s,Aa(e,s),qt(b,e,s),Fo;Ac(N)||Lr(),t=Jo(e,t,a)}else Ac(N)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,lt=on(N.nextSibling),Ct=t,Be=!0,ta=null,sn=!1,e!==null&&Gd(t,e),t=Io(t,s.children),t.flags|=4096);return t}return c?(oa(),N=s.fallback,c=t.mode,M=e.child,G=M.sibling,s=Dn(M,{mode:"hidden",children:s.children}),s.subtreeFlags=M.subtreeFlags&65011712,G!==null?N=Dn(G,N):(N=Ra(N,c,a,null),N.flags|=2),N.return=t,s.return=t,s.sibling=N,t.child=s,cs(null,s),s=t.child,N=e.child.memoizedState,N===null?N=Qo(a):(c=N.cachePool,c!==null?(M=xt._currentValue,c=c.parent!==M?{parent:M,pool:M}:c):c=Qd(),N={baseLanes:N.baseLanes|a,cachePool:c}),s.memoizedState=N,s.childLanes=Xo(e,b,a),t.memoizedState=Vo,cs(e.child,s)):(ia(t),a=e.child,e=a.sibling,a=Dn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=a,t.memoizedState=null,a)}function Io(e,t){return t=Cr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Cr(e,t){return e=Vt(22,e,null,t),e.lanes=0,e}function Jo(e,t,a){return Ba(t,e.child,null,a),e=Io(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rf(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),uo(e.return,t,a)}function Ko(e,t,a,s,c,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:d}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=a,b.tailMode=c,b.treeForkCount=d)}function of(e,t,a){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var b=mt.current,N=(b&2)!==0;if(N?(b=b&1|2,t.flags|=128):b&=1,F(mt,b),Tt(e,t,s,a),s=Be?Jl:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rf(e,a,t);else if(e.tag===19)rf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&pr(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Ko(t,!1,c,a,d,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&pr(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Ko(t,!0,a,null,d,s);break;case"together":Ko(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function $n(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),da|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ul(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Dn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Dn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Po(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&rr(e)))}function Og(e,t,a){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),aa(t,xt,e.memoizedState.cache),Ma();break;case 27:case 5:we(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:aa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?sf(e,t,a):(ia(t),e=$n(e,t,a),e!==null?e.sibling:null);ia(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(ul(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return of(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(mt,mt.current),s)break;return null;case 22:return t.lanes=0,Wm(e,t,a,t.pendingProps);case 24:aa(t,xt,e.memoizedState.cache)}return $n(e,t,a)}function cf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Po(e,a)&&(t.flags&128)===0)return bt=!1,Og(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Be&&(t.flags&1048576)!==0&&Hd(t,Jl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=La(t.elementType),t.type=e,typeof e=="function")no(e)?(s=Ua(e,s),t.tag=1,t=af(null,t,e,s,a)):(t.tag=0,t=Zo(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===D){t.tag=11,t=Jm(null,t,e,s,a);break e}else if(c===q){t.tag=14,t=Km(null,t,e,s,a);break e}}throw t=ue(e)||e,Error(o(306,t,""))}}return t;case 0:return Zo(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=Ua(s,t.pendingProps),af(e,t,s,c,a);case 3:e:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(o(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,bo(e,t),ls(t,s,null,a);var b=t.memoizedState;if(s=b.cache,aa(t,xt,s),s!==d.cache&&mo(t,[xt],a,!0),as(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=lf(e,t,s,a);break e}else if(s!==c){c=nn(Error(o(424)),t),Kl(c),t=lf(e,t,s,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(lt=on(e.firstChild),Ct=t,Be=!0,ta=null,sn=!0,a=Wd(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Ma(),s===c){t=$n(e,t,a);break e}Tt(e,t,s,a)}t=t.child}return t;case 26:return Sr(e,t),e===null?(a=vp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Be||(a=t.type,e=t.pendingProps,s=qr(pe.current).createElement(a),s[St]=t,s[zt]=e,At(s,a,e),Nt(s),t.stateNode=s):t.memoizedState=vp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return we(t),e===null&&Be&&(s=t.stateNode=gp(t.type,t.pendingProps,pe.current),Ct=t,sn=!0,c=lt,xa(t.type)?(Mc=c,lt=on(s.firstChild)):lt=c),Tt(e,t,t.pendingProps.children,a),Sr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((c=s=lt)&&(s=ub(s,t.type,t.pendingProps,sn),s!==null?(t.stateNode=s,Ct=t,lt=on(s.firstChild),sn=!1,c=!0):c=!1),c||na(t)),we(t),c=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,Cc(c,d)?s=null:b!==null&&Cc(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=So(e,t,Sg,null,null,a),ks._currentValue=c),Sr(e,t),Tt(e,t,s,a),t.child;case 6:return e===null&&Be&&((e=a=lt)&&(a=db(a,t.pendingProps,sn),a!==null?(t.stateNode=a,Ct=t,lt=null,e=!0):e=!1),e||na(t)),null;case 13:return sf(e,t,a);case 4:return ce(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Ba(t,null,s,a):Tt(e,t,s,a),t.child;case 11:return Jm(e,t,t.type,t.pendingProps,a);case 7:return Tt(e,t,t.pendingProps,a),t.child;case 8:return Tt(e,t,t.pendingProps.children,a),t.child;case 12:return Tt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,aa(t,t.type,s.value),Tt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,_a(t),c=Et(c),s=s(c),t.flags|=1,Tt(e,t,s,a),t.child;case 14:return Km(e,t,t.type,t.pendingProps,a);case 15:return Pm(e,t,t.type,t.pendingProps,a);case 19:return of(e,t,a);case 31:return _g(e,t,a);case 22:return Wm(e,t,a,t.pendingProps);case 24:return _a(t),s=Et(xt),e===null?(c=ho(),c===null&&(c=tt,d=fo(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:s,cache:c},go(t),aa(t,xt,c)):((e.lanes&a)!==0&&(bo(e,t),ls(t,null,null,a),as()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),aa(t,xt,s)):(s=d.cache,aa(t,xt,s),s!==c.cache&&mo(t,[xt],a,!0))),Tt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Un(e){e.flags|=4}function Wo(e,t,a,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(zf())e.flags|=8192;else throw za=ur,xo}else e.flags&=-16777217}function uf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sp(t))if(zf())e.flags|=8192;else throw za=ur,xo}function Er(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qu():536870912,e.lanes|=t,wl|=t)}function us(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function Lg(e,t,a){var s=t.pendingProps;switch(ro(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ln(xt),be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(cl(t)?Un(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,oo())),st(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Un(t),d!==null?(st(t),uf(t,d)):(st(t),Wo(t,c,null,s,a))):d?d!==e.memoizedState?(Un(t),st(t),uf(t,d)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Un(t),st(t),Wo(t,c,e,s,a)),null;case 27:if(Le(t),a=pe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Un(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return st(t),null}e=J.current,cl(t)?qd(t):(e=gp(c,s,a),t.stateNode=e,Un(t))}return st(t),null;case 5:if(Le(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Un(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return st(t),null}if(d=J.current,cl(t))qd(t);else{var b=qr(pe.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(c,{is:s.is}):b.createElement(c)}}d[St]=t,d[zt]=s;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=d;e:switch(At(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Un(t)}}return st(t),Wo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Un(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(o(166));if(e=pe.current,cl(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Ct,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[St]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||rp(e.nodeValue,a)),e||na(t,!0)}else e=qr(e).createTextNode(s),e[St]=t,t.stateNode=e}return st(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=cl(t),a!==null){if(e===null){if(!s)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[St]=t}else Ma(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else a=oo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Xt(t),t):(Xt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return st(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=cl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[St]=t}else Ma(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),c=!1}else c=oo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Xt(t),t):(Xt(t),null)}return Xt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Er(t,t.updateQueue),st(t),null);case 4:return be(),e===null&&jc(t.stateNode.containerInfo),st(t),null;case 10:return Ln(t.type),st(t),null;case 19:if(_(mt),s=t.memoizedState,s===null)return st(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)us(s,!1);else{if(ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=pr(e),d!==null){for(t.flags|=128,us(s,!1),e=d.updateQueue,t.updateQueue=e,Er(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Bd(a,e),a=a.sibling;return F(mt,mt.current&1|2),Be&&_n(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ge()>Dr&&(t.flags|=128,c=!0,us(s,!1),t.lanes=4194304)}else{if(!c)if(e=pr(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Er(t,e),us(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!Be)return st(t),null}else 2*Ge()-s.renderingStartTime>Dr&&a!==536870912&&(t.flags|=128,c=!0,us(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ge(),e.sibling=null,a=mt.current,F(mt,c?a&1|2:a&1),Be&&_n(t,s.treeForkCount),e):(st(t),null);case 22:case 23:return Xt(t),wo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),a=t.updateQueue,a!==null&&Er(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&_(Oa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ln(xt),st(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function zg(e,t){switch(ro(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(xt),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(Xt(t),t.alternate===null)throw Error(o(340));Ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(mt),null;case 4:return be(),null;case 10:return Ln(t.type),null;case 22:case 23:return Xt(t),wo(),e!==null&&_(Oa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ln(xt),null;case 25:return null;default:return null}}function df(e,t){switch(ro(t),t.tag){case 3:Ln(xt),be();break;case 26:case 27:case 5:Le(t);break;case 4:be();break;case 31:t.memoizedState!==null&&Xt(t);break;case 13:Xt(t);break;case 19:_(mt);break;case 10:Ln(t.type);break;case 22:case 23:Xt(t),wo(),e!==null&&_(Oa);break;case 24:Ln(xt)}}function ds(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var d=a.create,b=a.inst;s=d(),b.destroy=s}a=a.next}while(a!==c)}}catch(N){Xe(t,t.return,N)}}function ca(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var b=s.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,c=t;var M=a,G=N;try{G()}catch(W){Xe(c,M,W)}}}s=s.next}while(s!==d)}}catch(W){Xe(t,t.return,W)}}function mf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{tm(t,a)}catch(s){Xe(e,e.return,s)}}}function ff(e,t,a){a.props=Ua(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Xe(e,t,s)}}function ms(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Xe(e,t,c)}}function wn(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Xe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Xe(e,t,c)}else a.current=null}function pf(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Xe(e,e.return,c)}}function ec(e,t,a){try{var s=e.stateNode;lb(s,e.type,a,t),s[zt]=t}catch(c){Xe(e,e.return,c)}}function hf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xa(e.type)||e.tag===4}function tc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&xa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nc(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Rn));else if(s!==4&&(s===27&&xa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(nc(e,t,a),e=e.sibling;e!==null;)nc(e,t,a),e=e.sibling}function Tr(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&xa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Tr(e,t,a),e=e.sibling;e!==null;)Tr(e,t,a),e=e.sibling}function xf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);At(t,s,a),t[St]=e,t[zt]=a}catch(d){Xe(e,e.return,d)}}var Hn=!1,yt=!1,ac=!1,gf=typeof WeakSet=="function"?WeakSet:Set,kt=null;function Bg(e,t){if(e=e.containerInfo,kc=Ir,e=Td(e),Ii(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var b=0,N=-1,M=-1,G=0,W=0,re=e,Y=null;t:for(;;){for(var Z;re!==a||c!==0&&re.nodeType!==3||(N=b+c),re!==d||s!==0&&re.nodeType!==3||(M=b+s),re.nodeType===3&&(b+=re.nodeValue.length),(Z=re.firstChild)!==null;)Y=re,re=Z;for(;;){if(re===e)break t;if(Y===a&&++G===c&&(N=b),Y===d&&++W===s&&(M=b),(Z=re.nextSibling)!==null)break;re=Y,Y=re.parentNode}re=Z}a=N===-1||M===-1?null:{start:N,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(Sc={focusedElem:e,selectionRange:a},Ir=!1,kt=t;kt!==null;)if(t=kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,kt=e;else for(;kt!==null;){switch(t=kt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,s=a.stateNode;try{var xe=Ua(a.type,c);e=s.getSnapshotBeforeUpdate(xe,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(je){Xe(a,a.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Tc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Tc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,kt=e;break}kt=t.return}}function bf(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:qn(e,a),s&4&&ds(5,a);break;case 1:if(qn(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){Xe(a,a.return,b)}else{var c=Ua(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Xe(a,a.return,b)}}s&64&&mf(a),s&512&&ms(a,a.return);break;case 3:if(qn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{tm(e,t)}catch(b){Xe(a,a.return,b)}}break;case 27:t===null&&s&4&&xf(a);case 26:case 5:qn(e,a),t===null&&s&4&&pf(a),s&512&&ms(a,a.return);break;case 12:qn(e,a);break;case 31:qn(e,a),s&4&&jf(e,a);break;case 13:qn(e,a),s&4&&wf(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Vg.bind(null,a),mb(e,a))));break;case 22:if(s=a.memoizedState!==null||Hn,!s){t=t!==null&&t.memoizedState!==null||yt,c=Hn;var d=yt;Hn=s,(yt=t)&&!d?Yn(e,a,(a.subtreeFlags&8772)!==0):qn(e,a),Hn=c,yt=d}break;case 30:break;default:qn(e,a)}}function yf(e){var t=e.alternate;t!==null&&(e.alternate=null,yf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Di(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,$t=!1;function Gn(e,t,a){for(a=a.child;a!==null;)vf(e,t,a),a=a.sibling}function vf(e,t,a){if(ke&&typeof ke.onCommitFiberUnmount=="function")try{ke.onCommitFiberUnmount(fe,a)}catch{}switch(a.tag){case 26:yt||wn(a,t),Gn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:yt||wn(a,t);var s=it,c=$t;xa(a.type)&&(it=a.stateNode,$t=!1),Gn(e,t,a),js(a.stateNode),it=s,$t=c;break;case 5:yt||wn(a,t);case 6:if(s=it,c=$t,it=null,Gn(e,t,a),it=s,$t=c,it!==null)if($t)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(a.stateNode)}catch(d){Xe(a,t,d)}else try{it.removeChild(a.stateNode)}catch(d){Xe(a,t,d)}break;case 18:it!==null&&($t?(e=it,mp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Rl(e)):mp(it,a.stateNode));break;case 4:s=it,c=$t,it=a.stateNode.containerInfo,$t=!0,Gn(e,t,a),it=s,$t=c;break;case 0:case 11:case 14:case 15:ca(2,a,t),yt||ca(4,a,t),Gn(e,t,a);break;case 1:yt||(wn(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&ff(a,t,s)),Gn(e,t,a);break;case 21:Gn(e,t,a);break;case 22:yt=(s=yt)||a.memoizedState!==null,Gn(e,t,a),yt=s;break;default:Gn(e,t,a)}}function jf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rl(e)}catch(a){Xe(t,t.return,a)}}}function wf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rl(e)}catch(a){Xe(t,t.return,a)}}function $g(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gf),t;default:throw Error(o(435,e.tag))}}function Ar(e,t){var a=$g(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=Qg.bind(null,e,s);s.then(c,c)}})}function Ut(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],d=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(xa(N.type)){it=N.stateNode,$t=!1;break e}break;case 5:it=N.stateNode,$t=!1;break e;case 3:case 4:it=N.stateNode.containerInfo,$t=!0;break e}N=N.return}if(it===null)throw Error(o(160));vf(d,b,c),it=null,$t=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nf(t,e),t=t.sibling}var pn=null;function Nf(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ut(t,e),Ht(e),s&4&&(ca(3,e,e.return),ds(3,e),ca(5,e,e.return));break;case 1:Ut(t,e),Ht(e),s&512&&(yt||a===null||wn(a,a.return)),s&64&&Hn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=pn;if(Ut(t,e),Ht(e),s&512&&(yt||a===null||wn(a,a.return)),s&4){var d=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Ul]||d[St]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(s),c.head.insertBefore(d,c.querySelector("head > title"))),At(d,s,a),d[St]=e,Nt(d),s=d;break e;case"link":var b=Np("link","href",c).get(s+(a.href||""));if(b){for(var N=0;N<b.length;N++)if(d=b[N],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(N,1);break t}}d=c.createElement(s),At(d,s,a),c.head.appendChild(d);break;case"meta":if(b=Np("meta","content",c).get(s+(a.content||""))){for(N=0;N<b.length;N++)if(d=b[N],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(N,1);break t}}d=c.createElement(s),At(d,s,a),c.head.appendChild(d);break;default:throw Error(o(468,s))}d[St]=e,Nt(d),s=d}e.stateNode=s}else kp(c,e.type,e.stateNode);else e.stateNode=wp(c,s,e.memoizedProps);else d!==s?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,s===null?kp(c,e.type,e.stateNode):wp(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ec(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ut(t,e),Ht(e),s&512&&(yt||a===null||wn(a,a.return)),a!==null&&s&4&&ec(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ut(t,e),Ht(e),s&512&&(yt||a===null||wn(a,a.return)),e.flags&32){c=e.stateNode;try{Wa(c,"")}catch(xe){Xe(e,e.return,xe)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,ec(e,c,a!==null?a.memoizedProps:c)),s&1024&&(ac=!0);break;case 6:if(Ut(t,e),Ht(e),s&4){if(e.stateNode===null)throw Error(o(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(xe){Xe(e,e.return,xe)}}break;case 3:if(Zr=null,c=pn,pn=Yr(t.containerInfo),Ut(t,e),pn=c,Ht(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Rl(t.containerInfo)}catch(xe){Xe(e,e.return,xe)}ac&&(ac=!1,kf(e));break;case 4:s=pn,pn=Yr(e.stateNode.containerInfo),Ut(t,e),Ht(e),pn=s;break;case 12:Ut(t,e),Ht(e);break;case 31:Ut(t,e),Ht(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ar(e,s)));break;case 13:Ut(t,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Mr=Ge()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ar(e,s)));break;case 22:c=e.memoizedState!==null;var M=a!==null&&a.memoizedState!==null,G=Hn,W=yt;if(Hn=G||c,yt=W||M,Ut(t,e),yt=W,Hn=G,Ht(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||M||Hn||yt||Ha(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){M=a=t;try{if(d=M.stateNode,c)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=M.stateNode;var re=M.memoizedProps.style,Y=re!=null&&re.hasOwnProperty("display")?re.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(xe){Xe(M,M.return,xe)}}}else if(t.tag===6){if(a===null){M=t;try{M.stateNode.nodeValue=c?"":M.memoizedProps}catch(xe){Xe(M,M.return,xe)}}}else if(t.tag===18){if(a===null){M=t;try{var Z=M.stateNode;c?fp(Z,!0):fp(M.stateNode,!1)}catch(xe){Xe(M,M.return,xe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Ar(e,a))));break;case 19:Ut(t,e),Ht(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ar(e,s)));break;case 30:break;case 21:break;default:Ut(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(hf(s)){a=s;break}s=s.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var c=a.stateNode,d=tc(e);Tr(e,d,c);break;case 5:var b=a.stateNode;a.flags&32&&(Wa(b,""),a.flags&=-33);var N=tc(e);Tr(e,N,b);break;case 3:case 4:var M=a.stateNode.containerInfo,G=tc(e);nc(e,G,M);break;default:throw Error(o(161))}}catch(W){Xe(e,e.return,W)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function qn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)bf(e,t.alternate,t),t=t.sibling}function Ha(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ca(4,t,t.return),Ha(t);break;case 1:wn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&ff(t,t.return,a),Ha(t);break;case 27:js(t.stateNode);case 26:case 5:wn(t,t.return),Ha(t);break;case 22:t.memoizedState===null&&Ha(t);break;case 30:Ha(t);break;default:Ha(t)}e=e.sibling}}function Yn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,b=d.flags;switch(d.tag){case 0:case 11:case 15:Yn(c,d,a),ds(4,d);break;case 1:if(Yn(c,d,a),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(G){Xe(s,s.return,G)}if(s=d,c=s.updateQueue,c!==null){var N=s.stateNode;try{var M=c.shared.hiddenCallbacks;if(M!==null)for(c.shared.hiddenCallbacks=null,c=0;c<M.length;c++)em(M[c],N)}catch(G){Xe(s,s.return,G)}}a&&b&64&&mf(d),ms(d,d.return);break;case 27:xf(d);case 26:case 5:Yn(c,d,a),a&&s===null&&b&4&&pf(d),ms(d,d.return);break;case 12:Yn(c,d,a);break;case 31:Yn(c,d,a),a&&b&4&&jf(c,d);break;case 13:Yn(c,d,a),a&&b&4&&wf(c,d);break;case 22:d.memoizedState===null&&Yn(c,d,a),ms(d,d.return);break;case 30:break;default:Yn(c,d,a)}t=t.sibling}}function lc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Pl(a))}function sc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pl(e))}function hn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sf(e,t,a,s),t=t.sibling}function Sf(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:hn(e,t,a,s),c&2048&&ds(9,t);break;case 1:hn(e,t,a,s);break;case 3:hn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pl(e)));break;case 12:if(c&2048){hn(e,t,a,s),e=t.stateNode;try{var d=t.memoizedProps,b=d.id,N=d.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Xe(t,t.return,M)}}else hn(e,t,a,s);break;case 31:hn(e,t,a,s);break;case 13:hn(e,t,a,s);break;case 23:break;case 22:d=t.stateNode,b=t.alternate,t.memoizedState!==null?d._visibility&2?hn(e,t,a,s):fs(e,t):d._visibility&2?hn(e,t,a,s):(d._visibility|=2,yl(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&lc(b,t);break;case 24:hn(e,t,a,s),c&2048&&sc(t.alternate,t);break;default:hn(e,t,a,s)}}function yl(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,b=t,N=a,M=s,G=b.flags;switch(b.tag){case 0:case 11:case 15:yl(d,b,N,M,c),ds(8,b);break;case 23:break;case 22:var W=b.stateNode;b.memoizedState!==null?W._visibility&2?yl(d,b,N,M,c):fs(d,b):(W._visibility|=2,yl(d,b,N,M,c)),c&&G&2048&&lc(b.alternate,b);break;case 24:yl(d,b,N,M,c),c&&G&2048&&sc(b.alternate,b);break;default:yl(d,b,N,M,c)}t=t.sibling}}function fs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:fs(a,s),c&2048&&lc(s.alternate,s);break;case 24:fs(a,s),c&2048&&sc(s.alternate,s);break;default:fs(a,s)}t=t.sibling}}var ps=8192;function vl(e,t,a){if(e.subtreeFlags&ps)for(e=e.child;e!==null;)Cf(e,t,a),e=e.sibling}function Cf(e,t,a){switch(e.tag){case 26:vl(e,t,a),e.flags&ps&&e.memoizedState!==null&&kb(a,pn,e.memoizedState,e.memoizedProps);break;case 5:vl(e,t,a);break;case 3:case 4:var s=pn;pn=Yr(e.stateNode.containerInfo),vl(e,t,a),pn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ps,ps=16777216,vl(e,t,a),ps=s):vl(e,t,a));break;default:vl(e,t,a)}}function Ef(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function hs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];kt=s,Af(s,e)}Ef(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tf(e),e=e.sibling}function Tf(e){switch(e.tag){case 0:case 11:case 15:hs(e),e.flags&2048&&ca(9,e,e.return);break;case 3:hs(e);break;case 12:hs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rr(e)):hs(e);break;default:hs(e)}}function Rr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];kt=s,Af(s,e)}Ef(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ca(8,t,t.return),Rr(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Rr(t));break;default:Rr(t)}e=e.sibling}}function Af(e,t){for(;kt!==null;){var a=kt;switch(a.tag){case 0:case 11:case 15:ca(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Pl(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,kt=s;else e:for(a=e;kt!==null;){s=kt;var c=s.sibling,d=s.return;if(yf(s),s===a){kt=null;break e}if(c!==null){c.return=d,kt=c;break e}kt=d}}}var Ug={getCacheForType:function(e){var t=Et(xt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Et(xt).controller.signal}},Hg=typeof WeakMap=="function"?WeakMap:Map,Ze=0,tt=null,Me=null,_e=0,Qe=0,It=null,ua=!1,jl=!1,rc=!1,Fn=0,ct=0,da=0,Ga=0,ic=0,Jt=0,wl=0,xs=null,Gt=null,oc=!1,Mr=0,Rf=0,Dr=1/0,_r=null,ma=null,jt=0,fa=null,Nl=null,Zn=0,cc=0,uc=null,Mf=null,gs=0,dc=null;function Kt(){return(Ze&2)!==0&&_e!==0?_e&-_e:B.T!==null?gc():Vu()}function Df(){if(Jt===0)if((_e&536870912)===0||Be){var e=Jn;Jn<<=1,(Jn&3932160)===0&&(Jn=262144),Jt=e}else Jt=536870912;return e=Qt.current,e!==null&&(e.flags|=32),Jt}function qt(e,t,a){(e===tt&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(kl(e,0),pa(e,_e,Jt,!1)),$l(e,a),((Ze&2)===0||e!==tt)&&(e===tt&&((Ze&2)===0&&(Ga|=a),ct===4&&pa(e,_e,Jt,!1)),Nn(e))}function _f(e,t,a){if((Ze&6)!==0)throw Error(o(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Kn(e,t),c=s?Yg(e,t):fc(e,t,!0),d=s;do{if(c===0){jl&&!s&&pa(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!Gg(a)){c=fc(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var N=e;c=xs;var M=N.current.memoizedState.isDehydrated;if(M&&(kl(N,b).flags|=256),b=fc(N,b,!1),b!==2){if(rc&&!M){N.errorRecoveryDisabledLanes|=d,Ga|=d,c=4;break e}d=Gt,Gt=c,d!==null&&(Gt===null?Gt=d:Gt.push.apply(Gt,d))}c=b}if(d=!1,c!==2)continue}}if(c===1){kl(e,0),pa(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:pa(s,t,Jt,!ua);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Mr+300-Ge(),10<c)){if(pa(s,t,Jt,!ua),ka(s,0,!0)!==0)break e;Zn=t,s.timeoutHandle=up(Of.bind(null,s,a,Gt,_r,oc,t,Jt,Ga,wl,ua,d,"Throttled",-0,0),c);break e}Of(s,a,Gt,_r,oc,t,Jt,Ga,wl,ua,d,null,-0,0)}}break}while(!0);Nn(e)}function Of(e,t,a,s,c,d,b,N,M,G,W,re,Y,Z){if(e.timeoutHandle=-1,re=t.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rn},Cf(t,d,re);var xe=(d&62914560)===d?Mr-Ge():(d&4194048)===d?Rf-Ge():0;if(xe=Sb(re,xe),xe!==null){Zn=d,e.cancelPendingCommit=xe(qf.bind(null,e,t,d,a,s,c,b,N,M,W,re,null,Y,Z)),pa(e,d,b,!G);return}}qf(e,t,d,a,s,c,b,N,M)}function Gg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],d=c.getSnapshot;c=c.value;try{if(!Zt(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function pa(e,t,a,s){t&=~ic,t&=~Ga,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-Re(c),b=1<<d;s[d]=-1,c&=~b}a!==0&&Yu(e,a,t)}function Or(){return(Ze&6)===0?(bs(0),!1):!0}function mc(){if(Me!==null){if(Qe===0)var e=Me.return;else e=Me,On=Da=null,To(e),pl=null,es=0,e=Me;for(;e!==null;)df(e.alternate,e),e=e.return;Me=null}}function kl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,ib(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Zn=0,mc(),tt=e,Me=a=Dn(e.current,null),_e=t,Qe=0,It=null,ua=!1,jl=Kn(e,t),rc=!1,wl=Jt=ic=Ga=da=ct=0,Gt=xs=null,oc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-Re(s),d=1<<c;t|=e[c],s&=~d}return Fn=t,tr(),a}function Lf(e,t){Ce=null,B.H=os,t===fl||t===cr?(t=Jd(),Qe=3):t===xo?(t=Jd(),Qe=4):Qe=t===Fo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,Me===null&&(ct=1,Nr(e,nn(t,e.current)))}function zf(){var e=Qt.current;return e===null?!0:(_e&4194048)===_e?rn===null:(_e&62914560)===_e||(_e&536870912)!==0?e===rn:!1}function Bf(){var e=B.H;return B.H=os,e===null?os:e}function $f(){var e=B.A;return B.A=Ug,e}function Lr(){ct=4,ua||(_e&4194048)!==_e&&Qt.current!==null||(jl=!0),(da&134217727)===0&&(Ga&134217727)===0||tt===null||pa(tt,_e,Jt,!1)}function fc(e,t,a){var s=Ze;Ze|=2;var c=Bf(),d=$f();(tt!==e||_e!==t)&&(_r=null,kl(e,t)),t=!1;var b=ct;e:do try{if(Qe!==0&&Me!==null){var N=Me,M=It;switch(Qe){case 8:mc(),b=6;break e;case 3:case 2:case 9:case 6:Qt.current===null&&(t=!0);var G=Qe;if(Qe=0,It=null,Sl(e,N,M,G),a&&jl){b=0;break e}break;default:G=Qe,Qe=0,It=null,Sl(e,N,M,G)}}qg(),b=ct;break}catch(W){Lf(e,W)}while(!0);return t&&e.shellSuspendCounter++,On=Da=null,Ze=s,B.H=c,B.A=d,Me===null&&(tt=null,_e=0,tr()),b}function qg(){for(;Me!==null;)Uf(Me)}function Yg(e,t){var a=Ze;Ze|=2;var s=Bf(),c=$f();tt!==e||_e!==t?(_r=null,Dr=Ge()+500,kl(e,t)):jl=Kn(e,t);e:do try{if(Qe!==0&&Me!==null){t=Me;var d=It;t:switch(Qe){case 1:Qe=0,It=null,Sl(e,t,d,1);break;case 2:case 9:if(Xd(d)){Qe=0,It=null,Hf(t);break}t=function(){Qe!==2&&Qe!==9||tt!==e||(Qe=7),Nn(e)},d.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Xd(d)?(Qe=0,It=null,Hf(t)):(Qe=0,It=null,Sl(e,t,d,7));break;case 5:var b=null;switch(Me.tag){case 26:b=Me.memoizedState;case 5:case 27:var N=Me;if(b?Sp(b):N.stateNode.complete){Qe=0,It=null;var M=N.sibling;if(M!==null)Me=M;else{var G=N.return;G!==null?(Me=G,zr(G)):Me=null}break t}}Qe=0,It=null,Sl(e,t,d,5);break;case 6:Qe=0,It=null,Sl(e,t,d,6);break;case 8:mc(),ct=6;break e;default:throw Error(o(462))}}Fg();break}catch(W){Lf(e,W)}while(!0);return On=Da=null,B.H=s,B.A=c,Ze=a,Me!==null?0:(tt=null,_e=0,tr(),ct)}function Fg(){for(;Me!==null&&!Dt();)Uf(Me)}function Uf(e){var t=cf(e.alternate,e,Fn);e.memoizedProps=e.pendingProps,t===null?zr(e):Me=t}function Hf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=nf(a,t,t.pendingProps,t.type,void 0,_e);break;case 11:t=nf(a,t,t.pendingProps,t.type.render,t.ref,_e);break;case 5:To(t);default:df(a,t),t=Me=Bd(t,Fn),t=cf(a,t,Fn)}e.memoizedProps=e.pendingProps,t===null?zr(e):Me=t}function Sl(e,t,a,s){On=Da=null,To(t),pl=null,es=0;var c=t.return;try{if(Dg(e,c,t,a,_e)){ct=1,Nr(e,nn(a,e.current)),Me=null;return}}catch(d){if(c!==null)throw Me=c,d;ct=1,Nr(e,nn(a,e.current)),Me=null;return}t.flags&32768?(Be||s===1?e=!0:jl||(_e&536870912)!==0?e=!1:(ua=e=!0,(s===2||s===9||s===3||s===6)&&(s=Qt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Gf(t,e)):zr(t)}function zr(e){var t=e;do{if((t.flags&32768)!==0){Gf(t,ua);return}e=t.return;var a=Lg(t.alternate,t,Fn);if(a!==null){Me=a;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);ct===0&&(ct=5)}function Gf(e,t){do{var a=zg(e.alternate,e);if(a!==null){a.flags&=32767,Me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Me=e;return}Me=e=a}while(e!==null);ct=6,Me=null}function qf(e,t,a,s,c,d,b,N,M){e.cancelPendingCommit=null;do Br();while(jt!==0);if((Ze&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(d=t.lanes|t.childLanes,d|=eo,Nx(e,a,d,b,N,M),e===tt&&(Me=tt=null,_e=0),Nl=t,fa=e,Zn=a,cc=d,uc=c,Mf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xg(Te,function(){return Qf(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=B.T,B.T=null,c=L.p,L.p=2,b=Ze,Ze|=4;try{Bg(e,t,a)}finally{Ze=b,L.p=c,B.T=s}}jt=1,Yf(),Ff(),Zf()}}function Yf(){if(jt===1){jt=0;var e=fa,t=Nl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=B.T,B.T=null;var s=L.p;L.p=2;var c=Ze;Ze|=4;try{Nf(t,e);var d=Sc,b=Td(e.containerInfo),N=d.focusedElem,M=d.selectionRange;if(b!==N&&N&&N.ownerDocument&&Ed(N.ownerDocument.documentElement,N)){if(M!==null&&Ii(N)){var G=M.start,W=M.end;if(W===void 0&&(W=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(W,N.value.length);else{var re=N.ownerDocument||document,Y=re&&re.defaultView||window;if(Y.getSelection){var Z=Y.getSelection(),xe=N.textContent.length,je=Math.min(M.start,xe),We=M.end===void 0?je:Math.min(M.end,xe);!Z.extend&&je>We&&(b=We,We=je,je=b);var U=Cd(N,je),z=Cd(N,We);if(U&&z&&(Z.rangeCount!==1||Z.anchorNode!==U.node||Z.anchorOffset!==U.offset||Z.focusNode!==z.node||Z.focusOffset!==z.offset)){var H=re.createRange();H.setStart(U.node,U.offset),Z.removeAllRanges(),je>We?(Z.addRange(H),Z.extend(z.node,z.offset)):(H.setEnd(z.node,z.offset),Z.addRange(H))}}}}for(re=[],Z=N;Z=Z.parentNode;)Z.nodeType===1&&re.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<re.length;N++){var ae=re[N];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Ir=!!kc,Sc=kc=null}finally{Ze=c,L.p=s,B.T=a}}e.current=t,jt=2}}function Ff(){if(jt===2){jt=0;var e=fa,t=Nl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=B.T,B.T=null;var s=L.p;L.p=2;var c=Ze;Ze|=4;try{bf(e,t.alternate,t)}finally{Ze=c,L.p=s,B.T=a}}jt=3}}function Zf(){if(jt===4||jt===3){jt=0,Ft();var e=fa,t=Nl,a=Zn,s=Mf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,Nl=fa=null,Vf(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ma=null),Ri(a),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot=="function")try{ke.onCommitFiberRoot(fe,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=B.T,c=L.p,L.p=2,B.T=null;try{for(var d=e.onRecoverableError,b=0;b<s.length;b++){var N=s[b];d(N.value,{componentStack:N.stack})}}finally{B.T=t,L.p=c}}(Zn&3)!==0&&Br(),Nn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===dc?gs++:(gs=0,dc=e):gs=0,bs(0)}}function Vf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pl(t)))}function Br(){return Yf(),Ff(),Zf(),Qf()}function Qf(){if(jt!==5)return!1;var e=fa,t=cc;cc=0;var a=Ri(Zn),s=B.T,c=L.p;try{L.p=32>a?32:a,B.T=null,a=uc,uc=null;var d=fa,b=Zn;if(jt=0,Nl=fa=null,Zn=0,(Ze&6)!==0)throw Error(o(331));var N=Ze;if(Ze|=4,Tf(d.current),Sf(d,d.current,b,a),Ze=N,bs(0,!1),ke&&typeof ke.onPostCommitFiberRoot=="function")try{ke.onPostCommitFiberRoot(fe,d)}catch{}return!0}finally{L.p=c,B.T=s,Vf(e,t)}}function Xf(e,t,a){t=nn(a,t),t=Yo(e.stateNode,t,2),e=ra(e,t,2),e!==null&&($l(e,2),Nn(e))}function Xe(e,t,a){if(e.tag===3)Xf(e,e,a);else for(;t!==null;){if(t.tag===3){Xf(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ma===null||!ma.has(s))){e=nn(a,e),a=Xm(2),s=ra(t,a,2),s!==null&&(Im(a,s,t,e),$l(s,2),Nn(s));break}}t=t.return}}function pc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new Hg;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(rc=!0,c.add(a),e=Zg.bind(null,e,t,a),t.then(e,e))}function Zg(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,tt===e&&(_e&a)===a&&(ct===4||ct===3&&(_e&62914560)===_e&&300>Ge()-Mr?(Ze&2)===0&&kl(e,0):ic|=a,wl===_e&&(wl=0)),Nn(e)}function If(e,t){t===0&&(t=qu()),e=Aa(e,t),e!==null&&($l(e,t),Nn(e))}function Vg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),If(e,a)}function Qg(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(t),If(e,a)}function Xg(e,t){return dn(e,t)}var $r=null,Cl=null,hc=!1,Ur=!1,xc=!1,ha=0;function Nn(e){e!==Cl&&e.next===null&&(Cl===null?$r=Cl=e:Cl=Cl.next=e),Ur=!0,hc||(hc=!0,Jg())}function bs(e,t){if(!xc&&Ur){xc=!0;do for(var a=!1,s=$r;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var b=s.suspendedLanes,N=s.pingedLanes;d=(1<<31-Re(42|e)+1)-1,d&=c&~(b&~N),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Wf(s,d))}else d=_e,d=ka(s,s===tt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Kn(s,d)||(a=!0,Wf(s,d));s=s.next}while(a);xc=!1}}function Ig(){Jf()}function Jf(){Ur=hc=!1;var e=0;ha!==0&&rb()&&(e=ha);for(var t=Ge(),a=null,s=$r;s!==null;){var c=s.next,d=Kf(s,t);d===0?(s.next=null,a===null?$r=c:a.next=c,c===null&&(Cl=a)):(a=s,(e!==0||(d&3)!==0)&&(Ur=!0)),s=c}jt!==0&&jt!==5||bs(e),ha!==0&&(ha=0)}function Kf(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-Re(d),N=1<<b,M=c[b];M===-1?((N&a)===0||(N&s)!==0)&&(c[b]=Ys(N,t)):M<=t&&(e.expiredLanes|=N),d&=~N}if(t=tt,a=_e,a=ka(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Rt(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Kn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Rt(s),Ri(a)){case 2:case 8:a=Ae;break;case 32:a=Te;break;case 268435456:a=Ie;break;default:a=Te}return s=Pf.bind(null,e),a=dn(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Rt(s),e.callbackPriority=2,e.callbackNode=null,2}function Pf(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Br()&&e.callbackNode!==a)return null;var s=_e;return s=ka(e,e===tt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(_f(e,s,t),Kf(e,Ge()),e.callbackNode!=null&&e.callbackNode===a?Pf.bind(null,e):null)}function Wf(e,t){if(Br())return null;_f(e,t,!0)}function Jg(){ob(function(){(Ze&6)!==0?dn(ve,Ig):Jf()})}function gc(){if(ha===0){var e=dl;e===0&&(e=mn,mn<<=1,(mn&261888)===0&&(mn=256)),ha=e}return ha}function ep(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qs(""+e)}function tp(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Kg(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var d=ep((c[zt]||null).action),b=s.submitter;b&&(t=(t=b[zt]||null)?ep(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var N=new Ks("action","action",null,s,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ha!==0){var M=b?tp(c,b):new FormData(c);Bo(a,{pending:!0,data:M,method:c.method,action:d},null,M)}}else typeof d=="function"&&(N.preventDefault(),M=b?tp(c,b):new FormData(c),Bo(a,{pending:!0,data:M,method:c.method,action:d},d,M))},currentTarget:c}]})}}for(var bc=0;bc<Wi.length;bc++){var yc=Wi[bc],Pg=yc.toLowerCase(),Wg=yc[0].toUpperCase()+yc.slice(1);fn(Pg,"on"+Wg)}fn(Md,"onAnimationEnd"),fn(Dd,"onAnimationIteration"),fn(_d,"onAnimationStart"),fn("dblclick","onDoubleClick"),fn("focusin","onFocus"),fn("focusout","onBlur"),fn(hg,"onTransitionRun"),fn(xg,"onTransitionStart"),fn(gg,"onTransitionCancel"),fn(Od,"onTransitionEnd"),Ka("onMouseEnter",["mouseout","mouseover"]),Ka("onMouseLeave",["mouseout","mouseover"]),Ka("onPointerEnter",["pointerout","pointerover"]),Ka("onPointerLeave",["pointerout","pointerover"]),Sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ys="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(" "),eb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ys));function np(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var b=s.length-1;0<=b;b--){var N=s[b],M=N.instance,G=N.currentTarget;if(N=N.listener,M!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=G;try{d(c)}catch(W){er(W)}c.currentTarget=null,d=M}else for(b=0;b<s.length;b++){if(N=s[b],M=N.instance,G=N.currentTarget,N=N.listener,M!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=G;try{d(c)}catch(W){er(W)}c.currentTarget=null,d=M}}}}function De(e,t){var a=t[Mi];a===void 0&&(a=t[Mi]=new Set);var s=e+"__bubble";a.has(s)||(ap(t,e,2,!1),a.add(s))}function vc(e,t,a){var s=0;t&&(s|=4),ap(a,e,s,t)}var Hr="_reactListening"+Math.random().toString(36).slice(2);function jc(e){if(!e[Hr]){e[Hr]=!0,Iu.forEach(function(a){a!=="selectionchange"&&(eb.has(a)||vc(a,!1,e),vc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hr]||(t[Hr]=!0,vc("selectionchange",!1,t))}}function ap(e,t,a,s){switch(Dp(t)){case 2:var c=Tb;break;case 8:c=Ab;break;default:c=zc}a=c.bind(null,t,a,e),c=void 0,!Hi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function wc(e,t,a,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var N=s.stateNode.containerInfo;if(N===c)break;if(b===4)for(b=s.return;b!==null;){var M=b.tag;if((M===3||M===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;N!==null;){if(b=Xa(N),b===null)return;if(M=b.tag,M===5||M===6||M===26||M===27){s=d=b;continue e}N=N.parentNode}}s=s.return}id(function(){var G=d,W=$i(a),re=[];e:{var Y=Ld.get(e);if(Y!==void 0){var Z=Ks,xe=e;switch(e){case"keypress":if(Is(a)===0)break e;case"keydown":case"keyup":Z=Qx;break;case"focusin":xe="focus",Z=Fi;break;case"focusout":xe="blur",Z=Fi;break;case"beforeblur":case"afterblur":Z=Fi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=ud;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Lx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Jx;break;case Md:case Dd:case _d:Z=$x;break;case Od:Z=Px;break;case"scroll":case"scrollend":Z=_x;break;case"wheel":Z=eg;break;case"copy":case"cut":case"paste":Z=Hx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=md;break;case"toggle":case"beforetoggle":Z=ng}var je=(t&4)!==0,We=!je&&(e==="scroll"||e==="scrollend"),U=je?Y!==null?Y+"Capture":null:Y;je=[];for(var z=G,H;z!==null;){var ae=z;if(H=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||H===null||U===null||(ae=Gl(z,U),ae!=null&&je.push(vs(z,ae,H))),We)break;z=z.return}0<je.length&&(Y=new Z(Y,xe,null,a,W),re.push({event:Y,listeners:je}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",Y&&a!==Bi&&(xe=a.relatedTarget||a.fromElement)&&(Xa(xe)||xe[Qa]))break e;if((Z||Y)&&(Y=W.window===W?W:(Y=W.ownerDocument)?Y.defaultView||Y.parentWindow:window,Z?(xe=a.relatedTarget||a.toElement,Z=G,xe=xe?Xa(xe):null,xe!==null&&(We=m(xe),je=xe.tag,xe!==We||je!==5&&je!==27&&je!==6)&&(xe=null)):(Z=null,xe=G),Z!==xe)){if(je=ud,ae="onMouseLeave",U="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(je=md,ae="onPointerLeave",U="onPointerEnter",z="pointer"),We=Z==null?Y:Hl(Z),H=xe==null?Y:Hl(xe),Y=new je(ae,z+"leave",Z,a,W),Y.target=We,Y.relatedTarget=H,ae=null,Xa(W)===G&&(je=new je(U,z+"enter",xe,a,W),je.target=H,je.relatedTarget=We,ae=je),We=ae,Z&&xe)t:{for(je=tb,U=Z,z=xe,H=0,ae=U;ae;ae=je(ae))H++;ae=0;for(var ye=z;ye;ye=je(ye))ae++;for(;0<H-ae;)U=je(U),H--;for(;0<ae-H;)z=je(z),ae--;for(;H--;){if(U===z||z!==null&&U===z.alternate){je=U;break t}U=je(U),z=je(z)}je=null}else je=null;Z!==null&&lp(re,Y,Z,je,!1),xe!==null&&We!==null&&lp(re,We,xe,je,!0)}}e:{if(Y=G?Hl(G):window,Z=Y.nodeName&&Y.nodeName.toLowerCase(),Z==="select"||Z==="input"&&Y.type==="file")var qe=vd;else if(bd(Y))if(jd)qe=mg;else{qe=ug;var ge=cg}else Z=Y.nodeName,!Z||Z.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&zi(G.elementType)&&(qe=vd):qe=dg;if(qe&&(qe=qe(e,G))){yd(re,qe,a,W);break e}ge&&ge(e,Y,G),e==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&Li(Y,"number",Y.value)}switch(ge=G?Hl(G):window,e){case"focusin":(bd(ge)||ge.contentEditable==="true")&&(al=ge,Ji=G,Il=null);break;case"focusout":Il=Ji=al=null;break;case"mousedown":Ki=!0;break;case"contextmenu":case"mouseup":case"dragend":Ki=!1,Ad(re,a,W);break;case"selectionchange":if(pg)break;case"keydown":case"keyup":Ad(re,a,W)}var Ee;if(Vi)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else nl?xd(e,a)&&(Oe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Oe="onCompositionStart");Oe&&(fd&&a.locale!=="ko"&&(nl||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&nl&&(Ee=od()):(Wn=W,Gi="value"in Wn?Wn.value:Wn.textContent,nl=!0)),ge=Gr(G,Oe),0<ge.length&&(Oe=new dd(Oe,e,null,a,W),re.push({event:Oe,listeners:ge}),Ee?Oe.data=Ee:(Ee=gd(a),Ee!==null&&(Oe.data=Ee)))),(Ee=lg?sg(e,a):rg(e,a))&&(Oe=Gr(G,"onBeforeInput"),0<Oe.length&&(ge=new dd("onBeforeInput","beforeinput",null,a,W),re.push({event:ge,listeners:Oe}),ge.data=Ee)),Kg(re,e,G,a,W)}np(re,t)})}function vs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Gr(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Gl(e,a),c!=null&&s.unshift(vs(e,c,d)),c=Gl(e,t),c!=null&&s.push(vs(e,c,d))),e.tag===3)return s;e=e.return}return[]}function tb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function lp(e,t,a,s,c){for(var d=t._reactName,b=[];a!==null&&a!==s;){var N=a,M=N.alternate,G=N.stateNode;if(N=N.tag,M!==null&&M===s)break;N!==5&&N!==26&&N!==27||G===null||(M=G,c?(G=Gl(a,d),G!=null&&b.unshift(vs(a,G,M))):c||(G=Gl(a,d),G!=null&&b.push(vs(a,G,M)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var nb=/\r\n?/g,ab=/\u0000|\uFFFD/g;function sp(e){return(typeof e=="string"?e:""+e).replace(nb,`
|
|
56
|
-
`).replace(ab,"")}function rp(e,t){return t=sp(t),sp(e)===t}function Pe(e,t,a,s,c,d){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Wa(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Wa(e,""+s);break;case"className":Zs(e,"class",s);break;case"tabIndex":Zs(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zs(e,a,s);break;case"style":sd(e,s,d);break;case"data":if(t!=="object"){Zs(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Qs(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 d=="function"&&(a==="formAction"?(t!=="input"&&Pe(e,t,"name",c.name,c,null),Pe(e,t,"formEncType",c.formEncType,c,null),Pe(e,t,"formMethod",c.formMethod,c,null),Pe(e,t,"formTarget",c.formTarget,c,null)):(Pe(e,t,"encType",c.encType,c,null),Pe(e,t,"method",c.method,c,null),Pe(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Qs(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Rn);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=Qs(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":De("beforetoggle",e),De("toggle",e),Fs(e,"popover",s);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Fs(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Mx.get(a)||a,Fs(e,a,s))}}function Nc(e,t,a,s,c,d){switch(a){case"style":sd(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Wa(e,s):(typeof s=="number"||typeof s=="bigint")&&Wa(e,""+s);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ju.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[zt]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof s=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Fs(e,a,s)}}}function At(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var s=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var b=a[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Pe(e,t,d,b,a,null)}}c&&Pe(e,t,"srcSet",a.srcSet,a,null),s&&Pe(e,t,"src",a.src,a,null);return;case"input":De("invalid",e);var N=d=b=c=null,M=null,G=null;for(s in a)if(a.hasOwnProperty(s)){var W=a[s];if(W!=null)switch(s){case"name":c=W;break;case"type":b=W;break;case"checked":M=W;break;case"defaultChecked":G=W;break;case"value":d=W;break;case"defaultValue":N=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(o(137,t));break;default:Pe(e,t,s,W,a,null)}}td(e,d,N,M,G,b,c,!1);return;case"select":De("invalid",e),s=b=d=null;for(c in a)if(a.hasOwnProperty(c)&&(N=a[c],N!=null))switch(c){case"value":d=N;break;case"defaultValue":b=N;break;case"multiple":s=N;default:Pe(e,t,c,N,a,null)}t=d,a=b,e.multiple=!!s,t!=null?Pa(e,!!s,t,!1):a!=null&&Pa(e,!!s,a,!0);return;case"textarea":De("invalid",e),d=c=s=null;for(b in a)if(a.hasOwnProperty(b)&&(N=a[b],N!=null))switch(b){case"value":s=N;break;case"defaultValue":c=N;break;case"children":d=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:Pe(e,t,b,N,a,null)}ad(e,s,c,d);return;case"option":for(M in a)if(a.hasOwnProperty(M)&&(s=a[M],s!=null))switch(M){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Pe(e,t,M,s,a,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(s=0;s<ys.length;s++)De(ys[s],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in a)if(a.hasOwnProperty(G)&&(s=a[G],s!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Pe(e,t,G,s,a,null)}return;default:if(zi(t)){for(W in a)a.hasOwnProperty(W)&&(s=a[W],s!==void 0&&Nc(e,t,W,s,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(s=a[N],s!=null&&Pe(e,t,N,s,a,null))}function lb(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,b=null,N=null,M=null,G=null,W=null;for(Z in a){var re=a[Z];if(a.hasOwnProperty(Z)&&re!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":M=re;default:s.hasOwnProperty(Z)||Pe(e,t,Z,null,s,re)}}for(var Y in s){var Z=s[Y];if(re=a[Y],s.hasOwnProperty(Y)&&(Z!=null||re!=null))switch(Y){case"type":d=Z;break;case"name":c=Z;break;case"checked":G=Z;break;case"defaultChecked":W=Z;break;case"value":b=Z;break;case"defaultValue":N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Z!==re&&Pe(e,t,Y,Z,s,re)}}Oi(e,b,N,M,G,W,d,c);return;case"select":Z=b=N=Y=null;for(d in a)if(M=a[d],a.hasOwnProperty(d)&&M!=null)switch(d){case"value":break;case"multiple":Z=M;default:s.hasOwnProperty(d)||Pe(e,t,d,null,s,M)}for(c in s)if(d=s[c],M=a[c],s.hasOwnProperty(c)&&(d!=null||M!=null))switch(c){case"value":Y=d;break;case"defaultValue":N=d;break;case"multiple":b=d;default:d!==M&&Pe(e,t,c,d,s,M)}t=N,a=b,s=Z,Y!=null?Pa(e,!!a,Y,!1):!!s!=!!a&&(t!=null?Pa(e,!!a,t,!0):Pa(e,!!a,a?[]:"",!1));return;case"textarea":Z=Y=null;for(N in a)if(c=a[N],a.hasOwnProperty(N)&&c!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Pe(e,t,N,null,s,c)}for(b in s)if(c=s[b],d=a[b],s.hasOwnProperty(b)&&(c!=null||d!=null))switch(b){case"value":Y=c;break;case"defaultValue":Z=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==d&&Pe(e,t,b,c,s,d)}nd(e,Y,Z);return;case"option":for(var xe in a)if(Y=a[xe],a.hasOwnProperty(xe)&&Y!=null&&!s.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:Pe(e,t,xe,null,s,Y)}for(M in s)if(Y=s[M],Z=a[M],s.hasOwnProperty(M)&&Y!==Z&&(Y!=null||Z!=null))switch(M){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:Pe(e,t,M,Y,s,Z)}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 je in a)Y=a[je],a.hasOwnProperty(je)&&Y!=null&&!s.hasOwnProperty(je)&&Pe(e,t,je,null,s,Y);for(G in s)if(Y=s[G],Z=a[G],s.hasOwnProperty(G)&&Y!==Z&&(Y!=null||Z!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:Pe(e,t,G,Y,s,Z)}return;default:if(zi(t)){for(var We in a)Y=a[We],a.hasOwnProperty(We)&&Y!==void 0&&!s.hasOwnProperty(We)&&Nc(e,t,We,void 0,s,Y);for(W in s)Y=s[W],Z=a[W],!s.hasOwnProperty(W)||Y===Z||Y===void 0&&Z===void 0||Nc(e,t,W,Y,s,Z);return}}for(var U in a)Y=a[U],a.hasOwnProperty(U)&&Y!=null&&!s.hasOwnProperty(U)&&Pe(e,t,U,null,s,Y);for(re in s)Y=s[re],Z=a[re],!s.hasOwnProperty(re)||Y===Z||Y==null&&Z==null||Pe(e,t,re,Y,s,Z)}function ip(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],d=c.transferSize,b=c.initiatorType,N=c.duration;if(d&&N&&ip(b)){for(b=0,N=c.responseEnd,s+=1;s<a.length;s++){var M=a[s],G=M.startTime;if(G>N)break;var W=M.transferSize,re=M.initiatorType;W&&ip(re)&&(M=M.responseEnd,b+=W*(M<N?1:(N-G)/(M-G)))}if(--s,t+=8*(d+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kc=null,Sc=null;function qr(e){return e.nodeType===9?e:e.ownerDocument}function op(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Cc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ec=null;function rb(){var e=window.event;return e&&e.type==="popstate"?e===Ec?!1:(Ec=e,!0):(Ec=null,!1)}var up=typeof setTimeout=="function"?setTimeout:void 0,ib=typeof clearTimeout=="function"?clearTimeout:void 0,dp=typeof Promise=="function"?Promise:void 0,ob=typeof queueMicrotask=="function"?queueMicrotask:typeof dp<"u"?function(e){return dp.resolve(null).then(e).catch(cb)}:up;function cb(e){setTimeout(function(){throw e})}function xa(e){return e==="head"}function mp(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),Rl(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")js(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,js(a);for(var d=a.firstChild;d;){var b=d.nextSibling,N=d.nodeName;d[Ul]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=b}}else a==="body"&&js(e.ownerDocument.body);a=c}while(a);Rl(t)}function fp(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Tc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Tc(a),Di(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ub(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ul])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=on(e.nextSibling),e===null)break}return null}function db(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=on(e.nextSibling),e===null))return null;return e}function pp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=on(e.nextSibling),e===null))return null;return e}function Ac(e){return e.data==="$?"||e.data==="$~"}function Rc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function mb(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function on(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Mc=null;function hp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return on(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function xp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function gp(e,t,a){switch(t=qr(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function js(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Di(e)}var cn=new Map,bp=new Set;function Yr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Vn=L.d;L.d={f:fb,r:pb,D:hb,C:xb,L:gb,m:bb,X:vb,S:yb,M:jb};function fb(){var e=Vn.f(),t=Or();return e||t}function pb(e){var t=Ia(e);t!==null&&t.tag===5&&t.type==="form"?Om(t):Vn.r(e)}var El=typeof document>"u"?null:document;function yp(e,t,a){var s=El;if(s&&typeof t=="string"&&t){var c=en(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),bp.has(c)||(bp.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),At(t,"link",e),Nt(t),s.head.appendChild(t)))}}function hb(e){Vn.D(e),yp("dns-prefetch",e,null)}function xb(e,t){Vn.C(e,t),yp("preconnect",e,t)}function gb(e,t,a){Vn.L(e,t,a);var s=El;if(s&&e&&t){var c='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+en(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+en(a.imageSizes)+'"]')):c+='[href="'+en(e)+'"]';var d=c;switch(t){case"style":d=Tl(e);break;case"script":d=Al(e)}cn.has(d)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),cn.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(ws(d))||t==="script"&&s.querySelector(Ns(d))||(t=s.createElement("link"),At(t,"link",e),Nt(t),s.head.appendChild(t)))}}function bb(e,t){Vn.m(e,t);var a=El;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+en(s)+'"][href="'+en(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Al(e)}if(!cn.has(d)&&(e=v({rel:"modulepreload",href:e},t),cn.set(d,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ns(d)))return}s=a.createElement("link"),At(s,"link",e),Nt(s),a.head.appendChild(s)}}}function yb(e,t,a){Vn.S(e,t,a);var s=El;if(s&&e){var c=Ja(s).hoistableStyles,d=Tl(e);t=t||"default";var b=c.get(d);if(!b){var N={loading:0,preload:null};if(b=s.querySelector(ws(d)))N.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=cn.get(d))&&Dc(e,a);var M=b=s.createElement("link");Nt(M),At(M,"link",e),M._p=new Promise(function(G,W){M.onload=G,M.onerror=W}),M.addEventListener("load",function(){N.loading|=1}),M.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Fr(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:N},c.set(d,b)}}}function vb(e,t){Vn.X(e,t);var a=El;if(a&&e){var s=Ja(a).hoistableScripts,c=Al(e),d=s.get(c);d||(d=a.querySelector(Ns(c)),d||(e=v({src:e,async:!0},t),(t=cn.get(c))&&_c(e,t),d=a.createElement("script"),Nt(d),At(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function jb(e,t){Vn.M(e,t);var a=El;if(a&&e){var s=Ja(a).hoistableScripts,c=Al(e),d=s.get(c);d||(d=a.querySelector(Ns(c)),d||(e=v({src:e,async:!0,type:"module"},t),(t=cn.get(c))&&_c(e,t),d=a.createElement("script"),Nt(d),At(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function vp(e,t,a,s){var c=(c=pe.current)?Yr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Tl(a.href),a=Ja(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Tl(a.href);var d=Ja(c).hoistableStyles,b=d.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=c.querySelector(ws(e)))&&!d._p&&(b.instance=d,b.state.loading=5),cn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},cn.set(e,a),d||wb(c,e,a,b.state))),t&&s===null)throw Error(o(528,""));return b}if(t&&s!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Al(a),a=Ja(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Tl(e){return'href="'+en(e)+'"'}function ws(e){return'link[rel="stylesheet"]['+e+"]"}function jp(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function wb(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),At(t,"link",a),Nt(t),e.head.appendChild(t))}function Al(e){return'[src="'+en(e)+'"]'}function Ns(e){return"script[async]"+e}function wp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+en(a.href)+'"]');if(s)return t.instance=s,Nt(s),s;var c=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Nt(s),At(s,"style",c),Fr(s,a.precedence,e),t.instance=s;case"stylesheet":c=Tl(a.href);var d=e.querySelector(ws(c));if(d)return t.state.loading|=4,t.instance=d,Nt(d),d;s=jp(a),(c=cn.get(c))&&Dc(s,c),d=(e.ownerDocument||e).createElement("link"),Nt(d);var b=d;return b._p=new Promise(function(N,M){b.onload=N,b.onerror=M}),At(d,"link",s),t.state.loading|=4,Fr(d,a.precedence,e),t.instance=d;case"script":return d=Al(a.src),(c=e.querySelector(Ns(d)))?(t.instance=c,Nt(c),c):(s=a,(c=cn.get(d))&&(s=v({},a),_c(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Nt(c),At(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Fr(s,a.precedence,e));return t.instance}function Fr(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,b=0;b<s.length;b++){var N=s[b];if(N.dataset.precedence===t)d=N;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Dc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zr=null;function Np(e,t,a){if(Zr===null){var s=new Map,c=Zr=new Map;c.set(a,s)}else c=Zr,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Ul]||d[St]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var N=s.get(b);N?N.push(d):s.set(b,[d])}}return s}function kp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Nb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Sp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kb(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Tl(s.href),d=t.querySelector(ws(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,Nt(d);return}d=t.ownerDocument||t,s=jp(s),(c=cn.get(c))&&Dc(s,c),d=d.createElement("link"),Nt(d);var b=d;b._p=new Promise(function(N,M){b.onload=N,b.onerror=M}),At(d,"link",s),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Vr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Oc=0;function Sb(e,t){return e.stylesheets&&e.count===0&&Xr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&Xr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Oc===0&&(Oc=62500*sb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Oc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Vr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qr=null;function Xr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qr=new Map,t.forEach(Cb,e),Qr=null,Vr.call(e))}function Cb(e,t){if(!(t.state.loading&4)){var a=Qr.get(e);if(a)var s=a.get(null);else{a=new Map,Qr.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var b=c[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),s=b)}s&&a.set(null,s)}c=t.instance,b=c.getAttribute("data-precedence"),d=a.get(b)||s,d===s&&a.set(null,c),a.set(b,c),this.count++,s=Vr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ks={$$typeof:R,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function Eb(e,t,a,s,c,d,b,N,M){this.tag=1,this.containerInfo=e,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=Ti(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.hiddenUpdates=Ti(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Cp(e,t,a,s,c,d,b,N,M,G,W,re){return e=new Eb(e,t,a,b,M,G,W,re,N),t=1,d===!0&&(t|=24),d=Vt(3,null,null,t),e.current=d,d.stateNode=e,t=fo(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:a,cache:t},go(d),e}function Ep(e){return e?(e=rl,e):rl}function Tp(e,t,a,s,c,d){c=Ep(c),s.context===null?s.context=c:s.pendingContext=c,s=sa(t),s.payload={element:a},d=d===void 0?null:d,d!==null&&(s.callback=d),a=ra(e,s,t),a!==null&&(qt(a,e,t),ns(a,e,t))}function Ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Lc(e,t){Ap(e,t),(e=e.alternate)&&Ap(e,t)}function Rp(e){if(e.tag===13||e.tag===31){var t=Aa(e,67108864);t!==null&&qt(t,e,67108864),Lc(e,67108864)}}function Mp(e){if(e.tag===13||e.tag===31){var t=Kt();t=Ai(t);var a=Aa(e,t);a!==null&&qt(a,e,t),Lc(e,t)}}var Ir=!0;function Tb(e,t,a,s){var c=B.T;B.T=null;var d=L.p;try{L.p=2,zc(e,t,a,s)}finally{L.p=d,B.T=c}}function Ab(e,t,a,s){var c=B.T;B.T=null;var d=L.p;try{L.p=8,zc(e,t,a,s)}finally{L.p=d,B.T=c}}function zc(e,t,a,s){if(Ir){var c=Bc(s);if(c===null)wc(e,t,s,Jr,a),_p(e,s);else if(Mb(c,e,t,a,s))s.stopPropagation();else if(_p(e,s),t&4&&-1<Rb.indexOf(e)){for(;c!==null;){var d=Ia(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=yn(d.pendingLanes);if(b!==0){var N=d;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var M=1<<31-Re(b);N.entanglements[1]|=M,b&=~M}Nn(d),(Ze&6)===0&&(Dr=Ge()+500,bs(0))}}break;case 31:case 13:N=Aa(d,2),N!==null&&qt(N,d,2),Or(),Lc(d,2)}if(d=Bc(s),d===null&&wc(e,t,s,Jr,a),d===c)break;c=d}c!==null&&s.stopPropagation()}else wc(e,t,s,null,a)}}function Bc(e){return e=$i(e),$c(e)}var Jr=null;function $c(e){if(Jr=null,e=Xa(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=g(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Jr=e,null}function Dp(e){switch(e){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(Q()){case ve:return 2;case Ae:return 8;case Te:case $e:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Uc=!1,ga=null,ba=null,ya=null,Ss=new Map,Cs=new Map,va=[],Rb="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 _p(e,t){switch(e){case"focusin":case"focusout":ga=null;break;case"dragenter":case"dragleave":ba=null;break;case"mouseover":case"mouseout":ya=null;break;case"pointerover":case"pointerout":Ss.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cs.delete(t.pointerId)}}function Es(e,t,a,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Ia(t),t!==null&&Rp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Mb(e,t,a,s,c){switch(t){case"focusin":return ga=Es(ga,e,t,a,s,c),!0;case"dragenter":return ba=Es(ba,e,t,a,s,c),!0;case"mouseover":return ya=Es(ya,e,t,a,s,c),!0;case"pointerover":var d=c.pointerId;return Ss.set(d,Es(Ss.get(d)||null,e,t,a,s,c)),!0;case"gotpointercapture":return d=c.pointerId,Cs.set(d,Es(Cs.get(d)||null,e,t,a,s,c)),!0}return!1}function Op(e){var t=Xa(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Qu(e.priority,function(){Mp(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Qu(e.priority,function(){Mp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Kr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Bc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Bi=s,a.target.dispatchEvent(s),Bi=null}else return t=Ia(a),t!==null&&Rp(t),e.blockedOn=a,!1;t.shift()}return!0}function Lp(e,t,a){Kr(e)&&a.delete(t)}function Db(){Uc=!1,ga!==null&&Kr(ga)&&(ga=null),ba!==null&&Kr(ba)&&(ba=null),ya!==null&&Kr(ya)&&(ya=null),Ss.forEach(Lp),Cs.forEach(Lp)}function Pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Db)))}var Wr=null;function zp(e){Wr!==e&&(Wr=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Wr===e&&(Wr=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if($c(s||a)===null)continue;break}var d=Ia(a);d!==null&&(e.splice(t,3),t-=3,Bo(d,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Rl(e){function t(M){return Pr(M,e)}ga!==null&&Pr(ga,e),ba!==null&&Pr(ba,e),ya!==null&&Pr(ya,e),Ss.forEach(t),Cs.forEach(t);for(var a=0;a<va.length;a++){var s=va[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<va.length&&(a=va[0],a.blockedOn===null);)Op(a),a.blockedOn===null&&va.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],d=a[s+1],b=c[zt]||null;if(typeof d=="function")b||zp(a);else if(b){var N=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[zt]||null)N=b.formAction;else if($c(c)!==null)continue}else N=b.action;typeof N=="function"?a[s+1]=N:(a.splice(s,3),s-=3),zp(a)}}}function Bp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Hc(e){this._internalRoot=e}ei.prototype.render=Hc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,s=Kt();Tp(a,s,e,t,null,null)},ei.prototype.unmount=Hc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Tp(e.current,2,null,e,null,null),Or(),t[Qa]=null}};function ei(e){this._internalRoot=e}ei.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vu();e={blockedOn:null,target:e,priority:t};for(var a=0;a<va.length&&t!==0&&t<va[a].priority;a++);va.splice(a,0,e),a===0&&Op(e)}};var $p=r.version;if($p!=="19.2.4")throw Error(o(527,$p,"19.2.4"));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var _b={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ti.isDisabled&&ti.supportsFiber)try{fe=ti.inject(_b),ke=ti}catch{}}return As.createRoot=function(e,t){if(!u(e))throw Error(o(299));var a=!1,s="",c=Fm,d=Zm,b=Vm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Cp(e,1,!1,null,null,a,s,null,c,d,b,Bp),e[Qa]=t.current,jc(e),new Hc(t)},As.hydrateRoot=function(e,t,a){if(!u(e))throw Error(o(299));var s=!1,c="",d=Fm,b=Zm,N=Vm,M=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(M=a.formState)),t=Cp(e,1,!0,t,a??null,s,c,M,d,b,N,Bp),t.context=Ep(null),a=t.current,s=Kt(),s=Ai(s),c=sa(s),c.callback=null,ra(a,c,s),a=s,t.current.lanes=a,$l(t,a),Nn(t),e[Qa]=t.current,jc(e),new ei(t)},As.version="19.2.4",As}var Xp;function Yb(){if(Xp)return Yc.exports;Xp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Yc.exports=qb(),Yc.exports}var Fb=Yb();const Zb=Th(Fb);function ku(l,r,i=!0){y.useEffect(()=>{if(!i)return;const o=u=>{l.current&&!l.current.contains(u.target)&&r()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[i,r,l])}const ru=300*1e3;function Na(l){if(!l||typeof l!="object")return null;const r=l;return Array.isArray(r.sessions)?{sessions:r.sessions,cachedAt:typeof r.cachedAt=="string"?r.cachedAt:void 0}:null}function Hs(l,r=ru){if(!l)return!1;const i=Date.now()-new Date(l).getTime();return Number.isFinite(i)&&i>=0&&i<r}function ii(l){if(!l)return"just now";const r=Date.now()-new Date(l).getTime();if(!Number.isFinite(r)||r<0)return"just now";const i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Rh(l,r=Date.now()){if(!l)return"";const i=r-new Date(l).getTime();if(!Number.isFinite(i)||i<0)return"0m";const o=Math.floor(i/6e4);if(o<60)return`${o}m`;const u=Math.floor(o/60);return u<24?`${u}h`:`${Math.floor(u/24)}d`}function oi(l){return new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function Mh(l){return l?`$${l.toFixed(2)}`:""}function yi(l){if(!l)return"";const r=l.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(r)return`${r[3].charAt(0).toUpperCase()+r[3].slice(1).toLowerCase()} ${r[1]}.${r[2]}`;const i=l.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(i){const u=(i[1]||i[3]||"").toLowerCase(),m=i[2].replace(/-/g,"."),p=u.charAt(0).toUpperCase()+u.slice(1);return p?`${p} ${m}`:`Claude ${m}`}const o=l.split(/[-/]/);return o.length>1?o.slice(0,2).join("-"):l}function Su(l){if(l===0)return"0m";const r=Math.floor(l/6e4);if(r<60)return`${r}m`;const i=Math.floor(r/60),o=r%60;if(i<24)return o>0?`${i}h ${o}m`:`${i}h`;const u=Math.floor(i/24),m=i%24;return m>0?`${u}d ${m}h`:`${u}d`}function ci(l){const r=Math.round(l/1024);return r>=1024?`${(r/1024).toFixed(1)}MB`:`${r}KB`}function Ll(l){const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:oi(l)}function Xn(l){const r=Tu(l);if(r)return r;const i=l.replace(/\/$/,"").split("/");return i[i.length-1]||l}const Cu=120;function wt(l){return(l||"").replace(/\s+/g," ").trim().slice(0,Cu)}function Vb(l){return l.startsWith("[Request interrupted by user")||l.startsWith("<command-name>")||l.startsWith("<command-message>")||l.startsWith("<local-command-caveat>")||l.startsWith("<local-command-stdout>")||l.startsWith("<task-notification>")||l.startsWith("<bash-input>")||l.startsWith("<bash-stdout>")}function Qb(l){return l.split(`
|
|
55
|
+
`+s.stack}}var Cn=Object.prototype.hasOwnProperty,ze=l.unstable_scheduleCallback,ot=l.unstable_cancelCallback,jt=l.unstable_shouldYield,st=l.unstable_requestPaint,Ze=l.unstable_now,I=l.unstable_getCurrentPriorityLevel,we=l.unstable_ImmediatePriority,ve=l.unstable_UserBlockingPriority,ce=l.unstable_NormalPriority,fe=l.unstable_LowPriority,_e=l.unstable_IdlePriority,Se=l.log,Be=l.unstable_setDisableYieldValue,et=null,Oe=null;function Ue(e){if(typeof Se=="function"&&Be(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(et,e)}catch{}}var tt=Math.clz32?Math.clz32:rn,Yt=Math.log,Ft=Math.LN2;function rn(e){return e>>>=0,e===0?32:31-(Yt(e)/Ft|0)|0}var Ln=256,zn=262144,$t=4194304;function ie(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ke(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~d,s!==0?c=ie(s):(b&=N,b!==0?c=ie(b):a||(a=N&~e,a!==0&&(c=ie(a))))):(N=s&~d,N!==0?c=ie(N):b!==0?c=ie(b):a||(a=s&~e,a!==0&&(c=ie(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function wt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Nt(){var e=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),e}function on(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Tt(e,t,a,s,c,d){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,D=e.expirationTimes,Y=e.hiddenUpdates;for(a=b&~a;0<a;){var ee=31-tt(a),se=1<<ee;N[ee]=0,D[ee]=-1;var Z=Y[ee];if(Z!==null)for(Y[ee]=null,ee=0;ee<Z.length;ee++){var X=Z[ee];X!==null&&(X.lane&=-536870913)}a&=~se}s!==0&&Pa(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function Pa(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-tt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Zl(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-tt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function Wa(e,t){var a=t&-t;return a=(a&42)!==0?1:Li(a),(a&(e.suspendedLanes|t))!==0?0:a}function Li(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function zi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xu(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Op(e.type))}function Iu(e,t){var a=z.p;try{return z.p=e,t()}finally{z.p=a}}var la=Math.random().toString(36).slice(2),Mt="__reactFiber$"+la,Zt="__reactProps$"+la,el="__reactContainer$"+la,Bi="__reactEvents$"+la,Sx="__reactListeners$"+la,kx="__reactHandles$"+la,Ju="__reactResources$"+la,Vl="__reactMarker$"+la;function $i(e){delete e[Mt],delete e[Zt],delete e[Bi],delete e[Sx],delete e[kx]}function tl(e){var t=e[Mt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[el]||a[Mt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=bp(e);e!==null;){if(a=e[Mt])return a;e=bp(e)}return t}e=a,a=e.parentNode}return null}function nl(e){if(e=e[Mt]||e[el]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ql(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function al(e){var t=e[Ju];return t||(t=e[Ju]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Vl]=!0}var Ku=new Set,Pu={};function Ra(e,t){ll(e,t),ll(e+"Capture",t)}function ll(e,t){for(Pu[e]=t,e=0;e<t.length;e++)Ku.add(t[e])}var Cx=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]*$"),Wu={},ed={};function Tx(e){return Cn.call(ed,e)?!0:Cn.call(Wu,e)?!1:Cx.test(e)?ed[e]=!0:(Wu[e]=!0,!1)}function Ks(e,t,a){if(Tx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ps(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Bn(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function td(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ex(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){a=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ui(e){if(!e._valueTracker){var t=td(e)?"checked":"value";e._valueTracker=Ex(e,t,""+e[t])}}function nd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=td(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Ws(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ax=/[\n"\\]/g;function un(e){return e.replace(Ax,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hi(e,t,a,s,c,d,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+cn(t)):e.value!==""+cn(t)&&(e.value=""+cn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Gi(e,b,cn(t)):a!=null?Gi(e,b,cn(a)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+cn(N):e.removeAttribute("name")}function ad(e,t,a,s,c,d,b,N){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Ui(e);return}a=a!=null?""+cn(a):"",t=t!=null?""+cn(t):a,N||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=N?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Ui(e)}function Gi(e,t,a){t==="number"&&Ws(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function sl(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+cn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ld(e,t,a){if(t!=null&&(t=""+cn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+cn(a):""}function sd(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(o(92));if(pe(s)){if(1<s.length)throw Error(o(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=cn(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Ui(e)}function rl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Rx=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 rd(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||Rx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function id(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&rd(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&rd(e,d,t[d])}function qi(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Mx=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"]]),Dx=/^[\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(e){return Dx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var Yi=null;function Fi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var il=null,ol=null;function od(e){var t=nl(e);if(t&&(e=t.stateNode)){var a=e[Zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+un(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[Zt]||null;if(!c)throw Error(o(90));Hi(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&nd(s)}break e;case"textarea":ld(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&sl(e,!!a.multiple,t,!1)}}}var Zi=!1;function cd(e,t,a){if(Zi)return e(t,a);Zi=!0;try{var s=e(t);return s}finally{if(Zi=!1,(il!==null||ol!==null)&&(Gr(),il&&(t=il,e=ol,ol=il=null,od(t),e)))for(t=0;t<e.length;t++)od(e[t])}}function Xl(e,t){var a=e.stateNode;if(a===null)return null;var s=a[Zt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vi=!1;if(Un)try{var Il={};Object.defineProperty(Il,"passive",{get:function(){Vi=!0}}),window.addEventListener("test",Il,Il),window.removeEventListener("test",Il,Il)}catch{Vi=!1}var sa=null,Qi=null,tr=null;function ud(){if(tr)return tr;var e,t=Qi,a=t.length,s,c="value"in sa?sa.value:sa.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var b=a-e;for(s=1;s<=b&&t[a-s]===c[d-s];s++);return tr=c.slice(e,1<s?1-s:void 0)}function nr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ar(){return!0}function dd(){return!1}function Vt(e){function t(a,s,c,d,b){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(d):d[N]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ar:dd,this.isPropagationStopped=dd,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ar)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ar)},persist:function(){},isPersistent:ar}),t}var Ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lr=Vt(Ma),Jl=v({},Ma,{view:0,detail:0}),_x=Vt(Jl),Xi,Ii,Kl,sr=v({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ki,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Kl&&(Kl&&e.type==="mousemove"?(Xi=e.screenX-Kl.screenX,Ii=e.screenY-Kl.screenY):Ii=Xi=0,Kl=e),Xi)},movementY:function(e){return"movementY"in e?e.movementY:Ii}}),md=Vt(sr),Ox=v({},sr,{dataTransfer:0}),Lx=Vt(Ox),zx=v({},Jl,{relatedTarget:0}),Ji=Vt(zx),Bx=v({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),$x=Vt(Bx),Ux=v({},Ma,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hx=Vt(Ux),Gx=v({},Ma,{data:0}),fd=Vt(Gx),qx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yx={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"},Fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fx[e])?!!t[e]:!1}function Ki(){return Zx}var Vx=v({},Jl,{key:function(e){if(e.key){var t=qx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ki,charCode:function(e){return e.type==="keypress"?nr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qx=Vt(Vx),Xx=v({},sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pd=Vt(Xx),Ix=v({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ki}),Jx=Vt(Ix),Kx=v({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),Px=Vt(Kx),Wx=v({},sr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),eg=Vt(Wx),tg=v({},Ma,{newState:0,oldState:0}),ng=Vt(tg),ag=[9,13,27,32],Pi=Un&&"CompositionEvent"in window,Pl=null;Un&&"documentMode"in document&&(Pl=document.documentMode);var lg=Un&&"TextEvent"in window&&!Pl,hd=Un&&(!Pi||Pl&&8<Pl&&11>=Pl),xd=" ",gd=!1;function bd(e,t){switch(e){case"keyup":return ag.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cl=!1;function sg(e,t){switch(e){case"compositionend":return yd(t);case"keypress":return t.which!==32?null:(gd=!0,xd);case"textInput":return e=t.data,e===xd&&gd?null:e;default:return null}}function rg(e,t){if(cl)return e==="compositionend"||!Pi&&bd(e,t)?(e=ud(),tr=Qi=sa=null,cl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return hd&&t.locale!=="ko"?null:t.data;default:return null}}var ig={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 vd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ig[e.type]:t==="textarea"}function jd(e,t,a,s){il?ol?ol.push(s):ol=[s]:il=s,t=Xr(t,"onChange"),0<t.length&&(a=new lr("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Wl=null,es=null;function og(e){lp(e,0)}function rr(e){var t=Ql(e);if(nd(t))return e}function wd(e,t){if(e==="change")return t}var Nd=!1;if(Un){var Wi;if(Un){var eo="oninput"in document;if(!eo){var Sd=document.createElement("div");Sd.setAttribute("oninput","return;"),eo=typeof Sd.oninput=="function"}Wi=eo}else Wi=!1;Nd=Wi&&(!document.documentMode||9<document.documentMode)}function kd(){Wl&&(Wl.detachEvent("onpropertychange",Cd),es=Wl=null)}function Cd(e){if(e.propertyName==="value"&&rr(es)){var t=[];jd(t,es,e,Fi(e)),cd(og,t)}}function cg(e,t,a){e==="focusin"?(kd(),Wl=t,es=a,Wl.attachEvent("onpropertychange",Cd)):e==="focusout"&&kd()}function ug(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rr(es)}function dg(e,t){if(e==="click")return rr(t)}function mg(e,t){if(e==="input"||e==="change")return rr(t)}function fg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:fg;function ts(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Cn.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ed(e,t){var a=Td(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Td(a)}}function Ad(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ad(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ws(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ws(e.document)}return t}function to(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var pg=Un&&"documentMode"in document&&11>=document.documentMode,ul=null,no=null,ns=null,ao=!1;function Md(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ao||ul==null||ul!==Ws(s)||(s=ul,"selectionStart"in s&&to(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ns&&ts(ns,s)||(ns=s,s=Xr(no,"onSelect"),0<s.length&&(t=new lr("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=ul)))}function Da(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var dl={animationend:Da("Animation","AnimationEnd"),animationiteration:Da("Animation","AnimationIteration"),animationstart:Da("Animation","AnimationStart"),transitionrun:Da("Transition","TransitionRun"),transitionstart:Da("Transition","TransitionStart"),transitioncancel:Da("Transition","TransitionCancel"),transitionend:Da("Transition","TransitionEnd")},lo={},Dd={};Un&&(Dd=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function _a(e){if(lo[e])return lo[e];if(!dl[e])return e;var t=dl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Dd)return lo[e]=t[a];return e}var _d=_a("animationend"),Od=_a("animationiteration"),Ld=_a("animationstart"),hg=_a("transitionrun"),xg=_a("transitionstart"),gg=_a("transitioncancel"),zd=_a("transitionend"),Bd=new Map,so="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(" ");so.push("scrollEnd");function vn(e,t){Bd.set(e,t),Ra(t,[e])}var ir=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},dn=[],ml=0,ro=0;function or(){for(var e=ml,t=ro=ml=0;t<e;){var a=dn[t];dn[t++]=null;var s=dn[t];dn[t++]=null;var c=dn[t];dn[t++]=null;var d=dn[t];if(dn[t++]=null,s!==null&&c!==null){var b=s.pending;b===null?c.next=c:(c.next=b.next,b.next=c),s.pending=c}d!==0&&$d(a,c,d)}}function cr(e,t,a,s){dn[ml++]=e,dn[ml++]=t,dn[ml++]=a,dn[ml++]=s,ro|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function io(e,t,a,s){return cr(e,t,a,s),ur(e)}function Oa(e,t){return cr(e,null,null,t),ur(e)}function $d(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,s=d.alternate,s!==null&&(s.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-tt(a),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),d):null}function ur(e){if(50<Ss)throw Ss=0,gc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fl={};function bg(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,a,s){return new bg(e,t,a,s)}function oo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hn(e,t){var a=e.alternate;return a===null?(a=Wt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Ud(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function dr(e,t,a,s,c,d){var b=0;if(s=e,typeof e=="function")oo(e)&&(b=1);else if(typeof e=="string")b=Nb(e,a,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=Wt(31,a,t,c),e.elementType=ae,e.lanes=d,e;case S:return La(a.children,c,d,t);case k:b=8,c|=24;break;case E:return e=Wt(12,a,t,c|2),e.elementType=E,e.lanes=d,e;case O:return e=Wt(13,a,t,c),e.elementType=O,e.lanes=d,e;case $:return e=Wt(19,a,t,c),e.elementType=$,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:b=10;break e;case M:b=9;break e;case R:b=11;break e;case H:b=14;break e;case K:b=16,s=null;break e}b=29,a=Error(o(130,e===null?"null":typeof e,"")),s=null}return t=Wt(b,a,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function La(e,t,a,s){return e=Wt(7,e,s,t),e.lanes=a,e}function co(e,t,a){return e=Wt(6,e,null,t),e.lanes=a,e}function Hd(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function uo(e,t,a){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gd=new WeakMap;function mn(e,t){if(typeof e=="object"&&e!==null){var a=Gd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:qt(t)},Gd.set(e,t),t)}return{value:e,source:t,stack:qt(t)}}var pl=[],hl=0,mr=null,as=0,fn=[],pn=0,ra=null,Tn=1,En="";function Gn(e,t){pl[hl++]=as,pl[hl++]=mr,mr=e,as=t}function qd(e,t,a){fn[pn++]=Tn,fn[pn++]=En,fn[pn++]=ra,ra=e;var s=Tn;e=En;var c=32-tt(s)-1;s&=~(1<<c),a+=1;var d=32-tt(t)+c;if(30<d){var b=c-c%5;d=(s&(1<<b)-1).toString(32),s>>=b,c-=b,Tn=1<<32-tt(t)+c|a<<c|s,En=d+e}else Tn=1<<d|a<<c|s,En=e}function mo(e){e.return!==null&&(Gn(e,1),qd(e,1,0))}function fo(e){for(;e===mr;)mr=pl[--hl],pl[hl]=null,as=pl[--hl],pl[hl]=null;for(;e===ra;)ra=fn[--pn],fn[pn]=null,En=fn[--pn],fn[pn]=null,Tn=fn[--pn],fn[pn]=null}function Yd(e,t){fn[pn++]=Tn,fn[pn++]=En,fn[pn++]=ra,Tn=t.id,En=t.overflow,ra=e}var Dt=null,nt=null,Le=!1,ia=null,hn=!1,po=Error(o(519));function oa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ls(mn(t,e)),po}function Fd(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[Mt]=e,t[Zt]=s,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<Cs.length;a++)Re(Cs[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),ad(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),sd(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||op(t.textContent,a)?(s.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),s.onScroll!=null&&Re("scroll",t),s.onScrollEnd!=null&&Re("scrollend",t),s.onClick!=null&&(t.onclick=$n),t=!0):t=!1,t||oa(e,!0)}function Zd(e){for(Dt=e.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:hn=!1;return;case 27:case 3:hn=!0;return;default:Dt=Dt.return}}function xl(e){if(e!==Dt)return!1;if(!Le)return Zd(e),Le=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Dc(e.type,e.memoizedProps)),a=!a),a&&nt&&oa(e),Zd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=gp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));nt=gp(e)}else t===27?(t=nt,wa(e.type)?(e=Bc,Bc=null,nt=e):nt=t):nt=Dt?gn(e.stateNode.nextSibling):null;return!0}function za(){nt=Dt=null,Le=!1}function ho(){var e=ia;return e!==null&&(Jt===null?Jt=e:Jt.push.apply(Jt,e),ia=null),e}function ls(e){ia===null?ia=[e]:ia.push(e)}var xo=T(null),Ba=null,qn=null;function ca(e,t,a){V(xo,t._currentValue),t._currentValue=a}function Yn(e){e._currentValue=xo.current,_(xo)}function go(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function bo(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var b=c.child;d=d.firstContext;e:for(;d!==null;){var N=d;d=c;for(var D=0;D<t.length;D++)if(N.context===t[D]){d.lanes|=a,N=d.alternate,N!==null&&(N.lanes|=a),go(d.return,a,e),s||(b=null);break e}d=N.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(o(341));b.lanes|=a,d=b.alternate,d!==null&&(d.lanes|=a),go(b,a,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function gl(e,t,a,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var N=c.type;Pt(c.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(c===G.current){if(b=c.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Ms):e=[Ms])}c=c.return}e!==null&&bo(t,e,a,s),t.flags|=262144}function fr(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $a(e){Ba=e,qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _t(e){return Vd(Ba,e)}function pr(e,t){return Ba===null&&$a(e),Vd(e,t)}function Vd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},qn===null){if(e===null)throw Error(o(308));qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qn=qn.next=t;return a}var yg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},vg=l.unstable_scheduleCallback,jg=l.unstable_NormalPriority,xt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yo(){return{controller:new yg,data:new Map,refCount:0}}function ss(e){e.refCount--,e.refCount===0&&vg(jg,function(){e.controller.abort()})}var rs=null,vo=0,bl=0,yl=null;function wg(e,t){if(rs===null){var a=rs=[];vo=0,bl=Nc(),yl={status:"pending",value:void 0,then:function(s){a.push(s)}}}return vo++,t.then(Qd,Qd),t}function Qd(){if(--vo===0&&rs!==null){yl!==null&&(yl.status="fulfilled");var e=rs;rs=null,bl=0,yl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ng(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var Xd=U.S;U.S=function(e,t){Df=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wg(e,t),Xd!==null&&Xd(e,t)};var Ua=T(null);function jo(){var e=Ua.current;return e!==null?e:We.pooledCache}function hr(e,t){t===null?V(Ua,Ua.current):V(Ua,t.pool)}function Id(){var e=jo();return e===null?null:{parent:xt._currentValue,pool:e}}var vl=Error(o(460)),wo=Error(o(474)),xr=Error(o(542)),gr={then:function(){}};function Jd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Kd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then($n,$n),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wd(e),e;default:if(typeof t.status=="string")t.then($n,$n);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wd(e),e}throw Ga=t,vl}}function Ha(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ga=a,vl):a}}var Ga=null;function Pd(){if(Ga===null)throw Error(o(459));var e=Ga;return Ga=null,e}function Wd(e){if(e===vl||e===xr)throw Error(o(483))}var jl=null,is=0;function br(e){var t=is;return is+=1,jl===null&&(jl=[]),Kd(jl,e,t)}function os(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function yr(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function em(e){function t(B,L){if(e){var q=B.deletions;q===null?(B.deletions=[L],B.flags|=16):q.push(L)}}function a(B,L){if(!e)return null;for(;L!==null;)t(B,L),L=L.sibling;return null}function s(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function c(B,L){return B=Hn(B,L),B.index=0,B.sibling=null,B}function d(B,L,q){return B.index=q,e?(q=B.alternate,q!==null?(q=q.index,q<L?(B.flags|=67108866,L):q):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function N(B,L,q,le){return L===null||L.tag!==6?(L=co(q,B.mode,le),L.return=B,L):(L=c(L,q),L.return=B,L)}function D(B,L,q,le){var je=q.type;return je===S?ee(B,L,q.props.children,le,q.key):L!==null&&(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&Ha(je)===L.type)?(L=c(L,q.props),os(L,q),L.return=B,L):(L=dr(q.type,q.key,q.props,null,B.mode,le),os(L,q),L.return=B,L)}function Y(B,L,q,le){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=uo(q,B.mode,le),L.return=B,L):(L=c(L,q.children||[]),L.return=B,L)}function ee(B,L,q,le,je){return L===null||L.tag!==7?(L=La(q,B.mode,le,je),L.return=B,L):(L=c(L,q),L.return=B,L)}function se(B,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=co(""+L,B.mode,q),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case j:return q=dr(L.type,L.key,L.props,null,B.mode,q),os(q,L),q.return=B,q;case w:return L=uo(L,B.mode,q),L.return=B,L;case K:return L=Ha(L),se(B,L,q)}if(pe(L)||te(L))return L=La(L,B.mode,q,null),L.return=B,L;if(typeof L.then=="function")return se(B,br(L),q);if(L.$$typeof===A)return se(B,pr(B,L),q);yr(B,L)}return null}function Z(B,L,q,le){var je=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:N(B,L,""+q,le);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case j:return q.key===je?D(B,L,q,le):null;case w:return q.key===je?Y(B,L,q,le):null;case K:return q=Ha(q),Z(B,L,q,le)}if(pe(q)||te(q))return je!==null?null:ee(B,L,q,le,null);if(typeof q.then=="function")return Z(B,L,br(q),le);if(q.$$typeof===A)return Z(B,L,pr(B,q),le);yr(B,q)}return null}function X(B,L,q,le,je){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return B=B.get(q)||null,N(L,B,""+le,je);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case j:return B=B.get(le.key===null?q:le.key)||null,D(L,B,le,je);case w:return B=B.get(le.key===null?q:le.key)||null,Y(L,B,le,je);case K:return le=Ha(le),X(B,L,q,le,je)}if(pe(le)||te(le))return B=B.get(q)||null,ee(L,B,le,je,null);if(typeof le.then=="function")return X(B,L,q,br(le),je);if(le.$$typeof===A)return X(B,L,q,pr(L,le),je);yr(L,le)}return null}function ge(B,L,q,le){for(var je=null,Ge=null,ye=L,Ee=L=0,De=null;ye!==null&&Ee<q.length;Ee++){ye.index>Ee?(De=ye,ye=null):De=ye.sibling;var qe=Z(B,ye,q[Ee],le);if(qe===null){ye===null&&(ye=De);break}e&&ye&&qe.alternate===null&&t(B,ye),L=d(qe,L,Ee),Ge===null?je=qe:Ge.sibling=qe,Ge=qe,ye=De}if(Ee===q.length)return a(B,ye),Le&&Gn(B,Ee),je;if(ye===null){for(;Ee<q.length;Ee++)ye=se(B,q[Ee],le),ye!==null&&(L=d(ye,L,Ee),Ge===null?je=ye:Ge.sibling=ye,Ge=ye);return Le&&Gn(B,Ee),je}for(ye=s(ye);Ee<q.length;Ee++)De=X(ye,B,Ee,q[Ee],le),De!==null&&(e&&De.alternate!==null&&ye.delete(De.key===null?Ee:De.key),L=d(De,L,Ee),Ge===null?je=De:Ge.sibling=De,Ge=De);return e&&ye.forEach(function(Ta){return t(B,Ta)}),Le&&Gn(B,Ee),je}function Ne(B,L,q,le){if(q==null)throw Error(o(151));for(var je=null,Ge=null,ye=L,Ee=L=0,De=null,qe=q.next();ye!==null&&!qe.done;Ee++,qe=q.next()){ye.index>Ee?(De=ye,ye=null):De=ye.sibling;var Ta=Z(B,ye,qe.value,le);if(Ta===null){ye===null&&(ye=De);break}e&&ye&&Ta.alternate===null&&t(B,ye),L=d(Ta,L,Ee),Ge===null?je=Ta:Ge.sibling=Ta,Ge=Ta,ye=De}if(qe.done)return a(B,ye),Le&&Gn(B,Ee),je;if(ye===null){for(;!qe.done;Ee++,qe=q.next())qe=se(B,qe.value,le),qe!==null&&(L=d(qe,L,Ee),Ge===null?je=qe:Ge.sibling=qe,Ge=qe);return Le&&Gn(B,Ee),je}for(ye=s(ye);!qe.done;Ee++,qe=q.next())qe=X(ye,B,Ee,qe.value,le),qe!==null&&(e&&qe.alternate!==null&&ye.delete(qe.key===null?Ee:qe.key),L=d(qe,L,Ee),Ge===null?je=qe:Ge.sibling=qe,Ge=qe);return e&&ye.forEach(function(Ob){return t(B,Ob)}),Le&&Gn(B,Ee),je}function Pe(B,L,q,le){if(typeof q=="object"&&q!==null&&q.type===S&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case j:e:{for(var je=q.key;L!==null;){if(L.key===je){if(je=q.type,je===S){if(L.tag===7){a(B,L.sibling),le=c(L,q.props.children),le.return=B,B=le;break e}}else if(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&Ha(je)===L.type){a(B,L.sibling),le=c(L,q.props),os(le,q),le.return=B,B=le;break e}a(B,L);break}else t(B,L);L=L.sibling}q.type===S?(le=La(q.props.children,B.mode,le,q.key),le.return=B,B=le):(le=dr(q.type,q.key,q.props,null,B.mode,le),os(le,q),le.return=B,B=le)}return b(B);case w:e:{for(je=q.key;L!==null;){if(L.key===je)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){a(B,L.sibling),le=c(L,q.children||[]),le.return=B,B=le;break e}else{a(B,L);break}else t(B,L);L=L.sibling}le=uo(q,B.mode,le),le.return=B,B=le}return b(B);case K:return q=Ha(q),Pe(B,L,q,le)}if(pe(q))return ge(B,L,q,le);if(te(q)){if(je=te(q),typeof je!="function")throw Error(o(150));return q=je.call(q),Ne(B,L,q,le)}if(typeof q.then=="function")return Pe(B,L,br(q),le);if(q.$$typeof===A)return Pe(B,L,pr(B,q),le);yr(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(a(B,L.sibling),le=c(L,q),le.return=B,B=le):(a(B,L),le=co(q,B.mode,le),le.return=B,B=le),b(B)):a(B,L)}return function(B,L,q,le){try{is=0;var je=Pe(B,L,q,le);return jl=null,je}catch(ye){if(ye===vl||ye===xr)throw ye;var Ge=Wt(29,ye,null,B.mode);return Ge.lanes=le,Ge.return=B,Ge}finally{}}}var qa=em(!0),tm=em(!1),ua=!1;function No(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function So(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function da(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ma(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ve&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=ur(e),$d(e,null,a),t}return cr(e,s,t,a),ur(e)}function cs(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Zl(e,a)}}function ko(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=b:d=d.next=b,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Co=!1;function us(){if(Co){var e=yl;if(e!==null)throw e}}function ds(e,t,a,s){Co=!1;var c=e.updateQueue;ua=!1;var d=c.firstBaseUpdate,b=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var D=N,Y=D.next;D.next=null,b===null?d=Y:b.next=Y,b=D;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==b&&(N===null?ee.firstBaseUpdate=Y:N.next=Y,ee.lastBaseUpdate=D))}if(d!==null){var se=c.baseState;b=0,ee=Y=D=null,N=d;do{var Z=N.lane&-536870913,X=Z!==N.lane;if(X?(Me&Z)===Z:(s&Z)===Z){Z!==0&&Z===bl&&(Co=!0),ee!==null&&(ee=ee.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ge=e,Ne=N;Z=t;var Pe=a;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){se=ge.call(Pe,se,Z);break e}se=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,Z=typeof ge=="function"?ge.call(Pe,se,Z):ge,Z==null)break e;se=v({},se,Z);break e;case 2:ua=!0}}Z=N.callback,Z!==null&&(e.flags|=64,X&&(e.flags|=8192),X=c.callbacks,X===null?c.callbacks=[Z]:X.push(Z))}else X={lane:Z,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(Y=ee=X,D=se):ee=ee.next=X,b|=Z;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;X=N,N=X.next,X.next=null,c.lastBaseUpdate=X,c.shared.pending=null}}while(!0);ee===null&&(D=se),c.baseState=D,c.firstBaseUpdate=Y,c.lastBaseUpdate=ee,d===null&&(c.shared.lanes=0),ga|=b,e.lanes=b,e.memoizedState=se}}function nm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function am(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)nm(a[e],t)}var wl=T(null),vr=T(0);function lm(e,t){e=Pn,V(vr,e),V(wl,t),Pn=e|t.baseLanes}function To(){V(vr,Pn),V(wl,wl.current)}function Eo(){Pn=vr.current,_(wl),_(vr)}var en=T(null),xn=null;function fa(e){var t=e.alternate;V(mt,mt.current&1),V(en,e),xn===null&&(t===null||wl.current!==null||t.memoizedState!==null)&&(xn=e)}function Ao(e){V(mt,mt.current),V(en,e),xn===null&&(xn=e)}function sm(e){e.tag===22?(V(mt,mt.current),V(en,e),xn===null&&(xn=e)):pa()}function pa(){V(mt,mt.current),V(en,en.current)}function tn(e){_(en),xn===e&&(xn=null),_(mt)}var mt=T(0);function jr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lc(a)||zc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fn=0,Te=null,Je=null,gt=null,wr=!1,Nl=!1,Ya=!1,Nr=0,ms=0,Sl=null,Sg=0;function ct(){throw Error(o(321))}function Ro(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Pt(e[a],t[a]))return!1;return!0}function Mo(e,t,a,s,c,d){return Fn=d,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?qm:Vo,Ya=!1,d=a(s,c),Ya=!1,Nl&&(d=im(t,a,s,c)),rm(e),d}function rm(e){U.H=hs;var t=Je!==null&&Je.next!==null;if(Fn=0,gt=Je=Te=null,wr=!1,ms=0,Sl=null,t)throw Error(o(300));e===null||bt||(e=e.dependencies,e!==null&&fr(e)&&(bt=!0))}function im(e,t,a,s){Te=e;var c=0;do{if(Nl&&(Sl=null),ms=0,Nl=!1,25<=c)throw Error(o(301));if(c+=1,gt=Je=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}U.H=Ym,d=t(a,s)}while(Nl);return d}function kg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?fs(t):t,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(Te.flags|=1024),t}function Do(){var e=Nr!==0;return Nr=0,e}function _o(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Oo(e){if(wr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wr=!1}Fn=0,gt=Je=Te=null,Nl=!1,ms=Nr=0,Sl=null}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Te.memoizedState=gt=e:gt=gt.next=e,gt}function ft(){if(Je===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=gt===null?Te.memoizedState:gt.next;if(t!==null)gt=t,Je=e;else{if(e===null)throw Te.alternate===null?Error(o(467)):Error(o(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},gt===null?Te.memoizedState=gt=e:gt=gt.next=e}return gt}function Sr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var t=ms;return ms+=1,Sl===null&&(Sl=[]),e=Kd(Sl,e,t),t=Te,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?qm:Vo),e}function kr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fs(e);if(e.$$typeof===A)return _t(e)}throw Error(o(438,String(e)))}function Lo(e){var t=null,a=Te.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Te.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Sr(),Te.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=ue;return t.index++,a}function Zn(e,t){return typeof t=="function"?t(e):t}function Cr(e){var t=ft();return zo(t,Je,e)}function zo(e,t,a){var s=e.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=a;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var b=c.next;c.next=d.next,d.next=b}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var N=b=null,D=null,Y=t,ee=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Me&se)===se:(Fn&se)===se){var Z=Y.revertLane;if(Z===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===bl&&(ee=!0);else if((Fn&Z)===Z){Y=Y.next,Z===bl&&(ee=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},D===null?(N=D=se,b=d):D=D.next=se,Te.lanes|=Z,ga|=Z;se=Y.action,Ya&&a(d,se),d=Y.hasEagerState?Y.eagerState:a(d,se)}else Z={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},D===null?(N=D=Z,b=d):D=D.next=Z,Te.lanes|=se,ga|=se;Y=Y.next}while(Y!==null&&Y!==t);if(D===null?b=d:D.next=N,!Pt(d,e.memoizedState)&&(bt=!0,ee&&(a=yl,a!==null)))throw a;e.memoizedState=d,e.baseState=b,e.baseQueue=D,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Bo(e){var t=ft(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var b=c=c.next;do d=e(d,b.action),b=b.next;while(b!==c);Pt(d,t.memoizedState)||(bt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,s]}function om(e,t,a){var s=Te,c=ft(),d=Le;if(d){if(a===void 0)throw Error(o(407));a=a()}else a=t();var b=!Pt((Je||c).memoizedState,a);if(b&&(c.memoizedState=a,bt=!0),c=c.queue,Ho(dm.bind(null,s,c,e),[e]),c.getSnapshot!==t||b||gt!==null&>.memoizedState.tag&1){if(s.flags|=2048,kl(9,{destroy:void 0},um.bind(null,s,c,a,t),null),We===null)throw Error(o(349));d||(Fn&127)!==0||cm(s,t,a)}return a}function cm(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Te.updateQueue,t===null?(t=Sr(),Te.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function um(e,t,a,s){t.value=a,t.getSnapshot=s,mm(t)&&fm(e)}function dm(e,t,a){return a(function(){mm(t)&&fm(e)})}function mm(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pt(e,a)}catch{return!0}}function fm(e){var t=Oa(e,2);t!==null&&Kt(t,e,2)}function $o(e){var t=Ut();if(typeof e=="function"){var a=e;if(e=a(),Ya){Ue(!0);try{a()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:e},t}function pm(e,t,a,s){return e.baseState=a,zo(e,Je,typeof s=="function"?s:Zn)}function Cg(e,t,a,s,c){if(Ar(e))throw Error(o(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};U.T!==null?a(!0):d.isTransition=!1,s(d),a=t.pending,a===null?(d.next=t.pending=d,hm(t,d)):(d.next=a.next,t.pending=a.next=d)}}function hm(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=U.T,b={};U.T=b;try{var N=a(c,s),D=U.S;D!==null&&D(b,N),xm(e,t,N)}catch(Y){Uo(e,t,Y)}finally{d!==null&&b.types!==null&&(d.types=b.types),U.T=d}}else try{d=a(c,s),xm(e,t,d)}catch(Y){Uo(e,t,Y)}}function xm(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){gm(e,t,s)},function(s){return Uo(e,t,s)}):gm(e,t,a)}function gm(e,t,a){t.status="fulfilled",t.value=a,bm(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,hm(e,a)))}function Uo(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,bm(t),t=t.next;while(t!==s)}e.action=null}function bm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function vm(e,t){if(Le){var a=We.formState;if(a!==null){e:{var s=Te;if(Le){if(nt){t:{for(var c=nt,d=hn;c.nodeType!==8;){if(!d){c=null;break t}if(c=gn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){nt=gn(c.nextSibling),s=c.data==="F!";break e}}oa(s)}s=!1}s&&(t=a[0])}}return a=Ut(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},a.queue=s,a=Um.bind(null,Te,s),s.dispatch=a,s=$o(!1),d=Zo.bind(null,Te,!1,s.queue),s=Ut(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=Cg.bind(null,Te,c,d,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function jm(e){var t=ft();return wm(t,Je,e)}function wm(e,t,a){if(t=zo(e,t,ym)[0],e=Cr(Zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=fs(t)}catch(b){throw b===vl?xr:b}else s=t;t=ft();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Te.flags|=2048,kl(9,{destroy:void 0},Tg.bind(null,c,a),null)),[s,d,e]}function Tg(e,t){e.action=t}function Nm(e){var t=ft(),a=Je;if(a!==null)return wm(t,a,e);ft(),t=t.memoizedState,a=ft();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function kl(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Sr(),Te.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Sm(){return ft().memoizedState}function Tr(e,t,a,s){var c=Ut();Te.flags|=e,c.memoizedState=kl(1|t,{destroy:void 0},a,s===void 0?null:s)}function Er(e,t,a,s){var c=ft();s=s===void 0?null:s;var d=c.memoizedState.inst;Je!==null&&s!==null&&Ro(s,Je.memoizedState.deps)?c.memoizedState=kl(t,d,a,s):(Te.flags|=e,c.memoizedState=kl(1|t,d,a,s))}function km(e,t){Tr(8390656,8,e,t)}function Ho(e,t){Er(2048,8,e,t)}function Eg(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Sr(),Te.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Cm(e){var t=ft().memoizedState;return Eg({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Tm(e,t){return Er(4,2,e,t)}function Em(e,t){return Er(4,4,e,t)}function Am(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rm(e,t,a){a=a!=null?a.concat([e]):null,Er(4,4,Am.bind(null,t,e),a)}function Go(){}function Mm(e,t){var a=ft();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Ro(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Dm(e,t){var a=ft();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Ro(t,s[1]))return s[0];if(s=e(),Ya){Ue(!0);try{e()}finally{Ue(!1)}}return a.memoizedState=[s,t],s}function qo(e,t,a){return a===void 0||(Fn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Of(),Te.lanes|=e,ga|=e,a)}function _m(e,t,a,s){return Pt(a,t)?a:wl.current!==null?(e=qo(e,a,s),Pt(e,t)||(bt=!0),e):(Fn&42)===0||(Fn&1073741824)!==0&&(Me&261930)===0?(bt=!0,e.memoizedState=a):(e=Of(),Te.lanes|=e,ga|=e,t)}function Om(e,t,a,s,c){var d=z.p;z.p=d!==0&&8>d?d:8;var b=U.T,N={};U.T=N,Zo(e,!1,t,a);try{var D=c(),Y=U.S;if(Y!==null&&Y(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=Ng(D,s);ps(e,t,ee,ln(e))}else ps(e,t,s,ln(e))}catch(se){ps(e,t,{then:function(){},status:"rejected",reason:se},ln())}finally{z.p=d,b!==null&&N.types!==null&&(b.types=N.types),U.T=b}}function Ag(){}function Yo(e,t,a,s){if(e.tag!==5)throw Error(o(476));var c=Lm(e).queue;Om(e,c,t,Q,a===null?Ag:function(){return zm(e),a(s)})}function Lm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:Q},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zm(e){var t=Lm(e);t.next===null&&(t=e.alternate.memoizedState),ps(e,t.next.queue,{},ln())}function Fo(){return _t(Ms)}function Bm(){return ft().memoizedState}function $m(){return ft().memoizedState}function Rg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ln();e=da(a);var s=ma(t,e,a);s!==null&&(Kt(s,t,a),cs(s,t,a)),t={cache:yo()},e.payload=t;return}t=t.return}}function Mg(e,t,a){var s=ln();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ar(e)?Hm(t,a):(a=io(e,t,a,s),a!==null&&(Kt(a,e,s),Gm(a,t,s)))}function Um(e,t,a){var s=ln();ps(e,t,a,s)}function ps(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ar(e))Hm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var b=t.lastRenderedState,N=d(b,a);if(c.hasEagerState=!0,c.eagerState=N,Pt(N,b))return cr(e,t,c,0),We===null&&or(),!1}catch{}finally{}if(a=io(e,t,c,s),a!==null)return Kt(a,e,s),Gm(a,t,s),!0}return!1}function Zo(e,t,a,s){if(s={lane:2,revertLane:Nc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ar(e)){if(t)throw Error(o(479))}else t=io(e,a,s,2),t!==null&&Kt(t,e,2)}function Ar(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Hm(e,t){Nl=wr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Gm(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Zl(e,a)}}var hs={readContext:_t,use:kr,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};hs.useEffectEvent=ct;var qm={readContext:_t,use:kr,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:km,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Tr(4194308,4,Am.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Tr(4194308,4,e,t)},useInsertionEffect:function(e,t){Tr(4,2,e,t)},useMemo:function(e,t){var a=Ut();t=t===void 0?null:t;var s=e();if(Ya){Ue(!0);try{e()}finally{Ue(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Ut();if(a!==void 0){var c=a(t);if(Ya){Ue(!0);try{a(t)}finally{Ue(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=Mg.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:function(e){e=$o(e);var t=e.queue,a=Um.bind(null,Te,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Go,useDeferredValue:function(e,t){var a=Ut();return qo(a,e,t)},useTransition:function(){var e=$o(!1);return e=Om.bind(null,Te,e.queue,!0,!1),Ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Te,c=Ut();if(Le){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),We===null)throw Error(o(349));(Me&127)!==0||cm(s,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,km(dm.bind(null,s,d,e),[e]),s.flags|=2048,kl(9,{destroy:void 0},um.bind(null,s,d,a,t),null),a},useId:function(){var e=Ut(),t=We.identifierPrefix;if(Le){var a=En,s=Tn;a=(s&~(1<<32-tt(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Nr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Sg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Fo,useFormState:vm,useActionState:vm,useOptimistic:function(e){var t=Ut();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Zo.bind(null,Te,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Ut().memoizedState=Rg.bind(null,Te)},useEffectEvent:function(e){var t=Ut(),a={impl:e};return t.memoizedState=a,function(){if((Ve&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},Vo={readContext:_t,use:kr,useCallback:Mm,useContext:_t,useEffect:Ho,useImperativeHandle:Rm,useInsertionEffect:Tm,useLayoutEffect:Em,useMemo:Dm,useReducer:Cr,useRef:Sm,useState:function(){return Cr(Zn)},useDebugValue:Go,useDeferredValue:function(e,t){var a=ft();return _m(a,Je.memoizedState,e,t)},useTransition:function(){var e=Cr(Zn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:fs(e),t]},useSyncExternalStore:om,useId:Bm,useHostTransitionStatus:Fo,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var a=ft();return pm(a,Je,e,t)},useMemoCache:Lo,useCacheRefresh:$m};Vo.useEffectEvent=Cm;var Ym={readContext:_t,use:kr,useCallback:Mm,useContext:_t,useEffect:Ho,useImperativeHandle:Rm,useInsertionEffect:Tm,useLayoutEffect:Em,useMemo:Dm,useReducer:Bo,useRef:Sm,useState:function(){return Bo(Zn)},useDebugValue:Go,useDeferredValue:function(e,t){var a=ft();return Je===null?qo(a,e,t):_m(a,Je.memoizedState,e,t)},useTransition:function(){var e=Bo(Zn)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:fs(e),t]},useSyncExternalStore:om,useId:Bm,useHostTransitionStatus:Fo,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var a=ft();return Je!==null?pm(a,Je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lo,useCacheRefresh:$m};Ym.useEffectEvent=Cm;function Qo(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Xo={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=ln(),c=da(s);c.payload=t,a!=null&&(c.callback=a),t=ma(e,c,s),t!==null&&(Kt(t,e,s),cs(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=ln(),c=da(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ma(e,c,s),t!==null&&(Kt(t,e,s),cs(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ln(),s=da(a);s.tag=2,t!=null&&(s.callback=t),t=ma(e,s,a),t!==null&&(Kt(t,e,a),cs(t,e,a))}};function Fm(e,t,a,s,c,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):t.prototype&&t.prototype.isPureReactComponent?!ts(a,s)||!ts(c,d):!0}function Zm(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&Xo.enqueueReplaceState(t,t.state,null)}function Fa(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=v({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Vm(e){ir(e)}function Qm(e){console.error(e)}function Xm(e){ir(e)}function Rr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Im(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Io(e,t,a){return a=da(a),a.tag=3,a.payload={element:null},a.callback=function(){Rr(e,t)},a}function Jm(e){return e=da(e),e.tag=3,e}function Km(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){Im(t,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Im(t,a,s),typeof c!="function"&&(ba===null?ba=new Set([this]):ba.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function Dg(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&gl(t,a,c,!0),a=en.current,a!==null){switch(a.tag){case 31:case 13:return xn===null?qr():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===gr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),vc(e,s,c)),!1;case 22:return a.flags|=65536,s===gr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),vc(e,s,c)),!1}throw Error(o(435,a.tag))}return vc(e,s,c),qr(),!1}if(Le)return t=en.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==po&&(e=Error(o(422),{cause:s}),ls(mn(e,a)))):(s!==po&&(t=Error(o(423),{cause:s}),ls(mn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=mn(s,a),c=Io(e.stateNode,s,c),ko(e,c),ut!==4&&(ut=2)),!1;var d=Error(o(520),{cause:s});if(d=mn(d,a),Ns===null?Ns=[d]:Ns.push(d),ut!==4&&(ut=2),t===null)return!0;s=mn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Io(a.stateNode,s,e),ko(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ba===null||!ba.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Jm(c),Km(c,e,a,s),ko(a,c),!1}a=a.return}while(a!==null);return!1}var Jo=Error(o(461)),bt=!1;function Ot(e,t,a,s){t.child=e===null?tm(t,null,a,s):qa(t,e.child,a,s)}function Pm(e,t,a,s,c){a=a.render;var d=t.ref;if("ref"in s){var b={};for(var N in s)N!=="ref"&&(b[N]=s[N])}else b=s;return $a(t),s=Mo(e,t,a,b,d,c),N=Do(),e!==null&&!bt?(_o(e,t,c),Vn(e,t,c)):(Le&&N&&mo(t),t.flags|=1,Ot(e,t,s,c),t.child)}function Wm(e,t,a,s,c){if(e===null){var d=a.type;return typeof d=="function"&&!oo(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,ef(e,t,d,s,c)):(e=dr(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!lc(e,c)){var b=d.memoizedProps;if(a=a.compare,a=a!==null?a:ts,a(b,s)&&e.ref===t.ref)return Vn(e,t,c)}return t.flags|=1,e=Hn(d,s),e.ref=t.ref,e.return=t,t.child=e}function ef(e,t,a,s,c){if(e!==null){var d=e.memoizedProps;if(ts(d,s)&&e.ref===t.ref)if(bt=!1,t.pendingProps=s=d,lc(e,c))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,Vn(e,t,c)}return Ko(e,t,a,s,c)}function tf(e,t,a,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return nf(e,t,d,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hr(t,d!==null?d.cachePool:null),d!==null?lm(t,d):To(),sm(t);else return s=t.lanes=536870912,nf(e,t,d!==null?d.baseLanes|a:a,a,s)}else d!==null?(hr(t,d.cachePool),lm(t,d),pa(),t.memoizedState=null):(e!==null&&hr(t,null),To(),pa());return Ot(e,t,c,a),t.child}function xs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,a,s,c){var d=jo();return d=d===null?null:{parent:xt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&hr(t,null),To(),sm(t),e!==null&&gl(e,t,s,!0),t.childLanes=c,null}function Mr(e,t){return t=_r({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function af(e,t,a){return qa(t,e.child,null,a),e=Mr(t,t.pendingProps),e.flags|=2,tn(t),t.memoizedState=null,e}function _g(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(s.mode==="hidden")return e=Mr(t,s),t.lanes=536870912,xs(null,e);if(Ao(t),(e=nt)?(e=xp(e,hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:Tn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=Hd(e),a.return=t,t.child=a,Dt=t,nt=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Mr(t,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(Ao(t),c)if(t.flags&256)t.flags&=-257,t=af(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(bt||gl(e,t,a,!1),c=(a&e.childLanes)!==0,bt||c){if(s=We,s!==null&&(b=Wa(s,a),b!==0&&b!==d.retryLane))throw d.retryLane=b,Oa(e,b),Kt(s,e,b),Jo;qr(),t=af(e,t,a)}else e=d.treeContext,nt=gn(b.nextSibling),Dt=t,Le=!0,ia=null,hn=!1,e!==null&&Yd(t,e),t=Mr(t,s),t.flags|=4096;return t}return e=Hn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Dr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ko(e,t,a,s,c){return $a(t),a=Mo(e,t,a,s,void 0,c),s=Do(),e!==null&&!bt?(_o(e,t,c),Vn(e,t,c)):(Le&&s&&mo(t),t.flags|=1,Ot(e,t,a,c),t.child)}function lf(e,t,a,s,c,d){return $a(t),t.updateQueue=null,a=im(t,s,a,c),rm(e),s=Do(),e!==null&&!bt?(_o(e,t,d),Vn(e,t,d)):(Le&&s&&mo(t),t.flags|=1,Ot(e,t,a,d),t.child)}function sf(e,t,a,s,c){if($a(t),t.stateNode===null){var d=fl,b=a.contextType;typeof b=="object"&&b!==null&&(d=_t(b)),d=new a(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Xo,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},No(t),b=a.contextType,d.context=typeof b=="object"&&b!==null?_t(b):fl,d.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Qo(t,a,b,s),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&Xo.enqueueReplaceState(d,d.state,null),ds(t,s,d,c),us(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var N=t.memoizedProps,D=Fa(a,N);d.props=D;var Y=d.context,ee=a.contextType;b=fl,typeof ee=="object"&&ee!==null&&(b=_t(ee));var se=a.getDerivedStateFromProps;ee=typeof se=="function"||typeof d.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,ee||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(N||Y!==b)&&Zm(t,d,s,b),ua=!1;var Z=t.memoizedState;d.state=Z,ds(t,s,d,c),us(),Y=t.memoizedState,N||Z!==Y||ua?(typeof se=="function"&&(Qo(t,a,se,s),Y=t.memoizedState),(D=ua||Fm(t,a,D,s,Z,Y,b))?(ee||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=Y),d.props=s,d.state=Y,d.context=b,s=D):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,So(e,t),b=t.memoizedProps,ee=Fa(a,b),d.props=ee,se=t.pendingProps,Z=d.context,Y=a.contextType,D=fl,typeof Y=="object"&&Y!==null&&(D=_t(Y)),N=a.getDerivedStateFromProps,(Y=typeof N=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==se||Z!==D)&&Zm(t,d,s,D),ua=!1,Z=t.memoizedState,d.state=Z,ds(t,s,d,c),us();var X=t.memoizedState;b!==se||Z!==X||ua||e!==null&&e.dependencies!==null&&fr(e.dependencies)?(typeof N=="function"&&(Qo(t,a,N,s),X=t.memoizedState),(ee=ua||Fm(t,a,ee,s,Z,X,D)||e!==null&&e.dependencies!==null&&fr(e.dependencies))?(Y||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,X,D),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,X,D)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=X),d.props=s,d.state=X,d.context=D,s=ee):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Dr(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=qa(t,e.child,null,c),t.child=qa(t,null,a,c)):Ot(e,t,a,c),t.memoizedState=d.state,e=t.child):e=Vn(e,t,c),e}function rf(e,t,a,s){return za(),t.flags|=256,Ot(e,t,a,s),t.child}var Po={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wo(e){return{baseLanes:e,cachePool:Id()}}function ec(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=an),e}function of(e,t,a){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?fa(t):pa(),(e=nt)?(e=xp(e,hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:Tn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=Hd(e),a.return=t,t.child=a,Dt=t,nt=null)):e=null,e===null)throw oa(t);return zc(e)?t.lanes=32:t.lanes=536870912,null}var N=s.children;return s=s.fallback,c?(pa(),c=t.mode,N=_r({mode:"hidden",children:N},c),s=La(s,c,a,null),N.return=t,s.return=t,N.sibling=s,t.child=N,s=t.child,s.memoizedState=Wo(a),s.childLanes=ec(e,b,a),t.memoizedState=Po,xs(null,s)):(fa(t),tc(t,N))}var D=e.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(d)t.flags&256?(fa(t),t.flags&=-257,t=nc(e,t,a)):t.memoizedState!==null?(pa(),t.child=e.child,t.flags|=128,t=null):(pa(),N=s.fallback,c=t.mode,s=_r({mode:"visible",children:s.children},c),N=La(N,c,a,null),N.flags|=2,s.return=t,N.return=t,s.sibling=N,t.child=s,qa(t,e.child,null,a),s=t.child,s.memoizedState=Wo(a),s.childLanes=ec(e,b,a),t.memoizedState=Po,t=xs(null,s));else if(fa(t),zc(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var Y=b.dgst;b=Y,s=Error(o(419)),s.stack="",s.digest=b,ls({value:s,source:null,stack:null}),t=nc(e,t,a)}else if(bt||gl(e,t,a,!1),b=(a&e.childLanes)!==0,bt||b){if(b=We,b!==null&&(s=Wa(b,a),s!==0&&s!==D.retryLane))throw D.retryLane=s,Oa(e,s),Kt(b,e,s),Jo;Lc(N)||qr(),t=nc(e,t,a)}else Lc(N)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,nt=gn(N.nextSibling),Dt=t,Le=!0,ia=null,hn=!1,e!==null&&Yd(t,e),t=tc(t,s.children),t.flags|=4096);return t}return c?(pa(),N=s.fallback,c=t.mode,D=e.child,Y=D.sibling,s=Hn(D,{mode:"hidden",children:s.children}),s.subtreeFlags=D.subtreeFlags&65011712,Y!==null?N=Hn(Y,N):(N=La(N,c,a,null),N.flags|=2),N.return=t,s.return=t,s.sibling=N,t.child=s,xs(null,s),s=t.child,N=e.child.memoizedState,N===null?N=Wo(a):(c=N.cachePool,c!==null?(D=xt._currentValue,c=c.parent!==D?{parent:D,pool:D}:c):c=Id(),N={baseLanes:N.baseLanes|a,cachePool:c}),s.memoizedState=N,s.childLanes=ec(e,b,a),t.memoizedState=Po,xs(e.child,s)):(fa(t),a=e.child,e=a.sibling,a=Hn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=a,t.memoizedState=null,a)}function tc(e,t){return t=_r({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _r(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function nc(e,t,a){return qa(t,e.child,null,a),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cf(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),go(e.return,t,a)}function ac(e,t,a,s,c,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:d}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=a,b.tailMode=c,b.treeForkCount=d)}function uf(e,t,a){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var b=mt.current,N=(b&2)!==0;if(N?(b=b&1|2,t.flags|=128):b&=1,V(mt,b),Ot(e,t,s,a),s=Le?as:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cf(e,a,t);else if(e.tag===19)cf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&jr(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),ac(t,!1,c,a,d,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&jr(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}ac(t,!0,a,null,d,s);break;case"together":ac(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Vn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ga|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(gl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Hn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function lc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&fr(e)))}function Og(e,t,a){switch(t.tag){case 3:F(t,t.stateNode.containerInfo),ca(t,xt,e.memoizedState.cache),za();break;case 27:case 5:be(t);break;case 4:F(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(fa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?of(e,t,a):(fa(t),e=Vn(e,t,a),e!==null?e.sibling:null);fa(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(gl(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return uf(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(mt,mt.current),s)break;return null;case 22:return t.lanes=0,tf(e,t,a,t.pendingProps);case 24:ca(t,xt,e.memoizedState.cache)}return Vn(e,t,a)}function df(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!lc(e,a)&&(t.flags&128)===0)return bt=!1,Og(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Le&&(t.flags&1048576)!==0&&qd(t,as,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Ha(t.elementType),t.type=e,typeof e=="function")oo(e)?(s=Fa(e,s),t.tag=1,t=sf(null,t,e,s,a)):(t.tag=0,t=Ko(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===R){t.tag=11,t=Pm(null,t,e,s,a);break e}else if(c===H){t.tag=14,t=Wm(null,t,e,s,a);break e}}throw t=de(e)||e,Error(o(306,t,""))}}return t;case 0:return Ko(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=Fa(s,t.pendingProps),sf(e,t,s,c,a);case 3:e:{if(F(t,t.stateNode.containerInfo),e===null)throw Error(o(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,So(e,t),ds(t,s,null,a);var b=t.memoizedState;if(s=b.cache,ca(t,xt,s),s!==d.cache&&bo(t,[xt],a,!0),us(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=rf(e,t,s,a);break e}else if(s!==c){c=mn(Error(o(424)),t),ls(c),t=rf(e,t,s,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nt=gn(e.firstChild),Dt=t,Le=!0,ia=null,hn=!0,a=tm(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(za(),s===c){t=Vn(e,t,a);break e}Ot(e,t,s,a)}t=t.child}return t;case 26:return Dr(e,t),e===null?(a=wp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Le||(a=t.type,e=t.pendingProps,s=Ir(he.current).createElement(a),s[Mt]=t,s[Zt]=e,Lt(s,a,e),Et(s),t.stateNode=s):t.memoizedState=wp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&Le&&(s=t.stateNode=yp(t.type,t.pendingProps,he.current),Dt=t,hn=!0,c=nt,wa(t.type)?(Bc=c,nt=gn(s.firstChild)):nt=c),Ot(e,t,t.pendingProps.children,a),Dr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=s=nt)&&(s=ub(s,t.type,t.pendingProps,hn),s!==null?(t.stateNode=s,Dt=t,nt=gn(s.firstChild),hn=!1,c=!0):c=!1),c||oa(t)),be(t),c=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,Dc(c,d)?s=null:b!==null&&Dc(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Mo(e,t,kg,null,null,a),Ms._currentValue=c),Dr(e,t),Ot(e,t,s,a),t.child;case 6:return e===null&&Le&&((e=a=nt)&&(a=db(a,t.pendingProps,hn),a!==null?(t.stateNode=a,Dt=t,nt=null,e=!0):e=!1),e||oa(t)),null;case 13:return of(e,t,a);case 4:return F(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=qa(t,null,s,a):Ot(e,t,s,a),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,a);case 7:return Ot(e,t,t.pendingProps,a),t.child;case 8:return Ot(e,t,t.pendingProps.children,a),t.child;case 12:return Ot(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,ca(t,t.type,s.value),Ot(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,$a(t),c=_t(c),s=s(c),t.flags|=1,Ot(e,t,s,a),t.child;case 14:return Wm(e,t,t.type,t.pendingProps,a);case 15:return ef(e,t,t.type,t.pendingProps,a);case 19:return uf(e,t,a);case 31:return _g(e,t,a);case 22:return tf(e,t,a,t.pendingProps);case 24:return $a(t),s=_t(xt),e===null?(c=jo(),c===null&&(c=We,d=yo(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:s,cache:c},No(t),ca(t,xt,c)):((e.lanes&a)!==0&&(So(e,t),ds(t,null,null,a),us()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ca(t,xt,s)):(s=d.cache,ca(t,xt,s),s!==c.cache&&bo(t,[xt],a,!0))),Ot(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Qn(e){e.flags|=4}function sc(e,t,a,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if($f())e.flags|=8192;else throw Ga=gr,wo}else e.flags&=-16777217}function mf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Tp(t))if($f())e.flags|=8192;else throw Ga=gr,wo}function Or(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Nt():536870912,e.lanes|=t,Al|=t)}function gs(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function Lg(e,t,a){var s=t.pendingProps;switch(fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return at(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Yn(xt),me(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(xl(t)?Qn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ho())),at(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Qn(t),d!==null?(at(t),mf(t,d)):(at(t),sc(t,c,null,s,a))):d?d!==e.memoizedState?(Qn(t),at(t),mf(t,d)):(at(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Qn(t),at(t),sc(t,c,e,s,a)),null;case 27:if(Qe(t),a=he.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Qn(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return at(t),null}e=J.current,xl(t)?Fd(t):(e=yp(c,s,a),t.stateNode=e,Qn(t))}return at(t),null;case 5:if(Qe(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Qn(t);else{if(!s){if(t.stateNode===null)throw Error(o(166));return at(t),null}if(d=J.current,xl(t))Fd(t);else{var b=Ir(he.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(c,{is:s.is}):b.createElement(c)}}d[Mt]=t,d[Zt]=s;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=d;e:switch(Lt(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Qn(t)}}return at(t),sc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Qn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,xl(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=Dt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||op(e.nodeValue,a)),e||oa(t,!0)}else e=Ir(e).createTextNode(s),e[Mt]=t,t.stateNode=e}return at(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=xl(t),a!==null){if(e===null){if(!s)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Mt]=t}else za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else a=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(tn(t),t):(tn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return at(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=xl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[Mt]=t}else za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),c=!1}else c=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(tn(t),t):(tn(t),null)}return tn(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Or(t,t.updateQueue),at(t),null);case 4:return me(),e===null&&Tc(t.stateNode.containerInfo),at(t),null;case 10:return Yn(t.type),at(t),null;case 19:if(_(mt),s=t.memoizedState,s===null)return at(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)gs(s,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=jr(e),d!==null){for(t.flags|=128,gs(s,!1),e=d.updateQueue,t.updateQueue=e,Or(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Ud(a,e),a=a.sibling;return V(mt,mt.current&1|2),Le&&Gn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ze()>Ur&&(t.flags|=128,c=!0,gs(s,!1),t.lanes=4194304)}else{if(!c)if(e=jr(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Or(t,e),gs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!Le)return at(t),null}else 2*Ze()-s.renderingStartTime>Ur&&a!==536870912&&(t.flags|=128,c=!0,gs(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ze(),e.sibling=null,a=mt.current,V(mt,c?a&1|2:a&1),Le&&Gn(t,s.treeForkCount),e):(at(t),null);case 22:case 23:return tn(t),Eo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),a=t.updateQueue,a!==null&&Or(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&_(Ua),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Yn(xt),at(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function zg(e,t){switch(fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yn(xt),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Qe(t),null;case 31:if(t.memoizedState!==null){if(tn(t),t.alternate===null)throw Error(o(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(tn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(mt),null;case 4:return me(),null;case 10:return Yn(t.type),null;case 22:case 23:return tn(t),Eo(),e!==null&&_(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yn(xt),null;case 25:return null;default:return null}}function ff(e,t){switch(fo(t),t.tag){case 3:Yn(xt),me();break;case 26:case 27:case 5:Qe(t);break;case 4:me();break;case 31:t.memoizedState!==null&&tn(t);break;case 13:tn(t);break;case 19:_(mt);break;case 10:Yn(t.type);break;case 22:case 23:tn(t),Eo(),e!==null&&_(Ua);break;case 24:Yn(xt)}}function bs(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var d=a.create,b=a.inst;s=d(),b.destroy=s}a=a.next}while(a!==c)}}catch(N){Ie(t,t.return,N)}}function ha(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var b=s.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,c=t;var D=a,Y=N;try{Y()}catch(ee){Ie(c,D,ee)}}}s=s.next}while(s!==d)}}catch(ee){Ie(t,t.return,ee)}}function pf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{am(t,a)}catch(s){Ie(e,e.return,s)}}}function hf(e,t,a){a.props=Fa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ie(e,t,s)}}function ys(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Ie(e,t,c)}}function An(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Ie(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Ie(e,t,c)}else a.current=null}function xf(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Ie(e,e.return,c)}}function rc(e,t,a){try{var s=e.stateNode;lb(s,e.type,a,t),s[Zt]=t}catch(c){Ie(e,e.return,c)}}function gf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wa(e.type)||e.tag===4}function ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function oc(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=$n));else if(s!==4&&(s===27&&wa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(oc(e,t,a),e=e.sibling;e!==null;)oc(e,t,a),e=e.sibling}function Lr(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&wa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Lr(e,t,a),e=e.sibling;e!==null;)Lr(e,t,a),e=e.sibling}function bf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Lt(t,s,a),t[Mt]=e,t[Zt]=a}catch(d){Ie(e,e.return,d)}}var Xn=!1,yt=!1,cc=!1,yf=typeof WeakSet=="function"?WeakSet:Set,At=null;function Bg(e,t){if(e=e.containerInfo,Rc=ni,e=Rd(e),to(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var b=0,N=-1,D=-1,Y=0,ee=0,se=e,Z=null;t:for(;;){for(var X;se!==a||c!==0&&se.nodeType!==3||(N=b+c),se!==d||s!==0&&se.nodeType!==3||(D=b+s),se.nodeType===3&&(b+=se.nodeValue.length),(X=se.firstChild)!==null;)Z=se,se=X;for(;;){if(se===e)break t;if(Z===a&&++Y===c&&(N=b),Z===d&&++ee===s&&(D=b),(X=se.nextSibling)!==null)break;se=Z,Z=se.parentNode}se=X}a=N===-1||D===-1?null:{start:N,end:D}}else a=null}a=a||{start:0,end:0}}else a=null;for(Mc={focusedElem:e,selectionRange:a},ni=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,s=a.stateNode;try{var ge=Fa(a.type,c);e=s.getSnapshotBeforeUpdate(ge,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Ie(a,a.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Oc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Oc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function vf(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Jn(e,a),s&4&&bs(5,a);break;case 1:if(Jn(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){Ie(a,a.return,b)}else{var c=Fa(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ie(a,a.return,b)}}s&64&&pf(a),s&512&&ys(a,a.return);break;case 3:if(Jn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{am(e,t)}catch(b){Ie(a,a.return,b)}}break;case 27:t===null&&s&4&&bf(a);case 26:case 5:Jn(e,a),t===null&&s&4&&xf(a),s&512&&ys(a,a.return);break;case 12:Jn(e,a);break;case 31:Jn(e,a),s&4&&Nf(e,a);break;case 13:Jn(e,a),s&4&&Sf(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Vg.bind(null,a),mb(e,a))));break;case 22:if(s=a.memoizedState!==null||Xn,!s){t=t!==null&&t.memoizedState!==null||yt,c=Xn;var d=yt;Xn=s,(yt=t)&&!d?Kn(e,a,(a.subtreeFlags&8772)!==0):Jn(e,a),Xn=c,yt=d}break;case 30:break;default:Jn(e,a)}}function jf(e){var t=e.alternate;t!==null&&(e.alternate=null,jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$i(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Qt=!1;function In(e,t,a){for(a=a.child;a!==null;)wf(e,t,a),a=a.sibling}function wf(e,t,a){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(et,a)}catch{}switch(a.tag){case 26:yt||An(a,t),In(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:yt||An(a,t);var s=rt,c=Qt;wa(a.type)&&(rt=a.stateNode,Qt=!1),In(e,t,a),Es(a.stateNode),rt=s,Qt=c;break;case 5:yt||An(a,t);case 6:if(s=rt,c=Qt,rt=null,In(e,t,a),rt=s,Qt=c,rt!==null)if(Qt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode)}catch(d){Ie(a,t,d)}else try{rt.removeChild(a.stateNode)}catch(d){Ie(a,t,d)}break;case 18:rt!==null&&(Qt?(e=rt,pp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Bl(e)):pp(rt,a.stateNode));break;case 4:s=rt,c=Qt,rt=a.stateNode.containerInfo,Qt=!0,In(e,t,a),rt=s,Qt=c;break;case 0:case 11:case 14:case 15:ha(2,a,t),yt||ha(4,a,t),In(e,t,a);break;case 1:yt||(An(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&hf(a,t,s)),In(e,t,a);break;case 21:In(e,t,a);break;case 22:yt=(s=yt)||a.memoizedState!==null,In(e,t,a),yt=s;break;default:In(e,t,a)}}function Nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bl(e)}catch(a){Ie(t,t.return,a)}}}function Sf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bl(e)}catch(a){Ie(t,t.return,a)}}function $g(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yf),t;default:throw Error(o(435,e.tag))}}function zr(e,t){var a=$g(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=Qg.bind(null,e,s);s.then(c,c)}})}function Xt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],d=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(wa(N.type)){rt=N.stateNode,Qt=!1;break e}break;case 5:rt=N.stateNode,Qt=!1;break e;case 3:case 4:rt=N.stateNode.containerInfo,Qt=!0;break e}N=N.return}if(rt===null)throw Error(o(160));wf(d,b,c),rt=null,Qt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kf(t,e),t=t.sibling}var jn=null;function kf(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(t,e),It(e),s&4&&(ha(3,e,e.return),bs(3,e),ha(5,e,e.return));break;case 1:Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),s&64&&Xn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=jn;if(Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),s&4){var d=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Vl]||d[Mt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(s),c.head.insertBefore(d,c.querySelector("head > title"))),Lt(d,s,a),d[Mt]=e,Et(d),s=d;break e;case"link":var b=kp("link","href",c).get(s+(a.href||""));if(b){for(var N=0;N<b.length;N++)if(d=b[N],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(N,1);break t}}d=c.createElement(s),Lt(d,s,a),c.head.appendChild(d);break;case"meta":if(b=kp("meta","content",c).get(s+(a.content||""))){for(N=0;N<b.length;N++)if(d=b[N],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(N,1);break t}}d=c.createElement(s),Lt(d,s,a),c.head.appendChild(d);break;default:throw Error(o(468,s))}d[Mt]=e,Et(d),s=d}e.stateNode=s}else Cp(c,e.type,e.stateNode);else e.stateNode=Sp(c,s,e.memoizedProps);else d!==s?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,s===null?Cp(c,e.type,e.stateNode):Sp(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&rc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),a!==null&&s&4&&rc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Xt(t,e),It(e),s&512&&(yt||a===null||An(a,a.return)),e.flags&32){c=e.stateNode;try{rl(c,"")}catch(ge){Ie(e,e.return,ge)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,rc(e,c,a!==null?a.memoizedProps:c)),s&1024&&(cc=!0);break;case 6:if(Xt(t,e),It(e),s&4){if(e.stateNode===null)throw Error(o(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(ge){Ie(e,e.return,ge)}}break;case 3:if(Pr=null,c=jn,jn=Jr(t.containerInfo),Xt(t,e),jn=c,It(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Bl(t.containerInfo)}catch(ge){Ie(e,e.return,ge)}cc&&(cc=!1,Cf(e));break;case 4:s=jn,jn=Jr(e.stateNode.containerInfo),Xt(t,e),It(e),jn=s;break;case 12:Xt(t,e),It(e);break;case 31:Xt(t,e),It(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zr(e,s)));break;case 13:Xt(t,e),It(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&($r=Ze()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zr(e,s)));break;case 22:c=e.memoizedState!==null;var D=a!==null&&a.memoizedState!==null,Y=Xn,ee=yt;if(Xn=Y||c,yt=ee||D,Xt(t,e),yt=ee,Xn=Y,It(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||D||Xn||yt||Za(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){D=a=t;try{if(d=D.stateNode,c)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=D.stateNode;var se=D.memoizedProps.style,Z=se!=null&&se.hasOwnProperty("display")?se.display:null;N.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ge){Ie(D,D.return,ge)}}}else if(t.tag===6){if(a===null){D=t;try{D.stateNode.nodeValue=c?"":D.memoizedProps}catch(ge){Ie(D,D.return,ge)}}}else if(t.tag===18){if(a===null){D=t;try{var X=D.stateNode;c?hp(X,!0):hp(D.stateNode,!1)}catch(ge){Ie(D,D.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,zr(e,a))));break;case 19:Xt(t,e),It(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zr(e,s)));break;case 30:break;case 21:break;default:Xt(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(gf(s)){a=s;break}s=s.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var c=a.stateNode,d=ic(e);Lr(e,d,c);break;case 5:var b=a.stateNode;a.flags&32&&(rl(b,""),a.flags&=-33);var N=ic(e);Lr(e,N,b);break;case 3:case 4:var D=a.stateNode.containerInfo,Y=ic(e);oc(e,Y,D);break;default:throw Error(o(161))}}catch(ee){Ie(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Jn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vf(e,t.alternate,t),t=t.sibling}function Za(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ha(4,t,t.return),Za(t);break;case 1:An(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&hf(t,t.return,a),Za(t);break;case 27:Es(t.stateNode);case 26:case 5:An(t,t.return),Za(t);break;case 22:t.memoizedState===null&&Za(t);break;case 30:Za(t);break;default:Za(t)}e=e.sibling}}function Kn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,b=d.flags;switch(d.tag){case 0:case 11:case 15:Kn(c,d,a),bs(4,d);break;case 1:if(Kn(c,d,a),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){Ie(s,s.return,Y)}if(s=d,c=s.updateQueue,c!==null){var N=s.stateNode;try{var D=c.shared.hiddenCallbacks;if(D!==null)for(c.shared.hiddenCallbacks=null,c=0;c<D.length;c++)nm(D[c],N)}catch(Y){Ie(s,s.return,Y)}}a&&b&64&&pf(d),ys(d,d.return);break;case 27:bf(d);case 26:case 5:Kn(c,d,a),a&&s===null&&b&4&&xf(d),ys(d,d.return);break;case 12:Kn(c,d,a);break;case 31:Kn(c,d,a),a&&b&4&&Nf(c,d);break;case 13:Kn(c,d,a),a&&b&4&&Sf(c,d);break;case 22:d.memoizedState===null&&Kn(c,d,a),ys(d,d.return);break;case 30:break;default:Kn(c,d,a)}t=t.sibling}}function uc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ss(a))}function dc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e))}function wn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tf(e,t,a,s),t=t.sibling}function Tf(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:wn(e,t,a,s),c&2048&&bs(9,t);break;case 1:wn(e,t,a,s);break;case 3:wn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e)));break;case 12:if(c&2048){wn(e,t,a,s),e=t.stateNode;try{var d=t.memoizedProps,b=d.id,N=d.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Ie(t,t.return,D)}}else wn(e,t,a,s);break;case 31:wn(e,t,a,s);break;case 13:wn(e,t,a,s);break;case 23:break;case 22:d=t.stateNode,b=t.alternate,t.memoizedState!==null?d._visibility&2?wn(e,t,a,s):vs(e,t):d._visibility&2?wn(e,t,a,s):(d._visibility|=2,Cl(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&uc(b,t);break;case 24:wn(e,t,a,s),c&2048&&dc(t.alternate,t);break;default:wn(e,t,a,s)}}function Cl(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,b=t,N=a,D=s,Y=b.flags;switch(b.tag){case 0:case 11:case 15:Cl(d,b,N,D,c),bs(8,b);break;case 23:break;case 22:var ee=b.stateNode;b.memoizedState!==null?ee._visibility&2?Cl(d,b,N,D,c):vs(d,b):(ee._visibility|=2,Cl(d,b,N,D,c)),c&&Y&2048&&uc(b.alternate,b);break;case 24:Cl(d,b,N,D,c),c&&Y&2048&&dc(b.alternate,b);break;default:Cl(d,b,N,D,c)}t=t.sibling}}function vs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:vs(a,s),c&2048&&uc(s.alternate,s);break;case 24:vs(a,s),c&2048&&dc(s.alternate,s);break;default:vs(a,s)}t=t.sibling}}var js=8192;function Tl(e,t,a){if(e.subtreeFlags&js)for(e=e.child;e!==null;)Ef(e,t,a),e=e.sibling}function Ef(e,t,a){switch(e.tag){case 26:Tl(e,t,a),e.flags&js&&e.memoizedState!==null&&Sb(a,jn,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,a);break;case 3:case 4:var s=jn;jn=Jr(e.stateNode.containerInfo),Tl(e,t,a),jn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=js,js=16777216,Tl(e,t,a),js=s):Tl(e,t,a));break;default:Tl(e,t,a)}}function Af(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ws(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];At=s,Mf(s,e)}Af(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rf(e),e=e.sibling}function Rf(e){switch(e.tag){case 0:case 11:case 15:ws(e),e.flags&2048&&ha(9,e,e.return);break;case 3:ws(e);break;case 12:ws(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Br(e)):ws(e);break;default:ws(e)}}function Br(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];At=s,Mf(s,e)}Af(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ha(8,t,t.return),Br(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Br(t));break;default:Br(t)}e=e.sibling}}function Mf(e,t){for(;At!==null;){var a=At;switch(a.tag){case 0:case 11:case 15:ha(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ss(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,At=s;else e:for(a=e;At!==null;){s=At;var c=s.sibling,d=s.return;if(jf(s),s===a){At=null;break e}if(c!==null){c.return=d,At=c;break e}At=d}}}var Ug={getCacheForType:function(e){var t=_t(xt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return _t(xt).controller.signal}},Hg=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,Ae=null,Me=0,Xe=0,nn=null,xa=!1,El=!1,mc=!1,Pn=0,ut=0,ga=0,Va=0,fc=0,an=0,Al=0,Ns=null,Jt=null,pc=!1,$r=0,Df=0,Ur=1/0,Hr=null,ba=null,St=0,ya=null,Rl=null,Wn=0,hc=0,xc=null,_f=null,Ss=0,gc=null;function ln(){return(Ve&2)!==0&&Me!==0?Me&-Me:U.T!==null?Nc():Xu()}function Of(){if(an===0)if((Me&536870912)===0||Le){var e=zn;zn<<=1,(zn&3932160)===0&&(zn=262144),an=e}else an=536870912;return e=en.current,e!==null&&(e.flags|=32),an}function Kt(e,t,a){(e===We&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(Ml(e,0),va(e,Me,an,!1)),Rt(e,a),((Ve&2)===0||e!==We)&&(e===We&&((Ve&2)===0&&(Va|=a),ut===4&&va(e,Me,an,!1)),Rn(e))}function Lf(e,t,a){if((Ve&6)!==0)throw Error(o(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||He(e,t),c=s?Yg(e,t):yc(e,t,!0),d=s;do{if(c===0){El&&!s&&va(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!Gg(a)){c=yc(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var N=e;c=Ns;var D=N.current.memoizedState.isDehydrated;if(D&&(Ml(N,b).flags|=256),b=yc(N,b,!1),b!==2){if(mc&&!D){N.errorRecoveryDisabledLanes|=d,Va|=d,c=4;break e}d=Jt,Jt=c,d!==null&&(Jt===null?Jt=d:Jt.push.apply(Jt,d))}c=b}if(d=!1,c!==2)continue}}if(c===1){Ml(e,0),va(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:va(s,t,an,!xa);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=$r+300-Ze(),10<c)){if(va(s,t,an,!xa),ke(s,0,!0)!==0)break e;Wn=t,s.timeoutHandle=mp(zf.bind(null,s,a,Jt,Hr,pc,t,an,Va,Al,xa,d,"Throttled",-0,0),c);break e}zf(s,a,Jt,Hr,pc,t,an,Va,Al,xa,d,null,-0,0)}}break}while(!0);Rn(e)}function zf(e,t,a,s,c,d,b,N,D,Y,ee,se,Z,X){if(e.timeoutHandle=-1,se=t.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},Ef(t,d,se);var ge=(d&62914560)===d?$r-Ze():(d&4194048)===d?Df-Ze():0;if(ge=kb(se,ge),ge!==null){Wn=d,e.cancelPendingCommit=ge(Ff.bind(null,e,t,d,a,s,c,b,N,D,ee,se,null,Z,X)),va(e,d,b,!Y);return}}Ff(e,t,d,a,s,c,b,N,D)}function Gg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],d=c.getSnapshot;c=c.value;try{if(!Pt(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function va(e,t,a,s){t&=~fc,t&=~Va,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-tt(c),b=1<<d;s[d]=-1,c&=~b}a!==0&&Pa(e,a,t)}function Gr(){return(Ve&6)===0?(ks(0),!1):!0}function bc(){if(Ae!==null){if(Xe===0)var e=Ae.return;else e=Ae,qn=Ba=null,Oo(e),jl=null,is=0,e=Ae;for(;e!==null;)ff(e.alternate,e),e=e.return;Ae=null}}function Ml(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,ib(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Wn=0,bc(),We=e,Ae=a=Hn(e.current,null),Me=t,Xe=0,nn=null,xa=!1,El=He(e,t),mc=!1,Al=an=fc=Va=ga=ut=0,Jt=Ns=null,pc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-tt(s),d=1<<c;t|=e[c],s&=~d}return Pn=t,or(),a}function Bf(e,t){Te=null,U.H=hs,t===vl||t===xr?(t=Pd(),Xe=3):t===wo?(t=Pd(),Xe=4):Xe=t===Jo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,nn=t,Ae===null&&(ut=1,Rr(e,mn(t,e.current)))}function $f(){var e=en.current;return e===null?!0:(Me&4194048)===Me?xn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===xn:!1}function Uf(){var e=U.H;return U.H=hs,e===null?hs:e}function Hf(){var e=U.A;return U.A=Ug,e}function qr(){ut=4,xa||(Me&4194048)!==Me&&en.current!==null||(El=!0),(ga&134217727)===0&&(Va&134217727)===0||We===null||va(We,Me,an,!1)}function yc(e,t,a){var s=Ve;Ve|=2;var c=Uf(),d=Hf();(We!==e||Me!==t)&&(Hr=null,Ml(e,t)),t=!1;var b=ut;e:do try{if(Xe!==0&&Ae!==null){var N=Ae,D=nn;switch(Xe){case 8:bc(),b=6;break e;case 3:case 2:case 9:case 6:en.current===null&&(t=!0);var Y=Xe;if(Xe=0,nn=null,Dl(e,N,D,Y),a&&El){b=0;break e}break;default:Y=Xe,Xe=0,nn=null,Dl(e,N,D,Y)}}qg(),b=ut;break}catch(ee){Bf(e,ee)}while(!0);return t&&e.shellSuspendCounter++,qn=Ba=null,Ve=s,U.H=c,U.A=d,Ae===null&&(We=null,Me=0,or()),b}function qg(){for(;Ae!==null;)Gf(Ae)}function Yg(e,t){var a=Ve;Ve|=2;var s=Uf(),c=Hf();We!==e||Me!==t?(Hr=null,Ur=Ze()+500,Ml(e,t)):El=He(e,t);e:do try{if(Xe!==0&&Ae!==null){t=Ae;var d=nn;t:switch(Xe){case 1:Xe=0,nn=null,Dl(e,t,d,1);break;case 2:case 9:if(Jd(d)){Xe=0,nn=null,qf(t);break}t=function(){Xe!==2&&Xe!==9||We!==e||(Xe=7),Rn(e)},d.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Jd(d)?(Xe=0,nn=null,qf(t)):(Xe=0,nn=null,Dl(e,t,d,7));break;case 5:var b=null;switch(Ae.tag){case 26:b=Ae.memoizedState;case 5:case 27:var N=Ae;if(b?Tp(b):N.stateNode.complete){Xe=0,nn=null;var D=N.sibling;if(D!==null)Ae=D;else{var Y=N.return;Y!==null?(Ae=Y,Yr(Y)):Ae=null}break t}}Xe=0,nn=null,Dl(e,t,d,5);break;case 6:Xe=0,nn=null,Dl(e,t,d,6);break;case 8:bc(),ut=6;break e;default:throw Error(o(462))}}Fg();break}catch(ee){Bf(e,ee)}while(!0);return qn=Ba=null,U.H=s,U.A=c,Ve=a,Ae!==null?0:(We=null,Me=0,or(),ut)}function Fg(){for(;Ae!==null&&!jt();)Gf(Ae)}function Gf(e){var t=df(e.alternate,e,Pn);e.memoizedProps=e.pendingProps,t===null?Yr(e):Ae=t}function qf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=lf(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=lf(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Oo(t);default:ff(a,t),t=Ae=Ud(t,Pn),t=df(a,t,Pn)}e.memoizedProps=e.pendingProps,t===null?Yr(e):Ae=t}function Dl(e,t,a,s){qn=Ba=null,Oo(t),jl=null,is=0;var c=t.return;try{if(Dg(e,c,t,a,Me)){ut=1,Rr(e,mn(a,e.current)),Ae=null;return}}catch(d){if(c!==null)throw Ae=c,d;ut=1,Rr(e,mn(a,e.current)),Ae=null;return}t.flags&32768?(Le||s===1?e=!0:El||(Me&536870912)!==0?e=!1:(xa=e=!0,(s===2||s===9||s===3||s===6)&&(s=en.current,s!==null&&s.tag===13&&(s.flags|=16384))),Yf(t,e)):Yr(t)}function Yr(e){var t=e;do{if((t.flags&32768)!==0){Yf(t,xa);return}e=t.return;var a=Lg(t.alternate,t,Pn);if(a!==null){Ae=a;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ut===0&&(ut=5)}function Yf(e,t){do{var a=zg(e.alternate,e);if(a!==null){a.flags&=32767,Ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=a}while(e!==null);ut=6,Ae=null}function Ff(e,t,a,s,c,d,b,N,D){e.cancelPendingCommit=null;do Fr();while(St!==0);if((Ve&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(d=t.lanes|t.childLanes,d|=ro,Tt(e,a,d,b,N,D),e===We&&(Ae=We=null,Me=0),Rl=t,ya=e,Wn=a,hc=d,xc=c,_f=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xg(ce,function(){return If(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,c=z.p,z.p=2,b=Ve,Ve|=4;try{Bg(e,t,a)}finally{Ve=b,z.p=c,U.T=s}}St=1,Zf(),Vf(),Qf()}}function Zf(){if(St===1){St=0;var e=ya,t=Rl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var s=z.p;z.p=2;var c=Ve;Ve|=4;try{kf(t,e);var d=Mc,b=Rd(e.containerInfo),N=d.focusedElem,D=d.selectionRange;if(b!==N&&N&&N.ownerDocument&&Ad(N.ownerDocument.documentElement,N)){if(D!==null&&to(N)){var Y=D.start,ee=D.end;if(ee===void 0&&(ee=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ee,N.value.length);else{var se=N.ownerDocument||document,Z=se&&se.defaultView||window;if(Z.getSelection){var X=Z.getSelection(),ge=N.textContent.length,Ne=Math.min(D.start,ge),Pe=D.end===void 0?Ne:Math.min(D.end,ge);!X.extend&&Ne>Pe&&(b=Pe,Pe=Ne,Ne=b);var B=Ed(N,Ne),L=Ed(N,Pe);if(B&&L&&(X.rangeCount!==1||X.anchorNode!==B.node||X.anchorOffset!==B.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var q=se.createRange();q.setStart(B.node,B.offset),X.removeAllRanges(),Ne>Pe?(X.addRange(q),X.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),X.addRange(q))}}}}for(se=[],X=N;X=X.parentNode;)X.nodeType===1&&se.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var le=se[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}ni=!!Rc,Mc=Rc=null}finally{Ve=c,z.p=s,U.T=a}}e.current=t,St=2}}function Vf(){if(St===2){St=0;var e=ya,t=Rl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var s=z.p;z.p=2;var c=Ve;Ve|=4;try{vf(e,t.alternate,t)}finally{Ve=c,z.p=s,U.T=a}}St=3}}function Qf(){if(St===4||St===3){St=0,st();var e=ya,t=Rl,a=Wn,s=_f;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,Rl=ya=null,Xf(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ba=null),zi(a),t=t.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(et,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=U.T,c=z.p,z.p=2,U.T=null;try{for(var d=e.onRecoverableError,b=0;b<s.length;b++){var N=s[b];d(N.value,{componentStack:N.stack})}}finally{U.T=t,z.p=c}}(Wn&3)!==0&&Fr(),Rn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===gc?Ss++:(Ss=0,gc=e):Ss=0,ks(0)}}function Xf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ss(t)))}function Fr(){return Zf(),Vf(),Qf(),If()}function If(){if(St!==5)return!1;var e=ya,t=hc;hc=0;var a=zi(Wn),s=U.T,c=z.p;try{z.p=32>a?32:a,U.T=null,a=xc,xc=null;var d=ya,b=Wn;if(St=0,Rl=ya=null,Wn=0,(Ve&6)!==0)throw Error(o(331));var N=Ve;if(Ve|=4,Rf(d.current),Tf(d,d.current,b,a),Ve=N,ks(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(et,d)}catch{}return!0}finally{z.p=c,U.T=s,Xf(e,t)}}function Jf(e,t,a){t=mn(a,t),t=Io(e.stateNode,t,2),e=ma(e,t,2),e!==null&&(Rt(e,2),Rn(e))}function Ie(e,t,a){if(e.tag===3)Jf(e,e,a);else for(;t!==null;){if(t.tag===3){Jf(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ba===null||!ba.has(s))){e=mn(a,e),a=Jm(2),s=ma(t,a,2),s!==null&&(Km(a,s,t,e),Rt(s,2),Rn(s));break}}t=t.return}}function vc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new Hg;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(mc=!0,c.add(a),e=Zg.bind(null,e,t,a),t.then(e,e))}function Zg(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,We===e&&(Me&a)===a&&(ut===4||ut===3&&(Me&62914560)===Me&&300>Ze()-$r?(Ve&2)===0&&Ml(e,0):fc|=a,Al===Me&&(Al=0)),Rn(e)}function Kf(e,t){t===0&&(t=Nt()),e=Oa(e,t),e!==null&&(Rt(e,t),Rn(e))}function Vg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Kf(e,a)}function Qg(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(t),Kf(e,a)}function Xg(e,t){return ze(e,t)}var Zr=null,_l=null,jc=!1,Vr=!1,wc=!1,ja=0;function Rn(e){e!==_l&&e.next===null&&(_l===null?Zr=_l=e:_l=_l.next=e),Vr=!0,jc||(jc=!0,Jg())}function ks(e,t){if(!wc&&Vr){wc=!0;do for(var a=!1,s=Zr;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var b=s.suspendedLanes,N=s.pingedLanes;d=(1<<31-tt(42|e)+1)-1,d&=c&~(b&~N),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,tp(s,d))}else d=Me,d=ke(s,s===We?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||He(s,d)||(a=!0,tp(s,d));s=s.next}while(a);wc=!1}}function Ig(){Pf()}function Pf(){Vr=jc=!1;var e=0;ja!==0&&rb()&&(e=ja);for(var t=Ze(),a=null,s=Zr;s!==null;){var c=s.next,d=Wf(s,t);d===0?(s.next=null,a===null?Zr=c:a.next=c,c===null&&(_l=a)):(a=s,(e!==0||(d&3)!==0)&&(Vr=!0)),s=c}St!==0&&St!==5||ks(e),ja!==0&&(ja=0)}function Wf(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-tt(d),N=1<<b,D=c[b];D===-1?((N&a)===0||(N&s)!==0)&&(c[b]=wt(N,t)):D<=t&&(e.expiredLanes|=N),d&=~N}if(t=We,a=Me,a=ke(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ot(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||He(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&ot(s),zi(a)){case 2:case 8:a=ve;break;case 32:a=ce;break;case 268435456:a=_e;break;default:a=ce}return s=ep.bind(null,e),a=ze(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&ot(s),e.callbackPriority=2,e.callbackNode=null,2}function ep(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Fr()&&e.callbackNode!==a)return null;var s=Me;return s=ke(e,e===We?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Lf(e,s,t),Wf(e,Ze()),e.callbackNode!=null&&e.callbackNode===a?ep.bind(null,e):null)}function tp(e,t){if(Fr())return null;Lf(e,t,!0)}function Jg(){ob(function(){(Ve&6)!==0?ze(we,Ig):Pf()})}function Nc(){if(ja===0){var e=bl;e===0&&(e=Ln,Ln<<=1,(Ln&261888)===0&&(Ln=256)),ja=e}return ja}function np(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:er(""+e)}function ap(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Kg(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var d=np((c[Zt]||null).action),b=s.submitter;b&&(t=(t=b[Zt]||null)?np(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var N=new lr("action","action",null,s,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ja!==0){var D=b?ap(c,b):new FormData(c);Yo(a,{pending:!0,data:D,method:c.method,action:d},null,D)}}else typeof d=="function"&&(N.preventDefault(),D=b?ap(c,b):new FormData(c),Yo(a,{pending:!0,data:D,method:c.method,action:d},d,D))},currentTarget:c}]})}}for(var Sc=0;Sc<so.length;Sc++){var kc=so[Sc],Pg=kc.toLowerCase(),Wg=kc[0].toUpperCase()+kc.slice(1);vn(Pg,"on"+Wg)}vn(_d,"onAnimationEnd"),vn(Od,"onAnimationIteration"),vn(Ld,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(hg,"onTransitionRun"),vn(xg,"onTransitionStart"),vn(gg,"onTransitionCancel"),vn(zd,"onTransitionEnd"),ll("onMouseEnter",["mouseout","mouseover"]),ll("onMouseLeave",["mouseout","mouseover"]),ll("onPointerEnter",["pointerout","pointerover"]),ll("onPointerLeave",["pointerout","pointerover"]),Ra("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ra("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ra("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ra("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ra("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ra("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cs="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(" "),eb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cs));function lp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var b=s.length-1;0<=b;b--){var N=s[b],D=N.instance,Y=N.currentTarget;if(N=N.listener,D!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=Y;try{d(c)}catch(ee){ir(ee)}c.currentTarget=null,d=D}else for(b=0;b<s.length;b++){if(N=s[b],D=N.instance,Y=N.currentTarget,N=N.listener,D!==d&&c.isPropagationStopped())break e;d=N,c.currentTarget=Y;try{d(c)}catch(ee){ir(ee)}c.currentTarget=null,d=D}}}}function Re(e,t){var a=t[Bi];a===void 0&&(a=t[Bi]=new Set);var s=e+"__bubble";a.has(s)||(sp(t,e,2,!1),a.add(s))}function Cc(e,t,a){var s=0;t&&(s|=4),sp(a,e,s,t)}var Qr="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[Qr]){e[Qr]=!0,Ku.forEach(function(a){a!=="selectionchange"&&(eb.has(a)||Cc(a,!1,e),Cc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qr]||(t[Qr]=!0,Cc("selectionchange",!1,t))}}function sp(e,t,a,s){switch(Op(t)){case 2:var c=Eb;break;case 8:c=Ab;break;default:c=qc}a=c.bind(null,t,a,e),c=void 0,!Vi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Ec(e,t,a,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var N=s.stateNode.containerInfo;if(N===c)break;if(b===4)for(b=s.return;b!==null;){var D=b.tag;if((D===3||D===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;N!==null;){if(b=tl(N),b===null)return;if(D=b.tag,D===5||D===6||D===26||D===27){s=d=b;continue e}N=N.parentNode}}s=s.return}cd(function(){var Y=d,ee=Fi(a),se=[];e:{var Z=Bd.get(e);if(Z!==void 0){var X=lr,ge=e;switch(e){case"keypress":if(nr(a)===0)break e;case"keydown":case"keyup":X=Qx;break;case"focusin":ge="focus",X=Ji;break;case"focusout":ge="blur",X=Ji;break;case"beforeblur":case"afterblur":X=Ji;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Lx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Jx;break;case _d:case Od:case Ld:X=$x;break;case zd:X=Px;break;case"scroll":case"scrollend":X=_x;break;case"wheel":X=eg;break;case"copy":case"cut":case"paste":X=Hx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=pd;break;case"toggle":case"beforetoggle":X=ng}var Ne=(t&4)!==0,Pe=!Ne&&(e==="scroll"||e==="scrollend"),B=Ne?Z!==null?Z+"Capture":null:Z;Ne=[];for(var L=Y,q;L!==null;){var le=L;if(q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||q===null||B===null||(le=Xl(L,B),le!=null&&Ne.push(Ts(L,le,q))),Pe)break;L=L.return}0<Ne.length&&(Z=new X(Z,ge,null,a,ee),se.push({event:Z,listeners:Ne}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",Z&&a!==Yi&&(ge=a.relatedTarget||a.fromElement)&&(tl(ge)||ge[el]))break e;if((X||Z)&&(Z=ee.window===ee?ee:(Z=ee.ownerDocument)?Z.defaultView||Z.parentWindow:window,X?(ge=a.relatedTarget||a.toElement,X=Y,ge=ge?tl(ge):null,ge!==null&&(Pe=m(ge),Ne=ge.tag,ge!==Pe||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(X=null,ge=Y),X!==ge)){if(Ne=md,le="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=pd,le="onPointerLeave",B="onPointerEnter",L="pointer"),Pe=X==null?Z:Ql(X),q=ge==null?Z:Ql(ge),Z=new Ne(le,L+"leave",X,a,ee),Z.target=Pe,Z.relatedTarget=q,le=null,tl(ee)===Y&&(Ne=new Ne(B,L+"enter",ge,a,ee),Ne.target=q,Ne.relatedTarget=Pe,le=Ne),Pe=le,X&&ge)t:{for(Ne=tb,B=X,L=ge,q=0,le=B;le;le=Ne(le))q++;le=0;for(var je=L;je;je=Ne(je))le++;for(;0<q-le;)B=Ne(B),q--;for(;0<le-q;)L=Ne(L),le--;for(;q--;){if(B===L||L!==null&&B===L.alternate){Ne=B;break t}B=Ne(B),L=Ne(L)}Ne=null}else Ne=null;X!==null&&rp(se,Z,X,Ne,!1),ge!==null&&Pe!==null&&rp(se,Pe,ge,Ne,!0)}}e:{if(Z=Y?Ql(Y):window,X=Z.nodeName&&Z.nodeName.toLowerCase(),X==="select"||X==="input"&&Z.type==="file")var Ge=wd;else if(vd(Z))if(Nd)Ge=mg;else{Ge=ug;var ye=cg}else X=Z.nodeName,!X||X.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?Y&&qi(Y.elementType)&&(Ge=wd):Ge=dg;if(Ge&&(Ge=Ge(e,Y))){jd(se,Ge,a,ee);break e}ye&&ye(e,Z,Y),e==="focusout"&&Y&&Z.type==="number"&&Y.memoizedProps.value!=null&&Gi(Z,"number",Z.value)}switch(ye=Y?Ql(Y):window,e){case"focusin":(vd(ye)||ye.contentEditable==="true")&&(ul=ye,no=Y,ns=null);break;case"focusout":ns=no=ul=null;break;case"mousedown":ao=!0;break;case"contextmenu":case"mouseup":case"dragend":ao=!1,Md(se,a,ee);break;case"selectionchange":if(pg)break;case"keydown":case"keyup":Md(se,a,ee)}var Ee;if(Pi)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else cl?bd(e,a)&&(De="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(De="onCompositionStart");De&&(hd&&a.locale!=="ko"&&(cl||De!=="onCompositionStart"?De==="onCompositionEnd"&&cl&&(Ee=ud()):(sa=ee,Qi="value"in sa?sa.value:sa.textContent,cl=!0)),ye=Xr(Y,De),0<ye.length&&(De=new fd(De,e,null,a,ee),se.push({event:De,listeners:ye}),Ee?De.data=Ee:(Ee=yd(a),Ee!==null&&(De.data=Ee)))),(Ee=lg?sg(e,a):rg(e,a))&&(De=Xr(Y,"onBeforeInput"),0<De.length&&(ye=new fd("onBeforeInput","beforeinput",null,a,ee),se.push({event:ye,listeners:De}),ye.data=Ee)),Kg(se,e,Y,a,ee)}lp(se,t)})}function Ts(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Xr(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Xl(e,a),c!=null&&s.unshift(Ts(e,c,d)),c=Xl(e,t),c!=null&&s.push(Ts(e,c,d))),e.tag===3)return s;e=e.return}return[]}function tb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,a,s,c){for(var d=t._reactName,b=[];a!==null&&a!==s;){var N=a,D=N.alternate,Y=N.stateNode;if(N=N.tag,D!==null&&D===s)break;N!==5&&N!==26&&N!==27||Y===null||(D=Y,c?(Y=Xl(a,d),Y!=null&&b.unshift(Ts(a,Y,D))):c||(Y=Xl(a,d),Y!=null&&b.push(Ts(a,Y,D)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var nb=/\r\n?/g,ab=/\u0000|\uFFFD/g;function ip(e){return(typeof e=="string"?e:""+e).replace(nb,`
|
|
56
|
+
`).replace(ab,"")}function op(e,t){return t=ip(t),ip(e)===t}function Ke(e,t,a,s,c,d){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||rl(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&rl(e,""+s);break;case"className":Ps(e,"class",s);break;case"tabIndex":Ps(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ps(e,a,s);break;case"style":id(e,s,d);break;case"data":if(t!=="object"){Ps(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=er(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 d=="function"&&(a==="formAction"?(t!=="input"&&Ke(e,t,"name",c.name,c,null),Ke(e,t,"formEncType",c.formEncType,c,null),Ke(e,t,"formMethod",c.formMethod,c,null),Ke(e,t,"formTarget",c.formTarget,c,null)):(Ke(e,t,"encType",c.encType,c,null),Ke(e,t,"method",c.method,c,null),Ke(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=er(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=$n);break;case"onScroll":s!=null&&Re("scroll",e);break;case"onScrollEnd":s!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=er(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Re("beforetoggle",e),Re("toggle",e),Ks(e,"popover",s);break;case"xlinkActuate":Bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Bn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Bn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Bn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Bn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ks(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Mx.get(a)||a,Ks(e,a,s))}}function Ac(e,t,a,s,c,d){switch(a){case"style":id(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof s=="string"?rl(e,s):(typeof s=="number"||typeof s=="bigint")&&rl(e,""+s);break;case"onScroll":s!=null&&Re("scroll",e);break;case"onScrollEnd":s!=null&&Re("scrollend",e);break;case"onClick":s!=null&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[Zt]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof s=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Ks(e,a,s)}}}function Lt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var s=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var b=a[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,d,b,a,null)}}c&&Ke(e,t,"srcSet",a.srcSet,a,null),s&&Ke(e,t,"src",a.src,a,null);return;case"input":Re("invalid",e);var N=d=b=c=null,D=null,Y=null;for(s in a)if(a.hasOwnProperty(s)){var ee=a[s];if(ee!=null)switch(s){case"name":c=ee;break;case"type":b=ee;break;case"checked":D=ee;break;case"defaultChecked":Y=ee;break;case"value":d=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,t));break;default:Ke(e,t,s,ee,a,null)}}ad(e,d,N,D,Y,b,c,!1);return;case"select":Re("invalid",e),s=b=d=null;for(c in a)if(a.hasOwnProperty(c)&&(N=a[c],N!=null))switch(c){case"value":d=N;break;case"defaultValue":b=N;break;case"multiple":s=N;default:Ke(e,t,c,N,a,null)}t=d,a=b,e.multiple=!!s,t!=null?sl(e,!!s,t,!1):a!=null&&sl(e,!!s,a,!0);return;case"textarea":Re("invalid",e),d=c=s=null;for(b in a)if(a.hasOwnProperty(b)&&(N=a[b],N!=null))switch(b){case"value":s=N;break;case"defaultValue":c=N;break;case"children":d=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:Ke(e,t,b,N,a,null)}sd(e,s,c,d);return;case"option":for(D in a)if(a.hasOwnProperty(D)&&(s=a[D],s!=null))switch(D){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ke(e,t,D,s,a,null)}return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(s=0;s<Cs.length;s++)Re(Cs[s],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in a)if(a.hasOwnProperty(Y)&&(s=a[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,Y,s,a,null)}return;default:if(qi(t)){for(ee in a)a.hasOwnProperty(ee)&&(s=a[ee],s!==void 0&&Ac(e,t,ee,s,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(s=a[N],s!=null&&Ke(e,t,N,s,a,null))}function lb(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,b=null,N=null,D=null,Y=null,ee=null;for(X in a){var se=a[X];if(a.hasOwnProperty(X)&&se!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":D=se;default:s.hasOwnProperty(X)||Ke(e,t,X,null,s,se)}}for(var Z in s){var X=s[Z];if(se=a[Z],s.hasOwnProperty(Z)&&(X!=null||se!=null))switch(Z){case"type":d=X;break;case"name":c=X;break;case"checked":Y=X;break;case"defaultChecked":ee=X;break;case"value":b=X;break;case"defaultValue":N=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:X!==se&&Ke(e,t,Z,X,s,se)}}Hi(e,b,N,D,Y,ee,d,c);return;case"select":X=b=N=Z=null;for(d in a)if(D=a[d],a.hasOwnProperty(d)&&D!=null)switch(d){case"value":break;case"multiple":X=D;default:s.hasOwnProperty(d)||Ke(e,t,d,null,s,D)}for(c in s)if(d=s[c],D=a[c],s.hasOwnProperty(c)&&(d!=null||D!=null))switch(c){case"value":Z=d;break;case"defaultValue":N=d;break;case"multiple":b=d;default:d!==D&&Ke(e,t,c,d,s,D)}t=N,a=b,s=X,Z!=null?sl(e,!!a,Z,!1):!!s!=!!a&&(t!=null?sl(e,!!a,t,!0):sl(e,!!a,a?[]:"",!1));return;case"textarea":X=Z=null;for(N in a)if(c=a[N],a.hasOwnProperty(N)&&c!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ke(e,t,N,null,s,c)}for(b in s)if(c=s[b],d=a[b],s.hasOwnProperty(b)&&(c!=null||d!=null))switch(b){case"value":Z=c;break;case"defaultValue":X=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==d&&Ke(e,t,b,c,s,d)}ld(e,Z,X);return;case"option":for(var ge in a)if(Z=a[ge],a.hasOwnProperty(ge)&&Z!=null&&!s.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:Ke(e,t,ge,null,s,Z)}for(D in s)if(Z=s[D],X=a[D],s.hasOwnProperty(D)&&Z!==X&&(Z!=null||X!=null))switch(D){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:Ke(e,t,D,Z,s,X)}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 Ne in a)Z=a[Ne],a.hasOwnProperty(Ne)&&Z!=null&&!s.hasOwnProperty(Ne)&&Ke(e,t,Ne,null,s,Z);for(Y in s)if(Z=s[Y],X=a[Y],s.hasOwnProperty(Y)&&Z!==X&&(Z!=null||X!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Ke(e,t,Y,Z,s,X)}return;default:if(qi(t)){for(var Pe in a)Z=a[Pe],a.hasOwnProperty(Pe)&&Z!==void 0&&!s.hasOwnProperty(Pe)&&Ac(e,t,Pe,void 0,s,Z);for(ee in s)Z=s[ee],X=a[ee],!s.hasOwnProperty(ee)||Z===X||Z===void 0&&X===void 0||Ac(e,t,ee,Z,s,X);return}}for(var B in a)Z=a[B],a.hasOwnProperty(B)&&Z!=null&&!s.hasOwnProperty(B)&&Ke(e,t,B,null,s,Z);for(se in s)Z=s[se],X=a[se],!s.hasOwnProperty(se)||Z===X||Z==null&&X==null||Ke(e,t,se,Z,s,X)}function cp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],d=c.transferSize,b=c.initiatorType,N=c.duration;if(d&&N&&cp(b)){for(b=0,N=c.responseEnd,s+=1;s<a.length;s++){var D=a[s],Y=D.startTime;if(Y>N)break;var ee=D.transferSize,se=D.initiatorType;ee&&cp(se)&&(D=D.responseEnd,b+=ee*(D<N?1:(N-Y)/(D-Y)))}if(--s,t+=8*(d+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Rc=null,Mc=null;function Ir(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Dc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _c=null;function rb(){var e=window.event;return e&&e.type==="popstate"?e===_c?!1:(_c=e,!0):(_c=null,!1)}var mp=typeof setTimeout=="function"?setTimeout:void 0,ib=typeof clearTimeout=="function"?clearTimeout:void 0,fp=typeof Promise=="function"?Promise:void 0,ob=typeof queueMicrotask=="function"?queueMicrotask:typeof fp<"u"?function(e){return fp.resolve(null).then(e).catch(cb)}:mp;function cb(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function pp(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),Bl(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Es(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Es(a);for(var d=a.firstChild;d;){var b=d.nextSibling,N=d.nodeName;d[Vl]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=b}}else a==="body"&&Es(e.ownerDocument.body);a=c}while(a);Bl(t)}function hp(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Oc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Oc(a),$i(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ub(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Vl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=gn(e.nextSibling),e===null)break}return null}function db(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=gn(e.nextSibling),e===null))return null;return e}function xp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gn(e.nextSibling),e===null))return null;return e}function Lc(e){return e.data==="$?"||e.data==="$~"}function zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function mb(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function gn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Bc=null;function gp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return gn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function bp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function yp(e,t,a){switch(t=Ir(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Es(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$i(e)}var bn=new Map,vp=new Set;function Jr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ea=z.d;z.d={f:fb,r:pb,D:hb,C:xb,L:gb,m:bb,X:vb,S:yb,M:jb};function fb(){var e=ea.f(),t=Gr();return e||t}function pb(e){var t=nl(e);t!==null&&t.tag===5&&t.type==="form"?zm(t):ea.r(e)}var Ol=typeof document>"u"?null:document;function jp(e,t,a){var s=Ol;if(s&&typeof t=="string"&&t){var c=un(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),vp.has(c)||(vp.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Lt(t,"link",e),Et(t),s.head.appendChild(t)))}}function hb(e){ea.D(e),jp("dns-prefetch",e,null)}function xb(e,t){ea.C(e,t),jp("preconnect",e,t)}function gb(e,t,a){ea.L(e,t,a);var s=Ol;if(s&&e&&t){var c='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+un(a.imageSizes)+'"]')):c+='[href="'+un(e)+'"]';var d=c;switch(t){case"style":d=Ll(e);break;case"script":d=zl(e)}bn.has(d)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),bn.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(As(d))||t==="script"&&s.querySelector(Rs(d))||(t=s.createElement("link"),Lt(t,"link",e),Et(t),s.head.appendChild(t)))}}function bb(e,t){ea.m(e,t);var a=Ol;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+un(s)+'"][href="'+un(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=zl(e)}if(!bn.has(d)&&(e=v({rel:"modulepreload",href:e},t),bn.set(d,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Rs(d)))return}s=a.createElement("link"),Lt(s,"link",e),Et(s),a.head.appendChild(s)}}}function yb(e,t,a){ea.S(e,t,a);var s=Ol;if(s&&e){var c=al(s).hoistableStyles,d=Ll(e);t=t||"default";var b=c.get(d);if(!b){var N={loading:0,preload:null};if(b=s.querySelector(As(d)))N.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=bn.get(d))&&$c(e,a);var D=b=s.createElement("link");Et(D),Lt(D,"link",e),D._p=new Promise(function(Y,ee){D.onload=Y,D.onerror=ee}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Kr(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:N},c.set(d,b)}}}function vb(e,t){ea.X(e,t);var a=Ol;if(a&&e){var s=al(a).hoistableScripts,c=zl(e),d=s.get(c);d||(d=a.querySelector(Rs(c)),d||(e=v({src:e,async:!0},t),(t=bn.get(c))&&Uc(e,t),d=a.createElement("script"),Et(d),Lt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function jb(e,t){ea.M(e,t);var a=Ol;if(a&&e){var s=al(a).hoistableScripts,c=zl(e),d=s.get(c);d||(d=a.querySelector(Rs(c)),d||(e=v({src:e,async:!0,type:"module"},t),(t=bn.get(c))&&Uc(e,t),d=a.createElement("script"),Et(d),Lt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function wp(e,t,a,s){var c=(c=he.current)?Jr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Ll(a.href),a=al(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ll(a.href);var d=al(c).hoistableStyles,b=d.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=c.querySelector(As(e)))&&!d._p&&(b.instance=d,b.state.loading=5),bn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},bn.set(e,a),d||wb(c,e,a,b.state))),t&&s===null)throw Error(o(528,""));return b}if(t&&s!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=zl(a),a=al(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ll(e){return'href="'+un(e)+'"'}function As(e){return'link[rel="stylesheet"]['+e+"]"}function Np(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function wb(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Lt(t,"link",a),Et(t),e.head.appendChild(t))}function zl(e){return'[src="'+un(e)+'"]'}function Rs(e){return"script[async]"+e}function Sp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+un(a.href)+'"]');if(s)return t.instance=s,Et(s),s;var c=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Et(s),Lt(s,"style",c),Kr(s,a.precedence,e),t.instance=s;case"stylesheet":c=Ll(a.href);var d=e.querySelector(As(c));if(d)return t.state.loading|=4,t.instance=d,Et(d),d;s=Np(a),(c=bn.get(c))&&$c(s,c),d=(e.ownerDocument||e).createElement("link"),Et(d);var b=d;return b._p=new Promise(function(N,D){b.onload=N,b.onerror=D}),Lt(d,"link",s),t.state.loading|=4,Kr(d,a.precedence,e),t.instance=d;case"script":return d=zl(a.src),(c=e.querySelector(Rs(d)))?(t.instance=c,Et(c),c):(s=a,(c=bn.get(d))&&(s=v({},a),Uc(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Et(c),Lt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Kr(s,a.precedence,e));return t.instance}function Kr(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,b=0;b<s.length;b++){var N=s[b];if(N.dataset.precedence===t)d=N;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pr=null;function kp(e,t,a){if(Pr===null){var s=new Map,c=Pr=new Map;c.set(a,s)}else c=Pr,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[Vl]||d[Mt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var N=s.get(b);N?N.push(d):s.set(b,[d])}}return s}function Cp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Nb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Tp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Sb(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=Ll(s.href),d=t.querySelector(As(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Wr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,Et(d);return}d=t.ownerDocument||t,s=Np(s),(c=bn.get(c))&&$c(s,c),d=d.createElement("link"),Et(d);var b=d;b._p=new Promise(function(N,D){b.onload=N,b.onerror=D}),Lt(d,"link",s),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Wr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Hc=0;function kb(e,t){return e.stylesheets&&e.count===0&&ti(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&ti(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Hc===0&&(Hc=62500*sb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ti(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Hc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ti(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ei=null;function ti(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ei=new Map,t.forEach(Cb,e),ei=null,Wr.call(e))}function Cb(e,t){if(!(t.state.loading&4)){var a=ei.get(e);if(a)var s=a.get(null);else{a=new Map,ei.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var b=c[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),s=b)}s&&a.set(null,s)}c=t.instance,b=c.getAttribute("data-precedence"),d=a.get(b)||s,d===s&&a.set(null,c),a.set(b,c),this.count++,s=Wr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Ms={$$typeof:A,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function Tb(e,t,a,s,c,d,b,N,D){this.tag=1,this.containerInfo=e,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=on(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=on(0),this.hiddenUpdates=on(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Ep(e,t,a,s,c,d,b,N,D,Y,ee,se){return e=new Tb(e,t,a,b,D,Y,ee,se,N),t=1,d===!0&&(t|=24),d=Wt(3,null,null,t),e.current=d,d.stateNode=e,t=yo(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:a,cache:t},No(d),e}function Ap(e){return e?(e=fl,e):fl}function Rp(e,t,a,s,c,d){c=Ap(c),s.context===null?s.context=c:s.pendingContext=c,s=da(t),s.payload={element:a},d=d===void 0?null:d,d!==null&&(s.callback=d),a=ma(e,s,t),a!==null&&(Kt(a,e,t),cs(a,e,t))}function Mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Gc(e,t){Mp(e,t),(e=e.alternate)&&Mp(e,t)}function Dp(e){if(e.tag===13||e.tag===31){var t=Oa(e,67108864);t!==null&&Kt(t,e,67108864),Gc(e,67108864)}}function _p(e){if(e.tag===13||e.tag===31){var t=ln();t=Li(t);var a=Oa(e,t);a!==null&&Kt(a,e,t),Gc(e,t)}}var ni=!0;function Eb(e,t,a,s){var c=U.T;U.T=null;var d=z.p;try{z.p=2,qc(e,t,a,s)}finally{z.p=d,U.T=c}}function Ab(e,t,a,s){var c=U.T;U.T=null;var d=z.p;try{z.p=8,qc(e,t,a,s)}finally{z.p=d,U.T=c}}function qc(e,t,a,s){if(ni){var c=Yc(s);if(c===null)Ec(e,t,s,ai,a),Lp(e,s);else if(Mb(c,e,t,a,s))s.stopPropagation();else if(Lp(e,s),t&4&&-1<Rb.indexOf(e)){for(;c!==null;){var d=nl(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=ie(d.pendingLanes);if(b!==0){var N=d;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var D=1<<31-tt(b);N.entanglements[1]|=D,b&=~D}Rn(d),(Ve&6)===0&&(Ur=Ze()+500,ks(0))}}break;case 31:case 13:N=Oa(d,2),N!==null&&Kt(N,d,2),Gr(),Gc(d,2)}if(d=Yc(s),d===null&&Ec(e,t,s,ai,a),d===c)break;c=d}c!==null&&s.stopPropagation()}else Ec(e,t,s,null,a)}}function Yc(e){return e=Fi(e),Fc(e)}var ai=null;function Fc(e){if(ai=null,e=tl(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=g(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ai=e,null}function Op(e){switch(e){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(I()){case we:return 2;case ve:return 8;case ce:case fe:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Zc=!1,Na=null,Sa=null,ka=null,Ds=new Map,_s=new Map,Ca=[],Rb="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 Lp(e,t){switch(e){case"focusin":case"focusout":Na=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":Ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Os(e,t,a,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=nl(t),t!==null&&Dp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Mb(e,t,a,s,c){switch(t){case"focusin":return Na=Os(Na,e,t,a,s,c),!0;case"dragenter":return Sa=Os(Sa,e,t,a,s,c),!0;case"mouseover":return ka=Os(ka,e,t,a,s,c),!0;case"pointerover":var d=c.pointerId;return Ds.set(d,Os(Ds.get(d)||null,e,t,a,s,c)),!0;case"gotpointercapture":return d=c.pointerId,_s.set(d,Os(_s.get(d)||null,e,t,a,s,c)),!0}return!1}function zp(e){var t=tl(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,Iu(e.priority,function(){_p(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Iu(e.priority,function(){_p(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function li(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Yc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Yi=s,a.target.dispatchEvent(s),Yi=null}else return t=nl(a),t!==null&&Dp(t),e.blockedOn=a,!1;t.shift()}return!0}function Bp(e,t,a){li(e)&&a.delete(t)}function Db(){Zc=!1,Na!==null&&li(Na)&&(Na=null),Sa!==null&&li(Sa)&&(Sa=null),ka!==null&&li(ka)&&(ka=null),Ds.forEach(Bp),_s.forEach(Bp)}function si(e,t){e.blockedOn===t&&(e.blockedOn=null,Zc||(Zc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Db)))}var ri=null;function $p(e){ri!==e&&(ri=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){ri===e&&(ri=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Fc(s||a)===null)continue;break}var d=nl(a);d!==null&&(e.splice(t,3),t-=3,Yo(d,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function Bl(e){function t(D){return si(D,e)}Na!==null&&si(Na,e),Sa!==null&&si(Sa,e),ka!==null&&si(ka,e),Ds.forEach(t),_s.forEach(t);for(var a=0;a<Ca.length;a++){var s=Ca[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ca.length&&(a=Ca[0],a.blockedOn===null);)zp(a),a.blockedOn===null&&Ca.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],d=a[s+1],b=c[Zt]||null;if(typeof d=="function")b||$p(a);else if(b){var N=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[Zt]||null)N=b.formAction;else if(Fc(c)!==null)continue}else N=b.action;typeof N=="function"?a[s+1]=N:(a.splice(s,3),s-=3),$p(a)}}}function Up(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Vc(e){this._internalRoot=e}ii.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,s=ln();Rp(a,s,e,t,null,null)},ii.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rp(e.current,2,null,e,null,null),Gr(),t[el]=null}};function ii(e){this._internalRoot=e}ii.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xu();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ca.length&&t!==0&&t<Ca[a].priority;a++);Ca.splice(a,0,e),a===0&&zp(e)}};var Hp=r.version;if(Hp!=="19.2.4")throw Error(o(527,Hp,"19.2.4"));z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var _b={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oi.isDisabled&&oi.supportsFiber)try{et=oi.inject(_b),Oe=oi}catch{}}return zs.createRoot=function(e,t){if(!u(e))throw Error(o(299));var a=!1,s="",c=Vm,d=Qm,b=Xm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Ep(e,1,!1,null,null,a,s,null,c,d,b,Up),e[el]=t.current,Tc(e),new Vc(t)},zs.hydrateRoot=function(e,t,a){if(!u(e))throw Error(o(299));var s=!1,c="",d=Vm,b=Qm,N=Xm,D=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(D=a.formState)),t=Ep(e,1,!0,t,a??null,s,c,D,d,b,N,Up),t.context=Ap(null),a=t.current,s=ln(),s=Li(s),c=da(s),c.callback=null,ma(a,c,s),a=s,t.current.lanes=a,Rt(t,a),Rn(t),e[el]=t.current,Tc(e),new ii(t)},zs.version="19.2.4",zs}var Jp;function Yb(){if(Jp)return Ic.exports;Jp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Ic.exports=qb(),Ic.exports}var Fb=Yb();const Zb=Rh(Fb);function Au(l,r,i=!0){y.useEffect(()=>{if(!i)return;const o=u=>{l.current&&!l.current.contains(u.target)&&r()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[i,r,l])}const du=300*1e3;function Aa(l){if(!l||typeof l!="object")return null;const r=l;return Array.isArray(r.sessions)?{sessions:r.sessions,cachedAt:typeof r.cachedAt=="string"?r.cachedAt:void 0}:null}function Xs(l,r=du){if(!l)return!1;const i=Date.now()-new Date(l).getTime();return Number.isFinite(i)&&i>=0&&i<r}function pi(l){if(!l)return"just now";const r=Date.now()-new Date(l).getTime();if(!Number.isFinite(r)||r<0)return"just now";const i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Ru(l,r=Date.now()){if(!l)return"";const i=r-new Date(l).getTime();if(!Number.isFinite(i)||i<0)return"0m";const o=Math.floor(i/6e4);if(o<60)return`${o}m`;const u=Math.floor(o/60);return u<24?`${u}h`:`${Math.floor(u/24)}d`}function hi(l){return new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}function Dh(l){return l?`$${l.toFixed(2)}`:""}function Ci(l){if(!l)return"";const r=l.match(/claude-(\d+)-(\d+)-(opus|sonnet|haiku)(?:-\d{8})?/i);if(r)return`${r[3].charAt(0).toUpperCase()+r[3].slice(1).toLowerCase()} ${r[1]}.${r[2]}`;const i=l.match(/claude-(?:(opus|sonnet|haiku)-)?((?:\d+)(?:[.-](?!\d{8})\d+)*)(?:-\d{8})?(?:-(opus|sonnet|haiku))?(?:$|\b)/i);if(i){const u=(i[1]||i[3]||"").toLowerCase(),m=i[2].replace(/-/g,"."),p=u.charAt(0).toUpperCase()+u.slice(1);return p?`${p} ${m}`:`Claude ${m}`}const o=l.split(/[-/]/);return o.length>1?o.slice(0,2).join("-"):l}function Mu(l){if(l===0)return"0m";const r=Math.floor(l/6e4);if(r<60)return`${r}m`;const i=Math.floor(r/60),o=r%60;if(i<24)return o>0?`${i}h ${o}m`:`${i}h`;const u=Math.floor(i/24),m=i%24;return m>0?`${u}d ${m}h`:`${u}d`}function xi(l){const r=Math.round(l/1024);return r>=1024?`${(r/1024).toFixed(1)}MB`:`${r}KB`}function ql(l){const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:hi(l)}function na(l){const r=Ou(l);if(r)return r;const i=l.replace(/\/$/,"").split("/");return i[i.length-1]||l}const Du=120;function kt(l){return(l||"").replace(/\s+/g," ").trim().slice(0,Du)}function Vb(l){return l.startsWith("[Request interrupted by user")||l.startsWith("<command-name>")||l.startsWith("<command-message>")||l.startsWith("<local-command-caveat>")||l.startsWith("<local-command-stdout>")||l.startsWith("<task-notification>")||l.startsWith("<bash-input>")||l.startsWith("<bash-stdout>")}function Qb(l){return l.split(`
|
|
57
57
|
`).filter(o=>{const u=o.trim();return u?!(/^Last login:/i.test(u)||/^(?:➜|❯)\s+/.test(u)||/^github(?:\.com|\.rbx\.com)?$/i.test(u)||/^[✓✔]/.test(u)||/^-\s+(?:Active account|Git operations protocol|Token|Token scopes):/i.test(u)||/^(?:credential|init|user|filter|alias|core|remote|branch)\.[^=]+=/i.test(u)||/^branch\.[^.]+\./i.test(u)):!0}).join(`
|
|
58
58
|
`).trim()}function Xb(l){const i=[...l.split(`
|
|
59
59
|
`)],o=/^\S.*\[\d{1,2}:\d{2}\s?(?:AM|PM)\]$/i.test(i[0]||"");return o&&i.shift(),o&&/^(?:hello|hi)\b/i.test((i[0]||"").trim())&&i.shift(),i.join(`
|
|
60
|
-
`).trim()}function
|
|
61
|
-
`).map(v=>v.trim()).filter(Boolean),
|
|
62
|
-
`),className:"shrink-0"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer truncate hidden sm:inline",children:
|
|
60
|
+
`).trim()}function Kp(l){const r=l.trim();return/^\[Previous conversation summary\]:/i.test(r)||/^Summary:\s*1\.\s*Primary Request and Intent:/i.test(r)||/^and merge infrastructure was built for human-paced output/i.test(r)}function Yl(l){if(Vb(l)||Kp(l))return"";const r=/Last login:|Logged in to github\.com|Git operations protocol:|(?:➜|❯)\s+/i.test(l);let i=Xb(Qb(l));return/<attached_files>|<code_selection\b/i.test(i)||(i=i.replace(/<\/?[a-z][^>]*>/gi,""),i=i.replace(/^\s*\d+\|\s*/gm,""),i=i.replace(/Caveat:\s*The messages below were generated by the user while running local commands\.[^.]*/g,""),i=i.replace(/DO NOT respond to these messages[^.]*/g,""),i=i.replace(/!\[AI Session:[^\]]*]\([^)]+\)/gi,""),i=i.replace(/###\s*AI Coding Session[^\n]*/gi,""),i=i.replace(/\d+\s+prompts?,\s+\d+\s+tools?,[^\n]*/gi,""),i=i.replace(/^\/\w+\s*/g,""),i=i.replace(/\s+/g," ").trim(),!i||Kp(i))||r&&/^[a-z0-9._:-]{1,12}$/i.test(i)?"":i}function _h(l){const r=l.title?kt(Yl(l.title)):"";if(r)return r;const i=[...l.prompts||[],l.firstPrompt];for(const o of i){const u=kt(Yl(o||""));if(u)return u}return l.slug}function _u(l){const r=_h(l);if(l.replay?.title){const i=kt(l.replay.title);if(i)return i}return r}function mu(l,r){const i=_h(l),o=kt(l.replay?.title),u=kt(Yl(r?.title||""));return u||(i&&i!==l.slug?i:o||i)}function fu(l){const r=kt(l.title);if(r)return r;const i=kt(l.firstMessage);if(i)return i;const o=kt(l.messages?.[0]);return o||l.slug}function ht(l,r={}){const i=new URL(window.location.href),o=["tab","project","q","archived"];if(i.searchParams.get("view")==="dashboard"||!i.searchParams.has("session")&&!i.searchParams.has("gist")&&!i.searchParams.has("url")){const g={};o.forEach(f=>{const x=i.searchParams.get(f);x&&(g[f]=x)}),Object.keys(g).length>0?sessionStorage.setItem("vibe_dashboard_state",JSON.stringify(g)):sessionStorage.removeItem("vibe_dashboard_state")}if(l.session&&(o.forEach(g=>{l[g]===void 0&&i.searchParams.delete(g)}),l.view===void 0&&i.searchParams.delete("view")),l.view==="dashboard"||l.session===null&&!l.view){const g=sessionStorage.getItem("vibe_dashboard_state");if(g)try{const f=JSON.parse(g);Object.entries(f).forEach(([x,h])=>{l[x]===void 0&&!i.searchParams.has(x)&&i.searchParams.set(x,h)})}catch(f){console.error("Failed to restore dashboard state",f)}i.searchParams.delete("v"),i.searchParams.delete("s")}for(const[g,f]of Object.entries(l))f===null?i.searchParams.delete(g):i.searchParams.set(g,f);const p=i.toString()!==window.location.href;r.replace?window.history.replaceState({},"",i.toString()):window.history.pushState({},"",i.toString()),!r.replace&&p&&window.dispatchEvent(new PopStateEvent("popstate"))}const Ib={"claude-code":"bg-terminal-orange-subtle text-terminal-orange",cursor:"bg-terminal-blue-subtle text-terminal-blue"};function Oh(l){return l==="claude-code"?"Claude":l==="cursor"?"Cursor":l}function Lh(l){return Ib[l]||"bg-terminal-surface text-terminal-dim"}async function zh(l,r,i){const o=r.has(l);i(u=>{const m=new Set(u);return o?m.delete(l):m.add(l),m});try{if(!(await fetch(`/api/archive/${l}`,{method:o?"DELETE":"POST"})).ok)throw new Error("Archive toggle failed")}catch(u){console.error("Archive toggle failed:",gi(u)),i(m=>{const p=new Set(m);return o?p.add(l):p.delete(l),p})}}function gi(l){return l instanceof Error?l.message:typeof l=="string"?l:"Unknown error"}function Jb(l){const r=Ou(l);if(r)return r;const i=26;if(l.length<=i)return l;const o=l.split("/");if(o.length<=2)return l;const u=o[0],m=o.slice(-2).join("/"),p=`${u}/…/${m}`;if(p.length<=i)return p;const g=o[o.length-1];return`${u}/…/${g}`}function Bh(l){const r=new Map;for(const i of l)r.set(i,Ou(i)||Jb(i));return r}function pu(l,r){return r==="sqlite"?l?"SQLite + JSONL supplement":"SQLite":r==="global-state"?"Cursor global state":r==="jsonl"?l?"JSONL fallback":"JSONL transcript":l?"SQLite + JSONL":"JSONL"}function Ou(l){const r=l.replace(/\/$/,"");return r?r==="(globalStorage)"?"Cursor Global Storage":r==="~"?"Home":/\/\.cursor\/projects\/.+\/terminals$/.test(r)?"Cursor Terminals":/\/\.cursor\/extensions\//.test(r)?"Cursor Extension":null:null}const pt="__all__";function Pp(){return new URLSearchParams(window.location.search).get("project")||pt}function Wp(){return new URLSearchParams(window.location.search).get("q")||""}function eh(){return new URLSearchParams(window.location.search).get("archived")==="true"}function $h(){const[l,r]=y.useState(Pp),[i,o]=y.useState(Wp),[u,m]=y.useState(eh);return y.useEffect(()=>{const x=()=>{r(Pp()),o(Wp()),m(eh())};return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]),{selectedProject:l,filter:i,showArchived:u,handleProjectChange:x=>{r(x),ht({project:x===pt?null:x})},handleFilterChange:x=>{o(x),ht({q:x||null},{replace:!0})},handleToggleArchived:()=>{const x=!u;m(x),ht({archived:x?"true":null})}}}function Kb(l,r=450){const[i,o]=y.useState(l),u=y.useRef(l);return y.useEffect(()=>{const m=u.current,p=l-m;if(Math.abs(p)<1){u.current=l,o(l);return}let g=0;const f=performance.now(),x=h=>{const v=Math.min(1,(h-f)/r),C=1-(1-v)**3,j=m+p*C;u.current=j,o(j),v<1?g=requestAnimationFrame(x):(u.current=l,o(l))};return g=requestAnimationFrame(x),()=>cancelAnimationFrame(g)},[l,r]),i}function yn({value:l,durationMs:r,formatter:i=o=>Math.round(o).toLocaleString()}){const o=Kb(l,r);return n.jsx(n.Fragment,{children:i(o)})}var Pb=Mh();function Uh(l){const r=[...l.dataSourceInfo?.notes||[]];return l.provider==="cursor"&&(l.dataSource==="sqlite"||l.dataSource==="global-state")&&r.unshift("Some Cursor metrics are best-effort estimates and may be incomplete."),l.stats.tokenUsage||r.push("Token and cost metrics may be unavailable."),[...new Set(r)]}function Wb(l){const r=Uh(l);return{duration:r.find(i=>/duration/i.test(i)),tokens:r.find(i=>/token|cost|model attribution/i.test(i)),turnStats:r.find(i=>/per-turn|turn stats|turn metrics/i.test(i))}}function Ea({title:l,className:r=""}){const[i,o]=y.useState(!1),[u,m]=y.useState(!1),[p,g]=y.useState(null),f=y.useRef(null),x=l.split(`
|
|
61
|
+
`).map(v=>v.trim()).filter(Boolean),h=i||u;return y.useEffect(()=>{if(!h)return;const v=()=>{const C=f.current?.getBoundingClientRect();if(!C)return;const j=288,w=16,S=56+x.length*20,k=Math.min(Math.max(C.left+C.width/2-j/2,w),window.innerWidth-j-w),E=C.bottom+8,M=E+S>window.innerHeight-w?Math.max(w,C.top-S-8):E;g({left:k,top:M})};return v(),window.addEventListener("resize",v),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0)}},[h,x.length]),y.useEffect(()=>{if(!i)return;const v=j=>{f.current?.contains(j.target)||o(!1)},C=j=>{j.key==="Escape"&&o(!1)};return window.addEventListener("pointerdown",v),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",v),window.removeEventListener("keydown",C)}},[i]),n.jsxs("span",{ref:f,className:`inline-flex ${r}`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[n.jsx("button",{type:"button","aria-expanded":i,"aria-label":"Show data quality details",className:"inline-flex h-4 min-w-4 items-center justify-center rounded-full border border-terminal-orange/40 bg-terminal-orange/10 px-1 text-[10px] font-sans font-bold leading-none text-terminal-orange transition-colors hover:border-terminal-orange/70 hover:bg-terminal-orange/15 focus:outline-none focus:ring-2 focus:ring-terminal-orange/30",onClick:()=>o(v=>!v),onFocus:()=>m(!0),onBlur:()=>m(!1),children:"!"}),h&&p?Pb.createPortal(n.jsxs("div",{className:"pointer-events-none fixed z-[120] w-72 max-w-[calc(100vw-2rem)] rounded-xl border border-terminal-border-subtle bg-terminal-surface-2 px-3 py-2.5 text-left shadow-layer-xl",style:p,children:[n.jsx("div",{className:"mb-1 text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange",children:"Data Quality"}),n.jsx("div",{className:"space-y-1",children:x.map(v=>n.jsx("div",{className:"text-[11px] font-mono leading-relaxed text-terminal-dim",children:v},v))})]}),document.body):null]})}function Ul({label:l,value:r,color:i}){const o=typeof r=="number";return n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-3 py-3 shadow-layer-sm",children:[n.jsx("div",{className:`text-xl font-bold ${o?"tabular-nums":"truncate w-full"} ${i}`,title:typeof r=="string"?r:void 0,children:r}),n.jsx("div",{className:"text-terminal-dimmer text-[10px] font-sans font-medium uppercase tracking-widest mt-0.5",children:l})]})}function Ht(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toString()}function vt(l){if(!l)return"";const r=Math.floor(l/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60);return i<60?`${i}m ${r%60}s`:`${Math.floor(i/60)}h ${i%60}m`}const Hh=y.createContext(null);function Fl(){const l=y.useContext(Hh);if(!l)throw new Error("useScanInsightsContext must be used within ScanInsightsProvider");return l}function e0({children:l}){const[r,i]=y.useState(null),[o,u]=y.useState(null),[m]=y.useState(()=>new Map),p=y.useRef(!1),[,g]=y.useState(0),[f,x]=y.useState(!1),h=y.useRef(!1);y.useEffect(()=>{let j=!1,w;const S=()=>{j||fetch("/api/scan/start",{method:"POST"}).catch(()=>{})};return(async()=>{try{const E=await fetch("/api/scan/status");if(!E.ok||j)return;const M=await E.json();if(i(M),M.running)return;if(!M.hasCachedResults||!Xs(M.cachedAt,du)){S();return}const A=Date.now()-new Date(M.cachedAt).getTime(),R=Math.max(1e3,du-A);w=window.setTimeout(S,R)}catch{S()}})(),()=>{j=!0,w&&window.clearTimeout(w)}},[]),y.useEffect(()=>{let j=!1;const w=async()=>{try{const E=await fetch("/api/scan/status");if(!E.ok||j)return null;const M=await E.json();return i(M),M}catch{return null}},S=async()=>{x(!0);try{const E=await fetch("/api/insights");if(E.ok){const M=await E.json();M.type==="user"&&!j&&u(M.insights)}}catch{}finally{j||x(!1)}};w().then(E=>{E?.hasInsights&&!h.current&&(h.current=!0,S())});const k=setInterval(async()=>{const E=await w();!E||j||(E.hasInsights&&!h.current&&(h.current=!0,S()),!E.running&&E.finishedAt&&(E.resultCount>0&&(p.current=!0,S(),g(M=>(queueMicrotask(()=>{p.current=!1}),M+1))),clearInterval(k)))},2e3);return()=>{j=!0,clearInterval(k)}},[]);const v=y.useCallback(j=>{m.has(j)&&!p.current||(x(!0),fetch(`/api/insights?project=${encodeURIComponent(j)}`).then(w=>w.ok?w.json():null).then(w=>{w?.type==="project"&&(m.set(j,w.insights),g(S=>S+1))}).catch(()=>{}).finally(()=>x(!1)))},[m]),C=y.useMemo(()=>({scanStatus:r,userInsights:o,projectInsightsCache:m,fetchProjectInsights:v,loading:f}),[r,o,m,v,f]);return n.jsx(Hh.Provider,{value:C,children:l})}function Gh(){return n.jsxs("div",{className:"border-b border-terminal-border-subtle pb-3 animate-pulse",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[n.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[n.jsx("div",{className:"h-5 w-36 skeleton rounded"}),n.jsx("div",{className:"h-3 w-24 skeleton rounded opacity-40"})]}),n.jsx("div",{className:"h-3.5 w-24 skeleton rounded opacity-40"})]}),n.jsxs("div",{className:"flex items-center gap-5",children:[[16,14,10,12].map((l,r)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${l*4}px`}}),n.jsx("div",{className:"h-2.5 w-10 skeleton rounded opacity-40"})]},r)),n.jsx("div",{className:"flex-1"}),n.jsx("div",{className:"flex items-end gap-px h-4",children:Array.from({length:30},(l,r)=>n.jsx("div",{className:"w-1 rounded-sm skeleton",style:{height:`${Math.max(2,Math.random()*16)}px`,opacity:.15}},r))})]})]})}function bi({insights:l,variant:r}){const[i,o]=y.useState(!1),[u,m]=y.useState(!1),p=r==="project",g=p?"text-terminal-green":"text-terminal-purple",f=p?"bg-terminal-green":"bg-terminal-purple",x=p?l:null,h=p?null:l,v=x?.sessionCount??h?.totalSessions??0,C=x?.totalDurationMs??h?.totalDurationMs??0,j=x?.totalCost??h?.totalCost??0,w=x?.totalPrompts??h?.totalPrompts??0,S=x?.totalToolCalls??h?.totalToolCalls??0,k=x?.totalEdits??h?.totalEdits??0,E=x?.models??h?.models??{},M=x?.avgSessionDurationMs??h?.avgSessionDurationMs??0,A=x?.sessionsPerDay??h?.sessionsPerDay??{},R=x?.dataQuality?.notes??h?.dataQuality?.notes??[],O=x?.timeRange??h?.timeRange,$=x?x.project.split("/").pop()||x.project:"All Projects",H=x?x.project:`${h?.totalProjects??0} projects`;if(v===0)return null;const K=Object.entries(E).sort(([,te],[,xe])=>xe-te),ae=K.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Models"}),n.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:K.map(([te,xe])=>n.jsxs("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:te,children:[Ci(te)," ",n.jsxs("span",{className:"text-terminal-dimmer",children:[xe,"x"]})]},te))})]}),ue={month:"short",day:"numeric",year:"numeric"},oe=O&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dimmer",children:["Active"," ",n.jsx("span",{className:"text-terminal-dim",children:new Date(O.first).toLocaleDateString("en-US",ue)})," — ",n.jsx("span",{className:"text-terminal-dim",children:new Date(O.last).toLocaleDateString("en-US",ue)})]});return n.jsxs("div",{className:"border-b border-terminal-border-subtle pb-3",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[n.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${f} shrink-0 self-center`}),n.jsx("h2",{className:"text-base font-sans font-semibold text-terminal-text truncate",children:$}),R.length>0&&n.jsx(Ea,{title:R.join(`
|
|
62
|
+
`),className:"shrink-0"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer truncate hidden sm:inline",children:H})]}),n.jsxs("button",{onClick:()=>o(te=>!te),className:`flex items-center gap-1.5 text-xs font-mono tabular-nums shrink-0 hover:text-terminal-text transition-colors ${g}`,children:[v," session",v!==1?"s":"",n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:`transition-transform duration-200 ${i?"rotate-180":""}`,children:n.jsx("path",{d:"M3 4.5l3 3 3-3"})})]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap text-xs font-mono",children:[n.jsxs("span",{className:"text-terminal-blue tabular-nums",children:[vt(C),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"duration"})]}),j>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",j.toFixed(2),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"cost"})]}),n.jsxs("span",{className:"text-terminal-green tabular-nums",children:[Wc(w),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"prompts"})]}),n.jsxs("span",{className:"text-terminal-text tabular-nums",children:[Wc(S),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"tools"})]}),k>0&&n.jsxs("span",{className:"text-terminal-purple tabular-nums",children:[Wc(k),n.jsx("span",{className:"text-terminal-dimmer ml-1 text-[10px]",children:"edits"})]}),n.jsxs("span",{className:"text-terminal-dimmer text-[10px] tabular-nums hidden lg:inline",children:["avg ",vt(M),"/session"]}),n.jsx("div",{className:"flex-1 flex justify-end",children:n.jsx("div",{className:"flex items-end gap-px h-3.5",children:(()=>{const te=new Date,xe=new Date(te);xe.setDate(xe.getDate()-29);const de=[],pe=new Date(xe);for(;pe<=te;){const z=pe.toISOString().slice(0,10);de.push({day:z,count:A[z]||0}),pe.setDate(pe.getDate()+1)}const U=Math.max(...de.map(z=>z.count),1);return de.map(z=>n.jsx("div",{title:`${z.day}: ${z.count}`,className:`w-1 rounded-sm ${z.count>0?f:"bg-terminal-surface-2"}`,style:{height:z.count>0?`${Math.max(15,z.count/U*100)}%`:"2px",opacity:z.count>0?.35+z.count/U*.65:.15}},z.day))})()})})]}),i&&x&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-terminal-border-subtle space-y-3",children:[x.branches.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:["Branches (",x.branches.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:x.branches.slice(0,15).map(te=>n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"font-mono text-terminal-purple truncate",children:te.branch}),n.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[te.sessionIds.length,"x"]}),te.prLinks?.map(xe=>n.jsxs("a",{href:xe.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:underline shrink-0",children:["#",xe.prNumber]},xe.prUrl))]},te.branch))})]}),x.hotFiles.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Most modified files"}),n.jsx("div",{className:"space-y-0.5 max-h-28 overflow-y-auto",children:x.hotFiles.slice(0,10).map(te=>n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"font-mono text-terminal-dim truncate flex-1",children:te.file}),n.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[te.editCount,"x / ",te.sessionCount,"s"]})]},te.file))})]}),ae,oe,x.memory&&x.memory.memoryFiles.length>0&&n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>m(te=>!te),className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5 flex items-center gap-1 hover:text-terminal-dim transition-colors",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:`transition-transform duration-200 ${u?"rotate-90":""}`,children:n.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Memory (",x.memory.memoryFiles.length," files)"]}),u&&n.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:x.memory.memoryFiles.map(te=>n.jsxs("div",{className:"bg-terminal-surface-2 rounded-lg px-3 py-2 text-xs",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"font-mono text-terminal-text font-medium",children:te.name}),te.type&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-terminal-surface text-terminal-dimmer text-[10px]",children:te.type})]}),te.description&&n.jsx("div",{className:"text-terminal-dim text-[11px] mb-1",children:te.description}),n.jsx("div",{className:"font-mono text-terminal-dimmer whitespace-pre-wrap line-clamp-3 text-[11px] leading-relaxed",children:te.content})]},te.name))})]})]}),i&&h&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-terminal-border-subtle space-y-3",children:[h.topProjects.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold mb-1.5",children:"Top projects"}),n.jsx("div",{className:"space-y-1",children:h.topProjects.slice(0,8).map(te=>{const xe=te.project.split("/").pop()||te.project;return n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("span",{className:"font-mono text-terminal-text truncate flex-1",title:te.project,children:xe}),n.jsxs("span",{className:"text-terminal-dimmer tabular-nums shrink-0",children:[te.sessions,"s"]}),te.durationMs>0&&n.jsx("span",{className:"text-terminal-blue tabular-nums shrink-0",children:vt(te.durationMs)}),n.jsxs("span",{className:"text-terminal-green tabular-nums shrink-0",children:[te.prompts,"p"]}),te.edits>0&&n.jsxs("span",{className:"text-terminal-purple tabular-nums shrink-0",children:[te.edits,"e"]}),te.prCount>0&&n.jsxs("span",{className:"text-terminal-blue tabular-nums shrink-0",children:[te.prCount,"pr"]}),te.cost>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums shrink-0",children:["$",te.cost.toFixed(2)]})]},te.project)})})]}),ae,oe]})]})}function Wc(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}const aa=864e5,t0=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n0=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ia(l){return l.toISOString().slice(0,10)}function a0(l){return l==="7d"?7:l==="30d"?30:l==="90d"?90:0}function qh(l,r){if(r==="all")return l;const i=a0(r),o=new Date;o.setHours(0,0,0,0),o.setDate(o.getDate()-i);const u=Ia(o),m={};for(const[p,g]of Object.entries(l))p>=u&&(m[p]=g);return m}function l0(l,r,i){if(i==="all")return{sessions:r.totalSessions,replays:r.totalReplays,durationMs:r.totalDurationMs,cost:r.totalCost,prompts:r.totalPrompts,edits:r.totalEdits,toolCalls:r.totalToolCalls,projects:r.totalProjects};const o=qh(l,i),u=Object.values(o).reduce((p,g)=>p+g,0),m=r.totalSessions>0?u/r.totalSessions:0;return{sessions:u,replays:Math.round(r.totalReplays*m),durationMs:Math.round(r.totalDurationMs*m),cost:r.totalCost*m,prompts:Math.round(r.totalPrompts*m),edits:Math.round(r.totalEdits*m),toolCalls:Math.round(r.totalToolCalls*m),projects:r.totalProjects}}function s0(l){const r=new Date;r.setHours(0,0,0,0);let i=0;const o=new Date(r);for(;;){const h=Ia(o);if(l[h]&&l[h]>0)i++,o.setDate(o.getDate()-1);else if(i===0){o.setDate(o.getDate()-1);const v=Ia(o);if(l[v]&&l[v]>0)i++,o.setDate(o.getDate()-1);else break}else break}const u=Object.keys(l).filter(h=>l[h]>0).sort();let m=0,p,g,f=0,x="";for(let h=0;h<u.length;h++)if(h===0)f=1,x=u[h];else{const v=new Date(u[h-1]);(new Date(u[h]).getTime()-v.getTime())/aa===1?f++:(f>m&&(m=f,p=x,g=u[h-1]),f=1,x=u[h])}return f>m&&(m=f,p=x,g=u[u.length-1]),{current:i,longest:m,longestStart:p,longestEnd:g}}function r0(l){const r=[0,0,0,0,0,0,0];for(const[i,o]of Object.entries(l))if(o>0){const u=new Date(`${i}T00:00:00`);r[u.getDay()]+=o}return r.map((i,o)=>({day:n0[o],shortDay:t0[o],count:i}))}function i0(l,r){const i=[],o=new Date;o.setHours(0,0,0,0);const u=o.getDay(),m=u===0?6:u-1,p=new Date(o.getTime()-m*aa);for(let g=r-1;g>=0;g--){const f=new Date(p.getTime()-g*7*aa);let x=0;for(let v=0;v<7;v++){const C=new Date(f.getTime()+v*aa),j=Ia(C);x+=l[j]||0}const h=f.toLocaleDateString("en-US",{month:"short",day:"numeric"});i.push({weekLabel:h,sessions:x,startDate:Ia(f)})}return i}function o0(l){let r=0,i="";for(const[o,u]of Object.entries(l))u>r&&(r=u,i=o);return r>0?{date:i,count:r}:null}function Yh(l){return l===0?"$0":l<.01?"<$0.01":l<1?`$${l.toFixed(2)}`:l<100?`$${l.toFixed(2)}`:`$${Math.round(l)}`}function $l(l){return l>=1e4?`${(l/1e3).toFixed(1)}k`:l.toLocaleString()}function c0(l){const r=l?.filter(Boolean)||[],i=r.filter(u=>/duration estimates|timing data|duration/i.test(u)),o=r.filter(u=>/token snapshots|token and cost|cost totals/i.test(u));return{overall:r.length>0?r.join(`
|
|
63
63
|
`):void 0,duration:i.length>0?["Coding time is approximate for Cursor sessions.",...i].join(`
|
|
64
64
|
`):void 0,cost:o.length>0?["Spend is a lower bound for Cursor sessions, not the full total.",...o].join(`
|
|
65
|
-
`):void 0}}function u0(l){return[...new Set(l.split(",").map(r=>r.trim()).filter(Boolean))]}function d0(l){return l==="7d"?"Last 7 Days":l==="30d"?"Last 30 Days":l==="90d"?"Last 90 Days":"All Time"}function Yh({sessionsPerDay:l,weeks:r=52,showLegend:i=!0}){const{weekColumns:o,monthByWeek:u,maxVal:m}=y.useMemo(()=>{const g=new Date;g.setHours(0,0,0,0);const f=g.getDay(),h=new Date(g.getTime()+(6-f)*In),x=r*7,v=new Date(h.getTime()-(x-1)*In);let C=0;const j=[],w=new Map;let k=-1;for(let S=0;S<x;S++){const T=new Date(v.getTime()+S*In),A=Fa(T),R=l[A]||0,D=Math.floor(S/7);R>C&&(C=R),j[D]||(j[D]=[]),j[D].push({date:A,count:R});const O=T.getMonth();O!==k&&(w.set(D,T.toLocaleDateString("en-US",{month:"short"})),k=O)}return{weekColumns:j,monthByWeek:w,maxVal:C}},[l,r]),p=g=>{if(g===0)return{cls:"bg-terminal-border/20 dark:bg-terminal-surface-2"};const f=m<=1?1:g/m;return{cls:"bg-terminal-green",style:{opacity:f<=.25?.4:f<=.5?.6:f<=.75?.8:1}}};return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-end gap-[3px]",children:[n.jsx("div",{className:"shrink-0 w-7"}),n.jsx("div",{className:"flex-1 flex gap-[3px] min-w-0",children:o.map((g,f)=>n.jsx("div",{className:"flex-1 min-w-0 overflow-visible",children:u.has(f)&&n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer whitespace-nowrap",children:u.get(f)})},f))})]}),n.jsxs("div",{className:"flex gap-[3px]",children:[n.jsx("div",{className:"shrink-0 w-7 flex flex-col gap-[3px]",children:["","Mon","","Wed","","Fri",""].map((g,f)=>n.jsx("div",{className:"flex-1 flex items-center text-[9px] font-mono text-terminal-dimmer leading-none",children:g},f))}),n.jsx("div",{className:"flex-1 flex gap-[3px] min-w-0",children:o.map((g,f)=>n.jsx("div",{className:"flex-1 flex flex-col gap-[3px] min-w-0",children:g.map(h=>{const x=p(h.count);return n.jsx("div",{className:`aspect-square rounded-sm ${x.cls} hover:ring-1 hover:ring-terminal-text/30`,style:x.style,title:`${h.date}: ${h.count} session${h.count!==1?"s":""}`},h.date)})},f))})]}),i&&n.jsxs("div",{className:"flex items-center justify-end gap-1.5 pt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"Less"}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-border/20 dark:bg-terminal-surface-2"}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.4}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.6}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.8}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green"}),n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"More"})]})]})}function m0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date;o.setHours(0,0,0,0);const u=28,m=[];let p=0;for(let g=u-1;g>=0;g--){const f=new Date(o.getTime()-g*In),h=Fa(f),x=l[h]||0;x>p&&(p=x),m.push({key:h,count:x})}return{cells:m,max:p}},[l]),i=o=>{if(o===0)return{className:"bg-terminal-border/20 dark:bg-white/5"};const u=r.max<=1?1:o/r.max;return{className:"bg-terminal-green",style:{opacity:u<=.33?.45:u<=.66?.7:.9}}};return n.jsx("div",{className:"flex gap-[3px] flex-wrap",children:r.cells.map(o=>{const u=i(o.count);return n.jsx("div",{className:`w-[10px] h-[10px] rounded-[2px] ${u.className}`,style:u.style},o.key)})})}function f0({stats:l,streak:r,bestDay:i,sessionsPerDay:o,range:u,providers:m,dataQualityNotes:p}){const g=y.useRef(null),f=y.useMemo(()=>{const v=Object.entries(m);if(v.length===0)return"";v.sort((j,w)=>w[1]-j[1]);const C={"claude-code":"Claude Code",cursor:"Cursor"};return v.map(([j])=>C[j]||j).join(" + ")},[m]),h=y.useMemo(()=>c0(p),[p]),x=({label:v,title:C})=>n.jsxs("div",{className:"mt-0.5 flex items-center gap-1",children:[n.jsx("div",{className:"text-[10px] font-sans font-medium text-terminal-dim uppercase tracking-wider",children:v}),C?n.jsx(wa,{title:C,className:"shrink-0"}):null]});return n.jsxs("div",{ref:g,className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-bg to-terminal-surface border border-terminal-border p-6 md:p-8 shadow-layer-xl",children:[n.jsx("div",{className:"absolute -top-20 -right-20 w-64 h-64 bg-terminal-green/5 rounded-full blur-3xl pointer-events-none"}),n.jsx("div",{className:"absolute -bottom-20 -left-20 w-48 h-48 bg-terminal-blue/5 rounded-full blur-3xl pointer-events-none"}),n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer px-2 py-0.5 rounded-full bg-terminal-surface-2",children:d0(u)}),h.overall?n.jsx(wa,{title:h.overall,className:"shrink-0"}):null]}),f&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim",children:f})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-5 mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(un,{durationMs:500,value:l.sessions,formatter:Ml})}),n.jsx(x,{label:"sessions"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(un,{durationMs:500,value:l.replays,formatter:Ml})}),n.jsx(x,{label:"replays"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(un,{durationMs:500,value:l.prompts,formatter:Ml})}),n.jsx(x,{label:"turns"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(un,{durationMs:500,value:l.toolCalls,formatter:Ml})}),n.jsx(x,{label:"tool calls"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-text tabular-nums",children:n.jsx(un,{durationMs:500,value:l.durationMs,formatter:v=>Su(v)})}),n.jsx(x,{label:"coding",title:h.duration})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(un,{durationMs:500,value:l.cost,formatter:v=>qh(v)})}),n.jsx(x,{label:"spent",title:h.cost})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(un,{durationMs:500,value:l.edits,formatter:Ml})}),n.jsx(x,{label:"file edits"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-purple tabular-nums",children:n.jsx(un,{durationMs:500,value:l.projects,formatter:v=>Math.round(v).toString()})}),n.jsx(x,{label:"projects"})]})]}),n.jsx("div",{className:"mb-4",children:n.jsx(m0,{sessionsPerDay:o})}),n.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-terminal-border/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[r.current>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:[r.current," day streak"]}),i&&i.count>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Most active: ",i.day]})]}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:"vibe-replay.com"})]})]})]})}function Rs({icon:l,label:r,value:i,sub:o}){return n.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3.5 shadow-layer-sm hover:bg-terminal-surface-hover transition-colors group",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"text-lg leading-none mt-0.5",children:l}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest",children:r}),n.jsx("div",{className:"text-lg font-mono font-bold text-terminal-text mt-0.5",children:i}),o&&n.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer mt-0.5",children:o})]})]})})}function p0({data:l}){const r=Math.max(...l.map(h=>h.sessions),1);if(!l.some(h=>h.sessions>0))return n.jsx("div",{className:"flex items-center justify-center h-full text-terminal-dimmer text-xs font-mono",children:"No activity to show"});const o=l.slice(-4),u=l.slice(-8,-4),m=o.reduce((h,x)=>h+x.sessions,0)/Math.max(o.length,1),p=u.reduce((h,x)=>h+x.sessions,0)/Math.max(u.length,1),g=m>p,f=Math.abs(m-p)<.5;return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-end gap-1.5 h-28",children:l.map(h=>{const x=Math.max(h.sessions/r*100,h.sessions>0?6:0);return n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[n.jsx("div",{className:"absolute bottom-full mb-1 hidden group-hover:block z-10",children:n.jsxs("div",{className:"bg-terminal-surface-2 border border-terminal-border-subtle rounded-lg px-2 py-1 shadow-layer-md whitespace-nowrap",children:[n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim",children:h.weekLabel}),n.jsxs("div",{className:"text-[10px] font-mono text-terminal-green font-bold",children:[h.sessions," session",h.sessions!==1?"s":""]})]})}),n.jsx("div",{className:"w-full rounded-md bg-terminal-green hover:opacity-90 transition-all",style:{height:`${x}%`,minHeight:h.sessions>0?"4px":"0",opacity:h.sessions>0?.7:0}})]},h.startDate)})}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex gap-1.5 overflow-hidden",children:l.filter((h,x)=>x%2===0).map(h=>n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:h.weekLabel},h.startDate))}),!f&&n.jsxs("span",{className:`text-[10px] font-mono font-bold ${g?"text-terminal-green":"text-terminal-orange"}`,children:[g?"↑":"↓"," ",g?"Trending up":"Slowing down"]})]})]})}function h0({data:l}){const r=Math.max(...l.map(i=>i.count),1);return n.jsx("div",{className:"space-y-2",children:l.map(i=>{const o=r>0?i.count/r*100:0;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim w-7 text-right shrink-0",children:i.shortDay}),n.jsx("div",{className:"flex-1 h-4 rounded bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full rounded bg-terminal-green transition-all duration-500",style:{width:`${Math.max(o,i.count>0?3:0)}%`,opacity:.65}})}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim w-6 text-right tabular-nums shrink-0",children:i.count})]},i.day)})})}function x0({projects:l}){if(l.length===0)return n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono py-4 text-center",children:"No project data"});const r=Math.max(...l.map(i=>i.sessions),1);return n.jsx("div",{className:"space-y-2",children:l.slice(0,8).map(i=>{const o=Xn(i.project),u=i.sessions/r*100;return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]",children:o}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dim tabular-nums",children:[i.sessions," session",i.sessions!==1?"s":"",i.cost>0&&` · ${qh(i.cost)}`]})]}),n.jsx("div",{className:"h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-terminal-green to-terminal-blue transition-all duration-500",style:{width:`${Math.max(u,3)}%`,opacity:.65}})})]},i.project)})})}function g0({models:l}){const r=y.useMemo(()=>(()=>{const u=new Map;for(const[m,p]of Object.entries(l))for(const g of u0(m)){const f=yi(g);u.set(f,(u.get(f)??0)+p)}return[...u.entries()].map(([m,p])=>({model:m,count:p})).sort((m,p)=>p.count-m.count)})(),[l]),i=r.reduce((u,m)=>u+m.count,0);if(r.length===0)return n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono py-4 text-center",children:"No model data"});const o=["bg-terminal-green","bg-terminal-blue","bg-terminal-orange","bg-terminal-purple","bg-terminal-red","bg-terminal-dim"];return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex",children:r.map((u,m)=>n.jsx("div",{className:`h-full ${o[m%o.length]} transition-all duration-500`,style:{width:`${u.count/i*100}%`,opacity:.7}},u.model))}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:r.map((u,m)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2.5 h-2.5 rounded-sm ${o[m%o.length]} shrink-0`,style:{opacity:.7}}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim truncate",children:u.model}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0",children:u.count})]},u.model))})]})}function b0({providers:l}){const r=y.useMemo(()=>Object.entries(l).map(([u,m])=>({provider:u,label:u==="claude-code"?"Claude Code":u==="cursor"?"Cursor":u,count:m})).sort((u,m)=>m.count-u.count),[l]),i=r.reduce((u,m)=>u+m.count,0);if(r.length===0)return null;const o={"claude-code":"bg-terminal-orange",cursor:"bg-terminal-blue"};return n.jsx("div",{className:"space-y-3",children:r.map(u=>{const m=i>0?u.count/i*100:0;return n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text",children:u.label}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dim tabular-nums",children:[u.count," (",Math.round(m),"%)"]})]}),n.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full ${o[u.provider]||"bg-terminal-dim"} transition-all duration-500`,style:{width:`${m}%`,opacity:.7}})})]},u.provider)})})}function Fh(){return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"h-6 w-32 skeleton rounded"}),n.jsx("div",{className:"flex gap-1",children:Array.from({length:4},(l,r)=>n.jsx("div",{className:"h-7 w-10 skeleton rounded-md"},r))})]}),n.jsxs("div",{className:"rounded-2xl bg-terminal-surface border border-terminal-border/30 p-6 space-y-5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"h-4 w-20 skeleton rounded"}),n.jsx("div",{className:"h-5 w-12 skeleton rounded-md"})]}),n.jsx("div",{className:"h-3 w-28 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-4 gap-6",children:Array.from({length:8},(l,r)=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-7 skeleton rounded",style:{width:`${45+r*13%40}%`}}),n.jsx("div",{className:"h-3 w-16 skeleton rounded"})]},r))}),n.jsx("div",{className:"h-2.5 w-full skeleton rounded"}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("div",{className:"h-3 w-40 skeleton rounded"}),n.jsx("div",{className:"h-3 w-24 skeleton rounded"})]})]}),n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"h-3 w-16 skeleton rounded"}),n.jsx("div",{className:"space-y-1.5",children:Array.from({length:3},(l,r)=>n.jsx("div",{className:"h-3 skeleton rounded"},r))})]}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4},(l,r)=>n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-4 shadow-layer-sm space-y-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-5 w-5 skeleton rounded"}),n.jsx("div",{className:"h-3 w-20 skeleton rounded"})]}),n.jsx("div",{className:"h-6 w-24 skeleton rounded"}),n.jsx("div",{className:"h-2.5 w-16 skeleton rounded"})]},r))}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Array.from({length:2},(l,r)=>n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"h-3 w-24 skeleton rounded"}),n.jsx("div",{className:"space-y-2",children:Array.from({length:5},(i,o)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-3 w-8 skeleton rounded shrink-0"}),n.jsx("div",{className:"h-5 skeleton rounded",style:{width:`${25+(o*17+r*31)%60}%`}})]},o))})]},r))})]})})}function y0({scanStatus:l,hasCachedInsights:r}){const i=l?.phase==="discovering"?"Finding sessions across providers and restoring the latest local data.":l?.total?`Refreshing ${l.scanned}/${l.total} sessions in the background.`:"Preparing your latest session insights.";return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-8 space-y-4",children:[n.jsxs("div",{className:"rounded-xl border border-terminal-purple/20 bg-terminal-surface px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-sans text-terminal-text",children:[n.jsx("span",{className:"w-2 h-2 rounded-full bg-terminal-purple animate-pulse"}),n.jsx("span",{children:r?"Refreshing cached insights":"Loading your insights"})]}),n.jsx("p",{className:"mt-1 text-xs font-mono text-terminal-dim",children:i})]}),n.jsx(Fh,{})]})})}function v0(){const[l,r]=y.useState(null),i=y.useCallback((o,u)=>{let m=0,p=0,g=0;const f=new Map(o.map(x=>[x.slug,x]));for(const x of o)m+=x.promptCount??(x.prompts?.length||(x.firstPrompt?1:0)),p+=x.toolCallCount??0;for(const x of u){const v=f.get(x.slug),C=x.stats.toolCalls||0;v?v.toolCallCount==null?p+=C:C>v.toolCallCount&&(p+=C-v.toolCallCount):(m+=x.stats.userPrompts||0,p+=C),g+=x.stats.durationMs||0}const h=new Set;for(const x of o)h.add(x.project);for(const x of u)h.add(x.project);r({sessions:o.length,replays:u.length,prompts:m,toolCalls:p,duration:g,projects:h.size})},[]);return y.useEffect(()=>{Promise.all([fetch("/api/sources/cached").then(o=>o.ok?o.json():null).catch(()=>null),fetch("/api/sessions/cached").then(o=>o.ok?o.json():null).catch(()=>null)]).then(([o,u])=>{const m=Na(o)?.sessions||[],p=Na(u)?.sessions||[];(m.length>0||p.length>0)&&i(m,p)})},[i]),l}function j0(){const{userInsights:l,loading:r,scanStatus:i}=Bl(),o=v0(),[u,m]=y.useState("all"),p=i?.running&&!l,{stats:g,streak:f,dayOfWeek:h,bestDay:x,peak:v,weeklyTrend:C,activeDays:j,firstSessionDate:w}=y.useMemo(()=>{if(!l)return{stats:{sessions:0,replays:0,durationMs:0,cost:0,prompts:0,edits:0,toolCalls:0,projects:0},streak:{current:0,longest:0},dayOfWeek:[],bestDay:null,peak:null,weeklyTrend:[],activeDays:0,firstSessionDate:null};const A=l.sessionsPerDay||{},R=Gh(A,u),D={...l,totalSessions:Math.max(l.totalSessions,o?.sessions??0),totalReplays:o?.replays??0,totalPrompts:Math.max(l.totalPrompts,o?.prompts??0),totalToolCalls:Math.max(l.totalToolCalls,o?.toolCalls??0),totalDurationMs:Math.max(l.totalDurationMs,o?.duration??0),totalProjects:Math.max(l.totalProjects,o?.projects??0)},O=l0(R,D,u),$=s0(A),q=r0(R),ne=[...q].sort((V,ue)=>ue.count-V.count)[0]||null,de=o0(R),oe=i0(A,12),I=Object.values(R).filter(V=>V>0).length,te=l.timeRange?.first||null;return{stats:O,streak:$,dayOfWeek:q,bestDay:ne,peak:de,weeklyTrend:oe,activeDays:I,firstSessionDate:te}},[l,u,o]);if(!l&&(r||p||i?.phase==="discovering"))return n.jsx(y0,{scanStatus:i,hasCachedInsights:!!i?.hasCachedResults});if(!l)return n.jsx(Fh,{});const k=j>0?(g.sessions/j).toFixed(1):"0",S=g.sessions>0?Math.round(g.prompts/g.sessions):0,T=w?Math.floor((Date.now()-new Date(w).getTime())/In):0;return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h1",{className:"text-lg font-sans font-bold text-terminal-text",children:"Your Insights"}),n.jsx("div",{className:"flex items-center gap-0.5 p-0.5 rounded-lg bg-terminal-surface",children:["7d","30d","90d","all"].map(A=>n.jsx("button",{onClick:()=>m(A),className:`px-3 py-1.5 text-[11px] font-mono rounded-md transition-all ${u===A?"bg-terminal-green-subtle text-terminal-green font-bold":"text-terminal-dim hover:text-terminal-text"}`,children:A==="all"?"All":A},A))})]}),n.jsx(f0,{stats:g,streak:f,bestDay:x,sessionsPerDay:l.sessionsPerDay||{},range:u,providers:l.providers||{},dataQualityNotes:l.dataQuality?.notes}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Activity"}),u!=="all"&&n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"Last 52 weeks"})]}),n.jsx(Yh,{sessionsPerDay:l.sessionsPerDay||{}})]}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[n.jsx(Rs,{icon:"🔥",label:"Current Streak",value:`${f.current} day${f.current!==1?"s":""}`,sub:f.longest>f.current?`Best: ${f.longest} days`:f.current>0?"Personal best!":void 0}),n.jsx(Rs,{icon:"⚡",label:"Avg / Active Day",value:`${k} sessions`,sub:`${j} active day${j!==1?"s":""}`}),n.jsx(Rs,{icon:"💬",label:"Avg / Session",value:`${S} prompts`,sub:g.sessions>0?`~${Su(g.durationMs/g.sessions)} each`:void 0}),v?n.jsx(Rs,{icon:"🏆",label:"Peak Day",value:`${v.count} sessions`,sub:new Date(`${v.date}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}):n.jsx(Rs,{icon:"📅",label:"Vibe Coding Since",value:T>0?`${T} days`:"Today",sub:w?new Date(w).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):void 0})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Weekly Trend"}),n.jsx(p0,{data:C})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Day of Week"}),n.jsx(h0,{data:h})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Top Projects"}),n.jsx(x0,{projects:(l.topProjects||[]).map(A=>({project:A.project,sessions:A.sessions,cost:A.cost,prompts:A.prompts,durationMs:A.durationMs,edits:A.edits}))})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-5",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Models"}),n.jsx(g0,{models:l.models||{}})]}),Object.keys(l.providers||{}).length>1&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Providers"}),n.jsx(b0,{providers:l.providers||{}})]})]})]}),T>0&&n.jsx("div",{className:"text-center py-4",children:n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:["You've been vibe coding for ",T," day",T!==1?"s":""," ·"," ",vt(g.durationMs)," total · ",Ml(g.toolCalls)," tool calls"]})})]})})}function w0(){const[l,r]=y.useState([]),[i,o]=y.useState([]),[u,m]=y.useState(!0),[p,g]=y.useState(!0),[f,h]=y.useState(!0),[x,v]=y.useState(null),[,C]=y.useState(null),[,j]=y.useState(null),w=y.useRef(!1),k=y.useRef(void 0),S=y.useMemo(()=>l.some(A=>A.provider==="cursor"),[l]),T=y.useCallback(async()=>{m(!0),g(!0),h(!0),v(null);try{const[A,R]=await Promise.all([fetch("/api/sources/cached").then(de=>de.ok?de.json():null).catch(()=>null),fetch("/api/sessions/cached").then(de=>de.ok?de.json():null).catch(()=>null)]),D=Na(A),O=Na(R);D?.sessions.length&&r(D.sessions),O?.sessions.length&&o(O.sessions),(D?.sessions.length||O?.sessions.length)&&m(!1);const $=Hs(D?.cachedAt),q=Hs(O?.cachedAt),ne=[];$&&g(!1),q&&h(!1),$||ne.push(new Promise(de=>{C(0);const oe=new EventSource("/api/sources/stream");oe.onmessage=I=>{try{const te=JSON.parse(I.data);te.type==="progress"?C(te.scanned):te.type==="complete"?(r(te.sessions),C(null),oe.close(),de()):te.type==="error"&&(D?.sessions.length||v(te.message||"Failed to load sessions"),C(null),oe.close(),de())}catch{}},oe.onerror=()=>{oe.close(),C(null),fetch("/api/sources").then(I=>{if(!I.ok)throw new Error("Failed to load sources");return I.json()}).then(I=>r(I.sessions)).catch(I=>{D?.sessions.length||v(I instanceof Error?I.message:"Failed to load sessions")}).finally(()=>de())}}).finally(()=>g(!1))),q||ne.push(fetch("/api/sessions").then(de=>{if(!de.ok)throw new Error("Failed to load replays");return de.json()}).then(de=>o(de)).catch(de=>{O?.sessions.length||v(de instanceof Error?de.message:"Failed to load replays")}).finally(()=>h(!1))),ne.length>0&&await Promise.allSettled(ne)}catch(A){v(A instanceof Error?A.message:"Failed to load data")}finally{m(!1)}},[]);return y.useEffect(()=>{T()},[T]),y.useEffect(()=>{if(!p&&!S&&!w.current)return;let A=!1,R;const D=async()=>{const $=await fetch("/api/sources/cached").then(ne=>ne.ok?ne.json():null).catch(()=>null),q=Na($);!A&&q?.sessions.length&&q.cachedAt!==k.current&&(k.current=q.cachedAt,r(q.sessions))},O=async()=>{const $=await fetch("/api/sources/enrichment-status").then(q=>q.ok?q.json():null).catch(()=>null);!$||A||(j($),$.running?(w.current=!0,await D()):w.current&&(w.current=!1,await D()))};return O(),R=window.setInterval(()=>{O()},2500),()=>{A=!0,R&&window.clearInterval(R)}},[S,p]),{sources:l,setSources:r,replays:i,loading:u,loadingSources:p,loadingReplays:f,error:x}}function N0(l,r){let i=0,o=0,u=0;const m=new Map(l.map(k=>[k.slug,k]));for(const k of l)i+=k.promptCount??(k.prompts?.length||(k.firstPrompt?1:0)),o+=k.toolCallCount??0;for(const k of r){const S=m.get(k.slug),T=k.stats.toolCalls||0;S?S.toolCallCount==null?o+=T:T>S.toolCallCount&&(o+=T-S.toolCallCount):(i+=k.stats.userPrompts||0,o+=T),u+=k.stats.durationMs||0}const p=new Map;for(const k of l)p.set(k.provider,(p.get(k.provider)||0)+1);const g={"claude-code":"Claude Code",cursor:"Cursor"},f=[...p.entries()].map(([k,S])=>({provider:k,count:S,label:g[k]||k})).sort((k,S)=>S.count-k.count),h=new Set;for(const k of l)h.add(k.project);for(const k of r)h.add(k.project);const x={};for(const k of l){const S=k.timestamp?.slice(0,10);S&&(x[S]=(x[S]||0)+1)}const v=l.length,C=r.length,j=l.filter(k=>k.existingReplay).length,w=v>0?j/v*100:0;return{totalSessions:v,totalReplays:C,totalPrompts:i,totalToolCalls:o,totalDuration:u,providerBreakdown:f,projectCount:h.size,sessionsPerDay:x,recentSources:[...l].sort((k,S)=>S.timestamp.localeCompare(k.timestamp)).slice(0,5),recentReplays:[...r].sort((k,S)=>S.startTime.localeCompare(k.startTime)).slice(0,5),publishedCount:r.filter(k=>k.gist?.gistId).length,replayConversionPct:w}}function k0(){return n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("div",{className:"h-3 w-28 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:5},(l,r)=>n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg",children:[n.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${50+r*17%30}%`}}),n.jsx("div",{className:"h-3 skeleton rounded",style:{width:`${60+r*23%25}%`}})]}),n.jsx("div",{className:"h-4 w-14 shrink-0 skeleton rounded"})]},r))}),n.jsx("div",{className:"h-8 mt-2 rounded-lg skeleton"})]})}function Zh({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Oh(l)}`,children:_h(l)})}function S0({sessions:l,isLoading:r,onViewAll:i,onGenerate:o,onViewReplay:u,onSessionClick:m,generatingSlug:p,generateErrorSlug:g}){return l.length===0?n.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading sessions...":"No sessions found. Start a coding session with Claude Code or Cursor."}):n.jsxs("div",{className:"space-y-1 flex-1 flex flex-col",children:[l.map(f=>{const h=!!f.existingReplay,x=p===f.slug,v=g===f.slug;return n.jsxs("div",{onClick:()=>m(f),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 cursor-pointer",children:[n.jsx(Zh,{provider:f.provider}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-sans text-terminal-text truncate",children:Eu(f)}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:Xn(f.project)})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:Ll(f.timestamp)}),h?n.jsxs("button",{onClick:C=>{C.stopPropagation(),u(f.existingReplay)},className:"h-7 px-3 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 flex items-center gap-1",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}):n.jsx("button",{onClick:C=>{C.stopPropagation(),o(f)},disabled:x,className:`h-7 px-3 text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 ${v?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis"}`,children:x?n.jsx("span",{className:"animate-pulse",children:"..."}):v?"Failed":n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})})]})]},`${f.provider}-${f.slug}`)}),n.jsx("button",{onClick:i,className:"w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all sessions →"})]})}function C0({replays:l,isLoading:r,onViewAll:i,onOpen:o}){return l.length===0?n.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading replays...":"No replays yet. Generate one from the Sessions tab."}):n.jsxs("div",{className:"space-y-1 flex-1 flex flex-col",children:[l.map(u=>n.jsxs("button",{onClick:()=>o(u.slug),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 text-left group",children:[n.jsx(Zh,{provider:u.provider}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:ou(u)}),n.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.userPrompts," prompts"]}),n.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.toolCalls," tools"]}),u.stats.durationMs&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:vt(u.stats.durationMs)})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.gist?.gistId&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:"published"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:Ll(u.startTime)})]})]},u.slug)),n.jsx("button",{onClick:i,className:"w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all replays →"})]})}const Wp=[{name:"claude",label:"Claude Code",purpose:"AI feedback via headless mode"},{name:"cursor",label:"Cursor CLI",purpose:"AI feedback via AI Studio"},{name:"opencode",label:"OpenCode",purpose:"AI feedback via headless mode"}];function E0(){const[l,r]=y.useState(()=>Wp.map(i=>({...i,installed:!1,detail:"checking...",loading:!0})));return y.useEffect(()=>{let i=!1;for(const o of Wp)fetch(`/api/system-checks?tool=${encodeURIComponent(o.name)}`).then(u=>u.ok?u.json():null).then(u=>{if(i)return;const m=u?.checks?.find(p=>p.name===o.name)||u?.checks?.[0];if(!m){r(p=>p.map(g=>g.name===o.name?{...g,installed:!1,detail:"check failed",loading:!1}:g));return}r(p=>p.map(g=>g.name===o.name?{...g,installed:!!m.installed,version:m.version,detail:m.detail,loading:!1}:g))}).catch(()=>{i||r(u=>u.map(m=>m.name===o.name?{...m,installed:!1,detail:"check failed",loading:!1}:m))});return()=>{i=!0}},[]),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3",children:"System"}),n.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:l.map(i=>n.jsxs("div",{className:"flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg",children:[n.jsx("div",{className:`w-2 h-2 mt-1 rounded-full shrink-0 ${i.loading?"bg-terminal-blue animate-pulse":i.installed?"bg-terminal-green":"bg-terminal-dim opacity-40"}`}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:`text-xs font-sans font-medium ${i.loading?"text-terminal-dim":i.installed?"text-terminal-text":"text-terminal-dimmer"}`,children:i.label}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dimmer truncate",children:i.purpose}),i.loading?n.jsx("p",{className:"text-[10px] font-mono text-terminal-blue truncate animate-pulse",children:"checking..."}):i.installed?n.jsx("p",{className:"text-[10px] font-mono text-terminal-green truncate",children:i.detail||i.version||"ready"}):n.jsx("p",{className:"text-[10px] font-mono text-terminal-orange truncate",children:i.detail||"not found"})]})]},i.name))})]})}function T0({onNavigate:l}){const{sources:r,setSources:i,replays:o,loading:u,loadingSources:m,loadingReplays:p,error:g}=w0(),f=y.useMemo(()=>N0(r,o),[r,o]),{scanStatus:h,userInsights:x}=Bl(),[v,C]=y.useState(null),[j,w]=y.useState(null),[k,S]=y.useState(null),T=k?r.find(V=>V.slug===k)??null:null,A=!x&&(m||!!h?.running||r.length>0),R=Math.max(f.projectCount,x?.totalProjects??0),D=x?.totalPrompts??f.totalPrompts,O=x?.totalToolCalls??f.totalToolCalls,$=f.providerBreakdown.length>0?f.providerBreakdown:Object.entries(x?.providers||{}).map(([V,ue])=>({provider:V,count:ue,label:V==="claude-code"?"Claude Code":V==="cursor"?"Cursor":V})).sort((V,ue)=>ue.count-V.count),q=Object.keys(f.sessionsPerDay).length>0?f.sessionsPerDay:x?.sessionsPerDay??{},ne=V=>{ht({view:null,session:V})},de=async V=>{C(V.slug),w(null);try{const ue=Eu(V),me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:V.provider,filePaths:V.filePaths,toolPaths:V.toolPaths,title:wt(ue)||void 0,sessionSlug:V.slug,sessionProject:V.project})}),B=await me.json();if(!me.ok)throw new Error(B.error||"Generation failed");ht({view:null,session:B.slug})}catch(ue){console.error("Generate error:",ue),w(V.slug),setTimeout(()=>w(me=>me===V.slug?null:me),2e3)}finally{C(null)}},oe=async(V,ue)=>{S(null),C(V.slug),w(null);try{const me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:V.provider,filePaths:V.filePaths,toolPaths:V.toolPaths,title:wt(ue)||void 0,sessionSlug:V.slug,sessionProject:V.project})}),B=await me.json();if(!me.ok)throw new Error(B.error||"Generation failed");ht({view:null,session:B.slug})}catch(me){console.error("Generate error:",me),w(V.slug),setTimeout(()=>w(B=>B===V.slug?null:B),2e3)}finally{C(null)}},I=async(V,ue)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(V)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:ue})})).ok)throw new Error("Failed to update title");i(B=>B.map(L=>L.slug===V&&L.replay?{...L,replay:{...L.replay,title:ue||void 0}}:L))},te=async V=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(V)}`,{method:"DELETE"})).ok)return;i(me=>me.map(B=>B.slug===V?{...B,replay:void 0,existingReplay:null}:B))}catch{}};return u&&!r.length&&!o.length?n.jsx("div",{className:"flex-1 overflow-auto animate-in fade-in duration-500",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"grid grid-cols-4 gap-6",children:Array.from({length:4},(V,ue)=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-8 w-20 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]},ue))}),n.jsx("div",{className:"space-y-1.5 pt-2",children:Array.from({length:3},(V,ue)=>n.jsx("div",{className:"h-3 skeleton rounded"},ue))}),n.jsx("div",{className:"h-9 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:Array.from({length:2},(V,ue)=>n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"h-3 w-28 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]}),Array.from({length:5},(me,B)=>n.jsxs("div",{className:"flex items-center gap-3 px-1 py-1",children:[n.jsx("div",{className:"h-5 w-14 skeleton rounded-full shrink-0"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${55+B*19%35}%`}}),n.jsx("div",{className:"h-2.5 w-20 skeleton rounded"})]}),n.jsx("div",{className:"h-3 w-12 skeleton rounded shrink-0"})]},B)),n.jsx("div",{className:"h-8 skeleton rounded"})]},ue))})]})}):g&&r.length===0&&o.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-center space-y-2",children:n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:g})})}):n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-start justify-between mb-4",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-1 flex-1 min-w-0",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(un,{value:f.totalSessions})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"sessions"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(un,{value:f.totalReplays})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"replays"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(un,{value:D})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"turns"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(un,{value:O})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"tool calls"})]})]}),n.jsx("div",{className:"flex flex-col items-end gap-1 shrink-0",children:$.map(V=>n.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-md ${V.provider==="claude-code"?"bg-terminal-orange/8":V.provider==="cursor"?"bg-terminal-blue/8":"bg-terminal-dim/8"}`,children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${V.provider==="claude-code"?"bg-terminal-orange":V.provider==="cursor"?"bg-terminal-blue":"bg-terminal-dim"}`}),n.jsx("span",{className:`text-[10px] font-mono tabular-nums ${V.provider==="claude-code"?"text-terminal-orange/80":V.provider==="cursor"?"text-terminal-blue/80":"text-terminal-dim"}`,children:V.label}),n.jsx("span",{className:`text-[10px] font-mono font-bold tabular-nums ${V.provider==="claude-code"?"text-terminal-orange":V.provider==="cursor"?"text-terminal-blue":"text-terminal-dim"}`,children:V.count})]},V.provider))})]}),n.jsx(Yh,{sessionsPerDay:q,weeks:52}),n.jsx("button",{onClick:()=>l("insights"),className:"w-full py-2.5 mt-3 text-xs font-sans font-semibold rounded-lg bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200",children:"View personal insights →"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-stretch",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Sessions"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalSessions," total"]})]}),n.jsx("div",{className:"flex-1 flex flex-col justify-between",children:n.jsx(S0,{sessions:f.recentSources,isLoading:m,onViewAll:()=>l("sessions"),onGenerate:de,onViewReplay:ne,onSessionClick:V=>S(V.slug),generatingSlug:v,generateErrorSlug:j})})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Replays"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalReplays," total"]})]}),n.jsx("div",{className:"flex-1 flex flex-col justify-between",children:n.jsx(C0,{replays:f.recentReplays,isLoading:p,onViewAll:()=>l("replays"),onOpen:ne})})]})]}),A?n.jsx(k0,{}):x&&x.topProjects.length>1?n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Projects"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[R," total"]})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:[...x.topProjects].sort((V,ue)=>(ue.lastActivity||"").localeCompare(V.lastActivity||"")).slice(0,5).map(V=>{const ue=Xn(V.project);return n.jsxs("button",{onClick:()=>{l("sessions"),setTimeout(()=>{ht({tab:"sessions",project:V.project})},50)},className:"flex items-center justify-between gap-2 px-3 py-2.5 rounded-lg bg-terminal-bg hover:bg-terminal-surface-hover transition-colors text-left group",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors",children:ue}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[V.sessions," session",V.sessions>1?"s":""," · ",V.prompts," prompts",V.durationMs>0&&` · ${Su(V.durationMs)}`]})]}),V.cost>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-orange tabular-nums shrink-0",children:["$",V.cost.toFixed(2)]})]},V.project)})}),x.topProjects.length>5&&n.jsx("button",{onClick:()=>l("projects"),className:"w-full py-2 mt-2 text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all projects →"})]}):null,n.jsx(E0,{})]}),T&&n.jsx(Ih,{session:T,onClose:()=>S(null),onGenerate:oe,onViewReplay:V=>ht({view:null,session:V}),onArchive:V=>{fetch(`/api/archive/${V}`,{method:"POST"}).catch(()=>{}),S(null)},onTitleSave:I,onDeleteReplay:te,isGenerating:v===T.slug,isArchived:!1})]})}function A0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date,u=new Date(o);u.setDate(u.getDate()-29);const m=[],p=new Date(u);for(;p<=o;){const g=p.toISOString().slice(0,10);m.push(l[g]||0),p.setDate(p.getDate()+1)}return m},[l]),i=Math.max(...r,1);return n.jsx("div",{className:"flex items-end gap-px h-4",children:r.map((o,u)=>n.jsx("div",{className:`w-1 rounded-sm ${o>0?"bg-terminal-green":"bg-terminal-surface-2"}`,style:{height:o>0?`${Math.max(20,o/i*100)}%`:"2px",opacity:o>0?.4+o/i*.6:.2}},u))})}function Xc(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function R0(l){if(!l)return"";const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:`${Math.floor(u/30)}mo ago`}function M0({onNavigate:l}){const{userInsights:r,scanStatus:i}=Bl(),[o,u]=y.useState("lastActivity"),m=y.useMemo(()=>{if(!r)return[];const f=[...r.topProjects];switch(o){case"lastActivity":f.sort((h,x)=>(x.lastActivity||"").localeCompare(h.lastActivity||""));break;case"sessions":f.sort((h,x)=>x.sessions-h.sessions);break;case"cost":f.sort((h,x)=>x.cost-h.cost);break;case"duration":f.sort((h,x)=>x.durationMs-h.durationMs);break}return f},[r,o]),p=i?.running&&i.total>0;if(!r&&!p)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2 text-terminal-dimmer text-sm font-mono",children:[n.jsx("p",{children:"No scan data available yet."}),n.jsx("p",{className:"text-xs",children:"Projects will appear once the background scan completes."})]})});if(!r&&p)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"flex items-center gap-2 text-terminal-dim text-sm font-mono",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),"Analyzing sessions... ",i.scanned,"/",i.total]})});const g=f=>{l("sessions"),setTimeout(()=>{ht({tab:"sessions",project:f})},50)};return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-sm font-sans font-semibold text-terminal-text",children:["All Projects",n.jsxs("span",{className:"ml-2 text-terminal-dimmer font-normal",children:["(",m.length,")"]})]})}),n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-sans",children:[n.jsx("span",{className:"text-terminal-dimmer mr-1",children:"Sort:"}),[["lastActivity","Recent"],["sessions","Sessions"],["cost","Cost"],["duration","Duration"]].map(([f,h])=>n.jsx("button",{onClick:()=>u(f),className:`px-2 py-1 rounded-md transition-colors ${o===f?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:h},f))]})]}),p&&n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Analyzing... ",i.scanned,"/",i.total]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:m.map(f=>{const h=f.project.split("/").pop()||f.project;return n.jsxs("button",{onClick:()=>g(f.project),className:"text-left bg-terminal-surface rounded-xl p-4 shadow-layer-sm hover:bg-terminal-surface-hover transition-all duration-200 group border-l-2 border-terminal-green/40 hover:border-terminal-green",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:h}),n.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer truncate mt-0.5",children:f.project})]}),f.lastActivity&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer shrink-0",children:R0(f.lastActivity)})]}),n.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono flex-wrap mb-3",children:[n.jsxs("span",{className:"text-terminal-text tabular-nums",children:[f.sessions," ",n.jsxs("span",{className:"text-terminal-dimmer",children:["session",f.sessions!==1?"s":""]})]}),f.durationMs>0&&n.jsx("span",{className:"text-terminal-blue tabular-nums",children:vt(f.durationMs)}),f.cost>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",f.cost.toFixed(2)]}),n.jsxs("span",{className:"text-terminal-green tabular-nums",children:[Xc(f.prompts)," ",n.jsx("span",{className:"text-terminal-dimmer",children:"prompts"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2",children:[f.toolCalls>0&&n.jsxs("span",{children:[Xc(f.toolCalls)," tools"]}),f.edits>0&&n.jsxs("span",{children:[Xc(f.edits)," edits"]}),f.branchCount>0&&n.jsxs("span",{children:[f.branchCount," branch",f.branchCount!==1?"es":""]}),f.prCount>0&&n.jsxs("span",{children:[f.prCount," PR",f.prCount!==1?"s":""]}),f.memoryFileCount>0&&n.jsxs("span",{children:[f.memoryFileCount," memory file",f.memoryFileCount!==1?"s":""]})]}),n.jsx(A0,{sessionsPerDay:f.sessionsPerDay})]},f.project)})})]})})}const D0=()=>n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[n.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]});function Au({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Oh(l)}`,children:_h(l)})}function _0({slug:l,title:r,fallbackTitle:i,onSave:o}){const u=wt(r||i||l),[m,p]=y.useState(!1),[g,f]=y.useState(u),[h,x]=y.useState(!1),v=y.useRef(null);y.useEffect(()=>{f(u)},[u]),y.useEffect(()=>{m&&v.current?.focus()},[m]);const C=async()=>{if(!h){x(!0);try{await o(l,wt(g))}finally{x(!1),p(!1)}}};return m?n.jsxs("div",{className:"min-w-0",children:[n.jsx("form",{onSubmit:j=>{j.preventDefault(),C()},className:"flex items-center gap-1.5 min-w-0",children:n.jsx("input",{ref:v,value:g,onChange:j=>f(j.target.value),onBlur:C,onKeyDown:j=>{j.key==="Escape"&&(f(u),p(!1))},className:"bg-terminal-surface-2 rounded px-2 py-0.5 text-sm font-sans text-terminal-text w-full outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/50 transition-shadow duration-200",placeholder:u,maxLength:Cu,disabled:h})}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l})]})]}):n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("button",{onClick:()=>p(!0),className:"group flex items-center gap-1 min-w-0 max-w-full text-left",title:"Click to edit title",children:[n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate",children:u||l}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"shrink-0 text-terminal-dim opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx("path",{d:"M11.5 1.5l3 3-9 9H2.5v-3l9-9z"})})]}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l})]})]})}function O0({onArchive:l,isArchived:r}){const[i,o]=y.useState(!1),u=y.useRef(null),m=y.useCallback(()=>o(!1),[]);return ku(u,m,i),n.jsxs("div",{className:"relative",ref:u,children:[n.jsx("button",{onClick:p=>{p.stopPropagation(),o(g=>!g)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:n.jsx(D0,{})}),i&&n.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:n.jsxs("button",{onClick:p=>{p.stopPropagation(),l(),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),r?"Unarchive":"Archive"]})})]})}let ni=null,Ms=null;function Vh(){return ni?Promise.resolve(ni):Ms||(Ms=fetch("/api/scan/results").then(l=>l.ok?l.json():null).then(l=>{const r=l?.results??null;return ni=r,setTimeout(()=>{ni=null,Ms=null},3e4),r}).catch(()=>null),Ms)}function uu(l,r,i){const o=[],u=new Set,m=[r?.firstPrompt,...l.prompts||[]];r?.firstPrompt||m.push(l.firstPrompt);for(const g of m){const f=zl(g||"");!f||u.has(f)||(u.add(f),o.push(f))}const p=zl(i||"");return o.length>1&&p&&o[0]===p&&o.shift(),o.length>1&&/^(?:and|but|or|so|then)\b/i.test(o[0]||"")&&o.shift(),o}function Qh(l){return l&&l!=="main"&&l!=="master"?l:void 0}function Xh(l,r){return l==="jsonl"?"bg-terminal-orange-subtle text-terminal-orange":l==="global-state"?"bg-terminal-blue-subtle text-terminal-blue":l==="sqlite"||r?"bg-terminal-green-subtle text-terminal-green":"bg-terminal-surface-2 text-terminal-dimmer"}function Ih({session:l,scanData:r=null,onClose:i,onGenerate:o,onViewReplay:u,onArchive:m,onTitleSave:p,onDeleteReplay:g,isGenerating:f,isArchived:h}){const[x,v]=y.useState(r),C=Eu(l),j=iu(l,x),[w,k]=y.useState(l.replay?.title||j),[S,T]=y.useState(!1),A=y.useRef(null);y.useEffect(()=>{const L=P=>{P.key==="Escape"&&i()};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[i]),y.useEffect(()=>{const L=A.current;L&&(L.focus(),L.setSelectionRange(L.value.length,L.value.length))},[]),y.useEffect(()=>{v(r)},[r]),y.useEffect(()=>{if(r)return;let L=!1;return Vh().then(P=>{if(L||!P)return;const se=P.find(X=>X.slug===l.slug);se&&v(se)}),()=>{L=!0}},[r,l.slug]),y.useEffect(()=>{k(L=>{const P=wt(L),se=wt(j),X=wt(l.replay?.title);return!P||P===X||P===l.slug||se&&P===wt(C)?l.replay?.title||j:L})},[C,j,l.replay?.title,l.slug]);const R=Qh(x?.gitBranch||l.gitBranch),D=x?.model||l.model,O=uu(l,x,j),$=x?.dataQualityNotes||[],q=x?.promptCount??l.promptCount,ne=x?.toolCallCount??l.toolCallCount,de=x?.editCount??l.editCountEst,oe=x?.durationMs??l.durationMsEst,I=x?.costEstimate??l.replay?.stats?.costEstimate,te=x?.tokenUsage?x.tokenUsage.inputTokens+x.tokenUsage.outputTokens:void 0,V=x?.startTime||l.timestamp,ue=async()=>{if(!l.replay||S)return;const L=wt(w);if(L!==wt(l.replay.title||j)){T(!0);try{await p(l.slug,L)}finally{T(!1)}}},me=()=>{o(l,w)};return n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[n.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:i}),n.jsxs("div",{className:"relative max-w-4xl w-full bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl animate-in zoom-in-95 fade-in duration-200 flex flex-col max-h-[88vh]",onClick:L=>L.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-7 pt-5 pb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Au,{provider:l.provider}),D&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:yi(D)}),x?.dataSource&&n.jsx("span",{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${Xh(x.dataSource,l.hasSqlite)}`,children:cu(l.hasSqlite,x.dataSource)}),x?.entrypoint&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:x.entrypoint}),x?.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"trust mode"}),x?.skillsUsed?.map(L=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400",children:L},L)),x?.mcpServersUsed?.map(L=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-purple-500/10 text-purple-400",children:L},L)),l.replay?.replayOutdated&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"outdated replay"})]}),n.jsx("button",{onClick:i,className:"h-7 w-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto px-7 space-y-5 pb-5",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[n.jsx("span",{className:"text-xs font-sans uppercase tracking-widest text-terminal-dimmer",children:"Title"}),n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:l.slug})]}),n.jsx("form",{onSubmit:L=>{L.preventDefault(),l.replay?ue():me()},children:n.jsx("textarea",{ref:A,value:w,onChange:L=>k(L.target.value.replace(/\n/g,"")),onBlur:()=>{l.replay&&ue()},onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),l.replay?ue():me())},rows:2,className:"w-full bg-terminal-surface rounded-xl px-5 py-4 text-lg font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/40 transition-shadow duration-200 resize-none leading-relaxed",placeholder:j,maxLength:Cu})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Session Info"}),n.jsx(ut,{label:"Project",value:Xn(l.project),title:l.project}),R&&n.jsx(ut,{label:"Branch",value:R}),x?.gitBranches&&x.gitBranches.length>1&&n.jsx(ut,{label:"Branches",value:x.gitBranches.join(", ")}),x?.skillsUsed&&x.skillsUsed.length>0&&n.jsx(ut,{label:"Skills",value:x.skillsUsed.join(", ")}),x?.mcpServersUsed&&x.mcpServersUsed.length>0&&n.jsx(ut,{label:"MCP Servers",value:x.mcpServersUsed.join(", ")}),n.jsx(ut,{label:"Started",value:`${oi(V)} (${Ll(V)})`}),x?.endTime&&n.jsx(ut,{label:"Ended",value:oi(x.endTime)}),!!oe&&n.jsx(ut,{label:"Duration",value:`~${vt(oe)}`}),n.jsx(ut,{label:"Size",value:ci(l.fileSize)}),n.jsx(ut,{label:"Lines",value:l.lineCount.toLocaleString()}),l.filePaths.length>1&&n.jsx(ut,{label:"Parts",value:`${l.filePaths.length} files`}),n.jsx(ut,{label:"Data",value:cu(l.hasSqlite,x?.dataSource)})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Stats"}),!!q&&n.jsx(ut,{label:"Prompts",value:String(q)}),!!ne&&n.jsx(ut,{label:"Tools",value:String(ne)}),!!de&&n.jsx(ut,{label:"Edits",value:x?String(de):`~${de}`}),I!=null&&I>0&&n.jsx(ut,{label:"Cost",value:Mh(I)}),te!=null&&n.jsx(ut,{label:"Tokens",value:te.toLocaleString(),title:x?.tokenUsage?`In: ${x.tokenUsage.inputTokens.toLocaleString()} / Out: ${x.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${x.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${x.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),x!=null&&x.subAgentCount>0&&n.jsx(ut,{label:"Agents",value:`${x.subAgentCount} sub-agents`}),x!=null&&x.compactionCount>0&&n.jsx(ut,{label:"Compacts",value:String(x.compactionCount)}),x!=null&&x.apiErrorCount>0&&n.jsx(ut,{label:"Errors",value:`${x.apiErrorCount} API errors`}),l.hasPR&&!x?.prLinks?.length&&n.jsx(ut,{label:"PR",value:"Yes"}),x?.prLinks?.map(L=>n.jsx(ut,{label:"PR",value:`#${L.prNumber} (${L.prRepository})`},L.prNumber))]})]}),$.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Data Quality"}),n.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5",children:$.map(L=>n.jsxs("div",{className:"flex gap-2 items-start text-xs font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange shrink-0 mt-px",children:"!"}),n.jsx("span",{children:L})]},L))})]}),x?.filesModified&&x.filesModified.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:["Files Modified (",x.filesModified.length,")"]}),n.jsxs("div",{className:"max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1",children:[x.filesModified.slice(0,20).map(L=>n.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-dim truncate",children:L.file}),n.jsxs("span",{className:"text-terminal-dimmer shrink-0 tabular-nums",children:[L.count,"x"]})]},L.file)),x.filesModified.length>20&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dimmer",children:["+",x.filesModified.length-20," more files"]})]})]}),O.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Prompts"}),n.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:O.map((L,P)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-2 leading-relaxed",children:L})]},P))})]}),l.replay&&n.jsxs("div",{className:"border-t border-terminal-border-subtle pt-4",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Replay"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.replay.replaySize!=null&&n.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:ci(l.replay.replaySize)}),l.replay.generatorVersion&&n.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dimmer",children:["v",l.replay.generatorVersion]}),!!l.replay.annotationCount&&n.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:[l.replay.annotationCount," annotations"]}),(l.replay.cloud||l.replay.gist)&&n.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-green-subtle text-terminal-green",children:l.replay.cloud?"Cloud":"Gist"})]})]}),l.expiresInDays!=null&&l.expiresInDays<=7&&n.jsxs("div",{className:`rounded-lg px-4 py-2.5 text-sm font-mono ${l.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,children:[l.expiresInDays===0?"Transcript expires today":`Transcript expires in ${l.expiresInDays} day${l.expiresInDays!==1?"s":""}`," — generate a replay to preserve it."]})]}),n.jsxs("div",{className:"flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{m(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors flex items-center gap-1.5",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),h?"Unarchive":"Archive"]}),l.replay&&n.jsxs("button",{onClick:()=>{g(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-red/70 hover:text-terminal-red hover:bg-terminal-red-subtle transition-colors flex items-center gap-1.5",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9"})}),"Delete replay"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[l.replay&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>o(l,w),disabled:f,className:"h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 flex items-center gap-2 disabled:opacity-50",children:f?n.jsx("span",{className:"animate-pulse",children:"Regenerating..."}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]}),"Regenerate"]})}),n.jsxs("button",{onClick:()=>u(l.existingReplay),className:"h-11 px-6 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2",children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M5 3l8 5-8 5V3z"})}),"View Replay"]})]}),!l.replay&&n.jsx("button",{onClick:me,disabled:f,className:"h-12 px-8 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2 shadow-lg shadow-terminal-green/20 disabled:opacity-50",children:f?n.jsx("span",{className:"animate-pulse",children:"Generating..."}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate Replay"]})})]})]})]})]})}function ut({label:l,value:r,title:i}){return n.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[n.jsx("span",{className:"text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]",children:l}),n.jsx("span",{className:"text-sm font-mono text-terminal-dim truncate",title:i||r,children:r})]})}function Jh({summary:l,onOpen:r,onShare:i,onTitleSave:o,onDelete:u,onRegenerate:m,onArchive:p,isDeleting:g,isRegenerating:f,isArchived:h}){const[x,v]=y.useState(!1),[C,j]=y.useState(!1),w=y.useRef(null),k=y.useCallback(()=>{j(!1),v(!1)},[]);return ku(w,k,C),n.jsxs("div",{onClick:r,className:`bg-terminal-surface rounded-xl px-5 py-5 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-3.5 shadow-layer-sm cursor-pointer hover-lift ${h?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:o?n.jsx("div",{className:"flex-1 min-w-0",onClick:S=>S.stopPropagation(),children:n.jsx(_0,{slug:l.slug,title:l.title,fallbackTitle:ou(l),onSave:o})}):n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate block",children:ou(l)}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l.slug})]})]})}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.replayOutdated&&n.jsxs("span",{className:"h-6 px-2 text-[10px] font-mono rounded-md bg-terminal-orange-subtle text-terminal-orange flex items-center gap-1",title:`Generated with v${l.generatorVersion||"?"} — regenerate to update`,children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),n.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]}),"outdated"]}),l.gist?.outdated&&n.jsx("button",{onClick:S=>{S.stopPropagation(),i?.()},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis transition-all duration-200 ease-material shrink-0",title:"Gist out of sync — click to update",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})})}),i&&n.jsxs("button",{onClick:S=>{S.stopPropagation(),i()},className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 ${l.cloud||l.gist?"bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis":"bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis"}`,title:l.cloud||l.gist?"Already shared — view or update":"Share & Export",children:[l.cloud||l.gist?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"})}):n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M8 2v8M5 5l3-3 3 3M3 11v2h10v-2"})}),l.cloud||l.gist?"Shared":"Share"]}),m&&n.jsxs("button",{onClick:S=>{S.stopPropagation(),m()},disabled:f,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 disabled:opacity-50",title:"Redo",children:[f?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]}),"Redo"]}),n.jsxs("button",{onClick:r,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 shrink-0",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}),(u||p)&&n.jsxs("div",{className:"relative",ref:w,children:[n.jsx("button",{onClick:S=>{S.stopPropagation(),j(T=>!T),v(!1)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[n.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),C&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:[p&&n.jsxs("button",{onClick:S=>{S.stopPropagation(),p(),j(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),h?"Unarchive":"Archive"]}),u&&n.jsxs(n.Fragment,{children:[p&&n.jsx("div",{className:"mx-2 my-1 border-t border-terminal-border"}),x?n.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[n.jsx("button",{onClick:S=>{S.stopPropagation(),u(),v(!1),j(!1)},className:"h-6 px-2 text-xs font-sans rounded bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-colors duration-200",children:"Confirm"}),n.jsx("button",{onClick:()=>v(!1),className:"h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]}):n.jsxs("button",{onClick:()=>v(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-red hover:bg-terminal-red-subtle transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M3 4h10M5.5 4V3a1 1 0 011-1h3a1 1 0 011 1v1M6.5 7v4M9.5 7v4M4.5 4l.5 9a1 1 0 001 1h4a1 1 0 001-1l.5-9"})}),"Delete"]})]})]})]})]})]}),(l.messages||(l.firstMessage?[l.firstMessage]:[])).map(S=>zl(S||"")).filter(S=>S.length>0).map((S,T)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:S})]},T)),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[l.stats.userPrompts," prompts"]}),n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[l.stats.toolCalls," tools"]}),l.stats.durationMs&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:vt(l.stats.durationMs)}),l.stats.costEstimate&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-green-subtle text-terminal-green",children:Mh(l.stats.costEstimate)}),l.hasAnnotations&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-blue-subtle text-terminal-blue",children:[l.annotationCount," annotation",l.annotationCount!==1?"s":""]}),l.replaySize!=null&&l.replaySize>0&&n.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${l.replaySize>10*1024*1024?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,title:l.replaySize>10*1024*1024?"Exceeds share limit (10MB)":void 0,children:ci(l.replaySize)})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap",children:[n.jsx(Au,{provider:l.provider}),n.jsx("span",{children:l.project}),n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{children:oi(l.startTime)}),l.model&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{children:l.model})]})]})]})}function eh(){const[l,r]=y.useState(!1),[i,o]=y.useState(null),[u,m]=y.useState(null),p=async()=>{r(!0),m(null),o(null);try{const g=await fetch("/api/regenerate-all",{method:"POST"}),f=await g.json();if(!g.ok)throw new Error(f.error||"Failed");o({regenerated:f.regenerated,total:f.total}),setTimeout(()=>window.location.reload(),1500)}catch(g){m(g instanceof Error?g.message:"Failed to regenerate")}finally{r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:p,disabled:l,className:"px-3 py-1.5 text-xs font-mono rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border border-terminal-border-subtle transition-colors duration-200 disabled:opacity-40",children:l?"Regenerating...":"Regenerate All"}),i&&n.jsxs("span",{className:"text-xs font-mono text-terminal-green",children:[i.regenerated,"/",i.total," regenerated"]}),u&&n.jsx("span",{className:"text-xs font-mono text-terminal-red",children:u})]})}function L0(){const[l,r]=y.useState([]),[i,o]=y.useState({}),[u,m]=y.useState(null),[p,g]=y.useState(!0),[f,h]=y.useState(null),[x,v]=y.useState(!1),[C,j]=y.useState(null),[w,k]=y.useState(null),[S,T]=y.useState(null),[A,R]=y.useState(()=>Date.now()),{selectedProject:D,filter:O,showArchived:$,handleProjectChange:q,handleFilterChange:ne,handleToggleArchived:de}=Bh(),{scanStatus:oe,userInsights:I,projectInsightsCache:te,fetchProjectInsights:V}=Bl();y.useEffect(()=>{D!==pt&&V(D)},[D,V]);const ue=D!==pt?te.get(D):void 0,[me,B]=y.useState(null),[L,P]=y.useState(null),[se,X]=y.useState(null),E=y.useRef(!1),[_,F]=y.useState(new Set),[J,K]=y.useState(null),pe=l.some(Q=>Q.provider==="cursor"),he=se?l.find(Q=>Q.slug===se)??null:null,ce=y.useCallback(async Q=>{g(!0),h(null),k(null),v(!1),j(null);const ve=await fetch("/api/archived").then(ee=>ee.ok?ee.json():{slugs:[]}).catch(()=>({slugs:[]}));F(new Set(ve.slugs));let Ae=!1;const Te=await fetch("/api/sources/cached").then(ee=>ee.ok?ee.json():null).catch(()=>null),$e=Na(Te),Ie=!Q?.forceRefresh&&Hs($e?.cachedAt);if($e&&$e.sessions.length>0&&(Ae=!0,r($e.sessions),T($e.cachedAt??null),j(Ie?null:$e.cachedAt??null),g(!1),v(!Ie)),Ie){v(!1),g(!1);return}try{const ee=await fetch("/api/sources");if(!ee.ok)throw new Error("Failed to load sessions");const le=await ee.json();r(le.sessions),le.cleanupPeriodDays!=null&&m(le.cleanupPeriodDays),T(new Date().toISOString()),j(null)}catch(ee){Ae?k("Failed to refresh latest sessions. Showing cached data."):h(ui(ee)||"Failed to load sessions")}finally{v(!1),g(!1)}},[]),be=Q=>Lh(Q,_,F);y.useEffect(()=>{ce()},[ce]),y.useEffect(()=>{if(l.length===0)return;let Q=!1;const ve=async()=>{const Te=await Vh();Q||!Te||o(Object.fromEntries(Te.filter($e=>$e.slug).map($e=>[$e.slug,$e])))};ve();const Ae=window.setInterval(()=>{ve()},oe?.running?5e3:3e4);return()=>{Q=!0,window.clearInterval(Ae)}},[oe?.running,l.length]),y.useEffect(()=>{if(!p&&!pe&&!E.current)return;let Q=!1,ve;const Ae=async()=>{const $e=await fetch("/api/sources/cached").then(ee=>ee.ok?ee.json():null).catch(()=>null),Ie=Na($e);!Q&&Ie?.sessions.length&&r(Ie.sessions)},Te=async()=>{const $e=await fetch("/api/sources/enrichment-status").then(Ie=>Ie.ok?Ie.json():null).catch(()=>null);!$e||Q||(K($e),$e.running?(E.current=!0,await Ae()):E.current&&(E.current=!1,await Ae()))};return Te(),ve=window.setInterval(()=>{Te()},2500),()=>{Q=!0,ve&&window.clearInterval(ve)}},[pe,p]),y.useEffect(()=>{const Q=window.setInterval(()=>R(Date.now()),3e4);return()=>window.clearInterval(Q)},[]);const we=async(Q,ve)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(Q)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:ve})})).ok)throw new Error("Failed to update title");r(Te=>Te.map($e=>$e.slug===Q&&$e.replay?{...$e,replay:{...$e.replay,title:ve||void 0}}:$e))},Le=async(Q,ve)=>{X(null),B(Q.slug),P(null);try{const Ae=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:Q.provider,filePaths:Q.filePaths,toolPaths:Q.toolPaths,title:wt(ve)||void 0,sessionSlug:Q.slug,sessionProject:Q.project})}),Te=await Ae.json();if(!Ae.ok)throw new Error(Te.error||"Generation failed");ht({view:null,session:Te.slug})}catch(Ae){P(ui(Ae))}finally{B(null)}},He=async Q=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(Q)}`,{method:"DELETE"})).ok)return;r(Ae=>Ae.map(Te=>Te.slug===Q?{...Te,replay:void 0,existingReplay:null}:Te))}catch{}},Ve=l.filter(Q=>_.has(Q.slug)).length,et=$?l:l.filter(Q=>!_.has(Q.slug)),nt=new Map;for(const Q of et)nt.has(Q.project)||nt.set(Q.project,[]),nt.get(Q.project)?.push(Q);const Yt=[...nt.entries()].sort((Q,ve)=>{const Ae=Q[1][0]?.timestamp||"";return(ve[1][0]?.timestamp||"").localeCompare(Ae)}),dt=zh(Yt.map(([Q])=>Q)),at=D===pt?et:nt.get(D)||[],bn=O?at.filter(Q=>Q.slug.toLowerCase().includes(O.toLowerCase())||Q.firstPrompt.toLowerCase().includes(O.toLowerCase())||(Q.title||"").toLowerCase().includes(O.toLowerCase())||(Q.gitBranch||"").toLowerCase().includes(O.toLowerCase())):at,dn=S?Rh(S,A):null,Rt=p&&l.length===0,Dt=7,Ft=l.filter(Q=>Q.expiresInDays!=null&&Q.expiresInDays<=Dt&&!_.has(Q.slug)),Ge=Ft.reduce((Q,ve)=>Math.min(Q,ve.expiresInDays??1/0),1/0);return f&&l.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:f}),n.jsx("button",{onClick:()=>void ce({forceRefresh:!0}),className:"px-3 py-1.5 text-xs font-mono rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",children:"Retry"})]})}):l.length===0&&!Rt?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No AI sessions found"}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Start a coding session with Claude Code or Cursor, then come back here"})]})}):n.jsxs("div",{className:"flex flex-1 min-h-0",children:[n.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),dn&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:dn})]}),n.jsx("button",{onClick:()=>{ce({forceRefresh:!0})},className:"p-1.5 rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"Refresh",children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),n.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[n.jsxs("button",{onClick:()=>q(pt),className:`w-full text-left px-3 py-2.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${D===pt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[n.jsx("span",{className:"font-medium",children:"All projects"}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${D===pt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:l.length})]}),n.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),Yt.map(([Q,ve])=>{const Ae=ve.filter(le=>le.existingReplay).length,Te=D===Q,$e=dt.get(Q)||Xn(Q),Ie=ve[0]?.projectExists!==!1,ee=ve.some(le=>le.isGitRepo||le.gitBranch);return n.jsxs("button",{onClick:()=>q(Q),title:Q,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${Te?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"} ${Ie?"":"opacity-50"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[n.jsxs("span",{className:`text-xs font-sans truncate flex items-center gap-1.5 ${Te?"text-terminal-green font-medium":Ie?"text-terminal-text group-hover:text-terminal-text":"text-terminal-dim"}`,children:[ee&&n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",className:`shrink-0 ${Te?"opacity-70":"opacity-40"}`,children:n.jsx("path",{fillRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),$e]}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${Te?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:ve.length})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${Te?"text-terminal-dim":"text-terminal-dimmer"}`,children:Ll(ve[0]?.timestamp||"")}),Ae>0&&n.jsxs("span",{className:`text-xs font-mono ${Te?"text-terminal-green":"text-terminal-dimmer"}`,children:[Ae," ",Ae===1?"replay":"replays"]})]})]},Q)})]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[n.jsx("div",{className:"md:hidden px-3 pt-3",children:n.jsxs("select",{value:D,onChange:Q=>q(Q.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-sans text-terminal-text outline-none shadow-layer-sm",children:[n.jsxs("option",{value:pt,children:["All projects (",l.length,")"]}),Yt.map(([Q,ve])=>n.jsxs("option",{value:Q,children:[dt.get(Q)||Xn(Q)," (",ve.length,")"]},Q))]})}),n.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:ue&&D!==pt?n.jsx(di,{insights:ue,variant:"project"}):I&&D===pt?n.jsx(di,{insights:I,variant:"all"}):n.jsx(Hh,{})}),n.jsxs("div",{className:"flex gap-2 items-center",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:Q=>ne(Q.target.value),placeholder:"Filter by branch, title, prompt...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),Ve>0&&n.jsx("button",{onClick:de,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${Ve} archived)`,children:$?"Active":"View all"})]})]}),(Rt||x||C)&&n.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:Rt?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"FETCHING SESSIONS..."})]}):x?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"SCANNING LATEST SESSIONS..."}),C&&n.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",ii(C),")"]})]}):C?n.jsxs("span",{children:["Showing stale cache (",ii(C),")"]}):null}),J?.running&&J.total>0&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsxs("span",{children:["BACKFILLING CURSOR STATS... ",J.processed,"/",J.total]})]}),w&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-orange-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-orange shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:w}),n.jsx("button",{onClick:()=>k(null),className:"ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors",children:"×"})]}),L&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:L}),n.jsx("button",{onClick:()=>P(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),Ft.length>0&&n.jsxs("div",{className:"mx-4 mb-2 flex items-start gap-2.5 bg-terminal-orange-subtle rounded-lg px-4 py-3 shrink-0 shadow-layer-sm",children:[n.jsx("span",{className:"text-terminal-orange text-base leading-none mt-0.5",children:"⚠"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"text-xs font-sans font-semibold text-terminal-orange",children:[Ft.length," session",Ft.length!==1?"s":""," expiring",Ge===0?" today":Ge===1?" tomorrow":` within ${Ge} days`]}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-orange/70 mt-0.5",children:["Claude Code auto-deletes transcripts after"," ",u!=null?`${u} days`:"the configured period",". Generate replays to preserve them."]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:Rt?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching sessions..."}):bn.length===0?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:O?"No sessions match your filter":"No sessions in this project"}):n.jsx("div",{className:"space-y-2.5 px-4 py-3",children:bn.map(Q=>{const ve=i[Q.slug];if(Q.replay){const Je=_.has(Q.slug),ze=iu(Q,ve),rt=uu(Q,ve,ze);return n.jsx(Jh,{summary:{...Q.replay,title:ze,firstMessage:rt[0]||ve?.firstPrompt||Q.replay.firstMessage,messages:rt.length>0?rt.slice(0,2):ve?.firstPrompt?[ve.firstPrompt]:Q.replay.messages,model:ve?.model||Q.replay.model},onOpen:()=>ht({view:null,session:Q.existingReplay}),onShare:()=>ht({view:null,session:Q.existingReplay,v:"export"}),onTitleSave:we,onRegenerate:()=>X(Q.slug),isRegenerating:me===Q.slug,onDelete:()=>He(Q.slug),onArchive:()=>be(Q.slug),isArchived:Je},`${Q.provider}-${Q.slug}`)}const Ae=iu(Q,ve),Te=uu(Q,ve,Ae),$e=Qh(ve?.gitBranch||Q.gitBranch),Ie=ve?.promptCount??Q.promptCount,ee=ve?.toolCallCount??Q.toolCallCount,le=ve?.durationMs??Q.durationMsEst,fe=ve?.editCount??Q.editCountEst,ke=ve?.model||Q.model,Ne=cu(Q.hasSqlite,ve?.dataSource),Re=_.has(Q.slug);return n.jsxs("div",{onClick:()=>X(Q.slug),className:`bg-terminal-surface rounded-xl px-5 py-4 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-2.5 shadow-layer-sm cursor-pointer hover-lift ${Re?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[n.jsx("span",{className:"text-sm font-mono text-terminal-text truncate block",children:Ae}),n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:Q.slug})]}),$e&&n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded bg-terminal-surface-2 text-terminal-dim shrink-0 inline-flex items-center gap-0.5",children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"5",cy:"4",r:"2"}),n.jsx("circle",{cx:"11",cy:"12",r:"2"}),n.jsx("path",{d:"M5 6v4c0 1.1.9 2 2 2h2"})]}),$e]})]})]}),n.jsxs("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Ll(Q.timestamp)}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:Je=>{Je.stopPropagation(),X(Q.slug)},disabled:me===Q.slug,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 disabled:opacity-50",children:me===Q.slug?n.jsx("span",{className:"animate-pulse",children:"Generating..."}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})}),n.jsx(O0,{onArchive:()=>be(Q.slug),isArchived:Re})]})]})]}),Te.map((Je,ze)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:Je})]},ze)),(Q.promptCount||ee||le||fe||Q.hasPR||Q.expiresInDays!=null&&Q.expiresInDays<=Dt)&&n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[!!Ie&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[Ie," prompts"]}),!!ee&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[ee," tools"]}),!!le&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated active duration",children:["~",vt(le)]}),!!fe&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated file edits",children:["~",fe," edits"]}),Q.hasPR&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",title:"Session produced a PR",children:"PR"}),Q.expiresInDays!=null&&Q.expiresInDays<=Dt&&n.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md ${Q.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,title:`Session transcript will be cleaned up by Claude Code in ${Q.expiresInDays===0?"< 1 day":`${Q.expiresInDays} day${Q.expiresInDays!==1?"s":""}`}. Generate a replay to preserve it.`,children:Q.expiresInDays===0?"expires today":`expires in ${Q.expiresInDays}d`})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsx(Au,{provider:Q.provider}),D===pt&&n.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:Q.project,children:dt.get(Q.project)||Xn(Q.project)}),ke&&n.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:yi(ke)}),n.jsx("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:ci(Q.fileSize)}),Q.filePaths.length>1&&n.jsxs("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:[Q.filePaths.length," parts"]}),(Q.hasSqlite||ve?.dataSource)&&n.jsx("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${Xh(ve?.dataSource,Q.hasSqlite)}`,title:Ne,children:Ne})]})]},`${Q.provider}-${Q.slug}`)})})}),he&&n.jsx(Ih,{session:he,scanData:i[he.slug]||null,onClose:()=>X(null),onGenerate:Le,onViewReplay:Q=>ht({view:null,session:Q}),onArchive:Q=>{be(Q)},onTitleSave:we,onDeleteReplay:He,isGenerating:me===he.slug,isArchived:_.has(he.slug)})]})]})}function z0(){const[l,r]=y.useState([]),[i,o]=y.useState(!0),[u,m]=y.useState(!1),[p,g]=y.useState(!1),[f,h]=y.useState(null),[x,v]=y.useState(null),[C,j]=y.useState(()=>Date.now()),[w,k]=y.useState(new Set),[S,T]=y.useState(null),[A,R]=y.useState(null),{selectedProject:D,filter:O,showArchived:$,handleProjectChange:q,handleFilterChange:ne,handleToggleArchived:de}=Bh(),{userInsights:oe,projectInsightsCache:I,fetchProjectInsights:te}=Bl();y.useEffect(()=>{D!==pt&&te(D)},[D,te]);const V=D!==pt?I.get(D):void 0;y.useEffect(()=>{let ce=!0;return(async()=>{o(!0),g(!1),h(null);const we=await fetch("/api/archived").then(nt=>nt.ok?nt.json():{slugs:[]}).catch(()=>({slugs:[]}));ce&&k(new Set(we.slugs));let Le=!1;const He=await fetch("/api/sessions/cached").then(nt=>nt.ok?nt.json():null).catch(()=>null),Ve=Na(He),et=Hs(Ve?.cachedAt);if(ce&&Ve&&(Le=!0,r(Ve.sessions),m(!0),v(Ve.cachedAt??null),(Ve.sessions.length>0||et)&&(h(et?null:Ve.cachedAt??null),o(!1),g(!et))),et){ce&&(g(!1),o(!1));return}try{const nt=await fetch("/api/sessions");if(!nt.ok)throw new Error("Failed to load sessions");const Yt=await nt.json();if(!ce)return;r(Yt),m(!0),v(new Date().toISOString()),h(null)}catch{if(!ce)return;Le||m(!1)}finally{ce&&(g(!1),o(!1))}})(),()=>{ce=!1}},[]),y.useEffect(()=>{const ce=window.setInterval(()=>j(Date.now()),3e4);return()=>window.clearInterval(ce)},[]);const ue=ce=>Lh(ce,w,k),me=async(ce,be)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(ce)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:be})})).ok)throw new Error("Failed to update title");r(Le=>Le.map(He=>He.slug===ce?{...He,title:be||void 0}:He))},B=ce=>{ht({view:null,session:ce})},L=async ce=>{T(null);try{const be=await fetch(`/api/sessions/${encodeURIComponent(ce)}`,{method:"DELETE"});if(!be.ok){const we=await be.json().catch(()=>({}));T(we.error||"Failed to delete session");return}r(we=>we.filter(Le=>Le.slug!==ce))}catch{T("Failed to delete session")}},P=async ce=>{R(ce.slug);try{const be=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:ce.provider,sessionSlug:ce.slug,sessionProject:ce.project,sessionId:ce.sessionId||void 0,title:ce.title||void 0})}),we=await be.json();if(!be.ok)throw new Error(we.error||"Regeneration failed");ht({view:null,session:we.slug})}catch(be){console.error("Regenerate error:",ui(be))}finally{R(null)}},se=l.filter(ce=>w.has(ce.slug)).length,X=$?l:l.filter(ce=>!w.has(ce.slug)),E=new Map;for(const ce of X)E.has(ce.project)||E.set(ce.project,[]),E.get(ce.project)?.push(ce);const _=[...E.entries()].sort((ce,be)=>{const we=ce[1][0]?.startTime||"";return(be[1][0]?.startTime||"").localeCompare(we)}),F=zh(_.map(([ce])=>ce)),J=D===pt?X:E.get(D)||[],K=O?J.filter(ce=>(ce.title||"").toLowerCase().includes(O.toLowerCase())||ce.slug.toLowerCase().includes(O.toLowerCase())||ce.project.toLowerCase().includes(O.toLowerCase())||ce.provider.toLowerCase().includes(O.toLowerCase())||(ce.firstMessage||"").toLowerCase().includes(O.toLowerCase())):J,pe=x?Rh(x,C):null,he=i&&l.length===0;return!he&&(!u||l.length===0)?n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6 space-y-6",children:[n.jsx(eh,{}),u&&l.length===0&&n.jsxs("div",{className:"text-center py-12 space-y-2",children:[n.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No replays yet"}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Go to the Sessions tab to generate your first replay"})]}),!u&&n.jsx("div",{className:"text-center py-8 space-y-2",children:n.jsxs("div",{className:"text-terminal-dimmer font-mono text-xs",children:["Or run ",n.jsx("span",{className:"text-terminal-green",children:"npx vibe-replay"})," to create a replay from your AI coding sessions"]})})]})}):n.jsxs("div",{className:"flex flex-1 min-h-0",children:[n.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[n.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),pe&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:pe})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[n.jsxs("button",{onClick:()=>q(pt),className:`w-full text-left px-3 py-2.5 text-xs font-mono rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${D===pt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[n.jsx("span",{className:"font-medium",children:"All replays"}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${D===pt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:X.length})]}),n.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),_.map(([ce,be])=>{const we=D===ce,Le=F.get(ce)||Xn(ce),He=be.filter(Ve=>Ve.gist?.gistId).length;return n.jsxs("button",{onClick:()=>q(ce),title:ce,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${we?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${we?"text-terminal-green font-medium":"text-terminal-text group-hover:text-terminal-text"}`,children:Le}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${we?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:be.length})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${we?"text-terminal-dim":"text-terminal-dimmer"}`,children:Ll(be[0]?.startTime||"")}),He>0&&n.jsxs("span",{className:`text-xs font-mono ${we?"text-terminal-purple":"text-terminal-dimmer"}`,children:[He," published"]})]})]},ce)})]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[n.jsx("div",{className:"md:hidden px-3 pt-3",children:n.jsxs("select",{value:D,onChange:ce=>q(ce.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-mono text-terminal-text outline-none shadow-layer-sm",children:[n.jsxs("option",{value:pt,children:["All replays (",X.length,")"]}),_.map(([ce,be])=>n.jsxs("option",{value:ce,children:[F.get(ce)||Xn(ce)," (",be.length,")"]},ce))]})}),n.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:V&&D!==pt?n.jsx(di,{insights:V,variant:"project"}):oe&&D===pt?n.jsx(di,{insights:oe,variant:"all"}):n.jsx(Hh,{})}),n.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:ce=>ne(ce.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),se>0&&n.jsx("button",{onClick:de,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${se} archived)`,children:$?"Active":"View all"}),n.jsx(eh,{})]}),n.jsxs("div",{className:"md:hidden flex gap-2 items-center",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:ce=>ne(ce.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),se>0&&n.jsx("button",{onClick:de,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${se} archived)`,children:$?"Active":"View all"})]})]}),(he||p||f)&&n.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:he?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"FETCHING REPLAYS..."})]}):p?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"SCANNING LATEST REPLAYS..."}),f&&n.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",ii(f),")"]})]}):f?n.jsxs("span",{children:["Showing stale cache (",ii(f),")"]}):null}),S&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:S}),n.jsx("button",{onClick:()=>T(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:he?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching replays..."}):K.length===0?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:O?"No replays match your filter":"No replays in this project"}):n.jsx("div",{className:"space-y-2.5 px-4 py-3",children:K.map(ce=>{const be=w.has(ce.slug);return n.jsx(Jh,{summary:ce,onOpen:()=>B(ce.slug),onShare:()=>ht({view:null,session:ce.slug,v:"export"}),onTitleSave:me,onDelete:()=>L(ce.slug),onRegenerate:()=>P(ce),onArchive:()=>ue(ce.slug),isRegenerating:A===ce.slug,isArchived:be},ce.slug)})})})]})]})}function B0(){const{scanStatus:l}=Bl(),r=!!l?.running,[i,o]=y.useState(!1),[u,m]=y.useState(!1),p=y.useRef(l);l&&(p.current=l);const g=p.current;if(y.useEffect(()=>{if(r)m(!1),o(!0);else if(i){m(!0);const x=setTimeout(()=>{o(!1),m(!1)},300);return()=>clearTimeout(x)}},[r,i]),!i||!g)return null;const f=g.phase==="discovering"?"Discovering sessions...":g.total>0?`Scanning ${g.scanned}/${g.total}`:"Preparing scan...",h=g.total>0?Math.round(g.scanned/g.total*100):0;return n.jsxs("div",{className:`fixed bottom-4 right-4 z-50 flex items-center gap-2.5 rounded-lg px-3.5 py-2.5 text-xs font-mono bg-terminal-surface border border-terminal-border shadow-layer-md transition-all duration-300 ${u?"opacity-0 translate-y-2":"opacity-100 translate-y-0 animate-in fade-in slide-in-from-bottom-2 duration-300"}`,children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0"}),n.jsx("span",{className:"text-terminal-dim",children:f}),g.total>0&&n.jsx("div",{className:"w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full bg-terminal-purple rounded-full transition-all duration-300",style:{width:`${h}%`}})})]})}function $0({headerLeft:l,headerRight:r}){const i=!!window.__VIBE_REPLAY_EDITOR__,o=y.useCallback(()=>{const h=new URLSearchParams(window.location.search).get("tab");return h==="home"||h==="sessions"||h==="replays"||h==="projects"||h==="insights"?h:i?"home":"replays"},[i]),[u,m]=y.useState(o());y.useEffect(()=>{const f=()=>m(o());return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[o]);const p=f=>{m(f),ht({tab:f,project:null,q:null,archived:null})},g=(f,h)=>n.jsx("button",{onClick:()=>p(f),className:`px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg transition-all duration-200 ease-material ${u===f?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text"}`,children:h},f);return n.jsxs(e0,{children:[n.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[i&&n.jsxs("div",{className:"shrink-0 px-5 py-2 border-b border-terminal-border-subtle glass-effect z-40 safe-top flex items-center gap-4",children:[l,n.jsxs("div",{className:"inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm shrink-0",children:[g("home","Home"),g("sessions","Sessions"),g("replays","Replays"),g("projects","Projects"),g("insights","Insights")]}),n.jsx("div",{className:"flex-1"}),r]}),u==="home"&&i?n.jsx(T0,{onNavigate:p}):u==="insights"&&i?n.jsx(j0,{}):u==="projects"&&i?n.jsx(M0,{onNavigate:p}):u==="sessions"&&i?n.jsx(L0,{}):n.jsx(z0,{})]}),n.jsx(B0,{})]})}function U0(l,r,i,o){const u=new Date().toISOString(),m={id:crypto.randomUUID(),sceneIndex:r,body:i,author:"anonymous",createdAt:u,updatedAt:u,resolved:!1};return[...l,m]}function H0(l,r,i){return l.map(o=>o.id===r?{...o,body:i,updatedAt:new Date().toISOString()}:o)}function G0(l,r){return l.filter(i=>i.id!==r)}function q0(l){return new Set(l.map(r=>r.sceneIndex))}function Y0(l){const r=new Map;for(const i of l)r.set(i.sceneIndex,(r.get(i.sceneIndex)||0)+1);return r}function F0(l,r){return JSON.stringify(l)!==JSON.stringify(r)}function th(l){return l.type==="tool-call"&&!l.diff&&!l.bashOutput}function Kh(l,r){const i=l[r];if(!th(i))return r;const o=i.toolName;let u=r;for(;u+1<l.length&&th(l[u+1])&&l[u+1].toolName===o;)u++;return u}function Ds(l,r){return(()=>{switch(l.type){case"user-prompt":return 1200;case"thinking":return 600;case"text-response":{const o=l.content.length;return Math.max(800,Math.min(o/40,5)*600)}case"tool-call":return l.diff?1200:l.bashOutput?900:400;case"compaction-summary":return 800;case"context-injection":return 600;default:return 800}})()/r}function Ol(l){return l==="user-prompt"||l==="compaction-summary"||l==="context-injection"}function Z0(l){const r=[];for(let i=0;i<l.length;i++)l[i].type==="user-prompt"&&r.push(i);return r}function V0(l,r){return l.find(i=>i>r)}function Q0(l,r){for(let i=l.length-1;i>=0;i--)if(l[i]<r)return l[i]}function Ic(l,r,i){let o=r+1;if(o>=l.length)return-1;if(i.promptsOnly){for(;o<l.length&&!Ol(l[o].type);)o++;return o>=l.length?-1:o}if(i.compactAssistant&&!Ol(l[o].type)){let m=o;for(;m+1<l.length&&!Ol(l[m+1].type);)m++;return m}return Kh(l,o)}function nh(l,r,i){let o=Math.max(0,r-1);if(r<=0)return 0;if(i.promptsOnly){for(;o>0&&!Ol(l[o].type);)o--;return o}if(i.compactAssistant){if(!Ol(l[r].type)){let p=r;for(;p>0&&!Ol(l[p-1].type);)p--;return Math.max(0,p-1)}return Math.max(0,r-1)}const u=l[o];if(u.type==="tool-call"&&!u.diff&&!u.bashOutput){const m=u.toolName;for(;o>0&&l[o-1].type==="tool-call"&&!l[o-1].diff&&!l[o-1].bashOutput&&l[o-1].toolName===m;)o--}return o}const X0="vibe-replay-annotations-";function ai(l){return X0+l}function kn(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function I0(l,r="embedded"){const i=l.meta.sessionId,o=r==="editor",u=!!window.__VIBE_REPLAY_DATA__||o,[m,p]=y.useState(()=>{const _=l.annotations??[];if(o)return _;try{const F=localStorage.getItem(ai(i));if(F){const J=JSON.parse(F);if(J.length>0||_.length===0)return J}}catch{}return _}),[g,f]=y.useState(()=>l.annotations??[]),h=F0(m,g),x=y.useRef(null);y.useEffect(()=>{if(o)return x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{fetch(kn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(()=>{f(m)}).catch(()=>{})},1e3),()=>{x.current&&clearTimeout(x.current)};try{localStorage.setItem(ai(i),JSON.stringify(m))}catch{}},[m,i,o]);const v=y.useMemo(()=>q0(m),[m]),C=y.useMemo(()=>Y0(m),[m]),j=y.useCallback((_,F)=>{p(J=>U0(J,_,F))},[]),w=y.useCallback((_,F)=>{p(J=>H0(J,_,F))},[]),k=y.useCallback(_=>{p(F=>G0(F,_))},[]),S=y.useCallback(()=>{if(o)return;const _={...l,annotations:m},J=`window.__VIBE_REPLAY_DATA__ = ${JSON.stringify(_).replace(/<\//g,"<\\/")};`,K=document.getElementById("vibe-replay-data");if(K){const he=K.textContent;K.textContent=J;const ce=`<!DOCTYPE html>
|
|
66
|
-
${document.documentElement.outerHTML}`;
|
|
67
|
-
${document.documentElement.outerHTML}`;document.head.removeChild(he),pe(ce)}function pe(he){const ce=new Blob([he],{type:"text/html"}),be=URL.createObjectURL(ce),we=document.createElement("a");we.href=be,we.download=`${l.meta.slug||"replay"}.html`,document.body.appendChild(we),we.click(),document.body.removeChild(we),URL.revokeObjectURL(be)}f(m);try{localStorage.removeItem(ai(i))}catch{}},[l,m,i,o]),T=y.useCallback(()=>{const _={...l,annotations:m},F=JSON.stringify(_,null,2),J=new Blob([F],{type:"application/json"}),K=URL.createObjectURL(J),pe=document.createElement("a");pe.href=K,pe.download="replay.json",document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(K),f(m);try{localStorage.removeItem(ai(i))}catch{}},[l,m,i]),[A,R]=y.useState(!1),D=o?async()=>{R(!0);try{await fetch(kn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(kn("/api/publish/gist"),{method:"POST"}),F=await _.json();if(!_.ok)throw new Error(F.error||`Server error: ${_.status}`);return f(m),F}finally{R(!1)}}:null,[O,$]=y.useState([]),[q,ne]=y.useState(null),[de,oe]=y.useState(!1),I=y.useRef(null),te=y.useMemo(()=>q&&O.find(_=>_.name===q)||null,[q,O]);y.useEffect(()=>{o&&fetch(kn("/api/feedback/detect")).then(_=>_.json()).then(_=>{if(!_.available)return;const F=Array.isArray(_.tools)?_.tools:_.tool?[_.tool]:[];$(F);const J=_.defaultTool?.name||_.tool?.name||F[0]?.name||null;ne(J)}).catch(()=>{})},[o]);const V=o&&q?async()=>{const _=new AbortController;I.current=_,oe(!0);try{await fetch(kn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),signal:_.signal});const F=await fetch(kn("/api/feedback/generate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:q}),signal:_.signal}),J=await F.json();if(!F.ok)throw new Error(J.error||"AI Coach failed");return p(J.annotations),f(J.annotations),{score:J.score,itemCount:J.itemCount}}finally{I.current=null,oe(!1)}}:null,ue=o?_=>{ne(_)}:null,me=o?()=>{I.current&&I.current.abort()}:null,[B,L]=y.useState(!1),P=o?async()=>{L(!0);try{await fetch(kn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(kn("/api/export/html"),{method:"POST"}),F=await _.json();if(!_.ok)throw new Error(F.error||`Export failed: ${_.status}`);const{path:J}=F;return f(m),J}finally{L(!1)}}:null,[se,X]=y.useState(!1);return{annotations:m,annotatedScenes:v,annotationCounts:C,add:j,update:w,remove:k,hasUnsaved:h,canSaveHtml:u,downloadHtml:S,downloadJson:T,publishGist:D,exportHtml:P,exportGithub:o?async()=>{X(!0);try{await fetch(kn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(kn("/api/export/github"),{method:"POST"}),F=await _.json();if(!_.ok)throw new Error(F.error||`Export failed: ${_.status}`);return f(m),F}finally{X(!1)}}:null,gistPublishing:A,htmlExporting:B,githubExporting:se,aiCoachTool:te,aiCoachTools:O,aiCoachToolName:q,setAiCoachToolName:ue,runAiCoach:V,cancelAiCoach:me,aiCoachRunning:de}}const ah={version:1,overlays:[]};function _s(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function J0(l,r="embedded"){const i=r==="editor",[o,u]=y.useState(ah),[m,p]=y.useState(new Set),[g,f]=y.useState(!1),[h,x]=y.useState([]),[v,C]=y.useState(null),[j,w]=y.useState(!1),[k,S]=y.useState(!1),T=y.useRef(null),A=y.useRef(null),R=y.useRef(!1);y.useEffect(()=>{i&&fetch(_s("/api/overlays")).then(se=>se.json()).then(se=>{se&&Array.isArray(se.overlays)&&u(se)}).catch(()=>{}).finally(()=>{R.current=!0})},[i]),y.useEffect(()=>{i&&fetch(_s("/api/feedback/detect")).then(se=>se.json()).then(se=>{if(!se.available)return;const X=Array.isArray(se.tools)?se.tools:se.tool?[se.tool]:[];x(X);const E=se.defaultTool?.name||se.tool?.name||X[0]?.name||null;C(E)}).catch(()=>{})},[i]),y.useEffect(()=>{if(!(!i||!R.current))return A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{fetch(_s("/api/overlays"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(()=>{})},1e3),()=>{A.current&&clearTimeout(A.current)}},[o,i]);const D=y.useCallback(se=>{const X=l.scenes[se];if(!X||X.type!=="user-prompt"&&X.type!=="text-response")return null;if(g||m.has(se))return X.content;const E=o.overlays.filter(F=>F.sceneIndex===se);return E.length===0?X.content:E.reduce((F,J)=>F.updatedAt>J.updatedAt?F:J).modifiedValue},[l.scenes,o,m,g]),O=y.useMemo(()=>{if(o.overlays.length===0||g)return l;const se=new Map;for(const E of o.overlays){const _=se.get(E.sceneIndex);_?_.push(E):se.set(E.sceneIndex,[E])}const X=new Map;for(const[E,_]of se){const F=_.reduce((J,K)=>J.updatedAt>K.updatedAt?J:K);X.set(E,F.modifiedValue)}return X.size===0?l:{...l,scenes:l.scenes.map((E,_)=>{if(m.has(_))return E;const F=X.get(_);return F&&(E.type==="user-prompt"||E.type==="text-response")?{...E,content:F}:E})}},[l,o,m,g]),$=y.useCallback(se=>o.overlays.some(X=>X.sceneIndex===se),[o]),q=y.useCallback(se=>o.overlays.filter(X=>X.sceneIndex===se),[o]),ne=y.useCallback(se=>{u(se)},[]),de=y.useCallback(se=>{u(X=>({...X,overlays:X.overlays.filter(E=>E.id!==se)}))},[]),oe=y.useCallback(se=>{u(X=>({...X,overlays:X.overlays.filter(E=>E.sceneIndex!==se)}))},[]),I=y.useCallback(()=>{u(ah)},[]),te=y.useCallback((se,X)=>{u(E=>({...E,overlays:E.overlays.map(_=>_.id===se?{..._,modifiedValue:X,source:{type:"manual"},updatedAt:new Date().toISOString()}:_)}))},[]),V=y.useCallback(se=>{p(X=>{const E=new Set(X);return E.has(se)?E.delete(se):E.add(se),E})},[]),ue=y.useCallback(()=>{f(se=>!se)},[]),me=y.useMemo(()=>i?se=>C(se):null,[i]),B=y.useMemo(()=>i?()=>{T.current&&T.current.abort()}:null,[i]),L=y.useMemo(()=>i&&v?async se=>{const X=new AbortController;T.current=X,w(!0);try{const E=await fetch(_s("/api/studio/translate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:v,targetLang:se.targetLang,sourceLang:se.sourceLang}),signal:X.signal}),_=await E.json();if(!E.ok)throw new Error(_.error||"Translation failed");return _.overlays&&u(_.overlays),_.stats}finally{T.current=null,w(!1)}}:null,[i,v]),P=y.useMemo(()=>i&&v?async se=>{const X=new AbortController;T.current=X,S(!0);try{const E=await fetch(_s("/api/studio/tone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:v,style:se.style}),signal:X.signal}),_=await E.json();if(!E.ok)throw new Error(_.error||"Tone adjustment failed");return _.overlays&&u(_.overlays),_.stats}finally{T.current=null,S(!1)}}:null,[i,v]);return{overlays:o,effectiveSession:O,getEffectiveContent:D,hasOverlay:$,getOverlays:q,overlayCount:o.overlays.length,setOverlays:ne,revertOverlay:de,revertSceneOverlays:oe,revertAll:I,updateOverlay:te,showOriginal:m,toggleOriginal:V,showAllOriginals:g,toggleAllOriginals:ue,studioTools:h,studioToolName:v,setStudioToolName:me,studioToolsAvailable:h.length>0,translating:j,toningDown:k,cancelStudio:B,runTranslate:L,runTone:P}}function K0(l){const r=l;if(!r)return!1;const i=r.tagName;if(i==="INPUT"||i==="TEXTAREA"||i==="SELECT"||r.isContentEditable)return!0;const o=r.getAttribute("role");return o==="textbox"||o==="combobox"}function P0(l,r,i=!0){const[o,u]=y.useState("idle"),[m,p]=y.useState(-1),[g,f]=y.useState(1),[h,x]=y.useState(0),v=y.useRef(null),C=y.useRef(o),j=y.useRef(m),w=y.useRef(g),k=y.useRef(r);C.current=o,j.current=m,w.current=g,k.current=r;const S=y.useMemo(()=>Z0(l),[l]),T=y.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),A=y.useCallback(()=>{if(C.current!=="playing")return;const oe=Ic(l,j.current,k.current);if(oe===-1){u("ended"),p(l.length-1),x(l.length);return}p(oe),x(oe+1);const I=Ds(l[oe],w.current);v.current=setTimeout(A,I)},[l]),R=y.useCallback(()=>{l.length!==0&&(C.current==="ended"&&(p(-1),x(0)),u("playing"),setTimeout(()=>{if(j.current<0){const oe=Kh(l,0);p(oe),x(oe+1);const I=Ds(l[oe],w.current);v.current=setTimeout(A,I)}else{const oe=l[j.current];if(oe){const I=Ds(oe,w.current)/2;v.current=setTimeout(A,I)}}},50))},[l,A]),D=y.useCallback(()=>{T(),u("paused")},[T]),O=y.useCallback(()=>{C.current==="playing"?D():R()},[R,D]),$=y.useCallback(oe=>{T();const I=Math.max(0,Math.min(oe,l.length-1));if(p(I),x(I+1),C.current==="playing"){const te=Ds(l[I],w.current);v.current=setTimeout(A,te)}(C.current==="ended"||C.current==="idle")&&u("paused")},[l,T,A]),q=y.useCallback(()=>{const oe=V0(S,j.current);oe!==void 0&&$(oe)},[S,$]),ne=y.useCallback(()=>{const oe=Q0(S,j.current);oe!==void 0&&$(oe)},[S,$]),de=y.useCallback(oe=>{if(f(oe),C.current==="playing"){T();const I=l[j.current];if(I){const te=Ds(I,oe);v.current=setTimeout(A,te)}}},[l,T,A]);return y.useEffect(()=>T,[T]),y.useEffect(()=>{if(!i)return;const oe=I=>{if(!K0(I.target))if(I.key===" "||I.key==="k")I.preventDefault(),O();else if(I.key==="ArrowDown"||I.key==="j"){C.current==="playing"&&D(),I.preventDefault();const te=Ic(l,j.current,k.current);te!==-1&&$(te)}else if(I.key==="ArrowUp"||I.key==="k"){C.current==="playing"&&D(),I.preventDefault();const te=nh(l,j.current,k.current);$(te)}else I.key==="ArrowLeft"||I.key==="h"?(I.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"collapse"}}))):I.key==="Escape"?C.current==="playing"&&(I.preventDefault(),D()):I.key==="ArrowRight"||I.key==="l"?(I.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"expand"}}))):I.key==="n"?(I.preventDefault(),q()):I.key==="p"?(I.preventDefault(),ne()):I.key==="Home"?(I.preventDefault(),$(0)):(I.key==="End"||I.key==="e")&&(I.preventDefault(),$(l.length-1))};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[i,O,$,q,ne,l,D]),{state:o,currentIndex:m,visibleCount:h,speed:g,play:R,pause:D,togglePlayPause:O,seekTo:$,changeSpeed:de,jumpToNextUserPrompt:q,jumpToPrevUserPrompt:ne,userPromptIndices:S,totalScenes:l.length,computeNextIndex:y.useCallback(oe=>Ic(l,oe,r),[l,r]),computePrevIndex:y.useCallback(oe=>nh(l,oe,r),[l,r])}}function W0(l){switch(l.displayMode){case"all":return{hideThinking:!1,collapseAllTools:!1,promptsOnly:!1,compactAssistant:!1};case"compact":return{hideThinking:!0,collapseAllTools:!0,promptsOnly:!1,compactAssistant:!0};case"custom":return{hideThinking:l.hideThinking,collapseAllTools:l.collapseAllTools,promptsOnly:l.promptsOnly,compactAssistant:!1}}}const du="vibe-replay-view-prefs",Jc={displayMode:"compact",hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function ey(){try{const l=localStorage.getItem(du);if(l){const r=JSON.parse(l);return r.displayMode?{...Jc,...r}:{...Jc,...r,displayMode:"compact"}}}catch{}return Jc}function ty(){const[l,r]=y.useState(ey),i=y.useCallback((u,m)=>{r(p=>{const g={...p,[u]:m};return localStorage.setItem(du,JSON.stringify(g)),g})},[]),o=y.useCallback(u=>{r(m=>{const p=m[u];if(typeof p!="boolean")return m;const g={...m,[u]:!p};return localStorage.setItem(du,JSON.stringify(g)),g})},[]);return{prefs:l,updatePref:i,togglePref:o}}function lh({size:l=14}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})})}function ny({className:l=""}){return n.jsxs("svg",{className:`animate-spin h-3.5 w-3.5 ${l}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function ay({toolName:l}){return l==="claude"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude -p"})," ","locally with your prompt piped to stdin. Uses your existing auth and token quota."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude"})," ","in your terminal to re-login."]})]}):l==="agent"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent -p"})," ","locally with your prompt piped to stdin. Uses your Cursor subscription or API key."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Check Cursor IDE settings or run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent"})," ","in your terminal."]})]}):l==="opencode"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode run"})," ","locally with your prompt piped to stdin. Uses your existing OpenCode configuration."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Not working? Run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode"})," ","in your terminal to verify setup."]})]}):n.jsxs("p",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed",children:["Runs ",n.jsx("span",{className:"text-terminal-text font-medium",children:l})," locally on your machine using your existing auth."]})}const ly=["English","Chinese (Simplified)","Chinese (Traditional)","Japanese","Korean","Spanish","French","German","Portuguese","Russian"],sy=[{value:"professional",label:"Professional"},{value:"neutral",label:"Neutral"},{value:"friendly",label:"Friendly"}];function ry({annotationActions:l,overlayActions:r}){const{studioTools:i,studioToolName:o,setStudioToolName:u,studioToolsAvailable:m,translating:p,toningDown:g,cancelStudio:f,runTranslate:h,runTone:x,overlayCount:v,revertAll:C}=r,{runAiCoach:j,aiCoachRunning:w,cancelAiCoach:k,aiCoachTools:S,aiCoachToolName:T,setAiCoachToolName:A}=l,R=!!j,D=l.annotations.some(K=>K.author==="vibe-feedback"),[O,$]=y.useState("English"),[q,ne]=y.useState("professional"),[de,oe]=y.useState(null),[I,te]=y.useState(null),[V,ue]=y.useState(null),[me,B]=y.useState(null),L=w||p||g,P=i.length>0?i:S,se=o||T,X=y.useCallback(async()=>{if(j){oe(null),B(null);try{const K=await j();oe({type:"success",text:`Score ${K.score}/10 — ${K.itemCount} comment(s)`})}catch(K){if(K instanceof DOMException&&K.name==="AbortError")return;oe({type:"error",text:K instanceof Error?K.message:"AI Coach failed"})}}},[j]),E=y.useCallback(async()=>{if(h){te(null),B(null);try{const K=await h({targetLang:O});te({type:"success",text:`${K.translated} message(s) translated, ${K.skipped} unchanged`})}catch(K){if(K instanceof DOMException&&K.name==="AbortError")return;te({type:"error",text:K instanceof Error?K.message:"Translation failed"})}}},[h,O]),_=y.useCallback(async()=>{if(x){ue(null),B(null);try{const K=await x({style:q});ue({type:"success",text:`${K.adjusted} prompt(s) adjusted, ${K.skipped} unchanged`})}catch(K){if(K instanceof DOMException&&K.name==="AbortError")return;ue({type:"error",text:K instanceof Error?K.message:"Tone adjustment failed"})}}},[x,q]),F=K=>r.overlays.overlays.some(pe=>pe.source.type===K),J=K=>{if(K==="coach"&&D){B("coach");return}if(K==="translate"&&F("translate")){B("translate");return}if(K==="tone"&&F("tone")){B("tone");return}K==="coach"?X():K==="translate"?E():_()};return!m&&S.length===0?n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2",children:[n.jsx(lh,{size:12}),n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8 text-center",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),n.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text mb-1",children:"No AI tools detected"}),n.jsx("p",{className:"text-xs font-mono text-terminal-dim mb-4 leading-relaxed",children:"AI Studio requires a local CLI tool. Install one of the following:"}),n.jsx("div",{className:"w-full space-y-2 text-left",children:[{name:"Claude Code",cmd:"npm install -g @anthropic-ai/claude-code",rec:!0},{name:"Cursor CLI",cmd:'Bundled with Cursor IDE (run as "agent")'},{name:"OpenCode",cmd:"go install github.com/opencode-ai/opencode@latest"}].map(K=>n.jsxs("div",{className:"px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle",children:[n.jsxs("div",{className:"text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5",children:[K.name,K.rec&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green",children:"recommended"})]}),n.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-0.5 break-all",children:K.cmd})]},K.name))}),n.jsxs("p",{className:"mt-4 text-xs font-mono text-terminal-dimmer leading-relaxed text-center",children:["AI Studio runs the CLI tool in headless mode,"," ",n.jsx("span",{className:"text-terminal-green font-medium",children:"locally"})," on your machine."]})]})]}):n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(lh,{size:12}),n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),v>0&&n.jsxs("button",{onClick:C,className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-red-subtle hover:text-terminal-red transition-colors",children:["Revert All (",v,")"]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsxs("div",{className:"px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:"Tool"}),P.length>1&&u?n.jsx("select",{value:se||"",onChange:K=>{u(K.target.value),A&&A(K.target.value)},className:"bg-terminal-surface border border-terminal-border rounded-lg px-2 py-0.5 text-xs font-mono text-terminal-text outline-none cursor-pointer hover:border-terminal-purple/30 transition-colors",children:P.map(K=>n.jsx("option",{value:K.name,children:K.name},K.name))}):n.jsx("span",{className:"text-xs font-mono font-medium text-terminal-text px-2 py-0.5 rounded-lg bg-terminal-surface border border-terminal-border",children:se})]}),n.jsx(ay,{toolName:se})]}),n.jsxs("div",{className:"p-4 space-y-3",children:[R&&n.jsx(Kc,{title:"AI Coach",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsx("div",{className:"px-3 py-2.5 border-b border-terminal-border-subtle",children:n.jsx("div",{className:"text-xs font-mono text-terminal-green leading-relaxed",children:"Fix the login bug users reported"})}),n.jsxs("div",{className:"px-3 py-2 flex items-start gap-2",children:[n.jsx("span",{className:"text-xs shrink-0",children:"💬"}),n.jsx("span",{className:"text-xs font-mono text-terminal-blue leading-relaxed",children:"Be specific — which file? what error?"})]}),n.jsxs("div",{className:"px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2",children:[n.jsx("span",{className:"text-xs font-mono font-semibold text-terminal-orange",children:"6/10"}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["·"," 4 comments added inline"]})]})]}),description:"Score your prompting technique and get inline coaching comments.",running:w,disabled:L,status:de,buttonLabel:D?"Re-run Coach":"Run Coach",runningLabel:"Analyzing...",onRun:()=>J("coach"),onCancel:k||void 0,showRerunConfirm:me==="coach",rerunWarning:"Existing AI feedback will be replaced.",onConfirmRerun:()=>void X(),onCancelRerun:()=>B(null)}),h&&n.jsx(Kc,{title:"Translate",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"这个bug怎么修?"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"How to fix this bug?"})]}),n.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"已写入。以后用中文问我..."}),n.jsx("div",{className:"text-xs font-mono text-terminal-blue",children:"Done. Ask me in Chinese..."})]})]}),description:"Translate all prompts and responses for sharing with international teams.",running:p,disabled:L,status:I,buttonLabel:F("translate")?"Re-translate":"Translate All",runningLabel:"Translating...",onRun:()=>J("translate"),onCancel:f||void 0,showRerunConfirm:me==="translate",rerunWarning:"Existing translations will be replaced.",onConfirmRerun:()=>void E(),onCancelRerun:()=>B(null),config:n.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Target"}),n.jsx("select",{value:O,onChange:K=>$(K.target.value),disabled:L,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:ly.map(K=>n.jsx("option",{value:K,children:K},K))})]})}),x&&n.jsx(Kc,{title:"Soften Tone",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"this code is mass garbage, mass delete it"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"Let's refactor this module for clarity"})]}),n.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"are you stupid? I said fix the auth"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"The auth issue is still present, could you revisit?"})]})]}),description:"Rewrite harsh or blunt prompts into professional, constructive language.",running:g,disabled:L,status:V,buttonLabel:F("tone")?"Re-adjust":"Soften All",runningLabel:"Adjusting...",onRun:()=>J("tone"),onCancel:f||void 0,showRerunConfirm:me==="tone",rerunWarning:"Existing tone adjustments will be replaced.",onConfirmRerun:()=>void _(),onCancelRerun:()=>B(null),config:n.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Style"}),n.jsx("select",{value:q,onChange:K=>ne(K.target.value),disabled:L,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:sy.map(K=>n.jsx("option",{value:K.value,children:K.label},K.value))})]})})]})]})]})}function Kc({title:l,preview:r,description:i,running:o,disabled:u,status:m,buttonLabel:p,runningLabel:g,onRun:f,onCancel:h,showRerunConfirm:x,rerunWarning:v,onConfirmRerun:C,onCancelRerun:j,config:w}){return n.jsxs("div",{className:"rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3",children:[n.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text",children:l}),r,i&&n.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-2 leading-relaxed",children:i}),w,n.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[n.jsx("button",{onClick:f,disabled:u,className:"px-3.5 py-1.5 text-xs font-mono rounded-lg bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-colors disabled:opacity-40 flex items-center gap-1.5",children:o?n.jsxs(n.Fragment,{children:[n.jsx(ny,{className:"text-terminal-purple"}),g]}):p}),o&&h&&n.jsx("button",{onClick:h,className:"text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]})]}),x&&!o&&n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-orange flex-1",children:v}),n.jsx("button",{onClick:j,className:"text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:C,className:"text-terminal-purple hover:text-terminal-text transition-colors font-medium",children:"Continue"})]})}),m&&n.jsx("div",{className:`px-4 pb-3 text-xs font-mono ${m.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:m.text})]})}function iy({open:l,onClose:r,annotationActions:i,overlayActions:o}){return y.useEffect(()=>{if(!l)return;const u=m=>{m.key==="Escape"&&(m.preventDefault(),r())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l,r]),n.jsxs("div",{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),n.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-96 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:u=>u.stopPropagation(),children:[n.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close AI Studio",children:"✕"}),n.jsx(ry,{annotationActions:i,overlayActions:o})]})]})}function Ru(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Va=Ru();function Ph(l){Va=l}var Ya={exec:()=>null};function Ue(l,r=""){let i=typeof l=="string"?l:l.source,o={replace:(u,m)=>{let p=typeof m=="string"?m:m.source;return p=p.replace(Lt.caret,"$1"),i=i.replace(u,p),o},getRegex:()=>new RegExp(i,r)};return o}var oy=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Lt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}>`)},cy=/^(?:[ \t]*(?:\n|$))+/,uy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dy=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,my=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Wh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ex=Ue(Wh).replace(/bull/g,Mu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fy=Ue(Wh).replace(/bull/g,Mu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Du=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,py=/^[^\n]+/,_u=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hy=Ue(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_u).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xy=Ue(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Mu).getRegex(),vi="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ou=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,gy=Ue("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ou).replace("tag",vi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tx=Ue(Du).replace("hr",qs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vi).getRegex(),by=Ue(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",tx).getRegex(),Lu={blockquote:by,code:uy,def:hy,fences:dy,heading:my,hr:qs,html:gy,lheading:ex,list:xy,newline:cy,paragraph:tx,table:Ya,text:py},sh=Ue("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vi).getRegex(),yy={...Lu,lheading:fy,table:sh,paragraph:Ue(Du).replace("hr",qs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",sh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vi).getRegex()},vy={...Lu,html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ou).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ya,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ue(Du).replace("hr",qs).replace("heading",` *#{1,6} *[^
|
|
68
|
-
]`).replace("lheading",
|
|
65
|
+
`):void 0}}function u0(l){return[...new Set(l.split(",").map(r=>r.trim()).filter(Boolean))]}function d0(l){return l==="7d"?"Last 7 Days":l==="30d"?"Last 30 Days":l==="90d"?"Last 90 Days":"All Time"}function Fh({sessionsPerDay:l,weeks:r=52,showLegend:i=!0}){const{weekColumns:o,monthByWeek:u,maxVal:m}=y.useMemo(()=>{const g=new Date;g.setHours(0,0,0,0);const f=g.getDay(),x=new Date(g.getTime()+(6-f)*aa),h=r*7,v=new Date(x.getTime()-(h-1)*aa);let C=0;const j=[],w=new Map;let S=-1;for(let k=0;k<h;k++){const E=new Date(v.getTime()+k*aa),M=Ia(E),A=l[M]||0,R=Math.floor(k/7);A>C&&(C=A),j[R]||(j[R]=[]),j[R].push({date:M,count:A});const O=E.getMonth();O!==S&&(w.set(R,E.toLocaleDateString("en-US",{month:"short"})),S=O)}return{weekColumns:j,monthByWeek:w,maxVal:C}},[l,r]),p=g=>{if(g===0)return{cls:"bg-terminal-border/20 dark:bg-terminal-surface-2"};const f=m<=1?1:g/m;return{cls:"bg-terminal-green",style:{opacity:f<=.25?.4:f<=.5?.6:f<=.75?.8:1}}};return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-end gap-[3px]",children:[n.jsx("div",{className:"shrink-0 w-7"}),n.jsx("div",{className:"flex-1 flex gap-[3px] min-w-0",children:o.map((g,f)=>n.jsx("div",{className:"flex-1 min-w-0 overflow-visible",children:u.has(f)&&n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer whitespace-nowrap",children:u.get(f)})},f))})]}),n.jsxs("div",{className:"flex gap-[3px]",children:[n.jsx("div",{className:"shrink-0 w-7 flex flex-col gap-[3px]",children:["","Mon","","Wed","","Fri",""].map((g,f)=>n.jsx("div",{className:"flex-1 flex items-center text-[9px] font-mono text-terminal-dimmer leading-none",children:g},f))}),n.jsx("div",{className:"flex-1 flex gap-[3px] min-w-0",children:o.map((g,f)=>n.jsx("div",{className:"flex-1 flex flex-col gap-[3px] min-w-0",children:g.map(x=>{const h=p(x.count);return n.jsx("div",{className:`aspect-square rounded-sm ${h.cls} hover:ring-1 hover:ring-terminal-text/30`,style:h.style,title:`${x.date}: ${x.count} session${x.count!==1?"s":""}`},x.date)})},f))})]}),i&&n.jsxs("div",{className:"flex items-center justify-end gap-1.5 pt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"Less"}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-border/20 dark:bg-terminal-surface-2"}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.4}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.6}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green",style:{opacity:.8}}),n.jsx("div",{className:"w-[10px] h-[10px] rounded-sm bg-terminal-green"}),n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"More"})]})]})}function m0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date;o.setHours(0,0,0,0);const u=28,m=[];let p=0;for(let g=u-1;g>=0;g--){const f=new Date(o.getTime()-g*aa),x=Ia(f),h=l[x]||0;h>p&&(p=h),m.push({key:x,count:h})}return{cells:m,max:p}},[l]),i=o=>{if(o===0)return{className:"bg-terminal-border/20 dark:bg-white/5"};const u=r.max<=1?1:o/r.max;return{className:"bg-terminal-green",style:{opacity:u<=.33?.45:u<=.66?.7:.9}}};return n.jsx("div",{className:"flex gap-[3px] flex-wrap",children:r.cells.map(o=>{const u=i(o.count);return n.jsx("div",{className:`w-[10px] h-[10px] rounded-[2px] ${u.className}`,style:u.style},o.key)})})}function f0({stats:l,streak:r,bestDay:i,sessionsPerDay:o,range:u,providers:m,dataQualityNotes:p}){const g=y.useRef(null),f=y.useMemo(()=>{const v=Object.entries(m);if(v.length===0)return"";v.sort((j,w)=>w[1]-j[1]);const C={"claude-code":"Claude Code",cursor:"Cursor"};return v.map(([j])=>C[j]||j).join(" + ")},[m]),x=y.useMemo(()=>c0(p),[p]),h=({label:v,title:C})=>n.jsxs("div",{className:"mt-0.5 flex items-center gap-1",children:[n.jsx("div",{className:"text-[10px] font-sans font-medium text-terminal-dim uppercase tracking-wider",children:v}),C?n.jsx(Ea,{title:C,className:"shrink-0"}):null]});return n.jsxs("div",{ref:g,className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-terminal-surface via-terminal-bg to-terminal-surface border border-terminal-border p-6 md:p-8 shadow-layer-xl",children:[n.jsx("div",{className:"absolute -top-20 -right-20 w-64 h-64 bg-terminal-green/5 rounded-full blur-3xl pointer-events-none"}),n.jsx("div",{className:"absolute -bottom-20 -left-20 w-48 h-48 bg-terminal-blue/5 rounded-full blur-3xl pointer-events-none"}),n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer px-2 py-0.5 rounded-full bg-terminal-surface-2",children:d0(u)}),x.overall?n.jsx(Ea,{title:x.overall,className:"shrink-0"}):null]}),f&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim",children:f})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-5 mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.sessions,formatter:$l})}),n.jsx(h,{label:"sessions"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.replays,formatter:$l})}),n.jsx(h,{label:"replays"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.prompts,formatter:$l})}),n.jsx(h,{label:"turns"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.toolCalls,formatter:$l})}),n.jsx(h,{label:"tool calls"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-text tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.durationMs,formatter:v=>Mu(v)})}),n.jsx(h,{label:"coding",title:x.duration})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.cost,formatter:v=>Yh(v)})}),n.jsx(h,{label:"spent",title:x.cost})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.edits,formatter:$l})}),n.jsx(h,{label:"file edits"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl md:text-3xl font-mono font-bold text-terminal-purple tabular-nums",children:n.jsx(yn,{durationMs:500,value:l.projects,formatter:v=>Math.round(v).toString()})}),n.jsx(h,{label:"projects"})]})]}),n.jsx("div",{className:"mb-4",children:n.jsx(m0,{sessionsPerDay:o})}),n.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-terminal-border/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[r.current>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:[r.current," day streak"]}),i&&i.count>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Most active: ",i.day]})]}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:"vibe-replay.com"})]})]})]})}function Bs({icon:l,label:r,value:i,sub:o}){return n.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3.5 shadow-layer-sm hover:bg-terminal-surface-hover transition-colors group",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"text-lg leading-none mt-0.5",children:l}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest",children:r}),n.jsx("div",{className:"text-lg font-mono font-bold text-terminal-text mt-0.5",children:i}),o&&n.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer mt-0.5",children:o})]})]})})}function p0({data:l}){const r=Math.max(...l.map(x=>x.sessions),1);if(!l.some(x=>x.sessions>0))return n.jsx("div",{className:"flex items-center justify-center h-full text-terminal-dimmer text-xs font-mono",children:"No activity to show"});const o=l.slice(-4),u=l.slice(-8,-4),m=o.reduce((x,h)=>x+h.sessions,0)/Math.max(o.length,1),p=u.reduce((x,h)=>x+h.sessions,0)/Math.max(u.length,1),g=m>p,f=Math.abs(m-p)<.5;return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-end gap-1.5 h-28",children:l.map(x=>{const h=Math.max(x.sessions/r*100,x.sessions>0?6:0);return n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-end h-full group relative",children:[n.jsx("div",{className:"absolute bottom-full mb-1 hidden group-hover:block z-10",children:n.jsxs("div",{className:"bg-terminal-surface-2 border border-terminal-border-subtle rounded-lg px-2 py-1 shadow-layer-md whitespace-nowrap",children:[n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim",children:x.weekLabel}),n.jsxs("div",{className:"text-[10px] font-mono text-terminal-green font-bold",children:[x.sessions," session",x.sessions!==1?"s":""]})]})}),n.jsx("div",{className:"w-full rounded-md bg-terminal-green hover:opacity-90 transition-all",style:{height:`${h}%`,minHeight:x.sessions>0?"4px":"0",opacity:x.sessions>0?.7:0}})]},x.startDate)})}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex gap-1.5 overflow-hidden",children:l.filter((x,h)=>h%2===0).map(x=>n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:x.weekLabel},x.startDate))}),!f&&n.jsxs("span",{className:`text-[10px] font-mono font-bold ${g?"text-terminal-green":"text-terminal-orange"}`,children:[g?"↑":"↓"," ",g?"Trending up":"Slowing down"]})]})]})}function h0({data:l}){const r=Math.max(...l.map(i=>i.count),1);return n.jsx("div",{className:"space-y-2",children:l.map(i=>{const o=r>0?i.count/r*100:0;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim w-7 text-right shrink-0",children:i.shortDay}),n.jsx("div",{className:"flex-1 h-4 rounded bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full rounded bg-terminal-green transition-all duration-500",style:{width:`${Math.max(o,i.count>0?3:0)}%`,opacity:.65}})}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dim w-6 text-right tabular-nums shrink-0",children:i.count})]},i.day)})})}function x0({projects:l}){if(l.length===0)return n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono py-4 text-center",children:"No project data"});const r=Math.max(...l.map(i=>i.sessions),1);return n.jsx("div",{className:"space-y-2",children:l.slice(0,8).map(i=>{const o=na(i.project),u=i.sessions/r*100;return n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate max-w-[60%]",children:o}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dim tabular-nums",children:[i.sessions," session",i.sessions!==1?"s":"",i.cost>0&&` · ${Yh(i.cost)}`]})]}),n.jsx("div",{className:"h-1.5 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-terminal-green to-terminal-blue transition-all duration-500",style:{width:`${Math.max(u,3)}%`,opacity:.65}})})]},i.project)})})}function g0({models:l}){const r=y.useMemo(()=>(()=>{const u=new Map;for(const[m,p]of Object.entries(l))for(const g of u0(m)){const f=Ci(g);u.set(f,(u.get(f)??0)+p)}return[...u.entries()].map(([m,p])=>({model:m,count:p})).sort((m,p)=>p.count-m.count)})(),[l]),i=r.reduce((u,m)=>u+m.count,0);if(r.length===0)return n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono py-4 text-center",children:"No model data"});const o=["bg-terminal-green","bg-terminal-blue","bg-terminal-orange","bg-terminal-purple","bg-terminal-red","bg-terminal-dim"];return n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-3 rounded-full bg-terminal-surface-2 overflow-hidden flex",children:r.map((u,m)=>n.jsx("div",{className:`h-full ${o[m%o.length]} transition-all duration-500`,style:{width:`${u.count/i*100}%`,opacity:.7}},u.model))}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:r.map((u,m)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2.5 h-2.5 rounded-sm ${o[m%o.length]} shrink-0`,style:{opacity:.7}}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim truncate",children:u.model}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums ml-auto shrink-0",children:u.count})]},u.model))})]})}function b0({providers:l}){const r=y.useMemo(()=>Object.entries(l).map(([u,m])=>({provider:u,label:u==="claude-code"?"Claude Code":u==="cursor"?"Cursor":u,count:m})).sort((u,m)=>m.count-u.count),[l]),i=r.reduce((u,m)=>u+m.count,0);if(r.length===0)return null;const o={"claude-code":"bg-terminal-orange",cursor:"bg-terminal-blue"};return n.jsx("div",{className:"space-y-3",children:r.map(u=>{const m=i>0?u.count/i*100:0;return n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text",children:u.label}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dim tabular-nums",children:[u.count," (",Math.round(m),"%)"]})]}),n.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full ${o[u.provider]||"bg-terminal-dim"} transition-all duration-500`,style:{width:`${m}%`,opacity:.7}})})]},u.provider)})})}function Zh(){return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"h-6 w-32 skeleton rounded"}),n.jsx("div",{className:"flex gap-1",children:Array.from({length:4},(l,r)=>n.jsx("div",{className:"h-7 w-10 skeleton rounded-md"},r))})]}),n.jsxs("div",{className:"rounded-2xl bg-terminal-surface border border-terminal-border/30 p-6 space-y-5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"h-4 w-20 skeleton rounded"}),n.jsx("div",{className:"h-5 w-12 skeleton rounded-md"})]}),n.jsx("div",{className:"h-3 w-28 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-4 gap-6",children:Array.from({length:8},(l,r)=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-7 skeleton rounded",style:{width:`${45+r*13%40}%`}}),n.jsx("div",{className:"h-3 w-16 skeleton rounded"})]},r))}),n.jsx("div",{className:"h-2.5 w-full skeleton rounded"}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("div",{className:"h-3 w-40 skeleton rounded"}),n.jsx("div",{className:"h-3 w-24 skeleton rounded"})]})]}),n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"h-3 w-16 skeleton rounded"}),n.jsx("div",{className:"space-y-1.5",children:Array.from({length:3},(l,r)=>n.jsx("div",{className:"h-3 skeleton rounded"},r))})]}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4},(l,r)=>n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-4 shadow-layer-sm space-y-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-5 w-5 skeleton rounded"}),n.jsx("div",{className:"h-3 w-20 skeleton rounded"})]}),n.jsx("div",{className:"h-6 w-24 skeleton rounded"}),n.jsx("div",{className:"h-2.5 w-16 skeleton rounded"})]},r))}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Array.from({length:2},(l,r)=>n.jsxs("div",{className:"rounded-xl bg-terminal-surface p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"h-3 w-24 skeleton rounded"}),n.jsx("div",{className:"space-y-2",children:Array.from({length:5},(i,o)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-3 w-8 skeleton rounded shrink-0"}),n.jsx("div",{className:"h-5 skeleton rounded",style:{width:`${25+(o*17+r*31)%60}%`}})]},o))})]},r))})]})})}function y0({scanStatus:l,hasCachedInsights:r}){const i=l?.phase==="discovering"?"Finding sessions across providers and restoring the latest local data.":l?.total?`Refreshing ${l.scanned}/${l.total} sessions in the background.`:"Preparing your latest session insights.";return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-8 space-y-4",children:[n.jsxs("div",{className:"rounded-xl border border-terminal-purple/20 bg-terminal-surface px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-sans text-terminal-text",children:[n.jsx("span",{className:"w-2 h-2 rounded-full bg-terminal-purple animate-pulse"}),n.jsx("span",{children:r?"Refreshing cached insights":"Loading your insights"})]}),n.jsx("p",{className:"mt-1 text-xs font-mono text-terminal-dim",children:i})]}),n.jsx(Zh,{})]})})}function v0(){const[l,r]=y.useState(null),i=y.useCallback((o,u)=>{let m=0,p=0,g=0;const f=new Map(o.map(h=>[h.slug,h]));for(const h of o)m+=h.promptCount??(h.prompts?.length||(h.firstPrompt?1:0)),p+=h.toolCallCount??0;for(const h of u){const v=f.get(h.slug),C=h.stats.toolCalls||0;v?v.toolCallCount==null?p+=C:C>v.toolCallCount&&(p+=C-v.toolCallCount):(m+=h.stats.userPrompts||0,p+=C),g+=h.stats.durationMs||0}const x=new Set;for(const h of o)x.add(h.project);for(const h of u)x.add(h.project);r({sessions:o.length,replays:u.length,prompts:m,toolCalls:p,duration:g,projects:x.size})},[]);return y.useEffect(()=>{Promise.all([fetch("/api/sources/cached").then(o=>o.ok?o.json():null).catch(()=>null),fetch("/api/sessions/cached").then(o=>o.ok?o.json():null).catch(()=>null)]).then(([o,u])=>{const m=Aa(o)?.sessions||[],p=Aa(u)?.sessions||[];(m.length>0||p.length>0)&&i(m,p)})},[i]),l}function j0(){const{userInsights:l,loading:r,scanStatus:i}=Fl(),o=v0(),[u,m]=y.useState("all"),p=i?.running&&!l,{stats:g,streak:f,dayOfWeek:x,bestDay:h,peak:v,weeklyTrend:C,activeDays:j,firstSessionDate:w}=y.useMemo(()=>{if(!l)return{stats:{sessions:0,replays:0,durationMs:0,cost:0,prompts:0,edits:0,toolCalls:0,projects:0},streak:{current:0,longest:0},dayOfWeek:[],bestDay:null,peak:null,weeklyTrend:[],activeDays:0,firstSessionDate:null};const H=l.sessionsPerDay||{},K=qh(H,u),ae={...l,totalReplays:o?.replays??0},ue=l0(K,ae,u),oe=s0(H),te=r0(K),xe=[...te].sort((Q,ne)=>ne.count-Q.count)[0]||null,de=o0(K),pe=i0(H,12),U=Object.values(K).filter(Q=>Q>0).length,z=l.timeRange?.first||null;return{stats:ue,streak:oe,dayOfWeek:te,bestDay:xe,peak:de,weeklyTrend:pe,activeDays:U,firstSessionDate:z}},[l,u,o]);if(!l&&(r||p||i?.phase==="discovering"))return n.jsx(y0,{scanStatus:i,hasCachedInsights:!!i?.hasCachedResults});if(!l)return n.jsx(Zh,{});const S=j>0?(g.sessions/j).toFixed(1):"0",k=g.sessions>0?Math.round(g.prompts/g.sessions):0,E=w?Math.floor((Date.now()-new Date(w).getTime())/aa):0,M=o?.sessions??l.totalSessions,A=Math.max(0,M-l.totalSessions),R=!!(i?.running&&i?.hasCachedResults),O=i?.cachedAt?Ru(i.cachedAt):"",$=i?.total&&i.total>0?`${Math.min(i.scanned,i.total)}/${i.total}`:void 0;return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h1",{className:"text-lg font-sans font-bold text-terminal-text",children:"Your Insights"}),n.jsx("div",{className:"flex items-center gap-0.5 p-0.5 rounded-lg bg-terminal-surface",children:["7d","30d","90d","all"].map(H=>n.jsx("button",{onClick:()=>m(H),className:`px-3 py-1.5 text-[11px] font-mono rounded-md transition-all ${u===H?"bg-terminal-green-subtle text-terminal-green font-bold":"text-terminal-dim hover:text-terminal-text"}`,children:H==="all"?"All":H},H))})]}),R&&n.jsx("div",{className:"rounded-xl border border-terminal-blue/30 bg-terminal-blue/10 px-4 py-3",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"mt-0.5 h-2 w-2 shrink-0 rounded-full bg-terminal-blue"}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"text-xs font-sans font-semibold text-terminal-text",children:"Showing cached insights snapshot while the background refresh runs"}),n.jsxs("div",{className:"text-xs font-mono text-terminal-dim",children:[O?`Snapshot from ${O} ago.`:"Using the latest cached scan."," ",$?`Refreshing ${$} sessions now.`:"Refreshing now."]}),A>0&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dim",children:["Insights currently cover ",l.totalSessions," scanned sessions;"," ",A," additional session",A===1?"":"s"," will appear after the refresh completes."]})]})]})}),n.jsx(f0,{stats:g,streak:f,bestDay:h,sessionsPerDay:l.sessionsPerDay||{},range:u,providers:l.providers||{},dataQualityNotes:l.dataQuality?.notes}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Activity"}),u!=="all"&&n.jsx("span",{className:"text-[9px] font-mono text-terminal-dimmer",children:"Last 52 weeks"})]}),n.jsx(Fh,{sessionsPerDay:l.sessionsPerDay||{}})]}),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[n.jsx(Bs,{icon:"🔥",label:"Current Streak",value:`${f.current} day${f.current!==1?"s":""}`,sub:f.longest>f.current?`Best: ${f.longest} days`:f.current>0?"Personal best!":void 0}),n.jsx(Bs,{icon:"⚡",label:"Avg / Active Day",value:`${S} sessions`,sub:`${j} active day${j!==1?"s":""}`}),n.jsx(Bs,{icon:"💬",label:"Avg / Session",value:`${k} prompts`,sub:g.sessions>0?`~${Mu(g.durationMs/g.sessions)} each`:void 0}),v?n.jsx(Bs,{icon:"🏆",label:"Peak Day",value:`${v.count} sessions`,sub:new Date(`${v.date}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}):n.jsx(Bs,{icon:"📅",label:"Vibe Coding Since",value:E>0?`${E} days`:"Today",sub:w?new Date(w).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):void 0})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Weekly Trend"}),n.jsx(p0,{data:C})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Day of Week"}),n.jsx(h0,{data:x})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Top Projects"}),n.jsx(x0,{projects:(l.topProjects||[]).map(H=>({project:H.project,sessions:H.sessions,cost:H.cost,prompts:H.prompts,durationMs:H.durationMs,edits:H.edits}))})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-5",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Models"}),n.jsx(g0,{models:l.models||{}})]}),Object.keys(l.providers||{}).length>1&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-4",children:"Providers"}),n.jsx(b0,{providers:l.providers||{}})]})]})]}),E>0&&n.jsx("div",{className:"text-center py-4",children:n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:["You've been vibe coding for ",E," day",E!==1?"s":""," ·"," ",vt(g.durationMs)," total · ",$l(g.toolCalls)," tool calls"]})})]})})}function w0(){const[l,r]=y.useState([]),[i,o]=y.useState([]),[u,m]=y.useState(!0),[p,g]=y.useState(!0),[f,x]=y.useState(!0),[h,v]=y.useState(null),[,C]=y.useState(null),[,j]=y.useState(null),w=y.useRef(!1),S=y.useRef(void 0),k=y.useMemo(()=>l.some(M=>M.provider==="cursor"),[l]),E=y.useCallback(async()=>{m(!0),g(!0),x(!0),v(null);try{const[M,A]=await Promise.all([fetch("/api/sources/cached").then(ae=>ae.ok?ae.json():null).catch(()=>null),fetch("/api/sessions/cached").then(ae=>ae.ok?ae.json():null).catch(()=>null)]),R=Aa(M),O=Aa(A);R?.sessions.length&&r(R.sessions),O?.sessions.length&&o(O.sessions),(R?.sessions.length||O?.sessions.length)&&m(!1);const $=Xs(R?.cachedAt),H=Xs(O?.cachedAt),K=[];$&&g(!1),H&&x(!1),$||K.push(new Promise(ae=>{C(0);const ue=new EventSource("/api/sources/stream");ue.onmessage=oe=>{try{const te=JSON.parse(oe.data);te.type==="progress"?C(te.scanned):te.type==="complete"?(r(te.sessions),C(null),ue.close(),ae()):te.type==="error"&&(R?.sessions.length||v(te.message||"Failed to load sessions"),C(null),ue.close(),ae())}catch{}},ue.onerror=()=>{ue.close(),C(null),fetch("/api/sources").then(oe=>{if(!oe.ok)throw new Error("Failed to load sources");return oe.json()}).then(oe=>r(oe.sessions)).catch(oe=>{R?.sessions.length||v(oe instanceof Error?oe.message:"Failed to load sessions")}).finally(()=>ae())}}).finally(()=>g(!1))),H||K.push(fetch("/api/sessions").then(ae=>{if(!ae.ok)throw new Error("Failed to load replays");return ae.json()}).then(ae=>o(ae)).catch(ae=>{O?.sessions.length||v(ae instanceof Error?ae.message:"Failed to load replays")}).finally(()=>x(!1))),K.length>0&&await Promise.allSettled(K)}catch(M){v(M instanceof Error?M.message:"Failed to load data")}finally{m(!1)}},[]);return y.useEffect(()=>{E()},[E]),y.useEffect(()=>{if(!p&&!k&&!w.current)return;let M=!1,A;const R=async()=>{const $=await fetch("/api/sources/cached").then(K=>K.ok?K.json():null).catch(()=>null),H=Aa($);!M&&H?.sessions.length&&H.cachedAt!==S.current&&(S.current=H.cachedAt,r(H.sessions))},O=async()=>{const $=await fetch("/api/sources/enrichment-status").then(H=>H.ok?H.json():null).catch(()=>null);!$||M||(j($),$.running?(w.current=!0,await R()):w.current&&(w.current=!1,await R()))};return O(),A=window.setInterval(()=>{O()},2500),()=>{M=!0,A&&window.clearInterval(A)}},[k,p]),{sources:l,setSources:r,replays:i,loading:u,loadingSources:p,loadingReplays:f,error:h}}function N0(l,r){let i=0,o=0,u=0;const m=new Map(l.map(S=>[S.slug,S]));for(const S of l)i+=S.promptCount??(S.prompts?.length||(S.firstPrompt?1:0)),o+=S.toolCallCount??0;for(const S of r){const k=m.get(S.slug),E=S.stats.toolCalls||0;k?k.toolCallCount==null?o+=E:E>k.toolCallCount&&(o+=E-k.toolCallCount):(i+=S.stats.userPrompts||0,o+=E),u+=S.stats.durationMs||0}const p=new Map;for(const S of l)p.set(S.provider,(p.get(S.provider)||0)+1);const g={"claude-code":"Claude Code",cursor:"Cursor"},f=[...p.entries()].map(([S,k])=>({provider:S,count:k,label:g[S]||S})).sort((S,k)=>k.count-S.count),x=new Set;for(const S of l)x.add(S.project);for(const S of r)x.add(S.project);const h={};for(const S of l){const k=S.timestamp?.slice(0,10);k&&(h[k]=(h[k]||0)+1)}const v=l.length,C=r.length,j=l.filter(S=>S.existingReplay).length,w=v>0?j/v*100:0;return{totalSessions:v,totalReplays:C,totalPrompts:i,totalToolCalls:o,totalDuration:u,providerBreakdown:f,projectCount:x.size,sessionsPerDay:h,recentSources:[...l].sort((S,k)=>k.timestamp.localeCompare(S.timestamp)).slice(0,5),recentReplays:[...r].sort((S,k)=>k.startTime.localeCompare(S.startTime)).slice(0,5),publishedCount:r.filter(S=>S.gist?.gistId).length,replayConversionPct:w}}function S0(){return n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("div",{className:"h-3 w-28 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:5},(l,r)=>n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-3 rounded-lg bg-terminal-bg",children:[n.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${50+r*17%30}%`}}),n.jsx("div",{className:"h-3 skeleton rounded",style:{width:`${60+r*23%25}%`}})]}),n.jsx("div",{className:"h-4 w-14 shrink-0 skeleton rounded"})]},r))}),n.jsx("div",{className:"h-8 mt-2 rounded-lg skeleton"})]})}function Vh({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Lh(l)}`,children:Oh(l)})}function k0({sessions:l,isLoading:r,onViewAll:i,onGenerate:o,onViewReplay:u,onSessionClick:m,generatingSlug:p,generateErrorSlug:g}){return l.length===0?n.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading sessions...":"No sessions found. Start a coding session with Claude Code or Cursor."}):n.jsxs("div",{className:"space-y-1 flex-1 flex flex-col",children:[l.map(f=>{const x=!!f.existingReplay,h=p===f.slug,v=g===f.slug;return n.jsxs("div",{onClick:()=>m(f),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 cursor-pointer",children:[n.jsx(Vh,{provider:f.provider}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-sans text-terminal-text truncate",children:_u(f)}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:na(f.project)})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:ql(f.timestamp)}),x?n.jsxs("button",{onClick:C=>{C.stopPropagation(),u(f.existingReplay)},className:"h-7 px-3 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 flex items-center gap-1",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}):n.jsx("button",{onClick:C=>{C.stopPropagation(),o(f)},disabled:h,className:`h-7 px-3 text-xs font-sans font-semibold rounded-md transition-all duration-200 disabled:opacity-50 flex items-center gap-1 ${v?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis"}`,children:h?n.jsx("span",{className:"animate-pulse",children:"..."}):v?"Failed":n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})})]})]},`${f.provider}-${f.slug}`)}),n.jsx("button",{onClick:i,className:"w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all sessions →"})]})}function C0({replays:l,isLoading:r,onViewAll:i,onOpen:o}){return l.length===0?n.jsx("div",{className:"text-center py-6 text-terminal-dimmer text-xs font-mono",children:r?"Loading replays...":"No replays yet. Generate one from the Sessions tab."}):n.jsxs("div",{className:"space-y-1 flex-1 flex flex-col",children:[l.map(u=>n.jsxs("button",{onClick:()=>o(u.slug),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-terminal-surface-hover transition-colors duration-200 text-left group",children:[n.jsx(Vh,{provider:u.provider}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-sans text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:fu(u)}),n.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.userPrompts," prompts"]}),n.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),n.jsxs("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:[u.stats.toolCalls," tools"]}),u.stats.durationMs&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border text-[10px]",children:"·"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer",children:vt(u.stats.durationMs)})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.gist?.gistId&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:"published"}),n.jsx("span",{className:"text-[11px] font-mono text-terminal-dimmer tabular-nums",children:ql(u.startTime)})]})]},u.slug)),n.jsx("button",{onClick:i,className:"w-full py-2 mt-auto text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all replays →"})]})}const th=[{name:"claude",label:"Claude Code",purpose:"AI feedback via headless mode"},{name:"cursor",label:"Cursor CLI",purpose:"AI feedback via AI Studio"},{name:"opencode",label:"OpenCode",purpose:"AI feedback via headless mode"}];function T0(){const[l,r]=y.useState(()=>th.map(i=>({...i,installed:!1,detail:"checking...",loading:!0})));return y.useEffect(()=>{let i=!1;for(const o of th)fetch(`/api/system-checks?tool=${encodeURIComponent(o.name)}`).then(u=>u.ok?u.json():null).then(u=>{if(i)return;const m=u?.checks?.find(p=>p.name===o.name)||u?.checks?.[0];if(!m){r(p=>p.map(g=>g.name===o.name?{...g,installed:!1,detail:"check failed",loading:!1}:g));return}r(p=>p.map(g=>g.name===o.name?{...g,installed:!!m.installed,version:m.version,detail:m.detail,loading:!1}:g))}).catch(()=>{i||r(u=>u.map(m=>m.name===o.name?{...m,installed:!1,detail:"check failed",loading:!1}:m))});return()=>{i=!0}},[]),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider mb-3",children:"System"}),n.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:l.map(i=>n.jsxs("div",{className:"flex items-start gap-2.5 px-3 py-2.5 rounded-lg bg-terminal-bg",children:[n.jsx("div",{className:`w-2 h-2 mt-1 rounded-full shrink-0 ${i.loading?"bg-terminal-blue animate-pulse":i.installed?"bg-terminal-green":"bg-terminal-dim opacity-40"}`}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:`text-xs font-sans font-medium ${i.loading?"text-terminal-dim":i.installed?"text-terminal-text":"text-terminal-dimmer"}`,children:i.label}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dimmer truncate",children:i.purpose}),i.loading?n.jsx("p",{className:"text-[10px] font-mono text-terminal-blue truncate animate-pulse",children:"checking..."}):i.installed?n.jsx("p",{className:"text-[10px] font-mono text-terminal-green truncate",children:i.detail||i.version||"ready"}):n.jsx("p",{className:"text-[10px] font-mono text-terminal-orange truncate",children:i.detail||"not found"})]})]},i.name))})]})}function E0({onNavigate:l}){const{sources:r,setSources:i,replays:o,loading:u,loadingSources:m,loadingReplays:p,error:g}=w0(),f=y.useMemo(()=>N0(r,o),[r,o]),{scanStatus:x,userInsights:h}=Fl(),[v,C]=y.useState(null),[j,w]=y.useState(null),[S,k]=y.useState(null),[E,M]=y.useState("idle"),[A,R]=y.useState(null),[O,$]=y.useState(null),[H,K]=y.useState(0),ae=y.useRef(null),ue=y.useRef(null),oe=S?r.find(G=>G.slug===S)??null:null,te=!h&&(m||!!x?.running||r.length>0),xe=Math.max(f.projectCount,h?.totalProjects??0),de=h?.totalPrompts??f.totalPrompts,pe=h?.totalToolCalls??f.totalToolCalls,U=f.providerBreakdown.length>0?f.providerBreakdown:Object.entries(h?.providers||{}).map(([G,F])=>({provider:G,count:F,label:G==="claude-code"?"Claude Code":G==="cursor"?"Cursor":G})).sort((G,F)=>F.count-G.count),z=Object.keys(f.sessionsPerDay).length>0?f.sessionsPerDay:h?.sessionsPerDay??{},Q=G=>{ht({view:null,session:G})},ne=async G=>{C(G.slug),w(null);try{const F=_u(G),me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:G.provider,filePaths:G.filePaths,toolPaths:G.toolPaths,title:kt(F)||void 0,sessionSlug:G.slug,sessionProject:G.project})}),be=await me.json();if(!me.ok)throw new Error(be.error||"Generation failed");ht({view:null,session:be.slug})}catch(F){console.error("Generate error:",F),w(G.slug),setTimeout(()=>w(me=>me===G.slug?null:me),2e3)}finally{C(null)}},W=async(G,F)=>{k(null),C(G.slug),w(null);try{const me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:G.provider,filePaths:G.filePaths,toolPaths:G.toolPaths,title:kt(F)||void 0,sessionSlug:G.slug,sessionProject:G.project})}),be=await me.json();if(!me.ok)throw new Error(be.error||"Generation failed");ht({view:null,session:be.slug})}catch(me){console.error("Generate error:",me),w(G.slug),setTimeout(()=>w(be=>be===G.slug?null:be),2e3)}finally{C(null)}},T=async(G,F)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:F})})).ok)throw new Error("Failed to update title");i(be=>be.map(Qe=>Qe.slug===G&&Qe.replay?{...Qe,replay:{...Qe.replay,title:F||void 0}}:Qe))},_=async G=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(G)}`,{method:"DELETE"})).ok)return;i(me=>me.map(be=>be.slug===G?{...be,replay:void 0,existingReplay:null}:be))}catch{}},V=async()=>{M("syncing"),R(null);try{const G=await fetch("/api/insights/sync",{method:"POST"}),F=await G.json();if(G.status===401){M("needsLogin"),R(null);return}!G.ok||F.error?(M("error"),R(F.error||"Sync failed"),setTimeout(()=>{M(me=>me==="error"?"idle":me),R(null)},4e3)):(M("done"),R(F.message||`Synced ${F.synced??0} insights`),$(Date.now()))}catch{M("error"),R("Network error"),setTimeout(()=>{M(G=>G==="error"?"idle":G),R(null)},4e3)}},J=()=>{V()},P=async()=>{M("awaitingLogin"),R("Waiting for sign in...");try{const G=await fetch("/api/auth/login",{method:"POST"}),F=await G.json().catch(()=>null);G.ok&&F?.url&&window.open(F.url,"_blank")}catch{}ae.current&&clearInterval(ae.current),ue.current&&clearTimeout(ue.current),ae.current=setInterval(async()=>{try{(await(await fetch("/api/auth/get-session")).json())?.session&&(ae.current&&(clearInterval(ae.current),ae.current=null),ue.current&&(clearTimeout(ue.current),ue.current=null),window.dispatchEvent(new Event("vibe-auth-change")),V())}catch{}},2e3),ue.current=setTimeout(()=>{ae.current&&(clearInterval(ae.current),ae.current=null),M("idle"),R(null)},180*1e3)};y.useEffect(()=>()=>{ae.current&&clearInterval(ae.current),ue.current&&clearTimeout(ue.current)},[]),y.useEffect(()=>{if(!O)return;const G=setInterval(()=>K(F=>F+1),3e4);return()=>clearInterval(G)},[O]);const he=(()=>{if(!O)return null;const G=Date.now()-O;if(G<6e4)return"just now";const F=Math.floor(G/6e4);return F<60?`${F}m ago`:`${Math.floor(F/60)}h ago`})();return u&&!r.length&&!o.length?n.jsx("div",{className:"flex-1 overflow-auto animate-in fade-in duration-500",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm space-y-4",children:[n.jsx("div",{className:"grid grid-cols-4 gap-6",children:Array.from({length:4},(G,F)=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"h-8 w-20 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]},F))}),n.jsx("div",{className:"space-y-1.5 pt-2",children:Array.from({length:3},(G,F)=>n.jsx("div",{className:"h-3 skeleton rounded"},F))}),n.jsx("div",{className:"h-9 skeleton rounded"})]}),n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:Array.from({length:2},(G,F)=>n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"h-3 w-28 skeleton rounded"}),n.jsx("div",{className:"h-3 w-14 skeleton rounded"})]}),Array.from({length:5},(me,be)=>n.jsxs("div",{className:"flex items-center gap-3 px-1 py-1",children:[n.jsx("div",{className:"h-5 w-14 skeleton rounded-full shrink-0"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx("div",{className:"h-3.5 skeleton rounded",style:{width:`${55+be*19%35}%`}}),n.jsx("div",{className:"h-2.5 w-20 skeleton rounded"})]}),n.jsx("div",{className:"h-3 w-12 skeleton rounded shrink-0"})]},be)),n.jsx("div",{className:"h-8 skeleton rounded"})]},F))})]})}):g&&r.length===0&&o.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-center space-y-2",children:n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:g})})}):n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-6",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-5 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-start justify-between mb-4",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-1 flex-1 min-w-0",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{value:f.totalSessions})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"sessions"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-blue tabular-nums",children:n.jsx(yn,{value:f.totalReplays})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"replays"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-green tabular-nums",children:n.jsx(yn,{value:de})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"turns"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-mono font-bold text-terminal-orange tabular-nums",children:n.jsx(yn,{value:pe})}),n.jsx("div",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-widest mt-0.5",children:"tool calls"})]})]}),n.jsx("div",{className:"flex flex-col items-end gap-1 shrink-0",children:U.map(G=>n.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-md ${G.provider==="claude-code"?"bg-terminal-orange/8":G.provider==="cursor"?"bg-terminal-blue/8":"bg-terminal-dim/8"}`,children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${G.provider==="claude-code"?"bg-terminal-orange":G.provider==="cursor"?"bg-terminal-blue":"bg-terminal-dim"}`}),n.jsx("span",{className:`text-[10px] font-mono tabular-nums ${G.provider==="claude-code"?"text-terminal-orange/80":G.provider==="cursor"?"text-terminal-blue/80":"text-terminal-dim"}`,children:G.label}),n.jsx("span",{className:`text-[10px] font-mono font-bold tabular-nums ${G.provider==="claude-code"?"text-terminal-orange":G.provider==="cursor"?"text-terminal-blue":"text-terminal-dim"}`,children:G.count})]},G.provider))})]}),n.jsx(Fh,{sessionsPerDay:z,weeks:52}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx("button",{onClick:()=>l("insights"),className:"flex-1 py-2.5 text-xs font-sans font-semibold rounded-lg bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200",children:"View personal insights →"}),n.jsx("button",{onClick:J,disabled:E==="syncing"||E==="awaitingLogin",className:`py-2.5 px-4 text-xs font-sans font-semibold rounded-lg border transition-all duration-200 disabled:opacity-50 disabled:cursor-wait shrink-0 ${E==="done"?"bg-terminal-green/8 text-terminal-green border-terminal-green/20":E==="error"?"bg-red-400/8 text-red-400 border-red-400/20":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border-terminal-border"}`,title:A||void 0,children:E==="syncing"?"Syncing...":E==="done"&&he?`✓ Synced ${he}`:E==="error"?"Sync failed":E==="awaitingLogin"?"Waiting...":"↑ Sync to cloud"}),n.jsx("a",{href:"https://vibe-replay.com/insights/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-9 h-9 rounded-lg text-terminal-dim hover:text-terminal-green hover:bg-terminal-surface-hover transition-colors shrink-0",title:"View insights on vibe-replay.com",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-stretch",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Sessions"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalSessions," total"]})]}),n.jsx("div",{className:"flex-1 flex flex-col justify-between",children:n.jsx(k0,{sessions:f.recentSources,isLoading:m,onViewAll:()=>l("sessions"),onGenerate:ne,onViewReplay:Q,onSessionClick:G=>k(G.slug),generatingSlug:v,generateErrorSlug:j})})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Replays"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[f.totalReplays," total"]})]}),n.jsx("div",{className:"flex-1 flex flex-col justify-between",children:n.jsx(C0,{replays:f.recentReplays,isLoading:p,onViewAll:()=>l("replays"),onOpen:Q})})]})]}),te?n.jsx(S0,{}):h&&h.topProjects.length>1?n.jsxs("div",{className:"bg-terminal-surface rounded-xl p-4 shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-xs font-sans font-semibold text-terminal-text uppercase tracking-wider",children:"Recent Projects"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:[xe," total"]})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:[...h.topProjects].sort((G,F)=>(F.lastActivity||"").localeCompare(G.lastActivity||"")).slice(0,5).map(G=>{const F=na(G.project);return n.jsxs("button",{onClick:()=>{l("sessions"),setTimeout(()=>{ht({tab:"sessions",project:G.project})},50)},className:"flex items-center justify-between gap-2 px-3 py-2.5 rounded-lg bg-terminal-bg hover:bg-terminal-surface-hover transition-colors text-left group",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-text truncate block group-hover:text-terminal-green transition-colors",children:F}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[G.sessions," session",G.sessions>1?"s":""," · ",G.prompts," prompts",G.durationMs>0&&` · ${Mu(G.durationMs)}`]})]}),G.cost>0&&n.jsxs("span",{className:"text-xs font-mono text-terminal-orange tabular-nums shrink-0",children:["$",G.cost.toFixed(2)]})]},G.project)})}),h.topProjects.length>5&&n.jsx("button",{onClick:()=>l("projects"),className:"w-full py-2 mt-2 text-xs font-sans font-semibold rounded-lg bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200",children:"View all projects →"})]}):null,n.jsx(T0,{})]}),oe&&n.jsx(Jh,{session:oe,onClose:()=>k(null),onGenerate:W,onViewReplay:G=>ht({view:null,session:G}),onArchive:G=>{fetch(`/api/archive/${G}`,{method:"POST"}).catch(()=>{}),k(null)},onTitleSave:T,onDeleteReplay:_,isGenerating:v===oe.slug,isArchived:!1}),(E==="needsLogin"||E==="awaitingLogin")&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:G=>{G.target===G.currentTarget&&E==="needsLogin"&&M("idle")},children:n.jsxs("div",{className:"relative bg-terminal-surface border border-terminal-border rounded-2xl shadow-2xl max-w-md w-full mx-4 p-6",children:[E==="needsLogin"&&n.jsx("button",{onClick:()=>M("idle"),className:"absolute top-3 right-3 w-7 h-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors cursor-pointer",children:"×"}),E==="needsLogin"?n.jsxs(n.Fragment,{children:[n.jsx("h3",{className:"text-base font-bold text-terminal-text mb-1",children:"Sync Insights to the Cloud"}),n.jsx("p",{className:"text-xs text-terminal-dim mb-5",children:"Sign in with GitHub to unlock your online dashboard."}),n.jsxs("div",{className:"space-y-3 mb-6",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-terminal-green/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-green",children:"1"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-terminal-text",children:"Cross-machine dashboard"}),n.jsx("p",{className:"text-[11px] text-terminal-dim mt-0.5",children:"See all your sessions, costs, and streaks in one place — from any browser."})]})]}),n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-terminal-orange/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-orange",children:"2"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-terminal-text",children:"Cost tracking & trends"}),n.jsx("p",{className:"text-[11px] text-terminal-dim mt-0.5",children:"Track spending by model, spot weekly patterns, and monitor project breakdowns."})]})]}),n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-terminal-blue/10 flex items-center justify-center text-xs font-bold font-mono text-terminal-blue",children:"3"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-terminal-text",children:"Share your coding card"}),n.jsx("p",{className:"text-[11px] text-terminal-dim mt-0.5",children:"Activity heatmaps, streak badges, and project stats — shareable at a glance."})]})]})]}),n.jsxs("button",{onClick:P,className:"w-full inline-flex items-center justify-center gap-2 h-10 rounded-lg bg-[#24292f] hover:bg-[#32383f] text-white text-sm font-semibold transition-colors cursor-pointer border border-white/10",children:[n.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Sign in with GitHub"]}),n.jsx("p",{className:"text-[10px] text-terminal-dim text-center mt-3",children:"We'll auto-sync your insights right after sign in."})]}):n.jsxs("div",{className:"text-center py-4",children:[n.jsx("div",{className:"text-2xl mb-3 animate-pulse",children:"↑"}),n.jsx("h3",{className:"text-base font-bold text-terminal-text mb-1",children:"Waiting for sign in..."}),n.jsx("p",{className:"text-xs text-terminal-dim",children:"Complete GitHub sign in in the browser tab. We'll auto-sync once you're in."})]})]})})]})}function A0({sessionsPerDay:l}){const r=y.useMemo(()=>{const o=new Date,u=new Date(o);u.setDate(u.getDate()-29);const m=[],p=new Date(u);for(;p<=o;){const g=p.toISOString().slice(0,10);m.push(l[g]||0),p.setDate(p.getDate()+1)}return m},[l]),i=Math.max(...r,1);return n.jsx("div",{className:"flex items-end gap-px h-4",children:r.map((o,u)=>n.jsx("div",{className:`w-1 rounded-sm ${o>0?"bg-terminal-green":"bg-terminal-surface-2"}`,style:{height:o>0?`${Math.max(20,o/i*100)}%`:"2px",opacity:o>0?.4+o/i*.6:.2}},u))})}function eu(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}function R0(l){if(!l)return"";const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const u=Math.floor(o/24);return u<30?`${u}d ago`:`${Math.floor(u/30)}mo ago`}function M0({onNavigate:l}){const{userInsights:r,scanStatus:i}=Fl(),[o,u]=y.useState("lastActivity"),m=y.useMemo(()=>{if(!r)return[];const f=[...r.topProjects];switch(o){case"lastActivity":f.sort((x,h)=>(h.lastActivity||"").localeCompare(x.lastActivity||""));break;case"sessions":f.sort((x,h)=>h.sessions-x.sessions);break;case"cost":f.sort((x,h)=>h.cost-x.cost);break;case"duration":f.sort((x,h)=>h.durationMs-x.durationMs);break}return f},[r,o]),p=i?.running&&i.total>0;if(!r&&!p)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2 text-terminal-dimmer text-sm font-mono",children:[n.jsx("p",{children:"No scan data available yet."}),n.jsx("p",{className:"text-xs",children:"Projects will appear once the background scan completes."})]})});if(!r&&p)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"flex items-center gap-2 text-terminal-dim text-sm font-mono",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),"Analyzing sessions... ",i.scanned,"/",i.total]})});const g=f=>{l("sessions"),setTimeout(()=>{ht({tab:"sessions",project:f})},50)};return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:n.jsxs("h2",{className:"text-sm font-sans font-semibold text-terminal-text",children:["All Projects",n.jsxs("span",{className:"ml-2 text-terminal-dimmer font-normal",children:["(",m.length,")"]})]})}),n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-sans",children:[n.jsx("span",{className:"text-terminal-dimmer mr-1",children:"Sort:"}),[["lastActivity","Recent"],["sessions","Sessions"],["cost","Cost"],["duration","Duration"]].map(([f,x])=>n.jsx("button",{onClick:()=>u(f),className:`px-2 py-1 rounded-md transition-colors ${o===f?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:x},f))]})]}),p&&n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse"}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Analyzing... ",i.scanned,"/",i.total]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:m.map(f=>{const x=f.project.split("/").pop()||f.project;return n.jsxs("button",{onClick:()=>g(f.project),className:"text-left bg-terminal-surface rounded-xl p-4 shadow-layer-sm hover:bg-terminal-surface-hover transition-all duration-200 group border-l-2 border-terminal-green/40 hover:border-terminal-green",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-sans font-medium text-terminal-text truncate group-hover:text-terminal-green transition-colors",children:x}),n.jsx("div",{className:"text-[10px] font-mono text-terminal-dimmer truncate mt-0.5",children:f.project})]}),f.lastActivity&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer shrink-0",children:R0(f.lastActivity)})]}),n.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono flex-wrap mb-3",children:[n.jsxs("span",{className:"text-terminal-text tabular-nums",children:[f.sessions," ",n.jsxs("span",{className:"text-terminal-dimmer",children:["session",f.sessions!==1?"s":""]})]}),f.durationMs>0&&n.jsx("span",{className:"text-terminal-blue tabular-nums",children:vt(f.durationMs)}),f.cost>0&&n.jsxs("span",{className:"text-terminal-orange tabular-nums",children:["$",f.cost.toFixed(2)]}),n.jsxs("span",{className:"text-terminal-green tabular-nums",children:[eu(f.prompts)," ",n.jsx("span",{className:"text-terminal-dimmer",children:"prompts"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-terminal-dimmer flex-wrap mb-2",children:[f.toolCalls>0&&n.jsxs("span",{children:[eu(f.toolCalls)," tools"]}),f.edits>0&&n.jsxs("span",{children:[eu(f.edits)," edits"]}),f.branchCount>0&&n.jsxs("span",{children:[f.branchCount," branch",f.branchCount!==1?"es":""]}),f.prCount>0&&n.jsxs("span",{children:[f.prCount," PR",f.prCount!==1?"s":""]}),f.memoryFileCount>0&&n.jsxs("span",{children:[f.memoryFileCount," memory file",f.memoryFileCount!==1?"s":""]})]}),n.jsx(A0,{sessionsPerDay:f.sessionsPerDay})]},f.project)})})]})})}const D0=()=>n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[n.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]});function Lu({provider:l}){return n.jsx("span",{className:`text-[10px] font-sans font-medium px-1.5 py-0.5 rounded-full uppercase tracking-wider ${Lh(l)}`,children:Oh(l)})}function _0({slug:l,title:r,fallbackTitle:i,onSave:o}){const u=kt(r||i||l),[m,p]=y.useState(!1),[g,f]=y.useState(u),[x,h]=y.useState(!1),v=y.useRef(null);y.useEffect(()=>{f(u)},[u]),y.useEffect(()=>{m&&v.current?.focus()},[m]);const C=async()=>{if(!x){h(!0);try{await o(l,kt(g))}finally{h(!1),p(!1)}}};return m?n.jsxs("div",{className:"min-w-0",children:[n.jsx("form",{onSubmit:j=>{j.preventDefault(),C()},className:"flex items-center gap-1.5 min-w-0",children:n.jsx("input",{ref:v,value:g,onChange:j=>f(j.target.value),onBlur:C,onKeyDown:j=>{j.key==="Escape"&&(f(u),p(!1))},className:"bg-terminal-surface-2 rounded px-2 py-0.5 text-sm font-sans text-terminal-text w-full outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/50 transition-shadow duration-200",placeholder:u,maxLength:Du,disabled:x})}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l})]})]}):n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("button",{onClick:()=>p(!0),className:"group flex items-center gap-1 min-w-0 max-w-full text-left",title:"Click to edit title",children:[n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate",children:u||l}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"shrink-0 text-terminal-dim opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx("path",{d:"M11.5 1.5l3 3-9 9H2.5v-3l9-9z"})})]}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l})]})]})}function O0({onArchive:l,isArchived:r}){const[i,o]=y.useState(!1),u=y.useRef(null),m=y.useCallback(()=>o(!1),[]);return Au(u,m,i),n.jsxs("div",{className:"relative",ref:u,children:[n.jsx("button",{onClick:p=>{p.stopPropagation(),o(g=>!g)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:n.jsx(D0,{})}),i&&n.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:n.jsxs("button",{onClick:p=>{p.stopPropagation(),l(),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),r?"Unarchive":"Archive"]})})]})}let ci=null,$s=null;function Qh(){return ci?Promise.resolve(ci):$s||($s=fetch("/api/scan/results").then(l=>l.ok?l.json():null).then(l=>{const r=l?.results??null;return ci=r,setTimeout(()=>{ci=null,$s=null},3e4),r}).catch(()=>null),$s)}function hu(l,r,i){const o=[],u=new Set,m=[r?.firstPrompt,...l.prompts||[]];r?.firstPrompt||m.push(l.firstPrompt);for(const g of m){const f=Yl(g||"");!f||u.has(f)||(u.add(f),o.push(f))}const p=Yl(i||"");return o.length>1&&p&&o[0]===p&&o.shift(),o.length>1&&/^(?:and|but|or|so|then)\b/i.test(o[0]||"")&&o.shift(),o}function Xh(l){return l&&l!=="main"&&l!=="master"?l:void 0}function Ih(l,r){return l==="jsonl"?"bg-terminal-orange-subtle text-terminal-orange":l==="global-state"?"bg-terminal-blue-subtle text-terminal-blue":l==="sqlite"||r?"bg-terminal-green-subtle text-terminal-green":"bg-terminal-surface-2 text-terminal-dimmer"}function Jh({session:l,scanData:r=null,onClose:i,onGenerate:o,onViewReplay:u,onArchive:m,onTitleSave:p,onDeleteReplay:g,isGenerating:f,isArchived:x}){const[h,v]=y.useState(r),C=_u(l),j=mu(l,h),[w,S]=y.useState(l.replay?.title||j),[k,E]=y.useState(!1),M=y.useRef(null);y.useEffect(()=>{const z=Q=>{Q.key==="Escape"&&i()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),y.useEffect(()=>{const z=M.current;z&&(z.focus(),z.setSelectionRange(z.value.length,z.value.length))},[]),y.useEffect(()=>{v(r)},[r]),y.useEffect(()=>{if(r)return;let z=!1;return Qh().then(Q=>{if(z||!Q)return;const ne=Q.find(W=>W.slug===l.slug);ne&&v(ne)}),()=>{z=!0}},[r,l.slug]),y.useEffect(()=>{S(z=>{const Q=kt(z),ne=kt(j),W=kt(l.replay?.title);return!Q||Q===W||Q===l.slug||ne&&Q===kt(C)?l.replay?.title||j:z})},[C,j,l.replay?.title,l.slug]);const A=Xh(h?.gitBranch||l.gitBranch),R=h?.model||l.model,O=hu(l,h,j),$=h?.dataQualityNotes||[],H=h?.promptCount??l.promptCount,K=h?.toolCallCount??l.toolCallCount,ae=h?.editCount??l.editCountEst,ue=h?.durationMs??l.durationMsEst,oe=h?.costEstimate??l.replay?.stats?.costEstimate,te=h?.tokenUsage?h.tokenUsage.inputTokens+h.tokenUsage.outputTokens:void 0,xe=h?.startTime||l.timestamp,de=async()=>{if(!l.replay||k)return;const z=kt(w);if(z!==kt(l.replay.title||j)){E(!0);try{await p(l.slug,z)}finally{E(!1)}}},pe=()=>{o(l,w)};return n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[n.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:i}),n.jsxs("div",{className:"relative max-w-4xl w-full bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl animate-in zoom-in-95 fade-in duration-200 flex flex-col max-h-[88vh]",onClick:z=>z.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-7 pt-5 pb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Lu,{provider:l.provider}),R&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:Ci(R)}),h?.dataSource&&n.jsx("span",{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-full ${Ih(h.dataSource,l.hasSqlite)}`,children:pu(l.hasSqlite,h.dataSource)}),h?.entrypoint&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-surface-2 text-terminal-dimmer",children:h.entrypoint}),h?.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"trust mode"}),h?.skillsUsed?.map(z=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400",children:z},z)),h?.mcpServersUsed?.map(z=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-purple-500/10 text-purple-400",children:z},z)),l.replay?.replayOutdated&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:"outdated replay"})]}),n.jsx("button",{onClick:i,className:"h-7 w-7 flex items-center justify-center rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto px-7 space-y-5 pb-5",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[n.jsx("span",{className:"text-xs font-sans uppercase tracking-widest text-terminal-dimmer",children:"Title"}),n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:l.slug})]}),n.jsx("form",{onSubmit:z=>{z.preventDefault(),l.replay?de():pe()},children:n.jsx("textarea",{ref:M,value:w,onChange:z=>S(z.target.value.replace(/\n/g,"")),onBlur:()=>{l.replay&&de()},onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),l.replay?de():pe())},rows:2,className:"w-full bg-terminal-surface rounded-xl px-5 py-4 text-lg font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-green/40 transition-shadow duration-200 resize-none leading-relaxed",placeholder:j,maxLength:Du})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Session Info"}),n.jsx(dt,{label:"Project",value:na(l.project),title:l.project}),A&&n.jsx(dt,{label:"Branch",value:A}),h?.gitBranches&&h.gitBranches.length>1&&n.jsx(dt,{label:"Branches",value:h.gitBranches.join(", ")}),h?.skillsUsed&&h.skillsUsed.length>0&&n.jsx(dt,{label:"Skills",value:h.skillsUsed.join(", ")}),h?.mcpServersUsed&&h.mcpServersUsed.length>0&&n.jsx(dt,{label:"MCP Servers",value:h.mcpServersUsed.join(", ")}),n.jsx(dt,{label:"Started",value:`${hi(xe)} (${ql(xe)})`}),h?.endTime&&n.jsx(dt,{label:"Ended",value:hi(h.endTime)}),!!ue&&n.jsx(dt,{label:"Duration",value:`~${vt(ue)}`}),n.jsx(dt,{label:"Size",value:xi(l.fileSize)}),n.jsx(dt,{label:"Lines",value:l.lineCount.toLocaleString()}),l.filePaths.length>1&&n.jsx(dt,{label:"Parts",value:`${l.filePaths.length} files`}),n.jsx(dt,{label:"Data",value:pu(l.hasSqlite,h?.dataSource)})]}),n.jsxs("div",{className:"bg-terminal-surface rounded-xl px-5 py-4 space-y-2.5",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-1",children:"Stats"}),!!H&&n.jsx(dt,{label:"Prompts",value:String(H)}),!!K&&n.jsx(dt,{label:"Tools",value:String(K)}),!!ae&&n.jsx(dt,{label:"Edits",value:h?String(ae):`~${ae}`}),oe!=null&&oe>0&&n.jsx(dt,{label:"Cost",value:Dh(oe)}),te!=null&&n.jsx(dt,{label:"Tokens",value:te.toLocaleString(),title:h?.tokenUsage?`In: ${h.tokenUsage.inputTokens.toLocaleString()} / Out: ${h.tokenUsage.outputTokens.toLocaleString()} / Cache write: ${h.tokenUsage.cacheCreationTokens.toLocaleString()} / Cache read: ${h.tokenUsage.cacheReadTokens.toLocaleString()}`:void 0}),h!=null&&h.subAgentCount>0&&n.jsx(dt,{label:"Agents",value:`${h.subAgentCount} sub-agents`}),h!=null&&h.compactionCount>0&&n.jsx(dt,{label:"Compacts",value:String(h.compactionCount)}),h!=null&&h.apiErrorCount>0&&n.jsx(dt,{label:"Errors",value:`${h.apiErrorCount} API errors`}),l.hasPR&&!h?.prLinks?.length&&n.jsx(dt,{label:"PR",value:"Yes"}),h?.prLinks?.map(z=>n.jsx(dt,{label:"PR",value:`#${z.prNumber} (${z.prRepository})`},z.prNumber))]})]}),$.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Data Quality"}),n.jsx("div",{className:"bg-terminal-surface rounded-xl px-4 py-3 space-y-1.5",children:$.map(z=>n.jsxs("div",{className:"flex gap-2 items-start text-xs font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange shrink-0 mt-px",children:"!"}),n.jsx("span",{children:z})]},z))})]}),h?.filesModified&&h.filesModified.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:["Files Modified (",h.filesModified.length,")"]}),n.jsxs("div",{className:"max-h-[120px] overflow-y-auto bg-terminal-surface rounded-xl px-4 py-2.5 space-y-1",children:[h.filesModified.slice(0,20).map(z=>n.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-dim truncate",children:z.file}),n.jsxs("span",{className:"text-terminal-dimmer shrink-0 tabular-nums",children:[z.count,"x"]})]},z.file)),h.filesModified.length>20&&n.jsxs("div",{className:"text-xs font-mono text-terminal-dimmer",children:["+",h.filesModified.length-20," more files"]})]})]}),O.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Prompts"}),n.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:O.map((z,Q)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-2 leading-relaxed",children:z})]},Q))})]}),l.replay&&n.jsxs("div",{className:"border-t border-terminal-border-subtle pt-4",children:[n.jsx("div",{className:"text-[10px] font-sans uppercase tracking-widest text-terminal-dimmer mb-2",children:"Replay"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.replay.replaySize!=null&&n.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:xi(l.replay.replaySize)}),l.replay.generatorVersion&&n.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dimmer",children:["v",l.replay.generatorVersion]}),!!l.replay.annotationCount&&n.jsxs("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-surface text-terminal-dim",children:[l.replay.annotationCount," annotations"]}),(l.replay.cloud||l.replay.gist)&&n.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-terminal-green-subtle text-terminal-green",children:l.replay.cloud?"Cloud":"Gist"})]})]}),l.expiresInDays!=null&&l.expiresInDays<=7&&n.jsxs("div",{className:`rounded-lg px-4 py-2.5 text-sm font-mono ${l.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,children:[l.expiresInDays===0?"Transcript expires today":`Transcript expires in ${l.expiresInDays} day${l.expiresInDays!==1?"s":""}`," — generate a replay to preserve it."]})]}),n.jsxs("div",{className:"flex items-center justify-between px-7 py-4 border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{m(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors flex items-center gap-1.5",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),x?"Unarchive":"Archive"]}),l.replay&&n.jsxs("button",{onClick:()=>{g(l.slug),i()},className:"h-9 px-3 text-xs font-sans rounded-lg text-terminal-red/70 hover:text-terminal-red hover:bg-terminal-red-subtle transition-colors flex items-center gap-1.5",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M3 4h10M5.5 4V3h5v1M6 7v4M10 7v4M4.5 4l.5 9h6l.5-9"})}),"Delete replay"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[l.replay&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>o(l,w),disabled:f,className:"h-11 px-5 text-sm font-sans font-semibold rounded-xl bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 flex items-center gap-2 disabled:opacity-50",children:f?n.jsx("span",{className:"animate-pulse",children:"Regenerating..."}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]}),"Regenerate"]})}),n.jsxs("button",{onClick:()=>u(l.existingReplay),className:"h-11 px-6 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2",children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M5 3l8 5-8 5V3z"})}),"View Replay"]})]}),!l.replay&&n.jsx("button",{onClick:pe,disabled:f,className:"h-12 px-8 text-sm font-sans font-bold rounded-xl bg-terminal-green text-terminal-bg hover:brightness-110 transition-all duration-200 flex items-center gap-2 shadow-lg shadow-terminal-green/20 disabled:opacity-50",children:f?n.jsx("span",{className:"animate-pulse",children:"Generating..."}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate Replay"]})})]})]})]})]})}function dt({label:l,value:r,title:i}){return n.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[n.jsx("span",{className:"text-[11px] font-sans text-terminal-dimmer uppercase tracking-wider shrink-0 w-[68px]",children:l}),n.jsx("span",{className:"text-sm font-mono text-terminal-dim truncate",title:i||r,children:r})]})}function Kh({summary:l,onOpen:r,onShare:i,onTitleSave:o,onDelete:u,onRegenerate:m,onArchive:p,isDeleting:g,isRegenerating:f,isArchived:x}){const[h,v]=y.useState(!1),[C,j]=y.useState(!1),w=y.useRef(null),S=y.useCallback(()=>{j(!1),v(!1)},[]);return Au(w,S,C),n.jsxs("div",{onClick:r,className:`bg-terminal-surface rounded-xl px-5 py-5 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-3.5 shadow-layer-sm cursor-pointer hover-lift ${x?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:o?n.jsx("div",{className:"flex-1 min-w-0",onClick:k=>k.stopPropagation(),children:n.jsx(_0,{slug:l.slug,title:l.title,fallbackTitle:fu(l),onSave:o})}):n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-text truncate block",children:fu(l)}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate mt-0.5",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:l.slug})]})]})}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.replayOutdated&&n.jsxs("span",{className:"h-6 px-2 text-[10px] font-mono rounded-md bg-terminal-orange-subtle text-terminal-orange flex items-center gap-1",title:`Generated with v${l.generatorVersion||"?"} — regenerate to update`,children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),n.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]}),"outdated"]}),l.gist?.outdated&&n.jsx("button",{onClick:k=>{k.stopPropagation(),i?.()},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis transition-all duration-200 ease-material shrink-0",title:"Gist out of sync — click to update",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})})}),i&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),i()},className:`h-7 px-2.5 text-xs font-sans font-semibold rounded-md transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 ${l.cloud||l.gist?"bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis":"bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis"}`,title:l.cloud||l.gist?"Already shared — view or update":"Share & Export",children:[l.cloud||l.gist?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"})}):n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M8 2v8M5 5l3-3 3 3M3 11v2h10v-2"})}),l.cloud||l.gist?"Shared":"Share"]}),m&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),m()},disabled:f,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1.5 shrink-0 disabled:opacity-50",title:"Redo",children:[f?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]}),"Redo"]}),n.jsxs("button",{onClick:r,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 shrink-0",children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("polygon",{points:"4 2 14 8 4 14"})}),"View"]}),(u||p)&&n.jsxs("div",{className:"relative",ref:w,children:[n.jsx("button",{onClick:k=>{k.stopPropagation(),j(E=>!E),v(!1)},className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface-2 text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"More actions",children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[n.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),n.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),C&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-lg bg-terminal-surface-2 border border-terminal-border shadow-layer-md py-1",children:[p&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),p(),j(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M2 4h12v2H2zM3 6v7h10V6M6.5 8h3"})}),x?"Unarchive":"Archive"]}),u&&n.jsxs(n.Fragment,{children:[p&&n.jsx("div",{className:"mx-2 my-1 border-t border-terminal-border"}),h?n.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[n.jsx("button",{onClick:k=>{k.stopPropagation(),u(),v(!1),j(!1)},className:"h-6 px-2 text-xs font-sans rounded bg-terminal-red-subtle text-terminal-red hover:bg-terminal-red-emphasis transition-colors duration-200",children:"Confirm"}),n.jsx("button",{onClick:()=>v(!1),className:"h-6 px-2 text-xs font-sans rounded text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]}):n.jsxs("button",{onClick:()=>v(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs font-sans text-terminal-red hover:bg-terminal-red-subtle transition-colors",children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:n.jsx("path",{d:"M3 4h10M5.5 4V3a1 1 0 011-1h3a1 1 0 011 1v1M6.5 7v4M9.5 7v4M4.5 4l.5 9a1 1 0 001 1h4a1 1 0 001-1l.5-9"})}),"Delete"]})]})]})]})]})]}),(l.messages||(l.firstMessage?[l.firstMessage]:[])).map(k=>Yl(k||"")).filter(k=>k.length>0).map((k,E)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:k})]},E)),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[l.stats.userPrompts," prompts"]}),n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[l.stats.toolCalls," tools"]}),l.stats.durationMs&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:vt(l.stats.durationMs)}),l.stats.costEstimate&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-green-subtle text-terminal-green",children:Dh(l.stats.costEstimate)}),l.hasAnnotations&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-blue-subtle text-terminal-blue",children:[l.annotationCount," annotation",l.annotationCount!==1?"s":""]}),l.replaySize!=null&&l.replaySize>0&&n.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md ${l.replaySize>10*1024*1024?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,title:l.replaySize>10*1024*1024?"Exceeds share limit (10MB)":void 0,children:xi(l.replaySize)})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-terminal-dimmer flex-wrap",children:[n.jsx(Lu,{provider:l.provider}),n.jsx("span",{children:l.project}),n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{children:hi(l.startTime)}),l.model&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{children:l.model})]})]})]})}function nh(){const[l,r]=y.useState(!1),[i,o]=y.useState(null),[u,m]=y.useState(null),p=async()=>{r(!0),m(null),o(null);try{const g=await fetch("/api/regenerate-all",{method:"POST"}),f=await g.json();if(!g.ok)throw new Error(f.error||"Failed");o({regenerated:f.regenerated,total:f.total}),setTimeout(()=>window.location.reload(),1500)}catch(g){m(g instanceof Error?g.message:"Failed to regenerate")}finally{r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:p,disabled:l,className:"px-3 py-1.5 text-xs font-mono rounded-lg bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover border border-terminal-border-subtle transition-colors duration-200 disabled:opacity-40",children:l?"Regenerating...":"Regenerate All"}),i&&n.jsxs("span",{className:"text-xs font-mono text-terminal-green",children:[i.regenerated,"/",i.total," regenerated"]}),u&&n.jsx("span",{className:"text-xs font-mono text-terminal-red",children:u})]})}function L0(){const[l,r]=y.useState([]),[i,o]=y.useState({}),[u,m]=y.useState(null),[p,g]=y.useState(!0),[f,x]=y.useState(null),[h,v]=y.useState(!1),[C,j]=y.useState(null),[w,S]=y.useState(null),[k,E]=y.useState(null),[M,A]=y.useState(()=>Date.now()),{selectedProject:R,filter:O,showArchived:$,handleProjectChange:H,handleFilterChange:K,handleToggleArchived:ae}=$h(),{scanStatus:ue,userInsights:oe,projectInsightsCache:te,fetchProjectInsights:xe}=Fl();y.useEffect(()=>{R!==pt&&xe(R)},[R,xe]);const de=R!==pt?te.get(R):void 0,[pe,U]=y.useState(null),[z,Q]=y.useState(null),[ne,W]=y.useState(null),T=y.useRef(!1),[_,V]=y.useState(new Set),[J,P]=y.useState(null),he=l.some(I=>I.provider==="cursor"),G=ne?l.find(I=>I.slug===ne)??null:null,F=y.useCallback(async I=>{g(!0),x(null),S(null),v(!1),j(null);const we=await fetch("/api/archived").then(Se=>Se.ok?Se.json():{slugs:[]}).catch(()=>({slugs:[]}));V(new Set(we.slugs));let ve=!1;const ce=await fetch("/api/sources/cached").then(Se=>Se.ok?Se.json():null).catch(()=>null),fe=Aa(ce),_e=!I?.forceRefresh&&Xs(fe?.cachedAt);if(fe&&fe.sessions.length>0&&(ve=!0,r(fe.sessions),E(fe.cachedAt??null),j(_e?null:fe.cachedAt??null),g(!1),v(!_e)),_e){v(!1),g(!1);return}try{const Se=await fetch("/api/sources");if(!Se.ok)throw new Error("Failed to load sessions");const Be=await Se.json();r(Be.sessions),Be.cleanupPeriodDays!=null&&m(Be.cleanupPeriodDays),E(new Date().toISOString()),j(null)}catch(Se){ve?S("Failed to refresh latest sessions. Showing cached data."):x(gi(Se)||"Failed to load sessions")}finally{v(!1),g(!1)}},[]),me=I=>zh(I,_,V);y.useEffect(()=>{F()},[F]),y.useEffect(()=>{if(l.length===0)return;let I=!1;const we=async()=>{const ce=await Qh();I||!ce||o(Object.fromEntries(ce.filter(fe=>fe.slug).map(fe=>[fe.slug,fe])))};we();const ve=window.setInterval(()=>{we()},ue?.running?5e3:3e4);return()=>{I=!0,window.clearInterval(ve)}},[ue?.running,l.length]),y.useEffect(()=>{if(!p&&!he&&!T.current)return;let I=!1,we;const ve=async()=>{const fe=await fetch("/api/sources/cached").then(Se=>Se.ok?Se.json():null).catch(()=>null),_e=Aa(fe);!I&&_e?.sessions.length&&r(_e.sessions)},ce=async()=>{const fe=await fetch("/api/sources/enrichment-status").then(_e=>_e.ok?_e.json():null).catch(()=>null);!fe||I||(P(fe),fe.running?(T.current=!0,await ve()):T.current&&(T.current=!1,await ve()))};return ce(),we=window.setInterval(()=>{ce()},2500),()=>{I=!0,we&&window.clearInterval(we)}},[he,p]),y.useEffect(()=>{const I=window.setInterval(()=>A(Date.now()),3e4);return()=>window.clearInterval(I)},[]);const be=async(I,we)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(I)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:we})})).ok)throw new Error("Failed to update title");r(ce=>ce.map(fe=>fe.slug===I&&fe.replay?{...fe,replay:{...fe.replay,title:we||void 0}}:fe))},Qe=async(I,we)=>{W(null),U(I.slug),Q(null);try{const ve=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:I.provider,filePaths:I.filePaths,toolPaths:I.toolPaths,title:kt(we)||void 0,sessionSlug:I.slug,sessionProject:I.project})}),ce=await ve.json();if(!ve.ok)throw new Error(ce.error||"Generation failed");ht({view:null,session:ce.slug})}catch(ve){Q(gi(ve))}finally{U(null)}},lt=async I=>{try{if(!(await fetch(`/api/sessions/${encodeURIComponent(I)}`,{method:"DELETE"})).ok)return;r(ve=>ve.map(ce=>ce.slug===I?{...ce,replay:void 0,existingReplay:null}:ce))}catch{}},Ct=l.filter(I=>_.has(I.slug)).length,Fe=$?l:l.filter(I=>!_.has(I.slug)),it=new Map;for(const I of Fe)it.has(I.project)||it.set(I.project,[]),it.get(I.project)?.push(I);const Bt=[...it.entries()].sort((I,we)=>{const ve=I[1][0]?.timestamp||"";return(we[1][0]?.timestamp||"").localeCompare(ve)}),kn=Bh(Bt.map(([I])=>I)),qt=R===pt?Fe:it.get(R)||[],Cn=O?qt.filter(I=>I.slug.toLowerCase().includes(O.toLowerCase())||I.firstPrompt.toLowerCase().includes(O.toLowerCase())||(I.title||"").toLowerCase().includes(O.toLowerCase())||(I.gitBranch||"").toLowerCase().includes(O.toLowerCase())):qt,ze=k?Ru(k,M):null,ot=p&&l.length===0,jt=7,st=l.filter(I=>I.expiresInDays!=null&&I.expiresInDays<=jt&&!_.has(I.slug)),Ze=st.reduce((I,we)=>Math.min(I,we.expiresInDays??1/0),1/0);return f&&l.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:f}),n.jsx("button",{onClick:()=>void F({forceRefresh:!0}),className:"px-3 py-1.5 text-xs font-mono rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",children:"Retry"})]})}):l.length===0&&!ot?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No AI sessions found"}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Start a coding session with Claude Code or Cursor, then come back here"})]})}):n.jsxs("div",{className:"flex flex-1 min-h-0",children:[n.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),ze&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:ze})]}),n.jsx("button",{onClick:()=>{F({forceRefresh:!0})},className:"p-1.5 rounded-md text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors duration-200",title:"Refresh",children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.3-4M13.5 8a5.5 5.5 0 01-9.3 4"}),n.jsx("path",{d:"M12.5 1v3h-3M3.5 15v-3h3"})]})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[n.jsxs("button",{onClick:()=>H(pt),className:`w-full text-left px-3 py-2.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${R===pt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[n.jsx("span",{className:"font-medium",children:"All projects"}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${R===pt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:l.length})]}),n.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),Bt.map(([I,we])=>{const ve=we.filter(Be=>Be.existingReplay).length,ce=R===I,fe=kn.get(I)||na(I),_e=we[0]?.projectExists!==!1,Se=we.some(Be=>Be.isGitRepo||Be.gitBranch);return n.jsxs("button",{onClick:()=>H(I),title:I,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${ce?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"} ${_e?"":"opacity-50"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[n.jsxs("span",{className:`text-xs font-sans truncate flex items-center gap-1.5 ${ce?"text-terminal-green font-medium":_e?"text-terminal-text group-hover:text-terminal-text":"text-terminal-dim"}`,children:[Se&&n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",className:`shrink-0 ${ce?"opacity-70":"opacity-40"}`,children:n.jsx("path",{fillRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),fe]}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${ce?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:we.length})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${ce?"text-terminal-dim":"text-terminal-dimmer"}`,children:ql(we[0]?.timestamp||"")}),ve>0&&n.jsxs("span",{className:`text-xs font-mono ${ce?"text-terminal-green":"text-terminal-dimmer"}`,children:[ve," ",ve===1?"replay":"replays"]})]})]},I)})]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[n.jsx("div",{className:"md:hidden px-3 pt-3",children:n.jsxs("select",{value:R,onChange:I=>H(I.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-sans text-terminal-text outline-none shadow-layer-sm",children:[n.jsxs("option",{value:pt,children:["All projects (",l.length,")"]}),Bt.map(([I,we])=>n.jsxs("option",{value:I,children:[kn.get(I)||na(I)," (",we.length,")"]},I))]})}),n.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:de&&R!==pt?n.jsx(bi,{insights:de,variant:"project"}):oe&&R===pt?n.jsx(bi,{insights:oe,variant:"all"}):n.jsx(Gh,{})}),n.jsxs("div",{className:"flex gap-2 items-center",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:I=>K(I.target.value),placeholder:"Filter by branch, title, prompt...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),Ct>0&&n.jsx("button",{onClick:ae,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${Ct} archived)`,children:$?"Active":"View all"})]})]}),(ot||h||C)&&n.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:ot?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"FETCHING SESSIONS..."})]}):h?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"SCANNING LATEST SESSIONS..."}),C&&n.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",pi(C),")"]})]}):C?n.jsxs("span",{children:["Showing stale cache (",pi(C),")"]}):null}),J?.running&&J.total>0&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsxs("span",{children:["BACKFILLING CURSOR STATS... ",J.processed,"/",J.total]})]}),w&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-orange-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-orange shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:w}),n.jsx("button",{onClick:()=>S(null),className:"ml-auto text-terminal-orange/60 hover:text-terminal-orange transition-colors",children:"×"})]}),z&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:z}),n.jsx("button",{onClick:()=>Q(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),st.length>0&&n.jsxs("div",{className:"mx-4 mb-2 flex items-start gap-2.5 bg-terminal-orange-subtle rounded-lg px-4 py-3 shrink-0 shadow-layer-sm",children:[n.jsx("span",{className:"text-terminal-orange text-base leading-none mt-0.5",children:"⚠"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"text-xs font-sans font-semibold text-terminal-orange",children:[st.length," session",st.length!==1?"s":""," expiring",Ze===0?" today":Ze===1?" tomorrow":` within ${Ze} days`]}),n.jsxs("div",{className:"text-[11px] font-mono text-terminal-orange/70 mt-0.5",children:["Claude Code auto-deletes transcripts after"," ",u!=null?`${u} days`:"the configured period",". Generate replays to preserve them."]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:ot?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching sessions..."}):Cn.length===0?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:O?"No sessions match your filter":"No sessions in this project"}):n.jsx("div",{className:"space-y-2.5 px-4 py-3",children:Cn.map(I=>{const we=i[I.slug];if(I.replay){const Yt=_.has(I.slug),Ft=mu(I,we),rn=hu(I,we,Ft);return n.jsx(Kh,{summary:{...I.replay,title:Ft,firstMessage:rn[0]||we?.firstPrompt||I.replay.firstMessage,messages:rn.length>0?rn.slice(0,2):we?.firstPrompt?[we.firstPrompt]:I.replay.messages,model:we?.model||I.replay.model},onOpen:()=>ht({view:null,session:I.existingReplay}),onShare:()=>ht({view:null,session:I.existingReplay,v:"export"}),onTitleSave:be,onRegenerate:()=>W(I.slug),isRegenerating:pe===I.slug,onDelete:()=>lt(I.slug),onArchive:()=>me(I.slug),isArchived:Yt},`${I.provider}-${I.slug}`)}const ve=mu(I,we),ce=hu(I,we,ve),fe=Xh(we?.gitBranch||I.gitBranch),_e=we?.promptCount??I.promptCount,Se=we?.toolCallCount??I.toolCallCount,Be=we?.durationMs??I.durationMsEst,et=we?.editCount??I.editCountEst,Oe=we?.model||I.model,Ue=pu(I.hasSqlite,we?.dataSource),tt=_.has(I.slug);return n.jsxs("div",{onClick:()=>W(I.slug),className:`bg-terminal-surface rounded-xl px-5 py-4 hover:bg-terminal-surface-hover transition-all duration-300 ease-material space-y-2.5 shadow-layer-sm cursor-pointer hover-lift ${tt?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0 space-y-0.5",children:[n.jsx("span",{className:"text-sm font-mono text-terminal-text truncate block",children:ve}),n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsxs("div",{className:"text-[11px] font-mono text-terminal-dimmer truncate",children:["slug: ",n.jsx("span",{className:"text-terminal-dim",children:I.slug})]}),fe&&n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded bg-terminal-surface-2 text-terminal-dim shrink-0 inline-flex items-center gap-0.5",children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"5",cy:"4",r:"2"}),n.jsx("circle",{cx:"11",cy:"12",r:"2"}),n.jsx("path",{d:"M5 6v4c0 1.1.9 2 2 2h2"})]}),fe]})]})]}),n.jsxs("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:ql(I.timestamp)}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:Yt=>{Yt.stopPropagation(),W(I.slug)},disabled:pe===I.slug,className:"h-7 px-2.5 text-xs font-sans font-semibold rounded-md bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis transition-all duration-200 ease-material flex items-center justify-center gap-1 disabled:opacity-50",children:pe===I.slug?n.jsx("span",{className:"animate-pulse",children:"Generating..."}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M8 2v12M2 8h12"})}),"Generate"]})}),n.jsx(O0,{onArchive:()=>me(I.slug),isArchived:tt})]})]})]}),ce.map((Yt,Ft)=>n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsx("span",{className:"text-xs text-terminal-green shrink-0 mt-px select-none",children:">"}),n.jsx("p",{className:"text-sm text-terminal-dim line-clamp-1 leading-relaxed",children:Yt})]},Ft)),(I.promptCount||Se||Be||et||I.hasPR||I.expiresInDays!=null&&I.expiresInDays<=jt)&&n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[!!_e&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",children:[_e," prompts"]}),!!Se&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-orange-subtle text-terminal-orange",children:[Se," tools"]}),!!Be&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated active duration",children:["~",vt(Be)]}),!!et&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:"Estimated file edits",children:["~",et," edits"]}),I.hasPR&&n.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",title:"Session produced a PR",children:"PR"}),I.expiresInDays!=null&&I.expiresInDays<=jt&&n.jsx("span",{className:`inline-flex items-center gap-1 text-xs font-mono px-1.5 py-0.5 rounded-md ${I.expiresInDays<=2?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-orange-subtle text-terminal-orange"}`,title:`Session transcript will be cleaned up by Claude Code in ${I.expiresInDays===0?"< 1 day":`${I.expiresInDays} day${I.expiresInDays!==1?"s":""}`}. Generate a replay to preserve it.`,children:I.expiresInDays===0?"expires today":`expires in ${I.expiresInDays}d`})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsx(Lu,{provider:I.provider}),R===pt&&n.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dim",title:I.project,children:kn.get(I.project)||na(I.project)}),Oe&&n.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:Ci(Oe)}),n.jsx("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:xi(I.fileSize)}),I.filePaths.length>1&&n.jsxs("span",{className:"text-xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:[I.filePaths.length," parts"]}),(I.hasSqlite||we?.dataSource)&&n.jsx("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded-md ${Ih(we?.dataSource,I.hasSqlite)}`,title:Ue,children:Ue})]})]},`${I.provider}-${I.slug}`)})})}),G&&n.jsx(Jh,{session:G,scanData:i[G.slug]||null,onClose:()=>W(null),onGenerate:Qe,onViewReplay:I=>ht({view:null,session:I}),onArchive:I=>{me(I)},onTitleSave:be,onDeleteReplay:lt,isGenerating:pe===G.slug,isArchived:_.has(G.slug)})]})]})}function z0(){const[l,r]=y.useState([]),[i,o]=y.useState(!0),[u,m]=y.useState(!1),[p,g]=y.useState(!1),[f,x]=y.useState(null),[h,v]=y.useState(null),[C,j]=y.useState(()=>Date.now()),[w,S]=y.useState(new Set),[k,E]=y.useState(null),[M,A]=y.useState(null),{selectedProject:R,filter:O,showArchived:$,handleProjectChange:H,handleFilterChange:K,handleToggleArchived:ae}=$h(),{userInsights:ue,projectInsightsCache:oe,fetchProjectInsights:te}=Fl();y.useEffect(()=>{R!==pt&&te(R)},[R,te]);const xe=R!==pt?oe.get(R):void 0;y.useEffect(()=>{let F=!0;return(async()=>{o(!0),g(!1),x(null);const be=await fetch("/api/archived").then(it=>it.ok?it.json():{slugs:[]}).catch(()=>({slugs:[]}));F&&S(new Set(be.slugs));let Qe=!1;const lt=await fetch("/api/sessions/cached").then(it=>it.ok?it.json():null).catch(()=>null),Ct=Aa(lt),Fe=Xs(Ct?.cachedAt);if(F&&Ct&&(Qe=!0,r(Ct.sessions),m(!0),v(Ct.cachedAt??null),(Ct.sessions.length>0||Fe)&&(x(Fe?null:Ct.cachedAt??null),o(!1),g(!Fe))),Fe){F&&(g(!1),o(!1));return}try{const it=await fetch("/api/sessions");if(!it.ok)throw new Error("Failed to load sessions");const Bt=await it.json();if(!F)return;r(Bt),m(!0),v(new Date().toISOString()),x(null)}catch{if(!F)return;Qe||m(!1)}finally{F&&(g(!1),o(!1))}})(),()=>{F=!1}},[]),y.useEffect(()=>{const F=window.setInterval(()=>j(Date.now()),3e4);return()=>window.clearInterval(F)},[]);const de=F=>zh(F,w,S),pe=async(F,me)=>{if(!(await fetch(`/api/sessions/${encodeURIComponent(F)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:me})})).ok)throw new Error("Failed to update title");r(Qe=>Qe.map(lt=>lt.slug===F?{...lt,title:me||void 0}:lt))},U=F=>{ht({view:null,session:F})},z=async F=>{E(null);try{const me=await fetch(`/api/sessions/${encodeURIComponent(F)}`,{method:"DELETE"});if(!me.ok){const be=await me.json().catch(()=>({}));E(be.error||"Failed to delete session");return}r(be=>be.filter(Qe=>Qe.slug!==F))}catch{E("Failed to delete session")}},Q=async F=>{A(F.slug);try{const me=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:F.provider,sessionSlug:F.slug,sessionProject:F.project,sessionId:F.sessionId||void 0,title:F.title||void 0})}),be=await me.json();if(!me.ok)throw new Error(be.error||"Regeneration failed");ht({view:null,session:be.slug})}catch(me){console.error("Regenerate error:",gi(me))}finally{A(null)}},ne=l.filter(F=>w.has(F.slug)).length,W=$?l:l.filter(F=>!w.has(F.slug)),T=new Map;for(const F of W)T.has(F.project)||T.set(F.project,[]),T.get(F.project)?.push(F);const _=[...T.entries()].sort((F,me)=>{const be=F[1][0]?.startTime||"";return(me[1][0]?.startTime||"").localeCompare(be)}),V=Bh(_.map(([F])=>F)),J=R===pt?W:T.get(R)||[],P=O?J.filter(F=>(F.title||"").toLowerCase().includes(O.toLowerCase())||F.slug.toLowerCase().includes(O.toLowerCase())||F.project.toLowerCase().includes(O.toLowerCase())||F.provider.toLowerCase().includes(O.toLowerCase())||(F.firstMessage||"").toLowerCase().includes(O.toLowerCase())):J,he=h?Ru(h,C):null,G=i&&l.length===0;return!G&&(!u||l.length===0)?n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6 space-y-6",children:[n.jsx(nh,{}),u&&l.length===0&&n.jsxs("div",{className:"text-center py-12 space-y-2",children:[n.jsx("div",{className:"text-terminal-dim font-mono text-sm",children:"No replays yet"}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Go to the Sessions tab to generate your first replay"})]}),!u&&n.jsx("div",{className:"text-center py-8 space-y-2",children:n.jsxs("div",{className:"text-terminal-dimmer font-mono text-xs",children:["Or run ",n.jsx("span",{className:"text-terminal-green",children:"npx vibe-replay"})," to create a replay from your AI coding sessions"]})})]})}):n.jsxs("div",{className:"flex flex-1 min-h-0",children:[n.jsxs("div",{className:"hidden md:flex w-60 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-surface/20",children:[n.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-terminal-border-subtle",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-semibold",children:"Projects"}),he&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer tabular-nums",children:he})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:[n.jsxs("button",{onClick:()=>H(pt),className:`w-full text-left px-3 py-2.5 text-xs font-mono rounded-lg transition-all duration-200 ease-material flex items-center justify-between ${R===pt?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface"}`,children:[n.jsx("span",{className:"font-medium",children:"All replays"}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs ${R===pt?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:W.length})]}),n.jsx("div",{className:"h-px bg-terminal-border-subtle mx-2 my-1.5"}),_.map(([F,me])=>{const be=R===F,Qe=V.get(F)||na(F),lt=me.filter(Ct=>Ct.gist?.gistId).length;return n.jsxs("button",{onClick:()=>H(F),title:F,className:`w-full text-left px-3 py-2.5 rounded-lg transition-all duration-200 ease-material group ${be?"bg-terminal-green-subtle shadow-layer-sm":"hover:bg-terminal-surface"}`,children:[n.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${be?"text-terminal-green font-medium":"text-terminal-text group-hover:text-terminal-text"}`,children:Qe}),n.jsx("span",{className:`tabular-nums px-1.5 py-0.5 rounded-md text-xs shrink-0 ${be?"bg-terminal-green-emphasis text-terminal-green":"bg-terminal-surface text-terminal-dimmer"}`,children:me.length})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-0.5",children:[n.jsx("span",{className:`text-xs font-mono truncate ${be?"text-terminal-dim":"text-terminal-dimmer"}`,children:ql(me[0]?.startTime||"")}),lt>0&&n.jsxs("span",{className:`text-xs font-mono ${be?"text-terminal-purple":"text-terminal-dimmer"}`,children:[lt," published"]})]})]},F)})]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-0 min-w-0",children:[n.jsx("div",{className:"md:hidden px-3 pt-3",children:n.jsxs("select",{value:R,onChange:F=>H(F.target.value),className:"w-full bg-terminal-surface rounded-lg px-3 py-2.5 text-sm font-mono text-terminal-text outline-none shadow-layer-sm",children:[n.jsxs("option",{value:pt,children:["All replays (",W.length,")"]}),_.map(([F,me])=>n.jsxs("option",{value:F,children:[V.get(F)||na(F)," (",me.length,")"]},F))]})}),n.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-3 shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:xe&&R!==pt?n.jsx(bi,{insights:xe,variant:"project"}):ue&&R===pt?n.jsx(bi,{insights:ue,variant:"all"}):n.jsx(Gh,{})}),n.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:F=>K(F.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),ne>0&&n.jsx("button",{onClick:ae,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${ne} archived)`,children:$?"Active":"View all"}),n.jsx(nh,{})]}),n.jsxs("div",{className:"md:hidden flex gap-2 items-center",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-terminal-dim",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"7",cy:"7",r:"5"}),n.jsx("path",{d:"M11 11l3.5 3.5"})]}),n.jsx("input",{value:O,onChange:F=>K(F.target.value),placeholder:"Filter replays...",className:"w-full bg-terminal-surface rounded-lg pl-9 pr-3 py-2.5 text-sm font-mono text-terminal-text placeholder:text-terminal-dimmer outline-none ring-1 ring-transparent focus:ring-terminal-green/40 transition-shadow duration-200 shadow-layer-sm"})]}),ne>0&&n.jsx("button",{onClick:ae,className:`shrink-0 px-2.5 py-2 text-xs font-mono rounded-lg transition-colors duration-200 ${$?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,title:$?"Hide archived":`View all (${ne} archived)`,children:$?"Active":"View all"})]})]}),(G||p||f)&&n.jsx("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue shrink-0 shadow-layer-sm",children:G?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"FETCHING REPLAYS..."})]}):p?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-blue animate-pulse"}),n.jsx("span",{children:"SCANNING LATEST REPLAYS..."}),f&&n.jsxs("span",{className:"text-terminal-dim",children:["Showing stale cache (",pi(f),")"]})]}):f?n.jsxs("span",{children:["Showing stale cache (",pi(f),")"]}):null}),k&&n.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 bg-terminal-red-subtle rounded-lg px-3 py-2.5 text-xs font-mono text-terminal-red shrink-0 shadow-layer-sm",children:[n.jsx("span",{children:k}),n.jsx("button",{onClick:()=>E(null),className:"ml-auto text-terminal-red/60 hover:text-terminal-red transition-colors",children:"×"})]}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:G?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:"Fetching replays..."}):P.length===0?n.jsx("div",{className:"text-center py-12 text-terminal-dim font-mono text-sm",children:O?"No replays match your filter":"No replays in this project"}):n.jsx("div",{className:"space-y-2.5 px-4 py-3",children:P.map(F=>{const me=w.has(F.slug);return n.jsx(Kh,{summary:F,onOpen:()=>U(F.slug),onShare:()=>ht({view:null,session:F.slug,v:"export"}),onTitleSave:pe,onDelete:()=>z(F.slug),onRegenerate:()=>Q(F),onArchive:()=>de(F.slug),isRegenerating:M===F.slug,isArchived:me},F.slug)})})})]})]})}function B0(){const{scanStatus:l}=Fl(),r=!!l?.running,[i,o]=y.useState(!1),[u,m]=y.useState(!1),p=y.useRef(l);l&&(p.current=l);const g=p.current;if(y.useEffect(()=>{if(r)m(!1),o(!0);else if(i){m(!0);const h=setTimeout(()=>{o(!1),m(!1)},300);return()=>clearTimeout(h)}},[r,i]),!i||!g)return null;const f=g.phase==="discovering"?"Discovering sessions...":g.total>0?`Scanning ${g.scanned}/${g.total}`:"Preparing scan...",x=g.total>0?Math.round(g.scanned/g.total*100):0;return n.jsxs("div",{className:`fixed bottom-4 right-4 z-50 flex items-center gap-2.5 rounded-lg px-3.5 py-2.5 text-xs font-mono bg-terminal-surface border border-terminal-border shadow-layer-md transition-all duration-300 ${u?"opacity-0 translate-y-2":"opacity-100 translate-y-0 animate-in fade-in slide-in-from-bottom-2 duration-300"}`,children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-purple animate-pulse shrink-0"}),n.jsx("span",{className:"text-terminal-dim",children:f}),g.total>0&&n.jsx("div",{className:"w-16 h-1 rounded-full bg-terminal-surface-2 overflow-hidden",children:n.jsx("div",{className:"h-full bg-terminal-purple rounded-full transition-all duration-300",style:{width:`${x}%`}})})]})}function $0({headerLeft:l,headerRight:r}){const i=!!window.__VIBE_REPLAY_EDITOR__,o=y.useCallback(()=>{const x=new URLSearchParams(window.location.search).get("tab");return x==="home"||x==="sessions"||x==="replays"||x==="projects"||x==="insights"?x:i?"home":"replays"},[i]),[u,m]=y.useState(o());y.useEffect(()=>{const f=()=>m(o());return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[o]);const p=f=>{m(f),ht({tab:f,project:null,q:null,archived:null})},g=(f,x)=>n.jsx("button",{onClick:()=>p(f),className:`px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg transition-all duration-200 ease-material ${u===f?"bg-terminal-green-subtle text-terminal-green shadow-layer-sm":"text-terminal-dim hover:text-terminal-text"}`,children:x},f);return n.jsxs(e0,{children:[n.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[i&&n.jsxs("div",{className:"shrink-0 px-5 py-2 border-b border-terminal-border-subtle glass-effect z-40 safe-top flex items-center gap-4",children:[l,n.jsxs("div",{className:"inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm shrink-0",children:[g("home","Home"),g("sessions","Sessions"),g("replays","Replays"),g("projects","Projects"),g("insights","Insights")]}),n.jsx("div",{className:"flex-1"}),r]}),u==="home"&&i?n.jsx(E0,{onNavigate:p}):u==="insights"&&i?n.jsx(j0,{}):u==="projects"&&i?n.jsx(M0,{onNavigate:p}):u==="sessions"&&i?n.jsx(L0,{}):n.jsx(z0,{})]}),n.jsx(B0,{})]})}function U0(l,r,i,o){const u=new Date().toISOString(),m={id:crypto.randomUUID(),sceneIndex:r,body:i,author:"anonymous",createdAt:u,updatedAt:u,resolved:!1};return[...l,m]}function H0(l,r,i){return l.map(o=>o.id===r?{...o,body:i,updatedAt:new Date().toISOString()}:o)}function G0(l,r){return l.filter(i=>i.id!==r)}function q0(l){return new Set(l.map(r=>r.sceneIndex))}function Y0(l){const r=new Map;for(const i of l)r.set(i.sceneIndex,(r.get(i.sceneIndex)||0)+1);return r}function F0(l,r){return JSON.stringify(l)!==JSON.stringify(r)}function ah(l){return l.type==="tool-call"&&!l.diff&&!l.bashOutput}function Ph(l,r){const i=l[r];if(!ah(i))return r;const o=i.toolName;let u=r;for(;u+1<l.length&&ah(l[u+1])&&l[u+1].toolName===o;)u++;return u}function Us(l,r){return(()=>{switch(l.type){case"user-prompt":return 1200;case"thinking":return 600;case"text-response":{const o=l.content.length;return Math.max(800,Math.min(o/40,5)*600)}case"tool-call":return l.diff?1200:l.bashOutput?900:400;case"compaction-summary":return 800;case"context-injection":return 600;default:return 800}})()/r}function Gl(l){return l==="user-prompt"||l==="compaction-summary"||l==="context-injection"}function Z0(l){const r=[];for(let i=0;i<l.length;i++)l[i].type==="user-prompt"&&r.push(i);return r}function V0(l,r){return l.find(i=>i>r)}function Q0(l,r){for(let i=l.length-1;i>=0;i--)if(l[i]<r)return l[i]}function tu(l,r,i){let o=r+1;if(o>=l.length)return-1;if(i.promptsOnly){for(;o<l.length&&!Gl(l[o].type);)o++;return o>=l.length?-1:o}if(i.compactAssistant&&!Gl(l[o].type)){let m=o;for(;m+1<l.length&&!Gl(l[m+1].type);)m++;return m}return Ph(l,o)}function lh(l,r,i){let o=Math.max(0,r-1);if(r<=0)return 0;if(i.promptsOnly){for(;o>0&&!Gl(l[o].type);)o--;return o}if(i.compactAssistant){if(!Gl(l[r].type)){let p=r;for(;p>0&&!Gl(l[p-1].type);)p--;return Math.max(0,p-1)}return Math.max(0,r-1)}const u=l[o];if(u.type==="tool-call"&&!u.diff&&!u.bashOutput){const m=u.toolName;for(;o>0&&l[o-1].type==="tool-call"&&!l[o-1].diff&&!l[o-1].bashOutput&&l[o-1].toolName===m;)o--}return o}const X0="vibe-replay-annotations-";function ui(l){return X0+l}function Mn(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function I0(l,r="embedded"){const i=l.meta.sessionId,o=r==="editor",u=!!window.__VIBE_REPLAY_DATA__||o,[m,p]=y.useState(()=>{const _=l.annotations??[];if(o)return _;try{const V=localStorage.getItem(ui(i));if(V){const J=JSON.parse(V);if(J.length>0||_.length===0)return J}}catch{}return _}),[g,f]=y.useState(()=>l.annotations??[]),x=F0(m,g),h=y.useRef(null);y.useEffect(()=>{if(o)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(()=>{f(m)}).catch(()=>{})},1e3),()=>{h.current&&clearTimeout(h.current)};try{localStorage.setItem(ui(i),JSON.stringify(m))}catch{}},[m,i,o]);const v=y.useMemo(()=>q0(m),[m]),C=y.useMemo(()=>Y0(m),[m]),j=y.useCallback((_,V)=>{p(J=>U0(J,_,V))},[]),w=y.useCallback((_,V)=>{p(J=>H0(J,_,V))},[]),S=y.useCallback(_=>{p(V=>G0(V,_))},[]),k=y.useCallback(()=>{if(o)return;const _={...l,annotations:m},J=`window.__VIBE_REPLAY_DATA__ = ${JSON.stringify(_).replace(/<\//g,"<\\/")};`,P=document.getElementById("vibe-replay-data");if(P){const G=P.textContent;P.textContent=J;const F=`<!DOCTYPE html>
|
|
66
|
+
${document.documentElement.outerHTML}`;P.textContent=G,he(F)}else{const G=document.createElement("script");G.id="vibe-replay-data",G.textContent=J,document.head.appendChild(G);const F=`<!DOCTYPE html>
|
|
67
|
+
${document.documentElement.outerHTML}`;document.head.removeChild(G),he(F)}function he(G){const F=new Blob([G],{type:"text/html"}),me=URL.createObjectURL(F),be=document.createElement("a");be.href=me,be.download=`${l.meta.slug||"replay"}.html`,document.body.appendChild(be),be.click(),document.body.removeChild(be),URL.revokeObjectURL(me)}f(m);try{localStorage.removeItem(ui(i))}catch{}},[l,m,i,o]),E=y.useCallback(()=>{const _={...l,annotations:m},V=JSON.stringify(_,null,2),J=new Blob([V],{type:"application/json"}),P=URL.createObjectURL(J),he=document.createElement("a");he.href=P,he.download="replay.json",document.body.appendChild(he),he.click(),document.body.removeChild(he),URL.revokeObjectURL(P),f(m);try{localStorage.removeItem(ui(i))}catch{}},[l,m,i]),[M,A]=y.useState(!1),R=o?async()=>{A(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(Mn("/api/publish/gist"),{method:"POST"}),V=await _.json();if(!_.ok)throw new Error(V.error||`Server error: ${_.status}`);return f(m),V}finally{A(!1)}}:null,[O,$]=y.useState([]),[H,K]=y.useState(null),[ae,ue]=y.useState(!1),oe=y.useRef(null),te=y.useMemo(()=>H&&O.find(_=>_.name===H)||null,[H,O]);y.useEffect(()=>{o&&fetch(Mn("/api/feedback/detect")).then(_=>_.json()).then(_=>{if(!_.available)return;const V=Array.isArray(_.tools)?_.tools:_.tool?[_.tool]:[];$(V);const J=_.defaultTool?.name||_.tool?.name||V[0]?.name||null;K(J)}).catch(()=>{})},[o]);const xe=o&&H?async()=>{const _=new AbortController;oe.current=_,ue(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),signal:_.signal});const V=await fetch(Mn("/api/feedback/generate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:H}),signal:_.signal}),J=await V.json();if(!V.ok)throw new Error(J.error||"AI Coach failed");return p(J.annotations),f(J.annotations),{score:J.score,itemCount:J.itemCount}}finally{oe.current=null,ue(!1)}}:null,de=o?_=>{K(_)}:null,pe=o?()=>{oe.current&&oe.current.abort()}:null,[U,z]=y.useState(!1),Q=o?async()=>{z(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(Mn("/api/export/html"),{method:"POST"}),V=await _.json();if(!_.ok)throw new Error(V.error||`Export failed: ${_.status}`);const{path:J}=V;return f(m),J}finally{z(!1)}}:null,[ne,W]=y.useState(!1);return{annotations:m,annotatedScenes:v,annotationCounts:C,add:j,update:w,remove:S,hasUnsaved:x,canSaveHtml:u,downloadHtml:k,downloadJson:E,publishGist:R,exportHtml:Q,exportGithub:o?async()=>{W(!0);try{await fetch(Mn("/api/annotations"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});const _=await fetch(Mn("/api/export/github"),{method:"POST"}),V=await _.json();if(!_.ok)throw new Error(V.error||`Export failed: ${_.status}`);return f(m),V}finally{W(!1)}}:null,gistPublishing:M,htmlExporting:U,githubExporting:ne,aiCoachTool:te,aiCoachTools:O,aiCoachToolName:H,setAiCoachToolName:de,runAiCoach:xe,cancelAiCoach:pe,aiCoachRunning:ae}}const sh={version:1,overlays:[]};function Hs(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function J0(l,r="embedded"){const i=r==="editor",[o,u]=y.useState(sh),[m,p]=y.useState(new Set),[g,f]=y.useState(!1),[x,h]=y.useState([]),[v,C]=y.useState(null),[j,w]=y.useState(!1),[S,k]=y.useState(!1),E=y.useRef(null),M=y.useRef(null),A=y.useRef(!1);y.useEffect(()=>{i&&fetch(Hs("/api/overlays")).then(ne=>ne.json()).then(ne=>{ne&&Array.isArray(ne.overlays)&&u(ne)}).catch(()=>{}).finally(()=>{A.current=!0})},[i]),y.useEffect(()=>()=>{E.current&&E.current.abort()},[]),y.useEffect(()=>{i&&fetch(Hs("/api/feedback/detect")).then(ne=>ne.json()).then(ne=>{if(!ne.available)return;const W=Array.isArray(ne.tools)?ne.tools:ne.tool?[ne.tool]:[];h(W);const T=ne.defaultTool?.name||ne.tool?.name||W[0]?.name||null;C(T)}).catch(()=>{})},[i]),y.useEffect(()=>{if(!(!i||!A.current))return M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{fetch(Hs("/api/overlays"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(()=>{})},1e3),()=>{M.current&&clearTimeout(M.current)}},[o,i]);const R=y.useCallback(ne=>{const W=l.scenes[ne];if(!W||W.type!=="user-prompt"&&W.type!=="text-response")return null;if(g||m.has(ne))return W.content;const T=o.overlays.filter(V=>V.sceneIndex===ne);return T.length===0?W.content:T.reduce((V,J)=>V.updatedAt>J.updatedAt?V:J).modifiedValue},[l.scenes,o,m,g]),O=y.useMemo(()=>{if(o.overlays.length===0||g)return l;const ne=new Map;for(const T of o.overlays){const _=ne.get(T.sceneIndex);_?_.push(T):ne.set(T.sceneIndex,[T])}const W=new Map;for(const[T,_]of ne){const V=_.reduce((J,P)=>J.updatedAt>P.updatedAt?J:P);W.set(T,V.modifiedValue)}return W.size===0?l:{...l,scenes:l.scenes.map((T,_)=>{if(m.has(_))return T;const V=W.get(_);return V&&(T.type==="user-prompt"||T.type==="text-response")?{...T,content:V}:T})}},[l,o,m,g]),$=y.useCallback(ne=>o.overlays.some(W=>W.sceneIndex===ne),[o]),H=y.useCallback(ne=>o.overlays.filter(W=>W.sceneIndex===ne),[o]),K=y.useCallback(ne=>{u(ne)},[]),ae=y.useCallback(ne=>{u(W=>({...W,overlays:W.overlays.filter(T=>T.id!==ne)}))},[]),ue=y.useCallback(ne=>{u(W=>({...W,overlays:W.overlays.filter(T=>T.sceneIndex!==ne)}))},[]),oe=y.useCallback(()=>{u(sh)},[]),te=y.useCallback((ne,W)=>{u(T=>({...T,overlays:T.overlays.map(_=>_.id===ne?{..._,modifiedValue:W,source:{type:"manual"},updatedAt:new Date().toISOString()}:_)}))},[]),xe=y.useCallback(ne=>{p(W=>{const T=new Set(W);return T.has(ne)?T.delete(ne):T.add(ne),T})},[]),de=y.useCallback(()=>{f(ne=>!ne)},[]),pe=y.useMemo(()=>i?ne=>C(ne):null,[i]),U=y.useMemo(()=>i?()=>{E.current&&E.current.abort()}:null,[i]),z=y.useMemo(()=>i&&v?async ne=>{const W=new AbortController;E.current=W,w(!0);try{const T=await fetch(Hs("/api/studio/translate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:v,targetLang:ne.targetLang,sourceLang:ne.sourceLang}),signal:W.signal}),_=await T.json();if(!T.ok)throw new Error(_.error||"Translation failed");return _.overlays&&u(_.overlays),_.stats}finally{E.current=null,w(!1)}}:null,[i,v]),Q=y.useMemo(()=>i&&v?async ne=>{const W=new AbortController;E.current=W,k(!0);try{const T=await fetch(Hs("/api/studio/tone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:v,style:ne.style}),signal:W.signal}),_=await T.json();if(!T.ok)throw new Error(_.error||"Tone adjustment failed");return _.overlays&&u(_.overlays),_.stats}finally{E.current=null,k(!1)}}:null,[i,v]);return{overlays:o,effectiveSession:O,getEffectiveContent:R,hasOverlay:$,getOverlays:H,overlayCount:o.overlays.length,setOverlays:K,revertOverlay:ae,revertSceneOverlays:ue,revertAll:oe,updateOverlay:te,showOriginal:m,toggleOriginal:xe,showAllOriginals:g,toggleAllOriginals:de,studioTools:x,studioToolName:v,setStudioToolName:pe,studioToolsAvailable:x.length>0,translating:j,toningDown:S,cancelStudio:U,runTranslate:z,runTone:Q}}function K0(l){const r=l;if(!r)return!1;const i=r.tagName;if(i==="INPUT"||i==="TEXTAREA"||i==="SELECT"||r.isContentEditable)return!0;const o=r.getAttribute("role");return o==="textbox"||o==="combobox"}function P0(l,r,i=!0){const[o,u]=y.useState("idle"),[m,p]=y.useState(-1),[g,f]=y.useState(1),[x,h]=y.useState(0),v=y.useRef(null),C=y.useRef(o),j=y.useRef(m),w=y.useRef(g),S=y.useRef(r);C.current=o,j.current=m,w.current=g,S.current=r;const k=y.useMemo(()=>Z0(l),[l]),E=y.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),M=y.useCallback(()=>{if(C.current!=="playing")return;const ue=tu(l,j.current,S.current);if(ue===-1){u("ended"),p(l.length-1),h(l.length);return}p(ue),h(ue+1);const oe=Us(l[ue],w.current);v.current=setTimeout(M,oe)},[l]),A=y.useCallback(()=>{l.length!==0&&(C.current==="ended"&&(p(-1),h(0)),u("playing"),setTimeout(()=>{if(j.current<0){const ue=Ph(l,0);p(ue),h(ue+1);const oe=Us(l[ue],w.current);v.current=setTimeout(M,oe)}else{const ue=l[j.current];if(ue){const oe=Us(ue,w.current)/2;v.current=setTimeout(M,oe)}}},50))},[l,M]),R=y.useCallback(()=>{E(),u("paused")},[E]),O=y.useCallback(()=>{C.current==="playing"?R():A()},[A,R]),$=y.useCallback(ue=>{E();const oe=Math.max(0,Math.min(ue,l.length-1));if(p(oe),h(oe+1),C.current==="playing"){const te=Us(l[oe],w.current);v.current=setTimeout(M,te)}(C.current==="ended"||C.current==="idle")&&u("paused")},[l,E,M]),H=y.useCallback(()=>{const ue=V0(k,j.current);ue!==void 0&&$(ue)},[k,$]),K=y.useCallback(()=>{const ue=Q0(k,j.current);ue!==void 0&&$(ue)},[k,$]),ae=y.useCallback(ue=>{if(f(ue),C.current==="playing"){E();const oe=l[j.current];if(oe){const te=Us(oe,ue);v.current=setTimeout(M,te)}}},[l,E,M]);return y.useEffect(()=>E,[E]),y.useEffect(()=>{if(!i)return;const ue=oe=>{if(!K0(oe.target))if(oe.key===" "||oe.key==="k")oe.preventDefault(),O();else if(oe.key==="ArrowDown"||oe.key==="j"){C.current==="playing"&&R(),oe.preventDefault();const te=tu(l,j.current,S.current);te!==-1&&$(te)}else if(oe.key==="ArrowUp"||oe.key==="k"){C.current==="playing"&&R(),oe.preventDefault();const te=lh(l,j.current,S.current);$(te)}else oe.key==="ArrowLeft"||oe.key==="h"?(oe.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"collapse"}}))):oe.key==="Escape"?C.current==="playing"&&(oe.preventDefault(),R()):oe.key==="ArrowRight"||oe.key==="l"?(oe.preventDefault(),window.dispatchEvent(new CustomEvent("vibe:toggle-expand",{detail:{action:"expand"}}))):oe.key==="n"?(oe.preventDefault(),H()):oe.key==="p"?(oe.preventDefault(),K()):oe.key==="Home"?(oe.preventDefault(),$(0)):(oe.key==="End"||oe.key==="e")&&(oe.preventDefault(),$(l.length-1))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[i,O,$,H,K,l,R]),{state:o,currentIndex:m,visibleCount:x,speed:g,play:A,pause:R,togglePlayPause:O,seekTo:$,changeSpeed:ae,jumpToNextUserPrompt:H,jumpToPrevUserPrompt:K,userPromptIndices:k,totalScenes:l.length,computeNextIndex:y.useCallback(ue=>tu(l,ue,r),[l,r]),computePrevIndex:y.useCallback(ue=>lh(l,ue,r),[l,r])}}function W0(l){switch(l.displayMode){case"all":return{hideThinking:!1,collapseAllTools:!1,promptsOnly:!1,compactAssistant:!1};case"compact":return{hideThinking:!0,collapseAllTools:!0,promptsOnly:!1,compactAssistant:!0};case"custom":return{hideThinking:l.hideThinking,collapseAllTools:l.collapseAllTools,promptsOnly:l.promptsOnly,compactAssistant:!1}}}const xu="vibe-replay-view-prefs",nu={displayMode:"compact",hideThinking:!1,collapseAllTools:!1,promptsOnly:!1};function ey(){try{const l=localStorage.getItem(xu);if(l){const r=JSON.parse(l);return r.displayMode?{...nu,...r}:{...nu,...r,displayMode:"compact"}}}catch{}return nu}function ty(){const[l,r]=y.useState(ey),i=y.useCallback((u,m)=>{r(p=>{const g={...p,[u]:m};return localStorage.setItem(xu,JSON.stringify(g)),g})},[]),o=y.useCallback(u=>{r(m=>{const p=m[u];if(typeof p!="boolean")return m;const g={...m,[u]:!p};return localStorage.setItem(xu,JSON.stringify(g)),g})},[]);return{prefs:l,updatePref:i,togglePref:o}}function rh({size:l=14}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})})}function ny({className:l=""}){return n.jsxs("svg",{className:`animate-spin h-3.5 w-3.5 ${l}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function ay({toolName:l}){return l==="claude"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude -p"})," ","locally with your prompt piped to stdin. Uses your existing auth and token quota."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"claude"})," ","in your terminal to re-login."]})]}):l==="agent"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent -p"})," ","locally with your prompt piped to stdin. Uses your Cursor subscription or API key."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Auth issues? Check Cursor IDE settings or run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"agent"})," ","in your terminal."]})]}):l==="opencode"?n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed space-y-1",children:[n.jsxs("p",{children:["Runs"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode run"})," ","locally with your prompt piped to stdin. Uses your existing OpenCode configuration."]}),n.jsxs("p",{className:"text-terminal-dimmer",children:["Not working? Run"," ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-terminal-surface-inset text-terminal-text",children:"opencode"})," ","in your terminal to verify setup."]})]}):n.jsxs("p",{className:"mt-2 text-xs font-mono text-terminal-dim leading-relaxed",children:["Runs ",n.jsx("span",{className:"text-terminal-text font-medium",children:l})," locally on your machine using your existing auth."]})}const ly=["English","Chinese (Simplified)","Chinese (Traditional)","Japanese","Korean","Spanish","French","German","Portuguese","Russian"],sy=[{value:"professional",label:"Professional"},{value:"neutral",label:"Neutral"},{value:"friendly",label:"Friendly"}];function ry({annotationActions:l,overlayActions:r}){const{studioTools:i,studioToolName:o,setStudioToolName:u,studioToolsAvailable:m,translating:p,toningDown:g,cancelStudio:f,runTranslate:x,runTone:h,overlayCount:v,revertAll:C}=r,{runAiCoach:j,aiCoachRunning:w,cancelAiCoach:S,aiCoachTools:k,aiCoachToolName:E,setAiCoachToolName:M}=l,A=!!j,R=l.annotations.some(P=>P.author==="vibe-feedback"),[O,$]=y.useState("English"),[H,K]=y.useState("professional"),[ae,ue]=y.useState(null),[oe,te]=y.useState(null),[xe,de]=y.useState(null),[pe,U]=y.useState(null),z=w||p||g,Q=i.length>0?i:k,ne=o||E,W=y.useCallback(async()=>{if(j){ue(null),U(null);try{const P=await j();ue({type:"success",text:`Score ${P.score}/10 — ${P.itemCount} comment(s)`})}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;ue({type:"error",text:P instanceof Error?P.message:"AI Coach failed"})}}},[j]),T=y.useCallback(async()=>{if(x){te(null),U(null);try{const P=await x({targetLang:O});te({type:"success",text:`${P.translated} message(s) translated, ${P.skipped} unchanged`})}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;te({type:"error",text:P instanceof Error?P.message:"Translation failed"})}}},[x,O]),_=y.useCallback(async()=>{if(h){de(null),U(null);try{const P=await h({style:H});de({type:"success",text:`${P.adjusted} prompt(s) adjusted, ${P.skipped} unchanged`})}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;de({type:"error",text:P instanceof Error?P.message:"Tone adjustment failed"})}}},[h,H]),V=P=>r.overlays.overlays.some(he=>he.source.type===P),J=P=>{if(P==="coach"&&R){U("coach");return}if(P==="translate"&&V("translate")){U("translate");return}if(P==="tone"&&V("tone")){U("tone");return}P==="coach"?W():P==="translate"?T():_()};return!m&&k.length===0?n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center gap-2",children:[n.jsx(rh,{size:12}),n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8 text-center",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-terminal-surface flex items-center justify-center mb-3",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),n.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text mb-1",children:"No AI tools detected"}),n.jsx("p",{className:"text-xs font-mono text-terminal-dim mb-4 leading-relaxed",children:"AI Studio requires a local CLI tool. Install one of the following:"}),n.jsx("div",{className:"w-full space-y-2 text-left",children:[{name:"Claude Code",cmd:"npm install -g @anthropic-ai/claude-code",rec:!0},{name:"Cursor CLI",cmd:'Bundled with Cursor IDE (run as "agent")'},{name:"OpenCode",cmd:"go install github.com/opencode-ai/opencode@latest"}].map(P=>n.jsxs("div",{className:"px-3 py-2 rounded-lg bg-terminal-surface border border-terminal-border-subtle",children:[n.jsxs("div",{className:"text-xs font-sans font-medium text-terminal-text flex items-center gap-1.5",children:[P.name,P.rec&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-green-subtle text-terminal-green",children:"recommended"})]}),n.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-0.5 break-all",children:P.cmd})]},P.name))}),n.jsxs("p",{className:"mt-4 text-xs font-mono text-terminal-dimmer leading-relaxed text-center",children:["AI Studio runs the CLI tool in headless mode,"," ",n.jsx("span",{className:"text-terminal-green font-medium",children:"locally"})," on your machine."]})]})]}):n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-terminal-border-subtle flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(rh,{size:12}),n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"AI Studio"})]}),v>0&&n.jsxs("button",{onClick:C,className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-red-subtle hover:text-terminal-red transition-colors",children:["Revert All (",v,")"]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsxs("div",{className:"px-4 py-3 border-b border-terminal-border-subtle bg-terminal-surface/30",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:"Tool"}),Q.length>1&&u?n.jsx("select",{value:ne||"",onChange:P=>{u(P.target.value),M&&M(P.target.value)},className:"bg-terminal-surface border border-terminal-border rounded-lg px-2 py-0.5 text-xs font-mono text-terminal-text outline-none cursor-pointer hover:border-terminal-purple/30 transition-colors",children:Q.map(P=>n.jsx("option",{value:P.name,children:P.name},P.name))}):n.jsx("span",{className:"text-xs font-mono font-medium text-terminal-text px-2 py-0.5 rounded-lg bg-terminal-surface border border-terminal-border",children:ne})]}),n.jsx(ay,{toolName:ne})]}),n.jsxs("div",{className:"p-4 space-y-3",children:[A&&n.jsx(au,{title:"AI Coach",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsx("div",{className:"px-3 py-2.5 border-b border-terminal-border-subtle",children:n.jsx("div",{className:"text-xs font-mono text-terminal-green leading-relaxed",children:"Fix the login bug users reported"})}),n.jsxs("div",{className:"px-3 py-2 flex items-start gap-2",children:[n.jsx("span",{className:"text-xs shrink-0",children:"💬"}),n.jsx("span",{className:"text-xs font-mono text-terminal-blue leading-relaxed",children:"Be specific — which file? what error?"})]}),n.jsxs("div",{className:"px-3 py-2 border-t border-terminal-border-subtle flex items-center gap-2",children:[n.jsx("span",{className:"text-xs font-mono font-semibold text-terminal-orange",children:"6/10"}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["·"," 4 comments added inline"]})]})]}),description:"Score your prompting technique and get inline coaching comments.",running:w,disabled:z,status:ae,buttonLabel:R?"Re-run Coach":"Run Coach",runningLabel:"Analyzing...",onRun:()=>J("coach"),onCancel:S||void 0,showRerunConfirm:pe==="coach",rerunWarning:"Existing AI feedback will be replaced.",onConfirmRerun:()=>void W(),onCancelRerun:()=>U(null)}),x&&n.jsx(au,{title:"Translate",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"这个bug怎么修?"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"How to fix this bug?"})]}),n.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-dim line-through opacity-60",children:"已写入。以后用中文问我..."}),n.jsx("div",{className:"text-xs font-mono text-terminal-blue",children:"Done. Ask me in Chinese..."})]})]}),description:"Translate all prompts and responses for sharing with international teams.",running:p,disabled:z,status:oe,buttonLabel:V("translate")?"Re-translate":"Translate All",runningLabel:"Translating...",onRun:()=>J("translate"),onCancel:f||void 0,showRerunConfirm:pe==="translate",rerunWarning:"Existing translations will be replaced.",onConfirmRerun:()=>void T(),onCancelRerun:()=>U(null),config:n.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Target"}),n.jsx("select",{value:O,onChange:P=>$(P.target.value),disabled:z,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:ly.map(P=>n.jsx("option",{value:P,children:P},P))})]})}),h&&n.jsx(au,{title:"Soften Tone",preview:n.jsxs("div",{className:"mt-2.5 rounded-lg bg-terminal-surface-inset border border-terminal-border overflow-hidden",children:[n.jsxs("div",{className:"px-3 py-2.5 space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"this code is mass garbage, mass delete it"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"Let's refactor this module for clarity"})]}),n.jsxs("div",{className:"px-3 py-2.5 border-t border-terminal-border-subtle space-y-1",children:[n.jsx("div",{className:"text-xs font-mono text-terminal-red line-through opacity-60",children:"are you stupid? I said fix the auth"}),n.jsx("div",{className:"text-xs font-mono text-terminal-green",children:"The auth issue is still present, could you revisit?"})]})]}),description:"Rewrite harsh or blunt prompts into professional, constructive language.",running:g,disabled:z,status:xe,buttonLabel:V("tone")?"Re-adjust":"Soften All",runningLabel:"Adjusting...",onRun:()=>J("tone"),onCancel:f||void 0,showRerunConfirm:pe==="tone",rerunWarning:"Existing tone adjustments will be replaced.",onConfirmRerun:()=>void _(),onCancelRerun:()=>U(null),config:n.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dim shrink-0",children:"Style"}),n.jsx("select",{value:H,onChange:P=>K(P.target.value),disabled:z,className:"flex-1 bg-terminal-surface border border-terminal-border rounded px-2 py-1 text-xs font-mono text-terminal-text outline-none disabled:opacity-50",children:sy.map(P=>n.jsx("option",{value:P.value,children:P.label},P.value))})]})})]})]})]})}function au({title:l,preview:r,description:i,running:o,disabled:u,status:m,buttonLabel:p,runningLabel:g,onRun:f,onCancel:x,showRerunConfirm:h,rerunWarning:v,onConfirmRerun:C,onCancelRerun:j,config:w}){return n.jsxs("div",{className:"rounded-xl border border-terminal-border-subtle bg-terminal-surface/30 overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3",children:[n.jsx("div",{className:"text-sm font-sans font-semibold text-terminal-text",children:l}),r,i&&n.jsx("div",{className:"text-xs font-mono text-terminal-dim mt-2 leading-relaxed",children:i}),w,n.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[n.jsx("button",{onClick:f,disabled:u,className:"px-3.5 py-1.5 text-xs font-mono rounded-lg bg-terminal-purple-subtle text-terminal-purple hover:bg-terminal-purple-emphasis transition-colors disabled:opacity-40 flex items-center gap-1.5",children:o?n.jsxs(n.Fragment,{children:[n.jsx(ny,{className:"text-terminal-purple"}),g]}):p}),o&&x&&n.jsx("button",{onClick:x,className:"text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"})]})]}),h&&!o&&n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-orange flex-1",children:v}),n.jsx("button",{onClick:j,className:"text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:C,className:"text-terminal-purple hover:text-terminal-text transition-colors font-medium",children:"Continue"})]})}),m&&n.jsx("div",{className:`px-4 pb-3 text-xs font-mono ${m.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:m.text})]})}function iy({open:l,onClose:r,annotationActions:i,overlayActions:o}){return y.useEffect(()=>{if(!l)return;const u=m=>{m.key==="Escape"&&(m.preventDefault(),r())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l,r]),n.jsxs("div",{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),n.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-96 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:u=>u.stopPropagation(),children:[n.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close AI Studio",children:"✕"}),n.jsx(ry,{annotationActions:i,overlayActions:o})]})]})}function zu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ka=zu();function Wh(l){Ka=l}var Xa={exec:()=>null};function $e(l,r=""){let i=typeof l=="string"?l:l.source,o={replace:(u,m)=>{let p=typeof m=="string"?m:m.source;return p=p.replace(Gt.caret,"$1"),i=i.replace(u,p),o},getRegex:()=>new RegExp(i,r)};return o}var oy=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Gt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}>`)},cy=/^(?:[ \t]*(?:\n|$))+/,uy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dy=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Js=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,my=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ex=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tx=$e(ex).replace(/bull/g,Bu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fy=$e(ex).replace(/bull/g,Bu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$u=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,py=/^[^\n]+/,Uu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hy=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Uu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xy=$e(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bu).getRegex(),Ti="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Hu=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,gy=$e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Hu).replace("tag",Ti).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nx=$e($u).replace("hr",Js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ti).getRegex(),by=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nx).getRegex(),Gu={blockquote:by,code:uy,def:hy,fences:dy,heading:my,hr:Js,html:gy,lheading:tx,list:xy,newline:cy,paragraph:nx,table:Xa,text:py},ih=$e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ti).getRegex(),yy={...Gu,lheading:fy,table:ih,paragraph:$e($u).replace("hr",Js).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ih).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ti).getRegex()},vy={...Gu,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hu).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$e($u).replace("hr",Js).replace("heading",` *#{1,6} *[^
|
|
68
|
+
]`).replace("lheading",tx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jy=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ax=/^( {2,}|\\)\n(?!\s*$)/,Ny=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ei=/[\p{P}\p{S}]/u,qu=/[\s\p{P}\p{S}]/u,lx=/[^\s\p{P}\p{S}]/u,Sy=$e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qu).getRegex(),sx=/(?!~)[\p{P}\p{S}]/u,ky=/(?!~)[\s\p{P}\p{S}]/u,Cy=/(?:[^\s\p{P}\p{S}]|~)/u,rx=/(?![*_])[\p{P}\p{S}]/u,Ty=/(?![*_])[\s\p{P}\p{S}]/u,Ey=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ay=$e(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",oy?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ix=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ry=$e(ix,"u").replace(/punct/g,Ei).getRegex(),My=$e(ix,"u").replace(/punct/g,sx).getRegex(),ox="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Dy=$e(ox,"gu").replace(/notPunctSpace/g,lx).replace(/punctSpace/g,qu).replace(/punct/g,Ei).getRegex(),_y=$e(ox,"gu").replace(/notPunctSpace/g,Cy).replace(/punctSpace/g,ky).replace(/punct/g,sx).getRegex(),Oy=$e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lx).replace(/punctSpace/g,qu).replace(/punct/g,Ei).getRegex(),Ly=$e(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,rx).getRegex(),zy="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",By=$e(zy,"gu").replace(/notPunctSpace/g,Ey).replace(/punctSpace/g,Ty).replace(/punct/g,rx).getRegex(),$y=$e(/\\(punct)/,"gu").replace(/punct/g,Ei).getRegex(),Uy=$e(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Hy=$e(Hu).replace("(?:-->|$)","-->").getRegex(),Gy=$e("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Hy).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yi=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,qy=$e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",yi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cx=$e(/^!?\[(label)\]\[(ref)\]/).replace("label",yi).replace("ref",Uu).getRegex(),ux=$e(/^!?\[(ref)\](?:\[\])?/).replace("ref",Uu).getRegex(),Yy=$e("reflink|nolink(?!\\()","g").replace("reflink",cx).replace("nolink",ux).getRegex(),oh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Yu={_backpedal:Xa,anyPunctuation:$y,autolink:Uy,blockSkip:Ay,br:ax,code:wy,del:Xa,delLDelim:Xa,delRDelim:Xa,emStrongLDelim:Ry,emStrongRDelimAst:Dy,emStrongRDelimUnd:Oy,escape:jy,link:qy,nolink:ux,punctuation:Sy,reflink:cx,reflinkSearch:Yy,tag:Gy,text:Ny,url:Xa},Fy={...Yu,link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",yi).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yi).getRegex()},gu={...Yu,emStrongRDelimAst:_y,emStrongLDelim:My,delLDelim:Ly,delRDelim:By,url:$e(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",oh).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$e(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",oh).getRegex()},Zy={...gu,br:$e(ax).replace("{2,}","*").getRegex(),text:$e(gu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},di={normal:Gu,gfm:yy,pedantic:vy},Gs={normal:Yu,gfm:gu,breaks:Zy,pedantic:Fy},Vy={"&":"&","<":"<",">":">",'"':""","'":"'"},ch=l=>Vy[l];function Dn(l,r){if(r){if(Gt.escapeTest.test(l))return l.replace(Gt.escapeReplace,ch)}else if(Gt.escapeTestNoEncode.test(l))return l.replace(Gt.escapeReplaceNoEncode,ch);return l}function uh(l){try{l=encodeURI(l).replace(Gt.percentDecode,"%")}catch{return null}return l}function dh(l,r){let i=l.replace(Gt.findPipe,(m,p,g)=>{let f=!1,x=p;for(;--x>=0&&g[x]==="\\";)f=!f;return f?"|":" |"}),o=i.split(Gt.splitPipe),u=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;u<o.length;u++)o[u]=o[u].trim().replace(Gt.slashPipe,"|");return o}function qs(l,r,i){let o=l.length;if(o===0)return"";let u=0;for(;u<o&&l.charAt(o-u-1)===r;)u++;return l.slice(0,o-u)}function Qy(l,r){if(l.indexOf(r[1])===-1)return-1;let i=0;for(let o=0;o<l.length;o++)if(l[o]==="\\")o++;else if(l[o]===r[0])i++;else if(l[o]===r[1]&&(i--,i<0))return o;return i>0?-2:-1}function Xy(l,r=0){let i=r,o="";for(let u of l)if(u===" "){let m=4-i%4;o+=" ".repeat(m),i+=m}else o+=u,i++;return o}function mh(l,r,i,o,u){let m=r.href,p=r.title||null,g=l[1].replace(u.other.outputLinkReplace,"$1");o.state.inLink=!0;let f={type:l[0].charAt(0)==="!"?"image":"link",raw:i,href:m,title:p,text:g,tokens:o.inlineTokens(g)};return o.state.inLink=!1,f}function Iy(l,r,i){let o=l.match(i.other.indentCodeCompensation);if(o===null)return r;let u=o[1];return r.split(`
|
|
69
69
|
`).map(m=>{let p=m.match(i.other.beginningSpace);if(p===null)return m;let[g]=p;return g.length>=u.length?m.slice(u.length):m}).join(`
|
|
70
|
-
`)}var
|
|
71
|
-
`)}}}fences(l){let r=this.rules.block.fences.exec(l);if(r){let i=r[0],o=Iy(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(l){let r=this.rules.block.heading.exec(l);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=
|
|
72
|
-
`)}}blockquote(l){let r=this.rules.block.blockquote.exec(l);if(r){let i=
|
|
70
|
+
`)}var vi=class{options;rules;lexer;constructor(l){this.options=l||Ka}space(l){let r=this.rules.block.newline.exec(l);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(l){let r=this.rules.block.code.exec(l);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:qs(i,`
|
|
71
|
+
`)}}}fences(l){let r=this.rules.block.fences.exec(l);if(r){let i=r[0],o=Iy(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(l){let r=this.rules.block.heading.exec(l);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=qs(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(l){let r=this.rules.block.hr.exec(l);if(r)return{type:"hr",raw:qs(r[0],`
|
|
72
|
+
`)}}blockquote(l){let r=this.rules.block.blockquote.exec(l);if(r){let i=qs(r[0],`
|
|
73
73
|
`).split(`
|
|
74
|
-
`),o="",u="",m=[];for(;i.length>0;){let p=!1,g=[],f;for(f=0;f<i.length;f++)if(this.rules.other.blockquoteStart.test(i[f]))g.push(i[f]),p=!0;else if(!p)g.push(i[f]);else break;i=i.slice(f);let
|
|
75
|
-
`),x
|
|
74
|
+
`),o="",u="",m=[];for(;i.length>0;){let p=!1,g=[],f;for(f=0;f<i.length;f++)if(this.rules.other.blockquoteStart.test(i[f]))g.push(i[f]),p=!0;else if(!p)g.push(i[f]);else break;i=i.slice(f);let x=g.join(`
|
|
75
|
+
`),h=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
76
76
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
77
|
-
${
|
|
78
|
-
${
|
|
77
|
+
${x}`:x,u=u?`${u}
|
|
78
|
+
${h}`:h;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,m,!0),this.lexer.state.top=v,i.length===0)break;let C=m.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let j=C,w=j.raw+`
|
|
79
79
|
`+i.join(`
|
|
80
|
-
`),
|
|
80
|
+
`),S=this.blockquote(w);m[m.length-1]=S,o=o.substring(0,o.length-j.raw.length)+S.raw,u=u.substring(0,u.length-j.text.length)+S.text;break}else if(C?.type==="list"){let j=C,w=j.raw+`
|
|
81
81
|
`+i.join(`
|
|
82
|
-
`),
|
|
83
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:m,text:u}}}list(l){let r=this.rules.block.list.exec(l);if(r){let i=r[1].trim(),o=i.length>1,u={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let m=this.rules.other.listItemRegex(i),p=!1;for(;l;){let f=!1,
|
|
82
|
+
`),S=this.list(w);m[m.length-1]=S,o=o.substring(0,o.length-C.raw.length)+S.raw,u=u.substring(0,u.length-j.raw.length)+S.raw,i=w.substring(m.at(-1).raw.length).split(`
|
|
83
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:m,text:u}}}list(l){let r=this.rules.block.list.exec(l);if(r){let i=r[1].trim(),o=i.length>1,u={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let m=this.rules.other.listItemRegex(i),p=!1;for(;l;){let f=!1,x="",h="";if(!(r=m.exec(l))||this.rules.block.hr.test(l))break;x=r[0],l=l.substring(x.length);let v=Xy(r[2].split(`
|
|
84
84
|
`,1)[0],r[1].length),C=l.split(`
|
|
85
|
-
`,1)[0],j=!v.trim(),w=0;if(this.options.pedantic?(w=2,
|
|
86
|
-
`,l=l.substring(C.length+1),f=!0),!f){let
|
|
87
|
-
`,1)[0],$;if(C=O,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),$=C):$=C.replace(this.rules.other.tabCharGlobal," "),
|
|
88
|
-
`+$.slice(w);else{if(j||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||
|
|
89
|
-
`+C}j=!C.trim(),
|
|
90
|
-
`,l=l.substring(O.length+1),v=$.slice(w)}}u.loose||(p?u.loose=!0:this.rules.other.doubleBlankLine.test(
|
|
91
|
-
`):[],m={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let p of o)this.rules.other.tableAlignRight.test(p)?m.align.push("right"):this.rules.other.tableAlignCenter.test(p)?m.align.push("center"):this.rules.other.tableAlignLeft.test(p)?m.align.push("left"):m.align.push(null);for(let p=0;p<i.length;p++)m.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:m.align[p]});for(let p of u)m.rows.push(
|
|
92
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(l){let r=this.rules.block.text.exec(l);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(l){let r=this.rules.inline.escape.exec(l);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(l){let r=this.rules.inline.tag.exec(l);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(l){let r=this.rules.inline.link.exec(l);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let m=
|
|
93
|
-
`),this.blockTokens(r,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let o=this.inlineQueue[i];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,i=[],o=!1){for(this.options.pedantic&&(r=r.replace(
|
|
85
|
+
`,1)[0],j=!v.trim(),w=0;if(this.options.pedantic?(w=2,h=v.trimStart()):j?w=r[1].length+1:(w=v.search(this.rules.other.nonSpaceChar),w=w>4?1:w,h=v.slice(w),w+=r[1].length),j&&this.rules.other.blankLine.test(C)&&(x+=C+`
|
|
86
|
+
`,l=l.substring(C.length+1),f=!0),!f){let S=this.rules.other.nextBulletRegex(w),k=this.rules.other.hrRegex(w),E=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),A=this.rules.other.htmlBeginRegex(w),R=this.rules.other.blockquoteBeginRegex(w);for(;l;){let O=l.split(`
|
|
87
|
+
`,1)[0],$;if(C=O,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),$=C):$=C.replace(this.rules.other.tabCharGlobal," "),E.test(C)||M.test(C)||A.test(C)||R.test(C)||S.test(C)||k.test(C))break;if($.search(this.rules.other.nonSpaceChar)>=w||!C.trim())h+=`
|
|
88
|
+
`+$.slice(w);else{if(j||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(v)||M.test(v)||k.test(v))break;h+=`
|
|
89
|
+
`+C}j=!C.trim(),x+=O+`
|
|
90
|
+
`,l=l.substring(O.length+1),v=$.slice(w)}}u.loose||(p?u.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(p=!0)),u.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),u.raw+=x}let g=u.items.at(-1);if(g)g.raw=g.raw.trimEnd(),g.text=g.text.trimEnd();else return;u.raw=u.raw.trimEnd();for(let f of u.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),f.tokens[0]?.type==="text"||f.tokens[0]?.type==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(f.raw);if(x){let h={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};f.checked=h.checked,u.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=h.raw+f.tokens[0].raw,f.tokens[0].text=h.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(h)):f.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):f.tokens.unshift(h)}}if(!u.loose){let x=f.tokens.filter(v=>v.type==="space"),h=x.length>0&&x.some(v=>this.rules.other.anyLine.test(v.raw));u.loose=h}}if(u.loose)for(let f of u.items){f.loose=!0;for(let x of f.tokens)x.type==="text"&&(x.type="paragraph")}return u}}html(l){let r=this.rules.block.html.exec(l);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(l){let r=this.rules.block.def.exec(l);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",u=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:u}}}table(l){let r=this.rules.block.table.exec(l);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=dh(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),u=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
|
+
`):[],m={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let p of o)this.rules.other.tableAlignRight.test(p)?m.align.push("right"):this.rules.other.tableAlignCenter.test(p)?m.align.push("center"):this.rules.other.tableAlignLeft.test(p)?m.align.push("left"):m.align.push(null);for(let p=0;p<i.length;p++)m.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:m.align[p]});for(let p of u)m.rows.push(dh(p,m.header.length).map((g,f)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:m.align[f]})));return m}}lheading(l){let r=this.rules.block.lheading.exec(l);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(l){let r=this.rules.block.paragraph.exec(l);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
92
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(l){let r=this.rules.block.text.exec(l);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(l){let r=this.rules.inline.escape.exec(l);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(l){let r=this.rules.inline.tag.exec(l);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(l){let r=this.rules.inline.link.exec(l);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let m=qs(i.slice(0,-1),"\\");if((i.length-m.length)%2===0)return}else{let m=Qy(r[2],"()");if(m===-2)return;if(m>-1){let p=(r[0].indexOf("!")===0?5:4)+r[1].length+m;r[2]=r[2].substring(0,m),r[0]=r[0].substring(0,p).trim(),r[3]=""}}let o=r[2],u="";if(this.options.pedantic){let m=this.rules.other.pedanticHrefTitle.exec(o);m&&(o=m[1],u=m[3])}else u=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),mh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:u&&u.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(l,r){let i;if((i=this.rules.inline.reflink.exec(l))||(i=this.rules.inline.nolink.exec(l))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),u=r[o.toLowerCase()];if(!u){let m=i[0].charAt(0);return{type:"text",raw:m,text:m}}return mh(i,u,i[0],this.lexer,this.rules)}}emStrong(l,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(l);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let u=[...o[0]].length-1,m,p,g=u,f=0,x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,r=r.slice(-1*l.length+u);(o=x.exec(r))!=null;){if(m=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!m)continue;if(p=[...m].length,o[3]||o[4]){g+=p;continue}else if((o[5]||o[6])&&u%3&&!((u+p)%3)){f+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g+f);let h=[...o[0]][0].length,v=l.slice(0,u+o.index+h+p);if(Math.min(u,p)%2){let j=v.slice(1,-1);return{type:"em",raw:v,text:j,tokens:this.lexer.inlineTokens(j)}}let C=v.slice(2,-2);return{type:"strong",raw:v,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(l){let r=this.rules.inline.code.exec(l);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),u=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&u&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(l){let r=this.rules.inline.br.exec(l);if(r)return{type:"br",raw:r[0]}}del(l,r,i=""){let o=this.rules.inline.delLDelim.exec(l);if(o&&(!o[1]||!i||this.rules.inline.punctuation.exec(i))){let u=[...o[0]].length-1,m,p,g=u,f=this.rules.inline.delRDelim;for(f.lastIndex=0,r=r.slice(-1*l.length+u);(o=f.exec(r))!=null;){if(m=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!m||(p=[...m].length,p!==u))continue;if(o[3]||o[4]){g+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g);let x=[...o[0]][0].length,h=l.slice(0,u+o.index+x+p),v=h.slice(u,-u);return{type:"del",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(l){let r=this.rules.inline.autolink.exec(l);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(l){let r;if(r=this.rules.inline.url.exec(l)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let u;do u=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(u!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(l){let r=this.rules.inline.text.exec(l);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Nn=class bu{tokens;options;state;inlineQueue;tokenizer;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Ka,this.options.tokenizer=this.options.tokenizer||new vi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:Gt,block:di.normal,inline:Gs.normal};this.options.pedantic?(i.block=di.pedantic,i.inline=Gs.pedantic):this.options.gfm&&(i.block=di.gfm,this.options.breaks?i.inline=Gs.breaks:i.inline=Gs.gfm),this.tokenizer.rules=i}static get rules(){return{block:di,inline:Gs}}static lex(r,i){return new bu(i).lex(r)}static lexInline(r,i){return new bu(i).inlineTokens(r)}lex(r){r=r.replace(Gt.carriageReturn,`
|
|
93
|
+
`),this.blockTokens(r,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let o=this.inlineQueue[i];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,i=[],o=!1){for(this.options.pedantic&&(r=r.replace(Gt.tabCharGlobal," ").replace(Gt.spaceLine,""));r;){let u;if(this.options.extensions?.block?.some(p=>(u=p.call({lexer:this},r,i))?(r=r.substring(u.raw.length),i.push(u),!0):!1))continue;if(u=this.tokenizer.space(r)){r=r.substring(u.raw.length);let p=i.at(-1);u.raw.length===1&&p!==void 0?p.raw+=`
|
|
94
94
|
`:i.push(u);continue}if(u=this.tokenizer.code(r)){r=r.substring(u.raw.length);let p=i.at(-1);p?.type==="paragraph"||p?.type==="text"?(p.raw+=(p.raw.endsWith(`
|
|
95
95
|
`)?"":`
|
|
96
96
|
`)+u.raw,p.text+=`
|
|
97
97
|
`+u.text,this.inlineQueue.at(-1).src=p.text):i.push(u);continue}if(u=this.tokenizer.fences(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.heading(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.hr(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.blockquote(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.list(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.html(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.def(r)){r=r.substring(u.raw.length);let p=i.at(-1);p?.type==="paragraph"||p?.type==="text"?(p.raw+=(p.raw.endsWith(`
|
|
98
98
|
`)?"":`
|
|
99
99
|
`)+u.raw,p.text+=`
|
|
100
|
-
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},i.push(u));continue}if(u=this.tokenizer.table(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.lheading(r)){r=r.substring(u.raw.length),i.push(u);continue}let m=r;if(this.options.extensions?.startBlock){let p=1/0,g=r.slice(1),f;this.options.extensions.startBlock.forEach(
|
|
100
|
+
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},i.push(u));continue}if(u=this.tokenizer.table(r)){r=r.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.lheading(r)){r=r.substring(u.raw.length),i.push(u);continue}let m=r;if(this.options.extensions?.startBlock){let p=1/0,g=r.slice(1),f;this.options.extensions.startBlock.forEach(x=>{f=x.call({lexer:this},g),typeof f=="number"&&f>=0&&(p=Math.min(p,f))}),p<1/0&&p>=0&&(m=r.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(m))){let p=i.at(-1);o&&p?.type==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
|
101
101
|
`)?"":`
|
|
102
102
|
`)+u.raw,p.text+=`
|
|
103
103
|
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(u),o=m.length!==r.length,r=r.substring(u.raw.length);continue}if(u=this.tokenizer.text(r)){r=r.substring(u.raw.length);let p=i.at(-1);p?.type==="text"?(p.raw+=(p.raw.endsWith(`
|
|
104
104
|
`)?"":`
|
|
105
105
|
`)+u.raw,p.text+=`
|
|
106
|
-
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(u);continue}if(r){let p="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return this.state.top=!0,i}inline(r,i=[]){return this.inlineQueue.push({src:r,tokens:i}),i}inlineTokens(r,i=[]){let o=r,u=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)f.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,u.index)+"["+"a".repeat(u[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,u.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let m;for(;(u=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)m=u[2]?u[2].length:0,o=o.slice(0,u.index+m)+"["+"a".repeat(u[0].length-m-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let p=!1,g="";for(;r;){p||(g=""),p=!1;let f;if(this.options.extensions?.inline?.some(
|
|
107
|
-
`;return o?'<pre><code class="language-'+
|
|
108
|
-
`:"<pre><code>"+(i?u:
|
|
106
|
+
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(u);continue}if(r){let p="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return this.state.top=!0,i}inline(r,i=[]){return this.inlineQueue.push({src:r,tokens:i}),i}inlineTokens(r,i=[]){let o=r,u=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)f.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,u.index)+"["+"a".repeat(u[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,u.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let m;for(;(u=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)m=u[2]?u[2].length:0,o=o.slice(0,u.index+m)+"["+"a".repeat(u[0].length-m-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let p=!1,g="";for(;r;){p||(g=""),p=!1;let f;if(this.options.extensions?.inline?.some(h=>(f=h.call({lexer:this},r,i))?(r=r.substring(f.raw.length),i.push(f),!0):!1))continue;if(f=this.tokenizer.escape(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.tag(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.link(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(f.raw.length);let h=i.at(-1);f.type==="text"&&h?.type==="text"?(h.raw+=f.raw,h.text+=f.text):i.push(f);continue}if(f=this.tokenizer.emStrong(r,o,g)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.codespan(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.br(r)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.del(r,o,g)){r=r.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.autolink(r)){r=r.substring(f.raw.length),i.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(r))){r=r.substring(f.raw.length),i.push(f);continue}let x=r;if(this.options.extensions?.startInline){let h=1/0,v=r.slice(1),C;this.options.extensions.startInline.forEach(j=>{C=j.call({lexer:this},v),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(x=r.substring(0,h+1))}if(f=this.tokenizer.inlineText(x)){r=r.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(g=f.raw.slice(-1)),p=!0;let h=i.at(-1);h?.type==="text"?(h.raw+=f.raw,h.text+=f.text):i.push(f);continue}if(r){let h="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return i}},ji=class{options;parser;constructor(l){this.options=l||Ka}space(l){return""}code({text:l,lang:r,escaped:i}){let o=(r||"").match(Gt.notSpaceStart)?.[0],u=l.replace(Gt.endingNewline,"")+`
|
|
107
|
+
`;return o?'<pre><code class="language-'+Dn(o)+'">'+(i?u:Dn(u,!0))+`</code></pre>
|
|
108
|
+
`:"<pre><code>"+(i?u:Dn(u,!0))+`</code></pre>
|
|
109
109
|
`}blockquote({tokens:l}){return`<blockquote>
|
|
110
110
|
${this.parser.parse(l)}</blockquote>
|
|
111
111
|
`}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:r}){return`<h${r}>${this.parser.parseInline(l)}</h${r}>
|
|
@@ -121,19 +121,19 @@ ${this.parser.parse(l)}</blockquote>
|
|
|
121
121
|
`}tablerow({text:l}){return`<tr>
|
|
122
122
|
${l}</tr>
|
|
123
123
|
`}tablecell(l){let r=this.parser.parseInline(l.tokens),i=l.header?"th":"td";return(l.align?`<${i} align="${l.align}">`:`<${i}>`)+r+`</${i}>
|
|
124
|
-
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${
|
|
125
|
-
Please report this to https://github.com/markedjs/marked.`,l){let o="<p>An error occurred:</p><pre>"+
|
|
124
|
+
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Dn(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:r,tokens:i}){let o=this.parser.parseInline(i),u=uh(l);if(u===null)return o;l=u;let m='<a href="'+l+'"';return r&&(m+=' title="'+Dn(r)+'"'),m+=">"+o+"</a>",m}image({href:l,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let u=uh(l);if(u===null)return Dn(i);l=u;let m=`<img src="${l}" alt="${Dn(i)}"`;return r&&(m+=` title="${Dn(r)}"`),m+=">",m}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Dn(l.text)}},Fu=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Sn=class yu{options;renderer;textRenderer;constructor(r){this.options=r||Ka,this.options.renderer=this.options.renderer||new ji,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fu}static parse(r,i){return new yu(i).parse(r)}static parseInline(r,i){return new yu(i).parseInline(r)}parse(r){let i="";for(let o=0;o<r.length;o++){let u=r[o];if(this.options.extensions?.renderers?.[u.type]){let p=u,g=this.options.extensions.renderers[p.type].call({parser:this},p);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){i+=g||"";continue}}let m=u;switch(m.type){case"space":{i+=this.renderer.space(m);break}case"hr":{i+=this.renderer.hr(m);break}case"heading":{i+=this.renderer.heading(m);break}case"code":{i+=this.renderer.code(m);break}case"table":{i+=this.renderer.table(m);break}case"blockquote":{i+=this.renderer.blockquote(m);break}case"list":{i+=this.renderer.list(m);break}case"checkbox":{i+=this.renderer.checkbox(m);break}case"html":{i+=this.renderer.html(m);break}case"def":{i+=this.renderer.def(m);break}case"paragraph":{i+=this.renderer.paragraph(m);break}case"text":{i+=this.renderer.text(m);break}default:{let p='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}parseInline(r,i=this.renderer){let o="";for(let u=0;u<r.length;u++){let m=r[u];if(this.options.extensions?.renderers?.[m.type]){let g=this.options.extensions.renderers[m.type].call({parser:this},m);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){o+=g||"";continue}}let p=m;switch(p.type){case"escape":{o+=i.text(p);break}case"html":{o+=i.html(p);break}case"link":{o+=i.link(p);break}case"image":{o+=i.image(p);break}case"checkbox":{o+=i.checkbox(p);break}case"strong":{o+=i.strong(p);break}case"em":{o+=i.em(p);break}case"codespan":{o+=i.codespan(p);break}case"br":{o+=i.br(p);break}case"del":{o+=i.del(p);break}case"text":{o+=i.text(p);break}default:{let g='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},Vs=class{options;block;constructor(l){this.options=l||Ka}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(){return this.block?Nn.lex:Nn.lexInline}provideParser(){return this.block?Sn.parse:Sn.parseInline}},Jy=class{defaults=zu();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Sn;Renderer=ji;TextRenderer=Fu;Lexer=Nn;Tokenizer=vi;Hooks=Vs;constructor(...l){this.use(...l)}walkTokens(l,r){let i=[];for(let o of l)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let u=o;for(let m of u.header)i=i.concat(this.walkTokens(m.tokens,r));for(let m of u.rows)for(let p of m)i=i.concat(this.walkTokens(p.tokens,r));break}case"list":{let u=o;i=i.concat(this.walkTokens(u.items,r));break}default:{let u=o;this.defaults.extensions?.childTokens?.[u.type]?this.defaults.extensions.childTokens[u.type].forEach(m=>{let p=u[m].flat(1/0);i=i.concat(this.walkTokens(p,r))}):u.tokens&&(i=i.concat(this.walkTokens(u.tokens,r)))}}return i}use(...l){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(u=>{if(!u.name)throw new Error("extension name required");if("renderer"in u){let m=r.renderers[u.name];m?r.renderers[u.name]=function(...p){let g=u.renderer.apply(this,p);return g===!1&&(g=m.apply(this,p)),g}:r.renderers[u.name]=u.renderer}if("tokenizer"in u){if(!u.level||u.level!=="block"&&u.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let m=r[u.level];m?m.unshift(u.tokenizer):r[u.level]=[u.tokenizer],u.start&&(u.level==="block"?r.startBlock?r.startBlock.push(u.start):r.startBlock=[u.start]:u.level==="inline"&&(r.startInline?r.startInline.push(u.start):r.startInline=[u.start]))}"childTokens"in u&&u.childTokens&&(r.childTokens[u.name]=u.childTokens)}),o.extensions=r),i.renderer){let u=this.defaults.renderer||new ji(this.defaults);for(let m in i.renderer){if(!(m in u))throw new Error(`renderer '${m}' does not exist`);if(["options","parser"].includes(m))continue;let p=m,g=i.renderer[p],f=u[p];u[p]=(...x)=>{let h=g.apply(u,x);return h===!1&&(h=f.apply(u,x)),h||""}}o.renderer=u}if(i.tokenizer){let u=this.defaults.tokenizer||new vi(this.defaults);for(let m in i.tokenizer){if(!(m in u))throw new Error(`tokenizer '${m}' does not exist`);if(["options","rules","lexer"].includes(m))continue;let p=m,g=i.tokenizer[p],f=u[p];u[p]=(...x)=>{let h=g.apply(u,x);return h===!1&&(h=f.apply(u,x)),h}}o.tokenizer=u}if(i.hooks){let u=this.defaults.hooks||new Vs;for(let m in i.hooks){if(!(m in u))throw new Error(`hook '${m}' does not exist`);if(["options","block"].includes(m))continue;let p=m,g=i.hooks[p],f=u[p];Vs.passThroughHooks.has(m)?u[p]=x=>{if(this.defaults.async&&Vs.passThroughHooksRespectAsync.has(m))return(async()=>{let v=await g.call(u,x);return f.call(u,v)})();let h=g.call(u,x);return f.call(u,h)}:u[p]=(...x)=>{if(this.defaults.async)return(async()=>{let v=await g.apply(u,x);return v===!1&&(v=await f.apply(u,x)),v})();let h=g.apply(u,x);return h===!1&&(h=f.apply(u,x)),h}}o.hooks=u}if(i.walkTokens){let u=this.defaults.walkTokens,m=i.walkTokens;o.walkTokens=function(p){let g=[];return g.push(m.call(this,p)),u&&(g=g.concat(u.call(this,p))),g}}this.defaults={...this.defaults,...o}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,r){return Nn.lex(l,r??this.defaults)}parser(l,r){return Sn.parse(l,r??this.defaults)}parseMarkdown(l){return(r,i)=>{let o={...i},u={...this.defaults,...o},m=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&o.async===!1)return m(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return m(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return m(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(u.hooks&&(u.hooks.options=u,u.hooks.block=l),u.async)return(async()=>{let p=u.hooks?await u.hooks.preprocess(r):r,g=await(u.hooks?await u.hooks.provideLexer():l?Nn.lex:Nn.lexInline)(p,u),f=u.hooks?await u.hooks.processAllTokens(g):g;u.walkTokens&&await Promise.all(this.walkTokens(f,u.walkTokens));let x=await(u.hooks?await u.hooks.provideParser():l?Sn.parse:Sn.parseInline)(f,u);return u.hooks?await u.hooks.postprocess(x):x})().catch(m);try{u.hooks&&(r=u.hooks.preprocess(r));let p=(u.hooks?u.hooks.provideLexer():l?Nn.lex:Nn.lexInline)(r,u);u.hooks&&(p=u.hooks.processAllTokens(p)),u.walkTokens&&this.walkTokens(p,u.walkTokens);let g=(u.hooks?u.hooks.provideParser():l?Sn.parse:Sn.parseInline)(p,u);return u.hooks&&(g=u.hooks.postprocess(g)),g}catch(p){return m(p)}}}onError(l,r){return i=>{if(i.message+=`
|
|
125
|
+
Please report this to https://github.com/markedjs/marked.`,l){let o="<p>An error occurred:</p><pre>"+Dn(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},Ja=new Jy;function Ye(l,r){return Ja.parse(l,r)}Ye.options=Ye.setOptions=function(l){return Ja.setOptions(l),Ye.defaults=Ja.defaults,Wh(Ye.defaults),Ye};Ye.getDefaults=zu;Ye.defaults=Ka;Ye.use=function(...l){return Ja.use(...l),Ye.defaults=Ja.defaults,Wh(Ye.defaults),Ye};Ye.walkTokens=function(l,r){return Ja.walkTokens(l,r)};Ye.parseInline=Ja.parseInline;Ye.Parser=Sn;Ye.parser=Sn.parse;Ye.Renderer=ji;Ye.TextRenderer=Fu;Ye.Lexer=Nn;Ye.lexer=Nn.lex;Ye.Tokenizer=vi;Ye.Hooks=Vs;Ye.parse=Ye;Ye.options;Ye.setOptions;Ye.use;Ye.walkTokens;Ye.parseInline;Sn.parse;Nn.lex;const Ky=new Set(["script","iframe","object","embed","style","link","meta"]),Py=new Set(["script","iframe","object","embed","link","meta"]);function Zu(l){const r=new DOMParser().parseFromString(l,"text/html");return Vu(r.body,Ky),r.body.innerHTML}function Wy(l){const i=new DOMParser().parseFromString(l,"image/svg+xml").documentElement;return i.tagName==="parsererror"||i.querySelector("parsererror")?"":(Vu(i,Py),new XMLSerializer().serializeToString(i))}function Vu(l,r){const i=[];for(const o of l.childNodes)if(o.nodeType===Node.ELEMENT_NODE){const u=o,m=u.tagName.toLowerCase();if(r.has(m)){i.push(o);continue}for(const p of Array.from(u.attributes)){p.name.toLowerCase().startsWith("on")&&u.removeAttribute(p.name);const g=p.value.trim().toLowerCase();(g.startsWith("javascript:")||g.startsWith("data:text/html"))&&u.removeAttribute(p.name)}Vu(o,r)}for(const o of i)l.removeChild(o)}Ye.setOptions({breaks:!0,gfm:!0});function dx(l){switch(l.type){case"user-prompt":return{label:"You",text:(l.content.split(`
|
|
126
126
|
`).find(i=>i.trim())||"").slice(0,100)};case"compaction-summary":return{label:"Compaction",text:l.content.slice(0,80)};case"context-injection":return{label:"Injection",text:l.content.slice(0,80)};case"thinking":return{label:"Thinking",text:l.content.slice(0,80)};case"text-response":return{label:"Response",text:(l.content.split(`
|
|
127
|
-
`).find(i=>i.trim())||"").slice(0,100)};case"tool-call":return{label:l.toolName,text:l.diff?.filePath||l.bashOutput?.command||Object.values(l.input).filter(r=>typeof r=="string").join(", ").slice(0,80)||""}}}function dx(l){switch(l.type){case"user-prompt":return"text-terminal-green";case"compaction-summary":return"text-terminal-dim";case"context-injection":return"text-blue-400";case"thinking":return"text-terminal-purple";case"text-response":return"text-terminal-blue";case"tool-call":return"text-terminal-orange"}}function mx({actions:l,scenes:r,currentIndex:i,onSeek:o,addingForScene:u,onClearAddingTarget:m,readOnly:p=!1}){const{annotations:g,add:f,update:h,remove:x}=l,[v,C]=y.useState(null),[j,w]=y.useState(""),[k,S]=y.useState(null),[T,A]=y.useState(""),R=y.useRef(null),D=y.useRef(null),O=y.useRef(null),$=y.useRef(null),q=u??v;y.useEffect(()=>{u!==null&&(w(""),C(null),setTimeout(()=>{$.current?.scrollIntoView({behavior:"smooth",block:"nearest"}),R.current?.focus()},50))},[u]),y.useEffect(()=>{q!==null&&R.current&&R.current.focus()},[q]),y.useEffect(()=>{k&&D.current&&D.current.focus()},[k]);const ne=y.useMemo(()=>[...g].sort((ue,me)=>ue.sceneIndex-me.sceneIndex),[g]);y.useEffect(()=>{if(!O.current||q!==null)return;const ue=O.current.querySelectorAll("[data-annotation-scene]");let me=null,B=1/0;ue.forEach(L=>{const P=Number(L.getAttribute("data-annotation-scene")),se=Math.abs(P-i);se<B&&(B=se,me=L)}),me&&B<=3&&me.scrollIntoView({behavior:"smooth",block:"nearest"})},[i,q]);const de=y.useCallback(()=>{C(null),w(""),m()},[m]),oe=y.useCallback(()=>{!j.trim()||q===null||(f(q,j.trim()),w(""),C(null),m())},[f,q,j,m]),I=y.useCallback(()=>{!k||!T.trim()||(h(k,T.trim()),S(null),A(""))},[k,T,h]),te=q!==null&&r[q]?ux(r[q]):null,V=q!==null&&r[q]?dx(r[q]):"";return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"Comments"}),n.jsxs("div",{className:"flex items-center gap-2",children:[p&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer uppercase px-1.5 py-0.5 rounded bg-terminal-surface",children:"Read-only"}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:g.length})]})]}),n.jsxs("div",{ref:O,className:"flex-1 overflow-y-auto",children:[ne.length===0&&q===null&&n.jsxs("div",{className:"px-3 py-8 text-center",children:[n.jsx("div",{className:"text-terminal-dim text-xs font-mono mb-2",children:"No comments yet"}),!p&&n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono",children:"Hover over any message and click the comment icon to add one"})]}),ne.map(ue=>n.jsx(ev,{annotation:ue,scene:r[ue.sceneIndex],isCurrent:ue.sceneIndex===i,isEditing:!p&&k===ue.id,editBody:k===ue.id?T:"",editTextareaRef:k===ue.id?D:void 0,onSeek:()=>o(ue.sceneIndex),onStartEdit:()=>{S(ue.id),A(ue.body)},onCancelEdit:()=>{S(null),A("")},onSaveEdit:I,onEditBodyChange:A,onDelete:()=>x(ue.id),readOnly:p},ue.id)),!p&&q!==null&&n.jsxs("div",{ref:$,className:"px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle",children:[te&&n.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[n.jsx("span",{className:`text-xs font-mono font-semibold uppercase ${V}`,children:te.label}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate",children:te.text})]}),n.jsx("textarea",{ref:R,value:j,onChange:ue=>w(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&(ue.metaKey||ue.ctrlKey)&&(ue.preventDefault(),oe()),ue.key==="Escape"&&de()},placeholder:"Add a comment... (Markdown supported)",className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text placeholder-terminal-dimmer resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["⌘","+Enter to save"]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:de,className:"px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:oe,disabled:!j.trim(),className:"px-2 py-1 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors disabled:opacity-40",children:"Comment"})]})]})]})]})]})}const ev=y.memo(function({annotation:r,scene:i,isCurrent:o,isEditing:u,editBody:m,editTextareaRef:p,onSeek:g,onStartEdit:f,onCancelEdit:h,onSaveEdit:x,onEditBodyChange:v,onDelete:C,readOnly:j=!1}){const[w,k]=y.useState(!1),S=i?ux(i):null,T=i?dx(i):"text-terminal-dim",A=y.useMemo(()=>{try{return new Date(r.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}},[r.createdAt]),R=r.author==="vibe-feedback";return n.jsxs("div",{"data-annotation-scene":r.sceneIndex,className:`px-3 py-2 border-b border-terminal-border-subtle transition-colors ${R?o?"bg-terminal-purple/10 border-l-2 border-l-terminal-purple":"bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]":o?"bg-terminal-blue/10 border-l-2 border-l-terminal-blue":"hover:bg-terminal-surface/50"}`,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[R&&n.jsx("div",{className:"flex items-center gap-1.5 mb-1",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple-subtle",children:"AI Coach"})}),n.jsxs("button",{onClick:g,className:"flex items-center gap-1.5 mb-1 w-full text-left group/ref",children:[S&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`text-xs font-mono font-semibold uppercase shrink-0 ${T}`,children:S.label}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors",children:S.text})]}),!S&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Step ",r.sceneIndex+1]})]}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:u?n.jsxs("div",{children:[n.jsx("textarea",{ref:p,value:m,onChange:D=>v(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),x()),D.key==="Escape"&&h()},className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),n.jsxs("div",{className:"flex justify-end gap-1.5 mt-1",children:[n.jsx("button",{onClick:h,className:"px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:x,className:"px-2 py-0.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors",children:"Save"})]})]}):n.jsx("div",{className:"prose-terminal text-xs text-terminal-text leading-relaxed",dangerouslySetInnerHTML:{__html:Uu(Fe.parse(r.body))}})}),!j&&w&&!u&&n.jsxs("div",{className:"flex gap-0.5 shrink-0 pt-0.5",children:[n.jsx("button",{onClick:f,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors",title:"Edit",children:"✎"}),n.jsx("button",{onClick:C,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors",title:"Delete",children:"✕"})]})]}),n.jsx("div",{className:"text-xs font-mono text-terminal-dimmer mt-1",children:A})]})});function tv({open:l,onClose:r,actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f}){return y.useEffect(()=>{if(!l)return;const h=x=>{x.key==="Escape"&&(x.preventDefault(),r())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[l,r]),n.jsxs("div",{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),n.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-80 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:h=>h.stopPropagation(),children:[n.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close comments",children:"✕"}),n.jsx(mx,{actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f})]})]})}const nv=[1,5,10];function av({state:l,speed:r,currentIndex:i,totalScenes:o,userPromptCount:u,currentTurn:m,onTogglePlayPause:p,onChangeSpeed:g,onPrevPrompt:f,onNextPrompt:h,onOpenSearch:x,onOpenOutline:v,onShowHelp:C}){const j=l==="playing",w=j?"⏸":"▶",k=j?"Pause":"Play",[S,T]=y.useState(null),A=y.useCallback($=>{T($),setTimeout(()=>T(null),300)},[]),R=$=>S===$?"scale-105":"",D="px-2.5 py-1.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material",O="w-10 h-10 flex items-center justify-center rounded-lg transition-all duration-200 ease-material";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex md:hidden items-center justify-between px-3 py-1.5",children:[n.jsx("button",{onClick:()=>{A("play"),p()},className:`${O} bg-terminal-green-subtle text-terminal-green ${R("play")}`,title:"Play/Pause",children:n.jsx("span",{className:"text-base",children:w})}),n.jsx("button",{onClick:()=>{A("prev"),f()},className:`${O} bg-terminal-surface text-terminal-text ${R("prev")}`,title:"Previous turn",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M15 18l-6-6 6-6"})})}),n.jsxs("span",{className:"text-xs font-mono text-terminal-text tabular-nums font-medium",children:[m," / ",u]}),n.jsx("button",{onClick:()=>{A("next"),h()},className:`${O} bg-terminal-surface text-terminal-text ${R("next")}`,title:"Next turn",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M9 18l6-6-6-6"})})}),n.jsx("button",{onClick:()=>{A("search"),x()},className:`${O} bg-terminal-surface text-terminal-text ${R("search")}`,title:"Search",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("path",{d:"m21 21-4.35-4.35"})]})}),v&&n.jsx("button",{onClick:()=>{A("outline"),v()},className:`${O} bg-terminal-surface border border-terminal-border text-terminal-text ${R("outline")}`,title:"Outline",children:"☰"})]}),n.jsxs("div",{className:"hidden md:flex items-center justify-between px-5 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{A("play"),p()},className:`${D} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis font-medium ${R("play")}`,title:"Play/Pause (Space)",children:[n.jsx("span",{children:w}),n.jsx("span",{className:"ml-1.5",children:k})]}),n.jsx("div",{className:"flex items-center rounded-lg bg-terminal-surface overflow-hidden",children:nv.map($=>n.jsxs("button",{onClick:()=>{A(`speed-${$}`),g($)},className:`px-2.5 py-1.5 text-xs font-mono transition-all duration-200 ease-material ${r===$?"bg-terminal-green-subtle text-terminal-green font-medium":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"} ${R(`speed-${$}`)}`,children:[$,"x"]},$))}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("button",{onClick:()=>{A("prev"),f()},className:`${D} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${R("prev")}`,title:"Previous turn (p)",children:"‹"}),n.jsxs("span",{className:"px-1.5 py-1.5 text-xs font-sans text-terminal-dim tabular-nums flex items-center gap-1",children:[n.jsx("span",{className:"font-mono",children:m}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"font-mono",children:u})]}),n.jsx("button",{onClick:()=>{A("next"),h()},className:`${D} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${R("next")}`,title:"Next turn (n)",children:"›"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{A("search"),x()},className:`h-8 flex-grow flex items-center gap-3 px-3 rounded-lg bg-terminal-surface/20 border border-terminal-border-subtle hover:border-terminal-blue/40 hover:bg-terminal-blue-subtle/20 group/search transition-all duration-200 max-w-sm ${R("search")}`,title:"Search (/ or Cmd+K)",children:[n.jsx("span",{className:"text-sm opacity-70 group-hover/search:opacity-100 transition-opacity",children:"🔍"}),n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim group-hover/search:text-terminal-blue transition-colors",children:"Type / to search"}),n.jsx("div",{className:"flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity",children:n.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-surface border border-terminal-border/50 text-[9px] font-mono font-bold text-terminal-text",children:"/"})})]}),C&&n.jsxs("button",{onClick:()=>{A("help"),C()},className:`flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-terminal-dimmer hover:text-terminal-text hover:bg-terminal-surface-hover group/help transition-all duration-200 ${R("help")}`,title:"Keyboard Shortcuts (?)",children:[n.jsx("div",{className:"flex items-center justify-center w-5 h-5 rounded border border-terminal-border-subtle/50 bg-terminal-surface group-hover/help:border-terminal-text group-hover/help:text-terminal-bg group-hover/help:bg-terminal-text transition-all duration-200",children:n.jsx("span",{className:"text-[11px] font-mono font-black",children:"?"})}),n.jsx("span",{className:"hidden lg:inline text-[10px] font-sans font-bold uppercase tracking-widest opacity-60 group-hover/help:opacity-100",children:"Press ? for help"})]}),n.jsxs("div",{className:"flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0",children:[l==="paused"&&n.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange",children:"Paused"}),n.jsxs("span",{className:"tabular-nums",children:[Math.max(0,i+1)," / ",o]})]})]})]})]})}function lv(l){if(!l.startsWith("mcp__"))return null;const r=l.split("__");return r.length<3?null:{server:r[1],tool:r.slice(2).join("__")}}function hi(l){const r=lv(l);return r?`${r.server} · ${r.tool}`:l}const dh=3,xi=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1),m=r.split(`
|
|
128
|
-
`),p=m.length>
|
|
129
|
-
`):r;return n.jsxs("div",{children:[n.jsxs("div",{className:`text-xs font-mono text-terminal-dimmer whitespace-pre-wrap leading-relaxed ${p&&!o?"max-h-[4.5em] overflow-hidden relative":""}`,children:[g,p&&!o&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-terminal-surface to-transparent pointer-events-none"})]}),p&&n.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),u(!o)},className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors cursor-pointer",children:o?"Show less":`Show full summary (${m.length} lines)`})]})}),
|
|
130
|
-
`));var i=[],o=l.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(var u=0;u<o.length;u++){var m=o[u];u%2&&!r.newlineIsToken?i[i.length-1]+=m:i.push(m)}return i};
|
|
127
|
+
`).find(i=>i.trim())||"").slice(0,100)};case"tool-call":return{label:l.toolName,text:l.diff?.filePath||l.bashOutput?.command||Object.values(l.input).filter(r=>typeof r=="string").join(", ").slice(0,80)||""}}}function mx(l){switch(l.type){case"user-prompt":return"text-terminal-green";case"compaction-summary":return"text-terminal-dim";case"context-injection":return"text-blue-400";case"thinking":return"text-terminal-purple";case"text-response":return"text-terminal-blue";case"tool-call":return"text-terminal-orange"}}function fx({actions:l,scenes:r,currentIndex:i,onSeek:o,addingForScene:u,onClearAddingTarget:m,readOnly:p=!1}){const{annotations:g,add:f,update:x,remove:h}=l,[v,C]=y.useState(null),[j,w]=y.useState(""),[S,k]=y.useState(null),[E,M]=y.useState(""),A=y.useRef(null),R=y.useRef(null),O=y.useRef(null),$=y.useRef(null),H=u??v;y.useEffect(()=>{u!==null&&(w(""),C(null),setTimeout(()=>{$.current?.scrollIntoView({behavior:"smooth",block:"nearest"}),A.current?.focus()},50))},[u]),y.useEffect(()=>{H!==null&&A.current&&A.current.focus()},[H]),y.useEffect(()=>{S&&R.current&&R.current.focus()},[S]);const K=y.useMemo(()=>[...g].sort((de,pe)=>de.sceneIndex-pe.sceneIndex),[g]);y.useEffect(()=>{if(!O.current||H!==null)return;const de=O.current.querySelectorAll("[data-annotation-scene]");let pe=null,U=1/0;de.forEach(z=>{const Q=Number(z.getAttribute("data-annotation-scene")),ne=Math.abs(Q-i);ne<U&&(U=ne,pe=z)}),pe&&U<=3&&pe.scrollIntoView({behavior:"smooth",block:"nearest"})},[i,H]);const ae=y.useCallback(()=>{C(null),w(""),m()},[m]),ue=y.useCallback(()=>{!j.trim()||H===null||(f(H,j.trim()),w(""),C(null),m())},[f,H,j,m]),oe=y.useCallback(()=>{!S||!E.trim()||(x(S,E.trim()),k(null),M(""))},[S,E,x]),te=H!==null&&r[H]?dx(r[H]):null,xe=H!==null&&r[H]?mx(r[H]):"";return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-terminal-border-subtle",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-text uppercase tracking-widest",children:"Comments"}),n.jsxs("div",{className:"flex items-center gap-2",children:[p&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer uppercase px-1.5 py-0.5 rounded bg-terminal-surface",children:"Read-only"}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim",children:g.length})]})]}),n.jsxs("div",{ref:O,className:"flex-1 overflow-y-auto",children:[K.length===0&&H===null&&n.jsxs("div",{className:"px-3 py-8 text-center",children:[n.jsx("div",{className:"text-terminal-dim text-xs font-mono mb-2",children:"No comments yet"}),!p&&n.jsx("div",{className:"text-terminal-dimmer text-xs font-mono",children:"Hover over any message and click the comment icon to add one"})]}),K.map(de=>n.jsx(ev,{annotation:de,scene:r[de.sceneIndex],isCurrent:de.sceneIndex===i,isEditing:!p&&S===de.id,editBody:S===de.id?E:"",editTextareaRef:S===de.id?R:void 0,onSeek:()=>o(de.sceneIndex),onStartEdit:()=>{k(de.id),M(de.body)},onCancelEdit:()=>{k(null),M("")},onSaveEdit:oe,onEditBodyChange:M,onDelete:()=>h(de.id),readOnly:p},de.id)),!p&&H!==null&&n.jsxs("div",{ref:$,className:"px-3 py-2.5 border-b border-terminal-border-subtle bg-terminal-blue-subtle",children:[te&&n.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[n.jsx("span",{className:`text-xs font-mono font-semibold uppercase ${xe}`,children:te.label}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate",children:te.text})]}),n.jsx("textarea",{ref:A,value:j,onChange:de=>w(de.target.value),onKeyDown:de=>{de.key==="Enter"&&(de.metaKey||de.ctrlKey)&&(de.preventDefault(),ue()),de.key==="Escape"&&ae()},placeholder:"Add a comment... (Markdown supported)",className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text placeholder-terminal-dimmer resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer",children:["⌘","+Enter to save"]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:ae,className:"px-2 py-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:ue,disabled:!j.trim(),className:"px-2 py-1 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors disabled:opacity-40",children:"Comment"})]})]})]})]})]})}const ev=y.memo(function({annotation:r,scene:i,isCurrent:o,isEditing:u,editBody:m,editTextareaRef:p,onSeek:g,onStartEdit:f,onCancelEdit:x,onSaveEdit:h,onEditBodyChange:v,onDelete:C,readOnly:j=!1}){const[w,S]=y.useState(!1),k=i?dx(i):null,E=i?mx(i):"text-terminal-dim",M=y.useMemo(()=>{try{return new Date(r.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}},[r.createdAt]),A=r.author==="vibe-feedback";return n.jsxs("div",{"data-annotation-scene":r.sceneIndex,className:`px-3 py-2 border-b border-terminal-border-subtle transition-colors ${A?o?"bg-terminal-purple/10 border-l-2 border-l-terminal-purple":"bg-terminal-purple/[0.03] hover:bg-terminal-purple/[0.06]":o?"bg-terminal-blue/10 border-l-2 border-l-terminal-blue":"hover:bg-terminal-surface/50"}`,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:[A&&n.jsx("div",{className:"flex items-center gap-1.5 mb-1",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple-subtle",children:"AI Coach"})}),n.jsxs("button",{onClick:g,className:"flex items-center gap-1.5 mb-1 w-full text-left group/ref",children:[k&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`text-xs font-mono font-semibold uppercase shrink-0 ${E}`,children:k.label}),n.jsx("span",{className:"text-xs font-mono text-terminal-dim truncate group-hover/ref:text-terminal-text transition-colors",children:k.text})]}),!k&&n.jsxs("span",{className:"text-xs font-mono text-terminal-dim",children:["Step ",r.sceneIndex+1]})]}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:u?n.jsxs("div",{children:[n.jsx("textarea",{ref:p,value:m,onChange:R=>v(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),h()),R.key==="Escape"&&x()},className:"w-full bg-terminal-surface rounded px-2 py-1.5 text-xs font-mono text-terminal-text resize-none focus:outline-none ring-1 ring-terminal-border-subtle focus:ring-terminal-blue/40 transition-shadow duration-200",rows:3}),n.jsxs("div",{className:"flex justify-end gap-1.5 mt-1",children:[n.jsx("button",{onClick:x,className:"px-2 py-0.5 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:"Cancel"}),n.jsx("button",{onClick:h,className:"px-2 py-0.5 text-xs font-mono bg-terminal-blue-subtle text-terminal-blue rounded hover:bg-terminal-blue-emphasis transition-colors",children:"Save"})]})]}):n.jsx("div",{className:"prose-terminal text-xs text-terminal-text leading-relaxed",dangerouslySetInnerHTML:{__html:Zu(Ye.parse(r.body))}})}),!j&&w&&!u&&n.jsxs("div",{className:"flex gap-0.5 shrink-0 pt-0.5",children:[n.jsx("button",{onClick:f,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-blue transition-colors",title:"Edit",children:"✎"}),n.jsx("button",{onClick:C,className:"p-0.5 text-xs text-terminal-dim hover:text-terminal-red transition-colors",title:"Delete",children:"✕"})]})]}),n.jsx("div",{className:"text-xs font-mono text-terminal-dimmer mt-1",children:M})]})});function tv({open:l,onClose:r,actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f}){return y.useEffect(()=>{if(!l)return;const x=h=>{h.key==="Escape"&&(h.preventDefault(),r())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[l,r]),n.jsxs("div",{className:`fixed inset-0 z-50 hidden md:block transition-opacity duration-300 ${l?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:r}),n.jsxs("div",{className:`absolute top-0 right-0 bottom-0 w-80 bg-terminal-bg border-l border-terminal-border-subtle shadow-layer-xl flex flex-col transition-transform duration-300 ease-material-decel ${l?"translate-x-0":"translate-x-full"}`,onClick:x=>x.stopPropagation(),children:[n.jsx("button",{onClick:r,className:"absolute top-2 right-2 z-10 p-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Close comments",children:"✕"}),n.jsx(fx,{actions:i,scenes:o,currentIndex:u,onSeek:m,addingForScene:p,onClearAddingTarget:g,readOnly:f})]})]})}const nv=[1,5,10];function av({state:l,speed:r,currentIndex:i,totalScenes:o,userPromptCount:u,currentTurn:m,onTogglePlayPause:p,onChangeSpeed:g,onPrevPrompt:f,onNextPrompt:x,onOpenSearch:h,onOpenOutline:v,onShowHelp:C}){const j=l==="playing",w=j?"⏸":"▶",S=j?"Pause":"Play",[k,E]=y.useState(null),M=y.useCallback($=>{E($),setTimeout(()=>E(null),300)},[]),A=$=>k===$?"scale-105":"",R="px-2.5 py-1.5 text-xs font-sans rounded-lg transition-all duration-200 ease-material",O="w-10 h-10 flex items-center justify-center rounded-lg transition-all duration-200 ease-material";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex md:hidden items-center justify-between px-3 py-1.5",children:[n.jsx("button",{onClick:()=>{M("play"),p()},className:`${O} bg-terminal-green-subtle text-terminal-green ${A("play")}`,title:"Play/Pause",children:n.jsx("span",{className:"text-base",children:w})}),n.jsx("button",{onClick:()=>{M("prev"),f()},className:`${O} bg-terminal-surface text-terminal-text ${A("prev")}`,title:"Previous turn",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M15 18l-6-6 6-6"})})}),n.jsxs("span",{className:"text-xs font-mono text-terminal-text tabular-nums font-medium",children:[m," / ",u]}),n.jsx("button",{onClick:()=>{M("next"),x()},className:`${O} bg-terminal-surface text-terminal-text ${A("next")}`,title:"Next turn",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M9 18l6-6-6-6"})})}),n.jsx("button",{onClick:()=>{M("search"),h()},className:`${O} bg-terminal-surface text-terminal-text ${A("search")}`,title:"Search",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("path",{d:"m21 21-4.35-4.35"})]})}),v&&n.jsx("button",{onClick:()=>{M("outline"),v()},className:`${O} bg-terminal-surface border border-terminal-border text-terminal-text ${A("outline")}`,title:"Outline",children:"☰"})]}),n.jsxs("div",{className:"hidden md:flex items-center justify-between px-5 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{M("play"),p()},className:`${R} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis font-medium ${A("play")}`,title:"Play/Pause (Space)",children:[n.jsx("span",{children:w}),n.jsx("span",{className:"ml-1.5",children:S})]}),n.jsx("div",{className:"flex items-center rounded-lg bg-terminal-surface overflow-hidden",children:nv.map($=>n.jsxs("button",{onClick:()=>{M(`speed-${$}`),g($)},className:`px-2.5 py-1.5 text-xs font-mono transition-all duration-200 ease-material ${r===$?"bg-terminal-green-subtle text-terminal-green font-medium":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"} ${A(`speed-${$}`)}`,children:[$,"x"]},$))}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("button",{onClick:()=>{M("prev"),f()},className:`${R} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${A("prev")}`,title:"Previous turn (p)",children:"‹"}),n.jsxs("span",{className:"px-1.5 py-1.5 text-xs font-sans text-terminal-dim tabular-nums flex items-center gap-1",children:[n.jsx("span",{className:"font-mono",children:m}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"font-mono",children:u})]}),n.jsx("button",{onClick:()=>{M("next"),x()},className:`${R} text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover ${A("next")}`,title:"Next turn (n)",children:"›"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{M("search"),h()},className:`h-8 flex-grow flex items-center gap-3 px-3 rounded-lg bg-terminal-surface/20 border border-terminal-border-subtle hover:border-terminal-blue/40 hover:bg-terminal-blue-subtle/20 group/search transition-all duration-200 max-w-sm ${A("search")}`,title:"Search (/ or Cmd+K)",children:[n.jsx("span",{className:"text-sm opacity-70 group-hover/search:opacity-100 transition-opacity",children:"🔍"}),n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim group-hover/search:text-terminal-blue transition-colors",children:"Type / to search"}),n.jsx("div",{className:"flex items-center gap-1 ml-1 opacity-40 group-hover/search:opacity-80 transition-opacity",children:n.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-surface border border-terminal-border/50 text-[9px] font-mono font-bold text-terminal-text",children:"/"})})]}),C&&n.jsxs("button",{onClick:()=>{M("help"),C()},className:`flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-terminal-dimmer hover:text-terminal-text hover:bg-terminal-surface-hover group/help transition-all duration-200 ${A("help")}`,title:"Keyboard Shortcuts (?)",children:[n.jsx("div",{className:"flex items-center justify-center w-5 h-5 rounded border border-terminal-border-subtle/50 bg-terminal-surface group-hover/help:border-terminal-text group-hover/help:text-terminal-bg group-hover/help:bg-terminal-text transition-all duration-200",children:n.jsx("span",{className:"text-[11px] font-mono font-black",children:"?"})}),n.jsx("span",{className:"hidden lg:inline text-[10px] font-sans font-bold uppercase tracking-widest opacity-60 group-hover/help:opacity-100",children:"Press ? for help"})]}),n.jsxs("div",{className:"flex items-center gap-2 md:gap-3 text-xs text-terminal-dim font-mono shrink-0",children:[l==="paused"&&n.jsx("span",{className:"text-[10px] font-sans font-semibold uppercase tracking-widest text-terminal-orange",children:"Paused"}),n.jsxs("span",{className:"tabular-nums",children:[Math.max(0,i+1)," / ",o]})]})]})]})]})}function lv(l){if(!l.startsWith("mcp__"))return null;const r=l.split("__");return r.length<3?null:{server:r[1],tool:r.slice(2).join("__")}}function wi(l){const r=lv(l);return r?`${r.server} · ${r.tool}`:l}const fh=3,Ni=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1),m=r.split(`
|
|
128
|
+
`),p=m.length>fh;y.useEffect(()=>{if(!i)return;const f=x=>{const h=x.detail;h.action==="expand"?u(!0):h.action==="collapse"&&u(!1)};return window.addEventListener("vibe:toggle-expand",f),()=>window.removeEventListener("vibe:toggle-expand",f)},[i]);const g=p&&!o?m.slice(0,fh).join(`
|
|
129
|
+
`):r;return n.jsxs("div",{children:[n.jsxs("div",{className:`text-xs font-mono text-terminal-dimmer whitespace-pre-wrap leading-relaxed ${p&&!o?"max-h-[4.5em] overflow-hidden relative":""}`,children:[g,p&&!o&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-terminal-surface to-transparent pointer-events-none"})]}),p&&n.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),u(!o)},className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-text transition-colors cursor-pointer",children:o?"Show less":`Show full summary (${m.length} lines)`})]})}),ph=600,px=y.memo(function({content:r,isActive:i}){const o=r.length>ph,[u,m]=y.useState(!1),p=o&&!u?`${r.slice(0,ph)}...`:r,g=y.useMemo(()=>Zu(Ye.parse(p)),[p]);return n.jsxs("div",{children:[n.jsxs("div",{className:`prose-terminal text-sm text-terminal-text ${i?"typing-cursor":""} ${o&&!u?"max-h-[200px] overflow-hidden relative":""}`,children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:g}}),o&&!u&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-terminal-bg to-transparent"})]}),o&&n.jsx("button",{onClick:()=>m(!u),className:"mt-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors",children:u?"Show less":`Show more (${r.length} chars)`})]})}),sv=y.memo(function({content:r,isActive:i}){const[o,u]=y.useState(!1);return n.jsxs("div",{className:"ml-6",children:[n.jsxs("button",{onClick:()=>u(!o),className:"flex items-center gap-2 text-xs text-terminal-dim hover:text-terminal-text transition-colors duration-200 ease-material font-mono",children:[n.jsx("span",{className:`transition-transform ${o?"rotate-90":""}`,children:"▶"}),n.jsx("span",{className:i?"animate-pulse":"",children:"Thinking..."}),n.jsxs("span",{className:"text-terminal-purple",children:["(",r.length," chars)"]})]}),o&&n.jsx("div",{className:"mt-2 pl-5 text-xs text-terminal-dim font-mono whitespace-pre-wrap break-words border-l-2 border-terminal-purple/30 max-h-[300px] overflow-y-auto",children:r})]})}),rv=y.memo(function({command:r,stdout:i,isActive:o,durationMs:u}){const[m,p]=y.useState(!0),g=i.trim().length>0;return n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("button",{onClick:()=>g&&p(!m),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left",children:[n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:"$"}),n.jsx("span",{className:"text-xs font-mono text-terminal-text truncate flex-1",children:r}),u&&n.jsx("span",{className:"text-[10px] text-terminal-dimmer font-mono shrink-0",title:`Execution: ${vt(u)}`,children:vt(u)}),g&&n.jsx("span",{className:`text-xs text-terminal-dim transition-transform ${m?"rotate-90":""}`,children:"▶"})]}),m&&g&&n.jsx("div",{className:"px-3 py-2 max-h-[300px] overflow-y-auto",children:n.jsx("pre",{className:"text-xs font-mono text-terminal-dim whitespace-pre-wrap break-words",children:i})})]})});function On(){}On.prototype={diff:function(r,i){var o,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m=u.callback;typeof u=="function"&&(m=u,u={});var p=this;function g(R){return R=p.postProcess(R,u),m?(setTimeout(function(){m(R)},0),!0):R}r=this.castInput(r,u),i=this.castInput(i,u),r=this.removeEmpty(this.tokenize(r,u)),i=this.removeEmpty(this.tokenize(i,u));var f=i.length,x=r.length,h=1,v=f+x;u.maxEditLength!=null&&(v=Math.min(v,u.maxEditLength));var C=(o=u.timeout)!==null&&o!==void 0?o:1/0,j=Date.now()+C,w=[{oldPos:-1,lastComponent:void 0}],S=this.extractCommon(w[0],i,r,0,u);if(w[0].oldPos+1>=x&&S+1>=f)return g(hh(p,w[0].lastComponent,i,r,p.useLongestToken));var k=-1/0,E=1/0;function M(){for(var R=Math.max(k,-h);R<=Math.min(E,h);R+=2){var O=void 0,$=w[R-1],H=w[R+1];$&&(w[R-1]=void 0);var K=!1;if(H){var ae=H.oldPos-R;K=H&&0<=ae&&ae<f}var ue=$&&$.oldPos+1<x;if(!K&&!ue){w[R]=void 0;continue}if(!ue||K&&$.oldPos<H.oldPos?O=p.addToPath(H,!0,!1,0,u):O=p.addToPath($,!1,!0,1,u),S=p.extractCommon(O,i,r,R,u),O.oldPos+1>=x&&S+1>=f)return g(hh(p,O.lastComponent,i,r,p.useLongestToken));w[R]=O,O.oldPos+1>=x&&(E=Math.min(E,R-1)),S+1>=f&&(k=Math.max(k,R+1))}h++}if(m)(function R(){setTimeout(function(){if(h>v||Date.now()>j)return m();M()||R()},0)})();else for(;h<=v&&Date.now()<=j;){var A=M();if(A)return A}},addToPath:function(r,i,o,u,m){var p=r.lastComponent;return p&&!m.oneChangePerToken&&p.added===i&&p.removed===o?{oldPos:r.oldPos+u,lastComponent:{count:p.count+1,added:i,removed:o,previousComponent:p.previousComponent}}:{oldPos:r.oldPos+u,lastComponent:{count:1,added:i,removed:o,previousComponent:p}}},extractCommon:function(r,i,o,u,m){for(var p=i.length,g=o.length,f=r.oldPos,x=f-u,h=0;x+1<p&&f+1<g&&this.equals(o[f+1],i[x+1],m);)x++,f++,h++,m.oneChangePerToken&&(r.lastComponent={count:1,previousComponent:r.lastComponent,added:!1,removed:!1});return h&&!m.oneChangePerToken&&(r.lastComponent={count:h,previousComponent:r.lastComponent,added:!1,removed:!1}),r.oldPos=f,x},equals:function(r,i,o){return o.comparator?o.comparator(r,i):r===i||o.ignoreCase&&r.toLowerCase()===i.toLowerCase()},removeEmpty:function(r){for(var i=[],o=0;o<r.length;o++)r[o]&&i.push(r[o]);return i},castInput:function(r){return r},tokenize:function(r){return Array.from(r)},join:function(r){return r.join("")},postProcess:function(r){return r}};function hh(l,r,i,o,u){for(var m=[],p;r;)m.push(r),p=r.previousComponent,delete r.previousComponent,r=p;m.reverse();for(var g=0,f=m.length,x=0,h=0;g<f;g++){var v=m[g];if(v.removed)v.value=l.join(o.slice(h,h+v.count)),h+=v.count;else{if(!v.added&&u){var C=i.slice(x,x+v.count);C=C.map(function(j,w){var S=o[h+w];return S.length>j.length?S:j}),v.value=l.join(C)}else v.value=l.join(i.slice(x,x+v.count));x+=v.count,v.added||(h+=v.count)}}return m}function xh(l,r){var i;for(i=0;i<l.length&&i<r.length;i++)if(l[i]!=r[i])return l.slice(0,i);return l.slice(0,i)}function gh(l,r){var i;if(!l||!r||l[l.length-1]!=r[r.length-1])return"";for(i=0;i<l.length&&i<r.length;i++)if(l[l.length-(i+1)]!=r[r.length-(i+1)])return l.slice(-i);return l.slice(-i)}function vu(l,r,i){if(l.slice(0,r.length)!=r)throw Error("string ".concat(JSON.stringify(l)," doesn't start with prefix ").concat(JSON.stringify(r),"; this is a bug"));return i+l.slice(r.length)}function ju(l,r,i){if(!r)return l+i;if(l.slice(-r.length)!=r)throw Error("string ".concat(JSON.stringify(l)," doesn't end with suffix ").concat(JSON.stringify(r),"; this is a bug"));return l.slice(0,-r.length)+i}function Ys(l,r){return vu(l,r,"")}function mi(l,r){return ju(l,r,"")}function bh(l,r){return r.slice(0,iv(l,r))}function iv(l,r){var i=0;l.length>r.length&&(i=l.length-r.length);var o=r.length;l.length<r.length&&(o=l.length);var u=Array(o),m=0;u[0]=0;for(var p=1;p<o;p++){for(r[p]==r[m]?u[p]=u[m]:u[p]=m;m>0&&r[p]!=r[m];)m=u[m];r[p]==r[m]&&m++}m=0;for(var g=i;g<l.length;g++){for(;m>0&&l[g]!=r[m];)m=u[m];l[g]==r[m]&&m++}return m}var Si="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",ov=new RegExp("[".concat(Si,"]+|\\s+|[^").concat(Si,"]"),"ug"),Ai=new On;Ai.equals=function(l,r,i){return i.ignoreCase&&(l=l.toLowerCase(),r=r.toLowerCase()),l.trim()===r.trim()};Ai.tokenize=function(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i;if(r.intlSegmenter){if(r.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Array.from(r.intlSegmenter.segment(l),function(m){return m.segment})}else i=l.match(ov)||[];var o=[],u=null;return i.forEach(function(m){/\s/.test(m)?u==null?o.push(m):o.push(o.pop()+m):/\s/.test(u)?o[o.length-1]==u?o.push(o.pop()+m):o.push(u+m):o.push(m),u=m}),o};Ai.join=function(l){return l.map(function(r,i){return i==0?r:r.replace(/^\s+/,"")}).join("")};Ai.postProcess=function(l,r){if(!l||r.oneChangePerToken)return l;var i=null,o=null,u=null;return l.forEach(function(m){m.added?o=m:m.removed?u=m:((o||u)&&yh(i,u,o,m),i=m,o=null,u=null)}),(o||u)&&yh(i,u,o,null),l};function yh(l,r,i,o){if(r&&i){var u=r.value.match(/^\s*/)[0],m=r.value.match(/\s*$/)[0],p=i.value.match(/^\s*/)[0],g=i.value.match(/\s*$/)[0];if(l){var f=xh(u,p);l.value=ju(l.value,p,f),r.value=Ys(r.value,f),i.value=Ys(i.value,f)}if(o){var x=gh(m,g);o.value=vu(o.value,g,x),r.value=mi(r.value,x),i.value=mi(i.value,x)}}else if(i)l&&(i.value=i.value.replace(/^\s*/,"")),o&&(o.value=o.value.replace(/^\s*/,""));else if(l&&o){var h=o.value.match(/^\s*/)[0],v=r.value.match(/^\s*/)[0],C=r.value.match(/\s*$/)[0],j=xh(h,v);r.value=Ys(r.value,j);var w=gh(Ys(h,j),C);r.value=mi(r.value,w),o.value=vu(o.value,h,w),l.value=ju(l.value,h,h.slice(0,h.length-w.length))}else if(o){var S=o.value.match(/^\s*/)[0],k=r.value.match(/\s*$/)[0],E=bh(k,S);r.value=mi(r.value,E)}else if(l){var M=l.value.match(/\s*$/)[0],A=r.value.match(/^\s*/)[0],R=bh(M,A);r.value=Ys(r.value,R)}}var cv=new On;cv.tokenize=function(l){var r=new RegExp("(\\r?\\n)|[".concat(Si,"]+|[^\\S\\n\\r]+|[^").concat(Si,"]"),"ug");return l.match(r)||[]};var Ri=new On;Ri.tokenize=function(l,r){r.stripTrailingCr&&(l=l.replace(/\r\n/g,`
|
|
130
|
+
`));var i=[],o=l.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(var u=0;u<o.length;u++){var m=o[u];u%2&&!r.newlineIsToken?i[i.length-1]+=m:i.push(m)}return i};Ri.equals=function(l,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!l.includes(`
|
|
131
131
|
`))&&(l=l.trim()),(!i.newlineIsToken||!r.includes(`
|
|
132
132
|
`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(l.endsWith(`
|
|
133
133
|
`)&&(l=l.slice(0,-1)),r.endsWith(`
|
|
134
|
-
`)&&(r=r.slice(0,-1))),En.prototype.equals.call(this,l,r,i)};function uv(l,r,i){return Ni.diff(l,r,i)}var dv=new En;dv.tokenize=function(l){return l.split(/(\S.+?[.!?])(?=\s+|$)/)};var mv=new En;mv.tokenize=function(l){return l.split(/([{}:;,]|\s+)/)};function gu(l){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gu(l)}var Gs=new En;Gs.useLongestToken=!0;Gs.tokenize=Ni.tokenize;Gs.castInput=function(l,r){var i=r.undefinedReplacement,o=r.stringifyReplacer,u=o===void 0?function(m,p){return typeof p>"u"?i:p}:o;return typeof l=="string"?l:JSON.stringify(bu(l,null,null,u),u," ")};Gs.equals=function(l,r,i){return En.prototype.equals.call(Gs,l.replace(/,([\r\n])/g,"$1"),r.replace(/,([\r\n])/g,"$1"),i)};function bu(l,r,i,o,u){r=r||[],i=i||[],o&&(l=o(u,l));var m;for(m=0;m<r.length;m+=1)if(r[m]===l)return i[m];var p;if(Object.prototype.toString.call(l)==="[object Array]"){for(r.push(l),p=new Array(l.length),i.push(p),m=0;m<l.length;m+=1)p[m]=bu(l[m],r,i,o,u);return r.pop(),i.pop(),p}if(l&&l.toJSON&&(l=l.toJSON()),gu(l)==="object"&&l!==null){r.push(l),p={},i.push(p);var g=[],f;for(f in l)Object.prototype.hasOwnProperty.call(l,f)&&g.push(f);for(g.sort(),m=0;m<g.length;m+=1)f=g[m],p[f]=bu(l[f],r,i,o,f);r.pop(),i.pop()}else p=l;return p}var yu=new En;yu.tokenize=function(l){return l.slice()};yu.join=yu.removeEmpty=function(l){return l};function px(l){var r,i,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var u=l.length;for(r=0;r<u;r++)l[r]&&(i=px(l[r]))&&(o&&(o+=" "),o+=i)}else for(i in l)l[i]&&(o&&(o+=" "),o+=i);return o}function hx(){for(var l,r,i=0,o="",u=arguments.length;i<u;i++)(l=arguments[i])&&(r=px(l))&&(o&&(o+=" "),o+=r);return o}var fv=Object.create,ki=Object.defineProperty,pv=Object.defineProperties,hv=Object.getOwnPropertyDescriptor,xv=Object.getOwnPropertyDescriptors,xx=Object.getOwnPropertyNames,bi=Object.getOwnPropertySymbols,gv=Object.getPrototypeOf,Gu=Object.prototype.hasOwnProperty,gx=Object.prototype.propertyIsEnumerable,bh=(l,r,i)=>r in l?ki(l,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[r]=i,Cn=(l,r)=>{for(var i in r||(r={}))Gu.call(r,i)&&bh(l,i,r[i]);if(bi)for(var i of bi(r))gx.call(r,i)&&bh(l,i,r[i]);return l},Si=(l,r)=>pv(l,xv(r)),bx=(l,r)=>{var i={};for(var o in l)Gu.call(l,o)&&r.indexOf(o)<0&&(i[o]=l[o]);if(l!=null&&bi)for(var o of bi(l))r.indexOf(o)<0&&gx.call(l,o)&&(i[o]=l[o]);return i},bv=(l,r)=>function(){return r||(0,l[xx(l)[0]])((r={exports:{}}).exports,r),r.exports},yv=(l,r)=>{for(var i in r)ki(l,i,{get:r[i],enumerable:!0})},vv=(l,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of xx(r))!Gu.call(l,u)&&u!==i&&ki(l,u,{get:()=>r[u],enumerable:!(o=hv(r,u))||o.enumerable});return l},jv=(l,r,i)=>(i=l!=null?fv(gv(l)):{},vv(!l||!l.__esModule?ki(i,"default",{value:l,enumerable:!0}):i,l)),wv=bv({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(l,r){var i=(function(){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,u=0,m={},p={util:{encode:function w(k){return k instanceof g?new g(k.type,w(k.content),k.alias):Array.isArray(k)?k.map(w):k.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(w){return Object.prototype.toString.call(w).slice(8,-1)},objId:function(w){return w.__id||Object.defineProperty(w,"__id",{value:++u}),w.__id},clone:function w(k,S){S=S||{};var T,A;switch(p.util.type(k)){case"Object":if(A=p.util.objId(k),S[A])return S[A];T={},S[A]=T;for(var R in k)k.hasOwnProperty(R)&&(T[R]=w(k[R],S));return T;case"Array":return A=p.util.objId(k),S[A]?S[A]:(T=[],S[A]=T,k.forEach(function(D,O){T[O]=w(D,S)}),T);default:return k}},getLanguage:function(w){for(;w;){var k=o.exec(w.className);if(k)return k[1].toLowerCase();w=w.parentElement}return"none"},setLanguage:function(w,k){w.className=w.className.replace(RegExp(o,"gi"),""),w.classList.add("language-"+k)},isActive:function(w,k,S){for(var T="no-"+k;w;){var A=w.classList;if(A.contains(k))return!0;if(A.contains(T))return!1;w=w.parentElement}return!!S}},languages:{plain:m,plaintext:m,text:m,txt:m,extend:function(w,k){var S=p.util.clone(p.languages[w]);for(var T in k)S[T]=k[T];return S},insertBefore:function(w,k,S,T){T=T||p.languages;var A=T[w],R={};for(var D in A)if(A.hasOwnProperty(D)){if(D==k)for(var O in S)S.hasOwnProperty(O)&&(R[O]=S[O]);S.hasOwnProperty(D)||(R[D]=A[D])}var $=T[w];return T[w]=R,p.languages.DFS(p.languages,function(q,ne){ne===$&&q!=w&&(this[q]=R)}),R},DFS:function w(k,S,T,A){A=A||{};var R=p.util.objId;for(var D in k)if(k.hasOwnProperty(D)){S.call(k,D,k[D],T||D);var O=k[D],$=p.util.type(O);$==="Object"&&!A[R(O)]?(A[R(O)]=!0,w(O,S,null,A)):$==="Array"&&!A[R(O)]&&(A[R(O)]=!0,w(O,S,D,A))}}},plugins:{},highlight:function(w,k,S){var T={code:w,grammar:k,language:S};if(p.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=p.tokenize(T.code,T.grammar),p.hooks.run("after-tokenize",T),g.stringify(p.util.encode(T.tokens),T.language)},tokenize:function(w,k){var S=k.rest;if(S){for(var T in S)k[T]=S[T];delete k.rest}var A=new x;return v(A,A.head,w),h(w,A,k,A.head,0),j(A)},hooks:{all:{},add:function(w,k){var S=p.hooks.all;S[w]=S[w]||[],S[w].push(k)},run:function(w,k){var S=p.hooks.all[w];if(!(!S||!S.length))for(var T=0,A;A=S[T++];)A(k)}},Token:g};function g(w,k,S,T){this.type=w,this.content=k,this.alias=S,this.length=(T||"").length|0}g.stringify=function w(k,S){if(typeof k=="string")return k;if(Array.isArray(k)){var T="";return k.forEach(function($){T+=w($,S)}),T}var A={type:k.type,content:w(k.content,S),tag:"span",classes:["token",k.type],attributes:{},language:S},R=k.alias;R&&(Array.isArray(R)?Array.prototype.push.apply(A.classes,R):A.classes.push(R)),p.hooks.run("wrap",A);var D="";for(var O in A.attributes)D+=" "+O+'="'+(A.attributes[O]||"").replace(/"/g,""")+'"';return"<"+A.tag+' class="'+A.classes.join(" ")+'"'+D+">"+A.content+"</"+A.tag+">"};function f(w,k,S,T){w.lastIndex=k;var A=w.exec(S);if(A&&T&&A[1]){var R=A[1].length;A.index+=R,A[0]=A[0].slice(R)}return A}function h(w,k,S,T,A,R){for(var D in S)if(!(!S.hasOwnProperty(D)||!S[D])){var O=S[D];O=Array.isArray(O)?O:[O];for(var $=0;$<O.length;++$){if(R&&R.cause==D+","+$)return;var q=O[$],ne=q.inside,de=!!q.lookbehind,oe=!!q.greedy,I=q.alias;if(oe&&!q.pattern.global){var te=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,te+"g")}for(var V=q.pattern||q,ue=T.next,me=A;ue!==k.tail&&!(R&&me>=R.reach);me+=ue.value.length,ue=ue.next){var B=ue.value;if(k.length>w.length)return;if(!(B instanceof g)){var L=1,P;if(oe){if(P=f(V,me,w,de),!P||P.index>=w.length)break;var _=P.index,se=P.index+P[0].length,X=me;for(X+=ue.value.length;_>=X;)ue=ue.next,X+=ue.value.length;if(X-=ue.value.length,me=X,ue.value instanceof g)continue;for(var E=ue;E!==k.tail&&(X<se||typeof E.value=="string");E=E.next)L++,X+=E.value.length;L--,B=w.slice(me,X),P.index-=me}else if(P=f(V,0,B,de),!P)continue;var _=P.index,F=P[0],J=B.slice(0,_),K=B.slice(_+F.length),pe=me+B.length;R&&pe>R.reach&&(R.reach=pe);var he=ue.prev;J&&(he=v(k,he,J),me+=J.length),C(k,he,L);var ce=new g(D,ne?p.tokenize(F,ne):F,I,F);if(ue=v(k,he,ce),K&&v(k,ue,K),L>1){var be={cause:D+","+$,reach:pe};h(w,k,S,ue.prev,me,be),R&&be.reach>R.reach&&(R.reach=be.reach)}}}}}}function x(){var w={value:null,prev:null,next:null},k={value:null,prev:w,next:null};w.next=k,this.head=w,this.tail=k,this.length=0}function v(w,k,S){var T=k.next,A={value:S,prev:k,next:T};return k.next=A,T.prev=A,w.length++,A}function C(w,k,S){for(var T=k.next,A=0;A<S&&T!==w.tail;A++)T=T.next;k.next=T,T.prev=k,w.length-=A}function j(w){for(var k=[],S=w.head.next;S!==w.tail;)k.push(S.value),S=S.next;return k}return p})();r.exports=i,i.default=i}}),ie=jv(wv());ie.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ie.languages.markup.tag.inside["attr-value"].inside.entity=ie.languages.markup.entity,ie.languages.markup.doctype.inside["internal-subset"].inside=ie.languages.markup,ie.hooks.add("wrap",function(l){l.type==="entity"&&(l.attributes.title=l.content.replace(/&/,"&"))}),Object.defineProperty(ie.languages.markup.tag,"addInlined",{value:function(l,o){var i={},i=(i["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ie.languages[o]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),o=(i["language-"+o]={pattern:/[\s\S]+/,inside:ie.languages[o]},{});o[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:i},ie.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(ie.languages.markup.tag,"addAttribute",{value:function(l,r){ie.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+l+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:ie.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ie.languages.html=ie.languages.markup,ie.languages.mathml=ie.languages.markup,ie.languages.svg=ie.languages.markup,ie.languages.xml=ie.languages.extend("markup",{}),ie.languages.ssml=ie.languages.xml,ie.languages.atom=ie.languages.xml,ie.languages.rss=ie.languages.xml,(function(l){var r={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,o="(?:[^\\\\-]|"+i.source+")",o=RegExp(o+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};l.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:i,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":r,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:i}},"special-escape":r,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:i,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":u}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ie),ie.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ie.languages.javascript=ie.languages.extend("clike",{"class-name":[ie.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ie.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ie.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ie.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ie.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ie.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ie.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ie.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ie.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ie.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ie.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ie.languages.markup&&(ie.languages.markup.tag.addInlined("script","javascript"),ie.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ie.languages.js=ie.languages.javascript,ie.languages.actionscript=ie.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ie.languages.actionscript["class-name"].alias="function",delete ie.languages.actionscript.parameter,delete ie.languages.actionscript["literal-property"],ie.languages.markup&&ie.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ie.languages.markup}}),(function(l){var r=/#(?!\{).+/,i={pattern:/#\{[^}]+\}/,alias:"variable"};l.languages.coffeescript=l.languages.extend("javascript",{comment:r,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:i}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),l.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:r,interpolation:i}}}),l.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:l.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:i}}]}),l.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete l.languages.coffeescript["template-string"],l.languages.coffee=l.languages.coffeescript})(ie),(function(l){var r=l.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(r,"addSupport",{value:function(i,o){(i=typeof i=="string"?[i]:i).forEach(function(u){var m=function(v){v.inside||(v.inside={}),v.inside.rest=o},p="doc-comment";if(g=l.languages[u]){var g,f=g[p];if((f=f||(g=l.languages.insertBefore(u,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[p])instanceof RegExp&&(f=g[p]={pattern:f}),Array.isArray(f))for(var h=0,x=f.length;h<x;h++)f[h]instanceof RegExp&&(f[h]={pattern:f[h]}),m(f[h]);else m(f)}})}}),r.addSupport(["java","javascript","php"],r)})(ie),(function(l){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,r=(l.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},l.languages.css.atrule.inside.rest=l.languages.css,l.languages.markup);r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(ie),(function(l){var r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=(l.languages.css.selector={pattern:l.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},l.languages.css.atrule.inside["selector-function-argument"].inside=r,l.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};l.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})})(ie),(function(l){var r=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,o="(?:"+i.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+i.source+")?)",u=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),m=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function p(g,f){f=(f||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<value>>/g,function(){return g});return RegExp(h,f)}l.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return o})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<key>>/g,function(){return"(?:"+u+"|"+m+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:p(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:p(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:p(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:p(m),lookbehind:!0,greedy:!0},number:{pattern:p(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},l.languages.yml=l.languages.yaml})(ie),(function(l){var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(h){return h=h.replace(/<inner>/g,function(){return r}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+h+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,u=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),m=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,p=(l.languages.markdown=l.languages.extend("markup",{}),l.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:l.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+u+m+"(?:"+u+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+u+m+")(?:"+u+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:l.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+u+")"+m+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+u+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:l.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(h){["url","bold","italic","strike","code-snippet"].forEach(function(x){h!==x&&(l.languages.markdown[h].inside.content.inside[x]=l.languages.markdown[x])})}),l.hooks.add("after-tokenize",function(h){h.language!=="markdown"&&h.language!=="md"||(function x(v){if(v&&typeof v!="string")for(var C=0,j=v.length;C<j;C++){var w,k=v[C];k.type!=="code"?x(k.content):(w=k.content[1],k=k.content[3],w&&k&&w.type==="code-language"&&k.type==="code-block"&&typeof w.content=="string"&&(w=w.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),w="language-"+(w=(/[a-z][\w-]*/i.exec(w)||[""])[0].toLowerCase()),k.alias?typeof k.alias=="string"?k.alias=[k.alias,w]:k.alias.push(w):k.alias=[w]))}})(h.tokens)}),l.hooks.add("wrap",function(h){if(h.type==="code-block"){for(var x="",v=0,C=h.classes.length;v<C;v++){var j=h.classes[v],j=/language-(.+)/.exec(j);if(j){x=j[1];break}}var w,k=l.languages[x];k?h.content=l.highlight((function(S){return S=S.replace(p,""),S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(T,A){var R;return(A=A.toLowerCase())[0]==="#"?(R=A[1]==="x"?parseInt(A.slice(2),16):Number(A.slice(1)),f(R)):g[A]||T})})(h.content),k,x):x&&x!=="none"&&l.plugins.autoloader&&(w="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),h.attributes.id=w,l.plugins.autoloader.loadLanguages(x,function(){var S=document.getElementById(w);S&&(S.innerHTML=l.highlight(S.textContent,l.languages[x],x))}))}}),RegExp(l.languages.markup.tag.pattern.source,"gi")),g={amp:"&",lt:"<",gt:">",quot:'"'},f=String.fromCodePoint||String.fromCharCode;l.languages.md=l.languages.markdown})(ie),ie.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ie.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ie.hooks.add("after-tokenize",function(l){if(l.language==="graphql")for(var r=l.tokens.filter(function(w){return typeof w!="string"&&w.type!=="comment"&&w.type!=="scalar"}),i=0;i<r.length;){var o=r[i++];if(o.type==="keyword"&&o.content==="mutation"){var u=[];if(v(["definition-mutation","punctuation"])&&x(1).content==="("){i+=2;var m=C(/^\($/,/^\)$/);if(m===-1)continue;for(;i<m;i++){var p=x(0);p.type==="variable"&&(j(p,"variable-input"),u.push(p.content))}i=m+1}if(v(["punctuation","property-query"])&&x(0).content==="{"&&(i++,j(x(0),"property-mutation"),0<u.length)){var g=C(/^\{$/,/^\}$/);if(g!==-1)for(var f=i;f<g;f++){var h=r[f];h.type==="variable"&&0<=u.indexOf(h.content)&&j(h,"variable-input")}}}}function x(w){return r[i+w]}function v(w,k){k=k||0;for(var S=0;S<w.length;S++){var T=x(S+k);if(!T||T.type!==w[S])return}return 1}function C(w,k){for(var S=1,T=i;T<r.length;T++){var A=r[T],R=A.content;if(A.type==="punctuation"&&typeof R=="string"){if(w.test(R))S++;else if(k.test(R)&&--S===0)return T}}return-1}function j(w,k){var S=w.alias;S?Array.isArray(S)||(w.alias=S=[S]):w.alias=S=[],S.push(k)}}),ie.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(l){var r=l.languages.javascript["template-string"],i=r.pattern.source,o=r.inside.interpolation,u=o.inside["interpolation-punctuation"],m=o.pattern.source;function p(v,C){if(l.languages[v])return{pattern:RegExp("((?:"+C+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:v}}}}function g(v,C,j){return v={code:v,grammar:C,language:j},l.hooks.run("before-tokenize",v),v.tokens=l.tokenize(v.code,v.grammar),l.hooks.run("after-tokenize",v),v.tokens}function f(v,C,j){var S=l.tokenize(v,{interpolation:{pattern:RegExp(m),lookbehind:!0}}),w=0,k={},S=g(S.map(function(A){if(typeof A=="string")return A;for(var R,D,A=A.content;v.indexOf((D=w++,R="___"+j.toUpperCase()+"_"+D+"___"))!==-1;);return k[R]=A,R}).join(""),C,j),T=Object.keys(k);return w=0,(function A(R){for(var D=0;D<R.length;D++){if(w>=T.length)return;var O,$,q,ne,de,oe,I,te=R[D];typeof te=="string"||typeof te.content=="string"?(O=T[w],(I=(oe=typeof te=="string"?te:te.content).indexOf(O))!==-1&&(++w,$=oe.substring(0,I),de=k[O],q=void 0,(ne={})["interpolation-punctuation"]=u,(ne=l.tokenize(de,ne)).length===3&&((q=[1,1]).push.apply(q,g(ne[1],l.languages.javascript,"javascript")),ne.splice.apply(ne,q)),q=new l.Token("interpolation",ne,o.alias,de),ne=oe.substring(I+O.length),de=[],$&&de.push($),de.push(q),ne&&(A(oe=[ne]),de.push.apply(de,oe)),typeof te=="string"?(R.splice.apply(R,[D,1].concat(de)),D+=de.length-1):te.content=de)):(I=te.content,Array.isArray(I)?A(I):A([I]))}})(S),new l.Token(j,S,"language-"+j,v)}l.languages.javascript["template-string"]=[p("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),p("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),p("svg",/\bsvg/.source),p("markdown",/\b(?:markdown|md)/.source),p("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),p("sql",/\bsql/.source),r].filter(Boolean);var h={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function x(v){return typeof v=="string"?v:Array.isArray(v)?v.map(x).join(""):x(v.content)}l.hooks.add("after-tokenize",function(v){v.language in h&&(function C(j){for(var w=0,k=j.length;w<k;w++){var S,T,A,R=j[w];typeof R!="string"&&(S=R.content,Array.isArray(S)?R.type==="template-string"?(R=S[1],S.length===3&&typeof R!="string"&&R.type==="embedded-code"&&(T=x(R),R=R.alias,R=Array.isArray(R)?R[0]:R,A=l.languages[R])&&(S[1]=f(T,A,R))):C(S):typeof S!="string"&&C([S]))}})(v.tokens)})})(ie),(function(l){l.languages.typescript=l.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),l.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete l.languages.typescript.parameter,delete l.languages.typescript["literal-property"];var r=l.languages.extend("typescript",{});delete r["class-name"],l.languages.typescript["class-name"].inside=r,l.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),l.languages.ts=l.languages.typescript})(ie),(function(l){var r=l.languages.javascript,i=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,o="(@(?:arg|argument|param|property)\\s+(?:"+i+"\\s+)?)";l.languages.jsdoc=l.languages.extend("javadoclike",{parameter:{pattern:RegExp(o+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),l.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(o+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:r,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return i})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+i),lookbehind:!0,inside:{string:r.string,number:r.number,boolean:r.boolean,keyword:l.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:r,alias:"language-javascript"}}}}),l.languages.javadoclike.addSupport("javascript",l.languages.jsdoc)})(ie),(function(l){l.languages.flow=l.languages.extend("javascript",{}),l.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),l.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete l.languages.flow.parameter,l.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(l.languages.flow.keyword)||(l.languages.flow.keyword=[l.languages.flow.keyword]),l.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ie),ie.languages.n4js=ie.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ie.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ie.languages.n4jsd=ie.languages.n4js,(function(l){function r(p,g){return RegExp(p.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),g)}l.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+l.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),l.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+l.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),l.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),l.languages.insertBefore("javascript","keyword",{imports:{pattern:r(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:l.languages.javascript},exports:{pattern:r(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:l.languages.javascript}}),l.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),l.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),l.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:r(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var i=["function","function-variable","method","method-variable","property-access"],o=0;o<i.length;o++){var m=i[o],u=l.languages.javascript[m],m=(u=l.util.type(u)==="RegExp"?l.languages.javascript[m]={pattern:u}:u).inside||{};(u.inside=m)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ie),(function(l){var r=l.util.clone(l.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,o=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,u=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function m(f,h){return f=f.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return o}).replace(/<SPREAD>/g,function(){return u}),RegExp(f,h)}u=m(u).source,l.languages.jsx=l.languages.extend("markup",r),l.languages.jsx.tag.pattern=m(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),l.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,l.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,l.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,l.languages.jsx.tag.inside.comment=r.comment,l.languages.insertBefore("inside","attr-name",{spread:{pattern:m(/<SPREAD>/.source),inside:l.languages.jsx}},l.languages.jsx.tag),l.languages.insertBefore("inside","special-attr",{script:{pattern:m(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:l.languages.jsx}}},l.languages.jsx.tag);function p(f){for(var h=[],x=0;x<f.length;x++){var v=f[x],C=!1;typeof v!="string"&&(v.type==="tag"&&v.content[0]&&v.content[0].type==="tag"?v.content[0].content[0].content==="</"?0<h.length&&h[h.length-1].tagName===g(v.content[0].content[1])&&h.pop():v.content[v.content.length-1].content!=="/>"&&h.push({tagName:g(v.content[0].content[1]),openedBraces:0}):0<h.length&&v.type==="punctuation"&&v.content==="{"?h[h.length-1].openedBraces++:0<h.length&&0<h[h.length-1].openedBraces&&v.type==="punctuation"&&v.content==="}"?h[h.length-1].openedBraces--:C=!0),(C||typeof v=="string")&&0<h.length&&h[h.length-1].openedBraces===0&&(C=g(v),x<f.length-1&&(typeof f[x+1]=="string"||f[x+1].type==="plain-text")&&(C+=g(f[x+1]),f.splice(x+1,1)),0<x&&(typeof f[x-1]=="string"||f[x-1].type==="plain-text")&&(C=g(f[x-1])+C,f.splice(x-1,1),x--),f[x]=new l.Token("plain-text",C,null,C)),v.content&&typeof v.content!="string"&&p(v.content)}}var g=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(g).join(""):""};l.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||p(f.tokens)})})(ie),(function(l){var r=l.util.clone(l.languages.typescript),r=(l.languages.tsx=l.languages.extend("jsx",r),delete l.languages.tsx.parameter,delete l.languages.tsx["literal-property"],l.languages.tsx.tag);r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(ie),ie.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ie.languages.swift["string-literal"].forEach(function(l){l.inside.interpolation.inside=ie.languages.swift}),(function(l){l.languages.kotlin=l.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete l.languages.kotlin["class-name"];var r={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:l.languages.kotlin}};l.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:r},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:r},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete l.languages.kotlin.string,l.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),l.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),l.languages.kt=l.languages.kotlin,l.languages.kts=l.languages.kotlin})(ie),ie.languages.c=ie.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ie.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ie.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ie.languages.c.string],char:ie.languages.c.char,comment:ie.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ie.languages.c}}}}),ie.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ie.languages.c.boolean,ie.languages.objectivec=ie.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ie.languages.objectivec["class-name"],ie.languages.objc=ie.languages.objectivec,ie.languages.reason=ie.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ie.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ie.languages.reason.function,(function(l){for(var r=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)r=r.replace(/<self>/g,function(){return r});r=r.replace(/<self>/g,function(){return/[^\s\S]/.source}),l.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+r),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},l.languages.rust["closure-params"].inside.rest=l.languages.rust,l.languages.rust.attribute.inside.string=l.languages.rust.string})(ie),ie.languages.go=ie.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ie.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ie.languages.go["class-name"],(function(l){var r=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return r.source});l.languages.cpp=l.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:r,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),l.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),l.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:l.languages.cpp}}}}),l.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),l.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:l.languages.extend("cpp",{})}}),l.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},l.languages.cpp["base-clause"])})(ie),ie.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ie.languages.python["string-interpolation"].inside.interpolation.inside.rest=ie.languages.python,ie.languages.py=ie.languages.python,ie.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ie.languages.webmanifest=ie.languages.json;var vu={};yv(vu,{dracula:()=>kv,duotoneDark:()=>Cv,duotoneLight:()=>Tv,github:()=>Rv,gruvboxMaterialDark:()=>s1,gruvboxMaterialLight:()=>i1,jettwaveDark:()=>Kv,jettwaveLight:()=>Wv,nightOwl:()=>Dv,nightOwlLight:()=>Ov,oceanicNext:()=>zv,okaidia:()=>$v,oneDark:()=>t1,oneLight:()=>a1,palenight:()=>Hv,shadesOfPurple:()=>qv,synthwave84:()=>Fv,ultramin:()=>Vv,vsDark:()=>yx,vsLight:()=>Iv});var Nv={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},kv=Nv,Sv={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},Cv=Sv,Ev={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Tv=Ev,Av={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Rv=Av,Mv={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Dv=Mv,_v={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Ov=_v,Pt={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},Lv={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Pt.keyword}},{types:["attr-value"],style:{color:Pt.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Pt.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Pt.primitive}},{types:["boolean"],style:{color:Pt.boolean}},{types:["tag"],style:{color:Pt.tag}},{types:["string"],style:{color:Pt.string}},{types:["punctuation"],style:{color:Pt.string}},{types:["selector","char","builtin","inserted"],style:{color:Pt.char}},{types:["function"],style:{color:Pt.function}},{types:["operator","entity","url","variable"],style:{color:Pt.variable}},{types:["keyword"],style:{color:Pt.keyword}},{types:["atrule","class-name"],style:{color:Pt.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},zv=Lv,Bv={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},$v=Bv,Uv={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Hv=Uv,Gv={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},qv=Gv,Yv={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Fv=Yv,Zv={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Vv=Zv,Qv={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},yx=Qv,Xv={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Iv=Xv,Jv={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Kv=Jv,Pv={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Wv=Pv,e1={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},t1=e1,n1={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},a1=n1,l1={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},s1=l1,r1={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},i1=r1,o1=l=>y.useCallback(r=>{var i=r,{className:o,style:u,line:m}=i,p=bx(i,["className","style","line"]);const g=Si(Cn({},p),{className:hx("token-line",o)});return typeof l=="object"&&"plain"in l&&(g.style=l.plain),typeof u=="object"&&(g.style=Cn(Cn({},g.style||{}),u)),g},[l]),c1=l=>{const r=y.useCallback(({types:i,empty:o})=>{if(l!=null){{if(i.length===1&&i[0]==="plain")return o!=null?{display:"inline-block"}:void 0;if(i.length===1&&o!=null)return l[i[0]]}return Object.assign(o!=null?{display:"inline-block"}:{},...i.map(u=>l[u]))}},[l]);return y.useCallback(i=>{var o=i,{token:u,className:m,style:p}=o,g=bx(o,["token","className","style"]);const f=Si(Cn({},g),{className:hx("token",...u.types,m),children:u.content,style:r(u)});return p!=null&&(f.style=Cn(Cn({},f.style||{}),p)),f},[r])},u1=/\r\n|\r|\n/,yh=l=>{l.length===0?l.push({types:["plain"],content:`
|
|
134
|
+
`)&&(r=r.slice(0,-1))),On.prototype.equals.call(this,l,r,i)};function uv(l,r,i){return Ri.diff(l,r,i)}var dv=new On;dv.tokenize=function(l){return l.split(/(\S.+?[.!?])(?=\s+|$)/)};var mv=new On;mv.tokenize=function(l){return l.split(/([{}:;,]|\s+)/)};function wu(l){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},wu(l)}var Is=new On;Is.useLongestToken=!0;Is.tokenize=Ri.tokenize;Is.castInput=function(l,r){var i=r.undefinedReplacement,o=r.stringifyReplacer,u=o===void 0?function(m,p){return typeof p>"u"?i:p}:o;return typeof l=="string"?l:JSON.stringify(Nu(l,null,null,u),u," ")};Is.equals=function(l,r,i){return On.prototype.equals.call(Is,l.replace(/,([\r\n])/g,"$1"),r.replace(/,([\r\n])/g,"$1"),i)};function Nu(l,r,i,o,u){r=r||[],i=i||[],o&&(l=o(u,l));var m;for(m=0;m<r.length;m+=1)if(r[m]===l)return i[m];var p;if(Object.prototype.toString.call(l)==="[object Array]"){for(r.push(l),p=new Array(l.length),i.push(p),m=0;m<l.length;m+=1)p[m]=Nu(l[m],r,i,o,u);return r.pop(),i.pop(),p}if(l&&l.toJSON&&(l=l.toJSON()),wu(l)==="object"&&l!==null){r.push(l),p={},i.push(p);var g=[],f;for(f in l)Object.prototype.hasOwnProperty.call(l,f)&&g.push(f);for(g.sort(),m=0;m<g.length;m+=1)f=g[m],p[f]=Nu(l[f],r,i,o,f);r.pop(),i.pop()}else p=l;return p}var Su=new On;Su.tokenize=function(l){return l.slice()};Su.join=Su.removeEmpty=function(l){return l};function hx(l){var r,i,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var u=l.length;for(r=0;r<u;r++)l[r]&&(i=hx(l[r]))&&(o&&(o+=" "),o+=i)}else for(i in l)l[i]&&(o&&(o+=" "),o+=i);return o}function xx(){for(var l,r,i=0,o="",u=arguments.length;i<u;i++)(l=arguments[i])&&(r=hx(l))&&(o&&(o+=" "),o+=r);return o}var fv=Object.create,Mi=Object.defineProperty,pv=Object.defineProperties,hv=Object.getOwnPropertyDescriptor,xv=Object.getOwnPropertyDescriptors,gx=Object.getOwnPropertyNames,ki=Object.getOwnPropertySymbols,gv=Object.getPrototypeOf,Qu=Object.prototype.hasOwnProperty,bx=Object.prototype.propertyIsEnumerable,vh=(l,r,i)=>r in l?Mi(l,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[r]=i,_n=(l,r)=>{for(var i in r||(r={}))Qu.call(r,i)&&vh(l,i,r[i]);if(ki)for(var i of ki(r))bx.call(r,i)&&vh(l,i,r[i]);return l},Di=(l,r)=>pv(l,xv(r)),yx=(l,r)=>{var i={};for(var o in l)Qu.call(l,o)&&r.indexOf(o)<0&&(i[o]=l[o]);if(l!=null&&ki)for(var o of ki(l))r.indexOf(o)<0&&bx.call(l,o)&&(i[o]=l[o]);return i},bv=(l,r)=>function(){return r||(0,l[gx(l)[0]])((r={exports:{}}).exports,r),r.exports},yv=(l,r)=>{for(var i in r)Mi(l,i,{get:r[i],enumerable:!0})},vv=(l,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of gx(r))!Qu.call(l,u)&&u!==i&&Mi(l,u,{get:()=>r[u],enumerable:!(o=hv(r,u))||o.enumerable});return l},jv=(l,r,i)=>(i=l!=null?fv(gv(l)):{},vv(!l||!l.__esModule?Mi(i,"default",{value:l,enumerable:!0}):i,l)),wv=bv({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(l,r){var i=(function(){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,u=0,m={},p={util:{encode:function w(S){return S instanceof g?new g(S.type,w(S.content),S.alias):Array.isArray(S)?S.map(w):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(w){return Object.prototype.toString.call(w).slice(8,-1)},objId:function(w){return w.__id||Object.defineProperty(w,"__id",{value:++u}),w.__id},clone:function w(S,k){k=k||{};var E,M;switch(p.util.type(S)){case"Object":if(M=p.util.objId(S),k[M])return k[M];E={},k[M]=E;for(var A in S)S.hasOwnProperty(A)&&(E[A]=w(S[A],k));return E;case"Array":return M=p.util.objId(S),k[M]?k[M]:(E=[],k[M]=E,S.forEach(function(R,O){E[O]=w(R,k)}),E);default:return S}},getLanguage:function(w){for(;w;){var S=o.exec(w.className);if(S)return S[1].toLowerCase();w=w.parentElement}return"none"},setLanguage:function(w,S){w.className=w.className.replace(RegExp(o,"gi"),""),w.classList.add("language-"+S)},isActive:function(w,S,k){for(var E="no-"+S;w;){var M=w.classList;if(M.contains(S))return!0;if(M.contains(E))return!1;w=w.parentElement}return!!k}},languages:{plain:m,plaintext:m,text:m,txt:m,extend:function(w,S){var k=p.util.clone(p.languages[w]);for(var E in S)k[E]=S[E];return k},insertBefore:function(w,S,k,E){E=E||p.languages;var M=E[w],A={};for(var R in M)if(M.hasOwnProperty(R)){if(R==S)for(var O in k)k.hasOwnProperty(O)&&(A[O]=k[O]);k.hasOwnProperty(R)||(A[R]=M[R])}var $=E[w];return E[w]=A,p.languages.DFS(p.languages,function(H,K){K===$&&H!=w&&(this[H]=A)}),A},DFS:function w(S,k,E,M){M=M||{};var A=p.util.objId;for(var R in S)if(S.hasOwnProperty(R)){k.call(S,R,S[R],E||R);var O=S[R],$=p.util.type(O);$==="Object"&&!M[A(O)]?(M[A(O)]=!0,w(O,k,null,M)):$==="Array"&&!M[A(O)]&&(M[A(O)]=!0,w(O,k,R,M))}}},plugins:{},highlight:function(w,S,k){var E={code:w,grammar:S,language:k};if(p.hooks.run("before-tokenize",E),!E.grammar)throw new Error('The language "'+E.language+'" has no grammar.');return E.tokens=p.tokenize(E.code,E.grammar),p.hooks.run("after-tokenize",E),g.stringify(p.util.encode(E.tokens),E.language)},tokenize:function(w,S){var k=S.rest;if(k){for(var E in k)S[E]=k[E];delete S.rest}var M=new h;return v(M,M.head,w),x(w,M,S,M.head,0),j(M)},hooks:{all:{},add:function(w,S){var k=p.hooks.all;k[w]=k[w]||[],k[w].push(S)},run:function(w,S){var k=p.hooks.all[w];if(!(!k||!k.length))for(var E=0,M;M=k[E++];)M(S)}},Token:g};function g(w,S,k,E){this.type=w,this.content=S,this.alias=k,this.length=(E||"").length|0}g.stringify=function w(S,k){if(typeof S=="string")return S;if(Array.isArray(S)){var E="";return S.forEach(function($){E+=w($,k)}),E}var M={type:S.type,content:w(S.content,k),tag:"span",classes:["token",S.type],attributes:{},language:k},A=S.alias;A&&(Array.isArray(A)?Array.prototype.push.apply(M.classes,A):M.classes.push(A)),p.hooks.run("wrap",M);var R="";for(var O in M.attributes)R+=" "+O+'="'+(M.attributes[O]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+R+">"+M.content+"</"+M.tag+">"};function f(w,S,k,E){w.lastIndex=S;var M=w.exec(k);if(M&&E&&M[1]){var A=M[1].length;M.index+=A,M[0]=M[0].slice(A)}return M}function x(w,S,k,E,M,A){for(var R in k)if(!(!k.hasOwnProperty(R)||!k[R])){var O=k[R];O=Array.isArray(O)?O:[O];for(var $=0;$<O.length;++$){if(A&&A.cause==R+","+$)return;var H=O[$],K=H.inside,ae=!!H.lookbehind,ue=!!H.greedy,oe=H.alias;if(ue&&!H.pattern.global){var te=H.pattern.toString().match(/[imsuy]*$/)[0];H.pattern=RegExp(H.pattern.source,te+"g")}for(var xe=H.pattern||H,de=E.next,pe=M;de!==S.tail&&!(A&&pe>=A.reach);pe+=de.value.length,de=de.next){var U=de.value;if(S.length>w.length)return;if(!(U instanceof g)){var z=1,Q;if(ue){if(Q=f(xe,pe,w,ae),!Q||Q.index>=w.length)break;var _=Q.index,ne=Q.index+Q[0].length,W=pe;for(W+=de.value.length;_>=W;)de=de.next,W+=de.value.length;if(W-=de.value.length,pe=W,de.value instanceof g)continue;for(var T=de;T!==S.tail&&(W<ne||typeof T.value=="string");T=T.next)z++,W+=T.value.length;z--,U=w.slice(pe,W),Q.index-=pe}else if(Q=f(xe,0,U,ae),!Q)continue;var _=Q.index,V=Q[0],J=U.slice(0,_),P=U.slice(_+V.length),he=pe+U.length;A&&he>A.reach&&(A.reach=he);var G=de.prev;J&&(G=v(S,G,J),pe+=J.length),C(S,G,z);var F=new g(R,K?p.tokenize(V,K):V,oe,V);if(de=v(S,G,F),P&&v(S,de,P),z>1){var me={cause:R+","+$,reach:he};x(w,S,k,de.prev,pe,me),A&&me.reach>A.reach&&(A.reach=me.reach)}}}}}}function h(){var w={value:null,prev:null,next:null},S={value:null,prev:w,next:null};w.next=S,this.head=w,this.tail=S,this.length=0}function v(w,S,k){var E=S.next,M={value:k,prev:S,next:E};return S.next=M,E.prev=M,w.length++,M}function C(w,S,k){for(var E=S.next,M=0;M<k&&E!==w.tail;M++)E=E.next;S.next=E,E.prev=S,w.length-=M}function j(w){for(var S=[],k=w.head.next;k!==w.tail;)S.push(k.value),k=k.next;return S}return p})();r.exports=i,i.default=i}}),re=jv(wv());re.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},re.languages.markup.tag.inside["attr-value"].inside.entity=re.languages.markup.entity,re.languages.markup.doctype.inside["internal-subset"].inside=re.languages.markup,re.hooks.add("wrap",function(l){l.type==="entity"&&(l.attributes.title=l.content.replace(/&/,"&"))}),Object.defineProperty(re.languages.markup.tag,"addInlined",{value:function(l,o){var i={},i=(i["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:re.languages[o]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),o=(i["language-"+o]={pattern:/[\s\S]+/,inside:re.languages[o]},{});o[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:i},re.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(re.languages.markup.tag,"addAttribute",{value:function(l,r){re.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+l+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:re.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),re.languages.html=re.languages.markup,re.languages.mathml=re.languages.markup,re.languages.svg=re.languages.markup,re.languages.xml=re.languages.extend("markup",{}),re.languages.ssml=re.languages.xml,re.languages.atom=re.languages.xml,re.languages.rss=re.languages.xml,(function(l){var r={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,o="(?:[^\\\\-]|"+i.source+")",o=RegExp(o+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};l.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:i,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":r,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:i}},"special-escape":r,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:i,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":u}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(re),re.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},re.languages.javascript=re.languages.extend("clike",{"class-name":[re.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),re.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,re.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:re.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:re.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:re.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:re.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:re.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),re.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:re.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),re.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),re.languages.markup&&(re.languages.markup.tag.addInlined("script","javascript"),re.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),re.languages.js=re.languages.javascript,re.languages.actionscript=re.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),re.languages.actionscript["class-name"].alias="function",delete re.languages.actionscript.parameter,delete re.languages.actionscript["literal-property"],re.languages.markup&&re.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:re.languages.markup}}),(function(l){var r=/#(?!\{).+/,i={pattern:/#\{[^}]+\}/,alias:"variable"};l.languages.coffeescript=l.languages.extend("javascript",{comment:r,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:i}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),l.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:r,interpolation:i}}}),l.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:l.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:i}}]}),l.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete l.languages.coffeescript["template-string"],l.languages.coffee=l.languages.coffeescript})(re),(function(l){var r=l.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(r,"addSupport",{value:function(i,o){(i=typeof i=="string"?[i]:i).forEach(function(u){var m=function(v){v.inside||(v.inside={}),v.inside.rest=o},p="doc-comment";if(g=l.languages[u]){var g,f=g[p];if((f=f||(g=l.languages.insertBefore(u,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[p])instanceof RegExp&&(f=g[p]={pattern:f}),Array.isArray(f))for(var x=0,h=f.length;x<h;x++)f[x]instanceof RegExp&&(f[x]={pattern:f[x]}),m(f[x]);else m(f)}})}}),r.addSupport(["java","javascript","php"],r)})(re),(function(l){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,r=(l.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},l.languages.css.atrule.inside.rest=l.languages.css,l.languages.markup);r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(re),(function(l){var r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=(l.languages.css.selector={pattern:l.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},l.languages.css.atrule.inside["selector-function-argument"].inside=r,l.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};l.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})})(re),(function(l){var r=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,o="(?:"+i.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+i.source+")?)",u=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),m=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function p(g,f){f=(f||"").replace(/m/g,"")+"m";var x=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<value>>/g,function(){return g});return RegExp(x,f)}l.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return o})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<key>>/g,function(){return"(?:"+u+"|"+m+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:p(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:p(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:p(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:p(m),lookbehind:!0,greedy:!0},number:{pattern:p(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},l.languages.yml=l.languages.yaml})(re),(function(l){var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(x){return x=x.replace(/<inner>/g,function(){return r}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+x+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,u=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),m=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,p=(l.languages.markdown=l.languages.extend("markup",{}),l.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:l.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+u+m+"(?:"+u+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+u+m+")(?:"+u+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:l.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+u+")"+m+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+u+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:l.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(x){["url","bold","italic","strike","code-snippet"].forEach(function(h){x!==h&&(l.languages.markdown[x].inside.content.inside[h]=l.languages.markdown[h])})}),l.hooks.add("after-tokenize",function(x){x.language!=="markdown"&&x.language!=="md"||(function h(v){if(v&&typeof v!="string")for(var C=0,j=v.length;C<j;C++){var w,S=v[C];S.type!=="code"?h(S.content):(w=S.content[1],S=S.content[3],w&&S&&w.type==="code-language"&&S.type==="code-block"&&typeof w.content=="string"&&(w=w.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),w="language-"+(w=(/[a-z][\w-]*/i.exec(w)||[""])[0].toLowerCase()),S.alias?typeof S.alias=="string"?S.alias=[S.alias,w]:S.alias.push(w):S.alias=[w]))}})(x.tokens)}),l.hooks.add("wrap",function(x){if(x.type==="code-block"){for(var h="",v=0,C=x.classes.length;v<C;v++){var j=x.classes[v],j=/language-(.+)/.exec(j);if(j){h=j[1];break}}var w,S=l.languages[h];S?x.content=l.highlight((function(k){return k=k.replace(p,""),k=k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(E,M){var A;return(M=M.toLowerCase())[0]==="#"?(A=M[1]==="x"?parseInt(M.slice(2),16):Number(M.slice(1)),f(A)):g[M]||E})})(x.content),S,h):h&&h!=="none"&&l.plugins.autoloader&&(w="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),x.attributes.id=w,l.plugins.autoloader.loadLanguages(h,function(){var k=document.getElementById(w);k&&(k.innerHTML=l.highlight(k.textContent,l.languages[h],h))}))}}),RegExp(l.languages.markup.tag.pattern.source,"gi")),g={amp:"&",lt:"<",gt:">",quot:'"'},f=String.fromCodePoint||String.fromCharCode;l.languages.md=l.languages.markdown})(re),re.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:re.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},re.hooks.add("after-tokenize",function(l){if(l.language==="graphql")for(var r=l.tokens.filter(function(w){return typeof w!="string"&&w.type!=="comment"&&w.type!=="scalar"}),i=0;i<r.length;){var o=r[i++];if(o.type==="keyword"&&o.content==="mutation"){var u=[];if(v(["definition-mutation","punctuation"])&&h(1).content==="("){i+=2;var m=C(/^\($/,/^\)$/);if(m===-1)continue;for(;i<m;i++){var p=h(0);p.type==="variable"&&(j(p,"variable-input"),u.push(p.content))}i=m+1}if(v(["punctuation","property-query"])&&h(0).content==="{"&&(i++,j(h(0),"property-mutation"),0<u.length)){var g=C(/^\{$/,/^\}$/);if(g!==-1)for(var f=i;f<g;f++){var x=r[f];x.type==="variable"&&0<=u.indexOf(x.content)&&j(x,"variable-input")}}}}function h(w){return r[i+w]}function v(w,S){S=S||0;for(var k=0;k<w.length;k++){var E=h(k+S);if(!E||E.type!==w[k])return}return 1}function C(w,S){for(var k=1,E=i;E<r.length;E++){var M=r[E],A=M.content;if(M.type==="punctuation"&&typeof A=="string"){if(w.test(A))k++;else if(S.test(A)&&--k===0)return E}}return-1}function j(w,S){var k=w.alias;k?Array.isArray(k)||(w.alias=k=[k]):w.alias=k=[],k.push(S)}}),re.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(l){var r=l.languages.javascript["template-string"],i=r.pattern.source,o=r.inside.interpolation,u=o.inside["interpolation-punctuation"],m=o.pattern.source;function p(v,C){if(l.languages[v])return{pattern:RegExp("((?:"+C+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:v}}}}function g(v,C,j){return v={code:v,grammar:C,language:j},l.hooks.run("before-tokenize",v),v.tokens=l.tokenize(v.code,v.grammar),l.hooks.run("after-tokenize",v),v.tokens}function f(v,C,j){var k=l.tokenize(v,{interpolation:{pattern:RegExp(m),lookbehind:!0}}),w=0,S={},k=g(k.map(function(M){if(typeof M=="string")return M;for(var A,R,M=M.content;v.indexOf((R=w++,A="___"+j.toUpperCase()+"_"+R+"___"))!==-1;);return S[A]=M,A}).join(""),C,j),E=Object.keys(S);return w=0,(function M(A){for(var R=0;R<A.length;R++){if(w>=E.length)return;var O,$,H,K,ae,ue,oe,te=A[R];typeof te=="string"||typeof te.content=="string"?(O=E[w],(oe=(ue=typeof te=="string"?te:te.content).indexOf(O))!==-1&&(++w,$=ue.substring(0,oe),ae=S[O],H=void 0,(K={})["interpolation-punctuation"]=u,(K=l.tokenize(ae,K)).length===3&&((H=[1,1]).push.apply(H,g(K[1],l.languages.javascript,"javascript")),K.splice.apply(K,H)),H=new l.Token("interpolation",K,o.alias,ae),K=ue.substring(oe+O.length),ae=[],$&&ae.push($),ae.push(H),K&&(M(ue=[K]),ae.push.apply(ae,ue)),typeof te=="string"?(A.splice.apply(A,[R,1].concat(ae)),R+=ae.length-1):te.content=ae)):(oe=te.content,Array.isArray(oe)?M(oe):M([oe]))}})(k),new l.Token(j,k,"language-"+j,v)}l.languages.javascript["template-string"]=[p("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),p("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),p("svg",/\bsvg/.source),p("markdown",/\b(?:markdown|md)/.source),p("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),p("sql",/\bsql/.source),r].filter(Boolean);var x={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function h(v){return typeof v=="string"?v:Array.isArray(v)?v.map(h).join(""):h(v.content)}l.hooks.add("after-tokenize",function(v){v.language in x&&(function C(j){for(var w=0,S=j.length;w<S;w++){var k,E,M,A=j[w];typeof A!="string"&&(k=A.content,Array.isArray(k)?A.type==="template-string"?(A=k[1],k.length===3&&typeof A!="string"&&A.type==="embedded-code"&&(E=h(A),A=A.alias,A=Array.isArray(A)?A[0]:A,M=l.languages[A])&&(k[1]=f(E,M,A))):C(k):typeof k!="string"&&C([k]))}})(v.tokens)})})(re),(function(l){l.languages.typescript=l.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),l.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete l.languages.typescript.parameter,delete l.languages.typescript["literal-property"];var r=l.languages.extend("typescript",{});delete r["class-name"],l.languages.typescript["class-name"].inside=r,l.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),l.languages.ts=l.languages.typescript})(re),(function(l){var r=l.languages.javascript,i=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,o="(@(?:arg|argument|param|property)\\s+(?:"+i+"\\s+)?)";l.languages.jsdoc=l.languages.extend("javadoclike",{parameter:{pattern:RegExp(o+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),l.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(o+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:r,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return i})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+i),lookbehind:!0,inside:{string:r.string,number:r.number,boolean:r.boolean,keyword:l.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:r,alias:"language-javascript"}}}}),l.languages.javadoclike.addSupport("javascript",l.languages.jsdoc)})(re),(function(l){l.languages.flow=l.languages.extend("javascript",{}),l.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),l.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete l.languages.flow.parameter,l.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(l.languages.flow.keyword)||(l.languages.flow.keyword=[l.languages.flow.keyword]),l.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(re),re.languages.n4js=re.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),re.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),re.languages.n4jsd=re.languages.n4js,(function(l){function r(p,g){return RegExp(p.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),g)}l.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+l.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),l.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+l.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),l.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),l.languages.insertBefore("javascript","keyword",{imports:{pattern:r(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:l.languages.javascript},exports:{pattern:r(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:l.languages.javascript}}),l.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),l.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),l.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:r(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var i=["function","function-variable","method","method-variable","property-access"],o=0;o<i.length;o++){var m=i[o],u=l.languages.javascript[m],m=(u=l.util.type(u)==="RegExp"?l.languages.javascript[m]={pattern:u}:u).inside||{};(u.inside=m)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(re),(function(l){var r=l.util.clone(l.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,o=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,u=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function m(f,x){return f=f.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return o}).replace(/<SPREAD>/g,function(){return u}),RegExp(f,x)}u=m(u).source,l.languages.jsx=l.languages.extend("markup",r),l.languages.jsx.tag.pattern=m(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),l.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,l.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,l.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,l.languages.jsx.tag.inside.comment=r.comment,l.languages.insertBefore("inside","attr-name",{spread:{pattern:m(/<SPREAD>/.source),inside:l.languages.jsx}},l.languages.jsx.tag),l.languages.insertBefore("inside","special-attr",{script:{pattern:m(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:l.languages.jsx}}},l.languages.jsx.tag);function p(f){for(var x=[],h=0;h<f.length;h++){var v=f[h],C=!1;typeof v!="string"&&(v.type==="tag"&&v.content[0]&&v.content[0].type==="tag"?v.content[0].content[0].content==="</"?0<x.length&&x[x.length-1].tagName===g(v.content[0].content[1])&&x.pop():v.content[v.content.length-1].content!=="/>"&&x.push({tagName:g(v.content[0].content[1]),openedBraces:0}):0<x.length&&v.type==="punctuation"&&v.content==="{"?x[x.length-1].openedBraces++:0<x.length&&0<x[x.length-1].openedBraces&&v.type==="punctuation"&&v.content==="}"?x[x.length-1].openedBraces--:C=!0),(C||typeof v=="string")&&0<x.length&&x[x.length-1].openedBraces===0&&(C=g(v),h<f.length-1&&(typeof f[h+1]=="string"||f[h+1].type==="plain-text")&&(C+=g(f[h+1]),f.splice(h+1,1)),0<h&&(typeof f[h-1]=="string"||f[h-1].type==="plain-text")&&(C=g(f[h-1])+C,f.splice(h-1,1),h--),f[h]=new l.Token("plain-text",C,null,C)),v.content&&typeof v.content!="string"&&p(v.content)}}var g=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(g).join(""):""};l.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||p(f.tokens)})})(re),(function(l){var r=l.util.clone(l.languages.typescript),r=(l.languages.tsx=l.languages.extend("jsx",r),delete l.languages.tsx.parameter,delete l.languages.tsx["literal-property"],l.languages.tsx.tag);r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(re),re.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},re.languages.swift["string-literal"].forEach(function(l){l.inside.interpolation.inside=re.languages.swift}),(function(l){l.languages.kotlin=l.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete l.languages.kotlin["class-name"];var r={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:l.languages.kotlin}};l.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:r},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:r},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete l.languages.kotlin.string,l.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),l.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),l.languages.kt=l.languages.kotlin,l.languages.kts=l.languages.kotlin})(re),re.languages.c=re.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),re.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),re.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},re.languages.c.string],char:re.languages.c.char,comment:re.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:re.languages.c}}}}),re.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete re.languages.c.boolean,re.languages.objectivec=re.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete re.languages.objectivec["class-name"],re.languages.objc=re.languages.objectivec,re.languages.reason=re.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),re.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete re.languages.reason.function,(function(l){for(var r=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)r=r.replace(/<self>/g,function(){return r});r=r.replace(/<self>/g,function(){return/[^\s\S]/.source}),l.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+r),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},l.languages.rust["closure-params"].inside.rest=l.languages.rust,l.languages.rust.attribute.inside.string=l.languages.rust.string})(re),re.languages.go=re.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),re.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete re.languages.go["class-name"],(function(l){var r=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return r.source});l.languages.cpp=l.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:r,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),l.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),l.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:l.languages.cpp}}}}),l.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),l.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:l.languages.extend("cpp",{})}}),l.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},l.languages.cpp["base-clause"])})(re),re.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},re.languages.python["string-interpolation"].inside.interpolation.inside.rest=re.languages.python,re.languages.py=re.languages.python,re.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},re.languages.webmanifest=re.languages.json;var ku={};yv(ku,{dracula:()=>Sv,duotoneDark:()=>Cv,duotoneLight:()=>Ev,github:()=>Rv,gruvboxMaterialDark:()=>s1,gruvboxMaterialLight:()=>i1,jettwaveDark:()=>Kv,jettwaveLight:()=>Wv,nightOwl:()=>Dv,nightOwlLight:()=>Ov,oceanicNext:()=>zv,okaidia:()=>$v,oneDark:()=>t1,oneLight:()=>a1,palenight:()=>Hv,shadesOfPurple:()=>qv,synthwave84:()=>Fv,ultramin:()=>Vv,vsDark:()=>vx,vsLight:()=>Iv});var Nv={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},Sv=Nv,kv={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},Cv=kv,Tv={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Ev=Tv,Av={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Rv=Av,Mv={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Dv=Mv,_v={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Ov=_v,sn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},Lv={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:sn.keyword}},{types:["attr-value"],style:{color:sn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:sn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:sn.primitive}},{types:["boolean"],style:{color:sn.boolean}},{types:["tag"],style:{color:sn.tag}},{types:["string"],style:{color:sn.string}},{types:["punctuation"],style:{color:sn.string}},{types:["selector","char","builtin","inserted"],style:{color:sn.char}},{types:["function"],style:{color:sn.function}},{types:["operator","entity","url","variable"],style:{color:sn.variable}},{types:["keyword"],style:{color:sn.keyword}},{types:["atrule","class-name"],style:{color:sn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},zv=Lv,Bv={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},$v=Bv,Uv={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Hv=Uv,Gv={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},qv=Gv,Yv={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Fv=Yv,Zv={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Vv=Zv,Qv={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},vx=Qv,Xv={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Iv=Xv,Jv={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Kv=Jv,Pv={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Wv=Pv,e1={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},t1=e1,n1={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},a1=n1,l1={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},s1=l1,r1={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},i1=r1,o1=l=>y.useCallback(r=>{var i=r,{className:o,style:u,line:m}=i,p=yx(i,["className","style","line"]);const g=Di(_n({},p),{className:xx("token-line",o)});return typeof l=="object"&&"plain"in l&&(g.style=l.plain),typeof u=="object"&&(g.style=_n(_n({},g.style||{}),u)),g},[l]),c1=l=>{const r=y.useCallback(({types:i,empty:o})=>{if(l!=null){{if(i.length===1&&i[0]==="plain")return o!=null?{display:"inline-block"}:void 0;if(i.length===1&&o!=null)return l[i[0]]}return Object.assign(o!=null?{display:"inline-block"}:{},...i.map(u=>l[u]))}},[l]);return y.useCallback(i=>{var o=i,{token:u,className:m,style:p}=o,g=yx(o,["token","className","style"]);const f=Di(_n({},g),{className:xx("token",...u.types,m),children:u.content,style:r(u)});return p!=null&&(f.style=_n(_n({},f.style||{}),p)),f},[r])},u1=/\r\n|\r|\n/,jh=l=>{l.length===0?l.push({types:["plain"],content:`
|
|
135
135
|
`,empty:!0}):l.length===1&&l[0].content===""&&(l[0].content=`
|
|
136
|
-
`,l[0].empty=!0)},
|
|
136
|
+
`,l[0].empty=!0)},wh=(l,r)=>{const i=l.length;return i>0&&l[i-1]===r?l:l.concat(r)},d1=l=>{const r=[[]],i=[l],o=[0],u=[l.length];let m=0,p=0,g=[];const f=[g];for(;p>-1;){for(;(m=o[p]++)<u[p];){let x,h=r[p];const C=i[p][m];if(typeof C=="string"?(h=p>0?h:["plain"],x=C):(h=wh(h,C.type),C.alias&&(h=wh(h,C.alias)),x=C.content),typeof x!="string"){p++,r.push(h),i.push(x),o.push(0),u.push(x.length);continue}const j=x.split(u1),w=j.length;g.push({types:h,content:j[0]});for(let S=1;S<w;S++)jh(g),f.push(g=[]),g.push({types:h,content:j[S]})}p--,r.pop(),i.pop(),o.pop(),u.pop()}return jh(g),f},Nh=d1,m1=({prism:l,code:r,grammar:i,language:o})=>y.useMemo(()=>{if(i==null)return Nh([r]);const u={code:r,grammar:i,language:o,tokens:[]};return l.hooks.run("before-tokenize",u),u.tokens=l.tokenize(r,i),l.hooks.run("after-tokenize",u),Nh(u.tokens)},[r,i,o,l]),f1=(l,r)=>{const{plain:i}=l,o=l.styles.reduce((u,m)=>{const{languages:p,style:g}=m;return p&&!p.includes(r)||m.types.forEach(f=>{const x=_n(_n({},u[f]),g);u[f]=x}),u},{});return o.root=i,o.plain=Di(_n({},i),{backgroundColor:void 0}),o},p1=f1,h1=({children:l,language:r,code:i,theme:o,prism:u})=>{const m=r.toLowerCase(),p=p1(o,m),g=o1(p),f=c1(p),x=u.languages[m],h=m1({prism:u,language:m,code:i,grammar:x});return l({tokens:h,className:`prism-code language-${m}`,style:p!=null?p.root:{},getLineProps:g,getTokenProps:f})},x1=l=>y.createElement(h1,Di(_n({},l),{prism:l.prism||re,theme:l.theme||vx,code:l.code,language:l.language}));/*! Bundled license information:
|
|
137
137
|
|
|
138
138
|
prismjs/prism.js:
|
|
139
139
|
(**
|
|
@@ -146,22 +146,22 @@ prismjs/prism.js:
|
|
|
146
146
|
*)
|
|
147
147
|
*/const g1=l=>{const r=new MutationObserver(l);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},b1=()=>document.documentElement.classList.contains("dark");function y1(l,r){if(!l&&r)return r.split(`
|
|
148
148
|
`).map(u=>({type:"add",content:u}));const i=uv(l,r),o=[];for(const u of i){const m=u.value.replace(/\n$/,"").split(`
|
|
149
|
-
`),p=u.added?"add":u.removed?"remove":"context";for(const g of m)o.push({type:p,content:g})}return o}function v1(l){const r=l.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rs:"rust",go:"go",rb:"ruby",java:"java",css:"css",html:"html",json:"json",md:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",zsh:"bash",bash:"bash"}[r]||"text"}const j1=y.memo(function({toolName:r,filePath:i,oldContent:o,newContent:u,isActive:m}){const p=y.useMemo(()=>y1(o,u),[o,u]),g=v1(i),f=y.useSyncExternalStore(g1,b1),
|
|
150
|
-
`),language:g,children:({tokens:v,getLineProps:C,getTokenProps:j})=>n.jsx("pre",{className:"text-xs font-mono !bg-transparent !m-0 p-0",children:v.map((w,
|
|
151
|
-
`),[r]),f=g.length>p.lines||r.length>p.chars,
|
|
152
|
-
`);return
|
|
153
|
-
...`})]}),f&&n.jsxs("button",{onClick:()=>m(x=>!x),className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-green transition-colors duration-200 ease-material flex items-center gap-1.5",children:[o&&n.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:u?"[←]":"[→]"}),n.jsx("span",{children:u?"Show less":`Show more (${g.length} lines)`})]}),i&&i.length>0&&n.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:i.map((x,v)=>n.jsx("img",{src:x,alt:`Attachment ${v+1}`,className:"max-w-[300px] max-h-[200px] rounded-md object-contain"},v))})]})});function Us(l){if(!l)return"";try{return new Date(l).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return""}}function R1({scenes:l,visibleCount:r,currentIndex:i,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:g,onSeek:f,state:h,overlayActions:x,turnStats:v}){const C=y.useMemo(()=>{const S=[];let T=null,A=0;for(let R=0;R<l.length;R++){const D=l[R];if(D.type==="user-prompt"||D.type==="compaction-summary"||D.type==="context-injection"){T&&T.scenes.length>0&&S.push(T);const O=D.type==="compaction-summary"?"compaction":D.type==="context-injection"?"context-injection":"user";O==="user"&&A++,S.push({type:O,timestamp:D.timestamp,scenes:[{scene:D,index:R}],turnNumber:O==="user"?A:void 0}),T=null}else(!T||T.type!=="assistant")&&(T&&T.scenes.length>0&&S.push(T),T={type:"assistant",timestamp:D.timestamp,scenes:[],turnNumber:A>0?A:void 0}),T.scenes.push({scene:D,index:R})}return T&&T.scenes.length>0&&S.push(T),S},[l]),j=y.useMemo(()=>o.promptsOnly?C.filter(S=>(S.type==="user"||S.type==="compaction")&&S.scenes[0].index<r):C.filter(S=>S.scenes[0].index<r),[C,r,o.promptsOnly]),w=y.useMemo(()=>{for(let S=j.length-1;S>=0;S--)if(j[S].scenes.some(T=>T.index<=i))return S;return j.length-1},[j,i]),k=y.useMemo(()=>{const S=new Map;for(let T=1;T<j.length;T++){const A=j[T];if(A.type!=="user")continue;let R;for(let O=T-1;O>=0;O--){const $=j[O],q=$.scenes[$.scenes.length-1];if(q?.scene.timestamp){R=q.scene.timestamp;break}if($.timestamp){R=$.timestamp;break}}if(!R||!A.timestamp)continue;const D=new Date(A.timestamp).getTime()-new Date(R).getTime();D>12e4&&S.set(T,D)}return S},[j]);return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-5 pb-6",children:[j.map((S,T)=>n.jsxs(D1,{forceRender:T>=w-15&&T<=w+5,children:[k.has(T)&&n.jsx(M1,{gapMs:k.get(T)}),n.jsx(_1,{group:S,currentIndex:i,visibleCount:r,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:g,overlayActions:x,turnStats:v})]},T)),h==="paused"&&r<l.length&&n.jsx("div",{className:"pt-4 pb-12 flex items-center justify-center animate-in fade-in slide-in-from-bottom-2 duration-700 ease-out select-none",children:n.jsxs("div",{className:"group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm",children:[n.jsx("div",{className:"absolute inset-0 bg-terminal-orange/5 opacity-0 group-hover/pause:opacity-100 transition-opacity duration-700 blur-2xl -z-10"}),n.jsxs("div",{className:"flex items-center gap-2.5 pr-8 border-r border-terminal-border/20",children:[n.jsxs("div",{className:"relative flex h-2 w-2",children:[n.jsx("div",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40"}),n.jsx("div",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-orange/80 shadow-[0_0_8px_rgba(251,146,60,0.5)]"})]}),n.jsx("span",{className:"text-[10px] font-sans font-black text-terminal-orange uppercase tracking-[.25em] drop-shadow-sm",children:"Paused"})]}),n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:n.jsx("span",{className:"text-[11px] font-mono font-bold",children:"↓"})}),n.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Explore"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:n.jsx("span",{className:"text-[9px] font-mono font-black tracking-tight",children:"SPACE"})}),n.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Resume"})]})]})]})}),r>=l.length&&n.jsxs("div",{className:"pt-12 pb-24 flex flex-col items-center justify-center animate-in fade-in zoom-in-95 duration-1000 ease-out select-none",children:[n.jsx("div",{className:"h-px w-8 bg-terminal-border-subtle mb-6"}),n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]",children:"the end"}),n.jsx("div",{className:"text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1",children:"session replay complete"})]}),n.jsxs("div",{className:"mt-8 flex flex-col items-center gap-6",children:[n.jsxs("button",{onClick:()=>f?.(0),className:"group flex items-center gap-2.5 px-3.5 py-1.5 rounded-full bg-terminal-surface/30 border border-terminal-border-subtle text-terminal-dimmer hover:text-terminal-green hover:border-terminal-green/30 hover:bg-terminal-green/5 transition-all duration-300",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300 group-hover:-translate-y-0.5",children:n.jsx("path",{d:"m18 15-6-6-6 6"})}),n.jsx("span",{className:"text-[10px] font-mono font-bold uppercase tracking-widest transition-colors",children:"Back to Top"}),n.jsxs("span",{className:"text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity",children:[" ","[Home]"]})]}),n.jsxs("div",{className:"flex items-center gap-3 opacity-20",children:[n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-green"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-blue"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-orange"})]})]})]})]})}function M1({gapMs:l}){const r=l>=36e5?`${Math.floor(l/36e5)}h ${Math.floor(l%36e5/6e4)}m later`:`${Math.floor(l/6e4)}m later`;return n.jsxs("div",{className:"flex items-center gap-3 py-1 px-4",children:[n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer whitespace-nowrap",children:r}),n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}const D1=y.memo(function({children:r,forceRender:i}){const o=y.useRef(null),[u,m]=y.useState(!1),p=y.useRef(0);y.useEffect(()=>{const f=o.current;if(!f)return;const h=new IntersectionObserver(([x])=>{m(x.isIntersecting),x.isIntersecting&&f.offsetHeight>0&&(p.current=f.offsetHeight)},{rootMargin:"800px 0px"});return h.observe(f),()=>h.disconnect()},[]);const g=u||i;return y.useEffect(()=>{g&&o.current&&o.current.offsetHeight>0&&(p.current=o.current.offsetHeight)}),n.jsx("div",{ref:o,style:!g&&p.current>0?{minHeight:p.current}:void 0,children:g?r:null})}),_1=y.memo(function({group:r,currentIndex:i,visibleCount:o,effectivePrefs:u,focusIndex:m,annotatedScenes:p,annotationCounts:g,onComment:f,overlayActions:h,turnStats:x}){const[v,C]=y.useState(!1),j=y.useMemo(()=>r.scenes.filter(O=>O.index<o),[r.scenes,o]),w=j.some(({index:O})=>O===i),k=typeof m=="number"&&j.some(({index:O})=>O===m),S=j[0]?.index;if(j.length===0)return null;const T=r.type==="user"&&g?.get(S)||0,A=r.type==="user"&&f&&(T>0||v)?n.jsxs("button",{onClick:O=>{O.stopPropagation(),f(S)},className:`absolute right-0 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${T>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:T>0?`${T} comment${T>1?"s":""}`:"Add comment",children:["💬",T>0&&n.jsx("span",{children:T})]}):null;if(r.type==="user")return n.jsxs("div",{id:`scene-${S}`,"data-scene-index":S,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${k?"scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg":w?"bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm":"bg-terminal-surface border-terminal-border-subtle shadow-sm"}`,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[A,n.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"}),r.timestamp&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Us(r.timestamp)}),n.jsx("div",{className:"flex-1"}),k?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green text-terminal-bg",children:"Jump Target"}):w&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green-subtle text-terminal-green border border-terminal-green/20",children:"Focused"}),r.turnNumber!==void 0&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),n.jsx("div",{className:"text-left",children:j.map(({scene:O,index:$})=>{const q=h?.getOverlays($)??[],ne=h?.getEffectiveContent($),de=h?.showOriginal.has($);return n.jsxs("div",{className:"scene-enter",children:[n.jsx(Ci,{scene:O,isActive:$===i,collapseTools:u.collapseAllTools,effectiveContent:ne??void 0}),q.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[q.map(oe=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:oe.source.type==="translate"?"Translated":oe.source.type==="tone"?"Softened":"Modified"},oe.id)),n.jsx("button",{onClick:()=>h?.toggleOriginal($),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:de?"Show modified":"Show original"}),n.jsx("button",{onClick:()=>h?.revertSceneOverlays($),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]})]},$)})})]});if(r.type==="compaction"){const O=j[0]?.scene;return!O||O.type!=="compaction-summary"?null:n.jsxs("div",{id:`scene-${S}`,"data-scene-index":S,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${k?"scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":w?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"bg-terminal-surface/50"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dim uppercase tracking-widest",children:"Context Compaction"}),r.timestamp&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Us(r.timestamp)})]}),n.jsx(xi,{content:O.content,isActive:S===i})]})}if(r.type==="context-injection"){const O=j[0]?.scene;if(!O||O.type!=="context-injection")return null;const $=O.injectionType||"system",q=$.startsWith("skill:")?`Skill: ${$.slice(6)}`:$.startsWith("command:")?`Command: ${$.slice(8)}`:$==="image"?"Image Injection":$==="local-command"?"Local Command":"System Context";return n.jsxs("div",{id:`scene-${S}`,"data-scene-index":S,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${k?"scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm":w?"bg-terminal-surface border-l-2 border-blue-500/40 shadow-layer-sm":"bg-terminal-surface/50"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-blue-400/80 uppercase tracking-widest",children:q}),r.timestamp&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Us(r.timestamp)})]}),n.jsx(xi,{content:O.content,isActive:S===i})]})}const R=u.hideThinking?j.filter(O=>O.scene.type!=="thinking"):j;if(R.length===0)return null;const D=u.hideThinking?r.scenes.filter(O=>O.scene.type!=="thinking"):r.scenes;return u.compactAssistant?n.jsx(O1,{allScenes:D,filteredScenes:R,firstIndex:S,currentIndex:i,groupHasCurrent:w,groupHasFocusedTarget:k,timestamp:r.timestamp,annotationCounts:g,onComment:f,overlayActions:h,turnDurationMs:r.turnNumber?x?.[r.turnNumber-1]?.durationMs:void 0}):n.jsxs("div",{id:`scene-${S}`,"data-scene-index":S,className:`relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${k?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":w?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),r.timestamp&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Us(r.timestamp)}),n.jsx("div",{className:"flex-1"}),k?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):w&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"}),r.turnNumber!==void 0&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),n.jsx("div",{className:"space-y-2",children:n.jsx(L1,{scenes:R,currentIndex:i,collapseTools:u.collapseAllTools,annotationCounts:g,onComment:f,overlayActions:h})})]})});function O1({allScenes:l,filteredScenes:r,firstIndex:i,currentIndex:o,groupHasCurrent:u,groupHasFocusedTarget:m,timestamp:p,annotationCounts:g,onComment:f,overlayActions:h,turnDurationMs:x}){const[v,C]=y.useState(!1);y.useEffect(()=>{const R=D=>{if(!u)return;const O=D.detail;O.action==="expand"?C(!0):O.action==="collapse"&&C(!1)};return window.addEventListener("vibe:toggle-expand",R),()=>window.removeEventListener("vibe:toggle-expand",R)},[u]);const j=y.useMemo(()=>{const R={},D=new Set;let O=0,$=0,q=0,ne=0;const de=[];for(const{scene:V}of l)if(V.type==="tool-call"){q++,V.toolName==="Agent"&&V.subAgent&&(ne++,de.includes(V.subAgent.agentType)||de.push(V.subAgent.agentType));const ue=hi(V.toolName);if(R[ue]=(R[ue]||0)+1,V.toolName==="Bash"&&V.input?.command){const me=V.input.command.trim().split(/[\s|;&]/)[0];me&&D.add(me)}}else V.type==="text-response"?O++:V.type==="thinking"&&$++;let oe;const I=l[0]?.scene.timestamp,te=l[l.length-1]?.scene.timestamp;if(I&&te){const V=Date.parse(te)-Date.parse(I);V>0&&(oe=V)}return{totalTools:q,toolBreakdown:R,responses:O,thinking:$,bashCommands:[...D],subAgentCalls:ne,subAgentTypes:de,turnDurationMs:oe}},[l]),w=y.useMemo(()=>{for(let R=l.length-1;R>=0;R--)if(l[R].scene.type==="text-response")return l[R];return null},[l]),k=y.useMemo(()=>{const R=["Read","Write","Edit","Bash","Glob","Grep","Agent"],D=Object.entries(j.toolBreakdown);return D.sort((O,$)=>{const q=R.indexOf(O[0]),ne=R.indexOf($[0]),de=q>=0?q:100,oe=ne>=0?ne:100;return de-oe}),D},[j.toolBreakdown]),S=y.useMemo(()=>g?l.reduce((R,{index:D})=>R+(g.get(D)||0),0):0,[l,g]),[T,A]=y.useState(!1);return n.jsxs("div",{id:`scene-${i}`,"data-scene-index":i,className:`group relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${m?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":u?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:[f&&(S>0||T)&&!v&&n.jsxs("button",{onClick:R=>{R.stopPropagation(),f(i)},className:`absolute right-3 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${S>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:S>0?`${S} comment${S>1?"s":""}`:"Add comment",children:["💬",S>0&&n.jsx("span",{children:S})]}),n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),p&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Us(p)}),(x||j.turnDurationMs)&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["· ",vt(x??j.turnDurationMs)]}),n.jsx("div",{className:"flex-1"}),m?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):u&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[j.responses>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[j.responses," response",j.responses>1?"s":""]}),j.totalTools>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[j.totalTools," tool",j.totalTools>1?"s":""]}),j.subAgentCalls>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300",children:[j.subAgentCalls," agent",j.subAgentCalls>1?"s":"",j.subAgentTypes.length>0&&n.jsxs("span",{className:"opacity-70 text-[10px]",children:["(",j.subAgentTypes.join(", "),")"]})]}),j.thinking>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple",children:[j.thinking," thinking"]}),k.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),k.map(([R,D])=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange",children:R}),R==="Bash"&&j.bashCommands.length>0&&n.jsxs("span",{className:"text-terminal-dimmer",children:["(",j.bashCommands.slice(0,4).join(", "),j.bashCommands.length>4?", ...":"",")"]}),n.jsx("span",{children:D})]},R))]})]}),w&&!v&&n.jsx("div",{className:"mb-2",children:n.jsx(fx,{content:h?.getEffectiveContent(w.index)??w.scene.content,isActive:w.index===o})}),v&&n.jsx("div",{className:"space-y-2 mb-2",children:r.map(({scene:R,index:D})=>{const O=g?.get(D)||0,$=R.type==="text-response"?h?.getEffectiveContent(D)??void 0:void 0;return n.jsxs("div",{"data-scene-index":D,className:`group/scene relative scene-enter ${f?"pr-7":""}`,children:[n.jsx(Ci,{scene:R,isActive:D===o,collapseTools:!1,effectiveContent:$}),f&&n.jsxs("button",{onClick:q=>{q.stopPropagation(),f(D)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${O>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:O>0?`${O} comment${O>1?"s":""}`:"Add comment",children:["💬",O>0&&n.jsx("span",{children:O})]})]},D)})}),n.jsxs("button",{onClick:()=>C(!v),className:"text-xs font-mono text-terminal-dim hover:text-terminal-blue transition-colors flex items-center gap-1.5",children:[u&&n.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:v?"[←]":"[→]"}),n.jsx("span",{children:v?"Collapse":"Show all details"})]})]})}function L1({scenes:l,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u,overlayActions:m}){const p=[];let g=[];for(const f of l){const h=g[g.length-1];h&&h.scene.type==="tool-call"&&f.scene.type==="tool-call"&&h.scene.toolName===f.scene.toolName&&!f.scene.diff&&!f.scene.bashOutput&&!h.scene.diff&&!h.scene.bashOutput?g.push(f):(g.length>0&&p.push(g),g=[f])}return g.length>0&&p.push(g),n.jsx(n.Fragment,{children:p.map(f=>{if(f.length<=1){const{scene:x,index:v}=f[0],C=o?.get(v)||0,j=x.type==="text-response"?m?.getEffectiveContent(v):void 0,w=x.type==="text-response"?m?.getOverlays(v)??[]:[];return n.jsxs("div",{"data-scene-index":v,className:`group/scene relative scene-enter ${u?"pr-7":""}`,children:[n.jsx(Ci,{scene:x,isActive:v===r,collapseTools:i,effectiveContent:j??void 0}),w.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[w.map(k=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:k.source.type==="translate"?"Translated":k.source.type==="tone"?"Softened":"Modified"},k.id)),n.jsx("button",{onClick:()=>m?.toggleOriginal(v),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:m?.showOriginal.has(v)?"Show modified":"Show original"}),n.jsx("button",{onClick:()=>m?.revertSceneOverlays(v),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]}),u&&n.jsxs("button",{onClick:k=>{k.stopPropagation(),u(v)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${C>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:C>0?`${C} comment${C>1?"s":""}`:"Add comment",children:["💬",C>0&&n.jsx("span",{children:C})]})]},v)}const h=f[0].scene.toolName;return n.jsx(z1,{batch:f,toolName:h,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u},f[0].index)})})}function z1({batch:l,toolName:r,currentIndex:i,collapseTools:o,annotationCounts:u,onComment:m}){const[p,g]=y.useState(!1),f=u?l.reduce((x,{index:v})=>x+(u.get(v)||0),0):0,h=l.map(({scene:x})=>x.type==="tool-call"?B1(x.toolName,x.input):"");return n.jsxs("div",{"data-scene-index":l[0].index,className:`group/batch relative ${m?"pr-7":""}`,children:[n.jsxs("button",{onClick:()=>g(!p),className:"w-full flex items-center gap-2 px-3.5 py-2.5 text-xs font-mono text-terminal-dim rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material cursor-pointer text-left shadow-layer-sm",children:[n.jsx("span",{className:`transition-transform text-xs ${p?"rotate-90":""}`,children:"▶"}),n.jsx("span",{className:"text-terminal-orange font-semibold",children:r}),n.jsxs("span",{className:"text-terminal-dimmer",children:[l.length," call",l.length>1?"s":""]}),!p&&n.jsxs("span",{className:"truncate text-terminal-dimmer ml-1",children:[h.filter(Boolean).slice(0,3).join(", "),h.filter(Boolean).length>3&&"..."]})]}),m&&!p&&n.jsxs("button",{onClick:x=>{x.stopPropagation(),m(l[0].index)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${f>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/batch:opacity-100"}`,title:f>0?`${f} comment${f>1?"s":""}`:"Add comment",children:["💬",f>0&&n.jsx("span",{children:f})]}),p&&n.jsx("div",{className:"mt-1 ml-4 space-y-2 pl-4",children:l.map(({scene:x,index:v})=>{const C=u?.get(v)||0;return n.jsxs("div",{"data-scene-index":v,className:`group/scene relative scene-enter ${m?"pr-7":""}`,children:[n.jsx(Ci,{scene:x,isActive:v===i,collapseTools:o}),m&&n.jsxs("button",{onClick:j=>{j.stopPropagation(),m(v)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${C>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:C>0?`${C} comment${C>1?"s":""}`:"Add comment",children:["💬",C>0&&n.jsx("span",{children:C})]})]},v)})})]})}function B1(l,r){switch(l){case"Read":return r.file_path||"";case"Glob":return r.pattern||"";case"Grep":return r.pattern||"";case"Agent":return r.description||"";default:return""}}const Ci=y.memo(function({scene:r,isActive:i,collapseTools:o,effectiveContent:u}){switch(r.type){case"user-prompt":return n.jsx(A1,{content:u??r.content,images:r.images,isActive:i});case"compaction-summary":return n.jsx(xi,{content:r.content,isActive:i});case"context-injection":return n.jsx(xi,{content:r.content,isActive:i});case"thinking":return n.jsx(sv,{content:r.content,isActive:i});case"text-response":return n.jsxs(n.Fragment,{children:[n.jsx(fx,{content:u??r.content,isActive:i}),r.isTruncated&&n.jsx("div",{className:"mt-1 text-[10px] font-mono text-terminal-orange/70 italic",children:"Response truncated (max_tokens reached)"})]});case"tool-call":return n.jsx(S1,{scene:r,isActive:i,forceCollapse:o})}}),$1=8;function qa(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function wh({title:l,color:r}){return n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("span",{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${r}`,children:l}),n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}function eu({text:l,label:r}){const[i,o]=y.useState(!1);return n.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(l),o(!0),setTimeout(()=>o(!1),2e3)},className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors px-1.5 py-0.5 rounded bg-terminal-surface hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Copy to clipboard",children:i?"Copied!":r||"Copy"})}function ri(l){try{const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}catch{return""}}function Qn(l,r=!1){const i=r?Math.round(l*.75):l;if(i<1024)return`${i} B`;const o=i/1024;return o<1024?`${o.toFixed(1)} KB`:`${(o/1024).toFixed(1)} MB`}function tu({label:l,path:r}){return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:l}),n.jsx("span",{className:"text-terminal-text truncate",children:r})]})}function U1({actions:l,viewerMode:r,readOnly:i,session:o}){const{hasUnsaved:u,canSaveHtml:m,downloadHtml:p,downloadJson:g,publishGist:f,exportHtml:h,exportGithub:x,htmlExporting:v,githubExporting:C}=l,j=r==="editor",[w,k]=y.useState(null),[S,T]=y.useState(null),[A,R]=y.useState(null),[D,O]=y.useState(null),[$,q]=y.useState(!1),[ne,de]=y.useState(null),[oe,I]=y.useState(!1),[te,V]=y.useState(null),[ue,me]=y.useState("preview"),[B,L]=y.useState("unlisted"),[P,se]=y.useState(!1),[X,E]=y.useState(!1),[_,F]=y.useState(null),[J,K]=y.useState(null),[pe,he]=y.useState(null),[ce,be]=y.useState(null),we=y.useRef(null),Le=y.useRef(null),He=y.useRef(null),Ve=y.useRef(null),et="https://vibe-replay.com",nt=j?"":et,Yt=y.useMemo(()=>{if(j)return"";try{return new URL(et).origin}catch{return""}},[j]),dt=y.useCallback((ee,le={})=>{const fe=`${nt}${ee}`;return fetch(fe,{...le,...j?{}:{credentials:"include"}})},[nt,j]);y.useEffect(()=>()=>{we.current&&(clearInterval(we.current),we.current=null),Le.current&&(clearTimeout(Le.current),Le.current=null),He.current&&(clearTimeout(He.current),He.current=null),Ve.current&&(window.removeEventListener("message",Ve.current),Ve.current=null)},[]);const at=y.useMemo(()=>o?new TextEncoder().encode(JSON.stringify(o)).byteLength:0,[o]),bn=10*1024*1024,dn=10*1024*1024,Rt=at>bn,Dt=at>dn,Ft=y.useCallback(()=>{j&&dt("/api/auth/get-session").then(ee=>ee.json()).then(ee=>{const le=!!ee?.session;R(le),le&&dt("/api/cloud-replays").then(fe=>fe.json()).then(fe=>{he(fe.storage?.used??null),be(fe.storage?.limit??null),o&&fetch(qa("/api/cloud-info")).then(ke=>ke.json()).then(ke=>{const Ne=ke?.cloud?.id,Re=Ne?(fe.replays||[]).find(ze=>ze.id===Ne):null,Je=Re||(fe.replays||[]).find(ze=>ze.storageType==="r2"&&ze.title===(o.meta.title||o.meta.slug));if(Je){const ze={id:Je.id,url:`${et}/r/${Je.id}`,expiresAt:Je.expiresAt||"",visibility:Je.visibility};K(ze),Je.visibility&&L(Je.visibility),Re||fetch(qa("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ze)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>R(!1))},[j,dt]);y.useEffect(()=>{j&&(f&&(Ft(),q(!0),fetch(qa("/api/gist-info")).then(ee=>ee.json()).then(ee=>{ee.gist&&O(ee.gist)}).catch(()=>{}).finally(()=>q(!1))),x&&fetch(qa("/api/export/github/status")).then(ee=>ee.json()).then(ee=>{ee.exists&&de({svgContent:ee.svgContent,markdown:ee.markdown,svgPath:ee.svgPath,mdPath:ee.mdPath,gifContent:ee.gifContent??null,gifPath:ee.gifPath??null,gifGeneratedAt:ee.gifGeneratedAt,svgGeneratedAt:ee.svgGeneratedAt,mdGeneratedAt:ee.mdGeneratedAt,replayUrl:ee.replayUrl})}).catch(()=>{}))},[j,f,x,dt,Ft]),y.useEffect(()=>{if(!j)return;const ee=()=>Ft();return window.addEventListener("vibe-auth-change",ee),()=>window.removeEventListener("vibe-auth-change",ee)},[j,Ft]);const Ge=y.useCallback(async()=>{if(o){se(!0),T(null);try{const ee=JSON.stringify(o),le=o.meta.title||o.meta.slug,fe=`${le.replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").slice(0,60)}.json`,ke=D?`/api/gists/${D.gistId}`:"/api/gists",Ne=await dt(ke,{method:D?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:fe,content:ee,description:`vibe-replay: ${le}`,public:!0})});if(!Ne.ok){const ze=(await Ne.json().catch(()=>({}))).error||"Gist publish failed";if(Ne.status===401)throw R(!1),new Error(ze);if(D&&(Ne.status===404||ze.includes("not found"))){O(null),fetch(qa("/api/gist-info"),{method:"DELETE"}).catch(()=>{}),T({type:"error",text:"Gist was deleted on GitHub. Click again to create a new one."});return}throw new Error(ze)}const Re=await Ne.json();O({gistId:Re.gistId,gistUrl:Re.gistUrl,viewerUrl:Re.viewerUrl,updatedAt:new Date().toISOString()}),T({type:"success",text:"Published!"})}catch(ee){T({type:"error",text:ee instanceof Error?ee.message:String(ee)})}finally{se(!1)}}},[o,D,dt]),Q=y.useCallback(async()=>{if(o){E(!0),F(null);try{const ee=J?.id,le=await dt("/api/cloud-replays",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replay:o,visibility:B})});if(!le.ok){const Ne=await le.json().catch(()=>({}));throw le.status===401&&R(!1),new Error(Ne.error||"Upload failed")}const fe=await le.json();ee&&ee!==fe.id&&await dt(`/api/cloud-replays/${ee}`,{method:"DELETE"}).catch(()=>{}),K(fe),F({type:"success",text:ee?"Updated!":"Shared!"}),fetch(qa("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...fe,visibility:B})}).catch(()=>{});const ke=await dt("/api/cloud-replays").catch(()=>null);if(ke){const Ne=await ke.json().catch(()=>null);Ne?.storage&&(he(Ne.storage.used??null),be(Ne.storage.limit??null))}}catch(ee){F({type:"error",text:ee instanceof Error?ee.message:String(ee)})}finally{E(!1)}}},[o,B,J,dt]),ve=y.useCallback(async()=>{if(J?.id){E(!0),F(null);try{const ee=await dt(`/api/cloud-replays/${J.id}`,{method:"DELETE"});if(!ee.ok){const le=await ee.json().catch(()=>({}));throw new Error(le.error||"Delete failed")}K(null),F({type:"success",text:"Removed from cloud"}),fetch(qa("/api/cloud-info"),{method:"DELETE"}).catch(()=>{}),dt("/api/cloud-replays").then(le=>le.json()).then(le=>{he(le.storage?.used??null),be(le.storage?.limit??null)}).catch(()=>{})}catch(ee){F({type:"error",text:ee instanceof Error?ee.message:String(ee)})}finally{E(!1)}}},[J,dt]),Ae=y.useCallback(async()=>{if(x){V(null),I(!0);try{const ee=await x();await navigator.clipboard.writeText(ee.markdown),de({svgContent:ee.svgContent,markdown:ee.markdown,svgPath:ee.svgPath,mdPath:ee.mdPath,gifContent:ee.gifContent??null,gifPath:ee.gifPath??null,gifGeneratedAt:ee.gifGeneratedAt,svgGeneratedAt:ee.svgGeneratedAt,mdGeneratedAt:ee.mdGeneratedAt,replayUrl:ee.replayUrl,warnings:ee.warnings})}catch(ee){V(ee instanceof Error?ee.message:String(ee))}finally{I(!1)}}},[x]),Te=y.useMemo(()=>{if(!ne?.markdown)return"";const ee=ne.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,"");return Uu(Fe.parse(ee))},[ne?.markdown]),$e=y.useMemo(()=>ne?.svgContent?Wy(ne.svgContent):"",[ne?.svgContent]);if(i)return n.jsx("div",{className:"p-6 text-center text-xs font-mono text-terminal-dim",children:"Export is not available in read-only mode"});const Ie="px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0";return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"p-6 max-w-3xl mx-auto",children:n.jsxs("div",{children:[o&&n.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[n.jsx("h2",{className:"text-sm font-mono font-semibold text-terminal-text truncate",children:o.meta.title||o.meta.slug}),o.meta.provider&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle",children:o.meta.provider})]}),u&&n.jsx("div",{className:"text-xs font-mono text-terminal-orange text-center mb-5 px-3 py-2 rounded-lg bg-terminal-orange-subtle border border-terminal-orange/20",children:"You have unsaved annotation changes"}),j&&n.jsxs("div",{id:"share",className:"mb-12",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx(wh,{title:"Share",color:"text-terminal-purple"}),at>0&&n.jsxs("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md ${at>dn?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,children:[Qn(at)," replay"]})]}),A===!1?n.jsx("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden",children:n.jsxs("div",{className:"p-6",children:[n.jsx("h3",{className:"text-lg font-sans font-semibold text-terminal-text mb-5",children:"Share your session — free"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[n.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("span",{className:"text-xs font-sans font-bold text-terminal-purple",children:"Cloud Share"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",children:"Private"})]}),n.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"20 MB free storage"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"7-day shareable link"]})]})]}),n.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("span",{className:"text-xs font-sans font-bold text-terminal-dim",children:"GitHub Gist"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),n.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"No storage limit"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Permanent — never expires"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Great for portfolios"]})]})]})]}),n.jsxs("button",{type:"button",onClick:async()=>{if(we.current&&(clearInterval(we.current),we.current=null),Le.current&&(clearTimeout(Le.current),Le.current=null),He.current&&(clearTimeout(He.current),He.current=null),Ve.current&&(window.removeEventListener("message",Ve.current),Ve.current=null),j){try{const le=await fetch("/api/auth/login",{method:"POST"}),fe=await le.json().catch(()=>null);le.ok&&fe?.url&&window.open(fe.url,"_blank")}catch{}we.current=setInterval(async()=>{try{(await(await fetch("/api/auth/get-session")).json())?.session&&(we.current&&(clearInterval(we.current),we.current=null),Le.current&&(clearTimeout(Le.current),Le.current=null),R(!0),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),Le.current=setTimeout(()=>{we.current&&(clearInterval(we.current),we.current=null),Le.current=null},300*1e3);return}window.open(`${et}/auth/login?callback=/auth/success`,"_blank");const ee=le=>{le.origin===Yt&&le.data?.type==="vibe-replay-auth"&&le.data.user&&(window.removeEventListener("message",ee),Ve.current=null,He.current&&(clearTimeout(He.current),He.current=null),R(!0),window.dispatchEvent(new Event("vibe-auth-change")))};Ve.current=ee,window.addEventListener("message",ee),He.current=setTimeout(()=>{window.removeEventListener("message",ee),He.current=null,Ve.current===ee&&(Ve.current=null)},300*1e3)},className:"group inline-flex items-center gap-2.5 px-6 py-3 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis text-terminal-green text-sm font-sans font-semibold transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md hover:-translate-y-0.5",children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor",className:"transition-transform group-hover:scale-110",children:n.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"Sign in with GitHub"]})]})}):A===!0?n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[n.jsx("div",{className:"flex items-center gap-2 mb-3",children:n.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-purple",children:"Cloud Share"})}),n.jsx("div",{className:"flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3",children:[{value:"private",label:"Private",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},{value:"unlisted",label:"Link only",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})},{value:"public",label:"Public",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),n.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}].map(({value:ee,label:le,icon:fe})=>n.jsxs("button",{onClick:()=>L(ee),className:`h-full flex-1 px-2.5 text-[11px] font-mono transition-colors flex items-center justify-center gap-1.5 whitespace-nowrap ${B===ee?"bg-terminal-purple-subtle text-terminal-purple":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[fe,le]},ee))}),pe!=null&&ce!=null&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5",children:[n.jsxs("span",{children:[Qn(pe)," used"]}),n.jsxs("span",{children:[Qn(ce)," total"]})]}),(()=>{const ee=pe/ce*100,le=!J&&at>0,fe=le?at/ce*100:0,ke=le&&pe+at>ce;return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-hover overflow-hidden",children:n.jsxs("div",{className:"h-full flex",children:[pe>0&&n.jsx("div",{className:"h-full bg-terminal-purple transition-all",style:{width:`${Math.max(ee,1)}%`}}),le&&n.jsx("div",{className:`h-full transition-all ${ke?"bg-terminal-orange":"bg-terminal-green"}`,style:{width:`${Math.max(Math.min(fe,100-ee),1)}%`}})]})}),le&&n.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-sm bg-terminal-purple"}),Qn(pe)," used"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-sm ${ke?"bg-terminal-orange":"bg-terminal-green"}`}),"+",Qn(at)," this upload"]})]})]})})()]}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1",children:[n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-terminal-orange",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Free tier links expire after 7 days"]}),Rt&&n.jsxs("p",{className:"text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",Qn(at)," — exceeds 10MB limit"]}),J&&n.jsxs("div",{className:"mt-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["expires ",new Date(`${J.expiresAt}Z`).toLocaleDateString()]})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsx("a",{href:`${et}/r/${J.id}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate",children:`${et}/r/${J.id}`}),n.jsx(eu,{text:`${et}/r/${J.id}`})]})]}),n.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[n.jsx("button",{onClick:Q,disabled:X||Rt,className:`${Ie} ${Rt?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":J?"bg-terminal-surface-hover text-terminal-purple hover:bg-terminal-purple-subtle border border-terminal-border":"bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]"}`,children:X?"Uploading...":Rt?"Too large":J?"Update":"Share to Cloud"}),J&&n.jsx("button",{onClick:ve,disabled:X,className:`${Ie} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:"Delete"}),_&&n.jsx("span",{className:`text-[11px] font-mono ${_.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:_.text})]})]}),j&&n.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-dim",children:"GitHub Gist"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),n.jsxs("ul",{className:"space-y-1.5 text-xs font-sans text-terminal-dim mb-auto",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Hosted on GitHub forever"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Doesn't use your storage"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-orange shrink-0",children:"!"}),"Visible to everyone on the internet"]})]}),Dt&&n.jsxs("p",{className:"text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",Qn(at)," — exceeds 10MB limit"]}),D&&n.jsxs("div",{className:"mt-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Published"]}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:ri(D.updatedAt)})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsx("a",{href:D.viewerUrl,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors truncate",children:D.viewerUrl}),n.jsx(eu,{text:D.viewerUrl})]})]}),$&&!D&&n.jsx("div",{className:"mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse",children:"Checking..."}),n.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[n.jsx("button",{onClick:Ge,disabled:P||Dt,className:`${Ie} ${Dt?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":"bg-terminal-surface-hover text-terminal-dim hover:bg-terminal-surface-2 border border-terminal-border"}`,children:P?"Publishing...":Dt?"Too large":D?"Update Gist":"Publish to Gist"}),S&&n.jsx("span",{className:`text-[11px] font-mono ${S.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:S.text}),D&&n.jsx("a",{href:D.gistUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] font-mono text-terminal-blue hover:text-terminal-text transition-colors",children:"Open on GitHub"})]})]})]}):n.jsx("div",{className:"text-[11px] font-mono text-terminal-dimmer animate-pulse p-2",children:"Checking login status..."})]}),n.jsxs("div",{id:"export",children:[n.jsx(wh,{title:"Export",color:"text-terminal-green"}),n.jsxs("div",{className:"space-y-4",children:[j&&x&&n.jsxs(n.Fragment,{children:[ne?.gifContent&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green",children:"Animated GIF"}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Works everywhere: GitHub PRs, issues, READMEs, Slack, Discord. Shows up to 8 turns."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[ne.gifGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:ri(ne.gifGeneratedAt)}),n.jsx("button",{onClick:Ae,disabled:oe||C,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-green transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:oe||C?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]})})]})]}),n.jsx("div",{className:"bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle",children:n.jsx("img",{src:`data:image/gif;base64,${ne.gifContent}`,alt:"Session preview GIF",className:"w-full h-auto block"})}),n.jsxs("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:[ne.gifPath&&n.jsx(tu,{label:"File",path:`${ne.gifPath} (${Qn(ne.gifContent?.length??0,!0)})`}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed pt-1",children:["Usage:"," ",n.jsx("span",{className:"text-terminal-text",children:""})]})]})]}),ne?.svgContent&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Animated SVG"}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:["Embed in READMEs, PRs, or anywhere that renders SVG. Shows up to"," ",$1," turns."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[ne.svgGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:ri(ne.svgGeneratedAt)}),n.jsx("button",{onClick:Ae,disabled:oe||C,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-orange transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:oe||C?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]})})]})]}),n.jsx("div",{className:"bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block",dangerouslySetInnerHTML:{__html:$e}}),n.jsxs("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:[n.jsx(tu,{label:"File",path:`${ne.svgPath} (${Qn(ne.svgContent?.length??0)})`}),ne.replayUrl&&n.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:"Link"}),n.jsx("a",{href:ne.replayUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:text-terminal-text transition-colors truncate",children:ne.replayUrl})]}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed pt-1",children:["Usage:"," ",n.jsx("span",{className:"text-terminal-text",children:""})]})]})]}),ne?.markdown&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Markdown Summary"}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Paste into GitHub PRs, issues, or README files."})]}),ne.mdGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer self-start mt-0.5",children:ri(ne.mdGeneratedAt)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(eu,{text:ne.markdown,label:"Copy MD"}),n.jsxs("div",{className:"flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle",children:[n.jsx("button",{onClick:()=>me("preview"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${ue==="preview"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Preview"}),n.jsx("button",{onClick:()=>me("source"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${ue==="source"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Source"})]})]})]}),n.jsx("div",{className:"p-4",children:ue==="preview"?n.jsx("div",{className:"prose-terminal text-xs leading-relaxed bg-terminal-bg rounded-lg border border-terminal-border-subtle p-4 overflow-x-auto",dangerouslySetInnerHTML:{__html:Te}}):n.jsx("pre",{className:"bg-terminal-bg rounded-lg border border-terminal-border-subtle p-3 text-[11px] font-mono text-terminal-dim leading-relaxed overflow-x-auto max-h-72 overflow-y-auto whitespace-pre-wrap",children:ne.markdown})}),n.jsx("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:n.jsx(tu,{label:"File",path:ne.mdPath})}),ne.warnings&&ne.warnings.length>0&&n.jsxs("div",{className:"mx-5 mb-4 text-[11px] font-mono text-terminal-orange px-3 py-2 rounded-lg bg-terminal-orange-subtle/50 border border-terminal-orange/10",children:[n.jsx("div",{className:"font-semibold mb-1",children:"Security warnings"}),ne.warnings.map((ee,le)=>n.jsx("div",{className:"text-terminal-dim",children:ee},le))]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Ae,disabled:oe||C,className:`${Ie} ${ne?"bg-terminal-surface-hover text-terminal-orange hover:bg-terminal-orange-subtle border border-terminal-border":"bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis border border-terminal-orange/20"}`,children:oe||C?"Generating...":ne?"Regenerate GIF + SVG + Markdown":"Generate GIF + SVG + Markdown"}),te&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-red",children:te}),!ne&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim",children:"For GitHub PRs, READMEs, websites, email, Slack, and more. Shows up to 8 turns."})]})]}),j&&h&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"HTML Replay"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Self-contained HTML file with zero external requests. Includes all scenes, metadata, and annotations. Share via email, Slack, or host on any static server."})]}),n.jsx("button",{onClick:async()=>{k(null);try{const ee=await h();k({type:"success",text:ee})}catch(ee){k({type:"error",text:ee instanceof Error?ee.message:String(ee)})}},disabled:v,className:`${Ie} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:v?"Exporting...":"Export HTML"})]}),w&&n.jsx("div",{className:`mt-3 text-[11px] font-mono ${w.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:w.type==="success"?n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0"}),"Saved to ",w.text]}):w.text})]}),!j&&m&&n.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"Save HTML"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Download a self-contained HTML replay file with your comments included."})]}),n.jsx("button",{onClick:p,className:`${Ie} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:"Download HTML"})]})}),n.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-blue mb-1",children:"JSON Data"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Raw replay data including all scenes, metadata, and annotations. Useful for backup, re-import, or programmatic analysis."})]}),n.jsx("button",{onClick:g,className:`${Ie} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:"Download JSON"})]})})]})]})]})})})}const H1=[{title:"Playback",items:[{key:"Space",label:"Play / Pause"},{key:"↑ / ↓",label:"Step Back / Forward"},{key:"Home",label:"Reset to Start"},{key:"End / e",label:"Jump to End"}]},{title:"Navigation",items:[{key:"n / p",label:"Next / Prev Turn"},{key:"← / →",label:"Collapse / Expand Item"}]},{title:"Global",items:[{key:"?",label:"Show Keyboard Shortcuts"},{key:"⌘ K",label:"Open Search"},{key:"Esc",label:"Close Modal / Search"}]}];function G1({open:l,onClose:r}){const i=y.useCallback(o=>{(o.key==="Escape"||o.key==="?")&&r()},[r]);return y.useEffect(()=>{if(l)return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[l,i]),l?n.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:r,children:n.jsxs("div",{className:"w-full max-w-lg bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden animate-in zoom-in-95 duration-200",onClick:o=>o.stopPropagation(),children:[n.jsxs("div",{className:"px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between",children:[n.jsx("h2",{className:"text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text",children:"Keyboard Shortcuts"}),n.jsx("button",{onClick:r,className:"text-terminal-dimmer hover:text-terminal-red transition-colors",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsx("div",{className:"px-6 py-4 grid grid-cols-1 gap-8",children:H1.map(o=>n.jsxs("div",{className:"space-y-3.5",children:[n.jsx("h3",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1",children:o.title}),n.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:o.items.map(u=>n.jsxs("div",{className:"flex items-center justify-between group",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:u.label}),n.jsx("kbd",{className:"min-w-[40px] px-2 py-1 flex items-center justify-center text-[11px] font-mono font-bold text-terminal-text bg-terminal-surface border border-terminal-border-subtle rounded-lg shadow-layer-sm",children:u.key})]},u.key))})]},o.title))}),n.jsx("div",{className:"px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle",children:n.jsxs("p",{className:"text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider",children:["Press ",n.jsx("span",{className:"text-terminal-text font-mono font-bold",children:"?"})," to toggle this menu anytime"]})})]})}):null}function q1(l){return l==="claude-code"?"Claude Code":l==="cursor"?"Cursor":l}function Y1({session:l,onStart:r,onViewInsights:i}){const{meta:o,scenes:u}=l,m=y.useMemo(()=>{const j=u.find(O=>O.type==="user-prompt");if(!j||j.type!=="user-prompt")return null;const w=j.content,k={};let S=0,T=0,A="",R=0;for(const O of u){if(O.type==="user-prompt"){if(R++,R>1)break;continue}if(R===1)if(O.type==="tool-call"){T++;const $=O.toolName.replace(/^mcp__.*__/,"");k[$]=(k[$]||0)+1}else O.type==="text-response"&&(S++,A=O.content)}const D=Object.entries(k).sort((O,$)=>$[1]-O[1]);return{prompt:w,responses:S,totalTools:T,toolEntries:D,lastResponse:A}},[u]),p=y.useMemo(()=>{const j=new Set;for(const w of u)w.type==="tool-call"&&w.diff&&j.add(w.diff.filePath);return j.size},[u]),g=vt(o.stats.durationMs),f=o.title||o.project,h=q1(o.provider),x=y.useMemo(()=>{const j=[];if(g&&j.push({value:g,label:"Duration",color:"text-terminal-text"}),j.push({value:String(o.stats.userPrompts),label:"Turns",color:"text-terminal-green"}),p>0&&j.push({value:String(p),label:"Files",color:"text-terminal-blue"}),o.stats.costEstimate!==void 0){const w=o.stats.costEstimate;j.push({value:`$${w<.01?w.toFixed(4):w.toFixed(2)}`,label:"Cost",color:"text-terminal-orange"})}return j.length<3&&o.stats.toolCalls>0&&j.push({value:String(o.stats.toolCalls),label:"Tool Calls",color:"text-terminal-orange"}),j},[g,p,o.stats]),v=y.useRef(!1),C=y.useRef(0);return y.useEffect(()=>{const j=S=>{v.current||S.deltaY>0&&(v.current=!0,r(!1))},w=S=>{C.current=S.touches[0].clientY},k=S=>{if(v.current)return;C.current-S.touches[0].clientY>15&&(v.current=!0,r(!1))};return window.addEventListener("wheel",j,{passive:!0}),window.addEventListener("touchstart",w,{passive:!0}),window.addEventListener("touchmove",k,{passive:!0}),()=>{window.removeEventListener("wheel",j),window.removeEventListener("touchstart",w),window.removeEventListener("touchmove",k)}},[r]),y.useEffect(()=>{const j=w=>{(w.key===" "||w.key==="Enter"||w.key==="ArrowDown"||w.key==="ArrowRight")&&(w.preventDefault(),r())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[r]),n.jsxs("div",{className:"flex-1 flex flex-col items-center overflow-y-auto relative",children:[n.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent"}),n.jsx("div",{className:"absolute inset-0 bg-dot-grid"})]}),n.jsx("div",{className:"flex-1 min-h-4 md:min-h-0"}),n.jsxs("div",{className:"max-w-2xl w-full px-6 md:px-8 pt-4 md:pt-0 text-center space-y-5 md:space-y-7 z-10 shrink-0",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-sans font-bold text-terminal-text leading-[1.15] tracking-tight",children:f}),n.jsxs("p",{className:"text-sm font-sans text-terminal-dim",children:["A ",h," session replay by ",n.jsx("a",{href:"https://vibe-replay.com",target:"_blank",rel:"noopener noreferrer",className:"font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"})]}),(o.gitBranch||o.model)&&n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-2",children:[o.gitBranch&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple/10 border border-terminal-purple/20",title:o.gitBranches?o.gitBranches.join(" → "):o.gitBranch,children:o.gitBranches&&o.gitBranches.length>1?`${o.gitBranches[0]} → ${o.gitBranch}`:o.gitBranch}),o.model&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim px-2 py-0.5 rounded-full bg-terminal-surface border border-terminal-border-subtle",children:o.model}),o.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-orange px-2 py-0.5 rounded-full bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]})]}),m&&n.jsxs("button",{type:"button",onClick:()=>r(),className:"w-full text-left appearance-none bg-transparent border-none p-0 cursor-pointer space-y-3",children:[n.jsxs("div",{className:"rounded-2xl px-5 py-4 ml-4 md:ml-12 bg-terminal-green-subtle border border-terminal-green/30 shadow-layer-sm hover:bg-terminal-green-emphasis transition-all duration-200 ease-material",children:[n.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"})}),n.jsx("div",{className:"text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3",children:m.prompt})]}),n.jsxs("div",{className:"rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm",children:[n.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest",children:"Assistant"})}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[m.responses>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[m.responses," response",m.responses>1?"s":""]}),m.totalTools>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[m.totalTools," tool",m.totalTools>1?"s":""]}),m.toolEntries.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),m.toolEntries.map(([j,w])=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange",children:j}),n.jsx("span",{children:w})]},j))]})]}),m.lastResponse&&n.jsx("div",{className:"text-sm font-mono text-terminal-dim whitespace-pre-wrap break-words line-clamp-2 leading-relaxed",children:m.lastResponse})]}),o.stats.userPrompts>1&&n.jsx("div",{className:"text-center",children:n.jsxs("span",{className:"text-[11px] font-sans text-terminal-dimmer",children:["and ",o.stats.userPrompts-1," more turn",o.stats.userPrompts-1!==1?"s":""," ","→"]})})]}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 max-w-lg mx-auto",children:x.map(j=>n.jsxs("div",{className:"bg-terminal-surface rounded-lg sm:rounded-xl px-2.5 py-2 sm:px-3 sm:py-3 shadow-layer-sm",children:[n.jsx("div",{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${j.color}`,children:j.value}),n.jsx("div",{className:"text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium",children:j.label})]},j.label))}),n.jsxs("div",{className:"hidden md:flex items-center justify-center gap-3 flex-wrap",children:[n.jsxs("button",{type:"button",onClick:()=>r(),className:"group inline-flex items-center gap-3 px-10 py-4 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis transition-all duration-200 ease-material shadow-layer-md hover:shadow-layer-lg hover:-translate-y-0.5 landing-pulse",children:[n.jsx("span",{className:"text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200",children:"▶"}),n.jsx("span",{className:"text-base font-sans font-semibold text-terminal-green tracking-wide",children:"Watch Replay"})]}),i&&n.jsxs("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-2 px-6 py-4 rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md border border-terminal-border/40 hover:border-terminal-border",children:[n.jsxs("svg",{"aria-hidden":"true",className:"w-4 h-4 text-terminal-blue group-hover:scale-110 transition-transform duration-200",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),n.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),n.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),n.jsx("span",{className:"text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide",children:"View Insights"})]})]}),n.jsx("div",{className:"h-24 md:hidden"})]}),n.jsxs("button",{type:"button",onClick:()=>r(!1),className:"hidden md:flex mt-8 md:mt-10 mb-6 z-10 shrink-0 flex-col items-center gap-2 group cursor-pointer",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:"or scroll down"}),n.jsx("svg",{"aria-hidden":"true",className:"w-6 h-6 text-terminal-green animate-bounce group-hover:scale-110 transition-transform",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M6 9l6 6 6-6"})})]}),n.jsx("div",{className:"flex-1 min-h-0"}),n.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-50 bg-terminal-bg border-t border-terminal-border-subtle safe-bottom",children:n.jsxs("div",{className:"flex items-center gap-3 mx-6 my-4",children:[n.jsxs("button",{type:"button",onClick:()=>r(),className:"flex-[2] inline-flex items-center justify-center gap-2.5 py-3.5 rounded-xl bg-terminal-green text-terminal-bg font-semibold shadow-lg shadow-terminal-green/20 transition-all",children:[n.jsx("span",{className:"text-base",children:"▶"}),n.jsx("span",{className:"text-sm font-sans",children:"Watch Replay"})]}),i&&n.jsxs("button",{type:"button",onClick:i,className:"flex-1 inline-flex items-center justify-center gap-2 py-3.5 rounded-xl bg-terminal-surface border border-terminal-border-subtle hover:border-terminal-border transition-all",children:[n.jsxs("svg",{"aria-hidden":"true",className:"w-3.5 h-3.5 text-terminal-blue",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),n.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),n.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-dim",children:"Insights"})]})]})})]})}function Nh({scenes:l,currentIndex:r,onSeek:i,overlayActions:o,turnStats:u}){const m=y.useMemo(()=>{const g=[];let f=null,h=0;return l.forEach((x,v)=>{if(x.type==="user-prompt"){f&&(f.endIndex=v-1,g.push(f)),h++;const j=o?.getEffectiveContent(v)??x.content;f={kind:"turn",turnNumber:h,promptIndex:v,prompt:j.replace(/\n/g," ").slice(0,120),toolCalls:0,toolNames:[],thinkingBlocks:0,textBlocks:0,subAgentCalls:0,endIndex:v}}else x.type==="compaction-summary"||x.type==="context-injection"?(f&&(f.endIndex=v-1,g.push(f),f=null),g.push({kind:x.type==="context-injection"?"injection":"compaction",promptIndex:v,preview:x.content.replace(/\n/g," ").slice(0,80)})):f&&(f.endIndex=v,x.type==="tool-call"?(f.toolCalls++,x.toolName==="Agent"&&x.subAgent&&f.subAgentCalls++,f.toolNames.includes(x.toolName)||f.toolNames.push(x.toolName)):x.type==="thinking"?f.thinkingBlocks++:x.type==="text-response"&&f.textBlocks++)}),f&&g.push(f),g},[l,o?.getEffectiveContent]),p=y.useMemo(()=>{for(let g=m.length-1;g>=0;g--)if(r>=m[g].promptIndex)return g;return-1},[m,r]);return n.jsx("div",{className:"flex flex-col gap-1 p-3.5 overflow-y-auto",children:m.map((g,f)=>{const h=f===p,x=f<p;if(g.kind==="compaction"||g.kind==="injection"){const v=g.kind==="injection"?"System context":"Context compacted",C=g.kind==="injection"?"⚡":"⟳";return n.jsx("button",{onClick:()=>i(g.promptIndex),className:`text-left px-3 py-2 rounded-lg transition-all duration-200 ease-material ${h?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"hover:bg-terminal-surface-hover text-terminal-dimmer hover:text-terminal-dim"}`,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0",children:C}),n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer italic truncate",children:v})]})},`c-${g.promptIndex}`)}return n.jsxs("button",{onClick:()=>i(g.promptIndex),className:`group text-left px-3 py-2.5 rounded-xl transition-all duration-200 ease-material ${h?"bg-terminal-green-subtle border-l-2 border-terminal-green shadow-layer-sm":x?"hover:bg-terminal-surface-hover text-terminal-dim hover:text-terminal-text":"hover:bg-terminal-surface-hover"}`,children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("span",{className:`text-xs font-mono font-semibold shrink-0 mt-px tabular-nums ${h?"text-terminal-green":"text-terminal-dim"}`,children:String(g.turnNumber).padStart(2,"0")}),n.jsx("span",{className:"text-sm font-mono leading-snug line-clamp-2 text-terminal-text",children:g.prompt})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1.5 ml-6 flex-wrap",children:[g.toolCalls>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[g.toolCalls," tool",g.toolCalls>1?"s":""]}),g.subAgentCalls>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-green-500/20 text-green-300",children:[g.subAgentCalls," agent",g.subAgentCalls>1?"s":""]}),g.textBlocks>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[g.textBlocks," resp"]}),g.thinkingBlocks>0&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-purple-subtle text-terminal-purple",children:"think"}),(()=>{const v=u?.[g.turnNumber-1];return v?.durationMs?n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:vt(v.durationMs)}):null})()]}),h&&g.toolNames.length>0&&n.jsx("div",{className:"mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate",children:g.toolNames.join(", ")})]},`t-${g.promptIndex}`)})})}function F1(l){switch(l.type){case"user-prompt":return l.content;case"compaction-summary":return l.content;case"context-injection":return l.content;case"thinking":return l.content;case"text-response":return l.content;case"tool-call":return[l.toolName,JSON.stringify(l.input),l.result||"",l.bashOutput?.command||"",l.bashOutput?.stdout||""].join(" ");default:return""}}function Z1(l,r){const i=l.toLowerCase().indexOf(r.toLowerCase());if(i===-1)return l.slice(0,120);const o=Math.max(0,i-40),u=Math.min(l.length,i+r.length+60);return(o>0?"...":"")+l.slice(o,u)+(u<l.length?"...":"")}const V1={"user-prompt":"User","compaction-summary":"Compaction","context-injection":"Injection",thinking:"Thinking","text-response":"Response","tool-call":"Tool"},Q1={"user-prompt":"text-terminal-green","compaction-summary":"text-terminal-dim","context-injection":"text-blue-400",thinking:"text-terminal-purple","text-response":"text-terminal-blue","tool-call":"text-terminal-orange"};function X1({scenes:l,open:r,onClose:i,onSeek:o}){const[u,m]=y.useState(""),[p,g]=y.useState(0),f=y.useRef(null),h=y.useRef(null);y.useEffect(()=>{r&&(m(""),g(0),setTimeout(()=>f.current?.focus(),50))},[r]);const x=y.useMemo(()=>{if(u.length<2)return[];const j=u.toLowerCase(),w=[];for(let k=0;k<l.length;k++){const S=l[k],T=F1(S);if(T.toLowerCase().includes(j)&&w.push({sceneIndex:k,type:S.type,snippet:Z1(T,u),toolName:S.type==="tool-call"?S.toolName:void 0}),w.length>=50)break}return w},[l,u]);y.useEffect(()=>g(0),[]),y.useEffect(()=>{if(!h.current)return;h.current.children[p]?.scrollIntoView({block:"nearest"})},[p]);const v=y.useCallback(j=>{const w=x[j];w&&(o(w.sceneIndex),i())},[x,o,i]),C=y.useCallback(j=>{j.key==="ArrowDown"?(j.preventDefault(),g(w=>Math.min(w+1,x.length-1))):j.key==="ArrowUp"?(j.preventDefault(),g(w=>Math.max(w-1,0))):j.key==="Enter"?(j.preventDefault(),v(p)):j.key==="Escape"&&i()},[x.length,p,v,i]);return r?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[8vh] sm:pt-[15vh]",onClick:i,children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),n.jsxs("div",{className:"relative w-full max-w-xl mx-3 sm:mx-0 bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden",onClick:j=>j.stopPropagation(),onKeyDown:C,children:[n.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle",children:[n.jsx("span",{className:"text-terminal-dim text-sm",children:"🔍"}),n.jsx("input",{ref:f,type:"text",value:u,onChange:j=>m(j.target.value),placeholder:"Search scenes...",className:"flex-1 bg-transparent text-sm font-sans font-medium text-terminal-text placeholder-terminal-dim outline-none"}),n.jsx("kbd",{className:"text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md",children:"ESC"})]}),n.jsx("div",{ref:h,className:"max-h-[50vh] overflow-y-auto",children:u.length<2?n.jsx("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:"Type at least 2 characters to search"}):x.length===0?n.jsxs("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:['No results for "',u,'"']}):x.map((j,w)=>n.jsxs("button",{onClick:()=>v(w),className:`w-full text-left px-4 py-2.5 flex items-start gap-3 transition-colors ${w===p?"bg-terminal-green/10":"hover:bg-terminal-surface/50"}`,children:[n.jsx("span",{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${Q1[j.type]||"text-terminal-dim"}`,children:j.toolName||V1[j.type]||j.type}),n.jsx("span",{className:"text-xs font-mono text-terminal-text line-clamp-2 break-words",children:I1(j.snippet,u)}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5",children:["#",j.sceneIndex]})]},j.sceneIndex))}),x.length>0&&n.jsxs("div",{className:"px-4 py-2 border-t border-terminal-border-subtle text-[10px] font-sans font-bold uppercase tracking-wider text-terminal-dimmer flex gap-4",children:[n.jsxs("span",{children:[x.length," result",x.length!==1?"s":""]}),n.jsx("span",{children:"↑↓ navigate"}),n.jsx("span",{children:"↵ select"})]})]})]}):null}function I1(l,r){if(!r)return l;const i=[],o=l.toLowerCase(),u=r.toLowerCase();let m=0,p=o.indexOf(u);for(;p!==-1;)p>m&&i.push(l.slice(m,p)),i.push(n.jsx("mark",{className:"bg-terminal-green/30 text-terminal-green rounded-sm px-0.5",children:l.slice(p,p+r.length)},p)),m=p+r.length,p=o.indexOf(u,m);return m<l.length&&i.push(l.slice(m)),i}function J1(l){const r=l.toLowerCase();return/\b(test|jest|vitest|pytest|cargo\s+test|mocha|spec)\b/.test(r)?"test":/\b(build|compile|tsc|webpack|vite\s+build|rollup)\b/.test(r)?"build":r.trimStart().startsWith("git ")?"git":/\b(lint|biome|eslint|prettier|format)\b/.test(r)?"lint":"other"}function K1(l){return l?{sqlite:"SQLite (store.db)","global-state":"SQLite (global state.vscdb)",jsonl:"JSONL transcript","jsonl+tools":"JSONL + agent-tools"}[l]||l:"unknown"}function vx(l,r){if(!l)return;if(!r||r.length<=1)return[l];const i=[...r],o=i.lastIndexOf(l);return o>=0&&o!==i.length-1&&(i.splice(o,1),i.push(l)),i}function P1(l,r){const i=vx(l,r);if(i)return i.length>1?`${i[0]} → ${i[i.length-1]}`:i[0]}function W1(l,r){return vx(l,r)?.join(" → ")}function jx(l){const[r,i]=y.useState(null),o=y.useRef(null),u=y.useCallback(p=>{const g=o.current;if(!g||l<=1)return;const f=g.getBoundingClientRect(),h=(p.clientX-f.left)/f.width,x=Math.round(h*(l-1));i(Math.max(0,Math.min(l-1,x)))},[l]),m=y.useCallback(()=>i(null),[]);return{hovered:r,ref:o,onMouseMove:u,onMouseLeave:m}}function ej({session:l}){const{meta:r,scenes:i}=l,o=y.useMemo(()=>$h(r),[r]),u=y.useMemo(()=>Wb(r),[r]),m=y.useMemo(()=>{const f=[];let h=0,x=0;const v=new Map,C=L=>{let P=v.get(L);return P||(P={path:L,editCount:0,readCount:0,linesAdded:0,linesRemoved:0,turnEdits:new Map},v.set(L,P)),P},j=new Map,w=new Map;let k=0,S=0,T=0,A=0,R=0,D=0;const O=[],$=()=>{if(f.length>0){const L=f[f.length-1];L.toolCount=h,L.errorCount=x}};for(let L=0;L<i.length;L++){const P=i[L];switch(P.type){case"user-prompt":{$(),h=0,x=0,T+=P.content.length;const se=P.content.split(`
|
|
154
|
-
`).find(
|
|
155
|
-
`).length:0,
|
|
156
|
-
`).length:0;
|
|
157
|
-
`).length:0,
|
|
158
|
-
`).length:0;J.linesAdded+=Math.max(0,he
|
|
159
|
-
`),className:"shrink-0"}),r.gitBranch&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-purple px-1.5 py-0.5 rounded bg-terminal-purple/10 border border-terminal-purple/20",title:W1(r.gitBranch,r.gitBranches),children:P1(r.gitBranch,r.gitBranches)}),r.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-orange px-1.5 py-0.5 rounded bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]}),o.length>0&&n.jsxs("div",{className:"rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-orange uppercase tracking-widest mb-1",children:"Data Quality"}),n.jsx("div",{className:"space-y-0.5",children:o.slice(0,4).map(f=>n.jsx("div",{className:"text-xs font-mono text-terminal-dim",children:f},f))})]}),(r.dataSource||r.dataSourceInfo)&&n.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Data Source"}),n.jsx("div",{className:"text-xs font-mono text-terminal-text",children:K1(r.dataSourceInfo?.primary||r.dataSource)}),r.dataSourceInfo?.sources&&r.dataSourceInfo.sources.length>0&&n.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.sources.map(f=>n.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[n.jsx("span",{className:"text-terminal-green",children:"source:"})," ",f]},f))}),r.dataSourceInfo?.supplements&&r.dataSourceInfo.supplements.length>0&&n.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.supplements.map(f=>n.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[n.jsx("span",{className:"text-terminal-purple",children:"supplement:"})," ",f]},f))})]}),r.provider==="cursor"&&r.cursorSidecars&&(r.cursorSidecars.requestContextCount||r.cursorSidecars.checkpointCount||r.cursorSidecars.hasWorkspaceRules)&&n.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Cursor Sidecars"}),n.jsxs("div",{className:"space-y-0.5 text-xs font-mono text-terminal-dim",children:[r.cursorSidecars.requestContextCount?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-green",children:"request context:"})," ",r.cursorSidecars.requestContextCount," sidecar",r.cursorSidecars.requestContextCount===1?"":"s"]}):null,r.cursorSidecars.hasWorkspaceRules?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-purple",children:"workspace rules:"})," included"]}):null,r.cursorSidecars.checkpointCount?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-orange",children:"checkpoint state:"})," ",r.cursorSidecars.checkpointCount," entr",r.cursorSidecars.checkpointCount===1?"y":"ies"]}):null]})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3",children:"Overview"}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsx(Dl,{label:"Turns",value:m.userPrompts,color:"text-terminal-green"}),n.jsx(Dl,{label:"Tool Calls",value:m.toolCalls,color:"text-terminal-orange"}),n.jsx(Dl,{label:"Files Modified",value:m.editedFiles.length,color:"text-terminal-blue"}),n.jsx(Dl,{label:"Scenes",value:m.totalScenes,color:"text-terminal-text"})]}),m.totalDelegatedTools>0&&n.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs font-mono text-terminal-dim bg-green-500/5 border border-green-500/15 rounded-lg px-3 py-2",children:[n.jsxs("span",{className:"text-green-300",children:["+",m.totalDelegatedTools," tools delegated"]}),n.jsxs("span",{className:"text-terminal-dimmer",children:["to ",m.subAgents.length," sub-agent",m.subAgents.length>1?"s":""]}),m.totalDelegatedTokens>0&&n.jsxs("span",{className:"text-terminal-dimmer",children:["(",m.totalDelegatedTokens>1e6?`${(m.totalDelegatedTokens/1e6).toFixed(1)}M`:`${(m.totalDelegatedTokens/1e3).toFixed(0)}K`," ","tokens, context-free)"]})]}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-3 text-xs font-mono text-terminal-dim",children:[r.model&&n.jsxs("div",{children:["Model: ",n.jsx("span",{className:"text-terminal-text font-semibold",children:r.model})]}),(m.durationMs||u.duration)&&n.jsxs("div",{children:["Duration:"," ",n.jsx("span",{className:"text-terminal-text",children:m.durationMs?vt(m.durationMs):"unavailable"}),u.duration&&n.jsx(wa,{title:u.duration,className:"ml-1"})]}),m.costEstimate!==void 0&&n.jsxs("div",{children:["Cost:"," ",n.jsxs("span",{className:"text-terminal-green",children:["$",m.costEstimate<.01?m.costEstimate.toFixed(4):m.costEstimate.toFixed(2)]}),n.jsx("span",{className:"text-terminal-dimmer",children:" (est.)"}),u.tokens&&n.jsx(wa,{title:u.tokens,className:"ml-1"})]}),m.tokenUsage?n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:["In:"," ",n.jsx("span",{className:"text-terminal-blue",children:Ot(m.tokenUsage.inputTokens)})," / ","Out:"," ",n.jsx("span",{className:"text-terminal-green",children:Ot(m.tokenUsage.outputTokens)})]}),n.jsxs("div",{children:["Cache:"," ",n.jsx("span",{className:"text-terminal-purple",children:Ot(m.tokenUsage.cacheReadTokens)})," ","read /"," ",n.jsx("span",{className:"text-terminal-orange",children:Ot(m.tokenUsage.cacheCreationTokens)})," ","created"]})]}):u.tokens&&n.jsxs("div",{children:["Tokens: ",n.jsx("span",{className:"text-terminal-text",children:"unavailable"}),n.jsx(wa,{title:u.tokens,className:"ml-1"})]}),!p&&u.turnStats&&n.jsxs("div",{children:["Turn Stats: ",n.jsx("span",{className:"text-terminal-text",children:"limited"}),n.jsx(wa,{title:u.turnStats,className:"ml-1"})]})]})]}),p&&n.jsxs("div",{className:"space-y-5",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Per-Turn Metrics"}),n.jsx(nj,{turnStats:r.stats.turnStats,costEstimate:r.stats.costEstimate,turnLabels:g}),n.jsx(lj,{turnStats:r.stats.turnStats,turnLabels:g}),m.turns.length>=2&&n.jsx(ij,{turns:m.turns,turnLabels:g}),r.stats.turnStats.some(f=>f.durationMs)&&n.jsx(sj,{turnStats:r.stats.turnStats,turnLabels:g})]}),r.tokenUsageByModel&&Object.keys(r.tokenUsageByModel).length>1&&n.jsx(rj,{tokenUsageByModel:r.tokenUsageByModel}),r.apiErrors&&r.apiErrors.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"API Issues"}),n.jsx("div",{className:"text-xs font-mono text-terminal-dim space-y-1",children:(()=>{const f=r.apiErrors,h=Math.max(0,...f.map(j=>j.retryAttempt||0)),x=f.some(j=>j.errorType==="overloaded_error"||j.statusCode===529),v=f.some(j=>j.errorType==="rate_limit_error"||j.statusCode===429),C=[];return x&&C.push("API was overloaded"),v&&C.push("hit rate limits"),C.length===0&&C.push("API errors occurred"),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-text",children:[C.join(" and ")," ",n.jsxs("span",{className:"text-terminal-red",children:[f.length," times"]})," during this session",h>1&&n.jsxs(n.Fragment,{children:[", with up to"," ",n.jsxs("span",{className:"text-terminal-orange",children:[h," retries"]})," in a row"]}),"."]}),n.jsx("div",{className:"text-terminal-dimmer",children:h>0?"Cursor automatically retried some of these errors.":"These errors were observed in local Cursor metadata."})]})})()})]}),r.trackedFiles&&r.trackedFiles.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Files Tracked (",r.trackedFiles.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.trackedFiles.map(f=>n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.contextFiles&&r.contextFiles.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Context Files (inferred, ",r.contextFiles.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.contextFiles.map(f=>n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.prLinks&&r.prLinks.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Pull Requests"}),n.jsx("div",{className:"space-y-1",children:r.prLinks.map(f=>n.jsxs("a",{href:f.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs font-mono text-terminal-blue hover:underline px-2 py-1 rounded hover:bg-terminal-surface-hover transition-colors",children:[n.jsxs("span",{className:"text-terminal-green",children:["#",f.prNumber]}),f.prRepository&&n.jsx("span",{className:"text-terminal-dimmer truncate",children:f.prRepository})]},f.prUrl))})]}),m.turns.length>0&&n.jsx(cj,{turns:m.turns,turnStats:r.stats.turnStats}),n.jsx(oj,{editedFiles:m.editedFiles,turns:m.turns}),(m.editedFiles.length>0||m.readOnlyFiles.length>0)&&n.jsx(dj,{editedFiles:m.editedFiles,readOnlyFiles:m.readOnlyFiles}),m.bashCats.length>1&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Bash Commands",m.totalBashErrors>0&&n.jsxs("span",{className:"text-terminal-red ml-2 normal-case tracking-normal",children:[m.totalBashErrors," error",m.totalBashErrors!==1?"s":""]})]}),n.jsx("div",{className:"flex flex-wrap gap-2",children:m.bashCats.map(([f,h])=>n.jsxs("span",{className:"text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1",children:[f," ",n.jsx("span",{className:"text-terminal-text tabular-nums",children:h})]},f))})]}),m.topTools.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Top Tools"}),n.jsx("div",{className:"space-y-1.5",children:m.topTools.map(([f,h])=>n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right truncate",title:f,children:f}),n.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-terminal-orange",style:{width:`${h/m.topTools[0][1]*100}%`}})}),n.jsx("span",{className:"text-terminal-dim shrink-0 w-6 text-right tabular-nums",children:h})]},f))})]}),m.subAgents.length>0&&n.jsx(tj,{subAgents:m.subAgents}),m.totalTools>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Activity Distribution"}),n.jsx("div",{className:"space-y-1.5",children:[["Read/Search",m.activityDist.read,"--blue"],["Write/Edit",m.activityDist.write,"--green"],["Execute",m.activityDist.execute,"--purple"],["Other",m.activityDist.other,"--dim"]].filter(([,f])=>f>0).map(([f,h,x])=>n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right",children:f}),n.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${h/m.totalTools*100}%`,backgroundColor:`var(${x})`}})}),n.jsxs("span",{className:"text-terminal-dim shrink-0 w-16 text-right tabular-nums",children:[h," (",Math.round(h/m.totalTools*100),"%)"]})]},f))})]})]})})}const kh={Explore:"bg-blue-500/20 text-blue-300 border-blue-500/30",Plan:"bg-purple-500/20 text-purple-300 border-purple-500/30",Shell:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30","general-purpose":"bg-green-500/20 text-green-300 border-green-500/30","claude-code-guide":"bg-amber-500/20 text-amber-300 border-amber-500/30"};function tj({subAgents:l}){const r=new Map;let i=0,o=0;for(const m of l){const p=r.get(m.agentType)||{count:0,toolCalls:0,totalTokens:0};p.count++,p.toolCalls+=m.toolCalls,p.totalTokens+=m.totalTokens,r.set(m.agentType,p),i+=m.toolCalls,o+=m.totalTokens}const u=[...r.entries()].sort((m,p)=>p[1].count-m[1].count);return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Sub-Agents (",l.length,")"]}),n.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:u.map(([m,p])=>{const g=kh[m]||"bg-gray-500/20 text-gray-300 border-gray-500/30";return n.jsxs("span",{className:`text-[11px] px-2 py-1 rounded border font-mono ${g}`,children:[m," ",n.jsxs("span",{className:"opacity-70",children:["x",p.count," (",p.toolCalls," tools)"]})]},m)})}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim",children:[n.jsxs("div",{children:["Delegated tools: ",n.jsx("span",{className:"text-terminal-text",children:i})]}),o>0&&n.jsxs("div",{children:["Delegated tokens:"," ",n.jsx("span",{className:"text-terminal-text",children:o>1e6?`${(o/1e6).toFixed(1)}M`:o>1e3?`${(o/1e3).toFixed(0)}K`:o}),n.jsx("span",{className:"text-terminal-dimmer",children:" (context-free)"})]})]}),n.jsxs("div",{className:"mt-2 space-y-1",children:[l.slice(0,20).map((m,p)=>n.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-terminal-dim px-2 py-1 rounded bg-terminal-surface",children:[n.jsx("span",{className:`px-1 py-0.5 rounded border text-[9px] ${kh[m.agentType]||"bg-gray-500/20 text-gray-300 border-gray-500/30"}`,children:m.agentType}),n.jsx("span",{className:"truncate flex-1 text-terminal-text/70",children:m.description||"(no description)"}),n.jsxs("span",{className:"shrink-0",children:[m.toolCalls," tools"]}),m.totalTokens>0&&n.jsxs("span",{className:"shrink-0 text-terminal-dimmer",children:[m.totalTokens>1e3?`${(m.totalTokens/1e3).toFixed(0)}K`:m.totalTokens," ","tok"]})]},p)),l.length>20&&n.jsxs("div",{className:"text-[10px] text-terminal-dimmer font-mono px-2",children:["... and ",l.length-20," more"]})]})]})}function Ei({children:l,visible:r,x:i}){if(!r)return null;const o=i>.7;return n.jsx("div",{className:"absolute top-1 pointer-events-none z-10",style:{left:o?void 0:`${i*100}%`,right:o?`${(1-i)*100}%`:void 0},children:n.jsx("div",{className:`bg-terminal-surface border border-terminal-border-subtle rounded px-2 py-1 text-[10px] font-mono text-terminal-text shadow-md whitespace-nowrap ${o?"text-right":""}`,children:l})})}function nj({turnStats:l,costEstimate:r,turnLabels:i}){const o=[];let u=0;for(const k of l)u+=k.tokenUsage?.outputTokens||0,o.push(u);const m=o.length,{hovered:p,ref:g,onMouseMove:f,onMouseLeave:h}=jx(m);if(u===0)return null;const x=o[o.length-1],v=60,C=100,j=o.map((k,S)=>{const T=m===1?C/2:S/(m-1)*C,A=v-k/x*(v-6)-3;return`${T},${A}`}),w=p!==null?m===1?.5:p/(m-1):0;return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:["Token Burn",r?" & Cost":""]}),n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{ref:g,viewBox:`0 0 ${C} ${v}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:f,onMouseLeave:h,children:[n.jsx("polygon",{points:`0,${v} ${j.join(" ")} ${C},${v}`,style:{fill:"var(--green-subtle)"}}),n.jsx("polyline",{points:j.join(" "),fill:"none",style:{stroke:"var(--green)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),p!==null&&n.jsx("line",{x1:w*C,y1:"0",x2:w*C,y2:v,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),n.jsx(Ei,{visible:p!==null,x:w,children:p!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-green",children:["Turn ",p+1]}),i?.[p]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:i[p]}),n.jsxs("div",{children:["cumulative: ",Ot(o[p])," tokens"]}),l[p]?.tokenUsage&&n.jsxs("div",{className:"text-terminal-dimmer",children:["this turn: +",Ot(l[p].tokenUsage.outputTokens)," out"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:[Ot(x)," tokens",r?` ($${r<1?r.toFixed(2):r.toFixed(0)})`:""]}),n.jsxs("span",{children:["Turn ",m]})]}),l.some(k=>k.tokenUsage?.cacheReadTokens)&&n.jsx(aj,{turnStats:l})]})}function aj({turnStats:l}){const r=l.map(p=>{const g=p.tokenUsage;if(!g)return 0;const f=(g.cacheReadTokens||0)+(g.inputTokens||0);return f>0?g.cacheReadTokens/f:0}),i=24,o=100,u=r.map((p,g)=>{const f=r.length===1?o/2:g/(r.length-1)*o,h=i-p*(i-4)-2;return`${f},${h}`}),m=r.reduce((p,g)=>p+g,0)/r.length;return n.jsxs("div",{className:"mt-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Cache Hit Rate"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-purple",children:["avg ",Math.round(m*100),"%"]})]}),n.jsx("svg",{viewBox:`0 0 ${o} ${i}`,preserveAspectRatio:"none",className:"w-full h-6",children:n.jsx("polyline",{points:u.join(" "),fill:"none",style:{stroke:"var(--purple)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})})]})}function lj({turnStats:l,turnLabels:r}){const i=l.map(k=>k.contextTokens||0),o=i.length,{hovered:u,ref:m,onMouseMove:p,onMouseLeave:g}=jx(o);if(!i.some(k=>k>0))return null;const f=Math.max(...i),h=f,x=60,v=100,C=i.map((k,S)=>{const T=o===1?v/2:S/(o-1)*v,A=x-k/h*(x-6)-3;return`${T},${A}`}),j=[];for(let k=0;k<i.length-1;k++){const S=i[k],T=i[k+1];S>0&&T>0&&T<S*.5&&j.push(k)}const w=u!==null?o===1?.5:u/(o-1):0;return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Context Window Usage"}),n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{ref:m,viewBox:`0 0 ${v} ${x}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:p,onMouseLeave:g,children:[n.jsx("polygon",{points:`0,${x} ${C.join(" ")} ${v},${x}`,style:{fill:"var(--cyan-subtle)"}}),n.jsx("polyline",{points:C.join(" "),fill:"none",style:{stroke:"var(--cyan)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),j.map(k=>{const S=o===1?v/2:k/(o-1)*v;return n.jsx("line",{x1:S,y1:"0",x2:S,y2:x,style:{stroke:"var(--red)"},strokeWidth:"1",strokeDasharray:"2,1",vectorEffect:"non-scaling-stroke",opacity:"0.6"},k)}),u!==null&&n.jsx("line",{x1:w*v,y1:"0",x2:w*v,y2:x,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),n.jsx(Ei,{visible:u!==null,x:w,children:u!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-cyan",children:["Turn ",u+1]}),r?.[u]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),n.jsxs("div",{children:[Ot(i[u])," tokens"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["peak ",Ot(f)]}),n.jsxs("span",{children:["Turn ",o]})]}),j.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"inline-block w-3 border-t border-dashed",style:{borderColor:"var(--red)"}}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[j.length," compaction",j.length!==1?"s":""]})]})]})}function sj({turnStats:l,turnLabels:r}){const i=l.map(g=>g.durationMs||0),o=Math.max(...i,1),u=i.some(g=>g>0),[m,p]=y.useState(null);return u?n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Turn Duration"}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>p(null),children:i.map((g,f)=>{const h=g>0?Math.max(g/o*100,4):0;return n.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${h}%`,backgroundColor:g>0?"var(--blue)":"var(--surface)",opacity:m===f?1:g>0?.5+g/o*.5:.2},onMouseEnter:()=>p(f)},f)})}),n.jsx(Ei,{visible:m!==null,x:m!==null?i.length===1?.5:m/(i.length-1):0,children:m!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-blue",children:["Turn ",m+1]}),r?.[m]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[m]}),n.jsx("div",{children:i[m]>0?vt(i[m]):"no data"})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["max ",vt(o)]}),n.jsxs("span",{children:["Turn ",i.length]})]})]}):null}function rj({tokenUsageByModel:l}){const r=Object.entries(l).sort((u,m)=>m[1].outputTokens-u[1].outputTokens),i=r.reduce((u,[,m])=>u+m.outputTokens,0);if(i===0)return null;const o=["--green","--blue","--purple","--orange","--red"];return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Model Breakdown"}),n.jsx("div",{className:"flex h-3 rounded-full overflow-hidden gap-px",children:r.map(([u,m],p)=>{const g=m.outputTokens/i*100;return n.jsx("div",{style:{width:`${g}%`,minWidth:g>2?void 0:"3px",backgroundColor:`var(${o[p%o.length]})`,opacity:.7},title:`${u}: ${Ot(m.outputTokens)} output tokens`},u)})}),n.jsx("div",{className:"flex flex-wrap gap-3 mt-1.5",children:r.map(([u,m],p)=>n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer",children:[n.jsx("div",{className:"w-2 h-2 rounded-sm",style:{backgroundColor:`var(${o[p%o.length]})`,opacity:.7}}),n.jsxs("span",{children:[u," ",Ot(m.outputTokens)," (",Math.round(m.outputTokens/i*100),"%)"]})]},u))})]})}function ij({turns:l,turnLabels:r}){const i=l.map(p=>p.toolCount),o=Math.max(...i,1),[u,m]=y.useState(null);return l.length<2?null:n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Tool Calls per Turn"}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>m(null),children:i.map((p,g)=>{const f=p>0?Math.max(p/o*100,4):0;return n.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${f}%`,backgroundColor:p>0?"var(--orange)":"var(--surface)",opacity:u===g?1:p>0?.5+p/o*.5:.2},onMouseEnter:()=>m(g)},g)})}),n.jsx(Ei,{visible:u!==null,x:u!==null?i.length===1?.5:u/(i.length-1):0,children:u!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-orange",children:["Turn ",u+1]}),r?.[u]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),n.jsxs("div",{children:[i[u]," tool calls"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["max ",o]}),n.jsxs("span",{children:["Turn ",i.length]})]})]})}function oj({editedFiles:l,turns:r}){if(r.length<3||l.length<1)return null;const i=l.slice(0,8),o=60,u=r.map(f=>f.index),m=u.length>o,p=m?u.slice(-o):u;let g=1;for(const f of i)for(const h of p){const x=f.turnEdits.get(h)||0;x>g&&(g=x)}return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Activity Heatmap",m&&n.jsxs("span",{className:"normal-case tracking-normal font-normal ml-2",children:["(last ",o," of ",u.length," turns)"]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("div",{className:"grid gap-px text-[10px] font-mono",style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${p.length}, minmax(16px, 1fr))`},children:[n.jsx("div",{className:"text-terminal-dimmer px-1 py-0.5"}),p.map(f=>n.jsx("div",{className:"text-terminal-dimmer text-center py-0.5 text-[9px]",children:f},f)),i.map(f=>{const h=f.path.split("/").pop()||f.path;return[n.jsx("div",{className:"text-terminal-dim truncate px-1 py-0.5",title:f.path,children:h},`label-${f.path}`),...p.map(x=>{const v=f.turnEdits.get(x)||0,C=v===0?0:Math.round(20+Math.log1p(v)/Math.log1p(g)*60);return n.jsx("div",{className:"rounded-sm",style:{backgroundColor:v===0?"transparent":`color-mix(in srgb, var(--orange) ${C}%, transparent)`,minHeight:14},title:v>0?`${h} — Turn ${x}: ${v} edit${v!==1?"s":""}`:void 0},`${f.path}-${x}`)})]})]})})]})}const nu=20;function cj({turns:l,turnStats:r}){const[i,o]=y.useState(!1),{rows:u,compactionAfter:m}=y.useMemo(()=>{const j=Math.max(...l.map(R=>R.toolCount),1),w=Math.max(...r?.map(R=>R.durationMs||0)||[0],1),k=Math.max(...r?.map(R=>R.contextTokens||0)||[0],1),S=Math.max(...r?.map(R=>R.tokenUsage?.outputTokens||0)||[0],1),T=new Set;if(r)for(let R=0;R<r.length-1;R++){const D=r[R]?.contextTokens||0,O=r[R+1]?.contextTokens||0;D>0&&O>0&&O<D*.5&&T.add(R)}return{rows:l.map((R,D)=>{const O=r?.[D];return{...R,durationMs:O?.durationMs,contextTokens:O?.contextTokens,outputTokens:O?.tokenUsage?.outputTokens,toolRatio:R.toolCount/j,durationRatio:(O?.durationMs||0)/w,contextRatio:(O?.contextTokens||0)/k,outputRatio:(O?.tokenUsage?.outputTokens||0)/S}}),compactionAfter:T}},[l,r]),p=r&&r.length>0,g=p&&r.some(j=>j.durationMs),f=p&&r.some(j=>j.contextTokens),h=p&&r.some(j=>j.tokenUsage),x=3+(g?1:0)+(f?1:0)+(h?1:0),v=u.length>nu,C=v&&!i?u.slice(0,nu):u;return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Per-Turn Breakdown"}),n.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:n.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[n.jsx("th",{className:"px-2 py-1.5 font-semibold w-7",children:"#"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"Prompt"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Tools"}),g&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Duration"}),f&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Context"}),h&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Output"})]})}),n.jsx("tbody",{children:C.map((j,w)=>n.jsx(uj,{row:j,hasDuration:!!g,hasContext:!!f,hasTokens:!!h,colCount:x,showCompaction:m.has(w)},j.sceneIndex))}),v&&n.jsx("tfoot",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:x,children:n.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} turns (${u.length-nu} more)`})})})})]})})]})}function uj({row:l,hasDuration:r,hasContext:i,hasTokens:o,colCount:u,showCompaction:m}){return n.jsxs(n.Fragment,{children:[n.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("td",{className:"px-2 py-1 text-terminal-green tabular-nums",children:String(l.index).padStart(2,"0")}),n.jsx("td",{className:"px-2 py-1 text-terminal-text max-w-0",children:n.jsxs("div",{className:"truncate",title:l.text,children:[l.text,l.errorCount>0&&n.jsxs("span",{className:"text-terminal-red ml-1.5",children:[l.errorCount," err"]})]})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(_l,{value:l.toolCount,ratio:l.toolRatio,color:"--orange"})}),r&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(_l,{value:l.durationMs?vt(l.durationMs):"—",ratio:l.durationRatio,color:"--blue"})}),i&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(_l,{value:l.contextTokens?Ot(l.contextTokens):"—",ratio:l.contextRatio,color:"--cyan"})}),o&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(_l,{value:l.outputTokens?Ot(l.outputTokens):"—",ratio:l.outputRatio,color:"--green"})})]}),m&&n.jsx("tr",{children:n.jsx("td",{colSpan:u,className:"px-0 py-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5",children:[n.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-red/70 shrink-0",children:"context compacted"}),n.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"})]})})})]})}function _l({value:l,ratio:r,color:i}){return n.jsx("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm text-terminal-text",style:{backgroundColor:r>0?`color-mix(in srgb, var(${i}) ${Math.round(r*40)}%, transparent)`:void 0},children:l})}const au=20;function dj({editedFiles:l,readOnlyFiles:r}){const[i,o]=y.useState(!1),u=y.useMemo(()=>[...l,...r],[l,r]),m=y.useMemo(()=>Math.max(...u.map(j=>j.editCount),1),[u]),p=y.useMemo(()=>Math.max(...u.map(j=>j.readCount),1),[u]),g=y.useMemo(()=>Math.max(...u.map(j=>j.linesAdded+j.linesRemoved),1),[u]),f=u.some(j=>j.linesAdded>0||j.linesRemoved>0),h=u.some(j=>j.turnEdits.size>0),x=u.length>au,v=x&&!i?u.slice(0,au):u,C=3+(f?1:0)+(h?1:0);return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Impact",n.jsxs("span",{className:"normal-case tracking-normal ml-1.5",children:["(",l.length," modified",r.length>0&&`, ${r.length} read-only`,")"]})]}),n.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:n.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[n.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"File"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Edits"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Reads"}),f&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-20",children:"+/−"}),h&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Turns"})]})}),n.jsx("tbody",{children:v.map(j=>{const w=j.path.split("/").pop()||j.path,k=j.editCount>0;return n.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("td",{className:"px-2 py-1 max-w-0",children:n.jsxs("div",{className:`truncate ${k?"text-terminal-text":"text-terminal-dimmer"}`,title:j.path,children:[w,j.editCount>=10&&n.jsx("span",{className:"text-terminal-red ml-1",title:`${j.editCount} edits — high churn file`,children:"⚠"}),n.jsx("span",{className:"text-terminal-dimmer ml-1",children:j.path.slice(0,j.path.length-w.length-1)})]})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.editCount>0?n.jsx(_l,{value:j.editCount,ratio:j.editCount/m,color:"--orange"}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.readCount>0?n.jsx(_l,{value:j.readCount,ratio:j.readCount/p,color:"--blue"}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),f&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.linesAdded>0||j.linesRemoved>0?n.jsxs("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm",style:{backgroundColor:`color-mix(in srgb, var(--green) ${Math.round((j.linesAdded+j.linesRemoved)/g*30)}%, transparent)`},children:[n.jsxs("span",{className:"text-terminal-green",children:["+",j.linesAdded]}),n.jsx("span",{className:"text-terminal-dimmer",children:"/"}),n.jsxs("span",{className:"text-terminal-red",children:["−",j.linesRemoved]})]}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),h&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.turnEdits.size>0?n.jsx("span",{className:"text-terminal-dim",children:j.turnEdits.size}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})})]},j.path)})}),x&&n.jsx("tfoot",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:C,children:n.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} files (${u.length-au} more)`})})})})]})})]})}function mj(l){switch(l){case"user-prompt":return"#3fb950";case"compaction-summary":return"#666666";case"context-injection":return"#4488cc";case"thinking":return"#b392f0";case"text-response":return"#79b8ff";case"tool-call":return"#d29922"}}function fj({scenes:l,currentIndex:r,onSeek:i,annotatedScenes:o}){const u=y.useMemo(()=>{if(l.length<=200)return l.map((C,j)=>({startIndex:j,endIndex:j,type:C.type}));const x=l.length/200,v=[];for(let C=0;C<200;C++){const j=Math.floor(C*x),w=Math.floor((C+1)*x)-1,k={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1};let S=l[j].type,T=k[S];for(let A=j+1;A<=w&&A<l.length;A++){const R=k[l[A].type];R>T&&(S=l[A].type,T=R)}v.push({startIndex:j,endIndex:w,type:S})}return v},[l]),m=l.length>0?(r+1)/l.length*100:0,p=y.useRef(null),g=y.useCallback(h=>{const x=p.current;if(!x)return;const v=x.getBoundingClientRect(),C=h.clientX-v.left,j=Math.max(0,Math.min(1,C/v.width)),w=Math.floor(j*l.length);i(w)},[l.length,i]),f=y.useMemo(()=>{if(!o||o.size===0)return[];const h=[];return o.forEach(x=>{x>=0&&x<l.length&&h.push((x+.5)/l.length*100)}),h},[o,l.length]);return l.length===0?null:n.jsxs("div",{className:"px-4 pt-3 pb-1 cursor-pointer",onClick:g,children:[f.length>0&&n.jsx("div",{className:"relative h-2 mb-0.5",children:f.map((h,x)=>n.jsx("div",{className:"absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm",style:{left:`${h}%`,top:"50%",transform:"translate(-50%, -50%)"}},x))}),n.jsxs("div",{ref:p,className:"relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2",children:[u.map((h,x)=>n.jsx("div",{className:"flex-1 transition-opacity duration-150",style:{backgroundColor:mj(h.type),opacity:h.startIndex<=r?1:.15}},x)),n.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material",style:{left:`${m}%`}})]})]})}const pj=[{key:"replay",label:"Replay"},{key:"summary",label:"Insights"},{key:"export",label:"Share & Export"}],wx="vr-insights-seen";function hj(){try{return localStorage.getItem(wx)==="1"}catch{return!1}}function xj(){try{localStorage.setItem(wx,"1")}catch{}}function gj({activeView:l,onChangeView:r,className:i="",rightContent:o,hiddenTabs:u}){const[m,p]=y.useState(()=>hj()||l==="summary"),g=y.useCallback(f=>{f==="summary"&&!m&&(xj(),p(!0)),r(f)},[r,m]);return n.jsxs("div",{className:`flex items-center justify-between border-b border-terminal-border-subtle bg-terminal-bg shrink-0 overflow-x-auto ${i}`,children:[n.jsx("div",{className:"flex bg-terminal-surface/30",children:pj.filter(f=>!u?.includes(f.key)).map(({key:f,label:h})=>n.jsxs("button",{onClick:()=>g(f),className:`relative px-4 py-2 text-[11px] font-sans font-semibold uppercase tracking-widest transition-colors ${l===f?"text-terminal-green border-b-2 border-terminal-green bg-terminal-surface/50":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[h,f==="summary"&&!m&&l!=="summary"&&n.jsxs("span",{className:"absolute top-1.5 right-1 flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-green"})]})]},f))}),o&&n.jsx("div",{className:"pr-4 py-1.5 flex items-center",children:o})]})}function bj(l){l.classList.remove("jump-target-flash"),l.offsetWidth,l.classList.add("jump-target-flash"),window.setTimeout(()=>{l.classList.remove("jump-target-flash")},900)}function yj({session:l,viewPrefs:r,viewerMode:i="embedded",activeView:o,setActiveView:u,returnToLandingRef:m}){const p=i==="readonly",[g,f]=y.useState(!1);y.useEffect(()=>{if(m)return m.current=()=>{f(!1),Ft(!1);const le=new URL(window.location.href);le.searchParams.has("s")&&(le.searchParams.delete("s"),window.history.replaceState({},"",le.toString()))},()=>{m.current=null}},[m]);const[h,x]=y.useState(void 0),[v,C]=y.useState(0),[j,w]=y.useState(!1),[k,S]=y.useState(!1),[T,A]=y.useState(null),[R,D]=y.useState(!0),O=I0(l,i),$=J0(l,i),{effectiveSession:q}=$,{annotations:ne}=O,de=W0(r),{state:oe,currentIndex:I,visibleCount:te,speed:V,play:ue,pause:me,togglePlayPause:B,seekTo:L,changeSpeed:P,totalScenes:se,userPromptIndices:X,computeNextIndex:E}=P0(l.scenes,de,g),_=y.useRef(null),[F,J]=y.useState("outline"),[K,pe]=y.useState(!1),[he,ce]=y.useState(!1),[be,we]=y.useState(!1),Le=y.useRef(null),He=y.useRef(null),Ve=y.useRef(!1),[et,nt]=y.useState(!1);y.useEffect(()=>{const le=fe=>{(fe.metaKey||fe.ctrlKey)&&fe.key==="k"?(fe.preventDefault(),pe(ke=>!ke)):fe.key==="/"?fe.target instanceof HTMLInputElement||fe.target instanceof HTMLTextAreaElement||(fe.preventDefault(),pe(!0)):fe.key==="?"?nt(ke=>!ke):fe.key==="Escape"&&(et?nt(!1):K&&pe(!1))};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[K,et]);const Yt=X.filter(le=>le<=I).length||0,dt=X.length,at=y.useMemo(()=>{const le=new URLSearchParams(window.location.search).get("s");if(le!==null){const fe=Number(le);if(Number.isFinite(fe)&&fe>=0&&fe<l.scenes.length)return fe}return X.length>=2?X[1]:Math.min(15,l.scenes.length-1)},[X,l.scenes.length]),bn=y.useCallback((le=!0)=>{f(!0),le?setTimeout(ue,300):setTimeout(()=>L(at),100)},[ue,L,at]),dn=y.useCallback(()=>u("summary"),[u]),Rt=y.useRef(r.displayMode);y.useEffect(()=>{Rt.current!==r.displayMode&&(Rt.current=r.displayMode,g||(f(!0),setTimeout(()=>L(at),100)))},[r.displayMode,g,L,at]);const[Dt,Ft]=y.useState(()=>new URLSearchParams(window.location.search).get("s")!==null);y.useEffect(()=>{!g&&o!=="replay"&&!Dt&&(f(!0),setTimeout(()=>L(at),100))},[o,g,at,L,Dt]);const Ge=y.useCallback(le=>{const fe=Math.max(0,Math.min(le,l.scenes.length-1));me(),Le.current=fe,C(ke=>ke+1),x(fe),He.current&&clearTimeout(He.current),He.current=setTimeout(()=>x(void 0),2500),L(fe)},[me,L,l.scenes.length]);y.useEffect(()=>{!g&&Dt&&(f(!0),setTimeout(()=>Ge(at),100))},[g,Dt,at,Ge]);const Q=y.useCallback(()=>{const le=X.find(fe=>fe>I);le!==void 0&&Ge(le)},[X,I,Ge]),ve=y.useCallback(()=>{const le=[...X].reverse().find(fe=>fe<I);le!==void 0&&Ge(le)},[X,I,Ge]),Ae=y.useRef(!1);y.useEffect(()=>{oe==="playing"&&we(!1)},[oe]),y.useEffect(()=>{if(!_.current||I<0||Le.current!==null)return;if(Ve.current){Ve.current=!1;return}const le=_.current;Ae.current=!0;const fe=Ne=>{const Re=l.scenes;if(Ne<0||Ne>=Re.length)return Ne;const Je=rt=>rt==="user-prompt"||rt==="compaction-summary"||rt==="context-injection";if(Je(Re[Ne].type))return Ne;let ze=Ne;for(;ze>0&&!Je(Re[ze-1].type);)ze--;return ze},ke=Ne=>{const Re=le.querySelector(`[data-scene-index="${Ne}"]`);if(Re)return Re;const Je=fe(Ne);return le.querySelector(`[data-scene-index="${Je}"]`)};requestAnimationFrame(()=>{const Ne=ke(I);if(Ne)if(oe==="playing")Ne.scrollIntoView({behavior:"smooth",block:"center"});else{const Re=le.getBoundingClientRect(),rt=Ne.getBoundingClientRect().top-Re.top+le.scrollTop-Re.height*.3;le.scrollTo({top:Math.max(0,rt),behavior:"smooth"})}else oe==="playing"&&le.scrollTo({top:le.scrollHeight,behavior:"smooth"});setTimeout(()=>{Ae.current=!1},400)})},[I,oe,l.scenes]),y.useEffect(()=>{const le=_.current;if(!le)return;const fe=()=>{Ae.current||(we(!0),oe==="playing"&&me())};return le.addEventListener("wheel",fe,{passive:!0}),le.addEventListener("touchmove",fe,{passive:!0}),()=>{le.removeEventListener("wheel",fe),le.removeEventListener("touchmove",fe)}},[oe,me]),y.useEffect(()=>{const le=_.current;if(!le)return;let fe=!1;const ke=()=>{if(oe!=="paused"||fe||I>=l.scenes.length-1||Ae.current||Le.current!==null)return;if(le.scrollHeight-le.scrollTop-le.clientHeight<80){fe=!0,Ve.current=!0;const mn=E(I);mn!==-1&&L(mn),setTimeout(()=>{fe=!1},150)}},Ne=rt=>{rt.deltaY>0&&ke()};let Re=0;const Je=rt=>{Re=rt.touches[0].clientY},ze=rt=>{Re-rt.changedTouches[0].clientY>20&&ke()};return le.addEventListener("scroll",ke,{passive:!0}),le.addEventListener("wheel",Ne,{passive:!0}),le.addEventListener("touchstart",Je,{passive:!0}),le.addEventListener("touchend",ze,{passive:!0}),()=>{le.removeEventListener("scroll",ke),le.removeEventListener("wheel",Ne),le.removeEventListener("touchstart",Je),le.removeEventListener("touchend",ze)}},[oe,I,l.scenes.length,L,E]),y.useEffect(()=>{const le=Le.current,fe=_.current;if(le===null||!fe||I!==le)return;let ke=!1,Ne=0;const Re=ze=>{const rt=fe.querySelector(`[data-scene-index="${ze}"]`);if(rt)return rt;const mn=Array.from(fe.querySelectorAll("[data-scene-index]"));let Jn=null,Tn=1/0;for(const yn of mn){const ka=yn.getAttribute("data-scene-index");if(!ka)continue;const Kn=parseInt(ka,10);if(Kn<=ze){const Ys=ze-Kn;Ys<Tn&&(Tn=Ys,Jn=yn)}}return Jn},Je=()=>{if(ke)return;const ze=Re(le);if(ze){Ae.current=!0;const rt=fe.getBoundingClientRect(),Tn=ze.getBoundingClientRect().top-rt.top+fe.scrollTop-rt.height*.3;fe.scrollTo({top:Math.max(0,Tn),behavior:"smooth"}),bj(ze),setTimeout(()=>{Ae.current=!1},450),Le.current=null;return}Ne+=1,Ne<30?setTimeout(Je,80):Le.current=null};return requestAnimationFrame(Je),()=>{ke=!0}},[I]),y.useEffect(()=>()=>{He.current&&clearTimeout(He.current)},[]);const Te=y.useRef(null);y.useEffect(()=>{if(I<0||!g)return;Te.current&&clearTimeout(Te.current);const le=oe==="playing"?500:0;return Te.current=setTimeout(()=>{const fe=new URL(window.location.href);fe.searchParams.set("s",String(I)),window.history.replaceState({},"",fe.toString())},le),()=>{Te.current&&clearTimeout(Te.current)}},[I,oe,g]);const $e=i==="editor",Ie=y.useMemo(()=>ne.some(le=>le.author==="vibe-feedback"),[ne]);if(!g&&o==="replay")return n.jsx(Y1,{session:q,onStart:bn,onViewInsights:dn});const{meta:ee}=l;return n.jsxs("div",{className:"flex flex-1 min-h-0 relative",children:[n.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[n.jsx(gj,{activeView:o,onChangeView:u,hiddenTabs:p?["export"]:void 0,rightContent:o==="replay"?n.jsxs("div",{className:"flex items-center gap-3",children:[$.overlayCount>0&&n.jsxs("button",{onClick:()=>$.toggleAllOriginals(),className:"hidden md:flex items-center gap-2 text-xs font-mono text-terminal-dim",title:$.showAllOriginals?"Showing originals — click to show modified":"Showing modified — click to show originals",children:[n.jsx("span",{children:$.showAllOriginals?"Original":"Modified"}),n.jsx("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 ${$.showAllOriginals?"bg-terminal-surface border border-terminal-border":"bg-terminal-purple brightness-75"}`,children:n.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform duration-200 ${$.showAllOriginals?"translate-x-[3px]":"translate-x-[17px]"}`})})]}),n.jsxs("button",{onClick:()=>w(!0),className:"hidden md:flex items-center gap-1.5 text-xs font-mono font-semibold text-terminal-text hover:text-terminal-green transition-colors",title:"Open comments",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:n.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),n.jsx("span",{children:"Comments"}),O.annotations.length>0&&n.jsx("span",{className:"ml-0.5 px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:O.annotations.length})]}),n.jsxs("button",{onClick:()=>w(!0),className:"md:hidden flex items-center gap-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Comments",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),O.annotations.length>0&&n.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:O.annotations.length})]}),$e&&n.jsxs("button",{onClick:()=>S(!0),className:"hidden md:flex pl-2 pr-3 py-1 text-[11px] font-mono rounded bg-[rgba(168,85,247,0.1)] hover:bg-[rgba(168,85,247,0.2)] border border-[rgba(168,85,247,0.3)] hover:border-[rgba(168,85,247,0.5)] text-terminal-purple transition-all items-center gap-1.5 relative overflow-hidden group shadow-sm",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000"}),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#c084fc]",children:n.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})}),n.jsx("span",{className:"font-semibold tracking-wide",children:"AI Studio"}),(Ie||$.overlayCount>0)&&n.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple"})]})]})]}):void 0}),n.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full",children:[o==="replay"&&n.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full relative",children:[R&&n.jsxs("div",{className:"hidden md:flex w-64 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-bg shadow-layer-sm",children:[n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[n.jsxs("div",{className:"px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Outline"}),n.jsx("button",{onClick:()=>D(!1),className:"p-1 rounded hover:bg-terminal-surface text-terminal-dimmer hover:text-terminal-text transition-colors",title:"Hide Sidebar",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),n.jsx("line",{x1:"9",x2:"9",y1:"3",y2:"21"})]})})]}),n.jsx(Nh,{scenes:l.scenes,currentIndex:I,onSeek:Ge,overlayActions:$,turnStats:l.meta.stats.turnStats})]}),n.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]",children:[n.jsx("div",{className:"px-3 py-2 border-b border-terminal-border-subtle",children:n.jsx("button",{onClick:()=>u("summary"),className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest hover:text-terminal-green transition-colors",title:"Open Insights view",children:"Stats"})}),n.jsxs("div",{className:"p-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsx(Dl,{label:"Turns",value:ee.stats.userPrompts,color:"text-terminal-green"}),n.jsx(Dl,{label:"Tools",value:ee.stats.toolCalls,color:"text-terminal-orange"})]}),n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim space-y-0.5",children:[ee.model&&n.jsx("div",{children:n.jsx("span",{className:"text-terminal-text",children:ee.model})}),ee.stats.durationMs&&n.jsxs("div",{children:[vt(ee.stats.durationMs),ee.stats.costEstimate!==void 0&&n.jsxs("span",{children:[" / ",n.jsxs("span",{className:"text-terminal-green",children:["$",ee.stats.costEstimate<.01?ee.stats.costEstimate.toFixed(4):ee.stats.costEstimate.toFixed(2)]})]})]}),ee.stats.tokenUsage&&n.jsxs("div",{children:[Ot(ee.stats.tokenUsage.inputTokens)," in /"," ",Ot(ee.stats.tokenUsage.outputTokens)," out"]})]})]})]})]}),n.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0 relative",children:[!R&&n.jsx("button",{onClick:()=>D(!0),className:"absolute left-0 top-1/2 -translate-y-1/2 z-20 group/expand px-1.5 py-4 bg-terminal-surface/80 backdrop-blur-md border border-l-0 border-terminal-border-subtle rounded-r-xl text-terminal-dim hover:text-terminal-green transition-all shadow-layer-md animate-in slide-in-from-left-2 duration-300",title:"Show Sidebar",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}),n.jsx("div",{ref:_,className:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain",children:n.jsx(R1,{scenes:l.scenes,visibleCount:te,currentIndex:I,effectivePrefs:de,focusIndex:h,annotatedScenes:O.annotatedScenes,annotationCounts:O.annotationCounts,onSeek:Ge,state:oe,overlayActions:$,turnStats:l.meta.stats.turnStats,onComment:p?void 0:le=>{w(!0),A(le)}})}),n.jsx(X1,{scenes:q.scenes,open:K,onClose:()=>pe(!1),onSeek:le=>{Ge(le),pe(!1)}})]})]}),o==="summary"&&n.jsx(ej,{session:q}),o==="export"&&n.jsx(U1,{actions:O,viewerMode:i,readOnly:p,session:q})]}),o==="replay"&&n.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle bg-terminal-surface/80 backdrop-blur-md sticky bottom-0 safe-bottom shadow-layer-lg",children:[n.jsx(fj,{scenes:l.scenes,currentIndex:I,onSeek:Ge,annotatedScenes:O.annotatedScenes}),n.jsx(av,{state:oe,speed:V,currentIndex:I,totalScenes:se,userPromptCount:dt,currentTurn:Yt,onTogglePlayPause:B,onChangeSpeed:P,onPrevPrompt:ve,onNextPrompt:Q,onOpenSearch:()=>pe(!0),onOpenOutline:()=>ce(!0),onShowHelp:()=>nt(!0)})]})]}),n.jsx(tv,{open:j,onClose:()=>w(!1),actions:O,scenes:q.scenes,currentIndex:I,onSeek:Ge,addingForScene:T,onClearAddingTarget:()=>A(null),readOnly:p}),n.jsx(iy,{open:k,onClose:()=>S(!1),annotationActions:O,overlayActions:$}),n.jsxs("div",{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${he?"opacity-100":"opacity-0 pointer-events-none"}`,onClick:()=>ce(!1),children:[n.jsx("div",{className:"absolute inset-0 bg-black/40"}),n.jsxs("div",{className:`absolute bottom-0 left-0 right-0 h-[65vh] bg-terminal-bg border-t border-terminal-border-subtle rounded-t-2xl flex flex-col transition-transform duration-300 ease-material-decel safe-bottom shadow-layer-xl ${he?"translate-y-0":"translate-y-full"}`,onClick:le=>le.stopPropagation(),children:[n.jsx("div",{className:"flex justify-center py-2.5 shrink-0",children:n.jsx("div",{className:"w-10 h-1 rounded-full bg-terminal-border"})}),n.jsxs("div",{className:"flex border-b border-terminal-border-subtle shrink-0",children:[n.jsx("button",{onClick:()=>J("outline"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${F==="outline"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:"Outline"}),n.jsxs("button",{onClick:()=>J("comments"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${F==="comments"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:["Comments",O.annotations.length>0&&n.jsxs("span",{className:"ml-1.5 text-terminal-dimmer",children:["(",O.annotations.length,")"]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:F==="outline"?n.jsx(Nh,{scenes:l.scenes,currentIndex:I,onSeek:le=>{Ge(le),ce(!1)},overlayActions:$,turnStats:l.meta.stats.turnStats}):n.jsx(mx,{actions:O,scenes:q.scenes,currentIndex:I,onSeek:le=>{Ge(le)},addingForScene:T,onClearAddingTarget:()=>A(null),readOnly:p})})]})]}),n.jsx(G1,{open:et,onClose:()=>nt(!1)})]})}function vj(){const[l,r]=y.useState({status:"loading"}),i=y.useCallback(()=>{r({status:"loading"}),wj().then(o=>{r(o==="dashboard"?{status:"dashboard"}:{status:"ready",session:o.session,mode:o.mode,gistOwner:o.gistOwner})},o=>r({status:"error",message:String(o.message||o)}))},[]);return y.useEffect(()=>{i();const o=()=>i();return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[i]),l}function jj(){return!!window.__VIBE_REPLAY_EDITOR__}async function wj(){if(window.__VIBE_REPLAY_DATA__)return{session:window.__VIBE_REPLAY_DATA__,mode:"embedded"};const l=new URLSearchParams(window.location.search),r=l.get("cloud");if(r){if(!/^[a-zA-Z0-9_-]{10,16}$/.test(r))throw new Error("Invalid cloud replay ID");const p=await fetch(`https://vibe-replay.com/api/cloud-replays/${r}`,{credentials:"include"});if(!p.ok)throw p.status===404?new Error("Replay not found"):p.status===410?new Error("This replay has expired"):new Error(`Failed to load replay: ${p.status}`);const g=await p.json();if(g.redirect&&g.gistId){const{rawUrl:f}=await Sh(g.gistId);return{session:await lu(f),mode:"readonly"}}return{session:g,mode:"readonly"}}const i=l.get("gist");if(i){if(!/^[a-f0-9]{20,40}$/.test(i))throw new Error("Invalid gist ID");const{rawUrl:m,owner:p}=await Sh(i),g=await lu(m);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${i}`,{method:"POST"}).catch(()=>{}),{session:g,mode:"readonly",gistOwner:p}}if(jj()){if(l.get("view")==="dashboard")return"dashboard";const m=l.get("session");if(m){const p=await fetch(`/api/session?slug=${encodeURIComponent(m)}`);if(!p.ok)throw new Error(`Session not found: ${m}`);return{session:await p.json(),mode:"editor"}}return"dashboard"}const o=l.get("url");if(o)return{session:await lu(o),mode:"readonly"};const u=l.get("file");if(u){const m=await fetch(u);if(!m.ok)throw new Error(`Failed to load file: ${m.status}`);return{session:await m.json(),mode:"embedded"}}return"dashboard"}async function lu(l){const r=await fetch(l);if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);const i=await r.text();if(i.trimStart().startsWith("{"))return JSON.parse(i);throw new Error("URL must point to a vibe-replay JSON replay file")}async function Sh(l){const r=await fetch(`https://api.github.com/gists/${l}`);if(!r.ok)throw new Error(`Gist not found: ${r.status}`);const i=await r.json(),o=i.files,u=Object.values(o).find(p=>p.filename.endsWith(".json"));if(!u)throw new Error("No JSON file found in gist");const m=i.owner?.login;return{rawUrl:u.raw_url,owner:m}}function Nj(){const[l,r]=y.useState(()=>{const u=new URLSearchParams(window.location.search).get("theme");if(u==="light"||u==="dark")return u;const m=localStorage.getItem("vibe-replay-theme");return m==="light"||m==="dark"?m:"dark"});y.useEffect(()=>{const o=document.documentElement;o.classList.add("theme-transition"),o.classList.toggle("dark",l==="dark"),o.classList.toggle("light",l==="light"),localStorage.setItem("vibe-replay-theme",l);const u=setTimeout(()=>o.classList.remove("theme-transition"),300);return()=>clearTimeout(u)},[l]);const i=y.useCallback(()=>{r(o=>o==="dark"?"light":"dark")},[]);return{theme:l,toggleTheme:i}}function Ch(){const r=new URLSearchParams(window.location.search).get("v");return r==="summary"||r==="export"?r:"replay"}const Bs="https://vibe-replay.com";function Eh({isEditor:l}){const[r,i]=y.useState(null),[o,u]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useRef(null);return y.useEffect(()=>{const f=l?"/api/auth/get-session":`${Bs}/api/auth/get-session`;let h="";if(!l)try{h=new URL(Bs).origin}catch{h=""}const x=l?{}:{credentials:"include"},v=()=>{fetch(f,x).then(j=>j.json()).then(j=>{j?.session?i({authenticated:!0,user:j.user||null}):i({authenticated:!1,user:null})}).catch(()=>i({authenticated:!1,user:null}))};v();const C=j=>{!l&&j.origin===h&&j.data?.type==="vibe-replay-auth"&&j.data.user&&(i({authenticated:!0,user:j.data.user}),window.dispatchEvent(new Event("vibe-auth-change")))};return window.addEventListener("message",C),window.addEventListener("focus",v),()=>{p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null),window.removeEventListener("message",C),window.removeEventListener("focus",v)}},[l]),y.useEffect(()=>{if(!o)return;const f=h=>{m.current&&!m.current.contains(h.target)&&u(!1)};return document.addEventListener("click",f),()=>document.removeEventListener("click",f)},[o]),r?r.authenticated?n.jsxs("div",{className:"relative",ref:m,children:[n.jsx("button",{type:"button",onClick:()=>u(!o),className:"flex items-center justify-center w-7 h-7 rounded-full ring-2 ring-terminal-border/40 hover:ring-terminal-green/60 transition-all cursor-pointer overflow-hidden",children:r.user?.image?n.jsx("img",{src:r.user.image,alt:"",className:"w-full h-full rounded-full object-cover"}):n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"?"})}),o&&n.jsxs("div",{className:"absolute right-0 top-full mt-2 min-w-[140px] bg-terminal-surface border border-terminal-border rounded-lg shadow-lg py-1 z-50",children:[n.jsx("div",{className:"px-3 py-2 text-[11px] text-terminal-dim border-b border-terminal-border truncate font-mono",children:r.user?.name||"logged in"}),n.jsx("button",{type:"button",onClick:async()=>{const f=l?"/api/auth/sign-out":`${Bs}/api/auth/sign-out`;await fetch(f,{method:"POST",...l?{}:{credentials:"include"}}),window.location.reload()},className:"w-full text-left px-3 py-2 text-xs text-terminal-dim hover:text-red-400 hover:bg-terminal-surface-hover transition-colors cursor-pointer font-mono",children:"Logout"})]})]}):n.jsxs("button",{type:"button",onClick:async()=>{if(l)try{const x=await fetch("/api/auth/login",{method:"POST"}),v=await x.json().catch(()=>null);x.ok&&v?.url&&window.open(v.url,"_blank")}catch{}else window.open(`${Bs}/auth/login?callback=/auth/success`,"_blank");p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null);const f=l?"/api/auth/get-session":`${Bs}/api/auth/get-session`,h=l?{}:{credentials:"include"};p.current=setInterval(async()=>{try{const v=await(await fetch(f,h)).json();v?.session&&(p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null),i({authenticated:!0,user:v.user||null}),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),g.current=setTimeout(()=>{p.current&&(clearInterval(p.current),p.current=null),g.current=null},300*1e3)},className:"inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md bg-[#24292f] hover:bg-[#32383f] text-white text-xs font-medium transition-colors cursor-pointer border border-white/10",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Sign in"]}):null}function su(){const[l,r]=y.useState(null);return y.useEffect(()=>{window.__VIBE_REPLAY_EDITOR__&&fetch("https://api.github.com/repos/tuo-lei/vibe-replay").then(i=>i.json()).then(i=>{i.stargazers_count!=null&&r(i.stargazers_count)}).catch(()=>{})},[]),n.jsxs("a",{href:"https://github.com/tuo-lei/vibe-replay",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center h-7 rounded-md border border-terminal-border text-xs font-medium text-terminal-text/70 hover:text-terminal-text hover:border-terminal-text/30 transition-colors",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 px-2",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z"})}),"Star"]}),l!=null&&n.jsx("span",{className:"inline-flex items-center px-2 h-full border-l border-terminal-border",children:l})]})}function kj(){const l=vj(),{theme:r,toggleTheme:i}=Nj(),{prefs:o,updatePref:u,togglePref:m}=ty(),p=l.status==="ready"?l.session:null,g=l.status==="ready"?l.mode:"embedded",f=l.status==="ready"?l.gistOwner:void 0,h=g==="editor",[x,v]=y.useState(Ch()),C=y.useRef(null);y.useEffect(()=>{const $=()=>v(Ch());return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[]);const j=$=>{v($),ht({v:$==="replay"?null:$})},w=y.useMemo(()=>p?.scenes.some($=>$.type==="thinking")??!1,[p]),[k,S]=y.useState(!1);y.useEffect(()=>{if(!k)return;const $=q=>{q.key==="Escape"&&S(!1)};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[k]);const[T,A]=y.useState(!1),R=y.useRef(null);y.useEffect(()=>{o.displayMode!=="custom"&&A(!1)},[o.displayMode]);const D=y.useCallback(()=>A(!1),[]);if(ku(R,D,T),l.status==="loading")return n.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-green font-sans font-bold text-sm animate-pulse",children:"LOADING SESSION..."}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Preparing replay data"})]})});if(l.status==="error")return n.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:l.message}),n.jsx("div",{className:"text-terminal-dim font-mono text-xs",children:"Use ?gist=<id> or ?url=<replay-json-url> or embed via CLI"})]})});if(l.status==="dashboard")return n.jsx("div",{className:"h-screen bg-terminal-bg flex flex-col overflow-hidden",children:n.jsx($0,{headerLeft:n.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[n.jsx("button",{onClick:()=>ht({view:null,session:null}),className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"}),n.jsxs("span",{className:"instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-terminal-green animate-pulse"}),"Local",n.jsx("span",{className:"instant-tooltip-text",children:`v0.1.4
|
|
149
|
+
`),p=u.added?"add":u.removed?"remove":"context";for(const g of m)o.push({type:p,content:g})}return o}function v1(l){const r=l.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rs:"rust",go:"go",rb:"ruby",java:"java",css:"css",html:"html",json:"json",md:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",zsh:"bash",bash:"bash"}[r]||"text"}const j1=y.memo(function({toolName:r,filePath:i,oldContent:o,newContent:u,isActive:m}){const p=y.useMemo(()=>y1(o,u),[o,u]),g=v1(i),f=y.useSyncExternalStore(g1,b1),x=!o,h=r==="Delete"&&!u;return n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-terminal-surface",children:[n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:r}),n.jsx("span",{className:"text-xs font-mono text-terminal-blue truncate",children:i}),x&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-terminal-green/20 text-terminal-green",children:"new"}),h&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-terminal-red/20 text-terminal-red",children:"deleted"})]}),n.jsx("div",{className:"overflow-x-auto max-h-[400px] overflow-y-auto",children:n.jsx(x1,{theme:f?ku.nightOwl:ku.nightOwlLight,code:p.map(v=>v.content).join(`
|
|
150
|
+
`),language:g,children:({tokens:v,getLineProps:C,getTokenProps:j})=>n.jsx("pre",{className:"text-xs font-mono !bg-transparent !m-0 p-0",children:v.map((w,S)=>{const k=p[S];if(!k)return null;const E=k.type==="add"?"bg-green-100 dark:bg-green-900/30":k.type==="remove"?"bg-red-100 dark:bg-red-900/30":"",M=k.type==="add"?"+":k.type==="remove"?"-":" ",A=k.type==="add"?"text-terminal-green":k.type==="remove"?"text-terminal-red":"text-terminal-dim";return n.jsxs("div",{...C({line:w}),className:`flex ${E} px-3 leading-5`,children:[n.jsx("span",{className:`select-none w-4 shrink-0 ${A}`,children:M}),n.jsx("span",{children:w.map((R,O)=>n.jsx("span",{...j({token:R})},O))})]},S)})})})})]})});function lu({ms:l}){if(!l)return null;const r=vt(l);return r?n.jsx("span",{className:"text-[10px] text-terminal-dimmer font-mono shrink-0",title:`Tool execution: ${r}`,children:r}):null}function su(l){if(l.startsWith("mcp__"))return"🔌";switch(l){case"Read":return"📄";case"Write":return"✏️";case"Edit":return"✂️";case"Delete":return"🗑️";case"Bash":return"$";case"Glob":return"🔍";case"Grep":return"🔎";case"Agent":return"🤖";default:return"⚙️"}}const w1={Explore:"bg-blue-500/20 text-blue-300 border-blue-500/30",Plan:"bg-purple-500/20 text-purple-300 border-purple-500/30",Shell:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30","general-purpose":"bg-green-500/20 text-green-300 border-green-500/30","claude-code-guide":"bg-amber-500/20 text-amber-300 border-amber-500/30"};function Cu({type:l}){const r=w1[l]||"bg-gray-500/20 text-gray-300 border-gray-500/30";return n.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border font-mono ${r}`,children:l})}function N1({subAgent:l}){const[r,i]=y.useState(!1),o=l.tokenUsage?l.tokenUsage.inputTokens+l.tokenUsage.outputTokens+l.tokenUsage.cacheCreationTokens+l.tokenUsage.cacheReadTokens:0;return n.jsxs("div",{className:"border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"px-3 py-2 bg-terminal-surface-hover/50",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(Cu,{type:l.agentType}),l.model&&n.jsx("span",{className:"text-[10px] text-terminal-dim font-mono",children:l.model}),n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"|"}),n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[l.toolCalls," tools"]}),l.thinkingBlocks>0&&n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[l.thinkingBlocks," thinking"]}),l.textResponses>0&&n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[l.textResponses," responses"]}),o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"|"}),n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[o>1e6?`${(o/1e6).toFixed(1)}M`:o>1e3?`${(o/1e3).toFixed(0)}K`:o," ","tokens"]})]})]}),l.description&&n.jsx("div",{className:"text-[11px] text-terminal-text/70 mt-1 italic",children:l.description})]}),l.scenes.length>0&&n.jsxs("div",{className:"border-t border-terminal-border-subtle",children:[n.jsxs("button",{onClick:()=>i(!r),className:"w-full px-3 py-1.5 text-left text-[11px] text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("span",{className:`inline-block transition-transform mr-1 ${r?"rotate-90":""}`,children:"▶"}),r?"Hide":"Show"," agent conversation (",l.scenes.length," scenes)"]}),r&&n.jsx("div",{className:"px-3 pb-2 space-y-1 max-h-[400px] overflow-y-auto",children:l.scenes.map((u,m)=>n.jsx(S1,{scene:u},m))})]})]})}function S1({scene:l}){const[r,i]=y.useState(!1);if(l.type==="thinking")return n.jsxs("div",{className:"text-[10px] font-mono text-purple-400/60 pl-2 border-l-2 border-purple-500/20 py-0.5",children:[n.jsx("span",{className:"text-purple-400/40 mr-1",children:"[thinking]"}),(l.content||"").slice(0,120),(l.content||"").length>120?"...":""]});if(l.type==="text-response")return n.jsxs("div",{className:"text-[10px] font-mono text-terminal-text/80 pl-2 border-l-2 border-blue-500/20 py-0.5",children:[(l.content||"").slice(0,200),(l.content||"").length>200?"...":""]});if(l.type==="tool-call"){const o=l;return n.jsxs("div",{className:"pl-2 border-l-2 border-orange-500/20 py-0.5",children:[n.jsxs("button",{onClick:()=>i(!r),className:"flex items-center gap-1 text-[10px] font-mono w-full text-left hover:bg-terminal-surface-hover/30 rounded px-1",children:[n.jsx("span",{className:"text-terminal-orange font-bold",children:wi(o.toolName)}),n.jsx("span",{className:"text-terminal-dim truncate flex-1",children:Tu(o.toolName,o.input)}),o.isError&&n.jsx("span",{className:"text-red-400 text-[9px]",children:"ERR"})]}),r&&o.result&&n.jsx("pre",{className:"text-[9px] text-terminal-dim font-mono whitespace-pre-wrap break-words max-h-[100px] overflow-y-auto mt-0.5 px-1 bg-terminal-bg/50 rounded",children:o.result.slice(0,500)})]})}return null}const k1=y.memo(function({scene:r,isActive:i,forceCollapse:o}){const[u,m]=y.useState(!1);return o?n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 text-xs font-mono text-terminal-dim",children:[n.jsx("span",{children:su(r.toolName)}),n.jsx("span",{className:"text-terminal-orange font-bold",children:wi(r.toolName)}),n.jsx("span",{className:"truncate",children:Tu(r.toolName,r.input)}),r.subAgent&&n.jsx(Cu,{type:r.subAgent.agentType}),n.jsx(lu,{ms:r.durationMs})]}):r.bashOutput?n.jsx(rv,{command:r.bashOutput.command,stdout:r.bashOutput.stdout,isActive:i,durationMs:r.durationMs}):r.diff?n.jsx(j1,{toolName:r.toolName,filePath:r.diff.filePath,oldContent:r.diff.oldContent,newContent:r.diff.newContent,isActive:i}):r.toolName==="Agent"&&r.subAgent?n.jsx("div",{children:n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("button",{onClick:()=>m(!u),className:"w-full flex items-center gap-2 px-3 py-2 bg-terminal-surface hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left",children:[n.jsx("span",{className:"text-xs font-mono",children:su("Agent")}),n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:"Agent"}),n.jsx(Cu,{type:r.subAgent.agentType}),n.jsx("span",{className:"text-xs text-terminal-dim font-mono truncate flex-1",children:r.subAgent.description||r.input.description||""}),n.jsxs("span",{className:"text-[10px] text-terminal-dim font-mono",children:[r.subAgent.toolCalls," tools"]}),n.jsx(lu,{ms:r.durationMs}),n.jsx("span",{className:`text-xs text-terminal-dim transition-transform ${u?"rotate-90":""}`,children:"▶"})]}),u&&n.jsx(N1,{subAgent:r.subAgent})]})}):n.jsx("div",{children:n.jsxs("div",{className:"bg-terminal-surface rounded-xl overflow-hidden shadow-layer-sm",children:[n.jsxs("button",{onClick:()=>m(!u),className:"w-full flex items-center gap-2 px-3 py-2 bg-terminal-surface hover:bg-terminal-surface-hover transition-colors duration-200 ease-material text-left",children:[n.jsx("span",{className:"text-xs font-mono",children:su(r.toolName)}),n.jsx("span",{className:"text-xs font-mono font-bold text-terminal-orange",children:wi(r.toolName)}),n.jsx("span",{className:"text-xs text-terminal-dim font-mono truncate flex-1",children:Tu(r.toolName,r.input)}),n.jsx(lu,{ms:r.durationMs}),n.jsx("span",{className:`text-xs text-terminal-dim transition-transform ${u?"rotate-90":""}`,children:"▶"})]}),u&&n.jsxs("div",{className:"border-t border-terminal-border-subtle",children:[n.jsxs("div",{className:"px-3 py-2",children:[n.jsx("div",{className:"text-xs text-terminal-dim font-mono mb-1",children:"Input:"}),n.jsx("pre",{className:"text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto",children:JSON.stringify(r.input,null,2)})]}),r.result&&n.jsxs("div",{className:"px-3 py-2 border-t border-terminal-border-subtle",children:[n.jsx("div",{className:"text-xs text-terminal-dim font-mono mb-1",children:"Result:"}),n.jsx("pre",{className:"text-xs text-terminal-text font-mono whitespace-pre-wrap break-words max-h-[200px] overflow-y-auto",children:r.result})]}),r.images&&r.images.length>0&&n.jsx("div",{className:"px-3 py-2 border-t border-terminal-border-subtle",children:n.jsx("div",{className:"flex gap-2 flex-wrap",children:r.images.map((p,g)=>n.jsx("img",{src:p,alt:`Screenshot ${g+1}`,className:"max-w-[400px] max-h-[300px] rounded-md object-contain"},g))})})]})]})})});function Tu(l,r){switch(l){case"Read":return r.file_path||"";case"Glob":return r.pattern||"";case"Grep":return`/${r.pattern||""}/ ${r.path||""}`;case"Agent":return r.description||"";case"Write":return r.file_path||"";case"Edit":return r.file_path||"";case"WebSearch":return r.query||"";case"WebFetch":return r.url||"";default:return Object.values(r).filter(i=>typeof i=="string").join(" ").slice(0,80)}}const C1={lines:8,chars:900},T1={lines:4,chars:280};function E1(){return typeof window<"u"&&window.innerWidth<768?T1:C1}const A1=y.memo(function({content:r,images:i,isActive:o}){const[u,m]=y.useState(!1),[p]=y.useState(E1);y.useEffect(()=>{const h=v=>{if(!o)return;const C=v.detail;C.action==="expand"?m(!0):C.action==="collapse"&&m(!1)};return window.addEventListener("vibe:toggle-expand",h),()=>window.removeEventListener("vibe:toggle-expand",h)},[o]);const g=y.useMemo(()=>r.split(`
|
|
151
|
+
`),[r]),f=g.length>p.lines||r.length>p.chars,x=y.useMemo(()=>{if(!f||u)return r;const h=g.slice(0,p.lines).join(`
|
|
152
|
+
`);return h.length>p.chars?h.slice(0,p.chars):h},[r,u,f,g,p]);return n.jsxs("div",{children:[n.jsxs("div",{className:`text-terminal-green font-mono text-sm whitespace-pre-wrap break-words ${o?"typing-cursor":""}`,children:[x,f&&!u&&n.jsx("span",{className:"text-terminal-dim",children:`
|
|
153
|
+
...`})]}),f&&n.jsxs("button",{onClick:()=>m(h=>!h),className:"mt-1 text-xs font-mono text-terminal-dim hover:text-terminal-green transition-colors duration-200 ease-material flex items-center gap-1.5",children:[o&&n.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:u?"[←]":"[→]"}),n.jsx("span",{children:u?"Show less":`Show more (${g.length} lines)`})]}),i&&i.length>0&&n.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:i.map((h,v)=>n.jsx("img",{src:h,alt:`Attachment ${v+1}`,className:"max-w-[300px] max-h-[200px] rounded-md object-contain"},v))})]})});function Qs(l){if(!l)return"";try{return new Date(l).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return""}}function R1({scenes:l,visibleCount:r,currentIndex:i,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:g,onSeek:f,state:x,overlayActions:h,turnStats:v}){const C=y.useMemo(()=>{const k=[];let E=null,M=0;for(let A=0;A<l.length;A++){const R=l[A];if(R.type==="user-prompt"||R.type==="compaction-summary"||R.type==="context-injection"){E&&E.scenes.length>0&&k.push(E);const O=R.type==="compaction-summary"?"compaction":R.type==="context-injection"?"context-injection":"user";O==="user"&&M++,k.push({type:O,timestamp:R.timestamp,scenes:[{scene:R,index:A}],turnNumber:O==="user"?M:void 0}),E=null}else(!E||E.type!=="assistant")&&(E&&E.scenes.length>0&&k.push(E),E={type:"assistant",timestamp:R.timestamp,scenes:[],turnNumber:M>0?M:void 0}),E.scenes.push({scene:R,index:A})}return E&&E.scenes.length>0&&k.push(E),k},[l]),j=y.useMemo(()=>o.promptsOnly?C.filter(k=>(k.type==="user"||k.type==="compaction")&&k.scenes[0].index<r):C.filter(k=>k.scenes[0].index<r),[C,r,o.promptsOnly]),w=y.useMemo(()=>{for(let k=j.length-1;k>=0;k--)if(j[k].scenes.some(E=>E.index<=i))return k;return j.length-1},[j,i]),S=y.useMemo(()=>{const k=new Map;for(let E=1;E<j.length;E++){const M=j[E];if(M.type!=="user")continue;let A;for(let O=E-1;O>=0;O--){const $=j[O],H=$.scenes[$.scenes.length-1];if(H?.scene.timestamp){A=H.scene.timestamp;break}if($.timestamp){A=$.timestamp;break}}if(!A||!M.timestamp)continue;const R=new Date(M.timestamp).getTime()-new Date(A).getTime();R>12e4&&k.set(E,R)}return k},[j]);return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-5 pb-6",children:[j.map((k,E)=>n.jsxs(D1,{forceRender:E>=w-15&&E<=w+5,children:[S.has(E)&&n.jsx(M1,{gapMs:S.get(E)}),n.jsx(_1,{group:k,currentIndex:i,visibleCount:r,effectivePrefs:o,focusIndex:u,annotatedScenes:m,annotationCounts:p,onComment:g,overlayActions:h,turnStats:v})]},E)),x==="paused"&&r<l.length&&n.jsx("div",{className:"pt-4 pb-12 flex items-center justify-center animate-in fade-in slide-in-from-bottom-2 duration-700 ease-out select-none",children:n.jsxs("div",{className:"group/pause relative flex items-center gap-8 px-4 py-2 bg-transparent backdrop-blur-sm",children:[n.jsx("div",{className:"absolute inset-0 bg-terminal-orange/5 opacity-0 group-hover/pause:opacity-100 transition-opacity duration-700 blur-2xl -z-10"}),n.jsxs("div",{className:"flex items-center gap-2.5 pr-8 border-r border-terminal-border/20",children:[n.jsxs("div",{className:"relative flex h-2 w-2",children:[n.jsx("div",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-orange opacity-40"}),n.jsx("div",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-orange/80 shadow-[0_0_8px_rgba(251,146,60,0.5)]"})]}),n.jsx("span",{className:"text-[10px] font-sans font-black text-terminal-orange uppercase tracking-[.25em] drop-shadow-sm",children:"Paused"})]}),n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:n.jsx("span",{className:"text-[11px] font-mono font-bold",children:"↓"})}),n.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Explore"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-terminal-surface-hover/80 border border-terminal-border-subtle/50 text-terminal-text shadow-sm",children:n.jsx("span",{className:"text-[9px] font-mono font-black tracking-tight",children:"SPACE"})}),n.jsx("span",{className:"text-[10px] font-sans font-bold text-terminal-dim uppercase tracking-widest opacity-80",children:"Resume"})]})]})]})}),r>=l.length&&n.jsxs("div",{className:"pt-12 pb-24 flex flex-col items-center justify-center animate-in fade-in zoom-in-95 duration-1000 ease-out select-none",children:[n.jsx("div",{className:"h-px w-8 bg-terminal-border-subtle mb-6"}),n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-terminal-dimmer uppercase tracking-[0.3em]",children:"the end"}),n.jsx("div",{className:"text-[9px] font-mono text-terminal-border uppercase tracking-widest mt-1",children:"session replay complete"})]}),n.jsxs("div",{className:"mt-8 flex flex-col items-center gap-6",children:[n.jsxs("button",{onClick:()=>f?.(0),className:"group flex items-center gap-2.5 px-3.5 py-1.5 rounded-full bg-terminal-surface/30 border border-terminal-border-subtle text-terminal-dimmer hover:text-terminal-green hover:border-terminal-green/30 hover:bg-terminal-green/5 transition-all duration-300",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300 group-hover:-translate-y-0.5",children:n.jsx("path",{d:"m18 15-6-6-6 6"})}),n.jsx("span",{className:"text-[10px] font-mono font-bold uppercase tracking-widest transition-colors",children:"Back to Top"}),n.jsxs("span",{className:"text-[9px] font-mono font-bold opacity-0 group-hover:opacity-60 transition-opacity",children:[" ","[Home]"]})]}),n.jsxs("div",{className:"flex items-center gap-3 opacity-20",children:[n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-green"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-blue"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-terminal-orange"})]})]})]})]})}function M1({gapMs:l}){const r=l>=36e5?`${Math.floor(l/36e5)}h ${Math.floor(l%36e5/6e4)}m later`:`${Math.floor(l/6e4)}m later`;return n.jsxs("div",{className:"flex items-center gap-3 py-1 px-4",children:[n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer whitespace-nowrap",children:r}),n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}const D1=y.memo(function({children:r,forceRender:i}){const o=y.useRef(null),[u,m]=y.useState(!1),p=y.useRef(0);y.useEffect(()=>{const f=o.current;if(!f)return;const x=new IntersectionObserver(([h])=>{m(h.isIntersecting),h.isIntersecting&&f.offsetHeight>0&&(p.current=f.offsetHeight)},{rootMargin:"800px 0px"});return x.observe(f),()=>x.disconnect()},[]);const g=u||i;return y.useEffect(()=>{g&&o.current&&o.current.offsetHeight>0&&(p.current=o.current.offsetHeight)}),n.jsx("div",{ref:o,style:!g&&p.current>0?{minHeight:p.current}:void 0,children:g?r:null})}),_1=y.memo(function({group:r,currentIndex:i,visibleCount:o,effectivePrefs:u,focusIndex:m,annotatedScenes:p,annotationCounts:g,onComment:f,overlayActions:x,turnStats:h}){const[v,C]=y.useState(!1),j=y.useMemo(()=>r.scenes.filter(O=>O.index<o),[r.scenes,o]),w=j.some(({index:O})=>O===i),S=typeof m=="number"&&j.some(({index:O})=>O===m),k=j[0]?.index;if(j.length===0)return null;const E=r.type==="user"&&g?.get(k)||0,M=r.type==="user"&&f&&(E>0||v)?n.jsxs("button",{onClick:O=>{O.stopPropagation(),f(k)},className:`absolute right-0 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${E>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:E>0?`${E} comment${E>1?"s":""}`:"Add comment",children:["💬",E>0&&n.jsx("span",{children:E})]}):null;if(r.type==="user")return n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-2xl px-5 py-4 transition-all duration-200 ease-material ml-4 md:ml-12 border ${S?"scene-nav-focused bg-terminal-green-emphasis border-terminal-green shadow-layer-lg":w?"bg-terminal-green-subtle border-terminal-green/30 shadow-layer-sm":"bg-terminal-surface border-terminal-border-subtle shadow-sm"}`,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[M,n.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"}),r.timestamp&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Qs(r.timestamp)}),n.jsx("div",{className:"flex-1"}),S?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green text-terminal-bg",children:"Jump Target"}):w&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-green-subtle text-terminal-green border border-terminal-green/20",children:"Focused"}),r.turnNumber!==void 0&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),n.jsx("div",{className:"text-left",children:j.map(({scene:O,index:$})=>{const H=x?.getOverlays($)??[],K=x?.getEffectiveContent($),ae=x?.showOriginal.has($);return n.jsxs("div",{className:"scene-enter",children:[n.jsx(_i,{scene:O,isActive:$===i,collapseTools:u.collapseAllTools,effectiveContent:K??void 0}),H.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[H.map(ue=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:ue.source.type==="translate"?"Translated":ue.source.type==="tone"?"Softened":"Modified"},ue.id)),n.jsx("button",{onClick:()=>x?.toggleOriginal($),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:ae?"Show modified":"Show original"}),n.jsx("button",{onClick:()=>x?.revertSceneOverlays($),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]})]},$)})})]});if(r.type==="compaction"){const O=j[0]?.scene;return!O||O.type!=="compaction-summary"?null:n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":w?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"bg-terminal-surface/50"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dim uppercase tracking-widest",children:"Context Compaction"}),r.timestamp&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Qs(r.timestamp)})]}),n.jsx(Ni,{content:O.content,isActive:k===i})]})}if(r.type==="context-injection"){const O=j[0]?.scene;if(!O||O.type!=="context-injection")return null;const $=O.injectionType||"system",H=$.startsWith("skill:")?`Skill: ${$.slice(6)}`:$.startsWith("command:")?`Command: ${$.slice(8)}`:$==="image"?"Image Injection":$==="local-command"?"Local Command":"System Context";return n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`group relative rounded-xl px-5 py-3.5 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-surface border-l-2 border-blue-500/60 shadow-layer-sm":w?"bg-terminal-surface border-l-2 border-blue-500/40 shadow-layer-sm":"bg-terminal-surface/50"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-blue-400/80 uppercase tracking-widest",children:H}),r.timestamp&&n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer",children:Qs(r.timestamp)})]}),n.jsx(Ni,{content:O.content,isActive:k===i})]})}const A=u.hideThinking?j.filter(O=>O.scene.type!=="thinking"):j;if(A.length===0)return null;const R=u.hideThinking?r.scenes.filter(O=>O.scene.type!=="thinking"):r.scenes;return u.compactAssistant?n.jsx(O1,{allScenes:R,filteredScenes:A,firstIndex:k,currentIndex:i,groupHasCurrent:w,groupHasFocusedTarget:S,timestamp:r.timestamp,annotationCounts:g,onComment:f,overlayActions:x,turnDurationMs:r.turnNumber?h?.[r.turnNumber-1]?.durationMs:void 0}):n.jsxs("div",{id:`scene-${k}`,"data-scene-index":k,className:`relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${S?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":w?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),r.timestamp&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Qs(r.timestamp)}),n.jsx("div",{className:"flex-1"}),S?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):w&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"}),r.turnNumber!==void 0&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer font-bold",children:["#",String(r.turnNumber).padStart(2,"0")]})]}),n.jsx("div",{className:"space-y-2",children:n.jsx(L1,{scenes:A,currentIndex:i,collapseTools:u.collapseAllTools,annotationCounts:g,onComment:f,overlayActions:x})})]})});function O1({allScenes:l,filteredScenes:r,firstIndex:i,currentIndex:o,groupHasCurrent:u,groupHasFocusedTarget:m,timestamp:p,annotationCounts:g,onComment:f,overlayActions:x,turnDurationMs:h}){const[v,C]=y.useState(!1);y.useEffect(()=>{const A=R=>{if(!u)return;const O=R.detail;O.action==="expand"?C(!0):O.action==="collapse"&&C(!1)};return window.addEventListener("vibe:toggle-expand",A),()=>window.removeEventListener("vibe:toggle-expand",A)},[u]);const j=y.useMemo(()=>{const A={},R=new Set;let O=0,$=0,H=0,K=0;const ae=[];for(const{scene:xe}of l)if(xe.type==="tool-call"){H++,xe.toolName==="Agent"&&xe.subAgent&&(K++,ae.includes(xe.subAgent.agentType)||ae.push(xe.subAgent.agentType));const de=wi(xe.toolName);if(A[de]=(A[de]||0)+1,xe.toolName==="Bash"&&xe.input?.command){const pe=xe.input.command.trim().split(/[\s|;&]/)[0];pe&&R.add(pe)}}else xe.type==="text-response"?O++:xe.type==="thinking"&&$++;let ue;const oe=l[0]?.scene.timestamp,te=l[l.length-1]?.scene.timestamp;if(oe&&te){const xe=Date.parse(te)-Date.parse(oe);xe>0&&(ue=xe)}return{totalTools:H,toolBreakdown:A,responses:O,thinking:$,bashCommands:[...R],subAgentCalls:K,subAgentTypes:ae,turnDurationMs:ue}},[l]),w=y.useMemo(()=>{for(let A=l.length-1;A>=0;A--)if(l[A].scene.type==="text-response")return l[A];return null},[l]),S=y.useMemo(()=>{const A=["Read","Write","Edit","Bash","Glob","Grep","Agent"],R=Object.entries(j.toolBreakdown);return R.sort((O,$)=>{const H=A.indexOf(O[0]),K=A.indexOf($[0]),ae=H>=0?H:100,ue=K>=0?K:100;return ae-ue}),R},[j.toolBreakdown]),k=y.useMemo(()=>g?l.reduce((A,{index:R})=>A+(g.get(R)||0),0):0,[l,g]),[E,M]=y.useState(!1);return n.jsxs("div",{id:`scene-${i}`,"data-scene-index":i,className:`group relative rounded-xl px-5 py-4 transition-all duration-200 ease-material ${m?"scene-nav-focused bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-lg":u?"bg-terminal-blue-subtle border-l-2 border-terminal-blue shadow-layer-sm":"bg-terminal-surface shadow-layer-sm"}`,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[f&&(k>0||E)&&!v&&n.jsxs("button",{onClick:A=>{A.stopPropagation(),f(i)},className:`absolute right-3 top-3 z-10 flex items-center gap-1 px-1.5 py-1 rounded-md text-xs font-mono transition-all duration-150 ${k>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover:opacity-100"}`,title:k>0?`${k} comment${k>1?"s":""}`:"Add comment",children:["💬",k>0&&n.jsx("span",{children:k})]}),n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-blue uppercase tracking-widest",children:"Assistant"}),p&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:Qs(p)}),(h||j.turnDurationMs)&&n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["· ",vt(h??j.turnDurationMs)]}),n.jsx("div",{className:"flex-1"}),m?n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-emphasis text-terminal-blue",children:"Jump Target"}):u&&n.jsx("span",{className:"text-[10px] font-sans font-medium uppercase tracking-widest px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:"Focused"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[j.responses>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[j.responses," response",j.responses>1?"s":""]}),j.totalTools>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[j.totalTools," tool",j.totalTools>1?"s":""]}),j.subAgentCalls>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-500/20 text-green-300",children:[j.subAgentCalls," agent",j.subAgentCalls>1?"s":"",j.subAgentTypes.length>0&&n.jsxs("span",{className:"opacity-70 text-[10px]",children:["(",j.subAgentTypes.join(", "),")"]})]}),j.thinking>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-purple-subtle text-terminal-purple",children:[j.thinking," thinking"]}),S.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),S.map(([A,R])=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange",children:A}),A==="Bash"&&j.bashCommands.length>0&&n.jsxs("span",{className:"text-terminal-dimmer",children:["(",j.bashCommands.slice(0,4).join(", "),j.bashCommands.length>4?", ...":"",")"]}),n.jsx("span",{children:R})]},A))]})]}),w&&!v&&n.jsx("div",{className:"mb-2",children:n.jsx(px,{content:x?.getEffectiveContent(w.index)??w.scene.content,isActive:w.index===o})}),v&&n.jsx("div",{className:"space-y-2 mb-2",children:r.map(({scene:A,index:R})=>{const O=g?.get(R)||0,$=A.type==="text-response"?x?.getEffectiveContent(R)??void 0:void 0;return n.jsxs("div",{"data-scene-index":R,className:`group/scene relative scene-enter ${f?"pr-7":""}`,children:[n.jsx(_i,{scene:A,isActive:R===o,collapseTools:!1,effectiveContent:$}),f&&n.jsxs("button",{onClick:H=>{H.stopPropagation(),f(R)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${O>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:O>0?`${O} comment${O>1?"s":""}`:"Add comment",children:["💬",O>0&&n.jsx("span",{children:O})]})]},R)})}),n.jsxs("button",{onClick:()=>C(!v),className:"text-xs font-mono text-terminal-dim hover:text-terminal-blue transition-colors flex items-center gap-1.5",children:[u&&n.jsx("span",{className:"text-secondary-text font-bold opacity-70",children:v?"[←]":"[→]"}),n.jsx("span",{children:v?"Collapse":"Show all details"})]})]})}function L1({scenes:l,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u,overlayActions:m}){const p=[];let g=[];for(const f of l){const x=g[g.length-1];x&&x.scene.type==="tool-call"&&f.scene.type==="tool-call"&&x.scene.toolName===f.scene.toolName&&!f.scene.diff&&!f.scene.bashOutput&&!x.scene.diff&&!x.scene.bashOutput?g.push(f):(g.length>0&&p.push(g),g=[f])}return g.length>0&&p.push(g),n.jsx(n.Fragment,{children:p.map(f=>{if(f.length<=1){const{scene:h,index:v}=f[0],C=o?.get(v)||0,j=h.type==="text-response"?m?.getEffectiveContent(v):void 0,w=h.type==="text-response"?m?.getOverlays(v)??[]:[];return n.jsxs("div",{"data-scene-index":v,className:`group/scene relative scene-enter ${u?"pr-7":""}`,children:[n.jsx(_i,{scene:h,isActive:v===r,collapseTools:i,effectiveContent:j??void 0}),w.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[w.map(S=>n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-terminal-purple-subtle text-terminal-purple",children:S.source.type==="translate"?"Translated":S.source.type==="tone"?"Softened":"Modified"},S.id)),n.jsx("button",{onClick:()=>m?.toggleOriginal(v),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors",children:m?.showOriginal.has(v)?"Show modified":"Show original"}),n.jsx("button",{onClick:()=>m?.revertSceneOverlays(v),className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-red transition-colors",children:"Revert"})]}),u&&n.jsxs("button",{onClick:S=>{S.stopPropagation(),u(v)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${C>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:C>0?`${C} comment${C>1?"s":""}`:"Add comment",children:["💬",C>0&&n.jsx("span",{children:C})]})]},v)}const x=f[0].scene.toolName;return n.jsx(z1,{batch:f,toolName:x,currentIndex:r,collapseTools:i,annotationCounts:o,onComment:u},f[0].index)})})}function z1({batch:l,toolName:r,currentIndex:i,collapseTools:o,annotationCounts:u,onComment:m}){const[p,g]=y.useState(!1),f=u?l.reduce((h,{index:v})=>h+(u.get(v)||0),0):0,x=l.map(({scene:h})=>h.type==="tool-call"?B1(h.toolName,h.input):"");return n.jsxs("div",{"data-scene-index":l[0].index,className:`group/batch relative ${m?"pr-7":""}`,children:[n.jsxs("button",{onClick:()=>g(!p),className:"w-full flex items-center gap-2 px-3.5 py-2.5 text-xs font-mono text-terminal-dim rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material cursor-pointer text-left shadow-layer-sm",children:[n.jsx("span",{className:`transition-transform text-xs ${p?"rotate-90":""}`,children:"▶"}),n.jsx("span",{className:"text-terminal-orange font-semibold",children:r}),n.jsxs("span",{className:"text-terminal-dimmer",children:[l.length," call",l.length>1?"s":""]}),!p&&n.jsxs("span",{className:"truncate text-terminal-dimmer ml-1",children:[x.filter(Boolean).slice(0,3).join(", "),x.filter(Boolean).length>3&&"..."]})]}),m&&!p&&n.jsxs("button",{onClick:h=>{h.stopPropagation(),m(l[0].index)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${f>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/batch:opacity-100"}`,title:f>0?`${f} comment${f>1?"s":""}`:"Add comment",children:["💬",f>0&&n.jsx("span",{children:f})]}),p&&n.jsx("div",{className:"mt-1 ml-4 space-y-2 pl-4",children:l.map(({scene:h,index:v})=>{const C=u?.get(v)||0;return n.jsxs("div",{"data-scene-index":v,className:`group/scene relative scene-enter ${m?"pr-7":""}`,children:[n.jsx(_i,{scene:h,isActive:v===i,collapseTools:o}),m&&n.jsxs("button",{onClick:j=>{j.stopPropagation(),m(v)},className:`absolute right-0 top-1 z-10 flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-xs font-mono transition-all duration-150 ${C>0?"bg-terminal-blue text-terminal-bg shadow-layer-sm":"text-terminal-dim hover:text-terminal-blue hover:bg-terminal-blue-subtle opacity-0 group-hover/scene:opacity-100"}`,title:C>0?`${C} comment${C>1?"s":""}`:"Add comment",children:["💬",C>0&&n.jsx("span",{children:C})]})]},v)})})]})}function B1(l,r){switch(l){case"Read":return r.file_path||"";case"Glob":return r.pattern||"";case"Grep":return r.pattern||"";case"Agent":return r.description||"";default:return""}}const _i=y.memo(function({scene:r,isActive:i,collapseTools:o,effectiveContent:u}){switch(r.type){case"user-prompt":return n.jsx(A1,{content:u??r.content,images:r.images,isActive:i});case"compaction-summary":return n.jsx(Ni,{content:r.content,isActive:i});case"context-injection":return n.jsx(Ni,{content:r.content,isActive:i});case"thinking":return n.jsx(sv,{content:r.content,isActive:i});case"text-response":return n.jsxs(n.Fragment,{children:[n.jsx(px,{content:u??r.content,isActive:i}),r.isTruncated&&n.jsx("div",{className:"mt-1 text-[10px] font-mono text-terminal-orange/70 italic",children:"Response truncated (max_tokens reached)"})]});case"tool-call":return n.jsx(k1,{scene:r,isActive:i,forceCollapse:o})}}),$1=8;function Qa(l){const r=new URLSearchParams(window.location.search).get("session");if(!r)return l;const i=l.includes("?")?"&":"?";return`${l}${i}slug=${encodeURIComponent(r)}`}function Sh({title:l,color:r}){return n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("span",{className:`text-[10px] font-sans font-semibold uppercase tracking-widest ${r}`,children:l}),n.jsx("div",{className:"flex-1 h-px bg-terminal-border-subtle"})]})}function Fs({text:l,label:r}){const[i,o]=y.useState(!1);return n.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(l),o(!0),setTimeout(()=>o(!1),2e3)},className:"text-[10px] font-mono text-terminal-dim hover:text-terminal-text transition-colors px-1.5 py-0.5 rounded bg-terminal-surface hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Copy to clipboard",children:i?"Copied!":r||"Copy"})}function fi(l){try{const r=Date.now()-new Date(l).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}catch{return""}}function ta(l,r=!1){const i=r?Math.round(l*.75):l;if(i<1024)return`${i} B`;const o=i/1024;return o<1024?`${o.toFixed(1)} KB`:`${(o/1024).toFixed(1)} MB`}function ru({label:l,path:r}){return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:l}),n.jsx("span",{className:"text-terminal-text truncate",children:r})]})}function U1({actions:l,viewerMode:r,readOnly:i,session:o}){const{hasUnsaved:u,canSaveHtml:m,downloadHtml:p,downloadJson:g,publishGist:f,exportHtml:x,exportGithub:h,htmlExporting:v,githubExporting:C}=l,j=r==="editor",[w,S]=y.useState(null),[k,E]=y.useState(null),[M,A]=y.useState(null),[R,O]=y.useState(null),[$,H]=y.useState(!1),[K,ae]=y.useState(null),[ue,oe]=y.useState(!1),[te,xe]=y.useState(null),[de,pe]=y.useState("preview"),[U,z]=y.useState("unlisted"),[Q,ne]=y.useState(!1),[W,T]=y.useState(!1),[_,V]=y.useState(null),[J,P]=y.useState(null),[he,G]=y.useState(null),[F,me]=y.useState(null),[be,Qe]=y.useState(null),[lt,Ct]=y.useState(null),[Fe,it]=y.useState(null),[Bt,kn]=y.useState(null),[qt,Cn]=y.useState(null),ze=y.useRef(null),ot=y.useRef(null),jt=y.useRef(null),st=y.useRef(null),Ze="https://vibe-replay.com",I=j?"":Ze,we=y.useMemo(()=>{if(j)return"";try{return new URL(Ze).origin}catch{return""}},[j]),ve=y.useCallback((ie,ke={})=>{const He=`${I}${ie}`;return fetch(He,{...ke,...j?{}:{credentials:"include"}})},[I,j]);y.useEffect(()=>()=>{ze.current&&(clearInterval(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),jt.current&&(clearTimeout(jt.current),jt.current=null),st.current&&(window.removeEventListener("message",st.current),st.current=null)},[]);const ce=y.useMemo(()=>o?new TextEncoder().encode(JSON.stringify(o)).byteLength:0,[o]),fe=10*1024*1024,_e=10*1024*1024,Se=ce>fe,Be=ce>_e,et=y.useCallback(()=>{j&&ve("/api/auth/get-session").then(ie=>ie.json()).then(ie=>{const ke=!!ie?.session;A(ke),ke&&ve("/api/cloud-replays").then(He=>He.json()).then(He=>{G(He.storage?.used??null),me(He.storage?.limit??null),o&&fetch(Qa("/api/cloud-info")).then(wt=>wt.json()).then(wt=>{const Nt=wt?.cloud?.id,on=Nt?(He.replays||[]).find(Tt=>Tt.id===Nt):null,Rt=on||(He.replays||[]).find(Tt=>Tt.storageType==="r2"&&Tt.title===(o.meta.title||o.meta.slug));if(Rt){const Tt={id:Rt.id,url:`${Ze}/r/${Rt.id}`,expiresAt:Rt.expiresAt||"",visibility:Rt.visibility};P(Tt),Rt.visibility&&z(Rt.visibility),on||fetch(Qa("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tt)}).catch(()=>{})}}).catch(()=>{})}).catch(()=>{})}).catch(()=>A(!1))},[j,ve]);y.useEffect(()=>{j&&(f&&(et(),H(!0),fetch(Qa("/api/gist-info")).then(ie=>ie.json()).then(ie=>{ie.gist&&O(ie.gist)}).catch(()=>{}).finally(()=>H(!1))),h&&fetch(Qa("/api/export/github/status")).then(ie=>ie.json()).then(ie=>{ie.exists&&ae({svgContent:ie.svgContent,markdown:ie.markdown,svgPath:ie.svgPath,mdPath:ie.mdPath,gifContent:ie.gifContent??null,gifPath:ie.gifPath??null,gifGeneratedAt:ie.gifGeneratedAt,svgGeneratedAt:ie.svgGeneratedAt,mdGeneratedAt:ie.mdGeneratedAt,replayUrl:ie.replayUrl})}).catch(()=>{}))},[j,f,h,ve,et]),y.useEffect(()=>{if(!j)return;const ie=()=>et();return window.addEventListener("vibe-auth-change",ie),()=>window.removeEventListener("vibe-auth-change",ie)},[j,et]);const Oe=y.useCallback(async()=>{if(o){ne(!0),E(null);try{const ie=JSON.stringify(o),ke=o.meta.title||o.meta.slug,He=`${ke.replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").slice(0,60)}.json`,wt=R?`/api/gists/${R.gistId}`:"/api/gists",Nt=await ve(wt,{method:R?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:He,content:ie,description:`vibe-replay: ${ke}`,public:!0})});if(!Nt.ok){const Tt=(await Nt.json().catch(()=>({}))).error||"Gist publish failed";if(Nt.status===401)throw A(!1),new Error(Tt);if(R&&(Nt.status===404||Tt.includes("not found"))){O(null),fetch(Qa("/api/gist-info"),{method:"DELETE"}).catch(()=>{}),E({type:"error",text:"Gist was deleted on GitHub. Click again to create a new one."});return}throw new Error(Tt)}const on=await Nt.json();O({gistId:on.gistId,gistUrl:on.gistUrl,viewerUrl:on.viewerUrl,updatedAt:new Date().toISOString()}),E({type:"success",text:"Published!"})}catch(ie){E({type:"error",text:ie instanceof Error?ie.message:String(ie)})}finally{ne(!1)}}},[o,R,ve]),Ue=y.useCallback(async()=>{if(o){T(!0),V(null);try{const ie=J?.id,ke=await ve("/api/cloud-replays",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replay:o,visibility:U})});if(!ke.ok){const Nt=await ke.json().catch(()=>({}));throw ke.status===401&&A(!1),new Error(Nt.error||"Upload failed")}const He=await ke.json();ie&&ie!==He.id&&await ve(`/api/cloud-replays/${ie}`,{method:"DELETE"}).catch(()=>{}),P(He),V({type:"success",text:ie?"Updated!":"Shared!"}),fetch(Qa("/api/cloud-info"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...He,visibility:U})}).catch(()=>{});const wt=await ve("/api/cloud-replays").catch(()=>null);if(wt){const Nt=await wt.json().catch(()=>null);Nt?.storage&&(G(Nt.storage.used??null),me(Nt.storage.limit??null))}}catch(ie){V({type:"error",text:ie instanceof Error?ie.message:String(ie)})}finally{T(!1)}}},[o,U,J,ve]),tt=y.useCallback(async()=>{if(J?.id){T(!0),V(null);try{const ie=await ve(`/api/cloud-replays/${J.id}`,{method:"DELETE"});if(!ie.ok){const ke=await ie.json().catch(()=>({}));throw new Error(ke.error||"Delete failed")}P(null),V({type:"success",text:"Removed from cloud"}),fetch(Qa("/api/cloud-info"),{method:"DELETE"}).catch(()=>{}),ve("/api/cloud-replays").then(ke=>ke.json()).then(ke=>{G(ke.storage?.used??null),me(ke.storage?.limit??null)}).catch(()=>{})}catch(ie){V({type:"error",text:ie instanceof Error?ie.message:String(ie)})}finally{T(!1)}}},[J,ve]),Yt=y.useCallback(()=>{ve("/api/cloud-replays").then(ie=>ie.json()).then(ie=>{G(ie.storage?.used??null),me(ie.storage?.limit??null)}).catch(()=>{})},[ve]),Ft=y.useCallback(async ie=>{const ke=ie==="gif"?K?.gifContent:K?.svgContent;if(!ke)return;const He=ie==="gif"?kn:Cn;it(ie),He(null);try{const wt=ie==="svg"?btoa(Array.from(new TextEncoder().encode(ke),Wa=>String.fromCharCode(Wa)).join("")):ke,Nt=ie==="gif"?"image/gif":"image/svg+xml",on=`session-preview.${ie}`,Rt=ie==="gif"?be:lt,Tt=await ve("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:wt,contentType:Nt,filename:on,parentReplayId:J?.id||null,visibility:U})});if(!Tt.ok){const Wa=await Tt.json().catch(()=>({}));throw Tt.status===401&&A(!1),new Error(Wa.error||"Upload failed")}const Pa=await Tt.json();Rt&&await ve(`/api/files/${Rt.id}`,{method:"DELETE"}).catch(()=>{});const Zl={id:Pa.id,url:Pa.url};ie==="gif"?Qe(Zl):Ct(Zl),He({type:"success",text:"Shared!"}),navigator.clipboard.writeText(Pa.url).catch(()=>{}),Yt()}catch(wt){He({type:"error",text:wt instanceof Error?wt.message:String(wt)})}finally{it(null)}},[K,be,lt,J,U,ve,Yt]),rn=y.useCallback(async()=>{if(h){xe(null),oe(!0);try{const ie=await h();await navigator.clipboard.writeText(ie.markdown),ae({svgContent:ie.svgContent,markdown:ie.markdown,svgPath:ie.svgPath,mdPath:ie.mdPath,gifContent:ie.gifContent??null,gifPath:ie.gifPath??null,gifGeneratedAt:ie.gifGeneratedAt,svgGeneratedAt:ie.svgGeneratedAt,mdGeneratedAt:ie.mdGeneratedAt,replayUrl:ie.replayUrl,warnings:ie.warnings})}catch(ie){xe(ie instanceof Error?ie.message:String(ie))}finally{oe(!1)}}},[h]),Ln=y.useMemo(()=>{if(!K?.markdown)return"";const ie=K.markdown.replace(/\[?!\[[^\]]*\]\([^)]*\.(?:svg|gif)\)\]?(?:\([^)]*\))?\n*/g,"");return Zu(Ye.parse(ie))},[K?.markdown]),zn=y.useMemo(()=>K?.svgContent?Wy(K.svgContent):"",[K?.svgContent]);if(i)return n.jsx("div",{className:"p-6 text-center text-xs font-mono text-terminal-dim",children:"Export is not available in read-only mode"});const $t="px-4 py-2 text-xs font-mono rounded-lg transition-colors text-center disabled:opacity-50 shrink-0";return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"p-6 max-w-3xl mx-auto",children:n.jsxs("div",{children:[o&&n.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[n.jsx("h2",{className:"text-sm font-mono font-semibold text-terminal-text truncate",children:o.meta.title||o.meta.slug}),o.meta.provider&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle",children:o.meta.provider})]}),u&&n.jsx("div",{className:"text-xs font-mono text-terminal-orange text-center mb-5 px-3 py-2 rounded-lg bg-terminal-orange-subtle border border-terminal-orange/20",children:"You have unsaved annotation changes"}),j&&n.jsxs("div",{id:"share",className:"mb-12",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx(Sh,{title:"Share",color:"text-terminal-purple"}),ce>0&&n.jsxs("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md ${ce>_e?"bg-terminal-red-subtle text-terminal-red":"bg-terminal-surface-2 text-terminal-dimmer"}`,children:[ta(ce)," replay"]})]}),M===!1?n.jsx("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden",children:n.jsxs("div",{className:"p-6",children:[n.jsx("h3",{className:"text-lg font-sans font-semibold text-terminal-text mb-5",children:"Share your session — free"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[n.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("span",{className:"text-xs font-sans font-bold text-terminal-purple",children:"Cloud Share"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-purple-subtle text-terminal-purple",children:"Private"})]}),n.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"20 MB free storage"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"7-day shareable link"]})]})]}),n.jsxs("div",{className:"rounded-xl bg-terminal-bg border border-terminal-border-subtle p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("span",{className:"text-xs font-sans font-bold text-terminal-dim",children:"GitHub Gist"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),n.jsxs("ul",{className:"space-y-2.5 text-sm font-sans text-terminal-dim",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"No storage limit"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Permanent — never expires"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Great for portfolios"]})]})]})]}),n.jsxs("button",{type:"button",onClick:async()=>{if(ze.current&&(clearInterval(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),jt.current&&(clearTimeout(jt.current),jt.current=null),st.current&&(window.removeEventListener("message",st.current),st.current=null),j){try{const ke=await fetch("/api/auth/login",{method:"POST"}),He=await ke.json().catch(()=>null);ke.ok&&He?.url&&window.open(He.url,"_blank")}catch{}ze.current=setInterval(async()=>{try{(await(await fetch("/api/auth/get-session")).json())?.session&&(ze.current&&(clearInterval(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),A(!0),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),ot.current=setTimeout(()=>{ze.current&&(clearInterval(ze.current),ze.current=null),ot.current=null},300*1e3);return}window.open(`${Ze}/auth/login?callback=/auth/success`,"_blank");const ie=ke=>{ke.origin===we&&ke.data?.type==="vibe-replay-auth"&&ke.data.user&&(window.removeEventListener("message",ie),st.current=null,jt.current&&(clearTimeout(jt.current),jt.current=null),A(!0),window.dispatchEvent(new Event("vibe-auth-change")))};st.current=ie,window.addEventListener("message",ie),jt.current=setTimeout(()=>{window.removeEventListener("message",ie),jt.current=null,st.current===ie&&(st.current=null)},300*1e3)},className:"group inline-flex items-center gap-2.5 px-6 py-3 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis text-terminal-green text-sm font-sans font-semibold transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md hover:-translate-y-0.5",children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor",className:"transition-transform group-hover:scale-110",children:n.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"Sign in with GitHub"]})]})}):M===!0?n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[n.jsx("div",{className:"flex items-center gap-2 mb-3",children:n.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-purple",children:"Cloud Share"})}),n.jsx("div",{className:"flex items-center h-7 rounded-md overflow-hidden bg-terminal-bg mb-3",children:[{value:"private",label:"Private",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},{value:"unlisted",label:"Link only",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})},{value:"public",label:"Public",icon:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),n.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}].map(({value:ie,label:ke,icon:He})=>n.jsxs("button",{onClick:()=>z(ie),className:`h-full flex-1 px-2.5 text-[11px] font-mono transition-colors flex items-center justify-center gap-1.5 whitespace-nowrap ${U===ie?"bg-terminal-purple-subtle text-terminal-purple":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[He,ke]},ie))}),he!=null&&F!=null&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono text-terminal-dimmer mb-1.5",children:[n.jsxs("span",{children:[ta(he)," used"]}),n.jsxs("span",{children:[ta(F)," total"]})]}),(()=>{const ie=he/F*100,ke=!J&&ce>0,He=ke?ce/F*100:0,wt=ke&&he+ce>F;return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"h-2 rounded-full bg-terminal-surface-hover overflow-hidden",children:n.jsxs("div",{className:"h-full flex",children:[he>0&&n.jsx("div",{className:"h-full bg-terminal-purple transition-all",style:{width:`${Math.max(ie,1)}%`}}),ke&&n.jsx("div",{className:`h-full transition-all ${wt?"bg-terminal-orange":"bg-terminal-green"}`,style:{width:`${Math.max(Math.min(He,100-ie),1)}%`}})]})}),ke&&n.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] font-mono text-terminal-dimmer",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-sm bg-terminal-purple"}),ta(he)," used"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:`w-1.5 h-1.5 rounded-sm ${wt?"bg-terminal-orange":"bg-terminal-green"}`}),"+",ta(ce)," this upload"]})]})]})})()]}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer flex items-center gap-1.5 mb-1",children:[n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-terminal-orange",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Free tier links expire after 7 days"]}),Se&&n.jsxs("p",{className:"text-[11px] font-mono text-terminal-orange mt-1.5 flex items-center gap-1",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",ta(ce)," — exceeds 10MB limit"]}),J&&n.jsxs("div",{className:"mt-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:["expires ",new Date(`${J.expiresAt}Z`).toLocaleDateString()]})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsx("a",{href:`${Ze}/r/${J.id}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-purple hover:text-terminal-text transition-colors truncate",children:`${Ze}/r/${J.id}`}),n.jsx(Fs,{text:`${Ze}/r/${J.id}`})]})]}),n.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[n.jsx("button",{onClick:Ue,disabled:W||Se,className:`${$t} ${Se?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":J?"bg-terminal-surface-hover text-terminal-purple hover:bg-terminal-purple-subtle border border-terminal-border":"bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]"}`,children:W?"Uploading...":Se?"Too large":J?"Update":"Share to Cloud"}),J&&n.jsx("button",{onClick:tt,disabled:W,className:`${$t} bg-terminal-surface-hover text-terminal-red hover:bg-terminal-red-subtle border border-terminal-border`,children:"Delete"}),_&&n.jsx("span",{className:`text-[11px] font-mono ${_.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:_.text})]})]}),j&&n.jsxs("div",{className:"bg-terminal-surface rounded-xl border border-terminal-border shadow-layer-sm overflow-hidden p-5 flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:"text-sm font-mono font-semibold text-terminal-dim",children:"GitHub Gist"}),n.jsx("span",{className:"text-[10px] font-mono font-semibold px-2 py-0.5 rounded-md bg-terminal-surface-2 text-terminal-dimmer",children:"Public"})]}),n.jsxs("ul",{className:"space-y-1.5 text-xs font-sans text-terminal-dim mb-auto",children:[n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Hosted on GitHub forever"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-green shrink-0",children:"✓"}),"Doesn't use your storage"]}),n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-terminal-orange shrink-0",children:"!"}),"Visible to everyone on the internet"]})]}),Be&&n.jsxs("p",{className:"text-[11px] font-mono text-terminal-red mt-1.5 flex items-center gap-1",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v5.5a1 1 0 0 1-2 0V2a1 1 0 0 1 1-1zM8 11a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 8 11z"})}),"Replay is ",ta(ce)," — exceeds 10MB limit"]}),R&&n.jsxs("div",{className:"mt-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-2 py-0.5 rounded-full bg-terminal-green-subtle",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Published"]}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:fi(R.updatedAt)})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsx("a",{href:R.viewerUrl,target:"_blank",rel:"noopener noreferrer",className:"flex-1 text-xs font-mono text-terminal-blue hover:text-terminal-text transition-colors truncate",children:R.viewerUrl}),n.jsx(Fs,{text:R.viewerUrl})]})]}),$&&!R&&n.jsx("div",{className:"mt-4 text-[11px] font-mono text-terminal-dimmer animate-pulse",children:"Checking..."}),n.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[n.jsx("button",{onClick:Oe,disabled:Q||Be,className:`${$t} ${Be?"bg-terminal-surface-2 text-terminal-dimmer border border-terminal-border cursor-not-allowed":"bg-terminal-surface-hover text-terminal-dim hover:bg-terminal-surface-2 border border-terminal-border"}`,children:Q?"Publishing...":Be?"Too large":R?"Update Gist":"Publish to Gist"}),k&&n.jsx("span",{className:`text-[11px] font-mono ${k.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:k.text}),R&&n.jsx("a",{href:R.gistUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] font-mono text-terminal-blue hover:text-terminal-text transition-colors",children:"Open on GitHub"})]})]})]}):n.jsx("div",{className:"text-[11px] font-mono text-terminal-dimmer animate-pulse p-2",children:"Checking login status..."})]}),n.jsxs("div",{id:"export",children:[n.jsx(Sh,{title:"Export",color:"text-terminal-green"}),n.jsxs("div",{className:"space-y-4",children:[j&&h&&n.jsxs(n.Fragment,{children:[K?.gifContent&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green",children:"Animated GIF"}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Works everywhere: GitHub PRs, issues, READMEs, Slack, Discord. Shows up to 8 turns."})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[K.gifGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:fi(K.gifGeneratedAt)}),n.jsx("button",{onClick:rn,disabled:ue||C,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-green transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:ue||C?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]})})]})]}),n.jsx("div",{className:"bg-terminal-bg p-2 flex justify-center border-y border-terminal-border-subtle",children:n.jsx("img",{src:`data:image/gif;base64,${K.gifContent}`,alt:"Session preview GIF",className:"w-full h-auto block"})}),n.jsxs("div",{className:"px-5 py-3 space-y-2 border-t border-terminal-border-subtle",children:[K.gifPath&&n.jsx(ru,{label:"File",path:`${K.gifPath} (${ta(K.gifContent?.length??0,!0)})`}),be?n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-1.5 py-0.5 rounded-full bg-terminal-green-subtle shrink-0",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsx("span",{className:"flex-1 text-xs font-mono text-terminal-purple truncate",children:be.url}),n.jsx(Fs,{text:be.url})]}):n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed",children:["Usage:"," ",n.jsx("span",{className:"text-terminal-text",children:""})]}),M&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:()=>Ft("gif"),disabled:Fe==="gif",className:"text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]",children:Fe==="gif"?"Uploading...":be?"Update link":"Share to Cloud"}),Bt&&Fe===null&&n.jsx("span",{className:`text-[10px] font-mono ${Bt.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:Bt.text})]})]})]}),K?.svgContent&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Animated SVG"}),n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:["Embed in READMEs, PRs, or anywhere that renders SVG. Shows up to"," ",$1," turns."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[K.svgGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:fi(K.svgGeneratedAt)}),n.jsx("button",{onClick:rn,disabled:ue||C,className:"text-[11px] font-mono text-terminal-dim hover:text-terminal-orange transition-colors px-1.5 py-0.5 rounded bg-terminal-bg hover:bg-terminal-surface-hover border border-terminal-border-subtle",title:"Regenerate all exports",children:ue||C?n.jsx("span",{className:"animate-pulse",children:"..."}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),n.jsx("path",{d:"M21 3v5h-5"}),n.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),n.jsx("path",{d:"M8 16H3v5"})]})})]})]}),n.jsx("div",{className:"bg-terminal-bg p-2 border-y border-terminal-border-subtle [&>svg]:w-full [&>svg]:h-auto [&>svg]:block",dangerouslySetInnerHTML:{__html:zn}}),n.jsxs("div",{className:"px-5 py-3 space-y-2 border-t border-terminal-border-subtle",children:[n.jsx(ru,{label:"File",path:`${K.svgPath} (${ta(K.svgContent?.length??0)})`}),K.replayUrl&&n.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-dimmer w-8 shrink-0",children:"Link"}),n.jsx("a",{href:K.replayUrl,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-blue hover:text-terminal-text transition-colors truncate",children:K.replayUrl})]}),lt?n.jsxs("div",{className:"flex items-center gap-2 bg-terminal-bg rounded-lg px-3 py-2 border border-terminal-border-subtle",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-semibold text-terminal-green px-1.5 py-0.5 rounded-full bg-terminal-green-subtle shrink-0",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green"}),"Shared"]}),n.jsx("span",{className:"flex-1 text-xs font-mono text-terminal-purple truncate",children:lt.url}),n.jsx(Fs,{text:lt.url})]}):n.jsxs("p",{className:"text-[10px] font-mono text-terminal-dimmer leading-relaxed",children:["Usage:"," ",n.jsx("span",{className:"text-terminal-text",children:""})]}),M&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:()=>Ft("svg"),disabled:Fe==="svg",className:"text-[11px] font-mono px-3 py-1.5 rounded-lg transition-colors bg-terminal-purple-subtle text-terminal-purple hover:bg-[rgba(168,85,247,0.25)] border border-[rgba(168,85,247,0.2)]",children:Fe==="svg"?"Uploading...":lt?"Update link":"Share to Cloud"}),qt&&Fe===null&&n.jsx("span",{className:`text-[10px] font-mono ${qt.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:qt.text})]})]})]}),K?.markdown&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 flex items-center justify-between border-b border-terminal-border-subtle",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-orange",children:"Markdown Summary"}),n.jsx("p",{className:"text-[10px] font-mono text-terminal-dim mt-0.5",children:"Paste into GitHub PRs, issues, or README files."})]}),K.mdGeneratedAt&&n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer self-start mt-0.5",children:fi(K.mdGeneratedAt)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Fs,{text:K.markdown,label:"Copy MD"}),n.jsxs("div",{className:"flex items-center h-6 rounded-md overflow-hidden bg-terminal-bg border border-terminal-border-subtle",children:[n.jsx("button",{onClick:()=>pe("preview"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${de==="preview"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Preview"}),n.jsx("button",{onClick:()=>pe("source"),className:`h-full px-2.5 text-[10px] font-mono transition-colors ${de==="source"?"bg-terminal-orange-subtle text-terminal-orange":"text-terminal-dim hover:text-terminal-text"}`,children:"Source"})]})]})]}),n.jsx("div",{className:"p-4",children:de==="preview"?n.jsx("div",{className:"prose-terminal text-xs leading-relaxed bg-terminal-bg rounded-lg border border-terminal-border-subtle p-4 overflow-x-auto",dangerouslySetInnerHTML:{__html:Ln}}):n.jsx("pre",{className:"bg-terminal-bg rounded-lg border border-terminal-border-subtle p-3 text-[11px] font-mono text-terminal-dim leading-relaxed overflow-x-auto max-h-72 overflow-y-auto whitespace-pre-wrap",children:K.markdown})}),n.jsx("div",{className:"px-5 py-3 space-y-1.5 border-t border-terminal-border-subtle",children:n.jsx(ru,{label:"File",path:K.mdPath})}),K.warnings&&K.warnings.length>0&&n.jsxs("div",{className:"mx-5 mb-4 text-[11px] font-mono text-terminal-orange px-3 py-2 rounded-lg bg-terminal-orange-subtle/50 border border-terminal-orange/10",children:[n.jsx("div",{className:"font-semibold mb-1",children:"Security warnings"}),K.warnings.map((ie,ke)=>n.jsx("div",{className:"text-terminal-dim",children:ie},ke))]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:rn,disabled:ue||C,className:`${$t} ${K?"bg-terminal-surface-hover text-terminal-orange hover:bg-terminal-orange-subtle border border-terminal-border":"bg-terminal-orange-subtle text-terminal-orange hover:bg-terminal-orange-emphasis border border-terminal-orange/20"}`,children:ue||C?"Generating...":K?"Regenerate GIF + SVG + Markdown":"Generate GIF + SVG + Markdown"}),te&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-red",children:te}),!K&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim",children:"For GitHub PRs, READMEs, websites, email, Slack, and more. Shows up to 8 turns."})]})]}),j&&x&&n.jsxs("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"HTML Replay"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Self-contained HTML file with zero external requests. Includes all scenes, metadata, and annotations. Share via email, Slack, or host on any static server."})]}),n.jsx("button",{onClick:async()=>{S(null);try{const ie=await x();S({type:"success",text:ie})}catch(ie){S({type:"error",text:ie instanceof Error?ie.message:String(ie)})}},disabled:v,className:`${$t} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:v?"Exporting...":"Export HTML"})]}),w&&n.jsx("div",{className:`mt-3 text-[11px] font-mono ${w.type==="success"?"text-terminal-green":"text-terminal-red"}`,children:w.type==="success"?n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-terminal-green shrink-0"}),"Saved to ",w.text]}):w.text})]}),!j&&m&&n.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-green mb-1",children:"Save HTML"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Download a self-contained HTML replay file with your comments included."})]}),n.jsx("button",{onClick:p,className:`${$t} bg-terminal-green-subtle text-terminal-green hover:bg-terminal-green-emphasis border border-terminal-green/20`,children:"Download HTML"})]})}),n.jsx("div",{className:"bg-terminal-surface rounded-2xl border border-terminal-border-subtle shadow-layer-sm p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-mono font-semibold text-terminal-blue mb-1",children:"JSON Data"}),n.jsx("p",{className:"text-[11px] font-mono text-terminal-dim leading-relaxed",children:"Raw replay data including all scenes, metadata, and annotations. Useful for backup, re-import, or programmatic analysis."})]}),n.jsx("button",{onClick:g,className:`${$t} bg-terminal-blue-subtle text-terminal-blue hover:bg-terminal-blue-emphasis border border-terminal-blue/20`,children:"Download JSON"})]})})]})]})]})})})}const H1=[{title:"Playback",items:[{key:"Space",label:"Play / Pause"},{key:"↑ / ↓",label:"Step Back / Forward"},{key:"Home",label:"Reset to Start"},{key:"End / e",label:"Jump to End"}]},{title:"Navigation",items:[{key:"n / p",label:"Next / Prev Turn"},{key:"← / →",label:"Collapse / Expand Item"}]},{title:"Global",items:[{key:"?",label:"Show Keyboard Shortcuts"},{key:"⌘ K",label:"Open Search"},{key:"Esc",label:"Close Modal / Search"}]}];function G1({open:l,onClose:r}){const i=y.useCallback(o=>{(o.key==="Escape"||o.key==="?")&&r()},[r]);return y.useEffect(()=>{if(l)return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[l,i]),l?n.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/60 backdrop-blur-md animate-in fade-in duration-300",onClick:r,role:"dialog","aria-label":"Keyboard shortcuts","aria-modal":"true",children:n.jsxs("div",{className:"w-full max-w-lg bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden animate-in zoom-in-95 duration-200",onClick:o=>o.stopPropagation(),children:[n.jsxs("div",{className:"px-6 py-5 border-b border-terminal-border-subtle flex items-center justify-between",children:[n.jsx("h2",{className:"text-sm font-sans font-bold uppercase tracking-[0.2em] text-terminal-text",children:"Keyboard Shortcuts"}),n.jsx("button",{onClick:r,className:"text-terminal-dimmer hover:text-terminal-red transition-colors",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsx("div",{className:"px-6 py-4 grid grid-cols-1 gap-8",children:H1.map(o=>n.jsxs("div",{className:"space-y-3.5",children:[n.jsx("h3",{className:"text-[10px] font-sans font-bold text-terminal-dimmer uppercase tracking-[0.15em] pl-1",children:o.title}),n.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:o.items.map(u=>n.jsxs("div",{className:"flex items-center justify-between group",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:u.label}),n.jsx("kbd",{className:"min-w-[40px] px-2 py-1 flex items-center justify-center text-[11px] font-mono font-bold text-terminal-text bg-terminal-surface border border-terminal-border-subtle rounded-lg shadow-layer-sm",children:u.key})]},u.key))})]},o.title))}),n.jsx("div",{className:"px-6 py-4 bg-terminal-surface/30 border-t border-terminal-border-subtle",children:n.jsxs("p",{className:"text-[10px] font-sans font-medium text-terminal-dimmer text-center uppercase tracking-wider",children:["Press ",n.jsx("span",{className:"text-terminal-text font-mono font-bold",children:"?"})," to toggle this menu anytime"]})})]})}):null}function q1(l){return l==="claude-code"?"Claude Code":l==="cursor"?"Cursor":l}function Y1({session:l,onStart:r,onViewInsights:i}){const{meta:o,scenes:u}=l,m=y.useMemo(()=>{const j=u.find(O=>O.type==="user-prompt");if(!j||j.type!=="user-prompt")return null;const w=j.content,S={};let k=0,E=0,M="",A=0;for(const O of u){if(O.type==="user-prompt"){if(A++,A>1)break;continue}if(A===1)if(O.type==="tool-call"){E++;const $=O.toolName.replace(/^mcp__.*__/,"");S[$]=(S[$]||0)+1}else O.type==="text-response"&&(k++,M=O.content)}const R=Object.entries(S).sort((O,$)=>$[1]-O[1]);return{prompt:w,responses:k,totalTools:E,toolEntries:R,lastResponse:M}},[u]),p=y.useMemo(()=>{const j=new Set;for(const w of u)w.type==="tool-call"&&w.diff&&j.add(w.diff.filePath);return j.size},[u]),g=vt(o.stats.durationMs),f=o.title||o.project,x=q1(o.provider),h=y.useMemo(()=>{const j=[];if(g&&j.push({value:g,label:"Duration",color:"text-terminal-text"}),j.push({value:String(o.stats.userPrompts),label:"Turns",color:"text-terminal-green"}),p>0&&j.push({value:String(p),label:"Files",color:"text-terminal-blue"}),o.stats.costEstimate!==void 0){const w=o.stats.costEstimate;j.push({value:`$${w<.01?w.toFixed(4):w.toFixed(2)}`,label:"Cost",color:"text-terminal-orange"})}return j.length<3&&o.stats.toolCalls>0&&j.push({value:String(o.stats.toolCalls),label:"Tool Calls",color:"text-terminal-orange"}),j},[g,p,o.stats]),v=y.useRef(!1),C=y.useRef(0);return y.useEffect(()=>{const j=k=>{v.current||k.deltaY>0&&(v.current=!0,r(!1))},w=k=>{C.current=k.touches[0].clientY},S=k=>{if(v.current)return;C.current-k.touches[0].clientY>15&&(v.current=!0,r(!1))};return window.addEventListener("wheel",j,{passive:!0}),window.addEventListener("touchstart",w,{passive:!0}),window.addEventListener("touchmove",S,{passive:!0}),()=>{window.removeEventListener("wheel",j),window.removeEventListener("touchstart",w),window.removeEventListener("touchmove",S)}},[r]),y.useEffect(()=>{const j=w=>{(w.key===" "||w.key==="Enter"||w.key==="ArrowDown"||w.key==="ArrowRight")&&(w.preventDefault(),r())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[r]),n.jsxs("div",{className:"flex-1 flex flex-col items-center overflow-y-auto relative",children:[n.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-terminal-green-subtle via-transparent to-transparent"}),n.jsx("div",{className:"absolute inset-0 bg-dot-grid"})]}),n.jsx("div",{className:"flex-1 min-h-4 md:min-h-0"}),n.jsxs("div",{className:"max-w-2xl w-full px-6 md:px-8 pt-4 md:pt-0 text-center space-y-5 md:space-y-7 z-10 shrink-0",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-sans font-bold text-terminal-text leading-[1.15] tracking-tight",children:f}),n.jsxs("p",{className:"text-sm font-sans text-terminal-dim",children:["A ",x," session replay by ",n.jsx("a",{href:"https://vibe-replay.com",target:"_blank",rel:"noopener noreferrer",className:"font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"})]}),(o.gitBranch||o.model)&&n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-2",children:[o.gitBranch&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-purple px-2 py-0.5 rounded-full bg-terminal-purple/10 border border-terminal-purple/20",title:o.gitBranches?o.gitBranches.join(" → "):o.gitBranch,children:o.gitBranches&&o.gitBranches.length>1?`${o.gitBranches[0]} → ${o.gitBranch}`:o.gitBranch}),o.model&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-dim px-2 py-0.5 rounded-full bg-terminal-surface border border-terminal-border-subtle",children:o.model}),o.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"text-[11px] font-mono text-terminal-orange px-2 py-0.5 rounded-full bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]})]}),m&&n.jsxs("button",{type:"button",onClick:()=>r(),className:"w-full text-left appearance-none bg-transparent border-none p-0 cursor-pointer space-y-3",children:[n.jsxs("div",{className:"rounded-2xl px-5 py-4 ml-4 md:ml-12 bg-terminal-green-subtle border border-terminal-green/30 shadow-layer-sm hover:bg-terminal-green-emphasis transition-all duration-200 ease-material",children:[n.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-green uppercase tracking-widest",children:"You"})}),n.jsx("div",{className:"text-terminal-green font-mono text-sm whitespace-pre-wrap break-words line-clamp-3",children:m.prompt})]}),n.jsxs("div",{className:"rounded-xl px-5 py-4 bg-terminal-surface shadow-layer-sm",children:[n.jsx("div",{className:"flex items-center gap-2 mb-2.5",children:n.jsx("span",{className:"text-[10px] font-sans font-semibold text-secondary-text uppercase tracking-widest",children:"Assistant"})}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 text-[11px] font-mono",children:[m.responses>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[m.responses," response",m.responses>1?"s":""]}),m.totalTools>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[m.totalTools," tool",m.totalTools>1?"s":""]}),m.toolEntries.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-terminal-border mx-0.5",children:"|"}),m.toolEntries.map(([j,w])=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-terminal-surface-hover text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-orange",children:j}),n.jsx("span",{children:w})]},j))]})]}),m.lastResponse&&n.jsx("div",{className:"text-sm font-mono text-terminal-dim whitespace-pre-wrap break-words line-clamp-2 leading-relaxed",children:m.lastResponse})]}),o.stats.userPrompts>1&&n.jsx("div",{className:"text-center",children:n.jsxs("span",{className:"text-[11px] font-sans text-terminal-dimmer",children:["and ",o.stats.userPrompts-1," more turn",o.stats.userPrompts-1!==1?"s":""," ","→"]})})]}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 max-w-lg mx-auto",children:h.map(j=>n.jsxs("div",{className:"bg-terminal-surface rounded-lg sm:rounded-xl px-2.5 py-2 sm:px-3 sm:py-3 shadow-layer-sm",children:[n.jsx("div",{className:`text-base sm:text-xl font-bold font-mono tabular-nums ${j.color}`,children:j.value}),n.jsx("div",{className:"text-[9px] sm:text-[10px] font-sans text-terminal-dimmer uppercase tracking-widest font-medium",children:j.label})]},j.label))}),n.jsxs("div",{className:"hidden md:flex items-center justify-center gap-3 flex-wrap",children:[n.jsxs("button",{type:"button",onClick:()=>r(),className:"group inline-flex items-center gap-3 px-10 py-4 rounded-xl bg-terminal-green-subtle hover:bg-terminal-green-emphasis transition-all duration-200 ease-material shadow-layer-md hover:shadow-layer-lg hover:-translate-y-0.5 landing-pulse",children:[n.jsx("span",{className:"text-xl text-terminal-green group-hover:scale-110 transition-transform duration-200",children:"▶"}),n.jsx("span",{className:"text-base font-sans font-semibold text-terminal-green tracking-wide",children:"Watch Replay"})]}),i&&n.jsxs("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-2 px-6 py-4 rounded-xl bg-terminal-surface hover:bg-terminal-surface-hover transition-all duration-200 ease-material shadow-layer-sm hover:shadow-layer-md border border-terminal-border/40 hover:border-terminal-border",children:[n.jsxs("svg",{"aria-hidden":"true",className:"w-4 h-4 text-terminal-blue group-hover:scale-110 transition-transform duration-200",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),n.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),n.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),n.jsx("span",{className:"text-sm font-sans font-semibold text-terminal-dim group-hover:text-terminal-text tracking-wide",children:"View Insights"})]})]}),n.jsx("div",{className:"h-24 md:hidden"})]}),n.jsxs("button",{type:"button",onClick:()=>r(!1),className:"hidden md:flex mt-8 md:mt-10 mb-6 z-10 shrink-0 flex-col items-center gap-2 group cursor-pointer",children:[n.jsx("span",{className:"text-xs font-sans font-medium text-terminal-dim group-hover:text-terminal-text transition-colors",children:"or scroll down"}),n.jsx("svg",{"aria-hidden":"true",className:"w-6 h-6 text-terminal-green animate-bounce group-hover:scale-110 transition-transform",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M6 9l6 6 6-6"})})]}),n.jsx("div",{className:"flex-1 min-h-0"}),n.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-50 bg-terminal-bg border-t border-terminal-border-subtle safe-bottom",children:n.jsxs("div",{className:"flex items-center gap-3 mx-6 my-4",children:[n.jsxs("button",{type:"button",onClick:()=>r(),className:"flex-[2] inline-flex items-center justify-center gap-2.5 py-3.5 rounded-xl bg-terminal-green text-terminal-bg font-semibold shadow-lg shadow-terminal-green/20 transition-all",children:[n.jsx("span",{className:"text-base",children:"▶"}),n.jsx("span",{className:"text-sm font-sans",children:"Watch Replay"})]}),i&&n.jsxs("button",{type:"button",onClick:i,className:"flex-1 inline-flex items-center justify-center gap-2 py-3.5 rounded-xl bg-terminal-surface border border-terminal-border-subtle hover:border-terminal-border transition-all",children:[n.jsxs("svg",{"aria-hidden":"true",className:"w-3.5 h-3.5 text-terminal-blue",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",x2:"18",y1:"20",y2:"10"}),n.jsx("line",{x1:"12",x2:"12",y1:"20",y2:"4"}),n.jsx("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),n.jsx("span",{className:"text-sm font-sans font-medium text-terminal-dim",children:"Insights"})]})]})})]})}function kh({scenes:l,currentIndex:r,onSeek:i,overlayActions:o,turnStats:u}){const m=y.useMemo(()=>{const g=[];let f=null,x=0;return l.forEach((h,v)=>{if(h.type==="user-prompt"){f&&(f.endIndex=v-1,g.push(f)),x++;const j=o?.getEffectiveContent(v)??h.content;f={kind:"turn",turnNumber:x,promptIndex:v,prompt:j.replace(/\n/g," ").slice(0,120),toolCalls:0,toolNames:[],thinkingBlocks:0,textBlocks:0,subAgentCalls:0,endIndex:v}}else h.type==="compaction-summary"||h.type==="context-injection"?(f&&(f.endIndex=v-1,g.push(f),f=null),g.push({kind:h.type==="context-injection"?"injection":"compaction",promptIndex:v,preview:h.content.replace(/\n/g," ").slice(0,80)})):f&&(f.endIndex=v,h.type==="tool-call"?(f.toolCalls++,h.toolName==="Agent"&&h.subAgent&&f.subAgentCalls++,f.toolNames.includes(h.toolName)||f.toolNames.push(h.toolName)):h.type==="thinking"?f.thinkingBlocks++:h.type==="text-response"&&f.textBlocks++)}),f&&g.push(f),g},[l,o?.getEffectiveContent]),p=y.useMemo(()=>{for(let g=m.length-1;g>=0;g--)if(r>=m[g].promptIndex)return g;return-1},[m,r]);return n.jsx("div",{className:"flex flex-col gap-1 p-3.5 overflow-y-auto",children:m.map((g,f)=>{const x=f===p,h=f<p;if(g.kind==="compaction"||g.kind==="injection"){const v=g.kind==="injection"?"System context":"Context compacted",C=g.kind==="injection"?"⚡":"⟳";return n.jsx("button",{onClick:()=>i(g.promptIndex),className:`text-left px-3 py-2 rounded-lg transition-all duration-200 ease-material ${x?"bg-terminal-surface border-l-2 border-terminal-dim shadow-layer-sm":"hover:bg-terminal-surface-hover text-terminal-dimmer hover:text-terminal-dim"}`,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0",children:C}),n.jsx("span",{className:"text-xs font-mono text-terminal-dimmer italic truncate",children:v})]})},`c-${g.promptIndex}`)}return n.jsxs("button",{onClick:()=>i(g.promptIndex),className:`group text-left px-3 py-2.5 rounded-xl transition-all duration-200 ease-material ${x?"bg-terminal-green-subtle border-l-2 border-terminal-green shadow-layer-sm":h?"hover:bg-terminal-surface-hover text-terminal-dim hover:text-terminal-text":"hover:bg-terminal-surface-hover"}`,children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("span",{className:`text-xs font-mono font-semibold shrink-0 mt-px tabular-nums ${x?"text-terminal-green":"text-terminal-dim"}`,children:String(g.turnNumber).padStart(2,"0")}),n.jsx("span",{className:"text-sm font-mono leading-snug line-clamp-2 text-terminal-text",children:g.prompt})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1.5 ml-6 flex-wrap",children:[g.toolCalls>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-orange-subtle text-terminal-orange",children:[g.toolCalls," tool",g.toolCalls>1?"s":""]}),g.subAgentCalls>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-green-500/20 text-green-300",children:[g.subAgentCalls," agent",g.subAgentCalls>1?"s":""]}),g.textBlocks>0&&n.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-blue-subtle text-terminal-blue",children:[g.textBlocks," resp"]}),g.thinkingBlocks>0&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-px rounded-full bg-terminal-purple-subtle text-terminal-purple",children:"think"}),(()=>{const v=u?.[g.turnNumber-1];return v?.durationMs?n.jsx("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:vt(v.durationMs)}):null})()]}),x&&g.toolNames.length>0&&n.jsx("div",{className:"mt-1.5 ml-6 text-xs font-mono text-terminal-dim truncate",children:g.toolNames.join(", ")})]},`t-${g.promptIndex}`)})})}function F1(l){switch(l.type){case"user-prompt":return l.content;case"compaction-summary":return l.content;case"context-injection":return l.content;case"thinking":return l.content;case"text-response":return l.content;case"tool-call":return[l.toolName,JSON.stringify(l.input),l.result||"",l.bashOutput?.command||"",l.bashOutput?.stdout||""].join(" ");default:return""}}function Z1(l,r){const i=l.toLowerCase().indexOf(r.toLowerCase());if(i===-1)return l.slice(0,120);const o=Math.max(0,i-40),u=Math.min(l.length,i+r.length+60);return(o>0?"...":"")+l.slice(o,u)+(u<l.length?"...":"")}const V1={"user-prompt":"User","compaction-summary":"Compaction","context-injection":"Injection",thinking:"Thinking","text-response":"Response","tool-call":"Tool"},Q1={"user-prompt":"text-terminal-green","compaction-summary":"text-terminal-dim","context-injection":"text-blue-400",thinking:"text-terminal-purple","text-response":"text-terminal-blue","tool-call":"text-terminal-orange"};function X1({scenes:l,open:r,onClose:i,onSeek:o}){const[u,m]=y.useState(""),[p,g]=y.useState(0),f=y.useRef(null),x=y.useRef(null);y.useEffect(()=>{r&&(m(""),g(0),setTimeout(()=>f.current?.focus(),50))},[r]);const h=y.useMemo(()=>{if(u.length<2)return[];const j=u.toLowerCase(),w=[];for(let S=0;S<l.length;S++){const k=l[S],E=F1(k);if(E.toLowerCase().includes(j)&&w.push({sceneIndex:S,type:k.type,snippet:Z1(E,u),toolName:k.type==="tool-call"?k.toolName:void 0}),w.length>=50)break}return w},[l,u]);y.useEffect(()=>{if(!x.current)return;x.current.children[p]?.scrollIntoView({block:"nearest"})},[p]);const v=y.useCallback(j=>{const w=h[j];w&&(o(w.sceneIndex),i())},[h,o,i]),C=y.useCallback(j=>{j.key==="ArrowDown"?(j.preventDefault(),g(w=>Math.min(w+1,h.length-1))):j.key==="ArrowUp"?(j.preventDefault(),g(w=>Math.max(w-1,0))):j.key==="Enter"?(j.preventDefault(),v(p)):j.key==="Escape"&&i()},[h.length,p,v,i]);return r?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[8vh] sm:pt-[15vh]",onClick:i,role:"dialog","aria-label":"Search scenes","aria-modal":"true",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),n.jsxs("div",{className:"relative w-full max-w-xl mx-3 sm:mx-0 bg-terminal-bg border border-terminal-border-subtle rounded-2xl shadow-layer-xl overflow-hidden",onClick:j=>j.stopPropagation(),onKeyDown:C,children:[n.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-terminal-border-subtle",children:[n.jsx("span",{className:"text-terminal-dim text-sm",children:"🔍"}),n.jsx("input",{ref:f,type:"text",value:u,onChange:j=>{m(j.target.value),g(0)},placeholder:"Search scenes...","aria-label":"Search scenes",className:"flex-1 bg-transparent text-sm font-sans font-medium text-terminal-text placeholder-terminal-dim outline-none"}),n.jsx("kbd",{className:"text-[10px] font-mono text-terminal-dimmer bg-terminal-surface px-2 py-0.5 rounded-md",children:"ESC"})]}),n.jsx("div",{ref:x,className:"max-h-[50vh] overflow-y-auto",children:u.length<2?n.jsx("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:"Type at least 2 characters to search"}):h.length===0?n.jsxs("div",{className:"px-4 py-8 text-center text-xs font-sans font-medium text-terminal-dim",children:['No results for "',u,'"']}):h.map((j,w)=>n.jsxs("button",{onClick:()=>v(w),className:`w-full text-left px-4 py-2.5 flex items-start gap-3 transition-colors ${w===p?"bg-terminal-green/10":"hover:bg-terminal-surface/50"}`,children:[n.jsx("span",{className:`text-[10px] font-sans font-bold uppercase shrink-0 mt-0.5 tracking-wider ${Q1[j.type]||"text-terminal-dim"}`,children:j.toolName||V1[j.type]||j.type}),n.jsx("span",{className:"text-xs font-mono text-terminal-text line-clamp-2 break-words",children:I1(j.snippet,u)}),n.jsxs("span",{className:"text-xs font-mono text-terminal-dimmer shrink-0 mt-0.5",children:["#",j.sceneIndex]})]},j.sceneIndex))}),h.length>0&&n.jsxs("div",{className:"px-4 py-2 border-t border-terminal-border-subtle text-[10px] font-sans font-bold uppercase tracking-wider text-terminal-dimmer flex gap-4",children:[n.jsxs("span",{children:[h.length," result",h.length!==1?"s":""]}),n.jsx("span",{children:"↑↓ navigate"}),n.jsx("span",{children:"↵ select"})]})]})]}):null}function I1(l,r){if(!r)return l;const i=[],o=l.toLowerCase(),u=r.toLowerCase();let m=0,p=o.indexOf(u);for(;p!==-1;)p>m&&i.push(l.slice(m,p)),i.push(n.jsx("mark",{className:"bg-terminal-green/30 text-terminal-green rounded-sm px-0.5",children:l.slice(p,p+r.length)},p)),m=p+r.length,p=o.indexOf(u,m);return m<l.length&&i.push(l.slice(m)),i}function J1(l){const r=l.toLowerCase();return/\b(test|jest|vitest|pytest|cargo\s+test|mocha|spec)\b/.test(r)?"test":/\b(build|compile|tsc|webpack|vite\s+build|rollup)\b/.test(r)?"build":r.trimStart().startsWith("git ")?"git":/\b(lint|biome|eslint|prettier|format)\b/.test(r)?"lint":"other"}function K1(l){return l?{sqlite:"SQLite (store.db)","global-state":"SQLite (global state.vscdb)",jsonl:"JSONL transcript","jsonl+tools":"JSONL + agent-tools"}[l]||l:"unknown"}function jx(l,r){if(!l)return;if(!r||r.length<=1)return[l];const i=[...r],o=i.lastIndexOf(l);return o>=0&&o!==i.length-1&&(i.splice(o,1),i.push(l)),i}function P1(l,r){const i=jx(l,r);if(i)return i.length>1?`${i[0]} → ${i[i.length-1]}`:i[0]}function W1(l,r){return jx(l,r)?.join(" → ")}function wx(l){const[r,i]=y.useState(null),o=y.useRef(null),u=y.useCallback(p=>{const g=o.current;if(!g||l<=1)return;const f=g.getBoundingClientRect(),x=(p.clientX-f.left)/f.width,h=Math.round(x*(l-1));i(Math.max(0,Math.min(l-1,h)))},[l]),m=y.useCallback(()=>i(null),[]);return{hovered:r,ref:o,onMouseMove:u,onMouseLeave:m}}function ej({session:l}){const{meta:r,scenes:i}=l,o=y.useMemo(()=>Uh(r),[r]),u=y.useMemo(()=>Wb(r),[r]),m=y.useMemo(()=>{const f=[];let x=0,h=0;const v=new Map,C=z=>{let Q=v.get(z);return Q||(Q={path:z,editCount:0,readCount:0,linesAdded:0,linesRemoved:0,turnEdits:new Map},v.set(z,Q)),Q},j=new Map,w=new Map;let S=0,k=0,E=0,M=0,A=0,R=0;const O=[],$=()=>{if(f.length>0){const z=f[f.length-1];z.toolCount=x,z.errorCount=h}};for(let z=0;z<i.length;z++){const Q=i[z];switch(Q.type){case"user-prompt":{$(),x=0,h=0,E+=Q.content.length;const ne=Q.content.split(`
|
|
154
|
+
`).find(W=>W.trim())||"";f.push({index:f.length+1,text:ne.slice(0,120),sceneIndex:z,toolCount:0,errorCount:0});break}case"thinking":S+=Q.content.length;break;case"text-response":k+=Q.content.length;break;case"tool-call":{x++;const ne=Q.toolName;if(j.set(ne,(j.get(ne)||0)+1),ne==="Read"){const W=Q.input?.file_path;W&&C(W).readCount++}else if(ne==="Edit"||ne==="Write"){if(Q.diff){const W=C(Q.diff.filePath);W.editCount++;const T=f.length;W.turnEdits.set(T,(W.turnEdits.get(T)||0)+1);const _=Q.diff.oldContent?Q.diff.oldContent.split(`
|
|
155
|
+
`).length:0,V=Q.diff.newContent?Q.diff.newContent.split(`
|
|
156
|
+
`).length:0;W.linesAdded+=Math.max(0,V-_),W.linesRemoved+=Math.max(0,_-V)}}else if(ne==="Agent"&&Q.subAgent){const W=Q.subAgent,T=W.tokenUsage,_=T?T.inputTokens+T.outputTokens+T.cacheCreationTokens+T.cacheReadTokens:0;A+=W.toolCalls,R+=_,O.push({agentType:W.agentType,description:W.description,toolCalls:W.toolCalls,thinkingBlocks:W.thinkingBlocks,textResponses:W.textResponses,totalTokens:_,model:W.model,sceneCount:W.scenes.length});for(const V of W.scenes)if(V.type==="tool-call"&&V.diff){const J=C(V.diff.filePath);J.editCount++;const P=f.length;J.turnEdits.set(P,(J.turnEdits.get(P)||0)+1);const he=V.diff.oldContent?V.diff.oldContent.split(`
|
|
157
|
+
`).length:0,G=V.diff.newContent?V.diff.newContent.split(`
|
|
158
|
+
`).length:0;J.linesAdded+=Math.max(0,G-he),J.linesRemoved+=Math.max(0,he-G)}}else if(ne==="Bash"){if(Q.bashOutput){const W=J1(Q.bashOutput.command);w.set(W,(w.get(W)||0)+1)}if(Q.isError)h++,M++;else if(!("isError"in Q)){const W=Q.result?.slice(0,500).toLowerCase()||"";/\b(error|fail|exception|errno)\b/.test(W)&&(h++,M++)}}break}}}$();const H=[...v.values()],K=H.filter(z=>z.editCount>0).sort((z,Q)=>Q.editCount-z.editCount),ae=H.filter(z=>z.editCount===0&&z.readCount>0).sort((z,Q)=>Q.readCount-z.readCount),ue=[...j.entries()].sort((z,Q)=>Q[1]-z[1]).slice(0,8),oe=[...w.entries()].sort((z,Q)=>Q[1]-z[1]),te=[...j.values()].reduce((z,Q)=>z+Q,0),xe=(j.get("Read")||0)+(j.get("Grep")||0)+(j.get("Glob")||0),de=(j.get("Edit")||0)+(j.get("Write")||0),pe=j.get("Bash")||0,U={read:xe,write:de,execute:pe,other:te-xe-de-pe};return{totalScenes:i.length,userPrompts:r.stats.userPrompts,toolCalls:r.stats.toolCalls,thinkingChars:S,responseChars:k,promptChars:E,durationMs:r.stats.durationMs,tokenUsage:r.stats.tokenUsage,costEstimate:r.stats.costEstimate,turns:f,editedFiles:K,readOnlyFiles:ae,topTools:ue,bashCats:oe,activityDist:U,totalTools:te,totalBashErrors:M,subAgents:O,totalDelegatedTools:A,totalDelegatedTokens:R}},[i,r]),p=r.stats.turnStats&&r.stats.turnStats.length>1,g=y.useMemo(()=>m.turns.map(f=>f.text.slice(0,60)+(f.text.length>60?"…":"")),[m.turns]);return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"p-6 space-y-6 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("h2",{className:"text-sm font-mono font-semibold text-terminal-text truncate",children:r.title||r.slug}),r.provider&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-dimmer px-1.5 py-0.5 rounded bg-terminal-surface border border-terminal-border-subtle",children:r.provider}),o.length>0&&n.jsx(Ea,{title:o.join(`
|
|
159
|
+
`),className:"shrink-0"}),r.gitBranch&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-purple px-1.5 py-0.5 rounded bg-terminal-purple/10 border border-terminal-purple/20",title:W1(r.gitBranch,r.gitBranches),children:P1(r.gitBranch,r.gitBranches)}),r.permissionMode==="bypassPermissions"&&n.jsx("span",{className:"shrink-0 text-[10px] font-mono text-terminal-orange px-1.5 py-0.5 rounded bg-terminal-orange/10 border border-terminal-orange/20",children:"dangerous mode"})]}),o.length>0&&n.jsxs("div",{className:"rounded border border-terminal-orange/40 bg-terminal-orange/10 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-orange uppercase tracking-widest mb-1",children:"Data Quality"}),n.jsx("div",{className:"space-y-0.5",children:o.slice(0,4).map(f=>n.jsx("div",{className:"text-xs font-mono text-terminal-dim",children:f},f))})]}),(r.dataSource||r.dataSourceInfo)&&n.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Data Source"}),n.jsx("div",{className:"text-xs font-mono text-terminal-text",children:K1(r.dataSourceInfo?.primary||r.dataSource)}),r.dataSourceInfo?.sources&&r.dataSourceInfo.sources.length>0&&n.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.sources.map(f=>n.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[n.jsx("span",{className:"text-terminal-green",children:"source:"})," ",f]},f))}),r.dataSourceInfo?.supplements&&r.dataSourceInfo.supplements.length>0&&n.jsx("div",{className:"mt-1 space-y-0.5",children:r.dataSourceInfo.supplements.map(f=>n.jsxs("div",{className:"text-xs font-mono text-terminal-dim truncate",title:f,children:[n.jsx("span",{className:"text-terminal-purple",children:"supplement:"})," ",f]},f))})]}),r.provider==="cursor"&&r.cursorSidecars&&(r.cursorSidecars.requestContextCount||r.cursorSidecars.checkpointCount||r.cursorSidecars.hasWorkspaceRules)&&n.jsxs("div",{className:"rounded border border-terminal-border-subtle bg-terminal-surface/40 px-3 py-2",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Cursor Sidecars"}),n.jsxs("div",{className:"space-y-0.5 text-xs font-mono text-terminal-dim",children:[r.cursorSidecars.requestContextCount?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-green",children:"request context:"})," ",r.cursorSidecars.requestContextCount," sidecar",r.cursorSidecars.requestContextCount===1?"":"s"]}):null,r.cursorSidecars.hasWorkspaceRules?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-purple",children:"workspace rules:"})," included"]}):null,r.cursorSidecars.checkpointCount?n.jsxs("div",{children:[n.jsx("span",{className:"text-terminal-orange",children:"checkpoint state:"})," ",r.cursorSidecars.checkpointCount," entr",r.cursorSidecars.checkpointCount===1?"y":"ies"]}):null]})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-3",children:"Overview"}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsx(Ul,{label:"Turns",value:m.userPrompts,color:"text-terminal-green"}),n.jsx(Ul,{label:"Tool Calls",value:m.toolCalls,color:"text-terminal-orange"}),n.jsx(Ul,{label:"Files Modified",value:m.editedFiles.length,color:"text-terminal-blue"}),n.jsx(Ul,{label:"Scenes",value:m.totalScenes,color:"text-terminal-text"})]}),m.totalDelegatedTools>0&&n.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs font-mono text-terminal-dim bg-green-500/5 border border-green-500/15 rounded-lg px-3 py-2",children:[n.jsxs("span",{className:"text-green-300",children:["+",m.totalDelegatedTools," tools delegated"]}),n.jsxs("span",{className:"text-terminal-dimmer",children:["to ",m.subAgents.length," sub-agent",m.subAgents.length>1?"s":""]}),m.totalDelegatedTokens>0&&n.jsxs("span",{className:"text-terminal-dimmer",children:["(",m.totalDelegatedTokens>1e6?`${(m.totalDelegatedTokens/1e6).toFixed(1)}M`:`${(m.totalDelegatedTokens/1e3).toFixed(0)}K`," ","tokens, context-free)"]})]}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-3 text-xs font-mono text-terminal-dim",children:[r.model&&n.jsxs("div",{children:["Model: ",n.jsx("span",{className:"text-terminal-text font-semibold",children:r.model})]}),(m.durationMs||u.duration)&&n.jsxs("div",{children:["Duration:"," ",n.jsx("span",{className:"text-terminal-text",children:m.durationMs?vt(m.durationMs):"unavailable"}),u.duration&&n.jsx(Ea,{title:u.duration,className:"ml-1"})]}),m.costEstimate!==void 0&&n.jsxs("div",{children:["Cost:"," ",n.jsxs("span",{className:"text-terminal-green",children:["$",m.costEstimate<.01?m.costEstimate.toFixed(4):m.costEstimate.toFixed(2)]}),n.jsx("span",{className:"text-terminal-dimmer",children:" (est.)"}),u.tokens&&n.jsx(Ea,{title:u.tokens,className:"ml-1"})]}),m.tokenUsage?n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:["In:"," ",n.jsx("span",{className:"text-terminal-blue",children:Ht(m.tokenUsage.inputTokens)})," / ","Out:"," ",n.jsx("span",{className:"text-terminal-green",children:Ht(m.tokenUsage.outputTokens)})]}),n.jsxs("div",{children:["Cache:"," ",n.jsx("span",{className:"text-terminal-purple",children:Ht(m.tokenUsage.cacheReadTokens)})," ","read /"," ",n.jsx("span",{className:"text-terminal-orange",children:Ht(m.tokenUsage.cacheCreationTokens)})," ","created"]})]}):u.tokens&&n.jsxs("div",{children:["Tokens: ",n.jsx("span",{className:"text-terminal-text",children:"unavailable"}),n.jsx(Ea,{title:u.tokens,className:"ml-1"})]}),!p&&u.turnStats&&n.jsxs("div",{children:["Turn Stats: ",n.jsx("span",{className:"text-terminal-text",children:"limited"}),n.jsx(Ea,{title:u.turnStats,className:"ml-1"})]})]})]}),p&&n.jsxs("div",{className:"space-y-5",children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Per-Turn Metrics"}),n.jsx(nj,{turnStats:r.stats.turnStats,costEstimate:r.stats.costEstimate,turnLabels:g}),n.jsx(lj,{turnStats:r.stats.turnStats,turnLabels:g}),m.turns.length>=2&&n.jsx(ij,{turns:m.turns,turnLabels:g}),r.stats.turnStats.some(f=>f.durationMs)&&n.jsx(sj,{turnStats:r.stats.turnStats,turnLabels:g})]}),r.tokenUsageByModel&&Object.keys(r.tokenUsageByModel).length>1&&n.jsx(rj,{tokenUsageByModel:r.tokenUsageByModel}),r.apiErrors&&r.apiErrors.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"API Issues"}),n.jsx("div",{className:"text-xs font-mono text-terminal-dim space-y-1",children:(()=>{const f=r.apiErrors,x=Math.max(0,...f.map(j=>j.retryAttempt||0)),h=f.some(j=>j.errorType==="overloaded_error"||j.statusCode===529),v=f.some(j=>j.errorType==="rate_limit_error"||j.statusCode===429),C=[];return h&&C.push("API was overloaded"),v&&C.push("hit rate limits"),C.length===0&&C.push("API errors occurred"),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-text",children:[C.join(" and ")," ",n.jsxs("span",{className:"text-terminal-red",children:[f.length," times"]})," during this session",x>1&&n.jsxs(n.Fragment,{children:[", with up to"," ",n.jsxs("span",{className:"text-terminal-orange",children:[x," retries"]})," in a row"]}),"."]}),n.jsx("div",{className:"text-terminal-dimmer",children:x>0?"Cursor automatically retried some of these errors.":"These errors were observed in local Cursor metadata."})]})})()})]}),r.trackedFiles&&r.trackedFiles.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Files Tracked (",r.trackedFiles.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.trackedFiles.map(f=>n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.contextFiles&&r.contextFiles.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Context Files (inferred, ",r.contextFiles.length,")"]}),n.jsx("div",{className:"space-y-0.5 max-h-[200px] overflow-y-auto",children:r.contextFiles.map(f=>n.jsx("div",{className:"text-[10px] font-mono text-terminal-dim truncate px-2 py-0.5 rounded hover:bg-terminal-surface-hover",title:f,children:f},f))})]}),r.prLinks&&r.prLinks.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Pull Requests"}),n.jsx("div",{className:"space-y-1",children:r.prLinks.map(f=>n.jsxs("a",{href:f.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs font-mono text-terminal-blue hover:underline px-2 py-1 rounded hover:bg-terminal-surface-hover transition-colors",children:[n.jsxs("span",{className:"text-terminal-green",children:["#",f.prNumber]}),f.prRepository&&n.jsx("span",{className:"text-terminal-dimmer truncate",children:f.prRepository})]},f.prUrl))})]}),m.turns.length>0&&n.jsx(cj,{turns:m.turns,turnStats:r.stats.turnStats}),n.jsx(oj,{editedFiles:m.editedFiles,turns:m.turns}),(m.editedFiles.length>0||m.readOnlyFiles.length>0)&&n.jsx(dj,{editedFiles:m.editedFiles,readOnlyFiles:m.readOnlyFiles}),m.bashCats.length>1&&n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Bash Commands",m.totalBashErrors>0&&n.jsxs("span",{className:"text-terminal-red ml-2 normal-case tracking-normal",children:[m.totalBashErrors," error",m.totalBashErrors!==1?"s":""]})]}),n.jsx("div",{className:"flex flex-wrap gap-2",children:m.bashCats.map(([f,x])=>n.jsxs("span",{className:"text-xs font-mono text-terminal-dim bg-terminal-surface rounded px-2 py-1",children:[f," ",n.jsx("span",{className:"text-terminal-text tabular-nums",children:x})]},f))})]}),m.topTools.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Top Tools"}),n.jsx("div",{className:"space-y-1.5",children:m.topTools.map(([f,x])=>n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right truncate",title:f,children:f}),n.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-terminal-orange",style:{width:`${x/m.topTools[0][1]*100}%`}})}),n.jsx("span",{className:"text-terminal-dim shrink-0 w-6 text-right tabular-nums",children:x})]},f))})]}),m.subAgents.length>0&&n.jsx(tj,{subAgents:m.subAgents}),m.totalTools>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Activity Distribution"}),n.jsx("div",{className:"space-y-1.5",children:[["Read/Search",m.activityDist.read,"--blue"],["Write/Edit",m.activityDist.write,"--green"],["Execute",m.activityDist.execute,"--purple"],["Other",m.activityDist.other,"--dim"]].filter(([,f])=>f>0).map(([f,x,h])=>n.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[n.jsx("span",{className:"text-terminal-text shrink-0 w-24 text-right",children:f}),n.jsx("div",{className:"flex-1 h-2 rounded-full bg-terminal-surface overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${x/m.totalTools*100}%`,backgroundColor:`var(${h})`}})}),n.jsxs("span",{className:"text-terminal-dim shrink-0 w-16 text-right tabular-nums",children:[x," (",Math.round(x/m.totalTools*100),"%)"]})]},f))})]})]})})}const Ch={Explore:"bg-blue-500/20 text-blue-300 border-blue-500/30",Plan:"bg-purple-500/20 text-purple-300 border-purple-500/30",Shell:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30","general-purpose":"bg-green-500/20 text-green-300 border-green-500/30","claude-code-guide":"bg-amber-500/20 text-amber-300 border-amber-500/30"};function tj({subAgents:l}){const r=new Map;let i=0,o=0;for(const m of l){const p=r.get(m.agentType)||{count:0,toolCalls:0,totalTokens:0};p.count++,p.toolCalls+=m.toolCalls,p.totalTokens+=m.totalTokens,r.set(m.agentType,p),i+=m.toolCalls,o+=m.totalTokens}const u=[...r.entries()].sort((m,p)=>p[1].count-m[1].count);return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["Sub-Agents (",l.length,")"]}),n.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:u.map(([m,p])=>{const g=Ch[m]||"bg-gray-500/20 text-gray-300 border-gray-500/30";return n.jsxs("span",{className:`text-[11px] px-2 py-1 rounded border font-mono ${g}`,children:[m," ",n.jsxs("span",{className:"opacity-70",children:["x",p.count," (",p.toolCalls," tools)"]})]},m)})}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono text-terminal-dim",children:[n.jsxs("div",{children:["Delegated tools: ",n.jsx("span",{className:"text-terminal-text",children:i})]}),o>0&&n.jsxs("div",{children:["Delegated tokens:"," ",n.jsx("span",{className:"text-terminal-text",children:o>1e6?`${(o/1e6).toFixed(1)}M`:o>1e3?`${(o/1e3).toFixed(0)}K`:o}),n.jsx("span",{className:"text-terminal-dimmer",children:" (context-free)"})]})]}),n.jsxs("div",{className:"mt-2 space-y-1",children:[l.slice(0,20).map((m,p)=>n.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-terminal-dim px-2 py-1 rounded bg-terminal-surface",children:[n.jsx("span",{className:`px-1 py-0.5 rounded border text-[9px] ${Ch[m.agentType]||"bg-gray-500/20 text-gray-300 border-gray-500/30"}`,children:m.agentType}),n.jsx("span",{className:"truncate flex-1 text-terminal-text/70",children:m.description||"(no description)"}),n.jsxs("span",{className:"shrink-0",children:[m.toolCalls," tools"]}),m.totalTokens>0&&n.jsxs("span",{className:"shrink-0 text-terminal-dimmer",children:[m.totalTokens>1e3?`${(m.totalTokens/1e3).toFixed(0)}K`:m.totalTokens," ","tok"]})]},p)),l.length>20&&n.jsxs("div",{className:"text-[10px] text-terminal-dimmer font-mono px-2",children:["... and ",l.length-20," more"]})]})]})}function Oi({children:l,visible:r,x:i}){if(!r)return null;const o=i>.7;return n.jsx("div",{className:"absolute top-1 pointer-events-none z-10",style:{left:o?void 0:`${i*100}%`,right:o?`${(1-i)*100}%`:void 0},children:n.jsx("div",{className:`bg-terminal-surface border border-terminal-border-subtle rounded px-2 py-1 text-[10px] font-mono text-terminal-text shadow-md whitespace-nowrap ${o?"text-right":""}`,children:l})})}function nj({turnStats:l,costEstimate:r,turnLabels:i}){const o=[];let u=0;for(const S of l)u+=S.tokenUsage?.outputTokens||0,o.push(u);const m=o.length,{hovered:p,ref:g,onMouseMove:f,onMouseLeave:x}=wx(m);if(u===0)return null;const h=o[o.length-1],v=60,C=100,j=o.map((S,k)=>{const E=m===1?C/2:k/(m-1)*C,M=v-S/h*(v-6)-3;return`${E},${M}`}),w=p!==null?m===1?.5:p/(m-1):0;return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:["Token Burn",r?" & Cost":""]}),n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{ref:g,viewBox:`0 0 ${C} ${v}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:f,onMouseLeave:x,children:[n.jsx("polygon",{points:`0,${v} ${j.join(" ")} ${C},${v}`,style:{fill:"var(--green-subtle)"}}),n.jsx("polyline",{points:j.join(" "),fill:"none",style:{stroke:"var(--green)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),p!==null&&n.jsx("line",{x1:w*C,y1:"0",x2:w*C,y2:v,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),n.jsx(Oi,{visible:p!==null,x:w,children:p!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-green",children:["Turn ",p+1]}),i?.[p]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:i[p]}),n.jsxs("div",{children:["cumulative: ",Ht(o[p])," tokens"]}),l[p]?.tokenUsage&&n.jsxs("div",{className:"text-terminal-dimmer",children:["this turn: +",Ht(l[p].tokenUsage.outputTokens)," out"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:[Ht(h)," tokens",r?` ($${r<1?r.toFixed(2):r.toFixed(0)})`:""]}),n.jsxs("span",{children:["Turn ",m]})]}),l.some(S=>S.tokenUsage?.cacheReadTokens)&&n.jsx(aj,{turnStats:l})]})}function aj({turnStats:l}){const r=l.map(p=>{const g=p.tokenUsage;if(!g)return 0;const f=(g.cacheReadTokens||0)+(g.inputTokens||0);return f>0?g.cacheReadTokens/f:0}),i=24,o=100,u=r.map((p,g)=>{const f=r.length===1?o/2:g/(r.length-1)*o,x=i-p*(i-4)-2;return`${f},${x}`}),m=r.reduce((p,g)=>p+g,0)/r.length;return n.jsxs("div",{className:"mt-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Cache Hit Rate"}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-purple",children:["avg ",Math.round(m*100),"%"]})]}),n.jsx("svg",{viewBox:`0 0 ${o} ${i}`,preserveAspectRatio:"none",className:"w-full h-6",children:n.jsx("polyline",{points:u.join(" "),fill:"none",style:{stroke:"var(--purple)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})})]})}function lj({turnStats:l,turnLabels:r}){const i=l.map(S=>S.contextTokens||0),o=i.length,{hovered:u,ref:m,onMouseMove:p,onMouseLeave:g}=wx(o);if(!i.some(S=>S>0))return null;const f=Math.max(...i),x=f,h=60,v=100,C=i.map((S,k)=>{const E=o===1?v/2:k/(o-1)*v,M=h-S/x*(h-6)-3;return`${E},${M}`}),j=[];for(let S=0;S<i.length-1;S++){const k=i[S],E=i[S+1];k>0&&E>0&&E<k*.5&&j.push(S)}const w=u!==null?o===1?.5:u/(o-1):0;return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Context Window Usage"}),n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{ref:m,viewBox:`0 0 ${v} ${h}`,preserveAspectRatio:"none",className:"w-full h-20",onMouseMove:p,onMouseLeave:g,children:[n.jsx("polygon",{points:`0,${h} ${C.join(" ")} ${v},${h}`,style:{fill:"var(--cyan-subtle)"}}),n.jsx("polyline",{points:C.join(" "),fill:"none",style:{stroke:"var(--cyan)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),j.map(S=>{const k=o===1?v/2:S/(o-1)*v;return n.jsx("line",{x1:k,y1:"0",x2:k,y2:h,style:{stroke:"var(--red)"},strokeWidth:"1",strokeDasharray:"2,1",vectorEffect:"non-scaling-stroke",opacity:"0.6"},S)}),u!==null&&n.jsx("line",{x1:w*v,y1:"0",x2:w*v,y2:h,stroke:"var(--dim)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",opacity:"0.5"})]}),n.jsx(Oi,{visible:u!==null,x:w,children:u!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-cyan",children:["Turn ",u+1]}),r?.[u]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),n.jsxs("div",{children:[Ht(i[u])," tokens"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["peak ",Ht(f)]}),n.jsxs("span",{children:["Turn ",o]})]}),j.length>0&&n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"inline-block w-3 border-t border-dashed",style:{borderColor:"var(--red)"}}),n.jsxs("span",{className:"text-[10px] font-mono text-terminal-dimmer",children:[j.length," compaction",j.length!==1?"s":""]})]})]})}function sj({turnStats:l,turnLabels:r}){const i=l.map(g=>g.durationMs||0),o=Math.max(...i,1),u=i.some(g=>g>0),[m,p]=y.useState(null);return u?n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Turn Duration"}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>p(null),children:i.map((g,f)=>{const x=g>0?Math.max(g/o*100,4):0;return n.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${x}%`,backgroundColor:g>0?"var(--blue)":"var(--surface)",opacity:m===f?1:g>0?.5+g/o*.5:.2},onMouseEnter:()=>p(f)},f)})}),n.jsx(Oi,{visible:m!==null,x:m!==null?i.length===1?.5:m/(i.length-1):0,children:m!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-blue",children:["Turn ",m+1]}),r?.[m]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[m]}),n.jsx("div",{children:i[m]>0?vt(i[m]):"no data"})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["max ",vt(o)]}),n.jsxs("span",{children:["Turn ",i.length]})]})]}):null}function rj({tokenUsageByModel:l}){const r=Object.entries(l).sort((u,m)=>m[1].outputTokens-u[1].outputTokens),i=r.reduce((u,[,m])=>u+m.outputTokens,0);if(i===0)return null;const o=["--green","--blue","--purple","--orange","--red"];return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Model Breakdown"}),n.jsx("div",{className:"flex h-3 rounded-full overflow-hidden gap-px",children:r.map(([u,m],p)=>{const g=m.outputTokens/i*100;return n.jsx("div",{style:{width:`${g}%`,minWidth:g>2?void 0:"3px",backgroundColor:`var(${o[p%o.length]})`,opacity:.7},title:`${u}: ${Ht(m.outputTokens)} output tokens`},u)})}),n.jsx("div",{className:"flex flex-wrap gap-3 mt-1.5",children:r.map(([u,m],p)=>n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-mono text-terminal-dimmer",children:[n.jsx("div",{className:"w-2 h-2 rounded-sm",style:{backgroundColor:`var(${o[p%o.length]})`,opacity:.7}}),n.jsxs("span",{children:[u," ",Ht(m.outputTokens)," (",Math.round(m.outputTokens/i*100),"%)"]})]},u))})]})}function ij({turns:l,turnLabels:r}){const i=l.map(p=>p.toolCount),o=Math.max(...i,1),[u,m]=y.useState(null);return l.length<2?null:n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-1",children:"Tool Calls per Turn"}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex items-end gap-px h-16",onMouseLeave:()=>m(null),children:i.map((p,g)=>{const f=p>0?Math.max(p/o*100,4):0;return n.jsx("div",{className:"flex-1 rounded-t-sm cursor-default",style:{height:`${f}%`,backgroundColor:p>0?"var(--orange)":"var(--surface)",opacity:u===g?1:p>0?.5+p/o*.5:.2},onMouseEnter:()=>m(g)},g)})}),n.jsx(Oi,{visible:u!==null,x:u!==null?i.length===1?.5:u/(i.length-1):0,children:u!==null&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-terminal-orange",children:["Turn ",u+1]}),r?.[u]&&n.jsx("div",{className:"text-terminal-dim truncate max-w-[200px]",children:r[u]}),n.jsxs("div",{children:[i[u]," tool calls"]})]})})]}),n.jsxs("div",{className:"flex justify-between text-[10px] font-mono text-terminal-dimmer mt-0.5",children:[n.jsx("span",{children:"Turn 1"}),n.jsxs("span",{children:["max ",o]}),n.jsxs("span",{children:["Turn ",i.length]})]})]})}function oj({editedFiles:l,turns:r}){if(r.length<3||l.length<1)return null;const i=l.slice(0,8),o=60,u=r.map(f=>f.index),m=u.length>o,p=m?u.slice(-o):u;let g=1;for(const f of i)for(const x of p){const h=f.turnEdits.get(x)||0;h>g&&(g=h)}return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Activity Heatmap",m&&n.jsxs("span",{className:"normal-case tracking-normal font-normal ml-2",children:["(last ",o," of ",u.length," turns)"]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("div",{className:"grid gap-px text-[10px] font-mono",style:{gridTemplateColumns:`minmax(80px, 120px) repeat(${p.length}, minmax(16px, 1fr))`},children:[n.jsx("div",{className:"text-terminal-dimmer px-1 py-0.5"}),p.map(f=>n.jsx("div",{className:"text-terminal-dimmer text-center py-0.5 text-[9px]",children:f},f)),i.map(f=>{const x=f.path.split("/").pop()||f.path;return[n.jsx("div",{className:"text-terminal-dim truncate px-1 py-0.5",title:f.path,children:x},`label-${f.path}`),...p.map(h=>{const v=f.turnEdits.get(h)||0,C=v===0?0:Math.round(20+Math.log1p(v)/Math.log1p(g)*60);return n.jsx("div",{className:"rounded-sm",style:{backgroundColor:v===0?"transparent":`color-mix(in srgb, var(--orange) ${C}%, transparent)`,minHeight:14},title:v>0?`${x} — Turn ${h}: ${v} edit${v!==1?"s":""}`:void 0},`${f.path}-${h}`)})]})]})})]})}const iu=20;function cj({turns:l,turnStats:r}){const[i,o]=y.useState(!1),{rows:u,compactionAfter:m}=y.useMemo(()=>{const j=Math.max(...l.map(A=>A.toolCount),1),w=Math.max(...r?.map(A=>A.durationMs||0)||[0],1),S=Math.max(...r?.map(A=>A.contextTokens||0)||[0],1),k=Math.max(...r?.map(A=>A.tokenUsage?.outputTokens||0)||[0],1),E=new Set;if(r)for(let A=0;A<r.length-1;A++){const R=r[A]?.contextTokens||0,O=r[A+1]?.contextTokens||0;R>0&&O>0&&O<R*.5&&E.add(A)}return{rows:l.map((A,R)=>{const O=r?.[R];return{...A,durationMs:O?.durationMs,contextTokens:O?.contextTokens,outputTokens:O?.tokenUsage?.outputTokens,toolRatio:A.toolCount/j,durationRatio:(O?.durationMs||0)/w,contextRatio:(O?.contextTokens||0)/S,outputRatio:(O?.tokenUsage?.outputTokens||0)/k}}),compactionAfter:E}},[l,r]),p=r&&r.length>0,g=p&&r.some(j=>j.durationMs),f=p&&r.some(j=>j.contextTokens),x=p&&r.some(j=>j.tokenUsage),h=3+(g?1:0)+(f?1:0)+(x?1:0),v=u.length>iu,C=v&&!i?u.slice(0,iu):u;return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:"Per-Turn Breakdown"}),n.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:n.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[n.jsx("th",{className:"px-2 py-1.5 font-semibold w-7",children:"#"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"Prompt"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Tools"}),g&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Duration"}),f&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-16",children:"Context"}),x&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Output"})]})}),n.jsx("tbody",{children:C.map((j,w)=>n.jsx(uj,{row:j,hasDuration:!!g,hasContext:!!f,hasTokens:!!x,colCount:h,showCompaction:m.has(w)},j.sceneIndex))}),v&&n.jsx("tfoot",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:h,children:n.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} turns (${u.length-iu} more)`})})})})]})})]})}function uj({row:l,hasDuration:r,hasContext:i,hasTokens:o,colCount:u,showCompaction:m}){return n.jsxs(n.Fragment,{children:[n.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("td",{className:"px-2 py-1 text-terminal-green tabular-nums",children:String(l.index).padStart(2,"0")}),n.jsx("td",{className:"px-2 py-1 text-terminal-text max-w-0",children:n.jsxs("div",{className:"truncate",title:l.text,children:[l.text,l.errorCount>0&&n.jsxs("span",{className:"text-terminal-red ml-1.5",children:[l.errorCount," err"]})]})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.toolCount,ratio:l.toolRatio,color:"--orange"})}),r&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.durationMs?vt(l.durationMs):"—",ratio:l.durationRatio,color:"--blue"})}),i&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.contextTokens?Ht(l.contextTokens):"—",ratio:l.contextRatio,color:"--cyan"})}),o&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:n.jsx(Hl,{value:l.outputTokens?Ht(l.outputTokens):"—",ratio:l.outputRatio,color:"--green"})})]}),m&&n.jsx("tr",{children:n.jsx("td",{colSpan:u,className:"px-0 py-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 bg-terminal-red/5",children:[n.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"}),n.jsx("span",{className:"text-[10px] font-mono text-terminal-red/70 shrink-0",children:"context compacted"}),n.jsx("div",{className:"flex-1 border-t border-dashed border-terminal-red/40"})]})})})]})}function Hl({value:l,ratio:r,color:i}){return n.jsx("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm text-terminal-text",style:{backgroundColor:r>0?`color-mix(in srgb, var(${i}) ${Math.round(r*40)}%, transparent)`:void 0},children:l})}const ou=20;function dj({editedFiles:l,readOnlyFiles:r}){const[i,o]=y.useState(!1),u=y.useMemo(()=>[...l,...r],[l,r]),m=y.useMemo(()=>Math.max(...u.map(j=>j.editCount),1),[u]),p=y.useMemo(()=>Math.max(...u.map(j=>j.readCount),1),[u]),g=y.useMemo(()=>Math.max(...u.map(j=>j.linesAdded+j.linesRemoved),1),[u]),f=u.some(j=>j.linesAdded>0||j.linesRemoved>0),x=u.some(j=>j.turnEdits.size>0),h=u.length>ou,v=h&&!i?u.slice(0,ou):u,C=3+(f?1:0)+(x?1:0);return n.jsxs("div",{children:[n.jsxs("div",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest mb-2",children:["File Impact",n.jsxs("span",{className:"normal-case tracking-normal ml-1.5",children:["(",l.length," modified",r.length>0&&`, ${r.length} read-only`,")"]})]}),n.jsx("div",{className:"overflow-x-auto rounded border border-terminal-border-subtle",children:n.jsxs("table",{className:"w-full text-[11px] font-mono border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-terminal-dimmer text-left",children:[n.jsx("th",{className:"px-2 py-1.5 font-semibold",children:"File"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Edits"}),n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Reads"}),f&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-20",children:"+/−"}),x&&n.jsx("th",{className:"px-2 py-1.5 font-semibold text-right w-14",children:"Turns"})]})}),n.jsx("tbody",{children:v.map(j=>{const w=j.path.split("/").pop()||j.path,S=j.editCount>0;return n.jsxs("tr",{className:"border-t border-terminal-border-subtle hover:bg-terminal-surface-hover transition-colors",children:[n.jsx("td",{className:"px-2 py-1 max-w-0",children:n.jsxs("div",{className:`truncate ${S?"text-terminal-text":"text-terminal-dimmer"}`,title:j.path,children:[w,j.editCount>=10&&n.jsx("span",{className:"text-terminal-red ml-1",title:`${j.editCount} edits — high churn file`,children:"⚠"}),n.jsx("span",{className:"text-terminal-dimmer ml-1",children:j.path.slice(0,j.path.length-w.length-1)})]})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.editCount>0?n.jsx(Hl,{value:j.editCount,ratio:j.editCount/m,color:"--orange"}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.readCount>0?n.jsx(Hl,{value:j.readCount,ratio:j.readCount/p,color:"--blue"}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),f&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.linesAdded>0||j.linesRemoved>0?n.jsxs("span",{className:"inline-block w-full px-1 py-0.5 rounded-sm",style:{backgroundColor:`color-mix(in srgb, var(--green) ${Math.round((j.linesAdded+j.linesRemoved)/g*30)}%, transparent)`},children:[n.jsxs("span",{className:"text-terminal-green",children:["+",j.linesAdded]}),n.jsx("span",{className:"text-terminal-dimmer",children:"/"}),n.jsxs("span",{className:"text-terminal-red",children:["−",j.linesRemoved]})]}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})}),x&&n.jsx("td",{className:"px-2 py-1 text-right tabular-nums",children:j.turnEdits.size>0?n.jsx("span",{className:"text-terminal-dim",children:j.turnEdits.size}):n.jsx("span",{className:"text-terminal-dimmer",children:"—"})})]},j.path)})}),h&&n.jsx("tfoot",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:C,children:n.jsx("button",{type:"button",className:"w-full py-1.5 text-[11px] font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors",onClick:()=>o(!i),children:i?"▴ Collapse":`▾ Show all ${u.length} files (${u.length-ou} more)`})})})})]})})]})}function mj(l){switch(l){case"user-prompt":return"#3fb950";case"compaction-summary":return"#666666";case"context-injection":return"#4488cc";case"thinking":return"#b392f0";case"text-response":return"#79b8ff";case"tool-call":return"#d29922"}}function fj({scenes:l,currentIndex:r,onSeek:i,annotatedScenes:o}){const u=y.useMemo(()=>{if(l.length<=200)return l.map((j,w)=>({startIndex:w,endIndex:w,type:j.type}));const v=l.length/200,C=[];for(let j=0;j<200;j++){const w=Math.floor(j*v),S=Math.floor((j+1)*v)-1,k={"user-prompt":4,"compaction-summary":1,"context-injection":1,"tool-call":3,"text-response":2,thinking:1};let E=l[w].type,M=k[E];for(let A=w+1;A<=S&&A<l.length;A++){const R=k[l[A].type];R>M&&(E=l[A].type,M=R)}C.push({startIndex:w,endIndex:S,type:E})}return C},[l]),m=l.length>0?(r+1)/l.length*100:0,p=y.useRef(null),g=y.useCallback(h=>{const v=p.current;if(!v)return;const C=v.getBoundingClientRect(),j=h.clientX-C.left,w=Math.max(0,Math.min(1,j/C.width)),S=Math.floor(w*l.length);i(S)},[l.length,i]),f=y.useMemo(()=>{if(!o||o.size===0)return[];const h=[];return o.forEach(v=>{v>=0&&v<l.length&&h.push((v+.5)/l.length*100)}),h},[o,l.length]),x=y.useCallback(h=>{h.key==="ArrowRight"||h.key==="ArrowUp"?(h.preventDefault(),i(Math.min(r+1,l.length-1))):h.key==="ArrowLeft"||h.key==="ArrowDown"?(h.preventDefault(),i(Math.max(r-1,0))):h.key==="Home"?(h.preventDefault(),i(0)):h.key==="End"&&(h.preventDefault(),i(l.length-1))},[r,l.length,i]);return l.length===0?null:n.jsxs("div",{className:"px-4 pt-3 pb-1 cursor-pointer",onClick:g,onKeyDown:x,role:"slider","aria-label":"Scene timeline","aria-valuemin":0,"aria-valuemax":l.length-1,"aria-valuenow":r,tabIndex:0,children:[f.length>0&&n.jsx("div",{className:"relative h-2 mb-0.5",children:f.map((h,v)=>n.jsx("div",{className:"absolute w-1.5 h-1.5 rounded-full bg-terminal-blue shadow-layer-sm",style:{left:`${h}%`,top:"50%",transform:"translate(-50%, -50%)"}},v))}),n.jsxs("div",{ref:p,className:"relative flex h-2 rounded-full overflow-hidden bg-terminal-surface-2",children:[u.map((h,v)=>n.jsx("div",{className:"flex-1 transition-opacity duration-150",style:{backgroundColor:mj(h.type),opacity:h.startIndex<=r?1:.15}},v)),n.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white shadow-layer-sm transition-[left] duration-150 ease-material",style:{left:`${m}%`}})]})]})}const pj=[{key:"replay",label:"Replay"},{key:"summary",label:"Insights"},{key:"export",label:"Share & Export"}],Nx="vr-insights-seen";function hj(){try{return localStorage.getItem(Nx)==="1"}catch{return!1}}function xj(){try{localStorage.setItem(Nx,"1")}catch{}}function gj({activeView:l,onChangeView:r,className:i="",rightContent:o,hiddenTabs:u}){const[m,p]=y.useState(()=>hj()||l==="summary"),g=y.useCallback(f=>{f==="summary"&&!m&&(xj(),p(!0)),r(f)},[r,m]);return n.jsxs("div",{className:`flex items-center justify-between border-b border-terminal-border-subtle bg-terminal-bg shrink-0 overflow-x-auto ${i}`,children:[n.jsx("div",{className:"flex bg-terminal-surface/30",children:pj.filter(f=>!u?.includes(f.key)).map(({key:f,label:x})=>n.jsxs("button",{onClick:()=>g(f),className:`relative px-4 py-2 text-[11px] font-sans font-semibold uppercase tracking-widest transition-colors ${l===f?"text-terminal-green border-b-2 border-terminal-green bg-terminal-surface/50":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:[x,f==="summary"&&!m&&l!=="summary"&&n.jsxs("span",{className:"absolute top-1.5 right-1 flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-green opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-terminal-green"})]})]},f))}),o&&n.jsx("div",{className:"pr-4 py-1.5 flex items-center",children:o})]})}function bj(l){l.classList.remove("jump-target-flash"),l.offsetWidth,l.classList.add("jump-target-flash"),window.setTimeout(()=>{l.classList.remove("jump-target-flash")},900)}function yj({session:l,viewPrefs:r,viewerMode:i="embedded",activeView:o,setActiveView:u,returnToLandingRef:m}){const p=i==="readonly",[g,f]=y.useState(!1);y.useEffect(()=>{if(m)return m.current=()=>{f(!1),Cn(!1);const ce=new URL(window.location.href);ce.searchParams.has("s")&&(ce.searchParams.delete("s"),window.history.replaceState({},"",ce.toString()))},()=>{m.current=null}},[m]);const[x,h]=y.useState(void 0),[v,C]=y.useState(!1),[j,w]=y.useState(!1),[S,k]=y.useState(null),[E,M]=y.useState(!0),A=I0(l,i),R=J0(l,i),{effectiveSession:O}=R,{annotations:$}=A,H=W0(r),{state:K,currentIndex:ae,visibleCount:ue,speed:oe,play:te,pause:xe,togglePlayPause:de,seekTo:pe,changeSpeed:U,totalScenes:z,userPromptIndices:Q,computeNextIndex:ne}=P0(l.scenes,H,g),W=y.useRef(null),[T,_]=y.useState("outline"),[V,J]=y.useState(!1),[P,he]=y.useState(!1),G=y.useRef(null),F=y.useRef(null),me=y.useRef(!1),[be,Qe]=y.useState(!1);y.useEffect(()=>{const ce=fe=>{(fe.metaKey||fe.ctrlKey)&&fe.key==="k"?(fe.preventDefault(),J(_e=>!_e)):fe.key==="/"?fe.target instanceof HTMLInputElement||fe.target instanceof HTMLTextAreaElement||(fe.preventDefault(),J(!0)):fe.key==="?"?Qe(_e=>!_e):fe.key==="Escape"&&(be?Qe(!1):V&&J(!1))};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[V,be]);const lt=Q.filter(ce=>ce<=ae).length||0,Ct=Q.length,Fe=y.useMemo(()=>{const ce=new URLSearchParams(window.location.search).get("s");if(ce!==null){const fe=Number(ce);if(Number.isFinite(fe)&&fe>=0&&fe<l.scenes.length)return fe}return Q.length>=2?Q[1]:Math.min(15,l.scenes.length-1)},[Q,l.scenes.length]),it=y.useCallback((ce=!0)=>{f(!0),ce?setTimeout(te,300):setTimeout(()=>pe(Fe),100)},[te,pe,Fe]),Bt=y.useCallback(()=>u("summary"),[u]),kn=y.useRef(r.displayMode);y.useEffect(()=>{kn.current!==r.displayMode&&(kn.current=r.displayMode,g||(f(!0),setTimeout(()=>pe(Fe),100)))},[r.displayMode,g,pe,Fe]);const[qt,Cn]=y.useState(()=>new URLSearchParams(window.location.search).get("s")!==null);y.useEffect(()=>{!g&&o!=="replay"&&!qt&&(f(!0),setTimeout(()=>pe(Fe),100))},[o,g,Fe,pe,qt]);const ze=y.useCallback(ce=>{const fe=Math.max(0,Math.min(ce,l.scenes.length-1));xe(),G.current=fe,h(fe),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>h(void 0),2500),pe(fe)},[xe,pe,l.scenes.length]);y.useEffect(()=>{!g&&qt&&(f(!0),setTimeout(()=>ze(Fe),100))},[g,qt,Fe,ze]);const ot=y.useCallback(()=>{const ce=Q.find(fe=>fe>ae);ce!==void 0&&ze(ce)},[Q,ae,ze]),jt=y.useCallback(()=>{const ce=[...Q].reverse().find(fe=>fe<ae);ce!==void 0&&ze(ce)},[Q,ae,ze]),st=y.useRef(!1);y.useEffect(()=>{if(!W.current||ae<0||G.current!==null)return;if(me.current){me.current=!1;return}const ce=W.current;st.current=!0;const fe=Se=>{const Be=l.scenes;if(Se<0||Se>=Be.length)return Se;const et=Ue=>Ue==="user-prompt"||Ue==="compaction-summary"||Ue==="context-injection";if(et(Be[Se].type))return Se;let Oe=Se;for(;Oe>0&&!et(Be[Oe-1].type);)Oe--;return Oe},_e=Se=>{const Be=ce.querySelector(`[data-scene-index="${Se}"]`);if(Be)return Be;const et=fe(Se);return ce.querySelector(`[data-scene-index="${et}"]`)};requestAnimationFrame(()=>{const Se=_e(ae);if(Se)if(K==="playing")Se.scrollIntoView({behavior:"smooth",block:"center"});else{const Be=ce.getBoundingClientRect(),Ue=Se.getBoundingClientRect().top-Be.top+ce.scrollTop-Be.height*.3;ce.scrollTo({top:Math.max(0,Ue),behavior:"smooth"})}else K==="playing"&&ce.scrollTo({top:ce.scrollHeight,behavior:"smooth"});setTimeout(()=>{st.current=!1},400)})},[ae,K,l.scenes]),y.useEffect(()=>{const ce=W.current;if(!ce)return;const fe=()=>{st.current||K==="playing"&&xe()};return ce.addEventListener("wheel",fe,{passive:!0}),ce.addEventListener("touchmove",fe,{passive:!0}),()=>{ce.removeEventListener("wheel",fe),ce.removeEventListener("touchmove",fe)}},[K,xe]),y.useEffect(()=>{const ce=W.current;if(!ce)return;let fe=!1;const _e=()=>{if(K!=="paused"||fe||ae>=l.scenes.length-1||st.current||G.current!==null)return;if(ce.scrollHeight-ce.scrollTop-ce.clientHeight<80){fe=!0,me.current=!0;const tt=ne(ae);tt!==-1&&pe(tt),setTimeout(()=>{fe=!1},150)}},Se=Ue=>{Ue.deltaY>0&&_e()};let Be=0;const et=Ue=>{Be=Ue.touches[0].clientY},Oe=Ue=>{Be-Ue.changedTouches[0].clientY>20&&_e()};return ce.addEventListener("scroll",_e,{passive:!0}),ce.addEventListener("wheel",Se,{passive:!0}),ce.addEventListener("touchstart",et,{passive:!0}),ce.addEventListener("touchend",Oe,{passive:!0}),()=>{ce.removeEventListener("scroll",_e),ce.removeEventListener("wheel",Se),ce.removeEventListener("touchstart",et),ce.removeEventListener("touchend",Oe)}},[K,ae,l.scenes.length,pe,ne]),y.useEffect(()=>{const ce=G.current,fe=W.current;if(ce===null||!fe||ae!==ce)return;let _e=!1,Se=0;const Be=Oe=>{const Ue=fe.querySelector(`[data-scene-index="${Oe}"]`);if(Ue)return Ue;const tt=Array.from(fe.querySelectorAll("[data-scene-index]"));let Yt=null,Ft=1/0;for(const rn of tt){const Ln=rn.getAttribute("data-scene-index");if(!Ln)continue;const zn=parseInt(Ln,10);if(zn<=Oe){const $t=Oe-zn;$t<Ft&&(Ft=$t,Yt=rn)}}return Yt},et=()=>{if(_e)return;const Oe=Be(ce);if(Oe){st.current=!0;const Ue=fe.getBoundingClientRect(),Ft=Oe.getBoundingClientRect().top-Ue.top+fe.scrollTop-Ue.height*.3;fe.scrollTo({top:Math.max(0,Ft),behavior:"smooth"}),bj(Oe),setTimeout(()=>{st.current=!1},450),G.current=null;return}Se+=1,Se<30?setTimeout(et,80):G.current=null};return requestAnimationFrame(et),()=>{_e=!0}},[ae]),y.useEffect(()=>()=>{F.current&&clearTimeout(F.current)},[]);const Ze=y.useRef(null);y.useEffect(()=>{if(ae<0||!g)return;Ze.current&&clearTimeout(Ze.current);const ce=K==="playing"?500:0;return Ze.current=setTimeout(()=>{const fe=new URL(window.location.href);fe.searchParams.set("s",String(ae)),window.history.replaceState({},"",fe.toString())},ce),()=>{Ze.current&&clearTimeout(Ze.current)}},[ae,K,g]);const I=i==="editor",we=y.useMemo(()=>$.some(ce=>ce.author==="vibe-feedback"),[$]);if(!g&&o==="replay")return n.jsx(Y1,{session:O,onStart:it,onViewInsights:Bt});const{meta:ve}=l;return n.jsxs("div",{className:"flex flex-1 min-h-0 relative",children:[n.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[n.jsx(gj,{activeView:o,onChangeView:u,hiddenTabs:p?["export"]:void 0,rightContent:o==="replay"?n.jsxs("div",{className:"flex items-center gap-3",children:[R.overlayCount>0&&n.jsxs("button",{onClick:()=>R.toggleAllOriginals(),className:"hidden md:flex items-center gap-2 text-xs font-mono text-terminal-dim",title:R.showAllOriginals?"Showing originals — click to show modified":"Showing modified — click to show originals",children:[n.jsx("span",{children:R.showAllOriginals?"Original":"Modified"}),n.jsx("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 ${R.showAllOriginals?"bg-terminal-surface border border-terminal-border":"bg-terminal-purple brightness-75"}`,children:n.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform duration-200 ${R.showAllOriginals?"translate-x-[3px]":"translate-x-[17px]"}`})})]}),n.jsxs("button",{onClick:()=>C(!0),className:"hidden md:flex items-center gap-1.5 text-xs font-mono font-semibold text-terminal-text hover:text-terminal-green transition-colors",title:"Open comments",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-terminal-dim",children:n.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),n.jsx("span",{children:"Comments"}),A.annotations.length>0&&n.jsx("span",{className:"ml-0.5 px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:A.annotations.length})]}),n.jsxs("button",{onClick:()=>C(!0),className:"md:hidden flex items-center gap-1 text-terminal-dim hover:text-terminal-text transition-colors",title:"Comments",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),A.annotations.length>0&&n.jsx("span",{className:"px-1 py-0.5 rounded bg-terminal-black text-[10px] text-terminal-text border border-terminal-border tabular-nums leading-none",children:A.annotations.length})]}),I&&n.jsxs("button",{onClick:()=>w(!0),className:"hidden md:flex pl-2 pr-3 py-1 text-[11px] font-mono rounded bg-[rgba(168,85,247,0.1)] hover:bg-[rgba(168,85,247,0.2)] border border-[rgba(168,85,247,0.3)] hover:border-[rgba(168,85,247,0.5)] text-terminal-purple transition-all items-center gap-1.5 relative overflow-hidden group shadow-sm",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000"}),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#c084fc]",children:n.jsx("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})}),n.jsx("span",{className:"font-semibold tracking-wide",children:"AI Studio"}),(we||R.overlayCount>0)&&n.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-terminal-purple opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-terminal-purple"})]})]})]}):void 0}),n.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full",children:[o==="replay"&&n.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0 w-full relative",children:[E&&n.jsxs("div",{className:"hidden md:flex w-64 shrink-0 flex-col border-r border-terminal-border-subtle bg-terminal-bg shadow-layer-sm",children:[n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[n.jsxs("div",{className:"px-3 py-2 border-b border-terminal-border-subtle flex items-center justify-between group/side",children:[n.jsx("span",{className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest",children:"Outline"}),n.jsx("button",{onClick:()=>M(!1),className:"p-1 rounded hover:bg-terminal-surface text-terminal-dimmer hover:text-terminal-text transition-colors",title:"Hide Sidebar",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),n.jsx("line",{x1:"9",x2:"9",y1:"3",y2:"21"})]})})]}),n.jsx(kh,{scenes:l.scenes,currentIndex:ae,onSeek:ze,overlayActions:R,turnStats:l.meta.stats.turnStats})]}),n.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle overflow-y-auto max-h-[35%]",children:[n.jsx("div",{className:"px-3 py-2 border-b border-terminal-border-subtle",children:n.jsx("button",{onClick:()=>u("summary"),className:"text-[10px] font-sans font-semibold text-terminal-dimmer uppercase tracking-widest hover:text-terminal-green transition-colors",title:"Open Insights view",children:"Stats"})}),n.jsxs("div",{className:"p-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsx(Ul,{label:"Turns",value:ve.stats.userPrompts,color:"text-terminal-green"}),n.jsx(Ul,{label:"Tools",value:ve.stats.toolCalls,color:"text-terminal-orange"})]}),n.jsxs("div",{className:"mt-2 text-xs font-mono text-terminal-dim space-y-0.5",children:[ve.model&&n.jsx("div",{children:n.jsx("span",{className:"text-terminal-text",children:ve.model})}),ve.stats.durationMs&&n.jsxs("div",{children:[vt(ve.stats.durationMs),ve.stats.costEstimate!==void 0&&n.jsxs("span",{children:[" / ",n.jsxs("span",{className:"text-terminal-green",children:["$",ve.stats.costEstimate<.01?ve.stats.costEstimate.toFixed(4):ve.stats.costEstimate.toFixed(2)]})]})]}),ve.stats.tokenUsage&&n.jsxs("div",{children:[Ht(ve.stats.tokenUsage.inputTokens)," in /"," ",Ht(ve.stats.tokenUsage.outputTokens)," out"]})]})]})]})]}),n.jsxs("div",{className:"flex flex-col flex-1 min-h-0 min-w-0 relative",children:[!E&&n.jsx("button",{onClick:()=>M(!0),className:"absolute left-0 top-1/2 -translate-y-1/2 z-20 group/expand px-1.5 py-4 bg-terminal-surface/80 backdrop-blur-md border border-l-0 border-terminal-border-subtle rounded-r-xl text-terminal-dim hover:text-terminal-green transition-all shadow-layer-md animate-in slide-in-from-left-2 duration-300",title:"Show Sidebar",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}),n.jsx("div",{ref:W,className:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5 pb-10 overscroll-contain",children:n.jsx(R1,{scenes:l.scenes,visibleCount:ue,currentIndex:ae,effectivePrefs:H,focusIndex:x,annotatedScenes:A.annotatedScenes,annotationCounts:A.annotationCounts,onSeek:ze,state:K,overlayActions:R,turnStats:l.meta.stats.turnStats,onComment:p?void 0:ce=>{C(!0),k(ce)}})}),n.jsx(X1,{scenes:O.scenes,open:V,onClose:()=>J(!1),onSeek:ce=>{ze(ce),J(!1)}})]})]}),o==="summary"&&n.jsx(ej,{session:O}),o==="export"&&n.jsx(U1,{actions:A,viewerMode:i,readOnly:p,session:O})]}),o==="replay"&&n.jsxs("div",{className:"shrink-0 border-t border-terminal-border-subtle bg-terminal-surface/80 backdrop-blur-md sticky bottom-0 safe-bottom shadow-layer-lg",children:[n.jsx(fj,{scenes:l.scenes,currentIndex:ae,onSeek:ze,annotatedScenes:A.annotatedScenes}),n.jsx(av,{state:K,speed:oe,currentIndex:ae,totalScenes:z,userPromptCount:Ct,currentTurn:lt,onTogglePlayPause:de,onChangeSpeed:U,onPrevPrompt:jt,onNextPrompt:ot,onOpenSearch:()=>J(!0),onOpenOutline:()=>he(!0),onShowHelp:()=>Qe(!0)})]})]}),n.jsx(tv,{open:v,onClose:()=>C(!1),actions:A,scenes:O.scenes,currentIndex:ae,onSeek:ze,addingForScene:S,onClearAddingTarget:()=>k(null),readOnly:p}),n.jsx(iy,{open:j,onClose:()=>w(!1),annotationActions:A,overlayActions:R}),n.jsxs("div",{className:`fixed inset-0 z-40 md:hidden transition-opacity duration-300 ${P?"opacity-100":"opacity-0 pointer-events-none"}`,onClick:()=>he(!1),children:[n.jsx("div",{className:"absolute inset-0 bg-black/40"}),n.jsxs("div",{className:`absolute bottom-0 left-0 right-0 h-[65vh] bg-terminal-bg border-t border-terminal-border-subtle rounded-t-2xl flex flex-col transition-transform duration-300 ease-material-decel safe-bottom shadow-layer-xl ${P?"translate-y-0":"translate-y-full"}`,onClick:ce=>ce.stopPropagation(),children:[n.jsx("div",{className:"flex justify-center py-2.5 shrink-0",children:n.jsx("div",{className:"w-10 h-1 rounded-full bg-terminal-border"})}),n.jsxs("div",{className:"flex border-b border-terminal-border-subtle shrink-0",children:[n.jsx("button",{onClick:()=>_("outline"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${T==="outline"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:"Outline"}),n.jsxs("button",{onClick:()=>_("comments"),className:`flex-1 px-3 py-2.5 text-[10px] font-sans font-semibold uppercase tracking-widest transition-colors ${T==="comments"?"text-terminal-green border-b-2 border-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:["Comments",A.annotations.length>0&&n.jsxs("span",{className:"ml-1.5 text-terminal-dimmer",children:["(",A.annotations.length,")"]})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:T==="outline"?n.jsx(kh,{scenes:l.scenes,currentIndex:ae,onSeek:ce=>{ze(ce),he(!1)},overlayActions:R,turnStats:l.meta.stats.turnStats}):n.jsx(fx,{actions:A,scenes:O.scenes,currentIndex:ae,onSeek:ce=>{ze(ce)},addingForScene:S,onClearAddingTarget:()=>k(null),readOnly:p})})]})]}),n.jsx(G1,{open:be,onClose:()=>Qe(!1)})]})}function vj(){const[l,r]=y.useState({status:"loading"}),i=y.useCallback(()=>{r({status:"loading"}),wj().then(o=>{r(o==="dashboard"?{status:"dashboard"}:{status:"ready",session:o.session,mode:o.mode,gistOwner:o.gistOwner})},o=>r({status:"error",message:String(o.message||o)}))},[]);return y.useEffect(()=>{i();const o=()=>i();return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[i]),l}function jj(){return!!window.__VIBE_REPLAY_EDITOR__}async function wj(){if(window.__VIBE_REPLAY_DATA__)return{session:window.__VIBE_REPLAY_DATA__,mode:"embedded"};const l=new URLSearchParams(window.location.search),r=l.get("cloud");if(r){if(!/^[a-zA-Z0-9_-]{10,16}$/.test(r))throw new Error("Invalid cloud replay ID");const p=await fetch(`https://vibe-replay.com/api/cloud-replays/${r}`,{credentials:"include"});if(!p.ok)throw p.status===404?new Error("Replay not found"):p.status===410?new Error("This replay has expired"):new Error(`Failed to load replay: ${p.status}`);const g=await p.json();if(g.redirect&&g.gistId){const{rawUrl:f}=await Th(g.gistId);return{session:await cu(f),mode:"readonly"}}return{session:g,mode:"readonly"}}const i=l.get("gist");if(i){if(!/^[a-f0-9]{20,40}$/.test(i))throw new Error("Invalid gist ID");const{rawUrl:m,owner:p}=await Th(i),g=await cu(m);return fetch(`https://vibe-replay.com/api/cloud-replays/view-gist/${i}`,{method:"POST"}).catch(()=>{}),{session:g,mode:"readonly",gistOwner:p}}if(jj()){if(l.get("view")==="dashboard")return"dashboard";const m=l.get("session");if(m){const p=await fetch(`/api/session?slug=${encodeURIComponent(m)}`);if(!p.ok)throw new Error(`Session not found: ${m}`);return{session:await p.json(),mode:"editor"}}return"dashboard"}const o=l.get("url");if(o)return{session:await cu(o),mode:"readonly"};const u=l.get("file");if(u){const m=await fetch(u);if(!m.ok)throw new Error(`Failed to load file: ${m.status}`);return{session:await m.json(),mode:"embedded"}}return"dashboard"}async function cu(l){const r=await fetch(l);if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);const i=await r.text();if(i.trimStart().startsWith("{"))return JSON.parse(i);throw new Error("URL must point to a vibe-replay JSON replay file")}async function Th(l){const r=await fetch(`https://api.github.com/gists/${l}`);if(!r.ok)throw new Error(`Gist not found: ${r.status}`);const i=await r.json(),o=i.files,u=Object.values(o).find(p=>p.filename.endsWith(".json"));if(!u)throw new Error("No JSON file found in gist");const m=i.owner?.login;return{rawUrl:u.raw_url,owner:m}}function Nj(){const[l,r]=y.useState(()=>{const u=new URLSearchParams(window.location.search).get("theme");if(u==="light"||u==="dark")return u;const m=localStorage.getItem("vibe-replay-theme");return m==="light"||m==="dark"?m:"dark"});y.useEffect(()=>{const o=document.documentElement;o.classList.add("theme-transition"),o.classList.toggle("dark",l==="dark"),o.classList.toggle("light",l==="light"),localStorage.setItem("vibe-replay-theme",l);const u=setTimeout(()=>o.classList.remove("theme-transition"),300);return()=>clearTimeout(u)},[l]);const i=y.useCallback(()=>{r(o=>o==="dark"?"light":"dark")},[]);return{theme:l,toggleTheme:i}}function Eh(){const r=new URLSearchParams(window.location.search).get("v");return r==="summary"||r==="export"?r:"replay"}const Zs="https://vibe-replay.com";function Ah({isEditor:l}){const[r,i]=y.useState(null),[o,u]=y.useState(!1),m=y.useRef(null),p=y.useRef(null),g=y.useRef(null);return y.useEffect(()=>{const f=l?"/api/auth/get-session":`${Zs}/api/auth/get-session`;let x="";if(!l)try{x=new URL(Zs).origin}catch{x=""}const h=l?{}:{credentials:"include"},v=()=>{fetch(f,h).then(j=>j.json()).then(j=>{j?.session?i({authenticated:!0,user:j.user||null}):i({authenticated:!1,user:null})}).catch(()=>i({authenticated:!1,user:null}))};v();const C=j=>{!l&&j.origin===x&&j.data?.type==="vibe-replay-auth"&&j.data.user&&(i({authenticated:!0,user:j.data.user}),window.dispatchEvent(new Event("vibe-auth-change")))};return window.addEventListener("message",C),window.addEventListener("focus",v),()=>{p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null),window.removeEventListener("message",C),window.removeEventListener("focus",v)}},[l]),y.useEffect(()=>{if(!o)return;const f=x=>{m.current&&!m.current.contains(x.target)&&u(!1)};return document.addEventListener("click",f),()=>document.removeEventListener("click",f)},[o]),r?r.authenticated?n.jsxs("div",{className:"relative",ref:m,children:[n.jsx("button",{type:"button",onClick:()=>u(!o),className:"flex items-center justify-center w-7 h-7 rounded-full ring-2 ring-terminal-border/40 hover:ring-terminal-green/60 transition-all cursor-pointer overflow-hidden",children:r.user?.image?n.jsx("img",{src:r.user.image,alt:"",className:"w-full h-full rounded-full object-cover"}):n.jsx("span",{className:"text-[10px] text-terminal-dim",children:"?"})}),o&&n.jsxs("div",{className:"absolute right-0 top-full mt-2 min-w-[140px] bg-terminal-surface border border-terminal-border rounded-lg shadow-lg py-1 z-50",children:[n.jsx("div",{className:"px-3 py-2 text-[11px] text-terminal-dim border-b border-terminal-border truncate font-mono",children:r.user?.name||"logged in"}),n.jsx("button",{type:"button",onClick:async()=>{const f=l?"/api/auth/sign-out":`${Zs}/api/auth/sign-out`;await fetch(f,{method:"POST",...l?{}:{credentials:"include"}}),window.location.reload()},className:"w-full text-left px-3 py-2 text-xs text-terminal-dim hover:text-red-400 hover:bg-terminal-surface-hover transition-colors cursor-pointer font-mono",children:"Logout"})]})]}):n.jsxs("button",{type:"button",onClick:async()=>{if(l)try{const h=await fetch("/api/auth/login",{method:"POST"}),v=await h.json().catch(()=>null);h.ok&&v?.url&&window.open(v.url,"_blank")}catch{}else window.open(`${Zs}/auth/login?callback=/auth/success`,"_blank");p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null);const f=l?"/api/auth/get-session":`${Zs}/api/auth/get-session`,x=l?{}:{credentials:"include"};p.current=setInterval(async()=>{try{const v=await(await fetch(f,x)).json();v?.session&&(p.current&&(clearInterval(p.current),p.current=null),g.current&&(clearTimeout(g.current),g.current=null),i({authenticated:!0,user:v.user||null}),window.dispatchEvent(new Event("vibe-auth-change")))}catch{}},2e3),g.current=setTimeout(()=>{p.current&&(clearInterval(p.current),p.current=null),g.current=null},300*1e3)},className:"inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md bg-[#24292f] hover:bg-[#32383f] text-white text-xs font-medium transition-colors cursor-pointer border border-white/10",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Sign in"]}):null}function uu(){const[l,r]=y.useState(null);return y.useEffect(()=>{window.__VIBE_REPLAY_EDITOR__&&fetch("https://api.github.com/repos/tuo-lei/vibe-replay").then(i=>i.json()).then(i=>{i.stargazers_count!=null&&r(i.stargazers_count)}).catch(()=>{})},[]),n.jsxs("a",{href:"https://github.com/tuo-lei/vibe-replay",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center h-7 rounded-md border border-terminal-border text-xs font-medium text-terminal-text/70 hover:text-terminal-text hover:border-terminal-text/30 transition-colors",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 px-2",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:n.jsx("path",{d:"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z"})}),"Star"]}),l!=null&&n.jsx("span",{className:"inline-flex items-center px-2 h-full border-l border-terminal-border",children:l})]})}function Sj(){const l=vj(),{theme:r,toggleTheme:i}=Nj(),{prefs:o,updatePref:u,togglePref:m}=ty(),p=l.status==="ready"?l.session:null,g=l.status==="ready"?l.mode:"embedded",f=l.status==="ready"?l.gistOwner:void 0,x=g==="editor",[h,v]=y.useState(Eh()),C=y.useRef(null);y.useEffect(()=>{const $=()=>v(Eh());return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[]);const j=$=>{v($),ht({v:$==="replay"?null:$})},w=y.useMemo(()=>p?.scenes.some($=>$.type==="thinking")??!1,[p]),[S,k]=y.useState(!1);y.useEffect(()=>{if(!S)return;const $=H=>{H.key==="Escape"&&k(!1)};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[S]);const[E,M]=y.useState(!1),A=y.useRef(null);y.useEffect(()=>{o.displayMode!=="custom"&&M(!1)},[o.displayMode]);const R=y.useCallback(()=>M(!1),[]);if(Au(A,R,E),l.status==="loading")return n.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-green font-sans font-bold text-sm animate-pulse",children:"LOADING SESSION..."}),n.jsx("div",{className:"text-terminal-dimmer font-mono text-xs",children:"Preparing replay data"})]})});if(l.status==="error")return n.jsx("div",{className:"h-screen bg-terminal-bg flex items-center justify-center",children:n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("div",{className:"text-terminal-red font-mono text-sm",children:l.message}),n.jsx("div",{className:"text-terminal-dim font-mono text-xs",children:"Use ?gist=<id> or ?url=<replay-json-url> or embed via CLI"})]})});if(l.status==="dashboard")return n.jsx("div",{className:"h-screen bg-terminal-bg flex flex-col overflow-hidden",children:n.jsx($0,{headerLeft:n.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[n.jsx("button",{onClick:()=>ht({view:null,session:null}),className:"text-sm font-sans font-bold bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent hover:opacity-80 transition-opacity",children:"vibe-replay"}),n.jsxs("span",{className:"instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-terminal-green animate-pulse"}),"Local",n.jsx("span",{className:"instant-tooltip-text",children:`v0.1.5
|
|
160
160
|
Viewer ${window.location.host}
|
|
161
|
-
Cloud https://vibe-replay.com`})]})]}),headerRight:n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsx(
|
|
161
|
+
Cloud https://vibe-replay.com`})]})]}),headerRight:n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.jsx(uu,{}),n.jsx("button",{onClick:i,className:"w-7 h-7 flex items-center justify-center rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover text-sm transition-colors",children:r==="dark"?"☾":"☀"}),n.jsx(Ah,{isEditor:!0})]})})});const{meta:O}=p;return n.jsxs("div",{className:"h-screen bg-terminal-bg flex flex-col overflow-hidden",children:[n.jsxs("header",{className:"relative z-40 border-b border-terminal-border-subtle px-5 py-2 flex items-center gap-4 shrink-0 glass-effect safe-top",children:[n.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[x?n.jsx("button",{onClick:()=>ht({view:"dashboard",session:null}),className:"text-sm font-sans font-bold shrink-0 hover:opacity-80 transition-opacity bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}):n.jsx("a",{href:"https://vibe-replay.com",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-sans font-bold shrink-0 hover:opacity-80 transition-opacity bg-gradient-to-r from-terminal-green to-terminal-blue bg-clip-text text-transparent",children:"vibe-replay"}),x&&n.jsxs("span",{className:"instant-tooltip inline-flex items-center gap-1 text-[9px] font-sans font-bold px-2 py-0.5 rounded-full bg-terminal-green/10 text-terminal-green uppercase tracking-wider border border-terminal-green/20",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-terminal-green animate-pulse"}),"Local",n.jsx("span",{className:"instant-tooltip-text",children:`v0.1.5
|
|
162
162
|
Viewer ${window.location.host}
|
|
163
|
-
Cloud https://vibe-replay.com`})]})]}),
|
|
164
|
-
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{scrollbar-width:thin;scrollbar-color:var(--border) var(--bg)}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.tabular-nums{font-variant-numeric:tabular-nums}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.-bottom-20{bottom:-5rem}.-left-20{left:-5rem}.-right-20{right:-5rem}.-top-20{top:-5rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-3{left:.75rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[120\]{z-index:120}.z-\[60\]{z-index:60}.\!m-0{margin:0!important}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-auto{margin-bottom:auto}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[10px\]{height:10px}.h-\[65vh\]{height:65vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-28{max-height:7rem}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-\[100px\]{max-height:100px}.max-h-\[120px\]{max-height:120px}.max-h-\[180px\]{max-height:180px}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[35\%\]{max-height:35%}.max-h-\[4\.5em\]{max-height:4.5em}.max-h-\[400px\]{max-height:400px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[88vh\]{max-height:88vh}.min-h-0{min-height:0px}.min-h-4{min-height:1rem}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[10px\]{width:10px}.w-\[68px\]{width:68px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.max-w-0{max-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-\[60\%\]{max-width:60%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[17px\]{--tw-translate-x: 17px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[3px\]{--tw-translate-x: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[3px\]{gap:3px}.gap-px{gap:1px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.gap-y-5{row-gap:1.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[rgba\(168\,85\,247\,0\.2\)\]{border-color:#a855f733}.border-\[rgba\(168\,85\,247\,0\.3\)\]{border-color:#a855f74d}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-blue-500\/60{border-color:#3b82f699}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/30{border-color:#22c55e4d}.border-orange-500\/20{border-color:#f9731633}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-terminal-blue{border-color:var(--blue)}.border-terminal-border{border-color:var(--border)}.border-terminal-border-subtle{border-color:var(--border-subtle)}.border-terminal-dim{border-color:var(--dim)}.border-terminal-green{border-color:var(--green)}.border-white\/10{border-color:#ffffff1a}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:transparent!important}.bg-\[\#24292f\]{--tw-bg-opacity: 1;background-color:rgb(36 41 47 / var(--tw-bg-opacity, 1))}.bg-\[rgba\(168\,85\,247\,0\.1\)\]{background-color:#a855f71a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-500\/20{background-color:#6b728033}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-terminal-bg{background-color:var(--bg)}.bg-terminal-blue{background-color:var(--blue)}.bg-terminal-blue-emphasis{background-color:var(--blue-emphasis)}.bg-terminal-blue-subtle{background-color:var(--blue-subtle)}.bg-terminal-border{background-color:var(--border)}.bg-terminal-border-subtle{background-color:var(--border-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-green{background-color:var(--green)}.bg-terminal-green-emphasis{background-color:var(--green-emphasis)}.bg-terminal-green-subtle{background-color:var(--green-subtle)}.bg-terminal-orange{background-color:var(--orange)}.bg-terminal-orange-subtle{background-color:var(--orange-subtle)}.bg-terminal-purple{background-color:var(--purple)}.bg-terminal-purple-subtle{background-color:var(--purple-subtle)}.bg-terminal-red{background-color:var(--red)}.bg-terminal-red-subtle{background-color:var(--red-subtle)}.bg-terminal-surface{background-color:var(--surface)}.bg-terminal-surface-2{background-color:var(--surface-2)}.bg-terminal-surface-hover{background-color:var(--surface-hover)}.bg-terminal-surface-inset{background-color:var(--surface-inset)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-terminal-bg{--tw-gradient-from: var(--bg) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green{--tw-gradient-from: var(--green) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green-subtle{--tw-gradient-from: var(--green-subtle) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-surface{--tw-gradient-from: var(--surface) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-terminal-bg{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--bg) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/5{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .05) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-terminal-blue{--tw-gradient-to: var(--blue) var(--tw-gradient-to-position)}.to-terminal-surface{--tw-gradient-to: var(--surface) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-12{padding-top:3rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-\[8vh\]{padding-top:8vh}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-\[1\.15\]{line-height:1.15}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-\[\.25em\]{letter-spacing:.25em}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-normal{letter-spacing:0em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#c084fc\]{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-400\/80{color:#60a5facc}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/40{color:#c084fc66}.text-purple-400\/60{color:#c084fc99}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-terminal-bg{color:var(--bg)}.text-terminal-blue{color:var(--blue)}.text-terminal-border{color:var(--border)}.text-terminal-dim{color:var(--dim)}.text-terminal-dimmer{color:var(--dimmer)}.text-terminal-green{color:var(--green)}.text-terminal-orange{color:var(--orange)}.text-terminal-purple{color:var(--purple)}.text-terminal-red{color:var(--red)}.text-terminal-text{color:var(--text)}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.placeholder-terminal-dim::-moz-placeholder{color:var(--dim)}.placeholder-terminal-dim::placeholder{color:var(--dim)}.placeholder-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder-terminal-dimmer::placeholder{color:var(--dimmer)}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-\[0_0_8px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow: 0 0 8px rgba(251,146,60,.5);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-xl{--tw-shadow: var(--shadow-xl);--tw-shadow-colored: var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-terminal-border-subtle{--tw-ring-color: var(--border-subtle)}.ring-transparent{--tw-ring-color: transparent}.blur-2xl{--tw-blur: blur(40px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-75{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\]{transition-property:left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-material{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-decel,.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body{overflow-x:hidden;max-width:100vw}:root{--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}:root,.dark{--bg: #0d1117;--surface: #161b22;--surface-hover: #21262d;--surface-2: #1c2129;--surface-inset: #010409;--border: #30363d;--border-subtle: rgba(48, 54, 61, .5);--text: #c9d1d9;--dim: #8b949e;--dimmer: #7d8590;--green: #3fb950;--green-subtle: rgba(63, 185, 80, .15);--green-emphasis: rgba(63, 185, 80, .25);--blue: #79b8ff;--blue-subtle: rgba(121, 184, 255, .15);--blue-emphasis: rgba(121, 184, 255, .25);--orange: #d29922;--orange-subtle: rgba(210, 153, 34, .15);--orange-emphasis: rgba(210, 153, 34, .25);--red: #f85149;--red-subtle: rgba(248, 81, 73, .15);--red-emphasis: rgba(248, 81, 73, .25);--purple: #b392f0;--purple-subtle: rgba(179, 146, 240, .15);--purple-emphasis: rgba(179, 146, 240, .25);--cyan: #56d4dd;--cyan-subtle: rgba(86, 212, 221, .15);--shadow-color: 215 28% 4%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .5);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3), 0 12px 24px hsl(var(--shadow-color) / .25);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .4), 0 8px 16px hsl(var(--shadow-color) / .3), 0 24px 48px hsl(var(--shadow-color) / .25);--surface-subtle-glass: rgba(13, 17, 23, .7)}.light{--bg: #ffffff;--surface: #f6f8fa;--surface-hover: #e6edf3;--surface-2: #ebeef1;--surface-inset: #f0f2f5;--border: #d0d7de;--border-subtle: rgba(208, 215, 222, .5);--text: #24292f;--dim: #57606a;--dimmer: #697078;--green: #1a7f37;--green-subtle: rgba(26, 127, 55, .1);--green-emphasis: rgba(26, 127, 55, .2);--blue: #0969da;--blue-subtle: rgba(9, 105, 218, .1);--blue-emphasis: rgba(9, 105, 218, .2);--orange: #9a6700;--orange-subtle: rgba(154, 103, 0, .1);--orange-emphasis: rgba(154, 103, 0, .2);--red: #cf222e;--red-subtle: rgba(207, 34, 46, .1);--red-emphasis: rgba(207, 34, 46, .2);--purple: #8250df;--purple-subtle: rgba(130, 80, 223, .1);--purple-emphasis: rgba(130, 80, 223, .2);--cyan: #0e7c86;--cyan-subtle: rgba(14, 124, 134, .1);--shadow-color: 220 10% 50%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .1);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06), 0 12px 24px hsl(var(--shadow-color) / .05);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .08), 0 8px 16px hsl(var(--shadow-color) / .06), 0 24px 48px hsl(var(--shadow-color) / .05);--surface-subtle-glass: rgba(255, 255, 255, .75)}html.theme-transition,html.theme-transition *,html.theme-transition *:before,html.theme-transition *:after{transition:background-color .25s ease,border-color .25s ease,color .25s ease}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}button,[role=button]{-webkit-tap-highlight-color:transparent}:focus:not(:focus-visible){outline:none}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}@supports (padding: env(safe-area-inset-top)){.safe-top{padding-top:max(env(safe-area-inset-top),1.25rem)}.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.typing-cursor:after{content:"█";animation:blink 1s step-end infinite;color:var(--green)}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:fade-in .3s cubic-bezier(.4,0,.2,1)}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:pulse-border 2s ease-in-out infinite}@keyframes jump-target-flash{0%{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}30%{box-shadow:0 0 0 3px #3fb95040;outline-color:#3fb95099}to{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}}.jump-target-flash{outline:1px solid transparent;animation:jump-target-flash .85s ease-out}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:nav-focus-pulse .9s ease-in-out 2}@keyframes landing-glow{0%,to{box-shadow:0 0 #3fb95000}50%{box-shadow:0 0 20px 2px #3fb95026}}.landing-pulse{animation:landing-glow 2.5s ease-in-out infinite}.instant-tooltip{position:relative}.instant-tooltip .instant-tooltip-text{visibility:hidden;opacity:0;position:absolute;left:50%;top:100%;transform:translate(-50%);margin-top:6px;padding:4px 8px;border-radius:6px;background:var(--surface);border:1px solid var(--border-subtle);box-shadow:var(--shadow-md);color:var(--text);font:11px / 1.4 var(--font-sans),monospace;text-transform:none;letter-spacing:normal;white-space:pre-line;pointer-events:none;z-index:50;transition:opacity .08s ease}.instant-tooltip:hover .instant-tooltip-text{visibility:visible;opacity:1}.hover-lift{transition:transform .25s cubic-bezier(.175,.885,.32,1.275),box-shadow .25s cubic-bezier(.175,.885,.32,1.275),background-color .2s ease}.hover-lift:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}.glass-effect{backdrop-filter:blur(12px) saturate(180%);-webkit-backdrop-filter:blur(12px) saturate(180%);background-color:var(--surface-subtle-glass)}.premium-card{position:relative}.premium-card:before{content:"";position:absolute;inset:0;padding:1px;border-radius:inherit;background:linear-gradient(135deg,var(--green-subtle),var(--blue-subtle));-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;opacity:.5}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-hover) 50%,var(--surface-2) 75%);background-size:1000px 100%;animation:shimmer 2s infinite linear;border-radius:4px}.bg-dot-grid{background-image:radial-gradient(circle,var(--text) 1px,transparent 1px);background-size:24px 24px;opacity:.03}.minimap-item{transition:background-color .2s cubic-bezier(.4,0,.2,1),border-color .2s cubic-bezier(.4,0,.2,1)}.prose-terminal{line-height:1.6}.prose-terminal p{margin:.5em 0}.prose-terminal code{background:var(--surface);padding:.15em .4em;border-radius:4px;font-size:.9em}.prose-terminal pre{background:var(--surface);padding:.75em 1em;border-radius:6px;overflow-x:auto;margin:.5em 0}.prose-terminal pre code{background:none;padding:0}.prose-terminal ul,.prose-terminal ol{padding-left:1.5em;margin:.5em 0}.prose-terminal li{margin:.25em 0}.prose-terminal h1,.prose-terminal h2,.prose-terminal h3{margin:.75em 0 .5em;font-weight:600}.prose-terminal blockquote{border-left:3px solid var(--border);padding-left:1em;color:var(--dim);margin:.5em 0}.prose-terminal a{color:var(--blue);text-decoration:underline}.prose-terminal table{border-collapse:collapse;margin:.5em 0}.prose-terminal th,.prose-terminal td{border:1px solid var(--border);padding:.4em .8em}.placeholder\:text-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder\:text-terminal-dimmer::placeholder{color:var(--dimmer)}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[rgba\(168\,85\,247\,0\.5\)\]:hover{border-color:#a855f780}.hover\:border-terminal-border:hover{border-color:var(--border)}.hover\:border-terminal-green:hover{border-color:var(--green)}.hover\:bg-\[\#32383f\]:hover{--tw-bg-opacity: 1;background-color:rgb(50 56 63 / var(--tw-bg-opacity, 1))}.hover\:bg-\[rgba\(168\,85\,247\,0\.2\)\]:hover{background-color:#a855f733}.hover\:bg-\[rgba\(168\,85\,247\,0\.25\)\]:hover{background-color:#a855f740}.hover\:bg-terminal-blue-emphasis:hover{background-color:var(--blue-emphasis)}.hover\:bg-terminal-blue-subtle:hover{background-color:var(--blue-subtle)}.hover\:bg-terminal-green-emphasis:hover{background-color:var(--green-emphasis)}.hover\:bg-terminal-orange-emphasis:hover{background-color:var(--orange-emphasis)}.hover\:bg-terminal-orange-subtle:hover{background-color:var(--orange-subtle)}.hover\:bg-terminal-purple-emphasis:hover{background-color:var(--purple-emphasis)}.hover\:bg-terminal-purple-subtle:hover{background-color:var(--purple-subtle)}.hover\:bg-terminal-red-emphasis:hover{background-color:var(--red-emphasis)}.hover\:bg-terminal-red-subtle:hover{background-color:var(--red-subtle)}.hover\:bg-terminal-surface:hover{background-color:var(--surface)}.hover\:bg-terminal-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-terminal-surface-hover:hover{background-color:var(--surface-hover)}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-terminal-blue:hover{color:var(--blue)}.hover\:text-terminal-dim:hover{color:var(--dim)}.hover\:text-terminal-green:hover{color:var(--green)}.hover\:text-terminal-orange:hover{color:var(--orange)}.hover\:text-terminal-red:hover{color:var(--red)}.hover\:text-terminal-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-layer-lg:hover{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-layer-md:hover{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-1:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-0\.5{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/help:hover .group-hover\/help\:border-terminal-text{border-color:var(--text)}.group\/help:hover .group-hover\/help\:bg-terminal-text{background-color:var(--text)}.group\/help:hover .group-hover\/help\:text-terminal-bg{color:var(--bg)}.group\/ref:hover .group-hover\/ref\:text-terminal-text{color:var(--text)}.group\/search:hover .group-hover\/search\:text-terminal-blue{color:var(--blue)}.group:hover .group-hover\:text-terminal-green{color:var(--green)}.group:hover .group-hover\:text-terminal-text{color:var(--text)}.group\/batch:hover .group-hover\/batch\:opacity-100,.group\/help:hover .group-hover\/help\:opacity-100,.group\/pause:hover .group-hover\/pause\:opacity-100,.group\/scene:hover .group-hover\/scene\:opacity-100,.group\/search:hover .group-hover\/search\:opacity-100{opacity:1}.group\/search:hover .group-hover\/search\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-60{opacity:.6}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-terminal-surface-2:is(.dark *){background-color:var(--surface-2)}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@media(min-width:640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:gap-3{gap:.75rem}.sm\:rounded-xl{border-radius:.75rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:pt-\[15vh\]{padding-top:15vh}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media(min-width:768px){.md\:ml-12{margin-left:3rem}.md\:mt-10{margin-top:2.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:min-h-0{min-height:0px}.md\:max-w-\[300px\]{max-width:300px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-5xl{font-size:3rem;line-height:1}}@media(min-width:1024px){.lg\:inline{display:inline}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}</style>
|
|
163
|
+
Cloud https://vibe-replay.com`})]})]}),x&&n.jsx("nav",{className:"hidden md:inline-flex items-center rounded-xl bg-terminal-surface p-0.5 shadow-layer-sm shrink-0",children:["home","sessions","replays","projects","insights"].map($=>n.jsx("button",{onClick:()=>ht({view:"dashboard",session:null,tab:$}),className:"px-3.5 py-1.5 text-xs font-sans font-semibold rounded-lg text-terminal-dim hover:text-terminal-text transition-all duration-200 ease-material",children:$.charAt(0).toUpperCase()+$.slice(1)},$))}),O.title&&n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:"text-terminal-border/40 text-sm select-none hidden md:inline",children:"|"}),n.jsx("button",{type:"button",onClick:()=>{C.current?.(),j("replay")},className:"text-terminal-text text-xs font-sans font-medium truncate max-w-[180px] md:max-w-[300px] hover:text-terminal-green transition-colors",title:"Back to landing page",children:O.title}),f&&n.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 text-xs font-mono text-terminal-dim",children:[n.jsx("span",{className:"text-terminal-border",children:"·"}),n.jsx("span",{className:"text-terminal-dimmer",children:"shared by"}),n.jsxs("a",{href:`https://github.com/${f}`,target:"_blank",rel:"noopener noreferrer",className:"text-terminal-dim hover:text-terminal-text transition-colors",children:["@",f]})]})]}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1.5 md:gap-2 shrink-0",children:[n.jsxs("div",{ref:A,className:"hidden md:flex items-center gap-1.5",children:[n.jsxs("div",{className:"relative flex items-center",children:[n.jsxs("div",{className:"flex items-center h-7 rounded-md overflow-hidden bg-terminal-surface",children:[n.jsx("button",{onClick:()=>u("displayMode","all"),className:`h-full px-2.5 text-xs font-mono transition-colors ${o.displayMode==="all"?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:"All"}),n.jsx("button",{onClick:()=>u("displayMode","compact"),className:`h-full px-2.5 text-xs font-mono transition-colors ${o.displayMode==="compact"?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:"Compact"}),n.jsx("button",{onClick:()=>{u("displayMode","custom"),M($=>o.displayMode==="custom"?!$:!0)},className:`h-full px-2.5 text-xs font-mono transition-colors ${o.displayMode==="custom"?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover"}`,children:"Custom"})]}),E&&o.displayMode==="custom"&&n.jsxs("div",{className:"absolute right-0 top-full mt-2 w-40 bg-terminal-surface border border-terminal-border-subtle rounded-xl shadow-layer-xl z-50 py-1.5 backdrop-blur-md",children:[n.jsxs("button",{onClick:()=>m("promptsOnly"),className:"w-full text-left px-3 py-1.5 text-xs font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface/50 transition-colors flex items-center gap-2",children:[n.jsx("span",{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${o.promptsOnly?"bg-terminal-green-subtle text-terminal-green":"bg-terminal-bg"}`,children:o.promptsOnly?"✓":""}),"Prompts Only"]}),n.jsxs("button",{onClick:()=>m("collapseAllTools"),className:"w-full text-left px-3 py-1.5 text-xs font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface/50 transition-colors flex items-center gap-2",children:[n.jsx("span",{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${o.collapseAllTools?"bg-terminal-orange-subtle text-terminal-orange":"bg-terminal-bg"}`,children:o.collapseAllTools?"✓":""}),"Tools Collapsed"]}),w&&n.jsxs("button",{onClick:()=>m("hideThinking"),className:"w-full text-left px-3 py-1.5 text-xs font-mono text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface/50 transition-colors flex items-center gap-2",children:[n.jsx("span",{className:`w-3.5 h-3.5 rounded flex items-center justify-center text-[10px] ${o.hideThinking?"bg-terminal-purple-subtle text-terminal-purple":"bg-terminal-bg"}`,children:o.hideThinking?"✓":""}),"Thinking Hidden"]})]})]}),n.jsx(uu,{}),n.jsx("button",{onClick:i,className:"h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover text-xs transition-colors",title:r==="dark"?"Light mode":"Dark mode",children:r==="dark"?"☾":"☀"}),x&&n.jsx(Ah,{isEditor:x})]}),n.jsx("button",{onClick:()=>k($=>!$),className:"md:hidden h-7 w-7 flex items-center justify-center rounded-md bg-terminal-surface text-terminal-dim hover:text-terminal-text hover:bg-terminal-surface-hover transition-colors","aria-label":"Menu",children:S?n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}):n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})})]}),S&&n.jsx("div",{className:"md:hidden absolute top-full left-0 right-0 z-50 bg-terminal-bg shadow-layer-xl rounded-b-2xl border-b border-terminal-border-subtle",children:n.jsxs("div",{className:"px-5 py-4 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim",children:"Display"}),n.jsx("div",{className:"flex items-center h-8 rounded-lg overflow-hidden bg-terminal-surface",children:["all","compact","custom"].map($=>n.jsx("button",{onClick:()=>{u("displayMode",$),$!=="custom"&&k(!1)},className:`h-full px-3.5 text-xs font-mono capitalize transition-colors ${o.displayMode===$?"bg-terminal-green-subtle text-terminal-green":"text-terminal-dim hover:text-terminal-text"}`,children:$},$))})]}),o.displayMode==="custom"&&n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>m("promptsOnly"),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${o.promptsOnly?"bg-terminal-green-subtle text-terminal-green border-terminal-green/30":"text-terminal-dim border-terminal-border-subtle"}`,children:"Prompts Only"}),n.jsx("button",{onClick:()=>m("collapseAllTools"),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${o.collapseAllTools?"bg-terminal-orange-subtle text-terminal-orange border-terminal-orange/30":"text-terminal-dim border-terminal-border-subtle"}`,children:"Tools Collapsed"}),w&&n.jsx("button",{onClick:()=>m("hideThinking"),className:`px-3 py-1.5 text-xs font-mono rounded-lg border transition-colors ${o.hideThinking?"bg-terminal-purple-subtle text-terminal-purple border-terminal-purple/30":"text-terminal-dim border-terminal-border-subtle"}`,children:"Thinking Hidden"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim",children:"Theme"}),n.jsxs("button",{onClick:()=>{i(),k(!1)},className:"h-8 px-3.5 flex items-center gap-2 rounded-lg bg-terminal-surface text-terminal-dim text-xs font-mono transition-colors",children:[r==="dark"?"☾":"☀",n.jsx("span",{children:r==="dark"?"Light":"Dark"})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] font-sans font-medium text-terminal-dim",children:"GitHub"}),n.jsx(uu,{})]})]})})]}),S&&n.jsx("div",{className:"md:hidden fixed inset-0 z-30 bg-black/30",onClick:()=>k(!1)}),n.jsx(yj,{session:p,viewPrefs:o,viewerMode:g,activeView:h,setActiveView:j,returnToLandingRef:C})]})}Zb.createRoot(document.getElementById("root")).render(n.jsx($b.StrictMode,{children:n.jsx(Sj,{})}));</script>
|
|
164
|
+
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{scrollbar-width:thin;scrollbar-color:var(--border) var(--bg)}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.tabular-nums{font-variant-numeric:tabular-nums}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.-bottom-20{bottom:-5rem}.-left-20{left:-5rem}.-right-20{right:-5rem}.-top-20{top:-5rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-3{left:.75rem}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[120\]{z-index:120}.z-\[60\]{z-index:60}.\!m-0{margin:0!important}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-auto{margin-bottom:auto}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[10px\]{height:10px}.h-\[65vh\]{height:65vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-28{max-height:7rem}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-\[100px\]{max-height:100px}.max-h-\[120px\]{max-height:120px}.max-h-\[180px\]{max-height:180px}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[35\%\]{max-height:35%}.max-h-\[4\.5em\]{max-height:4.5em}.max-h-\[400px\]{max-height:400px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[88vh\]{max-height:88vh}.min-h-0{min-height:0px}.min-h-4{min-height:1rem}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[10px\]{width:10px}.w-\[68px\]{width:68px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-4{min-width:1rem}.min-w-\[140px\]{min-width:140px}.min-w-\[40px\]{min-width:40px}.max-w-0{max-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-\[400px\]{max-width:400px}.max-w-\[60\%\]{max-width:60%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[17px\]{--tw-translate-x: 17px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[3px\]{--tw-translate-x: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[3px\]{gap:3px}.gap-px{gap:1px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.gap-y-5{row-gap:1.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[rgba\(168\,85\,247\,0\.2\)\]{border-color:#a855f733}.border-\[rgba\(168\,85\,247\,0\.3\)\]{border-color:#a855f74d}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/20{border-color:#3b82f633}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-blue-500\/60{border-color:#3b82f699}.border-cyan-500\/30{border-color:#06b6d44d}.border-gray-500\/30{border-color:#6b72804d}.border-green-500\/15{border-color:#22c55e26}.border-green-500\/30{border-color:#22c55e4d}.border-orange-500\/20{border-color:#f9731633}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-red-400\/20{border-color:#f8717133}.border-terminal-blue{border-color:var(--blue)}.border-terminal-border{border-color:var(--border)}.border-terminal-border-subtle{border-color:var(--border-subtle)}.border-terminal-dim{border-color:var(--dim)}.border-terminal-green{border-color:var(--green)}.border-white\/10{border-color:#ffffff1a}.border-l-terminal-blue{border-left-color:var(--blue)}.border-l-terminal-purple{border-left-color:var(--purple)}.\!bg-transparent{background-color:transparent!important}.bg-\[\#24292f\]{--tw-bg-opacity: 1;background-color:rgb(36 41 47 / var(--tw-bg-opacity, 1))}.bg-\[rgba\(168\,85\,247\,0\.1\)\]{background-color:#a855f71a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-cyan-500\/20{background-color:#06b6d433}.bg-gray-500\/20{background-color:#6b728033}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-terminal-bg{background-color:var(--bg)}.bg-terminal-blue{background-color:var(--blue)}.bg-terminal-blue-emphasis{background-color:var(--blue-emphasis)}.bg-terminal-blue-subtle{background-color:var(--blue-subtle)}.bg-terminal-border{background-color:var(--border)}.bg-terminal-border-subtle{background-color:var(--border-subtle)}.bg-terminal-dim{background-color:var(--dim)}.bg-terminal-green{background-color:var(--green)}.bg-terminal-green-emphasis{background-color:var(--green-emphasis)}.bg-terminal-green-subtle{background-color:var(--green-subtle)}.bg-terminal-orange{background-color:var(--orange)}.bg-terminal-orange-subtle{background-color:var(--orange-subtle)}.bg-terminal-purple{background-color:var(--purple)}.bg-terminal-purple-subtle{background-color:var(--purple-subtle)}.bg-terminal-red{background-color:var(--red)}.bg-terminal-red-subtle{background-color:var(--red-subtle)}.bg-terminal-surface{background-color:var(--surface)}.bg-terminal-surface-2{background-color:var(--surface-2)}.bg-terminal-surface-hover{background-color:var(--surface-hover)}.bg-terminal-surface-inset{background-color:var(--surface-inset)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-terminal-bg{--tw-gradient-from: var(--bg) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green{--tw-gradient-from: var(--green) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-green-subtle{--tw-gradient-from: var(--green-subtle) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-terminal-surface{--tw-gradient-from: var(--surface) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-terminal-bg{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--bg) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/5{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .05) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-terminal-blue{--tw-gradient-to: var(--blue) var(--tw-gradient-to-position)}.to-terminal-surface{--tw-gradient-to: var(--surface) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-12{padding-top:3rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-\[8vh\]{padding-top:8vh}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-\[1\.15\]{line-height:1.15}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-\[\.25em\]{letter-spacing:.25em}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-normal{letter-spacing:0em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#c084fc\]{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-400\/80{color:#60a5facc}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/40{color:#c084fc66}.text-purple-400\/60{color:#c084fc99}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-terminal-bg{color:var(--bg)}.text-terminal-blue{color:var(--blue)}.text-terminal-border{color:var(--border)}.text-terminal-dim{color:var(--dim)}.text-terminal-dimmer{color:var(--dimmer)}.text-terminal-green{color:var(--green)}.text-terminal-orange{color:var(--orange)}.text-terminal-purple{color:var(--purple)}.text-terminal-red{color:var(--red)}.text-terminal-text{color:var(--text)}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.placeholder-terminal-dim::-moz-placeholder{color:var(--dim)}.placeholder-terminal-dim::placeholder{color:var(--dim)}.placeholder-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder-terminal-dimmer::placeholder{color:var(--dimmer)}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(251\,146\,60\,0\.5\)\]{--tw-shadow: 0 0 8px rgba(251,146,60,.5);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-layer-xl{--tw-shadow: var(--shadow-xl);--tw-shadow-colored: var(--shadow-xl);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-terminal-border-subtle{--tw-ring-color: var(--border-subtle)}.ring-transparent{--tw-ring-color: transparent}.blur-2xl{--tw-blur: blur(40px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-75{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\]{transition-property:left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-material{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-decel,.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body{overflow-x:hidden;max-width:100vw}:root{--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}:root,.dark{--bg: #0d1117;--surface: #161b22;--surface-hover: #21262d;--surface-2: #1c2129;--surface-inset: #010409;--border: #30363d;--border-subtle: rgba(48, 54, 61, .5);--text: #c9d1d9;--dim: #8b949e;--dimmer: #7d8590;--green: #3fb950;--green-subtle: rgba(63, 185, 80, .15);--green-emphasis: rgba(63, 185, 80, .25);--blue: #79b8ff;--blue-subtle: rgba(121, 184, 255, .15);--blue-emphasis: rgba(121, 184, 255, .25);--orange: #d29922;--orange-subtle: rgba(210, 153, 34, .15);--orange-emphasis: rgba(210, 153, 34, .25);--red: #f85149;--red-subtle: rgba(248, 81, 73, .15);--red-emphasis: rgba(248, 81, 73, .25);--purple: #b392f0;--purple-subtle: rgba(179, 146, 240, .15);--purple-emphasis: rgba(179, 146, 240, .25);--cyan: #56d4dd;--cyan-subtle: rgba(86, 212, 221, .15);--shadow-color: 215 28% 4%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .5);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .4), 0 4px 8px hsl(var(--shadow-color) / .3), 0 12px 24px hsl(var(--shadow-color) / .25);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .4), 0 8px 16px hsl(var(--shadow-color) / .3), 0 24px 48px hsl(var(--shadow-color) / .25);--surface-subtle-glass: rgba(13, 17, 23, .7)}.light{--bg: #ffffff;--surface: #f6f8fa;--surface-hover: #e6edf3;--surface-2: #ebeef1;--surface-inset: #f0f2f5;--border: #d0d7de;--border-subtle: rgba(208, 215, 222, .5);--text: #24292f;--dim: #57606a;--dimmer: #697078;--green: #1a7f37;--green-subtle: rgba(26, 127, 55, .1);--green-emphasis: rgba(26, 127, 55, .2);--blue: #0969da;--blue-subtle: rgba(9, 105, 218, .1);--blue-emphasis: rgba(9, 105, 218, .2);--orange: #9a6700;--orange-subtle: rgba(154, 103, 0, .1);--orange-emphasis: rgba(154, 103, 0, .2);--red: #cf222e;--red-subtle: rgba(207, 34, 46, .1);--red-emphasis: rgba(207, 34, 46, .2);--purple: #8250df;--purple-subtle: rgba(130, 80, 223, .1);--purple-emphasis: rgba(130, 80, 223, .2);--cyan: #0e7c86;--cyan-subtle: rgba(14, 124, 134, .1);--shadow-color: 220 10% 50%;--shadow-sm: 0 1px 2px hsl(var(--shadow-color) / .1);--shadow-md: 0 1px 2px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06);--shadow-lg: 0 1px 3px hsl(var(--shadow-color) / .08), 0 4px 8px hsl(var(--shadow-color) / .06), 0 12px 24px hsl(var(--shadow-color) / .05);--shadow-xl: 0 2px 4px hsl(var(--shadow-color) / .08), 0 8px 16px hsl(var(--shadow-color) / .06), 0 24px 48px hsl(var(--shadow-color) / .05);--surface-subtle-glass: rgba(255, 255, 255, .75)}html.theme-transition,html.theme-transition *,html.theme-transition *:before,html.theme-transition *:after{transition:background-color .25s ease,border-color .25s ease,color .25s ease}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}button,[role=button]{-webkit-tap-highlight-color:transparent}:focus:not(:focus-visible){outline:none}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}@supports (padding: env(safe-area-inset-top)){.safe-top{padding-top:max(env(safe-area-inset-top),1.25rem)}.safe-bottom{padding-bottom:env(safe-area-inset-bottom)}}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.typing-cursor:after{content:"█";animation:blink 1s step-end infinite;color:var(--green)}@keyframes fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.scene-enter{animation:fade-in .3s cubic-bezier(.4,0,.2,1)}@keyframes pulse-border{0%,to{border-color:#d299224d}50%{border-color:#d2992299}}.pause-overlay{animation:pulse-border 2s ease-in-out infinite}@keyframes jump-target-flash{0%{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}30%{box-shadow:0 0 0 3px #3fb95040;outline-color:#3fb95099}to{box-shadow:0 0 #3fb95000;outline-color:#3fb95000}}.jump-target-flash{outline:1px solid transparent;animation:jump-target-flash .85s ease-out}@keyframes nav-focus-pulse{0%,to{transform:translateY(0)}50%{transform:translateY(-1px)}}.scene-nav-focused{animation:nav-focus-pulse .9s ease-in-out 2}@keyframes landing-glow{0%,to{box-shadow:0 0 #3fb95000}50%{box-shadow:0 0 20px 2px #3fb95026}}.landing-pulse{animation:landing-glow 2.5s ease-in-out infinite}.instant-tooltip{position:relative}.instant-tooltip .instant-tooltip-text{visibility:hidden;opacity:0;position:absolute;left:50%;top:100%;transform:translate(-50%);margin-top:6px;padding:4px 8px;border-radius:6px;background:var(--surface);border:1px solid var(--border-subtle);box-shadow:var(--shadow-md);color:var(--text);font:11px / 1.4 var(--font-sans),monospace;text-transform:none;letter-spacing:normal;white-space:pre-line;pointer-events:none;z-index:50;transition:opacity .08s ease}.instant-tooltip:hover .instant-tooltip-text{visibility:visible;opacity:1}.hover-lift{transition:transform .25s cubic-bezier(.175,.885,.32,1.275),box-shadow .25s cubic-bezier(.175,.885,.32,1.275),background-color .2s ease}.hover-lift:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}.glass-effect{backdrop-filter:blur(12px) saturate(180%);-webkit-backdrop-filter:blur(12px) saturate(180%);background-color:var(--surface-subtle-glass)}.premium-card{position:relative}.premium-card:before{content:"";position:absolute;inset:0;padding:1px;border-radius:inherit;background:linear-gradient(135deg,var(--green-subtle),var(--blue-subtle));-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;opacity:.5}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-hover) 50%,var(--surface-2) 75%);background-size:1000px 100%;animation:shimmer 2s infinite linear;border-radius:4px}.bg-dot-grid{background-image:radial-gradient(circle,var(--text) 1px,transparent 1px);background-size:24px 24px;opacity:.03}.minimap-item{transition:background-color .2s cubic-bezier(.4,0,.2,1),border-color .2s cubic-bezier(.4,0,.2,1)}.prose-terminal{line-height:1.6}.prose-terminal p{margin:.5em 0}.prose-terminal code{background:var(--surface);padding:.15em .4em;border-radius:4px;font-size:.9em}.prose-terminal pre{background:var(--surface);padding:.75em 1em;border-radius:6px;overflow-x:auto;margin:.5em 0}.prose-terminal pre code{background:none;padding:0}.prose-terminal ul,.prose-terminal ol{padding-left:1.5em;margin:.5em 0}.prose-terminal li{margin:.25em 0}.prose-terminal h1,.prose-terminal h2,.prose-terminal h3{margin:.75em 0 .5em;font-weight:600}.prose-terminal blockquote{border-left:3px solid var(--border);padding-left:1em;color:var(--dim);margin:.5em 0}.prose-terminal a{color:var(--blue);text-decoration:underline}.prose-terminal table{border-collapse:collapse;margin:.5em 0}.prose-terminal th,.prose-terminal td{border:1px solid var(--border);padding:.4em .8em}.placeholder\:text-terminal-dimmer::-moz-placeholder{color:var(--dimmer)}.placeholder\:text-terminal-dimmer::placeholder{color:var(--dimmer)}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[rgba\(168\,85\,247\,0\.5\)\]:hover{border-color:#a855f780}.hover\:border-terminal-border:hover{border-color:var(--border)}.hover\:border-terminal-green:hover{border-color:var(--green)}.hover\:bg-\[\#32383f\]:hover{--tw-bg-opacity: 1;background-color:rgb(50 56 63 / var(--tw-bg-opacity, 1))}.hover\:bg-\[rgba\(168\,85\,247\,0\.2\)\]:hover{background-color:#a855f733}.hover\:bg-\[rgba\(168\,85\,247\,0\.25\)\]:hover{background-color:#a855f740}.hover\:bg-terminal-blue-emphasis:hover{background-color:var(--blue-emphasis)}.hover\:bg-terminal-blue-subtle:hover{background-color:var(--blue-subtle)}.hover\:bg-terminal-green-emphasis:hover{background-color:var(--green-emphasis)}.hover\:bg-terminal-orange-emphasis:hover{background-color:var(--orange-emphasis)}.hover\:bg-terminal-orange-subtle:hover{background-color:var(--orange-subtle)}.hover\:bg-terminal-purple-emphasis:hover{background-color:var(--purple-emphasis)}.hover\:bg-terminal-purple-subtle:hover{background-color:var(--purple-subtle)}.hover\:bg-terminal-red-emphasis:hover{background-color:var(--red-emphasis)}.hover\:bg-terminal-red-subtle:hover{background-color:var(--red-subtle)}.hover\:bg-terminal-surface:hover{background-color:var(--surface)}.hover\:bg-terminal-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-terminal-surface-hover:hover{background-color:var(--surface-hover)}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-terminal-blue:hover{color:var(--blue)}.hover\:text-terminal-dim:hover{color:var(--dim)}.hover\:text-terminal-green:hover{color:var(--green)}.hover\:text-terminal-orange:hover{color:var(--orange)}.hover\:text-terminal-red:hover{color:var(--red)}.hover\:text-terminal-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-layer-lg:hover{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-layer-md:hover{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-1:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-0\.5{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/help:hover .group-hover\/help\:border-terminal-text{border-color:var(--text)}.group\/help:hover .group-hover\/help\:bg-terminal-text{background-color:var(--text)}.group\/help:hover .group-hover\/help\:text-terminal-bg{color:var(--bg)}.group\/ref:hover .group-hover\/ref\:text-terminal-text{color:var(--text)}.group\/search:hover .group-hover\/search\:text-terminal-blue{color:var(--blue)}.group:hover .group-hover\:text-terminal-green{color:var(--green)}.group:hover .group-hover\:text-terminal-text{color:var(--text)}.group\/batch:hover .group-hover\/batch\:opacity-100,.group\/help:hover .group-hover\/help\:opacity-100,.group\/pause:hover .group-hover\/pause\:opacity-100,.group\/scene:hover .group-hover\/scene\:opacity-100,.group\/search:hover .group-hover\/search\:opacity-100{opacity:1}.group\/search:hover .group-hover\/search\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-60{opacity:.6}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-terminal-surface-2:is(.dark *){background-color:var(--surface-2)}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@media(min-width:640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:gap-3{gap:.75rem}.sm\:rounded-xl{border-radius:.75rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:pt-\[15vh\]{padding-top:15vh}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media(min-width:768px){.md\:ml-12{margin-left:3rem}.md\:mt-10{margin-top:2.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:min-h-0{min-height:0px}.md\:max-w-\[300px\]{max-width:300px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-5xl{font-size:3rem;line-height:1}}@media(min-width:1024px){.lg\:inline{display:inline}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\>svg\]\:block>svg{display:block}.\[\&\>svg\]\:h-auto>svg{height:auto}.\[\&\>svg\]\:w-full>svg{width:100%}</style>
|
|
165
165
|
</head>
|
|
166
166
|
<body class="bg-terminal-bg text-terminal-text min-h-screen">
|
|
167
167
|
<div id="root"></div>
|