repoburg 1.3.231 → 1.3.233

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,424 @@
1
+ var $v=Object.defineProperty;var Fv=(n,r,o)=>r in n?$v(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o;var it=(n,r,o)=>Fv(n,typeof r!="symbol"?r+"":r,o);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))l(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function o(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(a){if(a.ep)return;a.ep=!0;const c=o(a);fetch(a.href,c)}})();function Vh(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Oc={exports:{}},Bo={},zc={exports:{}},$e={};/**
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 kp;function Uv(){if(kp)return $e;kp=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),k=Symbol.iterator;function x(b){return b===null||typeof b!="object"?null:(b=k&&b[k]||b["@@iterator"],typeof b=="function"?b:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,E={};function N(b,I,ie){this.props=b,this.context=I,this.refs=E,this.updater=ie||C}N.prototype.isReactComponent={},N.prototype.setState=function(b,I){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,I,"setState")},N.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function M(){}M.prototype=N.prototype;function j(b,I,ie){this.props=b,this.context=I,this.refs=E,this.updater=ie||C}var H=j.prototype=new M;H.constructor=j,D(H,N.prototype),H.isPureReactComponent=!0;var P=Array.isArray,V=Object.prototype.hasOwnProperty,ee={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function B(b,I,ie){var de,ge={},we=null,Le=null;if(I!=null)for(de in I.ref!==void 0&&(Le=I.ref),I.key!==void 0&&(we=""+I.key),I)V.call(I,de)&&!q.hasOwnProperty(de)&&(ge[de]=I[de]);var Te=arguments.length-2;if(Te===1)ge.children=ie;else if(1<Te){for(var je=Array(Te),Ce=0;Ce<Te;Ce++)je[Ce]=arguments[Ce+2];ge.children=je}if(b&&b.defaultProps)for(de in Te=b.defaultProps,Te)ge[de]===void 0&&(ge[de]=Te[de]);return{$$typeof:n,type:b,key:we,ref:Le,props:ge,_owner:ee.current}}function oe(b,I){return{$$typeof:n,type:b.type,key:I,ref:b.ref,props:b.props,_owner:b._owner}}function ae(b){return typeof b=="object"&&b!==null&&b.$$typeof===n}function ce(b){var I={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(ie){return I[ie]})}var Pe=/\/+/g;function _e(b,I){return typeof b=="object"&&b!==null&&b.key!=null?ce(""+b.key):I.toString(36)}function Oe(b,I,ie,de,ge){var we=typeof b;(we==="undefined"||we==="boolean")&&(b=null);var Le=!1;if(b===null)Le=!0;else switch(we){case"string":case"number":Le=!0;break;case"object":switch(b.$$typeof){case n:case r:Le=!0}}if(Le)return Le=b,ge=ge(Le),b=de===""?"."+_e(Le,0):de,P(ge)?(ie="",b!=null&&(ie=b.replace(Pe,"$&/")+"/"),Oe(ge,I,ie,"",function(Ce){return Ce})):ge!=null&&(ae(ge)&&(ge=oe(ge,ie+(!ge.key||Le&&Le.key===ge.key?"":(""+ge.key).replace(Pe,"$&/")+"/")+b)),I.push(ge)),1;if(Le=0,de=de===""?".":de+":",P(b))for(var Te=0;Te<b.length;Te++){we=b[Te];var je=de+_e(we,Te);Le+=Oe(we,I,ie,je,ge)}else if(je=x(b),typeof je=="function")for(b=je.call(b),Te=0;!(we=b.next()).done;)we=we.value,je=de+_e(we,Te++),Le+=Oe(we,I,ie,je,ge);else if(we==="object")throw I=String(b),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return Le}function Q(b,I,ie){if(b==null)return b;var de=[],ge=0;return Oe(b,de,"","",function(we){return I.call(ie,we,ge++)}),de}function te(b){if(b._status===-1){var I=b._result;I=I(),I.then(function(ie){(b._status===0||b._status===-1)&&(b._status=1,b._result=ie)},function(ie){(b._status===0||b._status===-1)&&(b._status=2,b._result=ie)}),b._status===-1&&(b._status=0,b._result=I)}if(b._status===1)return b._result.default;throw b._result}var ne={current:null},G={transition:null},Z={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:G,ReactCurrentOwner:ee};function W(){throw Error("act(...) is not supported in production builds of React.")}return $e.Children={map:Q,forEach:function(b,I,ie){Q(b,function(){I.apply(this,arguments)},ie)},count:function(b){var I=0;return Q(b,function(){I++}),I},toArray:function(b){return Q(b,function(I){return I})||[]},only:function(b){if(!ae(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},$e.Component=N,$e.Fragment=o,$e.Profiler=a,$e.PureComponent=j,$e.StrictMode=l,$e.Suspense=m,$e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,$e.act=W,$e.cloneElement=function(b,I,ie){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var de=D({},b.props),ge=b.key,we=b.ref,Le=b._owner;if(I!=null){if(I.ref!==void 0&&(we=I.ref,Le=ee.current),I.key!==void 0&&(ge=""+I.key),b.type&&b.type.defaultProps)var Te=b.type.defaultProps;for(je in I)V.call(I,je)&&!q.hasOwnProperty(je)&&(de[je]=I[je]===void 0&&Te!==void 0?Te[je]:I[je])}var je=arguments.length-2;if(je===1)de.children=ie;else if(1<je){Te=Array(je);for(var Ce=0;Ce<je;Ce++)Te[Ce]=arguments[Ce+2];de.children=Te}return{$$typeof:n,type:b.type,key:ge,ref:we,props:de,_owner:Le}},$e.createContext=function(b){return b={$$typeof:f,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:c,_context:b},b.Consumer=b},$e.createElement=B,$e.createFactory=function(b){var I=B.bind(null,b);return I.type=b,I},$e.createRef=function(){return{current:null}},$e.forwardRef=function(b){return{$$typeof:h,render:b}},$e.isValidElement=ae,$e.lazy=function(b){return{$$typeof:y,_payload:{_status:-1,_result:b},_init:te}},$e.memo=function(b,I){return{$$typeof:g,type:b,compare:I===void 0?null:I}},$e.startTransition=function(b){var I=G.transition;G.transition={};try{b()}finally{G.transition=I}},$e.unstable_act=W,$e.useCallback=function(b,I){return ne.current.useCallback(b,I)},$e.useContext=function(b){return ne.current.useContext(b)},$e.useDebugValue=function(){},$e.useDeferredValue=function(b){return ne.current.useDeferredValue(b)},$e.useEffect=function(b,I){return ne.current.useEffect(b,I)},$e.useId=function(){return ne.current.useId()},$e.useImperativeHandle=function(b,I,ie){return ne.current.useImperativeHandle(b,I,ie)},$e.useInsertionEffect=function(b,I){return ne.current.useInsertionEffect(b,I)},$e.useLayoutEffect=function(b,I){return ne.current.useLayoutEffect(b,I)},$e.useMemo=function(b,I){return ne.current.useMemo(b,I)},$e.useReducer=function(b,I,ie){return ne.current.useReducer(b,I,ie)},$e.useRef=function(b){return ne.current.useRef(b)},$e.useState=function(b){return ne.current.useState(b)},$e.useSyncExternalStore=function(b,I,ie){return ne.current.useSyncExternalStore(b,I,ie)},$e.useTransition=function(){return ne.current.useTransition()},$e.version="18.3.1",$e}var Sp;function bu(){return Sp||(Sp=1,zc.exports=Uv()),zc.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 Tp;function Bv(){if(Tp)return Bo;Tp=1;var n=bu(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function f(h,m,g){var y,k={},x=null,C=null;g!==void 0&&(x=""+g),m.key!==void 0&&(x=""+m.key),m.ref!==void 0&&(C=m.ref);for(y in m)l.call(m,y)&&!c.hasOwnProperty(y)&&(k[y]=m[y]);if(h&&h.defaultProps)for(y in m=h.defaultProps,m)k[y]===void 0&&(k[y]=m[y]);return{$$typeof:r,type:h,key:x,ref:C,props:k,_owner:a.current}}return Bo.Fragment=o,Bo.jsx=f,Bo.jsxs=f,Bo}var Np;function Wv(){return Np||(Np=1,Oc.exports=Bv()),Oc.exports}var u=Wv(),w=bu();const rt=Vh(w);var yl={},$c={exports:{}},vn={},Fc={exports:{}},Uc={};/**
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 Cp;function Hv(){return Cp||(Cp=1,(function(n){function r(G,Z){var W=G.length;G.push(Z);e:for(;0<W;){var b=W-1>>>1,I=G[b];if(0<a(I,Z))G[b]=Z,G[W]=I,W=b;else break e}}function o(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var Z=G[0],W=G.pop();if(W!==Z){G[0]=W;e:for(var b=0,I=G.length,ie=I>>>1;b<ie;){var de=2*(b+1)-1,ge=G[de],we=de+1,Le=G[we];if(0>a(ge,W))we<I&&0>a(Le,ge)?(G[b]=Le,G[we]=W,b=we):(G[b]=ge,G[de]=W,b=de);else if(we<I&&0>a(Le,W))G[b]=Le,G[we]=W,b=we;else break e}}return Z}function a(G,Z){var W=G.sortIndex-Z.sortIndex;return W!==0?W:G.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],g=[],y=1,k=null,x=3,C=!1,D=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function H(G){for(var Z=o(g);Z!==null;){if(Z.callback===null)l(g);else if(Z.startTime<=G)l(g),Z.sortIndex=Z.expirationTime,r(m,Z);else break;Z=o(g)}}function P(G){if(E=!1,H(G),!D)if(o(m)!==null)D=!0,te(V);else{var Z=o(g);Z!==null&&ne(P,Z.startTime-G)}}function V(G,Z){D=!1,E&&(E=!1,M(B),B=-1),C=!0;var W=x;try{for(H(Z),k=o(m);k!==null&&(!(k.expirationTime>Z)||G&&!ce());){var b=k.callback;if(typeof b=="function"){k.callback=null,x=k.priorityLevel;var I=b(k.expirationTime<=Z);Z=n.unstable_now(),typeof I=="function"?k.callback=I:k===o(m)&&l(m),H(Z)}else l(m);k=o(m)}if(k!==null)var ie=!0;else{var de=o(g);de!==null&&ne(P,de.startTime-Z),ie=!1}return ie}finally{k=null,x=W,C=!1}}var ee=!1,q=null,B=-1,oe=5,ae=-1;function ce(){return!(n.unstable_now()-ae<oe)}function Pe(){if(q!==null){var G=n.unstable_now();ae=G;var Z=!0;try{Z=q(!0,G)}finally{Z?_e():(ee=!1,q=null)}}else ee=!1}var _e;if(typeof j=="function")_e=function(){j(Pe)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,Q=Oe.port2;Oe.port1.onmessage=Pe,_e=function(){Q.postMessage(null)}}else _e=function(){N(Pe,0)};function te(G){q=G,ee||(ee=!0,_e())}function ne(G,Z){B=N(function(){G(n.unstable_now())},Z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.unstable_continueExecution=function(){D||C||(D=!0,te(V))},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return o(m)},n.unstable_next=function(G){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var W=x;x=Z;try{return G()}finally{x=W}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(G,Z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var W=x;x=G;try{return Z()}finally{x=W}},n.unstable_scheduleCallback=function(G,Z,W){var b=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?b+W:b):W=b,G){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=W+I,G={id:y++,callback:Z,priorityLevel:G,startTime:W,expirationTime:I,sortIndex:-1},W>b?(G.sortIndex=W,r(g,G),o(m)===null&&G===o(g)&&(E?(M(B),B=-1):E=!0,ne(P,W-b))):(G.sortIndex=I,r(m,G),D||C||(D=!0,te(V))),G},n.unstable_shouldYield=ce,n.unstable_wrapCallback=function(G){var Z=x;return function(){var W=x;x=Z;try{return G.apply(this,arguments)}finally{x=W}}}})(Uc)),Uc}var bp;function Vv(){return bp||(bp=1,Fc.exports=Hv()),Fc.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 Ep;function Gv(){if(Ep)return vn;Ep=1;var n=bu(),r=Vv();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s]);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 l=new Set,a={};function c(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)l.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=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]*$/,y={},k={};function x(e){return m.call(k,e)?!0:m.call(y,e)?!1:g.test(e)?k[e]=!0:(y[e]=!0,!1)}function C(e,t,s,i){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,t,s,i){if(t===null||typeof t>"u"||C(e,t,s,i))return!0;if(i)return!1;if(s!==null)switch(s.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 E(e,t,s,i,d,p,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=v}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new E(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){N[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function j(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(M,j);N[t]=new E(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(M,j);N[t]=new E(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(M,j);N[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function H(e,t,s,i){var d=N.hasOwnProperty(t)?N[t]:null;(d!==null?d.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(D(t,s,d,i)&&(s=null),i||d===null?x(t)&&(s===null?e.removeAttribute(t):e.setAttribute(t,""+s)):d.mustUseProperty?e[d.propertyName]=s===null?d.type===3?!1:"":s:(t=d.attributeName,i=d.attributeNamespace,s===null?e.removeAttribute(t):(d=d.type,s=d===3||d===4&&s===!0?"":""+s,i?e.setAttributeNS(i,t,s):e.setAttribute(t,s))))}var P=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),ee=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),ae=Symbol.for("react.provider"),ce=Symbol.for("react.context"),Pe=Symbol.for("react.forward_ref"),_e=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),G=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var W=Object.assign,b;function I(e){if(b===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);b=t&&t[1]||""}return`
34
+ `+b+e}var ie=!1;function de(e,t){if(!e||ie)return"";ie=!0;var s=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(z){var i=z}Reflect.construct(e,[],t)}else{try{t.call()}catch(z){i=z}e.call(t.prototype)}else{try{throw Error()}catch(z){i=z}e()}}catch(z){if(z&&i&&typeof z.stack=="string"){for(var d=z.stack.split(`
35
+ `),p=i.stack.split(`
36
+ `),v=d.length-1,T=p.length-1;1<=v&&0<=T&&d[v]!==p[T];)T--;for(;1<=v&&0<=T;v--,T--)if(d[v]!==p[T]){if(v!==1||T!==1)do if(v--,T--,0>T||d[v]!==p[T]){var _=`
37
+ `+d[v].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),_}while(1<=v&&0<=T);break}}}finally{ie=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?I(e):""}function ge(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return""}}function we(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 q:return"Fragment";case ee:return"Portal";case oe:return"Profiler";case B:return"StrictMode";case _e:return"Suspense";case Oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case ae:return(e._context.displayName||"Context")+".Provider";case Pe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}function Le(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 we(t);case 8:return t===B?"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 Te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ce(e){var t=je(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,p=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(v){i=""+v,p.call(this,v)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lt(e){e._valueTracker||(e._valueTracker=Ce(e))}function Re(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=je(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function kt(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 $(e,t){var s=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Me(e,t){var s=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;s=Te(t.value!=null?t.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function le(e,t){t=t.checked,t!=null&&H(e,"checked",t,!1)}function Qe(e,t){le(e,t);var s=Te(t.value),i=t.type;if(s!=null)i==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ve(e,t.type,s):t.hasOwnProperty("defaultValue")&&ve(e,t.type,Te(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ut(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function ve(e,t,s){(t!=="number"||kt(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Fe=Array.isArray;function We(e,t,s,i){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Te(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function St(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(o(91));return W({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function U(e,t){var s=t.value;if(s==null){if(s=t.children,t=t.defaultValue,s!=null){if(t!=null)throw Error(o(92));if(Fe(s)){if(1<s.length)throw Error(o(93));s=s[0]}t=s}t==null&&(t=""),s=t}e._wrapperState={initialValue:Te(s)}}function ue(e,t){var s=Te(t.value),i=Te(t.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),t.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),i!=null&&(e.defaultValue=""+i)}function ze(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function qe(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 tt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?qe(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var st,De=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,s,i,d){MSApp.execUnsafeLocalFunction(function(){return e(t,s,i,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(st=st||document.createElement("div"),st.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=st.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ke(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var nt={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},lr=["Webkit","ms","Moz","O"];Object.keys(nt).forEach(function(e){lr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nt[t]=nt[e]})});function ar(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||nt.hasOwnProperty(e)&&nt[e]?(""+t).trim():t+"px"}function Qr(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var i=s.indexOf("--")===0,d=ar(s,t[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,d):e[s]=d}}var br=W({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 cr(e,t){if(t){if(br[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(o(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(t.style!=null&&typeof t.style!="object")throw Error(o(62))}}function ur(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 zn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kt=null,Rn=null,at=null;function jt(e){if(e=Eo(e)){if(typeof Kt!="function")throw Error(o(280));var t=e.stateNode;t&&(t=Mi(t),Kt(e.stateNode,e.type,t))}}function bt(e){Rn?at?at.push(e):at=[e]:Rn=e}function un(){if(Rn){var e=Rn,t=at;if(at=Rn=null,jt(e),t)for(e=0;e<t.length;e++)jt(t[e])}}function Et(e,t){return e(t)}function Tt(){}var dt=!1;function Xt(e,t,s){if(dt)return e(t,s);dt=!0;try{return Et(e,t,s)}finally{dt=!1,(Rn!==null||at!==null)&&(Tt(),un())}}function ot(e,t){var s=e.stateNode;if(s===null)return null;var i=Mi(s);if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Yt=!1;if(h)try{var At={};Object.defineProperty(At,"passive",{get:function(){Yt=!0}}),window.addEventListener("test",At,At),window.removeEventListener("test",At,At)}catch{Yt=!1}function dn(e,t,s,i,d,p,v,T,_){var z=Array.prototype.slice.call(arguments,3);try{t.apply(s,z)}catch(Y){this.onError(Y)}}var nn=!1,xn=null,Ut=!1,$n=null,Fn={onError:function(e){nn=!0,xn=e}};function oa(e,t,s,i,d,p,v,T,_){nn=!1,xn=null,dn.apply(Fn,arguments)}function ia(e,t,s,i,d,p,v,T,_){if(oa.apply(this,arguments),nn){if(nn){var z=xn;nn=!1,xn=null}else throw Error(o(198));Ut||(Ut=!0,$n=z)}}function Ze(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function dr(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 fi(e){if(Ze(e)!==e)throw Error(o(188))}function pi(e){var t=e.alternate;if(!t){if(t=Ze(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,i=t;;){var d=s.return;if(d===null)break;var p=d.alternate;if(p===null){if(i=d.return,i!==null){s=i;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===s)return fi(d),e;if(p===i)return fi(d),t;p=p.sibling}throw Error(o(188))}if(s.return!==i.return)s=d,i=p;else{for(var v=!1,T=d.child;T;){if(T===s){v=!0,s=d,i=p;break}if(T===i){v=!0,i=d,s=p;break}T=T.sibling}if(!v){for(T=p.child;T;){if(T===s){v=!0,s=p,i=d;break}if(T===i){v=!0,i=p,s=d;break}T=T.sibling}if(!v)throw Error(o(189))}}if(s.alternate!==i)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function ws(e){return e=pi(e),e!==null?lo(e):null}function lo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lo(e);if(t!==null)return t;e=e.sibling}return null}var ao=r.unstable_scheduleCallback,hi=r.unstable_cancelCallback,la=r.unstable_shouldYield,aa=r.unstable_requestPaint,mt=r.unstable_now,Qn=r.unstable_getCurrentPriorityLevel,Er=r.unstable_ImmediatePriority,Zn=r.unstable_UserBlockingPriority,ks=r.unstable_NormalPriority,Zr=r.unstable_LowPriority,mi=r.unstable_IdlePriority,Jr=null,wn=null;function Ss(e){if(wn&&typeof wn.onCommitFiberRoot=="function")try{wn.onCommitFiberRoot(Jr,e,void 0,(e.current.flags&128)===128)}catch{}}var rn=Math.clz32?Math.clz32:es,Ts=Math.log,_r=Math.LN2;function es(e){return e>>>=0,e===0?32:31-(Ts(e)/_r|0)|0}var sn=64,Ns=4194304;function ts(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 ns(e,t){var s=e.pendingLanes;if(s===0)return 0;var i=0,d=e.suspendedLanes,p=e.pingedLanes,v=s&268435455;if(v!==0){var T=v&~d;T!==0?i=ts(T):(p&=v,p!==0&&(i=ts(p)))}else v=s&~d,v!==0?i=ts(v):p!==0&&(i=ts(p));if(i===0)return 0;if(t!==0&&t!==i&&(t&d)===0&&(d=i&-i,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((i&4)!==0&&(i|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)s=31-rn(t),d=1<<s,i|=e[s],t&=~d;return i}function gi(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 vi(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-rn(p),T=1<<v,_=d[v];_===-1?((T&s)===0||(T&i)!==0)&&(d[v]=gi(T,t)):_<=t&&(e.expiredLanes|=T),p&=~T}}function co(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function uo(){var e=sn;return sn<<=1,(sn&4194240)===0&&(sn=64),e}function fo(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function rs(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=s}function yi(e,t){var s=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 i=e.eventTimes;for(e=e.expirationTimes;0<s;){var d=31-rn(s),p=1<<d;t[d]=0,i[d]=-1,e[d]=-1,s&=~p}}function Rr(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-rn(s),d=1<<i;d&t|e[i]&t&&(e[i]|=t),s&=~d}}var He=0;function re(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,A,K,me,ke,Ae=!1,Ve=[],Xe=null,gt=null,vt=null,fr=new Map,Nt=new Map,jr=[],lg="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 rd(e,t){switch(e){case"focusin":case"focusout":Xe=null;break;case"dragenter":case"dragleave":gt=null;break;case"mouseover":case"mouseout":vt=null;break;case"pointerover":case"pointerout":fr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nt.delete(t.pointerId)}}function po(e,t,s,i,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:p,targetContainers:[d]},t!==null&&(t=Eo(t),t!==null&&A(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function ag(e,t,s,i,d){switch(t){case"focusin":return Xe=po(Xe,e,t,s,i,d),!0;case"dragenter":return gt=po(gt,e,t,s,i,d),!0;case"mouseover":return vt=po(vt,e,t,s,i,d),!0;case"pointerover":var p=d.pointerId;return fr.set(p,po(fr.get(p)||null,e,t,s,i,d)),!0;case"gotpointercapture":return p=d.pointerId,Nt.set(p,po(Nt.get(p)||null,e,t,s,i,d)),!0}return!1}function sd(e){var t=ss(e.target);if(t!==null){var s=Ze(t);if(s!==null){if(t=s.tag,t===13){if(t=dr(s),t!==null){e.blockedOn=t,ke(e.priority,function(){K(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=ua(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);zn=i,s.target.dispatchEvent(i),zn=null}else return t=Eo(s),t!==null&&A(t),e.blockedOn=s,!1;t.shift()}return!0}function od(e,t,s){xi(e)&&s.delete(t)}function cg(){Ae=!1,Xe!==null&&xi(Xe)&&(Xe=null),gt!==null&&xi(gt)&&(gt=null),vt!==null&&xi(vt)&&(vt=null),fr.forEach(od),Nt.forEach(od)}function ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Ae||(Ae=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,cg)))}function mo(e){function t(d){return ho(d,e)}if(0<Ve.length){ho(Ve[0],e);for(var s=1;s<Ve.length;s++){var i=Ve[s];i.blockedOn===e&&(i.blockedOn=null)}}for(Xe!==null&&ho(Xe,e),gt!==null&&ho(gt,e),vt!==null&&ho(vt,e),fr.forEach(t),Nt.forEach(t),s=0;s<jr.length;s++)i=jr[s],i.blockedOn===e&&(i.blockedOn=null);for(;0<jr.length&&(s=jr[0],s.blockedOn===null);)sd(s),s.blockedOn===null&&jr.shift()}var Cs=P.ReactCurrentBatchConfig,wi=!0;function ug(e,t,s,i){var d=He,p=Cs.transition;Cs.transition=null;try{He=1,ca(e,t,s,i)}finally{He=d,Cs.transition=p}}function dg(e,t,s,i){var d=He,p=Cs.transition;Cs.transition=null;try{He=4,ca(e,t,s,i)}finally{He=d,Cs.transition=p}}function ca(e,t,s,i){if(wi){var d=ua(e,t,s,i);if(d===null)Ea(e,t,i,ki,s),rd(e,i);else if(ag(d,e,t,s,i))i.stopPropagation();else if(rd(e,i),t&4&&-1<lg.indexOf(e)){for(;d!==null;){var p=Eo(d);if(p!==null&&S(p),p=ua(e,t,s,i),p===null&&Ea(e,t,i,ki,s),p===d)break;d=p}d!==null&&i.stopPropagation()}else Ea(e,t,i,null,s)}}var ki=null;function ua(e,t,s,i){if(ki=null,e=_n(i),e=ss(e),e!==null)if(t=Ze(e),t===null)e=null;else if(s=t.tag,s===13){if(e=dr(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ki=e,null}function id(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(Qn()){case Er:return 1;case Zn:return 4;case ks:case Zr:return 16;case mi:return 536870912;default:return 16}default:return 16}}var Dr=null,da=null,Si=null;function ld(){if(Si)return Si;var e,t=da,s=t.length,i,d="value"in Dr?Dr.value:Dr.textContent,p=d.length;for(e=0;e<s&&t[e]===d[e];e++);var v=s-e;for(i=1;i<=v&&t[s-i]===d[p-i];i++);return Si=d.slice(e,1<i?1-i:void 0)}function Ti(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 Ni(){return!0}function ad(){return!1}function kn(e){function t(s,i,d,p,v){this._reactName=s,this._targetInst=d,this.type=i,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ni:ad,this.isPropagationStopped=ad,this}return W(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ni)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ni)},persist:function(){},isPersistent:Ni}),t}var bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fa=kn(bs),go=W({},bs,{view:0,detail:0}),fg=kn(go),pa,ha,vo,Ci=W({},go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ga,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!==vo&&(vo&&e.type==="mousemove"?(pa=e.screenX-vo.screenX,ha=e.screenY-vo.screenY):ha=pa=0,vo=e),pa)},movementY:function(e){return"movementY"in e?e.movementY:ha}}),cd=kn(Ci),pg=W({},Ci,{dataTransfer:0}),hg=kn(pg),mg=W({},go,{relatedTarget:0}),ma=kn(mg),gg=W({},bs,{animationName:0,elapsedTime:0,pseudoElement:0}),vg=kn(gg),yg=W({},bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xg=kn(yg),wg=W({},bs,{data:0}),ud=kn(wg),kg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sg={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"},Tg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ng(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tg[e])?!!t[e]:!1}function ga(){return Ng}var Cg=W({},go,{key:function(e){if(e.key){var t=kg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ti(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ga,charCode:function(e){return e.type==="keypress"?Ti(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ti(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bg=kn(Cg),Eg=W({},Ci,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dd=kn(Eg),_g=W({},go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ga}),Rg=kn(_g),jg=W({},bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dg=kn(jg),Ig=W({},Ci,{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}),Mg=kn(Ig),Ag=[9,13,27,32],va=h&&"CompositionEvent"in window,yo=null;h&&"documentMode"in document&&(yo=document.documentMode);var Lg=h&&"TextEvent"in window&&!yo,fd=h&&(!va||yo&&8<yo&&11>=yo),pd=" ",hd=!1;function md(e,t){switch(e){case"keyup":return Ag.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function Pg(e,t){switch(e){case"compositionend":return gd(t);case"keypress":return t.which!==32?null:(hd=!0,pd);case"textInput":return e=t.data,e===pd&&hd?null:e;default:return null}}function Og(e,t){if(Es)return e==="compositionend"||!va&&md(e,t)?(e=ld(),Si=da=Dr=null,Es=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fd&&t.locale!=="ko"?null:t.data;default:return null}}var zg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zg[e.type]:t==="textarea"}function yd(e,t,s,i){bt(i),t=ji(t,"onChange"),0<t.length&&(s=new fa("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var xo=null,wo=null;function $g(e){Pd(e,0)}function bi(e){var t=Is(e);if(Re(t))return e}function Fg(e,t){if(e==="change")return t}var xd=!1;if(h){var ya;if(h){var xa="oninput"in document;if(!xa){var wd=document.createElement("div");wd.setAttribute("oninput","return;"),xa=typeof wd.oninput=="function"}ya=xa}else ya=!1;xd=ya&&(!document.documentMode||9<document.documentMode)}function kd(){xo&&(xo.detachEvent("onpropertychange",Sd),wo=xo=null)}function Sd(e){if(e.propertyName==="value"&&bi(wo)){var t=[];yd(t,wo,e,_n(e)),Xt($g,t)}}function Ug(e,t,s){e==="focusin"?(kd(),xo=t,wo=s,xo.attachEvent("onpropertychange",Sd)):e==="focusout"&&kd()}function Bg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bi(wo)}function Wg(e,t){if(e==="click")return bi(t)}function Hg(e,t){if(e==="input"||e==="change")return bi(t)}function Vg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Un=typeof Object.is=="function"?Object.is:Vg;function ko(e,t){if(Un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var d=s[i];if(!m.call(t,d)||!Un(e[d],t[d]))return!1}return!0}function Td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nd(e,t){var s=Td(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Td(s)}}function Cd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bd(){for(var e=window,t=kt();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=kt(e.document)}return t}function wa(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 Gg(e){var t=bd(),s=e.focusedElem,i=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&Cd(s.ownerDocument.documentElement,s)){if(i!==null&&wa(s)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=s.textContent.length,p=Math.min(i.start,d);i=i.end===void 0?p:Math.min(i.end,d),!e.extend&&p>i&&(d=i,i=p,p=d),d=Nd(s,p);var v=Nd(s,i);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>i?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<t.length;s++)e=t[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qg=h&&"documentMode"in document&&11>=document.documentMode,_s=null,ka=null,So=null,Sa=!1;function Ed(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Sa||_s==null||_s!==kt(i)||(i=_s,"selectionStart"in i&&wa(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),So&&ko(So,i)||(So=i,i=ji(ka,"onSelect"),0<i.length&&(t=new fa("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=_s)))}function Ei(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Rs={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionend:Ei("Transition","TransitionEnd")},Ta={},_d={};h&&(_d=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function _i(e){if(Ta[e])return Ta[e];if(!Rs[e])return e;var t=Rs[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in _d)return Ta[e]=t[s];return e}var Rd=_i("animationend"),jd=_i("animationiteration"),Dd=_i("animationstart"),Id=_i("transitionend"),Md=new Map,Ad="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 Ir(e,t){Md.set(e,t),c(t,[e])}for(var Na=0;Na<Ad.length;Na++){var Ca=Ad[Na],Kg=Ca.toLowerCase(),Xg=Ca[0].toUpperCase()+Ca.slice(1);Ir(Kg,"on"+Xg)}Ir(Rd,"onAnimationEnd"),Ir(jd,"onAnimationIteration"),Ir(Dd,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(Id,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),Yg=new Set("cancel close invalid load scroll toggle".split(" ").concat(To));function Ld(e,t,s){var i=e.type||"unknown-event";e.currentTarget=s,ia(i,t,void 0,e),e.currentTarget=null}function Pd(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],d=i.event;i=i.listeners;e:{var p=void 0;if(t)for(var v=i.length-1;0<=v;v--){var T=i[v],_=T.instance,z=T.currentTarget;if(T=T.listener,_!==p&&d.isPropagationStopped())break e;Ld(d,T,z),p=_}else for(v=0;v<i.length;v++){if(T=i[v],_=T.instance,z=T.currentTarget,T=T.listener,_!==p&&d.isPropagationStopped())break e;Ld(d,T,z),p=_}}}if(Ut)throw e=$n,Ut=!1,$n=null,e}function ft(e,t){var s=t[Ma];s===void 0&&(s=t[Ma]=new Set);var i=e+"__bubble";s.has(i)||(Od(t,e,2,!1),s.add(i))}function ba(e,t,s){var i=0;t&&(i|=4),Od(s,e,i,t)}var Ri="_reactListening"+Math.random().toString(36).slice(2);function No(e){if(!e[Ri]){e[Ri]=!0,l.forEach(function(s){s!=="selectionchange"&&(Yg.has(s)||ba(s,!1,e),ba(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ri]||(t[Ri]=!0,ba("selectionchange",!1,t))}}function Od(e,t,s,i){switch(id(t)){case 1:var d=ug;break;case 4:d=dg;break;default:d=ca}s=d.bind(null,t,s,e),d=void 0,!Yt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function Ea(e,t,s,i,d){var p=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var v=i.tag;if(v===3||v===4){var T=i.stateNode.containerInfo;if(T===d||T.nodeType===8&&T.parentNode===d)break;if(v===4)for(v=i.return;v!==null;){var _=v.tag;if((_===3||_===4)&&(_=v.stateNode.containerInfo,_===d||_.nodeType===8&&_.parentNode===d))return;v=v.return}for(;T!==null;){if(v=ss(T),v===null)return;if(_=v.tag,_===5||_===6){i=p=v;continue e}T=T.parentNode}}i=i.return}Xt(function(){var z=p,Y=_n(s),J=[];e:{var X=Md.get(e);if(X!==void 0){var fe=fa,he=e;switch(e){case"keypress":if(Ti(s)===0)break e;case"keydown":case"keyup":fe=bg;break;case"focusin":he="focus",fe=ma;break;case"focusout":he="blur",fe=ma;break;case"beforeblur":case"afterblur":fe=ma;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=cd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=hg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Rg;break;case Rd:case jd:case Dd:fe=vg;break;case Id:fe=Dg;break;case"scroll":fe=fg;break;case"wheel":fe=Mg;break;case"copy":case"cut":case"paste":fe=xg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=dd}var ye=(t&4)!==0,Ct=!ye&&e==="scroll",L=ye?X!==null?X+"Capture":null:X;ye=[];for(var R=z,O;R!==null;){O=R;var se=O.stateNode;if(O.tag===5&&se!==null&&(O=se,L!==null&&(se=ot(R,L),se!=null&&ye.push(Co(R,se,O)))),Ct)break;R=R.return}0<ye.length&&(X=new fe(X,he,null,s,Y),J.push({event:X,listeners:ye}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",X&&s!==zn&&(he=s.relatedTarget||s.fromElement)&&(ss(he)||he[pr]))break e;if((fe||X)&&(X=Y.window===Y?Y:(X=Y.ownerDocument)?X.defaultView||X.parentWindow:window,fe?(he=s.relatedTarget||s.toElement,fe=z,he=he?ss(he):null,he!==null&&(Ct=Ze(he),he!==Ct||he.tag!==5&&he.tag!==6)&&(he=null)):(fe=null,he=z),fe!==he)){if(ye=cd,se="onMouseLeave",L="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ye=dd,se="onPointerLeave",L="onPointerEnter",R="pointer"),Ct=fe==null?X:Is(fe),O=he==null?X:Is(he),X=new ye(se,R+"leave",fe,s,Y),X.target=Ct,X.relatedTarget=O,se=null,ss(Y)===z&&(ye=new ye(L,R+"enter",he,s,Y),ye.target=O,ye.relatedTarget=Ct,se=ye),Ct=se,fe&&he)t:{for(ye=fe,L=he,R=0,O=ye;O;O=js(O))R++;for(O=0,se=L;se;se=js(se))O++;for(;0<R-O;)ye=js(ye),R--;for(;0<O-R;)L=js(L),O--;for(;R--;){if(ye===L||L!==null&&ye===L.alternate)break t;ye=js(ye),L=js(L)}ye=null}else ye=null;fe!==null&&zd(J,X,fe,ye,!1),he!==null&&Ct!==null&&zd(J,Ct,he,ye,!0)}}e:{if(X=z?Is(z):window,fe=X.nodeName&&X.nodeName.toLowerCase(),fe==="select"||fe==="input"&&X.type==="file")var xe=Fg;else if(vd(X))if(xd)xe=Hg;else{xe=Bg;var be=Ug}else(fe=X.nodeName)&&fe.toLowerCase()==="input"&&(X.type==="checkbox"||X.type==="radio")&&(xe=Wg);if(xe&&(xe=xe(e,z))){yd(J,xe,s,Y);break e}be&&be(e,X,z),e==="focusout"&&(be=X._wrapperState)&&be.controlled&&X.type==="number"&&ve(X,"number",X.value)}switch(be=z?Is(z):window,e){case"focusin":(vd(be)||be.contentEditable==="true")&&(_s=be,ka=z,So=null);break;case"focusout":So=ka=_s=null;break;case"mousedown":Sa=!0;break;case"contextmenu":case"mouseup":case"dragend":Sa=!1,Ed(J,s,Y);break;case"selectionchange":if(qg)break;case"keydown":case"keyup":Ed(J,s,Y)}var Ee;if(va)e:{switch(e){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Es?md(e,s)&&(Ie="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ie="onCompositionStart");Ie&&(fd&&s.locale!=="ko"&&(Es||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Es&&(Ee=ld()):(Dr=Y,da="value"in Dr?Dr.value:Dr.textContent,Es=!0)),be=ji(z,Ie),0<be.length&&(Ie=new ud(Ie,e,null,s,Y),J.push({event:Ie,listeners:be}),Ee?Ie.data=Ee:(Ee=gd(s),Ee!==null&&(Ie.data=Ee)))),(Ee=Lg?Pg(e,s):Og(e,s))&&(z=ji(z,"onBeforeInput"),0<z.length&&(Y=new ud("onBeforeInput","beforeinput",null,s,Y),J.push({event:Y,listeners:z}),Y.data=Ee))}Pd(J,t)})}function Co(e,t,s){return{instance:e,listener:t,currentTarget:s}}function ji(e,t){for(var s=t+"Capture",i=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=ot(e,s),p!=null&&i.unshift(Co(e,p,d)),p=ot(e,t),p!=null&&i.push(Co(e,p,d))),e=e.return}return i}function js(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zd(e,t,s,i,d){for(var p=t._reactName,v=[];s!==null&&s!==i;){var T=s,_=T.alternate,z=T.stateNode;if(_!==null&&_===i)break;T.tag===5&&z!==null&&(T=z,d?(_=ot(s,p),_!=null&&v.unshift(Co(s,_,T))):d||(_=ot(s,p),_!=null&&v.push(Co(s,_,T)))),s=s.return}v.length!==0&&e.push({event:t,listeners:v})}var Qg=/\r\n?/g,Zg=/\u0000|\uFFFD/g;function $d(e){return(typeof e=="string"?e:""+e).replace(Qg,`
38
+ `).replace(Zg,"")}function Di(e,t,s){if(t=$d(t),$d(e)!==t&&s)throw Error(o(425))}function Ii(){}var _a=null,Ra=null;function ja(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 Da=typeof setTimeout=="function"?setTimeout:void 0,Jg=typeof clearTimeout=="function"?clearTimeout:void 0,Fd=typeof Promise=="function"?Promise:void 0,ev=typeof queueMicrotask=="function"?queueMicrotask:typeof Fd<"u"?function(e){return Fd.resolve(null).then(e).catch(tv)}:Da;function tv(e){setTimeout(function(){throw e})}function Ia(e,t){var s=t,i=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(i===0){e.removeChild(d),mo(t);return}i--}else s!=="$"&&s!=="$?"&&s!=="$!"||i++;s=d}while(s);mo(t)}function Mr(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 Ud(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(t===0)return e;t--}else s==="/$"&&t++}e=e.previousSibling}return null}var Ds=Math.random().toString(36).slice(2),Jn="__reactFiber$"+Ds,bo="__reactProps$"+Ds,pr="__reactContainer$"+Ds,Ma="__reactEvents$"+Ds,nv="__reactListeners$"+Ds,rv="__reactHandles$"+Ds;function ss(e){var t=e[Jn];if(t)return t;for(var s=e.parentNode;s;){if(t=s[pr]||s[Jn]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Ud(e);e!==null;){if(s=e[Jn])return s;e=Ud(e)}return t}e=s,s=e.parentNode}return null}function Eo(e){return e=e[Jn]||e[pr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Is(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function Mi(e){return e[bo]||null}var Aa=[],Ms=-1;function Ar(e){return{current:e}}function pt(e){0>Ms||(e.current=Aa[Ms],Aa[Ms]=null,Ms--)}function ct(e,t){Ms++,Aa[Ms]=e.current,e.current=t}var Lr={},Qt=Ar(Lr),fn=Ar(!1),os=Lr;function As(e,t){var s=e.type.contextTypes;if(!s)return Lr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in s)d[p]=t[p];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function pn(e){return e=e.childContextTypes,e!=null}function Ai(){pt(fn),pt(Qt)}function Bd(e,t,s){if(Qt.current!==Lr)throw Error(o(168));ct(Qt,t),ct(fn,s)}function Wd(e,t,s){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(o(108,Le(e)||"Unknown",d));return W({},s,i)}function Li(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lr,os=Qt.current,ct(Qt,e),ct(fn,fn.current),!0}function Hd(e,t,s){var i=e.stateNode;if(!i)throw Error(o(169));s?(e=Wd(e,t,os),i.__reactInternalMemoizedMergedChildContext=e,pt(fn),pt(Qt),ct(Qt,e)):pt(fn),ct(fn,s)}var hr=null,Pi=!1,La=!1;function Vd(e){hr===null?hr=[e]:hr.push(e)}function sv(e){Pi=!0,Vd(e)}function Pr(){if(!La&&hr!==null){La=!0;var e=0,t=He;try{var s=hr;for(He=1;e<s.length;e++){var i=s[e];do i=i(!0);while(i!==null)}hr=null,Pi=!1}catch(d){throw hr!==null&&(hr=hr.slice(e+1)),ao(Er,Pr),d}finally{He=t,La=!1}}return null}var Ls=[],Ps=0,Oi=null,zi=0,jn=[],Dn=0,is=null,mr=1,gr="";function ls(e,t){Ls[Ps++]=zi,Ls[Ps++]=Oi,Oi=e,zi=t}function Gd(e,t,s){jn[Dn++]=mr,jn[Dn++]=gr,jn[Dn++]=is,is=e;var i=mr;e=gr;var d=32-rn(i)-1;i&=~(1<<d),s+=1;var p=32-rn(t)+d;if(30<p){var v=d-d%5;p=(i&(1<<v)-1).toString(32),i>>=v,d-=v,mr=1<<32-rn(t)+d|s<<d|i,gr=p+e}else mr=1<<p|s<<d|i,gr=e}function Pa(e){e.return!==null&&(ls(e,1),Gd(e,1,0))}function Oa(e){for(;e===Oi;)Oi=Ls[--Ps],Ls[Ps]=null,zi=Ls[--Ps],Ls[Ps]=null;for(;e===is;)is=jn[--Dn],jn[Dn]=null,gr=jn[--Dn],jn[Dn]=null,mr=jn[--Dn],jn[Dn]=null}var Sn=null,Tn=null,ht=!1,Bn=null;function qd(e,t){var s=Ln(5,null,null,0);s.elementType="DELETED",s.stateNode=t,s.return=e,t=e.deletions,t===null?(e.deletions=[s],e.flags|=16):t.push(s)}function Kd(e,t){switch(e.tag){case 5:var s=e.type;return t=t.nodeType!==1||s.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Sn=e,Tn=Mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Sn=e,Tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(s=is!==null?{id:mr,overflow:gr}:null,e.memoizedState={dehydrated:t,treeContext:s,retryLane:1073741824},s=Ln(18,null,null,0),s.stateNode=t,s.return=e,e.child=s,Sn=e,Tn=null,!0):!1;default:return!1}}function za(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $a(e){if(ht){var t=Tn;if(t){var s=t;if(!Kd(e,t)){if(za(e))throw Error(o(418));t=Mr(s.nextSibling);var i=Sn;t&&Kd(e,t)?qd(i,s):(e.flags=e.flags&-4097|2,ht=!1,Sn=e)}}else{if(za(e))throw Error(o(418));e.flags=e.flags&-4097|2,ht=!1,Sn=e}}}function Xd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Sn=e}function $i(e){if(e!==Sn)return!1;if(!ht)return Xd(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ja(e.type,e.memoizedProps)),t&&(t=Tn)){if(za(e))throw Yd(),Error(o(418));for(;t;)qd(e,t),t=Mr(t.nextSibling)}if(Xd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(t===0){Tn=Mr(e.nextSibling);break e}t--}else s!=="$"&&s!=="$!"&&s!=="$?"||t++}e=e.nextSibling}Tn=null}}else Tn=Sn?Mr(e.stateNode.nextSibling):null;return!0}function Yd(){for(var e=Tn;e;)e=Mr(e.nextSibling)}function Os(){Tn=Sn=null,ht=!1}function Fa(e){Bn===null?Bn=[e]:Bn.push(e)}var ov=P.ReactCurrentBatchConfig;function _o(e,t,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(o(309));var i=s.stateNode}if(!i)throw Error(o(147,e));var d=i,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(v){var T=d.refs;v===null?delete T[p]:T[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(o(284));if(!s._owner)throw Error(o(290,e))}return e}function Fi(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qd(e){var t=e._init;return t(e._payload)}function Zd(e){function t(L,R){if(e){var O=L.deletions;O===null?(L.deletions=[R],L.flags|=16):O.push(R)}}function s(L,R){if(!e)return null;for(;R!==null;)t(L,R),R=R.sibling;return null}function i(L,R){for(L=new Map;R!==null;)R.key!==null?L.set(R.key,R):L.set(R.index,R),R=R.sibling;return L}function d(L,R){return L=Hr(L,R),L.index=0,L.sibling=null,L}function p(L,R,O){return L.index=O,e?(O=L.alternate,O!==null?(O=O.index,O<R?(L.flags|=2,R):O):(L.flags|=2,R)):(L.flags|=1048576,R)}function v(L){return e&&L.alternate===null&&(L.flags|=2),L}function T(L,R,O,se){return R===null||R.tag!==6?(R=Dc(O,L.mode,se),R.return=L,R):(R=d(R,O),R.return=L,R)}function _(L,R,O,se){var xe=O.type;return xe===q?Y(L,R,O.props.children,se,O.key):R!==null&&(R.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===te&&Qd(xe)===R.type)?(se=d(R,O.props),se.ref=_o(L,R,O),se.return=L,se):(se=ul(O.type,O.key,O.props,null,L.mode,se),se.ref=_o(L,R,O),se.return=L,se)}function z(L,R,O,se){return R===null||R.tag!==4||R.stateNode.containerInfo!==O.containerInfo||R.stateNode.implementation!==O.implementation?(R=Ic(O,L.mode,se),R.return=L,R):(R=d(R,O.children||[]),R.return=L,R)}function Y(L,R,O,se,xe){return R===null||R.tag!==7?(R=ms(O,L.mode,se,xe),R.return=L,R):(R=d(R,O),R.return=L,R)}function J(L,R,O){if(typeof R=="string"&&R!==""||typeof R=="number")return R=Dc(""+R,L.mode,O),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case V:return O=ul(R.type,R.key,R.props,null,L.mode,O),O.ref=_o(L,null,R),O.return=L,O;case ee:return R=Ic(R,L.mode,O),R.return=L,R;case te:var se=R._init;return J(L,se(R._payload),O)}if(Fe(R)||Z(R))return R=ms(R,L.mode,O,null),R.return=L,R;Fi(L,R)}return null}function X(L,R,O,se){var xe=R!==null?R.key:null;if(typeof O=="string"&&O!==""||typeof O=="number")return xe!==null?null:T(L,R,""+O,se);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case V:return O.key===xe?_(L,R,O,se):null;case ee:return O.key===xe?z(L,R,O,se):null;case te:return xe=O._init,X(L,R,xe(O._payload),se)}if(Fe(O)||Z(O))return xe!==null?null:Y(L,R,O,se,null);Fi(L,O)}return null}function fe(L,R,O,se,xe){if(typeof se=="string"&&se!==""||typeof se=="number")return L=L.get(O)||null,T(R,L,""+se,xe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case V:return L=L.get(se.key===null?O:se.key)||null,_(R,L,se,xe);case ee:return L=L.get(se.key===null?O:se.key)||null,z(R,L,se,xe);case te:var be=se._init;return fe(L,R,O,be(se._payload),xe)}if(Fe(se)||Z(se))return L=L.get(O)||null,Y(R,L,se,xe,null);Fi(R,se)}return null}function he(L,R,O,se){for(var xe=null,be=null,Ee=R,Ie=R=0,Ot=null;Ee!==null&&Ie<O.length;Ie++){Ee.index>Ie?(Ot=Ee,Ee=null):Ot=Ee.sibling;var Ye=X(L,Ee,O[Ie],se);if(Ye===null){Ee===null&&(Ee=Ot);break}e&&Ee&&Ye.alternate===null&&t(L,Ee),R=p(Ye,R,Ie),be===null?xe=Ye:be.sibling=Ye,be=Ye,Ee=Ot}if(Ie===O.length)return s(L,Ee),ht&&ls(L,Ie),xe;if(Ee===null){for(;Ie<O.length;Ie++)Ee=J(L,O[Ie],se),Ee!==null&&(R=p(Ee,R,Ie),be===null?xe=Ee:be.sibling=Ee,be=Ee);return ht&&ls(L,Ie),xe}for(Ee=i(L,Ee);Ie<O.length;Ie++)Ot=fe(Ee,L,Ie,O[Ie],se),Ot!==null&&(e&&Ot.alternate!==null&&Ee.delete(Ot.key===null?Ie:Ot.key),R=p(Ot,R,Ie),be===null?xe=Ot:be.sibling=Ot,be=Ot);return e&&Ee.forEach(function(Vr){return t(L,Vr)}),ht&&ls(L,Ie),xe}function ye(L,R,O,se){var xe=Z(O);if(typeof xe!="function")throw Error(o(150));if(O=xe.call(O),O==null)throw Error(o(151));for(var be=xe=null,Ee=R,Ie=R=0,Ot=null,Ye=O.next();Ee!==null&&!Ye.done;Ie++,Ye=O.next()){Ee.index>Ie?(Ot=Ee,Ee=null):Ot=Ee.sibling;var Vr=X(L,Ee,Ye.value,se);if(Vr===null){Ee===null&&(Ee=Ot);break}e&&Ee&&Vr.alternate===null&&t(L,Ee),R=p(Vr,R,Ie),be===null?xe=Vr:be.sibling=Vr,be=Vr,Ee=Ot}if(Ye.done)return s(L,Ee),ht&&ls(L,Ie),xe;if(Ee===null){for(;!Ye.done;Ie++,Ye=O.next())Ye=J(L,Ye.value,se),Ye!==null&&(R=p(Ye,R,Ie),be===null?xe=Ye:be.sibling=Ye,be=Ye);return ht&&ls(L,Ie),xe}for(Ee=i(L,Ee);!Ye.done;Ie++,Ye=O.next())Ye=fe(Ee,L,Ie,Ye.value,se),Ye!==null&&(e&&Ye.alternate!==null&&Ee.delete(Ye.key===null?Ie:Ye.key),R=p(Ye,R,Ie),be===null?xe=Ye:be.sibling=Ye,be=Ye);return e&&Ee.forEach(function(zv){return t(L,zv)}),ht&&ls(L,Ie),xe}function Ct(L,R,O,se){if(typeof O=="object"&&O!==null&&O.type===q&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case V:e:{for(var xe=O.key,be=R;be!==null;){if(be.key===xe){if(xe=O.type,xe===q){if(be.tag===7){s(L,be.sibling),R=d(be,O.props.children),R.return=L,L=R;break e}}else if(be.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===te&&Qd(xe)===be.type){s(L,be.sibling),R=d(be,O.props),R.ref=_o(L,be,O),R.return=L,L=R;break e}s(L,be);break}else t(L,be);be=be.sibling}O.type===q?(R=ms(O.props.children,L.mode,se,O.key),R.return=L,L=R):(se=ul(O.type,O.key,O.props,null,L.mode,se),se.ref=_o(L,R,O),se.return=L,L=se)}return v(L);case ee:e:{for(be=O.key;R!==null;){if(R.key===be)if(R.tag===4&&R.stateNode.containerInfo===O.containerInfo&&R.stateNode.implementation===O.implementation){s(L,R.sibling),R=d(R,O.children||[]),R.return=L,L=R;break e}else{s(L,R);break}else t(L,R);R=R.sibling}R=Ic(O,L.mode,se),R.return=L,L=R}return v(L);case te:return be=O._init,Ct(L,R,be(O._payload),se)}if(Fe(O))return he(L,R,O,se);if(Z(O))return ye(L,R,O,se);Fi(L,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,R!==null&&R.tag===6?(s(L,R.sibling),R=d(R,O),R.return=L,L=R):(s(L,R),R=Dc(O,L.mode,se),R.return=L,L=R),v(L)):s(L,R)}return Ct}var zs=Zd(!0),Jd=Zd(!1),Ui=Ar(null),Bi=null,$s=null,Ua=null;function Ba(){Ua=$s=Bi=null}function Wa(e){var t=Ui.current;pt(Ui),e._currentValue=t}function Ha(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function Fs(e,t){Bi=e,Ua=$s=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(hn=!0),e.firstContext=null)}function In(e){var t=e._currentValue;if(Ua!==e)if(e={context:e,memoizedValue:t,next:null},$s===null){if(Bi===null)throw Error(o(308));$s=e,Bi.dependencies={lanes:0,firstContext:e}}else $s=$s.next=e;return t}var as=null;function Va(e){as===null?as=[e]:as.push(e)}function ef(e,t,s,i){var d=t.interleaved;return d===null?(s.next=s,Va(t)):(s.next=d.next,d.next=s),t.interleaved=s,vr(e,i)}function vr(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var Or=!1;function Ga(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tf(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 yr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zr(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ge&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,vr(e,s)}return d=i.interleaved,d===null?(t.next=t,Va(i)):(t.next=d.next,d.next=t),i.interleaved=t,vr(e,s)}function Wi(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,Rr(e,s)}}function nf(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var d=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var v={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};p===null?d=p=v:p=p.next=v,s=s.next}while(s!==null);p===null?d=p=t:p=p.next=t}else d=p=t;s={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:i.shared,effects:i.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function Hi(e,t,s,i){var d=e.updateQueue;Or=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var _=T,z=_.next;_.next=null,v===null?p=z:v.next=z,v=_;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,T=Y.lastBaseUpdate,T!==v&&(T===null?Y.firstBaseUpdate=z:T.next=z,Y.lastBaseUpdate=_))}if(p!==null){var J=d.baseState;v=0,Y=z=_=null,T=p;do{var X=T.lane,fe=T.eventTime;if((i&X)===X){Y!==null&&(Y=Y.next={eventTime:fe,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var he=e,ye=T;switch(X=t,fe=s,ye.tag){case 1:if(he=ye.payload,typeof he=="function"){J=he.call(fe,J,X);break e}J=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,X=typeof he=="function"?he.call(fe,J,X):he,X==null)break e;J=W({},J,X);break e;case 2:Or=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,X=d.effects,X===null?d.effects=[T]:X.push(T))}else fe={eventTime:fe,lane:X,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Y===null?(z=Y=fe,_=J):Y=Y.next=fe,v|=X;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;X=T,T=X.next,X.next=null,d.lastBaseUpdate=X,d.shared.pending=null}}while(!0);if(Y===null&&(_=J),d.baseState=_,d.firstBaseUpdate=z,d.lastBaseUpdate=Y,t=d.shared.interleaved,t!==null){d=t;do v|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);ds|=v,e.lanes=v,e.memoizedState=J}}function rf(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],d=i.callback;if(d!==null){if(i.callback=null,i=s,typeof d!="function")throw Error(o(191,d));d.call(i)}}}var Ro={},er=Ar(Ro),jo=Ar(Ro),Do=Ar(Ro);function cs(e){if(e===Ro)throw Error(o(174));return e}function qa(e,t){switch(ct(Do,t),ct(jo,e),ct(er,Ro),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:tt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=tt(t,e)}pt(er),ct(er,t)}function Us(){pt(er),pt(jo),pt(Do)}function sf(e){cs(Do.current);var t=cs(er.current),s=tt(t,e.type);t!==s&&(ct(jo,e),ct(er,s))}function Ka(e){jo.current===e&&(pt(er),pt(jo))}var yt=Ar(0);function Vi(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.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 Xa=[];function Ya(){for(var e=0;e<Xa.length;e++)Xa[e]._workInProgressVersionPrimary=null;Xa.length=0}var Gi=P.ReactCurrentDispatcher,Qa=P.ReactCurrentBatchConfig,us=0,xt=null,Dt=null,Lt=null,qi=!1,Io=!1,Mo=0,iv=0;function Zt(){throw Error(o(321))}function Za(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Un(e[s],t[s]))return!1;return!0}function Ja(e,t,s,i,d,p){if(us=p,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Gi.current=e===null||e.memoizedState===null?uv:dv,e=s(i,d),Io){p=0;do{if(Io=!1,Mo=0,25<=p)throw Error(o(301));p+=1,Lt=Dt=null,t.updateQueue=null,Gi.current=fv,e=s(i,d)}while(Io)}if(Gi.current=Yi,t=Dt!==null&&Dt.next!==null,us=0,Lt=Dt=xt=null,qi=!1,t)throw Error(o(300));return e}function ec(){var e=Mo!==0;return Mo=0,e}function tr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?xt.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Mn(){if(Dt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Dt.next;var t=Lt===null?xt.memoizedState:Lt.next;if(t!==null)Lt=t,Dt=e;else{if(e===null)throw Error(o(310));Dt=e,e={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},Lt===null?xt.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Ao(e,t){return typeof t=="function"?t(e):t}function tc(e){var t=Mn(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=Dt,d=i.baseQueue,p=s.pending;if(p!==null){if(d!==null){var v=d.next;d.next=p.next,p.next=v}i.baseQueue=d=p,s.pending=null}if(d!==null){p=d.next,i=i.baseState;var T=v=null,_=null,z=p;do{var Y=z.lane;if((us&Y)===Y)_!==null&&(_=_.next={lane:0,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),i=z.hasEagerState?z.eagerState:e(i,z.action);else{var J={lane:Y,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null};_===null?(T=_=J,v=i):_=_.next=J,xt.lanes|=Y,ds|=Y}z=z.next}while(z!==null&&z!==p);_===null?v=i:_.next=T,Un(i,t.memoizedState)||(hn=!0),t.memoizedState=i,t.baseState=v,t.baseQueue=_,s.lastRenderedState=i}if(e=s.interleaved,e!==null){d=e;do p=d.lane,xt.lanes|=p,ds|=p,d=d.next;while(d!==e)}else d===null&&(s.lanes=0);return[t.memoizedState,s.dispatch]}function nc(e){var t=Mn(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,d=s.pending,p=t.memoizedState;if(d!==null){s.pending=null;var v=d=d.next;do p=e(p,v.action),v=v.next;while(v!==d);Un(p,t.memoizedState)||(hn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),s.lastRenderedState=p}return[p,i]}function of(){}function lf(e,t){var s=xt,i=Mn(),d=t(),p=!Un(i.memoizedState,d);if(p&&(i.memoizedState=d,hn=!0),i=i.queue,rc(uf.bind(null,s,i,e),[e]),i.getSnapshot!==t||p||Lt!==null&&Lt.memoizedState.tag&1){if(s.flags|=2048,Lo(9,cf.bind(null,s,i,d,t),void 0,null),Pt===null)throw Error(o(349));(us&30)!==0||af(s,t,d)}return d}function af(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function cf(e,t,s,i){t.value=s,t.getSnapshot=i,df(t)&&ff(e)}function uf(e,t,s){return s(function(){df(t)&&ff(e)})}function df(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Un(e,s)}catch{return!0}}function ff(e){var t=vr(e,1);t!==null&&Gn(t,e,1,-1)}function pf(e){var t=tr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t.queue=e,e=e.dispatch=cv.bind(null,xt,e),[t.memoizedState,e]}function Lo(e,t,s,i){return e={tag:e,create:t,destroy:s,deps:i,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e)),e}function hf(){return Mn().memoizedState}function Ki(e,t,s,i){var d=tr();xt.flags|=e,d.memoizedState=Lo(1|t,s,void 0,i===void 0?null:i)}function Xi(e,t,s,i){var d=Mn();i=i===void 0?null:i;var p=void 0;if(Dt!==null){var v=Dt.memoizedState;if(p=v.destroy,i!==null&&Za(i,v.deps)){d.memoizedState=Lo(t,s,p,i);return}}xt.flags|=e,d.memoizedState=Lo(1|t,s,p,i)}function mf(e,t){return Ki(8390656,8,e,t)}function rc(e,t){return Xi(2048,8,e,t)}function gf(e,t){return Xi(4,2,e,t)}function vf(e,t){return Xi(4,4,e,t)}function yf(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 xf(e,t,s){return s=s!=null?s.concat([e]):null,Xi(4,4,yf.bind(null,t,e),s)}function sc(){}function wf(e,t){var s=Mn();t=t===void 0?null:t;var i=s.memoizedState;return i!==null&&t!==null&&Za(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function kf(e,t){var s=Mn();t=t===void 0?null:t;var i=s.memoizedState;return i!==null&&t!==null&&Za(t,i[1])?i[0]:(e=e(),s.memoizedState=[e,t],e)}function Sf(e,t,s){return(us&21)===0?(e.baseState&&(e.baseState=!1,hn=!0),e.memoizedState=s):(Un(s,t)||(s=uo(),xt.lanes|=s,ds|=s,e.baseState=!0),t)}function lv(e,t){var s=He;He=s!==0&&4>s?s:4,e(!0);var i=Qa.transition;Qa.transition={};try{e(!1),t()}finally{He=s,Qa.transition=i}}function Tf(){return Mn().memoizedState}function av(e,t,s){var i=Br(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},Nf(e))Cf(t,s);else if(s=ef(e,t,s,i),s!==null){var d=ln();Gn(s,e,i,d),bf(s,t,i)}}function cv(e,t,s){var i=Br(e),d={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(Nf(e))Cf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var v=t.lastRenderedState,T=p(v,s);if(d.hasEagerState=!0,d.eagerState=T,Un(T,v)){var _=t.interleaved;_===null?(d.next=d,Va(t)):(d.next=_.next,_.next=d),t.interleaved=d;return}}catch{}finally{}s=ef(e,t,d,i),s!==null&&(d=ln(),Gn(s,e,i,d),bf(s,t,i))}}function Nf(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function Cf(e,t){Io=qi=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function bf(e,t,s){if((s&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,Rr(e,s)}}var Yi={readContext:In,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},uv={readContext:In,useCallback:function(e,t){return tr().memoizedState=[e,t===void 0?null:t],e},useContext:In,useEffect:mf,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,Ki(4194308,4,yf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ki(4,2,e,t)},useMemo:function(e,t){var s=tr();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var i=tr();return t=s!==void 0?s(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=av.bind(null,xt,e),[i.memoizedState,e]},useRef:function(e){var t=tr();return e={current:e},t.memoizedState=e},useState:pf,useDebugValue:sc,useDeferredValue:function(e){return tr().memoizedState=e},useTransition:function(){var e=pf(!1),t=e[0];return e=lv.bind(null,e[1]),tr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var i=xt,d=tr();if(ht){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Pt===null)throw Error(o(349));(us&30)!==0||af(i,t,s)}d.memoizedState=s;var p={value:s,getSnapshot:t};return d.queue=p,mf(uf.bind(null,i,p,e),[e]),i.flags|=2048,Lo(9,cf.bind(null,i,p,s,t),void 0,null),s},useId:function(){var e=tr(),t=Pt.identifierPrefix;if(ht){var s=gr,i=mr;s=(i&~(1<<32-rn(i)-1)).toString(32)+s,t=":"+t+"R"+s,s=Mo++,0<s&&(t+="H"+s.toString(32)),t+=":"}else s=iv++,t=":"+t+"r"+s.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dv={readContext:In,useCallback:wf,useContext:In,useEffect:rc,useImperativeHandle:xf,useInsertionEffect:gf,useLayoutEffect:vf,useMemo:kf,useReducer:tc,useRef:hf,useState:function(){return tc(Ao)},useDebugValue:sc,useDeferredValue:function(e){var t=Mn();return Sf(t,Dt.memoizedState,e)},useTransition:function(){var e=tc(Ao)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:of,useSyncExternalStore:lf,useId:Tf,unstable_isNewReconciler:!1},fv={readContext:In,useCallback:wf,useContext:In,useEffect:rc,useImperativeHandle:xf,useInsertionEffect:gf,useLayoutEffect:vf,useMemo:kf,useReducer:nc,useRef:hf,useState:function(){return nc(Ao)},useDebugValue:sc,useDeferredValue:function(e){var t=Mn();return Dt===null?t.memoizedState=e:Sf(t,Dt.memoizedState,e)},useTransition:function(){var e=nc(Ao)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:of,useSyncExternalStore:lf,useId:Tf,unstable_isNewReconciler:!1};function Wn(e,t){if(e&&e.defaultProps){t=W({},t),e=e.defaultProps;for(var s in e)t[s]===void 0&&(t[s]=e[s]);return t}return t}function oc(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:W({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Qi={isMounted:function(e){return(e=e._reactInternals)?Ze(e)===e:!1},enqueueSetState:function(e,t,s){e=e._reactInternals;var i=ln(),d=Br(e),p=yr(i,d);p.payload=t,s!=null&&(p.callback=s),t=zr(e,p,d),t!==null&&(Gn(t,e,d,i),Wi(t,e,d))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=ln(),d=Br(e),p=yr(i,d);p.tag=1,p.payload=t,s!=null&&(p.callback=s),t=zr(e,p,d),t!==null&&(Gn(t,e,d,i),Wi(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=ln(),i=Br(e),d=yr(s,i);d.tag=2,t!=null&&(d.callback=t),t=zr(e,d,i),t!==null&&(Gn(t,e,i,s),Wi(t,e,i))}};function Ef(e,t,s,i,d,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,v):t.prototype&&t.prototype.isPureReactComponent?!ko(s,i)||!ko(d,p):!0}function _f(e,t,s){var i=!1,d=Lr,p=t.contextType;return typeof p=="object"&&p!==null?p=In(p):(d=pn(t)?os:Qt.current,i=t.contextTypes,p=(i=i!=null)?As(e,d):Lr),t=new t(s,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qi,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Rf(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Qi.enqueueReplaceState(t,t.state,null)}function ic(e,t,s,i){var d=e.stateNode;d.props=s,d.state=e.memoizedState,d.refs={},Ga(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=In(p):(p=pn(t)?os:Qt.current,d.context=As(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(oc(e,t,p,s),d.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(t=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),t!==d.state&&Qi.enqueueReplaceState(d,d.state,null),Hi(e,s,d,i),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Bs(e,t){try{var s="",i=t;do s+=ge(i),i=i.return;while(i);var d=s}catch(p){d=`
39
+ Error generating stack: `+p.message+`
40
+ `+p.stack}return{value:e,source:t,stack:d,digest:null}}function lc(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function ac(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var pv=typeof WeakMap=="function"?WeakMap:Map;function jf(e,t,s){s=yr(-1,s),s.tag=3,s.payload={element:null};var i=t.value;return s.callback=function(){sl||(sl=!0,Tc=i),ac(e,t)},s}function Df(e,t,s){s=yr(-1,s),s.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var d=t.value;s.payload=function(){return i(d)},s.callback=function(){ac(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(s.callback=function(){ac(e,t),typeof i!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),s}function If(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new pv;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(s)||(d.add(s),e=Ev.bind(null,e,t,s),t.then(e,e))}function Mf(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 Af(e,t,s,i,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=yr(-1,1),t.tag=2,zr(s,t,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var hv=P.ReactCurrentOwner,hn=!1;function on(e,t,s,i){t.child=e===null?Jd(t,null,s,i):zs(t,e.child,s,i)}function Lf(e,t,s,i,d){s=s.render;var p=t.ref;return Fs(t,d),i=Ja(e,t,s,i,p,d),s=ec(),e!==null&&!hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,xr(e,t,d)):(ht&&s&&Pa(t),t.flags|=1,on(e,t,i,d),t.child)}function Pf(e,t,s,i,d){if(e===null){var p=s.type;return typeof p=="function"&&!jc(p)&&p.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=p,Of(e,t,p,i,d)):(e=ul(s.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var v=p.memoizedProps;if(s=s.compare,s=s!==null?s:ko,s(v,i)&&e.ref===t.ref)return xr(e,t,d)}return t.flags|=1,e=Hr(p,i),e.ref=t.ref,e.return=t,t.child=e}function Of(e,t,s,i,d){if(e!==null){var p=e.memoizedProps;if(ko(p,i)&&e.ref===t.ref)if(hn=!1,t.pendingProps=i=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(hn=!0);else return t.lanes=e.lanes,xr(e,t,d)}return cc(e,t,s,i,d)}function zf(e,t,s){var i=t.pendingProps,d=i.children,p=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(Hs,Nn),Nn|=s;else{if((s&1073741824)===0)return e=p!==null?p.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(Hs,Nn),Nn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=p!==null?p.baseLanes:s,ct(Hs,Nn),Nn|=i}else p!==null?(i=p.baseLanes|s,t.memoizedState=null):i=s,ct(Hs,Nn),Nn|=i;return on(e,t,d,s),t.child}function $f(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function cc(e,t,s,i,d){var p=pn(s)?os:Qt.current;return p=As(t,p),Fs(t,d),s=Ja(e,t,s,i,p,d),i=ec(),e!==null&&!hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,xr(e,t,d)):(ht&&i&&Pa(t),t.flags|=1,on(e,t,s,d),t.child)}function Ff(e,t,s,i,d){if(pn(s)){var p=!0;Li(t)}else p=!1;if(Fs(t,d),t.stateNode===null)Ji(e,t),_f(t,s,i),ic(t,s,i,d),i=!0;else if(e===null){var v=t.stateNode,T=t.memoizedProps;v.props=T;var _=v.context,z=s.contextType;typeof z=="object"&&z!==null?z=In(z):(z=pn(s)?os:Qt.current,z=As(t,z));var Y=s.getDerivedStateFromProps,J=typeof Y=="function"||typeof v.getSnapshotBeforeUpdate=="function";J||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==i||_!==z)&&Rf(t,v,i,z),Or=!1;var X=t.memoizedState;v.state=X,Hi(t,i,v,d),_=t.memoizedState,T!==i||X!==_||fn.current||Or?(typeof Y=="function"&&(oc(t,s,Y,i),_=t.memoizedState),(T=Or||Ef(t,s,T,i,X,_,z))?(J||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=_),v.props=i,v.state=_,v.context=z,i=T):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{v=t.stateNode,tf(e,t),T=t.memoizedProps,z=t.type===t.elementType?T:Wn(t.type,T),v.props=z,J=t.pendingProps,X=v.context,_=s.contextType,typeof _=="object"&&_!==null?_=In(_):(_=pn(s)?os:Qt.current,_=As(t,_));var fe=s.getDerivedStateFromProps;(Y=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==J||X!==_)&&Rf(t,v,i,_),Or=!1,X=t.memoizedState,v.state=X,Hi(t,i,v,d);var he=t.memoizedState;T!==J||X!==he||fn.current||Or?(typeof fe=="function"&&(oc(t,s,fe,i),he=t.memoizedState),(z=Or||Ef(t,s,z,i,X,he,_)||!1)?(Y||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(i,he,_),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(i,he,_)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=he),v.props=i,v.state=he,v.context=_,i=z):(typeof v.componentDidUpdate!="function"||T===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),i=!1)}return uc(e,t,s,i,p,d)}function uc(e,t,s,i,d,p){$f(e,t);var v=(t.flags&128)!==0;if(!i&&!v)return d&&Hd(t,s,!1),xr(e,t,p);i=t.stateNode,hv.current=t;var T=v&&typeof s.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&v?(t.child=zs(t,e.child,null,p),t.child=zs(t,null,T,p)):on(e,t,T,p),t.memoizedState=i.state,d&&Hd(t,s,!0),t.child}function Uf(e){var t=e.stateNode;t.pendingContext?Bd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bd(e,t.context,!1),qa(e,t.containerInfo)}function Bf(e,t,s,i,d){return Os(),Fa(d),t.flags|=256,on(e,t,s,i),t.child}var dc={dehydrated:null,treeContext:null,retryLane:0};function fc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Wf(e,t,s){var i=t.pendingProps,d=yt.current,p=!1,v=(t.flags&128)!==0,T;if((T=v)||(T=e!==null&&e.memoizedState===null?!1:(d&2)!==0),T?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ct(yt,d&1),e===null)return $a(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):(v=i.children,e=i.fallback,p?(i=t.mode,p=t.child,v={mode:"hidden",children:v},(i&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=v):p=dl(v,i,0,null),e=ms(e,i,s,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=fc(s),t.memoizedState=dc,e):pc(t,v));if(d=e.memoizedState,d!==null&&(T=d.dehydrated,T!==null))return mv(e,t,v,i,T,d,s);if(p){p=i.fallback,v=t.mode,d=e.child,T=d.sibling;var _={mode:"hidden",children:i.children};return(v&1)===0&&t.child!==d?(i=t.child,i.childLanes=0,i.pendingProps=_,t.deletions=null):(i=Hr(d,_),i.subtreeFlags=d.subtreeFlags&14680064),T!==null?p=Hr(T,p):(p=ms(p,v,s,null),p.flags|=2),p.return=t,i.return=t,i.sibling=p,t.child=i,i=p,p=t.child,v=e.child.memoizedState,v=v===null?fc(s):{baseLanes:v.baseLanes|s,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~s,t.memoizedState=dc,i}return p=e.child,e=p.sibling,i=Hr(p,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=s),i.return=t,i.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=i,t.memoizedState=null,i}function pc(e,t){return t=dl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zi(e,t,s,i){return i!==null&&Fa(i),zs(t,e.child,null,s),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mv(e,t,s,i,d,p,v){if(s)return t.flags&256?(t.flags&=-257,i=lc(Error(o(422))),Zi(e,t,v,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=i.fallback,d=t.mode,i=dl({mode:"visible",children:i.children},d,0,null),p=ms(p,d,v,null),p.flags|=2,i.return=t,p.return=t,i.sibling=p,t.child=i,(t.mode&1)!==0&&zs(t,e.child,null,v),t.child.memoizedState=fc(v),t.memoizedState=dc,p);if((t.mode&1)===0)return Zi(e,t,v,null);if(d.data==="$!"){if(i=d.nextSibling&&d.nextSibling.dataset,i)var T=i.dgst;return i=T,p=Error(o(419)),i=lc(p,i,void 0),Zi(e,t,v,i)}if(T=(v&e.childLanes)!==0,hn||T){if(i=Pt,i!==null){switch(v&-v){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(i.suspendedLanes|v))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,vr(e,d),Gn(i,e,d,-1))}return Rc(),i=lc(Error(o(421))),Zi(e,t,v,i)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=_v.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,Tn=Mr(d.nextSibling),Sn=t,ht=!0,Bn=null,e!==null&&(jn[Dn++]=mr,jn[Dn++]=gr,jn[Dn++]=is,mr=e.id,gr=e.overflow,is=t),t=pc(t,i.children),t.flags|=4096,t)}function Hf(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ha(e.return,t,s)}function hc(e,t,s,i,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=s,p.tailMode=d)}function Vf(e,t,s){var i=t.pendingProps,d=i.revealOrder,p=i.tail;if(on(e,t,i.children,s),i=yt.current,(i&2)!==0)i=i&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&&Hf(e,s,t);else if(e.tag===19)Hf(e,s,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}i&=1}if(ct(yt,i),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(s=t.child,d=null;s!==null;)e=s.alternate,e!==null&&Vi(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),hc(t,!1,d,s,p);break;case"backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Vi(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}hc(t,!0,s,null,p);break;case"together":hc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ji(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function xr(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),ds|=t.lanes,(s&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=Hr(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Hr(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function gv(e,t,s){switch(t.tag){case 3:Uf(t),Os();break;case 5:sf(t);break;case 1:pn(t.type)&&Li(t);break;case 4:qa(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,d=t.memoizedProps.value;ct(Ui,i._currentValue),i._currentValue=d;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ct(yt,yt.current&1),t.flags|=128,null):(s&t.child.childLanes)!==0?Wf(e,t,s):(ct(yt,yt.current&1),e=xr(e,t,s),e!==null?e.sibling:null);ct(yt,yt.current&1);break;case 19:if(i=(s&t.childLanes)!==0,(e.flags&128)!==0){if(i)return Vf(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ct(yt,yt.current),i)break;return null;case 22:case 23:return t.lanes=0,zf(e,t,s)}return xr(e,t,s)}var Gf,mc,qf,Kf;Gf=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},mc=function(){},qf=function(e,t,s,i){var d=e.memoizedProps;if(d!==i){e=t.stateNode,cs(er.current);var p=null;switch(s){case"input":d=$(e,d),i=$(e,i),p=[];break;case"select":d=W({},d,{value:void 0}),i=W({},i,{value:void 0}),p=[];break;case"textarea":d=St(e,d),i=St(e,i),p=[];break;default:typeof d.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Ii)}cr(s,i);var v;s=null;for(z in d)if(!i.hasOwnProperty(z)&&d.hasOwnProperty(z)&&d[z]!=null)if(z==="style"){var T=d[z];for(v in T)T.hasOwnProperty(v)&&(s||(s={}),s[v]="")}else z!=="dangerouslySetInnerHTML"&&z!=="children"&&z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&z!=="autoFocus"&&(a.hasOwnProperty(z)?p||(p=[]):(p=p||[]).push(z,null));for(z in i){var _=i[z];if(T=d!=null?d[z]:void 0,i.hasOwnProperty(z)&&_!==T&&(_!=null||T!=null))if(z==="style")if(T){for(v in T)!T.hasOwnProperty(v)||_&&_.hasOwnProperty(v)||(s||(s={}),s[v]="");for(v in _)_.hasOwnProperty(v)&&T[v]!==_[v]&&(s||(s={}),s[v]=_[v])}else s||(p||(p=[]),p.push(z,s)),s=_;else z==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,T=T?T.__html:void 0,_!=null&&T!==_&&(p=p||[]).push(z,_)):z==="children"?typeof _!="string"&&typeof _!="number"||(p=p||[]).push(z,""+_):z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&(a.hasOwnProperty(z)?(_!=null&&z==="onScroll"&&ft("scroll",e),p||T===_||(p=[])):(p=p||[]).push(z,_))}s&&(p=p||[]).push("style",s);var z=p;(t.updateQueue=z)&&(t.flags|=4)}},Kf=function(e,t,s,i){s!==i&&(t.flags|=4)};function Po(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Jt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,i|=d.subtreeFlags&14680064,i|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function vv(e,t,s){var i=t.pendingProps;switch(Oa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jt(t),null;case 1:return pn(t.type)&&Ai(),Jt(t),null;case 3:return i=t.stateNode,Us(),pt(fn),pt(Qt),Ya(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&($i(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Bn!==null&&(bc(Bn),Bn=null))),mc(e,t),Jt(t),null;case 5:Ka(t);var d=cs(Do.current);if(s=t.type,e!==null&&t.stateNode!=null)qf(e,t,s,i,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Jt(t),null}if(e=cs(er.current),$i(t)){i=t.stateNode,s=t.type;var p=t.memoizedProps;switch(i[Jn]=t,i[bo]=p,e=(t.mode&1)!==0,s){case"dialog":ft("cancel",i),ft("close",i);break;case"iframe":case"object":case"embed":ft("load",i);break;case"video":case"audio":for(d=0;d<To.length;d++)ft(To[d],i);break;case"source":ft("error",i);break;case"img":case"image":case"link":ft("error",i),ft("load",i);break;case"details":ft("toggle",i);break;case"input":Me(i,p),ft("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!p.multiple},ft("invalid",i);break;case"textarea":U(i,p),ft("invalid",i)}cr(s,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var T=p[v];v==="children"?typeof T=="string"?i.textContent!==T&&(p.suppressHydrationWarning!==!0&&Di(i.textContent,T,e),d=["children",T]):typeof T=="number"&&i.textContent!==""+T&&(p.suppressHydrationWarning!==!0&&Di(i.textContent,T,e),d=["children",""+T]):a.hasOwnProperty(v)&&T!=null&&v==="onScroll"&&ft("scroll",i)}switch(s){case"input":lt(i),ut(i,p,!0);break;case"textarea":lt(i),ze(i);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(i.onclick=Ii)}i=d,t.updateQueue=i,i!==null&&(t.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=qe(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=v.createElement(s,{is:i.is}):(e=v.createElement(s),s==="select"&&(v=e,i.multiple?v.multiple=!0:i.size&&(v.size=i.size))):e=v.createElementNS(e,s),e[Jn]=t,e[bo]=i,Gf(e,t,!1,!1),t.stateNode=e;e:{switch(v=ur(s,i),s){case"dialog":ft("cancel",e),ft("close",e),d=i;break;case"iframe":case"object":case"embed":ft("load",e),d=i;break;case"video":case"audio":for(d=0;d<To.length;d++)ft(To[d],e);d=i;break;case"source":ft("error",e),d=i;break;case"img":case"image":case"link":ft("error",e),ft("load",e),d=i;break;case"details":ft("toggle",e),d=i;break;case"input":Me(e,i),d=$(e,i),ft("invalid",e);break;case"option":d=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},d=W({},i,{value:void 0}),ft("invalid",e);break;case"textarea":U(e,i),d=St(e,i),ft("invalid",e);break;default:d=i}cr(s,d),T=d;for(p in T)if(T.hasOwnProperty(p)){var _=T[p];p==="style"?Qr(e,_):p==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,_!=null&&De(e,_)):p==="children"?typeof _=="string"?(s!=="textarea"||_!=="")&&Ke(e,_):typeof _=="number"&&Ke(e,""+_):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?_!=null&&p==="onScroll"&&ft("scroll",e):_!=null&&H(e,p,_,v))}switch(s){case"input":lt(e),ut(e,i,!1);break;case"textarea":lt(e),ze(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Te(i.value));break;case"select":e.multiple=!!i.multiple,p=i.value,p!=null?We(e,!!i.multiple,p,!1):i.defaultValue!=null&&We(e,!!i.multiple,i.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Ii)}switch(s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Jt(t),null;case 6:if(e&&t.stateNode!=null)Kf(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(s=cs(Do.current),cs(er.current),$i(t)){if(i=t.stateNode,s=t.memoizedProps,i[Jn]=t,(p=i.nodeValue!==s)&&(e=Sn,e!==null))switch(e.tag){case 3:Di(i.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Di(i.nodeValue,s,(e.mode&1)!==0)}p&&(t.flags|=4)}else i=(s.nodeType===9?s:s.ownerDocument).createTextNode(i),i[Jn]=t,t.stateNode=i}return Jt(t),null;case 13:if(pt(yt),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&Tn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Yd(),Os(),t.flags|=98560,p=!1;else if(p=$i(t),i!==null&&i.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[Jn]=t}else Os(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Jt(t),p=!1}else Bn!==null&&(bc(Bn),Bn=null),p=!0;if(!p)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=s,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(yt.current&1)!==0?It===0&&(It=3):Rc())),t.updateQueue!==null&&(t.flags|=4),Jt(t),null);case 4:return Us(),mc(e,t),e===null&&No(t.stateNode.containerInfo),Jt(t),null;case 10:return Wa(t.type._context),Jt(t),null;case 17:return pn(t.type)&&Ai(),Jt(t),null;case 19:if(pt(yt),p=t.memoizedState,p===null)return Jt(t),null;if(i=(t.flags&128)!==0,v=p.rendering,v===null)if(i)Po(p,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Vi(e),v!==null){for(t.flags|=128,Po(p,!1),i=v.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=s,s=t.child;s!==null;)p=s,e=i,p.flags&=14680066,v=p.alternate,v===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=v.childLanes,p.lanes=v.lanes,p.child=v.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=v.memoizedProps,p.memoizedState=v.memoizedState,p.updateQueue=v.updateQueue,p.type=v.type,e=v.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return ct(yt,yt.current&1|2),t.child}e=e.sibling}p.tail!==null&&mt()>Vs&&(t.flags|=128,i=!0,Po(p,!1),t.lanes=4194304)}else{if(!i)if(e=Vi(v),e!==null){if(t.flags|=128,i=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),Po(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ht)return Jt(t),null}else 2*mt()-p.renderingStartTime>Vs&&s!==1073741824&&(t.flags|=128,i=!0,Po(p,!1),t.lanes=4194304);p.isBackwards?(v.sibling=t.child,t.child=v):(s=p.last,s!==null?s.sibling=v:t.child=v,p.last=v)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=mt(),t.sibling=null,s=yt.current,ct(yt,i?s&1|2:s&1),t):(Jt(t),null);case 22:case 23:return _c(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(Nn&1073741824)!==0&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function yv(e,t){switch(Oa(t),t.tag){case 1:return pn(t.type)&&Ai(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Us(),pt(fn),pt(Qt),Ya(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ka(t),null;case 13:if(pt(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(yt),null;case 4:return Us(),null;case 10:return Wa(t.type._context),null;case 22:case 23:return _c(),null;case 24:return null;default:return null}}var el=!1,en=!1,xv=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Ws(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){wt(e,t,i)}else s.current=null}function gc(e,t,s){try{s()}catch(i){wt(e,t,i)}}var Xf=!1;function wv(e,t){if(_a=wi,e=bd(),wa(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var d=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var v=0,T=-1,_=-1,z=0,Y=0,J=e,X=null;t:for(;;){for(var fe;J!==s||d!==0&&J.nodeType!==3||(T=v+d),J!==p||i!==0&&J.nodeType!==3||(_=v+i),J.nodeType===3&&(v+=J.nodeValue.length),(fe=J.firstChild)!==null;)X=J,J=fe;for(;;){if(J===e)break t;if(X===s&&++z===d&&(T=v),X===p&&++Y===i&&(_=v),(fe=J.nextSibling)!==null)break;J=X,X=J.parentNode}J=fe}s=T===-1||_===-1?null:{start:T,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ra={focusedElem:e,selectionRange:s},wi=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var he=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(he!==null){var ye=he.memoizedProps,Ct=he.memoizedState,L=t.stateNode,R=L.getSnapshotBeforeUpdate(t.elementType===t.type?ye:Wn(t.type,ye),Ct);L.__reactInternalSnapshotBeforeUpdate=R}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(se){wt(t,t.return,se)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return he=Xf,Xf=!1,he}function Oo(e,t,s){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&gc(t,s,p)}d=d.next}while(d!==i)}}function tl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==t)}}function vc(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function Yf(e){var t=e.alternate;t!==null&&(e.alternate=null,Yf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[bo],delete t[Ma],delete t[nv],delete t[rv])),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 Qf(e){return e.tag===5||e.tag===3||e.tag===4}function Zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qf(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 yc(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Ii));else if(i!==4&&(e=e.child,e!==null))for(yc(e,t,s),e=e.sibling;e!==null;)yc(e,t,s),e=e.sibling}function xc(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(xc(e,t,s),e=e.sibling;e!==null;)xc(e,t,s),e=e.sibling}var Bt=null,Hn=!1;function $r(e,t,s){for(s=s.child;s!==null;)Jf(e,t,s),s=s.sibling}function Jf(e,t,s){if(wn&&typeof wn.onCommitFiberUnmount=="function")try{wn.onCommitFiberUnmount(Jr,s)}catch{}switch(s.tag){case 5:en||Ws(s,t);case 6:var i=Bt,d=Hn;Bt=null,$r(e,t,s),Bt=i,Hn=d,Bt!==null&&(Hn?(e=Bt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Bt.removeChild(s.stateNode));break;case 18:Bt!==null&&(Hn?(e=Bt,s=s.stateNode,e.nodeType===8?Ia(e.parentNode,s):e.nodeType===1&&Ia(e,s),mo(e)):Ia(Bt,s.stateNode));break;case 4:i=Bt,d=Hn,Bt=s.stateNode.containerInfo,Hn=!0,$r(e,t,s),Bt=i,Hn=d;break;case 0:case 11:case 14:case 15:if(!en&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var p=d,v=p.destroy;p=p.tag,v!==void 0&&((p&2)!==0||(p&4)!==0)&&gc(s,t,v),d=d.next}while(d!==i)}$r(e,t,s);break;case 1:if(!en&&(Ws(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(T){wt(s,t,T)}$r(e,t,s);break;case 21:$r(e,t,s);break;case 22:s.mode&1?(en=(i=en)||s.memoizedState!==null,$r(e,t,s),en=i):$r(e,t,s);break;default:$r(e,t,s)}}function ep(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new xv),t.forEach(function(i){var d=Rv.bind(null,e,i);s.has(i)||(s.add(i),i.then(d,d))})}}function Vn(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var d=s[i];try{var p=e,v=t,T=v;e:for(;T!==null;){switch(T.tag){case 5:Bt=T.stateNode,Hn=!1;break e;case 3:Bt=T.stateNode.containerInfo,Hn=!0;break e;case 4:Bt=T.stateNode.containerInfo,Hn=!0;break e}T=T.return}if(Bt===null)throw Error(o(160));Jf(p,v,d),Bt=null,Hn=!1;var _=d.alternate;_!==null&&(_.return=null),d.return=null}catch(z){wt(d,t,z)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)tp(t,e),t=t.sibling}function tp(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vn(t,e),nr(e),i&4){try{Oo(3,e,e.return),tl(3,e)}catch(ye){wt(e,e.return,ye)}try{Oo(5,e,e.return)}catch(ye){wt(e,e.return,ye)}}break;case 1:Vn(t,e),nr(e),i&512&&s!==null&&Ws(s,s.return);break;case 5:if(Vn(t,e),nr(e),i&512&&s!==null&&Ws(s,s.return),e.flags&32){var d=e.stateNode;try{Ke(d,"")}catch(ye){wt(e,e.return,ye)}}if(i&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=s!==null?s.memoizedProps:p,T=e.type,_=e.updateQueue;if(e.updateQueue=null,_!==null)try{T==="input"&&p.type==="radio"&&p.name!=null&&le(d,p),ur(T,v);var z=ur(T,p);for(v=0;v<_.length;v+=2){var Y=_[v],J=_[v+1];Y==="style"?Qr(d,J):Y==="dangerouslySetInnerHTML"?De(d,J):Y==="children"?Ke(d,J):H(d,Y,J,z)}switch(T){case"input":Qe(d,p);break;case"textarea":ue(d,p);break;case"select":var X=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var fe=p.value;fe!=null?We(d,!!p.multiple,fe,!1):X!==!!p.multiple&&(p.defaultValue!=null?We(d,!!p.multiple,p.defaultValue,!0):We(d,!!p.multiple,p.multiple?[]:"",!1))}d[bo]=p}catch(ye){wt(e,e.return,ye)}}break;case 6:if(Vn(t,e),nr(e),i&4){if(e.stateNode===null)throw Error(o(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ye){wt(e,e.return,ye)}}break;case 3:if(Vn(t,e),nr(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{mo(t.containerInfo)}catch(ye){wt(e,e.return,ye)}break;case 4:Vn(t,e),nr(e);break;case 13:Vn(t,e),nr(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Sc=mt())),i&4&&ep(e);break;case 22:if(Y=s!==null&&s.memoizedState!==null,e.mode&1?(en=(z=en)||Y,Vn(t,e),en=z):Vn(t,e),nr(e),i&8192){if(z=e.memoizedState!==null,(e.stateNode.isHidden=z)&&!Y&&(e.mode&1)!==0)for(pe=e,Y=e.child;Y!==null;){for(J=pe=Y;pe!==null;){switch(X=pe,fe=X.child,X.tag){case 0:case 11:case 14:case 15:Oo(4,X,X.return);break;case 1:Ws(X,X.return);var he=X.stateNode;if(typeof he.componentWillUnmount=="function"){i=X,s=X.return;try{t=i,he.props=t.memoizedProps,he.state=t.memoizedState,he.componentWillUnmount()}catch(ye){wt(i,s,ye)}}break;case 5:Ws(X,X.return);break;case 22:if(X.memoizedState!==null){sp(J);continue}}fe!==null?(fe.return=X,pe=fe):sp(J)}Y=Y.sibling}e:for(Y=null,J=e;;){if(J.tag===5){if(Y===null){Y=J;try{d=J.stateNode,z?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(T=J.stateNode,_=J.memoizedProps.style,v=_!=null&&_.hasOwnProperty("display")?_.display:null,T.style.display=ar("display",v))}catch(ye){wt(e,e.return,ye)}}}else if(J.tag===6){if(Y===null)try{J.stateNode.nodeValue=z?"":J.memoizedProps}catch(ye){wt(e,e.return,ye)}}else if((J.tag!==22&&J.tag!==23||J.memoizedState===null||J===e)&&J.child!==null){J.child.return=J,J=J.child;continue}if(J===e)break e;for(;J.sibling===null;){if(J.return===null||J.return===e)break e;Y===J&&(Y=null),J=J.return}Y===J&&(Y=null),J.sibling.return=J.return,J=J.sibling}}break;case 19:Vn(t,e),nr(e),i&4&&ep(e);break;case 21:break;default:Vn(t,e),nr(e)}}function nr(e){var t=e.flags;if(t&2){try{e:{for(var s=e.return;s!==null;){if(Qf(s)){var i=s;break e}s=s.return}throw Error(o(160))}switch(i.tag){case 5:var d=i.stateNode;i.flags&32&&(Ke(d,""),i.flags&=-33);var p=Zf(e);xc(e,p,d);break;case 3:case 4:var v=i.stateNode.containerInfo,T=Zf(e);yc(e,T,v);break;default:throw Error(o(161))}}catch(_){wt(e,e.return,_)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kv(e,t,s){pe=e,np(e)}function np(e,t,s){for(var i=(e.mode&1)!==0;pe!==null;){var d=pe,p=d.child;if(d.tag===22&&i){var v=d.memoizedState!==null||el;if(!v){var T=d.alternate,_=T!==null&&T.memoizedState!==null||en;T=el;var z=en;if(el=v,(en=_)&&!z)for(pe=d;pe!==null;)v=pe,_=v.child,v.tag===22&&v.memoizedState!==null?op(d):_!==null?(_.return=v,pe=_):op(d);for(;p!==null;)pe=p,np(p),p=p.sibling;pe=d,el=T,en=z}rp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,pe=p):rp(e)}}function rp(e){for(;pe!==null;){var t=pe;if((t.flags&8772)!==0){var s=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:en||tl(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!en)if(s===null)i.componentDidMount();else{var d=t.elementType===t.type?s.memoizedProps:Wn(t.type,s.memoizedProps);i.componentDidUpdate(d,s.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&rf(t,p,i);break;case 3:var v=t.updateQueue;if(v!==null){if(s=null,t.child!==null)switch(t.child.tag){case 5:s=t.child.stateNode;break;case 1:s=t.child.stateNode}rf(t,v,s)}break;case 5:var T=t.stateNode;if(s===null&&t.flags&4){s=T;var _=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":_.autoFocus&&s.focus();break;case"img":_.src&&(s.src=_.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var z=t.alternate;if(z!==null){var Y=z.memoizedState;if(Y!==null){var J=Y.dehydrated;J!==null&&mo(J)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}en||t.flags&512&&vc(t)}catch(X){wt(t,t.return,X)}}if(t===e){pe=null;break}if(s=t.sibling,s!==null){s.return=t.return,pe=s;break}pe=t.return}}function sp(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var s=t.sibling;if(s!==null){s.return=t.return,pe=s;break}pe=t.return}}function op(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var s=t.return;try{tl(4,t)}catch(_){wt(t,s,_)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var d=t.return;try{i.componentDidMount()}catch(_){wt(t,d,_)}}var p=t.return;try{vc(t)}catch(_){wt(t,p,_)}break;case 5:var v=t.return;try{vc(t)}catch(_){wt(t,v,_)}}}catch(_){wt(t,t.return,_)}if(t===e){pe=null;break}var T=t.sibling;if(T!==null){T.return=t.return,pe=T;break}pe=t.return}}var Sv=Math.ceil,nl=P.ReactCurrentDispatcher,wc=P.ReactCurrentOwner,An=P.ReactCurrentBatchConfig,Ge=0,Pt=null,_t=null,Wt=0,Nn=0,Hs=Ar(0),It=0,zo=null,ds=0,rl=0,kc=0,$o=null,mn=null,Sc=0,Vs=1/0,wr=null,sl=!1,Tc=null,Fr=null,ol=!1,Ur=null,il=0,Fo=0,Nc=null,ll=-1,al=0;function ln(){return(Ge&6)!==0?mt():ll!==-1?ll:ll=mt()}function Br(e){return(e.mode&1)===0?1:(Ge&2)!==0&&Wt!==0?Wt&-Wt:ov.transition!==null?(al===0&&(al=uo()),al):(e=He,e!==0||(e=window.event,e=e===void 0?16:id(e.type)),e)}function Gn(e,t,s,i){if(50<Fo)throw Fo=0,Nc=null,Error(o(185));rs(e,s,i),((Ge&2)===0||e!==Pt)&&(e===Pt&&((Ge&2)===0&&(rl|=s),It===4&&Wr(e,Wt)),gn(e,i),s===1&&Ge===0&&(t.mode&1)===0&&(Vs=mt()+500,Pi&&Pr()))}function gn(e,t){var s=e.callbackNode;vi(e,t);var i=ns(e,e===Pt?Wt:0);if(i===0)s!==null&&hi(s),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(s!=null&&hi(s),t===1)e.tag===0?sv(lp.bind(null,e)):Vd(lp.bind(null,e)),ev(function(){(Ge&6)===0&&Pr()}),s=null;else{switch(re(i)){case 1:s=Er;break;case 4:s=Zn;break;case 16:s=ks;break;case 536870912:s=mi;break;default:s=ks}s=mp(s,ip.bind(null,e))}e.callbackPriority=t,e.callbackNode=s}}function ip(e,t){if(ll=-1,al=0,(Ge&6)!==0)throw Error(o(327));var s=e.callbackNode;if(Gs()&&e.callbackNode!==s)return null;var i=ns(e,e===Pt?Wt:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=cl(e,i);else{t=i;var d=Ge;Ge|=2;var p=cp();(Pt!==e||Wt!==t)&&(wr=null,Vs=mt()+500,ps(e,t));do try{Cv();break}catch(T){ap(e,T)}while(!0);Ba(),nl.current=p,Ge=d,_t!==null?t=0:(Pt=null,Wt=0,t=It)}if(t!==0){if(t===2&&(d=co(e),d!==0&&(i=d,t=Cc(e,d))),t===1)throw s=zo,ps(e,0),Wr(e,i),gn(e,mt()),s;if(t===6)Wr(e,i);else{if(d=e.current.alternate,(i&30)===0&&!Tv(d)&&(t=cl(e,i),t===2&&(p=co(e),p!==0&&(i=p,t=Cc(e,p))),t===1))throw s=zo,ps(e,0),Wr(e,i),gn(e,mt()),s;switch(e.finishedWork=d,e.finishedLanes=i,t){case 0:case 1:throw Error(o(345));case 2:hs(e,mn,wr);break;case 3:if(Wr(e,i),(i&130023424)===i&&(t=Sc+500-mt(),10<t)){if(ns(e,0)!==0)break;if(d=e.suspendedLanes,(d&i)!==i){ln(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Da(hs.bind(null,e,mn,wr),t);break}hs(e,mn,wr);break;case 4:if(Wr(e,i),(i&4194240)===i)break;for(t=e.eventTimes,d=-1;0<i;){var v=31-rn(i);p=1<<v,v=t[v],v>d&&(d=v),i&=~p}if(i=d,i=mt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Sv(i/1960))-i,10<i){e.timeoutHandle=Da(hs.bind(null,e,mn,wr),i);break}hs(e,mn,wr);break;case 5:hs(e,mn,wr);break;default:throw Error(o(329))}}}return gn(e,mt()),e.callbackNode===s?ip.bind(null,e):null}function Cc(e,t){var s=$o;return e.current.memoizedState.isDehydrated&&(ps(e,t).flags|=256),e=cl(e,t),e!==2&&(t=mn,mn=s,t!==null&&bc(t)),e}function bc(e){mn===null?mn=e:mn.push.apply(mn,e)}function Tv(e){for(var t=e;;){if(t.flags&16384){var s=t.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var i=0;i<s.length;i++){var d=s[i],p=d.getSnapshot;d=d.value;try{if(!Un(p(),d))return!1}catch{return!1}}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Wr(e,t){for(t&=~kc,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var s=31-rn(t),i=1<<s;e[s]=-1,t&=~i}}function lp(e){if((Ge&6)!==0)throw Error(o(327));Gs();var t=ns(e,0);if((t&1)===0)return gn(e,mt()),null;var s=cl(e,t);if(e.tag!==0&&s===2){var i=co(e);i!==0&&(t=i,s=Cc(e,i))}if(s===1)throw s=zo,ps(e,0),Wr(e,t),gn(e,mt()),s;if(s===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hs(e,mn,wr),gn(e,mt()),null}function Ec(e,t){var s=Ge;Ge|=1;try{return e(t)}finally{Ge=s,Ge===0&&(Vs=mt()+500,Pi&&Pr())}}function fs(e){Ur!==null&&Ur.tag===0&&(Ge&6)===0&&Gs();var t=Ge;Ge|=1;var s=An.transition,i=He;try{if(An.transition=null,He=1,e)return e()}finally{He=i,An.transition=s,Ge=t,(Ge&6)===0&&Pr()}}function _c(){Nn=Hs.current,pt(Hs)}function ps(e,t){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,Jg(s)),_t!==null)for(s=_t.return;s!==null;){var i=s;switch(Oa(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Ai();break;case 3:Us(),pt(fn),pt(Qt),Ya();break;case 5:Ka(i);break;case 4:Us();break;case 13:pt(yt);break;case 19:pt(yt);break;case 10:Wa(i.type._context);break;case 22:case 23:_c()}s=s.return}if(Pt=e,_t=e=Hr(e.current,null),Wt=Nn=t,It=0,zo=null,kc=rl=ds=0,mn=$o=null,as!==null){for(t=0;t<as.length;t++)if(s=as[t],i=s.interleaved,i!==null){s.interleaved=null;var d=i.next,p=s.pending;if(p!==null){var v=p.next;p.next=d,i.next=v}s.pending=i}as=null}return e}function ap(e,t){do{var s=_t;try{if(Ba(),Gi.current=Yi,qi){for(var i=xt.memoizedState;i!==null;){var d=i.queue;d!==null&&(d.pending=null),i=i.next}qi=!1}if(us=0,Lt=Dt=xt=null,Io=!1,Mo=0,wc.current=null,s===null||s.return===null){It=1,zo=t,_t=null;break}e:{var p=e,v=s.return,T=s,_=t;if(t=Wt,T.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){var z=_,Y=T,J=Y.tag;if((Y.mode&1)===0&&(J===0||J===11||J===15)){var X=Y.alternate;X?(Y.updateQueue=X.updateQueue,Y.memoizedState=X.memoizedState,Y.lanes=X.lanes):(Y.updateQueue=null,Y.memoizedState=null)}var fe=Mf(v);if(fe!==null){fe.flags&=-257,Af(fe,v,T,p,t),fe.mode&1&&If(p,z,t),t=fe,_=z;var he=t.updateQueue;if(he===null){var ye=new Set;ye.add(_),t.updateQueue=ye}else he.add(_);break e}else{if((t&1)===0){If(p,z,t),Rc();break e}_=Error(o(426))}}else if(ht&&T.mode&1){var Ct=Mf(v);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),Af(Ct,v,T,p,t),Fa(Bs(_,T));break e}}p=_=Bs(_,T),It!==4&&(It=2),$o===null?$o=[p]:$o.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var L=jf(p,_,t);nf(p,L);break e;case 1:T=_;var R=p.type,O=p.stateNode;if((p.flags&128)===0&&(typeof R.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Fr===null||!Fr.has(O)))){p.flags|=65536,t&=-t,p.lanes|=t;var se=Df(p,T,t);nf(p,se);break e}}p=p.return}while(p!==null)}dp(s)}catch(xe){t=xe,_t===s&&s!==null&&(_t=s=s.return);continue}break}while(!0)}function cp(){var e=nl.current;return nl.current=Yi,e===null?Yi:e}function Rc(){(It===0||It===3||It===2)&&(It=4),Pt===null||(ds&268435455)===0&&(rl&268435455)===0||Wr(Pt,Wt)}function cl(e,t){var s=Ge;Ge|=2;var i=cp();(Pt!==e||Wt!==t)&&(wr=null,ps(e,t));do try{Nv();break}catch(d){ap(e,d)}while(!0);if(Ba(),Ge=s,nl.current=i,_t!==null)throw Error(o(261));return Pt=null,Wt=0,It}function Nv(){for(;_t!==null;)up(_t)}function Cv(){for(;_t!==null&&!la();)up(_t)}function up(e){var t=hp(e.alternate,e,Nn);e.memoizedProps=e.pendingProps,t===null?dp(e):_t=t,wc.current=null}function dp(e){var t=e;do{var s=t.alternate;if(e=t.return,(t.flags&32768)===0){if(s=vv(s,t,Nn),s!==null){_t=s;return}}else{if(s=yv(s,t),s!==null){s.flags&=32767,_t=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{It=6,_t=null;return}}if(t=t.sibling,t!==null){_t=t;return}_t=t=e}while(t!==null);It===0&&(It=5)}function hs(e,t,s){var i=He,d=An.transition;try{An.transition=null,He=1,bv(e,t,s,i)}finally{An.transition=d,He=i}return null}function bv(e,t,s,i){do Gs();while(Ur!==null);if((Ge&6)!==0)throw Error(o(327));s=e.finishedWork;var d=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var p=s.lanes|s.childLanes;if(yi(e,p),e===Pt&&(_t=Pt=null,Wt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||ol||(ol=!0,mp(ks,function(){return Gs(),null})),p=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||p){p=An.transition,An.transition=null;var v=He;He=1;var T=Ge;Ge|=4,wc.current=null,wv(e,s),tp(s,e),Gg(Ra),wi=!!_a,Ra=_a=null,e.current=s,kv(s),aa(),Ge=T,He=v,An.transition=p}else e.current=s;if(ol&&(ol=!1,Ur=e,il=d),p=e.pendingLanes,p===0&&(Fr=null),Ss(s.stateNode),gn(e,mt()),t!==null)for(i=e.onRecoverableError,s=0;s<t.length;s++)d=t[s],i(d.value,{componentStack:d.stack,digest:d.digest});if(sl)throw sl=!1,e=Tc,Tc=null,e;return(il&1)!==0&&e.tag!==0&&Gs(),p=e.pendingLanes,(p&1)!==0?e===Nc?Fo++:(Fo=0,Nc=e):Fo=0,Pr(),null}function Gs(){if(Ur!==null){var e=re(il),t=An.transition,s=He;try{if(An.transition=null,He=16>e?16:e,Ur===null)var i=!1;else{if(e=Ur,Ur=null,il=0,(Ge&6)!==0)throw Error(o(331));var d=Ge;for(Ge|=4,pe=e.current;pe!==null;){var p=pe,v=p.child;if((pe.flags&16)!==0){var T=p.deletions;if(T!==null){for(var _=0;_<T.length;_++){var z=T[_];for(pe=z;pe!==null;){var Y=pe;switch(Y.tag){case 0:case 11:case 15:Oo(8,Y,p)}var J=Y.child;if(J!==null)J.return=Y,pe=J;else for(;pe!==null;){Y=pe;var X=Y.sibling,fe=Y.return;if(Yf(Y),Y===z){pe=null;break}if(X!==null){X.return=fe,pe=X;break}pe=fe}}}var he=p.alternate;if(he!==null){var ye=he.child;if(ye!==null){he.child=null;do{var Ct=ye.sibling;ye.sibling=null,ye=Ct}while(ye!==null)}}pe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,pe=v;else e:for(;pe!==null;){if(p=pe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Oo(9,p,p.return)}var L=p.sibling;if(L!==null){L.return=p.return,pe=L;break e}pe=p.return}}var R=e.current;for(pe=R;pe!==null;){v=pe;var O=v.child;if((v.subtreeFlags&2064)!==0&&O!==null)O.return=v,pe=O;else e:for(v=R;pe!==null;){if(T=pe,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:tl(9,T)}}catch(xe){wt(T,T.return,xe)}if(T===v){pe=null;break e}var se=T.sibling;if(se!==null){se.return=T.return,pe=se;break e}pe=T.return}}if(Ge=d,Pr(),wn&&typeof wn.onPostCommitFiberRoot=="function")try{wn.onPostCommitFiberRoot(Jr,e)}catch{}i=!0}return i}finally{He=s,An.transition=t}}return!1}function fp(e,t,s){t=Bs(s,t),t=jf(e,t,1),e=zr(e,t,1),t=ln(),e!==null&&(rs(e,1,t),gn(e,t))}function wt(e,t,s){if(e.tag===3)fp(e,e,s);else for(;t!==null;){if(t.tag===3){fp(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Fr===null||!Fr.has(i))){e=Bs(s,e),e=Df(t,e,1),t=zr(t,e,1),e=ln(),t!==null&&(rs(t,1,e),gn(t,e));break}}t=t.return}}function Ev(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),t=ln(),e.pingedLanes|=e.suspendedLanes&s,Pt===e&&(Wt&s)===s&&(It===4||It===3&&(Wt&130023424)===Wt&&500>mt()-Sc?ps(e,0):kc|=s),gn(e,t)}function pp(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ns,Ns<<=1,(Ns&130023424)===0&&(Ns=4194304)));var s=ln();e=vr(e,t),e!==null&&(rs(e,t,s),gn(e,s))}function _v(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),pp(e,s)}function Rv(e,t){var s=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}i!==null&&i.delete(t),pp(e,s)}var hp;hp=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||fn.current)hn=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return hn=!1,gv(e,t,s);hn=(e.flags&131072)!==0}else hn=!1,ht&&(t.flags&1048576)!==0&&Gd(t,zi,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Ji(e,t),e=t.pendingProps;var d=As(t,Qt.current);Fs(t,s),d=Ja(null,t,i,e,d,s);var p=ec();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pn(i)?(p=!0,Li(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Ga(t),d.updater=Qi,t.stateNode=d,d._reactInternals=t,ic(t,i,e,s),t=uc(null,t,i,!0,p,s)):(t.tag=0,ht&&p&&Pa(t),on(null,t,d,s),t=t.child),t;case 16:i=t.elementType;e:{switch(Ji(e,t),e=t.pendingProps,d=i._init,i=d(i._payload),t.type=i,d=t.tag=Dv(i),e=Wn(i,e),d){case 0:t=cc(null,t,i,e,s);break e;case 1:t=Ff(null,t,i,e,s);break e;case 11:t=Lf(null,t,i,e,s);break e;case 14:t=Pf(null,t,i,Wn(i.type,e),s);break e}throw Error(o(306,i,""))}return t;case 0:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Wn(i,d),cc(e,t,i,d,s);case 1:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Wn(i,d),Ff(e,t,i,d,s);case 3:e:{if(Uf(t),e===null)throw Error(o(387));i=t.pendingProps,p=t.memoizedState,d=p.element,tf(e,t),Hi(t,i,null,s);var v=t.memoizedState;if(i=v.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Bs(Error(o(423)),t),t=Bf(e,t,i,s,d);break e}else if(i!==d){d=Bs(Error(o(424)),t),t=Bf(e,t,i,s,d);break e}else for(Tn=Mr(t.stateNode.containerInfo.firstChild),Sn=t,ht=!0,Bn=null,s=Jd(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Os(),i===d){t=xr(e,t,s);break e}on(e,t,i,s)}t=t.child}return t;case 5:return sf(t),e===null&&$a(t),i=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,ja(i,d)?v=null:p!==null&&ja(i,p)&&(t.flags|=32),$f(e,t),on(e,t,v,s),t.child;case 6:return e===null&&$a(t),null;case 13:return Wf(e,t,s);case 4:return qa(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=zs(t,null,i,s):on(e,t,i,s),t.child;case 11:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Wn(i,d),Lf(e,t,i,d,s);case 7:return on(e,t,t.pendingProps,s),t.child;case 8:return on(e,t,t.pendingProps.children,s),t.child;case 12:return on(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(i=t.type._context,d=t.pendingProps,p=t.memoizedProps,v=d.value,ct(Ui,i._currentValue),i._currentValue=v,p!==null)if(Un(p.value,v)){if(p.children===d.children&&!fn.current){t=xr(e,t,s);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var T=p.dependencies;if(T!==null){v=p.child;for(var _=T.firstContext;_!==null;){if(_.context===i){if(p.tag===1){_=yr(-1,s&-s),_.tag=2;var z=p.updateQueue;if(z!==null){z=z.shared;var Y=z.pending;Y===null?_.next=_:(_.next=Y.next,Y.next=_),z.pending=_}}p.lanes|=s,_=p.alternate,_!==null&&(_.lanes|=s),Ha(p.return,s,t),T.lanes|=s;break}_=_.next}}else if(p.tag===10)v=p.type===t.type?null:p.child;else if(p.tag===18){if(v=p.return,v===null)throw Error(o(341));v.lanes|=s,T=v.alternate,T!==null&&(T.lanes|=s),Ha(v,s,t),v=p.sibling}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===t){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}on(e,t,d.children,s),t=t.child}return t;case 9:return d=t.type,i=t.pendingProps.children,Fs(t,s),d=In(d),i=i(d),t.flags|=1,on(e,t,i,s),t.child;case 14:return i=t.type,d=Wn(i,t.pendingProps),d=Wn(i.type,d),Pf(e,t,i,d,s);case 15:return Of(e,t,t.type,t.pendingProps,s);case 17:return i=t.type,d=t.pendingProps,d=t.elementType===i?d:Wn(i,d),Ji(e,t),t.tag=1,pn(i)?(e=!0,Li(t)):e=!1,Fs(t,s),_f(t,i,d),ic(t,i,d,s),uc(null,t,i,!0,e,s);case 19:return Vf(e,t,s);case 22:return zf(e,t,s)}throw Error(o(156,t.tag))};function mp(e,t){return ao(e,t)}function jv(e,t,s,i){this.tag=e,this.key=s,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(e,t,s,i){return new jv(e,t,s,i)}function jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dv(e){if(typeof e=="function")return jc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pe)return 11;if(e===Q)return 14}return 2}function Hr(e,t){var s=e.alternate;return s===null?(s=Ln(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function ul(e,t,s,i,d,p){var v=2;if(i=e,typeof e=="function")jc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case q:return ms(s.children,d,p,t);case B:v=8,d|=8;break;case oe:return e=Ln(12,s,t,d|2),e.elementType=oe,e.lanes=p,e;case _e:return e=Ln(13,s,t,d),e.elementType=_e,e.lanes=p,e;case Oe:return e=Ln(19,s,t,d),e.elementType=Oe,e.lanes=p,e;case ne:return dl(s,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ae:v=10;break e;case ce:v=9;break e;case Pe:v=11;break e;case Q:v=14;break e;case te:v=16,i=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=Ln(v,s,t,d),t.elementType=e,t.type=i,t.lanes=p,t}function ms(e,t,s,i){return e=Ln(7,e,i,t),e.lanes=s,e}function dl(e,t,s,i){return e=Ln(22,e,i,t),e.elementType=ne,e.lanes=s,e.stateNode={isHidden:!1},e}function Dc(e,t,s){return e=Ln(6,e,null,t),e.lanes=s,e}function Ic(e,t,s){return t=Ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Iv(e,t,s,i,d){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=fo(0),this.expirationTimes=fo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fo(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Mc(e,t,s,i,d,p,v,T,_){return e=new Iv(e,t,s,T,_),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Ln(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ga(p),e}function Mv(e,t,s){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:i==null?null:""+i,children:e,containerInfo:t,implementation:s}}function gp(e){if(!e)return Lr;e=e._reactInternals;e:{if(Ze(e)!==e||e.tag!==1)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(o(171))}if(e.tag===1){var s=e.type;if(pn(s))return Wd(e,s,t)}return t}function vp(e,t,s,i,d,p,v,T,_){return e=Mc(s,i,!0,e,d,p,v,T,_),e.context=gp(null),s=e.current,i=ln(),d=Br(s),p=yr(i,d),p.callback=t??null,zr(s,p,d),e.current.lanes=d,rs(e,d,i),gn(e,i),e}function fl(e,t,s,i){var d=t.current,p=ln(),v=Br(d);return s=gp(s),t.context===null?t.context=s:t.pendingContext=s,t=yr(p,v),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=zr(d,t,v),e!==null&&(Gn(e,d,v,p),Wi(e,d,v)),v}function pl(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 yp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Ac(e,t){yp(e,t),(e=e.alternate)&&yp(e,t)}function Av(){return null}var xp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lc(e){this._internalRoot=e}hl.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));fl(e,t,null,null)},hl.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fs(function(){fl(null,e,null,null)}),t[pr]=null}};function hl(e){this._internalRoot=e}hl.prototype.unstable_scheduleHydration=function(e){if(e){var t=me();e={blockedOn:null,target:e,priority:t};for(var s=0;s<jr.length&&t!==0&&t<jr[s].priority;s++);jr.splice(s,0,e),s===0&&sd(e)}};function Pc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ml(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function wp(){}function Lv(e,t,s,i,d){if(d){if(typeof i=="function"){var p=i;i=function(){var z=pl(v);p.call(z)}}var v=vp(t,i,e,0,null,!1,!1,"",wp);return e._reactRootContainer=v,e[pr]=v.current,No(e.nodeType===8?e.parentNode:e),fs(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof i=="function"){var T=i;i=function(){var z=pl(_);T.call(z)}}var _=Mc(e,0,!1,null,null,!1,!1,"",wp);return e._reactRootContainer=_,e[pr]=_.current,No(e.nodeType===8?e.parentNode:e),fs(function(){fl(t,_,s,i)}),_}function gl(e,t,s,i,d){var p=s._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var T=d;d=function(){var _=pl(v);T.call(_)}}fl(t,v,e,d)}else v=Lv(s,t,e,d,i);return pl(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var s=ts(t.pendingLanes);s!==0&&(Rr(t,s|1),gn(t,mt()),(Ge&6)===0&&(Vs=mt()+500,Pr()))}break;case 13:fs(function(){var i=vr(e,1);if(i!==null){var d=ln();Gn(i,e,1,d)}}),Ac(e,1)}},A=function(e){if(e.tag===13){var t=vr(e,134217728);if(t!==null){var s=ln();Gn(t,e,134217728,s)}Ac(e,134217728)}},K=function(e){if(e.tag===13){var t=Br(e),s=vr(e,t);if(s!==null){var i=ln();Gn(s,e,t,i)}Ac(e,t)}},me=function(){return He},ke=function(e,t){var s=He;try{return He=e,t()}finally{He=s}},Kt=function(e,t,s){switch(t){case"input":if(Qe(e,s),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var d=Mi(i);if(!d)throw Error(o(90));Re(i),Qe(i,d)}}}break;case"textarea":ue(e,s);break;case"select":t=s.value,t!=null&&We(e,!!s.multiple,t,!1)}},Et=Ec,Tt=fs;var Pv={usingClientEntryPoint:!1,Events:[Eo,Is,Mi,bt,un,Ec]},Uo={findFiberByHostInstance:ss,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ov={bundleType:Uo.bundleType,version:Uo.version,rendererPackageName:Uo.rendererPackageName,rendererConfig:Uo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ws(e),e===null?null:e.stateNode},findFiberByHostInstance:Uo.findFiberByHostInstance||Av,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 vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{Jr=vl.inject(Ov),wn=vl}catch{}}return vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Pv,vn.createPortal=function(e,t){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pc(t))throw Error(o(200));return Mv(e,t,null,s)},vn.createRoot=function(e,t){if(!Pc(e))throw Error(o(299));var s=!1,i="",d=xp;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Mc(e,1,!1,null,null,s,!1,i,d),e[pr]=t.current,No(e.nodeType===8?e.parentNode:e),new Lc(t)},vn.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(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=ws(t),e=e===null?null:e.stateNode,e},vn.flushSync=function(e){return fs(e)},vn.hydrate=function(e,t,s){if(!ml(t))throw Error(o(200));return gl(null,e,t,!0,s)},vn.hydrateRoot=function(e,t,s){if(!Pc(e))throw Error(o(405));var i=s!=null&&s.hydratedSources||null,d=!1,p="",v=xp;if(s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onRecoverableError!==void 0&&(v=s.onRecoverableError)),t=vp(t,null,e,1,s??null,d,!1,p,v),e[pr]=t.current,No(e),i)for(e=0;e<i.length;e++)s=i[e],d=s._getVersion,d=d(s._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[s,d]:t.mutableSourceEagerHydrationData.push(s,d);return new hl(t)},vn.render=function(e,t,s){if(!ml(t))throw Error(o(200));return gl(null,e,t,!1,s)},vn.unmountComponentAtNode=function(e){if(!ml(e))throw Error(o(40));return e._reactRootContainer?(fs(function(){gl(null,null,e,!1,function(){e._reactRootContainer=null,e[pr]=null})}),!0):!1},vn.unstable_batchedUpdates=Ec,vn.unstable_renderSubtreeIntoContainer=function(e,t,s,i){if(!ml(s))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return gl(e,t,s,!1,i)},vn.version="18.3.1-next-f1338f8080-20240426",vn}var _p;function Gh(){if(_p)return $c.exports;_p=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),$c.exports=Gv(),$c.exports}var Rp;function qv(){if(Rp)return yl;Rp=1;var n=Gh();return yl.createRoot=n.createRoot,yl.hydrateRoot=n.hydrateRoot,yl}var Kv=qv();const Xv=Vh(Kv),jp=n=>{let r;const o=new Set,l=(g,y)=>{const k=typeof g=="function"?g(r):g;if(!Object.is(k,r)){const x=r;r=y??(typeof k!="object"||k===null)?k:Object.assign({},r,k),o.forEach(C=>C(r,x))}},a=()=>r,h={setState:l,getState:a,getInitialState:()=>m,subscribe:g=>(o.add(g),()=>o.delete(g))},m=r=n(l,a,h);return h},Yv=(n=>n?jp(n):jp),Qv=n=>n;function Zv(n,r=Qv){const o=rt.useSyncExternalStore(n.subscribe,rt.useCallback(()=>r(n.getState()),[n,r]),rt.useCallback(()=>r(n.getInitialState()),[n,r]));return rt.useDebugValue(o),o}const Jv=n=>{const r=Yv(n),o=l=>Zv(r,l);return Object.assign(o,r),o},ey=(n=>Jv),qh="agentpane:machines",Kh="agentpane:active-machine";function ty(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Xh(n){return`${n}.repoburg.com`}function Eu(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function Yh(n,r){try{const o=localStorage.getItem(n);return o==null?r:JSON.parse(o)}catch{return r}}function Qh(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function Zh(){return Yh(qh,[]).filter(r=>ty(r.mahlas)&&r.hostname===Xh(r.mahlas))}function ny(n){const r={mahlas:n,hostname:Xh(n),lastConnectedAt:new Date().toISOString()},o=Zh(),l=[r,...o.filter(a=>a.mahlas!==n)];return Qh(qh,l),r}function ry(){const n=Yh(Kh,null);return n?Zh().find(r=>r.mahlas===n)??null:null}function sy(n){Qh(Kh,n)}function oy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Eu(n);r&&(ny(r),sy(r))}const Dp="http://localhost:9998",iy=["agent.repoburg.com"];function sr(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),r=n.get("bport");if(r)return`http://localhost:${r}`;const o=n.get("host");if(o)return`https://${o}`;const l=window.location.hostname;if(iy.includes(l))return Dp;if(Eu(l))return"";const a=ry();return a?`https://${a.hostname}`:l==="localhost"||l==="127.0.0.1"||l==="0.0.0.0"?"":Dp}const ly="/api";async function ql(n,r,o){const l=await fetch(`${sr()}${ly}${r}`,{method:n,headers:o?{"Content-Type":"application/json"}:void 0,body:o?JSON.stringify(o):void 0});if(!l.ok){let a=`${l.status} ${l.statusText}`;try{const c=await l.json();c!=null&&c.error&&(a=`${a} — ${c.error}`)}catch{}throw new Error(`${n} ${r} failed: ${a}`)}return l.json()}function Cr(n){return ql("GET",n)}function Ht(n,r){return ql("POST",n,r)}function _u(n){return ql("DELETE",n)}function or(n,r){return ql("PATCH",n,r)}function ay(){return Cr("/sessions")}function xl(n){return Cr(`/sessions/${n}`)}function Jh(n){return Ht("/sessions",n)}function cy(n){return _u(`/sessions/${n}`)}function uy(n,r,o){return Ht(`/sessions/${n}/turns`,{user_prompt:r,...o!=null&&o.length?{attachments:o}:{}})}function dy(n){return Ht(`/sessions/${n}/cancel`)}function fy(n,r){return or(`/sessions/${n}`,{title:r})}function py(n){return or(`/sessions/${n}`,{lifecycle:"finished"})}function hy(n){return or(`/sessions/${n}`,{lifecycle:"working"})}function my(n,r){return or(`/sessions/${n}`,{starred:r})}function Ip(n){return or(`/sessions/${n}`,{has_unreviewed:0})}function gy(n,r,o,l){const a={model:r,model_reasoning_effort:o};return l!==void 0&&(a.runtime_type=l),or(`/sessions/${n}`,a)}function vy(n,r){return or(`/sessions/${n}`,{runtime_config:r})}function yy(n,r){return Ht(`/sessions/${n}/rewind`,{turn_id:r})}function xy(n){return Ht(`/sessions/${n}/restore`,{})}function wy(n,r,o){return Ht(`/sessions/${n}/branch`,{turn_id:r,title:o})}function em(){return Cr("/workspaces")}function ky(n,r){return Ht("/workspaces",{path:n,label:r})}function Sy(n){return Ht("/workspaces/hide",{path:n})}async function Ty(){const n=await fetch(`${sr()}/api/pick-directory`);if(n.status===204)return{cancelled:!0};if(!n.ok)throw new Error(`GET /api/pick-directory failed: ${n.status} ${n.statusText}`);return n.json()}function tm(){return Cr("/folders")}function Ny(n,r){return Ht("/folders",{workspace_path:n,name:r})}function Mp(n,r){return or(`/folders/${n}`,r)}function Cy(n){return _u(`/folders/${n}`)}function by(n){return Ht("/sessions/reorder",{moves:n})}function ro(n){return n.status==="pending"||n.status==="running"}function nm(n){return!!(n!=null&&n.turns.some(ro))}function Kl(n){return n?n.turns.some(ro)||(n.threads??[]).some(r=>(r.turns??[]).some(ro)):!1}const Ey=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,restoredPrompt:null,quotedText:null,init:async()=>{var o;try{const l=localStorage.getItem("agentpane:last-model-config");l&&n({lastModelConfig:JSON.parse(l)})}catch{}n({loading:!0,error:null});try{const[l,a,c]=await Promise.all([ay(),em(),tm()]);n({sessions:l,workspaces:a,folders:c,loading:!1});const f=new URLSearchParams(window.location.search),h=f.get("session"),m=f.get("thread"),g=h&&l.some(y=>y.id===h)?h:(o=l[0])==null?void 0:o.id;g&&!r().activeSessionId&&await r().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(l){n({loading:!1,error:l.message})}},selectSession:async o=>{if(r().sessionDetails[o]){const l=r().sessionDetails[o];n({activeSessionId:o,activeTurnIndex:l.turns.length>0?l.turns.length-1:0,activeRightTab:"turns",openTabs:r().openTabs.includes(o)?r().openTabs:[...r().openTabs,o]}),l.has_unreviewed===1&&(Ip(o).catch(()=>{}),n(a=>({sessions:a.sessions.map(c=>c.id===o?{...c,has_unreviewed:0}:c),sessionDetails:{...a.sessionDetails,[o]:{...l,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const l=await xl(o);n(a=>({sessionDetails:{...a.sessionDetails,[o]:l},activeSessionId:o,activeTurnIndex:l.turns.length>0?l.turns.length-1:0,activeRightTab:"turns",loading:!1})),l.has_unreviewed===1&&(Ip(o).catch(()=>{}),n(a=>({sessions:a.sessions.map(c=>c.id===o?{...c,has_unreviewed:0}:c),sessionDetails:{...a.sessionDetails,[o]:{...l,has_unreviewed:0}}})))}catch(l){n({loading:!1,error:l.message})}},closeTab:o=>{n(l=>{const a=l.openTabs.filter(c=>c!==o);if(l.activeSessionId===o&&a.length>0){const c=a[a.length-1],f=l.sessionDetails[c];return{openTabs:a,activeSessionId:c,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:l.activeSessionId===o?null:l.activeSessionId}})},updateModelConfig:async(o,l,a)=>{const c=r().activeSessionId;if(c){n({error:null});try{const f=await gy(c,o,l,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),n(m=>({sessions:m.sessions.map(g=>g.id===c?f:g),sessionDetails:m.sessionDetails[c]?{...m.sessionDetails,[c]:{...m.sessionDetails[c],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:m.sessionDetails})),await r().refreshActiveSession()}catch(f){n({error:f.message}),r().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async o=>{n({error:null});try{const l=await Jh(o);n(c=>({sessions:[l,...c.sessions],showNewSessionDialog:!1}));const a={provider:l.runtime_type,model:l.model??"",reasoning:l.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await r().selectSession(l.id),r().addLogEntry("INFO",`Session created — ${l.id.slice(0,8)}`),r().addToast("success",`Session created — ${l.title||l.id.slice(0,8)}`)}catch(l){n({error:l.message}),r().addToast("error",`Failed to create session — ${l.message}`)}},deleteSession:async o=>{var a;n({error:null});const l=(a=r().sessions.find(c=>c.id===o))==null?void 0:a.title;try{await cy(o),n(c=>{const f={...c.sessionDetails};delete f[o];const h=c.openTabs.filter(y=>y!==o);let m=c.activeSessionId,g=c.activeTurnIndex;if(c.activeSessionId===o){m=h.length>0?h[h.length-1]:null;const y=m?f[m]:null;g=y&&y.turns.length>0?y.turns.length-1:0}return{sessions:c.sessions.filter(y=>y.id!==o),sessionDetails:f,openTabs:h,activeSessionId:m,activeTurnIndex:g}}),r().addLogEntry("INFO",`Session deleted — ${o.slice(0,8)}`),r().addToast("info",`Session "${l||o.slice(0,8)}" deleted`)}catch(c){n({error:c.message}),r().addToast("error",`Failed to delete session — ${c.message}`)}},renameSession:async(o,l)=>{n({error:null});try{const a=await fy(o,l.trim());n(c=>({sessions:c.sessions.map(f=>f.id===o?a:f),sessionDetails:c.sessionDetails[o]?{...c.sessionDetails,[o]:{...c.sessionDetails[o],title:a.title}}:c.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async o=>{n({error:null});try{const l=await py(o);n(a=>({sessions:a.sessions.map(c=>c.id===o?l:c)})),r().addToast("info","Session marked as finished")}catch(l){n({error:l.message}),r().addToast("error",`Failed to mark as finished — ${l.message}`)}},toggleStar:async o=>{const l=r().sessions.find(a=>a.id===o);if(l){n({error:null});try{const a=await my(o,l.starred?0:1);n(c=>({sessions:c.sessions.map(f=>f.id===o?a:f),sessionDetails:c.sessionDetails[o]?{...c.sessionDetails,[o]:{...c.sessionDetails[o],starred:a.starred}}:c.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async o=>{n({error:null});try{const l=await hy(o);n(a=>({sessions:a.sessions.map(c=>c.id===o?l:c)})),r().addToast("info","Session reopened")}catch(l){n({error:l.message}),r().addToast("error",`Failed to reopen session — ${l.message}`)}},submitPrompt:async(o,l)=>{const a=r().activeSessionId;if(a){n({error:null,submittingPrompt:o}),n(c=>{const f=c.sessionDetails[a];return f?{sessionDetails:{...c.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:c.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const c=await uy(a,o,l);r().addLogEntry("INFO",`Turn submitted — "${o.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const m={...c,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},activeTurnIndex:h.turns.length}})}catch(c){n({submittingPrompt:null,error:c.message}),r().addLogEntry("ERROR",`Turn failed — ${c.message}`),r().addToast("error",`Failed to send prompt — ${c.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const m=Kl(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:m,status:m?"running":"active"}},sessions:f.sessions.map(g=>g.id===a?{...g,is_running:m,status:m?"running":"active"}:g)}})}}},cancelTurn:async()=>{const o=r().activeSessionId;if(o)try{await dy(o)}catch(l){n({error:l.message})}},rewindToTurn:async(o,l)=>{n({error:null});try{const a=await yy(o,l),c=await xl(o);n(f=>({sessionDetails:{...f.sessionDetails,[o]:c},sessions:f.sessions.map(h=>h.id===o?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:c.turns.length>0?c.turns.length-1:0})),r().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),r().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async o=>{n({error:null});try{const l=await xy(o),a=await xl(o);n(c=>({sessionDetails:{...c.sessionDetails,[o]:a},sessions:c.sessions.map(f=>f.id===o?{...f,external_thread_id:l.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),r().addToast("info","Restored rewound session")}catch(l){n({error:l.message}),r().addToast("error",`Failed to restore — ${l.message}`)}},branchFromTurn:async(o,l,a)=>{n({error:null});try{const c=await wy(o,l,a);n(f=>({sessions:[c,...f.sessions]})),await r().selectSession(c.id),r().addToast("success","Branched from selected turn")}catch(c){n({error:c.message}),r().addToast("error",`Failed to branch — ${c.message}`)}},updateRuntimeConfig:async o=>{const l=r().activeSessionId;if(l){n({error:null});try{const a=await vy(l,JSON.stringify(o));n(c=>({sessions:c.sessions.map(f=>f.id===l?a:f),sessionDetails:c.sessionDetails[l]?{...c.sessionDetails,[l]:{...c.sessionDetails[l],runtime_config:a.runtime_config}}:c.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const o=r().activeSessionId;if(o)try{const l=await xl(o);n(a=>({sessionDetails:{...a.sessionDetails,[o]:l},activeTurnIndex:l.turns.length>0?Math.min(a.activeTurnIndex,l.turns.length-1):0,sessions:a.sessions.map(c=>c.id===o?{...c,is_running:l.is_running,status:l.status}:c)}))}catch(l){n({error:l.message})}}}),_y=(n,r)=>({workspaces:[],addWorkspace:async o=>{n({error:null});try{const l=await ky(o.trim());n(a=>({workspaces:[...a.workspaces,l]})),r().addToast("success",`Workspace added — ${l.path}`)}catch(l){r().addToast("error",`Failed to add workspace — ${l.message}`)}},removeWorkspace:async o=>{n({error:null});try{await Sy(o);const l=await em();n({workspaces:l}),r().addToast("info","Workspace hidden")}catch(l){r().addToast("error",`Failed to hide workspace — ${l.message}`)}},createSessionInWorkspace:async o=>{n({error:null});try{const l=r().lastModelConfig,a=await Jh({cwd:o,runtime_type:(l==null?void 0:l.provider)??"codex",model:l==null?void 0:l.model,model_reasoning_effort:l==null?void 0:l.reasoning});n(c=>({sessions:[a,...c.sessions]})),await r().selectSession(a.id),r().addLogEntry("INFO",`Session created in ${o} — ${a.id.slice(0,8)}`),r().addToast("success",`Session created in ${o.split("/").pop()||o}`)}catch(l){n({error:l.message}),r().addToast("error",`Failed to create session — ${l.message}`)}},pickAndAddWorkspace:async()=>{try{const o=await Ty();if(o.cancelled||!o.path)return;await r().addWorkspace(o.path)}catch(o){r().addToast("error",`Failed to pick directory — ${o.message}`)}}}),Ry=(n,r)=>({wsConnected:!1,setWsConnected:o=>n({wsConnected:o}),onTurnStarted:(o,l)=>{r().addLogEntry("DEBUG",`turn:started — ${l.slice(0,8)}`),n(a=>{const c=a.sessionDetails[o];if(!c)return{};const f=c.turns.findIndex(h=>h.id===l);return{sessionDetails:{...a.sessionDetails,[o]:{...Gr(c,l,h=>({...h,status:"running"})),is_running:1,status:"running"}},sessions:a.sessions.map(h=>h.id===o?{...h,is_running:1,status:"running"}:h),activeTurnIndex:a.activeSessionId===o&&f>=0?f:a.activeTurnIndex}})},onItemStarted:(o,l,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(c=>{const f=c.sessionDetails[o];return f?{sessionDetails:{...c.sessionDetails,[o]:Gr(f,l,h=>Wc(h,a))}}:{}})},onItemUpdated:(o,l,a)=>{n(c=>{const f=c.sessionDetails[o];return f?{sessionDetails:{...c.sessionDetails,[o]:Gr(f,l,h=>Wc(h,a))}}:{}})},onItemCompleted:(o,l,a)=>{if(r().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const c=a.data||{},f=c.task_type||"unknown",h=c.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${g} completed: ${h}`):r().addToast("error",`${g} failed: ${h}`)}n(c=>{const f=c.sessionDetails[o];return f?{sessionDetails:{...c.sessionDetails,[o]:Gr(f,l,h=>{var g,y;let m=Wc(h,a);if(a.type==="agent_message"&&((g=a.data)!=null&&g.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((y=a.data)!=null&&y.text)){const k=m.thoughts?m.thoughts+`
41
+ `+a.data.text:a.data.text;m={...m,thoughts:k}}return m})}}:{}})},onItemDelta:(o,l,a,c)=>{n(f=>{const h=f.sessionDetails[o];return h?{sessionDetails:{...f.sessionDetails,[o]:Gr(h,l,m=>jy(m,a,c))}}:{}})},onTurnCompleted:(o,l,a,c,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),n(g=>{const y=g.sessionDetails[o];if(!y)return{};const k=Gr(y,l,C=>({...C,status:"completed",token_usage:a??C.token_usage??null,...f&&!C.agent_response?{agent_response:f}:{}})),x=Bc(k);return{sessionDetails:{...g.sessionDetails,[o]:{...k,is_running:x,status:x?"running":"active",has_unreviewed:c?1:y.has_unreviewed}},sessions:g.sessions.map(C=>C.id===o?{...C,is_running:x,status:x?"running":"active",has_unreviewed:c?1:C.has_unreviewed}:C)}})},onTokenUsageUpdated:(o,l,a)=>{n(c=>{const f=c.sessionDetails[o];return f?{sessionDetails:{...c.sessionDetails,[o]:Gr(f,l,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(o,l)=>{n(a=>{const c=a.sessionDetails[o];return c?{sessionDetails:{...a.sessionDetails,[o]:{...c,contextUsage:l}}}:{}})},onTurnFailed:(o,l,a)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),n(c=>{const f=c.sessionDetails[o];if(!f)return{};const h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=Gr(f,l,x=>({...x,status:m,error:a,items:x.items.map(C=>C.status==="in_progress"?{...C,status:"failed"}:C)})),y=Bc(g),k=y?"running":h?"active":"failed";return{sessionDetails:{...c.sessionDetails,[o]:{...g,is_running:y,status:k}},sessions:c.sessions.map(x=>x.id===o?{...x,is_running:y,status:k}:x)}})},onTurnCancelled:(o,l)=>{n(a=>{const c=a.sessionDetails[o];if(!c)return{};const h=[...c.turns,...(c.threads??[]).flatMap(x=>x.turns??[])].find(x=>x.id===l),m=(h==null?void 0:h.user_prompt)??null,g=c.turns.filter(x=>x.id!==l),y={...c,turns:g,threads:(c.threads??[]).map(x=>({...x,turns:(x.turns??[]).filter(C=>C.id!==l)}))},k=Bc(y);return{restoredPrompt:m,sessionDetails:{...a.sessionDetails,[o]:{...y,is_running:k,status:k?"running":"active"}},sessions:a.sessions.map(x=>x.id===o?{...x,is_running:k,status:k?"running":"active"}:x),activeTurnIndex:g.length>0?Math.min(a.activeTurnIndex,g.length-1):0}})},onSessionTitle:(o,l)=>{n(a=>({sessions:a.sessions.map(c=>c.id===o?{...c,title:l}:c),sessionDetails:a.sessionDetails[o]?{...a.sessionDetails,[o]:{...a.sessionDetails[o],title:l}}:a.sessionDetails}))},onBackgroundTasksChanged:(o,l)=>{n(a=>{const c=a.sessionDetails[o];return c?{sessionDetails:{...a.sessionDetails,[o]:{...c,backgroundTasks:l}}}:{}})}});function Bc(n){return n.turns.some(ro)||(n.threads??[]).some(o=>(o.turns??[]).some(ro))?1:0}function Gr(n,r,o){const l=(n.threads??[]).map(a=>(a.turns??[]).some(c=>c.id===r)?{...a,turns:(a.turns??[]).map(c=>c.id===r?o(c):c)}:a);return{...n,turns:n.turns.map(a=>a.id===r?o(a):a),threads:l}}function Wc(n,r){const o=n.items.findIndex(l=>l.external_item_id===r.external_item_id);if(o>=0){const l=[...n.items];return l[o]=r,{...n,items:l}}if(r.type==="agent_message"){const l=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...l,r]}}return{...n,items:[...n.items,r]}}function jy(n,r,o){var c;const l=n.items.findIndex(f=>f.external_item_id===r);if(l>=0){const f=n.items[l],m=(((c=f.data)==null?void 0:c.text)??"")+o,g=[...n.items];return g[l]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${r}`,turn_id:n.id,external_item_id:r,type:"agent_message",data:{text:o},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:o}}function Dy(n,r){const o=r?`?cwd=${encodeURIComponent(r)}`:"";return Cr(`/providers/${n}/models${o}`)}const iu=160,lu=480,Iy=240,Dl=220,My=300,Ay=600;function Il(){return typeof window>"u"?Ay:Math.max(Dl,Math.round(window.innerWidth*.7))}const Ap="agentpane:sidebar-width",Lp="agentpane:right-panel-width";function Pp(n,r,o,l){try{const a=localStorage.getItem(n);if(a==null)return l;const c=Number(a);return Number.isFinite(c)?Math.min(o,Math.max(r,c)):l}catch{return l}}const Op=200,Ly=(n,r)=>({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:Pp(Ap,iu,lu,Iy),rightPanelWidth:Pp(Lp,Dl,Il(),My),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:o=>n({activeTurnIndex:o}),switchRightTab:o=>n({activeRightTab:o}),setChangesScope:o=>n({changesScope:o}),setShowNewSessionDialog:o=>n({showNewSessionDialog:o}),setShowRemoteModal:o=>n({showRemoteModal:o}),setShowCommandPalette:o=>n({showCommandPalette:o}),setShowModelSelector:o=>n({showModelSelector:o}),setSelectedChangePath:o=>n({selectedChangePath:o}),setDeepLinkThreadId:o=>n({deepLinkThreadId:o}),setSidebarWidth:o=>{const l=Math.min(lu,Math.max(iu,Math.round(o)));n({sidebarWidth:l});try{localStorage.setItem(Ap,String(l))}catch{}},setRightPanelWidth:o=>{const l=Math.min(Il(),Math.max(Dl,Math.round(o)));n({rightPanelWidth:l});try{localStorage.setItem(Lp,String(l))}catch{}},toggleVscodeView:()=>{if(r().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(o,l,a)=>n({vscodeState:o,vscodeId:l,vscodeToken:a}),addToast:(o,l,a,c)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:o,message:l,undoAction:a,undoLabel:c}]}))},removeToast:o=>{n(l=>({toasts:l.toasts.filter(a=>a.id!==o)}))},addLogEntry:(o,l)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(c=>{const f=[...c.eventLog,{time:a,level:o,message:l}];return f.length>Op&&f.splice(0,f.length-Op),{eventLog:f}})},loadModels:async(o,l)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await Dy(o,l);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),Py=(n,r)=>({createThread:async(o,l)=>{try{await Ht(`/sessions/${o}/threads`,l),r().addLogEntry("INFO",`Thread created — "${l.message.slice(0,40)}"`)}catch(a){r().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(o,l,a)=>{try{await Ht(`/sessions/${o}/threads/${l}/followup`,{message:a}),r().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(c){r().addToast("error",`Failed to send follow-up — ${c.message}`)}},cancelThreadTurn:async(o,l)=>{try{await Ht(`/sessions/${o}/cancel?threadId=${encodeURIComponent(l)}`),r().addLogEntry("INFO","Thread turn cancelled")}catch(a){r().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(o,l)=>{try{await or(`/sessions/${o}/threads/${l}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(o,l)=>{try{await or(`/sessions/${o}/threads/${l}`,{status:"open"})}catch(a){r().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(o,l,a)=>{try{const c=await Ht(`/sessions/${o}/threads/${l}/summarize`,{directives:a}),f=`
42
+ [Shared from a resolved discussion thread — summary of its findings]
43
+
44
+ \`\`\`QUOTE
45
+ ${c.summary}
46
+ \`\`\`
47
+
48
+ `;return n({quotedText:f}),r().addLogEntry("INFO",`Thread shared to main session — "${c.summary.slice(0,40)}"`),r().addToast("success","Thread summary added to your input"),!0}catch(c){return r().addToast("error",`Failed to share thread — ${c.message}`),!1}},deleteThread:async(o,l)=>{try{await _u(`/sessions/${o}/threads/${l}`)}catch(a){r().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(o,l,a)=>{n(c=>{const f=c.sessionDetails[o];return f?{sessionDetails:{...c.sessionDetails,[o]:{...f,threads:[...f.threads??[],{...l,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(o,l,a)=>{n(c=>{const f=c.sessionDetails[o];return f?{sessionDetails:{...c.sessionDetails,[o]:{...f,threads:(f.threads??[]).map(h=>h.id===l?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(o,l,a)=>{n(c=>{const f=c.sessionDetails[o];if(!f)return{};const h=(f.threads??[]).map(m=>m.id===l?{...m,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:m);return{sessionDetails:{...c.sessionDetails,[o]:{...f,threads:h}}}})},onThreadDeleted:(o,l)=>{n(a=>{const c=a.sessionDetails[o];return c?{sessionDetails:{...a.sessionDetails,[o]:{...c,threads:(c.threads??[]).filter(f=>f.id!==l)}}}:{}})}}),Oy=(n,r)=>({folders:[],loadFolders:async()=>{const o=await tm();n({folders:o})},createSidebarFolder:async(o,l)=>{try{const a=await Ny(o,l);return n(c=>({folders:[...c.folders,a]})),a}catch(a){return r().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(o,l)=>{try{const a=await Mp(o,{name:l});n(c=>({folders:c.folders.map(f=>f.id===o?a:f)}))}catch(a){r().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async o=>{const l=r().folders,a=r().sessions;n(c=>({folders:c.folders.filter(f=>f.id!==o),sessions:c.sessions.map(f=>f.folder_id===o?{...f,folder_id:null}:f)}));try{await Cy(o)}catch(c){n({folders:l,sessions:a}),r().addToast("error",`Failed to delete folder — ${c.message}`)}},applyMoves:async o=>{if(o.length===0)return;const l=r().sessions,a=new Map(o.map(c=>[c.id,c]));n(c=>({sessions:c.sessions.map(f=>{const h=a.get(f.id);return h?{...f,folder_id:h.folder_id,sort_order:h.sort_order}:f})}));try{await by(o)}catch(c){n({sessions:l}),r().addToast("error",`Failed to save session order — ${c.message}`)}},reorderFolders:async o=>{const l=r().folders,a=new Map(o.map((c,f)=>[c,f]));n(c=>({folders:c.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(o.map((c,f)=>Mp(c,{sort_order:f})))}catch(c){n({folders:l}),r().addToast("error",`Failed to save folder order — ${c.message}`)}}}),zp=3e3,bn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},En=[];let Ml=0,Ru=0,Al=0,ju=0,Ll=0,Du=0,Iu=0;const ti=new Map,ni=new Map;let Js=new Map,Qs=0,eo=new Map,Hc=!1;function Pl(n,r,o){if(En.push({t:Date.now(),cat:n,msg:r,ms:o}),En.length>zp){const l=En.length-zp;En.splice(0,l),yn=Math.max(0,yn-l)}}function Zs(n,r,o){Pl(n,r,o),console.log(`[perf:${n}] ${r}`)}function rm(n){Zs("note",n)}function sm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function zy(n,r){let o=Js.get(n);o||Js.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r;let l=ti.get(n);l||ti.set(n,l={n:0,bytes:0}),l.n++,l.bytes+=r}function $y(){Qs++,Iu++}function Fy(n){eo.set(n,(eo.get(n)??0)+1),ni.set(n,(ni.get(n)??0)+1)}let _l=0;function Uy(){_l=performance.now()}function By(){const n=performance.now(),r=_l?n-_l:null;_l=0,requestAnimationFrame(()=>{if(r===null)return;const o=performance.now()-n+r;o>bn.keypressMs&&Zs("input",`keystroke→paint ${Math.round(o)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Wy=5e3,om=500,$p=2e3;let yn=0,Vc=!1;function Hy(n){return Ht("/perf-log",{entries:n}).then(()=>{yn+=n.length})}function Vy(){if(Vc||yn>=En.length)return;const n=En.slice(yn,yn+om);n.length!==0&&(Vc=!0,Hy(n).catch(()=>{En.length-yn>$p&&(yn=Math.max(yn,En.length-$p))}).finally(()=>{Vc=!1}))}function Fp(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||yn>=En.length)return;const n=En.slice(yn,yn+om);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${sr()}/api/perf-log`,r),yn+=n.length}catch{}}function Gy(){let n=0;for(const l of Js.values())n+=l.n;const r=[];if(n>0){const l=[...Js.entries()].sort((a,c)=>c[1].n-a[1].n).map(([a,c])=>`${a}×${c.n}(${sm(c.bytes)})`).join(", ");r.push(`ws ${n}/s [${l}]`)}Qs>0&&r.push(`store ${Qs}/s`);const o=[...eo.entries()].sort((l,a)=>a[1]-l[1]).map(([l,a])=>`${l}×${a}`);if(o.length>0&&r.push(`renders ${o.join(" ")}`),r.length>0){const l=r.join(" · ");Pl("stat",l);const a=[...eo.values()].some(c=>c>bn.renderPerSecLog);(n>bn.wsPerSecLog||Qs>bn.storePerSecLog||a)&&console.log(`[perf:stat] ${l}`)}Js=new Map,Qs=0,eo=new Map}function qy(n){if(n instanceof Element){const r=n.id?`#${n.id}`:"",o=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${r}${o}`}return n?"window":"unknown"}function Ky(){if(Hc||typeof window>"u")return()=>{};Hc=!0,Ml=Date.now();const n=[];let r=performance.now()+250;const o=window.setInterval(()=>{const c=performance.now(),f=c-r;r=c+250,f>bn.lagMs&&(Ru++,Al=Math.max(Al,f),Zs("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(o)),typeof window.requestAnimationFrame=="function"){let c=performance.now(),f=0;const h=m=>{const g=m-c;c=m,g>bn.frameGapMs&&Zs("lag",`frame gap ${Math.round(g)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const c=new PerformanceObserver(f=>{var h;for(const m of f.getEntries()){const g=m.duration;if(g<bn.longtaskBufferMs)continue;ju++,Ll=Math.max(Ll,g);const y=(h=m.attribution)==null?void 0:h[0],k=(y==null?void 0:y.containerName)||(y==null?void 0:y.name)||"unknown",x=`long task ${Math.round(g)}ms (${k})`;g>=bn.longtaskLogMs?Zs("longtask",x,g):Pl("longtask",x,g)}});c.observe({type:"longtask",buffered:!1}),n.push(()=>c.disconnect())}catch{}try{const c=new PerformanceObserver(f=>{for(const h of f.getEntries()){const m=h.duration,g=h.processingStart-h.startTime;Du++;const y=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${qy(h.target)}`;m>=bn.eventLogMs?Zs("input",y,m):Pl("input",y,m)}});c.observe({type:"event",durationThreshold:bn.eventBufferMs}),n.push(()=>c.disconnect())}catch{}}const l=window.setInterval(Gy,1e3);n.push(()=>window.clearInterval(l)),rm("perf logger session started");const a=window.setInterval(Vy,Wy);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",Fp),n.push(()=>window.removeEventListener("beforeunload",Fp)),window.__agentPanePerf={dump:im,reset:lm},()=>{n.forEach(c=>c()),Hc=!1}}function im(){const n=[],r=Ml?Math.round((Date.now()-Ml)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${En.length} buffered entries`),n.push(`event-loop lag: ${Ru} blocks >${bn.lagMs}ms (max ${Math.round(Al)}ms)`),n.push(`long tasks: ${ju} ≥${bn.longtaskBufferMs}ms (max ${Math.round(Ll)}ms)`),n.push(`slow input events (≥${bn.eventBufferMs}ms): ${Du}`),n.push(`store updates: ${Iu} total`),ti.size>0){n.push("ws messages by type (top 15):");for(const[o,l]of[...ti.entries()].sort((a,c)=>c[1].n-a[1].n).slice(0,15))n.push(` ${o}: ${l.n} msgs, ${sm(l.bytes)}`)}if(ni.size>0){n.push("render counts by component:");for(const[o,l]of[...ni.entries()].sort((a,c)=>c[1]-a[1]))n.push(` ${o}: ${l}`)}n.push("--- last 200 entries ---");for(const o of En.slice(-200))n.push(`${new Date(o.t).toISOString().slice(11,23)} [${o.cat}] ${o.msg}`);return n.join(`
49
+ `)}function lm(){En.length=0,yn=0,Ml=Date.now(),Ru=0,Al=0,ju=0,Ll=0,Du=0,Iu=0,ti.clear(),ni.clear(),Js=new Map,Qs=0,eo=new Map}const Gt={start:Ky,note:rm,trackWsEvent:zy,trackStoreUpdate:$y,trackRender:Fy,markKeystroke:Uy,markInputChange:By,dump:im,reset:lm},F=ey()((...n)=>({...Ey(...n),..._y(...n),...Ry(...n),...Ly(...n),...Py(...n),...Oy(...n)}));typeof window<"u"&&F.subscribe(()=>Gt.trackStoreUpdate());function au(n){switch(n){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 Xy(n,r){const o=new Date(n).getTime(),l=r?new Date(r).getTime():Date.now(),a=Math.max(0,Math.floor((l-o)/1e3));if(a<60)return`${a}s`;const c=Math.floor(a/60),f=a%60;if(c<60)return`${c}m ${f}s`;const h=Math.floor(c/60),m=c%60;return`${h}h ${m}m`}function Yy(n,r,o=!1,l="working"){if(l==="finished")return"";if(r)return"running";if(o&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Qy(n,r,o=!1,l="working"){if(l==="finished")return"Finished";if(r)return"Running";if(o&&n!=="failed")return"Review Pending";switch(n){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return n}}function Mu(n){const r=n.is_running===1,o=n.lifecycle==="finished",l=au(n.runtime_type);return{dot:Yy(n.status,r,n.has_unreviewed===1,n.lifecycle),label:Qy(n.status,r,n.has_unreviewed===1,n.lifecycle),iconClass:l.iconClass,iconText:l.iconText,isRunning:r,isFinished:o}}function Xl(n,r,o=!0){w.useEffect(()=>{if(!o)return;function l(a){n.current&&!n.current.contains(a.target)&&r()}return document.addEventListener("mousedown",l),document.addEventListener("touchstart",l),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("touchstart",l)}},[n,r,o])}function Au(n,r=!0){w.useEffect(()=>{if(!r)return;function o(l){l.key==="Escape"&&n()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,r])}function Lu({status:n,size:r=6}){return u.jsx("span",{className:`status-dot ${n}`,style:r!==6?{width:r,height:r}:void 0})}function am({iconClass:n,iconText:r,size:o=20}){return u.jsx("span",{className:`runtime-icon ${n}`,style:o!==20?{width:o,height:o,fontSize:o*.45}:void 0,children:r})}/**
50
+ * @license lucide-react v0.469.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Zy=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cm=(...n)=>n.filter((r,o,l)=>!!r&&r.trim()!==""&&l.indexOf(r)===o).join(" ").trim();/**
55
+ * @license lucide-react v0.469.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */var Jy={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"};/**
60
+ * @license lucide-react v0.469.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const e0=w.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:a="",children:c,iconNode:f,...h},m)=>w.createElement("svg",{ref:m,...Jy,width:r,height:r,stroke:n,strokeWidth:l?Number(o)*24/Number(r):o,className:cm("lucide",a),...h},[...f.map(([g,y])=>w.createElement(g,y)),...Array.isArray(c)?c:[c]]));/**
65
+ * @license lucide-react v0.469.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const Se=(n,r)=>{const o=w.forwardRef(({className:l,...a},c)=>w.createElement(e0,{ref:c,iconNode:r,className:cm(`lucide-${Zy(n)}`,l),...a}));return o.displayName=`${n}`,o};/**
70
+ * @license lucide-react v0.469.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const t0=Se("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
75
+ * @license lucide-react v0.469.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const cu=Se("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"}]]);/**
80
+ * @license lucide-react v0.469.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const n0=Se("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"}]]);/**
85
+ * @license lucide-react v0.469.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const Yr=Se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
90
+ * @license lucide-react v0.469.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const ri=Se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
95
+ * @license lucide-react v0.469.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const Pu=Se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
100
+ * @license lucide-react v0.469.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Ou=Se("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"}]]);/**
105
+ * @license lucide-react v0.469.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const r0=Se("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
110
+ * @license lucide-react v0.469.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const zu=Se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
115
+ * @license lucide-react v0.469.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const s0=Se("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"}]]);/**
120
+ * @license lucide-react v0.469.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const o0=Se("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
125
+ * @license lucide-react v0.469.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const i0=Se("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
130
+ * @license lucide-react v0.469.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const um=Se("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"}]]);/**
135
+ * @license lucide-react v0.469.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const Up=Se("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"}]]);/**
140
+ * @license lucide-react v0.469.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const uu=Se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
145
+ * @license lucide-react v0.469.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const l0=Se("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
150
+ * @license lucide-react v0.469.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const a0=Se("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"}]]);/**
155
+ * @license lucide-react v0.469.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const c0=Se("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"}]]);/**
160
+ * @license lucide-react v0.469.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const dm=Se("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"}]]);/**
165
+ * @license lucide-react v0.469.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const Gc=Se("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"}]]);/**
170
+ * @license lucide-react v0.469.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const du=Se("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"}]]);/**
175
+ * @license lucide-react v0.469.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const u0=Se("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"}]]);/**
180
+ * @license lucide-react v0.469.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const d0=Se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
185
+ * @license lucide-react v0.469.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const f0=Se("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"}]]);/**
190
+ * @license lucide-react v0.469.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const p0=Se("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"}]]);/**
195
+ * @license lucide-react v0.469.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const h0=Se("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"}]]);/**
200
+ * @license lucide-react v0.469.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const Kn=Se("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
205
+ * @license lucide-react v0.469.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const m0=Se("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"}]]);/**
210
+ * @license lucide-react v0.469.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const g0=Se("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"}]]);/**
215
+ * @license lucide-react v0.469.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const v0=Se("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"}]]);/**
220
+ * @license lucide-react v0.469.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const y0=Se("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"}]]);/**
225
+ * @license lucide-react v0.469.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const Bp=Se("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"}]]);/**
230
+ * @license lucide-react v0.469.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const x0=Se("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
235
+ * @license lucide-react v0.469.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const w0=Se("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"}]]);/**
240
+ * @license lucide-react v0.469.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const Wp=Se("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"}]]);/**
245
+ * @license lucide-react v0.469.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const k0=Se("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"}]]);/**
250
+ * @license lucide-react v0.469.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const Xo=Se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
255
+ * @license lucide-react v0.469.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const fm=Se("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"}]]);/**
260
+ * @license lucide-react v0.469.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const S0=Se("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"}]]);/**
265
+ * @license lucide-react v0.469.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const Yl=Se("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"}]]);/**
270
+ * @license lucide-react v0.469.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const pm=Se("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"}]]);/**
275
+ * @license lucide-react v0.469.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const T0=Se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
280
+ * @license lucide-react v0.469.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const Ql=Se("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"}]]);/**
285
+ * @license lucide-react v0.469.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const N0=Se("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
290
+ * @license lucide-react v0.469.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const ii=Se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
295
+ * @license lucide-react v0.469.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const C0=Se("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
300
+ * @license lucide-react v0.469.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const hm=Se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
305
+ * @license lucide-react v0.469.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const vs=Se("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"}]]);/**
310
+ * @license lucide-react v0.469.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const b0=Se("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"}]]);/**
315
+ * @license lucide-react v0.469.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const E0=Se("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"}]]);/**
320
+ * @license lucide-react v0.469.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const _0=Se("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"}]]);/**
325
+ * @license lucide-react v0.469.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const R0=Se("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"}]]);/**
330
+ * @license lucide-react v0.469.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const ir=Se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
335
+ * @license lucide-react v0.469.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const j0=Se("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"}]]);var qo=Gh();function D0(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return w.useMemo(()=>l=>{r.forEach(a=>a(l))},r)}const Zl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function so(n){const r=Object.prototype.toString.call(n);return r==="[object Window]"||r==="[object global]"}function $u(n){return"nodeType"in n}function cn(n){var r,o;return n?so(n)?n:$u(n)&&(r=(o=n.ownerDocument)==null?void 0:o.defaultView)!=null?r:window:window}function Fu(n){const{Document:r}=cn(n);return n instanceof r}function li(n){return so(n)?!1:n instanceof cn(n).HTMLElement}function mm(n){return n instanceof cn(n).SVGElement}function oo(n){return n?so(n)?n.document:$u(n)?Fu(n)?n:li(n)||mm(n)?n.ownerDocument:document:document:document}const Xn=Zl?w.useLayoutEffect:w.useEffect;function Jl(n){const r=w.useRef(n);return Xn(()=>{r.current=n}),w.useCallback(function(){for(var o=arguments.length,l=new Array(o),a=0;a<o;a++)l[a]=arguments[a];return r.current==null?void 0:r.current(...l)},[])}function I0(){const n=w.useRef(null),r=w.useCallback((l,a)=>{n.current=setInterval(l,a)},[]),o=w.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[r,o]}function si(n,r){r===void 0&&(r=[n]);const o=w.useRef(n);return Xn(()=>{o.current!==n&&(o.current=n)},r),o}function ai(n,r){const o=w.useRef();return w.useMemo(()=>{const l=n(o.current);return o.current=l,l},[...r])}function Ol(n){const r=Jl(n),o=w.useRef(null),l=w.useCallback(a=>{a!==o.current&&(r==null||r(a,o.current)),o.current=a},[]);return[o,l]}function zl(n){const r=w.useRef();return w.useEffect(()=>{r.current=n},[n]),r.current}let qc={};function ci(n,r){return w.useMemo(()=>{if(r)return r;const o=qc[n]==null?0:qc[n]+1;return qc[n]=o,n+"-"+o},[n,r])}function gm(n){return function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),a=1;a<o;a++)l[a-1]=arguments[a];return l.reduce((c,f)=>{const h=Object.entries(f);for(const[m,g]of h){const y=c[m];y!=null&&(c[m]=y+n*g)}return c},{...r})}}const to=gm(1),$l=gm(-1);function M0(n){return"clientX"in n&&"clientY"in n}function ea(n){if(!n)return!1;const{KeyboardEvent:r}=cn(n.target);return r&&n instanceof r}function A0(n){if(!n)return!1;const{TouchEvent:r}=cn(n.target);return r&&n instanceof r}function Fl(n){if(A0(n)){if(n.touches&&n.touches.length){const{clientX:r,clientY:o}=n.touches[0];return{x:r,y:o}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:r,clientY:o}=n.changedTouches[0];return{x:r,y:o}}}return M0(n)?{x:n.clientX,y:n.clientY}:null}const Nr=Object.freeze({Translate:{toString(n){if(!n)return;const{x:r,y:o}=n;return"translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:r,scaleY:o}=n;return"scaleX("+r+") scaleY("+o+")"}},Transform:{toString(n){if(n)return[Nr.Translate.toString(n),Nr.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:r,duration:o,easing:l}=n;return r+" "+o+"ms "+l}}}),Hp="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function L0(n){return n.matches(Hp)?n:n.querySelector(Hp)}const P0={display:"none"};function O0(n){let{id:r,value:o}=n;return rt.createElement("div",{id:r,style:P0},o)}function z0(n){let{id:r,announcement:o,ariaLiveType:l="assertive"}=n;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return rt.createElement("div",{id:r,style:a,role:"status","aria-live":l,"aria-atomic":!0},o)}function $0(){const[n,r]=w.useState("");return{announce:w.useCallback(l=>{l!=null&&r(l)},[]),announcement:n}}const vm=w.createContext(null);function F0(n){const r=w.useContext(vm);w.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(n)},[n,r])}function U0(){const[n]=w.useState(()=>new Set),r=w.useCallback(l=>(n.add(l),()=>n.delete(l)),[n]);return[w.useCallback(l=>{let{type:a,event:c}=l;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,c)})},[n]),r]}const B0={draggable:`
340
+ To pick up a draggable item, press the space bar.
341
+ While dragging, use the arrow keys to move the item.
342
+ Press space again to drop the item in its new position, or press escape to cancel.
343
+ `},W0={onDragStart(n){let{active:r}=n;return"Picked up draggable item "+r.id+"."},onDragOver(n){let{active:r,over:o}=n;return o?"Draggable item "+r.id+" was moved over droppable area "+o.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(n){let{active:r,over:o}=n;return o?"Draggable item "+r.id+" was dropped over droppable area "+o.id:"Draggable item "+r.id+" was dropped."},onDragCancel(n){let{active:r}=n;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function H0(n){let{announcements:r=W0,container:o,hiddenTextDescribedById:l,screenReaderInstructions:a=B0}=n;const{announce:c,announcement:f}=$0(),h=ci("DndLiveRegion"),[m,g]=w.useState(!1);if(w.useEffect(()=>{g(!0)},[]),F0(w.useMemo(()=>({onDragStart(k){let{active:x}=k;c(r.onDragStart({active:x}))},onDragMove(k){let{active:x,over:C}=k;r.onDragMove&&c(r.onDragMove({active:x,over:C}))},onDragOver(k){let{active:x,over:C}=k;c(r.onDragOver({active:x,over:C}))},onDragEnd(k){let{active:x,over:C}=k;c(r.onDragEnd({active:x,over:C}))},onDragCancel(k){let{active:x,over:C}=k;c(r.onDragCancel({active:x,over:C}))}}),[c,r])),!m)return null;const y=rt.createElement(rt.Fragment,null,rt.createElement(O0,{id:l,value:a.draggable}),rt.createElement(z0,{id:h,announcement:f}));return o?qo.createPortal(y,o):y}var Mt;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Mt||(Mt={}));function Ul(){}function V0(n,r){return w.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function G0(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return w.useMemo(()=>[...r].filter(l=>l!=null),[...r])}const Yn=Object.freeze({x:0,y:0});function q0(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function K0(n,r){const o=Fl(n);if(!o)return"0 0";const l={x:(o.x-r.left)/r.width*100,y:(o.y-r.top)/r.height*100};return l.x+"% "+l.y+"%"}function X0(n,r){let{data:{value:o}}=n,{data:{value:l}}=r;return o-l}function Y0(n,r){let{data:{value:o}}=n,{data:{value:l}}=r;return l-o}function Q0(n,r){if(!n||n.length===0)return null;const[o]=n;return o[r]}function Vp(n,r,o){return r===void 0&&(r=n.left),o===void 0&&(o=n.top),{x:r+n.width*.5,y:o+n.height*.5}}const Z0=n=>{let{collisionRect:r,droppableRects:o,droppableContainers:l}=n;const a=Vp(r,r.left,r.top),c=[];for(const f of l){const{id:h}=f,m=o.get(h);if(m){const g=q0(Vp(m),a);c.push({id:h,data:{droppableContainer:f,value:g}})}}return c.sort(X0)};function J0(n,r){const o=Math.max(r.top,n.top),l=Math.max(r.left,n.left),a=Math.min(r.left+r.width,n.left+n.width),c=Math.min(r.top+r.height,n.top+n.height),f=a-l,h=c-o;if(l<a&&o<c){const m=r.width*r.height,g=n.width*n.height,y=f*h,k=y/(m+g-y);return Number(k.toFixed(4))}return 0}const ex=n=>{let{collisionRect:r,droppableRects:o,droppableContainers:l}=n;const a=[];for(const c of l){const{id:f}=c,h=o.get(f);if(h){const m=J0(h,r);m>0&&a.push({id:f,data:{droppableContainer:c,value:m}})}}return a.sort(Y0)};function tx(n,r,o){return{...n,scaleX:r&&o?r.width/o.width:1,scaleY:r&&o?r.height/o.height:1}}function ym(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:Yn}function nx(n){return function(o){for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c<l;c++)a[c-1]=arguments[c];return a.reduce((f,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...o})}}const rx=nx(1);function xm(n){if(n.startsWith("matrix3d(")){const r=n.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(n.startsWith("matrix(")){const r=n.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function sx(n,r,o){const l=xm(r);if(!l)return n;const{scaleX:a,scaleY:c,x:f,y:h}=l,m=n.left-f-(1-a)*parseFloat(o),g=n.top-h-(1-c)*parseFloat(o.slice(o.indexOf(" ")+1)),y=a?n.width/a:n.width,k=c?n.height/c:n.height;return{width:y,height:k,top:g,right:m+y,bottom:g+k,left:m}}const ox={ignoreTransform:!1};function io(n,r){r===void 0&&(r=ox);let o=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:g,transformOrigin:y}=cn(n).getComputedStyle(n);g&&(o=sx(o,g,y))}const{top:l,left:a,width:c,height:f,bottom:h,right:m}=o;return{top:l,left:a,width:c,height:f,bottom:h,right:m}}function Gp(n){return io(n,{ignoreTransform:!0})}function ix(n){const r=n.innerWidth,o=n.innerHeight;return{top:0,left:0,right:r,bottom:o,width:r,height:o}}function lx(n,r){return r===void 0&&(r=cn(n).getComputedStyle(n)),r.position==="fixed"}function ax(n,r){r===void 0&&(r=cn(n).getComputedStyle(n));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const c=r[a];return typeof c=="string"?o.test(c):!1})}function Uu(n,r){const o=[];function l(a){if(r!=null&&o.length>=r||!a)return o;if(Fu(a)&&a.scrollingElement!=null&&!o.includes(a.scrollingElement))return o.push(a.scrollingElement),o;if(!li(a)||mm(a)||o.includes(a))return o;const c=cn(n).getComputedStyle(a);return a!==n&&ax(a,c)&&o.push(a),lx(a,c)?o:l(a.parentNode)}return n?l(n):o}function wm(n){const[r]=Uu(n,1);return r??null}function Kc(n){return!Zl||!n?null:so(n)?n:$u(n)?Fu(n)||n===oo(n).scrollingElement?window:li(n)?n:null:null}function km(n){return so(n)?n.scrollX:n.scrollLeft}function Sm(n){return so(n)?n.scrollY:n.scrollTop}function fu(n){return{x:km(n),y:Sm(n)}}var Ft;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Ft||(Ft={}));function Tm(n){return!Zl||!n?!1:n===document.scrollingElement}function Nm(n){const r={x:0,y:0},o=Tm(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},l={x:n.scrollWidth-o.width,y:n.scrollHeight-o.height},a=n.scrollTop<=r.y,c=n.scrollLeft<=r.x,f=n.scrollTop>=l.y,h=n.scrollLeft>=l.x;return{isTop:a,isLeft:c,isBottom:f,isRight:h,maxScroll:l,minScroll:r}}const cx={x:.2,y:.2};function ux(n,r,o,l,a){let{top:c,left:f,right:h,bottom:m}=o;l===void 0&&(l=10),a===void 0&&(a=cx);const{isTop:g,isBottom:y,isLeft:k,isRight:x}=Nm(n),C={x:0,y:0},D={x:0,y:0},E={height:r.height*a.y,width:r.width*a.x};return!g&&c<=r.top+E.height?(C.y=Ft.Backward,D.y=l*Math.abs((r.top+E.height-c)/E.height)):!y&&m>=r.bottom-E.height&&(C.y=Ft.Forward,D.y=l*Math.abs((r.bottom-E.height-m)/E.height)),!x&&h>=r.right-E.width?(C.x=Ft.Forward,D.x=l*Math.abs((r.right-E.width-h)/E.width)):!k&&f<=r.left+E.width&&(C.x=Ft.Backward,D.x=l*Math.abs((r.left+E.width-f)/E.width)),{direction:C,speed:D}}function dx(n){if(n===document.scrollingElement){const{innerWidth:c,innerHeight:f}=window;return{top:0,left:0,right:c,bottom:f,width:c,height:f}}const{top:r,left:o,right:l,bottom:a}=n.getBoundingClientRect();return{top:r,left:o,right:l,bottom:a,width:n.clientWidth,height:n.clientHeight}}function Cm(n){return n.reduce((r,o)=>to(r,fu(o)),Yn)}function fx(n){return n.reduce((r,o)=>r+km(o),0)}function px(n){return n.reduce((r,o)=>r+Sm(o),0)}function bm(n,r){if(r===void 0&&(r=io),!n)return;const{top:o,left:l,bottom:a,right:c}=r(n);wm(n)&&(a<=0||c<=0||o>=window.innerHeight||l>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const hx=[["x",["left","right"],fx],["y",["top","bottom"],px]];class Bu{constructor(r,o){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const l=Uu(o),a=Cm(l);this.rect={...r},this.width=r.width,this.height=r.height;for(const[c,f,h]of hx)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=h(l),y=a[c]-g;return this.rect[m]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yo{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(o=>{var l;return(l=this.target)==null?void 0:l.removeEventListener(...o)})},this.target=r}add(r,o,l){var a;(a=this.target)==null||a.addEventListener(r,o,l),this.listeners.push([r,o,l])}}function mx(n){const{EventTarget:r}=cn(n);return n instanceof r?n:oo(n)}function Xc(n,r){const o=Math.abs(n.x),l=Math.abs(n.y);return typeof r=="number"?Math.sqrt(o**2+l**2)>r:"x"in r&&"y"in r?o>r.x&&l>r.y:"x"in r?o>r.x:"y"in r?l>r.y:!1}var On;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(On||(On={}));function qp(n){n.preventDefault()}function gx(n){n.stopPropagation()}var Je;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Je||(Je={}));const Em={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter,Je.Tab]},vx=(n,r)=>{let{currentCoordinates:o}=r;switch(n.code){case Je.Right:return{...o,x:o.x+25};case Je.Left:return{...o,x:o.x-25};case Je.Down:return{...o,y:o.y+25};case Je.Up:return{...o,y:o.y-25}}};class _m{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;const{event:{target:o}}=r;this.props=r,this.listeners=new Yo(oo(o)),this.windowListeners=new Yo(cn(o)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(On.Resize,this.handleCancel),this.windowListeners.add(On.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(On.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:o}=this.props,l=r.node.current;l&&bm(l),o(Yn)}handleKeyDown(r){if(ea(r)){const{active:o,context:l,options:a}=this.props,{keyboardCodes:c=Em,coordinateGetter:f=vx,scrollBehavior:h="smooth"}=a,{code:m}=r;if(c.end.includes(m)){this.handleEnd(r);return}if(c.cancel.includes(m)){this.handleCancel(r);return}const{collisionRect:g}=l.current,y=g?{x:g.left,y:g.top}:Yn;this.referenceCoordinates||(this.referenceCoordinates=y);const k=f(r,{active:o,context:l.current,currentCoordinates:y});if(k){const x=$l(k,y),C={x:0,y:0},{scrollableAncestors:D}=l.current;for(const E of D){const N=r.code,{isTop:M,isRight:j,isLeft:H,isBottom:P,maxScroll:V,minScroll:ee}=Nm(E),q=dx(E),B={x:Math.min(N===Je.Right?q.right-q.width/2:q.right,Math.max(N===Je.Right?q.left:q.left+q.width/2,k.x)),y:Math.min(N===Je.Down?q.bottom-q.height/2:q.bottom,Math.max(N===Je.Down?q.top:q.top+q.height/2,k.y))},oe=N===Je.Right&&!j||N===Je.Left&&!H,ae=N===Je.Down&&!P||N===Je.Up&&!M;if(oe&&B.x!==k.x){const ce=E.scrollLeft+x.x,Pe=N===Je.Right&&ce<=V.x||N===Je.Left&&ce>=ee.x;if(Pe&&!x.y){E.scrollTo({left:ce,behavior:h});return}Pe?C.x=E.scrollLeft-ce:C.x=N===Je.Right?E.scrollLeft-V.x:E.scrollLeft-ee.x,C.x&&E.scrollBy({left:-C.x,behavior:h});break}else if(ae&&B.y!==k.y){const ce=E.scrollTop+x.y,Pe=N===Je.Down&&ce<=V.y||N===Je.Up&&ce>=ee.y;if(Pe&&!x.x){E.scrollTo({top:ce,behavior:h});return}Pe?C.y=E.scrollTop-ce:C.y=N===Je.Down?E.scrollTop-V.y:E.scrollTop-ee.y,C.y&&E.scrollBy({top:-C.y,behavior:h});break}}this.handleMove(r,to($l(k,this.referenceCoordinates),C))}}}handleMove(r,o){const{onMove:l}=this.props;r.preventDefault(),l(o)}handleEnd(r){const{onEnd:o}=this.props;r.preventDefault(),this.detach(),o()}handleCancel(r){const{onCancel:o}=this.props;r.preventDefault(),this.detach(),o()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}_m.activators=[{eventName:"onKeyDown",handler:(n,r,o)=>{let{keyboardCodes:l=Em,onActivation:a}=r,{active:c}=o;const{code:f}=n.nativeEvent;if(l.start.includes(f)){const h=c.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function Kp(n){return!!(n&&"distance"in n)}function Xp(n){return!!(n&&"delay"in n)}class Wu{constructor(r,o,l){var a;l===void 0&&(l=mx(r.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=r,this.events=o;const{event:c}=r,{target:f}=c;this.props=r,this.events=o,this.document=oo(f),this.documentListeners=new Yo(this.document),this.listeners=new Yo(l),this.windowListeners=new Yo(cn(f)),this.initialCoordinates=(a=Fl(c))!=null?a:Yn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:r,props:{options:{activationConstraint:o,bypassActivationConstraint:l}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(On.Resize,this.handleCancel),this.windowListeners.add(On.DragStart,qp),this.windowListeners.add(On.VisibilityChange,this.handleCancel),this.windowListeners.add(On.ContextMenu,qp),this.documentListeners.add(On.Keydown,this.handleKeydown),o){if(l!=null&&l({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Xp(o)){this.timeoutId=setTimeout(this.handleStart,o.delay),this.handlePending(o);return}if(Kp(o)){this.handlePending(o);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(r,o){const{active:l,onPending:a}=this.props;a(l,r,this.initialCoordinates,o)}handleStart(){const{initialCoordinates:r}=this,{onStart:o}=this.props;r&&(this.activated=!0,this.documentListeners.add(On.Click,gx,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(On.SelectionChange,this.removeTextSelection),o(r))}handleMove(r){var o;const{activated:l,initialCoordinates:a,props:c}=this,{onMove:f,options:{activationConstraint:h}}=c;if(!a)return;const m=(o=Fl(r))!=null?o:Yn,g=$l(a,m);if(!l&&h){if(Kp(h)){if(h.tolerance!=null&&Xc(g,h.tolerance))return this.handleCancel();if(Xc(g,h.distance))return this.handleStart()}if(Xp(h)&&Xc(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}r.cancelable&&r.preventDefault(),f(m)}handleEnd(){const{onAbort:r,onEnd:o}=this.props;this.detach(),this.activated||r(this.props.active),o()}handleCancel(){const{onAbort:r,onCancel:o}=this.props;this.detach(),this.activated||r(this.props.active),o()}handleKeydown(r){r.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const yx={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Hu extends Wu{constructor(r){const{event:o}=r,l=oo(o.target);super(r,yx,l)}}Hu.activators=[{eventName:"onPointerDown",handler:(n,r)=>{let{nativeEvent:o}=n,{onActivation:l}=r;return!o.isPrimary||o.button!==0?!1:(l==null||l({event:o}),!0)}}];const xx={move:{name:"mousemove"},end:{name:"mouseup"}};var pu;(function(n){n[n.RightClick=2]="RightClick"})(pu||(pu={}));class wx extends Wu{constructor(r){super(r,xx,oo(r.event.target))}}wx.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:o}=n,{onActivation:l}=r;return o.button===pu.RightClick?!1:(l==null||l({event:o}),!0)}}];const Yc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class kx extends Wu{constructor(r){super(r,Yc)}static setup(){return window.addEventListener(Yc.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(Yc.move.name,r)};function r(){}}}kx.activators=[{eventName:"onTouchStart",handler:(n,r)=>{let{nativeEvent:o}=n,{onActivation:l}=r;const{touches:a}=o;return a.length>1?!1:(l==null||l({event:o}),!0)}}];var Qo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Qo||(Qo={}));var Bl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Bl||(Bl={}));function Sx(n){let{acceleration:r,activator:o=Qo.Pointer,canScroll:l,draggingRect:a,enabled:c,interval:f=5,order:h=Bl.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:y,delta:k,threshold:x}=n;const C=Nx({delta:k,disabled:!c}),[D,E]=I0(),N=w.useRef({x:0,y:0}),M=w.useRef({x:0,y:0}),j=w.useMemo(()=>{switch(o){case Qo.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case Qo.DraggableRect:return a}},[o,a,m]),H=w.useRef(null),P=w.useCallback(()=>{const ee=H.current;if(!ee)return;const q=N.current.x*M.current.x,B=N.current.y*M.current.y;ee.scrollBy(q,B)},[]),V=w.useMemo(()=>h===Bl.TreeOrder?[...g].reverse():g,[h,g]);w.useEffect(()=>{if(!c||!g.length||!j){E();return}for(const ee of V){if((l==null?void 0:l(ee))===!1)continue;const q=g.indexOf(ee),B=y[q];if(!B)continue;const{direction:oe,speed:ae}=ux(ee,B,j,r,x);for(const ce of["x","y"])C[ce][oe[ce]]||(ae[ce]=0,oe[ce]=0);if(ae.x>0||ae.y>0){E(),H.current=ee,D(P,f),N.current=ae,M.current=oe;return}}N.current={x:0,y:0},M.current={x:0,y:0},E()},[r,P,l,E,c,f,JSON.stringify(j),JSON.stringify(C),D,g,V,y,JSON.stringify(x)])}const Tx={x:{[Ft.Backward]:!1,[Ft.Forward]:!1},y:{[Ft.Backward]:!1,[Ft.Forward]:!1}};function Nx(n){let{delta:r,disabled:o}=n;const l=zl(r);return ai(a=>{if(o||!l||!a)return Tx;const c={x:Math.sign(r.x-l.x),y:Math.sign(r.y-l.y)};return{x:{[Ft.Backward]:a.x[Ft.Backward]||c.x===-1,[Ft.Forward]:a.x[Ft.Forward]||c.x===1},y:{[Ft.Backward]:a.y[Ft.Backward]||c.y===-1,[Ft.Forward]:a.y[Ft.Forward]||c.y===1}}},[o,r,l])}function Cx(n,r){const o=r!=null?n.get(r):void 0,l=o?o.node.current:null;return ai(a=>{var c;return r==null?null:(c=l??a)!=null?c:null},[l,r])}function bx(n,r){return w.useMemo(()=>n.reduce((o,l)=>{const{sensor:a}=l,c=a.activators.map(f=>({eventName:f.eventName,handler:r(f.handler,l)}));return[...o,...c]},[]),[n,r])}var oi;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(oi||(oi={}));var hu;(function(n){n.Optimized="optimized"})(hu||(hu={}));const Yp=new Map;function Ex(n,r){let{dragging:o,dependencies:l,config:a}=r;const[c,f]=w.useState(null),{frequency:h,measure:m,strategy:g}=a,y=w.useRef(n),k=N(),x=si(k),C=w.useCallback(function(M){M===void 0&&(M=[]),!x.current&&f(j=>j===null?M:j.concat(M.filter(H=>!j.includes(H))))},[x]),D=w.useRef(null),E=ai(M=>{if(k&&!o)return Yp;if(!M||M===Yp||y.current!==n||c!=null){const j=new Map;for(let H of n){if(!H)continue;if(c&&c.length>0&&!c.includes(H.id)&&H.rect.current){j.set(H.id,H.rect.current);continue}const P=H.node.current,V=P?new Bu(m(P),P):null;H.rect.current=V,V&&j.set(H.id,V)}return j}return M},[n,c,o,k,m]);return w.useEffect(()=>{y.current=n},[n]),w.useEffect(()=>{k||C()},[o,k]),w.useEffect(()=>{c&&c.length>0&&f(null)},[JSON.stringify(c)]),w.useEffect(()=>{k||typeof h!="number"||D.current!==null||(D.current=setTimeout(()=>{C(),D.current=null},h))},[h,k,C,...l]),{droppableRects:E,measureDroppableContainers:C,measuringScheduled:c!=null};function N(){switch(g){case oi.Always:return!1;case oi.BeforeDragging:return o;default:return!o}}}function Vu(n,r){return ai(o=>n?o||(typeof r=="function"?r(n):n):null,[r,n])}function _x(n,r){return Vu(n,r)}function Rx(n){let{callback:r,disabled:o}=n;const l=Jl(r),a=w.useMemo(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(l)},[l,o]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function ta(n){let{callback:r,disabled:o}=n;const l=Jl(r),a=w.useMemo(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(l)},[o]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function jx(n){return new Bu(io(n),n)}function Qp(n,r,o){r===void 0&&(r=jx);const[l,a]=w.useState(null);function c(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??o)!=null?g:null}const y=r(n);return JSON.stringify(m)===JSON.stringify(y)?m:y})}const f=Rx({callback(m){if(n)for(const g of m){const{type:y,target:k}=g;if(y==="childList"&&k instanceof HTMLElement&&k.contains(n)){c();break}}}}),h=ta({callback:c});return Xn(()=>{c(),n?(h==null||h.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),f==null||f.disconnect())},[n]),l}function Dx(n){const r=Vu(n);return ym(n,r)}const Zp=[];function Ix(n){const r=w.useRef(n),o=ai(l=>n?l&&l!==Zp&&n&&r.current&&n.parentNode===r.current.parentNode?l:Uu(n):Zp,[n]);return w.useEffect(()=>{r.current=n},[n]),o}function Mx(n){const[r,o]=w.useState(null),l=w.useRef(n),a=w.useCallback(c=>{const f=Kc(c.target);f&&o(h=>h?(h.set(f,fu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const c=l.current;if(n!==c){f(c);const h=n.map(m=>{const g=Kc(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,fu(g)]):null}).filter(m=>m!=null);o(h.length?new Map(h):null),l.current=n}return()=>{f(n),f(c)};function f(h){h.forEach(m=>{const g=Kc(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?r?Array.from(r.values()).reduce((c,f)=>to(c,f),Yn):Cm(n):Yn,[n,r])}function Jp(n,r){r===void 0&&(r=[]);const o=w.useRef(null);return w.useEffect(()=>{o.current=null},r),w.useEffect(()=>{const l=n!==Yn;l&&!o.current&&(o.current=n),!l&&o.current&&(o.current=null)},[n]),o.current?$l(n,o.current):Yn}function Ax(n){w.useEffect(()=>{if(!Zl)return;const r=n.map(o=>{let{sensor:l}=o;return l.setup==null?void 0:l.setup()});return()=>{for(const o of r)o==null||o()}},n.map(r=>{let{sensor:o}=r;return o}))}function Lx(n,r){return w.useMemo(()=>n.reduce((o,l)=>{let{eventName:a,handler:c}=l;return o[a]=f=>{c(f,r)},o},{}),[n,r])}function Rm(n){return w.useMemo(()=>n?ix(n):null,[n])}const eh=[];function Px(n,r){r===void 0&&(r=io);const[o]=n,l=Rm(o?cn(o):null),[a,c]=w.useState(eh);function f(){c(()=>n.length?n.map(m=>Tm(m)?l:new Bu(r(m),m)):eh)}const h=ta({callback:f});return Xn(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function jm(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return li(r)?r:n}function Ox(n){let{measure:r}=n;const[o,l]=w.useState(null),a=w.useCallback(g=>{for(const{target:y}of g)if(li(y)){l(k=>{const x=r(y);return k?{...k,width:x.width,height:x.height}:x});break}},[r]),c=ta({callback:a}),f=w.useCallback(g=>{const y=jm(g);c==null||c.disconnect(),y&&(c==null||c.observe(y)),l(y?r(y):null)},[r,c]),[h,m]=Ol(f);return w.useMemo(()=>({nodeRef:h,rect:o,setRef:m}),[o,h,m])}const zx=[{sensor:Hu,options:{}},{sensor:_m,options:{}}],$x={current:{}},Rl={draggable:{measure:Gp},droppable:{measure:Gp,strategy:oi.WhileDragging,frequency:hu.Optimized},dragOverlay:{measure:io}};class Zo extends Map{get(r){var o;return r!=null&&(o=super.get(r))!=null?o:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:o}=r;return!o})}getNodeFor(r){var o,l;return(o=(l=this.get(r))==null?void 0:l.node.current)!=null?o:void 0}}const Fx={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ul},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Rl,measureDroppableContainers:Ul,windowRect:null,measuringScheduled:!1},Dm={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ul,draggableNodes:new Map,over:null,measureDroppableContainers:Ul},ui=w.createContext(Dm),Im=w.createContext(Fx);function Ux(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zo}}}function Bx(n,r){switch(r.type){case Mt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Mt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:r.coordinates.x-n.draggable.initialCoordinates.x,y:r.coordinates.y-n.draggable.initialCoordinates.y}}};case Mt.DragEnd:case Mt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Mt.RegisterDroppable:{const{element:o}=r,{id:l}=o,a=new Zo(n.droppable.containers);return a.set(l,o),{...n,droppable:{...n.droppable,containers:a}}}case Mt.SetDroppableDisabled:{const{id:o,key:l,disabled:a}=r,c=n.droppable.containers.get(o);if(!c||l!==c.key)return n;const f=new Zo(n.droppable.containers);return f.set(o,{...c,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Mt.UnregisterDroppable:{const{id:o,key:l}=r,a=n.droppable.containers.get(o);if(!a||l!==a.key)return n;const c=new Zo(n.droppable.containers);return c.delete(o),{...n,droppable:{...n.droppable,containers:c}}}default:return n}}function Wx(n){let{disabled:r}=n;const{active:o,activatorEvent:l,draggableNodes:a}=w.useContext(ui),c=zl(l),f=zl(o==null?void 0:o.id);return w.useEffect(()=>{if(!r&&!l&&c&&f!=null){if(!ea(c)||document.activeElement===c.target)return;const h=a.get(f);if(!h)return;const{activatorNode:m,node:g}=h;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const y of[m.current,g.current]){if(!y)continue;const k=L0(y);if(k){k.focus();break}}})}},[l,r,a,f,c]),null}function Mm(n,r){let{transform:o,...l}=r;return n!=null&&n.length?n.reduce((a,c)=>c({transform:a,...l}),o):o}function Hx(n){return w.useMemo(()=>({draggable:{...Rl.draggable,...n==null?void 0:n.draggable},droppable:{...Rl.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Rl.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function Vx(n){let{activeNode:r,measure:o,initialRect:l,config:a=!0}=n;const c=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;Xn(()=>{if(!f&&!h||!r){c.current=!1;return}if(c.current||!l)return;const g=r==null?void 0:r.node.current;if(!g||g.isConnected===!1)return;const y=o(g),k=ym(y,l);if(f||(k.x=0),h||(k.y=0),c.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const x=wm(g);x&&x.scrollBy({top:k.y,left:k.x})}},[r,f,h,l,o])}const na=w.createContext({...Yn,scaleX:1,scaleY:1});var Kr;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Kr||(Kr={}));const Gx=w.memo(function(r){var o,l,a,c;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:y=zx,collisionDetection:k=ex,measuring:x,modifiers:C,...D}=r;const E=w.useReducer(Bx,void 0,Ux),[N,M]=E,[j,H]=U0(),[P,V]=w.useState(Kr.Uninitialized),ee=P===Kr.Initialized,{draggable:{active:q,nodes:B,translate:oe},droppable:{containers:ae}}=N,ce=q!=null?B.get(q):null,Pe=w.useRef({initial:null,translated:null}),_e=w.useMemo(()=>{var at;return q!=null?{id:q,data:(at=ce==null?void 0:ce.data)!=null?at:$x,rect:Pe}:null},[q,ce]),Oe=w.useRef(null),[Q,te]=w.useState(null),[ne,G]=w.useState(null),Z=si(D,Object.values(D)),W=ci("DndDescribedBy",f),b=w.useMemo(()=>ae.getEnabled(),[ae]),I=Hx(x),{droppableRects:ie,measureDroppableContainers:de,measuringScheduled:ge}=Ex(b,{dragging:ee,dependencies:[oe.x,oe.y],config:I.droppable}),we=Cx(B,q),Le=w.useMemo(()=>ne?Fl(ne):null,[ne]),Te=Rn(),je=_x(we,I.draggable.measure);Vx({activeNode:q!=null?B.get(q):null,config:Te.layoutShiftCompensation,initialRect:je,measure:I.draggable.measure});const Ce=Qp(we,I.draggable.measure,je),lt=Qp(we?we.parentElement:null),Re=w.useRef({activatorEvent:null,active:null,activeNode:we,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:ae,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=ae.getNodeFor((o=Re.current.over)==null?void 0:o.id),$=Ox({measure:I.dragOverlay.measure}),Me=(l=$.nodeRef.current)!=null?l:we,le=ee?(a=$.rect)!=null?a:Ce:null,Qe=!!($.nodeRef.current&&$.rect),ut=Dx(Qe?null:Ce),ve=Rm(Me?cn(Me):null),Fe=Ix(ee?kt??we:null),We=Px(Fe),St=Mm(C,{transform:{x:oe.x-ut.x,y:oe.y-ut.y,scaleX:1,scaleY:1},activatorEvent:ne,active:_e,activeNodeRect:Ce,containerNodeRect:lt,draggingNodeRect:le,over:Re.current.over,overlayNodeRect:$.rect,scrollableAncestors:Fe,scrollableAncestorRects:We,windowRect:ve}),U=Le?to(Le,oe):null,ue=Mx(Fe),ze=Jp(ue),qe=Jp(ue,[Ce]),tt=to(St,ze),st=le?rx(le,St):null,De=_e&&st?k({active:_e,collisionRect:st,droppableRects:ie,droppableContainers:b,pointerCoordinates:U}):null,Ke=Q0(De,"id"),[nt,lr]=w.useState(null),ar=Qe?St:to(St,qe),Qr=tx(ar,(c=nt==null?void 0:nt.rect)!=null?c:null,Ce),br=w.useRef(null),cr=w.useCallback((at,jt)=>{let{sensor:bt,options:un}=jt;if(Oe.current==null)return;const Et=B.get(Oe.current);if(!Et)return;const Tt=at.nativeEvent,dt=new bt({active:Oe.current,activeNode:Et,event:Tt,options:un,context:Re,onAbort(ot){if(!B.get(ot))return;const{onDragAbort:At}=Z.current,dn={id:ot};At==null||At(dn),j({type:"onDragAbort",event:dn})},onPending(ot,Yt,At,dn){if(!B.get(ot))return;const{onDragPending:xn}=Z.current,Ut={id:ot,constraint:Yt,initialCoordinates:At,offset:dn};xn==null||xn(Ut),j({type:"onDragPending",event:Ut})},onStart(ot){const Yt=Oe.current;if(Yt==null)return;const At=B.get(Yt);if(!At)return;const{onDragStart:dn}=Z.current,nn={activatorEvent:Tt,active:{id:Yt,data:At.data,rect:Pe}};qo.unstable_batchedUpdates(()=>{dn==null||dn(nn),V(Kr.Initializing),M({type:Mt.DragStart,initialCoordinates:ot,active:Yt}),j({type:"onDragStart",event:nn}),te(br.current),G(Tt)})},onMove(ot){M({type:Mt.DragMove,coordinates:ot})},onEnd:Xt(Mt.DragEnd),onCancel:Xt(Mt.DragCancel)});br.current=dt;function Xt(ot){return async function(){const{active:At,collisions:dn,over:nn,scrollAdjustedTranslate:xn}=Re.current;let Ut=null;if(At&&xn){const{cancelDrop:$n}=Z.current;Ut={activatorEvent:Tt,active:At,collisions:dn,delta:xn,over:nn},ot===Mt.DragEnd&&typeof $n=="function"&&await Promise.resolve($n(Ut))&&(ot=Mt.DragCancel)}Oe.current=null,qo.unstable_batchedUpdates(()=>{M({type:ot}),V(Kr.Uninitialized),lr(null),te(null),G(null),br.current=null;const $n=ot===Mt.DragEnd?"onDragEnd":"onDragCancel";if(Ut){const Fn=Z.current[$n];Fn==null||Fn(Ut),j({type:$n,event:Ut})}})}}},[B]),ur=w.useCallback((at,jt)=>(bt,un)=>{const Et=bt.nativeEvent,Tt=B.get(un);if(Oe.current!==null||!Tt||Et.dndKit||Et.defaultPrevented)return;const dt={active:Tt};at(bt,jt.options,dt)===!0&&(Et.dndKit={capturedBy:jt.sensor},Oe.current=un,cr(bt,jt))},[B,cr]),zn=bx(y,ur);Ax(y),Xn(()=>{Ce&&P===Kr.Initializing&&V(Kr.Initialized)},[Ce,P]),w.useEffect(()=>{const{onDragMove:at}=Z.current,{active:jt,activatorEvent:bt,collisions:un,over:Et}=Re.current;if(!jt||!bt)return;const Tt={active:jt,activatorEvent:bt,collisions:un,delta:{x:tt.x,y:tt.y},over:Et};qo.unstable_batchedUpdates(()=>{at==null||at(Tt),j({type:"onDragMove",event:Tt})})},[tt.x,tt.y]),w.useEffect(()=>{const{active:at,activatorEvent:jt,collisions:bt,droppableContainers:un,scrollAdjustedTranslate:Et}=Re.current;if(!at||Oe.current==null||!jt||!Et)return;const{onDragOver:Tt}=Z.current,dt=un.get(Ke),Xt=dt&&dt.rect.current?{id:dt.id,rect:dt.rect.current,data:dt.data,disabled:dt.disabled}:null,ot={active:at,activatorEvent:jt,collisions:bt,delta:{x:Et.x,y:Et.y},over:Xt};qo.unstable_batchedUpdates(()=>{lr(Xt),Tt==null||Tt(ot),j({type:"onDragOver",event:ot})})},[Ke]),Xn(()=>{Re.current={activatorEvent:ne,active:_e,activeNode:we,collisionRect:st,collisions:De,droppableRects:ie,draggableNodes:B,draggingNode:Me,draggingNodeRect:le,droppableContainers:ae,over:nt,scrollableAncestors:Fe,scrollAdjustedTranslate:tt},Pe.current={initial:le,translated:st}},[_e,we,De,st,B,Me,le,ie,ae,nt,Fe,tt]),Sx({...Te,delta:oe,draggingRect:st,pointerCoordinates:U,scrollableAncestors:Fe,scrollableAncestorRects:We});const _n=w.useMemo(()=>({active:_e,activeNode:we,activeNodeRect:Ce,activatorEvent:ne,collisions:De,containerNodeRect:lt,dragOverlay:$,draggableNodes:B,droppableContainers:ae,droppableRects:ie,over:nt,measureDroppableContainers:de,scrollableAncestors:Fe,scrollableAncestorRects:We,measuringConfiguration:I,measuringScheduled:ge,windowRect:ve}),[_e,we,Ce,ne,De,lt,$,B,ae,ie,nt,de,Fe,We,I,ge,ve]),Kt=w.useMemo(()=>({activatorEvent:ne,activators:zn,active:_e,activeNodeRect:Ce,ariaDescribedById:{draggable:W},dispatch:M,draggableNodes:B,over:nt,measureDroppableContainers:de}),[ne,zn,_e,Ce,M,W,B,nt,de]);return rt.createElement(vm.Provider,{value:H},rt.createElement(ui.Provider,{value:Kt},rt.createElement(Im.Provider,{value:_n},rt.createElement(na.Provider,{value:Qr},g)),rt.createElement(Wx,{disabled:(h==null?void 0:h.restoreFocus)===!1})),rt.createElement(H0,{...h,hiddenTextDescribedById:W}));function Rn(){const at=(Q==null?void 0:Q.autoScrollEnabled)===!1,jt=typeof m=="object"?m.enabled===!1:m===!1,bt=ee&&!at&&!jt;return typeof m=="object"?{...m,enabled:bt}:{enabled:bt}}}),qx=w.createContext(null),th="button",Kx="Draggable";function Xx(n){let{id:r,data:o,disabled:l=!1,attributes:a}=n;const c=ci(Kx),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:y,draggableNodes:k,over:x}=w.useContext(ui),{role:C=th,roleDescription:D="draggable",tabIndex:E=0}=a??{},N=(m==null?void 0:m.id)===r,M=w.useContext(N?na:qx),[j,H]=Ol(),[P,V]=Ol(),ee=Lx(f,r),q=si(o);Xn(()=>(k.set(r,{id:r,key:c,node:j,activatorNode:P,data:q}),()=>{const oe=k.get(r);oe&&oe.key===c&&k.delete(r)}),[k,r]);const B=w.useMemo(()=>({role:C,tabIndex:E,"aria-disabled":l,"aria-pressed":N&&C===th?!0:void 0,"aria-roledescription":D,"aria-describedby":y.draggable}),[l,C,E,N,D,y.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:B,isDragging:N,listeners:l?void 0:ee,node:j,over:x,setNodeRef:H,setActivatorNodeRef:V,transform:M}}function Am(){return w.useContext(Im)}const Yx="Droppable",Qx={timeout:25};function Lm(n){let{data:r,disabled:o=!1,id:l,resizeObserverConfig:a}=n;const c=ci(Yx),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=w.useContext(ui),y=w.useRef({disabled:o}),k=w.useRef(!1),x=w.useRef(null),C=w.useRef(null),{disabled:D,updateMeasurementsFor:E,timeout:N}={...Qx,...a},M=si(E??l),j=w.useCallback(()=>{if(!k.current){k.current=!0;return}C.current!=null&&clearTimeout(C.current),C.current=setTimeout(()=>{g(Array.isArray(M.current)?M.current:[M.current]),C.current=null},N)},[N]),H=ta({callback:j,disabled:D||!f}),P=w.useCallback((B,oe)=>{H&&(oe&&(H.unobserve(oe),k.current=!1),B&&H.observe(B))},[H]),[V,ee]=Ol(P),q=si(r);return w.useEffect(()=>{!H||!V.current||(H.disconnect(),k.current=!1,H.observe(V.current))},[V,H]),w.useEffect(()=>(h({type:Mt.RegisterDroppable,element:{id:l,key:c,disabled:o,node:V,rect:x,data:q}}),()=>h({type:Mt.UnregisterDroppable,key:c,id:l})),[l]),w.useEffect(()=>{o!==y.current.disabled&&(h({type:Mt.SetDroppableDisabled,id:l,key:c,disabled:o}),y.current.disabled=o)},[l,c,o,h]),{active:f,rect:x,isOver:(m==null?void 0:m.id)===l,node:V,over:m,setNodeRef:ee}}function Zx(n){let{animation:r,children:o}=n;const[l,a]=w.useState(null),[c,f]=w.useState(null),h=zl(o);return!o&&!l&&h&&a(h),Xn(()=>{if(!c)return;const m=l==null?void 0:l.key,g=l==null?void 0:l.props.id;if(m==null||g==null){a(null);return}Promise.resolve(r(g,c)).then(()=>{a(null)})},[r,l,c]),rt.createElement(rt.Fragment,null,o,l?w.cloneElement(l,{ref:f}):null)}const Jx={x:0,y:0,scaleX:1,scaleY:1};function ew(n){let{children:r}=n;return rt.createElement(ui.Provider,{value:Dm},rt.createElement(na.Provider,{value:Jx},r))}const tw={position:"fixed",touchAction:"none"},nw=n=>ea(n)?"transform 250ms ease":void 0,rw=w.forwardRef((n,r)=>{let{as:o,activatorEvent:l,adjustScale:a,children:c,className:f,rect:h,style:m,transform:g,transition:y=nw}=n;if(!h)return null;const k=a?g:{...g,scaleX:1,scaleY:1},x={...tw,width:h.width,height:h.height,top:h.top,left:h.left,transform:Nr.Transform.toString(k),transformOrigin:a&&l?K0(l,h):void 0,transition:typeof y=="function"?y(l):y,...m};return rt.createElement(o,{className:f,style:x,ref:r},c)}),sw=n=>r=>{let{active:o,dragOverlay:l}=r;const a={},{styles:c,className:f}=n;if(c!=null&&c.active)for(const[h,m]of Object.entries(c.active))m!==void 0&&(a[h]=o.node.style.getPropertyValue(h),o.node.style.setProperty(h,m));if(c!=null&&c.dragOverlay)for(const[h,m]of Object.entries(c.dragOverlay))m!==void 0&&l.node.style.setProperty(h,m);return f!=null&&f.active&&o.node.classList.add(f.active),f!=null&&f.dragOverlay&&l.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))o.node.style.setProperty(m,g);f!=null&&f.active&&o.node.classList.remove(f.active)}},ow=n=>{let{transform:{initial:r,final:o}}=n;return[{transform:Nr.Transform.toString(r)},{transform:Nr.Transform.toString(o)}]},iw={duration:250,easing:"ease",keyframes:ow,sideEffects:sw({styles:{active:{opacity:"0"}}})};function lw(n){let{config:r,draggableNodes:o,droppableContainers:l,measuringConfiguration:a}=n;return Jl((c,f)=>{if(r===null)return;const h=o.get(c);if(!h)return;const m=h.node.current;if(!m)return;const g=jm(f);if(!g)return;const{transform:y}=cn(f).getComputedStyle(f),k=xm(y);if(!k)return;const x=typeof r=="function"?r:aw(r);return bm(m,a.draggable.measure),x({active:{id:c,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:o,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:l,measuringConfiguration:a,transform:k})})}function aw(n){const{duration:r,easing:o,sideEffects:l,keyframes:a}={...iw,...n};return c=>{let{active:f,dragOverlay:h,transform:m,...g}=c;if(!r)return;const y={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},x={x:m.x-y.x,y:m.y-y.y,...k},C=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:x}}),[D]=C,E=C[C.length-1];if(JSON.stringify(D)===JSON.stringify(E))return;const N=l==null?void 0:l({active:f,dragOverlay:h,...g}),M=h.node.animate(C,{duration:r,easing:o,fill:"forwards"});return new Promise(j=>{M.onfinish=()=>{N==null||N(),j()}})}}let nh=0;function cw(n){return w.useMemo(()=>{if(n!=null)return nh++,nh},[n])}const uw=rt.memo(n=>{let{adjustScale:r=!1,children:o,dropAnimation:l,style:a,transition:c,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:y,active:k,activeNodeRect:x,containerNodeRect:C,draggableNodes:D,droppableContainers:E,dragOverlay:N,over:M,measuringConfiguration:j,scrollableAncestors:H,scrollableAncestorRects:P,windowRect:V}=Am(),ee=w.useContext(na),q=cw(k==null?void 0:k.id),B=Mm(f,{activatorEvent:y,active:k,activeNodeRect:x,containerNodeRect:C,draggingNodeRect:N.rect,over:M,overlayNodeRect:N.rect,scrollableAncestors:H,scrollableAncestorRects:P,transform:ee,windowRect:V}),oe=Vu(x),ae=lw({config:l,draggableNodes:D,droppableContainers:E,measuringConfiguration:j}),ce=oe?N.setRef:void 0;return rt.createElement(ew,null,rt.createElement(Zx,{animation:ae},k&&q?rt.createElement(rw,{key:q,id:k.id,ref:ce,as:h,activatorEvent:y,adjustScale:r,className:m,transition:c,rect:oe,style:{zIndex:g,...a},transform:B},o):null))});function Pm(n,r,o){const l=n.slice();return l.splice(o<0?l.length+o:o,0,l.splice(r,1)[0]),l}function dw(n,r){return n.reduce((o,l,a)=>{const c=r.get(l);return c&&(o[a]=c),o},Array(n.length))}function wl(n){return n!==null&&n>=0}function fw(n,r){if(n===r)return!0;if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o])return!1;return!0}function pw(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Om=n=>{let{rects:r,activeIndex:o,overIndex:l,index:a}=n;const c=Pm(r,l,o),f=r[a],h=c[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},kl={scaleX:1,scaleY:1},rh=n=>{var r;let{activeIndex:o,activeNodeRect:l,index:a,rects:c,overIndex:f}=n;const h=(r=c[o])!=null?r:l;if(!h)return null;if(a===o){const g=c[f];return g?{x:0,y:o<f?g.top+g.height-(h.top+h.height):g.top-h.top,...kl}:null}const m=hw(c,a,o);return a>o&&a<=f?{x:0,y:-h.height-m,...kl}:a<o&&a>=f?{x:0,y:h.height+m,...kl}:{x:0,y:0,...kl}};function hw(n,r,o){const l=n[r],a=n[r-1],c=n[r+1];return l?o<r?a?l.top-(a.top+a.height):c?c.top-(l.top+l.height):0:c?c.top-(l.top+l.height):a?l.top-(a.top+a.height):0:0}const zm="Sortable",$m=rt.createContext({activeIndex:-1,containerId:zm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Om,disabled:{draggable:!1,droppable:!1}});function sh(n){let{children:r,id:o,items:l,strategy:a=Om,disabled:c=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:y}=Am(),k=ci(zm,o),x=h.rect!==null,C=w.useMemo(()=>l.map(ee=>typeof ee=="object"&&"id"in ee?ee.id:ee),[l]),D=f!=null,E=f?C.indexOf(f.id):-1,N=g?C.indexOf(g.id):-1,M=w.useRef(C),j=!fw(C,M.current),H=N!==-1&&E===-1||j,P=pw(c);Xn(()=>{j&&D&&y(C)},[j,C,D,y]),w.useEffect(()=>{M.current=C},[C]);const V=w.useMemo(()=>({activeIndex:E,containerId:k,disabled:P,disableTransforms:H,items:C,overIndex:N,useDragOverlay:x,sortedRects:dw(C,m),strategy:a}),[E,k,P.draggable,P.droppable,H,C,N,m,x,a]);return rt.createElement($m.Provider,{value:V},r)}const mw=n=>{let{id:r,items:o,activeIndex:l,overIndex:a}=n;return Pm(o,l,a).indexOf(r)},gw=n=>{let{containerId:r,isSorting:o,wasDragging:l,index:a,items:c,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!l||h!==c&&a===f?!1:o?!0:f!==a&&r===m},vw={duration:200,easing:"ease"},Fm="transform",yw=Nr.Transition.toString({property:Fm,duration:0,easing:"linear"}),xw={roleDescription:"sortable"};function ww(n){let{disabled:r,index:o,node:l,rect:a}=n;const[c,f]=w.useState(null),h=w.useRef(o);return Xn(()=>{if(!r&&o!==h.current&&l.current){const m=a.current;if(m){const g=io(l.current,{ignoreTransform:!0}),y={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(y.x||y.y)&&f(y)}}o!==h.current&&(h.current=o)},[r,o,l,a]),w.useEffect(()=>{c&&f(null)},[c]),c}function Um(n){let{animateLayoutChanges:r=gw,attributes:o,disabled:l,data:a,getNewIndex:c=mw,id:f,strategy:h,resizeObserverConfig:m,transition:g=vw}=n;const{items:y,containerId:k,activeIndex:x,disabled:C,disableTransforms:D,sortedRects:E,overIndex:N,useDragOverlay:M,strategy:j}=w.useContext($m),H=kw(l,C),P=y.indexOf(f),V=w.useMemo(()=>({sortable:{containerId:k,index:P,items:y},...a}),[k,a,P,y]),ee=w.useMemo(()=>y.slice(y.indexOf(f)),[y,f]),{rect:q,node:B,isOver:oe,setNodeRef:ae}=Lm({id:f,data:V,disabled:H.droppable,resizeObserverConfig:{updateMeasurementsFor:ee,...m}}),{active:ce,activatorEvent:Pe,activeNodeRect:_e,attributes:Oe,setNodeRef:Q,listeners:te,isDragging:ne,over:G,setActivatorNodeRef:Z,transform:W}=Xx({id:f,data:V,attributes:{...xw,...o},disabled:H.draggable}),b=D0(ae,Q),I=!!ce,ie=I&&!D&&wl(x)&&wl(N),de=!M&&ne,ge=de&&ie?W:null,Le=ie?ge??(h??j)({rects:E,activeNodeRect:_e,activeIndex:x,overIndex:N,index:P}):null,Te=wl(x)&&wl(N)?c({id:f,items:y,activeIndex:x,overIndex:N}):P,je=ce==null?void 0:ce.id,Ce=w.useRef({activeId:je,items:y,newIndex:Te,containerId:k}),lt=y!==Ce.current.items,Re=r({active:ce,containerId:k,isDragging:ne,isSorting:I,id:f,index:P,items:y,newIndex:Ce.current.newIndex,previousItems:Ce.current.items,previousContainerId:Ce.current.containerId,transition:g,wasDragging:Ce.current.activeId!=null}),kt=ww({disabled:!Re,index:P,node:B,rect:q});return w.useEffect(()=>{I&&Ce.current.newIndex!==Te&&(Ce.current.newIndex=Te),k!==Ce.current.containerId&&(Ce.current.containerId=k),y!==Ce.current.items&&(Ce.current.items=y)},[I,Te,k,y]),w.useEffect(()=>{if(je===Ce.current.activeId)return;if(je!=null&&Ce.current.activeId==null){Ce.current.activeId=je;return}const Me=setTimeout(()=>{Ce.current.activeId=je},50);return()=>clearTimeout(Me)},[je]),{active:ce,activeIndex:x,attributes:Oe,data:V,rect:q,index:P,newIndex:Te,items:y,isOver:oe,isSorting:I,isDragging:ne,listeners:te,node:B,overIndex:N,over:G,setNodeRef:b,setActivatorNodeRef:Z,setDroppableNodeRef:ae,setDraggableNodeRef:Q,transform:kt??Le,transition:$()};function $(){if(kt||lt&&Ce.current.newIndex===P)return yw;if(!(de&&!ea(Pe)||!g)&&(I||Re))return Nr.Transition.toString({...g,property:Fm})}}function kw(n,r){var o,l;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(o=n==null?void 0:n.draggable)!=null?o:r.draggable,droppable:(l=n==null?void 0:n.droppable)!=null?l:r.droppable}}Je.Down,Je.Right,Je.Up,Je.Left;function Qc(n){const[r,o]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const c=JSON.parse(a);return Array.isArray(c)?new Set(c.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),l=w.useCallback(a=>{o(c=>{const f=a(new Set(c));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[r,l]}async function mu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const o=document.execCommand("copy");return document.body.removeChild(r),o}catch{return!1}}}function Sw(n,r){const o=new Map;for(const f of r){const h=f.cwd||"(no directory)",m=o.get(h)??[];m.push(f),o.set(h,m)}const l=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),c=[];for(const f of n){if(f.deleted===1){l.add(f.path);continue}l.add(f.path),c.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:o.get(f.path)??[],workspace:f})}for(const[f,h]of o)l.has(f)||a.has(f)||c.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return c}function Sl(n){return[...n].sort((r,o)=>o.sort_order-r.sort_order||(r.created_at<o.created_at?1:-1))}function Tl(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function Tw(n){const r=new Set(n.map(l=>l.name));if(!r.has("New Folder"))return"New Folder";let o=2;for(;r.has(`New Folder ${o}`);)o++;return`New Folder ${o}`}function oh({id:n,children:r,className:o}){const{setNodeRef:l,isOver:a}=Lm({id:n});return u.jsx("div",{ref:l,className:`${o??""}${a?" drop-over":""}`,children:r})}function Nw({s:n,isActive:r,renaming:o,renameValue:l,renameRef:a,onRenameValue:c,onRenameConfirm:f,onRenameCancel:h,onSelect:m,onCtxMenu:g,onToggleStar:y}){const{attributes:k,listeners:x,setNodeRef:C,transform:D,transition:E,isDragging:N}=Um({id:`s:${n.id}`}),M=Mu(n);return u.jsxs("div",{ref:C,style:{transform:Nr.Transform.toString(D),transition:E},className:`tree-item ${r?"active":""} ${M.isFinished?"tree-item-finished":""}${N?" dragging":""}${n.starred?" tree-item-starred":""}`,...k,...x,onClick:m,onContextMenu:g,children:[u.jsx(am,{iconClass:M.iconClass,iconText:M.iconText,size:16}),o?u.jsx("input",{ref:a,className:"tree-rename-input",value:l,onChange:j=>c(j.target.value),onClick:j=>j.stopPropagation(),onPointerDown:j=>j.stopPropagation(),onKeyDown:j=>{j.key==="Enter"&&f(),j.key==="Escape"&&h()},onBlur:f}):u.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!o&&u.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:j=>{j.stopPropagation(),y()},onPointerDown:j=>j.stopPropagation(),children:u.jsx(C0,{size:10,fill:n.starred?"currentColor":"none"})}),M.dot&&u.jsx(Lu,{status:M.dot})]})}function Cw({folder:n,count:r,collapsed:o,renaming:l,renameValue:a,renameRef:c,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:y,children:k}){const{attributes:x,listeners:C,setNodeRef:D,transform:E,transition:N,isDragging:M,over:j}=Um({id:`f:${n.id}`}),H=j!=null&&String(j.id).startsWith("s:");return u.jsxs("div",{ref:D,style:{transform:Nr.Transform.toString(E),transition:N},className:`tree-folder ${o?"collapsed":""}${M?" dragging":""}`,children:[u.jsx("div",{className:`tree-folder-header${H?" drop-over":""}`,...x,...C,onClick:()=>{l||g()},onContextMenu:y,children:l?u.jsx("input",{ref:c,className:"tree-rename-input",value:a,onChange:P=>f(P.target.value),onClick:P=>P.stopPropagation(),onPointerDown:P=>P.stopPropagation(),onKeyDown:P=>{P.key==="Enter"&&h(),P.key==="Escape"&&m()},onBlur:h}):u.jsxs(u.Fragment,{children:[u.jsx(ri,{size:8,className:"tree-chevron"}),u.jsx(du,{size:12}),u.jsx("span",{className:"tree-folder-label",children:n.name}),u.jsx("span",{className:"tree-count",children:r})]})}),!o&&u.jsx("div",{className:"tree-folder-children",children:k})]})}function bw(){const n=F($=>$.sessions),r=F($=>$.workspaces),o=F($=>$.folders),l=F($=>$.activeSessionId),a=F($=>$.selectSession),c=F($=>$.deleteSession),f=F($=>$.removeWorkspace),h=F($=>$.createSessionInWorkspace),m=F($=>$.pickAndAddWorkspace),g=F($=>$.renameSession),y=F($=>$.markFinished),k=F($=>$.toggleStar),x=F($=>$.reopenSession),C=F($=>$.createSidebarFolder),D=F($=>$.renameFolder),E=F($=>$.deleteFolder),N=F($=>$.applyMoves),M=F($=>$.reorderFolders),[j,H]=Qc("agentpane:sidebar-ws-collapsed"),[P,V]=Qc("agentpane:sidebar-sub-collapsed"),[ee,q]=Qc("agentpane:sidebar-folders-collapsed"),[B,oe]=w.useState(null),[ae,ce]=w.useState(null),[Pe,_e]=w.useState(""),[Oe,Q]=w.useState(null),te=w.useRef(null),ne=w.useRef(null),G=G0(V0(Hu,{activationConstraint:{distance:5}}));Xl(te,()=>oe(null),!!B),Au(()=>oe(null),!!B);const Z=w.useMemo(()=>new Map(n.map($=>[$.id,$])),[n]),W=w.useMemo(()=>new Map(o.map($=>[$.id,$])),[o]),b=w.useMemo(()=>{const $=new Map;for(const Me of[...o].sort((le,Qe)=>le.sort_order-Qe.sort_order)){const le=$.get(Me.workspace_path)??[];le.push(Me),$.set(Me.workspace_path,le)}return $},[o]);function I($){H(Me=>{const le=new Set(Me);return le.has($)?le.delete($):le.add($),le})}function ie($){V(Me=>{const le=new Set(Me);return le.has($)?le.delete($):le.add($),le})}function de($){q(Me=>{const le=new Set(Me);return le.has($)?le.delete($):le.add($),le})}w.useEffect(()=>{ae&&ne.current&&(ne.current.focus(),ne.current.select())},[ae]);function ge($,Me,le,Qe=""){ce({kind:$,id:Me}),_e(le||Qe)}function we(){if(ae){const $=Pe.trim();$&&(ae.kind==="session"?g(ae.id,$):D(ae.id,$))}ce(null)}function Le(){ce(null),_e("")}async function Te($){const Me=Tw(b.get($)??[]),le=await C($,Me);le&&ge("folder",le.id,le.name)}function je($){const Me=String($.active.id);if(Me.startsWith("s:")){const le=Z.get(Me.slice(2));le&&Q({kind:"session",label:le.title||le.id.slice(0,8)})}else if(Me.startsWith("f:")){const le=W.get(Me.slice(2));le&&Q({kind:"folder",label:le.name})}}function Ce($){Q(null);const{active:Me,over:le}=$;if(!le)return;const Qe=String(Me.id),ut=String(le.id);if(Qe.startsWith("s:")){const ve=Z.get(Qe.slice(2));if(!ve)return;const Fe=ve.cwd||"(no directory)",We=Tl(ve,W);let St,U;if(ut.startsWith("f:")){const De=W.get(ut.slice(2));if(!De)return;St=De.workspace_path,U=De.id}else if(ut.startsWith("s:")){const De=Z.get(ut.slice(2));if(!De)return;St=De.cwd||"(no directory)",U=Tl(De,W)}else if(ut.startsWith("c:")){const De=ut.slice(2),Ke=De.lastIndexOf("|");St=De.slice(0,Ke);const nt=De.slice(Ke+1);U=nt==="root"?null:nt}else return;if(St!==Fe)return;const ue=Sl(n.filter(De=>(De.cwd||"(no directory)")===St&&Tl(De,W)===U)),ze=ue.filter(De=>De.id!==ve.id);let qe=ze.length;if(ut.startsWith("s:")){const De=ze.findIndex(Ke=>Ke.id===ut.slice(2));De>=0&&(qe=De)}const tt=[...ze.slice(0,qe),ve,...ze.slice(qe)],st=[];if(U===We){if(tt.length===ue.length&&tt.every((De,Ke)=>De.id===ue[Ke].id))return;tt.forEach((De,Ke)=>st.push({id:De.id,folder_id:U,sort_order:tt.length-1-Ke}))}else{const De=Sl(n.filter(Ke=>(Ke.cwd||"(no directory)")===Fe&&Tl(Ke,W)===We)).filter(Ke=>Ke.id!==ve.id);De.forEach((Ke,nt)=>st.push({id:Ke.id,folder_id:We,sort_order:De.length-1-nt})),tt.forEach((Ke,nt)=>st.push({id:Ke.id,folder_id:U,sort_order:tt.length-1-nt}))}N(st);return}if(Qe.startsWith("f:")){if(!ut.startsWith("f:"))return;const ve=W.get(Qe.slice(2)),Fe=W.get(ut.slice(2));if(!ve||!Fe||ve.id===Fe.id||ve.workspace_path!==Fe.workspace_path)return;const We=(b.get(ve.workspace_path)??[]).map(ue=>ue.id),St=We.indexOf(ve.id),U=We.indexOf(Fe.id);We.splice(U,0,...We.splice(St,1)),M(We)}}const lt=Sw(r,n);function Re($){return u.jsx(Nw,{s:$,isActive:l===$.id,renaming:(ae==null?void 0:ae.kind)==="session"&&ae.id===$.id,renameValue:Pe,renameRef:ne,onRenameValue:_e,onRenameConfirm:we,onRenameCancel:Le,onSelect:()=>a($.id),onToggleStar:()=>k($.id),onCtxMenu:Me=>{Me.preventDefault(),oe({x:Me.clientX,y:Me.clientY,type:"session",sessionId:$.id,sessionTitle:$.title,sessionLifecycle:$.lifecycle,sessionExternalId:$.external_thread_id})}},$.id)}function kt($,Me){const le=Sl($.filter(Fe=>Fe.lifecycle!=="finished")),Qe=Sl($.filter(Fe=>Fe.lifecycle==="finished")),ut=[...le,...Qe].map(Fe=>`s:${Fe.id}`),ve=P.has(Me);return u.jsxs(sh,{items:ut,strategy:rh,children:[le.length===0&&Qe.length===0?u.jsx("div",{className:"tree-empty",children:"No sessions"}):le.map(Re),Qe.length>0&&u.jsxs("div",{className:`tree-subgroup ${ve?"collapsed":""}`,children:[u.jsxs("div",{className:"tree-subgroup-header",onClick:()=>ie(Me),children:[u.jsx(ri,{size:8,className:"tree-chevron"}),u.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),u.jsx("span",{className:"tree-subgroup-count",children:Qe.length})]}),!ve&&u.jsx("div",{className:"tree-subgroup-items",children:Qe.map(Re)})]})]})}return u.jsxs("div",{className:"ide-sidebar",children:[u.jsxs("div",{className:"sidebar-header",children:[u.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),u.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:u.jsx(Xo,{size:14})})]}),u.jsxs(Gx,{sensors:G,collisionDetection:Z0,onDragStart:je,onDragEnd:Ce,children:[lt.length===0?u.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):lt.map($=>{const Me=j.has($.path),le=b.get($.path)??[],Qe=new Set(le.map(ve=>ve.id)),ut=$.sessions.filter(ve=>!(ve.folder_id&&Qe.has(ve.folder_id)));return u.jsxs("div",{className:`tree-section ${Me?"collapsed":""}`,children:[u.jsxs("div",{className:"tree-section-header",onClick:()=>I($.path),onContextMenu:ve=>{ve.preventDefault(),oe({x:ve.clientX,y:ve.clientY,type:"workspace",path:$.path})},children:[u.jsx(ri,{size:9,className:"tree-chevron"}),u.jsx(du,{size:14}),u.jsx("span",{className:"tree-section-label",children:$.label}),u.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:ve=>{ve.stopPropagation(),h($.path)},children:u.jsx(Xo,{size:11})}),u.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:ve=>{ve.stopPropagation(),Te($.path)},children:u.jsx(Gc,{size:11})}),u.jsx("span",{className:"tree-count",children:$.sessions.length})]}),!Me&&u.jsxs("div",{className:"tree-children",children:[u.jsx(sh,{items:le.map(ve=>`f:${ve.id}`),strategy:rh,children:le.map(ve=>{const Fe=$.sessions.filter(We=>We.folder_id===ve.id);return u.jsx(Cw,{folder:ve,count:Fe.length,collapsed:ee.has(ve.id),renaming:(ae==null?void 0:ae.kind)==="folder"&&ae.id===ve.id,renameValue:Pe,renameRef:ne,onRenameValue:_e,onRenameConfirm:we,onRenameCancel:Le,onToggle:()=>de(ve.id),onCtxMenu:We=>{We.preventDefault(),oe({x:We.clientX,y:We.clientY,type:"folder",folderId:ve.id,folderName:ve.name})},children:u.jsx(oh,{id:`c:${$.path}|${ve.id}`,children:kt(Fe,`folder:${ve.id}:finished`)})},ve.id)})}),u.jsx(oh,{id:`c:${$.path}|root`,children:kt(ut,`${$.path}:finished`)})]})]},$.path)}),u.jsx(uw,{children:Oe&&u.jsxs("div",{className:"drag-overlay",children:[Oe.kind==="folder"&&u.jsx(du,{size:12}),u.jsx("span",{children:Oe.label})]})})]}),u.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[u.jsx(Gc,{size:14}),u.jsx("span",{children:"Add workspace"})]}),B&&u.jsxs("div",{ref:te,className:"ctx-menu",style:{position:"fixed",left:B.x,top:B.y,zIndex:500},children:[B.type==="workspace"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{h(B.path),oe(null)},children:[u.jsx(Xo,{size:12})," New Session"]}),u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Te(B.path),oe(null)},children:[u.jsx(Gc,{size:12})," New Folder"]}),u.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(B.path),oe(null)},children:[u.jsx(vs,{size:12})," Hide Workspace"]})]}),B.type==="folder"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ge("folder",B.folderId,B.folderName??""),oe(null)},children:[u.jsx(Wp,{size:12})," Rename Folder"]}),u.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{E(B.folderId),oe(null)},children:[u.jsx(vs,{size:12})," Delete Folder"]})]}),B.type==="session"&&u.jsx(u.Fragment,{children:B.sessionLifecycle!=="finished"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ge("session",B.sessionId,B.sessionTitle??""),oe(null)},children:[u.jsx(Wp,{size:12})," Rename"]}),u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{y(B.sessionId),oe(null)},children:[u.jsx(zu,{size:12})," Mark as Finished"]}),u.jsxs("div",{className:`ctx-menu-item${B.sessionExternalId?"":" ctx-disabled"}`,title:B.sessionExternalId?void 0:"Session not started",onClick:()=>{B.sessionExternalId&&(mu(B.sessionExternalId),oe(null))},children:[u.jsx(uu,{size:12})," Copy Session ID"]}),u.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{c(B.sessionId),oe(null)},children:[u.jsx(vs,{size:12})," Delete Session"]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(B.sessionId),oe(null)},children:[u.jsx(Yl,{size:12})," Reopen"]}),u.jsxs("div",{className:`ctx-menu-item${B.sessionExternalId?"":" ctx-disabled"}`,title:B.sessionExternalId?void 0:"Session not started",onClick:()=>{B.sessionExternalId&&(mu(B.sessionExternalId),oe(null))},children:[u.jsx(uu,{size:12})," Copy Session ID"]}),u.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{c(B.sessionId),oe(null)},children:[u.jsx(vs,{size:12})," Delete Session"]})]})})]})]})}function Ew(){const n=F(f=>f.openTabs),r=F(f=>f.activeSessionId),o=F(f=>f.sessions),l=F(f=>f.selectSession),a=F(f=>f.closeTab),c=F(f=>f.setShowNewSessionDialog);return u.jsxs("div",{className:"ide-tabs",children:[n.map(f=>{const h=o.find(y=>y.id===f);if(!h)return null;const m=Mu(h),g=r===f;return u.jsxs("div",{className:`ide-tab ${g?"active":""}`,onClick:()=>l(f),children:[u.jsx(am,{iconClass:m.iconClass,iconText:m.iconText,size:14}),h.title||f.slice(0,8),m.dot&&u.jsx(Lu,{status:m.dot}),u.jsx("span",{className:"ide-tab-close",onClick:y=>{y.stopPropagation(),a(f)},children:u.jsx(ir,{size:12})})]},f)}),u.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>c(!0),children:u.jsx(Xo,{size:14})})]})}function Gu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xs=Gu();function Bm(n){xs=n}var Jo={exec:()=>null};function et(n,r=""){let o=typeof n=="string"?n:n.source;const l={replace:(a,c)=>{let f=typeof c=="string"?c:c.source;return f=f.replace(an.caret,"$1"),o=o.replace(a,f),l},getRegex:()=>new RegExp(o,r)};return l}var an={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},_w=/^(?:[ \t]*(?:\n|$))+/,Rw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,di=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qu=/(?:[*+-]|\d{1,9}[.)])/,Wm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hm=et(Wm).replace(/bull/g,qu).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(),Iw=et(Wm).replace(/bull/g,qu).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(),Ku=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Mw=/^[^\n]+/,Xu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Aw=et(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Lw=et(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qu).getRegex(),ra="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]*?(?:-->|$))/,Pw=et("^ {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",ra).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vm=et(Ku).replace("hr",di).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",ra).getRegex(),Ow=et(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vm).getRegex(),Qu={blockquote:Ow,code:Rw,def:Aw,fences:jw,heading:Dw,hr:di,html:Pw,lheading:Hm,list:Lw,newline:_w,paragraph:Vm,table:Jo,text:Mw},ih=et("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",di).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",ra).getRegex(),zw={...Qu,lheading:Iw,table:ih,paragraph:et(Ku).replace("hr",di).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ih).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ra).getRegex()},$w={...Qu,html:et(`^ *(?: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:Jo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:et(Ku).replace("hr",di).replace("heading",` *#{1,6} *[^
344
+ ]`).replace("lheading",Hm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Fw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Uw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gm=/^( {2,}|\\)\n(?!\s*$)/,Bw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,sa=/[\p{P}\p{S}]/u,Zu=/[\s\p{P}\p{S}]/u,qm=/[^\s\p{P}\p{S}]/u,Ww=et(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zu).getRegex(),Km=/(?!~)[\p{P}\p{S}]/u,Hw=/(?!~)[\s\p{P}\p{S}]/u,Vw=/(?:[^\s\p{P}\p{S}]|~)/u,Gw=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Xm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qw=et(Xm,"u").replace(/punct/g,sa).getRegex(),Kw=et(Xm,"u").replace(/punct/g,Km).getRegex(),Ym="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xw=et(Ym,"gu").replace(/notPunctSpace/g,qm).replace(/punctSpace/g,Zu).replace(/punct/g,sa).getRegex(),Yw=et(Ym,"gu").replace(/notPunctSpace/g,Vw).replace(/punctSpace/g,Hw).replace(/punct/g,Km).getRegex(),Qw=et("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qm).replace(/punctSpace/g,Zu).replace(/punct/g,sa).getRegex(),Zw=et(/\\(punct)/,"gu").replace(/punct/g,sa).getRegex(),Jw=et(/^<(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(),e1=et(Yu).replace("(?:-->|$)","-->").getRegex(),t1=et("^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",e1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Wl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,n1=et(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Wl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qm=et(/^!?\[(label)\]\[(ref)\]/).replace("label",Wl).replace("ref",Xu).getRegex(),Zm=et(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xu).getRegex(),r1=et("reflink|nolink(?!\\()","g").replace("reflink",Qm).replace("nolink",Zm).getRegex(),Ju={_backpedal:Jo,anyPunctuation:Zw,autolink:Jw,blockSkip:Gw,br:Gm,code:Uw,del:Jo,emStrongLDelim:qw,emStrongRDelimAst:Xw,emStrongRDelimUnd:Qw,escape:Fw,link:n1,nolink:Zm,punctuation:Ww,reflink:Qm,reflinkSearch:r1,tag:t1,text:Bw,url:Jo},s1={...Ju,link:et(/^!?\[(label)\]\((.*?)\)/).replace("label",Wl).getRegex(),reflink:et(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Wl).getRegex()},gu={...Ju,emStrongRDelimAst:Yw,emStrongLDelim:Kw,url:et(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},o1={...gu,br:et(Gm).replace("{2,}","*").getRegex(),text:et(gu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Nl={normal:Qu,gfm:zw,pedantic:$w},Wo={normal:Ju,gfm:gu,breaks:o1,pedantic:s1},i1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},lh=n=>i1[n];function rr(n,r){if(r){if(an.escapeTest.test(n))return n.replace(an.escapeReplace,lh)}else if(an.escapeTestNoEncode.test(n))return n.replace(an.escapeReplaceNoEncode,lh);return n}function ah(n){try{n=encodeURI(n).replace(an.percentDecode,"%")}catch{return null}return n}function ch(n,r){var c;const o=n.replace(an.findPipe,(f,h,m)=>{let g=!1,y=h;for(;--y>=0&&m[y]==="\\";)g=!g;return g?"|":" |"}),l=o.split(an.splitPipe);let a=0;if(l[0].trim()||l.shift(),l.length>0&&!((c=l.at(-1))!=null&&c.trim())&&l.pop(),r)if(l.length>r)l.splice(r);else for(;l.length<r;)l.push("");for(;a<l.length;a++)l[a]=l[a].trim().replace(an.slashPipe,"|");return l}function Ho(n,r,o){const l=n.length;if(l===0)return"";let a=0;for(;a<l&&n.charAt(l-a-1)===r;)a++;return n.slice(0,l-a)}function l1(n,r){if(n.indexOf(r[1])===-1)return-1;let o=0;for(let l=0;l<n.length;l++)if(n[l]==="\\")l++;else if(n[l]===r[0])o++;else if(n[l]===r[1]&&(o--,o<0))return l;return o>0?-2:-1}function uh(n,r,o,l,a){const c=r.href,f=r.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");l.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:o,href:c,title:f,text:h,tokens:l.inlineTokens(h)};return l.state.inLink=!1,m}function a1(n,r,o){const l=n.match(o.other.indentCodeCompensation);if(l===null)return r;const a=l[1];return r.split(`
345
+ `).map(c=>{const f=c.match(o.other.beginningSpace);if(f===null)return c;const[h]=f;return h.length>=a.length?c.slice(a.length):c}).join(`
346
+ `)}var Hl=class{constructor(n){it(this,"options");it(this,"rules");it(this,"lexer");this.options=n||xs}space(n){const r=this.rules.block.newline.exec(n);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(n){const r=this.rules.block.code.exec(n);if(r){const o=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Ho(o,`
347
+ `)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const o=r[0],l=a1(o,r[3]||"",this.rules);return{type:"code",raw:o,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:l}}}heading(n){const r=this.rules.block.heading.exec(n);if(r){let o=r[2].trim();if(this.rules.other.endingHash.test(o)){const l=Ho(o,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(o=l.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(n){const r=this.rules.block.hr.exec(n);if(r)return{type:"hr",raw:Ho(r[0],`
348
+ `)}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){let o=Ho(r[0],`
349
+ `).split(`
350
+ `),l="",a="";const c=[];for(;o.length>0;){let f=!1;const h=[];let m;for(m=0;m<o.length;m++)if(this.rules.other.blockquoteStart.test(o[m]))h.push(o[m]),f=!0;else if(!f)h.push(o[m]);else break;o=o.slice(m);const g=h.join(`
351
+ `),y=g.replace(this.rules.other.blockquoteSetextReplace,`
352
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");l=l?`${l}
353
+ ${g}`:g,a=a?`${a}
354
+ ${y}`:y;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,c,!0),this.lexer.state.top=k,o.length===0)break;const x=c.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){const C=x,D=C.raw+`
355
+ `+o.join(`
356
+ `),E=this.blockquote(D);c[c.length-1]=E,l=l.substring(0,l.length-C.raw.length)+E.raw,a=a.substring(0,a.length-C.text.length)+E.text;break}else if((x==null?void 0:x.type)==="list"){const C=x,D=C.raw+`
357
+ `+o.join(`
358
+ `),E=this.list(D);c[c.length-1]=E,l=l.substring(0,l.length-x.raw.length)+E.raw,a=a.substring(0,a.length-C.raw.length)+E.raw,o=D.substring(c.at(-1).raw.length).split(`
359
+ `);continue}}return{type:"blockquote",raw:l,tokens:c,text:a}}}list(n){let r=this.rules.block.list.exec(n);if(r){let o=r[1].trim();const l=o.length>1,a={type:"list",raw:"",ordered:l,start:l?+o.slice(0,-1):"",loose:!1,items:[]};o=l?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=l?o:"[*+-]");const c=this.rules.other.listItemRegex(o);let f=!1;for(;n;){let m=!1,g="",y="";if(!(r=c.exec(n))||this.rules.block.hr.test(n))break;g=r[0],n=n.substring(g.length);let k=r[2].split(`
360
+ `,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),x=n.split(`
361
+ `,1)[0],C=!k.trim(),D=0;if(this.options.pedantic?(D=2,y=k.trimStart()):C?D=r[1].length+1:(D=r[2].search(this.rules.other.nonSpaceChar),D=D>4?1:D,y=k.slice(D),D+=r[1].length),C&&this.rules.other.blankLine.test(x)&&(g+=x+`
362
+ `,n=n.substring(x.length+1),m=!0),!m){const M=this.rules.other.nextBulletRegex(D),j=this.rules.other.hrRegex(D),H=this.rules.other.fencesBeginRegex(D),P=this.rules.other.headingBeginRegex(D),V=this.rules.other.htmlBeginRegex(D);for(;n;){const ee=n.split(`
363
+ `,1)[0];let q;if(x=ee,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),q=x):q=x.replace(this.rules.other.tabCharGlobal," "),H.test(x)||P.test(x)||V.test(x)||M.test(x)||j.test(x))break;if(q.search(this.rules.other.nonSpaceChar)>=D||!x.trim())y+=`
364
+ `+q.slice(D);else{if(C||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||H.test(k)||P.test(k)||j.test(k))break;y+=`
365
+ `+x}!C&&!x.trim()&&(C=!0),g+=ee+`
366
+ `,n=n.substring(ee.length+1),k=q.slice(D)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let E=null,N;this.options.gfm&&(E=this.rules.other.listIsTask.exec(y),E&&(N=E[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!E,checked:N,loose:!1,text:y,tokens:[]}),a.raw+=g}const h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m=0;m<a.items.length;m++)if(this.lexer.state.top=!1,a.items[m].tokens=this.lexer.blockTokens(a.items[m].text,[]),!a.loose){const g=a.items[m].tokens.filter(k=>k.type==="space"),y=g.length>0&&g.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=y}if(a.loose)for(let m=0;m<a.items.length;m++)a.items[m].loose=!0;return a}}html(n){const r=this.rules.block.html.exec(n);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(n){const r=this.rules.block.def.exec(n);if(r){const o=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:o,raw:r[0],href:l,title:a}}}table(n){var f;const r=this.rules.block.table.exec(n);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const o=ch(r[1]),l=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=r[3])!=null&&f.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
367
+ `):[],c={type:"table",raw:r[0],header:[],align:[],rows:[]};if(o.length===l.length){for(const h of l)this.rules.other.tableAlignRight.test(h)?c.align.push("right"):this.rules.other.tableAlignCenter.test(h)?c.align.push("center"):this.rules.other.tableAlignLeft.test(h)?c.align.push("left"):c.align.push(null);for(let h=0;h<o.length;h++)c.header.push({text:o[h],tokens:this.lexer.inline(o[h]),header:!0,align:c.align[h]});for(const h of a)c.rows.push(ch(h,c.header.length).map((m,g)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:c.align[g]})));return c}}lheading(n){const r=this.rules.block.lheading.exec(n);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(n){const r=this.rules.block.paragraph.exec(n);if(r){const o=r[1].charAt(r[1].length-1)===`
368
+ `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:o,tokens:this.lexer.inline(o)}}}text(n){const r=this.rules.block.text.exec(n);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(n){const r=this.rules.inline.escape.exec(n);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(n){const r=this.rules.inline.tag.exec(n);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(n){const r=this.rules.inline.link.exec(n);if(r){const o=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;const c=Ho(o.slice(0,-1),"\\");if((o.length-c.length)%2===0)return}else{const c=l1(r[2],"()");if(c===-2)return;if(c>-1){const h=(r[0].indexOf("!")===0?5:4)+r[1].length+c;r[2]=r[2].substring(0,c),r[0]=r[0].substring(0,h).trim(),r[3]=""}}let l=r[2],a="";if(this.options.pedantic){const c=this.rules.other.pedanticHrefTitle.exec(l);c&&(l=c[1],a=c[3])}else a=r[3]?r[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?l=l.slice(1):l=l.slice(1,-1)),uh(r,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(n,r){let o;if((o=this.rules.inline.reflink.exec(n))||(o=this.rules.inline.nolink.exec(n))){const l=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[l.toLowerCase()];if(!a){const c=o[0].charAt(0);return{type:"text",raw:c,text:c}}return uh(o,a,o[0],this.lexer,this.rules)}}emStrong(n,r,o=""){let l=this.rules.inline.emStrongLDelim.exec(n);if(!l||l[3]&&o.match(this.rules.other.unicodeAlphaNumeric))return;if(!(l[1]||l[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const c=[...l[0]].length-1;let f,h,m=c,g=0;const y=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(y.lastIndex=0,r=r.slice(-1*n.length+c);(l=y.exec(r))!=null;){if(f=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!f)continue;if(h=[...f].length,l[3]||l[4]){m+=h;continue}else if((l[5]||l[6])&&c%3&&!((c+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);const k=[...l[0]][0].length,x=n.slice(0,c+l.index+k+h);if(Math.min(c,h)%2){const D=x.slice(1,-1);return{type:"em",raw:x,text:D,tokens:this.lexer.inlineTokens(D)}}const C=x.slice(2,-2);return{type:"strong",raw:x,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(n){const r=this.rules.inline.code.exec(n);if(r){let o=r[2].replace(this.rules.other.newLineCharGlobal," ");const l=this.rules.other.nonSpaceChar.test(o),a=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return l&&a&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:r[0],text:o}}}br(n){const r=this.rules.inline.br.exec(n);if(r)return{type:"br",raw:r[0]}}del(n){const r=this.rules.inline.del.exec(n);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(n){const r=this.rules.inline.autolink.exec(n);if(r){let o,l;return r[2]==="@"?(o=r[1],l="mailto:"+o):(o=r[1],l=o),{type:"link",raw:r[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}url(n){var o;let r;if(r=this.rules.inline.url.exec(n)){let l,a;if(r[2]==="@")l=r[0],a="mailto:"+l;else{let c;do c=r[0],r[0]=((o=this.rules.inline._backpedal.exec(r[0]))==null?void 0:o[0])??"";while(c!==r[0]);l=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:l,href:a,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(n){const r=this.rules.inline.text.exec(n);if(r){const o=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:o}}}},Sr=class vu{constructor(r){it(this,"tokens");it(this,"options");it(this,"state");it(this,"tokenizer");it(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||xs,this.options.tokenizer=this.options.tokenizer||new Hl,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 o={other:an,block:Nl.normal,inline:Wo.normal};this.options.pedantic?(o.block=Nl.pedantic,o.inline=Wo.pedantic):this.options.gfm&&(o.block=Nl.gfm,this.options.breaks?o.inline=Wo.breaks:o.inline=Wo.gfm),this.tokenizer.rules=o}static get rules(){return{block:Nl,inline:Wo}}static lex(r,o){return new vu(o).lex(r)}static lexInline(r,o){return new vu(o).inlineTokens(r)}lex(r){r=r.replace(an.carriageReturn,`
369
+ `),this.blockTokens(r,this.tokens);for(let o=0;o<this.inlineQueue.length;o++){const l=this.inlineQueue[o];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,o=[],l=!1){var a,c,f;for(this.options.pedantic&&(r=r.replace(an.tabCharGlobal," ").replace(an.spaceLine,""));r;){let h;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(g=>(h=g.call({lexer:this},r,o))?(r=r.substring(h.raw.length),o.push(h),!0):!1))continue;if(h=this.tokenizer.space(r)){r=r.substring(h.raw.length);const g=o.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
370
+ `:o.push(h);continue}if(h=this.tokenizer.code(r)){r=r.substring(h.raw.length);const g=o.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
371
+ `+h.raw,g.text+=`
372
+ `+h.text,this.inlineQueue.at(-1).src=g.text):o.push(h);continue}if(h=this.tokenizer.fences(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.heading(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.hr(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.blockquote(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.list(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.html(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.def(r)){r=r.substring(h.raw.length);const g=o.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
373
+ `+h.raw,g.text+=`
374
+ `+h.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(r)){r=r.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.lheading(r)){r=r.substring(h.raw.length),o.push(h);continue}let m=r;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const y=r.slice(1);let k;this.options.extensions.startBlock.forEach(x=>{k=x.call({lexer:this},y),typeof k=="number"&&k>=0&&(g=Math.min(g,k))}),g<1/0&&g>=0&&(m=r.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){const g=o.at(-1);l&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
375
+ `+h.raw,g.text+=`
376
+ `+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):o.push(h),l=m.length!==r.length,r=r.substring(h.raw.length);continue}if(h=this.tokenizer.text(r)){r=r.substring(h.raw.length);const g=o.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
377
+ `+h.raw,g.text+=`
378
+ `+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):o.push(h);continue}if(r){const g="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,o}inline(r,o=[]){return this.inlineQueue.push({src:r,tokens:o}),o}inlineTokens(r,o=[]){var h,m,g;let l=r,a=null;if(this.tokens.links){const y=Object.keys(this.tokens.links);if(y.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)y.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,a.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let c=!1,f="";for(;r;){c||(f=""),c=!1;let y;if((m=(h=this.options.extensions)==null?void 0:h.inline)!=null&&m.some(x=>(y=x.call({lexer:this},r,o))?(r=r.substring(y.raw.length),o.push(y),!0):!1))continue;if(y=this.tokenizer.escape(r)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.tag(r)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.link(r)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(y.raw.length);const x=o.at(-1);y.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=y.raw,x.text+=y.text):o.push(y);continue}if(y=this.tokenizer.emStrong(r,l,f)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.codespan(r)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.br(r)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.del(r)){r=r.substring(y.raw.length),o.push(y);continue}if(y=this.tokenizer.autolink(r)){r=r.substring(y.raw.length),o.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(r))){r=r.substring(y.raw.length),o.push(y);continue}let k=r;if((g=this.options.extensions)!=null&&g.startInline){let x=1/0;const C=r.slice(1);let D;this.options.extensions.startInline.forEach(E=>{D=E.call({lexer:this},C),typeof D=="number"&&D>=0&&(x=Math.min(x,D))}),x<1/0&&x>=0&&(k=r.substring(0,x+1))}if(y=this.tokenizer.inlineText(k)){r=r.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(f=y.raw.slice(-1)),c=!0;const x=o.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=y.raw,x.text+=y.text):o.push(y);continue}if(r){const x="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return o}},Vl=class{constructor(n){it(this,"options");it(this,"parser");this.options=n||xs}space(n){return""}code({text:n,lang:r,escaped:o}){var c;const l=(c=(r||"").match(an.notSpaceStart))==null?void 0:c[0],a=n.replace(an.endingNewline,"")+`
379
+ `;return l?'<pre><code class="language-'+rr(l)+'">'+(o?a:rr(a,!0))+`</code></pre>
380
+ `:"<pre><code>"+(o?a:rr(a,!0))+`</code></pre>
381
+ `}blockquote({tokens:n}){return`<blockquote>
382
+ ${this.parser.parse(n)}</blockquote>
383
+ `}html({text:n}){return n}heading({tokens:n,depth:r}){return`<h${r}>${this.parser.parseInline(n)}</h${r}>
384
+ `}hr(n){return`<hr>
385
+ `}list(n){const r=n.ordered,o=n.start;let l="";for(let f=0;f<n.items.length;f++){const h=n.items[f];l+=this.listitem(h)}const a=r?"ol":"ul",c=r&&o!==1?' start="'+o+'"':"";return"<"+a+c+`>
386
+ `+l+"</"+a+`>
387
+ `}listitem(n){var o;let r="";if(n.task){const l=this.checkbox({checked:!!n.checked});n.loose?((o=n.tokens[0])==null?void 0:o.type)==="paragraph"?(n.tokens[0].text=l+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=l+" "+rr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:l+" ",text:l+" ",escaped:!0}):r+=l+" "}return r+=this.parser.parse(n.tokens,!!n.loose),`<li>${r}</li>
388
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
389
+ `}table(n){let r="",o="";for(let a=0;a<n.header.length;a++)o+=this.tablecell(n.header[a]);r+=this.tablerow({text:o});let l="";for(let a=0;a<n.rows.length;a++){const c=n.rows[a];o="";for(let f=0;f<c.length;f++)o+=this.tablecell(c[f]);l+=this.tablerow({text:o})}return l&&(l=`<tbody>${l}</tbody>`),`<table>
390
+ <thead>
391
+ `+r+`</thead>
392
+ `+l+`</table>
393
+ `}tablerow({text:n}){return`<tr>
394
+ ${n}</tr>
395
+ `}tablecell(n){const r=this.parser.parseInline(n.tokens),o=n.header?"th":"td";return(n.align?`<${o} align="${n.align}">`:`<${o}>`)+r+`</${o}>
396
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${rr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:r,tokens:o}){const l=this.parser.parseInline(o),a=ah(n);if(a===null)return l;n=a;let c='<a href="'+n+'"';return r&&(c+=' title="'+rr(r)+'"'),c+=">"+l+"</a>",c}image({href:n,title:r,text:o,tokens:l}){l&&(o=this.parser.parseInline(l,this.parser.textRenderer));const a=ah(n);if(a===null)return rr(o);n=a;let c=`<img src="${n}" alt="${o}"`;return r&&(c+=` title="${rr(r)}"`),c+=">",c}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:rr(n.text)}},ed=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Tr=class yu{constructor(r){it(this,"options");it(this,"renderer");it(this,"textRenderer");this.options=r||xs,this.options.renderer=this.options.renderer||new Vl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ed}static parse(r,o){return new yu(o).parse(r)}static parseInline(r,o){return new yu(o).parseInline(r)}parse(r,o=!0){var a,c;let l="";for(let f=0;f<r.length;f++){const h=r[f];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[h.type]){const g=h,y=this.options.extensions.renderers[g.type].call({parser:this},g);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){l+=y||"";continue}}const m=h;switch(m.type){case"space":{l+=this.renderer.space(m);continue}case"hr":{l+=this.renderer.hr(m);continue}case"heading":{l+=this.renderer.heading(m);continue}case"code":{l+=this.renderer.code(m);continue}case"table":{l+=this.renderer.table(m);continue}case"blockquote":{l+=this.renderer.blockquote(m);continue}case"list":{l+=this.renderer.list(m);continue}case"html":{l+=this.renderer.html(m);continue}case"paragraph":{l+=this.renderer.paragraph(m);continue}case"text":{let g=m,y=this.renderer.text(g);for(;f+1<r.length&&r[f+1].type==="text";)g=r[++f],y+=`
397
+ `+this.renderer.text(g);o?l+=this.renderer.paragraph({type:"paragraph",raw:y,text:y,tokens:[{type:"text",raw:y,text:y,escaped:!0}]}):l+=y;continue}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return l}parseInline(r,o=this.renderer){var a,c;let l="";for(let f=0;f<r.length;f++){const h=r[f];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[h.type]){const g=this.options.extensions.renderers[h.type].call({parser:this},h);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){l+=g||"";continue}}const m=h;switch(m.type){case"escape":{l+=o.text(m);break}case"html":{l+=o.html(m);break}case"link":{l+=o.link(m);break}case"image":{l+=o.image(m);break}case"strong":{l+=o.strong(m);break}case"em":{l+=o.em(m);break}case"codespan":{l+=o.codespan(m);break}case"br":{l+=o.br(m);break}case"del":{l+=o.del(m);break}case"text":{l+=o.text(m);break}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return l}},ou,jl=(ou=class{constructor(n){it(this,"options");it(this,"block");this.options=n||xs}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Sr.lex:Sr.lexInline}provideParser(){return this.block?Tr.parse:Tr.parseInline}},it(ou,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),ou),c1=class{constructor(...n){it(this,"defaults",Gu());it(this,"options",this.setOptions);it(this,"parse",this.parseMarkdown(!0));it(this,"parseInline",this.parseMarkdown(!1));it(this,"Parser",Tr);it(this,"Renderer",Vl);it(this,"TextRenderer",ed);it(this,"Lexer",Sr);it(this,"Tokenizer",Hl);it(this,"Hooks",jl);this.use(...n)}walkTokens(n,r){var l,a;let o=[];for(const c of n)switch(o=o.concat(r.call(this,c)),c.type){case"table":{const f=c;for(const h of f.header)o=o.concat(this.walkTokens(h.tokens,r));for(const h of f.rows)for(const m of h)o=o.concat(this.walkTokens(m.tokens,r));break}case"list":{const f=c;o=o.concat(this.walkTokens(f.items,r));break}default:{const f=c;(a=(l=this.defaults.extensions)==null?void 0:l.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const m=f[h].flat(1/0);o=o.concat(this.walkTokens(m,r))}):f.tokens&&(o=o.concat(this.walkTokens(f.tokens,r)))}}return o}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(o=>{const l={...o};if(l.async=this.defaults.async||l.async||!1,o.extensions&&(o.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const c=r.renderers[a.name];c?r.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=c.apply(this,f)),h}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const c=r[a.level];c?c.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),l.extensions=r),o.renderer){const a=this.defaults.renderer||new Vl(this.defaults);for(const c in o.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;const f=c,h=o.renderer[f],m=a[f];a[f]=(...g)=>{let y=h.apply(a,g);return y===!1&&(y=m.apply(a,g)),y||""}}l.renderer=a}if(o.tokenizer){const a=this.defaults.tokenizer||new Hl(this.defaults);for(const c in o.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;const f=c,h=o.tokenizer[f],m=a[f];a[f]=(...g)=>{let y=h.apply(a,g);return y===!1&&(y=m.apply(a,g)),y}}l.tokenizer=a}if(o.hooks){const a=this.defaults.hooks||new jl;for(const c in o.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;const f=c,h=o.hooks[f],m=a[f];jl.passThroughHooks.has(c)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(h.call(a,g)).then(k=>m.call(a,k));const y=h.call(a,g);return m.call(a,y)}:a[f]=(...g)=>{let y=h.apply(a,g);return y===!1&&(y=m.apply(a,g)),y}}l.hooks=a}if(o.walkTokens){const a=this.defaults.walkTokens,c=o.walkTokens;l.walkTokens=function(f){let h=[];return h.push(c.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...l}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Sr.lex(n,r??this.defaults)}parser(n,r){return Tr.parse(n,r??this.defaults)}parseMarkdown(n){return(o,l)=>{const a={...l},c={...this.defaults,...a},f=this.onError(!!c.silent,!!c.async);if(this.defaults.async===!0&&a.async===!1)return f(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 o>"u"||o===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));c.hooks&&(c.hooks.options=c,c.hooks.block=n);const h=c.hooks?c.hooks.provideLexer():n?Sr.lex:Sr.lexInline,m=c.hooks?c.hooks.provideParser():n?Tr.parse:Tr.parseInline;if(c.async)return Promise.resolve(c.hooks?c.hooks.preprocess(o):o).then(g=>h(g,c)).then(g=>c.hooks?c.hooks.processAllTokens(g):g).then(g=>c.walkTokens?Promise.all(this.walkTokens(g,c.walkTokens)).then(()=>g):g).then(g=>m(g,c)).then(g=>c.hooks?c.hooks.postprocess(g):g).catch(f);try{c.hooks&&(o=c.hooks.preprocess(o));let g=h(o,c);c.hooks&&(g=c.hooks.processAllTokens(g)),c.walkTokens&&this.walkTokens(g,c.walkTokens);let y=m(g,c);return c.hooks&&(y=c.hooks.postprocess(y)),y}catch(g){return f(g)}}}onError(n,r){return o=>{if(o.message+=`
398
+ Please report this to https://github.com/markedjs/marked.`,n){const l="<p>An error occurred:</p><pre>"+rr(o.message+"",!0)+"</pre>";return r?Promise.resolve(l):l}if(r)return Promise.reject(o);throw o}}},ys=new c1;function Be(n,r){return ys.parse(n,r)}Be.options=Be.setOptions=function(n){return ys.setOptions(n),Be.defaults=ys.defaults,Bm(Be.defaults),Be};Be.getDefaults=Gu;Be.defaults=xs;Be.use=function(...n){return ys.use(...n),Be.defaults=ys.defaults,Bm(Be.defaults),Be};Be.walkTokens=function(n,r){return ys.walkTokens(n,r)};Be.parseInline=ys.parseInline;Be.Parser=Tr;Be.parser=Tr.parse;Be.Renderer=Vl;Be.TextRenderer=ed;Be.Lexer=Sr;Be.lexer=Sr.lex;Be.Tokenizer=Hl;Be.Hooks=jl;Be.parse=Be;Be.options;Be.setOptions;Be.use;Be.walkTokens;Be.parseInline;Tr.parse;Sr.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 dh(n,r){(r==null||r>n.length)&&(r=n.length);for(var o=0,l=Array(r);o<r;o++)l[o]=n[o];return l}function u1(n){if(Array.isArray(n))return n}function d1(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var l,a,c,f,h=[],m=!0,g=!1;try{if(c=(o=o.call(n)).next,r!==0)for(;!(m=(l=c.call(o)).done)&&(h.push(l.value),h.length!==r);m=!0);}catch(y){g=!0,a=y}finally{try{if(!m&&o.return!=null&&(f=o.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function f1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
399
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p1(n,r){return u1(n)||d1(n,r)||h1(n,r)||f1()}function h1(n,r){if(n){if(typeof n=="string")return dh(n,r);var o={}.toString.call(n).slice(8,-1);return o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set"?Array.from(n):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?dh(n,r):void 0}}const Jm=Object.entries,fh=Object.setPrototypeOf,m1=Object.isFrozen,g1=Object.getPrototypeOf,v1=Object.getOwnPropertyDescriptor;let Vt=Object.freeze,qt=Object.seal,Ys=Object.create,eg=typeof Reflect<"u"&&Reflect,xu=eg.apply,wu=eg.construct;Vt||(Vt=function(r){return r});qt||(qt=function(r){return r});xu||(xu=function(r,o){for(var l=arguments.length,a=new Array(l>2?l-2:0),c=2;c<l;c++)a[c-2]=arguments[c];return r.apply(o,a)});wu||(wu=function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),a=1;a<o;a++)l[a-1]=arguments[a];return new r(...l)});const qs=Rt(Array.prototype.forEach),y1=Rt(Array.prototype.lastIndexOf),ph=Rt(Array.prototype.pop),Ks=Rt(Array.prototype.push),x1=Rt(Array.prototype.splice),Xr=Array.isArray,Ko=Rt(String.prototype.toLowerCase),Zc=Rt(String.prototype.toString),hh=Rt(String.prototype.match),Vo=Rt(String.prototype.replace),mh=Rt(String.prototype.indexOf),w1=Rt(String.prototype.trim),k1=Rt(Number.prototype.toString),S1=Rt(Boolean.prototype.toString),gh=typeof BigInt>"u"?null:Rt(BigInt.prototype.toString),vh=typeof Symbol>"u"?null:Rt(Symbol.prototype.toString),$t=Rt(Object.prototype.hasOwnProperty),Go=Rt(Object.prototype.toString),zt=Rt(RegExp.prototype.test),gs=T1(TypeError);function Rt(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var o=arguments.length,l=new Array(o>1?o-1:0),a=1;a<o;a++)l[a-1]=arguments[a];return xu(n,r,l)}}function T1(n){return function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return wu(n,o)}}function Ue(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ko;if(fh&&fh(n,null),!Xr(r))return n;let l=r.length;for(;l--;){let a=r[l];if(typeof a=="string"){const c=o(a);c!==a&&(m1(r)||(r[l]=c),a=c)}n[a]=!0}return n}function N1(n){for(let r=0;r<n.length;r++)$t(n,r)||(n[r]=null);return n}function tn(n){const r=Ys(null);for(const l of Jm(n)){var o=p1(l,2);const a=o[0],c=o[1];$t(n,a)&&(Xr(c)?r[a]=N1(c):c&&typeof c=="object"&&c.constructor===Object?r[a]=tn(c):r[a]=c)}return r}function C1(n){switch(typeof n){case"string":return n;case"number":return k1(n);case"boolean":return S1(n);case"bigint":return gh?gh(n):"0";case"symbol":return vh?vh(n):"Symbol()";case"undefined":return Go(n);case"function":case"object":{if(n===null)return Go(n);const r=n,o=qn(r,"toString");if(typeof o=="function"){const l=o(r);return typeof l=="string"?l:Go(l)}return Go(n)}default:return Go(n)}}function qn(n,r){for(;n!==null;){const l=v1(n,r);if(l){if(l.get)return Rt(l.get);if(typeof l.value=="function")return Rt(l.value)}n=g1(n)}function o(){return null}return o}function b1(n){try{return zt(n,""),!0}catch{return!1}}const yh=Vt(["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"]),Jc=Vt(["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"]),eu=Vt(["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"]),E1=Vt(["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"]),tu=Vt(["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"]),_1=Vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xh=Vt(["#text"]),wh=Vt(["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"]),nu=Vt(["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"]),kh=Vt(["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"]),Cl=Vt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),R1=qt(/{{[\w\W]*|^[\w\W]*}}/g),j1=qt(/<%[\w\W]*|^[\w\W]*%>/g),D1=qt(/\${[\w\W]*/g),I1=qt(/^data-[\-\w.\u00B7-\uFFFF]+$/),M1=qt(/^aria-[\-\w]+$/),Sh=qt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),A1=qt(/^(?:\w+script|data):/i),L1=qt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),P1=qt(/^html$/i),O1=qt(/^[a-z][.\w]*(-[.\w]+)+$/i),Th=qt(/<[/\w!]/g),Nh=qt(/<[/\w]/g),z1=qt(/<\/no(script|embed|frames)/i),$1=qt(/\/>/i),Cn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},F1=function(){return typeof window>"u"?null:window},U1=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let l=null;const a="data-tt-policy-suffix";o&&o.hasAttribute(a)&&(l=o.getAttribute(a));const c="dompurify"+(l?"#"+l:"");try{return r.createPolicy(c,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Ch=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},qr=function(r,o,l,a){return $t(r,o)&&Xr(r[o])?Ue(a.base?tn(a.base):{},r[o],a.transform):l};function tg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F1();const r=re=>tg(re);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==Cn.document||!n.Element)return r.isSupported=!1,r;let o=n.document;const l=o,a=l.currentScript;n.DocumentFragment;const c=n.HTMLTemplateElement,f=n.Node,h=n.Element,m=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,k=n.trustedTypes,x=h.prototype,C=qn(x,"cloneNode"),D=qn(x,"remove"),E=qn(x,"nextSibling"),N=qn(x,"childNodes"),M=qn(x,"parentNode"),j=qn(x,"shadowRoot"),H=qn(x,"attributes"),P=f&&f.prototype?qn(f.prototype,"nodeType"):null,V=f&&f.prototype?qn(f.prototype,"nodeName"):null,ee=f&&f.prototype?qn(f.prototype,"ownerDocument"):null;if(typeof c=="function"){const re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}let q,B="",oe,ae=!1,ce=0;const Pe=function(){if(ce>0)throw gs('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.')},_e=function(S){Pe(),ce++;try{return q.createHTML(S)}finally{ce--}},Oe=function(S){Pe(),ce++;try{return q.createScriptURL(S)}finally{ce--}},Q=function(){return ae||(oe=U1(k,a),ae=!0),oe},te=o,ne=te.implementation,G=te.createNodeIterator,Z=te.createDocumentFragment,W=te.getElementsByTagName,b=l.importNode;let I=Ch();r.isSupported=typeof Jm=="function"&&typeof M=="function"&&ne&&ne.createHTMLDocument!==void 0;const ie=R1,de=j1,ge=D1,we=I1,Le=M1,Te=A1,je=L1,Ce=O1;let lt=Sh,Re=null;const kt=Ue({},[...yh,...Jc,...eu,...tu,...xh]);let $=null;const Me=Ue({},[...wh,...nu,...kh,...Cl]);let le=Object.seal(Ys(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}})),Qe=null,ut=null;const ve=Object.seal(Ys(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Fe=!0,We=!0,St=!1,U=!0,ue=!1,ze=!0,qe=!1,tt=!1,st=null,De=null,Ke=!1,nt=!1,lr=!1,ar=!1,Qr=!0,br=!1;const cr="user-content-";let ur=!0,zn=!1,_n={},Kt=null;const Rn=Ue({},["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 at=null;const jt=Ue({},["audio","video","img","source","image","track"]);let bt=null;const un=Ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Et="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",dt="http://www.w3.org/1999/xhtml";let Xt=dt,ot=!1,Yt=null;const At=Ue({},[Et,Tt,dt],Zc),dn=Vt(["mi","mo","mn","ms","mtext"]);let nn=Ue({},dn);const xn=Vt(["annotation-xml"]);let Ut=Ue({},xn);const $n=Ue({},["title","style","font","a","script"]);let Fn=null;const oa=["application/xhtml+xml","text/html"],ia="text/html";let Ze=null,dr=null;const fi=o.createElement("form"),pi=function(S){return S instanceof RegExp||S instanceof Function},ws=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dr&&dr===S)return;(!S||typeof S!="object")&&(S={}),S=tn(S),Fn=oa.indexOf(S.PARSER_MEDIA_TYPE)===-1?ia:S.PARSER_MEDIA_TYPE,Ze=Fn==="application/xhtml+xml"?Zc:Ko,Re=qr(S,"ALLOWED_TAGS",kt,{transform:Ze}),$=qr(S,"ALLOWED_ATTR",Me,{transform:Ze}),Yt=qr(S,"ALLOWED_NAMESPACES",At,{transform:Zc}),bt=qr(S,"ADD_URI_SAFE_ATTR",un,{transform:Ze,base:un}),at=qr(S,"ADD_DATA_URI_TAGS",jt,{transform:Ze,base:jt}),Kt=qr(S,"FORBID_CONTENTS",Rn,{transform:Ze}),Qe=qr(S,"FORBID_TAGS",tn({}),{transform:Ze}),ut=qr(S,"FORBID_ATTR",tn({}),{transform:Ze}),_n=$t(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?tn(S.USE_PROFILES):S.USE_PROFILES:!1,Fe=S.ALLOW_ARIA_ATTR!==!1,We=S.ALLOW_DATA_ATTR!==!1,St=S.ALLOW_UNKNOWN_PROTOCOLS||!1,U=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=S.SAFE_FOR_TEMPLATES||!1,ze=S.SAFE_FOR_XML!==!1,qe=S.WHOLE_DOCUMENT||!1,nt=S.RETURN_DOM||!1,lr=S.RETURN_DOM_FRAGMENT||!1,ar=S.RETURN_TRUSTED_TYPE||!1,Ke=S.FORCE_BODY||!1,Qr=S.SANITIZE_DOM!==!1,br=S.SANITIZE_NAMED_PROPS||!1,ur=S.KEEP_CONTENT!==!1,zn=S.IN_PLACE||!1,lt=b1(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:Sh,Xt=typeof S.NAMESPACE=="string"?S.NAMESPACE:dt,nn=$t(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?tn(S.MATHML_TEXT_INTEGRATION_POINTS):Ue({},dn),Ut=$t(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?tn(S.HTML_INTEGRATION_POINTS):Ue({},xn);const A=$t(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?tn(S.CUSTOM_ELEMENT_HANDLING):Ys(null);if(le=Ys(null),$t(A,"tagNameCheck")&&pi(A.tagNameCheck)&&(le.tagNameCheck=A.tagNameCheck),$t(A,"attributeNameCheck")&&pi(A.attributeNameCheck)&&(le.attributeNameCheck=A.attributeNameCheck),$t(A,"allowCustomizedBuiltInElements")&&typeof A.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=A.allowCustomizedBuiltInElements),qt(le),ue&&(We=!1),lr&&(nt=!0),_n&&(Re=Ue({},xh),$=Ys(null),_n.html===!0&&(Ue(Re,yh),Ue($,wh)),_n.svg===!0&&(Ue(Re,Jc),Ue($,nu),Ue($,Cl)),_n.svgFilters===!0&&(Ue(Re,eu),Ue($,nu),Ue($,Cl)),_n.mathMl===!0&&(Ue(Re,tu),Ue($,kh),Ue($,Cl))),ve.tagCheck=null,ve.attributeCheck=null,$t(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?ve.tagCheck=S.ADD_TAGS:Xr(S.ADD_TAGS)&&(Re===kt&&(Re=tn(Re)),Ue(Re,S.ADD_TAGS,Ze))),$t(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?ve.attributeCheck=S.ADD_ATTR:Xr(S.ADD_ATTR)&&($===Me&&($=tn($)),Ue($,S.ADD_ATTR,Ze))),$t(S,"ADD_URI_SAFE_ATTR")&&Xr(S.ADD_URI_SAFE_ATTR)&&Ue(bt,S.ADD_URI_SAFE_ATTR,Ze),$t(S,"FORBID_CONTENTS")&&Xr(S.FORBID_CONTENTS)&&(Kt===Rn&&(Kt=tn(Kt)),Ue(Kt,S.FORBID_CONTENTS,Ze)),$t(S,"ADD_FORBID_CONTENTS")&&Xr(S.ADD_FORBID_CONTENTS)&&(Kt===Rn&&(Kt=tn(Kt)),Ue(Kt,S.ADD_FORBID_CONTENTS,Ze)),ur&&(Re["#text"]=!0),qe&&Ue(Re,["html","head","body"]),Re.table&&(Ue(Re,["tbody"]),delete Qe.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const K=q;q=S.TRUSTED_TYPES_POLICY;try{B=_e("")}catch(me){throw q=K,me}}else S.TRUSTED_TYPES_POLICY===null?(q=void 0,B=""):(q===void 0&&(q=Q()),q&&typeof B=="string"&&(B=_e("")));Vt&&Vt(S),dr=S},lo=Ue({},[...Jc,...eu,...E1]),ao=Ue({},[...tu,..._1]),hi=function(S,A,K){return A.namespaceURI===dt?S==="svg":A.namespaceURI===Et?S==="svg"&&(K==="annotation-xml"||nn[K]):!!lo[S]},la=function(S,A,K){return A.namespaceURI===dt?S==="math":A.namespaceURI===Tt?S==="math"&&Ut[K]:!!ao[S]},aa=function(S,A,K){return A.namespaceURI===Tt&&!Ut[K]||A.namespaceURI===Et&&!nn[K]?!1:!ao[S]&&($n[S]||!lo[S])},mt=function(S){let A=M(S);(!A||!A.tagName)&&(A={namespaceURI:Xt,tagName:"template"});const K=Ko(S.tagName),me=Ko(A.tagName);return Yt[S.namespaceURI]?S.namespaceURI===Tt?hi(K,A,me):S.namespaceURI===Et?la(K,A,me):S.namespaceURI===dt?aa(K,A,me):!!(Fn==="application/xhtml+xml"&&Yt[S.namespaceURI]):!1},Qn=function(S){Ks(r.removed,{element:S});try{M(S).removeChild(S)}catch{if(D(S),!M(S))throw gs("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Er=function(S){Zr(S);const A=N(S);if(A){const me=[];qs(A,ke=>{Ks(me,ke)}),qs(me,ke=>{try{D(ke)}catch{}})}const K=H(S);if(K)for(let me=K.length-1;me>=0;--me){const ke=K[me],Ae=ke&&ke.name;if(typeof Ae=="string")try{S.removeAttribute(Ae)}catch{}}},Zn=function(S,A){try{Ks(r.removed,{attribute:A.getAttributeNode(S),from:A})}catch{Ks(r.removed,{attribute:null,from:A})}if(A.removeAttribute(S),S==="is")if(nt||lr)try{Qn(A)}catch{}else try{A.setAttribute(S,"")}catch{}},ks=function(S){const A=H(S);if(A)for(let K=A.length-1;K>=0;--K){const me=A[K],ke=me&&me.name;if(!(typeof ke!="string"||$[Ze(ke)]))try{S.removeAttribute(ke)}catch{}}},Zr=function(S){const A=[S];for(;A.length>0;){const K=A.pop();(P?P(K):K.nodeType)===Cn.element&&ks(K);const ke=N(K);if(ke)for(let Ae=ke.length-1;Ae>=0;--Ae)A.push(ke[Ae])}},mi=function(S){if(!ze)return;const A=[S];for(;A.length>0;){const K=A.pop(),me=P?P(K):K.nodeType;if(me===Cn.processingInstruction||me===Cn.comment&&zt(Nh,K.data)){try{D(K)}catch{}continue}if(me===Cn.element){const Ae=K,Ve=Ze(V?V(K):K.nodeName);try{Ae.hasAttribute&&Ae.hasAttribute("patchsrc")&&Ae.removeAttribute("patchsrc"),Ae.hasAttribute&&Ae.hasAttribute("for")&&Ve!=="label"&&Ve!=="output"&&Ae.removeAttribute("for")}catch{}}const ke=N(K);if(ke)for(let Ae=ke.length-1;Ae>=0;--Ae)A.push(ke[Ae])}},Jr=function(S){let A=null,K=null;if(Ke)S="<remove></remove>"+S;else{const Ae=hh(S,/^[\r\n\t ]+/);K=Ae&&Ae[0]}Fn==="application/xhtml+xml"&&Xt===dt&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const me=q?_e(S):S;if(Xt===dt)try{A=new y().parseFromString(me,Fn)}catch{}if(!A||!A.documentElement){A=ne.createDocument(Xt,"template",null);try{A.documentElement.innerHTML=ot?B:me}catch{}}const ke=A.body||A.documentElement;return S&&K&&ke.insertBefore(o.createTextNode(K),ke.childNodes[0]||null),Xt===dt?W.call(A,qe?"html":"body")[0]:qe?A.documentElement:ke},wn=function(S){const A=ee?ee(S):S.ownerDocument;return G.call(A||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Ss=function(S){return S=Vo(S,ie," "),S=Vo(S,de," "),S=Vo(S,ge," "),S},rn=function(S){var A;S.normalize();const K=ee?ee(S):S.ownerDocument,me=G.call(K||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let ke=me.nextNode();for(;ke;)ke.data=Ss(ke.data),ke=me.nextNode();const Ae=(A=S.querySelectorAll)===null||A===void 0?void 0:A.call(S,"template");Ae&&qs(Ae,Ve=>{_r(Ve.content)&&rn(Ve.content)})},Ts=function(S){const A=V?V(S):null;return typeof A!="string"||Ze(A)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==H(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==P(S)||S.childNodes!==N(S)},_r=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return P(S)===Cn.documentFragment}catch{return!1}},es=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return typeof P(S)=="number"}catch{return!1}};function sn(re,S,A){re.length!==0&&qs(re,K=>{K.call(r,S,A,dr)})}const Ns=function(S,A){return!!(ze&&S.hasChildNodes()&&!es(S.firstElementChild)&&zt(Th,S.textContent)&&zt(Th,S.innerHTML)||ze&&S.namespaceURI===dt&&A==="style"&&es(S.firstElementChild)||S.nodeType===Cn.processingInstruction||ze&&S.nodeType===Cn.comment&&zt(Nh,S.data))},ts=function(S,A,K){if(!Qe[A]&&uo(A)&&(le.tagNameCheck instanceof RegExp&&zt(le.tagNameCheck,A)||le.tagNameCheck instanceof Function&&le.tagNameCheck(A)))return!1;if(ur&&!Kt[A]){const me=M(S),ke=N(S);if(ke&&me){const Ae=ke.length;for(let Ve=Ae-1;Ve>=0;--Ve){const Xe=S===K?C(ke[Ve],!0):ke[Ve];me.insertBefore(Xe,E(S))}}}return Qn(S),!0},ns=function(S,A,K,me){return S.length===0?A:A===K||A===me?tn(A):A},gi=function(S,A){if(sn(I.beforeSanitizeElements,S,null),S!==A&&M(S)===null)return zn&&Zr(S),!0;if(Ts(S))return Qn(S),!0;const K=Ze(V?V(S):S.nodeName);if(Re=ns(I.uponSanitizeElement,Re,kt,st),sn(I.uponSanitizeElement,S,{tagName:K,allowedTags:Re}),S!==A&&M(S)===null)return zn&&Zr(S),!0;if(Ns(S,K))return Qn(S),!0;if(Qe[K]||!(ve.tagCheck instanceof Function&&ve.tagCheck(K))&&!Re[K]){const ke=ts(S,K,A);return ke===!1&&sn(I.afterSanitizeElements,S,null),ke}if((P?P(S):S.nodeType)===Cn.element&&!mt(S)||(K==="noscript"||K==="noembed"||K==="noframes")&&zt(z1,S.innerHTML))return Qn(S),!0;if(ue&&S.nodeType===Cn.text){const ke=Ss(S.textContent);S.textContent!==ke&&(Ks(r.removed,{element:S.cloneNode()}),S.textContent=ke)}return sn(I.afterSanitizeElements,S,null),!1},vi=function(S,A,K){if(ut[A]||ze&&A==="patchsrc"||ze&&A==="for"&&S!=="label"&&S!=="output"||Qr&&(A==="id"||A==="name")&&(K in o||K in fi))return!1;const me=$[A]||ve.attributeCheck instanceof Function&&ve.attributeCheck(A,S);if(!(We&&zt(we,A))){if(!(Fe&&zt(Le,A))){if(me){if(!bt[A]){if(!zt(lt,Vo(K,je,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&S!=="script"&&mh(K,"data:")===0&&at[S])){if(!(St&&!zt(Te,Vo(K,je,"")))){if(K)return!1}}}}}else if(!(uo(S)&&(le.tagNameCheck instanceof RegExp&&zt(le.tagNameCheck,S)||le.tagNameCheck instanceof Function&&le.tagNameCheck(S))&&(le.attributeNameCheck instanceof RegExp&&zt(le.attributeNameCheck,A)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(A,S))||A==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&zt(le.tagNameCheck,K)||le.tagNameCheck instanceof Function&&le.tagNameCheck(K))))return!1}}return!0},co=Ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),uo=function(S){return!co[Ko(S)]&&zt(Ce,S)},fo=function(S,A,K,me){if(q&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!K)switch(k.getAttributeType(S,A)){case"TrustedHTML":return _e(me);case"TrustedScriptURL":return Oe(me)}return me},rs=function(S,A,K,me){try{K?S.setAttributeNS(K,A,me):S.setAttribute(A,me),Ts(S)?Qn(S):ph(r.removed)}catch{Zn(A,S)}},yi=function(S){sn(I.beforeSanitizeAttributes,S,null);const A=S.attributes;if(!A||Ts(S))return;$=ns(I.uponSanitizeAttribute,$,Me,De);const K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$,forceKeepAttr:void 0};let me=A.length;const ke=Ze(S.nodeName);for(;me--;){const Ae=A[me],Ve=Ae.name,Xe=Ae.namespaceURI,gt=Ae.value,vt=Ze(Ve),fr=gt;let Nt=Ve==="value"?fr:w1(fr);if(K.attrName=vt,K.attrValue=Nt,K.keepAttr=!0,K.forceKeepAttr=void 0,sn(I.uponSanitizeAttribute,S,K),Nt=K.attrValue,br&&(vt==="id"||vt==="name")&&mh(Nt,cr)!==0&&(Zn(Ve,S),Nt=cr+Nt),ze&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nt)){Zn(Ve,S);continue}if(vt==="attributename"&&hh(Nt,"href")){Zn(Ve,S);continue}if(!K.forceKeepAttr){if(!K.keepAttr){Zn(Ve,S);continue}if(!U&&zt($1,Nt)){Zn(Ve,S);continue}if(ue&&(Nt=Ss(Nt)),!vi(ke,vt,Nt)){Zn(Ve,S);continue}Nt=fo(ke,vt,Xe,Nt),Nt!==fr&&rs(S,Ve,Xe,Nt)}}sn(I.afterSanitizeAttributes,S,null)},Rr=function(S){let A=null;const K=wn(S);for(sn(I.beforeSanitizeShadowDOM,S,null);A=K.nextNode();)if(sn(I.uponSanitizeShadowNode,A,null),gi(A,S),yi(A),_r(A.content)&&Rr(A.content),(P?P(A):A.nodeType)===Cn.element){const ke=j(A);_r(ke)&&(He(ke),Rr(ke))}sn(I.afterSanitizeShadowDOM,S,null)},He=function(S){const A=[{node:S,shadow:null}];for(;A.length>0;){const K=A.pop();if(K.shadow){Rr(K.shadow);continue}const me=K.node,Ae=(P?P(me):me.nodeType)===Cn.element,Ve=N(me);if(Ve)for(let Xe=Ve.length-1;Xe>=0;--Xe)A.push({node:Ve[Xe],shadow:null});if(Ae){const Xe=V?V(me):null;if(typeof Xe=="string"&&Ze(Xe)==="template"){const gt=me.content;_r(gt)&&A.push({node:gt,shadow:null})}}if(Ae){const Xe=j(me);_r(Xe)&&A.push({node:null,shadow:Xe},{node:Xe,shadow:null})}}};return r.sanitize=function(re){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,K=null,me=null,ke=null;if(ot=!re,ot&&(re="<!-->"),typeof re!="string"&&!es(re)&&(re=C1(re),typeof re!="string"))throw gs("dirty is not a string, aborting");if(!r.isSupported)return re;tt?(Re=st,$=De):ws(S),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(Re=tn(Re)),I.uponSanitizeAttribute.length>0&&($=tn($)),r.removed=[];const Ae=zn&&typeof re!="string"&&es(re);if(Ae){mi(re);const gt=V?V(re):re.nodeName;if(typeof gt=="string"){const vt=Ze(gt);if(!Re[vt]||Qe[vt])throw Er(re),gs("root node is forbidden and cannot be sanitized in-place")}if(Ts(re))throw Er(re),gs("root node is clobbered and cannot be sanitized in-place");try{He(re)}catch(vt){throw Er(re),vt}}else if(es(re))A=Jr("<!---->"),K=A.ownerDocument.importNode(re,!0),K.nodeType===Cn.element&&K.nodeName==="BODY"||K.nodeName==="HTML"?A=K:A.appendChild(K),He(K);else{if(!nt&&!ue&&!qe&&re.indexOf("<")===-1)return q&&ar?_e(re):re;if(A=Jr(re),!A)return nt?null:ar?B:""}A&&Ke&&Qn(A.firstChild);const Ve=Ae?re:A;try{const gt=wn(Ve);for(;me=gt.nextNode();)gi(me,Ve),yi(me),_r(me.content)&&Rr(me.content)}catch(gt){throw Ae&&(Er(re),qs(r.removed,vt=>{vt.element&&Zr(vt.element)})),gt}if(Ae)return qs(r.removed,gt=>{gt.element&&Zr(gt.element)}),ue&&rn(re),re;if(nt){if(ue&&rn(A),lr)for(ke=Z.call(A.ownerDocument);A.firstChild;)ke.appendChild(A.firstChild);else ke=A;return($.shadowroot||$.shadowrootmode)&&(ke=b.call(l,ke,!0)),ke}let Xe=qe?A.outerHTML:A.innerHTML;return qe&&Re["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&zt(P1,A.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
400
+ `+Xe),ue&&(Xe=Ss(Xe)),q&&ar?_e(Xe):Xe},r.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ws(re),tt=!0,st=Re,De=$},r.clearConfig=function(){dr=null,tt=!1,st=null,De=null,q=oe,B=""},r.isValidAttribute=function(re,S,A){dr||ws({});const K=Ze(re),me=Ze(S);return vi(K,me,A)},r.addHook=function(re,S){typeof S=="function"&&$t(I,re)&&Ks(I[re],S)},r.removeHook=function(re,S){if($t(I,re)){if(S!==void 0){const A=y1(I[re],S);return A===-1?void 0:x1(I[re],A,1)[0]}return ph(I[re])}},r.removeHooks=function(re){$t(I,re)&&(I[re]=[])},r.removeAllHooks=function(){I=Ch()},r}var td=tg();const B1=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function bh(n){return B1.has(n.type)}function W1({items:n,runtimeType:r,turn:o,threads:l=[]}){const[a,c]=w.useState(!1);if(n.length===0)return null;const f=n.length;return u.jsxs("div",{className:"tool-calls",children:[u.jsxs("div",{className:"tool-calls-header",onClick:()=>c(h=>!h),children:[u.jsx("span",{className:"tool-calls-icon",children:u.jsx(R0,{size:12})}),u.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),u.jsx(Pu,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&u.jsx("div",{className:"tool-calls-body",children:n.map(h=>u.jsx(kr,{item:h,runtimeType:r,turn:o,threads:l},h.id))})]})}Be.setOptions({breaks:!0,gfm:!0});function H1(n){const r=Be.parse(n);return td.sanitize(r)}function Eh(n,r){var a;const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let l=0;for(;o.nextNode();){const c=o.currentNode,f=((a=c.textContent)==null?void 0:a.length)??0;if(l+f>r)return{node:c,offset:r-l};l+=f}return null}function V1(n,r){n.querySelectorAll("mark[data-thread-id]").forEach(o=>{const l=o.parentNode;if(!l)return;const a=document.createTextNode(o.textContent||"");l.replaceChild(a,o),l.normalize()});for(const o of r){if(o.start_offset===null||o.end_offset===null)continue;const l=Eh(n,o.start_offset),a=Eh(n,o.end_offset);if(!l||!a)continue;const c=document.createRange();c.setStart(l.node,l.offset),c.setEnd(a.node,a.offset);const f=document.createElement("mark");f.setAttribute("data-thread-id",o.id),o.status==="resolved"&&f.classList.add("thread-mark-resolved");try{c.surroundContents(f)}catch{const h=c.extractContents();f.appendChild(h),c.insertNode(f)}}}function G1(n){const r=window.getSelection();if(!r||r.rangeCount===0)return null;const o=r.getRangeAt(0);if(o.collapsed||!n.contains(o.commonAncestorContainer))return null;const l=document.createRange();l.setStart(n,0),l.setEnd(o.startContainer,o.startOffset);const a=l.toString().length,c=o.toString();return{start:a,end:a+c.length,text:c}}function q1({itemId:n,turnId:r,sessionId:o,content:l,threads:a}){const c=w.useRef(null),f=w.useRef(null),h=w.useRef(null),m=w.useRef(""),g=w.useRef(0),[y,k]=w.useState(!1),[x,C]=w.useState({x:0,y:0}),[D,E]=w.useState(!1),[N,M]=w.useState({x:0,y:0}),[j,H]=w.useState(""),[P,V]=w.useState(null),[ee,q]=w.useState(!1),B=F(W=>W.createThread),oe=F(W=>W.switchRightTab),ae=F(W=>Kl(W.sessionDetails[o])),ce=w.useCallback(async()=>{await mu(l||""),q(!0),setTimeout(()=>q(!1),1500)},[l]),Pe=w.useCallback(()=>{var b;if(!P)return;const W=`
401
+ \`\`\`QUOTE
402
+ ${P.text}
403
+ \`\`\`
404
+
405
+ `;F.setState({quotedText:W}),k(!1),V(null),(b=window.getSelection())==null||b.removeAllRanges()},[P]),_e=w.useMemo(()=>H1(l||"…"),[l]),Oe=w.useMemo(()=>a.filter(W=>W.item_id===n),[a,n]);w.useEffect(()=>{c.current&&V1(c.current,Oe)},[_e,Oe]),w.useEffect(()=>{m.current=j},[j]),w.useEffect(()=>{function W(b){f.current&&!f.current.contains(b.target)&&(k(!1),m.current.trim()||E(!1))}return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[]);const Q=w.useCallback(()=>{k(!1),m.current.trim()||E(!1)},[]),te=w.useCallback(()=>{const W=c.current;if(!W)return;const b=G1(W);if(b&&b.text.trim().length>0){const I=window.getSelection();if(I&&I.rangeCount>0&&I.anchorNode&&I.focusNode){const de=I.getRangeAt(0).getBoundingClientRect(),ge=28,we=6,Le=170;let Te=!1;try{const lt=document.createRange();lt.setStart(I.focusNode,I.focusOffset),lt.setEnd(I.focusNode,I.focusOffset);const Re=document.createRange();Re.setStart(I.anchorNode,I.anchorOffset),Re.setEnd(I.anchorNode,I.anchorOffset),Te=Re.compareBoundaryPoints(Range.START_TO_START,lt)>0}catch{Te=!1}let je=de.top-ge-we;je<8&&(je=de.bottom+we);let Ce=Te?de.left-Le:de.right;Ce=Math.max(8,Math.min(Ce,window.innerWidth-Le-8)),C({x:Ce,y:je}),k(!0),V(b)}}else k(!1)},[]);w.useEffect(()=>{function W(b){const I=b.target;I&&(I.closest(".selection-actions")||I.closest(".thread-create-popover"))||te()}return document.addEventListener("mouseup",W),()=>document.removeEventListener("mouseup",W)},[te]);const ne=w.useCallback(()=>{k(!1),E(!0),M({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!D)return;const W=h.current;if(!W)return;const b=W.offsetWidth,I=W.offsetHeight,ie=8;let de=x.x,ge=x.y;de-b<ie&&(de=b+ie),de>window.innerWidth-ie&&(de=window.innerWidth-ie),ge<ie&&(ge=ie),ge+I>window.innerHeight-ie&&(ge=window.innerHeight-I-ie),M({x:de,y:ge})},[D,x]);const G=w.useCallback(async()=>{var W;ae||!P||!j.trim()||(await B(o,{itemId:n,turnId:r,startOffset:P.start,endOffset:P.end,selectedText:P.text,message:j.trim()}),H(""),E(!1),V(null),(W=window.getSelection())==null||W.removeAllRanges(),oe("threads"))},[P,j,B,o,n,r,oe,ae]),Z=w.useCallback(W=>{const b=W.target;if(b.tagName==="MARK"&&b.hasAttribute("data-thread-id")){W.preventDefault(),oe("threads");const I=b.getAttribute("data-thread-id");setTimeout(()=>{const ie=document.getElementById(`thread-${I}`);ie&&(ie.scrollIntoView({behavior:"smooth",block:"center"}),ie.classList.add("thread-card-highlighted"),setTimeout(()=>ie.classList.remove("thread-card-highlighted"),1500))},100)}},[oe]);return u.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[u.jsx("div",{ref:c,dangerouslySetInnerHTML:{__html:_e},onMouseDown:Q,onClick:Z}),u.jsx("button",{className:`copy-text-btn${ee?" copied":""}`,onClick:ce,title:ee?"Copied":"Copy message","aria-label":"Copy message text",children:ee?u.jsx(Yr,{size:14}):u.jsx(uu,{size:14})}),y&&!D&&u.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!ae&&u.jsxs("button",{className:"discuss-button",onClick:ne,title:"Start a discussion about this text",children:[u.jsx(g0,{size:14}),u.jsx("span",{children:"Discuss"})]}),u.jsxs("button",{className:"discuss-button",onClick:Pe,title:"Quote this text in your message",children:[u.jsx(fm,{size:14}),u.jsx("span",{children:"Quote"})]})]}),D&&u.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:N.x,top:N.y},children:[u.jsxs("div",{className:"thread-create-header",children:[u.jsxs("span",{className:"thread-create-quote",children:['"',P==null?void 0:P.text.slice(0,80),P&&P.text.length>80?"…":"",'"']}),u.jsx("button",{className:"thread-create-close",onClick:()=>{E(!1),V(null)},children:u.jsx(ir,{size:14})})]}),u.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:j,onChange:W=>H(W.target.value),autoFocus:!0,rows:2,onKeyDown:W=>{if(W.key==="Enter"&&(W.metaKey||W.ctrlKey)&&(W.preventDefault(),G()),W.key==="Escape")if(m.current.trim()){const b=Date.now();g.current&&b-g.current<400?(g.current=0,E(!1),V(null)):g.current=b}else E(!1),V(null)}}),u.jsxs("div",{className:"thread-create-footer",children:[u.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),u.jsxs("button",{className:"thread-create-send",onClick:G,disabled:!j.trim()||ae,title:ae?"Wait for the running turn to finish first":void 0,children:[u.jsx(Ql,{size:13}),u.jsx("span",{children:"Send"})]})]})]})]})}const _h=w.memo(q1),Gl=new Map,ng=new Set,ku=new Set,Rh=new Map;function rg(){ku.forEach(n=>n())}function sg(n,r){return`${n}:${r}`}function K1(n,r,o,l,a){var m;const c=sg(r,o),f=Gl.get(n)??new Map,h=new Map(f);((m=h.get(c))==null?void 0:m.answer)===a?h.delete(c):h.set(c,{itemIndex:r,groupIndex:o,question:l,answer:a}),Gl.set(n,h),rg()}function X1(n){Gl.delete(n),rg()}function Y1(n){ng.add(n),X1(n)}function Q1(n){const r=w.useCallback(o=>(ku.add(o),()=>{ku.delete(o)}),[]);return w.useSyncExternalStore(r,()=>Gl.get(n)??Rh,()=>Rh)}function Z1(n){return[...n].sort((r,o)=>r.itemIndex-o.itemIndex||r.groupIndex-o.groupIndex).map(r=>`> ${r.question}
406
+ ${r.answer}`).join(`
407
+
408
+ `)}function jh({item:n,turn:r}){var C;const o=n.data??{},l=w.useMemo(()=>Array.isArray(o.groups)?o.groups.filter(D=>!!D&&Array.isArray(D.selections)&&D.selections.length>0):[],[o.groups]),a=Q1(r.id),c=F(D=>r.session_id?D.sessionDetails[r.session_id]:null),f=F(D=>D.activeSessionId),h=r.items.findIndex(D=>D.id===n.id),m=c?((C=c.turns[c.turns.length-1])==null?void 0:C.id)===r.id:!0,g=ng.has(r.id),y=g||nm(c)||!m||r.session_id!==f,k=(D,E,N)=>{y||K1(r.id,h,D,E,N)},x=()=>{const D=[...a.values()];if(D.length===0)return;const E=Z1(D);Y1(r.id),F.getState().submitPrompt(E)};return u.jsxs("div",{className:"render-content ask-user-card",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(s0,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"Question"}),g&&u.jsx("span",{className:"turn-header-meta",children:"answered"})]}),l.length>0?u.jsxs("div",{className:"ask-user-groups",children:[l.map((D,E)=>u.jsxs("div",{className:"ask-user-group",children:[D.question&&u.jsx("div",{className:"ask-user-question",children:D.question}),u.jsx("div",{className:"ask-user-options",children:D.selections.map(N=>{var j;const M=((j=a.get(sg(h,E)))==null?void 0:j.answer)===N;return u.jsx("button",{type:"button",className:`ask-user-option ${M?"selected":""}`,disabled:y,onClick:()=>k(E,D.question,N),children:N},N)})})]},E)),y?g&&u.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):u.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:x,children:[u.jsx(Ql,{size:12}),"Send"]})]}):o.question?u.jsx("p",{className:"user-message",children:o.question}):u.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}Be.setOptions({breaks:!0,gfm:!0});function J1({attachments:n}){const[r,o]=w.useState(null);return w.useEffect(()=>{if(!r)return;function l(a){a.key==="Escape"&&o(null)}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r]),!Array.isArray(n)||n.length===0?null:u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"attachment-pills",children:n.map((l,a)=>{const c=l.media_type.startsWith("image/"),f=`data:${l.media_type};base64,${l.data}`;return u.jsxs("span",{className:"attachment-pill",title:l.name,onClick:c?()=>o(f):void 0,style:c?{cursor:"pointer"}:void 0,children:[c?u.jsx("img",{src:f,alt:l.name,className:"attachment-pill-thumb"}):u.jsx(dm,{size:12,className:"attachment-pill-icon"}),u.jsx("span",{className:"attachment-pill-name",children:l.name})]},a)})}),r&&u.jsx("div",{className:"image-preview-modal",onClick:()=>o(null),children:u.jsxs("div",{className:"image-preview-content",onClick:l=>l.stopPropagation(),children:[u.jsx("img",{src:r,alt:"preview"}),u.jsx("button",{className:"image-preview-close",onClick:()=>o(null),children:u.jsx(ir,{size:20})})]})})]})}function ek(n){const r=Be.parse(n);return td.sanitize(r)}function Dh(n){var r;return(r=n.data)!=null&&r.text?n.data.text:""}function tk(n){const r=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return r?r[1]:n}const Ih='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function nk(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${Ih}</body>`):n+Ih}function rk({html:n}){const[r,o]=w.useState(480),l=w.useRef(null);return w.useEffect(()=>{function a(c){var f;c.source===((f=l.current)==null?void 0:f.contentWindow)&&typeof c.data=="number"&&c.data>0&&o(c.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),u.jsx("iframe",{ref:l,sandbox:"allow-scripts",srcDoc:nk(n),title:"HTML content",style:{width:"100%",height:`${r}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const Mh=1e4;function sk({item:n,runtimeType:r,turn:o,threads:l}){var h,m,g,y,k,x,C,D;const a=n.status==="in_progress",[c,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:E,iconText:N}=au(r??"codex");return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:`turn-header-icon ${E}`,children:N}),u.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&u.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),u.jsx(_h,{itemId:n.id,turnId:o.id,sessionId:o.session_id,content:Dh(n)||"…",threads:l,runtimeType:r})]})}case"reasoning":return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(n0,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),u.jsx("div",{dangerouslySetInnerHTML:{__html:ek(Dh(n))}})]});case"command_execution":{const E=n.data||{},N=tk(E.command||""),M=E.aggregated_output||"",j=E.exit_code,H=a?"running…":j!==null?`exit ${j}`:"",P=M.length>Mh,V=P&&!c?M.slice(0,Mh)+`
409
+ … (truncated, click to expand)`:M;return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(hm,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"Command"}),H&&u.jsx("span",{className:"turn-header-meta",children:H})]}),u.jsx("pre",{className:"cmd-block",children:u.jsx("code",{children:N})}),M&&u.jsxs(u.Fragment,{children:[u.jsx("pre",{className:"cmd-output",children:u.jsx("code",{children:V})}),P&&u.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(ee=>!ee),children:c?"Show less":`Show full output (${(M.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const E=(h=n.data)==null?void 0:h.changes,N=Array.isArray(E)?E:[],M=`${N.length} file${N.length!==1?"s":""}`;return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(c0,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"File Changes"}),u.jsx("span",{className:"turn-header-meta",children:M})]}),u.jsx("div",{className:"file-change-list",children:N.map((j,H)=>{const P=j.kind==="add"?"A":j.kind==="delete"?"D":"M",V=j.kind==="add"?"fc-add":j.kind==="delete"?"fc-del":"fc-mod";return u.jsxs("div",{className:"file-change",children:[u.jsx("span",{className:`fc-status ${V}`,children:P}),u.jsx("span",{className:"fc-name",children:j.path})]},H)})})]})}case"mcp_tool_call":{const E=n.data||{},N=E.tool||"mcp";if(N==="Agent"){const B=E.arguments,oe=(B==null?void 0:B.description)||(B==null?void 0:B.prompt)||"Subagent",ae=n.status==="failed",ce=a?"running…":ae?"failed":"done";return u.jsxs("div",{className:"agent-call-card",children:[u.jsx("span",{className:"agent-call-icon",children:u.jsx(cu,{size:14})}),u.jsx("span",{className:"agent-call-desc",children:oe}),u.jsx("span",{className:`agent-call-status ${a?"running":ae?"failed":"done"}`,children:ce})]})}const M=E.server||"",j=E.arguments,H=E.result,P=E.error,V=n.status==="failed"||!!P,ee=a?"running…":V?"failed":"done",q=((m=H==null?void 0:H.content)==null?void 0:m.filter(B=>B.type==="text").map(B=>B.text))??[];return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(k0,{size:14})}),u.jsxs("span",{className:"turn-header-title",children:["MCP: ",N]}),M&&u.jsx("span",{className:"turn-header-meta",children:M}),u.jsx("span",{className:"turn-header-meta",style:V?{color:"var(--red)"}:void 0,children:ee})]}),j&&Object.keys(j).length>0&&u.jsx("div",{className:"mcp-args",children:Object.entries(j).map(([B,oe])=>u.jsxs("div",{className:"mcp-arg",children:[u.jsx("span",{className:"mcp-arg-key",children:B}),B==="code"?u.jsx("pre",{className:"cmd-block",children:u.jsx("code",{children:String(oe)})}):u.jsx("span",{className:"mcp-arg-value",children:typeof oe=="string"?oe:JSON.stringify(oe,null,2)})]},B))}),q.length>0&&q.map((B,oe)=>u.jsx("pre",{className:"cmd-output",children:u.jsx("code",{children:B})},oe)),P&&u.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:u.jsx("code",{children:P})})]})}case"web_search":{const E=((g=n.data)==null?void 0:g.query)||"";return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(T0,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),u.jsx("p",{className:"user-message",children:E})]})}case"todo_list":{const E=((y=n.data)==null?void 0:y.items)||[];return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(p0,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),u.jsx("ul",{className:"todo-list",children:E.map((N,M)=>u.jsxs("li",{className:N.completed?"todo-done":"todo-pending",children:[N.completed?u.jsx(Yr,{size:14}):u.jsx(ii,{size:14})," ",N.text]},M))})]})}case"ask_user":return u.jsx(jh,{item:n,turn:o});case"final_result":{const E=n.data??{},N=E.text||"",M=E.html||null,j=Array.isArray(E.groups)?E.groups.filter(V=>!!V&&Array.isArray(V.selections)&&V.selections.length>0):[],{iconClass:H,iconText:P}=au(r??"codex");return u.jsxs(u.Fragment,{children:[(N||M)&&u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:`turn-header-icon ${H}`,children:P}),u.jsx("span",{className:"turn-header-title",children:"Agent"})]}),N&&u.jsx(_h,{itemId:n.id,turnId:o.id,sessionId:o.session_id,content:N,threads:l,runtimeType:r}),M&&u.jsx(rk,{html:M})]}),j.length>0&&u.jsx(jh,{item:n,turn:o})]})}case"background_task":{const E=n.data||{},N=E.task_type||"unknown",M=E.subagent_type||null,j=E.description||"",H=E.status||"running",P=E.last_tool_name||null,V=E.token_count||null,ee=N==="local_agent",q=N==="local_bash",B=ee?cu:q?pm:um,oe=ee?`Subagent${M?`: ${M}`:""}`:q?"Monitor":"Background Task",ae=H==="running"?"running…":H==="completed"?"done":H==="failed"?"failed":H==="stopped"?"stopped":H,ce=n.status==="failed"||H==="failed";return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(B,{size:14})}),u.jsx("span",{className:"turn-header-title",children:oe}),u.jsx("span",{className:"turn-header-meta",style:ce?{color:"var(--red)"}:void 0,children:ae})]}),j&&u.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:j}),P&&a&&u.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",P,V!=null&&` · ${V.toLocaleString()} tokens`]}),u.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 E=((k=n.data)==null?void 0:k.trigger)??"auto",N=((x=n.data)==null?void 0:x.pre_tokens)??0,M=((C=n.data)==null?void 0:C.post_tokens)??0,j=N>0?Math.round((1-M/N)*100):0,H=E==="manual"?"Context compacted (/compact)":"Context auto-compacted";return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:u.jsx(y0,{size:14})}),u.jsx("span",{className:"turn-header-title",children:H})]}),u.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[N.toLocaleString()," → ",M.toLocaleString()," tokens (",j,"% reduction)"]})]})}case"error":{const E=((D=n.data)==null?void 0:D.message)||"Unknown error";return u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:u.jsx(Ou,{size:14})}),u.jsx("span",{className:"turn-header-title",children:"Error"})]}),u.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:u.jsx("code",{children:E})})]})}default:return null}}const kr=w.memo(sk,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function ok({turn:n,runtimeType:r,threads:o=[]}){Gt.trackRender("TurnContent");const[l,a]=w.useState(!1);w.useEffect(()=>{const N=n.items.some(M=>M.type==="background_task"&&M.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!N&&a(!1)},[n.status,n.items]);let c=-1;for(let N=n.items.length-1;N>=0;N--)if(n.items[N].type==="agent_message"){c=N;break}const f=c>=0,h=f?n.items.slice(0,c):n.items,m=n.items.some(N=>N.type==="final_result"||N.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=h.filter(N=>{var M;return!(N.type==="reasoning"&&(!((M=N.data)!=null&&M.text)||N.data.text===""))}).filter(N=>!(N.type==="background_task"||N.type==="ask_user"||N.type==="final_result")),x=[];let C=null;for(const N of k)N.type==="agent_message"?(C&&x.push(C),C={agentMessage:N,toolItems:[],otherItems:[]}):(C||(C={agentMessage:null,toolItems:[],otherItems:[]}),bh(N)?C.toolItems.push(N):C.otherItems.push(N));C&&x.push(C);const D=k.filter(N=>bh(N)).length,E=D>0||k.length>0&&(n.status==="running"||n.status==="pending");return u.jsxs("div",{className:"turn-group",children:[u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),u.jsx("span",{className:"turn-header-title",children:"You"})]}),u.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&u.jsx(J1,{attachments:n.attachments})]}),E&&u.jsxs("div",{className:"tool-calls",children:[u.jsxs("div",{className:"tool-calls-header",onClick:()=>a(N=>!N),children:[u.jsx("span",{className:"tool-calls-icon",children:u.jsx(f0,{size:12})}),u.jsx("span",{className:"tool-calls-summary",children:D>0?`${D} tool call${D>1?"s":""}`:"thinking…"}),u.jsx(Pu,{size:14,className:"tool-calls-chevron",style:{transform:l?"rotate(90deg)":"none"}})]}),l&&u.jsx("div",{className:"tool-calls-body",children:x.map((N,M)=>u.jsxs("div",{className:"intermediate-segment",children:[N.agentMessage&&u.jsx(kr,{item:N.agentMessage,runtimeType:r,turn:n,threads:o}),N.otherItems.map(j=>u.jsx(kr,{item:j,runtimeType:r,turn:n,threads:o},j.id)),N.toolItems.length>0&&u.jsx(W1,{items:N.toolItems,runtimeType:r,turn:n,threads:o})]},M))})]}),n.items.filter(N=>N.type==="background_task").map(N=>u.jsx(kr,{item:N,runtimeType:r,turn:n,threads:o},`task-${N.id}`)),f&&u.jsx(kr,{item:n.items[c],runtimeType:r,turn:n,threads:o},n.items[c].id),g&&u.jsx(kr,{item:g,runtimeType:r,turn:n,threads:o},g.id),f&&n.items.slice(c+1).filter(N=>N.type!=="ask_user"&&N.type!=="background_task"&&N.type!=="final_result").map(N=>u.jsx(kr,{item:N,runtimeType:r,turn:n,threads:o},N.id)),n.items.filter(N=>N.type==="final_result").map(N=>u.jsx(kr,{item:N,runtimeType:r,turn:n,threads:o},`final-${N.id}`)),n.items.filter(N=>N.type==="ask_user").map(N=>u.jsx(kr,{item:N,runtimeType:r,turn:n,threads:o},`ask-${N.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&u.jsx("div",{className:"render-content",children:u.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&u.jsx("div",{className:"render-content",children:u.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:u.jsx("code",{children:n.error})})})]})}const ik=w.memo(ok);function og(n,r="session",o=0){const l=[];if(r==="session")n.forEach((c,f)=>Ah(c,f,l));else{const c=n[o];c&&Ah(c,o,l)}const a=new Map;for(const c of l)a.set(c.path,c);return Array.from(a.values())}function Ah(n,r,o){var l;for(const a of n.items)if(a.type==="file_change"&&((l=a.data)!=null&&l.changes)){const c=a.data.changes;for(const f of c)o.push({path:f.path,kind:f.kind,turnIdx:r})}}const lk=[],bl=50;function ak(){Gt.trackRender("RenderArea");const n=F(M=>M.activeSessionId),r=F(M=>M.activeSessionId?M.sessionDetails[M.activeSessionId]:null),o=F(M=>M.activeTurnIndex),l=F(M=>M.activeRightTab),a=F(M=>M.changesScope),c=F(M=>M.submittingPrompt),f=F(M=>M.loading),h=F(M=>M.selectedChangePath),m=F(M=>M.setSelectedChangePath),g=(r==null?void 0:r.turns)??[],y=(r==null?void 0:r.threads)??lk,k=w.useRef(null),[x,C]=w.useState(bl);w.useEffect(()=>{C(bl)},[n]);const D=g.filter(M=>!M.thread_id),E=Math.max(0,D.length-x),N=D.slice(E);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,g.length]),w.useEffect(()=>{if(!h||l!=="changes")return;const M=setTimeout(()=>{const j=h.replace(/[^a-zA-Z0-9]/g,"-"),H=document.getElementById(`diff-${j}`);H&&(H.scrollIntoView({behavior:"smooth",block:"start"}),H.classList.add("diff-highlight"),setTimeout(()=>H.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(M)},[h,l,m]),l==="changes"){if(!r)return u.jsx("div",{className:"render-scroll",children:u.jsx("div",{className:"empty-state",children:"No session selected"})});const M=og(g,a,o);return M.length===0?u.jsx("div",{className:"render-scroll",children:u.jsx("div",{className:"render-content",children:u.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):u.jsx("div",{className:"render-scroll",ref:k,children:u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{style:{marginBottom:"20px"},children:[u.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"var(--text)"},children:a==="session"?"All Session Changes":"Current Turn Changes"}),u.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px"},children:[M.length," file",M.length>1?"s":""]})]}),M.map(j=>{const H=j.path.split("/").pop()||j.path,P=j.path.replace("/"+H,""),V=j.kind==="add"?"Added":j.kind==="delete"?"Deleted":"Modified",ee=j.kind==="add"?"fc-add":j.kind==="delete"?"fc-del":"fc-mod",q=j.kind==="add"?"A":j.kind==="delete"?"D":"M",B=j.path.replace(/[^a-zA-Z0-9]/g,"-");return u.jsxs("div",{children:[u.jsxs("div",{className:"diff-file-header",id:`diff-${B}`,children:[u.jsx("span",{className:`diff-file-status ${ee}`,children:q}),u.jsxs("span",{className:"diff-file-name",children:[P&&u.jsxs("span",{style:{color:"var(--text-muted)"},children:[P,"/"]}),H]}),u.jsx("span",{className:"diff-file-stats",children:u.jsx("span",{className:`diff-file-badge ${ee}`,children:V})})]}),u.jsx("p",{style:{color:"var(--text-muted)",fontSize:"12px",fontStyle:"italic",padding:"8px 16px"},children:"Diff content not available (Codex SDK limitation)."})]},j.path)})]})})}return f&&!r?u.jsx("div",{className:"render-scroll",children:u.jsxs("div",{className:"skeleton-bars",children:[u.jsx("div",{className:"skeleton-bar"}),u.jsx("div",{className:"skeleton-bar"}),u.jsx("div",{className:"skeleton-bar"}),u.jsx("div",{className:"skeleton-bar"}),u.jsx("div",{className:"skeleton-bar"})]})}):r?u.jsxs("div",{className:"render-scroll",ref:k,children:[c&&u.jsx("div",{className:"turn-block",children:u.jsxs("div",{className:"turn-group",children:[u.jsxs("div",{className:"render-content",children:[u.jsxs("div",{className:"turn-header",children:[u.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),u.jsx("span",{className:"turn-header-title",children:"You"})]}),u.jsx("p",{className:"user-message",children:c})]}),u.jsx("div",{className:"render-content",children:u.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),g.length===0&&!c&&u.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),E>0&&u.jsx("div",{className:"render-load-earlier",children:u.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>C(M=>M+bl),children:["Show ",Math.min(bl,E)," earlier turns (",E," hidden)"]})}),N.map((M,j)=>u.jsx("div",{id:`turn-${E+j}`,className:"turn-block",children:u.jsx(ik,{turn:M,runtimeType:r.runtime_type,threads:y})},M.id))]}):u.jsx("div",{className:"render-scroll",children:u.jsx("div",{className:"empty-state",children:"No session selected"})})}const ck=w.memo(ak),uk=[{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 dk(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function fk(n,r,o=[]){const l=[...uk,...dk(o)],a=new Set;return l.filter(c=>!(a.has(c.label)||(a.add(c.label),c.capability&&!r[c.capability])||n&&!c.label.toLowerCase().includes(n.toLowerCase())))}function pk({commands:n,selectedIndex:r,onSelect:o,onHover:l}){return u.jsxs("div",{className:"slash-popup",children:[u.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&u.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,c)=>u.jsxs("div",{className:`slash-popup-item ${c===r?"selected":""}`,onMouseEnter:()=>l(c),onClick:()=>o(a),children:[u.jsx("span",{className:"slash-popup-label",children:a.label}),u.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function ru({title:n,options:r,currentValue:o,onSelect:l,onClose:a}){return u.jsxs("div",{className:"slash-popup",children:[u.jsxs("div",{className:"slash-popup-header",children:[u.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),u.jsx("span",{children:n})]}),r.map(c=>u.jsxs("div",{className:`slash-popup-item ${c.value===o?"selected":""}`,onClick:()=>l(c.value),children:[u.jsxs("div",{className:"slash-popup-item-main",children:[u.jsx("span",{className:"slash-popup-label",children:c.label}),c.description&&u.jsx("span",{className:"slash-popup-hint",children:c.description})]}),c.value===o&&u.jsx("span",{className:"slash-popup-check",children:"✓"})]},c.value))]})}function hk(n){return Cr("/skills")}function mk({filter:n,onSelect:r,onClose:o}){const[l,a]=w.useState([]),[c,f]=w.useState(!0),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{hk().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const y=l.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{m(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),m(C=>Math.min(C+1,y.length-1))):x.key==="ArrowUp"?(x.preventDefault(),m(C=>Math.max(C-1,0))):x.key==="Enter"?(x.preventDefault(),y[h]&&r(y[h])):x.key==="Escape"&&(x.preventDefault(),o())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[y,h,r,o]),u.jsxs("div",{className:"slash-popup",ref:g,children:[u.jsxs("div",{className:"slash-popup-header",children:[u.jsx("button",{className:"slash-popup-back",onClick:o,children:"← Back"}),u.jsx("span",{children:"Skills"})]}),c&&u.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!c&&y.length===0&&u.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),y.map((k,x)=>u.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>m(x),onClick:()=>r(k),children:[u.jsxs("div",{className:"slash-popup-item-main",children:[u.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&u.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&u.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function gk(){return Cr("/providers")}function vk(n,r){const o=r?`?cwd=${encodeURIComponent(r)}`:"";return Cr(`/providers/${n}/commands${o}`)}const yk={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function xk(n){const[r,o]=w.useState([]),[l,a]=w.useState(!0);w.useEffect(()=>{gk().then(o).catch(()=>o([])).finally(()=>a(!1))},[]);const c=r.find(f=>f.id===n)??null;return{provider:c,capabilities:(c==null?void 0:c.capabilities)??yk,loading:l}}const Xs=32,su=200;function Lh(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function Ph(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let Oh=0;function wk(){return Oh+=1,`att-${Date.now()}-${Oh}`}function kk(){Gt.trackRender("CommandInputBar");const[n,r]=w.useState(""),o=w.useRef(null),l=w.useRef(Xs),a=w.useRef(null),{submitPrompt:c,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=F(),g=F(U=>U.activeSessionId),y=F(U=>U.activeSessionId?U.sessionDetails[U.activeSessionId]:null),k=F(U=>U.restoredPrompt),x=F(U=>U.quotedText),C=nm(y),D=!g,{capabilities:E}=xk(y==null?void 0:y.runtime_type),N=(y==null?void 0:y.runtime_type)??null,M=E.imageAttachments,[j,H]=w.useState([]),[P,V]=w.useState(!1),[ee,q]=w.useState(null),[B,oe]=w.useState([]);w.useEffect(()=>{if(!N){oe([]);return}let U=!1;return vk(N,(y==null?void 0:y.cwd)??void 0).then(ue=>{U||oe(ue)}).catch(()=>{U||oe([])}),()=>{U=!0}},[N,y==null?void 0:y.cwd]);const[ae,ce]=w.useState(!1),[Pe,_e]=w.useState(""),[Oe,Q]=w.useState(0),[te,ne]=w.useState(void 0),[G,Z]=w.useState(!1),[W,b]=w.useState(""),[I,ie]=w.useState([]),de=ae?fk(Pe,E,B):[];w.useEffect(()=>{k!==null&&(r(k),requestAnimationFrame(()=>Re()),F.setState({restoredPrompt:null}))},[k]),w.useEffect(()=>{x!==null&&(r(U=>U+x),setTimeout(()=>{if(o.current){Re(),o.current.focus();const U=o.current.value.length;o.current.setSelectionRange(U,U)}},0),F.setState({quotedText:null}))},[x]),w.useEffect(()=>{if(!C)return;function U(ue){ue.key==="Escape"&&(ue.preventDefault(),f())}return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[C,f]),w.useEffect(()=>{ce(!1),ne(void 0),Z(!1),ie([]),H(U=>{for(const ue of U)ue.previewUrl&&URL.revokeObjectURL(ue.previewUrl);return[]})},[g]),w.useEffect(()=>{if(!ee)return;function U(ue){ue.key==="Escape"&&(ue.preventDefault(),q(null))}return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[ee]);const ge=w.useCallback(U=>{if(!U)return;const ue=Array.from(U);for(const ze of ue){const qe=new FileReader;qe.onload=()=>{const st=qe.result.split(",")[1]??"",De=ze.type.startsWith("image/")?URL.createObjectURL(ze):void 0;H(Ke=>[...Ke,{id:wk(),name:ze.name,media_type:ze.type||"application/octet-stream",data:st,previewUrl:De,size:ze.size}])},qe.readAsDataURL(ze)}},[]),we=w.useCallback(U=>{H(ue=>{const ze=ue.find(qe=>qe.id===U);return ze!=null&&ze.previewUrl&&URL.revokeObjectURL(ze.previewUrl),ue.filter(qe=>qe.id!==U)})},[]),Le=w.useCallback(U=>{U.preventDefault(),U.stopPropagation(),!(!M||C)&&V(!0)},[M,C]),Te=w.useCallback(U=>{U.preventDefault(),U.stopPropagation(),V(!1)},[]),je=w.useCallback(U=>{U.preventDefault(),U.stopPropagation(),V(!1),!(!M||C)&&ge(U.dataTransfer.files)},[M,C,ge]),Ce=w.useCallback(U=>{var qe;if(!M)return;const ue=(qe=U.clipboardData)==null?void 0:qe.items;if(!ue)return;const ze=[];for(let tt=0;tt<ue.length;tt++){const st=ue[tt];if(st.type.startsWith("image/")){const De=st.getAsFile();De&&ze.push(De)}}ze.length>0&&(U.preventDefault(),ge(ze))},[M,ge]);function lt(U){const ue=o.current;ue&&(ue.style.height=`${U}px`,l.current=U)}function Re(){const U=o.current;if(U){if(U.scrollHeight>U.clientHeight){const ue=Math.min(U.scrollHeight,su);ue!==l.current&&lt(ue);return}l.current>Xs&&(U.style.height="auto",lt(Math.min(U.scrollHeight,su)))}}function kt(){const U=n.trim();if(!U||C)return;let ue=U;I.length>0&&(ue=`${I.map(tt=>`$${tt.name}`).join(" ")}
410
+
411
+ ${U}`);const ze=j.map(({id:qe,previewUrl:tt,size:st,...De})=>De);r(""),ie([]),lt(Xs),ce(!1),ne(void 0),Z(!1);for(const qe of j)qe.previewUrl&&URL.revokeObjectURL(qe.previewUrl);H([]),c(ue,ze.length>0?ze:void 0)}function $(U){if(U.insertAsText){const ue=`/${U.id} `;r(ue),ce(!1),ne(void 0),requestAnimationFrame(()=>{if(o.current){o.current.focus();const ze=ue.length;o.current.setSelectionRange(ze,ze),Re()}});return}U.subPopup?ne(U.subPopup):U.id==="skills"?(Z(!0),b(""),ce(!1),r("")):U.id==="model"?(m(!0),ce(!1),r("")):(ce(!1),r(""))}function Me(U){ie(ue=>[...ue,U]),Z(!1),r(""),lt(Xs)}function le(U){const ue=Lh(y==null?void 0:y.runtime_config);te==="sandbox"?ue.sandboxMode=U:te==="websearch"?ue.webSearchMode=U:te==="network"&&(ue.networkAccessEnabled=U==="true"),h(ue),ne(void 0),ce(!1),r(""),lt(Xs)}function Qe(U){if(Gt.markKeystroke(),ae&&!te){if(U.key==="ArrowDown"){U.preventDefault(),Q(ue=>Math.min(ue+1,de.length-1));return}if(U.key==="ArrowUp"){U.preventDefault(),Q(ue=>Math.max(ue-1,0));return}if(U.key==="Enter"){U.preventDefault(),de[Oe]&&$(de[Oe]);return}if(U.key==="Escape"){U.preventDefault(),ce(!1),r("");return}}if(te&&U.key==="Escape"){U.preventDefault(),ne(void 0);return}if(U.key==="Enter"&&(U.metaKey||U.ctrlKey)&&!C){U.preventDefault(),kt();return}U.key==="Escape"&&C&&(U.preventDefault(),f())}function ut(U){Gt.markInputChange();const ue=U.target.value;r(ue),Re(),ue.startsWith("/")&&!ue.includes(" ")&&!C?(ce(!0),_e(ue.slice(1)),Q(0)):(ce(!1),ne(void 0)),ue.startsWith("$")&&!C?(Z(!0),b(ue.slice(1))):ue.startsWith("$")||Z(!1)}const ve=Lh(y==null?void 0:y.runtime_config),Fe=[{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"}],We=[{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"}],St=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return u.jsxs("div",{className:`cmd-bar${P?" drag-over":""}`,onDragOver:Le,onDragLeave:Te,onDrop:je,children:[ae&&!te&&u.jsx(pk,{commands:de,selectedIndex:Oe,onSelect:$,onHover:Q}),ae&&te==="sandbox"&&u.jsx(ru,{title:"Sandbox Mode",options:Fe,currentValue:ve.sandboxMode,onSelect:le,onClose:()=>ne(void 0)}),ae&&te==="websearch"&&u.jsx(ru,{title:"Web Search",options:We,currentValue:ve.webSearchMode,onSelect:le,onClose:()=>ne(void 0)}),ae&&te==="network"&&u.jsx(ru,{title:"Network Access",options:St,currentValue:ve.networkAccessEnabled===!0?"true":"false",onSelect:le,onClose:()=>ne(void 0)}),G&&u.jsx(mk,{filter:W,onSelect:Me,onClose:()=>{Z(!1),r("")}}),I.length>0&&u.jsx("div",{className:"skill-badges",children:I.map(U=>u.jsxs("span",{className:"skill-badge",children:["$",U.name,u.jsx("button",{className:"skill-badge-remove",onClick:()=>ie(ue=>ue.filter(ze=>ze.id!==U.id)),children:"×"})]},U.id))}),j.length>0&&u.jsx("div",{className:"attachment-preview-area",children:j.map(U=>u.jsxs("div",{className:"attachment-chip",title:U.name,children:[U.previewUrl?u.jsx("img",{src:U.previewUrl,alt:U.name,className:"attachment-thumb",onClick:()=>q(U),style:{cursor:"pointer"}}):u.jsx(dm,{size:20,className:"attachment-file-icon"}),u.jsxs("div",{className:"attachment-info",children:[u.jsx("span",{className:"attachment-name",children:U.name}),u.jsx("span",{className:"attachment-size",children:Ph(U.size)})]}),u.jsx("button",{className:"attachment-remove",onClick:()=>we(U.id),title:"Remove attachment",children:u.jsx(ir,{size:14})})]},U.id))}),M&&!C&&!D&&u.jsx("input",{ref:a,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:U=>{ge(U.target.files),U.target.value=""}}),u.jsxs("div",{className:"cmd-input-row",children:[M&&!C&&!D&&u.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var U;return(U=a.current)==null?void 0:U.click()},title:"Attach files",disabled:C,children:u.jsx(w0,{size:16})}),u.jsx("textarea",{ref:o,className:"cmd-textarea",placeholder:D?"Select or create a session…":C?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:C||D,rows:1,style:{minHeight:Xs,maxHeight:su},onChange:ut,onKeyDown:Qe,onPaste:Ce}),C?u.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:u.jsx(ii,{size:15})}):u.jsx("button",{className:"cmd-send-btn",onClick:kt,disabled:!n.trim()||D,title:"Send (⌘↵)",children:u.jsx(t0,{size:16})})]}),ee&&u.jsx("div",{className:"image-preview-modal",onClick:()=>q(null),children:u.jsxs("div",{className:"image-preview-content",onClick:U=>U.stopPropagation(),children:[u.jsx("img",{src:ee.previewUrl,alt:ee.name}),u.jsxs("div",{className:"image-preview-info",children:[u.jsx("span",{children:ee.name}),u.jsx("span",{children:Ph(ee.size)})]}),u.jsx("button",{className:"image-preview-close",onClick:()=>q(null),children:u.jsx(ir,{size:20})})]})})]})}function Sk(){const n=F(N=>N.activeSessionId),r=F(N=>N.activeSessionId?N.sessionDetails[N.activeSessionId]:null),o=F(N=>N.activeTurnIndex),l=F(N=>N.setActiveTurnIndex),a=F(N=>N.rewindToTurn),c=F(N=>N.restoreSession),f=F(N=>N.branchFromTurn),h=(r==null?void 0:r.turns)??[],m=Kl(r),g=!!(r!=null&&r.rewound_at_turn_id),y=(r==null?void 0:r.runtime_type)==="repoburg",k=y?"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.",[x,C]=w.useState(null),D=w.useRef(null);if(Xl(D,()=>C(null),!!x),Au(()=>C(null),!!x),h.length===0)return u.jsx("div",{className:"empty-state",children:"No turns yet"});function E(N){l(N),requestAnimationFrame(()=>{var M;(M=document.getElementById(`turn-${N}`))==null||M.scrollIntoView({behavior:"smooth",block:"start"})})}return u.jsxs("div",{className:"right-section",children:[u.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((N,M)=>{const j=M===o,H=N.user_prompt.length>50?N.user_prompt.slice(0,50)+"…":N.user_prompt,P=N.status==="running"||N.status==="pending";return u.jsx("div",{children:u.jsxs("div",{className:`turn-item ${j?"active":""}`,onClick:()=>E(M),onContextMenu:V=>{V.preventDefault(),C({x:V.clientX,y:V.clientY,turnId:N.id,turnIndex:M,isLast:M===h.length-1,isSlashCommand:N.user_prompt.trimStart().startsWith("/")})},children:[u.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:u.jsx(_0,{size:12})}),u.jsx("span",{className:"turn-item-label",children:H}),P&&u.jsx("span",{className:"turn-item-status",children:"running…"})]})},N.id)}),x&&u.jsxs("div",{ref:D,className:"ctx-menu",style:{position:"fixed",left:x.x,top:x.y,zIndex:500},children:[u.jsxs("div",{className:`ctx-menu-item ${x.isLast||m||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||m||x.isSlashCommand||(window.confirm(k)&&a(n,x.turnId),C(null))},children:[u.jsx(S0,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),g&&!y&&u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{c(n),C(null)},children:[u.jsx(Yl,{size:12})," Restore Rewind"]}),u.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,x.turnId),C(null)},children:[u.jsx(u0,{size:12})," Branch from Here"]})]})]})}function Tk(){const n=F(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),r=F(h=>h.changesScope),o=F(h=>h.setChangesScope),l=F(h=>h.activeTurnIndex),a=F(h=>h.setSelectedChangePath),c=(n==null?void 0:n.turns)??[],f=og(c,r,l);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"changes-scope-toggle",children:[u.jsx("button",{className:`scope-btn ${r==="session"?"active":""}`,onClick:()=>o("session"),children:"Session"}),u.jsx("button",{className:`scope-btn ${r==="turngroup"?"active":""}`,onClick:()=>o("turngroup"),children:"Current Turn"})]}),f.length===0?u.jsx("div",{className:"empty-state",children:"No file changes in this scope"}):u.jsxs("div",{className:"right-section",children:[u.jsxs("div",{className:"right-section-title",children:["Changed Files (",f.length,")"]}),f.map(h=>{const m=h.kind==="add"?"fc-add":h.kind==="delete"?"fc-del":"fc-mod",g=h.kind==="add"?"A":h.kind==="delete"?"D":"M",y=h.path.split("/").pop()||h.path,k=h.path.replace("/"+y,"");return u.jsxs("div",{className:"file-change clickable",onClick:()=>a(h.path),children:[u.jsx("span",{className:`fc-status ${m}`,children:g}),u.jsxs("span",{className:"fc-name",children:[k&&u.jsxs("span",{style:{color:"var(--text-muted)"},children:[k,"/"]}),y]})]},h.path)})]})]})}const zh=2e4;function Nk(n){const r=[];return n.forEach((o,l)=>{var a;for(const c of o.items)if(c.type==="background_task"){if((((a=c.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;r.push({item:c,turnIndex:l,turnPrompt:o.user_prompt})}}),r}function Ck({entry:n}){const{item:r,turnIndex:o,turnPrompt:l}=n,a=r.data||{},c=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",m=a.status||"running",g=a.summary||null,y=a.last_tool_name||null,k=a.token_count||null,x=a.output||"",C=r.status==="in_progress",D=c==="local_agent",E=c==="local_bash",N=D?cu:E?pm:um,M=D?`Subagent${f?`: ${f}`:""}`:E?"Monitor":"Background Task",j=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,H=r.status==="failed"||m==="failed",[P,V]=w.useState(C),[ee,q]=w.useState(!1),B=w.useRef(null);w.useEffect(()=>{C&&V(!0)},[C]),w.useEffect(()=>{P&&C&&B.current&&(B.current.scrollTop=B.current.scrollHeight)},[P,C,x]);const oe=x.length>zh,ae=oe&&!ee?x.slice(0,zh)+`
412
+ … (truncated, click to expand)`:x,ce=C?null:m==="completed"?u.jsx(Yr,{size:12}):H?u.jsx(Ou,{size:12}):u.jsx(ii,{size:12});return u.jsxs("div",{className:`task-card ${C?"task-running":""} ${H?"task-failed":""}`,children:[u.jsxs("div",{className:"task-card-header",onClick:()=>V(Pe=>!Pe),style:{cursor:"pointer"},children:[u.jsx("span",{className:"task-card-icon",children:u.jsx(N,{size:14})}),u.jsx("span",{className:"task-card-type",children:M}),u.jsxs("span",{className:`task-card-status ${H?"task-status-failed":C?"task-status-running":"task-status-done"}`,children:[ce," ",j]}),u.jsx(Pu,{size:14,className:"task-card-chevron",style:{transform:P?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&u.jsx("div",{className:"task-card-desc",children:h}),C&&y&&u.jsxs("div",{className:"task-card-meta",children:["last tool: ",y,k!=null&&` · ${k.toLocaleString()} tokens`]}),P&&u.jsxs("div",{className:"task-card-body",children:[x?u.jsxs(u.Fragment,{children:[u.jsx("pre",{className:"cmd-output task-output",ref:B,children:u.jsx("code",{children:ae})}),oe&&u.jsx("button",{className:"cmd-output-toggle",onClick:()=>q(Pe=>!Pe),children:ee?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):g?u.jsx("pre",{className:"cmd-output task-output",children:u.jsx("code",{children:g})}):C?u.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):u.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),u.jsxs("div",{className:"task-card-context",title:l,children:["from turn ",o+1,": ",l.length>60?l.slice(0,60)+"…":l]})]})]})}const bk=w.memo(Ck);function Ek(){var h,m;const n=F(g=>g.activeSessionId?g.sessionDetails[g.activeSessionId]:null),r=(n==null?void 0:n.turns)??[],o=(n==null?void 0:n.backgroundTasks)??[],l=Nk(r),a=[...l].sort((g,y)=>{const k=g.item.status==="in_progress",x=y.item.status==="in_progress";return k&&!x?-1:!k&&x?1:y.turnIndex-g.turnIndex}),c=new Map;for(const g of o)g.task_type==="local_bash"&&c.set(g.task_id,g.task_type);for(const g of l)if(g.item.status==="in_progress"){const y=((h=g.item.data)==null?void 0:h.task_id)??g.item.external_item_id,k=((m=g.item.data)==null?void 0:m.task_type)??"unknown";c.set(y,k)}const f=[...c.values()].filter(g=>g==="local_bash").length;return l.length===0?u.jsx("div",{className:"empty-state",children:"No background tasks yet"}):u.jsxs("div",{className:"right-section",children:[u.jsxs("div",{className:"right-section-title",children:["Background Tasks (",l.length,")",f>0&&u.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",f," running"]})]}),a.map(g=>u.jsx(bk,{entry:g},g.item.id))]})}const _k=w.memo(Ek);function Rk({thread:n,onClose:r}){const{activeSessionId:o,resolveThread:l,shareThread:a}=F(),[c,f]=w.useState(""),[h,m]=w.useState(!1),[g,y]=w.useState(!1);async function k(){if(!o||h)return;m(!0),await a(o,n.id,c)?r():m(!1)}async function x(){!o||g||(y(!0),await l(o,n.id),r())}const C=h||g;return u.jsx("div",{className:"dialog-overlay",onClick:C?void 0:r,children:u.jsxs("div",{className:"dialog",onClick:D=>D.stopPropagation(),children:[u.jsxs("div",{className:"dialog-header",children:[u.jsx("span",{className:"dialog-title",children:"Resolve thread"}),u.jsx("button",{className:"dialog-close",onClick:r,disabled:C,children:u.jsx(ir,{size:16})})]}),u.jsxs("div",{className:"dialog-body",children:[u.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),u.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",u.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:c,onChange:D=>f(D.target.value),rows:3,disabled:C,autoFocus:!0})]})]}),u.jsxs("div",{className:"dialog-footer",children:[u.jsx("button",{className:"dialog-btn-cancel",onClick:r,disabled:C,children:"Cancel"}),u.jsxs("button",{className:"dialog-btn-cancel",onClick:x,disabled:C,title:"Resolve without sharing",children:[g?u.jsx(Kn,{size:13,className:"spin"}):u.jsx(zu,{size:13}),"Resolve only"]}),u.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:C,children:[h?u.jsx(Kn,{size:13,className:"spin"}):u.jsx(N0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const $h=[];Be.setOptions({breaks:!0,gfm:!0});function jk(n){const r=Be.parse(n);return td.sanitize(r)}function Dk(n){var r,o,l;if(n.type==="agent_message"||n.type==="final_result"){const a=(r=n.data)==null?void 0:r.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((o=n.data)==null?void 0:o.groups)?n.data.groups:[],c=[(l=n.data)==null?void 0:l.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return c.length?c.join(`
413
+
414
+ `):null}return null}function Ik(n){const r=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return r?r[1]:n}function Mk({turn:n}){const r=Ik(n.user_prompt),o=n.items.map(Dk).filter(l=>l!==null);return o.length===0&&n.status==="completed"&&n.agent_response&&o.push(n.agent_response),u.jsxs("div",{className:"thread-card-turn",children:[u.jsx("div",{className:"thread-card-user-message",children:r}),o.map((l,a)=>u.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:jk(l)}},a)),o.length===0&&(n.status==="pending"||n.status==="running")&&u.jsx("div",{className:"thread-card-pending",children:n.status==="running"?"AI is responding…":"Waiting…"}),n.status==="failed"&&u.jsx("div",{className:"thread-card-pending",children:n.error||"Turn failed"})]})}function Ak({thread:n,threadTurns:r,onStop:o,onResolve:l,onReopen:a,onDelete:c,onFollowup:f,onLocate:h}){var _e,Oe,Q;const[m,g]=w.useState(""),[y,k]=w.useState(!0),x=w.useRef(null),C=w.useRef(null),[D,E]=w.useState(!1),[N,M]=w.useState({x:0,y:0}),[j,H]=w.useState(""),P=r.some(ro),V=28,ee=120,q=w.useRef(V);w.useEffect(()=>{const te=C.current;te&&(te.scrollTop=te.scrollHeight)},[r.length,y]);function B(te){const ne=x.current;ne&&(ne.style.height=`${te}px`,q.current=te)}function oe(){const te=x.current;if(te){if(te.scrollHeight>te.clientHeight){const ne=Math.min(te.scrollHeight,ee);ne!==q.current&&B(ne);return}q.current>V&&(te.style.height="auto",B(Math.min(te.scrollHeight,ee)))}}const ae=w.useCallback(()=>{E(!1)},[]),ce=w.useCallback(()=>{const te=C.current;if(!te)return;const ne=window.getSelection();if(!ne||ne.rangeCount===0||ne.isCollapsed){E(!1);return}const G=ne.getRangeAt(0);if(!te.contains(G.commonAncestorContainer)){E(!1);return}const Z=G.commonAncestorContainer.nodeType===Node.TEXT_NODE?G.commonAncestorContainer.parentElement:G.commonAncestorContainer;if(!(Z!=null&&Z.closest(".thread-card-ai-response"))){E(!1);return}const W=ne.toString();if(!W.trim()){E(!1);return}const b=G.getBoundingClientRect(),I=28,ie=6,de=170;let ge=!1;if(ne.anchorNode&&ne.focusNode)try{const Te=document.createRange();Te.setStart(ne.focusNode,ne.focusOffset),Te.setEnd(ne.focusNode,ne.focusOffset);const je=document.createRange();je.setStart(ne.anchorNode,ne.anchorOffset),je.setEnd(ne.anchorNode,ne.anchorOffset),ge=je.compareBoundaryPoints(Range.START_TO_START,Te)>0}catch{ge=!1}let we=b.top-I-ie;we<8&&(we=b.bottom+ie);let Le=ge?b.left-de:b.right;Le=Math.max(8,Math.min(Le,window.innerWidth-de-8)),M({x:Le,y:we}),H(W),E(!0)},[]);w.useEffect(()=>{function te(ne){const G=ne.target;G&&G.closest(".selection-actions")||ce()}return document.addEventListener("mouseup",te),()=>document.removeEventListener("mouseup",te)},[ce]);const Pe=w.useCallback(()=>{var ne;const te=`
415
+ \`\`\`QUOTE
416
+ ${j}
417
+ \`\`\`
418
+
419
+ `;g(G=>G+te),E(!1),H(""),(ne=window.getSelection())==null||ne.removeAllRanges(),setTimeout(()=>{if(x.current){oe(),x.current.focus();const G=x.current.value.length;x.current.setSelectionRange(G,G)}},0)},[j]);return u.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[u.jsxs("div",{className:"thread-card-header",onClick:()=>k(te=>!te),children:[u.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Oe=(_e=n.turns)==null?void 0:_e[0])==null?void 0:Oe.user_prompt)==null?void 0:Q.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),u.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&u.jsx("button",{className:"thread-locate-btn",onClick:te=>{te.stopPropagation(),h()},title:"Scroll to text",children:u.jsx(x0,{size:12})}),u.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),y&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"thread-card-conversation",ref:C,onMouseDown:ae,children:[r.map(te=>u.jsx(Mk,{turn:te},te.id)),r.length===0&&u.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),D&&u.jsx("div",{className:"selection-actions",style:{left:N.x,top:N.y},children:u.jsxs("button",{className:"discuss-button",onClick:Pe,title:"Quote this text in your follow-up",children:[u.jsx(fm,{size:14}),u.jsx("span",{children:"Quote"})]})}),n.status==="open"&&u.jsxs("div",{className:"thread-card-followup",children:[u.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:P?"Agent is running…":"Type a follow-up…",value:m,onChange:te=>{Gt.markInputChange(),g(te.target.value),oe()},disabled:P,rows:1,style:{minHeight:V,maxHeight:ee},onKeyDown:te=>{Gt.markKeystroke(),te.key==="Enter"&&(te.metaKey||te.ctrlKey)&&!P&&m.trim()&&(te.preventDefault(),f(m.trim()),g(""),B(V))}}),u.jsx("button",{className:"thread-card-followup-send",disabled:P||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:u.jsx(Ql,{size:13})}),P&&u.jsx("button",{className:"thread-card-followup-stop",onClick:o,title:"Stop this thread's turn (Esc)",children:u.jsx(ii,{size:13})})]}),u.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?u.jsxs("button",{className:"thread-action-btn",onClick:l,title:"Resolve thread",children:[u.jsx(zu,{size:13})," Resolve"]}):u.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[u.jsx(Yl,{size:13})," Reopen"]}),u.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:c,title:"Delete thread",children:[u.jsx(vs,{size:13})," Delete"]})]})]})]})}function Lk(){Gt.trackRender("ThreadsPanel");const n=F(j=>j.activeSessionId),r=F(j=>{var H;return j.activeSessionId?((H=j.sessionDetails[j.activeSessionId])==null?void 0:H.threads)??$h:$h}),o=F(j=>j.followupThread),l=F(j=>j.cancelThreadTurn),a=F(j=>j.reopenThread),c=F(j=>j.deleteThread),f=F(j=>j.activeRightTab),h=F(j=>j.switchRightTab),m=F(j=>j.deepLinkThreadId),g=F(j=>j.setDeepLinkThreadId),[y,k]=w.useState("open"),[x,C]=w.useState(null);w.useEffect(()=>{if(!m)return;const j=m;g(null),k(P=>r.some(V=>V.id===j&&V.status==="open")?P:"all");const H=setTimeout(()=>{const P=document.getElementById(`thread-${j}`);P&&(P.scrollIntoView({behavior:"smooth",block:"center"}),P.classList.add("thread-card-highlighted"),setTimeout(()=>P.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(H)},[m,g,r]);const D=r.filter(j=>y==="open"?j.status==="open":y==="resolved"?j.status==="resolved":!0),E=r.filter(j=>j.status==="open").length,N=r.filter(j=>j.status==="resolved").length;function M(j){f==="changes"&&h("turns"),setTimeout(()=>{const H=document.querySelector(`mark[data-thread-id="${j}"]`);H&&(H.scrollIntoView({behavior:"smooth",block:"center"}),H.classList.add("thread-mark-flash"),setTimeout(()=>H.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?r.length===0?u.jsxs("div",{className:"empty-state",children:[u.jsx(v0,{size:24,style:{opacity:.3,marginBottom:8}}),u.jsx("div",{children:"No threads yet."}),u.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):u.jsxs("div",{children:[u.jsxs("div",{className:"thread-filter-tabs",children:[u.jsxs("button",{className:`thread-filter-tab ${y==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",E,")"]}),u.jsxs("button",{className:`thread-filter-tab ${y==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",N,")"]}),u.jsxs("button",{className:`thread-filter-tab ${y==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",r.length,")"]})]}),D.length===0?u.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",y," threads."]}):D.map(j=>u.jsx(Ak,{thread:j,threadTurns:j.turns??[],onStop:()=>l(n,j.id),onResolve:()=>C(j),onReopen:()=>a(n,j.id),onDelete:()=>c(n,j.id),onFollowup:H=>o(n,j.id,H),onLocate:()=>M(j.id)},j.id)),x&&u.jsx(Rk,{thread:x,onClose:()=>C(null)})]}):u.jsx("div",{className:"empty-state",children:"No session selected"})}function Pk(){var f,h;Gt.trackRender("RightPanel");const n=F(m=>m.activeRightTab),r=F(m=>m.switchRightTab),o=F(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),l=((f=o==null?void 0:o.backgroundTasks)==null?void 0:f.length)??0,a=((h=o==null?void 0:o.threads)==null?void 0:h.filter(m=>m.status==="open").length)??0,c=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:l||void 0},{id:"threads",label:"Threads",badge:a||void 0}];return u.jsxs("div",{className:"ide-right",children:[u.jsx("div",{className:"right-tabs",children:c.map(m=>u.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?u.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),u.jsxs("div",{className:"right-content",children:[n==="turns"&&u.jsx(Sk,{}),n==="changes"&&u.jsx(Tk,{}),n==="tasks"&&u.jsx(_k,{}),n==="threads"&&u.jsx(Lk,{})]})]})}const Ne={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"}},Su=[{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:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]}]}];function Ok(n){return Su.find(r=>r.id===n)}function nd(n){const r=Ok(n);return(r==null?void 0:r.models)??[]}function ig(n,r){return nd(n).find(o=>o.slug===r)}function Tu(n,r){var o;return((o=ig(n,r))==null?void 0:o.reasoningLevels)??[]}function Nu(n,r){var o;return(o=ig(n,r))==null?void 0:o.defaultReasoning}function zk(){const{activeSessionId:n,sessions:r,updateModelConfig:o}=F(),l=F(Q=>Q.showModelSelector),a=F(Q=>Q.setShowModelSelector),c=r.find(Q=>Q.id===n),f=F(Q=>Q.models),h=F(Q=>Q.modelsLoading),m=F(Q=>Q.loadModels),[g,y]=w.useState(!1),k=w.useRef(null);if(Xl(k,()=>y(!1),g),Au(()=>y(!1),g),w.useEffect(()=>{l&&(y(!0),a(!1))},[l,a]),w.useEffect(()=>{c!=null&&c.runtime_type&&m(c.runtime_type,c.cwd??void 0)},[c==null?void 0:c.runtime_type,c==null?void 0:c.cwd,m]),!c)return null;const x=c.runtime_type,C=c.model??"",D=c.model_reasoning_effort??"",E=f.length>0?f:[],N=nd(x),j=[...E.length>0?E:N];if(C&&!j.some(Q=>Q.slug===C)){const Q=N[0];j.unshift({slug:C,displayName:C,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function H(Q){return j.find(te=>te.slug===Q)}function P(Q){var te;return E.length>0?((te=H(Q))==null?void 0:te.reasoningLevels)??[]:Tu(x,Q)}function V(Q){var te;return E.length>0?(te=H(Q))==null?void 0:te.defaultReasoning:Nu(x,Q)}const ee=Su.find(Q=>Q.id===x),q=H(C),B=C?P(C):[],oe=(ee==null?void 0:ee.label)??x,ae=(q==null?void 0:q.displayName)??(C||"Default"),ce=B.find(Q=>Q.effort===D),Pe=(ce==null?void 0:ce.label)??(D||"Default");function _e(Q){var Z;const te=P(Q),G=te.some(W=>W.effort===D)?D:V(Q)??((Z=te[0])==null?void 0:Z.effort)??"";o(Q,G),y(!1)}function Oe(Q){o(C,Q),y(!1)}return u.jsxs("div",{className:"model-selector",ref:k,children:[u.jsxs("button",{className:"model-selector-btn",onClick:()=>y(!g),title:"Change model and thinking level",children:[u.jsx("span",{className:"model-selector-provider",children:oe}),u.jsx("span",{className:"model-selector-sep",children:"›"}),u.jsx("span",{className:"model-selector-model",children:ae}),Pe!=="Default"&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"model-selector-sep",children:"›"}),u.jsx("span",{className:"model-selector-reasoning",children:Pe})]}),u.jsx(ri,{size:12,className:"model-selector-chevron"})]}),g&&u.jsxs("div",{className:"model-selector-popover",children:[u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Su.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.id===x?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===x){y(!1);return}o("","",Q.id)}},children:[u.jsx("span",{children:Q.label}),!Q.available&&u.jsxs("span",{className:"model-selector-coming-soon",children:[u.jsx(m0,{size:10})," Soon"]}),Q.id===x&&u.jsx(Yr,{size:12})]},Q.id))]}),u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&u.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&j.length===0&&u.jsx("div",{className:"model-selector-empty",children:"No models available"}),j.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.slug===C?"selected":""}`,onClick:()=>_e(Q.slug),children:[u.jsxs("div",{className:"model-selector-item-main",children:[u.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),u.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===C&&u.jsx(Yr,{size:12})]},Q.slug))]}),u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),B.length===0&&u.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),B.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.effort===D?"selected":""}`,onClick:()=>Oe(Q.effort),children:[u.jsx("span",{children:Q.label}),Q.effort===D&&u.jsx(Yr,{size:12})]},Q.effort))]})]})]})}function $k(n,r){if(!n||n.turns.length===0)return"—";const o=n.turns[0],l=n.turns[n.turns.length-1],a=r?null:l.updated_at;return Xy(o.created_at,a)}function El(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Fh(){const n=F(o=>o.setShowRemoteModal),r=Eu(window.location.hostname);return u.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[u.jsx(j0,{size:14})," AgentPane",r?` · ${r}`:""]})}function Uh(){const n=F(o=>o.vscodeViewOpen),r=F(o=>o.toggleVscodeView);return u.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[u.jsx(i0,{size:14})," VS Code"]})}function Fk(){var x,C;Gt.trackRender("StatusBar");const n=F(D=>D.activeSessionId),r=F(D=>n?D.sessions.find(E=>E.id===n)??null:null),o=F(D=>n?D.sessionDetails[n]??null:null),l=F(D=>D.wsConnected),a=F(D=>D.switchRightTab),c=(o==null?void 0:o.contextUsage)??null;if(!r)return u.jsxs("div",{className:"ide-statusbar",children:[u.jsx(Fh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(Uh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:[u.jsx("span",{className:`status-dot ${l?"done":"error"}`}),l?"Live":"Offline"]}),u.jsx("div",{className:"sb-spacer"}),u.jsxs("div",{className:"sb-item",children:[u.jsx(Up,{size:14})," K"]})]});const f=Mu(r),h=$k(o,f.isRunning),m=(o==null?void 0:o.backgroundTasks)??[],g=new Set,y=new Map;for(const D of m)g.add(D.task_id),y.set(D.task_id,D.task_type);for(const D of(o==null?void 0:o.turns)??[])for(const E of D.items)if(E.type==="background_task"&&E.status==="in_progress"){const N=((x=E.data)==null?void 0:x.task_id)??E.external_item_id,M=((C=E.data)==null?void 0:C.task_type)??"unknown";g.add(N),y.set(N,M)}const k=[...y.values()].filter(D=>D==="local_bash").length;return u.jsxs("div",{className:"ide-statusbar",children:[u.jsx(Fh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(Uh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(zk,{}),k>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[u.jsx(hm,{size:14})," ",k]})]}),u.jsx("div",{className:"sb-spacer"}),u.jsxs("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:[u.jsx("span",{className:`status-dot ${l?"done":"error"}`}),l?"Live":"Offline"]}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",style:r.status==="failed"?{color:"var(--red)"}:void 0,children:[u.jsx(Lu,{status:f.dot})," ",f.label]}),c&&u.jsx(Uk,{usage:c}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx("div",{className:"sb-item",children:h}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",children:[u.jsx(Up,{size:14})," K"]})]})}function Uk({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",o=`${El(n.totalTokens)} / ${El(n.contextWindow)} tokens`;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx("div",{className:"sb-context",title:o,children:u.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",El(n.totalTokens)," / ",El(n.contextWindow)]})})]})}function Bh(n){return Cr(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function Bk(n){return Ht("/vscode-web/start",{folder:n})}function Wk(n){return Ht("/vscode-web/heartbeat",{id:n})}const Hk=1e3,Vk=5*6e4;function Gk(){const n=F(k=>k.vscodeState),r=F(k=>k.vscodeId),o=F(k=>k.vscodeToken),l=F(k=>k.setVscodeView),a=F(k=>{var C;const x=k.activeSessionId?k.sessions.find(D=>D.id===k.activeSessionId):null;return x!=null&&x.cwd?x.cwd:((C=k.workspaces.find(D=>D.deleted===0))==null?void 0:C.path)??null}),[c,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{let k=!1;function x(){g.current&&(clearInterval(g.current),g.current=null)}async function C(){try{let E=await Bh(a);if((E.state==="stopped"||E.state==="error")&&(E=await Bk(a)),k||(l(E.state,E.id,E.token),E.state==="running"||E.state==="error"))return;g.current=setInterval(async()=>{const N=await Bh(a);k||(l(N.state,N.id,N.token),(N.state==="running"||N.state==="error"||N.state==="stopped")&&x())},Hk)}catch{k||l("error",null,null)}}C();const D=setInterval(()=>{const E=F.getState().vscodeId;E&&Wk(E).catch(()=>{})},Vk);return()=>{k=!0,x(),clearInterval(D)}},[h,a,l]);function y(){f(!1),l("starting",null,null),m(k=>k+1)}return n!=="running"||!o||!r?u.jsx("div",{className:"vscode-view vscode-view--loading",children:n==="error"?u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"VS Code could not start."}),u.jsxs("button",{className:"dialog-btn-cancel",onClick:y,children:[u.jsx(Yl,{size:14})," Retry"]})]}):u.jsxs("span",{className:"vscode-view-hint",children:[u.jsx(Kn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):u.jsxs("div",{className:"vscode-view",children:[!c&&u.jsxs("div",{className:"vscode-view-overlay",children:[u.jsx(Kn,{size:16,className:"spin"})," Loading VS Code…"]}),u.jsx("iframe",{src:`${sr()}/vscode/${r}/?tkn=${o}${a?`&folder=${encodeURIComponent(a)}`:""}`,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]})}function qk({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a}){const[c,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(x=>{const C=x.clientX-h.current,D=n==="left"?m.current+C:m.current-C,E=Math.min(o,Math.max(r,D));a(E)},[n,r,o,a]),y=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(x=>{x.preventDefault(),x.stopPropagation(),h.current=x.clientX,m.current=l(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",y)},[l,g,y]),dragging:c}}function Wh({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a}){const{onPointerDown:c,dragging:f}=qk({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a});return u.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:c,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function Kk(){Gt.trackRender("IdeWorkspace");const n=F(f=>f.sidebarWidth),r=F(f=>f.rightPanelWidth),o=F(f=>f.setSidebarWidth),l=F(f=>f.setRightPanelWidth),a=F(f=>f.vscodeViewOpen);w.useEffect(()=>{const f=()=>{const h=Il(),{rightPanelWidth:m,setRightPanelWidth:g}=F.getState();m>h&&g(h)};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const c=`${n}px 6px 1fr 6px ${r}px`;return u.jsxs("div",{className:"ide-root",children:[u.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:c},children:[u.jsx(bw,{}),u.jsx(Wh,{side:"left",minWidth:iu,maxWidth:lu,getWidth:()=>F.getState().sidebarWidth,setWidth:o}),u.jsxs("div",{className:"ide-center",children:[u.jsx(Ew,{}),u.jsx("div",{className:"ide-render",children:u.jsx(ck,{})}),u.jsx(kk,{})]}),u.jsx(Wh,{side:"right",minWidth:Dl,maxWidth:Il(),getWidth:()=>F.getState().rightPanelWidth,setWidth:l}),u.jsx(Pk,{})]}),a&&u.jsx(Gk,{}),u.jsx(Fk,{})]})}function Xk(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:o,lastModelConfig:l}=F(),a=(l==null?void 0:l.provider)??"codex",c=(l==null?void 0:l.model)??"",f=(l==null?void 0:l.reasoning)??"",[h,m]=w.useState(""),[g,y]=w.useState(c),[k,x]=w.useState(f),[C,D]=w.useState("");if(!n)return null;const E=nd(a),N=g?Tu(a,g):[];function M(){o({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:C.trim()||void 0,runtime_type:a}),m(""),D("")}function j(P){P.key==="Escape"&&r(!1)}function H(P){var q;y(P);const V=Tu(a,P);V.some(B=>B.effort===k)||x(Nu(a,P)??((q=V[0])==null?void 0:q.effort)??"")}return u.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:j,children:[u.jsxs("div",{className:"dialog-header",children:[u.jsx("span",{className:"dialog-title",children:"New Session"}),u.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:u.jsx(ir,{size:16})})]}),u.jsxs("div",{className:"dialog-body",children:[u.jsxs("label",{className:"dialog-label",children:["Title (optional)",u.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:P=>m(P.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),u.jsxs("label",{className:"dialog-label",children:["Model",u.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:P=>H(P.target.value),children:[u.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(P=>u.jsxs("option",{value:P.slug,children:[P.displayName," — ",P.description]},P.slug))]})]}),N.length>0&&u.jsxs("label",{className:"dialog-label",children:["Thinking Level",u.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:P=>x(P.target.value),children:[u.jsxs("option",{value:"",children:["Default (",Nu(a,g),")"]}),N.map(P=>u.jsx("option",{value:P.effort,children:P.label},P.effort))]})]}),u.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",u.jsx("input",{className:"dialog-input",type:"text",value:C,onChange:P=>D(P.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),u.jsxs("div",{className:"dialog-footer",children:[u.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),u.jsx("button",{className:"dialog-btn-create",onClick:M,children:"Create"})]})]})})}function Yk(){const n=F(k=>k.showCommandPalette),r=F(k=>k.setShowCommandPalette),o=F(),[l,a]=w.useState(""),[c,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=o.activeSessionId?o.sessionDetails[o.activeSessionId]:null,x=Kl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Xo,action:()=>o.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:vs,action:()=>{o.activeSessionId&&o.deleteSession(o.activeSessionId)},available:!!o.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Ql,action:()=>{const C=document.querySelector(".cmd-input");C==null||C.focus()},available:!!o.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:ii,action:()=>o.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:h0,action:()=>o.switchRightTab("turns"),available:!!o.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:a0,action:()=>o.switchRightTab("changes"),available:!!o.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:ir,action:()=>{o.activeSessionId&&o.closeTab(o.activeSessionId)},available:!!o.activeSessionId}]},[o]),g=w.useMemo(()=>{const k=l.toLowerCase().trim(),x=m.filter(C=>C.available);return k?x.filter(C=>C.label.toLowerCase().includes(k)||C.hint.toLowerCase().includes(k)):x},[m,l]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function y(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(x=>Math.max(x-1,0));else if(k.key==="Enter"){k.preventDefault();const x=g[c];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?u.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[u.jsxs("div",{className:"palette-search",children:[u.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:l,onChange:k=>{a(k.target.value),f(0)},onKeyDown:y}),u.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?u.jsx("div",{className:"palette-empty",children:"No matching commands"}):u.jsx("div",{className:"palette-list",children:g.map((k,x)=>{const C=k.icon;return u.jsxs("div",{className:`palette-item ${x===c?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[u.jsx("span",{className:"palette-item-icon",children:u.jsx(C,{size:16})}),u.jsx("span",{className:"palette-item-label",children:k.label}),u.jsx("span",{className:"palette-item-hint",children:k.hint}),x===c&&u.jsx(l0,{size:12,className:"palette-item-enter"})]},k.id)})}),u.jsxs("div",{className:"palette-footer",children:[u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"↑"}),u.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"↵"})," Select"]}),u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Hh=/^[a-z][a-z0-9-]{1,30}$/,Qk=2e3;function Zk(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:o}=F(),[l,a]=w.useState(null),[c,f]=w.useState(null),[h,m]=w.useState(!1),[g,y]=w.useState(!1),[k,x]=w.useState(!1),[C,D]=w.useState(!1),[E,N]=w.useState("main"),[M,j]=w.useState(""),[H,P]=w.useState(!1),[V,ee]=w.useState(null),q=w.useRef(null);Xl(q,()=>D(!1),C);const B=g||k,oe=w.useCallback(async()=>{m(!0),f(null);try{const G=await fetch(`${sr()}/remote/status`,{headers:{Accept:"application/json"}});if(!G.ok)throw new Error(`status ${G.status}`);a(await G.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(N("main"),ee(null),oe())},[n,oe]);const ae=V!==null&&V.state==="running";if(w.useEffect(()=>{if(!ae)return;const G=setInterval(async()=>{try{const Z=await fetch(`${sr()}/remote/enable`,{headers:{Accept:"application/json"}});Z.ok&&ee(await Z.json())}catch{}},Qk);return()=>clearInterval(G)},[ae]),!n)return null;const ce=!!(l!=null&&l.tunnel.provisioned)&&!!(l!=null&&l.service.running)&&!!(l!=null&&l.connection.ok);function Pe(G){G.key==="Escape"&&r(!1)}async function _e(G){if(Hh.test(G)){P(!0);try{const Z=await fetch(`${sr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:G})});if(!Z.ok)throw new Error(`enable ${Z.status}`);ee(await Z.json()),N("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{P(!1)}}}function Oe(){V!=null&&V.troubleshootingSessionId&&(o(V.troubleshootingSessionId),r(!1))}async function Q(){y(!0);try{await fetch(`${sr()}/remote/disable`,{method:"POST"}),await oe()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{y(!1)}}async function te(){if(D(!1),!!window.confirm(`Remove the tunnel completely?
420
+
421
+ This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
422
+
423
+ This cannot be undone.`)){x(!0);try{const Z=await fetch(`${sr()}/remote/uninstall`,{method:"DELETE"});if(!Z.ok)throw new Error(`uninstall ${Z.status}`);await oe()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function ne(){if(!V)return u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",u.jsx("input",{className:"dialog-input",value:M,onChange:b=>j(b.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),u.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),u.jsxs("div",{className:"dialog-footer",children:[u.jsx("button",{className:"dialog-btn-cancel",onClick:()=>N("main"),children:"Back"}),u.jsxs("button",{className:"dialog-btn-create",disabled:!Hh.test(M)||H,onClick:()=>void _e(M),children:[H?u.jsx(Kn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const G=["detect","provision","install","verify","ready"],Z=G.indexOf(V.step),W=V.state==="ready";return u.jsxs(u.Fragment,{children:[V.state==="running"&&u.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[u.jsx(Kn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),V.state==="ready"&&u.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[u.jsx(Yr,{size:14})," Setup complete — you can close this window."]}),V.state==="ready"&&V.hostname&&u.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",u.jsx("a",{href:`https://${V.hostname}`,target:"_blank",rel:"noreferrer",children:V.hostname})]}),u.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:G.map((b,I)=>{const ie=W||Z>-1&&I<Z,de=!W&&I===Z&&V.state==="running";return u.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:ie||de?1:.4,color:ie?"var(--green)":void 0},children:[ie?u.jsx(Yr,{size:13}):de?u.jsx(Kn,{size:13,className:"spin"}):u.jsx(o0,{size:9,style:{marginLeft:2,marginRight:2}}),b]},b)})}),V.logs.length>0&&u.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:V.logs.slice(-3).map(b=>b.message).join(`
424
+ `)}),V.state==="troubleshooting"&&u.jsxs(u.Fragment,{children:[u.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."}),u.jsx("div",{className:"dialog-footer",children:u.jsx("button",{className:"dialog-btn-create",onClick:Oe,children:"Open troubleshooting session"})})]}),V.state==="failed"&&u.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",V.error]}),u.jsx("div",{className:"dialog-footer",children:u.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void oe(),children:"Refresh status"})})]})}return u.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"dialog",onClick:G=>G.stopPropagation(),onKeyDown:Pe,children:[u.jsxs("div",{className:"dialog-header",children:[u.jsx("span",{className:"dialog-title",children:"Remote Access"}),u.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:u.jsx(ir,{size:16})})]}),u.jsxs("div",{className:"dialog-body",children:[h&&u.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[u.jsx(Kn,{size:14,className:"spin"})," Loading machine status…"]}),c&&u.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:c}),E==="setup"?ne():u.jsxs(u.Fragment,{children:[ce&&(l==null?void 0:l.tunnel.hostname)&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",u.jsx("a",{href:`https://${l.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:l.tunnel.hostname})]}),u.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[u.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void Q(),disabled:B,children:[g?u.jsx(Kn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),u.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>D(G=>!G),disabled:B,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":C,children:k?u.jsx(Kn,{size:14,className:"spin"}):u.jsx(ri,{size:14})}),C&&u.jsx("div",{ref:q,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:u.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void te(),children:[u.jsx(vs,{size:12})," Remove tunnel"]})})]})]}),!ce&&u.jsx(u.Fragment,{children:l!=null&&l.tunnel.provisioned&&l.tunnel.mahlas&&l.tunnel.hostname?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",u.jsx("a",{href:`https://${l.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:l.tunnel.hostname})," ","but the connection is stopped."]}),u.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void _e(l.tunnel.mahlas),disabled:H,children:[H?u.jsx(Kn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):u.jsx(Bp,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>N("setup"),children:[u.jsx(Bp,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),u.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const Jk={success:r0,error:Ou,info:d0,warn:b0},eS=4e3;function tS({toast:n}){const r=F(f=>f.removeToast),o=Jk[n.type],l=w.useRef(null);w.useEffect(()=>{function f(){l.current=setTimeout(()=>r(n.id),eS)}return f(),()=>{l.current&&clearTimeout(l.current)}},[n.id,r]);function a(){l.current&&(clearTimeout(l.current),l.current=null)}function c(){l.current=setTimeout(()=>r(n.id),2e3)}return u.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:c,children:[u.jsx(o,{size:16}),u.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&u.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),r(n.id)},children:[u.jsx(E0,{size:12})," ",n.undoLabel||"Undo"]}),u.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:u.jsx(ir,{size:14})})]})}function nS(){const n=F(r=>r.toasts);return n.length===0?null:u.jsx("div",{className:"toast-container",children:n.map(r=>u.jsx(tS,{toast:r},r.id))})}let Pn=null,no=null,ei=1e3;const rS=1e4;function sS(){const n=sr();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Cu(){Pn&&(Pn.readyState===WebSocket.OPEN||Pn.readyState===WebSocket.CONNECTING)||(Pn=new WebSocket(sS()),Pn.onopen=()=>{const n=ei>1e3;if(ei=1e3,F.getState().setWsConnected(!0),F.getState().addLogEntry("INFO","WebSocket connected"),n){const r=F.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},Pn.onclose=()=>{F.getState().setWsConnected(!1),F.getState().addLogEntry("WARN","WebSocket disconnected"),F.getState().addToast("warn","WebSocket disconnected — reconnecting…"),iS()},Pn.onerror=()=>{},Pn.onmessage=n=>{try{const r=JSON.parse(n.data);Gt.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const o=lS[r.event];o&&o(r.data)}catch{}})}function oS(){no&&(clearTimeout(no),no=null),Pn&&(Pn.onclose=null,Pn.close(),Pn=null),F.getState().setWsConnected(!1)}function iS(){no||(no=window.setTimeout(()=>{no=null,Cu()},ei),ei=Math.min(ei*2,rS))}const lS={"turn:started":n=>{const r=n;Gt.note(`turn:started — ${r.turnId.slice(0,8)}`),F.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;F.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;F.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;F.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;F.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;Gt.note(`turn:completed — ${r.turnId.slice(0,8)}`),F.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;F.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,o={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage};F.getState().onContextUsageUpdated(r.sessionId,o)},"turn:failed":n=>{const r=n;F.getState().onTurnFailed(r.sessionId,r.turnId,r.error)},"turn:cancelled":n=>{const r=n;F.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;F.getState().onSessionTitle(r.sessionId,r.title)},background_tasks:n=>{const r=n;Gt.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(o=>o.task_type).join(", ")||"none"})`),F.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"thread:created":n=>{const r=n;F.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;F.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;F.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;F.getState().onThreadDeleted(r.sessionId,r.threadId)}};function aS(){const n=F(r=>r.init);return w.useEffect(()=>{oy(),n(),Cu();function r(){if(document.visibilityState!=="visible")return;const o=F.getState(),l=o.activeSessionId;if(!l)return;const a=o.sessionDetails[l];o.wsConnected||Cu(),a&&a.is_running===1&&(o.refreshActiveSession(),o.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",r),()=>{oS(),document.removeEventListener("visibilitychange",r)}},[n]),null}function cS(){const n=F(a=>a.loading),r=F(a=>a.error),o=F(a=>a.sessions),l=F(a=>a.setShowCommandPalette);return w.useEffect(()=>Gt.start(),[]),w.useEffect(()=>{function a(c){(c.metaKey||c.ctrlKey)&&c.key==="k"&&(c.preventDefault(),l(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[l]),u.jsxs(u.Fragment,{children:[u.jsx(aS,{}),n&&o.length===0?u.jsx("div",{className:"empty-state",children:"Loading sessions…"}):r&&o.length===0?u.jsxs("div",{className:"empty-state",children:["Error: ",r]}):u.jsxs(u.Fragment,{children:[u.jsx(Kk,{}),u.jsx(Xk,{}),u.jsx(Zk,{}),u.jsx(Yk,{}),u.jsx(nS,{})]})]})}Xv.createRoot(document.getElementById("root")).render(u.jsx(rt.StrictMode,{children:u.jsx(cS,{})}));