repoburg 1.3.217 → 1.3.219

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.
@@ -0,0 +1,392 @@
1
+ var nm=Object.defineProperty;var rm=(s,l,i)=>l in s?nm(s,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[l]=i;var Ge=(s,l,i)=>rm(s,typeof l!="symbol"?l+"":l,i);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();function Uf(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var La={exports:{}},hl={},Ia={exports:{}},je={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Bd;function sm(){if(Bd)return je;Bd=1;var s=Symbol.for("react.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),S=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,L={};function E(N,D,fe){this.props=N,this.context=D,this.refs=L,this.updater=fe||A}E.prototype.isReactComponent={},E.prototype.setState=function(N,D){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,D,"setState")},E.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function $(){}$.prototype=E.prototype;function H(N,D,fe){this.props=N,this.context=D,this.refs=L,this.updater=fe||A}var J=H.prototype=new $;J.constructor=H,M(J,E.prototype),J.isPureReactComponent=!0;var F=Array.isArray,q=Object.prototype.hasOwnProperty,ae={current:null},se={key:!0,ref:!0,__self:!0,__source:!0};function le(N,D,fe){var ge,Ne={},Ee=null,Re=null;if(D!=null)for(ge in D.ref!==void 0&&(Re=D.ref),D.key!==void 0&&(Ee=""+D.key),D)q.call(D,ge)&&!se.hasOwnProperty(ge)&&(Ne[ge]=D[ge]);var Ie=arguments.length-2;if(Ie===1)Ne.children=fe;else if(1<Ie){for(var Be=Array(Ie),mt=0;mt<Ie;mt++)Be[mt]=arguments[mt+2];Ne.children=Be}if(N&&N.defaultProps)for(ge in Ie=N.defaultProps,Ie)Ne[ge]===void 0&&(Ne[ge]=Ie[ge]);return{$$typeof:s,type:N,key:Ee,ref:Re,props:Ne,_owner:ae.current}}function we(N,D){return{$$typeof:s,type:N.type,key:D,ref:N.ref,props:N.props,_owner:N._owner}}function te(N){return typeof N=="object"&&N!==null&&N.$$typeof===s}function he(N){var D={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(fe){return D[fe]})}var _e=/\/+/g;function Ce(N,D){return typeof N=="object"&&N!==null&&N.key!=null?he(""+N.key):D.toString(36)}function ce(N,D,fe,ge,Ne){var Ee=typeof N;(Ee==="undefined"||Ee==="boolean")&&(N=null);var Re=!1;if(N===null)Re=!0;else switch(Ee){case"string":case"number":Re=!0;break;case"object":switch(N.$$typeof){case s:case l:Re=!0}}if(Re)return Re=N,Ne=Ne(Re),N=ge===""?"."+Ce(Re,0):ge,F(Ne)?(fe="",N!=null&&(fe=N.replace(_e,"$&/")+"/"),ce(Ne,D,fe,"",function(mt){return mt})):Ne!=null&&(te(Ne)&&(Ne=we(Ne,fe+(!Ne.key||Re&&Re.key===Ne.key?"":(""+Ne.key).replace(_e,"$&/")+"/")+N)),D.push(Ne)),1;if(Re=0,ge=ge===""?".":ge+":",F(N))for(var Ie=0;Ie<N.length;Ie++){Ee=N[Ie];var Be=ge+Ce(Ee,Ie);Re+=ce(Ee,D,fe,Be,Ne)}else if(Be=w(N),typeof Be=="function")for(N=Be.call(N),Ie=0;!(Ee=N.next()).done;)Ee=Ee.value,Be=ge+Ce(Ee,Ie++),Re+=ce(Ee,D,fe,Be,Ne);else if(Ee==="object")throw D=String(N),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return Re}function P(N,D,fe){if(N==null)return N;var ge=[],Ne=0;return ce(N,ge,"","",function(Ee){return D.call(fe,Ee,Ne++)}),ge}function Z(N){if(N._status===-1){var D=N._result;D=D(),D.then(function(fe){(N._status===0||N._status===-1)&&(N._status=1,N._result=fe)},function(fe){(N._status===0||N._status===-1)&&(N._status=2,N._result=fe)}),N._status===-1&&(N._status=0,N._result=D)}if(N._status===1)return N._result.default;throw N._result}var ee={current:null},z={transition:null},Y={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:z,ReactCurrentOwner:ae};function V(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:P,forEach:function(N,D,fe){P(N,function(){D.apply(this,arguments)},fe)},count:function(N){var D=0;return P(N,function(){D++}),D},toArray:function(N){return P(N,function(D){return D})||[]},only:function(N){if(!te(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},je.Component=E,je.Fragment=i,je.Profiler=d,je.PureComponent=H,je.StrictMode=u,je.Suspense=y,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,je.act=V,je.cloneElement=function(N,D,fe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var ge=M({},N.props),Ne=N.key,Ee=N.ref,Re=N._owner;if(D!=null){if(D.ref!==void 0&&(Ee=D.ref,Re=ae.current),D.key!==void 0&&(Ne=""+D.key),N.type&&N.type.defaultProps)var Ie=N.type.defaultProps;for(Be in D)q.call(D,Be)&&!se.hasOwnProperty(Be)&&(ge[Be]=D[Be]===void 0&&Ie!==void 0?Ie[Be]:D[Be])}var Be=arguments.length-2;if(Be===1)ge.children=fe;else if(1<Be){Ie=Array(Be);for(var mt=0;mt<Be;mt++)Ie[mt]=arguments[mt+2];ge.children=Ie}return{$$typeof:s,type:N.type,key:Ne,ref:Ee,props:ge,_owner:Re}},je.createContext=function(N){return N={$$typeof:p,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:f,_context:N},N.Consumer=N},je.createElement=le,je.createFactory=function(N){var D=le.bind(null,N);return D.type=N,D},je.createRef=function(){return{current:null}},je.forwardRef=function(N){return{$$typeof:m,render:N}},je.isValidElement=te,je.lazy=function(N){return{$$typeof:k,_payload:{_status:-1,_result:N},_init:Z}},je.memo=function(N,D){return{$$typeof:g,type:N,compare:D===void 0?null:D}},je.startTransition=function(N){var D=z.transition;z.transition={};try{N()}finally{z.transition=D}},je.unstable_act=V,je.useCallback=function(N,D){return ee.current.useCallback(N,D)},je.useContext=function(N){return ee.current.useContext(N)},je.useDebugValue=function(){},je.useDeferredValue=function(N){return ee.current.useDeferredValue(N)},je.useEffect=function(N,D){return ee.current.useEffect(N,D)},je.useId=function(){return ee.current.useId()},je.useImperativeHandle=function(N,D,fe){return ee.current.useImperativeHandle(N,D,fe)},je.useInsertionEffect=function(N,D){return ee.current.useInsertionEffect(N,D)},je.useLayoutEffect=function(N,D){return ee.current.useLayoutEffect(N,D)},je.useMemo=function(N,D){return ee.current.useMemo(N,D)},je.useReducer=function(N,D,fe){return ee.current.useReducer(N,D,fe)},je.useRef=function(N){return ee.current.useRef(N)},je.useState=function(N){return ee.current.useState(N)},je.useSyncExternalStore=function(N,D,fe){return ee.current.useSyncExternalStore(N,D,fe)},je.useTransition=function(){return ee.current.useTransition()},je.version="18.3.1",je}var Hd;function iu(){return Hd||(Hd=1,Ia.exports=sm()),Ia.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Wd;function lm(){if(Wd)return hl;Wd=1;var s=iu(),l=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function p(m,y,g){var k,S={},w=null,A=null;g!==void 0&&(w=""+g),y.key!==void 0&&(w=""+y.key),y.ref!==void 0&&(A=y.ref);for(k in y)u.call(y,k)&&!f.hasOwnProperty(k)&&(S[k]=y[k]);if(m&&m.defaultProps)for(k in y=m.defaultProps,y)S[k]===void 0&&(S[k]=y[k]);return{$$typeof:l,type:m,key:w,ref:A,props:S,_owner:d.current}}return hl.Fragment=i,hl.jsx=p,hl.jsxs=p,hl}var Vd;function im(){return Vd||(Vd=1,La.exports=lm()),La.exports}var a=im(),I=iu();const kl=Uf(I);var Mi={},ba={exports:{}},Ft={},Ma={exports:{}},Da={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Gd;function om(){return Gd||(Gd=1,(function(s){function l(z,Y){var V=z.length;z.push(Y);e:for(;0<V;){var N=V-1>>>1,D=z[N];if(0<d(D,Y))z[N]=Y,z[V]=D,V=N;else break e}}function i(z){return z.length===0?null:z[0]}function u(z){if(z.length===0)return null;var Y=z[0],V=z.pop();if(V!==Y){z[0]=V;e:for(var N=0,D=z.length,fe=D>>>1;N<fe;){var ge=2*(N+1)-1,Ne=z[ge],Ee=ge+1,Re=z[Ee];if(0>d(Ne,V))Ee<D&&0>d(Re,Ne)?(z[N]=Re,z[Ee]=V,N=Ee):(z[N]=Ne,z[ge]=V,N=ge);else if(Ee<D&&0>d(Re,V))z[N]=Re,z[Ee]=V,N=Ee;else break e}}return Y}function d(z,Y){var V=z.sortIndex-Y.sortIndex;return V!==0?V:z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var p=Date,m=p.now();s.unstable_now=function(){return p.now()-m}}var y=[],g=[],k=1,S=null,w=3,A=!1,M=!1,L=!1,E=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function J(z){for(var Y=i(g);Y!==null;){if(Y.callback===null)u(g);else if(Y.startTime<=z)u(g),Y.sortIndex=Y.expirationTime,l(y,Y);else break;Y=i(g)}}function F(z){if(L=!1,J(z),!M)if(i(y)!==null)M=!0,Z(q);else{var Y=i(g);Y!==null&&ee(F,Y.startTime-z)}}function q(z,Y){M=!1,L&&(L=!1,$(le),le=-1),A=!0;var V=w;try{for(J(Y),S=i(y);S!==null&&(!(S.expirationTime>Y)||z&&!he());){var N=S.callback;if(typeof N=="function"){S.callback=null,w=S.priorityLevel;var D=N(S.expirationTime<=Y);Y=s.unstable_now(),typeof D=="function"?S.callback=D:S===i(y)&&u(y),J(Y)}else u(y);S=i(y)}if(S!==null)var fe=!0;else{var ge=i(g);ge!==null&&ee(F,ge.startTime-Y),fe=!1}return fe}finally{S=null,w=V,A=!1}}var ae=!1,se=null,le=-1,we=5,te=-1;function he(){return!(s.unstable_now()-te<we)}function _e(){if(se!==null){var z=s.unstable_now();te=z;var Y=!0;try{Y=se(!0,z)}finally{Y?Ce():(ae=!1,se=null)}}else ae=!1}var Ce;if(typeof H=="function")Ce=function(){H(_e)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,P=ce.port2;ce.port1.onmessage=_e,Ce=function(){P.postMessage(null)}}else Ce=function(){E(_e,0)};function Z(z){se=z,ae||(ae=!0,Ce())}function ee(z,Y){le=E(function(){z(s.unstable_now())},Y)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(z){z.callback=null},s.unstable_continueExecution=function(){M||A||(M=!0,Z(q))},s.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):we=0<z?Math.floor(1e3/z):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_getFirstCallbackNode=function(){return i(y)},s.unstable_next=function(z){switch(w){case 1:case 2:case 3:var Y=3;break;default:Y=w}var V=w;w=Y;try{return z()}finally{w=V}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(z,Y){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=w;w=z;try{return Y()}finally{w=V}},s.unstable_scheduleCallback=function(z,Y,V){var N=s.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?N+V:N):V=N,z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=V+D,z={id:k++,callback:Y,priorityLevel:z,startTime:V,expirationTime:D,sortIndex:-1},V>N?(z.sortIndex=V,l(g,z),i(y)===null&&z===i(g)&&(L?($(le),le=-1):L=!0,ee(F,V-N))):(z.sortIndex=D,l(y,z),M||A||(M=!0,Z(q))),z},s.unstable_shouldYield=he,s.unstable_wrapCallback=function(z){var Y=w;return function(){var V=w;w=Y;try{return z.apply(this,arguments)}finally{w=V}}}})(Da)),Da}var qd;function am(){return qd||(qd=1,Ma.exports=om()),Ma.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Qd;function um(){if(Qd)return Ft;Qd=1;var s=iu(),l=am();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var u=new Set,d={};function f(e,t){p(e,t),p(e+"Capture",t)}function p(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,g=/^[: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]*$/,k={},S={};function w(e){return y.call(S,e)?!0:y.call(k,e)?!1:g.test(e)?S[e]=!0:(k[e]=!0,!1)}function A(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function M(e,t,n,r){if(t===null||typeof t>"u"||A(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function L(e,t,n,r,o,c,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=h}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){E[e]=new L(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];E[t]=new L(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){E[e]=new L(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){E[e]=new L(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){E[e]=new L(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){E[e]=new L(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){E[e]=new L(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){E[e]=new L(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){E[e]=new L(e,5,!1,e.toLowerCase(),null,!1,!1)});var $=/[\-:]([a-z])/g;function H(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace($,H);E[t]=new L(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace($,H);E[t]=new L(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace($,H);E[t]=new L(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){E[e]=new L(e,1,!1,e.toLowerCase(),null,!1,!1)}),E.xlinkHref=new L("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){E[e]=new L(e,1,!1,e.toLowerCase(),null,!0,!0)});function J(e,t,n,r){var o=E.hasOwnProperty(t)?E[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(M(t,n,o,r)&&(n=null),r||o===null?w(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var F=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=Symbol.for("react.element"),ae=Symbol.for("react.portal"),se=Symbol.for("react.fragment"),le=Symbol.for("react.strict_mode"),we=Symbol.for("react.profiler"),te=Symbol.for("react.provider"),he=Symbol.for("react.context"),_e=Symbol.for("react.forward_ref"),Ce=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),z=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var V=Object.assign,N;function D(e){if(N===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return`
34
+ `+N+e}var fe=!1;function ge(e,t){if(!e||fe)return"";fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(b){var r=b}Reflect.construct(e,[],t)}else{try{t.call()}catch(b){r=b}e.call(t.prototype)}else{try{throw Error()}catch(b){r=b}e()}}catch(b){if(b&&r&&typeof b.stack=="string"){for(var o=b.stack.split(`
35
+ `),c=r.stack.split(`
36
+ `),h=o.length-1,x=c.length-1;1<=h&&0<=x&&o[h]!==c[x];)x--;for(;1<=h&&0<=x;h--,x--)if(o[h]!==c[x]){if(h!==1||x!==1)do if(h--,x--,0>x||o[h]!==c[x]){var T=`
37
+ `+o[h].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),T}while(1<=h&&0<=x);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function Ne(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=ge(e.type,!1),e;case 11:return e=ge(e.type.render,!1),e;case 1:return e=ge(e.type,!0),e;default:return""}}function Ee(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case se:return"Fragment";case ae:return"Portal";case we:return"Profiler";case le:return"StrictMode";case Ce:return"Suspense";case ce:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case he:return(e.displayName||"Context")+".Consumer";case te:return(e._context.displayName||"Context")+".Provider";case _e:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}function Re(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ee(t);case 8:return t===le?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ie(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mt(e){var t=Be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){r=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(h){r=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dn(e){e._valueTracker||(e._valueTracker=mt(e))}function Fe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Be(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fn(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}}function Pe(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hn(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ie(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function We(e,t){t=t.checked,t!=null&&J(e,"checked",t,!1)}function Ut(e,t){We(e,t);var n=Ie(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Lt(e,t.type,n):t.hasOwnProperty("defaultValue")&&Lt(e,t.type,Ie(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mr(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Lt(e,t,n){(t!=="number"||fn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pn=Array.isArray;function O(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ie(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function me(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function He(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(i(92));if(pn(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ie(n)}}function Ve(e,t){var n=Ie(t.value),r=Ie(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function ot(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function kt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function It(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?kt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nn,gr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(nn=nn||document.createElement("div"),nn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _n(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Kr=["Webkit","ms","Moz","O"];Object.keys(Qt).forEach(function(e){Kr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qt[t]=Qt[e]})});function vr(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qt.hasOwnProperty(e)&&Qt[e]?(""+t).trim():t+"px"}function As(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=vr(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var El=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yr(e,t){if(t){if(El[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function yr(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Wn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bt=null,mn=null,Nn=null;function Ls(e){if(e=Js(e)){if(typeof bt!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Kl(t),bt(e.stateNode,e.type,t))}}function Xr(e){mn?Nn?Nn.push(e):Nn=[e]:mn=e}function Is(){if(mn){var e=mn,t=Nn;if(Nn=mn=null,Ls(e),t)for(e=0;e<t.length;e++)Ls(t[e])}}function xr(e,t){return e(t)}function kr(){}var Mt=!1;function En(e,t,n){if(Mt)return e(t,n);Mt=!0;try{return xr(e,t,n)}finally{Mt=!1,(mn!==null||Nn!==null)&&(kr(),Is())}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=Kl(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var wr=!1;if(m)try{var Sr={};Object.defineProperty(Sr,"passive",{get:function(){wr=!0}}),window.addEventListener("test",Sr,Sr),window.removeEventListener("test",Sr,Sr)}catch{wr=!1}function Cl(e,t,n,r,o,c,h,x,T){var b=Array.prototype.slice.call(arguments,3);try{t.apply(n,b)}catch(W){this.onError(W)}}var jn=!1,Tr=null,Vn=!1,bs=null,_r={onError:function(e){jn=!0,Tr=e}};function Zi(e,t,n,r,o,c,h,x,T){jn=!1,Tr=null,Cl.apply(_r,arguments)}function Ji(e,t,n,r,o,c,h,x,T){if(Zi.apply(this,arguments),jn){if(jn){var b=Tr;jn=!1,Tr=null}else throw Error(i(198));Vn||(Vn=!0,bs=b)}}function $e(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Rn(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 jl(e){if($e(e)!==e)throw Error(i(188))}function Rl(e){var t=e.alternate;if(!t){if(t=$e(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return jl(o),e;if(c===r)return jl(o),t;c=c.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=c;else{for(var h=!1,x=o.child;x;){if(x===n){h=!0,n=o,r=c;break}if(x===r){h=!0,r=o,n=c;break}x=x.sibling}if(!h){for(x=c.child;x;){if(x===n){h=!0,n=c,r=o;break}if(x===r){h=!0,r=c,n=o;break}x=x.sibling}if(!h)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function Zr(e){return e=Rl(e),e!==null?Ms(e):null}function Ms(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ms(e);if(t!==null)return t;e=e.sibling}return null}var Ds=l.unstable_scheduleCallback,Al=l.unstable_cancelCallback,eo=l.unstable_shouldYield,to=l.unstable_requestPaint,Xe=l.unstable_now,gn=l.unstable_getCurrentPriorityLevel,Gn=l.unstable_ImmediatePriority,vn=l.unstable_UserBlockingPriority,Jr=l.unstable_NormalPriority,Nr=l.unstable_LowPriority,Ll=l.unstable_IdlePriority,Er=null,Bt=null;function es(e){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Er,e,void 0,(e.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:Cr,ts=Math.log,qn=Math.LN2;function Cr(e){return e>>>=0,e===0?32:31-(ts(e)/qn|0)|0}var Ct=64,ns=4194304;function jr(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,c=e.pingedLanes,h=n&268435455;if(h!==0){var x=h&~o;x!==0?r=jr(x):(c&=h,c!==0&&(r=jr(c)))}else h=n&~o,h!==0?r=jr(h):c!==0&&(r=jr(c));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,c=t&-t,o>=c||o===16&&(c&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Et(t),o=1<<n,r|=e[n],t&=~o;return r}function Il(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bl(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes;0<c;){var h=31-Et(c),x=1<<h,T=o[h];T===-1?((x&n)===0||(x&r)!==0)&&(o[h]=Il(x,t)):T<=t&&(e.expiredLanes|=x),c&=~x}}function Ps(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zs(){var e=Ct;return Ct<<=1,(Ct&4194240)===0&&(Ct=64),e}function Os(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ar(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Et(t),e[t]=n}function Ml(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Et(n),c=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~c}}function Qn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Et(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var be=0;function Q(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var v,C,U,oe,pe,Te=!1,Me=[],ze=null,Ze=null,Je=null,An=new Map,rt=new Map,Kn=[],_p="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 submit".split(" ");function Nu(e,t){switch(e){case"focusin":case"focusout":ze=null;break;case"dragenter":case"dragleave":Ze=null;break;case"mouseover":case"mouseout":Je=null;break;case"pointerover":case"pointerout":An.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rt.delete(t.pointerId)}}function $s(e,t,n,r,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Js(t),t!==null&&C(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Np(e,t,n,r,o){switch(t){case"focusin":return ze=$s(ze,e,t,n,r,o),!0;case"dragenter":return Ze=$s(Ze,e,t,n,r,o),!0;case"mouseover":return Je=$s(Je,e,t,n,r,o),!0;case"pointerover":var c=o.pointerId;return An.set(c,$s(An.get(c)||null,e,t,n,r,o)),!0;case"gotpointercapture":return c=o.pointerId,rt.set(c,$s(rt.get(c)||null,e,t,n,r,o)),!0}return!1}function Eu(e){var t=Lr(e.target);if(t!==null){var n=$e(t);if(n!==null){if(t=n.tag,t===13){if(t=Rn(n),t!==null){e.blockedOn=t,pe(e.priority,function(){U(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ro(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Wn=r,n.target.dispatchEvent(r),Wn=null}else return t=Js(n),t!==null&&C(t),e.blockedOn=n,!1;t.shift()}return!0}function Cu(e,t,n){Dl(e)&&n.delete(t)}function Ep(){Te=!1,ze!==null&&Dl(ze)&&(ze=null),Ze!==null&&Dl(Ze)&&(Ze=null),Je!==null&&Dl(Je)&&(Je=null),An.forEach(Cu),rt.forEach(Cu)}function Fs(e,t){e.blockedOn===t&&(e.blockedOn=null,Te||(Te=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Ep)))}function Us(e){function t(o){return Fs(o,e)}if(0<Me.length){Fs(Me[0],e);for(var n=1;n<Me.length;n++){var r=Me[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ze!==null&&Fs(ze,e),Ze!==null&&Fs(Ze,e),Je!==null&&Fs(Je,e),An.forEach(t),rt.forEach(t),n=0;n<Kn.length;n++)r=Kn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Kn.length&&(n=Kn[0],n.blockedOn===null);)Eu(n),n.blockedOn===null&&Kn.shift()}var rs=F.ReactCurrentBatchConfig,Pl=!0;function Cp(e,t,n,r){var o=be,c=rs.transition;rs.transition=null;try{be=1,no(e,t,n,r)}finally{be=o,rs.transition=c}}function jp(e,t,n,r){var o=be,c=rs.transition;rs.transition=null;try{be=4,no(e,t,n,r)}finally{be=o,rs.transition=c}}function no(e,t,n,r){if(Pl){var o=ro(e,t,n,r);if(o===null)wo(e,t,r,zl,n),Nu(e,r);else if(Np(o,e,t,n,r))r.stopPropagation();else if(Nu(e,r),t&4&&-1<_p.indexOf(e)){for(;o!==null;){var c=Js(o);if(c!==null&&v(c),c=ro(e,t,n,r),c===null&&wo(e,t,r,zl,n),c===o)break;o=c}o!==null&&r.stopPropagation()}else wo(e,t,r,null,n)}}var zl=null;function ro(e,t,n,r){if(zl=null,e=hn(r),e=Lr(e),e!==null)if(t=$e(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Rn(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return zl=e,null}function ju(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(gn()){case Gn:return 1;case vn:return 4;case Jr:case Nr:return 16;case Ll:return 536870912;default:return 16}default:return 16}}var Yn=null,so=null,Ol=null;function Ru(){if(Ol)return Ol;var e,t=so,n=t.length,r,o="value"in Yn?Yn.value:Yn.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var h=n-e;for(r=1;r<=h&&t[n-r]===o[c-r];r++);return Ol=o.slice(e,1<r?1-r:void 0)}function $l(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 Fl(){return!0}function Au(){return!1}function Ht(e){function t(n,r,o,c,h){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(c):c[x]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Fl:Au,this.isPropagationStopped=Au,this}return V(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Fl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),t}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lo=Ht(ss),Bs=V({},ss,{view:0,detail:0}),Rp=Ht(Bs),io,oo,Hs,Ul=V({},Bs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uo,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!==Hs&&(Hs&&e.type==="mousemove"?(io=e.screenX-Hs.screenX,oo=e.screenY-Hs.screenY):oo=io=0,Hs=e),io)},movementY:function(e){return"movementY"in e?e.movementY:oo}}),Lu=Ht(Ul),Ap=V({},Ul,{dataTransfer:0}),Lp=Ht(Ap),Ip=V({},Bs,{relatedTarget:0}),ao=Ht(Ip),bp=V({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),Mp=Ht(bp),Dp=V({},ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pp=Ht(Dp),zp=V({},ss,{data:0}),Iu=Ht(zp),Op={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$p={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"},Fp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Up(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fp[e])?!!t[e]:!1}function uo(){return Up}var Bp=V({},Bs,{key:function(e){if(e.key){var t=Op[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$p[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uo,charCode:function(e){return e.type==="keypress"?$l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hp=Ht(Bp),Wp=V({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bu=Ht(Wp),Vp=V({},Bs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uo}),Gp=Ht(Vp),qp=V({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qp=Ht(qp),Kp=V({},Ul,{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}),Yp=Ht(Kp),Xp=[9,13,27,32],co=m&&"CompositionEvent"in window,Ws=null;m&&"documentMode"in document&&(Ws=document.documentMode);var Zp=m&&"TextEvent"in window&&!Ws,Mu=m&&(!co||Ws&&8<Ws&&11>=Ws),Du=" ",Pu=!1;function zu(e,t){switch(e){case"keyup":return Xp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ls=!1;function Jp(e,t){switch(e){case"compositionend":return Ou(t);case"keypress":return t.which!==32?null:(Pu=!0,Du);case"textInput":return e=t.data,e===Du&&Pu?null:e;default:return null}}function eh(e,t){if(ls)return e==="compositionend"||!co&&zu(e,t)?(e=Ru(),Ol=so=Yn=null,ls=!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 Mu&&t.locale!=="ko"?null:t.data;default:return null}}var th={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 $u(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!th[e.type]:t==="textarea"}function Fu(e,t,n,r){Xr(r),t=Gl(t,"onChange"),0<t.length&&(n=new lo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vs=null,Gs=null;function nh(e){sc(e,0)}function Bl(e){var t=cs(e);if(Fe(t))return e}function rh(e,t){if(e==="change")return t}var Uu=!1;if(m){var fo;if(m){var po="oninput"in document;if(!po){var Bu=document.createElement("div");Bu.setAttribute("oninput","return;"),po=typeof Bu.oninput=="function"}fo=po}else fo=!1;Uu=fo&&(!document.documentMode||9<document.documentMode)}function Hu(){Vs&&(Vs.detachEvent("onpropertychange",Wu),Gs=Vs=null)}function Wu(e){if(e.propertyName==="value"&&Bl(Gs)){var t=[];Fu(t,Gs,e,hn(e)),En(nh,t)}}function sh(e,t,n){e==="focusin"?(Hu(),Vs=t,Gs=n,Vs.attachEvent("onpropertychange",Wu)):e==="focusout"&&Hu()}function lh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(Gs)}function ih(e,t){if(e==="click")return Bl(t)}function oh(e,t){if(e==="input"||e==="change")return Bl(t)}function ah(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rn=typeof Object.is=="function"?Object.is:ah;function qs(e,t){if(rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!y.call(t,o)||!rn(e[o],t[o]))return!1}return!0}function Vu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gu(e,t){var n=Vu(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vu(n)}}function qu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qu(){for(var e=window,t=fn();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fn(e.document)}return t}function ho(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")}function uh(e){var t=Qu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qu(n.ownerDocument.documentElement,n)){if(r!==null&&ho(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,c=Math.min(r.start,o);r=r.end===void 0?c:Math.min(r.end,o),!e.extend&&c>r&&(o=r,r=c,c=o),o=Gu(n,c);var h=Gu(n,r);o&&h&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),c>r?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ch=m&&"documentMode"in document&&11>=document.documentMode,is=null,mo=null,Qs=null,go=!1;function Ku(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;go||is==null||is!==fn(r)||(r=is,"selectionStart"in r&&ho(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Qs&&qs(Qs,r)||(Qs=r,r=Gl(mo,"onSelect"),0<r.length&&(t=new lo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=is)))}function Hl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var os={animationend:Hl("Animation","AnimationEnd"),animationiteration:Hl("Animation","AnimationIteration"),animationstart:Hl("Animation","AnimationStart"),transitionend:Hl("Transition","TransitionEnd")},vo={},Yu={};m&&(Yu=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Wl(e){if(vo[e])return vo[e];if(!os[e])return e;var t=os[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yu)return vo[e]=t[n];return e}var Xu=Wl("animationend"),Zu=Wl("animationiteration"),Ju=Wl("animationstart"),ec=Wl("transitionend"),tc=new Map,nc="abort auxClick 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(" ");function Xn(e,t){tc.set(e,t),f(t,[e])}for(var yo=0;yo<nc.length;yo++){var xo=nc[yo],dh=xo.toLowerCase(),fh=xo[0].toUpperCase()+xo.slice(1);Xn(dh,"on"+fh)}Xn(Xu,"onAnimationEnd"),Xn(Zu,"onAnimationIteration"),Xn(Ju,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(ec,"onTransitionEnd"),p("onMouseEnter",["mouseout","mouseover"]),p("onMouseLeave",["mouseout","mouseover"]),p("onPointerEnter",["pointerout","pointerover"]),p("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="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(" "),ph=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ks));function rc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Ji(r,t,void 0,e),e.currentTarget=null}function sc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var c=void 0;if(t)for(var h=r.length-1;0<=h;h--){var x=r[h],T=x.instance,b=x.currentTarget;if(x=x.listener,T!==c&&o.isPropagationStopped())break e;rc(o,x,b),c=T}else for(h=0;h<r.length;h++){if(x=r[h],T=x.instance,b=x.currentTarget,x=x.listener,T!==c&&o.isPropagationStopped())break e;rc(o,x,b),c=T}}}if(Vn)throw e=bs,Vn=!1,bs=null,e}function Qe(e,t){var n=t[Co];n===void 0&&(n=t[Co]=new Set);var r=e+"__bubble";n.has(r)||(lc(t,e,2,!1),n.add(r))}function ko(e,t,n){var r=0;t&&(r|=4),lc(n,e,r,t)}var Vl="_reactListening"+Math.random().toString(36).slice(2);function Ys(e){if(!e[Vl]){e[Vl]=!0,u.forEach(function(n){n!=="selectionchange"&&(ph.has(n)||ko(n,!1,e),ko(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vl]||(t[Vl]=!0,ko("selectionchange",!1,t))}}function lc(e,t,n,r){switch(ju(t)){case 1:var o=Cp;break;case 4:o=jp;break;default:o=no}n=o.bind(null,t,n,e),o=void 0,!wr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function wo(e,t,n,r,o){var c=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var h=r.tag;if(h===3||h===4){var x=r.stateNode.containerInfo;if(x===o||x.nodeType===8&&x.parentNode===o)break;if(h===4)for(h=r.return;h!==null;){var T=h.tag;if((T===3||T===4)&&(T=h.stateNode.containerInfo,T===o||T.nodeType===8&&T.parentNode===o))return;h=h.return}for(;x!==null;){if(h=Lr(x),h===null)return;if(T=h.tag,T===5||T===6){r=c=h;continue e}x=x.parentNode}}r=r.return}En(function(){var b=c,W=hn(n),G=[];e:{var B=tc.get(e);if(B!==void 0){var ne=lo,ie=e;switch(e){case"keypress":if($l(n)===0)break e;case"keydown":case"keyup":ne=Hp;break;case"focusin":ie="focus",ne=ao;break;case"focusout":ie="blur",ne=ao;break;case"beforeblur":case"afterblur":ne=ao;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Lu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Lp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Gp;break;case Xu:case Zu:case Ju:ne=Mp;break;case ec:ne=Qp;break;case"scroll":ne=Rp;break;case"wheel":ne=Yp;break;case"copy":case"cut":case"paste":ne=Pp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=bu}var ue=(t&4)!==0,st=!ue&&e==="scroll",j=ue?B!==null?B+"Capture":null:B;ue=[];for(var _=b,R;_!==null;){R=_;var K=R.stateNode;if(R.tag===5&&K!==null&&(R=K,j!==null&&(K=Cn(_,j),K!=null&&ue.push(Xs(_,K,R)))),st)break;_=_.return}0<ue.length&&(B=new ne(B,ie,null,n,W),G.push({event:B,listeners:ue}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",B&&n!==Wn&&(ie=n.relatedTarget||n.fromElement)&&(Lr(ie)||ie[Ln]))break e;if((ne||B)&&(B=W.window===W?W:(B=W.ownerDocument)?B.defaultView||B.parentWindow:window,ne?(ie=n.relatedTarget||n.toElement,ne=b,ie=ie?Lr(ie):null,ie!==null&&(st=$e(ie),ie!==st||ie.tag!==5&&ie.tag!==6)&&(ie=null)):(ne=null,ie=b),ne!==ie)){if(ue=Lu,K="onMouseLeave",j="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(ue=bu,K="onPointerLeave",j="onPointerEnter",_="pointer"),st=ne==null?B:cs(ne),R=ie==null?B:cs(ie),B=new ue(K,_+"leave",ne,n,W),B.target=st,B.relatedTarget=R,K=null,Lr(W)===b&&(ue=new ue(j,_+"enter",ie,n,W),ue.target=R,ue.relatedTarget=st,K=ue),st=K,ne&&ie)t:{for(ue=ne,j=ie,_=0,R=ue;R;R=as(R))_++;for(R=0,K=j;K;K=as(K))R++;for(;0<_-R;)ue=as(ue),_--;for(;0<R-_;)j=as(j),R--;for(;_--;){if(ue===j||j!==null&&ue===j.alternate)break t;ue=as(ue),j=as(j)}ue=null}else ue=null;ne!==null&&ic(G,B,ne,ue,!1),ie!==null&&st!==null&&ic(G,st,ie,ue,!0)}}e:{if(B=b?cs(b):window,ne=B.nodeName&&B.nodeName.toLowerCase(),ne==="select"||ne==="input"&&B.type==="file")var de=rh;else if($u(B))if(Uu)de=oh;else{de=lh;var ve=sh}else(ne=B.nodeName)&&ne.toLowerCase()==="input"&&(B.type==="checkbox"||B.type==="radio")&&(de=ih);if(de&&(de=de(e,b))){Fu(G,de,n,W);break e}ve&&ve(e,B,b),e==="focusout"&&(ve=B._wrapperState)&&ve.controlled&&B.type==="number"&&Lt(B,"number",B.value)}switch(ve=b?cs(b):window,e){case"focusin":($u(ve)||ve.contentEditable==="true")&&(is=ve,mo=b,Qs=null);break;case"focusout":Qs=mo=is=null;break;case"mousedown":go=!0;break;case"contextmenu":case"mouseup":case"dragend":go=!1,Ku(G,n,W);break;case"selectionchange":if(ch)break;case"keydown":case"keyup":Ku(G,n,W)}var ye;if(co)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else ls?zu(e,n)&&(Se="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Se="onCompositionStart");Se&&(Mu&&n.locale!=="ko"&&(ls||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&ls&&(ye=Ru()):(Yn=W,so="value"in Yn?Yn.value:Yn.textContent,ls=!0)),ve=Gl(b,Se),0<ve.length&&(Se=new Iu(Se,e,null,n,W),G.push({event:Se,listeners:ve}),ye?Se.data=ye:(ye=Ou(n),ye!==null&&(Se.data=ye)))),(ye=Zp?Jp(e,n):eh(e,n))&&(b=Gl(b,"onBeforeInput"),0<b.length&&(W=new Iu("onBeforeInput","beforeinput",null,n,W),G.push({event:W,listeners:b}),W.data=ye))}sc(G,t)})}function Xs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,c=o.stateNode;o.tag===5&&c!==null&&(o=c,c=Cn(e,n),c!=null&&r.unshift(Xs(e,c,o)),c=Cn(e,t),c!=null&&r.push(Xs(e,c,o))),e=e.return}return r}function as(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ic(e,t,n,r,o){for(var c=t._reactName,h=[];n!==null&&n!==r;){var x=n,T=x.alternate,b=x.stateNode;if(T!==null&&T===r)break;x.tag===5&&b!==null&&(x=b,o?(T=Cn(n,c),T!=null&&h.unshift(Xs(n,T,x))):o||(T=Cn(n,c),T!=null&&h.push(Xs(n,T,x)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var hh=/\r\n?/g,mh=/\u0000|\uFFFD/g;function oc(e){return(typeof e=="string"?e:""+e).replace(hh,`
38
+ `).replace(mh,"")}function ql(e,t,n){if(t=oc(t),oc(e)!==t&&n)throw Error(i(425))}function Ql(){}var So=null,To=null;function _o(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var No=typeof setTimeout=="function"?setTimeout:void 0,gh=typeof clearTimeout=="function"?clearTimeout:void 0,ac=typeof Promise=="function"?Promise:void 0,vh=typeof queueMicrotask=="function"?queueMicrotask:typeof ac<"u"?function(e){return ac.resolve(null).then(e).catch(yh)}:No;function yh(e){setTimeout(function(){throw e})}function Eo(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Us(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Us(t)}function Zn(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==="$?")break;if(t==="/$")return null}}return e}function uc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var us=Math.random().toString(36).slice(2),yn="__reactFiber$"+us,Zs="__reactProps$"+us,Ln="__reactContainer$"+us,Co="__reactEvents$"+us,xh="__reactListeners$"+us,kh="__reactHandles$"+us;function Lr(e){var t=e[yn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[yn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uc(e);e!==null;){if(n=e[yn])return n;e=uc(e)}return t}e=n,n=e.parentNode}return null}function Js(e){return e=e[yn]||e[Ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Kl(e){return e[Zs]||null}var jo=[],ds=-1;function Jn(e){return{current:e}}function Ke(e){0>ds||(e.current=jo[ds],jo[ds]=null,ds--)}function qe(e,t){ds++,jo[ds]=e.current,e.current=t}var er={},wt=Jn(er),Dt=Jn(!1),Ir=er;function fs(e,t){var n=e.type.contextTypes;if(!n)return er;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},c;for(c in n)o[c]=t[c];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Pt(e){return e=e.childContextTypes,e!=null}function Yl(){Ke(Dt),Ke(wt)}function cc(e,t,n){if(wt.current!==er)throw Error(i(168));qe(wt,t),qe(Dt,n)}function dc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(i(108,Re(e)||"Unknown",o));return V({},n,r)}function Xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||er,Ir=wt.current,qe(wt,e),qe(Dt,Dt.current),!0}function fc(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=dc(e,t,Ir),r.__reactInternalMemoizedMergedChildContext=e,Ke(Dt),Ke(wt),qe(wt,e)):Ke(Dt),qe(Dt,n)}var In=null,Zl=!1,Ro=!1;function pc(e){In===null?In=[e]:In.push(e)}function wh(e){Zl=!0,pc(e)}function tr(){if(!Ro&&In!==null){Ro=!0;var e=0,t=be;try{var n=In;for(be=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}In=null,Zl=!1}catch(o){throw In!==null&&(In=In.slice(e+1)),Ds(Gn,tr),o}finally{be=t,Ro=!1}}return null}var ps=[],hs=0,Jl=null,ei=0,Kt=[],Yt=0,br=null,bn=1,Mn="";function Mr(e,t){ps[hs++]=ei,ps[hs++]=Jl,Jl=e,ei=t}function hc(e,t,n){Kt[Yt++]=bn,Kt[Yt++]=Mn,Kt[Yt++]=br,br=e;var r=bn;e=Mn;var o=32-Et(r)-1;r&=~(1<<o),n+=1;var c=32-Et(t)+o;if(30<c){var h=o-o%5;c=(r&(1<<h)-1).toString(32),r>>=h,o-=h,bn=1<<32-Et(t)+o|n<<o|r,Mn=c+e}else bn=1<<c|n<<o|r,Mn=e}function Ao(e){e.return!==null&&(Mr(e,1),hc(e,1,0))}function Lo(e){for(;e===Jl;)Jl=ps[--hs],ps[hs]=null,ei=ps[--hs],ps[hs]=null;for(;e===br;)br=Kt[--Yt],Kt[Yt]=null,Mn=Kt[--Yt],Kt[Yt]=null,bn=Kt[--Yt],Kt[Yt]=null}var Wt=null,Vt=null,Ye=!1,sn=null;function mc(e,t){var n=en(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function gc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Wt=e,Vt=Zn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wt=e,Vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=br!==null?{id:bn,overflow:Mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=en(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Wt=e,Vt=null,!0):!1;default:return!1}}function Io(e){return(e.mode&1)!==0&&(e.flags&128)===0}function bo(e){if(Ye){var t=Vt;if(t){var n=t;if(!gc(e,t)){if(Io(e))throw Error(i(418));t=Zn(n.nextSibling);var r=Wt;t&&gc(e,t)?mc(r,n):(e.flags=e.flags&-4097|2,Ye=!1,Wt=e)}}else{if(Io(e))throw Error(i(418));e.flags=e.flags&-4097|2,Ye=!1,Wt=e}}}function vc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function ti(e){if(e!==Wt)return!1;if(!Ye)return vc(e),Ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_o(e.type,e.memoizedProps)),t&&(t=Vt)){if(Io(e))throw yc(),Error(i(418));for(;t;)mc(e,t),t=Zn(t.nextSibling)}if(vc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vt=Zn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vt=null}}else Vt=Wt?Zn(e.stateNode.nextSibling):null;return!0}function yc(){for(var e=Vt;e;)e=Zn(e.nextSibling)}function ms(){Vt=Wt=null,Ye=!1}function Mo(e){sn===null?sn=[e]:sn.push(e)}var Sh=F.ReactCurrentBatchConfig;function el(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var o=r,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(h){var x=o.refs;h===null?delete x[c]:x[c]=h},t._stringRef=c,t)}if(typeof e!="string")throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function ni(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xc(e){var t=e._init;return t(e._payload)}function kc(e){function t(j,_){if(e){var R=j.deletions;R===null?(j.deletions=[_],j.flags|=16):R.push(_)}}function n(j,_){if(!e)return null;for(;_!==null;)t(j,_),_=_.sibling;return null}function r(j,_){for(j=new Map;_!==null;)_.key!==null?j.set(_.key,_):j.set(_.index,_),_=_.sibling;return j}function o(j,_){return j=ur(j,_),j.index=0,j.sibling=null,j}function c(j,_,R){return j.index=R,e?(R=j.alternate,R!==null?(R=R.index,R<_?(j.flags|=2,_):R):(j.flags|=2,_)):(j.flags|=1048576,_)}function h(j){return e&&j.alternate===null&&(j.flags|=2),j}function x(j,_,R,K){return _===null||_.tag!==6?(_=Na(R,j.mode,K),_.return=j,_):(_=o(_,R),_.return=j,_)}function T(j,_,R,K){var de=R.type;return de===se?W(j,_,R.props.children,K,R.key):_!==null&&(_.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===Z&&xc(de)===_.type)?(K=o(_,R.props),K.ref=el(j,_,R),K.return=j,K):(K=Ei(R.type,R.key,R.props,null,j.mode,K),K.ref=el(j,_,R),K.return=j,K)}function b(j,_,R,K){return _===null||_.tag!==4||_.stateNode.containerInfo!==R.containerInfo||_.stateNode.implementation!==R.implementation?(_=Ea(R,j.mode,K),_.return=j,_):(_=o(_,R.children||[]),_.return=j,_)}function W(j,_,R,K,de){return _===null||_.tag!==7?(_=Br(R,j.mode,K,de),_.return=j,_):(_=o(_,R),_.return=j,_)}function G(j,_,R){if(typeof _=="string"&&_!==""||typeof _=="number")return _=Na(""+_,j.mode,R),_.return=j,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case q:return R=Ei(_.type,_.key,_.props,null,j.mode,R),R.ref=el(j,null,_),R.return=j,R;case ae:return _=Ea(_,j.mode,R),_.return=j,_;case Z:var K=_._init;return G(j,K(_._payload),R)}if(pn(_)||Y(_))return _=Br(_,j.mode,R,null),_.return=j,_;ni(j,_)}return null}function B(j,_,R,K){var de=_!==null?_.key:null;if(typeof R=="string"&&R!==""||typeof R=="number")return de!==null?null:x(j,_,""+R,K);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case q:return R.key===de?T(j,_,R,K):null;case ae:return R.key===de?b(j,_,R,K):null;case Z:return de=R._init,B(j,_,de(R._payload),K)}if(pn(R)||Y(R))return de!==null?null:W(j,_,R,K,null);ni(j,R)}return null}function ne(j,_,R,K,de){if(typeof K=="string"&&K!==""||typeof K=="number")return j=j.get(R)||null,x(_,j,""+K,de);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case q:return j=j.get(K.key===null?R:K.key)||null,T(_,j,K,de);case ae:return j=j.get(K.key===null?R:K.key)||null,b(_,j,K,de);case Z:var ve=K._init;return ne(j,_,R,ve(K._payload),de)}if(pn(K)||Y(K))return j=j.get(R)||null,W(_,j,K,de,null);ni(_,K)}return null}function ie(j,_,R,K){for(var de=null,ve=null,ye=_,Se=_=0,ft=null;ye!==null&&Se<R.length;Se++){ye.index>Se?(ft=ye,ye=null):ft=ye.sibling;var Oe=B(j,ye,R[Se],K);if(Oe===null){ye===null&&(ye=ft);break}e&&ye&&Oe.alternate===null&&t(j,ye),_=c(Oe,_,Se),ve===null?de=Oe:ve.sibling=Oe,ve=Oe,ye=ft}if(Se===R.length)return n(j,ye),Ye&&Mr(j,Se),de;if(ye===null){for(;Se<R.length;Se++)ye=G(j,R[Se],K),ye!==null&&(_=c(ye,_,Se),ve===null?de=ye:ve.sibling=ye,ve=ye);return Ye&&Mr(j,Se),de}for(ye=r(j,ye);Se<R.length;Se++)ft=ne(ye,j,Se,R[Se],K),ft!==null&&(e&&ft.alternate!==null&&ye.delete(ft.key===null?Se:ft.key),_=c(ft,_,Se),ve===null?de=ft:ve.sibling=ft,ve=ft);return e&&ye.forEach(function(cr){return t(j,cr)}),Ye&&Mr(j,Se),de}function ue(j,_,R,K){var de=Y(R);if(typeof de!="function")throw Error(i(150));if(R=de.call(R),R==null)throw Error(i(151));for(var ve=de=null,ye=_,Se=_=0,ft=null,Oe=R.next();ye!==null&&!Oe.done;Se++,Oe=R.next()){ye.index>Se?(ft=ye,ye=null):ft=ye.sibling;var cr=B(j,ye,Oe.value,K);if(cr===null){ye===null&&(ye=ft);break}e&&ye&&cr.alternate===null&&t(j,ye),_=c(cr,_,Se),ve===null?de=cr:ve.sibling=cr,ve=cr,ye=ft}if(Oe.done)return n(j,ye),Ye&&Mr(j,Se),de;if(ye===null){for(;!Oe.done;Se++,Oe=R.next())Oe=G(j,Oe.value,K),Oe!==null&&(_=c(Oe,_,Se),ve===null?de=Oe:ve.sibling=Oe,ve=Oe);return Ye&&Mr(j,Se),de}for(ye=r(j,ye);!Oe.done;Se++,Oe=R.next())Oe=ne(ye,j,Se,Oe.value,K),Oe!==null&&(e&&Oe.alternate!==null&&ye.delete(Oe.key===null?Se:Oe.key),_=c(Oe,_,Se),ve===null?de=Oe:ve.sibling=Oe,ve=Oe);return e&&ye.forEach(function(tm){return t(j,tm)}),Ye&&Mr(j,Se),de}function st(j,_,R,K){if(typeof R=="object"&&R!==null&&R.type===se&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case q:e:{for(var de=R.key,ve=_;ve!==null;){if(ve.key===de){if(de=R.type,de===se){if(ve.tag===7){n(j,ve.sibling),_=o(ve,R.props.children),_.return=j,j=_;break e}}else if(ve.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===Z&&xc(de)===ve.type){n(j,ve.sibling),_=o(ve,R.props),_.ref=el(j,ve,R),_.return=j,j=_;break e}n(j,ve);break}else t(j,ve);ve=ve.sibling}R.type===se?(_=Br(R.props.children,j.mode,K,R.key),_.return=j,j=_):(K=Ei(R.type,R.key,R.props,null,j.mode,K),K.ref=el(j,_,R),K.return=j,j=K)}return h(j);case ae:e:{for(ve=R.key;_!==null;){if(_.key===ve)if(_.tag===4&&_.stateNode.containerInfo===R.containerInfo&&_.stateNode.implementation===R.implementation){n(j,_.sibling),_=o(_,R.children||[]),_.return=j,j=_;break e}else{n(j,_);break}else t(j,_);_=_.sibling}_=Ea(R,j.mode,K),_.return=j,j=_}return h(j);case Z:return ve=R._init,st(j,_,ve(R._payload),K)}if(pn(R))return ie(j,_,R,K);if(Y(R))return ue(j,_,R,K);ni(j,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,_!==null&&_.tag===6?(n(j,_.sibling),_=o(_,R),_.return=j,j=_):(n(j,_),_=Na(R,j.mode,K),_.return=j,j=_),h(j)):n(j,_)}return st}var gs=kc(!0),wc=kc(!1),ri=Jn(null),si=null,vs=null,Do=null;function Po(){Do=vs=si=null}function zo(e){var t=ri.current;Ke(ri),e._currentValue=t}function Oo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ys(e,t){si=e,Do=vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(zt=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(Do!==e)if(e={context:e,memoizedValue:t,next:null},vs===null){if(si===null)throw Error(i(308));vs=e,si.dependencies={lanes:0,firstContext:e}}else vs=vs.next=e;return t}var Dr=null;function $o(e){Dr===null?Dr=[e]:Dr.push(e)}function Sc(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,$o(t)):(n.next=o.next,o.next=n),t.interleaved=n,Dn(e,r)}function Dn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var nr=!1;function Fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(De&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Dn(e,n)}return o=r.interleaved,o===null?(t.next=t,$o(r)):(t.next=o.next,o.next=t),r.interleaved=t,Dn(e,n)}function li(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qn(e,n)}}function _c(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?o=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ii(e,t,n,r){var o=e.updateQueue;nr=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,x=o.shared.pending;if(x!==null){o.shared.pending=null;var T=x,b=T.next;T.next=null,h===null?c=b:h.next=b,h=T;var W=e.alternate;W!==null&&(W=W.updateQueue,x=W.lastBaseUpdate,x!==h&&(x===null?W.firstBaseUpdate=b:x.next=b,W.lastBaseUpdate=T))}if(c!==null){var G=o.baseState;h=0,W=b=T=null,x=c;do{var B=x.lane,ne=x.eventTime;if((r&B)===B){W!==null&&(W=W.next={eventTime:ne,lane:0,tag:x.tag,payload:x.payload,callback:x.callback,next:null});e:{var ie=e,ue=x;switch(B=t,ne=n,ue.tag){case 1:if(ie=ue.payload,typeof ie=="function"){G=ie.call(ne,G,B);break e}G=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=ue.payload,B=typeof ie=="function"?ie.call(ne,G,B):ie,B==null)break e;G=V({},G,B);break e;case 2:nr=!0}}x.callback!==null&&x.lane!==0&&(e.flags|=64,B=o.effects,B===null?o.effects=[x]:B.push(x))}else ne={eventTime:ne,lane:B,tag:x.tag,payload:x.payload,callback:x.callback,next:null},W===null?(b=W=ne,T=G):W=W.next=ne,h|=B;if(x=x.next,x===null){if(x=o.shared.pending,x===null)break;B=x,x=B.next,B.next=null,o.lastBaseUpdate=B,o.shared.pending=null}}while(!0);if(W===null&&(T=G),o.baseState=T,o.firstBaseUpdate=b,o.lastBaseUpdate=W,t=o.shared.interleaved,t!==null){o=t;do h|=o.lane,o=o.next;while(o!==t)}else c===null&&(o.shared.lanes=0);Or|=h,e.lanes=h,e.memoizedState=G}}function Nc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(i(191,o));o.call(r)}}}var tl={},xn=Jn(tl),nl=Jn(tl),rl=Jn(tl);function Pr(e){if(e===tl)throw Error(i(174));return e}function Uo(e,t){switch(qe(rl,t),qe(nl,e),qe(xn,tl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:It(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=It(t,e)}Ke(xn),qe(xn,t)}function xs(){Ke(xn),Ke(nl),Ke(rl)}function Ec(e){Pr(rl.current);var t=Pr(xn.current),n=It(t,e.type);t!==n&&(qe(nl,e),qe(xn,n))}function Bo(e){nl.current===e&&(Ke(xn),Ke(nl))}var et=Jn(0);function oi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Ho=[];function Wo(){for(var e=0;e<Ho.length;e++)Ho[e]._workInProgressVersionPrimary=null;Ho.length=0}var ai=F.ReactCurrentDispatcher,Vo=F.ReactCurrentBatchConfig,zr=0,tt=null,at=null,ct=null,ui=!1,sl=!1,ll=0,Th=0;function St(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rn(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,o,c){if(zr=c,tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ai.current=e===null||e.memoizedState===null?Ch:jh,e=n(r,o),sl){c=0;do{if(sl=!1,ll=0,25<=c)throw Error(i(301));c+=1,ct=at=null,t.updateQueue=null,ai.current=Rh,e=n(r,o)}while(sl)}if(ai.current=fi,t=at!==null&&at.next!==null,zr=0,ct=at=tt=null,ui=!1,t)throw Error(i(300));return e}function Qo(){var e=ll!==0;return ll=0,e}function kn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?tt.memoizedState=ct=e:ct=ct.next=e,ct}function Zt(){if(at===null){var e=tt.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=ct===null?tt.memoizedState:ct.next;if(t!==null)ct=t,at=e;else{if(e===null)throw Error(i(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},ct===null?tt.memoizedState=ct=e:ct=ct.next=e}return ct}function il(e,t){return typeof t=="function"?t(e):t}function Ko(e){var t=Zt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=at,o=r.baseQueue,c=n.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}r.baseQueue=o=c,n.pending=null}if(o!==null){c=o.next,r=r.baseState;var x=h=null,T=null,b=c;do{var W=b.lane;if((zr&W)===W)T!==null&&(T=T.next={lane:0,action:b.action,hasEagerState:b.hasEagerState,eagerState:b.eagerState,next:null}),r=b.hasEagerState?b.eagerState:e(r,b.action);else{var G={lane:W,action:b.action,hasEagerState:b.hasEagerState,eagerState:b.eagerState,next:null};T===null?(x=T=G,h=r):T=T.next=G,tt.lanes|=W,Or|=W}b=b.next}while(b!==null&&b!==c);T===null?h=r:T.next=x,rn(r,t.memoizedState)||(zt=!0),t.memoizedState=r,t.baseState=h,t.baseQueue=T,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do c=o.lane,tt.lanes|=c,Or|=c,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Yo(e){var t=Zt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);rn(c,t.memoizedState)||(zt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,r]}function Cc(){}function jc(e,t){var n=tt,r=Zt(),o=t(),c=!rn(r.memoizedState,o);if(c&&(r.memoizedState=o,zt=!0),r=r.queue,Xo(Lc.bind(null,n,r,e),[e]),r.getSnapshot!==t||c||ct!==null&&ct.memoizedState.tag&1){if(n.flags|=2048,ol(9,Ac.bind(null,n,r,o,t),void 0,null),dt===null)throw Error(i(349));(zr&30)!==0||Rc(n,t,o)}return o}function Rc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=tt.updateQueue,t===null?(t={lastEffect:null,stores:null},tt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ac(e,t,n,r){t.value=n,t.getSnapshot=r,Ic(t)&&bc(e)}function Lc(e,t,n){return n(function(){Ic(t)&&bc(e)})}function Ic(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rn(e,n)}catch{return!0}}function bc(e){var t=Dn(e,1);t!==null&&un(t,e,1,-1)}function Mc(e){var t=kn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:e},t.queue=e,e=e.dispatch=Eh.bind(null,tt,e),[t.memoizedState,e]}function ol(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=tt.updateQueue,t===null?(t={lastEffect:null,stores:null},tt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Dc(){return Zt().memoizedState}function ci(e,t,n,r){var o=kn();tt.flags|=e,o.memoizedState=ol(1|t,n,void 0,r===void 0?null:r)}function di(e,t,n,r){var o=Zt();r=r===void 0?null:r;var c=void 0;if(at!==null){var h=at.memoizedState;if(c=h.destroy,r!==null&&Go(r,h.deps)){o.memoizedState=ol(t,n,c,r);return}}tt.flags|=e,o.memoizedState=ol(1|t,n,c,r)}function Pc(e,t){return ci(8390656,8,e,t)}function Xo(e,t){return di(2048,8,e,t)}function zc(e,t){return di(4,2,e,t)}function Oc(e,t){return di(4,4,e,t)}function $c(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fc(e,t,n){return n=n!=null?n.concat([e]):null,di(4,4,$c.bind(null,t,e),n)}function Zo(){}function Uc(e,t){var n=Zt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bc(e,t){var n=Zt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Go(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Hc(e,t,n){return(zr&21)===0?(e.baseState&&(e.baseState=!1,zt=!0),e.memoizedState=n):(rn(n,t)||(n=zs(),tt.lanes|=n,Or|=n,e.baseState=!0),t)}function _h(e,t){var n=be;be=n!==0&&4>n?n:4,e(!0);var r=Vo.transition;Vo.transition={};try{e(!1),t()}finally{be=n,Vo.transition=r}}function Wc(){return Zt().memoizedState}function Nh(e,t,n){var r=or(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vc(e))Gc(t,n);else if(n=Sc(e,t,n,r),n!==null){var o=Rt();un(n,e,r,o),qc(n,t,r)}}function Eh(e,t,n){var r=or(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vc(e))Gc(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,x=c(h,n);if(o.hasEagerState=!0,o.eagerState=x,rn(x,h)){var T=t.interleaved;T===null?(o.next=o,$o(t)):(o.next=T.next,T.next=o),t.interleaved=o;return}}catch{}finally{}n=Sc(e,t,o,r),n!==null&&(o=Rt(),un(n,e,r,o),qc(n,t,r))}}function Vc(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function Gc(e,t){sl=ui=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qn(e,n)}}var fi={readContext:Xt,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useInsertionEffect:St,useLayoutEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useMutableSource:St,useSyncExternalStore:St,useId:St,unstable_isNewReconciler:!1},Ch={readContext:Xt,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Pc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ci(4194308,4,$c.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ci(4194308,4,e,t)},useInsertionEffect:function(e,t){return ci(4,2,e,t)},useMemo:function(e,t){var n=kn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=kn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Nh.bind(null,tt,e),[r.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:Mc,useDebugValue:Zo,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=Mc(!1),t=e[0];return e=_h.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=tt,o=kn();if(Ye){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),dt===null)throw Error(i(349));(zr&30)!==0||Rc(r,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,Pc(Lc.bind(null,r,c,e),[e]),r.flags|=2048,ol(9,Ac.bind(null,r,c,n,t),void 0,null),n},useId:function(){var e=kn(),t=dt.identifierPrefix;if(Ye){var n=Mn,r=bn;n=(r&~(1<<32-Et(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ll++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Th++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jh={readContext:Xt,useCallback:Uc,useContext:Xt,useEffect:Xo,useImperativeHandle:Fc,useInsertionEffect:zc,useLayoutEffect:Oc,useMemo:Bc,useReducer:Ko,useRef:Dc,useState:function(){return Ko(il)},useDebugValue:Zo,useDeferredValue:function(e){var t=Zt();return Hc(t,at.memoizedState,e)},useTransition:function(){var e=Ko(il)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:Cc,useSyncExternalStore:jc,useId:Wc,unstable_isNewReconciler:!1},Rh={readContext:Xt,useCallback:Uc,useContext:Xt,useEffect:Xo,useImperativeHandle:Fc,useInsertionEffect:zc,useLayoutEffect:Oc,useMemo:Bc,useReducer:Yo,useRef:Dc,useState:function(){return Yo(il)},useDebugValue:Zo,useDeferredValue:function(e){var t=Zt();return at===null?t.memoizedState=e:Hc(t,at.memoizedState,e)},useTransition:function(){var e=Yo(il)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:Cc,useSyncExternalStore:jc,useId:Wc,unstable_isNewReconciler:!1};function ln(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Jo(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:V({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pi={isMounted:function(e){return(e=e._reactInternals)?$e(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rt(),o=or(e),c=Pn(r,o);c.payload=t,n!=null&&(c.callback=n),t=rr(e,c,o),t!==null&&(un(t,e,o,r),li(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rt(),o=or(e),c=Pn(r,o);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=rr(e,c,o),t!==null&&(un(t,e,o,r),li(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rt(),r=or(e),o=Pn(n,r);o.tag=2,t!=null&&(o.callback=t),t=rr(e,o,r),t!==null&&(un(t,e,r,n),li(t,e,r))}};function Qc(e,t,n,r,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,c,h):t.prototype&&t.prototype.isPureReactComponent?!qs(n,r)||!qs(o,c):!0}function Kc(e,t,n){var r=!1,o=er,c=t.contextType;return typeof c=="object"&&c!==null?c=Xt(c):(o=Pt(t)?Ir:wt.current,r=t.contextTypes,c=(r=r!=null)?fs(e,o):er),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=c),t}function Yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pi.enqueueReplaceState(t,t.state,null)}function ea(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Fo(e);var c=t.contextType;typeof c=="object"&&c!==null?o.context=Xt(c):(c=Pt(t)?Ir:wt.current,o.context=fs(e,c)),o.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Jo(e,t,c,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&pi.enqueueReplaceState(o,o.state,null),ii(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ks(e,t){try{var n="",r=t;do n+=Ne(r),r=r.return;while(r);var o=n}catch(c){o=`
39
+ Error generating stack: `+c.message+`
40
+ `+c.stack}return{value:e,source:t,stack:o,digest:null}}function ta(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function na(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ah=typeof WeakMap=="function"?WeakMap:Map;function Xc(e,t,n){n=Pn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ki||(ki=!0,va=r),na(e,t)},n}function Zc(e,t,n){n=Pn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){na(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){na(e,t),typeof r!="function"&&(lr===null?lr=new Set([this]):lr.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function Jc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ah;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Wh.bind(null,e,t,n),t.then(e,e))}function ed(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function td(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Pn(-1,1),t.tag=2,rr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Lh=F.ReactCurrentOwner,zt=!1;function jt(e,t,n,r){t.child=e===null?wc(t,null,n,r):gs(t,e.child,n,r)}function nd(e,t,n,r,o){n=n.render;var c=t.ref;return ys(t,o),r=qo(e,t,n,r,c,o),n=Qo(),e!==null&&!zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,zn(e,t,o)):(Ye&&n&&Ao(t),t.flags|=1,jt(e,t,r,o),t.child)}function rd(e,t,n,r,o){if(e===null){var c=n.type;return typeof c=="function"&&!_a(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,sd(e,t,c,r,o)):(e=Ei(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&o)===0){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:qs,n(h,r)&&e.ref===t.ref)return zn(e,t,o)}return t.flags|=1,e=ur(c,r),e.ref=t.ref,e.return=t,t.child=e}function sd(e,t,n,r,o){if(e!==null){var c=e.memoizedProps;if(qs(c,r)&&e.ref===t.ref)if(zt=!1,t.pendingProps=r=c,(e.lanes&o)!==0)(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,zn(e,t,o)}return ra(e,t,n,r,o)}function ld(e,t,n){var r=t.pendingProps,o=r.children,c=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qe(Ss,Gt),Gt|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qe(Ss,Gt),Gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=c!==null?c.baseLanes:n,qe(Ss,Gt),Gt|=r}else c!==null?(r=c.baseLanes|n,t.memoizedState=null):r=n,qe(Ss,Gt),Gt|=r;return jt(e,t,o,n),t.child}function id(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ra(e,t,n,r,o){var c=Pt(n)?Ir:wt.current;return c=fs(t,c),ys(t,o),n=qo(e,t,n,r,c,o),r=Qo(),e!==null&&!zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,zn(e,t,o)):(Ye&&r&&Ao(t),t.flags|=1,jt(e,t,n,o),t.child)}function od(e,t,n,r,o){if(Pt(n)){var c=!0;Xl(t)}else c=!1;if(ys(t,o),t.stateNode===null)mi(e,t),Kc(t,n,r),ea(t,n,r,o),r=!0;else if(e===null){var h=t.stateNode,x=t.memoizedProps;h.props=x;var T=h.context,b=n.contextType;typeof b=="object"&&b!==null?b=Xt(b):(b=Pt(n)?Ir:wt.current,b=fs(t,b));var W=n.getDerivedStateFromProps,G=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function";G||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==r||T!==b)&&Yc(t,h,r,b),nr=!1;var B=t.memoizedState;h.state=B,ii(t,r,h,o),T=t.memoizedState,x!==r||B!==T||Dt.current||nr?(typeof W=="function"&&(Jo(t,n,W,r),T=t.memoizedState),(x=nr||Qc(t,n,x,r,B,T,b))?(G||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=T),h.props=r,h.state=T,h.context=b,r=x):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{h=t.stateNode,Tc(e,t),x=t.memoizedProps,b=t.type===t.elementType?x:ln(t.type,x),h.props=b,G=t.pendingProps,B=h.context,T=n.contextType,typeof T=="object"&&T!==null?T=Xt(T):(T=Pt(n)?Ir:wt.current,T=fs(t,T));var ne=n.getDerivedStateFromProps;(W=typeof ne=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==G||B!==T)&&Yc(t,h,r,T),nr=!1,B=t.memoizedState,h.state=B,ii(t,r,h,o);var ie=t.memoizedState;x!==G||B!==ie||Dt.current||nr?(typeof ne=="function"&&(Jo(t,n,ne,r),ie=t.memoizedState),(b=nr||Qc(t,n,b,r,B,ie,T)||!1)?(W||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(r,ie,T),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(r,ie,T)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ie),h.props=r,h.state=ie,h.context=T,r=b):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),r=!1)}return sa(e,t,n,r,c,o)}function sa(e,t,n,r,o,c){id(e,t);var h=(t.flags&128)!==0;if(!r&&!h)return o&&fc(t,n,!1),zn(e,t,c);r=t.stateNode,Lh.current=t;var x=h&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&h?(t.child=gs(t,e.child,null,c),t.child=gs(t,null,x,c)):jt(e,t,x,c),t.memoizedState=r.state,o&&fc(t,n,!0),t.child}function ad(e){var t=e.stateNode;t.pendingContext?cc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cc(e,t.context,!1),Uo(e,t.containerInfo)}function ud(e,t,n,r,o){return ms(),Mo(o),t.flags|=256,jt(e,t,n,r),t.child}var la={dehydrated:null,treeContext:null,retryLane:0};function ia(e){return{baseLanes:e,cachePool:null,transitions:null}}function cd(e,t,n){var r=t.pendingProps,o=et.current,c=!1,h=(t.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(o&2)!==0),x?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),qe(et,o&1),e===null)return bo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(h=r.children,e=r.fallback,c?(r=t.mode,c=t.child,h={mode:"hidden",children:h},(r&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=h):c=Ci(h,r,0,null),e=Br(e,r,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=ia(n),t.memoizedState=la,e):oa(t,h));if(o=e.memoizedState,o!==null&&(x=o.dehydrated,x!==null))return Ih(e,t,h,r,x,o,n);if(c){c=r.fallback,h=t.mode,o=e.child,x=o.sibling;var T={mode:"hidden",children:r.children};return(h&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=T,t.deletions=null):(r=ur(o,T),r.subtreeFlags=o.subtreeFlags&14680064),x!==null?c=ur(x,c):(c=Br(c,h,n,null),c.flags|=2),c.return=t,r.return=t,r.sibling=c,t.child=r,r=c,c=t.child,h=e.child.memoizedState,h=h===null?ia(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},c.memoizedState=h,c.childLanes=e.childLanes&~n,t.memoizedState=la,r}return c=e.child,e=c.sibling,r=ur(c,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function oa(e,t){return t=Ci({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hi(e,t,n,r){return r!==null&&Mo(r),gs(t,e.child,null,n),e=oa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ih(e,t,n,r,o,c,h){if(n)return t.flags&256?(t.flags&=-257,r=ta(Error(i(422))),hi(e,t,h,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=r.fallback,o=t.mode,r=Ci({mode:"visible",children:r.children},o,0,null),c=Br(c,o,h,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,(t.mode&1)!==0&&gs(t,e.child,null,h),t.child.memoizedState=ia(h),t.memoizedState=la,c);if((t.mode&1)===0)return hi(e,t,h,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var x=r.dgst;return r=x,c=Error(i(419)),r=ta(c,r,void 0),hi(e,t,h,r)}if(x=(h&e.childLanes)!==0,zt||x){if(r=dt,r!==null){switch(h&-h){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|h))!==0?0:o,o!==0&&o!==c.retryLane&&(c.retryLane=o,Dn(e,o),un(r,e,o,-1))}return Ta(),r=ta(Error(i(421))),hi(e,t,h,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Vh.bind(null,e),o._reactRetry=t,null):(e=c.treeContext,Vt=Zn(o.nextSibling),Wt=t,Ye=!0,sn=null,e!==null&&(Kt[Yt++]=bn,Kt[Yt++]=Mn,Kt[Yt++]=br,bn=e.id,Mn=e.overflow,br=t),t=oa(t,r.children),t.flags|=4096,t)}function dd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Oo(e.return,t,n)}function aa(e,t,n,r,o){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=r,c.tail=n,c.tailMode=o)}function fd(e,t,n){var r=t.pendingProps,o=r.revealOrder,c=r.tail;if(jt(e,t,r.children,n),r=et.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dd(e,n,t);else if(e.tag===19)dd(e,n,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}r&=1}if(qe(et,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&oi(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),aa(t,!1,o,n,c);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&oi(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}aa(t,!0,n,null,c);break;case"together":aa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function mi(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ur(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ur(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bh(e,t,n){switch(t.tag){case 3:ad(t),ms();break;case 5:Ec(t);break;case 1:Pt(t.type)&&Xl(t);break;case 4:Uo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;qe(ri,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(qe(et,et.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?cd(e,t,n):(qe(et,et.current&1),e=zn(e,t,n),e!==null?e.sibling:null);qe(et,et.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return fd(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),qe(et,et.current),r)break;return null;case 22:case 23:return t.lanes=0,ld(e,t,n)}return zn(e,t,n)}var pd,ua,hd,md;pd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ua=function(){},hd=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Pr(xn.current);var c=null;switch(n){case"input":o=Pe(e,o),r=Pe(e,r),c=[];break;case"select":o=V({},o,{value:void 0}),r=V({},r,{value:void 0}),c=[];break;case"textarea":o=me(e,o),r=me(e,r),c=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ql)}Yr(n,r);var h;n=null;for(b in o)if(!r.hasOwnProperty(b)&&o.hasOwnProperty(b)&&o[b]!=null)if(b==="style"){var x=o[b];for(h in x)x.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else b!=="dangerouslySetInnerHTML"&&b!=="children"&&b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(d.hasOwnProperty(b)?c||(c=[]):(c=c||[]).push(b,null));for(b in r){var T=r[b];if(x=o!=null?o[b]:void 0,r.hasOwnProperty(b)&&T!==x&&(T!=null||x!=null))if(b==="style")if(x){for(h in x)!x.hasOwnProperty(h)||T&&T.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in T)T.hasOwnProperty(h)&&x[h]!==T[h]&&(n||(n={}),n[h]=T[h])}else n||(c||(c=[]),c.push(b,n)),n=T;else b==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,x=x?x.__html:void 0,T!=null&&x!==T&&(c=c||[]).push(b,T)):b==="children"?typeof T!="string"&&typeof T!="number"||(c=c||[]).push(b,""+T):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&(d.hasOwnProperty(b)?(T!=null&&b==="onScroll"&&Qe("scroll",e),c||x===T||(c=[])):(c=c||[]).push(b,T))}n&&(c=c||[]).push("style",n);var b=c;(t.updateQueue=b)&&(t.flags|=4)}},md=function(e,t,n,r){n!==r&&(t.flags|=4)};function al(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mh(e,t,n){var r=t.pendingProps;switch(Lo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return Pt(t.type)&&Yl(),Tt(t),null;case 3:return r=t.stateNode,xs(),Ke(Dt),Ke(wt),Wo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ti(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,sn!==null&&(ka(sn),sn=null))),ua(e,t),Tt(t),null;case 5:Bo(t);var o=Pr(rl.current);if(n=t.type,e!==null&&t.stateNode!=null)hd(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Tt(t),null}if(e=Pr(xn.current),ti(t)){r=t.stateNode,n=t.type;var c=t.memoizedProps;switch(r[yn]=t,r[Zs]=c,e=(t.mode&1)!==0,n){case"dialog":Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":case"embed":Qe("load",r);break;case"video":case"audio":for(o=0;o<Ks.length;o++)Qe(Ks[o],r);break;case"source":Qe("error",r);break;case"img":case"image":case"link":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"input":Hn(r,c),Qe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!c.multiple},Qe("invalid",r);break;case"textarea":He(r,c),Qe("invalid",r)}Yr(n,c),o=null;for(var h in c)if(c.hasOwnProperty(h)){var x=c[h];h==="children"?typeof x=="string"?r.textContent!==x&&(c.suppressHydrationWarning!==!0&&ql(r.textContent,x,e),o=["children",x]):typeof x=="number"&&r.textContent!==""+x&&(c.suppressHydrationWarning!==!0&&ql(r.textContent,x,e),o=["children",""+x]):d.hasOwnProperty(h)&&x!=null&&h==="onScroll"&&Qe("scroll",r)}switch(n){case"input":dn(r),mr(r,c,!0);break;case"textarea":dn(r),ot(r);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(r.onclick=Ql)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{h=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=kt(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=h.createElement(n,{is:r.is}):(e=h.createElement(n),n==="select"&&(h=e,r.multiple?h.multiple=!0:r.size&&(h.size=r.size))):e=h.createElementNS(e,n),e[yn]=t,e[Zs]=r,pd(e,t,!1,!1),t.stateNode=e;e:{switch(h=yr(n,r),n){case"dialog":Qe("cancel",e),Qe("close",e),o=r;break;case"iframe":case"object":case"embed":Qe("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ks.length;o++)Qe(Ks[o],e);o=r;break;case"source":Qe("error",e),o=r;break;case"img":case"image":case"link":Qe("error",e),Qe("load",e),o=r;break;case"details":Qe("toggle",e),o=r;break;case"input":Hn(e,r),o=Pe(e,r),Qe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=V({},r,{value:void 0}),Qe("invalid",e);break;case"textarea":He(e,r),o=me(e,r),Qe("invalid",e);break;default:o=r}Yr(n,o),x=o;for(c in x)if(x.hasOwnProperty(c)){var T=x[c];c==="style"?As(e,T):c==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,T!=null&&gr(e,T)):c==="children"?typeof T=="string"?(n!=="textarea"||T!=="")&&_n(e,T):typeof T=="number"&&_n(e,""+T):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?T!=null&&c==="onScroll"&&Qe("scroll",e):T!=null&&J(e,c,T,h))}switch(n){case"input":dn(e),mr(e,r,!1);break;case"textarea":dn(e),ot(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ie(r.value));break;case"select":e.multiple=!!r.multiple,c=r.value,c!=null?O(e,!!r.multiple,c,!1):r.defaultValue!=null&&O(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ql)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tt(t),null;case 6:if(e&&t.stateNode!=null)md(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(n=Pr(rl.current),Pr(xn.current),ti(t)){if(r=t.stateNode,n=t.memoizedProps,r[yn]=t,(c=r.nodeValue!==n)&&(e=Wt,e!==null))switch(e.tag){case 3:ql(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ql(r.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yn]=t,t.stateNode=r}return Tt(t),null;case 13:if(Ke(et),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ye&&Vt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)yc(),ms(),t.flags|=98560,c=!1;else if(c=ti(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[yn]=t}else ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Tt(t),c=!1}else sn!==null&&(ka(sn),sn=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(et.current&1)!==0?ut===0&&(ut=3):Ta())),t.updateQueue!==null&&(t.flags|=4),Tt(t),null);case 4:return xs(),ua(e,t),e===null&&Ys(t.stateNode.containerInfo),Tt(t),null;case 10:return zo(t.type._context),Tt(t),null;case 17:return Pt(t.type)&&Yl(),Tt(t),null;case 19:if(Ke(et),c=t.memoizedState,c===null)return Tt(t),null;if(r=(t.flags&128)!==0,h=c.rendering,h===null)if(r)al(c,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=oi(e),h!==null){for(t.flags|=128,al(c,!1),r=h.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)c=n,e=r,c.flags&=14680066,h=c.alternate,h===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=h.childLanes,c.lanes=h.lanes,c.child=h.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=h.memoizedProps,c.memoizedState=h.memoizedState,c.updateQueue=h.updateQueue,c.type=h.type,e=h.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return qe(et,et.current&1|2),t.child}e=e.sibling}c.tail!==null&&Xe()>Ts&&(t.flags|=128,r=!0,al(c,!1),t.lanes=4194304)}else{if(!r)if(e=oi(h),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),al(c,!0),c.tail===null&&c.tailMode==="hidden"&&!h.alternate&&!Ye)return Tt(t),null}else 2*Xe()-c.renderingStartTime>Ts&&n!==1073741824&&(t.flags|=128,r=!0,al(c,!1),t.lanes=4194304);c.isBackwards?(h.sibling=t.child,t.child=h):(n=c.last,n!==null?n.sibling=h:t.child=h,c.last=h)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Xe(),t.sibling=null,n=et.current,qe(et,r?n&1|2:n&1),t):(Tt(t),null);case 22:case 23:return Sa(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Gt&1073741824)!==0&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Dh(e,t){switch(Lo(t),t.tag){case 1:return Pt(t.type)&&Yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xs(),Ke(Dt),Ke(wt),Wo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Bo(t),null;case 13:if(Ke(et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(et),null;case 4:return xs(),null;case 10:return zo(t.type._context),null;case 22:case 23:return Sa(),null;case 24:return null;default:return null}}var gi=!1,_t=!1,Ph=typeof WeakSet=="function"?WeakSet:Set,re=null;function ws(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function ca(e,t,n){try{n()}catch(r){nt(e,t,r)}}var gd=!1;function zh(e,t){if(So=Pl,e=Qu(),ho(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,c=r.focusNode;r=r.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,x=-1,T=-1,b=0,W=0,G=e,B=null;t:for(;;){for(var ne;G!==n||o!==0&&G.nodeType!==3||(x=h+o),G!==c||r!==0&&G.nodeType!==3||(T=h+r),G.nodeType===3&&(h+=G.nodeValue.length),(ne=G.firstChild)!==null;)B=G,G=ne;for(;;){if(G===e)break t;if(B===n&&++b===o&&(x=h),B===c&&++W===r&&(T=h),(ne=G.nextSibling)!==null)break;G=B,B=G.parentNode}G=ne}n=x===-1||T===-1?null:{start:x,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(To={focusedElem:e,selectionRange:n},Pl=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var ie=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ie!==null){var ue=ie.memoizedProps,st=ie.memoizedState,j=t.stateNode,_=j.getSnapshotBeforeUpdate(t.elementType===t.type?ue:ln(t.type,ue),st);j.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var R=t.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(K){nt(t,t.return,K)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return ie=gd,gd=!1,ie}function ul(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var c=o.destroy;o.destroy=void 0,c!==void 0&&ca(t,n,c)}o=o.next}while(o!==r)}}function vi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function da(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vd(e){var t=e.alternate;t!==null&&(e.alternate=null,vd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yn],delete t[Zs],delete t[Co],delete t[xh],delete t[kh])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yd(e){return e.tag===5||e.tag===3||e.tag===4}function xd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yd(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.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 fa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ql));else if(r!==4&&(e=e.child,e!==null))for(fa(e,t,n),e=e.sibling;e!==null;)fa(e,t,n),e=e.sibling}function pa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(pa(e,t,n),e=e.sibling;e!==null;)pa(e,t,n),e=e.sibling}var gt=null,on=!1;function sr(e,t,n){for(n=n.child;n!==null;)kd(e,t,n),n=n.sibling}function kd(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Er,n)}catch{}switch(n.tag){case 5:_t||ws(n,t);case 6:var r=gt,o=on;gt=null,sr(e,t,n),gt=r,on=o,gt!==null&&(on?(e=gt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gt.removeChild(n.stateNode));break;case 18:gt!==null&&(on?(e=gt,n=n.stateNode,e.nodeType===8?Eo(e.parentNode,n):e.nodeType===1&&Eo(e,n),Us(e)):Eo(gt,n.stateNode));break;case 4:r=gt,o=on,gt=n.stateNode.containerInfo,on=!0,sr(e,t,n),gt=r,on=o;break;case 0:case 11:case 14:case 15:if(!_t&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var c=o,h=c.destroy;c=c.tag,h!==void 0&&((c&2)!==0||(c&4)!==0)&&ca(n,t,h),o=o.next}while(o!==r)}sr(e,t,n);break;case 1:if(!_t&&(ws(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(x){nt(n,t,x)}sr(e,t,n);break;case 21:sr(e,t,n);break;case 22:n.mode&1?(_t=(r=_t)||n.memoizedState!==null,sr(e,t,n),_t=r):sr(e,t,n);break;default:sr(e,t,n)}}function wd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ph),t.forEach(function(r){var o=Gh.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function an(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var c=e,h=t,x=h;e:for(;x!==null;){switch(x.tag){case 5:gt=x.stateNode,on=!1;break e;case 3:gt=x.stateNode.containerInfo,on=!0;break e;case 4:gt=x.stateNode.containerInfo,on=!0;break e}x=x.return}if(gt===null)throw Error(i(160));kd(c,h,o),gt=null,on=!1;var T=o.alternate;T!==null&&(T.return=null),o.return=null}catch(b){nt(o,t,b)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Sd(t,e),t=t.sibling}function Sd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(an(t,e),wn(e),r&4){try{ul(3,e,e.return),vi(3,e)}catch(ue){nt(e,e.return,ue)}try{ul(5,e,e.return)}catch(ue){nt(e,e.return,ue)}}break;case 1:an(t,e),wn(e),r&512&&n!==null&&ws(n,n.return);break;case 5:if(an(t,e),wn(e),r&512&&n!==null&&ws(n,n.return),e.flags&32){var o=e.stateNode;try{_n(o,"")}catch(ue){nt(e,e.return,ue)}}if(r&4&&(o=e.stateNode,o!=null)){var c=e.memoizedProps,h=n!==null?n.memoizedProps:c,x=e.type,T=e.updateQueue;if(e.updateQueue=null,T!==null)try{x==="input"&&c.type==="radio"&&c.name!=null&&We(o,c),yr(x,h);var b=yr(x,c);for(h=0;h<T.length;h+=2){var W=T[h],G=T[h+1];W==="style"?As(o,G):W==="dangerouslySetInnerHTML"?gr(o,G):W==="children"?_n(o,G):J(o,W,G,b)}switch(x){case"input":Ut(o,c);break;case"textarea":Ve(o,c);break;case"select":var B=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!c.multiple;var ne=c.value;ne!=null?O(o,!!c.multiple,ne,!1):B!==!!c.multiple&&(c.defaultValue!=null?O(o,!!c.multiple,c.defaultValue,!0):O(o,!!c.multiple,c.multiple?[]:"",!1))}o[Zs]=c}catch(ue){nt(e,e.return,ue)}}break;case 6:if(an(t,e),wn(e),r&4){if(e.stateNode===null)throw Error(i(162));o=e.stateNode,c=e.memoizedProps;try{o.nodeValue=c}catch(ue){nt(e,e.return,ue)}}break;case 3:if(an(t,e),wn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Us(t.containerInfo)}catch(ue){nt(e,e.return,ue)}break;case 4:an(t,e),wn(e);break;case 13:an(t,e),wn(e),o=e.child,o.flags&8192&&(c=o.memoizedState!==null,o.stateNode.isHidden=c,!c||o.alternate!==null&&o.alternate.memoizedState!==null||(ga=Xe())),r&4&&wd(e);break;case 22:if(W=n!==null&&n.memoizedState!==null,e.mode&1?(_t=(b=_t)||W,an(t,e),_t=b):an(t,e),wn(e),r&8192){if(b=e.memoizedState!==null,(e.stateNode.isHidden=b)&&!W&&(e.mode&1)!==0)for(re=e,W=e.child;W!==null;){for(G=re=W;re!==null;){switch(B=re,ne=B.child,B.tag){case 0:case 11:case 14:case 15:ul(4,B,B.return);break;case 1:ws(B,B.return);var ie=B.stateNode;if(typeof ie.componentWillUnmount=="function"){r=B,n=B.return;try{t=r,ie.props=t.memoizedProps,ie.state=t.memoizedState,ie.componentWillUnmount()}catch(ue){nt(r,n,ue)}}break;case 5:ws(B,B.return);break;case 22:if(B.memoizedState!==null){Nd(G);continue}}ne!==null?(ne.return=B,re=ne):Nd(G)}W=W.sibling}e:for(W=null,G=e;;){if(G.tag===5){if(W===null){W=G;try{o=G.stateNode,b?(c=o.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(x=G.stateNode,T=G.memoizedProps.style,h=T!=null&&T.hasOwnProperty("display")?T.display:null,x.style.display=vr("display",h))}catch(ue){nt(e,e.return,ue)}}}else if(G.tag===6){if(W===null)try{G.stateNode.nodeValue=b?"":G.memoizedProps}catch(ue){nt(e,e.return,ue)}}else if((G.tag!==22&&G.tag!==23||G.memoizedState===null||G===e)&&G.child!==null){G.child.return=G,G=G.child;continue}if(G===e)break e;for(;G.sibling===null;){if(G.return===null||G.return===e)break e;W===G&&(W=null),G=G.return}W===G&&(W=null),G.sibling.return=G.return,G=G.sibling}}break;case 19:an(t,e),wn(e),r&4&&wd(e);break;case 21:break;default:an(t,e),wn(e)}}function wn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(yd(n)){var r=n;break e}n=n.return}throw Error(i(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(_n(o,""),r.flags&=-33);var c=xd(e);pa(e,c,o);break;case 3:case 4:var h=r.stateNode.containerInfo,x=xd(e);fa(e,x,h);break;default:throw Error(i(161))}}catch(T){nt(e,e.return,T)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Oh(e,t,n){re=e,Td(e)}function Td(e,t,n){for(var r=(e.mode&1)!==0;re!==null;){var o=re,c=o.child;if(o.tag===22&&r){var h=o.memoizedState!==null||gi;if(!h){var x=o.alternate,T=x!==null&&x.memoizedState!==null||_t;x=gi;var b=_t;if(gi=h,(_t=T)&&!b)for(re=o;re!==null;)h=re,T=h.child,h.tag===22&&h.memoizedState!==null?Ed(o):T!==null?(T.return=h,re=T):Ed(o);for(;c!==null;)re=c,Td(c),c=c.sibling;re=o,gi=x,_t=b}_d(e)}else(o.subtreeFlags&8772)!==0&&c!==null?(c.return=o,re=c):_d(e)}}function _d(e){for(;re!==null;){var t=re;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:_t||vi(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!_t)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ln(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Nc(t,c,r);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Nc(t,h,n)}break;case 5:var x=t.stateNode;if(n===null&&t.flags&4){n=x;var T=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":T.autoFocus&&n.focus();break;case"img":T.src&&(n.src=T.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var b=t.alternate;if(b!==null){var W=b.memoizedState;if(W!==null){var G=W.dehydrated;G!==null&&Us(G)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}_t||t.flags&512&&da(t)}catch(B){nt(t,t.return,B)}}if(t===e){re=null;break}if(n=t.sibling,n!==null){n.return=t.return,re=n;break}re=t.return}}function Nd(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,re=n;break}re=t.return}}function Ed(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{vi(4,t)}catch(T){nt(t,n,T)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(T){nt(t,o,T)}}var c=t.return;try{da(t)}catch(T){nt(t,c,T)}break;case 5:var h=t.return;try{da(t)}catch(T){nt(t,h,T)}}}catch(T){nt(t,t.return,T)}if(t===e){re=null;break}var x=t.sibling;if(x!==null){x.return=t.return,re=x;break}re=t.return}}var $h=Math.ceil,yi=F.ReactCurrentDispatcher,ha=F.ReactCurrentOwner,Jt=F.ReactCurrentBatchConfig,De=0,dt=null,lt=null,vt=0,Gt=0,Ss=Jn(0),ut=0,cl=null,Or=0,xi=0,ma=0,dl=null,Ot=null,ga=0,Ts=1/0,On=null,ki=!1,va=null,lr=null,wi=!1,ir=null,Si=0,fl=0,ya=null,Ti=-1,_i=0;function Rt(){return(De&6)!==0?Xe():Ti!==-1?Ti:Ti=Xe()}function or(e){return(e.mode&1)===0?1:(De&2)!==0&&vt!==0?vt&-vt:Sh.transition!==null?(_i===0&&(_i=zs()),_i):(e=be,e!==0||(e=window.event,e=e===void 0?16:ju(e.type)),e)}function un(e,t,n,r){if(50<fl)throw fl=0,ya=null,Error(i(185));Ar(e,n,r),((De&2)===0||e!==dt)&&(e===dt&&((De&2)===0&&(xi|=n),ut===4&&ar(e,vt)),$t(e,r),n===1&&De===0&&(t.mode&1)===0&&(Ts=Xe()+500,Zl&&tr()))}function $t(e,t){var n=e.callbackNode;bl(e,t);var r=Rr(e,e===dt?vt:0);if(r===0)n!==null&&Al(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Al(n),t===1)e.tag===0?wh(jd.bind(null,e)):pc(jd.bind(null,e)),vh(function(){(De&6)===0&&tr()}),n=null;else{switch(Q(r)){case 1:n=Gn;break;case 4:n=vn;break;case 16:n=Jr;break;case 536870912:n=Ll;break;default:n=Jr}n=Pd(n,Cd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Cd(e,t){if(Ti=-1,_i=0,(De&6)!==0)throw Error(i(327));var n=e.callbackNode;if(_s()&&e.callbackNode!==n)return null;var r=Rr(e,e===dt?vt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Ni(e,r);else{t=r;var o=De;De|=2;var c=Ad();(dt!==e||vt!==t)&&(On=null,Ts=Xe()+500,Fr(e,t));do try{Bh();break}catch(x){Rd(e,x)}while(!0);Po(),yi.current=c,De=o,lt!==null?t=0:(dt=null,vt=0,t=ut)}if(t!==0){if(t===2&&(o=Ps(e),o!==0&&(r=o,t=xa(e,o))),t===1)throw n=cl,Fr(e,0),ar(e,r),$t(e,Xe()),n;if(t===6)ar(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Fh(o)&&(t=Ni(e,r),t===2&&(c=Ps(e),c!==0&&(r=c,t=xa(e,c))),t===1))throw n=cl,Fr(e,0),ar(e,r),$t(e,Xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(i(345));case 2:Ur(e,Ot,On);break;case 3:if(ar(e,r),(r&130023424)===r&&(t=ga+500-Xe(),10<t)){if(Rr(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Rt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=No(Ur.bind(null,e,Ot,On),t);break}Ur(e,Ot,On);break;case 4:if(ar(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var h=31-Et(r);c=1<<h,h=t[h],h>o&&(o=h),r&=~c}if(r=o,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$h(r/1960))-r,10<r){e.timeoutHandle=No(Ur.bind(null,e,Ot,On),r);break}Ur(e,Ot,On);break;case 5:Ur(e,Ot,On);break;default:throw Error(i(329))}}}return $t(e,Xe()),e.callbackNode===n?Cd.bind(null,e):null}function xa(e,t){var n=dl;return e.current.memoizedState.isDehydrated&&(Fr(e,t).flags|=256),e=Ni(e,t),e!==2&&(t=Ot,Ot=n,t!==null&&ka(t)),e}function ka(e){Ot===null?Ot=e:Ot.push.apply(Ot,e)}function Fh(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],c=o.getSnapshot;o=o.value;try{if(!rn(c(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 ar(e,t){for(t&=~ma,t&=~xi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Et(t),r=1<<n;e[n]=-1,t&=~r}}function jd(e){if((De&6)!==0)throw Error(i(327));_s();var t=Rr(e,0);if((t&1)===0)return $t(e,Xe()),null;var n=Ni(e,t);if(e.tag!==0&&n===2){var r=Ps(e);r!==0&&(t=r,n=xa(e,r))}if(n===1)throw n=cl,Fr(e,0),ar(e,t),$t(e,Xe()),n;if(n===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ur(e,Ot,On),$t(e,Xe()),null}function wa(e,t){var n=De;De|=1;try{return e(t)}finally{De=n,De===0&&(Ts=Xe()+500,Zl&&tr())}}function $r(e){ir!==null&&ir.tag===0&&(De&6)===0&&_s();var t=De;De|=1;var n=Jt.transition,r=be;try{if(Jt.transition=null,be=1,e)return e()}finally{be=r,Jt.transition=n,De=t,(De&6)===0&&tr()}}function Sa(){Gt=Ss.current,Ke(Ss)}function Fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gh(n)),lt!==null)for(n=lt.return;n!==null;){var r=n;switch(Lo(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yl();break;case 3:xs(),Ke(Dt),Ke(wt),Wo();break;case 5:Bo(r);break;case 4:xs();break;case 13:Ke(et);break;case 19:Ke(et);break;case 10:zo(r.type._context);break;case 22:case 23:Sa()}n=n.return}if(dt=e,lt=e=ur(e.current,null),vt=Gt=t,ut=0,cl=null,ma=xi=Or=0,Ot=dl=null,Dr!==null){for(t=0;t<Dr.length;t++)if(n=Dr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,c=n.pending;if(c!==null){var h=c.next;c.next=o,r.next=h}n.pending=r}Dr=null}return e}function Rd(e,t){do{var n=lt;try{if(Po(),ai.current=fi,ui){for(var r=tt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ui=!1}if(zr=0,ct=at=tt=null,sl=!1,ll=0,ha.current=null,n===null||n.return===null){ut=1,cl=t,lt=null;break}e:{var c=e,h=n.return,x=n,T=t;if(t=vt,x.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){var b=T,W=x,G=W.tag;if((W.mode&1)===0&&(G===0||G===11||G===15)){var B=W.alternate;B?(W.updateQueue=B.updateQueue,W.memoizedState=B.memoizedState,W.lanes=B.lanes):(W.updateQueue=null,W.memoizedState=null)}var ne=ed(h);if(ne!==null){ne.flags&=-257,td(ne,h,x,c,t),ne.mode&1&&Jc(c,b,t),t=ne,T=b;var ie=t.updateQueue;if(ie===null){var ue=new Set;ue.add(T),t.updateQueue=ue}else ie.add(T);break e}else{if((t&1)===0){Jc(c,b,t),Ta();break e}T=Error(i(426))}}else if(Ye&&x.mode&1){var st=ed(h);if(st!==null){(st.flags&65536)===0&&(st.flags|=256),td(st,h,x,c,t),Mo(ks(T,x));break e}}c=T=ks(T,x),ut!==4&&(ut=2),dl===null?dl=[c]:dl.push(c),c=h;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var j=Xc(c,T,t);_c(c,j);break e;case 1:x=T;var _=c.type,R=c.stateNode;if((c.flags&128)===0&&(typeof _.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(lr===null||!lr.has(R)))){c.flags|=65536,t&=-t,c.lanes|=t;var K=Zc(c,x,t);_c(c,K);break e}}c=c.return}while(c!==null)}Id(n)}catch(de){t=de,lt===n&&n!==null&&(lt=n=n.return);continue}break}while(!0)}function Ad(){var e=yi.current;return yi.current=fi,e===null?fi:e}function Ta(){(ut===0||ut===3||ut===2)&&(ut=4),dt===null||(Or&268435455)===0&&(xi&268435455)===0||ar(dt,vt)}function Ni(e,t){var n=De;De|=2;var r=Ad();(dt!==e||vt!==t)&&(On=null,Fr(e,t));do try{Uh();break}catch(o){Rd(e,o)}while(!0);if(Po(),De=n,yi.current=r,lt!==null)throw Error(i(261));return dt=null,vt=0,ut}function Uh(){for(;lt!==null;)Ld(lt)}function Bh(){for(;lt!==null&&!eo();)Ld(lt)}function Ld(e){var t=Dd(e.alternate,e,Gt);e.memoizedProps=e.pendingProps,t===null?Id(e):lt=t,ha.current=null}function Id(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Mh(n,t,Gt),n!==null){lt=n;return}}else{if(n=Dh(n,t),n!==null){n.flags&=32767,lt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,lt=null;return}}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);ut===0&&(ut=5)}function Ur(e,t,n){var r=be,o=Jt.transition;try{Jt.transition=null,be=1,Hh(e,t,n,r)}finally{Jt.transition=o,be=r}return null}function Hh(e,t,n,r){do _s();while(ir!==null);if((De&6)!==0)throw Error(i(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var c=n.lanes|n.childLanes;if(Ml(e,c),e===dt&&(lt=dt=null,vt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||wi||(wi=!0,Pd(Jr,function(){return _s(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=Jt.transition,Jt.transition=null;var h=be;be=1;var x=De;De|=4,ha.current=null,zh(e,n),Sd(n,e),uh(To),Pl=!!So,To=So=null,e.current=n,Oh(n),to(),De=x,be=h,Jt.transition=c}else e.current=n;if(wi&&(wi=!1,ir=e,Si=o),c=e.pendingLanes,c===0&&(lr=null),es(n.stateNode),$t(e,Xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ki)throw ki=!1,e=va,va=null,e;return(Si&1)!==0&&e.tag!==0&&_s(),c=e.pendingLanes,(c&1)!==0?e===ya?fl++:(fl=0,ya=e):fl=0,tr(),null}function _s(){if(ir!==null){var e=Q(Si),t=Jt.transition,n=be;try{if(Jt.transition=null,be=16>e?16:e,ir===null)var r=!1;else{if(e=ir,ir=null,Si=0,(De&6)!==0)throw Error(i(331));var o=De;for(De|=4,re=e.current;re!==null;){var c=re,h=c.child;if((re.flags&16)!==0){var x=c.deletions;if(x!==null){for(var T=0;T<x.length;T++){var b=x[T];for(re=b;re!==null;){var W=re;switch(W.tag){case 0:case 11:case 15:ul(8,W,c)}var G=W.child;if(G!==null)G.return=W,re=G;else for(;re!==null;){W=re;var B=W.sibling,ne=W.return;if(vd(W),W===b){re=null;break}if(B!==null){B.return=ne,re=B;break}re=ne}}}var ie=c.alternate;if(ie!==null){var ue=ie.child;if(ue!==null){ie.child=null;do{var st=ue.sibling;ue.sibling=null,ue=st}while(ue!==null)}}re=c}}if((c.subtreeFlags&2064)!==0&&h!==null)h.return=c,re=h;else e:for(;re!==null;){if(c=re,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:ul(9,c,c.return)}var j=c.sibling;if(j!==null){j.return=c.return,re=j;break e}re=c.return}}var _=e.current;for(re=_;re!==null;){h=re;var R=h.child;if((h.subtreeFlags&2064)!==0&&R!==null)R.return=h,re=R;else e:for(h=_;re!==null;){if(x=re,(x.flags&2048)!==0)try{switch(x.tag){case 0:case 11:case 15:vi(9,x)}}catch(de){nt(x,x.return,de)}if(x===h){re=null;break e}var K=x.sibling;if(K!==null){K.return=x.return,re=K;break e}re=x.return}}if(De=o,tr(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Er,e)}catch{}r=!0}return r}finally{be=n,Jt.transition=t}}return!1}function bd(e,t,n){t=ks(n,t),t=Xc(e,t,1),e=rr(e,t,1),t=Rt(),e!==null&&(Ar(e,1,t),$t(e,t))}function nt(e,t,n){if(e.tag===3)bd(e,e,n);else for(;t!==null;){if(t.tag===3){bd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(lr===null||!lr.has(r))){e=ks(n,e),e=Zc(t,e,1),t=rr(t,e,1),e=Rt(),t!==null&&(Ar(t,1,e),$t(t,e));break}}t=t.return}}function Wh(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Rt(),e.pingedLanes|=e.suspendedLanes&n,dt===e&&(vt&n)===n&&(ut===4||ut===3&&(vt&130023424)===vt&&500>Xe()-ga?Fr(e,0):ma|=n),$t(e,t)}function Md(e,t){t===0&&((e.mode&1)===0?t=1:(t=ns,ns<<=1,(ns&130023424)===0&&(ns=4194304)));var n=Rt();e=Dn(e,t),e!==null&&(Ar(e,t,n),$t(e,n))}function Vh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Md(e,n)}function Gh(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}r!==null&&r.delete(t),Md(e,n)}var Dd;Dd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dt.current)zt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return zt=!1,bh(e,t,n);zt=(e.flags&131072)!==0}else zt=!1,Ye&&(t.flags&1048576)!==0&&hc(t,ei,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;mi(e,t),e=t.pendingProps;var o=fs(t,wt.current);ys(t,n),o=qo(null,t,r,e,o,n);var c=Qo();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pt(r)?(c=!0,Xl(t)):c=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Fo(t),o.updater=pi,t.stateNode=o,o._reactInternals=t,ea(t,r,e,n),t=sa(null,t,r,!0,c,n)):(t.tag=0,Ye&&c&&Ao(t),jt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(mi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Qh(r),e=ln(r,e),o){case 0:t=ra(null,t,r,e,n);break e;case 1:t=od(null,t,r,e,n);break e;case 11:t=nd(null,t,r,e,n);break e;case 14:t=rd(null,t,r,ln(r.type,e),n);break e}throw Error(i(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),ra(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),od(e,t,r,o,n);case 3:e:{if(ad(t),e===null)throw Error(i(387));r=t.pendingProps,c=t.memoizedState,o=c.element,Tc(e,t),ii(t,r,null,n);var h=t.memoizedState;if(r=h.element,c.isDehydrated)if(c={element:r,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){o=ks(Error(i(423)),t),t=ud(e,t,r,n,o);break e}else if(r!==o){o=ks(Error(i(424)),t),t=ud(e,t,r,n,o);break e}else for(Vt=Zn(t.stateNode.containerInfo.firstChild),Wt=t,Ye=!0,sn=null,n=wc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ms(),r===o){t=zn(e,t,n);break e}jt(e,t,r,n)}t=t.child}return t;case 5:return Ec(t),e===null&&bo(t),r=t.type,o=t.pendingProps,c=e!==null?e.memoizedProps:null,h=o.children,_o(r,o)?h=null:c!==null&&_o(r,c)&&(t.flags|=32),id(e,t),jt(e,t,h,n),t.child;case 6:return e===null&&bo(t),null;case 13:return cd(e,t,n);case 4:return Uo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gs(t,null,r,n):jt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),nd(e,t,r,o,n);case 7:return jt(e,t,t.pendingProps,n),t.child;case 8:return jt(e,t,t.pendingProps.children,n),t.child;case 12:return jt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,c=t.memoizedProps,h=o.value,qe(ri,r._currentValue),r._currentValue=h,c!==null)if(rn(c.value,h)){if(c.children===o.children&&!Dt.current){t=zn(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var x=c.dependencies;if(x!==null){h=c.child;for(var T=x.firstContext;T!==null;){if(T.context===r){if(c.tag===1){T=Pn(-1,n&-n),T.tag=2;var b=c.updateQueue;if(b!==null){b=b.shared;var W=b.pending;W===null?T.next=T:(T.next=W.next,W.next=T),b.pending=T}}c.lanes|=n,T=c.alternate,T!==null&&(T.lanes|=n),Oo(c.return,n,t),x.lanes|=n;break}T=T.next}}else if(c.tag===10)h=c.type===t.type?null:c.child;else if(c.tag===18){if(h=c.return,h===null)throw Error(i(341));h.lanes|=n,x=h.alternate,x!==null&&(x.lanes|=n),Oo(h,n,t),h=c.sibling}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===t){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}jt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ys(t,n),o=Xt(o),r=r(o),t.flags|=1,jt(e,t,r,n),t.child;case 14:return r=t.type,o=ln(r,t.pendingProps),o=ln(r.type,o),rd(e,t,r,o,n);case 15:return sd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),mi(e,t),t.tag=1,Pt(r)?(e=!0,Xl(t)):e=!1,ys(t,n),Kc(t,r,o),ea(t,r,o,n),sa(null,t,r,!0,e,n);case 19:return fd(e,t,n);case 22:return ld(e,t,n)}throw Error(i(156,t.tag))};function Pd(e,t){return Ds(e,t)}function qh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,t,n,r){return new qh(e,t,n,r)}function _a(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qh(e){if(typeof e=="function")return _a(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_e)return 11;if(e===P)return 14}return 2}function ur(e,t){var n=e.alternate;return n===null?(n=en(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ei(e,t,n,r,o,c){var h=2;if(r=e,typeof e=="function")_a(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case se:return Br(n.children,o,c,t);case le:h=8,o|=8;break;case we:return e=en(12,n,t,o|2),e.elementType=we,e.lanes=c,e;case Ce:return e=en(13,n,t,o),e.elementType=Ce,e.lanes=c,e;case ce:return e=en(19,n,t,o),e.elementType=ce,e.lanes=c,e;case ee:return Ci(n,o,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case te:h=10;break e;case he:h=9;break e;case _e:h=11;break e;case P:h=14;break e;case Z:h=16,r=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=en(h,n,t,o),t.elementType=e,t.type=r,t.lanes=c,t}function Br(e,t,n,r){return e=en(7,e,r,t),e.lanes=n,e}function Ci(e,t,n,r){return e=en(22,e,r,t),e.elementType=ee,e.lanes=n,e.stateNode={isHidden:!1},e}function Na(e,t,n){return e=en(6,e,null,t),e.lanes=n,e}function Ea(e,t,n){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kh(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Os(0),this.expirationTimes=Os(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Os(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ca(e,t,n,r,o,c,h,x,T){return e=new Kh(e,t,n,x,T),t===1?(t=1,c===!0&&(t|=8)):t=0,c=en(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fo(c),e}function Yh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ae,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function zd(e){if(!e)return er;e=e._reactInternals;e:{if($e(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var n=e.type;if(Pt(n))return dc(e,n,t)}return t}function Od(e,t,n,r,o,c,h,x,T){return e=Ca(n,r,!0,e,o,c,h,x,T),e.context=zd(null),n=e.current,r=Rt(),o=or(n),c=Pn(r,o),c.callback=t??null,rr(n,c,o),e.current.lanes=o,Ar(e,o,r),$t(e,r),e}function ji(e,t,n,r){var o=t.current,c=Rt(),h=or(o);return n=zd(n),t.context===null?t.context=n:t.pendingContext=n,t=Pn(c,h),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=rr(o,t,h),e!==null&&(un(e,o,h,c),li(e,o,h)),h}function Ri(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $d(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ja(e,t){$d(e,t),(e=e.alternate)&&$d(e,t)}function Xh(){return null}var Fd=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ra(e){this._internalRoot=e}Ai.prototype.render=Ra.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));ji(e,t,null,null)},Ai.prototype.unmount=Ra.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$r(function(){ji(null,e,null,null)}),t[Ln]=null}};function Ai(e){this._internalRoot=e}Ai.prototype.unstable_scheduleHydration=function(e){if(e){var t=oe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Kn.length&&t!==0&&t<Kn[n].priority;n++);Kn.splice(n,0,e),n===0&&Eu(e)}};function Aa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Li(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ud(){}function Zh(e,t,n,r,o){if(o){if(typeof r=="function"){var c=r;r=function(){var b=Ri(h);c.call(b)}}var h=Od(t,r,e,0,null,!1,!1,"",Ud);return e._reactRootContainer=h,e[Ln]=h.current,Ys(e.nodeType===8?e.parentNode:e),$r(),h}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var x=r;r=function(){var b=Ri(T);x.call(b)}}var T=Ca(e,0,!1,null,null,!1,!1,"",Ud);return e._reactRootContainer=T,e[Ln]=T.current,Ys(e.nodeType===8?e.parentNode:e),$r(function(){ji(t,T,n,r)}),T}function Ii(e,t,n,r,o){var c=n._reactRootContainer;if(c){var h=c;if(typeof o=="function"){var x=o;o=function(){var T=Ri(h);x.call(T)}}ji(t,h,e,o)}else h=Zh(n,t,e,o,r);return Ri(h)}v=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jr(t.pendingLanes);n!==0&&(Qn(t,n|1),$t(t,Xe()),(De&6)===0&&(Ts=Xe()+500,tr()))}break;case 13:$r(function(){var r=Dn(e,1);if(r!==null){var o=Rt();un(r,e,1,o)}}),ja(e,1)}},C=function(e){if(e.tag===13){var t=Dn(e,134217728);if(t!==null){var n=Rt();un(t,e,134217728,n)}ja(e,134217728)}},U=function(e){if(e.tag===13){var t=or(e),n=Dn(e,t);if(n!==null){var r=Rt();un(n,e,t,r)}ja(e,t)}},oe=function(){return be},pe=function(e,t){var n=be;try{return be=e,t()}finally{be=n}},bt=function(e,t,n){switch(t){case"input":if(Ut(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Kl(r);if(!o)throw Error(i(90));Fe(r),Ut(r,o)}}}break;case"textarea":Ve(e,n);break;case"select":t=n.value,t!=null&&O(e,!!n.multiple,t,!1)}},xr=wa,kr=$r;var Jh={usingClientEntryPoint:!1,Events:[Js,cs,Kl,Xr,Is,wa]},pl={findFiberByHostInstance:Lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},em={bundleType:pl.bundleType,version:pl.version,rendererPackageName:pl.rendererPackageName,rendererConfig:pl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:F.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Zr(e),e===null?null:e.stateNode},findFiberByHostInstance:pl.findFiberByHostInstance||Xh,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bi.isDisabled&&bi.supportsFiber)try{Er=bi.inject(em),Bt=bi}catch{}}return Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jh,Ft.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Aa(t))throw Error(i(200));return Yh(e,t,null,n)},Ft.createRoot=function(e,t){if(!Aa(e))throw Error(i(299));var n=!1,r="",o=Fd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ca(e,1,!1,null,null,n,!1,r,o),e[Ln]=t.current,Ys(e.nodeType===8?e.parentNode:e),new Ra(t)},Ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=Zr(t),e=e===null?null:e.stateNode,e},Ft.flushSync=function(e){return $r(e)},Ft.hydrate=function(e,t,n){if(!Li(t))throw Error(i(200));return Ii(null,e,t,!0,n)},Ft.hydrateRoot=function(e,t,n){if(!Aa(e))throw Error(i(405));var r=n!=null&&n.hydratedSources||null,o=!1,c="",h=Fd;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=Od(t,null,e,1,n??null,o,!1,c,h),e[Ln]=t.current,Ys(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Ai(t)},Ft.render=function(e,t,n){if(!Li(t))throw Error(i(200));return Ii(null,e,t,!1,n)},Ft.unmountComponentAtNode=function(e){if(!Li(e))throw Error(i(40));return e._reactRootContainer?($r(function(){Ii(null,null,e,!1,function(){e._reactRootContainer=null,e[Ln]=null})}),!0):!1},Ft.unstable_batchedUpdates=wa,Ft.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Li(n))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Ii(e,t,n,!1,r)},Ft.version="18.3.1-next-f1338f8080-20240426",Ft}var Kd;function cm(){if(Kd)return ba.exports;Kd=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),ba.exports=um(),ba.exports}var Yd;function dm(){if(Yd)return Mi;Yd=1;var s=cm();return Mi.createRoot=s.createRoot,Mi.hydrateRoot=s.hydrateRoot,Mi}var fm=dm();const pm=Uf(fm),Xd=s=>{let l;const i=new Set,u=(g,k)=>{const S=typeof g=="function"?g(l):g;if(!Object.is(S,l)){const w=l;l=k??(typeof S!="object"||S===null)?S:Object.assign({},l,S),i.forEach(A=>A(l,w))}},d=()=>l,m={setState:u,getState:d,getInitialState:()=>y,subscribe:g=>(i.add(g),()=>i.delete(g))},y=l=s(u,d,m);return m},hm=(s=>s?Xd(s):Xd),mm=s=>s;function gm(s,l=mm){const i=kl.useSyncExternalStore(s.subscribe,kl.useCallback(()=>l(s.getState()),[s,l]),kl.useCallback(()=>l(s.getInitialState()),[s,l]));return kl.useDebugValue(i),i}const vm=s=>{const l=hm(s),i=u=>gm(l,u);return Object.assign(i,l),i},ym=(s=>vm),Bf="agentpane:machines",Hf="agentpane:active-machine";function xm(s){return/^[a-z][a-z0-9-]{1,30}$/.test(s)}function Wf(s){return`${s}.repoburg.com`}function ou(s){const l=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(s);return l?l[1]:null}function Vf(s,l){try{const i=localStorage.getItem(s);return i==null?l:JSON.parse(i)}catch{return l}}function Gf(s,l){try{localStorage.setItem(s,JSON.stringify(l))}catch{}}function qf(){return Vf(Bf,[]).filter(l=>xm(l.mahlas)&&l.hostname===Wf(l.mahlas))}function km(s){const l={mahlas:s,hostname:Wf(s),lastConnectedAt:new Date().toISOString()},i=qf(),u=[l,...i.filter(d=>d.mahlas!==s)];return Gf(Bf,u),l}function wm(){const s=Vf(Hf,null);return s?qf().find(l=>l.mahlas===s)??null:null}function Sm(s){Gf(Hf,s)}function Tm(){if(typeof window>"u")return;const s=new URLSearchParams(window.location.search).get("host");if(!s)return;const l=ou(s);l&&(km(l),Sm(l))}const Zd="http://localhost:9998",_m=["agent.repoburg.com"];function fr(){if(typeof window>"u")return"";const s=new URLSearchParams(window.location.search),l=s.get("bport");if(l)return`http://localhost:${l}`;const i=s.get("host");if(i)return`https://${i}`;const u=window.location.hostname;if(_m.includes(u))return Zd;if(ou(u))return"";const d=wm();return d?`https://${d.hostname}`:u==="localhost"||u==="127.0.0.1"||u==="0.0.0.0"?"":Zd}const Nm="/api";async function Gi(s,l,i){const u=await fetch(`${fr()}${Nm}${l}`,{method:s,headers:i?{"Content-Type":"application/json"}:void 0,body:i?JSON.stringify(i):void 0});if(!u.ok)throw new Error(`${s} ${l} failed: ${u.status} ${u.statusText}`);return u.json()}function qr(s){return Gi("GET",s)}function Tn(s,l){return Gi("POST",s,l)}function Qf(s){return Gi("DELETE",s)}function hr(s,l){return Gi("PATCH",s,l)}function Em(){return qr("/sessions")}function Di(s){return qr(`/sessions/${s}`)}function Kf(s){return Tn("/sessions",s)}function Cm(s){return Qf(`/sessions/${s}`)}function jm(s,l,i){return Tn(`/sessions/${s}/turns`,{user_prompt:l,...i!=null&&i.length?{attachments:i}:{}})}function Rm(s){return Tn(`/sessions/${s}/cancel`)}function Am(s,l){return hr(`/sessions/${s}`,{title:l})}function Lm(s){return hr(`/sessions/${s}`,{lifecycle:"finished"})}function Im(s){return hr(`/sessions/${s}`,{lifecycle:"working"})}function Jd(s){return hr(`/sessions/${s}`,{has_unreviewed:0})}function bm(s,l,i,u){const d={model:l,model_reasoning_effort:i};return u!==void 0&&(d.runtime_type=u),hr(`/sessions/${s}`,d)}function Mm(s,l){return hr(`/sessions/${s}`,{runtime_config:l})}function Dm(s,l){return Tn(`/sessions/${s}/rewind`,{turn_id:l})}function Pm(s){return Tn(`/sessions/${s}/restore`,{})}function zm(s,l,i){return Tn(`/sessions/${s}/branch`,{turn_id:l,title:i})}function Yf(){return qr("/workspaces")}function Om(s,l){return Tn("/workspaces",{path:s,label:l})}function $m(s){return Tn("/workspaces/hide",{path:s})}async function Fm(){const s=await fetch(`${fr()}/api/pick-directory`);if(s.status===204)return{cancelled:!0};if(!s.ok)throw new Error(`GET /api/pick-directory failed: ${s.status} ${s.statusText}`);return s.json()}const Um=(s,l)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,restoredPrompt:null,quotedText:null,init:async()=>{try{const i=localStorage.getItem("agentpane:last-model-config");i&&s({lastModelConfig:JSON.parse(i)})}catch{}s({loading:!0,error:null});try{const[i,u]=await Promise.all([Em(),Yf()]);s({sessions:i,workspaces:u,loading:!1}),i.length>0&&!l().activeSessionId&&await l().selectSession(i[0].id)}catch(i){s({loading:!1,error:i.message})}},selectSession:async i=>{if(l().sessionDetails[i]){const u=l().sessionDetails[i];s({activeSessionId:i,activeTurnIndex:u.turns.length>0?u.turns.length-1:0,activeRightTab:"turns",openTabs:l().openTabs.includes(i)?l().openTabs:[...l().openTabs,i]}),u.has_unreviewed===1&&(Jd(i).catch(()=>{}),s(d=>({sessions:d.sessions.map(f=>f.id===i?{...f,has_unreviewed:0}:f),sessionDetails:{...d.sessionDetails,[i]:{...u,has_unreviewed:0}}})));return}s({loading:!0,error:null});try{const u=await Di(i);s(d=>({sessionDetails:{...d.sessionDetails,[i]:u},activeSessionId:i,activeTurnIndex:u.turns.length>0?u.turns.length-1:0,activeRightTab:"turns",loading:!1})),u.has_unreviewed===1&&(Jd(i).catch(()=>{}),s(d=>({sessions:d.sessions.map(f=>f.id===i?{...f,has_unreviewed:0}:f),sessionDetails:{...d.sessionDetails,[i]:{...u,has_unreviewed:0}}})))}catch(u){s({loading:!1,error:u.message})}},closeTab:i=>{s(u=>{const d=u.openTabs.filter(f=>f!==i);if(u.activeSessionId===i&&d.length>0){const f=d[d.length-1],p=u.sessionDetails[f];return{openTabs:d,activeSessionId:f,activeTurnIndex:p&&p.turns.length>0?p.turns.length-1:0}}return{openTabs:d,activeSessionId:u.activeSessionId===i?null:u.activeSessionId}})},updateModelConfig:async(i,u,d)=>{const f=l().activeSessionId;if(f){s({error:null});try{const p=await bm(f,i,u,d),m={provider:p.runtime_type,model:p.model??"",reasoning:p.model_reasoning_effort??""};s({lastModelConfig:m}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(m)),s(y=>({sessions:y.sessions.map(g=>g.id===f?p:g),sessionDetails:y.sessionDetails[f]?{...y.sessionDetails,[f]:{...y.sessionDetails[f],model:p.model,model_reasoning_effort:p.model_reasoning_effort,external_thread_id:p.external_thread_id}}:y.sessionDetails})),await l().refreshActiveSession()}catch(p){s({error:p.message}),l().addToast("error",`Failed to update model — ${p.message}`)}}},createSession:async i=>{s({error:null});try{const u=await Kf(i);s(f=>({sessions:[u,...f.sessions],showNewSessionDialog:!1}));const d={provider:u.runtime_type,model:u.model??"",reasoning:u.model_reasoning_effort??""};s({lastModelConfig:d}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(d)),await l().selectSession(u.id),l().addLogEntry("INFO",`Session created — ${u.id.slice(0,8)}`),l().addToast("success",`Session created — ${u.title||u.id.slice(0,8)}`)}catch(u){s({error:u.message}),l().addToast("error",`Failed to create session — ${u.message}`)}},deleteSession:async i=>{var d;s({error:null});const u=(d=l().sessions.find(f=>f.id===i))==null?void 0:d.title;try{await Cm(i),s(f=>{const p={...f.sessionDetails};delete p[i];const m=f.openTabs.filter(k=>k!==i);let y=f.activeSessionId,g=f.activeTurnIndex;if(f.activeSessionId===i){y=m.length>0?m[m.length-1]:null;const k=y?p[y]:null;g=k&&k.turns.length>0?k.turns.length-1:0}return{sessions:f.sessions.filter(k=>k.id!==i),sessionDetails:p,openTabs:m,activeSessionId:y,activeTurnIndex:g}}),l().addLogEntry("INFO",`Session deleted — ${i.slice(0,8)}`),l().addToast("info",`Session "${u||i.slice(0,8)}" deleted`)}catch(f){s({error:f.message}),l().addToast("error",`Failed to delete session — ${f.message}`)}},renameSession:async(i,u)=>{s({error:null});try{const d=await Am(i,u.trim());s(f=>({sessions:f.sessions.map(p=>p.id===i?d:p),sessionDetails:f.sessionDetails[i]?{...f.sessionDetails,[i]:{...f.sessionDetails[i],title:d.title}}:f.sessionDetails}))}catch(d){s({error:d.message}),l().addToast("error",`Failed to rename session — ${d.message}`)}},markFinished:async i=>{s({error:null});try{const u=await Lm(i);s(d=>({sessions:d.sessions.map(f=>f.id===i?u:f)})),l().addToast("info","Session marked as finished")}catch(u){s({error:u.message}),l().addToast("error",`Failed to mark as finished — ${u.message}`)}},reopenSession:async i=>{s({error:null});try{const u=await Im(i);s(d=>({sessions:d.sessions.map(f=>f.id===i?u:f)})),l().addToast("info","Session reopened")}catch(u){s({error:u.message}),l().addToast("error",`Failed to reopen session — ${u.message}`)}},submitPrompt:async(i,u)=>{const d=l().activeSessionId;if(d){s({error:null,submittingPrompt:i}),s(f=>{const p=f.sessionDetails[d];return p?{sessionDetails:{...f.sessionDetails,[d]:{...p,is_running:1,status:"running"}},sessions:f.sessions.map(m=>m.id===d?{...m,is_running:1,status:"running"}:m)}:{}});try{const f=await jm(d,i,u);l().addLogEntry("INFO",`Turn submitted — "${i.slice(0,40)}"`),s(p=>{const m=p.sessionDetails[d];if(!m)return{submittingPrompt:null};const y={...f,items:[]};return{submittingPrompt:null,sessionDetails:{...p.sessionDetails,[d]:{...m,turns:[...m.turns,y]}},activeTurnIndex:m.turns.length}})}catch(f){s({submittingPrompt:null,error:f.message}),l().addLogEntry("ERROR",`Turn failed — ${f.message}`),l().addToast("error",`Failed to send prompt — ${f.message}`),s(p=>({sessionDetails:p.sessionDetails[d]?{...p.sessionDetails,[d]:{...p.sessionDetails[d],is_running:0,status:"active"}}:p.sessionDetails,sessions:p.sessions.map(m=>m.id===d?{...m,is_running:0,status:"active"}:m)}))}}},cancelTurn:async()=>{const i=l().activeSessionId;if(i)try{await Rm(i)}catch(u){s({error:u.message})}},rewindToTurn:async(i,u)=>{s({error:null});try{const d=await Dm(i,u),f=await Di(i);s(p=>({sessionDetails:{...p.sessionDetails,[i]:f},sessions:p.sessions.map(m=>m.id===i?{...m,external_thread_id:d.external_thread_id,is_running:0,status:"active"}:m),activeTurnIndex:f.turns.length>0?f.turns.length-1:0})),l().addToast("info","Rewound to selected turn")}catch(d){s({error:d.message}),l().addToast("error",`Failed to rewind — ${d.message}`)}},restoreSession:async i=>{s({error:null});try{const u=await Pm(i),d=await Di(i);s(f=>({sessionDetails:{...f.sessionDetails,[i]:d},sessions:f.sessions.map(p=>p.id===i?{...p,external_thread_id:u.external_thread_id,is_running:0,status:"active"}:p),activeTurnIndex:d.turns.length>0?d.turns.length-1:0})),l().addToast("info","Restored rewound session")}catch(u){s({error:u.message}),l().addToast("error",`Failed to restore — ${u.message}`)}},branchFromTurn:async(i,u,d)=>{s({error:null});try{const f=await zm(i,u,d);s(p=>({sessions:[f,...p.sessions]})),await l().selectSession(f.id),l().addToast("success","Branched from selected turn")}catch(f){s({error:f.message}),l().addToast("error",`Failed to branch — ${f.message}`)}},updateRuntimeConfig:async i=>{const u=l().activeSessionId;if(u){s({error:null});try{const d=await Mm(u,JSON.stringify(i));s(f=>({sessions:f.sessions.map(p=>p.id===u?d:p),sessionDetails:f.sessionDetails[u]?{...f.sessionDetails,[u]:{...f.sessionDetails[u],runtime_config:d.runtime_config}}:f.sessionDetails}))}catch(d){s({error:d.message}),l().addToast("error",`Failed to update config — ${d.message}`)}}},refreshActiveSession:async()=>{const i=l().activeSessionId;if(i)try{const u=await Di(i);s(d=>({sessionDetails:{...d.sessionDetails,[i]:u},activeTurnIndex:u.turns.length>0?Math.min(d.activeTurnIndex,u.turns.length-1):0,sessions:d.sessions.map(f=>f.id===i?{...f,is_running:u.is_running,status:u.status}:f)}))}catch(u){s({error:u.message})}}}),Bm=(s,l)=>({workspaces:[],addWorkspace:async i=>{s({error:null});try{const u=await Om(i.trim());s(d=>({workspaces:[...d.workspaces,u]})),l().addToast("success",`Workspace added — ${u.path}`)}catch(u){l().addToast("error",`Failed to add workspace — ${u.message}`)}},removeWorkspace:async i=>{s({error:null});try{await $m(i);const u=await Yf();s({workspaces:u}),l().addToast("info","Workspace hidden")}catch(u){l().addToast("error",`Failed to hide workspace — ${u.message}`)}},createSessionInWorkspace:async i=>{s({error:null});try{const u=l().lastModelConfig,d=await Kf({cwd:i,runtime_type:(u==null?void 0:u.provider)??"codex",model:u==null?void 0:u.model,model_reasoning_effort:u==null?void 0:u.reasoning});s(f=>({sessions:[d,...f.sessions]})),await l().selectSession(d.id),l().addLogEntry("INFO",`Session created in ${i} — ${d.id.slice(0,8)}`),l().addToast("success",`Session created in ${i.split("/").pop()||i}`)}catch(u){s({error:u.message}),l().addToast("error",`Failed to create session — ${u.message}`)}},pickAndAddWorkspace:async()=>{try{const i=await Fm();if(i.cancelled||!i.path)return;await l().addWorkspace(i.path)}catch(i){l().addToast("error",`Failed to pick directory — ${i.message}`)}}}),Hm=(s,l)=>({wsConnected:!1,setWsConnected:i=>s({wsConnected:i}),onTurnStarted:(i,u)=>{l().addLogEntry("DEBUG",`turn:started — ${u.slice(0,8)}`),s(d=>{const f=d.sessionDetails[i];return f?{sessionDetails:{...d.sessionDetails,[i]:{...f,is_running:1,status:"running",turns:f.turns.map(p=>p.id===u?{...p,status:"running"}:p)}},sessions:d.sessions.map(p=>p.id===i?{...p,is_running:1,status:"running"}:p),activeTurnIndex:d.activeSessionId===i?f.turns.findIndex(p=>p.id===u):d.activeTurnIndex}:{}})},onItemStarted:(i,u,d)=>{l().addLogEntry("DEBUG",`item:started — ${d.type}`),s(f=>{const p=f.sessionDetails[i];return p?{sessionDetails:{...f.sessionDetails,[i]:Pa(p,u,d)}}:{}})},onItemUpdated:(i,u,d)=>{s(f=>{const p=f.sessionDetails[i];return p?{sessionDetails:{...f.sessionDetails,[i]:Pa(p,u,d)}}:{}})},onItemCompleted:(i,u,d)=>{if(l().addLogEntry("DEBUG",`item:completed — ${d.type}`),d.type==="background_task"&&(d.status==="completed"||d.status==="failed")){const f=d.data||{},p=f.task_type||"unknown",m=f.description||"background task",g=p==="local_agent"?"Subagent":p==="local_bash"?"Monitor":"Task";d.status==="completed"?l().addToast("success",`${g} completed: ${m}`):l().addToast("error",`${g} failed: ${m}`)}s(f=>{var g,k;const p=f.sessionDetails[i];if(!p)return{};const m=Pa(p,u,d);let y=m.turns;return d.type==="agent_message"&&((g=d.data)!=null&&g.text)&&(y=y.map(S=>S.id===u?{...S,agent_response:d.data.text}:S)),d.type==="reasoning"&&((k=d.data)!=null&&k.text)&&(y=y.map(S=>{if(S.id!==u)return S;const w=S.thoughts?S.thoughts+`
41
+ `+d.data.text:d.data.text;return{...S,thoughts:w}})),{sessionDetails:{...f.sessionDetails,[i]:{...m,turns:y}}}})},onItemDelta:(i,u,d,f)=>{s(p=>{const m=p.sessionDetails[i];return m?{sessionDetails:{...p.sessionDetails,[i]:Wm(m,u,d,f)}}:{}})},onTurnCompleted:(i,u,d,f,p)=>{const m=(d==null?void 0:d.input_tokens)??0,y=(d==null?void 0:d.output_tokens)??0;l().addLogEntry("INFO",`turn:completed — ${m} in / ${y} out`),s(g=>{const k=g.sessionDetails[i];return k?{sessionDetails:{...g.sessionDetails,[i]:{...k,is_running:0,status:"active",has_unreviewed:f?1:k.has_unreviewed,turns:k.turns.map(S=>S.id===u?{...S,status:"completed",token_usage:d??S.token_usage??null,...p&&!S.agent_response?{agent_response:p}:{}}:S)}},sessions:g.sessions.map(S=>S.id===i?{...S,is_running:0,status:"active",has_unreviewed:f?1:S.has_unreviewed}:S)}:{}})},onTokenUsageUpdated:(i,u,d)=>{s(f=>{const p=f.sessionDetails[i];return p?{sessionDetails:{...f.sessionDetails,[i]:{...p,turns:p.turns.map(m=>m.id===u?{...m,token_usage:d}:m)}}}:{}})},onContextUsageUpdated:(i,u)=>{s(d=>{const f=d.sessionDetails[i];return f?{sessionDetails:{...d.sessionDetails,[i]:{...f,contextUsage:u}}}:{}})},onTurnFailed:(i,u,d)=>{l().addLogEntry("ERROR",`turn:failed — ${d}`),l().addToast("error",`Turn failed — ${d}`),s(f=>{const p=f.sessionDetails[i];if(!p)return{};const m=d.includes("cancelled")||d.includes("aborted"),y=m?"aborted":"failed";return{sessionDetails:{...f.sessionDetails,[i]:{...p,is_running:0,status:m?"active":"failed",turns:p.turns.map(g=>{if(g.id!==u)return g;const k=g.items.map(S=>S.status==="in_progress"?{...S,status:"failed"}:S);return{...g,status:y,error:d,items:k}})}},sessions:f.sessions.map(g=>g.id===i?{...g,is_running:0,status:m?"active":"failed"}:g)}})},onTurnCancelled:(i,u)=>{s(d=>{const f=d.sessionDetails[i];if(!f)return{};const p=f.turns.find(g=>g.id===u),m=(p==null?void 0:p.user_prompt)??null,y=f.turns.filter(g=>g.id!==u);return{restoredPrompt:m,sessionDetails:{...d.sessionDetails,[i]:{...f,is_running:0,status:"active",turns:y}},sessions:d.sessions.map(g=>g.id===i?{...g,is_running:0,status:"active"}:g),activeTurnIndex:y.length>0?Math.min(d.activeTurnIndex,y.length-1):0}})},onSessionTitle:(i,u)=>{s(d=>({sessions:d.sessions.map(f=>f.id===i?{...f,title:u}:f),sessionDetails:d.sessionDetails[i]?{...d.sessionDetails,[i]:{...d.sessionDetails[i],title:u}}:d.sessionDetails}))},onBackgroundTasksChanged:(i,u)=>{s(d=>{const f=d.sessionDetails[i];return f?{sessionDetails:{...d.sessionDetails,[i]:{...f,backgroundTasks:u}}}:{}})}});function Pa(s,l,i){return{...s,turns:s.turns.map(u=>{if(u.id!==l)return u;const d=u.items.findIndex(f=>f.external_item_id===i.external_item_id);if(d>=0){const f=[...u.items];return f[d]=i,{...u,items:f}}if(i.type==="agent_message"){const f=u.items.filter(p=>!(p.type==="agent_message"&&p.id.startsWith("delta-")));return{...u,items:[...f,i]}}return{...u,items:[...u.items,i]}})}}function Wm(s,l,i,u){return{...s,turns:s.turns.map(d=>{var m;if(d.id!==l)return d;const f=d.items.findIndex(y=>y.external_item_id===i);if(f>=0){const y=d.items[f],k=(((m=y.data)==null?void 0:m.text)??"")+u,S=[...d.items];return S[f]={...y,data:{...y.data,text:k}},{...d,items:S,agent_response:k}}const p={id:`delta-${i}`,turn_id:l,external_item_id:i,type:"agent_message",data:{text:u},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...d,items:[...d.items,p],agent_response:u}})}}function Vm(s,l){const i=l?`?cwd=${encodeURIComponent(l)}`:"";return qr(`/providers/${s}/models${i}`)}const Wa=160,Va=480,Gm=240,Ga=220,qa=600,qm=300,ef="agentpane:sidebar-width",tf="agentpane:right-panel-width";function nf(s,l,i,u){try{const d=localStorage.getItem(s);if(d==null)return u;const f=Number(d);return Number.isFinite(f)?Math.min(i,Math.max(l,f)):u}catch{return u}}const Qm=(s,l)=>({activeRightTab:"turns",changesScope:"session",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,selectedChangePath:null,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:nf(ef,Wa,Va,Gm),rightPanelWidth:nf(tf,Ga,qa,qm),setActiveTurnIndex:i=>s({activeTurnIndex:i}),switchRightTab:i=>s({activeRightTab:i}),setChangesScope:i=>s({changesScope:i}),setShowNewSessionDialog:i=>s({showNewSessionDialog:i}),setShowRemoteModal:i=>s({showRemoteModal:i}),setShowCommandPalette:i=>s({showCommandPalette:i}),setShowModelSelector:i=>s({showModelSelector:i}),setSelectedChangePath:i=>s({selectedChangePath:i}),setSidebarWidth:i=>{const u=Math.min(Va,Math.max(Wa,Math.round(i)));s({sidebarWidth:u});try{localStorage.setItem(ef,String(u))}catch{}},setRightPanelWidth:i=>{const u=Math.min(qa,Math.max(Ga,Math.round(i)));s({rightPanelWidth:u});try{localStorage.setItem(tf,String(u))}catch{}},addToast:(i,u,d,f)=>{const p=Math.random().toString(36).slice(2,9);s(m=>({toasts:[...m.toasts,{id:p,type:i,message:u,undoAction:d,undoLabel:f}]}))},removeToast:i=>{s(u=>({toasts:u.toasts.filter(d=>d.id!==i)}))},addLogEntry:(i,u)=>{const d=new Date().toLocaleTimeString("en-GB",{hour12:!1});s(f=>({eventLog:[...f.eventLog,{time:d,level:i,message:u}]}))},loadModels:async(i,u)=>{if(!l().modelsLoading){s({modelsLoading:!0,models:[]});try{const d=await Vm(i,u);s({models:d,modelsLoading:!1})}catch{s({modelsLoading:!1})}}}}),Km=(s,l)=>({createThread:async(i,u)=>{try{await Tn(`/sessions/${i}/threads`,u),l().addLogEntry("INFO",`Thread created — "${u.message.slice(0,40)}"`)}catch(d){l().addToast("error",`Failed to create thread — ${d.message}`)}},followupThread:async(i,u,d)=>{try{await Tn(`/sessions/${i}/threads/${u}/followup`,{message:d}),l().addLogEntry("INFO",`Thread follow-up — "${d.slice(0,40)}"`)}catch(f){l().addToast("error",`Failed to send follow-up — ${f.message}`)}},resolveThread:async(i,u)=>{try{await hr(`/sessions/${i}/threads/${u}`,{status:"resolved"})}catch(d){l().addToast("error",`Failed to resolve thread — ${d.message}`)}},reopenThread:async(i,u)=>{try{await hr(`/sessions/${i}/threads/${u}`,{status:"open"})}catch(d){l().addToast("error",`Failed to reopen thread — ${d.message}`)}},deleteThread:async(i,u)=>{try{await Qf(`/sessions/${i}/threads/${u}`)}catch(d){l().addToast("error",`Failed to delete thread — ${d.message}`)}},onThreadCreated:(i,u,d)=>{s(f=>{const p=f.sessionDetails[i];return p?{sessionDetails:{...f.sessionDetails,[i]:{...p,threads:[...p.threads??[],u],turns:[...p.turns,{...d,items:[]}]}}}:{}})},onThreadFollowup:(i,u,d)=>{s(f=>{const p=f.sessionDetails[i];return p?{sessionDetails:{...f.sessionDetails,[i]:{...p,turns:[...p.turns,{...d,items:[]}]}}}:{}})},onThreadResolved:(i,u,d)=>{s(f=>{const p=f.sessionDetails[i];if(!p)return{};const m=(p.threads??[]).map(y=>y.id===u?{...y,status:d,resolved_at:d==="resolved"?new Date().toISOString():null}:y);return{sessionDetails:{...f.sessionDetails,[i]:{...p,threads:m}}}})},onThreadDeleted:(i,u)=>{s(d=>{const f=d.sessionDetails[i];return f?{sessionDetails:{...d.sessionDetails,[i]:{...f,threads:(f.threads??[]).filter(p=>p.id!==u),turns:f.turns.filter(p=>p.thread_id!==u)}}}:{}})}}),X=ym()((...s)=>({...Um(...s),...Bm(...s),...Hm(...s),...Qm(...s),...Km(...s)}));function Qa(s){switch(s){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function Ym(s,l){const i=new Date(s).getTime(),u=l?new Date(l).getTime():Date.now(),d=Math.max(0,Math.floor((u-i)/1e3));if(d<60)return`${d}s`;const f=Math.floor(d/60),p=d%60;if(f<60)return`${f}m ${p}s`;const m=Math.floor(f/60),y=f%60;return`${m}h ${y}m`}function Xm(s,l,i=!1,u="working"){if(u==="finished")return"";if(l)return"running";if(i&&s!=="failed")return"queued";switch(s){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Zm(s,l,i=!1,u="working"){if(u==="finished")return"Finished";if(l)return"Running";if(i&&s!=="failed")return"Review Pending";switch(s){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return s}}function au(s){const l=s.is_running===1,i=s.lifecycle==="finished",u=Qa(s.runtime_type);return{dot:Xm(s.status,l,s.has_unreviewed===1,s.lifecycle),label:Zm(s.status,l,s.has_unreviewed===1,s.lifecycle),iconClass:u.iconClass,iconText:u.iconText,isRunning:l,isFinished:i}}function qi(s,l,i=!0){I.useEffect(()=>{if(!i)return;function u(d){s.current&&!s.current.contains(d.target)&&l()}return document.addEventListener("mousedown",u),document.addEventListener("touchstart",u),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("touchstart",u)}},[s,l,i])}function uu(s,l=!0){I.useEffect(()=>{if(!l)return;function i(u){u.key==="Escape"&&s()}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[s,l])}function cu({status:s,size:l=6}){return a.jsx("span",{className:`status-dot ${s}`,style:l!==6?{width:l,height:l}:void 0})}function Xf({iconClass:s,iconText:l,size:i=20}){return a.jsx("span",{className:`runtime-icon ${s}`,style:i!==20?{width:i,height:i,fontSize:i*.45}:void 0,children:l})}/**
42
+ * @license lucide-react v0.469.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Jm=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zf=(...s)=>s.filter((l,i,u)=>!!l&&l.trim()!==""&&u.indexOf(l)===i).join(" ").trim();/**
47
+ * @license lucide-react v0.469.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */var eg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
52
+ * @license lucide-react v0.469.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const tg=I.forwardRef(({color:s="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:p,...m},y)=>I.createElement("svg",{ref:y,...eg,width:l,height:l,stroke:s,strokeWidth:u?Number(i)*24/Number(l):i,className:Zf("lucide",d),...m},[...p.map(([g,k])=>I.createElement(g,k)),...Array.isArray(f)?f:[f]]));/**
57
+ * @license lucide-react v0.469.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const xe=(s,l)=>{const i=I.forwardRef(({className:u,...d},f)=>I.createElement(tg,{ref:f,iconNode:l,className:Zf(`lucide-${Jm(s)}`,u),...d}));return i.displayName=`${s}`,i};/**
62
+ * @license lucide-react v0.469.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const ng=xe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
67
+ * @license lucide-react v0.469.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Ka=xe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
72
+ * @license lucide-react v0.469.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const rg=xe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
77
+ * @license lucide-react v0.469.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Vr=xe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
82
+ * @license lucide-react v0.469.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Ui=xe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
87
+ * @license lucide-react v0.469.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const du=xe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
92
+ * @license lucide-react v0.469.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const fu=xe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
97
+ * @license lucide-react v0.469.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const sg=xe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
102
+ * @license lucide-react v0.469.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Jf=xe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
107
+ * @license lucide-react v0.469.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const lg=xe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
112
+ * @license lucide-react v0.469.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const ig=xe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
117
+ * @license lucide-react v0.469.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const ep=xe("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
122
+ * @license lucide-react v0.469.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const rf=xe("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
127
+ * @license lucide-react v0.469.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const og=xe("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
132
+ * @license lucide-react v0.469.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const ag=xe("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
137
+ * @license lucide-react v0.469.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const ug=xe("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
142
+ * @license lucide-react v0.469.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const tp=xe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
147
+ * @license lucide-react v0.469.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const cg=xe("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
152
+ * @license lucide-react v0.469.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const dg=xe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
157
+ * @license lucide-react v0.469.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const fg=xe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
162
+ * @license lucide-react v0.469.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const pg=xe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
167
+ * @license lucide-react v0.469.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const hg=xe("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
172
+ * @license lucide-react v0.469.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const mg=xe("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
177
+ * @license lucide-react v0.469.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const gg=xe("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
182
+ * @license lucide-react v0.469.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const Hr=xe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
187
+ * @license lucide-react v0.469.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const vg=xe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
192
+ * @license lucide-react v0.469.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const yg=xe("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
197
+ * @license lucide-react v0.469.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const xg=xe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
202
+ * @license lucide-react v0.469.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const kg=xe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
207
+ * @license lucide-react v0.469.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const sf=xe("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
212
+ * @license lucide-react v0.469.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const wg=xe("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
217
+ * @license lucide-react v0.469.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const Sg=xe("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
222
+ * @license lucide-react v0.469.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const Tg=xe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
227
+ * @license lucide-react v0.469.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const _g=xe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
232
+ * @license lucide-react v0.469.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const Sl=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
237
+ * @license lucide-react v0.469.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const np=xe("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
242
+ * @license lucide-react v0.469.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const Ng=xe("Rewind",[["polygon",{points:"11 19 2 12 11 5 11 19",key:"14yba5"}],["polygon",{points:"22 19 13 12 22 5 22 19",key:"1pi1cj"}]]);/**
247
+ * @license lucide-react v0.469.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const pu=xe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
252
+ * @license lucide-react v0.469.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const rp=xe("SatelliteDish",[["path",{d:"M4 10a7.31 7.31 0 0 0 10 10Z",key:"1fzpp3"}],["path",{d:"m9 15 3-3",key:"88sc13"}],["path",{d:"M17 13a6 6 0 0 0-6-6",key:"15cc6u"}],["path",{d:"M21 13A10 10 0 0 0 11 3",key:"11nf8s"}]]);/**
257
+ * @license lucide-react v0.469.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const Eg=xe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
262
+ * @license lucide-react v0.469.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const Qi=xe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
267
+ * @license lucide-react v0.469.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const Ki=xe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
272
+ * @license lucide-react v0.469.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const sp=xe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
277
+ * @license lucide-react v0.469.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const js=xe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
282
+ * @license lucide-react v0.469.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const Cg=xe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
287
+ * @license lucide-react v0.469.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const jg=xe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
292
+ * @license lucide-react v0.469.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const Rg=xe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
297
+ * @license lucide-react v0.469.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const Ag=xe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
302
+ * @license lucide-react v0.469.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const Bn=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
307
+ * @license lucide-react v0.469.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const Lg=xe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Ig(s,l){const i=new Map;for(const p of l){const m=p.cwd||"(no directory)",y=i.get(m)??[];y.push(p),i.set(m,y)}const u=new Set,d=new Set(s.filter(p=>p.deleted===1).map(p=>p.path)),f=[];for(const p of s){if(p.deleted===1){u.add(p.path);continue}u.add(p.path),f.push({path:p.path,label:p.label||p.path.split("/").pop()||p.path,sessions:i.get(p.path)??[],workspace:p})}for(const[p,m]of i)u.has(p)||d.has(p)||f.push({path:p,label:p==="(no directory)"?"Other":p.split("/").pop()||p,sessions:m,workspace:null});return f}function bg(){const{sessions:s,workspaces:l,activeSessionId:i,selectSession:u,deleteSession:d,removeWorkspace:f,createSessionInWorkspace:p,pickAndAddWorkspace:m,renameSession:y,markFinished:g,reopenSession:k}=X(),[S,w]=I.useState(new Set),[A,M]=I.useState(new Set),[L,E]=I.useState(null),[$,H]=I.useState(null),[J,F]=I.useState(""),q=I.useRef(null),ae=I.useRef(null);qi(q,()=>E(null),!!L),uu(()=>E(null),!!L);function se(ce){w(P=>{const Z=new Set(P);return Z.has(ce)?Z.delete(ce):Z.add(ce),Z})}function le(ce){M(P=>{const Z=new Set(P);return Z.has(ce)?Z.delete(ce):Z.add(ce),Z})}I.useEffect(()=>{$&&ae.current&&(ae.current.focus(),ae.current.select())},[$]);function we(ce,P){H(ce),F(P||ce.slice(0,8))}function te(){$&&y($,J),H(null)}function he(){H(null),F("")}const _e=Ig(l,s);function Ce(ce){const P=i===ce.id,Z=au(ce);return a.jsxs("div",{className:`tree-item ${P?"active":""} ${Z.isFinished?"tree-item-finished":""}`,onClick:()=>u(ce.id),onContextMenu:ee=>{ee.preventDefault(),E({x:ee.clientX,y:ee.clientY,type:"session",sessionId:ce.id,sessionTitle:ce.title,sessionLifecycle:ce.lifecycle})},children:[a.jsx(Xf,{iconClass:Z.iconClass,iconText:Z.iconText,size:16}),$===ce.id?a.jsx("input",{ref:ae,className:"tree-rename-input",value:J,onChange:ee=>F(ee.target.value),onClick:ee=>ee.stopPropagation(),onKeyDown:ee=>{ee.key==="Enter"&&te(),ee.key==="Escape"&&he()},onBlur:te}):a.jsx("span",{className:"tree-label",children:ce.title||ce.id.slice(0,8)}),Z.dot&&a.jsx(cu,{status:Z.dot})]},ce.id)}return a.jsxs("div",{className:"ide-sidebar",children:[a.jsxs("div",{className:"sidebar-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),a.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:a.jsx(Sl,{size:14})})]}),_e.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):_e.map(ce=>{const P=S.has(ce.path),Z=ce.sessions.filter(V=>V.lifecycle!=="finished"),ee=ce.sessions.filter(V=>V.lifecycle==="finished"),z=`${ce.path}:finished`,Y=A.has(z);return a.jsxs("div",{className:`tree-section ${P?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-section-header",onClick:()=>se(ce.path),onContextMenu:V=>{V.preventDefault(),E({x:V.clientX,y:V.clientY,type:"workspace",path:ce.path})},children:[a.jsx(Ui,{size:9,className:"tree-chevron"}),a.jsx(dg,{size:14}),a.jsx("span",{className:"tree-section-label",children:ce.label}),a.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:V=>{V.stopPropagation(),p(ce.path)},children:a.jsx(Sl,{size:11})}),a.jsx("span",{className:"tree-count",children:ce.sessions.length})]}),a.jsxs("div",{className:"tree-children",children:[Z.length===0&&ee.length===0?a.jsx("div",{className:"tree-empty",children:"No sessions"}):Z.map(Ce),ee.length>0&&a.jsxs("div",{className:`tree-subgroup ${Y?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-subgroup-header",onClick:()=>le(z),children:[a.jsx(Ui,{size:8,className:"tree-chevron"}),a.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),a.jsx("span",{className:"tree-subgroup-count",children:ee.length})]}),!Y&&a.jsx("div",{className:"tree-subgroup-items",children:ee.map(Ce)})]})]})]},ce.path)}),a.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[a.jsx(cg,{size:14}),a.jsx("span",{children:"Add workspace"})]}),L&&a.jsxs("div",{ref:q,className:"ctx-menu",style:{position:"fixed",left:L.x,top:L.y,zIndex:500},children:[L.type==="workspace"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{p(L.path),E(null)},children:[a.jsx(Sl,{size:12})," New Session"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(L.path),E(null)},children:[a.jsx(js,{size:12})," Hide Workspace"]})]}),L.type==="session"&&a.jsx(a.Fragment,{children:L.sessionLifecycle!=="finished"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{we(L.sessionId,L.sessionTitle??""),E(null)},children:[a.jsx(Tg,{size:12})," Rename"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(L.sessionId),E(null)},children:[a.jsx(Jf,{size:12})," Mark as Finished"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(L.sessionId),E(null)},children:[a.jsx(js,{size:12})," Delete Session"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(L.sessionId),E(null)},children:[a.jsx(pu,{size:12})," Reopen"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(L.sessionId),E(null)},children:[a.jsx(js,{size:12})," Delete Session"]})]})})]})]})}function Mg(){const s=X(p=>p.openTabs),l=X(p=>p.activeSessionId),i=X(p=>p.sessions),u=X(p=>p.selectSession),d=X(p=>p.closeTab),f=X(p=>p.setShowNewSessionDialog);return a.jsxs("div",{className:"ide-tabs",children:[s.map(p=>{const m=i.find(k=>k.id===p);if(!m)return null;const y=au(m),g=l===p;return a.jsxs("div",{className:`ide-tab ${g?"active":""}`,onClick:()=>u(p),children:[a.jsx(Xf,{iconClass:y.iconClass,iconText:y.iconText,size:14}),m.title||p.slice(0,8),y.dot&&a.jsx(cu,{status:y.dot}),a.jsx("span",{className:"ide-tab-close",onClick:k=>{k.stopPropagation(),d(p)},children:a.jsx(Bn,{size:12})})]},p)}),a.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:a.jsx(Sl,{size:14})})]})}function hu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Qr=hu();function lp(s){Qr=s}var Tl={exec:()=>null};function Ue(s,l=""){let i=typeof s=="string"?s:s.source;const u={replace:(d,f)=>{let p=typeof f=="string"?f:f.source;return p=p.replace(At.caret,"$1"),i=i.replace(d,p),u},getRegex:()=>new RegExp(i,l)};return u}var At={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},Dg=/^(?:[ \t]*(?:\n|$))+/,Pg=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zg=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Og=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mu=/(?:[*+-]|\d{1,9}[.)])/,ip=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,op=Ue(ip).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(),$g=Ue(ip).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(),gu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fg=/^[^\n]+/,vu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ug=Ue(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Bg=Ue(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,mu).getRegex(),Yi="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",yu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Hg=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",yu).replace("tag",Yi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ap=Ue(gu).replace("hr",Nl).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yi).getRegex(),Wg=Ue(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ap).getRegex(),xu={blockquote:Wg,code:Pg,def:Ug,fences:zg,heading:Og,hr:Nl,html:Hg,lheading:op,list:Bg,newline:Dg,paragraph:ap,table:Tl,text:Fg},lf=Ue("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Nl).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yi).getRegex(),Vg={...xu,lheading:$g,table:lf,paragraph:Ue(gu).replace("hr",Nl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yi).getRegex()},Gg={...xu,html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",yu).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:Tl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ue(gu).replace("hr",Nl).replace("heading",` *#{1,6} *[^
312
+ ]`).replace("lheading",op).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qg=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Qg=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,up=/^( {2,}|\\)\n(?!\s*$)/,Kg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xi=/[\p{P}\p{S}]/u,ku=/[\s\p{P}\p{S}]/u,cp=/[^\s\p{P}\p{S}]/u,Yg=Ue(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ku).getRegex(),dp=/(?!~)[\p{P}\p{S}]/u,Xg=/(?!~)[\s\p{P}\p{S}]/u,Zg=/(?:[^\s\p{P}\p{S}]|~)/u,Jg=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,fp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ev=Ue(fp,"u").replace(/punct/g,Xi).getRegex(),tv=Ue(fp,"u").replace(/punct/g,dp).getRegex(),pp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nv=Ue(pp,"gu").replace(/notPunctSpace/g,cp).replace(/punctSpace/g,ku).replace(/punct/g,Xi).getRegex(),rv=Ue(pp,"gu").replace(/notPunctSpace/g,Zg).replace(/punctSpace/g,Xg).replace(/punct/g,dp).getRegex(),sv=Ue("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cp).replace(/punctSpace/g,ku).replace(/punct/g,Xi).getRegex(),lv=Ue(/\\(punct)/,"gu").replace(/punct/g,Xi).getRegex(),iv=Ue(/^<(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(),ov=Ue(yu).replace("(?:-->|$)","-->").getRegex(),av=Ue("^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",ov).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,uv=Ue(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Bi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hp=Ue(/^!?\[(label)\]\[(ref)\]/).replace("label",Bi).replace("ref",vu).getRegex(),mp=Ue(/^!?\[(ref)\](?:\[\])?/).replace("ref",vu).getRegex(),cv=Ue("reflink|nolink(?!\\()","g").replace("reflink",hp).replace("nolink",mp).getRegex(),wu={_backpedal:Tl,anyPunctuation:lv,autolink:iv,blockSkip:Jg,br:up,code:Qg,del:Tl,emStrongLDelim:ev,emStrongRDelimAst:nv,emStrongRDelimUnd:sv,escape:qg,link:uv,nolink:mp,punctuation:Yg,reflink:hp,reflinkSearch:cv,tag:av,text:Kg,url:Tl},dv={...wu,link:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",Bi).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bi).getRegex()},Ya={...wu,emStrongRDelimAst:rv,emStrongLDelim:tv,url:Ue(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},fv={...Ya,br:Ue(up).replace("{2,}","*").getRegex(),text:Ue(Ya.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pi={normal:xu,gfm:Vg,pedantic:Gg},ml={normal:wu,gfm:Ya,breaks:fv,pedantic:dv},pv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},of=s=>pv[s];function Sn(s,l){if(l){if(At.escapeTest.test(s))return s.replace(At.escapeReplace,of)}else if(At.escapeTestNoEncode.test(s))return s.replace(At.escapeReplaceNoEncode,of);return s}function af(s){try{s=encodeURI(s).replace(At.percentDecode,"%")}catch{return null}return s}function uf(s,l){var f;const i=s.replace(At.findPipe,(p,m,y)=>{let g=!1,k=m;for(;--k>=0&&y[k]==="\\";)g=!g;return g?"|":" |"}),u=i.split(At.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((f=u.at(-1))!=null&&f.trim())&&u.pop(),l)if(u.length>l)u.splice(l);else for(;u.length<l;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(At.slashPipe,"|");return u}function gl(s,l,i){const u=s.length;if(u===0)return"";let d=0;for(;d<u&&s.charAt(u-d-1)===l;)d++;return s.slice(0,u-d)}function hv(s,l){if(s.indexOf(l[1])===-1)return-1;let i=0;for(let u=0;u<s.length;u++)if(s[u]==="\\")u++;else if(s[u]===l[0])i++;else if(s[u]===l[1]&&(i--,i<0))return u;return i>0?-2:-1}function cf(s,l,i,u,d){const f=l.href,p=l.title||null,m=s[1].replace(d.other.outputLinkReplace,"$1");u.state.inLink=!0;const y={type:s[0].charAt(0)==="!"?"image":"link",raw:i,href:f,title:p,text:m,tokens:u.inlineTokens(m)};return u.state.inLink=!1,y}function mv(s,l,i){const u=s.match(i.other.indentCodeCompensation);if(u===null)return l;const d=u[1];return l.split(`
313
+ `).map(f=>{const p=f.match(i.other.beginningSpace);if(p===null)return f;const[m]=p;return m.length>=d.length?f.slice(d.length):f}).join(`
314
+ `)}var Hi=class{constructor(s){Ge(this,"options");Ge(this,"rules");Ge(this,"lexer");this.options=s||Qr}space(s){const l=this.rules.block.newline.exec(s);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(s){const l=this.rules.block.code.exec(s);if(l){const i=l[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:l[0],codeBlockStyle:"indented",text:this.options.pedantic?i:gl(i,`
315
+ `)}}}fences(s){const l=this.rules.block.fences.exec(s);if(l){const i=l[0],u=mv(i,l[3]||"",this.rules);return{type:"code",raw:i,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:u}}}heading(s){const l=this.rules.block.heading.exec(s);if(l){let i=l[2].trim();if(this.rules.other.endingHash.test(i)){const u=gl(i,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(i=u.trim())}return{type:"heading",raw:l[0],depth:l[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(s){const l=this.rules.block.hr.exec(s);if(l)return{type:"hr",raw:gl(l[0],`
316
+ `)}}blockquote(s){const l=this.rules.block.blockquote.exec(s);if(l){let i=gl(l[0],`
317
+ `).split(`
318
+ `),u="",d="";const f=[];for(;i.length>0;){let p=!1;const m=[];let y;for(y=0;y<i.length;y++)if(this.rules.other.blockquoteStart.test(i[y]))m.push(i[y]),p=!0;else if(!p)m.push(i[y]);else break;i=i.slice(y);const g=m.join(`
319
+ `),k=g.replace(this.rules.other.blockquoteSetextReplace,`
320
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
321
+ ${g}`:g,d=d?`${d}
322
+ ${k}`:k;const S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(k,f,!0),this.lexer.state.top=S,i.length===0)break;const w=f.at(-1);if((w==null?void 0:w.type)==="code")break;if((w==null?void 0:w.type)==="blockquote"){const A=w,M=A.raw+`
323
+ `+i.join(`
324
+ `),L=this.blockquote(M);f[f.length-1]=L,u=u.substring(0,u.length-A.raw.length)+L.raw,d=d.substring(0,d.length-A.text.length)+L.text;break}else if((w==null?void 0:w.type)==="list"){const A=w,M=A.raw+`
325
+ `+i.join(`
326
+ `),L=this.list(M);f[f.length-1]=L,u=u.substring(0,u.length-w.raw.length)+L.raw,d=d.substring(0,d.length-A.raw.length)+L.raw,i=M.substring(f.at(-1).raw.length).split(`
327
+ `);continue}}return{type:"blockquote",raw:u,tokens:f,text:d}}}list(s){let l=this.rules.block.list.exec(s);if(l){let i=l[1].trim();const u=i.length>1,d={type:"list",raw:"",ordered:u,start:u?+i.slice(0,-1):"",loose:!1,items:[]};i=u?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=u?i:"[*+-]");const f=this.rules.other.listItemRegex(i);let p=!1;for(;s;){let y=!1,g="",k="";if(!(l=f.exec(s))||this.rules.block.hr.test(s))break;g=l[0],s=s.substring(g.length);let S=l[2].split(`
328
+ `,1)[0].replace(this.rules.other.listReplaceTabs,$=>" ".repeat(3*$.length)),w=s.split(`
329
+ `,1)[0],A=!S.trim(),M=0;if(this.options.pedantic?(M=2,k=S.trimStart()):A?M=l[1].length+1:(M=l[2].search(this.rules.other.nonSpaceChar),M=M>4?1:M,k=S.slice(M),M+=l[1].length),A&&this.rules.other.blankLine.test(w)&&(g+=w+`
330
+ `,s=s.substring(w.length+1),y=!0),!y){const $=this.rules.other.nextBulletRegex(M),H=this.rules.other.hrRegex(M),J=this.rules.other.fencesBeginRegex(M),F=this.rules.other.headingBeginRegex(M),q=this.rules.other.htmlBeginRegex(M);for(;s;){const ae=s.split(`
331
+ `,1)[0];let se;if(w=ae,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),se=w):se=w.replace(this.rules.other.tabCharGlobal," "),J.test(w)||F.test(w)||q.test(w)||$.test(w)||H.test(w))break;if(se.search(this.rules.other.nonSpaceChar)>=M||!w.trim())k+=`
332
+ `+se.slice(M);else{if(A||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||J.test(S)||F.test(S)||H.test(S))break;k+=`
333
+ `+w}!A&&!w.trim()&&(A=!0),g+=ae+`
334
+ `,s=s.substring(ae.length+1),S=se.slice(M)}}d.loose||(p?d.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(p=!0));let L=null,E;this.options.gfm&&(L=this.rules.other.listIsTask.exec(k),L&&(E=L[0]!=="[ ] ",k=k.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:g,task:!!L,checked:E,loose:!1,text:k,tokens:[]}),d.raw+=g}const m=d.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let y=0;y<d.items.length;y++)if(this.lexer.state.top=!1,d.items[y].tokens=this.lexer.blockTokens(d.items[y].text,[]),!d.loose){const g=d.items[y].tokens.filter(S=>S.type==="space"),k=g.length>0&&g.some(S=>this.rules.other.anyLine.test(S.raw));d.loose=k}if(d.loose)for(let y=0;y<d.items.length;y++)d.items[y].loose=!0;return d}}html(s){const l=this.rules.block.html.exec(s);if(l)return{type:"html",block:!0,raw:l[0],pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:l[0]}}def(s){const l=this.rules.block.def.exec(s);if(l){const i=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:i,raw:l[0],href:u,title:d}}}table(s){var p;const l=this.rules.block.table.exec(s);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;const i=uf(l[1]),u=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(p=l[3])!=null&&p.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
335
+ `):[],f={type:"table",raw:l[0],header:[],align:[],rows:[]};if(i.length===u.length){for(const m of u)this.rules.other.tableAlignRight.test(m)?f.align.push("right"):this.rules.other.tableAlignCenter.test(m)?f.align.push("center"):this.rules.other.tableAlignLeft.test(m)?f.align.push("left"):f.align.push(null);for(let m=0;m<i.length;m++)f.header.push({text:i[m],tokens:this.lexer.inline(i[m]),header:!0,align:f.align[m]});for(const m of d)f.rows.push(uf(m,f.header.length).map((y,g)=>({text:y,tokens:this.lexer.inline(y),header:!1,align:f.align[g]})));return f}}lheading(s){const l=this.rules.block.lheading.exec(s);if(l)return{type:"heading",raw:l[0],depth:l[2].charAt(0)==="="?1:2,text:l[1],tokens:this.lexer.inline(l[1])}}paragraph(s){const l=this.rules.block.paragraph.exec(s);if(l){const i=l[1].charAt(l[1].length-1)===`
336
+ `?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:i,tokens:this.lexer.inline(i)}}}text(s){const l=this.rules.block.text.exec(s);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(s){const l=this.rules.inline.escape.exec(s);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(s){const l=this.rules.inline.tag.exec(s);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(s){const l=this.rules.inline.link.exec(s);if(l){const i=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;const f=gl(i.slice(0,-1),"\\");if((i.length-f.length)%2===0)return}else{const f=hv(l[2],"()");if(f===-2)return;if(f>-1){const m=(l[0].indexOf("!")===0?5:4)+l[1].length+f;l[2]=l[2].substring(0,f),l[0]=l[0].substring(0,m).trim(),l[3]=""}}let u=l[2],d="";if(this.options.pedantic){const f=this.rules.other.pedanticHrefTitle.exec(u);f&&(u=f[1],d=f[3])}else d=l[3]?l[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?u=u.slice(1):u=u.slice(1,-1)),cf(l,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(s,l){let i;if((i=this.rules.inline.reflink.exec(s))||(i=this.rules.inline.nolink.exec(s))){const u=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=l[u.toLowerCase()];if(!d){const f=i[0].charAt(0);return{type:"text",raw:f,text:f}}return cf(i,d,i[0],this.lexer,this.rules)}}emStrong(s,l,i=""){let u=this.rules.inline.emStrongLDelim.exec(s);if(!u||u[3]&&i.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const f=[...u[0]].length-1;let p,m,y=f,g=0;const k=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(k.lastIndex=0,l=l.slice(-1*s.length+f);(u=k.exec(l))!=null;){if(p=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!p)continue;if(m=[...p].length,u[3]||u[4]){y+=m;continue}else if((u[5]||u[6])&&f%3&&!((f+m)%3)){g+=m;continue}if(y-=m,y>0)continue;m=Math.min(m,m+y+g);const S=[...u[0]][0].length,w=s.slice(0,f+u.index+S+m);if(Math.min(f,m)%2){const M=w.slice(1,-1);return{type:"em",raw:w,text:M,tokens:this.lexer.inlineTokens(M)}}const A=w.slice(2,-2);return{type:"strong",raw:w,text:A,tokens:this.lexer.inlineTokens(A)}}}}codespan(s){const l=this.rules.inline.code.exec(s);if(l){let i=l[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(i),d=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return u&&d&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:l[0],text:i}}}br(s){const l=this.rules.inline.br.exec(s);if(l)return{type:"br",raw:l[0]}}del(s){const l=this.rules.inline.del.exec(s);if(l)return{type:"del",raw:l[0],text:l[2],tokens:this.lexer.inlineTokens(l[2])}}autolink(s){const l=this.rules.inline.autolink.exec(s);if(l){let i,u;return l[2]==="@"?(i=l[1],u="mailto:"+i):(i=l[1],u=i),{type:"link",raw:l[0],text:i,href:u,tokens:[{type:"text",raw:i,text:i}]}}}url(s){var i;let l;if(l=this.rules.inline.url.exec(s)){let u,d;if(l[2]==="@")u=l[0],d="mailto:"+u;else{let f;do f=l[0],l[0]=((i=this.rules.inline._backpedal.exec(l[0]))==null?void 0:i[0])??"";while(f!==l[0]);u=l[0],l[1]==="www."?d="http://"+l[0]:d=l[0]}return{type:"link",raw:l[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(s){const l=this.rules.inline.text.exec(s);if(l){const i=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:i}}}},Fn=class Xa{constructor(l){Ge(this,"tokens");Ge(this,"options");Ge(this,"state");Ge(this,"tokenizer");Ge(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Qr,this.options.tokenizer=this.options.tokenizer||new Hi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={other:At,block:Pi.normal,inline:ml.normal};this.options.pedantic?(i.block=Pi.pedantic,i.inline=ml.pedantic):this.options.gfm&&(i.block=Pi.gfm,this.options.breaks?i.inline=ml.breaks:i.inline=ml.gfm),this.tokenizer.rules=i}static get rules(){return{block:Pi,inline:ml}}static lex(l,i){return new Xa(i).lex(l)}static lexInline(l,i){return new Xa(i).inlineTokens(l)}lex(l){l=l.replace(At.carriageReturn,`
337
+ `),this.blockTokens(l,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const u=this.inlineQueue[i];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,i=[],u=!1){var d,f,p;for(this.options.pedantic&&(l=l.replace(At.tabCharGlobal," ").replace(At.spaceLine,""));l;){let m;if((f=(d=this.options.extensions)==null?void 0:d.block)!=null&&f.some(g=>(m=g.call({lexer:this},l,i))?(l=l.substring(m.raw.length),i.push(m),!0):!1))continue;if(m=this.tokenizer.space(l)){l=l.substring(m.raw.length);const g=i.at(-1);m.raw.length===1&&g!==void 0?g.raw+=`
338
+ `:i.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);const g=i.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
339
+ `+m.raw,g.text+=`
340
+ `+m.text,this.inlineQueue.at(-1).src=g.text):i.push(m);continue}if(m=this.tokenizer.fences(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.heading(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.hr(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.blockquote(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.list(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.html(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.def(l)){l=l.substring(m.raw.length);const g=i.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
341
+ `+m.raw,g.text+=`
342
+ `+m.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title});continue}if(m=this.tokenizer.table(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.lheading(l)){l=l.substring(m.raw.length),i.push(m);continue}let y=l;if((p=this.options.extensions)!=null&&p.startBlock){let g=1/0;const k=l.slice(1);let S;this.options.extensions.startBlock.forEach(w=>{S=w.call({lexer:this},k),typeof S=="number"&&S>=0&&(g=Math.min(g,S))}),g<1/0&&g>=0&&(y=l.substring(0,g+1))}if(this.state.top&&(m=this.tokenizer.paragraph(y))){const g=i.at(-1);u&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
343
+ `+m.raw,g.text+=`
344
+ `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):i.push(m),u=y.length!==l.length,l=l.substring(m.raw.length);continue}if(m=this.tokenizer.text(l)){l=l.substring(m.raw.length);const g=i.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
345
+ `+m.raw,g.text+=`
346
+ `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):i.push(m);continue}if(l){const g="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,i}inline(l,i=[]){return this.inlineQueue.push({src:l,tokens:i}),i}inlineTokens(l,i=[]){var m,y,g;let u=l,d=null;if(this.tokens.links){const k=Object.keys(this.tokens.links);if(k.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)k.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let f=!1,p="";for(;l;){f||(p=""),f=!1;let k;if((y=(m=this.options.extensions)==null?void 0:m.inline)!=null&&y.some(w=>(k=w.call({lexer:this},l,i))?(l=l.substring(k.raw.length),i.push(k),!0):!1))continue;if(k=this.tokenizer.escape(l)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.tag(l)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.link(l)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(k.raw.length);const w=i.at(-1);k.type==="text"&&(w==null?void 0:w.type)==="text"?(w.raw+=k.raw,w.text+=k.text):i.push(k);continue}if(k=this.tokenizer.emStrong(l,u,p)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.codespan(l)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.br(l)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.del(l)){l=l.substring(k.raw.length),i.push(k);continue}if(k=this.tokenizer.autolink(l)){l=l.substring(k.raw.length),i.push(k);continue}if(!this.state.inLink&&(k=this.tokenizer.url(l))){l=l.substring(k.raw.length),i.push(k);continue}let S=l;if((g=this.options.extensions)!=null&&g.startInline){let w=1/0;const A=l.slice(1);let M;this.options.extensions.startInline.forEach(L=>{M=L.call({lexer:this},A),typeof M=="number"&&M>=0&&(w=Math.min(w,M))}),w<1/0&&w>=0&&(S=l.substring(0,w+1))}if(k=this.tokenizer.inlineText(S)){l=l.substring(k.raw.length),k.raw.slice(-1)!=="_"&&(p=k.raw.slice(-1)),f=!0;const w=i.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=k.raw,w.text+=k.text):i.push(k);continue}if(l){const w="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(w);break}else throw new Error(w)}}return i}},Wi=class{constructor(s){Ge(this,"options");Ge(this,"parser");this.options=s||Qr}space(s){return""}code({text:s,lang:l,escaped:i}){var f;const u=(f=(l||"").match(At.notSpaceStart))==null?void 0:f[0],d=s.replace(At.endingNewline,"")+`
347
+ `;return u?'<pre><code class="language-'+Sn(u)+'">'+(i?d:Sn(d,!0))+`</code></pre>
348
+ `:"<pre><code>"+(i?d:Sn(d,!0))+`</code></pre>
349
+ `}blockquote({tokens:s}){return`<blockquote>
350
+ ${this.parser.parse(s)}</blockquote>
351
+ `}html({text:s}){return s}heading({tokens:s,depth:l}){return`<h${l}>${this.parser.parseInline(s)}</h${l}>
352
+ `}hr(s){return`<hr>
353
+ `}list(s){const l=s.ordered,i=s.start;let u="";for(let p=0;p<s.items.length;p++){const m=s.items[p];u+=this.listitem(m)}const d=l?"ol":"ul",f=l&&i!==1?' start="'+i+'"':"";return"<"+d+f+`>
354
+ `+u+"</"+d+`>
355
+ `}listitem(s){var i;let l="";if(s.task){const u=this.checkbox({checked:!!s.checked});s.loose?((i=s.tokens[0])==null?void 0:i.type)==="paragraph"?(s.tokens[0].text=u+" "+s.tokens[0].text,s.tokens[0].tokens&&s.tokens[0].tokens.length>0&&s.tokens[0].tokens[0].type==="text"&&(s.tokens[0].tokens[0].text=u+" "+Sn(s.tokens[0].tokens[0].text),s.tokens[0].tokens[0].escaped=!0)):s.tokens.unshift({type:"text",raw:u+" ",text:u+" ",escaped:!0}):l+=u+" "}return l+=this.parser.parse(s.tokens,!!s.loose),`<li>${l}</li>
356
+ `}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
357
+ `}table(s){let l="",i="";for(let d=0;d<s.header.length;d++)i+=this.tablecell(s.header[d]);l+=this.tablerow({text:i});let u="";for(let d=0;d<s.rows.length;d++){const f=s.rows[d];i="";for(let p=0;p<f.length;p++)i+=this.tablecell(f[p]);u+=this.tablerow({text:i})}return u&&(u=`<tbody>${u}</tbody>`),`<table>
358
+ <thead>
359
+ `+l+`</thead>
360
+ `+u+`</table>
361
+ `}tablerow({text:s}){return`<tr>
362
+ ${s}</tr>
363
+ `}tablecell(s){const l=this.parser.parseInline(s.tokens),i=s.header?"th":"td";return(s.align?`<${i} align="${s.align}">`:`<${i}>`)+l+`</${i}>
364
+ `}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Sn(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:l,tokens:i}){const u=this.parser.parseInline(i),d=af(s);if(d===null)return u;s=d;let f='<a href="'+s+'"';return l&&(f+=' title="'+Sn(l)+'"'),f+=">"+u+"</a>",f}image({href:s,title:l,text:i,tokens:u}){u&&(i=this.parser.parseInline(u,this.parser.textRenderer));const d=af(s);if(d===null)return Sn(i);s=d;let f=`<img src="${s}" alt="${i}"`;return l&&(f+=` title="${Sn(l)}"`),f+=">",f}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Sn(s.text)}},Su=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}},Un=class Za{constructor(l){Ge(this,"options");Ge(this,"renderer");Ge(this,"textRenderer");this.options=l||Qr,this.options.renderer=this.options.renderer||new Wi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Su}static parse(l,i){return new Za(i).parse(l)}static parseInline(l,i){return new Za(i).parseInline(l)}parse(l,i=!0){var d,f;let u="";for(let p=0;p<l.length;p++){const m=l[p];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[m.type]){const g=m,k=this.options.extensions.renderers[g.type].call({parser:this},g);if(k!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){u+=k||"";continue}}const y=m;switch(y.type){case"space":{u+=this.renderer.space(y);continue}case"hr":{u+=this.renderer.hr(y);continue}case"heading":{u+=this.renderer.heading(y);continue}case"code":{u+=this.renderer.code(y);continue}case"table":{u+=this.renderer.table(y);continue}case"blockquote":{u+=this.renderer.blockquote(y);continue}case"list":{u+=this.renderer.list(y);continue}case"html":{u+=this.renderer.html(y);continue}case"paragraph":{u+=this.renderer.paragraph(y);continue}case"text":{let g=y,k=this.renderer.text(g);for(;p+1<l.length&&l[p+1].type==="text";)g=l[++p],k+=`
365
+ `+this.renderer.text(g);i?u+=this.renderer.paragraph({type:"paragraph",raw:k,text:k,tokens:[{type:"text",raw:k,text:k,escaped:!0}]}):u+=k;continue}default:{const g='Token with "'+y.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return u}parseInline(l,i=this.renderer){var d,f;let u="";for(let p=0;p<l.length;p++){const m=l[p];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[m.type]){const 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)){u+=g||"";continue}}const y=m;switch(y.type){case"escape":{u+=i.text(y);break}case"html":{u+=i.html(y);break}case"link":{u+=i.link(y);break}case"image":{u+=i.image(y);break}case"strong":{u+=i.strong(y);break}case"em":{u+=i.em(y);break}case"codespan":{u+=i.codespan(y);break}case"br":{u+=i.br(y);break}case"del":{u+=i.del(y);break}case"text":{u+=i.text(y);break}default:{const g='Token with "'+y.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return u}},Ha,Fi=(Ha=class{constructor(s){Ge(this,"options");Ge(this,"block");this.options=s||Qr}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}provideLexer(){return this.block?Fn.lex:Fn.lexInline}provideParser(){return this.block?Un.parse:Un.parseInline}},Ge(Ha,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ha),gv=class{constructor(...s){Ge(this,"defaults",hu());Ge(this,"options",this.setOptions);Ge(this,"parse",this.parseMarkdown(!0));Ge(this,"parseInline",this.parseMarkdown(!1));Ge(this,"Parser",Un);Ge(this,"Renderer",Wi);Ge(this,"TextRenderer",Su);Ge(this,"Lexer",Fn);Ge(this,"Tokenizer",Hi);Ge(this,"Hooks",Fi);this.use(...s)}walkTokens(s,l){var u,d;let i=[];for(const f of s)switch(i=i.concat(l.call(this,f)),f.type){case"table":{const p=f;for(const m of p.header)i=i.concat(this.walkTokens(m.tokens,l));for(const m of p.rows)for(const y of m)i=i.concat(this.walkTokens(y.tokens,l));break}case"list":{const p=f;i=i.concat(this.walkTokens(p.items,l));break}default:{const p=f;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[p.type]?this.defaults.extensions.childTokens[p.type].forEach(m=>{const y=p[m].flat(1/0);i=i.concat(this.walkTokens(y,l))}):p.tokens&&(i=i.concat(this.walkTokens(p.tokens,l)))}}return i}use(...s){const l=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(i=>{const u={...i};if(u.async=this.defaults.async||u.async||!1,i.extensions&&(i.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const f=l.renderers[d.name];f?l.renderers[d.name]=function(...p){let m=d.renderer.apply(this,p);return m===!1&&(m=f.apply(this,p)),m}:l.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const f=l[d.level];f?f.unshift(d.tokenizer):l[d.level]=[d.tokenizer],d.start&&(d.level==="block"?l.startBlock?l.startBlock.push(d.start):l.startBlock=[d.start]:d.level==="inline"&&(l.startInline?l.startInline.push(d.start):l.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(l.childTokens[d.name]=d.childTokens)}),u.extensions=l),i.renderer){const d=this.defaults.renderer||new Wi(this.defaults);for(const f in i.renderer){if(!(f in d))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;const p=f,m=i.renderer[p],y=d[p];d[p]=(...g)=>{let k=m.apply(d,g);return k===!1&&(k=y.apply(d,g)),k||""}}u.renderer=d}if(i.tokenizer){const d=this.defaults.tokenizer||new Hi(this.defaults);for(const f in i.tokenizer){if(!(f in d))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;const p=f,m=i.tokenizer[p],y=d[p];d[p]=(...g)=>{let k=m.apply(d,g);return k===!1&&(k=y.apply(d,g)),k}}u.tokenizer=d}if(i.hooks){const d=this.defaults.hooks||new Fi;for(const f in i.hooks){if(!(f in d))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;const p=f,m=i.hooks[p],y=d[p];Fi.passThroughHooks.has(f)?d[p]=g=>{if(this.defaults.async)return Promise.resolve(m.call(d,g)).then(S=>y.call(d,S));const k=m.call(d,g);return y.call(d,k)}:d[p]=(...g)=>{let k=m.apply(d,g);return k===!1&&(k=y.apply(d,g)),k}}u.hooks=d}if(i.walkTokens){const d=this.defaults.walkTokens,f=i.walkTokens;u.walkTokens=function(p){let m=[];return m.push(f.call(this,p)),d&&(m=m.concat(d.call(this,p))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,l){return Fn.lex(s,l??this.defaults)}parser(s,l){return Un.parse(s,l??this.defaults)}parseMarkdown(s){return(i,u)=>{const d={...u},f={...this.defaults,...d},p=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&d.async===!1)return p(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 i>"u"||i===null)return p(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return p(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));f.hooks&&(f.hooks.options=f,f.hooks.block=s);const m=f.hooks?f.hooks.provideLexer():s?Fn.lex:Fn.lexInline,y=f.hooks?f.hooks.provideParser():s?Un.parse:Un.parseInline;if(f.async)return Promise.resolve(f.hooks?f.hooks.preprocess(i):i).then(g=>m(g,f)).then(g=>f.hooks?f.hooks.processAllTokens(g):g).then(g=>f.walkTokens?Promise.all(this.walkTokens(g,f.walkTokens)).then(()=>g):g).then(g=>y(g,f)).then(g=>f.hooks?f.hooks.postprocess(g):g).catch(p);try{f.hooks&&(i=f.hooks.preprocess(i));let g=m(i,f);f.hooks&&(g=f.hooks.processAllTokens(g)),f.walkTokens&&this.walkTokens(g,f.walkTokens);let k=y(g,f);return f.hooks&&(k=f.hooks.postprocess(k)),k}catch(g){return p(g)}}}onError(s,l){return i=>{if(i.message+=`
366
+ Please report this to https://github.com/markedjs/marked.`,s){const u="<p>An error occurred:</p><pre>"+Sn(i.message+"",!0)+"</pre>";return l?Promise.resolve(u):u}if(l)return Promise.reject(i);throw i}}},Gr=new gv;function Le(s,l){return Gr.parse(s,l)}Le.options=Le.setOptions=function(s){return Gr.setOptions(s),Le.defaults=Gr.defaults,lp(Le.defaults),Le};Le.getDefaults=hu;Le.defaults=Qr;Le.use=function(...s){return Gr.use(...s),Le.defaults=Gr.defaults,lp(Le.defaults),Le};Le.walkTokens=function(s,l){return Gr.walkTokens(s,l)};Le.parseInline=Gr.parseInline;Le.Parser=Un;Le.parser=Un.parse;Le.Renderer=Wi;Le.TextRenderer=Su;Le.Lexer=Fn;Le.lexer=Fn.lex;Le.Tokenizer=Hi;Le.Hooks=Fi;Le.parse=Le;Le.options;Le.setOptions;Le.use;Le.walkTokens;Le.parseInline;Un.parse;Fn.lex;/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function df(s,l){(l==null||l>s.length)&&(l=s.length);for(var i=0,u=Array(l);i<l;i++)u[i]=s[i];return u}function vv(s){if(Array.isArray(s))return s}function yv(s,l){var i=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(i!=null){var u,d,f,p,m=[],y=!0,g=!1;try{if(f=(i=i.call(s)).next,l!==0)for(;!(y=(u=f.call(i)).done)&&(m.push(u.value),m.length!==l);y=!0);}catch(k){g=!0,d=k}finally{try{if(!y&&i.return!=null&&(p=i.return(),Object(p)!==p))return}finally{if(g)throw d}}return m}}function xv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
367
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kv(s,l){return vv(s)||yv(s,l)||wv(s,l)||xv()}function wv(s,l){if(s){if(typeof s=="string")return df(s,l);var i={}.toString.call(s).slice(8,-1);return i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set"?Array.from(s):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?df(s,l):void 0}}const gp=Object.entries,ff=Object.setPrototypeOf,Sv=Object.isFrozen,Tv=Object.getPrototypeOf,_v=Object.getOwnPropertyDescriptor;let yt=Object.freeze,xt=Object.seal,Cs=Object.create,vp=typeof Reflect<"u"&&Reflect,Ja=vp.apply,eu=vp.construct;yt||(yt=function(l){return l});xt||(xt=function(l){return l});Ja||(Ja=function(l,i){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];return l.apply(i,d)});eu||(eu=function(l){for(var i=arguments.length,u=new Array(i>1?i-1:0),d=1;d<i;d++)u[d-1]=arguments[d];return new l(...u)});const Ns=it(Array.prototype.forEach),Nv=it(Array.prototype.lastIndexOf),pf=it(Array.prototype.pop),Es=it(Array.prototype.push),Ev=it(Array.prototype.splice),pr=Array.isArray,wl=it(String.prototype.toLowerCase),za=it(String.prototype.toString),hf=it(String.prototype.match),vl=it(String.prototype.replace),mf=it(String.prototype.indexOf),Cv=it(String.prototype.trim),jv=it(Number.prototype.toString),Rv=it(Boolean.prototype.toString),gf=typeof BigInt>"u"?null:it(BigInt.prototype.toString),vf=typeof Symbol>"u"?null:it(Symbol.prototype.toString),ht=it(Object.prototype.hasOwnProperty),yl=it(Object.prototype.toString),pt=it(RegExp.prototype.test),Wr=Av(TypeError);function it(s){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,u=new Array(i>1?i-1:0),d=1;d<i;d++)u[d-1]=arguments[d];return Ja(s,l,u)}}function Av(s){return function(){for(var l=arguments.length,i=new Array(l),u=0;u<l;u++)i[u]=arguments[u];return eu(s,i)}}function Ae(s,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wl;if(ff&&ff(s,null),!pr(l))return s;let u=l.length;for(;u--;){let d=l[u];if(typeof d=="string"){const f=i(d);f!==d&&(Sv(l)||(l[u]=f),d=f)}s[d]=!0}return s}function Lv(s){for(let l=0;l<s.length;l++)ht(s,l)||(s[l]=null);return s}function Nt(s){const l=Cs(null);for(const u of gp(s)){var i=kv(u,2);const d=i[0],f=i[1];ht(s,d)&&(pr(f)?l[d]=Lv(f):f&&typeof f=="object"&&f.constructor===Object?l[d]=Nt(f):l[d]=f)}return l}function Iv(s){switch(typeof s){case"string":return s;case"number":return jv(s);case"boolean":return Rv(s);case"bigint":return gf?gf(s):"0";case"symbol":return vf?vf(s):"Symbol()";case"undefined":return yl(s);case"function":case"object":{if(s===null)return yl(s);const l=s,i=cn(l,"toString");if(typeof i=="function"){const u=i(l);return typeof u=="string"?u:yl(u)}return yl(s)}default:return yl(s)}}function cn(s,l){for(;s!==null;){const u=_v(s,l);if(u){if(u.get)return it(u.get);if(typeof u.value=="function")return it(u.value)}s=Tv(s)}function i(){return null}return i}function bv(s){try{return pt(s,""),!0}catch{return!1}}const yf=yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Oa=yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),$a=yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Mv=yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Fa=yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Dv=yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xf=yt(["#text"]),kf=yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ua=yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),wf=yt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zi=yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Pv=xt(/{{[\w\W]*|^[\w\W]*}}/g),zv=xt(/<%[\w\W]*|^[\w\W]*%>/g),Ov=xt(/\${[\w\W]*/g),$v=xt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Fv=xt(/^aria-[\-\w]+$/),Sf=xt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Uv=xt(/^(?:\w+script|data):/i),Bv=xt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hv=xt(/^html$/i),Wv=xt(/^[a-z][.\w]*(-[.\w]+)+$/i),Tf=xt(/<[/\w!]/g),_f=xt(/<[/\w]/g),Vv=xt(/<\/no(script|embed|frames)/i),Gv=xt(/\/>/i),qt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qv=function(){return typeof window>"u"?null:window},Qv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let u=null;const d="data-tt-policy-suffix";i&&i.hasAttribute(d)&&(u=i.getAttribute(d));const f="dompurify"+(u?"#"+u:"");try{return l.createPolicy(f,{createHTML(p){return p},createScriptURL(p){return p}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},Nf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},dr=function(l,i,u,d){return ht(l,i)&&pr(l[i])?Ae(d.base?Nt(d.base):{},l[i],d.transform):u};function yp(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qv();const l=Q=>yp(Q);if(l.version="3.4.13",l.removed=[],!s||!s.document||s.document.nodeType!==qt.document||!s.Element)return l.isSupported=!1,l;let i=s.document;const u=i,d=u.currentScript;s.DocumentFragment;const f=s.HTMLTemplateElement,p=s.Node,m=s.Element,y=s.NodeFilter,g=s.NamedNodeMap;g===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const k=s.DOMParser,S=s.trustedTypes,w=m.prototype,A=cn(w,"cloneNode"),M=cn(w,"remove"),L=cn(w,"nextSibling"),E=cn(w,"childNodes"),$=cn(w,"parentNode"),H=cn(w,"shadowRoot"),J=cn(w,"attributes"),F=p&&p.prototype?cn(p.prototype,"nodeType"):null,q=p&&p.prototype?cn(p.prototype,"nodeName"):null,ae=p&&p.prototype?cn(p.prototype,"ownerDocument"):null;if(typeof f=="function"){const Q=i.createElement("template");Q.content&&Q.content.ownerDocument&&(i=Q.content.ownerDocument)}let se,le="",we,te=!1,he=0;const _e=function(){if(he>0)throw Wr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ce=function(v){_e(),he++;try{return se.createHTML(v)}finally{he--}},ce=function(v){_e(),he++;try{return se.createScriptURL(v)}finally{he--}},P=function(){return te||(we=Qv(S,d),te=!0),we},Z=i,ee=Z.implementation,z=Z.createNodeIterator,Y=Z.createDocumentFragment,V=Z.getElementsByTagName,N=u.importNode;let D=Nf();l.isSupported=typeof gp=="function"&&typeof $=="function"&&ee&&ee.createHTMLDocument!==void 0;const fe=Pv,ge=zv,Ne=Ov,Ee=$v,Re=Fv,Ie=Uv,Be=Bv,mt=Wv;let dn=Sf,Fe=null;const fn=Ae({},[...yf,...Oa,...$a,...Fa,...xf]);let Pe=null;const Hn=Ae({},[...kf,...Ua,...wf,...zi]);let We=Object.seal(Cs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ut=null,mr=null;const Lt=Object.seal(Cs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pn=!0,O=!0,me=!1,He=!0,Ve=!1,ot=!0,kt=!1,It=!1,nn=null,gr=null,_n=!1,Qt=!1,Kr=!1,vr=!1,As=!0,El=!1;const Yr="user-content-";let yr=!0,Wn=!1,hn={},bt=null;const mn=Ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Nn=null;const Ls=Ae({},["audio","video","img","source","image","track"]);let Xr=null;const Is=Ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xr="http://www.w3.org/1998/Math/MathML",kr="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let En=Mt,Cn=!1,wr=null;const Sr=Ae({},[xr,kr,Mt],za),Cl=yt(["mi","mo","mn","ms","mtext"]);let jn=Ae({},Cl);const Tr=yt(["annotation-xml"]);let Vn=Ae({},Tr);const bs=Ae({},["title","style","font","a","script"]);let _r=null;const Zi=["application/xhtml+xml","text/html"],Ji="text/html";let $e=null,Rn=null;const jl=i.createElement("form"),Rl=function(v){return v instanceof RegExp||v instanceof Function},Zr=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Rn&&Rn===v)return;(!v||typeof v!="object")&&(v={}),v=Nt(v),_r=Zi.indexOf(v.PARSER_MEDIA_TYPE)===-1?Ji:v.PARSER_MEDIA_TYPE,$e=_r==="application/xhtml+xml"?za:wl,Fe=dr(v,"ALLOWED_TAGS",fn,{transform:$e}),Pe=dr(v,"ALLOWED_ATTR",Hn,{transform:$e}),wr=dr(v,"ALLOWED_NAMESPACES",Sr,{transform:za}),Xr=dr(v,"ADD_URI_SAFE_ATTR",Is,{transform:$e,base:Is}),Nn=dr(v,"ADD_DATA_URI_TAGS",Ls,{transform:$e,base:Ls}),bt=dr(v,"FORBID_CONTENTS",mn,{transform:$e}),Ut=dr(v,"FORBID_TAGS",Nt({}),{transform:$e}),mr=dr(v,"FORBID_ATTR",Nt({}),{transform:$e}),hn=ht(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?Nt(v.USE_PROFILES):v.USE_PROFILES:!1,pn=v.ALLOW_ARIA_ATTR!==!1,O=v.ALLOW_DATA_ATTR!==!1,me=v.ALLOW_UNKNOWN_PROTOCOLS||!1,He=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=v.SAFE_FOR_TEMPLATES||!1,ot=v.SAFE_FOR_XML!==!1,kt=v.WHOLE_DOCUMENT||!1,Qt=v.RETURN_DOM||!1,Kr=v.RETURN_DOM_FRAGMENT||!1,vr=v.RETURN_TRUSTED_TYPE||!1,_n=v.FORCE_BODY||!1,As=v.SANITIZE_DOM!==!1,El=v.SANITIZE_NAMED_PROPS||!1,yr=v.KEEP_CONTENT!==!1,Wn=v.IN_PLACE||!1,dn=bv(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:Sf,En=typeof v.NAMESPACE=="string"?v.NAMESPACE:Mt,jn=ht(v,"MATHML_TEXT_INTEGRATION_POINTS")&&v.MATHML_TEXT_INTEGRATION_POINTS&&typeof v.MATHML_TEXT_INTEGRATION_POINTS=="object"?Nt(v.MATHML_TEXT_INTEGRATION_POINTS):Ae({},Cl),Vn=ht(v,"HTML_INTEGRATION_POINTS")&&v.HTML_INTEGRATION_POINTS&&typeof v.HTML_INTEGRATION_POINTS=="object"?Nt(v.HTML_INTEGRATION_POINTS):Ae({},Tr);const C=ht(v,"CUSTOM_ELEMENT_HANDLING")&&v.CUSTOM_ELEMENT_HANDLING&&typeof v.CUSTOM_ELEMENT_HANDLING=="object"?Nt(v.CUSTOM_ELEMENT_HANDLING):Cs(null);if(We=Cs(null),ht(C,"tagNameCheck")&&Rl(C.tagNameCheck)&&(We.tagNameCheck=C.tagNameCheck),ht(C,"attributeNameCheck")&&Rl(C.attributeNameCheck)&&(We.attributeNameCheck=C.attributeNameCheck),ht(C,"allowCustomizedBuiltInElements")&&typeof C.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=C.allowCustomizedBuiltInElements),xt(We),Ve&&(O=!1),Kr&&(Qt=!0),hn&&(Fe=Ae({},xf),Pe=Cs(null),hn.html===!0&&(Ae(Fe,yf),Ae(Pe,kf)),hn.svg===!0&&(Ae(Fe,Oa),Ae(Pe,Ua),Ae(Pe,zi)),hn.svgFilters===!0&&(Ae(Fe,$a),Ae(Pe,Ua),Ae(Pe,zi)),hn.mathMl===!0&&(Ae(Fe,Fa),Ae(Pe,wf),Ae(Pe,zi))),Lt.tagCheck=null,Lt.attributeCheck=null,ht(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?Lt.tagCheck=v.ADD_TAGS:pr(v.ADD_TAGS)&&(Fe===fn&&(Fe=Nt(Fe)),Ae(Fe,v.ADD_TAGS,$e))),ht(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?Lt.attributeCheck=v.ADD_ATTR:pr(v.ADD_ATTR)&&(Pe===Hn&&(Pe=Nt(Pe)),Ae(Pe,v.ADD_ATTR,$e))),ht(v,"ADD_URI_SAFE_ATTR")&&pr(v.ADD_URI_SAFE_ATTR)&&Ae(Xr,v.ADD_URI_SAFE_ATTR,$e),ht(v,"FORBID_CONTENTS")&&pr(v.FORBID_CONTENTS)&&(bt===mn&&(bt=Nt(bt)),Ae(bt,v.FORBID_CONTENTS,$e)),ht(v,"ADD_FORBID_CONTENTS")&&pr(v.ADD_FORBID_CONTENTS)&&(bt===mn&&(bt=Nt(bt)),Ae(bt,v.ADD_FORBID_CONTENTS,$e)),yr&&(Fe["#text"]=!0),kt&&Ae(Fe,["html","head","body"]),Fe.table&&(Ae(Fe,["tbody"]),delete Ut.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const U=se;se=v.TRUSTED_TYPES_POLICY;try{le=Ce("")}catch(oe){throw se=U,oe}}else v.TRUSTED_TYPES_POLICY===null?(se=void 0,le=""):(se===void 0&&(se=P()),se&&typeof le=="string"&&(le=Ce("")));yt&&yt(v),Rn=v},Ms=Ae({},[...Oa,...$a,...Mv]),Ds=Ae({},[...Fa,...Dv]),Al=function(v,C,U){return C.namespaceURI===Mt?v==="svg":C.namespaceURI===xr?v==="svg"&&(U==="annotation-xml"||jn[U]):!!Ms[v]},eo=function(v,C,U){return C.namespaceURI===Mt?v==="math":C.namespaceURI===kr?v==="math"&&Vn[U]:!!Ds[v]},to=function(v,C,U){return C.namespaceURI===kr&&!Vn[U]||C.namespaceURI===xr&&!jn[U]?!1:!Ds[v]&&(bs[v]||!Ms[v])},Xe=function(v){let C=$(v);(!C||!C.tagName)&&(C={namespaceURI:En,tagName:"template"});const U=wl(v.tagName),oe=wl(C.tagName);return wr[v.namespaceURI]?v.namespaceURI===kr?Al(U,C,oe):v.namespaceURI===xr?eo(U,C,oe):v.namespaceURI===Mt?to(U,C,oe):!!(_r==="application/xhtml+xml"&&wr[v.namespaceURI]):!1},gn=function(v){Es(l.removed,{element:v});try{$(v).removeChild(v)}catch{if(M(v),!$(v))throw Wr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Gn=function(v){Nr(v);const C=E(v);if(C){const oe=[];Ns(C,pe=>{Es(oe,pe)}),Ns(oe,pe=>{try{M(pe)}catch{}})}const U=J(v);if(U)for(let oe=U.length-1;oe>=0;--oe){const pe=U[oe],Te=pe&&pe.name;if(typeof Te=="string")try{v.removeAttribute(Te)}catch{}}},vn=function(v,C){try{Es(l.removed,{attribute:C.getAttributeNode(v),from:C})}catch{Es(l.removed,{attribute:null,from:C})}if(C.removeAttribute(v),v==="is")if(Qt||Kr)try{gn(C)}catch{}else try{C.setAttribute(v,"")}catch{}},Jr=function(v){const C=J(v);if(C)for(let U=C.length-1;U>=0;--U){const oe=C[U],pe=oe&&oe.name;if(!(typeof pe!="string"||Pe[$e(pe)]))try{v.removeAttribute(pe)}catch{}}},Nr=function(v){const C=[v];for(;C.length>0;){const U=C.pop();(F?F(U):U.nodeType)===qt.element&&Jr(U);const pe=E(U);if(pe)for(let Te=pe.length-1;Te>=0;--Te)C.push(pe[Te])}},Ll=function(v){if(!ot)return;const C=[v];for(;C.length>0;){const U=C.pop(),oe=F?F(U):U.nodeType;if(oe===qt.processingInstruction||oe===qt.comment&&pt(_f,U.data)){try{M(U)}catch{}continue}if(oe===qt.element){const Te=U,Me=$e(q?q(U):U.nodeName);try{Te.hasAttribute&&Te.hasAttribute("patchsrc")&&Te.removeAttribute("patchsrc"),Te.hasAttribute&&Te.hasAttribute("for")&&Me!=="label"&&Me!=="output"&&Te.removeAttribute("for")}catch{}}const pe=E(U);if(pe)for(let Te=pe.length-1;Te>=0;--Te)C.push(pe[Te])}},Er=function(v){let C=null,U=null;if(_n)v="<remove></remove>"+v;else{const Te=hf(v,/^[\r\n\t ]+/);U=Te&&Te[0]}_r==="application/xhtml+xml"&&En===Mt&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const oe=se?Ce(v):v;if(En===Mt)try{C=new k().parseFromString(oe,_r)}catch{}if(!C||!C.documentElement){C=ee.createDocument(En,"template",null);try{C.documentElement.innerHTML=Cn?le:oe}catch{}}const pe=C.body||C.documentElement;return v&&U&&pe.insertBefore(i.createTextNode(U),pe.childNodes[0]||null),En===Mt?V.call(C,kt?"html":"body")[0]:kt?C.documentElement:pe},Bt=function(v){const C=ae?ae(v):v.ownerDocument;return z.call(C||v,v,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},es=function(v){return v=vl(v,fe," "),v=vl(v,ge," "),v=vl(v,Ne," "),v},Et=function(v){var C;v.normalize();const U=ae?ae(v):v.ownerDocument,oe=z.call(U||v,v,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let pe=oe.nextNode();for(;pe;)pe.data=es(pe.data),pe=oe.nextNode();const Te=(C=v.querySelectorAll)===null||C===void 0?void 0:C.call(v,"template");Te&&Ns(Te,Me=>{qn(Me.content)&&Et(Me.content)})},ts=function(v){const C=q?q(v):null;return typeof C!="string"||$e(C)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==J(v)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==F(v)||v.childNodes!==E(v)},qn=function(v){if(!F||typeof v!="object"||v===null)return!1;try{return F(v)===qt.documentFragment}catch{return!1}},Cr=function(v){if(!F||typeof v!="object"||v===null)return!1;try{return typeof F(v)=="number"}catch{return!1}};function Ct(Q,v,C){Q.length!==0&&Ns(Q,U=>{U.call(l,v,C,Rn)})}const ns=function(v,C){return!!(ot&&v.hasChildNodes()&&!Cr(v.firstElementChild)&&pt(Tf,v.textContent)&&pt(Tf,v.innerHTML)||ot&&v.namespaceURI===Mt&&C==="style"&&Cr(v.firstElementChild)||v.nodeType===qt.processingInstruction||ot&&v.nodeType===qt.comment&&pt(_f,v.data))},jr=function(v,C,U){if(!Ut[C]&&zs(C)&&(We.tagNameCheck instanceof RegExp&&pt(We.tagNameCheck,C)||We.tagNameCheck instanceof Function&&We.tagNameCheck(C)))return!1;if(yr&&!bt[C]){const oe=$(v),pe=E(v);if(pe&&oe){const Te=pe.length;for(let Me=Te-1;Me>=0;--Me){const ze=v===U?A(pe[Me],!0):pe[Me];oe.insertBefore(ze,L(v))}}}return gn(v),!0},Rr=function(v,C,U,oe){return v.length===0?C:C===U||C===oe?Nt(C):C},Il=function(v,C){if(Ct(D.beforeSanitizeElements,v,null),v!==C&&$(v)===null)return Wn&&Nr(v),!0;if(ts(v))return gn(v),!0;const U=$e(q?q(v):v.nodeName);if(Fe=Rr(D.uponSanitizeElement,Fe,fn,nn),Ct(D.uponSanitizeElement,v,{tagName:U,allowedTags:Fe}),v!==C&&$(v)===null)return Wn&&Nr(v),!0;if(ns(v,U))return gn(v),!0;if(Ut[U]||!(Lt.tagCheck instanceof Function&&Lt.tagCheck(U))&&!Fe[U]){const pe=jr(v,U,C);return pe===!1&&Ct(D.afterSanitizeElements,v,null),pe}if((F?F(v):v.nodeType)===qt.element&&!Xe(v)||(U==="noscript"||U==="noembed"||U==="noframes")&&pt(Vv,v.innerHTML))return gn(v),!0;if(Ve&&v.nodeType===qt.text){const pe=es(v.textContent);v.textContent!==pe&&(Es(l.removed,{element:v.cloneNode()}),v.textContent=pe)}return Ct(D.afterSanitizeElements,v,null),!1},bl=function(v,C,U){if(mr[C]||ot&&C==="patchsrc"||ot&&C==="for"&&v!=="label"&&v!=="output"||As&&(C==="id"||C==="name")&&(U in i||U in jl))return!1;const oe=Pe[C]||Lt.attributeCheck instanceof Function&&Lt.attributeCheck(C,v);if(!(O&&pt(Ee,C))){if(!(pn&&pt(Re,C))){if(oe){if(!Xr[C]){if(!pt(dn,vl(U,Be,""))){if(!((C==="src"||C==="xlink:href"||C==="href")&&v!=="script"&&mf(U,"data:")===0&&Nn[v])){if(!(me&&!pt(Ie,vl(U,Be,"")))){if(U)return!1}}}}}else if(!(zs(v)&&(We.tagNameCheck instanceof RegExp&&pt(We.tagNameCheck,v)||We.tagNameCheck instanceof Function&&We.tagNameCheck(v))&&(We.attributeNameCheck instanceof RegExp&&pt(We.attributeNameCheck,C)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(C,v))||C==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&pt(We.tagNameCheck,U)||We.tagNameCheck instanceof Function&&We.tagNameCheck(U))))return!1}}return!0},Ps=Ae({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),zs=function(v){return!Ps[wl(v)]&&pt(mt,v)},Os=function(v,C,U,oe){if(se&&typeof S=="object"&&typeof S.getAttributeType=="function"&&!U)switch(S.getAttributeType(v,C)){case"TrustedHTML":return Ce(oe);case"TrustedScriptURL":return ce(oe)}return oe},Ar=function(v,C,U,oe){try{U?v.setAttributeNS(U,C,oe):v.setAttribute(C,oe),ts(v)?gn(v):pf(l.removed)}catch{vn(C,v)}},Ml=function(v){Ct(D.beforeSanitizeAttributes,v,null);const C=v.attributes;if(!C||ts(v))return;Pe=Rr(D.uponSanitizeAttribute,Pe,Hn,gr);const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let oe=C.length;const pe=$e(v.nodeName);for(;oe--;){const Te=C[oe],Me=Te.name,ze=Te.namespaceURI,Ze=Te.value,Je=$e(Me),An=Ze;let rt=Me==="value"?An:Cv(An);if(U.attrName=Je,U.attrValue=rt,U.keepAttr=!0,U.forceKeepAttr=void 0,Ct(D.uponSanitizeAttribute,v,U),rt=U.attrValue,El&&(Je==="id"||Je==="name")&&mf(rt,Yr)!==0&&(vn(Me,v),rt=Yr+rt),ot&&pt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,rt)){vn(Me,v);continue}if(Je==="attributename"&&hf(rt,"href")){vn(Me,v);continue}if(!U.forceKeepAttr){if(!U.keepAttr){vn(Me,v);continue}if(!He&&pt(Gv,rt)){vn(Me,v);continue}if(Ve&&(rt=es(rt)),!bl(pe,Je,rt)){vn(Me,v);continue}rt=Os(pe,Je,ze,rt),rt!==An&&Ar(v,Me,ze,rt)}}Ct(D.afterSanitizeAttributes,v,null)},Qn=function(v){let C=null;const U=Bt(v);for(Ct(D.beforeSanitizeShadowDOM,v,null);C=U.nextNode();)if(Ct(D.uponSanitizeShadowNode,C,null),Il(C,v),Ml(C),qn(C.content)&&Qn(C.content),(F?F(C):C.nodeType)===qt.element){const pe=H(C);qn(pe)&&(be(pe),Qn(pe))}Ct(D.afterSanitizeShadowDOM,v,null)},be=function(v){const C=[{node:v,shadow:null}];for(;C.length>0;){const U=C.pop();if(U.shadow){Qn(U.shadow);continue}const oe=U.node,Te=(F?F(oe):oe.nodeType)===qt.element,Me=E(oe);if(Me)for(let ze=Me.length-1;ze>=0;--ze)C.push({node:Me[ze],shadow:null});if(Te){const ze=q?q(oe):null;if(typeof ze=="string"&&$e(ze)==="template"){const Ze=oe.content;qn(Ze)&&C.push({node:Ze,shadow:null})}}if(Te){const ze=H(oe);qn(ze)&&C.push({node:null,shadow:ze},{node:ze,shadow:null})}}};return l.sanitize=function(Q){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,U=null,oe=null,pe=null;if(Cn=!Q,Cn&&(Q="<!-->"),typeof Q!="string"&&!Cr(Q)&&(Q=Iv(Q),typeof Q!="string"))throw Wr("dirty is not a string, aborting");if(!l.isSupported)return Q;It?(Fe=nn,Pe=gr):Zr(v),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(Fe=Nt(Fe)),D.uponSanitizeAttribute.length>0&&(Pe=Nt(Pe)),l.removed=[];const Te=Wn&&typeof Q!="string"&&Cr(Q);if(Te){Ll(Q);const Ze=q?q(Q):Q.nodeName;if(typeof Ze=="string"){const Je=$e(Ze);if(!Fe[Je]||Ut[Je])throw Gn(Q),Wr("root node is forbidden and cannot be sanitized in-place")}if(ts(Q))throw Gn(Q),Wr("root node is clobbered and cannot be sanitized in-place");try{be(Q)}catch(Je){throw Gn(Q),Je}}else if(Cr(Q))C=Er("<!---->"),U=C.ownerDocument.importNode(Q,!0),U.nodeType===qt.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?C=U:C.appendChild(U),be(U);else{if(!Qt&&!Ve&&!kt&&Q.indexOf("<")===-1)return se&&vr?Ce(Q):Q;if(C=Er(Q),!C)return Qt?null:vr?le:""}C&&_n&&gn(C.firstChild);const Me=Te?Q:C;try{const Ze=Bt(Me);for(;oe=Ze.nextNode();)Il(oe,Me),Ml(oe),qn(oe.content)&&Qn(oe.content)}catch(Ze){throw Te&&(Gn(Q),Ns(l.removed,Je=>{Je.element&&Nr(Je.element)})),Ze}if(Te)return Ns(l.removed,Ze=>{Ze.element&&Nr(Ze.element)}),Ve&&Et(Q),Q;if(Qt){if(Ve&&Et(C),Kr)for(pe=Y.call(C.ownerDocument);C.firstChild;)pe.appendChild(C.firstChild);else pe=C;return(Pe.shadowroot||Pe.shadowrootmode)&&(pe=N.call(u,pe,!0)),pe}let ze=kt?C.outerHTML:C.innerHTML;return kt&&Fe["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&pt(Hv,C.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+C.ownerDocument.doctype.name+`>
368
+ `+ze),Ve&&(ze=es(ze)),se&&vr?Ce(ze):ze},l.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zr(Q),It=!0,nn=Fe,gr=Pe},l.clearConfig=function(){Rn=null,It=!1,nn=null,gr=null,se=we,le=""},l.isValidAttribute=function(Q,v,C){Rn||Zr({});const U=$e(Q),oe=$e(v);return bl(U,oe,C)},l.addHook=function(Q,v){typeof v=="function"&&ht(D,Q)&&Es(D[Q],v)},l.removeHook=function(Q,v){if(ht(D,Q)){if(v!==void 0){const C=Nv(D[Q],v);return C===-1?void 0:Ev(D[Q],C,1)[0]}return pf(D[Q])}},l.removeHooks=function(Q){ht(D,Q)&&(D[Q]=[])},l.removeAllHooks=function(){D=Nf()},l}var Tu=yp();const Kv=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Ef(s){return Kv.has(s.type)}function Yv({items:s,runtimeType:l,turn:i,threads:u=[]}){const[d,f]=I.useState(!1);if(s.length===0)return null;const p=s.length;return a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>f(m=>!m),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(Ag,{size:12})}),a.jsxs("span",{className:"tool-calls-summary",children:[p," tool call",p>1?"s":""]}),a.jsx(du,{size:14,className:"tool-calls-chevron",style:{transform:d?"rotate(90deg)":"none"}})]}),d&&a.jsx("div",{className:"tool-calls-body",children:s.map(m=>a.jsx($n,{item:m,runtimeType:l,turn:i,threads:u},m.id))})]})}Le.setOptions({breaks:!0,gfm:!0});function Xv(s){const l=Le.parse(s);return Tu.sanitize(l)}function Cf(s,l){var d;const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT);let u=0;for(;i.nextNode();){const f=i.currentNode,p=((d=f.textContent)==null?void 0:d.length)??0;if(u+p>l)return{node:f,offset:l-u};u+=p}return null}function Zv(s,l){s.querySelectorAll("mark[data-thread-id]").forEach(i=>{const u=i.parentNode;if(!u)return;const d=document.createTextNode(i.textContent||"");u.replaceChild(d,i),u.normalize()});for(const i of l){const u=Cf(s,i.start_offset),d=Cf(s,i.end_offset);if(!u||!d)continue;const f=document.createRange();f.setStart(u.node,u.offset),f.setEnd(d.node,d.offset);const p=document.createElement("mark");p.setAttribute("data-thread-id",i.id),i.status==="resolved"&&p.classList.add("thread-mark-resolved");try{f.surroundContents(p)}catch{const m=f.extractContents();p.appendChild(m),f.insertNode(p)}}}function Jv(s){const l=window.getSelection();if(!l||l.rangeCount===0)return null;const i=l.getRangeAt(0);if(i.collapsed||!s.contains(i.commonAncestorContainer))return null;const u=document.createRange();u.setStart(s,0),u.setEnd(i.startContainer,i.startOffset);const d=u.toString().length,f=i.toString();return{start:d,end:d+f.length,text:f}}function jf({itemId:s,turnId:l,sessionId:i,content:u,threads:d}){const f=I.useRef(null),p=I.useRef(null),m=I.useRef(null),y=I.useRef(""),g=I.useRef(0),[k,S]=I.useState(!1),[w,A]=I.useState({x:0,y:0}),[M,L]=I.useState(!1),[E,$]=I.useState({x:0,y:0}),[H,J]=I.useState(""),[F,q]=I.useState(null),{createThread:ae,switchRightTab:se}=X(),le=I.useCallback(()=>{var Z;if(!F)return;const P=`
369
+ \`\`\`QUOTE
370
+ ${F.text}
371
+ \`\`\`
372
+
373
+ `;X.setState({quotedText:P}),S(!1),q(null),(Z=window.getSelection())==null||Z.removeAllRanges()},[F]),we=d.filter(P=>P.item_id===s);I.useEffect(()=>{f.current&&Zv(f.current,we)}),I.useEffect(()=>{y.current=H},[H]),I.useEffect(()=>{function P(Z){p.current&&!p.current.contains(Z.target)&&(S(!1),y.current.trim()||L(!1))}return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);const te=I.useCallback(()=>{S(!1),y.current.trim()||L(!1)},[]),he=I.useCallback(()=>{const P=f.current;if(!P)return;const Z=Jv(P);if(Z&&Z.text.trim().length>0){const ee=window.getSelection();if(ee&&ee.rangeCount>0&&ee.anchorNode&&ee.focusNode){const Y=ee.getRangeAt(0).getBoundingClientRect(),V=28,N=6,D=170;let fe=!1;try{const Ee=document.createRange();Ee.setStart(ee.focusNode,ee.focusOffset),Ee.setEnd(ee.focusNode,ee.focusOffset);const Re=document.createRange();Re.setStart(ee.anchorNode,ee.anchorOffset),Re.setEnd(ee.anchorNode,ee.anchorOffset),fe=Re.compareBoundaryPoints(Range.START_TO_START,Ee)>0}catch{fe=!1}let ge=Y.top-V-N;ge<8&&(ge=Y.bottom+N);let Ne=fe?Y.left-D:Y.right;Ne=Math.max(8,Math.min(Ne,window.innerWidth-D-8)),A({x:Ne,y:ge}),S(!0),q(Z)}}else S(!1)},[]);I.useEffect(()=>{function P(Z){const ee=Z.target;ee&&(ee.closest(".selection-actions")||ee.closest(".thread-create-popover"))||he()}return document.addEventListener("mouseup",P),()=>document.removeEventListener("mouseup",P)},[he]);const _e=I.useCallback(()=>{S(!1),L(!0),$({x:w.x,y:w.y})},[w]);I.useLayoutEffect(()=>{if(!M)return;const P=m.current;if(!P)return;const Z=P.offsetWidth,ee=P.offsetHeight,z=8;let Y=w.x,V=w.y;Y-Z<z&&(Y=Z+z),Y>window.innerWidth-z&&(Y=window.innerWidth-z),V<z&&(V=z),V+ee>window.innerHeight-z&&(V=window.innerHeight-ee-z),$({x:Y,y:V})},[M,w]);const Ce=I.useCallback(async()=>{var P;!F||!H.trim()||(await ae(i,{itemId:s,turnId:l,startOffset:F.start,endOffset:F.end,selectedText:F.text,message:H.trim()}),J(""),L(!1),q(null),(P=window.getSelection())==null||P.removeAllRanges(),se("threads"))},[F,H,ae,i,s,l,se]),ce=I.useCallback(P=>{const Z=P.target;if(Z.tagName==="MARK"&&Z.hasAttribute("data-thread-id")){P.preventDefault(),se("threads");const ee=Z.getAttribute("data-thread-id");setTimeout(()=>{const z=document.getElementById(`thread-${ee}`);z&&(z.scrollIntoView({behavior:"smooth",block:"center"}),z.classList.add("thread-card-highlighted"),setTimeout(()=>z.classList.remove("thread-card-highlighted"),1500))},100)}},[se]);return a.jsxs("div",{style:{position:"relative"},ref:p,children:[a.jsx("div",{ref:f,dangerouslySetInnerHTML:{__html:Xv(u||"…")},onMouseDown:te,onClick:ce}),k&&!M&&a.jsxs("div",{className:"selection-actions",style:{left:w.x,top:w.y},children:[a.jsxs("button",{className:"discuss-button",onClick:_e,title:"Start a discussion about this text",children:[a.jsx(yg,{size:14}),a.jsx("span",{children:"Discuss"})]}),a.jsxs("button",{className:"discuss-button",onClick:le,title:"Quote this text in your message",children:[a.jsx(np,{size:14}),a.jsx("span",{children:"Quote"})]})]}),M&&a.jsxs("div",{ref:m,className:"thread-create-popover",style:{left:E.x,top:E.y},children:[a.jsxs("div",{className:"thread-create-header",children:[a.jsxs("span",{className:"thread-create-quote",children:['"',F==null?void 0:F.text.slice(0,80),F&&F.text.length>80?"…":"",'"']}),a.jsx("button",{className:"thread-create-close",onClick:()=>{L(!1),q(null)},children:a.jsx(Bn,{size:14})})]}),a.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:H,onChange:P=>J(P.target.value),autoFocus:!0,rows:2,onKeyDown:P=>{if(P.key==="Enter"&&(P.metaKey||P.ctrlKey)&&(P.preventDefault(),Ce()),P.key==="Escape")if(y.current.trim()){const Z=Date.now();g.current&&Z-g.current<400?(g.current=0,L(!1),q(null)):g.current=Z}else L(!1),q(null)}}),a.jsxs("div",{className:"thread-create-footer",children:[a.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),a.jsxs("button",{className:"thread-create-send",onClick:Ce,disabled:!H.trim(),children:[a.jsx(Qi,{size:13}),a.jsx("span",{children:"Send"})]})]})]})]})}const Vi=new Map,xp=new Set,tu=new Set,Rf=new Map;function kp(){tu.forEach(s=>s())}function wp(s,l){return`${s}:${l}`}function ey(s,l,i,u,d){var y;const f=wp(l,i),p=Vi.get(s)??new Map,m=new Map(p);((y=m.get(f))==null?void 0:y.answer)===d?m.delete(f):m.set(f,{itemIndex:l,groupIndex:i,question:u,answer:d}),Vi.set(s,m),kp()}function ty(s){Vi.delete(s),kp()}function ny(s){xp.add(s),ty(s)}function ry(s){const l=I.useCallback(i=>(tu.add(i),()=>{tu.delete(i)}),[]);return I.useSyncExternalStore(l,()=>Vi.get(s)??Rf,()=>Rf)}function sy(s){return[...s].sort((l,i)=>l.itemIndex-i.itemIndex||l.groupIndex-i.groupIndex).map(l=>`> ${l.question}
374
+ ${l.answer}`).join(`
375
+
376
+ `)}function Af({item:s,turn:l}){var A;const i=s.data??{},u=I.useMemo(()=>Array.isArray(i.groups)?i.groups.filter(M=>!!M&&Array.isArray(M.selections)&&M.selections.length>0):[],[i.groups]),d=ry(l.id),f=X(M=>l.session_id?M.sessionDetails[l.session_id]:null),p=X(M=>M.activeSessionId),m=l.items.findIndex(M=>M.id===s.id),y=f?((A=f.turns[f.turns.length-1])==null?void 0:A.id)===l.id:!0,g=xp.has(l.id),k=g||(f==null?void 0:f.is_running)===1||!y||l.session_id!==p,S=(M,L,E)=>{k||ey(l.id,m,M,L,E)},w=()=>{const M=[...d.values()];if(M.length===0)return;const L=sy(M);ny(l.id),X.getState().submitPrompt(L)};return a.jsxs("div",{className:"render-content ask-user-card",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(lg,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Question"}),g&&a.jsx("span",{className:"turn-header-meta",children:"answered"})]}),u.length>0?a.jsxs("div",{className:"ask-user-groups",children:[u.map((M,L)=>a.jsxs("div",{className:"ask-user-group",children:[M.question&&a.jsx("div",{className:"ask-user-question",children:M.question}),a.jsx("div",{className:"ask-user-options",children:M.selections.map(E=>{var H;const $=((H=d.get(wp(m,L)))==null?void 0:H.answer)===E;return a.jsx("button",{type:"button",className:`ask-user-option ${$?"selected":""}`,disabled:k,onClick:()=>S(L,M.question,E),children:E},E)})})]},L)),k?g&&a.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):a.jsxs("button",{type:"button",className:"ask-user-send",disabled:d.size===0,onClick:w,children:[a.jsx(Qi,{size:12}),"Send"]})]}):i.question?a.jsx("p",{className:"user-message",children:i.question}):a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}Le.setOptions({breaks:!0,gfm:!0});function ly({attachments:s}){const[l,i]=I.useState(null);return I.useEffect(()=>{if(!l)return;function u(d){d.key==="Escape"&&i(null)}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l]),!Array.isArray(s)||s.length===0?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"attachment-pills",children:s.map((u,d)=>{const f=u.media_type.startsWith("image/"),p=`data:${u.media_type};base64,${u.data}`;return a.jsxs("span",{className:"attachment-pill",title:u.name,onClick:f?()=>i(p):void 0,style:f?{cursor:"pointer"}:void 0,children:[f?a.jsx("img",{src:p,alt:u.name,className:"attachment-pill-thumb"}):a.jsx(tp,{size:12,className:"attachment-pill-icon"}),a.jsx("span",{className:"attachment-pill-name",children:u.name})]},d)})}),l&&a.jsx("div",{className:"image-preview-modal",onClick:()=>i(null),children:a.jsxs("div",{className:"image-preview-content",onClick:u=>u.stopPropagation(),children:[a.jsx("img",{src:l,alt:"preview"}),a.jsx("button",{className:"image-preview-close",onClick:()=>i(null),children:a.jsx(Bn,{size:20})})]})})]})}function iy(s){const l=Le.parse(s);return Tu.sanitize(l)}function Lf(s){var l;return(l=s.data)!=null&&l.text?s.data.text:""}function oy(s){const l=s.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return l?l[1]:s}function ay({html:s}){const[l,i]=I.useState(480);return a.jsx("iframe",{sandbox:"allow-scripts",srcDoc:s,title:"HTML content",onLoad:u=>{try{const d=u.currentTarget.contentDocument;d!=null&&d.documentElement&&i(Math.max(240,d.documentElement.scrollHeight))}catch{}},style:{width:"100%",height:`${l}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const If=1e4;function uy({item:s,runtimeType:l,turn:i,threads:u}){var m,y,g,k,S,w,A,M;const d=s.status==="in_progress",[f,p]=I.useState(!1);switch(s.type){case"agent_message":{const{iconClass:L,iconText:E}=Qa(l??"codex");return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${L}`,children:E}),a.jsx("span",{className:"turn-header-title",children:"Agent"}),d&&a.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),a.jsx(jf,{itemId:s.id,turnId:i.id,sessionId:i.session_id,content:Lf(s)||"…",threads:u,runtimeType:l})]})}case"reasoning":return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(rg,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),a.jsx("div",{dangerouslySetInnerHTML:{__html:iy(Lf(s))}})]});case"command_execution":{const L=s.data||{},E=oy(L.command||""),$=L.aggregated_output||"",H=L.exit_code,J=d?"running…":H!==null?`exit ${H}`:"",F=$.length>If,q=F&&!f?$.slice(0,If)+`
377
+ … (truncated, click to expand)`:$;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(sp,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Command"}),J&&a.jsx("span",{className:"turn-header-meta",children:J})]}),a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:E})}),$&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:q})}),F&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>p(ae=>!ae),children:f?"Show less":`Show full output (${($.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const L=(m=s.data)==null?void 0:m.changes,E=Array.isArray(L)?L:[],$=`${E.length} file${E.length!==1?"s":""}`;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(ug,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"File Changes"}),a.jsx("span",{className:"turn-header-meta",children:$})]}),a.jsx("div",{className:"file-change-list",children:E.map((H,J)=>{const F=H.kind==="add"?"A":H.kind==="delete"?"D":"M",q=H.kind==="add"?"fc-add":H.kind==="delete"?"fc-del":"fc-mod";return a.jsxs("div",{className:"file-change",children:[a.jsx("span",{className:`fc-status ${q}`,children:F}),a.jsx("span",{className:"fc-name",children:H.path})]},J)})})]})}case"mcp_tool_call":{const L=s.data||{},E=L.tool||"mcp";if(E==="Agent"){const le=L.arguments,we=(le==null?void 0:le.description)||(le==null?void 0:le.prompt)||"Subagent",te=s.status==="failed",he=d?"running…":te?"failed":"done";return a.jsxs("div",{className:"agent-call-card",children:[a.jsx("span",{className:"agent-call-icon",children:a.jsx(Ka,{size:14})}),a.jsx("span",{className:"agent-call-desc",children:we}),a.jsx("span",{className:`agent-call-status ${d?"running":te?"failed":"done"}`,children:he})]})}const $=L.server||"",H=L.arguments,J=L.result,F=L.error,q=s.status==="failed"||!!F,ae=d?"running…":q?"failed":"done",se=((y=J==null?void 0:J.content)==null?void 0:y.filter(le=>le.type==="text").map(le=>le.text))??[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(_g,{size:14})}),a.jsxs("span",{className:"turn-header-title",children:["MCP: ",E]}),$&&a.jsx("span",{className:"turn-header-meta",children:$}),a.jsx("span",{className:"turn-header-meta",style:q?{color:"var(--red)"}:void 0,children:ae})]}),H&&Object.keys(H).length>0&&a.jsx("div",{className:"mcp-args",children:Object.entries(H).map(([le,we])=>a.jsxs("div",{className:"mcp-arg",children:[a.jsx("span",{className:"mcp-arg-key",children:le}),le==="code"?a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:String(we)})}):a.jsx("span",{className:"mcp-arg-value",children:typeof we=="string"?we:JSON.stringify(we,null,2)})]},le))}),se.length>0&&se.map((le,we)=>a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:le})},we)),F&&a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:F})})]})}case"web_search":{const L=((g=s.data)==null?void 0:g.query)||"";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(Eg,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),a.jsx("p",{className:"user-message",children:L})]})}case"todo_list":{const L=((k=s.data)==null?void 0:k.items)||[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(mg,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),a.jsx("ul",{className:"todo-list",children:L.map((E,$)=>a.jsxs("li",{className:E.completed?"todo-done":"todo-pending",children:[E.completed?a.jsx(Vr,{size:14}):a.jsx(Ki,{size:14})," ",E.text]},$))})]})}case"ask_user":return a.jsx(Af,{item:s,turn:i});case"final_result":{const L=s.data??{},E=L.text||"",$=L.html||null,H=Array.isArray(L.groups)?L.groups.filter(q=>!!q&&Array.isArray(q.selections)&&q.selections.length>0):[],{iconClass:J,iconText:F}=Qa(l??"codex");return a.jsxs(a.Fragment,{children:[(E||$)&&a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${J}`,children:F}),a.jsx("span",{className:"turn-header-title",children:"Agent"})]}),E&&a.jsx(jf,{itemId:s.id,turnId:i.id,sessionId:i.session_id,content:E,threads:u,runtimeType:l}),$&&a.jsx(ay,{html:$})]}),H.length>0&&a.jsx(Af,{item:s,turn:i})]})}case"background_task":{const L=s.data||{},E=L.task_type||"unknown",$=L.subagent_type||null,H=L.description||"",J=L.status||"running",F=L.last_tool_name||null,q=L.token_count||null,ae=E==="local_agent",se=E==="local_bash",le=ae?Ka:se?rp:ep,we=ae?`Subagent${$?`: ${$}`:""}`:se?"Monitor":"Background Task",te=J==="running"?"running…":J==="completed"?"done":J==="failed"?"failed":J==="stopped"?"stopped":J,he=s.status==="failed"||J==="failed";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(le,{size:14})}),a.jsx("span",{className:"turn-header-title",children:we}),a.jsx("span",{className:"turn-header-meta",style:he?{color:"var(--red)"}:void 0,children:te})]}),H&&a.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:H}),F&&d&&a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",F,q!=null&&` · ${q.toLocaleString()} tokens`]}),a.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const L=((S=s.data)==null?void 0:S.trigger)??"auto",E=((w=s.data)==null?void 0:w.pre_tokens)??0,$=((A=s.data)==null?void 0:A.post_tokens)??0,H=E>0?Math.round((1-$/E)*100):0,J=L==="manual"?"Context compacted (/compact)":"Context auto-compacted";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(kg,{size:14})}),a.jsx("span",{className:"turn-header-title",children:J})]}),a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[E.toLocaleString()," → ",$.toLocaleString()," tokens (",H,"% reduction)"]})]})}case"error":{const L=((M=s.data)==null?void 0:M.message)||"Unknown error";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:a.jsx(fu,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Error"})]}),a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:L})})]})}default:return null}}const $n=I.memo(uy);function cy({turn:s,runtimeType:l,threads:i=[]}){const[u,d]=I.useState(!1);I.useEffect(()=>{const E=s.items.some($=>$.type==="background_task"&&$.status==="in_progress");s.status==="running"||s.status==="pending"?d(!0):s.status==="completed"&&!E&&d(!1)},[s.status,s.items]);let f=-1;for(let E=s.items.length-1;E>=0;E--)if(s.items[E].type==="agent_message"){f=E;break}const p=f>=0,m=p?s.items.slice(0,f):s.items,y=s.items.some(E=>E.type==="final_result"||E.type==="ask_user"),g=!p&&s.status==="completed"&&s.agent_response&&!y?{id:`response-${s.id}`,turn_id:s.id,external_item_id:`response-${s.id}`,type:"agent_message",data:{text:s.agent_response},status:"completed",created_at:s.created_at,updated_at:s.updated_at}:null,S=m.filter(E=>{var $;return!(E.type==="reasoning"&&(!(($=E.data)!=null&&$.text)||E.data.text===""))}).filter(E=>!(E.type==="background_task"||E.type==="ask_user"||E.type==="final_result")),w=[];let A=null;for(const E of S)E.type==="agent_message"?(A&&w.push(A),A={agentMessage:E,toolItems:[],otherItems:[]}):(A||(A={agentMessage:null,toolItems:[],otherItems:[]}),Ef(E)?A.toolItems.push(E):A.otherItems.push(E));A&&w.push(A);const M=S.filter(E=>Ef(E)).length,L=M>0||S.length>0&&(s.status==="running"||s.status==="pending");return a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:s.user_prompt}),Array.isArray(s.attachments)&&s.attachments.length>0&&a.jsx(ly,{attachments:s.attachments})]}),L&&a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>d(E=>!E),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(hg,{size:12})}),a.jsx("span",{className:"tool-calls-summary",children:M>0?`${M} tool call${M>1?"s":""}`:"thinking…"}),a.jsx(du,{size:14,className:"tool-calls-chevron",style:{transform:u?"rotate(90deg)":"none"}})]}),u&&a.jsx("div",{className:"tool-calls-body",children:w.map((E,$)=>a.jsxs("div",{className:"intermediate-segment",children:[E.agentMessage&&a.jsx($n,{item:E.agentMessage,runtimeType:l,turn:s,threads:i}),E.otherItems.map(H=>a.jsx($n,{item:H,runtimeType:l,turn:s,threads:i},H.id)),E.toolItems.length>0&&a.jsx(Yv,{items:E.toolItems,runtimeType:l,turn:s,threads:i})]},$))})]}),s.items.filter(E=>E.type==="background_task").map(E=>a.jsx($n,{item:E,runtimeType:l,turn:s,threads:i},`task-${E.id}`)),p&&a.jsx($n,{item:s.items[f],runtimeType:l,turn:s,threads:i},s.items[f].id),g&&a.jsx($n,{item:g,runtimeType:l,turn:s,threads:i},g.id),p&&s.items.slice(f+1).filter(E=>E.type!=="ask_user"&&E.type!=="background_task"&&E.type!=="final_result").map(E=>a.jsx($n,{item:E,runtimeType:l,turn:s,threads:i},E.id)),s.items.filter(E=>E.type==="final_result").map(E=>a.jsx($n,{item:E,runtimeType:l,turn:s,threads:i},`final-${E.id}`)),s.items.filter(E=>E.type==="ask_user").map(E=>a.jsx($n,{item:E,runtimeType:l,turn:s,threads:i},`ask-${E.id}`)),s.items.length===0&&!s.error&&(s.status==="pending"||s.status==="running")&&a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:s.status==="running"?"Agent is thinking…":"Waiting to start…"})}),s.error&&a.jsx("div",{className:"render-content",children:a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:s.error})})})]})}const dy=I.memo(cy);function Sp(s,l="session",i=0){const u=[];if(l==="session")s.forEach((f,p)=>bf(f,p,u));else{const f=s[i];f&&bf(f,i,u)}const d=new Map;for(const f of u)d.set(f.path,f);return Array.from(d.values())}function bf(s,l,i){var u;for(const d of s.items)if(d.type==="file_change"&&((u=d.data)!=null&&u.changes)){const f=d.data.changes;for(const p of f)i.push({path:p.path,kind:p.kind,turnIdx:l})}}function fy(){const{activeSessionId:s,sessionDetails:l,activeTurnIndex:i,activeRightTab:u,changesScope:d,submittingPrompt:f,loading:p,selectedChangePath:m,setSelectedChangePath:y}=X(),g=s?l[s]:null,k=(g==null?void 0:g.turns)??[],S=I.useRef(null);if(I.useEffect(()=>{S.current&&(S.current.scrollTop=S.current.scrollHeight)},[s,k.length]),I.useEffect(()=>{if(!m||u!=="changes")return;const w=setTimeout(()=>{const A=m.replace(/[^a-zA-Z0-9]/g,"-"),M=document.getElementById(`diff-${A}`);M&&(M.scrollIntoView({behavior:"smooth",block:"start"}),M.classList.add("diff-highlight"),setTimeout(()=>M.classList.remove("diff-highlight"),1500)),y(null)},50);return()=>clearTimeout(w)},[m,u,y]),u==="changes"){if(!g)return a.jsx("div",{className:"render-scroll",children:a.jsx("div",{className:"empty-state",children:"No session selected"})});const w=Sp(k,d,i);return w.length===0?a.jsx("div",{className:"render-scroll",children:a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):a.jsx("div",{className:"render-scroll",ref:S,children:a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{style:{marginBottom:"20px"},children:[a.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"var(--text)"},children:d==="session"?"All Session Changes":"Current Turn Changes"}),a.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px"},children:[w.length," file",w.length>1?"s":""]})]}),w.map(A=>{const M=A.path.split("/").pop()||A.path,L=A.path.replace("/"+M,""),E=A.kind==="add"?"Added":A.kind==="delete"?"Deleted":"Modified",$=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod",H=A.kind==="add"?"A":A.kind==="delete"?"D":"M",J=A.path.replace(/[^a-zA-Z0-9]/g,"-");return a.jsxs("div",{children:[a.jsxs("div",{className:"diff-file-header",id:`diff-${J}`,children:[a.jsx("span",{className:`diff-file-status ${$}`,children:H}),a.jsxs("span",{className:"diff-file-name",children:[L&&a.jsxs("span",{style:{color:"var(--text-muted)"},children:[L,"/"]}),M]}),a.jsx("span",{className:"diff-file-stats",children:a.jsx("span",{className:`diff-file-badge ${$}`,children:E})})]}),a.jsx("p",{style:{color:"var(--text-muted)",fontSize:"12px",fontStyle:"italic",padding:"8px 16px"},children:"Diff content not available (Codex SDK limitation)."})]},A.path)})]})})}return p&&!g?a.jsx("div",{className:"render-scroll",children:a.jsxs("div",{className:"skeleton-bars",children:[a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"})]})}):g?a.jsxs("div",{className:"render-scroll",ref:S,children:[f&&a.jsx("div",{className:"turn-block",children:a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:f})]}),a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),k.length===0&&!f&&a.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),k.filter(w=>!w.thread_id).map((w,A)=>a.jsx("div",{id:`turn-${A}`,className:"turn-block",children:a.jsx(dy,{turn:w,runtimeType:g.runtime_type,threads:g.threads??[]})},w.id))]}):a.jsx("div",{className:"render-scroll",children:a.jsx("div",{className:"empty-state",children:"No session selected"})})}const py=I.memo(fy),hy=[{id:"model",label:"/model",hint:"Change model",capability:"dynamicModels"},{id:"sandbox",label:"/sandbox",hint:"Sandbox mode",capability:"sandbox",subPopup:"sandbox"},{id:"websearch",label:"/websearch",hint:"Web search mode",capability:"webSearch",subPopup:"websearch"},{id:"network",label:"/network",hint:"Network access",capability:"networkAccess",subPopup:"network"},{id:"skills",label:"/skills",hint:"Browse skills",capability:"skills"},{id:"plugins",label:"/plugins",hint:"Browse plugins",capability:"plugins"},{id:"mcp",label:"/mcp",hint:"Browse MCP servers",capability:"mcpServers"}];function my(s){return s.map(l=>({id:l.name,label:`/${l.name}`,hint:l.description,capability:null,insertAsText:!0}))}function gy(s,l,i=[]){const u=[...hy,...my(i)],d=new Set;return u.filter(f=>!(d.has(f.label)||(d.add(f.label),f.capability&&!l[f.capability])||s&&!f.label.toLowerCase().includes(s.toLowerCase())))}function vy({commands:s,selectedIndex:l,onSelect:i,onHover:u}){return a.jsxs("div",{className:"slash-popup",children:[a.jsx("div",{className:"slash-popup-header",children:"Commands"}),s.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),s.map((d,f)=>a.jsxs("div",{className:`slash-popup-item ${f===l?"selected":""}`,onMouseEnter:()=>u(f),onClick:()=>i(d),children:[a.jsx("span",{className:"slash-popup-label",children:d.label}),a.jsx("span",{className:"slash-popup-hint",children:d.hint})]},d.id))]})}function Ba({title:s,options:l,currentValue:i,onSelect:u,onClose:d}){return a.jsxs("div",{className:"slash-popup",children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:d,children:"← Back"}),a.jsx("span",{children:s})]}),l.map(f=>a.jsxs("div",{className:`slash-popup-item ${f.value===i?"selected":""}`,onClick:()=>u(f.value),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:f.label}),f.description&&a.jsx("span",{className:"slash-popup-hint",children:f.description})]}),f.value===i&&a.jsx("span",{className:"slash-popup-check",children:"✓"})]},f.value))]})}function yy(s){return qr("/skills")}function xy({filter:s,onSelect:l,onClose:i}){const[u,d]=I.useState([]),[f,p]=I.useState(!0),[m,y]=I.useState(0),g=I.useRef(null);I.useEffect(()=>{yy().then(d).catch(()=>d([])).finally(()=>p(!1))},[]);const k=u.filter(S=>S.name.toLowerCase().includes(s.toLowerCase())||S.description.toLowerCase().includes(s.toLowerCase()));return I.useEffect(()=>{y(0)},[s]),I.useEffect(()=>{function S(w){w.key==="ArrowDown"?(w.preventDefault(),y(A=>Math.min(A+1,k.length-1))):w.key==="ArrowUp"?(w.preventDefault(),y(A=>Math.max(A-1,0))):w.key==="Enter"?(w.preventDefault(),k[m]&&l(k[m])):w.key==="Escape"&&(w.preventDefault(),i())}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[k,m,l,i]),a.jsxs("div",{className:"slash-popup",ref:g,children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:i,children:"← Back"}),a.jsx("span",{children:"Skills"})]}),f&&a.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!f&&k.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),k.map((S,w)=>a.jsxs("div",{className:`slash-popup-item ${w===m?"selected":""}`,onMouseEnter:()=>y(w),onClick:()=>l(S),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:S.name}),S.description&&a.jsx("span",{className:"slash-popup-hint",children:S.description})]}),!!S.metadata.isSystem&&a.jsx("span",{className:"slash-popup-hint",children:"system"})]},S.id))]})}function ky(){return qr("/providers")}function wy(s,l){const i=l?`?cwd=${encodeURIComponent(l)}`:"";return qr(`/providers/${s}/commands${i}`)}const Sy={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function Ty(s){const[l,i]=I.useState([]),[u,d]=I.useState(!0);I.useEffect(()=>{ky().then(i).catch(()=>i([])).finally(()=>d(!1))},[]);const f=l.find(p=>p.id===s)??null;return{provider:f,capabilities:(f==null?void 0:f.capabilities)??Sy,loading:u}}const Oi=32,xl=200;function Mf(s){if(!s)return{};try{return JSON.parse(s)}catch{return{}}}function Df(s){return s<1024?`${s}B`:s<1024*1024?`${(s/1024).toFixed(1)}KB`:`${(s/(1024*1024)).toFixed(1)}MB`}let Pf=0;function _y(){return Pf+=1,`att-${Date.now()}-${Pf}`}function Ny(){const[s,l]=I.useState(""),i=I.useRef(null),u=I.useRef(null),{submitPrompt:d,cancelTurn:f,updateRuntimeConfig:p,setShowModelSelector:m}=X(),y=X(O=>O.activeSessionId),g=X(O=>O.activeSessionId?O.sessionDetails[O.activeSessionId]:null),k=X(O=>O.restoredPrompt),S=X(O=>O.quotedText),w=(g==null?void 0:g.is_running)===1,A=!y,{capabilities:M}=Ty(g==null?void 0:g.runtime_type),L=(g==null?void 0:g.runtime_type)??null,E=M.imageAttachments,[$,H]=I.useState([]),[J,F]=I.useState(!1),[q,ae]=I.useState(null),[se,le]=I.useState([]);I.useEffect(()=>{if(!L){le([]);return}let O=!1;return wy(L,(g==null?void 0:g.cwd)??void 0).then(me=>{O||le(me)}).catch(()=>{O||le([])}),()=>{O=!0}},[L,g==null?void 0:g.cwd]);const[we,te]=I.useState(!1),[he,_e]=I.useState(""),[Ce,ce]=I.useState(0),[P,Z]=I.useState(void 0),[ee,z]=I.useState(!1),[Y,V]=I.useState(""),[N,D]=I.useState([]),fe=we?gy(he,M,se):[];I.useEffect(()=>{k!==null&&(l(k),requestAnimationFrame(()=>{i.current&&(i.current.style.height="auto",i.current.style.height=Math.min(i.current.scrollHeight,xl)+"px")}),X.setState({restoredPrompt:null}))},[k]),I.useEffect(()=>{S!==null&&(l(O=>O+S),setTimeout(()=>{if(i.current){i.current.style.height="auto",i.current.style.height=Math.min(i.current.scrollHeight,xl)+"px",i.current.focus();const O=i.current.value.length;i.current.setSelectionRange(O,O)}},0),X.setState({quotedText:null}))},[S]),I.useEffect(()=>{if(!w)return;function O(me){me.key==="Escape"&&(me.preventDefault(),f())}return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[w,f]),I.useEffect(()=>{te(!1),Z(void 0),z(!1),D([]),H(O=>{for(const me of O)me.previewUrl&&URL.revokeObjectURL(me.previewUrl);return[]})},[y]),I.useEffect(()=>{if(!q)return;function O(me){me.key==="Escape"&&(me.preventDefault(),ae(null))}return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[q]);const ge=I.useCallback(O=>{if(!O)return;const me=Array.from(O);for(const He of me){const Ve=new FileReader;Ve.onload=()=>{const kt=Ve.result.split(",")[1]??"",It=He.type.startsWith("image/")?URL.createObjectURL(He):void 0;H(nn=>[...nn,{id:_y(),name:He.name,media_type:He.type||"application/octet-stream",data:kt,previewUrl:It,size:He.size}])},Ve.readAsDataURL(He)}},[]),Ne=I.useCallback(O=>{H(me=>{const He=me.find(Ve=>Ve.id===O);return He!=null&&He.previewUrl&&URL.revokeObjectURL(He.previewUrl),me.filter(Ve=>Ve.id!==O)})},[]),Ee=I.useCallback(O=>{O.preventDefault(),O.stopPropagation(),!(!E||w)&&F(!0)},[E,w]),Re=I.useCallback(O=>{O.preventDefault(),O.stopPropagation(),F(!1)},[]),Ie=I.useCallback(O=>{O.preventDefault(),O.stopPropagation(),F(!1),!(!E||w)&&ge(O.dataTransfer.files)},[E,w,ge]),Be=I.useCallback(O=>{var Ve;if(!E)return;const me=(Ve=O.clipboardData)==null?void 0:Ve.items;if(!me)return;const He=[];for(let ot=0;ot<me.length;ot++){const kt=me[ot];if(kt.type.startsWith("image/")){const It=kt.getAsFile();It&&He.push(It)}}He.length>0&&(O.preventDefault(),ge(He))},[E,ge]);function mt(){const O=i.current;O&&(O.style.height="auto",O.style.height=Math.min(O.scrollHeight,xl)+"px")}function dn(){const O=s.trim();if(!O||w)return;let me=O;N.length>0&&(me=`${N.map(ot=>`$${ot.name}`).join(" ")}
378
+
379
+ ${O}`);const He=$.map(({id:Ve,previewUrl:ot,size:kt,...It})=>It);l(""),D([]),i.current&&(i.current.style.height=Oi+"px"),te(!1),Z(void 0),z(!1);for(const Ve of $)Ve.previewUrl&&URL.revokeObjectURL(Ve.previewUrl);H([]),d(me,He.length>0?He:void 0)}function Fe(O){if(O.insertAsText){const me=`/${O.id} `;l(me),te(!1),Z(void 0),requestAnimationFrame(()=>{if(i.current){i.current.focus();const He=me.length;i.current.setSelectionRange(He,He),i.current.style.height="auto",i.current.style.height=Math.min(i.current.scrollHeight,xl)+"px"}});return}O.subPopup?Z(O.subPopup):O.id==="skills"?(z(!0),V(""),te(!1),l("")):O.id==="model"?(m(!0),te(!1),l("")):(te(!1),l(""))}function fn(O){D(me=>[...me,O]),z(!1),l(""),i.current&&(i.current.style.height=Oi+"px")}function Pe(O){const me=Mf(g==null?void 0:g.runtime_config);P==="sandbox"?me.sandboxMode=O:P==="websearch"?me.webSearchMode=O:P==="network"&&(me.networkAccessEnabled=O==="true"),p(me),Z(void 0),te(!1),l(""),i.current&&(i.current.style.height=Oi+"px")}function Hn(O){if(we&&!P){if(O.key==="ArrowDown"){O.preventDefault(),ce(me=>Math.min(me+1,fe.length-1));return}if(O.key==="ArrowUp"){O.preventDefault(),ce(me=>Math.max(me-1,0));return}if(O.key==="Enter"){O.preventDefault(),fe[Ce]&&Fe(fe[Ce]);return}if(O.key==="Escape"){O.preventDefault(),te(!1),l("");return}}if(P&&O.key==="Escape"){O.preventDefault(),Z(void 0);return}if(O.key==="Enter"&&(O.metaKey||O.ctrlKey)&&!w){O.preventDefault(),dn();return}O.key==="Escape"&&w&&(O.preventDefault(),f())}function We(O){const me=O.target.value;l(me),mt(),me.startsWith("/")&&!me.includes(" ")&&!w?(te(!0),_e(me.slice(1)),ce(0)):(te(!1),Z(void 0)),me.startsWith("$")&&!w?(z(!0),V(me.slice(1))):me.startsWith("$")||z(!1)}const Ut=Mf(g==null?void 0:g.runtime_config),mr=[{value:"read-only",label:"Read Only",description:"Agent can only read files"},{value:"workspace-write",label:"Workspace Write",description:"Agent can read and write in workspace"},{value:"danger-full-access",label:"Danger Full Access",description:"Agent has unrestricted access"}],Lt=[{value:"disabled",label:"Disabled",description:"No web search"},{value:"cached",label:"Cached",description:"Use cached search results"},{value:"live",label:"Live",description:"Perform live web searches"}],pn=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return a.jsxs("div",{className:`cmd-bar${J?" drag-over":""}`,onDragOver:Ee,onDragLeave:Re,onDrop:Ie,children:[we&&!P&&a.jsx(vy,{commands:fe,selectedIndex:Ce,onSelect:Fe,onHover:ce}),we&&P==="sandbox"&&a.jsx(Ba,{title:"Sandbox Mode",options:mr,currentValue:Ut.sandboxMode,onSelect:Pe,onClose:()=>Z(void 0)}),we&&P==="websearch"&&a.jsx(Ba,{title:"Web Search",options:Lt,currentValue:Ut.webSearchMode,onSelect:Pe,onClose:()=>Z(void 0)}),we&&P==="network"&&a.jsx(Ba,{title:"Network Access",options:pn,currentValue:Ut.networkAccessEnabled===!0?"true":"false",onSelect:Pe,onClose:()=>Z(void 0)}),ee&&a.jsx(xy,{filter:Y,onSelect:fn,onClose:()=>{z(!1),l("")}}),N.length>0&&a.jsx("div",{className:"skill-badges",children:N.map(O=>a.jsxs("span",{className:"skill-badge",children:["$",O.name,a.jsx("button",{className:"skill-badge-remove",onClick:()=>D(me=>me.filter(He=>He.id!==O.id)),children:"×"})]},O.id))}),$.length>0&&a.jsx("div",{className:"attachment-preview-area",children:$.map(O=>a.jsxs("div",{className:"attachment-chip",title:O.name,children:[O.previewUrl?a.jsx("img",{src:O.previewUrl,alt:O.name,className:"attachment-thumb",onClick:()=>ae(O),style:{cursor:"pointer"}}):a.jsx(tp,{size:20,className:"attachment-file-icon"}),a.jsxs("div",{className:"attachment-info",children:[a.jsx("span",{className:"attachment-name",children:O.name}),a.jsx("span",{className:"attachment-size",children:Df(O.size)})]}),a.jsx("button",{className:"attachment-remove",onClick:()=>Ne(O.id),title:"Remove attachment",children:a.jsx(Bn,{size:14})})]},O.id))}),E&&!w&&!A&&a.jsx("input",{ref:u,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:O=>{ge(O.target.files),O.target.value=""}}),a.jsxs("div",{className:"cmd-input-row",children:[E&&!w&&!A&&a.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var O;return(O=u.current)==null?void 0:O.click()},title:"Attach files",disabled:w,children:a.jsx(Sg,{size:16})}),a.jsx("textarea",{ref:i,className:"cmd-textarea",placeholder:A?"Select or create a session…":w?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:s,disabled:w||A,rows:1,style:{minHeight:Oi,maxHeight:xl},onChange:We,onKeyDown:Hn,onPaste:Be}),w?a.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:a.jsx(Ki,{size:15})}):a.jsx("button",{className:"cmd-send-btn",onClick:dn,disabled:!s.trim()||A,title:"Send (⌘↵)",children:a.jsx(ng,{size:16})})]}),q&&a.jsx("div",{className:"image-preview-modal",onClick:()=>ae(null),children:a.jsxs("div",{className:"image-preview-content",onClick:O=>O.stopPropagation(),children:[a.jsx("img",{src:q.previewUrl,alt:q.name}),a.jsxs("div",{className:"image-preview-info",children:[a.jsx("span",{children:q.name}),a.jsx("span",{children:Df(q.size)})]}),a.jsx("button",{className:"image-preview-close",onClick:()=>ae(null),children:a.jsx(Bn,{size:20})})]})})]})}function Ey(){const s=X($=>$.activeSessionId),l=X($=>$.sessionDetails),i=X($=>$.activeTurnIndex),u=X($=>$.setActiveTurnIndex),d=X($=>$.rewindToTurn),f=X($=>$.restoreSession),p=X($=>$.branchFromTurn),m=s?l[s]:null,y=(m==null?void 0:m.turns)??[],g=(m==null?void 0:m.is_running)===1,k=!!(m!=null&&m.rewound_at_turn_id),S=(m==null?void 0:m.runtime_type)==="repoburg",w=S?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[A,M]=I.useState(null),L=I.useRef(null);if(qi(L,()=>M(null),!!A),uu(()=>M(null),!!A),y.length===0)return a.jsx("div",{className:"empty-state",children:"No turns yet"});function E($){u($),requestAnimationFrame(()=>{var H;(H=document.getElementById(`turn-${$}`))==null||H.scrollIntoView({behavior:"smooth",block:"start"})})}return a.jsxs("div",{className:"right-section",children:[a.jsx("div",{className:"right-section-title",children:"Conversation"}),y.map(($,H)=>{const J=H===i,F=$.user_prompt.length>50?$.user_prompt.slice(0,50)+"…":$.user_prompt,q=$.status==="running"||$.status==="pending";return a.jsx("div",{children:a.jsxs("div",{className:`turn-item ${J?"active":""}`,onClick:()=>E(H),onContextMenu:ae=>{ae.preventDefault(),M({x:ae.clientX,y:ae.clientY,turnId:$.id,turnIndex:H,isLast:H===y.length-1,isSlashCommand:$.user_prompt.trimStart().startsWith("/")})},children:[a.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:a.jsx(Rg,{size:12})}),a.jsx("span",{className:"turn-item-label",children:F}),q&&a.jsx("span",{className:"turn-item-status",children:"running…"})]})},$.id)}),A&&a.jsxs("div",{ref:L,className:"ctx-menu",style:{position:"fixed",left:A.x,top:A.y,zIndex:500},children:[a.jsxs("div",{className:`ctx-menu-item ${A.isLast||g||A.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{A.isLast||g||A.isSlashCommand||(window.confirm(w)&&d(s,A.turnId),M(null))},children:[a.jsx(Ng,{size:12})," Rewind to Here",A.isSlashCommand?" (slash command)":""]}),k&&!S&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(s),M(null)},children:[a.jsx(pu,{size:12})," Restore Rewind"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{p(s,A.turnId),M(null)},children:[a.jsx(fg,{size:12})," Branch from Here"]})]})]})}function Cy(){const{activeSessionId:s,sessionDetails:l,changesScope:i,setChangesScope:u,activeTurnIndex:d,setSelectedChangePath:f}=X(),p=s?l[s]:null,m=(p==null?void 0:p.turns)??[],y=Sp(m,i,d);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"changes-scope-toggle",children:[a.jsx("button",{className:`scope-btn ${i==="session"?"active":""}`,onClick:()=>u("session"),children:"Session"}),a.jsx("button",{className:`scope-btn ${i==="turngroup"?"active":""}`,onClick:()=>u("turngroup"),children:"Current Turn"})]}),y.length===0?a.jsx("div",{className:"empty-state",children:"No file changes in this scope"}):a.jsxs("div",{className:"right-section",children:[a.jsxs("div",{className:"right-section-title",children:["Changed Files (",y.length,")"]}),y.map(g=>{const k=g.kind==="add"?"fc-add":g.kind==="delete"?"fc-del":"fc-mod",S=g.kind==="add"?"A":g.kind==="delete"?"D":"M",w=g.path.split("/").pop()||g.path,A=g.path.replace("/"+w,"");return a.jsxs("div",{className:"file-change clickable",onClick:()=>f(g.path),children:[a.jsx("span",{className:`fc-status ${k}`,children:S}),a.jsxs("span",{className:"fc-name",children:[A&&a.jsxs("span",{style:{color:"var(--text-muted)"},children:[A,"/"]}),w]})]},g.path)})]})]})}const zf=2e4;function jy(s){const l=[];return s.forEach((i,u)=>{var d;for(const f of i.items)if(f.type==="background_task"){if((((d=f.data)==null?void 0:d.task_type)||"unknown")==="local_agent")continue;l.push({item:f,turnIndex:u,turnPrompt:i.user_prompt})}}),l}function Ry({entry:s}){const{item:l,turnIndex:i,turnPrompt:u}=s,d=l.data||{},f=d.task_type||"unknown",p=d.subagent_type||null,m=d.description||"",y=d.status||"running",g=d.summary||null,k=d.last_tool_name||null,S=d.token_count||null,w=d.output||"",A=l.status==="in_progress",M=f==="local_agent",L=f==="local_bash",E=M?Ka:L?rp:ep,$=M?`Subagent${p?`: ${p}`:""}`:L?"Monitor":"Background Task",H=y==="running"?"running…":y==="completed"?"done":y==="failed"?"failed":y==="stopped"?"stopped":y,J=l.status==="failed"||y==="failed",[F,q]=I.useState(A),[ae,se]=I.useState(!1),le=I.useRef(null);I.useEffect(()=>{A&&q(!0)},[A]),I.useEffect(()=>{F&&A&&le.current&&(le.current.scrollTop=le.current.scrollHeight)},[F,A,w]);const we=w.length>zf,te=we&&!ae?w.slice(0,zf)+`
380
+ … (truncated, click to expand)`:w,he=A?null:y==="completed"?a.jsx(Vr,{size:12}):J?a.jsx(fu,{size:12}):a.jsx(Ki,{size:12});return a.jsxs("div",{className:`task-card ${A?"task-running":""} ${J?"task-failed":""}`,children:[a.jsxs("div",{className:"task-card-header",onClick:()=>q(_e=>!_e),style:{cursor:"pointer"},children:[a.jsx("span",{className:"task-card-icon",children:a.jsx(E,{size:14})}),a.jsx("span",{className:"task-card-type",children:$}),a.jsxs("span",{className:`task-card-status ${J?"task-status-failed":A?"task-status-running":"task-status-done"}`,children:[he," ",H]}),a.jsx(du,{size:14,className:"task-card-chevron",style:{transform:F?"rotate(90deg)":"none",marginLeft:"auto"}})]}),m&&a.jsx("div",{className:"task-card-desc",children:m}),A&&k&&a.jsxs("div",{className:"task-card-meta",children:["last tool: ",k,S!=null&&` · ${S.toLocaleString()} tokens`]}),F&&a.jsxs("div",{className:"task-card-body",children:[w?a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output task-output",ref:le,children:a.jsx("code",{children:te})}),we&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>se(_e=>!_e),children:ae?"Show less":`Show full output (${(w.length/1024).toFixed(0)}KB)`})]}):g?a.jsx("pre",{className:"cmd-output task-output",children:a.jsx("code",{children:g})}):A?a.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):a.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),a.jsxs("div",{className:"task-card-context",title:u,children:["from turn ",i+1,": ",u.length>60?u.slice(0,60)+"…":u]})]})]})}const Ay=I.memo(Ry);function Ly(){var g,k;const s=X(S=>S.activeSessionId),l=X(S=>S.sessionDetails),i=s?l[s]:null,u=(i==null?void 0:i.turns)??[],d=(i==null?void 0:i.backgroundTasks)??[],f=jy(u),p=[...f].sort((S,w)=>{const A=S.item.status==="in_progress",M=w.item.status==="in_progress";return A&&!M?-1:!A&&M?1:w.turnIndex-S.turnIndex}),m=new Map;for(const S of d)S.task_type==="local_bash"&&m.set(S.task_id,S.task_type);for(const S of f)if(S.item.status==="in_progress"){const w=((g=S.item.data)==null?void 0:g.task_id)??S.item.external_item_id,A=((k=S.item.data)==null?void 0:k.task_type)??"unknown";m.set(w,A)}const y=[...m.values()].filter(S=>S==="local_bash").length;return f.length===0?a.jsx("div",{className:"empty-state",children:"No background tasks yet"}):a.jsxs("div",{className:"right-section",children:[a.jsxs("div",{className:"right-section-title",children:["Background Tasks (",f.length,")",y>0&&a.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",y," running"]})]}),p.map(S=>a.jsx(Ay,{entry:S},S.item.id))]})}const Iy=I.memo(Ly);Le.setOptions({breaks:!0,gfm:!0});function by(s){const l=Le.parse(s);return Tu.sanitize(l)}function My(s){var l,i,u;if(s.type==="agent_message"||s.type==="final_result"){const d=(l=s.data)==null?void 0:l.text;return typeof d=="string"&&d?d:null}if(s.type==="ask_user"){const d=Array.isArray((i=s.data)==null?void 0:i.groups)?s.data.groups:[],f=[(u=s.data)==null?void 0:u.question,...d.map(p=>p.question)].filter(p=>typeof p=="string"&&!!p);return f.length?f.join(`
381
+
382
+ `):null}return null}function Dy(s){const l=s.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return l?l[1]:s}function Py({turn:s}){const l=Dy(s.user_prompt),i=s.items.map(My).filter(u=>u!==null);return i.length===0&&s.status==="completed"&&s.agent_response&&i.push(s.agent_response),a.jsxs("div",{className:"thread-card-turn",children:[a.jsx("div",{className:"thread-card-user-message",children:l}),i.map((u,d)=>a.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:by(u)}},d)),i.length===0&&(s.status==="pending"||s.status==="running")&&a.jsx("div",{className:"thread-card-pending",children:s.status==="running"?"AI is responding…":"Waiting…"}),s.status==="failed"&&a.jsx("div",{className:"thread-card-pending",children:s.error||"Turn failed"})]})}function zy({thread:s,isRunning:l,threadTurns:i,onResolve:u,onReopen:d,onDelete:f,onFollowup:p,onLocate:m}){const[y,g]=I.useState(""),[k,S]=I.useState(!0),w=I.useRef(null),A=I.useRef(null),[M,L]=I.useState(!1),[E,$]=I.useState({x:0,y:0}),[H,J]=I.useState(""),F=28,q=120;I.useEffect(()=>{const te=A.current;te&&(te.scrollTop=te.scrollHeight)},[i.length,k]);function ae(){const te=w.current;te&&(te.style.height="auto",te.style.height=Math.min(te.scrollHeight,q)+"px")}const se=I.useCallback(()=>{L(!1)},[]),le=I.useCallback(()=>{const te=A.current;if(!te)return;const he=window.getSelection();if(!he||he.rangeCount===0||he.isCollapsed){L(!1);return}const _e=he.getRangeAt(0);if(!te.contains(_e.commonAncestorContainer)){L(!1);return}const Ce=_e.commonAncestorContainer.nodeType===Node.TEXT_NODE?_e.commonAncestorContainer.parentElement:_e.commonAncestorContainer;if(!(Ce!=null&&Ce.closest(".thread-card-ai-response"))){L(!1);return}const ce=he.toString();if(!ce.trim()){L(!1);return}const P=_e.getBoundingClientRect(),Z=28,ee=6,z=170;let Y=!1;if(he.anchorNode&&he.focusNode)try{const D=document.createRange();D.setStart(he.focusNode,he.focusOffset),D.setEnd(he.focusNode,he.focusOffset);const fe=document.createRange();fe.setStart(he.anchorNode,he.anchorOffset),fe.setEnd(he.anchorNode,he.anchorOffset),Y=fe.compareBoundaryPoints(Range.START_TO_START,D)>0}catch{Y=!1}let V=P.top-Z-ee;V<8&&(V=P.bottom+ee);let N=Y?P.left-z:P.right;N=Math.max(8,Math.min(N,window.innerWidth-z-8)),$({x:N,y:V}),J(ce),L(!0)},[]);I.useEffect(()=>{function te(he){const _e=he.target;_e&&_e.closest(".selection-actions")||le()}return document.addEventListener("mouseup",te),()=>document.removeEventListener("mouseup",te)},[le]);const we=I.useCallback(()=>{var he;const te=`
383
+ \`\`\`QUOTE
384
+ ${H}
385
+ \`\`\`
386
+
387
+ `;g(_e=>_e+te),L(!1),J(""),(he=window.getSelection())==null||he.removeAllRanges(),setTimeout(()=>{if(w.current){w.current.style.height="auto",w.current.style.height=Math.min(w.current.scrollHeight,q)+"px",w.current.focus();const _e=w.current.value.length;w.current.setSelectionRange(_e,_e)}},0)},[H]);return a.jsxs("div",{className:`thread-card ${s.status==="resolved"?"thread-resolved":""}`,id:`thread-${s.id}`,children:[a.jsxs("div",{className:"thread-card-header",onClick:()=>S(te=>!te),children:[a.jsxs("div",{className:"thread-card-quote",children:["“",s.selected_text.slice(0,100),s.selected_text.length>100?"…":"","”"]}),a.jsxs("div",{className:"thread-card-header-right",children:[a.jsx("button",{className:"thread-locate-btn",onClick:te=>{te.stopPropagation(),m()},title:"Scroll to text",children:a.jsx(wg,{size:12})}),a.jsx("span",{className:`thread-status-badge ${s.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:s.status==="open"?"Open":"Resolved"})]})]}),k&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"thread-card-conversation",ref:A,onMouseDown:se,children:[i.map(te=>a.jsx(Py,{turn:te},te.id)),i.length===0&&a.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),M&&a.jsx("div",{className:"selection-actions",style:{left:E.x,top:E.y},children:a.jsxs("button",{className:"discuss-button",onClick:we,title:"Quote this text in your follow-up",children:[a.jsx(np,{size:14}),a.jsx("span",{children:"Quote"})]})}),s.status==="open"&&a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{ref:w,className:"thread-card-followup-input",placeholder:l?"Agent is running…":"Type a follow-up…",value:y,onChange:te=>{g(te.target.value),ae()},disabled:l,rows:1,style:{minHeight:F,maxHeight:q},onKeyDown:te=>{te.key==="Enter"&&(te.metaKey||te.ctrlKey)&&!l&&y.trim()&&(te.preventDefault(),p(y.trim()),g(""),w.current&&(w.current.style.height=F+"px"))}}),a.jsx("button",{className:"thread-card-followup-send",disabled:l||!y.trim(),onClick:()=>{p(y.trim()),g("")},children:a.jsx(Qi,{size:13})})]}),a.jsxs("div",{className:"thread-card-actions",children:[s.status==="open"?a.jsxs("button",{className:"thread-action-btn",onClick:u,title:"Resolve thread",children:[a.jsx(Jf,{size:13})," Resolve"]}):a.jsxs("button",{className:"thread-action-btn",onClick:d,title:"Reopen thread",children:[a.jsx(pu,{size:13})," Reopen"]}),a.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:f,title:"Delete thread",children:[a.jsx(js,{size:13})," Delete"]})]})]})]})}function Oy(){const{activeSessionId:s,sessionDetails:l,followupThread:i,resolveThread:u,reopenThread:d,deleteThread:f,activeRightTab:p,switchRightTab:m}=X(),[y,g]=I.useState("open"),k=s?l[s]:null,S=(k==null?void 0:k.threads)??[],w=(k==null?void 0:k.turns)??[],A=(k==null?void 0:k.is_running)===1,M=S.filter(H=>y==="open"?H.status==="open":y==="resolved"?H.status==="resolved":!0),L=S.filter(H=>H.status==="open").length,E=S.filter(H=>H.status==="resolved").length;function $(H){p==="changes"&&m("turns"),setTimeout(()=>{const J=document.querySelector(`mark[data-thread-id="${H}"]`);J&&(J.scrollIntoView({behavior:"smooth",block:"center"}),J.classList.add("thread-mark-flash"),setTimeout(()=>J.classList.remove("thread-mark-flash"),1500))},p==="changes"?150:50)}return s?S.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx(xg,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"No threads yet."}),a.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"thread-filter-tabs",children:[a.jsxs("button",{className:`thread-filter-tab ${y==="open"?"active":""}`,onClick:()=>g("open"),children:["Open (",L,")"]}),a.jsxs("button",{className:`thread-filter-tab ${y==="resolved"?"active":""}`,onClick:()=>g("resolved"),children:["Resolved (",E,")"]}),a.jsxs("button",{className:`thread-filter-tab ${y==="all"?"active":""}`,onClick:()=>g("all"),children:["All (",S.length,")"]})]}),M.length===0?a.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",y," threads."]}):M.map(H=>a.jsx(zy,{thread:H,isRunning:A,threadTurns:w.filter(J=>J.thread_id===H.id),onResolve:()=>u(s,H.id),onReopen:()=>d(s,H.id),onDelete:()=>f(s,H.id),onFollowup:J=>i(s,H.id,J),onLocate:()=>$(H.id)},H.id))]}):a.jsx("div",{className:"empty-state",children:"No session selected"})}function $y(){var y,g;const{activeRightTab:s,switchRightTab:l,activeSessionId:i,sessionDetails:u}=X(),d=i?u[i]:null,f=((y=d==null?void 0:d.backgroundTasks)==null?void 0:y.length)??0,p=((g=d==null?void 0:d.threads)==null?void 0:g.filter(k=>k.status==="open").length)??0,m=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:f||void 0},{id:"threads",label:"Threads",badge:p||void 0}];return a.jsxs("div",{className:"ide-right",children:[a.jsx("div",{className:"right-tabs",children:m.map(k=>a.jsxs("div",{className:`right-tab ${s===k.id?"active":""}`,onClick:()=>l(k.id),children:[k.label,k.badge?a.jsx("span",{className:"right-tab-badge",children:k.badge}):null]},k.id))}),a.jsxs("div",{className:"right-content",children:[s==="turns"&&a.jsx(Ey,{}),s==="changes"&&a.jsx(Cy,{}),s==="tasks"&&a.jsx(Iy,{}),s==="threads"&&a.jsx(Oy,{})]})]})}const ke={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},nu=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh,ke.max,ke.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh,ke.max,ke.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh,ke.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh,ke.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh,ke.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high,ke.xhigh,ke.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[ke.low,ke.medium,ke.high]}]}];function Fy(s){return nu.find(l=>l.id===s)}function _u(s){const l=Fy(s);return(l==null?void 0:l.models)??[]}function Tp(s,l){return _u(s).find(i=>i.slug===l)}function ru(s,l){var i;return((i=Tp(s,l))==null?void 0:i.reasoningLevels)??[]}function su(s,l){var i;return(i=Tp(s,l))==null?void 0:i.defaultReasoning}function Uy(){const{activeSessionId:s,sessions:l,updateModelConfig:i}=X(),u=X(P=>P.showModelSelector),d=X(P=>P.setShowModelSelector),f=l.find(P=>P.id===s),p=X(P=>P.models),m=X(P=>P.modelsLoading),y=X(P=>P.loadModels),[g,k]=I.useState(!1),S=I.useRef(null);if(qi(S,()=>k(!1),g),uu(()=>k(!1),g),I.useEffect(()=>{u&&(k(!0),d(!1))},[u,d]),I.useEffect(()=>{f!=null&&f.runtime_type&&y(f.runtime_type,f.cwd??void 0)},[f==null?void 0:f.runtime_type,f==null?void 0:f.cwd,y]),!f)return null;const w=f.runtime_type,A=f.model??"",M=f.model_reasoning_effort??"",L=p.length>0?p:[],E=_u(w),H=[...L.length>0?L:E];if(A&&!H.some(P=>P.slug===A)){const P=E[0];H.unshift({slug:A,displayName:A,description:"Custom model",defaultReasoning:(P==null?void 0:P.defaultReasoning)??"medium",reasoningLevels:(P==null?void 0:P.reasoningLevels)??[]})}function J(P){return H.find(Z=>Z.slug===P)}function F(P){var Z;return L.length>0?((Z=J(P))==null?void 0:Z.reasoningLevels)??[]:ru(w,P)}function q(P){var Z;return L.length>0?(Z=J(P))==null?void 0:Z.defaultReasoning:su(w,P)}const ae=nu.find(P=>P.id===w),se=J(A),le=A?F(A):[],we=(ae==null?void 0:ae.label)??w,te=(se==null?void 0:se.displayName)??(A||"Default"),he=le.find(P=>P.effort===M),_e=(he==null?void 0:he.label)??(M||"Default");function Ce(P){var Y;const Z=F(P),z=Z.some(V=>V.effort===M)?M:q(P)??((Y=Z[0])==null?void 0:Y.effort)??"";i(P,z),k(!1)}function ce(P){i(A,P),k(!1)}return a.jsxs("div",{className:"model-selector",ref:S,children:[a.jsxs("button",{className:"model-selector-btn",onClick:()=>k(!g),title:"Change model and thinking level",children:[a.jsx("span",{className:"model-selector-provider",children:we}),a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-model",children:te}),_e!=="Default"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-reasoning",children:_e})]}),a.jsx(Ui,{size:12,className:"model-selector-chevron"})]}),g&&a.jsxs("div",{className:"model-selector-popover",children:[a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Provider"}),nu.map(P=>a.jsxs("div",{className:`model-selector-item ${P.id===w?"selected":""} ${P.available?"":"disabled"}`,onClick:()=>{if(P.available){if(P.id===w){k(!1);return}i("","",P.id)}},children:[a.jsx("span",{children:P.label}),!P.available&&a.jsxs("span",{className:"model-selector-coming-soon",children:[a.jsx(vg,{size:10})," Soon"]}),P.id===w&&a.jsx(Vr,{size:12})]},P.id))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Model"}),m&&a.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!m&&H.length===0&&a.jsx("div",{className:"model-selector-empty",children:"No models available"}),H.map(P=>a.jsxs("div",{className:`model-selector-item ${P.slug===A?"selected":""}`,onClick:()=>Ce(P.slug),children:[a.jsxs("div",{className:"model-selector-item-main",children:[a.jsx("span",{className:"model-selector-item-name",children:P.displayName}),a.jsx("span",{className:"model-selector-item-desc",children:P.description})]}),P.slug===A&&a.jsx(Vr,{size:12})]},P.slug))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),le.length===0&&a.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),le.map(P=>a.jsxs("div",{className:`model-selector-item ${P.effort===M?"selected":""}`,onClick:()=>ce(P.effort),children:[a.jsx("span",{children:P.label}),P.effort===M&&a.jsx(Vr,{size:12})]},P.effort))]})]})]})}function By(s,l){if(!s||s.turns.length===0)return"—";const i=s.turns[0],u=s.turns[s.turns.length-1],d=l?null:u.updated_at;return Ym(i.created_at,d)}function $i(s){return s>=1e6?`${(s/1e6).toFixed(s%1e6===0?0:1)}M`:s>=1e3?`${Math.round(s/1e3)}K`:String(s)}function Of(){const s=X(i=>i.setShowRemoteModal),l=ou(window.location.hostname);return a.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>s(!0),children:[a.jsx(Lg,{size:14})," AgentPane",l?` · ${l}`:""]})}function Hy(){var w,A;const s=X(M=>M.activeSessionId),l=X(M=>s?M.sessions.find(L=>L.id===s)??null:null),i=X(M=>s?M.sessionDetails[s]??null:null),u=X(M=>M.wsConnected),d=X(M=>M.switchRightTab),f=(i==null?void 0:i.contextUsage)??null;if(!l)return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(Of,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",title:u?"WebSocket connected":"WebSocket disconnected",children:[a.jsx("span",{className:`status-dot ${u?"done":"error"}`}),u?"Live":"Offline"]}),a.jsx("div",{className:"sb-spacer"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(rf,{size:14})," K"]})]});const p=au(l),m=By(i,p.isRunning),y=(i==null?void 0:i.backgroundTasks)??[],g=new Set,k=new Map;for(const M of y)g.add(M.task_id),k.set(M.task_id,M.task_type);for(const M of(i==null?void 0:i.turns)??[])for(const L of M.items)if(L.type==="background_task"&&L.status==="in_progress"){const E=((w=L.data)==null?void 0:w.task_id)??L.external_item_id,$=((A=L.data)==null?void 0:A.task_type)??"unknown";g.add(E),k.set(E,$)}const S=[...k.values()].filter(M=>M==="local_bash").length;return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(Of,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(Uy,{}),S>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${S} Monitor task${S>1?"s":""} running — click to view`,onClick:()=>d("tasks"),children:[a.jsx(sp,{size:14})," ",S]})]}),a.jsx("div",{className:"sb-spacer"}),a.jsxs("div",{className:"sb-item",title:u?"WebSocket connected":"WebSocket disconnected",children:[a.jsx("span",{className:`status-dot ${u?"done":"error"}`}),u?"Live":"Offline"]}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",style:l.status==="failed"?{color:"var(--red)"}:void 0,children:[a.jsx(cu,{status:p.dot})," ",p.label]}),f&&a.jsx(Wy,{usage:f}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",children:m}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(rf,{size:14})," K"]})]})}function Wy({usage:s}){const l=s.percentage>=85?"var(--red)":s.percentage>=60?"var(--amber)":"var(--green)",i=`${$i(s.totalTokens)} / ${$i(s.contextWindow)} tokens`;return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-context",title:i,children:a.jsxs("span",{className:"sb-context-text",style:{color:l},children:[Math.round(s.percentage),"% / ",$i(s.totalTokens)," / ",$i(s.contextWindow)]})})]})}function Vy({side:s,minWidth:l,maxWidth:i,getWidth:u,setWidth:d}){const[f,p]=I.useState(!1),m=I.useRef(0),y=I.useRef(0),g=I.useCallback(w=>{const A=w.clientX-m.current,M=s==="left"?y.current+A:y.current-A,L=Math.min(i,Math.max(l,M));d(L)},[s,l,i,d]),k=I.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",k),document.body.classList.remove("is-resizing"),p(!1)},[g]);return{onPointerDown:I.useCallback(w=>{w.preventDefault(),w.stopPropagation(),m.current=w.clientX,y.current=u(),p(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",k)},[u,g,k]),dragging:f}}function $f({side:s,minWidth:l,maxWidth:i,getWidth:u,setWidth:d}){const{onPointerDown:f,dragging:p}=Vy({side:s,minWidth:l,maxWidth:i,getWidth:u,setWidth:d});return a.jsx("div",{className:`resize-handle ${s}${p?" dragging":""}`,onPointerDown:f,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s} panel`,"data-resizing":p?"":void 0})}function Gy(){const s=X(f=>f.sidebarWidth),l=X(f=>f.rightPanelWidth),i=X(f=>f.setSidebarWidth),u=X(f=>f.setRightPanelWidth),d=`${s}px 6px 1fr 6px ${l}px`;return a.jsxs("div",{className:"ide-root",children:[a.jsxs("div",{className:"ide-layout",style:{gridTemplateColumns:d},children:[a.jsx(bg,{}),a.jsx($f,{side:"left",minWidth:Wa,maxWidth:Va,getWidth:()=>X.getState().sidebarWidth,setWidth:i}),a.jsxs("div",{className:"ide-center",children:[a.jsx(Mg,{}),a.jsx("div",{className:"ide-render",children:a.jsx(py,{})}),a.jsx(Ny,{})]}),a.jsx($f,{side:"right",minWidth:Ga,maxWidth:qa,getWidth:()=>X.getState().rightPanelWidth,setWidth:u}),a.jsx($y,{})]}),a.jsx(Hy,{})]})}function qy(){const{showNewSessionDialog:s,setShowNewSessionDialog:l,createSession:i,lastModelConfig:u}=X(),d=(u==null?void 0:u.provider)??"codex",f=(u==null?void 0:u.model)??"",p=(u==null?void 0:u.reasoning)??"",[m,y]=I.useState(""),[g,k]=I.useState(f),[S,w]=I.useState(p),[A,M]=I.useState("");if(!s)return null;const L=_u(d),E=g?ru(d,g):[];function $(){i({title:m.trim()||void 0,model:g||void 0,model_reasoning_effort:S||void 0,cwd:A.trim()||void 0,runtime_type:d}),y(""),M("")}function H(F){F.key==="Escape"&&l(!1)}function J(F){var se;k(F);const q=ru(d,F);q.some(le=>le.effort===S)||w(su(d,F)??((se=q[0])==null?void 0:se.effort)??"")}return a.jsx("div",{className:"dialog-overlay",onClick:()=>l(!1),children:a.jsxs("div",{className:"dialog",onClick:F=>F.stopPropagation(),onKeyDown:H,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"New Session"}),a.jsx("button",{className:"dialog-close",onClick:()=>l(!1),children:a.jsx(Bn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("label",{className:"dialog-label",children:["Title (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:m,onChange:F=>y(F.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Model",a.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:F=>J(F.target.value),children:[a.jsx("option",{value:"",children:"Default (Codex picks)"}),L.map(F=>a.jsxs("option",{value:F.slug,children:[F.displayName," — ",F.description]},F.slug))]})]}),E.length>0&&a.jsxs("label",{className:"dialog-label",children:["Thinking Level",a.jsxs("select",{className:"dialog-input dialog-select",value:S,onChange:F=>w(F.target.value),children:[a.jsxs("option",{value:"",children:["Default (",su(d,g),")"]}),E.map(F=>a.jsx("option",{value:F.effort,children:F.label},F.effort))]})]}),a.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:A,onChange:F=>M(F.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>l(!1),children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:$,children:"Create"})]})]})})}function Qy(){const s=X(S=>S.showCommandPalette),l=X(S=>S.setShowCommandPalette),i=X(),[u,d]=I.useState(""),[f,p]=I.useState(0),m=I.useRef(null),y=I.useMemo(()=>{const S=i.activeSessionId?i.sessionDetails[i.activeSessionId]:null,w=(S==null?void 0:S.is_running)===1;return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Sl,action:()=>i.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:js,action:()=>{i.activeSessionId&&i.deleteSession(i.activeSessionId)},available:!!i.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Qi,action:()=>{const A=document.querySelector(".cmd-input");A==null||A.focus()},available:!!i.activeSessionId&&!w},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Ki,action:()=>i.cancelTurn(),available:w},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:gg,action:()=>i.switchRightTab("turns"),available:!!i.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:ag,action:()=>i.switchRightTab("changes"),available:!!i.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Bn,action:()=>{i.activeSessionId&&i.closeTab(i.activeSessionId)},available:!!i.activeSessionId}]},[i]),g=I.useMemo(()=>{const S=u.toLowerCase().trim(),w=y.filter(A=>A.available);return S?w.filter(A=>A.label.toLowerCase().includes(S)||A.hint.toLowerCase().includes(S)):w},[y,u]);I.useEffect(()=>{s&&(d(""),p(0),setTimeout(()=>{var S;return(S=m.current)==null?void 0:S.focus()},50))},[s]);function k(S){if(S.key==="ArrowDown")S.preventDefault(),p(w=>Math.min(w+1,g.length-1));else if(S.key==="ArrowUp")S.preventDefault(),p(w=>Math.max(w-1,0));else if(S.key==="Enter"){S.preventDefault();const w=g[f];w&&(w.action(),l(!1))}else S.key==="Escape"&&l(!1)}return s?a.jsx("div",{className:"palette-overlay",onClick:()=>l(!1),children:a.jsxs("div",{className:"palette",onClick:S=>S.stopPropagation(),children:[a.jsxs("div",{className:"palette-search",children:[a.jsx("input",{ref:m,type:"text",placeholder:"Type a command…",value:u,onChange:S=>{d(S.target.value),p(0)},onKeyDown:k}),a.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?a.jsx("div",{className:"palette-empty",children:"No matching commands"}):a.jsx("div",{className:"palette-list",children:g.map((S,w)=>{const A=S.icon;return a.jsxs("div",{className:`palette-item ${w===f?"selected":""}`,onClick:()=>{S.action(),l(!1)},onMouseEnter:()=>p(w),children:[a.jsx("span",{className:"palette-item-icon",children:a.jsx(A,{size:16})}),a.jsx("span",{className:"palette-item-label",children:S.label}),a.jsx("span",{className:"palette-item-hint",children:S.hint}),w===f&&a.jsx(og,{size:12,className:"palette-item-enter"})]},S.id)})}),a.jsxs("div",{className:"palette-footer",children:[a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↑"}),a.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↵"})," Select"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Ff=/^[a-z][a-z0-9-]{1,30}$/,Ky=2e3;function Yy(){const{showRemoteModal:s,setShowRemoteModal:l,selectSession:i}=X(),[u,d]=I.useState(null),[f,p]=I.useState(null),[m,y]=I.useState(!1),[g,k]=I.useState(!1),[S,w]=I.useState(!1),[A,M]=I.useState(!1),[L,E]=I.useState("main"),[$,H]=I.useState(""),[J,F]=I.useState(!1),[q,ae]=I.useState(null),se=I.useRef(null);qi(se,()=>M(!1),A);const le=g||S,we=I.useCallback(async()=>{y(!0),p(null);try{const z=await fetch(`${fr()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);d(await z.json())}catch{d(null),p("Machine management is only available from this machine's local pane.")}finally{y(!1)}},[]);I.useEffect(()=>{s&&(E("main"),ae(null),we())},[s,we]);const te=q!==null&&q.state==="running";if(I.useEffect(()=>{if(!te)return;const z=setInterval(async()=>{try{const Y=await fetch(`${fr()}/remote/enable`,{headers:{Accept:"application/json"}});Y.ok&&ae(await Y.json())}catch{}},Ky);return()=>clearInterval(z)},[te]),!s)return null;const he=!!(u!=null&&u.tunnel.provisioned)&&!!(u!=null&&u.service.running)&&!!(u!=null&&u.connection.ok);function _e(z){z.key==="Escape"&&l(!1)}async function Ce(z){if(Ff.test(z)){F(!0);try{const Y=await fetch(`${fr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!Y.ok)throw new Error(`enable ${Y.status}`);ae(await Y.json()),E("setup")}catch{p("Could not start the setup — check the daemon logs.")}finally{F(!1)}}}function ce(){q!=null&&q.troubleshootingSessionId&&(i(q.troubleshootingSessionId),l(!1))}async function P(){k(!0);try{await fetch(`${fr()}/remote/disable`,{method:"POST"}),await we()}catch{p("Could not stop the tunnel service — check the service logs.")}finally{k(!1)}}async function Z(){if(M(!1),!!window.confirm(`Remove the tunnel completely?
388
+
389
+ This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
390
+
391
+ This cannot be undone.`)){w(!0);try{const Y=await fetch(`${fr()}/remote/uninstall`,{method:"DELETE"});if(!Y.ok)throw new Error(`uninstall ${Y.status}`);await we()}catch{p("Could not remove the tunnel — check the daemon logs.")}finally{w(!1)}}}function ee(){if(!q)return a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",a.jsx("input",{className:"dialog-input",value:$,onChange:N=>H(N.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>E("main"),children:"Back"}),a.jsxs("button",{className:"dialog-btn-create",disabled:!Ff.test($)||J,onClick:()=>void Ce($),children:[J?a.jsx(Hr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const z=["detect","provision","install","verify","ready"],Y=z.indexOf(q.step),V=q.state==="ready";return a.jsxs(a.Fragment,{children:[q.state==="running"&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(Hr,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),q.state==="ready"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[a.jsx(Vr,{size:14})," Setup complete — you can close this window."]}),q.state==="ready"&&q.hostname&&a.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",a.jsx("a",{href:`https://${q.hostname}`,target:"_blank",rel:"noreferrer",children:q.hostname})]}),a.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:z.map((N,D)=>{const fe=V||Y>-1&&D<Y,ge=!V&&D===Y&&q.state==="running";return a.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:fe||ge?1:.4,color:fe?"var(--green)":void 0},children:[fe?a.jsx(Vr,{size:13}):ge?a.jsx(Hr,{size:13,className:"spin"}):a.jsx(ig,{size:9,style:{marginLeft:2,marginRight:2}}),N]},N)})}),q.logs.length>0&&a.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:q.logs.slice(-3).map(N=>N.message).join(`
392
+ `)}),q.state==="troubleshooting"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-create",onClick:ce,children:"Open troubleshooting session"})})]}),q.state==="failed"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",q.error]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void we(),children:"Refresh status"})})]})}return a.jsx("div",{className:"dialog-overlay",onClick:()=>l(!1),children:a.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:_e,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Remote Access"}),a.jsx("button",{className:"dialog-close",onClick:()=>l(!1),children:a.jsx(Bn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[m&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(Hr,{size:14,className:"spin"})," Loading machine status…"]}),f&&a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:f}),L==="setup"?ee():a.jsxs(a.Fragment,{children:[he&&(u==null?void 0:u.tunnel.hostname)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",a.jsx("a",{href:`https://${u.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:u.tunnel.hostname})]}),a.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[a.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void P(),disabled:le,children:[g?a.jsx(Hr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),a.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>M(z=>!z),disabled:le,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":A,children:S?a.jsx(Hr,{size:14,className:"spin"}):a.jsx(Ui,{size:14})}),A&&a.jsx("div",{ref:se,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:a.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void Z(),children:[a.jsx(js,{size:12})," Remove tunnel"]})})]})]}),!he&&a.jsx(a.Fragment,{children:u!=null&&u.tunnel.provisioned&&u.tunnel.mahlas&&u.tunnel.hostname?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",a.jsx("a",{href:`https://${u.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:u.tunnel.hostname})," ","but the connection is stopped."]}),a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void Ce(u.tunnel.mahlas),disabled:J,children:[J?a.jsx(Hr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):a.jsx(sf,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>E("setup"),children:[a.jsx(sf,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const Xy={success:sg,error:fu,info:pg,warn:Cg},Zy=4e3;function Jy({toast:s}){const l=X(p=>p.removeToast),i=Xy[s.type],u=I.useRef(null);I.useEffect(()=>{function p(){u.current=setTimeout(()=>l(s.id),Zy)}return p(),()=>{u.current&&clearTimeout(u.current)}},[s.id,l]);function d(){u.current&&(clearTimeout(u.current),u.current=null)}function f(){u.current=setTimeout(()=>l(s.id),2e3)}return a.jsxs("div",{className:`toast toast-${s.type}`,onMouseEnter:d,onMouseLeave:f,children:[a.jsx(i,{size:16}),a.jsx("span",{className:"toast-message",children:s.message}),s.undoAction&&a.jsxs("button",{className:"toast-undo",onClick:()=>{var p;(p=s.undoAction)==null||p.call(s),l(s.id)},children:[a.jsx(jg,{size:12})," ",s.undoLabel||"Undo"]}),a.jsx("button",{className:"toast-close",onClick:()=>l(s.id),children:a.jsx(Bn,{size:14})})]})}function e0(){const s=X(l=>l.toasts);return s.length===0?null:a.jsx("div",{className:"toast-container",children:s.map(l=>a.jsx(Jy,{toast:l},l.id))})}let tn=null,Rs=null,_l=1e3;const t0=1e4;function n0(){const s=fr();return s?`${s.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function lu(){tn&&(tn.readyState===WebSocket.OPEN||tn.readyState===WebSocket.CONNECTING)||(tn=new WebSocket(n0()),tn.onopen=()=>{const s=_l>1e3;if(_l=1e3,X.getState().setWsConnected(!0),X.getState().addLogEntry("INFO","WebSocket connected"),s){const l=X.getState();l.activeSessionId&&(l.refreshActiveSession(),l.addToast("info","WebSocket reconnected — session state reconciled"))}},tn.onclose=()=>{X.getState().setWsConnected(!1),X.getState().addLogEntry("WARN","WebSocket disconnected"),X.getState().addToast("warn","WebSocket disconnected — reconnecting…"),s0()},tn.onerror=()=>{},tn.onmessage=s=>{try{const l=JSON.parse(s.data),i=l0[l.event];i&&i(l.data)}catch{}})}function r0(){Rs&&(clearTimeout(Rs),Rs=null),tn&&(tn.onclose=null,tn.close(),tn=null),X.getState().setWsConnected(!1)}function s0(){Rs||(Rs=window.setTimeout(()=>{Rs=null,lu()},_l),_l=Math.min(_l*2,t0))}const l0={"turn:started":s=>{const l=s;X.getState().onTurnStarted(l.sessionId,l.turnId)},"item:started":s=>{const l=s;X.getState().onItemStarted(l.sessionId,l.turnId,l.item)},"item:updated":s=>{const l=s;X.getState().onItemUpdated(l.sessionId,l.turnId,l.item)},"item:completed":s=>{const l=s;X.getState().onItemCompleted(l.sessionId,l.turnId,l.item)},"item:delta":s=>{const l=s;X.getState().onItemDelta(l.sessionId,l.turnId,l.itemId,l.delta)},"turn:completed":s=>{const l=s;X.getState().onTurnCompleted(l.sessionId,l.turnId,l.usage,l.hasUnreviewed,l.response??void 0)},"turn:tokenUsage":s=>{const l=s;X.getState().onTokenUsageUpdated(l.sessionId,l.turnId,l.usage)},"turn:contextUsage":s=>{const l=s,i={totalTokens:l.totalTokens,contextWindow:l.contextWindow,percentage:l.percentage};X.getState().onContextUsageUpdated(l.sessionId,i)},"turn:failed":s=>{const l=s;X.getState().onTurnFailed(l.sessionId,l.turnId,l.error)},"turn:cancelled":s=>{const l=s;X.getState().onTurnCancelled(l.sessionId,l.turnId)},"session:title":s=>{const l=s;X.getState().onSessionTitle(l.sessionId,l.title)},background_tasks:s=>{const l=s;X.getState().onBackgroundTasksChanged(l.sessionId,l.tasks)},"thread:created":s=>{const l=s;X.getState().onThreadCreated(l.sessionId,l.thread,l.turn)},"thread:followup":s=>{const l=s;X.getState().onThreadFollowup(l.sessionId,l.threadId,l.turn)},"thread:resolved":s=>{const l=s;X.getState().onThreadResolved(l.sessionId,l.threadId,l.status)},"thread:deleted":s=>{const l=s;X.getState().onThreadDeleted(l.sessionId,l.threadId)}};function i0(){const s=X(l=>l.init);return I.useEffect(()=>{Tm(),s(),lu();function l(){if(document.visibilityState!=="visible")return;const i=X.getState(),u=i.activeSessionId;if(!u)return;const d=i.sessionDetails[u];i.wsConnected||lu(),d&&d.is_running===1&&(i.refreshActiveSession(),i.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",l),()=>{r0(),document.removeEventListener("visibilitychange",l)}},[s]),null}function o0(){const s=X(d=>d.loading),l=X(d=>d.error),i=X(d=>d.sessions),u=X(d=>d.setShowCommandPalette);return I.useEffect(()=>{function d(f){(f.metaKey||f.ctrlKey)&&f.key==="k"&&(f.preventDefault(),u(!0))}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[u]),a.jsxs(a.Fragment,{children:[a.jsx(i0,{}),s&&i.length===0?a.jsx("div",{className:"empty-state",children:"Loading sessions…"}):l&&i.length===0?a.jsxs("div",{className:"empty-state",children:["Error: ",l]}):a.jsxs(a.Fragment,{children:[a.jsx(Gy,{}),a.jsx(qy,{}),a.jsx(Yy,{}),a.jsx(Qy,{}),a.jsx(e0,{})]})]})}pm.createRoot(document.getElementById("root")).render(a.jsx(kl.StrictMode,{children:a.jsx(o0,{})}));