repoburg 1.3.269 → 1.3.270
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-pane/frontend/dist/assets/{index-BaBO6I13.js → index-CcL4MDxZ.js} +86 -81
- package/agent-pane/frontend/dist/assets/index-Cr-XES2b.css +1 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/tabtape/extension/dist/build-info.json +3 -3
- package/tabtape/extension/dist/manifest.json +1 -1
- package/tabtape/ui/dist/build-info.json +3 -3
- package/agent-pane/frontend/dist/assets/index-K4hE7q_n.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ly=Object.defineProperty;var Py=(n,r,s)=>r in n?Ly(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var lt=(n,r,s)=>Py(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function Im(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var eu={exports:{}},Ji={},tu={exports:{}},We={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var My=Object.defineProperty;var Ly=(n,r,s)=>r in n?My(n,r,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Wp;function
|
|
9
|
+
*/var Wp;function Oy(){if(Wp)return We;Wp=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=k&&j[k]||j["@@iterator"],typeof j=="function"?j:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function T(j,L,ce){this.props=j,this.context=L,this.refs=C,this.updater=ce||b}T.prototype.isReactComponent={},T.prototype.setState=function(j,L){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,L,"setState")},T.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function I(){}I.prototype=T.prototype;function A(j,L,ce){this.props=j,this.context=L,this.refs=C,this.updater=ce||b}var B=A.prototype=new I;B.constructor=A,E(B,T.prototype),B.isPureReactComponent=!0;var $=Array.isArray,W=Object.prototype.hasOwnProperty,Y={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function K(j,L,ce){var q,le={},fe=null,Pe=null;if(L!=null)for(q in L.ref!==void 0&&(Pe=L.ref),L.key!==void 0&&(fe=""+L.key),L)W.call(L,q)&&!G.hasOwnProperty(q)&&(le[q]=L[q]);var Ce=arguments.length-2;if(Ce===1)le.children=ce;else if(1<Ce){for(var je=Array(Ce),_e=0;_e<Ce;_e++)je[_e]=arguments[_e+2];le.children=je}if(j&&j.defaultProps)for(q in Ce=j.defaultProps,Ce)le[q]===void 0&&(le[q]=Ce[q]);return{$$typeof:n,type:j,key:fe,ref:Pe,props:le,_owner:Y.current}}function ue(j,L){return{$$typeof:n,type:j.type,key:L,ref:j.ref,props:j.props,_owner:j._owner}}function ge(j){return typeof j=="object"&&j!==null&&j.$$typeof===n}function de(j){var L={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ce){return L[ce]})}var pe=/\/+/g;function ve(j,L){return typeof j=="object"&&j!==null&&j.key!=null?de(""+j.key):L.toString(36)}function Me(j,L,ce,q,le){var fe=typeof j;(fe==="undefined"||fe==="boolean")&&(j=null);var Pe=!1;if(j===null)Pe=!0;else switch(fe){case"string":case"number":Pe=!0;break;case"object":switch(j.$$typeof){case n:case r:Pe=!0}}if(Pe)return Pe=j,le=le(Pe),j=q===""?"."+ve(Pe,0):q,$(le)?(ce="",j!=null&&(ce=j.replace(pe,"$&/")+"/"),Me(le,L,ce,"",function(_e){return _e})):le!=null&&(ge(le)&&(le=ue(le,ce+(!le.key||Pe&&Pe.key===le.key?"":(""+le.key).replace(pe,"$&/")+"/")+j)),L.push(le)),1;if(Pe=0,q=q===""?".":q+":",$(j))for(var Ce=0;Ce<j.length;Ce++){fe=j[Ce];var je=q+ve(fe,Ce);Pe+=Me(fe,L,ce,je,le)}else if(je=x(j),typeof je=="function")for(j=je.call(j),Ce=0;!(fe=j.next()).done;)fe=fe.value,je=q+ve(fe,Ce++),Pe+=Me(fe,L,ce,je,le);else if(fe==="object")throw L=String(j),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return Pe}function ee(j,L,ce){if(j==null)return j;var q=[],le=0;return Me(j,q,"","",function(fe){return L.call(ce,fe,le++)}),q}function re(j){if(j._status===-1){var L=j._result;L=L(),L.then(function(ce){(j._status===0||j._status===-1)&&(j._status=1,j._result=ce)},function(ce){(j._status===0||j._status===-1)&&(j._status=2,j._result=ce)}),j._status===-1&&(j._status=0,j._result=L)}if(j._status===1)return j._result.default;throw j._result}var ae={current:null},z={transition:null},X={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:z,ReactCurrentOwner:Y};function V(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:ee,forEach:function(j,L,ce){ee(j,function(){L.apply(this,arguments)},ce)},count:function(j){var L=0;return ee(j,function(){L++}),L},toArray:function(j){return ee(j,function(L){return L})||[]},only:function(j){if(!ge(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},We.Component=T,We.Fragment=s,We.Profiler=a,We.PureComponent=A,We.StrictMode=o,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,We.act=V,We.cloneElement=function(j,L,ce){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var q=E({},j.props),le=j.key,fe=j.ref,Pe=j._owner;if(L!=null){if(L.ref!==void 0&&(fe=L.ref,Pe=Y.current),L.key!==void 0&&(le=""+L.key),j.type&&j.type.defaultProps)var Ce=j.type.defaultProps;for(je in L)W.call(L,je)&&!G.hasOwnProperty(je)&&(q[je]=L[je]===void 0&&Ce!==void 0?Ce[je]:L[je])}var je=arguments.length-2;if(je===1)q.children=ce;else if(1<je){Ce=Array(je);for(var _e=0;_e<je;_e++)Ce[_e]=arguments[_e+2];q.children=Ce}return{$$typeof:n,type:j.type,key:le,ref:fe,props:q,_owner:Pe}},We.createContext=function(j){return j={$$typeof:f,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:u,_context:j},j.Consumer=j},We.createElement=K,We.createFactory=function(j){var L=K.bind(null,j);return L.type=j,L},We.createRef=function(){return{current:null}},We.forwardRef=function(j){return{$$typeof:h,render:j}},We.isValidElement=ge,We.lazy=function(j){return{$$typeof:v,_payload:{_status:-1,_result:j},_init:re}},We.memo=function(j,L){return{$$typeof:m,type:j,compare:L===void 0?null:L}},We.startTransition=function(j){var L=z.transition;z.transition={};try{j()}finally{z.transition=L}},We.unstable_act=V,We.useCallback=function(j,L){return ae.current.useCallback(j,L)},We.useContext=function(j){return ae.current.useContext(j)},We.useDebugValue=function(){},We.useDeferredValue=function(j){return ae.current.useDeferredValue(j)},We.useEffect=function(j,L){return ae.current.useEffect(j,L)},We.useId=function(){return ae.current.useId()},We.useImperativeHandle=function(j,L,ce){return ae.current.useImperativeHandle(j,L,ce)},We.useInsertionEffect=function(j,L){return ae.current.useInsertionEffect(j,L)},We.useLayoutEffect=function(j,L){return ae.current.useLayoutEffect(j,L)},We.useMemo=function(j,L){return ae.current.useMemo(j,L)},We.useReducer=function(j,L,ce){return ae.current.useReducer(j,L,ce)},We.useRef=function(j){return ae.current.useRef(j)},We.useState=function(j){return ae.current.useState(j)},We.useSyncExternalStore=function(j,L,ce){return ae.current.useSyncExternalStore(j,L,ce)},We.useTransition=function(){return ae.current.useTransition()},We.version="18.3.1",We}var Hp;function qu(){return Hp||(Hp=1,tu.exports=Oy()),tu.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var My=Object.defineProperty;var Ly=(n,r,s)=>r in n?My(n,r,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Vp;function
|
|
17
|
+
*/var Vp;function zy(){if(Vp)return Ji;Vp=1;var n=qu(),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,g,m){var v,k={},x=null,b=null;m!==void 0&&(x=""+m),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(b=g.ref);for(v in g)o.call(g,v)&&!u.hasOwnProperty(v)&&(k[v]=g[v]);if(h&&h.defaultProps)for(v in g=h.defaultProps,g)k[v]===void 0&&(k[v]=g[v]);return{$$typeof:r,type:h,key:x,ref:b,props:k,_owner:a.current}}return Ji.Fragment=s,Ji.jsx=f,Ji.jsxs=f,Ji}var qp;function $y(){return qp||(qp=1,eu.exports=zy()),eu.exports}var c=$y(),w=qu();const st=Im(w);var Ra={},nu={exports:{}},Cn={},ru={exports:{}},su={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var My=Object.defineProperty;var Ly=(n,r,s)=>r in n?My(n,r,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Gp;function
|
|
25
|
+
*/var Gp;function Fy(){return Gp||(Gp=1,(function(n){function r(z,X){var V=z.length;z.push(X);e:for(;0<V;){var j=V-1>>>1,L=z[j];if(0<a(L,X))z[j]=X,z[V]=L,V=j;else break e}}function s(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var X=z[0],V=z.pop();if(V!==X){z[0]=V;e:for(var j=0,L=z.length,ce=L>>>1;j<ce;){var q=2*(j+1)-1,le=z[q],fe=q+1,Pe=z[fe];if(0>a(le,V))fe<L&&0>a(Pe,le)?(z[j]=Pe,z[fe]=V,j=fe):(z[j]=le,z[q]=V,j=q);else if(fe<L&&0>a(Pe,V))z[j]=Pe,z[fe]=V,j=fe;else break e}}return X}function a(z,X){var V=z.sortIndex-X.sortIndex;return V!==0?V:z.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var g=[],m=[],v=1,k=null,x=3,b=!1,E=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(z){for(var X=s(m);X!==null;){if(X.callback===null)o(m);else if(X.startTime<=z)o(m),X.sortIndex=X.expirationTime,r(g,X);else break;X=s(m)}}function $(z){if(C=!1,B(z),!E)if(s(g)!==null)E=!0,re(W);else{var X=s(m);X!==null&&ae($,X.startTime-z)}}function W(z,X){E=!1,C&&(C=!1,I(K),K=-1),b=!0;var V=x;try{for(B(X),k=s(g);k!==null&&(!(k.expirationTime>X)||z&&!de());){var j=k.callback;if(typeof j=="function"){k.callback=null,x=k.priorityLevel;var L=j(k.expirationTime<=X);X=n.unstable_now(),typeof L=="function"?k.callback=L:k===s(g)&&o(g),B(X)}else o(g);k=s(g)}if(k!==null)var ce=!0;else{var q=s(m);q!==null&&ae($,q.startTime-X),ce=!1}return ce}finally{k=null,x=V,b=!1}}var Y=!1,G=null,K=-1,ue=5,ge=-1;function de(){return!(n.unstable_now()-ge<ue)}function pe(){if(G!==null){var z=n.unstable_now();ge=z;var X=!0;try{X=G(!0,z)}finally{X?ve():(Y=!1,G=null)}}else Y=!1}var ve;if(typeof A=="function")ve=function(){A(pe)};else if(typeof MessageChannel<"u"){var Me=new MessageChannel,ee=Me.port2;Me.port1.onmessage=pe,ve=function(){ee.postMessage(null)}}else ve=function(){T(pe,0)};function re(z){G=z,Y||(Y=!0,ve())}function ae(z,X){K=T(function(){z(n.unstable_now())},X)}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(z){z.callback=null},n.unstable_continueExecution=function(){E||b||(E=!0,re(W))},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return s(g)},n.unstable_next=function(z){switch(x){case 1:case 2:case 3:var X=3;break;default:X=x}var V=x;x=X;try{return z()}finally{x=V}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,X){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=x;x=z;try{return X()}finally{x=V}},n.unstable_scheduleCallback=function(z,X,V){var j=n.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?j+V:j):V=j,z){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=V+L,z={id:v++,callback:X,priorityLevel:z,startTime:V,expirationTime:L,sortIndex:-1},V>j?(z.sortIndex=V,r(m,z),s(g)===null&&z===s(m)&&(C?(I(K),K=-1):C=!0,ae($,V-j))):(z.sortIndex=L,r(g,z),E||b||(E=!0,re(W))),z},n.unstable_shouldYield=de,n.unstable_wrapCallback=function(z){var X=x;return function(){var V=x;x=X;try{return z.apply(this,arguments)}finally{x=V}}}})(su)),su}var Kp;function Uy(){return Kp||(Kp=1,ru.exports=Fy()),ru.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,53 +30,53 @@ var My=Object.defineProperty;var Ly=(n,r,s)=>r in n?My(n,r,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Yp;function
|
|
33
|
+
*/var Yp;function By(){if(Yp)return Cn;Yp=1;var n=qu(),r=Uy();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);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 o=new Set,a={};function u(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,v={},k={};function x(e){return g.call(k,e)?!0:g.call(v,e)?!1:m.test(e)?k[e]=!0:(v[e]=!0,!1)}function b(e,t,i,l){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,t,i,l){if(t===null||typeof t>"u"||b(e,t,i,l))return!0;if(l)return!1;if(i!==null)switch(i.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 C(e,t,i,l,d,p,y){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=y}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];T[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new C(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){T[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function A(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(I,A);T[t]=new C(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(I,A);T[t]=new C(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(I,A);T[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function B(e,t,i,l){var d=T.hasOwnProperty(t)?T[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(E(t,i,d,l)&&(i=null),l||d===null?x(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(t=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(t):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,t,i):e.setAttribute(t,i))))}var $=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),Y=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),ue=Symbol.for("react.profiler"),ge=Symbol.for("react.provider"),de=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),z=Symbol.iterator;function X(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var V=Object.assign,j;function L(e){if(j===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return`
|
|
34
34
|
`+j+e}var ce=!1;function q(e,t){if(!e||ce)return"";ce=!0;var i=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(U){var l=U}Reflect.construct(e,[],t)}else{try{t.call()}catch(U){l=U}e.call(t.prototype)}else{try{throw Error()}catch(U){l=U}e()}}catch(U){if(U&&l&&typeof U.stack=="string"){for(var d=U.stack.split(`
|
|
35
35
|
`),p=l.stack.split(`
|
|
36
36
|
`),y=d.length-1,N=p.length-1;1<=y&&0<=N&&d[y]!==p[N];)N--;for(;1<=y&&0<=N;y--,N--)if(d[y]!==p[N]){if(y!==1||N!==1)do if(y--,N--,0>N||d[y]!==p[N]){var R=`
|
|
37
|
-
`+d[y].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=y&&0<=N);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?M(e):""}function le(e){switch(e.tag){case 5:return M(e.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1),e;case 11:return e=q(e.type.render,!1),e;case 1:return e=q(e.type,!0),e;default:return""}}function fe(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 G:return"Fragment";case Y:return"Portal";case ue:return"Profiler";case K:return"StrictMode";case ve:return"Suspense";case Me:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case de:return(e.displayName||"Context")+".Consumer";case ge: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 ee:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case re:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function Pe(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 fe(t);case 8:return t===K?"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 Ce(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 _e(e){var t=je(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(y){l=""+y,p.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function it(e){e._valueTracker||(e._valueTracker=_e(e))}function Ee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=je(e)?e.checked?"true":"false":e.value),e=l,e!==i?(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(e,t){var i=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function It(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Ce(t.value!=null?t.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fe(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Dt(e,t){Fe(e,t);var i=Ce(t.value),l=t.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?St(e,t.type,i):t.hasOwnProperty("defaultValue")&&St(e,t.type,Ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _n(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function St(e,t,i){(t!=="number"||kt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Mt=Array.isArray;function pt(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Ce(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function en(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function H(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(s(92));if(Mt(i)){if(1<i.length)throw Error(s(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Ce(i)}}function he(e,t){var i=Ce(t.value),l=Ce(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tt(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 ht(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mt,Rt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(t,i,l,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(mt=mt||document.createElement("div"),mt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ht(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ut={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},jn=["Webkit","ms","Moz","O"];Object.keys(ut).forEach(function(e){jn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ut[t]=ut[e]})});function Wn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||ut.hasOwnProperty(e)&&ut[e]?(""+t).trim():t+"px"}function br(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Wn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var hr=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rn(e,t){if(t){if(hr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function An(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 dn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ft=null,Vt=null,rt=null;function gt(e){if(e=zi(e)){if(typeof Ft!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Vo(t),Ft(e.stateNode,e.type,t))}}function vt(e){Vt?rt?rt.push(e):rt=[e]:Vt=e}function qt(){if(Vt){var e=Vt,t=rt;if(rt=Vt=null,gt(e),t)for(e=0;e<t.length;e++)gt(t[e])}}function bt(e,t){return e(t)}function yt(){}var ot=!1;function Gt(e,t,i){if(ot)return e(t,i);ot=!0;try{return bt(e,t,i)}finally{ot=!1,(Vt!==null||rt!==null)&&(yt(),qt())}}function Je(e,t){var i=e.stateNode;if(i===null)return null;var l=Vo(i);if(l===null)return null;i=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var _=!1;if(h)try{var se={};Object.defineProperty(se,"passive",{get:function(){_=!0}}),window.addEventListener("test",se,se),window.removeEventListener("test",se,se)}catch{_=!1}function ne(e,t,i,l,d,p,y,N,R){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(J){this.onError(J)}}var ye=!1,ze=null,Be=!1,De=null,at={onError:function(e){ye=!0,ze=e}};function In(e,t,i,l,d,p,y,N,R){ye=!1,ze=null,ne.apply(at,arguments)}function Dn(e,t,i,l,d,p,y,N,R){if(In.apply(this,arguments),ye){if(ye){var U=ze;ye=!1,ze=null}else throw Error(s(198));Be||(Be=!0,De=U)}}function He(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function wn(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 Or(e){if(He(e)!==e)throw Error(s(188))}function Jn(e){var t=e.alternate;if(!t){if(t=He(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return Or(d),e;if(p===l)return Or(d),t;p=p.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=p;else{for(var y=!1,N=d.child;N;){if(N===i){y=!0,i=d,l=p;break}if(N===l){y=!0,l=d,i=p;break}N=N.sibling}if(!y){for(N=p.child;N;){if(N===i){y=!0,i=p,l=d;break}if(N===l){y=!0,l=p,i=d;break}N=N.sibling}if(!y)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function er(e){return e=Jn(e),e!==null?Xe(e):null}function Xe(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xe(e);if(t!==null)return t;e=e.sibling}return null}var Tt=r.unstable_scheduleCallback,tr=r.unstable_cancelCallback,Tl=r.unstable_shouldYield,Nl=r.unstable_requestPaint,Nt=r.unstable_now,mr=r.unstable_getCurrentPriorityLevel,zr=r.unstable_ImmediatePriority,gr=r.unstable_UserBlockingPriority,Ls=r.unstable_NormalPriority,cs=r.unstable_LowPriority,Eo=r.unstable_IdlePriority,us=null,Mn=null;function Ps(e){if(Mn&&typeof Mn.onCommitFiberRoot=="function")try{Mn.onCommitFiberRoot(us,e,void 0,(e.current.flags&128)===128)}catch{}}var fn=Math.clz32?Math.clz32:ds,Os=Math.log,$r=Math.LN2;function ds(e){return e>>>=0,e===0?32:31-(Os(e)/$r|0)|0}var pn=64,zs=4194304;function fs(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 ps(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,y=i&268435455;if(y!==0){var N=y&~d;N!==0?l=fs(N):(p&=y,p!==0&&(l=fs(p)))}else y=i&~d,y!==0?l=fs(y):p!==0&&(l=fs(p));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((l&4)!==0&&(l|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)i=31-fn(t),d=1<<i,l|=e[i],t&=~d;return l}function _o(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 jo(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var y=31-fn(p),N=1<<y,R=d[y];R===-1?((N&i)===0||(N&l)!==0)&&(d[y]=_o(N,t)):R<=t&&(e.expiredLanes|=N),p&=~N}}function ki(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Si(){var e=pn;return pn<<=1,(pn&4194240)===0&&(pn=64),e}function bi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function hs(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=i}function Ro(e,t){var i=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 l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-fn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Fr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-fn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ge=0;function ie(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,P,Q,Se,Ne,Oe=!1,Ke=[],Qe=null,Ct=null,Et=null,Tr=new Map,Lt=new Map,Ur=[],nv="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 Nd(e,t){switch(e){case"focusin":case"focusout":Qe=null;break;case"dragenter":case"dragleave":Ct=null;break;case"mouseover":case"mouseout":Et=null;break;case"pointerover":case"pointerout":Tr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lt.delete(t.pointerId)}}function Ti(e,t,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},t!==null&&(t=zi(t),t!==null&&P(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function rv(e,t,i,l,d){switch(t){case"focusin":return Qe=Ti(Qe,e,t,i,l,d),!0;case"dragenter":return Ct=Ti(Ct,e,t,i,l,d),!0;case"mouseover":return Et=Ti(Et,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return Tr.set(p,Ti(Tr.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Lt.set(p,Ti(Lt.get(p)||null,e,t,i,l,d)),!0}return!1}function Cd(e){var t=ms(e.target);if(t!==null){var i=He(t);if(i!==null){if(t=i.tag,t===13){if(t=wn(i),t!==null){e.blockedOn=t,Ne(e.priority,function(){Q(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ao(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=El(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);dn=l,i.target.dispatchEvent(l),dn=null}else return t=zi(i),t!==null&&P(t),e.blockedOn=i,!1;t.shift()}return!0}function Ed(e,t,i){Ao(e)&&i.delete(t)}function sv(){Oe=!1,Qe!==null&&Ao(Qe)&&(Qe=null),Ct!==null&&Ao(Ct)&&(Ct=null),Et!==null&&Ao(Et)&&(Et=null),Tr.forEach(Ed),Lt.forEach(Ed)}function Ni(e,t){e.blockedOn===t&&(e.blockedOn=null,Oe||(Oe=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,sv)))}function Ci(e){function t(d){return Ni(d,e)}if(0<Ke.length){Ni(Ke[0],e);for(var i=1;i<Ke.length;i++){var l=Ke[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Qe!==null&&Ni(Qe,e),Ct!==null&&Ni(Ct,e),Et!==null&&Ni(Et,e),Tr.forEach(t),Lt.forEach(t),i=0;i<Ur.length;i++)l=Ur[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ur.length&&(i=Ur[0],i.blockedOn===null);)Cd(i),i.blockedOn===null&&Ur.shift()}var $s=$.ReactCurrentBatchConfig,Io=!0;function iv(e,t,i,l){var d=Ge,p=$s.transition;$s.transition=null;try{Ge=1,Cl(e,t,i,l)}finally{Ge=d,$s.transition=p}}function ov(e,t,i,l){var d=Ge,p=$s.transition;$s.transition=null;try{Ge=4,Cl(e,t,i,l)}finally{Ge=d,$s.transition=p}}function Cl(e,t,i,l){if(Io){var d=El(e,t,i,l);if(d===null)Hl(e,t,l,Do,i),Nd(e,l);else if(rv(d,e,t,i,l))l.stopPropagation();else if(Nd(e,l),t&4&&-1<nv.indexOf(e)){for(;d!==null;){var p=zi(d);if(p!==null&&S(p),p=El(e,t,i,l),p===null&&Hl(e,t,l,Do,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Hl(e,t,l,null,i)}}var Do=null;function El(e,t,i,l){if(Do=null,e=xn(l),e=ms(e),e!==null)if(t=He(e),t===null)e=null;else if(i=t.tag,i===13){if(e=wn(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Do=e,null}function _d(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(mr()){case zr:return 1;case gr:return 4;case Ls:case cs:return 16;case Eo:return 536870912;default:return 16}default:return 16}}var Br=null,_l=null,Mo=null;function jd(){if(Mo)return Mo;var e,t=_l,i=t.length,l,d="value"in Br?Br.value:Br.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var y=i-e;for(l=1;l<=y&&t[i-l]===d[p-l];l++);return Mo=d.slice(e,1<l?1-l:void 0)}function Lo(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 Po(){return!0}function Rd(){return!1}function Ln(e){function t(i,l,d,p,y){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=y,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Po:Rd,this.isPropagationStopped=Rd,this}return V(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Po)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Po)},persist:function(){},isPersistent:Po}),t}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=Ln(Fs),Ei=V({},Fs,{view:0,detail:0}),av=Ln(Ei),Rl,Al,_i,Oo=V({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dl,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!==_i&&(_i&&e.type==="mousemove"?(Rl=e.screenX-_i.screenX,Al=e.screenY-_i.screenY):Al=Rl=0,_i=e),Rl)},movementY:function(e){return"movementY"in e?e.movementY:Al}}),Ad=Ln(Oo),lv=V({},Oo,{dataTransfer:0}),cv=Ln(lv),uv=V({},Ei,{relatedTarget:0}),Il=Ln(uv),dv=V({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),fv=Ln(dv),pv=V({},Fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hv=Ln(pv),mv=V({},Fs,{data:0}),Id=Ln(mv),gv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vv={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"},yv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yv[e])?!!t[e]:!1}function Dl(){return xv}var wv=V({},Ei,{key:function(e){if(e.key){var t=gv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dl,charCode:function(e){return e.type==="keypress"?Lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kv=Ln(wv),Sv=V({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dd=Ln(Sv),bv=V({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dl}),Tv=Ln(bv),Nv=V({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Cv=Ln(Nv),Ev=V({},Oo,{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}),_v=Ln(Ev),jv=[9,13,27,32],Ml=h&&"CompositionEvent"in window,ji=null;h&&"documentMode"in document&&(ji=document.documentMode);var Rv=h&&"TextEvent"in window&&!ji,Md=h&&(!Ml||ji&&8<ji&&11>=ji),Ld=" ",Pd=!1;function Od(e,t){switch(e){case"keyup":return jv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Us=!1;function Av(e,t){switch(e){case"compositionend":return zd(t);case"keypress":return t.which!==32?null:(Pd=!0,Ld);case"textInput":return e=t.data,e===Ld&&Pd?null:e;default:return null}}function Iv(e,t){if(Us)return e==="compositionend"||!Ml&&Od(e,t)?(e=jd(),Mo=_l=Br=null,Us=!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 Md&&t.locale!=="ko"?null:t.data;default:return null}}var Dv={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 $d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Dv[e.type]:t==="textarea"}function Fd(e,t,i,l){vt(l),t=Bo(t,"onChange"),0<t.length&&(i=new jl("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Ri=null,Ai=null;function Mv(e){sf(e,0)}function zo(e){var t=qs(e);if(Ee(t))return e}function Lv(e,t){if(e==="change")return t}var Ud=!1;if(h){var Ll;if(h){var Pl="oninput"in document;if(!Pl){var Bd=document.createElement("div");Bd.setAttribute("oninput","return;"),Pl=typeof Bd.oninput=="function"}Ll=Pl}else Ll=!1;Ud=Ll&&(!document.documentMode||9<document.documentMode)}function Wd(){Ri&&(Ri.detachEvent("onpropertychange",Hd),Ai=Ri=null)}function Hd(e){if(e.propertyName==="value"&&zo(Ai)){var t=[];Fd(t,Ai,e,xn(e)),Gt(Mv,t)}}function Pv(e,t,i){e==="focusin"?(Wd(),Ri=t,Ai=i,Ri.attachEvent("onpropertychange",Hd)):e==="focusout"&&Wd()}function Ov(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zo(Ai)}function zv(e,t){if(e==="click")return zo(t)}function $v(e,t){if(e==="input"||e==="change")return zo(t)}function Fv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nr=typeof Object.is=="function"?Object.is:Fv;function Ii(e,t){if(nr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!g.call(t,d)||!nr(e[d],t[d]))return!1}return!0}function Vd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qd(e,t){var i=Vd(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Vd(i)}}function Gd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kd(){for(var e=window,t=kt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=kt(e.document)}return t}function Ol(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 Uv(e){var t=Kd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&Gd(i.ownerDocument.documentElement,i)){if(l!==null&&Ol(i)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=qd(i,p);var y=qd(i,l);d&&y&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Bv=h&&"documentMode"in document&&11>=document.documentMode,Bs=null,zl=null,Di=null,$l=!1;function Yd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;$l||Bs==null||Bs!==kt(l)||(l=Bs,"selectionStart"in l&&Ol(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Di&&Ii(Di,l)||(Di=l,l=Bo(zl,"onSelect"),0<l.length&&(t=new jl("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Bs)))}function $o(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ws={animationend:$o("Animation","AnimationEnd"),animationiteration:$o("Animation","AnimationIteration"),animationstart:$o("Animation","AnimationStart"),transitionend:$o("Transition","TransitionEnd")},Fl={},Xd={};h&&(Xd=document.createElement("div").style,"AnimationEvent"in window||(delete Ws.animationend.animation,delete Ws.animationiteration.animation,delete Ws.animationstart.animation),"TransitionEvent"in window||delete Ws.transitionend.transition);function Fo(e){if(Fl[e])return Fl[e];if(!Ws[e])return e;var t=Ws[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Xd)return Fl[e]=t[i];return e}var Qd=Fo("animationend"),Zd=Fo("animationiteration"),Jd=Fo("animationstart"),ef=Fo("transitionend"),tf=new Map,nf="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 Wr(e,t){tf.set(e,t),u(t,[e])}for(var Ul=0;Ul<nf.length;Ul++){var Bl=nf[Ul],Wv=Bl.toLowerCase(),Hv=Bl[0].toUpperCase()+Bl.slice(1);Wr(Wv,"on"+Hv)}Wr(Qd,"onAnimationEnd"),Wr(Zd,"onAnimationIteration"),Wr(Jd,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(ef,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mi="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(" "),Vv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mi));function rf(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,Dn(l,t,void 0,e),e.currentTarget=null}function sf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(t)for(var y=l.length-1;0<=y;y--){var N=l[y],R=N.instance,U=N.currentTarget;if(N=N.listener,R!==p&&d.isPropagationStopped())break e;rf(d,N,U),p=R}else for(y=0;y<l.length;y++){if(N=l[y],R=N.instance,U=N.currentTarget,N=N.listener,R!==p&&d.isPropagationStopped())break e;rf(d,N,U),p=R}}}if(Be)throw e=De,Be=!1,De=null,e}function dt(e,t){var i=t[Xl];i===void 0&&(i=t[Xl]=new Set);var l=e+"__bubble";i.has(l)||(of(t,e,2,!1),i.add(l))}function Wl(e,t,i){var l=0;t&&(l|=4),of(i,e,l,t)}var Uo="_reactListening"+Math.random().toString(36).slice(2);function Li(e){if(!e[Uo]){e[Uo]=!0,o.forEach(function(i){i!=="selectionchange"&&(Vv.has(i)||Wl(i,!1,e),Wl(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uo]||(t[Uo]=!0,Wl("selectionchange",!1,t))}}function of(e,t,i,l){switch(_d(t)){case 1:var d=iv;break;case 4:d=ov;break;default:d=Cl}i=d.bind(null,t,i,e),d=void 0,!_||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function Hl(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(y===4)for(y=l.return;y!==null;){var R=y.tag;if((R===3||R===4)&&(R=y.stateNode.containerInfo,R===d||R.nodeType===8&&R.parentNode===d))return;y=y.return}for(;N!==null;){if(y=ms(N),y===null)return;if(R=y.tag,R===5||R===6){l=p=y;continue e}N=N.parentNode}}l=l.return}Gt(function(){var U=p,J=xn(i),te=[];e:{var Z=tf.get(e);if(Z!==void 0){var me=jl,ke=e;switch(e){case"keypress":if(Lo(i)===0)break e;case"keydown":case"keyup":me=kv;break;case"focusin":ke="focus",me=Il;break;case"focusout":ke="blur",me=Il;break;case"beforeblur":case"afterblur":me=Il;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Ad;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=cv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=Tv;break;case Qd:case Zd:case Jd:me=fv;break;case ef:me=Cv;break;case"scroll":me=av;break;case"wheel":me=_v;break;case"copy":case"cut":case"paste":me=hv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Dd}var be=(t&4)!==0,Pt=!be&&e==="scroll",O=be?Z!==null?Z+"Capture":null:Z;be=[];for(var D=U,F;D!==null;){F=D;var oe=F.stateNode;if(F.tag===5&&oe!==null&&(F=oe,O!==null&&(oe=Je(D,O),oe!=null&&be.push(Pi(D,oe,F)))),Pt)break;D=D.return}0<be.length&&(Z=new me(Z,ke,null,i,J),te.push({event:Z,listeners:be}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",me=e==="mouseout"||e==="pointerout",Z&&i!==dn&&(ke=i.relatedTarget||i.fromElement)&&(ms(ke)||ke[Nr]))break e;if((me||Z)&&(Z=J.window===J?J:(Z=J.ownerDocument)?Z.defaultView||Z.parentWindow:window,me?(ke=i.relatedTarget||i.toElement,me=U,ke=ke?ms(ke):null,ke!==null&&(Pt=He(ke),ke!==Pt||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(me=null,ke=U),me!==ke)){if(be=Ad,oe="onMouseLeave",O="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(be=Dd,oe="onPointerLeave",O="onPointerEnter",D="pointer"),Pt=me==null?Z:qs(me),F=ke==null?Z:qs(ke),Z=new be(oe,D+"leave",me,i,J),Z.target=Pt,Z.relatedTarget=F,oe=null,ms(J)===U&&(be=new be(O,D+"enter",ke,i,J),be.target=F,be.relatedTarget=Pt,oe=be),Pt=oe,me&&ke)t:{for(be=me,O=ke,D=0,F=be;F;F=Hs(F))D++;for(F=0,oe=O;oe;oe=Hs(oe))F++;for(;0<D-F;)be=Hs(be),D--;for(;0<F-D;)O=Hs(O),F--;for(;D--;){if(be===O||O!==null&&be===O.alternate)break t;be=Hs(be),O=Hs(O)}be=null}else be=null;me!==null&&af(te,Z,me,be,!1),ke!==null&&Pt!==null&&af(te,Pt,ke,be,!0)}}e:{if(Z=U?qs(U):window,me=Z.nodeName&&Z.nodeName.toLowerCase(),me==="select"||me==="input"&&Z.type==="file")var Te=Lv;else if($d(Z))if(Ud)Te=$v;else{Te=Ov;var Ae=Pv}else(me=Z.nodeName)&&me.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(Te=zv);if(Te&&(Te=Te(e,U))){Fd(te,Te,i,J);break e}Ae&&Ae(e,Z,U),e==="focusout"&&(Ae=Z._wrapperState)&&Ae.controlled&&Z.type==="number"&&St(Z,"number",Z.value)}switch(Ae=U?qs(U):window,e){case"focusin":($d(Ae)||Ae.contentEditable==="true")&&(Bs=Ae,zl=U,Di=null);break;case"focusout":Di=zl=Bs=null;break;case"mousedown":$l=!0;break;case"contextmenu":case"mouseup":case"dragend":$l=!1,Yd(te,i,J);break;case"selectionchange":if(Bv)break;case"keydown":case"keyup":Yd(te,i,J)}var Ie;if(Ml)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Us?Od(e,i)&&(Le="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Le="onCompositionStart");Le&&(Md&&i.locale!=="ko"&&(Us||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Us&&(Ie=jd()):(Br=J,_l="value"in Br?Br.value:Br.textContent,Us=!0)),Ae=Bo(U,Le),0<Ae.length&&(Le=new Id(Le,e,null,i,J),te.push({event:Le,listeners:Ae}),Ie?Le.data=Ie:(Ie=zd(i),Ie!==null&&(Le.data=Ie)))),(Ie=Rv?Av(e,i):Iv(e,i))&&(U=Bo(U,"onBeforeInput"),0<U.length&&(J=new Id("onBeforeInput","beforeinput",null,i,J),te.push({event:J,listeners:U}),J.data=Ie))}sf(te,t)})}function Pi(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Bo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Je(e,i),p!=null&&l.unshift(Pi(e,p,d)),p=Je(e,t),p!=null&&l.push(Pi(e,p,d))),e=e.return}return l}function Hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function af(e,t,i,l,d){for(var p=t._reactName,y=[];i!==null&&i!==l;){var N=i,R=N.alternate,U=N.stateNode;if(R!==null&&R===l)break;N.tag===5&&U!==null&&(N=U,d?(R=Je(i,p),R!=null&&y.unshift(Pi(i,R,N))):d||(R=Je(i,p),R!=null&&y.push(Pi(i,R,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var qv=/\r\n?/g,Gv=/\u0000|\uFFFD/g;function lf(e){return(typeof e=="string"?e:""+e).replace(qv,`
|
|
38
|
-
`).replace(Gv,"")}function Wo(e,t,i){if(t=lf(t),lf(e)!==t&&i)throw Error(s(425))}function Ho(){}var Vl=null,ql=null;function Gl(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 Kl=typeof setTimeout=="function"?setTimeout:void 0,Kv=typeof clearTimeout=="function"?clearTimeout:void 0,cf=typeof Promise=="function"?Promise:void 0,Yv=typeof queueMicrotask=="function"?queueMicrotask:typeof cf<"u"?function(e){return cf.resolve(null).then(e).catch(Xv)}:Kl;function Xv(e){setTimeout(function(){throw e})}function Yl(e,t){var i=t,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),Ci(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ci(t)}function Hr(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 uf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var Vs=Math.random().toString(36).slice(2),vr="__reactFiber$"+Vs,Oi="__reactProps$"+Vs,Nr="__reactContainer$"+Vs,Xl="__reactEvents$"+Vs,Qv="__reactListeners$"+Vs,Zv="__reactHandles$"+Vs;function ms(e){var t=e[vr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Nr]||i[vr]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=uf(e);e!==null;){if(i=e[vr])return i;e=uf(e)}return t}e=i,i=e.parentNode}return null}function zi(e){return e=e[vr]||e[Nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Vo(e){return e[Oi]||null}var Ql=[],Gs=-1;function Vr(e){return{current:e}}function ft(e){0>Gs||(e.current=Ql[Gs],Ql[Gs]=null,Gs--)}function ct(e,t){Gs++,Ql[Gs]=e.current,e.current=t}var qr={},on=Vr(qr),kn=Vr(!1),gs=qr;function Ks(e,t){var i=e.type.contextTypes;if(!i)return qr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=t[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Sn(e){return e=e.childContextTypes,e!=null}function qo(){ft(kn),ft(on)}function df(e,t,i){if(on.current!==qr)throw Error(s(168));ct(on,t),ct(kn,i)}function ff(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(s(108,Pe(e)||"Unknown",d));return V({},i,l)}function Go(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qr,gs=on.current,ct(on,e),ct(kn,kn.current),!0}function pf(e,t,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=ff(e,t,gs),l.__reactInternalMemoizedMergedChildContext=e,ft(kn),ft(on),ct(on,e)):ft(kn),ct(kn,i)}var Cr=null,Ko=!1,Zl=!1;function hf(e){Cr===null?Cr=[e]:Cr.push(e)}function Jv(e){Ko=!0,hf(e)}function Gr(){if(!Zl&&Cr!==null){Zl=!0;var e=0,t=Ge;try{var i=Cr;for(Ge=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}Cr=null,Ko=!1}catch(d){throw Cr!==null&&(Cr=Cr.slice(e+1)),Tt(zr,Gr),d}finally{Ge=t,Zl=!1}}return null}var Ys=[],Xs=0,Yo=null,Xo=0,Hn=[],Vn=0,vs=null,Er=1,_r="";function ys(e,t){Ys[Xs++]=Xo,Ys[Xs++]=Yo,Yo=e,Xo=t}function mf(e,t,i){Hn[Vn++]=Er,Hn[Vn++]=_r,Hn[Vn++]=vs,vs=e;var l=Er;e=_r;var d=32-fn(l)-1;l&=~(1<<d),i+=1;var p=32-fn(t)+d;if(30<p){var y=d-d%5;p=(l&(1<<y)-1).toString(32),l>>=y,d-=y,Er=1<<32-fn(t)+d|i<<d|l,_r=p+e}else Er=1<<p|i<<d|l,_r=e}function Jl(e){e.return!==null&&(ys(e,1),mf(e,1,0))}function ec(e){for(;e===Yo;)Yo=Ys[--Xs],Ys[Xs]=null,Xo=Ys[--Xs],Ys[Xs]=null;for(;e===vs;)vs=Hn[--Vn],Hn[Vn]=null,_r=Hn[--Vn],Hn[Vn]=null,Er=Hn[--Vn],Hn[Vn]=null}var Pn=null,On=null,xt=!1,rr=null;function gf(e,t){var i=Yn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function vf(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Pn=e,On=Hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,On=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=vs!==null?{id:Er,overflow:_r}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Yn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Pn=e,On=null,!0):!1;default:return!1}}function tc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(xt){var t=On;if(t){var i=t;if(!vf(e,t)){if(tc(e))throw Error(s(418));t=Hr(i.nextSibling);var l=Pn;t&&vf(e,t)?gf(l,i):(e.flags=e.flags&-4097|2,xt=!1,Pn=e)}}else{if(tc(e))throw Error(s(418));e.flags=e.flags&-4097|2,xt=!1,Pn=e}}}function yf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function Qo(e){if(e!==Pn)return!1;if(!xt)return yf(e),xt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gl(e.type,e.memoizedProps)),t&&(t=On)){if(tc(e))throw xf(),Error(s(418));for(;t;)gf(e,t),t=Hr(t.nextSibling)}if(yf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){On=Hr(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}On=null}}else On=Pn?Hr(e.stateNode.nextSibling):null;return!0}function xf(){for(var e=On;e;)e=Hr(e.nextSibling)}function Qs(){On=Pn=null,xt=!1}function rc(e){rr===null?rr=[e]:rr.push(e)}var ey=$.ReactCurrentBatchConfig;function $i(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var l=i.stateNode}if(!l)throw Error(s(147,e));var d=l,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(y){var N=d.refs;y===null?delete N[p]:N[p]=y},t._stringRef=p,t)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Zo(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wf(e){var t=e._init;return t(e._payload)}function kf(e){function t(O,D){if(e){var F=O.deletions;F===null?(O.deletions=[D],O.flags|=16):F.push(D)}}function i(O,D){if(!e)return null;for(;D!==null;)t(O,D),D=D.sibling;return null}function l(O,D){for(O=new Map;D!==null;)D.key!==null?O.set(D.key,D):O.set(D.index,D),D=D.sibling;return O}function d(O,D){return O=ts(O,D),O.index=0,O.sibling=null,O}function p(O,D,F){return O.index=F,e?(F=O.alternate,F!==null?(F=F.index,F<D?(O.flags|=2,D):F):(O.flags|=2,D)):(O.flags|=1048576,D)}function y(O){return e&&O.alternate===null&&(O.flags|=2),O}function N(O,D,F,oe){return D===null||D.tag!==6?(D=Kc(F,O.mode,oe),D.return=O,D):(D=d(D,F),D.return=O,D)}function R(O,D,F,oe){var Te=F.type;return Te===G?J(O,D,F.props.children,oe,F.key):D!==null&&(D.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===re&&wf(Te)===D.type)?(oe=d(D,F.props),oe.ref=$i(O,D,F),oe.return=O,oe):(oe=Sa(F.type,F.key,F.props,null,O.mode,oe),oe.ref=$i(O,D,F),oe.return=O,oe)}function U(O,D,F,oe){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Yc(F,O.mode,oe),D.return=O,D):(D=d(D,F.children||[]),D.return=O,D)}function J(O,D,F,oe,Te){return D===null||D.tag!==7?(D=Cs(F,O.mode,oe,Te),D.return=O,D):(D=d(D,F),D.return=O,D)}function te(O,D,F){if(typeof D=="string"&&D!==""||typeof D=="number")return D=Kc(""+D,O.mode,F),D.return=O,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case W:return F=Sa(D.type,D.key,D.props,null,O.mode,F),F.ref=$i(O,null,D),F.return=O,F;case Y:return D=Yc(D,O.mode,F),D.return=O,D;case re:var oe=D._init;return te(O,oe(D._payload),F)}if(Mt(D)||X(D))return D=Cs(D,O.mode,F,null),D.return=O,D;Zo(O,D)}return null}function Z(O,D,F,oe){var Te=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Te!==null?null:N(O,D,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Te?R(O,D,F,oe):null;case Y:return F.key===Te?U(O,D,F,oe):null;case re:return Te=F._init,Z(O,D,Te(F._payload),oe)}if(Mt(F)||X(F))return Te!==null?null:J(O,D,F,oe,null);Zo(O,F)}return null}function me(O,D,F,oe,Te){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return O=O.get(F)||null,N(D,O,""+oe,Te);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case W:return O=O.get(oe.key===null?F:oe.key)||null,R(D,O,oe,Te);case Y:return O=O.get(oe.key===null?F:oe.key)||null,U(D,O,oe,Te);case re:var Ae=oe._init;return me(O,D,F,Ae(oe._payload),Te)}if(Mt(oe)||X(oe))return O=O.get(F)||null,J(D,O,oe,Te,null);Zo(D,oe)}return null}function ke(O,D,F,oe){for(var Te=null,Ae=null,Ie=D,Le=D=0,Xt=null;Ie!==null&&Le<F.length;Le++){Ie.index>Le?(Xt=Ie,Ie=null):Xt=Ie.sibling;var Ze=Z(O,Ie,F[Le],oe);if(Ze===null){Ie===null&&(Ie=Xt);break}e&&Ie&&Ze.alternate===null&&t(O,Ie),D=p(Ze,D,Le),Ae===null?Te=Ze:Ae.sibling=Ze,Ae=Ze,Ie=Xt}if(Le===F.length)return i(O,Ie),xt&&ys(O,Le),Te;if(Ie===null){for(;Le<F.length;Le++)Ie=te(O,F[Le],oe),Ie!==null&&(D=p(Ie,D,Le),Ae===null?Te=Ie:Ae.sibling=Ie,Ae=Ie);return xt&&ys(O,Le),Te}for(Ie=l(O,Ie);Le<F.length;Le++)Xt=me(Ie,O,Le,F[Le],oe),Xt!==null&&(e&&Xt.alternate!==null&&Ie.delete(Xt.key===null?Le:Xt.key),D=p(Xt,D,Le),Ae===null?Te=Xt:Ae.sibling=Xt,Ae=Xt);return e&&Ie.forEach(function(ns){return t(O,ns)}),xt&&ys(O,Le),Te}function be(O,D,F,oe){var Te=X(F);if(typeof Te!="function")throw Error(s(150));if(F=Te.call(F),F==null)throw Error(s(151));for(var Ae=Te=null,Ie=D,Le=D=0,Xt=null,Ze=F.next();Ie!==null&&!Ze.done;Le++,Ze=F.next()){Ie.index>Le?(Xt=Ie,Ie=null):Xt=Ie.sibling;var ns=Z(O,Ie,Ze.value,oe);if(ns===null){Ie===null&&(Ie=Xt);break}e&&Ie&&ns.alternate===null&&t(O,Ie),D=p(ns,D,Le),Ae===null?Te=ns:Ae.sibling=ns,Ae=ns,Ie=Xt}if(Ze.done)return i(O,Ie),xt&&ys(O,Le),Te;if(Ie===null){for(;!Ze.done;Le++,Ze=F.next())Ze=te(O,Ze.value,oe),Ze!==null&&(D=p(Ze,D,Le),Ae===null?Te=Ze:Ae.sibling=Ze,Ae=Ze);return xt&&ys(O,Le),Te}for(Ie=l(O,Ie);!Ze.done;Le++,Ze=F.next())Ze=me(Ie,O,Le,Ze.value,oe),Ze!==null&&(e&&Ze.alternate!==null&&Ie.delete(Ze.key===null?Le:Ze.key),D=p(Ze,D,Le),Ae===null?Te=Ze:Ae.sibling=Ze,Ae=Ze);return e&&Ie.forEach(function(Dy){return t(O,Dy)}),xt&&ys(O,Le),Te}function Pt(O,D,F,oe){if(typeof F=="object"&&F!==null&&F.type===G&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var Te=F.key,Ae=D;Ae!==null;){if(Ae.key===Te){if(Te=F.type,Te===G){if(Ae.tag===7){i(O,Ae.sibling),D=d(Ae,F.props.children),D.return=O,O=D;break e}}else if(Ae.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===re&&wf(Te)===Ae.type){i(O,Ae.sibling),D=d(Ae,F.props),D.ref=$i(O,Ae,F),D.return=O,O=D;break e}i(O,Ae);break}else t(O,Ae);Ae=Ae.sibling}F.type===G?(D=Cs(F.props.children,O.mode,oe,F.key),D.return=O,O=D):(oe=Sa(F.type,F.key,F.props,null,O.mode,oe),oe.ref=$i(O,D,F),oe.return=O,O=oe)}return y(O);case Y:e:{for(Ae=F.key;D!==null;){if(D.key===Ae)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){i(O,D.sibling),D=d(D,F.children||[]),D.return=O,O=D;break e}else{i(O,D);break}else t(O,D);D=D.sibling}D=Yc(F,O.mode,oe),D.return=O,O=D}return y(O);case re:return Ae=F._init,Pt(O,D,Ae(F._payload),oe)}if(Mt(F))return ke(O,D,F,oe);if(X(F))return be(O,D,F,oe);Zo(O,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,D!==null&&D.tag===6?(i(O,D.sibling),D=d(D,F),D.return=O,O=D):(i(O,D),D=Kc(F,O.mode,oe),D.return=O,O=D),y(O)):i(O,D)}return Pt}var Zs=kf(!0),Sf=kf(!1),Jo=Vr(null),ea=null,Js=null,sc=null;function ic(){sc=Js=ea=null}function oc(e){var t=Jo.current;ft(Jo),e._currentValue=t}function ac(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function ei(e,t){ea=e,sc=Js=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(bn=!0),e.firstContext=null)}function qn(e){var t=e._currentValue;if(sc!==e)if(e={context:e,memoizedValue:t,next:null},Js===null){if(ea===null)throw Error(s(308));Js=e,ea.dependencies={lanes:0,firstContext:e}}else Js=Js.next=e;return t}var xs=null;function lc(e){xs===null?xs=[e]:xs.push(e)}function bf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,lc(t)):(i.next=d.next,d.next=i),t.interleaved=i,jr(e,l)}function jr(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Kr=!1;function cc(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 Rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yr(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,jr(e,i)}return d=l.interleaved,d===null?(t.next=t,lc(l)):(t.next=d.next,d.next=t),l.interleaved=t,jr(e,i)}function ta(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Fr(e,i)}}function Nf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var y={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=y:p=p.next=y,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function na(e,t,i,l){var d=e.updateQueue;Kr=!1;var p=d.firstBaseUpdate,y=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var R=N,U=R.next;R.next=null,y===null?p=U:y.next=U,y=R;var J=e.alternate;J!==null&&(J=J.updateQueue,N=J.lastBaseUpdate,N!==y&&(N===null?J.firstBaseUpdate=U:N.next=U,J.lastBaseUpdate=R))}if(p!==null){var te=d.baseState;y=0,J=U=R=null,N=p;do{var Z=N.lane,me=N.eventTime;if((l&Z)===Z){J!==null&&(J=J.next={eventTime:me,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var ke=e,be=N;switch(Z=t,me=i,be.tag){case 1:if(ke=be.payload,typeof ke=="function"){te=ke.call(me,te,Z);break e}te=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=be.payload,Z=typeof ke=="function"?ke.call(me,te,Z):ke,Z==null)break e;te=V({},te,Z);break e;case 2:Kr=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,Z=d.effects,Z===null?d.effects=[N]:Z.push(N))}else me={eventTime:me,lane:Z,tag:N.tag,payload:N.payload,callback:N.callback,next:null},J===null?(U=J=me,R=te):J=J.next=me,y|=Z;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);if(J===null&&(R=te),d.baseState=R,d.firstBaseUpdate=U,d.lastBaseUpdate=J,t=d.shared.interleaved,t!==null){d=t;do y|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);Ss|=y,e.lanes=y,e.memoizedState=te}}function Cf(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(s(191,d));d.call(l)}}}var Fi={},yr=Vr(Fi),Ui=Vr(Fi),Bi=Vr(Fi);function ws(e){if(e===Fi)throw Error(s(174));return e}function uc(e,t){switch(ct(Bi,t),ct(Ui,e),ct(yr,Fi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ht(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ht(t,e)}ft(yr),ct(yr,t)}function ti(){ft(yr),ft(Ui),ft(Bi)}function Ef(e){ws(Bi.current);var t=ws(yr.current),i=ht(t,e.type);t!==i&&(ct(Ui,e),ct(yr,i))}function dc(e){Ui.current===e&&(ft(yr),ft(Ui))}var _t=Vr(0);function ra(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.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 fc=[];function pc(){for(var e=0;e<fc.length;e++)fc[e]._workInProgressVersionPrimary=null;fc.length=0}var sa=$.ReactCurrentDispatcher,hc=$.ReactCurrentBatchConfig,ks=0,jt=null,Ut=null,Kt=null,ia=!1,Wi=!1,Hi=0,ty=0;function an(){throw Error(s(321))}function mc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!nr(e[i],t[i]))return!1;return!0}function gc(e,t,i,l,d,p){if(ks=p,jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,sa.current=e===null||e.memoizedState===null?iy:oy,e=i(l,d),Wi){p=0;do{if(Wi=!1,Hi=0,25<=p)throw Error(s(301));p+=1,Kt=Ut=null,t.updateQueue=null,sa.current=ay,e=i(l,d)}while(Wi)}if(sa.current=la,t=Ut!==null&&Ut.next!==null,ks=0,Kt=Ut=jt=null,ia=!1,t)throw Error(s(300));return e}function vc(){var e=Hi!==0;return Hi=0,e}function xr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?jt.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Gn(){if(Ut===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Kt===null?jt.memoizedState:Kt.next;if(t!==null)Kt=t,Ut=e;else{if(e===null)throw Error(s(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Kt===null?jt.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Vi(e,t){return typeof t=="function"?t(e):t}function yc(e){var t=Gn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=Ut,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var y=d.next;d.next=p.next,p.next=y}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var N=y=null,R=null,U=p;do{var J=U.lane;if((ks&J)===J)R!==null&&(R=R.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var te={lane:J,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};R===null?(N=R=te,y=l):R=R.next=te,jt.lanes|=J,Ss|=J}U=U.next}while(U!==null&&U!==p);R===null?y=l:R.next=N,nr(l,t.memoizedState)||(bn=!0),t.memoizedState=l,t.baseState=y,t.baseQueue=R,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,jt.lanes|=p,Ss|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function xc(e){var t=Gn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var y=d=d.next;do p=e(p,y.action),y=y.next;while(y!==d);nr(p,t.memoizedState)||(bn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function _f(){}function jf(e,t){var i=jt,l=Gn(),d=t(),p=!nr(l.memoizedState,d);if(p&&(l.memoizedState=d,bn=!0),l=l.queue,wc(If.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Kt!==null&&Kt.memoizedState.tag&1){if(i.flags|=2048,qi(9,Af.bind(null,i,l,d,t),void 0,null),Yt===null)throw Error(s(349));(ks&30)!==0||Rf(i,t,d)}return d}function Rf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Af(e,t,i,l){t.value=i,t.getSnapshot=l,Df(t)&&Mf(e)}function If(e,t,i){return i(function(){Df(t)&&Mf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!nr(e,i)}catch{return!0}}function Mf(e){var t=jr(e,1);t!==null&&ar(t,e,1,-1)}function Lf(e){var t=xr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:e},t.queue=e,e=e.dispatch=sy.bind(null,jt,e),[t.memoizedState,e]}function qi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function Pf(){return Gn().memoizedState}function oa(e,t,i,l){var d=xr();jt.flags|=e,d.memoizedState=qi(1|t,i,void 0,l===void 0?null:l)}function aa(e,t,i,l){var d=Gn();l=l===void 0?null:l;var p=void 0;if(Ut!==null){var y=Ut.memoizedState;if(p=y.destroy,l!==null&&mc(l,y.deps)){d.memoizedState=qi(t,i,p,l);return}}jt.flags|=e,d.memoizedState=qi(1|t,i,p,l)}function Of(e,t){return oa(8390656,8,e,t)}function wc(e,t){return aa(2048,8,e,t)}function zf(e,t){return aa(4,2,e,t)}function $f(e,t){return aa(4,4,e,t)}function Ff(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 Uf(e,t,i){return i=i!=null?i.concat([e]):null,aa(4,4,Ff.bind(null,t,e),i)}function kc(){}function Bf(e,t){var i=Gn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&mc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Wf(e,t){var i=Gn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&mc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Hf(e,t,i){return(ks&21)===0?(e.baseState&&(e.baseState=!1,bn=!0),e.memoizedState=i):(nr(i,t)||(i=Si(),jt.lanes|=i,Ss|=i,e.baseState=!0),t)}function ny(e,t){var i=Ge;Ge=i!==0&&4>i?i:4,e(!0);var l=hc.transition;hc.transition={};try{e(!1),t()}finally{Ge=i,hc.transition=l}}function Vf(){return Gn().memoizedState}function ry(e,t,i){var l=Jr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},qf(e))Gf(t,i);else if(i=bf(e,t,i,l),i!==null){var d=mn();ar(i,e,l,d),Kf(i,t,l)}}function sy(e,t,i){var l=Jr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(qf(e))Gf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var y=t.lastRenderedState,N=p(y,i);if(d.hasEagerState=!0,d.eagerState=N,nr(N,y)){var R=t.interleaved;R===null?(d.next=d,lc(t)):(d.next=R.next,R.next=d),t.interleaved=d;return}}catch{}finally{}i=bf(e,t,d,l),i!==null&&(d=mn(),ar(i,e,l,d),Kf(i,t,l))}}function qf(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function Gf(e,t){Wi=ia=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Kf(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Fr(e,i)}}var la={readContext:qn,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useInsertionEffect:an,useLayoutEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useMutableSource:an,useSyncExternalStore:an,useId:an,unstable_isNewReconciler:!1},iy={readContext:qn,useCallback:function(e,t){return xr().memoizedState=[e,t===void 0?null:t],e},useContext:qn,useEffect:Of,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,oa(4194308,4,Ff.bind(null,t,e),i)},useLayoutEffect:function(e,t){return oa(4194308,4,e,t)},useInsertionEffect:function(e,t){return oa(4,2,e,t)},useMemo:function(e,t){var i=xr();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=xr();return t=i!==void 0?i(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=ry.bind(null,jt,e),[l.memoizedState,e]},useRef:function(e){var t=xr();return e={current:e},t.memoizedState=e},useState:Lf,useDebugValue:kc,useDeferredValue:function(e){return xr().memoizedState=e},useTransition:function(){var e=Lf(!1),t=e[0];return e=ny.bind(null,e[1]),xr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=jt,d=xr();if(xt){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Yt===null)throw Error(s(349));(ks&30)!==0||Rf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,Of(If.bind(null,l,p,e),[e]),l.flags|=2048,qi(9,Af.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=xr(),t=Yt.identifierPrefix;if(xt){var i=_r,l=Er;i=(l&~(1<<32-fn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Hi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=ty++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oy={readContext:qn,useCallback:Bf,useContext:qn,useEffect:wc,useImperativeHandle:Uf,useInsertionEffect:zf,useLayoutEffect:$f,useMemo:Wf,useReducer:yc,useRef:Pf,useState:function(){return yc(Vi)},useDebugValue:kc,useDeferredValue:function(e){var t=Gn();return Hf(t,Ut.memoizedState,e)},useTransition:function(){var e=yc(Vi)[0],t=Gn().memoizedState;return[e,t]},useMutableSource:_f,useSyncExternalStore:jf,useId:Vf,unstable_isNewReconciler:!1},ay={readContext:qn,useCallback:Bf,useContext:qn,useEffect:wc,useImperativeHandle:Uf,useInsertionEffect:zf,useLayoutEffect:$f,useMemo:Wf,useReducer:xc,useRef:Pf,useState:function(){return xc(Vi)},useDebugValue:kc,useDeferredValue:function(e){var t=Gn();return Ut===null?t.memoizedState=e:Hf(t,Ut.memoizedState,e)},useTransition:function(){var e=xc(Vi)[0],t=Gn().memoizedState;return[e,t]},useMutableSource:_f,useSyncExternalStore:jf,useId:Vf,unstable_isNewReconciler:!1};function sr(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function Sc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:V({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ca={isMounted:function(e){return(e=e._reactInternals)?He(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=mn(),d=Jr(e),p=Rr(l,d);p.payload=t,i!=null&&(p.callback=i),t=Yr(e,p,d),t!==null&&(ar(t,e,d,l),ta(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=mn(),d=Jr(e),p=Rr(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Yr(e,p,d),t!==null&&(ar(t,e,d,l),ta(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=mn(),l=Jr(e),d=Rr(i,l);d.tag=2,t!=null&&(d.callback=t),t=Yr(e,d,l),t!==null&&(ar(t,e,l,i),ta(t,e,l))}};function Yf(e,t,i,l,d,p,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,y):t.prototype&&t.prototype.isPureReactComponent?!Ii(i,l)||!Ii(d,p):!0}function Xf(e,t,i){var l=!1,d=qr,p=t.contextType;return typeof p=="object"&&p!==null?p=qn(p):(d=Sn(t)?gs:on.current,l=t.contextTypes,p=(l=l!=null)?Ks(e,d):qr),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ca,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Qf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&ca.enqueueReplaceState(t,t.state,null)}function bc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},cc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=qn(p):(p=Sn(t)?gs:on.current,d.context=Ks(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(Sc(e,t,p,i),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&&ca.enqueueReplaceState(d,d.state,null),na(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function ni(e,t){try{var i="",l=t;do i+=le(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
37
|
+
`+d[y].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=y&&0<=N);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?L(e):""}function le(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1),e;case 11:return e=q(e.type.render,!1),e;case 1:return e=q(e.type,!0),e;default:return""}}function fe(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 G:return"Fragment";case Y:return"Portal";case ue:return"Profiler";case K:return"StrictMode";case ve:return"Suspense";case Me:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case de:return(e.displayName||"Context")+".Consumer";case ge: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 ee:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case re:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function Pe(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 fe(t);case 8:return t===K?"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 Ce(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 _e(e){var t=je(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(y){l=""+y,p.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function it(e){e._valueTracker||(e._valueTracker=_e(e))}function Ee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=je(e)?e.checked?"true":"false":e.value),e=l,e!==i?(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(e,t){var i=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function It(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Ce(t.value!=null?t.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fe(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Dt(e,t){Fe(e,t);var i=Ce(t.value),l=t.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?St(e,t.type,i):t.hasOwnProperty("defaultValue")&&St(e,t.type,Ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _n(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function St(e,t,i){(t!=="number"||kt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Mt=Array.isArray;function pt(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Ce(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function en(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function H(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(s(92));if(Mt(i)){if(1<i.length)throw Error(s(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Ce(i)}}function he(e,t){var i=Ce(t.value),l=Ce(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tt(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 ht(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mt,Rt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(t,i,l,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(mt=mt||document.createElement("div"),mt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ht(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ut={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},jn=["Webkit","ms","Moz","O"];Object.keys(ut).forEach(function(e){jn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ut[t]=ut[e]})});function Hn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||ut.hasOwnProperty(e)&&ut[e]?(""+t).trim():t+"px"}function br(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Hn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var hr=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rn(e,t){if(t){if(hr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function An(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 dn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ft=null,Vt=null,rt=null;function gt(e){if(e=zi(e)){if(typeof Ft!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Vo(t),Ft(e.stateNode,e.type,t))}}function vt(e){Vt?rt?rt.push(e):rt=[e]:Vt=e}function qt(){if(Vt){var e=Vt,t=rt;if(rt=Vt=null,gt(e),t)for(e=0;e<t.length;e++)gt(t[e])}}function bt(e,t){return e(t)}function yt(){}var ot=!1;function Gt(e,t,i){if(ot)return e(t,i);ot=!0;try{return bt(e,t,i)}finally{ot=!1,(Vt!==null||rt!==null)&&(yt(),qt())}}function Je(e,t){var i=e.stateNode;if(i===null)return null;var l=Vo(i);if(l===null)return null;i=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var _=!1;if(h)try{var se={};Object.defineProperty(se,"passive",{get:function(){_=!0}}),window.addEventListener("test",se,se),window.removeEventListener("test",se,se)}catch{_=!1}function ne(e,t,i,l,d,p,y,N,R){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(J){this.onError(J)}}var ye=!1,ze=null,Be=!1,De=null,at={onError:function(e){ye=!0,ze=e}};function In(e,t,i,l,d,p,y,N,R){ye=!1,ze=null,ne.apply(at,arguments)}function Dn(e,t,i,l,d,p,y,N,R){if(In.apply(this,arguments),ye){if(ye){var U=ze;ye=!1,ze=null}else throw Error(s(198));Be||(Be=!0,De=U)}}function He(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function wn(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 Or(e){if(He(e)!==e)throw Error(s(188))}function tr(e){var t=e.alternate;if(!t){if(t=He(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return Or(d),e;if(p===l)return Or(d),t;p=p.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=p;else{for(var y=!1,N=d.child;N;){if(N===i){y=!0,i=d,l=p;break}if(N===l){y=!0,l=d,i=p;break}N=N.sibling}if(!y){for(N=p.child;N;){if(N===i){y=!0,i=p,l=d;break}if(N===l){y=!0,l=p,i=d;break}N=N.sibling}if(!y)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function nr(e){return e=tr(e),e!==null?Xe(e):null}function Xe(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xe(e);if(t!==null)return t;e=e.sibling}return null}var Tt=r.unstable_scheduleCallback,rr=r.unstable_cancelCallback,Tl=r.unstable_shouldYield,Nl=r.unstable_requestPaint,Nt=r.unstable_now,mr=r.unstable_getCurrentPriorityLevel,zr=r.unstable_ImmediatePriority,gr=r.unstable_UserBlockingPriority,Ls=r.unstable_NormalPriority,cs=r.unstable_LowPriority,Eo=r.unstable_IdlePriority,us=null,Mn=null;function Ps(e){if(Mn&&typeof Mn.onCommitFiberRoot=="function")try{Mn.onCommitFiberRoot(us,e,void 0,(e.current.flags&128)===128)}catch{}}var fn=Math.clz32?Math.clz32:ds,Os=Math.log,$r=Math.LN2;function ds(e){return e>>>=0,e===0?32:31-(Os(e)/$r|0)|0}var pn=64,zs=4194304;function fs(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 ps(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,y=i&268435455;if(y!==0){var N=y&~d;N!==0?l=fs(N):(p&=y,p!==0&&(l=fs(p)))}else y=i&~d,y!==0?l=fs(y):p!==0&&(l=fs(p));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((l&4)!==0&&(l|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)i=31-fn(t),d=1<<i,l|=e[i],t&=~d;return l}function _o(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 jo(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var y=31-fn(p),N=1<<y,R=d[y];R===-1?((N&i)===0||(N&l)!==0)&&(d[y]=_o(N,t)):R<=t&&(e.expiredLanes|=N),p&=~N}}function ki(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Si(){var e=pn;return pn<<=1,(pn&4194240)===0&&(pn=64),e}function bi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function hs(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=i}function Ro(e,t){var i=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 l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-fn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Fr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-fn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ge=0;function ie(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,P,Q,Se,Ne,Oe=!1,Ke=[],Qe=null,Ct=null,Et=null,Tr=new Map,Lt=new Map,Ur=[],rv="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 Nd(e,t){switch(e){case"focusin":case"focusout":Qe=null;break;case"dragenter":case"dragleave":Ct=null;break;case"mouseover":case"mouseout":Et=null;break;case"pointerover":case"pointerout":Tr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lt.delete(t.pointerId)}}function Ti(e,t,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},t!==null&&(t=zi(t),t!==null&&P(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function sv(e,t,i,l,d){switch(t){case"focusin":return Qe=Ti(Qe,e,t,i,l,d),!0;case"dragenter":return Ct=Ti(Ct,e,t,i,l,d),!0;case"mouseover":return Et=Ti(Et,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return Tr.set(p,Ti(Tr.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Lt.set(p,Ti(Lt.get(p)||null,e,t,i,l,d)),!0}return!1}function Cd(e){var t=ms(e.target);if(t!==null){var i=He(t);if(i!==null){if(t=i.tag,t===13){if(t=wn(i),t!==null){e.blockedOn=t,Ne(e.priority,function(){Q(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ao(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=El(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);dn=l,i.target.dispatchEvent(l),dn=null}else return t=zi(i),t!==null&&P(t),e.blockedOn=i,!1;t.shift()}return!0}function Ed(e,t,i){Ao(e)&&i.delete(t)}function iv(){Oe=!1,Qe!==null&&Ao(Qe)&&(Qe=null),Ct!==null&&Ao(Ct)&&(Ct=null),Et!==null&&Ao(Et)&&(Et=null),Tr.forEach(Ed),Lt.forEach(Ed)}function Ni(e,t){e.blockedOn===t&&(e.blockedOn=null,Oe||(Oe=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,iv)))}function Ci(e){function t(d){return Ni(d,e)}if(0<Ke.length){Ni(Ke[0],e);for(var i=1;i<Ke.length;i++){var l=Ke[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Qe!==null&&Ni(Qe,e),Ct!==null&&Ni(Ct,e),Et!==null&&Ni(Et,e),Tr.forEach(t),Lt.forEach(t),i=0;i<Ur.length;i++)l=Ur[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ur.length&&(i=Ur[0],i.blockedOn===null);)Cd(i),i.blockedOn===null&&Ur.shift()}var $s=$.ReactCurrentBatchConfig,Io=!0;function ov(e,t,i,l){var d=Ge,p=$s.transition;$s.transition=null;try{Ge=1,Cl(e,t,i,l)}finally{Ge=d,$s.transition=p}}function av(e,t,i,l){var d=Ge,p=$s.transition;$s.transition=null;try{Ge=4,Cl(e,t,i,l)}finally{Ge=d,$s.transition=p}}function Cl(e,t,i,l){if(Io){var d=El(e,t,i,l);if(d===null)Hl(e,t,l,Do,i),Nd(e,l);else if(sv(d,e,t,i,l))l.stopPropagation();else if(Nd(e,l),t&4&&-1<rv.indexOf(e)){for(;d!==null;){var p=zi(d);if(p!==null&&S(p),p=El(e,t,i,l),p===null&&Hl(e,t,l,Do,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Hl(e,t,l,null,i)}}var Do=null;function El(e,t,i,l){if(Do=null,e=xn(l),e=ms(e),e!==null)if(t=He(e),t===null)e=null;else if(i=t.tag,i===13){if(e=wn(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Do=e,null}function _d(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(mr()){case zr:return 1;case gr:return 4;case Ls:case cs:return 16;case Eo:return 536870912;default:return 16}default:return 16}}var Br=null,_l=null,Mo=null;function jd(){if(Mo)return Mo;var e,t=_l,i=t.length,l,d="value"in Br?Br.value:Br.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var y=i-e;for(l=1;l<=y&&t[i-l]===d[p-l];l++);return Mo=d.slice(e,1<l?1-l:void 0)}function Lo(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 Po(){return!0}function Rd(){return!1}function Ln(e){function t(i,l,d,p,y){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=y,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Po:Rd,this.isPropagationStopped=Rd,this}return V(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Po)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Po)},persist:function(){},isPersistent:Po}),t}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=Ln(Fs),Ei=V({},Fs,{view:0,detail:0}),lv=Ln(Ei),Rl,Al,_i,Oo=V({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dl,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!==_i&&(_i&&e.type==="mousemove"?(Rl=e.screenX-_i.screenX,Al=e.screenY-_i.screenY):Al=Rl=0,_i=e),Rl)},movementY:function(e){return"movementY"in e?e.movementY:Al}}),Ad=Ln(Oo),cv=V({},Oo,{dataTransfer:0}),uv=Ln(cv),dv=V({},Ei,{relatedTarget:0}),Il=Ln(dv),fv=V({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),pv=Ln(fv),hv=V({},Fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mv=Ln(hv),gv=V({},Fs,{data:0}),Id=Ln(gv),vv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yv={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"},xv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xv[e])?!!t[e]:!1}function Dl(){return wv}var kv=V({},Ei,{key:function(e){if(e.key){var t=vv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dl,charCode:function(e){return e.type==="keypress"?Lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sv=Ln(kv),bv=V({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dd=Ln(bv),Tv=V({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dl}),Nv=Ln(Tv),Cv=V({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ev=Ln(Cv),_v=V({},Oo,{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}),jv=Ln(_v),Rv=[9,13,27,32],Ml=h&&"CompositionEvent"in window,ji=null;h&&"documentMode"in document&&(ji=document.documentMode);var Av=h&&"TextEvent"in window&&!ji,Md=h&&(!Ml||ji&&8<ji&&11>=ji),Ld=" ",Pd=!1;function Od(e,t){switch(e){case"keyup":return Rv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Us=!1;function Iv(e,t){switch(e){case"compositionend":return zd(t);case"keypress":return t.which!==32?null:(Pd=!0,Ld);case"textInput":return e=t.data,e===Ld&&Pd?null:e;default:return null}}function Dv(e,t){if(Us)return e==="compositionend"||!Ml&&Od(e,t)?(e=jd(),Mo=_l=Br=null,Us=!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 Md&&t.locale!=="ko"?null:t.data;default:return null}}var Mv={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 $d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mv[e.type]:t==="textarea"}function Fd(e,t,i,l){vt(l),t=Bo(t,"onChange"),0<t.length&&(i=new jl("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Ri=null,Ai=null;function Lv(e){sf(e,0)}function zo(e){var t=qs(e);if(Ee(t))return e}function Pv(e,t){if(e==="change")return t}var Ud=!1;if(h){var Ll;if(h){var Pl="oninput"in document;if(!Pl){var Bd=document.createElement("div");Bd.setAttribute("oninput","return;"),Pl=typeof Bd.oninput=="function"}Ll=Pl}else Ll=!1;Ud=Ll&&(!document.documentMode||9<document.documentMode)}function Wd(){Ri&&(Ri.detachEvent("onpropertychange",Hd),Ai=Ri=null)}function Hd(e){if(e.propertyName==="value"&&zo(Ai)){var t=[];Fd(t,Ai,e,xn(e)),Gt(Lv,t)}}function Ov(e,t,i){e==="focusin"?(Wd(),Ri=t,Ai=i,Ri.attachEvent("onpropertychange",Hd)):e==="focusout"&&Wd()}function zv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zo(Ai)}function $v(e,t){if(e==="click")return zo(t)}function Fv(e,t){if(e==="input"||e==="change")return zo(t)}function Uv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sr=typeof Object.is=="function"?Object.is:Uv;function Ii(e,t){if(sr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!g.call(t,d)||!sr(e[d],t[d]))return!1}return!0}function Vd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qd(e,t){var i=Vd(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Vd(i)}}function Gd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kd(){for(var e=window,t=kt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=kt(e.document)}return t}function Ol(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 Bv(e){var t=Kd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&Gd(i.ownerDocument.documentElement,i)){if(l!==null&&Ol(i)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=qd(i,p);var y=qd(i,l);d&&y&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Wv=h&&"documentMode"in document&&11>=document.documentMode,Bs=null,zl=null,Di=null,$l=!1;function Yd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;$l||Bs==null||Bs!==kt(l)||(l=Bs,"selectionStart"in l&&Ol(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Di&&Ii(Di,l)||(Di=l,l=Bo(zl,"onSelect"),0<l.length&&(t=new jl("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Bs)))}function $o(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ws={animationend:$o("Animation","AnimationEnd"),animationiteration:$o("Animation","AnimationIteration"),animationstart:$o("Animation","AnimationStart"),transitionend:$o("Transition","TransitionEnd")},Fl={},Xd={};h&&(Xd=document.createElement("div").style,"AnimationEvent"in window||(delete Ws.animationend.animation,delete Ws.animationiteration.animation,delete Ws.animationstart.animation),"TransitionEvent"in window||delete Ws.transitionend.transition);function Fo(e){if(Fl[e])return Fl[e];if(!Ws[e])return e;var t=Ws[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Xd)return Fl[e]=t[i];return e}var Qd=Fo("animationend"),Zd=Fo("animationiteration"),Jd=Fo("animationstart"),ef=Fo("transitionend"),tf=new Map,nf="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 Wr(e,t){tf.set(e,t),u(t,[e])}for(var Ul=0;Ul<nf.length;Ul++){var Bl=nf[Ul],Hv=Bl.toLowerCase(),Vv=Bl[0].toUpperCase()+Bl.slice(1);Wr(Hv,"on"+Vv)}Wr(Qd,"onAnimationEnd"),Wr(Zd,"onAnimationIteration"),Wr(Jd,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(ef,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mi="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(" "),qv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mi));function rf(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,Dn(l,t,void 0,e),e.currentTarget=null}function sf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(t)for(var y=l.length-1;0<=y;y--){var N=l[y],R=N.instance,U=N.currentTarget;if(N=N.listener,R!==p&&d.isPropagationStopped())break e;rf(d,N,U),p=R}else for(y=0;y<l.length;y++){if(N=l[y],R=N.instance,U=N.currentTarget,N=N.listener,R!==p&&d.isPropagationStopped())break e;rf(d,N,U),p=R}}}if(Be)throw e=De,Be=!1,De=null,e}function dt(e,t){var i=t[Xl];i===void 0&&(i=t[Xl]=new Set);var l=e+"__bubble";i.has(l)||(of(t,e,2,!1),i.add(l))}function Wl(e,t,i){var l=0;t&&(l|=4),of(i,e,l,t)}var Uo="_reactListening"+Math.random().toString(36).slice(2);function Li(e){if(!e[Uo]){e[Uo]=!0,o.forEach(function(i){i!=="selectionchange"&&(qv.has(i)||Wl(i,!1,e),Wl(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uo]||(t[Uo]=!0,Wl("selectionchange",!1,t))}}function of(e,t,i,l){switch(_d(t)){case 1:var d=ov;break;case 4:d=av;break;default:d=Cl}i=d.bind(null,t,i,e),d=void 0,!_||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function Hl(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(y===4)for(y=l.return;y!==null;){var R=y.tag;if((R===3||R===4)&&(R=y.stateNode.containerInfo,R===d||R.nodeType===8&&R.parentNode===d))return;y=y.return}for(;N!==null;){if(y=ms(N),y===null)return;if(R=y.tag,R===5||R===6){l=p=y;continue e}N=N.parentNode}}l=l.return}Gt(function(){var U=p,J=xn(i),te=[];e:{var Z=tf.get(e);if(Z!==void 0){var me=jl,ke=e;switch(e){case"keypress":if(Lo(i)===0)break e;case"keydown":case"keyup":me=Sv;break;case"focusin":ke="focus",me=Il;break;case"focusout":ke="blur",me=Il;break;case"beforeblur":case"afterblur":me=Il;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Ad;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=uv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=Nv;break;case Qd:case Zd:case Jd:me=pv;break;case ef:me=Ev;break;case"scroll":me=lv;break;case"wheel":me=jv;break;case"copy":case"cut":case"paste":me=mv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Dd}var be=(t&4)!==0,Pt=!be&&e==="scroll",O=be?Z!==null?Z+"Capture":null:Z;be=[];for(var D=U,F;D!==null;){F=D;var oe=F.stateNode;if(F.tag===5&&oe!==null&&(F=oe,O!==null&&(oe=Je(D,O),oe!=null&&be.push(Pi(D,oe,F)))),Pt)break;D=D.return}0<be.length&&(Z=new me(Z,ke,null,i,J),te.push({event:Z,listeners:be}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",me=e==="mouseout"||e==="pointerout",Z&&i!==dn&&(ke=i.relatedTarget||i.fromElement)&&(ms(ke)||ke[Nr]))break e;if((me||Z)&&(Z=J.window===J?J:(Z=J.ownerDocument)?Z.defaultView||Z.parentWindow:window,me?(ke=i.relatedTarget||i.toElement,me=U,ke=ke?ms(ke):null,ke!==null&&(Pt=He(ke),ke!==Pt||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(me=null,ke=U),me!==ke)){if(be=Ad,oe="onMouseLeave",O="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(be=Dd,oe="onPointerLeave",O="onPointerEnter",D="pointer"),Pt=me==null?Z:qs(me),F=ke==null?Z:qs(ke),Z=new be(oe,D+"leave",me,i,J),Z.target=Pt,Z.relatedTarget=F,oe=null,ms(J)===U&&(be=new be(O,D+"enter",ke,i,J),be.target=F,be.relatedTarget=Pt,oe=be),Pt=oe,me&&ke)t:{for(be=me,O=ke,D=0,F=be;F;F=Hs(F))D++;for(F=0,oe=O;oe;oe=Hs(oe))F++;for(;0<D-F;)be=Hs(be),D--;for(;0<F-D;)O=Hs(O),F--;for(;D--;){if(be===O||O!==null&&be===O.alternate)break t;be=Hs(be),O=Hs(O)}be=null}else be=null;me!==null&&af(te,Z,me,be,!1),ke!==null&&Pt!==null&&af(te,Pt,ke,be,!0)}}e:{if(Z=U?qs(U):window,me=Z.nodeName&&Z.nodeName.toLowerCase(),me==="select"||me==="input"&&Z.type==="file")var Te=Pv;else if($d(Z))if(Ud)Te=Fv;else{Te=zv;var Ae=Ov}else(me=Z.nodeName)&&me.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(Te=$v);if(Te&&(Te=Te(e,U))){Fd(te,Te,i,J);break e}Ae&&Ae(e,Z,U),e==="focusout"&&(Ae=Z._wrapperState)&&Ae.controlled&&Z.type==="number"&&St(Z,"number",Z.value)}switch(Ae=U?qs(U):window,e){case"focusin":($d(Ae)||Ae.contentEditable==="true")&&(Bs=Ae,zl=U,Di=null);break;case"focusout":Di=zl=Bs=null;break;case"mousedown":$l=!0;break;case"contextmenu":case"mouseup":case"dragend":$l=!1,Yd(te,i,J);break;case"selectionchange":if(Wv)break;case"keydown":case"keyup":Yd(te,i,J)}var Ie;if(Ml)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Us?Od(e,i)&&(Le="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Le="onCompositionStart");Le&&(Md&&i.locale!=="ko"&&(Us||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Us&&(Ie=jd()):(Br=J,_l="value"in Br?Br.value:Br.textContent,Us=!0)),Ae=Bo(U,Le),0<Ae.length&&(Le=new Id(Le,e,null,i,J),te.push({event:Le,listeners:Ae}),Ie?Le.data=Ie:(Ie=zd(i),Ie!==null&&(Le.data=Ie)))),(Ie=Av?Iv(e,i):Dv(e,i))&&(U=Bo(U,"onBeforeInput"),0<U.length&&(J=new Id("onBeforeInput","beforeinput",null,i,J),te.push({event:J,listeners:U}),J.data=Ie))}sf(te,t)})}function Pi(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Bo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Je(e,i),p!=null&&l.unshift(Pi(e,p,d)),p=Je(e,t),p!=null&&l.push(Pi(e,p,d))),e=e.return}return l}function Hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function af(e,t,i,l,d){for(var p=t._reactName,y=[];i!==null&&i!==l;){var N=i,R=N.alternate,U=N.stateNode;if(R!==null&&R===l)break;N.tag===5&&U!==null&&(N=U,d?(R=Je(i,p),R!=null&&y.unshift(Pi(i,R,N))):d||(R=Je(i,p),R!=null&&y.push(Pi(i,R,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var Gv=/\r\n?/g,Kv=/\u0000|\uFFFD/g;function lf(e){return(typeof e=="string"?e:""+e).replace(Gv,`
|
|
38
|
+
`).replace(Kv,"")}function Wo(e,t,i){if(t=lf(t),lf(e)!==t&&i)throw Error(s(425))}function Ho(){}var Vl=null,ql=null;function Gl(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 Kl=typeof setTimeout=="function"?setTimeout:void 0,Yv=typeof clearTimeout=="function"?clearTimeout:void 0,cf=typeof Promise=="function"?Promise:void 0,Xv=typeof queueMicrotask=="function"?queueMicrotask:typeof cf<"u"?function(e){return cf.resolve(null).then(e).catch(Qv)}:Kl;function Qv(e){setTimeout(function(){throw e})}function Yl(e,t){var i=t,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),Ci(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ci(t)}function Hr(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 uf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var Vs=Math.random().toString(36).slice(2),vr="__reactFiber$"+Vs,Oi="__reactProps$"+Vs,Nr="__reactContainer$"+Vs,Xl="__reactEvents$"+Vs,Zv="__reactListeners$"+Vs,Jv="__reactHandles$"+Vs;function ms(e){var t=e[vr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Nr]||i[vr]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=uf(e);e!==null;){if(i=e[vr])return i;e=uf(e)}return t}e=i,i=e.parentNode}return null}function zi(e){return e=e[vr]||e[Nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Vo(e){return e[Oi]||null}var Ql=[],Gs=-1;function Vr(e){return{current:e}}function ft(e){0>Gs||(e.current=Ql[Gs],Ql[Gs]=null,Gs--)}function ct(e,t){Gs++,Ql[Gs]=e.current,e.current=t}var qr={},on=Vr(qr),kn=Vr(!1),gs=qr;function Ks(e,t){var i=e.type.contextTypes;if(!i)return qr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=t[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Sn(e){return e=e.childContextTypes,e!=null}function qo(){ft(kn),ft(on)}function df(e,t,i){if(on.current!==qr)throw Error(s(168));ct(on,t),ct(kn,i)}function ff(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(s(108,Pe(e)||"Unknown",d));return V({},i,l)}function Go(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qr,gs=on.current,ct(on,e),ct(kn,kn.current),!0}function pf(e,t,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=ff(e,t,gs),l.__reactInternalMemoizedMergedChildContext=e,ft(kn),ft(on),ct(on,e)):ft(kn),ct(kn,i)}var Cr=null,Ko=!1,Zl=!1;function hf(e){Cr===null?Cr=[e]:Cr.push(e)}function ey(e){Ko=!0,hf(e)}function Gr(){if(!Zl&&Cr!==null){Zl=!0;var e=0,t=Ge;try{var i=Cr;for(Ge=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}Cr=null,Ko=!1}catch(d){throw Cr!==null&&(Cr=Cr.slice(e+1)),Tt(zr,Gr),d}finally{Ge=t,Zl=!1}}return null}var Ys=[],Xs=0,Yo=null,Xo=0,Vn=[],qn=0,vs=null,Er=1,_r="";function ys(e,t){Ys[Xs++]=Xo,Ys[Xs++]=Yo,Yo=e,Xo=t}function mf(e,t,i){Vn[qn++]=Er,Vn[qn++]=_r,Vn[qn++]=vs,vs=e;var l=Er;e=_r;var d=32-fn(l)-1;l&=~(1<<d),i+=1;var p=32-fn(t)+d;if(30<p){var y=d-d%5;p=(l&(1<<y)-1).toString(32),l>>=y,d-=y,Er=1<<32-fn(t)+d|i<<d|l,_r=p+e}else Er=1<<p|i<<d|l,_r=e}function Jl(e){e.return!==null&&(ys(e,1),mf(e,1,0))}function ec(e){for(;e===Yo;)Yo=Ys[--Xs],Ys[Xs]=null,Xo=Ys[--Xs],Ys[Xs]=null;for(;e===vs;)vs=Vn[--qn],Vn[qn]=null,_r=Vn[--qn],Vn[qn]=null,Er=Vn[--qn],Vn[qn]=null}var Pn=null,On=null,xt=!1,ir=null;function gf(e,t){var i=Xn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function vf(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Pn=e,On=Hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,On=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=vs!==null?{id:Er,overflow:_r}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Xn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Pn=e,On=null,!0):!1;default:return!1}}function tc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(xt){var t=On;if(t){var i=t;if(!vf(e,t)){if(tc(e))throw Error(s(418));t=Hr(i.nextSibling);var l=Pn;t&&vf(e,t)?gf(l,i):(e.flags=e.flags&-4097|2,xt=!1,Pn=e)}}else{if(tc(e))throw Error(s(418));e.flags=e.flags&-4097|2,xt=!1,Pn=e}}}function yf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function Qo(e){if(e!==Pn)return!1;if(!xt)return yf(e),xt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gl(e.type,e.memoizedProps)),t&&(t=On)){if(tc(e))throw xf(),Error(s(418));for(;t;)gf(e,t),t=Hr(t.nextSibling)}if(yf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){On=Hr(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}On=null}}else On=Pn?Hr(e.stateNode.nextSibling):null;return!0}function xf(){for(var e=On;e;)e=Hr(e.nextSibling)}function Qs(){On=Pn=null,xt=!1}function rc(e){ir===null?ir=[e]:ir.push(e)}var ty=$.ReactCurrentBatchConfig;function $i(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var l=i.stateNode}if(!l)throw Error(s(147,e));var d=l,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(y){var N=d.refs;y===null?delete N[p]:N[p]=y},t._stringRef=p,t)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Zo(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wf(e){var t=e._init;return t(e._payload)}function kf(e){function t(O,D){if(e){var F=O.deletions;F===null?(O.deletions=[D],O.flags|=16):F.push(D)}}function i(O,D){if(!e)return null;for(;D!==null;)t(O,D),D=D.sibling;return null}function l(O,D){for(O=new Map;D!==null;)D.key!==null?O.set(D.key,D):O.set(D.index,D),D=D.sibling;return O}function d(O,D){return O=ts(O,D),O.index=0,O.sibling=null,O}function p(O,D,F){return O.index=F,e?(F=O.alternate,F!==null?(F=F.index,F<D?(O.flags|=2,D):F):(O.flags|=2,D)):(O.flags|=1048576,D)}function y(O){return e&&O.alternate===null&&(O.flags|=2),O}function N(O,D,F,oe){return D===null||D.tag!==6?(D=Kc(F,O.mode,oe),D.return=O,D):(D=d(D,F),D.return=O,D)}function R(O,D,F,oe){var Te=F.type;return Te===G?J(O,D,F.props.children,oe,F.key):D!==null&&(D.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===re&&wf(Te)===D.type)?(oe=d(D,F.props),oe.ref=$i(O,D,F),oe.return=O,oe):(oe=Sa(F.type,F.key,F.props,null,O.mode,oe),oe.ref=$i(O,D,F),oe.return=O,oe)}function U(O,D,F,oe){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Yc(F,O.mode,oe),D.return=O,D):(D=d(D,F.children||[]),D.return=O,D)}function J(O,D,F,oe,Te){return D===null||D.tag!==7?(D=Cs(F,O.mode,oe,Te),D.return=O,D):(D=d(D,F),D.return=O,D)}function te(O,D,F){if(typeof D=="string"&&D!==""||typeof D=="number")return D=Kc(""+D,O.mode,F),D.return=O,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case W:return F=Sa(D.type,D.key,D.props,null,O.mode,F),F.ref=$i(O,null,D),F.return=O,F;case Y:return D=Yc(D,O.mode,F),D.return=O,D;case re:var oe=D._init;return te(O,oe(D._payload),F)}if(Mt(D)||X(D))return D=Cs(D,O.mode,F,null),D.return=O,D;Zo(O,D)}return null}function Z(O,D,F,oe){var Te=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Te!==null?null:N(O,D,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Te?R(O,D,F,oe):null;case Y:return F.key===Te?U(O,D,F,oe):null;case re:return Te=F._init,Z(O,D,Te(F._payload),oe)}if(Mt(F)||X(F))return Te!==null?null:J(O,D,F,oe,null);Zo(O,F)}return null}function me(O,D,F,oe,Te){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return O=O.get(F)||null,N(D,O,""+oe,Te);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case W:return O=O.get(oe.key===null?F:oe.key)||null,R(D,O,oe,Te);case Y:return O=O.get(oe.key===null?F:oe.key)||null,U(D,O,oe,Te);case re:var Ae=oe._init;return me(O,D,F,Ae(oe._payload),Te)}if(Mt(oe)||X(oe))return O=O.get(F)||null,J(D,O,oe,Te,null);Zo(D,oe)}return null}function ke(O,D,F,oe){for(var Te=null,Ae=null,Ie=D,Le=D=0,Xt=null;Ie!==null&&Le<F.length;Le++){Ie.index>Le?(Xt=Ie,Ie=null):Xt=Ie.sibling;var Ze=Z(O,Ie,F[Le],oe);if(Ze===null){Ie===null&&(Ie=Xt);break}e&&Ie&&Ze.alternate===null&&t(O,Ie),D=p(Ze,D,Le),Ae===null?Te=Ze:Ae.sibling=Ze,Ae=Ze,Ie=Xt}if(Le===F.length)return i(O,Ie),xt&&ys(O,Le),Te;if(Ie===null){for(;Le<F.length;Le++)Ie=te(O,F[Le],oe),Ie!==null&&(D=p(Ie,D,Le),Ae===null?Te=Ie:Ae.sibling=Ie,Ae=Ie);return xt&&ys(O,Le),Te}for(Ie=l(O,Ie);Le<F.length;Le++)Xt=me(Ie,O,Le,F[Le],oe),Xt!==null&&(e&&Xt.alternate!==null&&Ie.delete(Xt.key===null?Le:Xt.key),D=p(Xt,D,Le),Ae===null?Te=Xt:Ae.sibling=Xt,Ae=Xt);return e&&Ie.forEach(function(ns){return t(O,ns)}),xt&&ys(O,Le),Te}function be(O,D,F,oe){var Te=X(F);if(typeof Te!="function")throw Error(s(150));if(F=Te.call(F),F==null)throw Error(s(151));for(var Ae=Te=null,Ie=D,Le=D=0,Xt=null,Ze=F.next();Ie!==null&&!Ze.done;Le++,Ze=F.next()){Ie.index>Le?(Xt=Ie,Ie=null):Xt=Ie.sibling;var ns=Z(O,Ie,Ze.value,oe);if(ns===null){Ie===null&&(Ie=Xt);break}e&&Ie&&ns.alternate===null&&t(O,Ie),D=p(ns,D,Le),Ae===null?Te=ns:Ae.sibling=ns,Ae=ns,Ie=Xt}if(Ze.done)return i(O,Ie),xt&&ys(O,Le),Te;if(Ie===null){for(;!Ze.done;Le++,Ze=F.next())Ze=te(O,Ze.value,oe),Ze!==null&&(D=p(Ze,D,Le),Ae===null?Te=Ze:Ae.sibling=Ze,Ae=Ze);return xt&&ys(O,Le),Te}for(Ie=l(O,Ie);!Ze.done;Le++,Ze=F.next())Ze=me(Ie,O,Le,Ze.value,oe),Ze!==null&&(e&&Ze.alternate!==null&&Ie.delete(Ze.key===null?Le:Ze.key),D=p(Ze,D,Le),Ae===null?Te=Ze:Ae.sibling=Ze,Ae=Ze);return e&&Ie.forEach(function(My){return t(O,My)}),xt&&ys(O,Le),Te}function Pt(O,D,F,oe){if(typeof F=="object"&&F!==null&&F.type===G&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var Te=F.key,Ae=D;Ae!==null;){if(Ae.key===Te){if(Te=F.type,Te===G){if(Ae.tag===7){i(O,Ae.sibling),D=d(Ae,F.props.children),D.return=O,O=D;break e}}else if(Ae.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===re&&wf(Te)===Ae.type){i(O,Ae.sibling),D=d(Ae,F.props),D.ref=$i(O,Ae,F),D.return=O,O=D;break e}i(O,Ae);break}else t(O,Ae);Ae=Ae.sibling}F.type===G?(D=Cs(F.props.children,O.mode,oe,F.key),D.return=O,O=D):(oe=Sa(F.type,F.key,F.props,null,O.mode,oe),oe.ref=$i(O,D,F),oe.return=O,O=oe)}return y(O);case Y:e:{for(Ae=F.key;D!==null;){if(D.key===Ae)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){i(O,D.sibling),D=d(D,F.children||[]),D.return=O,O=D;break e}else{i(O,D);break}else t(O,D);D=D.sibling}D=Yc(F,O.mode,oe),D.return=O,O=D}return y(O);case re:return Ae=F._init,Pt(O,D,Ae(F._payload),oe)}if(Mt(F))return ke(O,D,F,oe);if(X(F))return be(O,D,F,oe);Zo(O,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,D!==null&&D.tag===6?(i(O,D.sibling),D=d(D,F),D.return=O,O=D):(i(O,D),D=Kc(F,O.mode,oe),D.return=O,O=D),y(O)):i(O,D)}return Pt}var Zs=kf(!0),Sf=kf(!1),Jo=Vr(null),ea=null,Js=null,sc=null;function ic(){sc=Js=ea=null}function oc(e){var t=Jo.current;ft(Jo),e._currentValue=t}function ac(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function ei(e,t){ea=e,sc=Js=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(bn=!0),e.firstContext=null)}function Gn(e){var t=e._currentValue;if(sc!==e)if(e={context:e,memoizedValue:t,next:null},Js===null){if(ea===null)throw Error(s(308));Js=e,ea.dependencies={lanes:0,firstContext:e}}else Js=Js.next=e;return t}var xs=null;function lc(e){xs===null?xs=[e]:xs.push(e)}function bf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,lc(t)):(i.next=d.next,d.next=i),t.interleaved=i,jr(e,l)}function jr(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Kr=!1;function cc(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 Rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yr(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,jr(e,i)}return d=l.interleaved,d===null?(t.next=t,lc(l)):(t.next=d.next,d.next=t),l.interleaved=t,jr(e,i)}function ta(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Fr(e,i)}}function Nf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var y={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=y:p=p.next=y,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function na(e,t,i,l){var d=e.updateQueue;Kr=!1;var p=d.firstBaseUpdate,y=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var R=N,U=R.next;R.next=null,y===null?p=U:y.next=U,y=R;var J=e.alternate;J!==null&&(J=J.updateQueue,N=J.lastBaseUpdate,N!==y&&(N===null?J.firstBaseUpdate=U:N.next=U,J.lastBaseUpdate=R))}if(p!==null){var te=d.baseState;y=0,J=U=R=null,N=p;do{var Z=N.lane,me=N.eventTime;if((l&Z)===Z){J!==null&&(J=J.next={eventTime:me,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var ke=e,be=N;switch(Z=t,me=i,be.tag){case 1:if(ke=be.payload,typeof ke=="function"){te=ke.call(me,te,Z);break e}te=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=be.payload,Z=typeof ke=="function"?ke.call(me,te,Z):ke,Z==null)break e;te=V({},te,Z);break e;case 2:Kr=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,Z=d.effects,Z===null?d.effects=[N]:Z.push(N))}else me={eventTime:me,lane:Z,tag:N.tag,payload:N.payload,callback:N.callback,next:null},J===null?(U=J=me,R=te):J=J.next=me,y|=Z;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);if(J===null&&(R=te),d.baseState=R,d.firstBaseUpdate=U,d.lastBaseUpdate=J,t=d.shared.interleaved,t!==null){d=t;do y|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);Ss|=y,e.lanes=y,e.memoizedState=te}}function Cf(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(s(191,d));d.call(l)}}}var Fi={},yr=Vr(Fi),Ui=Vr(Fi),Bi=Vr(Fi);function ws(e){if(e===Fi)throw Error(s(174));return e}function uc(e,t){switch(ct(Bi,t),ct(Ui,e),ct(yr,Fi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ht(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ht(t,e)}ft(yr),ct(yr,t)}function ti(){ft(yr),ft(Ui),ft(Bi)}function Ef(e){ws(Bi.current);var t=ws(yr.current),i=ht(t,e.type);t!==i&&(ct(Ui,e),ct(yr,i))}function dc(e){Ui.current===e&&(ft(yr),ft(Ui))}var _t=Vr(0);function ra(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.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 fc=[];function pc(){for(var e=0;e<fc.length;e++)fc[e]._workInProgressVersionPrimary=null;fc.length=0}var sa=$.ReactCurrentDispatcher,hc=$.ReactCurrentBatchConfig,ks=0,jt=null,Ut=null,Kt=null,ia=!1,Wi=!1,Hi=0,ny=0;function an(){throw Error(s(321))}function mc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!sr(e[i],t[i]))return!1;return!0}function gc(e,t,i,l,d,p){if(ks=p,jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,sa.current=e===null||e.memoizedState===null?oy:ay,e=i(l,d),Wi){p=0;do{if(Wi=!1,Hi=0,25<=p)throw Error(s(301));p+=1,Kt=Ut=null,t.updateQueue=null,sa.current=ly,e=i(l,d)}while(Wi)}if(sa.current=la,t=Ut!==null&&Ut.next!==null,ks=0,Kt=Ut=jt=null,ia=!1,t)throw Error(s(300));return e}function vc(){var e=Hi!==0;return Hi=0,e}function xr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?jt.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Kn(){if(Ut===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Kt===null?jt.memoizedState:Kt.next;if(t!==null)Kt=t,Ut=e;else{if(e===null)throw Error(s(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Kt===null?jt.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Vi(e,t){return typeof t=="function"?t(e):t}function yc(e){var t=Kn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=Ut,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var y=d.next;d.next=p.next,p.next=y}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var N=y=null,R=null,U=p;do{var J=U.lane;if((ks&J)===J)R!==null&&(R=R.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var te={lane:J,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};R===null?(N=R=te,y=l):R=R.next=te,jt.lanes|=J,Ss|=J}U=U.next}while(U!==null&&U!==p);R===null?y=l:R.next=N,sr(l,t.memoizedState)||(bn=!0),t.memoizedState=l,t.baseState=y,t.baseQueue=R,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,jt.lanes|=p,Ss|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function xc(e){var t=Kn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var y=d=d.next;do p=e(p,y.action),y=y.next;while(y!==d);sr(p,t.memoizedState)||(bn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function _f(){}function jf(e,t){var i=jt,l=Kn(),d=t(),p=!sr(l.memoizedState,d);if(p&&(l.memoizedState=d,bn=!0),l=l.queue,wc(If.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Kt!==null&&Kt.memoizedState.tag&1){if(i.flags|=2048,qi(9,Af.bind(null,i,l,d,t),void 0,null),Yt===null)throw Error(s(349));(ks&30)!==0||Rf(i,t,d)}return d}function Rf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Af(e,t,i,l){t.value=i,t.getSnapshot=l,Df(t)&&Mf(e)}function If(e,t,i){return i(function(){Df(t)&&Mf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!sr(e,i)}catch{return!0}}function Mf(e){var t=jr(e,1);t!==null&&cr(t,e,1,-1)}function Lf(e){var t=xr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:e},t.queue=e,e=e.dispatch=iy.bind(null,jt,e),[t.memoizedState,e]}function qi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function Pf(){return Kn().memoizedState}function oa(e,t,i,l){var d=xr();jt.flags|=e,d.memoizedState=qi(1|t,i,void 0,l===void 0?null:l)}function aa(e,t,i,l){var d=Kn();l=l===void 0?null:l;var p=void 0;if(Ut!==null){var y=Ut.memoizedState;if(p=y.destroy,l!==null&&mc(l,y.deps)){d.memoizedState=qi(t,i,p,l);return}}jt.flags|=e,d.memoizedState=qi(1|t,i,p,l)}function Of(e,t){return oa(8390656,8,e,t)}function wc(e,t){return aa(2048,8,e,t)}function zf(e,t){return aa(4,2,e,t)}function $f(e,t){return aa(4,4,e,t)}function Ff(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 Uf(e,t,i){return i=i!=null?i.concat([e]):null,aa(4,4,Ff.bind(null,t,e),i)}function kc(){}function Bf(e,t){var i=Kn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&mc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Wf(e,t){var i=Kn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&mc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Hf(e,t,i){return(ks&21)===0?(e.baseState&&(e.baseState=!1,bn=!0),e.memoizedState=i):(sr(i,t)||(i=Si(),jt.lanes|=i,Ss|=i,e.baseState=!0),t)}function ry(e,t){var i=Ge;Ge=i!==0&&4>i?i:4,e(!0);var l=hc.transition;hc.transition={};try{e(!1),t()}finally{Ge=i,hc.transition=l}}function Vf(){return Kn().memoizedState}function sy(e,t,i){var l=Jr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},qf(e))Gf(t,i);else if(i=bf(e,t,i,l),i!==null){var d=mn();cr(i,e,l,d),Kf(i,t,l)}}function iy(e,t,i){var l=Jr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(qf(e))Gf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var y=t.lastRenderedState,N=p(y,i);if(d.hasEagerState=!0,d.eagerState=N,sr(N,y)){var R=t.interleaved;R===null?(d.next=d,lc(t)):(d.next=R.next,R.next=d),t.interleaved=d;return}}catch{}finally{}i=bf(e,t,d,l),i!==null&&(d=mn(),cr(i,e,l,d),Kf(i,t,l))}}function qf(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function Gf(e,t){Wi=ia=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Kf(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Fr(e,i)}}var la={readContext:Gn,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useInsertionEffect:an,useLayoutEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useMutableSource:an,useSyncExternalStore:an,useId:an,unstable_isNewReconciler:!1},oy={readContext:Gn,useCallback:function(e,t){return xr().memoizedState=[e,t===void 0?null:t],e},useContext:Gn,useEffect:Of,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,oa(4194308,4,Ff.bind(null,t,e),i)},useLayoutEffect:function(e,t){return oa(4194308,4,e,t)},useInsertionEffect:function(e,t){return oa(4,2,e,t)},useMemo:function(e,t){var i=xr();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=xr();return t=i!==void 0?i(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=sy.bind(null,jt,e),[l.memoizedState,e]},useRef:function(e){var t=xr();return e={current:e},t.memoizedState=e},useState:Lf,useDebugValue:kc,useDeferredValue:function(e){return xr().memoizedState=e},useTransition:function(){var e=Lf(!1),t=e[0];return e=ry.bind(null,e[1]),xr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=jt,d=xr();if(xt){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Yt===null)throw Error(s(349));(ks&30)!==0||Rf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,Of(If.bind(null,l,p,e),[e]),l.flags|=2048,qi(9,Af.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=xr(),t=Yt.identifierPrefix;if(xt){var i=_r,l=Er;i=(l&~(1<<32-fn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Hi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=ny++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ay={readContext:Gn,useCallback:Bf,useContext:Gn,useEffect:wc,useImperativeHandle:Uf,useInsertionEffect:zf,useLayoutEffect:$f,useMemo:Wf,useReducer:yc,useRef:Pf,useState:function(){return yc(Vi)},useDebugValue:kc,useDeferredValue:function(e){var t=Kn();return Hf(t,Ut.memoizedState,e)},useTransition:function(){var e=yc(Vi)[0],t=Kn().memoizedState;return[e,t]},useMutableSource:_f,useSyncExternalStore:jf,useId:Vf,unstable_isNewReconciler:!1},ly={readContext:Gn,useCallback:Bf,useContext:Gn,useEffect:wc,useImperativeHandle:Uf,useInsertionEffect:zf,useLayoutEffect:$f,useMemo:Wf,useReducer:xc,useRef:Pf,useState:function(){return xc(Vi)},useDebugValue:kc,useDeferredValue:function(e){var t=Kn();return Ut===null?t.memoizedState=e:Hf(t,Ut.memoizedState,e)},useTransition:function(){var e=xc(Vi)[0],t=Kn().memoizedState;return[e,t]},useMutableSource:_f,useSyncExternalStore:jf,useId:Vf,unstable_isNewReconciler:!1};function or(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function Sc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:V({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ca={isMounted:function(e){return(e=e._reactInternals)?He(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=mn(),d=Jr(e),p=Rr(l,d);p.payload=t,i!=null&&(p.callback=i),t=Yr(e,p,d),t!==null&&(cr(t,e,d,l),ta(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=mn(),d=Jr(e),p=Rr(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Yr(e,p,d),t!==null&&(cr(t,e,d,l),ta(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=mn(),l=Jr(e),d=Rr(i,l);d.tag=2,t!=null&&(d.callback=t),t=Yr(e,d,l),t!==null&&(cr(t,e,l,i),ta(t,e,l))}};function Yf(e,t,i,l,d,p,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,y):t.prototype&&t.prototype.isPureReactComponent?!Ii(i,l)||!Ii(d,p):!0}function Xf(e,t,i){var l=!1,d=qr,p=t.contextType;return typeof p=="object"&&p!==null?p=Gn(p):(d=Sn(t)?gs:on.current,l=t.contextTypes,p=(l=l!=null)?Ks(e,d):qr),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ca,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Qf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&ca.enqueueReplaceState(t,t.state,null)}function bc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},cc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Gn(p):(p=Sn(t)?gs:on.current,d.context=Ks(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(Sc(e,t,p,i),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&&ca.enqueueReplaceState(d,d.state,null),na(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function ni(e,t){try{var i="",l=t;do i+=le(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
39
|
Error generating stack: `+p.message+`
|
|
40
|
-
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function Tc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function Nc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var ly=typeof WeakMap=="function"?WeakMap:Map;function Zf(e,t,i){i=Rr(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){ga||(ga=!0,Fc=l),Nc(e,t)},i}function Jf(e,t,i){i=Rr(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=t.value;i.payload=function(){return l(d)},i.callback=function(){Nc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Nc(e,t),typeof l!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var y=t.stack;this.componentDidCatch(t.value,{componentStack:y!==null?y:""})}),i}function ep(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new ly;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(i)||(d.add(i),e=Sy.bind(null,e,t,i),t.then(e,e))}function tp(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 np(e,t,i,l,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=Rr(-1,1),t.tag=2,Yr(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var cy=$.ReactCurrentOwner,bn=!1;function hn(e,t,i,l){t.child=e===null?Sf(t,null,i,l):Zs(t,e.child,i,l)}function rp(e,t,i,l,d){i=i.render;var p=t.ref;return ei(t,d),l=gc(e,t,i,l,p,d),i=vc(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ar(e,t,d)):(xt&&i&&Jl(t),t.flags|=1,hn(e,t,l,d),t.child)}function sp(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Gc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,ip(e,t,p,l,d)):(e=Sa(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var y=p.memoizedProps;if(i=i.compare,i=i!==null?i:Ii,i(y,l)&&e.ref===t.ref)return Ar(e,t,d)}return t.flags|=1,e=ts(p,l),e.ref=t.ref,e.return=t,t.child=e}function ip(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(Ii(p,l)&&e.ref===t.ref)if(bn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(bn=!0);else return t.lanes=e.lanes,Ar(e,t,d)}return Cc(e,t,i,l,d)}function op(e,t,i){var l=t.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(si,zn),zn|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(si,zn),zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ct(si,zn),zn|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ct(si,zn),zn|=l;return hn(e,t,d,i),t.child}function ap(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Cc(e,t,i,l,d){var p=Sn(i)?gs:on.current;return p=Ks(t,p),ei(t,d),i=gc(e,t,i,l,p,d),l=vc(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ar(e,t,d)):(xt&&l&&Jl(t),t.flags|=1,hn(e,t,i,d),t.child)}function lp(e,t,i,l,d){if(Sn(i)){var p=!0;Go(t)}else p=!1;if(ei(t,d),t.stateNode===null)da(e,t),Xf(t,i,l),bc(t,i,l,d),l=!0;else if(e===null){var y=t.stateNode,N=t.memoizedProps;y.props=N;var R=y.context,U=i.contextType;typeof U=="object"&&U!==null?U=qn(U):(U=Sn(i)?gs:on.current,U=Ks(t,U));var J=i.getDerivedStateFromProps,te=typeof J=="function"||typeof y.getSnapshotBeforeUpdate=="function";te||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==l||R!==U)&&Qf(t,y,l,U),Kr=!1;var Z=t.memoizedState;y.state=Z,na(t,l,y,d),R=t.memoizedState,N!==l||Z!==R||kn.current||Kr?(typeof J=="function"&&(Sc(t,i,J,l),R=t.memoizedState),(N=Kr||Yf(t,i,N,l,Z,R,U))?(te||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(t.flags|=4194308)):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),y.props=l,y.state=R,y.context=U,l=N):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{y=t.stateNode,Tf(e,t),N=t.memoizedProps,U=t.type===t.elementType?N:sr(t.type,N),y.props=U,te=t.pendingProps,Z=y.context,R=i.contextType,typeof R=="object"&&R!==null?R=qn(R):(R=Sn(i)?gs:on.current,R=Ks(t,R));var me=i.getDerivedStateFromProps;(J=typeof me=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==te||Z!==R)&&Qf(t,y,l,R),Kr=!1,Z=t.memoizedState,y.state=Z,na(t,l,y,d);var ke=t.memoizedState;N!==te||Z!==ke||kn.current||Kr?(typeof me=="function"&&(Sc(t,i,me,l),ke=t.memoizedState),(U=Kr||Yf(t,i,U,l,Z,ke,R)||!1)?(J||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,ke,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,ke,R)),typeof y.componentDidUpdate=="function"&&(t.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ke),y.props=l,y.state=ke,y.context=R,l=U):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),l=!1)}return Ec(e,t,i,l,p,d)}function Ec(e,t,i,l,d,p){ap(e,t);var y=(t.flags&128)!==0;if(!l&&!y)return d&&pf(t,i,!1),Ar(e,t,p);l=t.stateNode,cy.current=t;var N=y&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&y?(t.child=Zs(t,e.child,null,p),t.child=Zs(t,null,N,p)):hn(e,t,N,p),t.memoizedState=l.state,d&&pf(t,i,!0),t.child}function cp(e){var t=e.stateNode;t.pendingContext?df(e,t.pendingContext,t.pendingContext!==t.context):t.context&&df(e,t.context,!1),uc(e,t.containerInfo)}function up(e,t,i,l,d){return Qs(),rc(d),t.flags|=256,hn(e,t,i,l),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0};function jc(e){return{baseLanes:e,cachePool:null,transitions:null}}function dp(e,t,i){var l=t.pendingProps,d=_t.current,p=!1,y=(t.flags&128)!==0,N;if((N=y)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ct(_t,d&1),e===null)return nc(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):(y=l.children,e=l.fallback,p?(l=t.mode,p=t.child,y={mode:"hidden",children:y},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=y):p=ba(y,l,0,null),e=Cs(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=jc(i),t.memoizedState=_c,e):Rc(t,y));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return uy(e,t,y,l,N,d,i);if(p){p=l.fallback,y=t.mode,d=e.child,N=d.sibling;var R={mode:"hidden",children:l.children};return(y&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=R,t.deletions=null):(l=ts(d,R),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=ts(N,p):(p=Cs(p,y,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,y=e.child.memoizedState,y=y===null?jc(i):{baseLanes:y.baseLanes|i,cachePool:null,transitions:y.transitions},p.memoizedState=y,p.childLanes=e.childLanes&~i,t.memoizedState=_c,l}return p=e.child,e=p.sibling,l=ts(p,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=i),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l}function Rc(e,t){return t=ba({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ua(e,t,i,l){return l!==null&&rc(l),Zs(t,e.child,null,i),e=Rc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uy(e,t,i,l,d,p,y){if(i)return t.flags&256?(t.flags&=-257,l=Tc(Error(s(422))),ua(e,t,y,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=ba({mode:"visible",children:l.children},d,0,null),p=Cs(p,d,y,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Zs(t,e.child,null,y),t.child.memoizedState=jc(y),t.memoizedState=_c,p);if((t.mode&1)===0)return ua(e,t,y,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(s(419)),l=Tc(p,l,void 0),ua(e,t,y,l)}if(N=(y&e.childLanes)!==0,bn||N){if(l=Yt,l!==null){switch(y&-y){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&(l.suspendedLanes|y))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,jr(e,d),ar(l,e,d,-1))}return qc(),l=Tc(Error(s(421))),ua(e,t,y,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=by.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,On=Hr(d.nextSibling),Pn=t,xt=!0,rr=null,e!==null&&(Hn[Vn++]=Er,Hn[Vn++]=_r,Hn[Vn++]=vs,Er=e.id,_r=e.overflow,vs=t),t=Rc(t,l.children),t.flags|=4096,t)}function fp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ac(e.return,t,i)}function Ac(e,t,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function pp(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(hn(e,t,l.children,i),l=_t.current,(l&2)!==0)l=l&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&&fp(e,i,t);else if(e.tag===19)fp(e,i,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}l&=1}if(ct(_t,l),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&ra(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Ac(t,!1,d,i,p);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&ra(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Ac(t,!0,i,null,p);break;case"together":Ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function da(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ar(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ss|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=ts(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ts(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function dy(e,t,i){switch(t.tag){case 3:cp(t),Qs();break;case 5:Ef(t);break;case 1:Sn(t.type)&&Go(t);break;case 4:uc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ct(Jo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ct(_t,_t.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?dp(e,t,i):(ct(_t,_t.current&1),e=Ar(e,t,i),e!==null?e.sibling:null);ct(_t,_t.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return pp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ct(_t,_t.current),l)break;return null;case 22:case 23:return t.lanes=0,op(e,t,i)}return Ar(e,t,i)}var hp,Ic,mp,gp;hp=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Ic=function(){},mp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ws(yr.current);var p=null;switch(i){case"input":d=$e(e,d),l=$e(e,l),p=[];break;case"select":d=V({},d,{value:void 0}),l=V({},l,{value:void 0}),p=[];break;case"textarea":d=en(e,d),l=en(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Ho)}Rn(i,l);var y;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var N=d[U];for(y in N)N.hasOwnProperty(y)&&(i||(i={}),i[y]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var R=l[U];if(N=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&R!==N&&(R!=null||N!=null))if(U==="style")if(N){for(y in N)!N.hasOwnProperty(y)||R&&R.hasOwnProperty(y)||(i||(i={}),i[y]="");for(y in R)R.hasOwnProperty(y)&&N[y]!==R[y]&&(i||(i={}),i[y]=R[y])}else i||(p||(p=[]),p.push(U,i)),i=R;else U==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,N=N?N.__html:void 0,R!=null&&N!==R&&(p=p||[]).push(U,R)):U==="children"?typeof R!="string"&&typeof R!="number"||(p=p||[]).push(U,""+R):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(R!=null&&U==="onScroll"&&dt("scroll",e),p||N===R||(p=[])):(p=p||[]).push(U,R))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},gp=function(e,t,i,l){i!==l&&(t.flags|=4)};function Gi(e,t){if(!xt)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ln(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function fy(e,t,i){var l=t.pendingProps;switch(ec(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return Sn(t.type)&&qo(),ln(t),null;case 3:return l=t.stateNode,ti(),ft(kn),ft(on),pc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Qo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,rr!==null&&(Wc(rr),rr=null))),Ic(e,t),ln(t),null;case 5:dc(t);var d=ws(Bi.current);if(i=t.type,e!==null&&t.stateNode!=null)mp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ln(t),null}if(e=ws(yr.current),Qo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[vr]=t,l[Oi]=p,e=(t.mode&1)!==0,i){case"dialog":dt("cancel",l),dt("close",l);break;case"iframe":case"object":case"embed":dt("load",l);break;case"video":case"audio":for(d=0;d<Mi.length;d++)dt(Mi[d],l);break;case"source":dt("error",l);break;case"img":case"image":case"link":dt("error",l),dt("load",l);break;case"details":dt("toggle",l);break;case"input":It(l,p),dt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},dt("invalid",l);break;case"textarea":H(l,p),dt("invalid",l)}Rn(i,p),d=null;for(var y in p)if(p.hasOwnProperty(y)){var N=p[y];y==="children"?typeof N=="string"?l.textContent!==N&&(p.suppressHydrationWarning!==!0&&Wo(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&Wo(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(y)&&N!=null&&y==="onScroll"&&dt("scroll",l)}switch(i){case"input":it(l),_n(l,p,!0);break;case"textarea":it(l),Ue(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Ho)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{y=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=y.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=y.createElement(i,{is:l.is}):(e=y.createElement(i),i==="select"&&(y=e,l.multiple?y.multiple=!0:l.size&&(y.size=l.size))):e=y.createElementNS(e,i),e[vr]=t,e[Oi]=l,hp(e,t,!1,!1),t.stateNode=e;e:{switch(y=An(i,l),i){case"dialog":dt("cancel",e),dt("close",e),d=l;break;case"iframe":case"object":case"embed":dt("load",e),d=l;break;case"video":case"audio":for(d=0;d<Mi.length;d++)dt(Mi[d],e);d=l;break;case"source":dt("error",e),d=l;break;case"img":case"image":case"link":dt("error",e),dt("load",e),d=l;break;case"details":dt("toggle",e),d=l;break;case"input":It(e,l),d=$e(e,l),dt("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=V({},l,{value:void 0}),dt("invalid",e);break;case"textarea":H(e,l),d=en(e,l),dt("invalid",e);break;default:d=l}Rn(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var R=N[p];p==="style"?br(e,R):p==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Rt(e,R)):p==="children"?typeof R=="string"?(i!=="textarea"||R!=="")&&Ht(e,R):typeof R=="number"&&Ht(e,""+R):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?R!=null&&p==="onScroll"&&dt("scroll",e):R!=null&&B(e,p,R,y))}switch(i){case"input":it(e),_n(e,l,!1);break;case"textarea":it(e),Ue(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ce(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?pt(e,!!l.multiple,p,!1):l.defaultValue!=null&&pt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Ho)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ln(t),null;case 6:if(e&&t.stateNode!=null)gp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(i=ws(Bi.current),ws(yr.current),Qo(t)){if(l=t.stateNode,i=t.memoizedProps,l[vr]=t,(p=l.nodeValue!==i)&&(e=Pn,e!==null))switch(e.tag){case 3:Wo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[vr]=t,t.stateNode=l}return ln(t),null;case 13:if(ft(_t),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&On!==null&&(t.mode&1)!==0&&(t.flags&128)===0)xf(),Qs(),t.flags|=98560,p=!1;else if(p=Qo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[vr]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else rr!==null&&(Wc(rr),rr=null),p=!0;if(!p)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=i,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(_t.current&1)!==0?Bt===0&&(Bt=3):qc())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return ti(),Ic(e,t),e===null&&Li(t.stateNode.containerInfo),ln(t),null;case 10:return oc(t.type._context),ln(t),null;case 17:return Sn(t.type)&&qo(),ln(t),null;case 19:if(ft(_t),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,y=p.rendering,y===null)if(l)Gi(p,!1);else{if(Bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(y=ra(e),y!==null){for(t.flags|=128,Gi(p,!1),l=y.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)p=i,e=l,p.flags&=14680066,y=p.alternate,y===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=y.childLanes,p.lanes=y.lanes,p.child=y.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=y.memoizedProps,p.memoizedState=y.memoizedState,p.updateQueue=y.updateQueue,p.type=y.type,e=y.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ct(_t,_t.current&1|2),t.child}e=e.sibling}p.tail!==null&&Nt()>ii&&(t.flags|=128,l=!0,Gi(p,!1),t.lanes=4194304)}else{if(!l)if(e=ra(y),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Gi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!xt)return ln(t),null}else 2*Nt()-p.renderingStartTime>ii&&i!==1073741824&&(t.flags|=128,l=!0,Gi(p,!1),t.lanes=4194304);p.isBackwards?(y.sibling=t.child,t.child=y):(i=p.last,i!==null?i.sibling=y:t.child=y,p.last=y)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=Nt(),t.sibling=null,i=_t.current,ct(_t,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return Vc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(zn&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function py(e,t){switch(ec(t),t.tag){case 1:return Sn(t.type)&&qo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(),ft(kn),ft(on),pc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return dc(t),null;case 13:if(ft(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(_t),null;case 4:return ti(),null;case 10:return oc(t.type._context),null;case 22:case 23:return Vc(),null;case 24:return null;default:return null}}var fa=!1,cn=!1,hy=typeof WeakSet=="function"?WeakSet:Set,xe=null;function ri(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){At(e,t,l)}else i.current=null}function Dc(e,t,i){try{i()}catch(l){At(e,t,l)}}var vp=!1;function my(e,t){if(Vl=Io,e=Kd(),Ol(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var y=0,N=-1,R=-1,U=0,J=0,te=e,Z=null;t:for(;;){for(var me;te!==i||d!==0&&te.nodeType!==3||(N=y+d),te!==p||l!==0&&te.nodeType!==3||(R=y+l),te.nodeType===3&&(y+=te.nodeValue.length),(me=te.firstChild)!==null;)Z=te,te=me;for(;;){if(te===e)break t;if(Z===i&&++U===d&&(N=y),Z===p&&++J===l&&(R=y),(me=te.nextSibling)!==null)break;te=Z,Z=te.parentNode}te=me}i=N===-1||R===-1?null:{start:N,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for(ql={focusedElem:e,selectionRange:i},Io=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var ke=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var be=ke.memoizedProps,Pt=ke.memoizedState,O=t.stateNode,D=O.getSnapshotBeforeUpdate(t.elementType===t.type?be:sr(t.type,be),Pt);O.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(oe){At(t,t.return,oe)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return ke=vp,vp=!1,ke}function Ki(e,t,i){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Dc(t,i,p)}d=d.next}while(d!==l)}}function pa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==t)}}function Mc(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function yp(e){var t=e.alternate;t!==null&&(e.alternate=null,yp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vr],delete t[Oi],delete t[Xl],delete t[Qv],delete t[Zv])),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 xp(e){return e.tag===5||e.tag===3||e.tag===4}function wp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xp(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 Lc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Ho));else if(l!==4&&(e=e.child,e!==null))for(Lc(e,t,i),e=e.sibling;e!==null;)Lc(e,t,i),e=e.sibling}function Pc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Pc(e,t,i),e=e.sibling;e!==null;)Pc(e,t,i),e=e.sibling}var tn=null,ir=!1;function Xr(e,t,i){for(i=i.child;i!==null;)kp(e,t,i),i=i.sibling}function kp(e,t,i){if(Mn&&typeof Mn.onCommitFiberUnmount=="function")try{Mn.onCommitFiberUnmount(us,i)}catch{}switch(i.tag){case 5:cn||ri(i,t);case 6:var l=tn,d=ir;tn=null,Xr(e,t,i),tn=l,ir=d,tn!==null&&(ir?(e=tn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):tn.removeChild(i.stateNode));break;case 18:tn!==null&&(ir?(e=tn,i=i.stateNode,e.nodeType===8?Yl(e.parentNode,i):e.nodeType===1&&Yl(e,i),Ci(e)):Yl(tn,i.stateNode));break;case 4:l=tn,d=ir,tn=i.stateNode.containerInfo,ir=!0,Xr(e,t,i),tn=l,ir=d;break;case 0:case 11:case 14:case 15:if(!cn&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,y=p.destroy;p=p.tag,y!==void 0&&((p&2)!==0||(p&4)!==0)&&Dc(i,t,y),d=d.next}while(d!==l)}Xr(e,t,i);break;case 1:if(!cn&&(ri(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){At(i,t,N)}Xr(e,t,i);break;case 21:Xr(e,t,i);break;case 22:i.mode&1?(cn=(l=cn)||i.memoizedState!==null,Xr(e,t,i),cn=l):Xr(e,t,i);break;default:Xr(e,t,i)}}function Sp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new hy),t.forEach(function(l){var d=Ty.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function or(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,y=t,N=y;e:for(;N!==null;){switch(N.tag){case 5:tn=N.stateNode,ir=!1;break e;case 3:tn=N.stateNode.containerInfo,ir=!0;break e;case 4:tn=N.stateNode.containerInfo,ir=!0;break e}N=N.return}if(tn===null)throw Error(s(160));kp(p,y,d),tn=null,ir=!1;var R=d.alternate;R!==null&&(R.return=null),d.return=null}catch(U){At(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bp(t,e),t=t.sibling}function bp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(or(t,e),wr(e),l&4){try{Ki(3,e,e.return),pa(3,e)}catch(be){At(e,e.return,be)}try{Ki(5,e,e.return)}catch(be){At(e,e.return,be)}}break;case 1:or(t,e),wr(e),l&512&&i!==null&&ri(i,i.return);break;case 5:if(or(t,e),wr(e),l&512&&i!==null&&ri(i,i.return),e.flags&32){var d=e.stateNode;try{Ht(d,"")}catch(be){At(e,e.return,be)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,y=i!==null?i.memoizedProps:p,N=e.type,R=e.updateQueue;if(e.updateQueue=null,R!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&Fe(d,p),An(N,y);var U=An(N,p);for(y=0;y<R.length;y+=2){var J=R[y],te=R[y+1];J==="style"?br(d,te):J==="dangerouslySetInnerHTML"?Rt(d,te):J==="children"?Ht(d,te):B(d,J,te,U)}switch(N){case"input":Dt(d,p);break;case"textarea":he(d,p);break;case"select":var Z=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var me=p.value;me!=null?pt(d,!!p.multiple,me,!1):Z!==!!p.multiple&&(p.defaultValue!=null?pt(d,!!p.multiple,p.defaultValue,!0):pt(d,!!p.multiple,p.multiple?[]:"",!1))}d[Oi]=p}catch(be){At(e,e.return,be)}}break;case 6:if(or(t,e),wr(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(be){At(e,e.return,be)}}break;case 3:if(or(t,e),wr(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ci(t.containerInfo)}catch(be){At(e,e.return,be)}break;case 4:or(t,e),wr(e);break;case 13:or(t,e),wr(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||($c=Nt())),l&4&&Sp(e);break;case 22:if(J=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(U=cn)||J,or(t,e),cn=U):or(t,e),wr(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!J&&(e.mode&1)!==0)for(xe=e,J=e.child;J!==null;){for(te=xe=J;xe!==null;){switch(Z=xe,me=Z.child,Z.tag){case 0:case 11:case 14:case 15:Ki(4,Z,Z.return);break;case 1:ri(Z,Z.return);var ke=Z.stateNode;if(typeof ke.componentWillUnmount=="function"){l=Z,i=Z.return;try{t=l,ke.props=t.memoizedProps,ke.state=t.memoizedState,ke.componentWillUnmount()}catch(be){At(l,i,be)}}break;case 5:ri(Z,Z.return);break;case 22:if(Z.memoizedState!==null){Cp(te);continue}}me!==null?(me.return=Z,xe=me):Cp(te)}J=J.sibling}e:for(J=null,te=e;;){if(te.tag===5){if(J===null){J=te;try{d=te.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=te.stateNode,R=te.memoizedProps.style,y=R!=null&&R.hasOwnProperty("display")?R.display:null,N.style.display=Wn("display",y))}catch(be){At(e,e.return,be)}}}else if(te.tag===6){if(J===null)try{te.stateNode.nodeValue=U?"":te.memoizedProps}catch(be){At(e,e.return,be)}}else if((te.tag!==22&&te.tag!==23||te.memoizedState===null||te===e)&&te.child!==null){te.child.return=te,te=te.child;continue}if(te===e)break e;for(;te.sibling===null;){if(te.return===null||te.return===e)break e;J===te&&(J=null),te=te.return}J===te&&(J=null),te.sibling.return=te.return,te=te.sibling}}break;case 19:or(t,e),wr(e),l&4&&Sp(e);break;case 21:break;default:or(t,e),wr(e)}}function wr(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(xp(i)){var l=i;break e}i=i.return}throw Error(s(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(Ht(d,""),l.flags&=-33);var p=wp(e);Pc(e,p,d);break;case 3:case 4:var y=l.stateNode.containerInfo,N=wp(e);Lc(e,N,y);break;default:throw Error(s(161))}}catch(R){At(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gy(e,t,i){xe=e,Tp(e)}function Tp(e,t,i){for(var l=(e.mode&1)!==0;xe!==null;){var d=xe,p=d.child;if(d.tag===22&&l){var y=d.memoizedState!==null||fa;if(!y){var N=d.alternate,R=N!==null&&N.memoizedState!==null||cn;N=fa;var U=cn;if(fa=y,(cn=R)&&!U)for(xe=d;xe!==null;)y=xe,R=y.child,y.tag===22&&y.memoizedState!==null?Ep(d):R!==null?(R.return=y,xe=R):Ep(d);for(;p!==null;)xe=p,Tp(p),p=p.sibling;xe=d,fa=N,cn=U}Np(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,xe=p):Np(e)}}function Np(e){for(;xe!==null;){var t=xe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:cn||pa(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!cn)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:sr(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&Cf(t,p,l);break;case 3:var y=t.updateQueue;if(y!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Cf(t,y,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var R=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&i.focus();break;case"img":R.src&&(i.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var J=U.memoizedState;if(J!==null){var te=J.dehydrated;te!==null&&Ci(te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}cn||t.flags&512&&Mc(t)}catch(Z){At(t,t.return,Z)}}if(t===e){xe=null;break}if(i=t.sibling,i!==null){i.return=t.return,xe=i;break}xe=t.return}}function Cp(e){for(;xe!==null;){var t=xe;if(t===e){xe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,xe=i;break}xe=t.return}}function Ep(e){for(;xe!==null;){var t=xe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{pa(4,t)}catch(R){At(t,i,R)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(R){At(t,d,R)}}var p=t.return;try{Mc(t)}catch(R){At(t,p,R)}break;case 5:var y=t.return;try{Mc(t)}catch(R){At(t,y,R)}}}catch(R){At(t,t.return,R)}if(t===e){xe=null;break}var N=t.sibling;if(N!==null){N.return=t.return,xe=N;break}xe=t.return}}var vy=Math.ceil,ha=$.ReactCurrentDispatcher,Oc=$.ReactCurrentOwner,Kn=$.ReactCurrentBatchConfig,Ye=0,Yt=null,zt=null,nn=0,zn=0,si=Vr(0),Bt=0,Yi=null,Ss=0,ma=0,zc=0,Xi=null,Tn=null,$c=0,ii=1/0,Ir=null,ga=!1,Fc=null,Qr=null,va=!1,Zr=null,ya=0,Qi=0,Uc=null,xa=-1,wa=0;function mn(){return(Ye&6)!==0?Nt():xa!==-1?xa:xa=Nt()}function Jr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&nn!==0?nn&-nn:ey.transition!==null?(wa===0&&(wa=Si()),wa):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:_d(e.type)),e)}function ar(e,t,i,l){if(50<Qi)throw Qi=0,Uc=null,Error(s(185));hs(e,i,l),((Ye&2)===0||e!==Yt)&&(e===Yt&&((Ye&2)===0&&(ma|=i),Bt===4&&es(e,nn)),Nn(e,l),i===1&&Ye===0&&(t.mode&1)===0&&(ii=Nt()+500,Ko&&Gr()))}function Nn(e,t){var i=e.callbackNode;jo(e,t);var l=ps(e,e===Yt?nn:0);if(l===0)i!==null&&tr(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&tr(i),t===1)e.tag===0?Jv(jp.bind(null,e)):hf(jp.bind(null,e)),Yv(function(){(Ye&6)===0&&Gr()}),i=null;else{switch(ie(l)){case 1:i=zr;break;case 4:i=gr;break;case 16:i=Ls;break;case 536870912:i=Eo;break;default:i=Ls}i=Op(i,_p.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function _p(e,t){if(xa=-1,wa=0,(Ye&6)!==0)throw Error(s(327));var i=e.callbackNode;if(oi()&&e.callbackNode!==i)return null;var l=ps(e,e===Yt?nn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=ka(e,l);else{t=l;var d=Ye;Ye|=2;var p=Ap();(Yt!==e||nn!==t)&&(Ir=null,ii=Nt()+500,Ts(e,t));do try{wy();break}catch(N){Rp(e,N)}while(!0);ic(),ha.current=p,Ye=d,zt!==null?t=0:(Yt=null,nn=0,t=Bt)}if(t!==0){if(t===2&&(d=ki(e),d!==0&&(l=d,t=Bc(e,d))),t===1)throw i=Yi,Ts(e,0),es(e,l),Nn(e,Nt()),i;if(t===6)es(e,l);else{if(d=e.current.alternate,(l&30)===0&&!yy(d)&&(t=ka(e,l),t===2&&(p=ki(e),p!==0&&(l=p,t=Bc(e,p))),t===1))throw i=Yi,Ts(e,0),es(e,l),Nn(e,Nt()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:Ns(e,Tn,Ir);break;case 3:if(es(e,l),(l&130023424)===l&&(t=$c+500-Nt(),10<t)){if(ps(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){mn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Kl(Ns.bind(null,e,Tn,Ir),t);break}Ns(e,Tn,Ir);break;case 4:if(es(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var y=31-fn(l);p=1<<y,y=t[y],y>d&&(d=y),l&=~p}if(l=d,l=Nt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*vy(l/1960))-l,10<l){e.timeoutHandle=Kl(Ns.bind(null,e,Tn,Ir),l);break}Ns(e,Tn,Ir);break;case 5:Ns(e,Tn,Ir);break;default:throw Error(s(329))}}}return Nn(e,Nt()),e.callbackNode===i?_p.bind(null,e):null}function Bc(e,t){var i=Xi;return e.current.memoizedState.isDehydrated&&(Ts(e,t).flags|=256),e=ka(e,t),e!==2&&(t=Tn,Tn=i,t!==null&&Wc(t)),e}function Wc(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function yy(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!nr(p(),d))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 es(e,t){for(t&=~zc,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-fn(t),l=1<<i;e[i]=-1,t&=~l}}function jp(e){if((Ye&6)!==0)throw Error(s(327));oi();var t=ps(e,0);if((t&1)===0)return Nn(e,Nt()),null;var i=ka(e,t);if(e.tag!==0&&i===2){var l=ki(e);l!==0&&(t=l,i=Bc(e,l))}if(i===1)throw i=Yi,Ts(e,0),es(e,t),Nn(e,Nt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ns(e,Tn,Ir),Nn(e,Nt()),null}function Hc(e,t){var i=Ye;Ye|=1;try{return e(t)}finally{Ye=i,Ye===0&&(ii=Nt()+500,Ko&&Gr())}}function bs(e){Zr!==null&&Zr.tag===0&&(Ye&6)===0&&oi();var t=Ye;Ye|=1;var i=Kn.transition,l=Ge;try{if(Kn.transition=null,Ge=1,e)return e()}finally{Ge=l,Kn.transition=i,Ye=t,(Ye&6)===0&&Gr()}}function Vc(){zn=si.current,ft(si)}function Ts(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Kv(i)),zt!==null)for(i=zt.return;i!==null;){var l=i;switch(ec(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&qo();break;case 3:ti(),ft(kn),ft(on),pc();break;case 5:dc(l);break;case 4:ti();break;case 13:ft(_t);break;case 19:ft(_t);break;case 10:oc(l.type._context);break;case 22:case 23:Vc()}i=i.return}if(Yt=e,zt=e=ts(e.current,null),nn=zn=t,Bt=0,Yi=null,zc=ma=Ss=0,Tn=Xi=null,xs!==null){for(t=0;t<xs.length;t++)if(i=xs[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var y=p.next;p.next=d,l.next=y}i.pending=l}xs=null}return e}function Rp(e,t){do{var i=zt;try{if(ic(),sa.current=la,ia){for(var l=jt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}ia=!1}if(ks=0,Kt=Ut=jt=null,Wi=!1,Hi=0,Oc.current=null,i===null||i.return===null){Bt=1,Yi=t,zt=null;break}e:{var p=e,y=i.return,N=i,R=t;if(t=nn,N.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var U=R,J=N,te=J.tag;if((J.mode&1)===0&&(te===0||te===11||te===15)){var Z=J.alternate;Z?(J.updateQueue=Z.updateQueue,J.memoizedState=Z.memoizedState,J.lanes=Z.lanes):(J.updateQueue=null,J.memoizedState=null)}var me=tp(y);if(me!==null){me.flags&=-257,np(me,y,N,p,t),me.mode&1&&ep(p,U,t),t=me,R=U;var ke=t.updateQueue;if(ke===null){var be=new Set;be.add(R),t.updateQueue=be}else ke.add(R);break e}else{if((t&1)===0){ep(p,U,t),qc();break e}R=Error(s(426))}}else if(xt&&N.mode&1){var Pt=tp(y);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),np(Pt,y,N,p,t),rc(ni(R,N));break e}}p=R=ni(R,N),Bt!==4&&(Bt=2),Xi===null?Xi=[p]:Xi.push(p),p=y;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var O=Zf(p,R,t);Nf(p,O);break e;case 1:N=R;var D=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof D.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Qr===null||!Qr.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var oe=Jf(p,N,t);Nf(p,oe);break e}}p=p.return}while(p!==null)}Dp(i)}catch(Te){t=Te,zt===i&&i!==null&&(zt=i=i.return);continue}break}while(!0)}function Ap(){var e=ha.current;return ha.current=la,e===null?la:e}function qc(){(Bt===0||Bt===3||Bt===2)&&(Bt=4),Yt===null||(Ss&268435455)===0&&(ma&268435455)===0||es(Yt,nn)}function ka(e,t){var i=Ye;Ye|=2;var l=Ap();(Yt!==e||nn!==t)&&(Ir=null,Ts(e,t));do try{xy();break}catch(d){Rp(e,d)}while(!0);if(ic(),Ye=i,ha.current=l,zt!==null)throw Error(s(261));return Yt=null,nn=0,Bt}function xy(){for(;zt!==null;)Ip(zt)}function wy(){for(;zt!==null&&!Tl();)Ip(zt)}function Ip(e){var t=Pp(e.alternate,e,zn);e.memoizedProps=e.pendingProps,t===null?Dp(e):zt=t,Oc.current=null}function Dp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=fy(i,t,zn),i!==null){zt=i;return}}else{if(i=py(i,t),i!==null){i.flags&=32767,zt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Bt=6,zt=null;return}}if(t=t.sibling,t!==null){zt=t;return}zt=t=e}while(t!==null);Bt===0&&(Bt=5)}function Ns(e,t,i){var l=Ge,d=Kn.transition;try{Kn.transition=null,Ge=1,ky(e,t,i,l)}finally{Kn.transition=d,Ge=l}return null}function ky(e,t,i,l){do oi();while(Zr!==null);if((Ye&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(Ro(e,p),e===Yt&&(zt=Yt=null,nn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||va||(va=!0,Op(Ls,function(){return oi(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Kn.transition,Kn.transition=null;var y=Ge;Ge=1;var N=Ye;Ye|=4,Oc.current=null,my(e,i),bp(i,e),Uv(ql),Io=!!Vl,ql=Vl=null,e.current=i,gy(i),Nl(),Ye=N,Ge=y,Kn.transition=p}else e.current=i;if(va&&(va=!1,Zr=e,ya=d),p=e.pendingLanes,p===0&&(Qr=null),Ps(i.stateNode),Nn(e,Nt()),t!==null)for(l=e.onRecoverableError,i=0;i<t.length;i++)d=t[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(ga)throw ga=!1,e=Fc,Fc=null,e;return(ya&1)!==0&&e.tag!==0&&oi(),p=e.pendingLanes,(p&1)!==0?e===Uc?Qi++:(Qi=0,Uc=e):Qi=0,Gr(),null}function oi(){if(Zr!==null){var e=ie(ya),t=Kn.transition,i=Ge;try{if(Kn.transition=null,Ge=16>e?16:e,Zr===null)var l=!1;else{if(e=Zr,Zr=null,ya=0,(Ye&6)!==0)throw Error(s(331));var d=Ye;for(Ye|=4,xe=e.current;xe!==null;){var p=xe,y=p.child;if((xe.flags&16)!==0){var N=p.deletions;if(N!==null){for(var R=0;R<N.length;R++){var U=N[R];for(xe=U;xe!==null;){var J=xe;switch(J.tag){case 0:case 11:case 15:Ki(8,J,p)}var te=J.child;if(te!==null)te.return=J,xe=te;else for(;xe!==null;){J=xe;var Z=J.sibling,me=J.return;if(yp(J),J===U){xe=null;break}if(Z!==null){Z.return=me,xe=Z;break}xe=me}}}var ke=p.alternate;if(ke!==null){var be=ke.child;if(be!==null){ke.child=null;do{var Pt=be.sibling;be.sibling=null,be=Pt}while(be!==null)}}xe=p}}if((p.subtreeFlags&2064)!==0&&y!==null)y.return=p,xe=y;else e:for(;xe!==null;){if(p=xe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Ki(9,p,p.return)}var O=p.sibling;if(O!==null){O.return=p.return,xe=O;break e}xe=p.return}}var D=e.current;for(xe=D;xe!==null;){y=xe;var F=y.child;if((y.subtreeFlags&2064)!==0&&F!==null)F.return=y,xe=F;else e:for(y=D;xe!==null;){if(N=xe,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:pa(9,N)}}catch(Te){At(N,N.return,Te)}if(N===y){xe=null;break e}var oe=N.sibling;if(oe!==null){oe.return=N.return,xe=oe;break e}xe=N.return}}if(Ye=d,Gr(),Mn&&typeof Mn.onPostCommitFiberRoot=="function")try{Mn.onPostCommitFiberRoot(us,e)}catch{}l=!0}return l}finally{Ge=i,Kn.transition=t}}return!1}function Mp(e,t,i){t=ni(i,t),t=Zf(e,t,1),e=Yr(e,t,1),t=mn(),e!==null&&(hs(e,1,t),Nn(e,t))}function At(e,t,i){if(e.tag===3)Mp(e,e,i);else for(;t!==null;){if(t.tag===3){Mp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Qr===null||!Qr.has(l))){e=ni(i,e),e=Jf(t,e,1),t=Yr(t,e,1),e=mn(),t!==null&&(hs(t,1,e),Nn(t,e));break}}t=t.return}}function Sy(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=mn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(nn&i)===i&&(Bt===4||Bt===3&&(nn&130023424)===nn&&500>Nt()-$c?Ts(e,0):zc|=i),Nn(e,t)}function Lp(e,t){t===0&&((e.mode&1)===0?t=1:(t=zs,zs<<=1,(zs&130023424)===0&&(zs=4194304)));var i=mn();e=jr(e,t),e!==null&&(hs(e,t,i),Nn(e,i))}function by(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Lp(e,i)}function Ty(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),Lp(e,i)}var Pp;Pp=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||kn.current)bn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return bn=!1,dy(e,t,i);bn=(e.flags&131072)!==0}else bn=!1,xt&&(t.flags&1048576)!==0&&mf(t,Xo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;da(e,t),e=t.pendingProps;var d=Ks(t,on.current);ei(t,i),d=gc(null,t,l,e,d,i);var p=vc();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,Sn(l)?(p=!0,Go(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,cc(t),d.updater=ca,t.stateNode=d,d._reactInternals=t,bc(t,l,e,i),t=Ec(null,t,l,!0,p,i)):(t.tag=0,xt&&p&&Jl(t),hn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(da(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=Cy(l),e=sr(l,e),d){case 0:t=Cc(null,t,l,e,i);break e;case 1:t=lp(null,t,l,e,i);break e;case 11:t=rp(null,t,l,e,i);break e;case 14:t=sp(null,t,l,sr(l.type,e),i);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:sr(l,d),Cc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:sr(l,d),lp(e,t,l,d,i);case 3:e:{if(cp(t),e===null)throw Error(s(387));l=t.pendingProps,p=t.memoizedState,d=p.element,Tf(e,t),na(t,l,null,i);var y=t.memoizedState;if(l=y.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=ni(Error(s(423)),t),t=up(e,t,l,i,d);break e}else if(l!==d){d=ni(Error(s(424)),t),t=up(e,t,l,i,d);break e}else for(On=Hr(t.stateNode.containerInfo.firstChild),Pn=t,xt=!0,rr=null,i=Sf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Qs(),l===d){t=Ar(e,t,i);break e}hn(e,t,l,i)}t=t.child}return t;case 5:return Ef(t),e===null&&nc(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,y=d.children,Gl(l,d)?y=null:p!==null&&Gl(l,p)&&(t.flags|=32),ap(e,t),hn(e,t,y,i),t.child;case 6:return e===null&&nc(t),null;case 13:return dp(e,t,i);case 4:return uc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Zs(t,null,l,i):hn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:sr(l,d),rp(e,t,l,d,i);case 7:return hn(e,t,t.pendingProps,i),t.child;case 8:return hn(e,t,t.pendingProps.children,i),t.child;case 12:return hn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,y=d.value,ct(Jo,l._currentValue),l._currentValue=y,p!==null)if(nr(p.value,y)){if(p.children===d.children&&!kn.current){t=Ar(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){y=p.child;for(var R=N.firstContext;R!==null;){if(R.context===l){if(p.tag===1){R=Rr(-1,i&-i),R.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var J=U.pending;J===null?R.next=R:(R.next=J.next,J.next=R),U.pending=R}}p.lanes|=i,R=p.alternate,R!==null&&(R.lanes|=i),ac(p.return,i,t),N.lanes|=i;break}R=R.next}}else if(p.tag===10)y=p.type===t.type?null:p.child;else if(p.tag===18){if(y=p.return,y===null)throw Error(s(341));y.lanes|=i,N=y.alternate,N!==null&&(N.lanes|=i),ac(y,i,t),y=p.sibling}else y=p.child;if(y!==null)y.return=p;else for(y=p;y!==null;){if(y===t){y=null;break}if(p=y.sibling,p!==null){p.return=y.return,y=p;break}y=y.return}p=y}hn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,ei(t,i),d=qn(d),l=l(d),t.flags|=1,hn(e,t,l,i),t.child;case 14:return l=t.type,d=sr(l,t.pendingProps),d=sr(l.type,d),sp(e,t,l,d,i);case 15:return ip(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:sr(l,d),da(e,t),t.tag=1,Sn(l)?(e=!0,Go(t)):e=!1,ei(t,i),Xf(t,l,d),bc(t,l,d,i),Ec(null,t,l,!0,e,i);case 19:return pp(e,t,i);case 22:return op(e,t,i)}throw Error(s(156,t.tag))};function Op(e,t){return Tt(e,t)}function Ny(e,t,i,l){this.tag=e,this.key=i,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(e,t,i,l){return new Ny(e,t,i,l)}function Gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cy(e){if(typeof e=="function")return Gc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pe)return 11;if(e===ee)return 14}return 2}function ts(e,t){var i=e.alternate;return i===null?(i=Yn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Sa(e,t,i,l,d,p){var y=2;if(l=e,typeof e=="function")Gc(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case G:return Cs(i.children,d,p,t);case K:y=8,d|=8;break;case ue:return e=Yn(12,i,t,d|2),e.elementType=ue,e.lanes=p,e;case ve:return e=Yn(13,i,t,d),e.elementType=ve,e.lanes=p,e;case Me:return e=Yn(19,i,t,d),e.elementType=Me,e.lanes=p,e;case ae:return ba(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ge:y=10;break e;case de:y=9;break e;case pe:y=11;break e;case ee:y=14;break e;case re:y=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Yn(y,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function Cs(e,t,i,l){return e=Yn(7,e,l,t),e.lanes=i,e}function ba(e,t,i,l){return e=Yn(22,e,l,t),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function Kc(e,t,i){return e=Yn(6,e,null,t),e.lanes=i,e}function Yc(e,t,i){return t=Yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ey(e,t,i,l,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=bi(0),this.expirationTimes=bi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Xc(e,t,i,l,d,p,y,N,R){return e=new Ey(e,t,i,N,R),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Yn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},cc(p),e}function _y(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function zp(e){if(!e)return qr;e=e._reactInternals;e:{if(He(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Sn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(Sn(i))return ff(e,i,t)}return t}function $p(e,t,i,l,d,p,y,N,R){return e=Xc(i,l,!0,e,d,p,y,N,R),e.context=zp(null),i=e.current,l=mn(),d=Jr(i),p=Rr(l,d),p.callback=t??null,Yr(i,p,d),e.current.lanes=d,hs(e,d,l),Nn(e,l),e}function Ta(e,t,i,l){var d=t.current,p=mn(),y=Jr(d);return i=zp(i),t.context===null?t.context=i:t.pendingContext=i,t=Rr(p,y),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Yr(d,t,y),e!==null&&(ar(e,d,y,p),ta(e,d,y)),y}function Na(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 Fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Qc(e,t){Fp(e,t),(e=e.alternate)&&Fp(e,t)}function jy(){return null}var Up=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zc(e){this._internalRoot=e}Ca.prototype.render=Zc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));Ta(e,t,null,null)},Ca.prototype.unmount=Zc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){Ta(null,e,null,null)}),t[Nr]=null}};function Ca(e){this._internalRoot=e}Ca.prototype.unstable_scheduleHydration=function(e){if(e){var t=Se();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ur.length&&t!==0&&t<Ur[i].priority;i++);Ur.splice(i,0,e),i===0&&Cd(e)}};function Jc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ea(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Bp(){}function Ry(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=Na(y);p.call(U)}}var y=$p(t,l,e,0,null,!1,!1,"",Bp);return e._reactRootContainer=y,e[Nr]=y.current,Li(e.nodeType===8?e.parentNode:e),bs(),y}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var U=Na(R);N.call(U)}}var R=Xc(e,0,!1,null,null,!1,!1,"",Bp);return e._reactRootContainer=R,e[Nr]=R.current,Li(e.nodeType===8?e.parentNode:e),bs(function(){Ta(t,R,i,l)}),R}function _a(e,t,i,l,d){var p=i._reactRootContainer;if(p){var y=p;if(typeof d=="function"){var N=d;d=function(){var R=Na(y);N.call(R)}}Ta(t,y,e,d)}else y=Ry(i,t,e,d,l);return Na(y)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=fs(t.pendingLanes);i!==0&&(Fr(t,i|1),Nn(t,Nt()),(Ye&6)===0&&(ii=Nt()+500,Gr()))}break;case 13:bs(function(){var l=jr(e,1);if(l!==null){var d=mn();ar(l,e,1,d)}}),Qc(e,1)}},P=function(e){if(e.tag===13){var t=jr(e,134217728);if(t!==null){var i=mn();ar(t,e,134217728,i)}Qc(e,134217728)}},Q=function(e){if(e.tag===13){var t=Jr(e),i=jr(e,t);if(i!==null){var l=mn();ar(i,e,t,l)}Qc(e,t)}},Se=function(){return Ge},Ne=function(e,t){var i=Ge;try{return Ge=e,t()}finally{Ge=i}},Ft=function(e,t,i){switch(t){case"input":if(Dt(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var d=Vo(l);if(!d)throw Error(s(90));Ee(l),Dt(l,d)}}}break;case"textarea":he(e,i);break;case"select":t=i.value,t!=null&&pt(e,!!i.multiple,t,!1)}},bt=Hc,yt=bs;var Ay={usingClientEntryPoint:!1,Events:[zi,qs,Vo,vt,qt,Hc]},Zi={findFiberByHostInstance:ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Iy={bundleType:Zi.bundleType,version:Zi.version,rendererPackageName:Zi.rendererPackageName,rendererConfig:Zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=er(e),e===null?null:e.stateNode},findFiberByHostInstance:Zi.findFiberByHostInstance||jy,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 ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ja.isDisabled&&ja.supportsFiber)try{us=ja.inject(Iy),Mn=ja}catch{}}return Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ay,Cn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jc(t))throw Error(s(200));return _y(e,t,null,i)},Cn.createRoot=function(e,t){if(!Jc(e))throw Error(s(299));var i=!1,l="",d=Up;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Xc(e,1,!1,null,null,i,!1,l,d),e[Nr]=t.current,Li(e.nodeType===8?e.parentNode:e),new Zc(t)},Cn.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(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=er(t),e=e===null?null:e.stateNode,e},Cn.flushSync=function(e){return bs(e)},Cn.hydrate=function(e,t,i){if(!Ea(t))throw Error(s(200));return _a(null,e,t,!0,i)},Cn.hydrateRoot=function(e,t,i){if(!Jc(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",y=Up;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),t=$p(t,null,e,1,i??null,d,!1,p,y),e[Nr]=t.current,Li(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,d]:t.mutableSourceEagerHydrationData.push(i,d);return new Ca(t)},Cn.render=function(e,t,i){if(!Ea(t))throw Error(s(200));return _a(null,e,t,!1,i)},Cn.unmountComponentAtNode=function(e){if(!Ea(e))throw Error(s(40));return e._reactRootContainer?(bs(function(){_a(null,null,e,!1,function(){e._reactRootContainer=null,e[Nr]=null})}),!0):!1},Cn.unstable_batchedUpdates=Hc,Cn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!Ea(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return _a(e,t,i,!1,l)},Cn.version="18.3.1-next-f1338f8080-20240426",Cn}var Xp;function Dm(){if(Xp)return nu.exports;Xp=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(),nu.exports=Uy(),nu.exports}var Qp;function By(){if(Qp)return Ra;Qp=1;var n=Dm();return Ra.createRoot=n.createRoot,Ra.hydrateRoot=n.hydrateRoot,Ra}var Wy=By();const Hy=Im(Wy),Zp=n=>{let r;const s=new Set,o=(m,v)=>{const k=typeof m=="function"?m(r):m;if(!Object.is(k,r)){const x=r;r=v??(typeof k!="object"||k===null)?k:Object.assign({},r,k),s.forEach(b=>b(r,x))}},a=()=>r,h={setState:o,getState:a,getInitialState:()=>g,subscribe:m=>(s.add(m),()=>s.delete(m))},g=r=n(o,a,h);return h},Vy=(n=>n?Zp(n):Zp),qy=n=>n;function Gy(n,r=qy){const s=st.useSyncExternalStore(n.subscribe,st.useCallback(()=>r(n.getState()),[n,r]),st.useCallback(()=>r(n.getInitialState()),[n,r]));return st.useDebugValue(s),s}const Ky=n=>{const r=Vy(n),s=o=>Gy(r,o);return Object.assign(s,r),s},Yy=(n=>Ky),Mm="agentpane:machines",Lm="agentpane:active-machine";function Xy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Pm(n){return`${n}.repoburg.com`}function Om(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function zm(n,r){try{const s=localStorage.getItem(n);return s==null?r:JSON.parse(s)}catch{return r}}function $m(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function Fm(){return zm(Mm,[]).filter(r=>Xy(r.mahlas)&&r.hostname===Pm(r.mahlas))}function Qy(n){const r={mahlas:n,hostname:Pm(n),lastConnectedAt:new Date().toISOString()},s=Fm(),o=[r,...s.filter(a=>a.mahlas!==n)];return $m(Mm,o),r}function Zy(){const n=zm(Lm,null);return n?Fm().find(r=>r.mahlas===n)??null:null}function Jy(n){$m(Lm,n)}function ex(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Om(n);r&&(Qy(r),Jy(r))}const Jp="http://localhost:9998",tx=["agent.repoburg.com"];function dr(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),r=n.get("bport");if(r)return`http://localhost:${r}`;const s=n.get("host");if(s)return`https://${s}`;const o=window.location.hostname;if(tx.includes(o))return Jp;if(Om(o))return"";const a=Zy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Jp}const nx="/api";async function wo(n,r,s){const o=await fetch(`${dr()}${nx}${r}`,{method:n,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${r} failed: ${a}`)}return o.json()}function vn(n){return wo("GET",n)}function wt(n,r){return wo("POST",n,r)}function fl(n){return wo("DELETE",n)}function Sr(n,r){return wo("PATCH",n,r)}function rx(n,r){return wo("PUT",n,r)}function sx(){return vn("/sessions")}function eo(n){return vn(`/sessions/${n}`)}function Gu(n){return wt("/sessions",n)}function eh(n){return fl(`/sessions/${n}`)}function Um(n,r,s,o){return wt(`/sessions/${n}/turns`,{user_prompt:r,...s!=null&&s.length?{attachments:s}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function ix(n){return wt(`/sessions/${n}/cancel`)}function ox(n,r){return wt(`/sessions/${n}/turns/${r}/resume`)}function ax(n,r){return Sr(`/sessions/${n}`,{title:r})}function th(n){return Sr(`/sessions/${n}`,{lifecycle:"finished"})}function nh(n){return Sr(`/sessions/${n}`,{lifecycle:"working"})}function lx(n,r){return Sr(`/sessions/${n}`,{starred:r})}function rh(n){return Sr(`/sessions/${n}`,{has_unreviewed:0})}function cx(n,r,s,o){const a={model:r,model_reasoning_effort:s};return o!==void 0&&(a.runtime_type=o),Sr(`/sessions/${n}`,a)}function ux(n,r){return Sr(`/sessions/${n}`,{runtime_config:r})}function dx(n,r){return wt(`/sessions/${n}/rewind`,{turn_id:r})}function fx(n){return wt(`/sessions/${n}/restore`,{})}function px(n,r,s){return wt(`/sessions/${n}/branch`,{turn_id:r,title:s})}function Bm(){return vn("/workspaces")}function hx(n,r){return wt("/workspaces",{path:n,label:r})}function mx(n){return wt("/workspaces/hide",{path:n})}async function gx(){const n=await fetch(`${dr()}/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 Wm(){return vn("/folders")}function vx(n,r){return wt("/folders",{workspace_path:n,name:r})}function sh(n,r){return Sr(`/folders/${n}`,r)}function yx(n){return fl(`/folders/${n}`)}function xx(n){return wt("/sessions/reorder",{moves:n})}function as(n){return n.status==="pending"||n.status==="running"}function Hm(n){return!!(n!=null&&n.turns.some(as))}function pl(n){return n?n.turns.some(as)||(n.threads??[]).some(r=>(r.turns??[]).some(as)):!1}const Vm=1;function qm(){let n="";try{n=dr()}catch{}return`agentpane:tabs:${n||window.location.origin}`}function ih(n){return Array.isArray(n)&&n.every(r=>typeof r=="string")}function oh(n){return n===null||typeof n=="string"}function wx(n){if(n==null)return null;let r;try{r=JSON.parse(n)}catch{return null}if(typeof r!="object"||r===null)return null;const s=r;return s.v!==Vm||!ih(s.openTabs)||!oh(s.activeSessionId)||!ih(s.openAppTabs)||!oh(s.activeAppTabId)?null:{openTabs:s.openTabs,activeSessionId:s.activeSessionId,openAppTabs:s.openAppTabs,activeAppTabId:s.activeAppTabId}}const Gm=[()=>window.sessionStorage,()=>window.localStorage];function kx(){const n=qm();for(const r of Gm)try{const s=wx(r().getItem(n));if(s)return s}catch{}return null}function Sx(n){const r=qm(),s=JSON.stringify({v:Vm,openTabs:n.openTabs,activeSessionId:n.activeSessionId,openAppTabs:n.openAppTabs,activeAppTabId:n.activeAppTabId});for(const o of Gm)try{o().setItem(r,s)}catch{}}function bx(n){return n.subscribe((r,s)=>{(r.openTabs!==s.openTabs||r.activeSessionId!==s.activeSessionId||r.openAppTabs!==s.openAppTabs||r.activeAppTabId!==s.activeAppTabId)&&Sx(r)})}function Ha(n){return[...new Set(n)]}function Tx(n,r,s,o){const a=m=>s===null||s.has(m),u=Ha(((n==null?void 0:n.openTabs)??[]).filter(m=>r.has(m))),f=Ha(((n==null?void 0:n.openAppTabs)??[]).filter(a));let h=(n==null?void 0:n.activeSessionId)??null;h!==null&&!r.has(h)&&(h=null),h!==null&&!u.includes(h)&&u.push(h),h??(h=u.at(-1)??null);let g=(n==null?void 0:n.activeAppTabId)??null;return g!==null&&!a(g)&&(g=null),g!==null&&!f.includes(g)&&f.push(g),o!==null&&r.has(o)&&(u.includes(o)||u.push(o),h=o,g=null),{openTabs:u,activeSessionId:h,openAppTabs:f,activeAppTabId:g}}function Nx(){const n=new URLSearchParams(window.location.search);return{session:n.get("session"),thread:n.get("thread")}}function Cx(){const n=new URL(window.location.href);!n.searchParams.has("session")&&!n.searchParams.has("thread")||(n.searchParams.delete("session"),n.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",n))}let iu=0;function ah(n){return n==="sidecar"?"sidecar":"turns"}async function Ex(n,r){const s=await Promise.allSettled(n.map(u=>r(u))),o=new Map;let a=null;return s.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function lh(n,r){const s={...n.sessionDetails};r.forEach(h=>delete s[h]);const o={...n.backgroundTasks};r.forEach(h=>delete o[h]);const a=n.openTabs.filter(h=>!r.has(h));let u=n.activeSessionId,f=n.activeTurnIndex;if(u&&r.has(u)){u=a.length>0?a[a.length-1]:null;const h=u?s[u]:null;f=h&&h.turns.length>0?h.turns.length-1:0}return{sessions:n.sessions.filter(h=>!r.has(h.id)),sessionDetails:s,backgroundTasks:o,openTabs:a,activeSessionId:u,activeTurnIndex:f}}function _x(n){const r={...n};return delete r.turns,delete r.threads,delete r.contextUsage,r}async function ch(n,r,s,o,a){if(s.length===0)return;n({error:null});const{updated:u,firstError:f}=await Ex(s,o);u.size>0&&n(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const h=s.length-u.size;if(h===0)r().addToast("info",`${s.length} session${s.length===1?"":"s"} ${a}`);else{n({error:f});const g=a[0].toUpperCase()+a.slice(1);r().addToast(h===s.length?"error":"warn",`${g} ${u.size} of ${s.length} — ${h} failed`)}}const jx=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const s=Nx(),o=kx();try{const a=localStorage.getItem("agentpane:last-model-config");a&&n({lastModelConfig:JSON.parse(a)})}catch{}n({loading:!0,error:null});try{const a=r().loadApps(),[u,f,h]=await Promise.all([sx(),Bm(),Wm()]);n({sessions:u,workspaces:f,folders:h,loading:!1}),Cx();const g=await a,m=Tx(o,new Set(u.map(v=>v.id)),g?new Set(r().apps.map(v=>v.id)):null,s.session);n(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Ha([...m.openTabs,...v.openTabs]),openAppTabs:Ha([...m.openAppTabs,...v.openAppTabs]),activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!r().activeSessionId&&await r().selectSession(m.activeSessionId,{keepAppView:!0}),s.thread&&(n({deepLinkThreadId:s.thread}),r().switchRightTab("threads"))}catch(a){n({loading:!1,error:a.message})}},selectSession:async(s,o)=>{const a=++iu,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},f=h=>h.includes(s)?h:[...h,s];if(r().sessionDetails[s]){const h=r().sessionDetails[s];n({activeSessionId:s,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:ah(r().activeRightTab),...u,openTabs:f(r().openTabs)}),h.has_unreviewed===1&&(rh(s).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===s?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[s]:{...h,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const h=await eo(s);if(a!==iu){n(g=>({sessionDetails:{...g.sessionDetails,[s]:h},openTabs:f(g.openTabs),loading:!1}));return}n(g=>({sessionDetails:{...g.sessionDetails,[s]:h},activeSessionId:s,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:ah(g.activeRightTab),...u,openTabs:f(g.openTabs),loading:!1})),h.has_unreviewed===1&&(rh(s).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===s?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[s]:{...h,has_unreviewed:0}}})))}catch(h){n(a===iu?{loading:!1,error:h.message}:{loading:!1})}},closeTab:s=>{n(o=>{const a=o.openTabs.filter(u=>u!==s);if(o.activeSessionId===s&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===s?null:o.activeSessionId}})},updateModelConfig:async(s,o,a)=>{const u=r().activeSessionId;if(u){n({error:null});try{const f=await cx(u,s,o,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(g=>({sessions:g.sessions.map(m=>m.id===u?f:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:g.sessionDetails})),await r().refreshActiveSession()}catch(f){n({error:f.message}),r().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async s=>{n({error:null});try{const o=await Gu(s);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await r().selectSession(o.id),r().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),r().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},addSession:s=>{n(o=>({sessions:o.sessions.some(a=>a.id===s.id)?o.sessions:[s,...o.sessions]}))},revealSession:async s=>{let o=r().sessionDetails[s];if(!o){const a=await eo(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a}})),o=a}r().sessions.some(a=>a.id===s)||r().addSession(_x(o)),await r().selectSession(s)},deleteSession:async s=>{var a;n({error:null});const o=(a=r().sessions.find(u=>u.id===s))==null?void 0:a.title;try{await eh(s),n(u=>lh(u,new Set([s]))),r().addLogEntry("INFO",`Session deleted — ${s.slice(0,8)}`),r().addToast("info",`Session "${o||s.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),r().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(s,o)=>{n({error:null});try{const a=await ax(s,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async s=>{n({error:null});try{const o=await th(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),r().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async s=>{await ch(n,r,s,th,"marked as finished")},toggleStar:async s=>{const o=r().sessions.find(a=>a.id===s);if(o){n({error:null});try{const a=await lx(s,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async s=>{n({error:null});try{const o=await nh(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session reopened")}catch(o){n({error:o.message}),r().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async s=>{await ch(n,r,s,nh,"reopened")},deleteSessionMany:async s=>{if(s.length===0)return;n({error:null});const o=await Promise.allSettled(s.map(f=>eh(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(s[h])}),a.size===0){n({error:"Failed to delete sessions"}),r().addToast("error","Failed to delete sessions");return}n(f=>lh(f,a)),r().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=s.length-a.size;u===0?r().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),r().addToast("warn",`Deleted ${a.size} of ${s.length} — ${u} failed`))},submitPrompt:async(s,o)=>{const a=r().activeSessionId;if(a){n({error:null,submittingPrompt:s}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await Um(a,s,o);r().addLogEntry("INFO",`Turn submitted — "${s.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const g=h.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},activeTurnIndex:h.turns.length}})}catch(u){n({submittingPrompt:null,error:u.message}),r().addLogEntry("ERROR",`Turn failed — ${u.message}`),r().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const g=pl(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:g,status:g?"running":"active"}},sessions:f.sessions.map(m=>m.id===a?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const s=r().activeSessionId;if(s)try{await ix(s)}catch(o){n({error:o.message})}},rewindToTurn:async(s,o)=>{n({error:null});try{const a=await dx(s,o),u=await eo(s);n(f=>({sessionDetails:{...f.sessionDetails,[s]:u},sessions:f.sessions.map(h=>h.id===s?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.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 s=>{n({error:null});try{const o=await fx(s),a=await eo(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a},sessions:u.sessions.map(f=>f.id===s?{...f,external_thread_id:o.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(o){n({error:o.message}),r().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(s,o,a)=>{n({error:null});try{const u=await px(s,o,a);n(f=>({sessions:[u,...f.sessions]})),await r().selectSession(u.id),r().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),r().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async s=>{const o=r().activeSessionId;if(o){n({error:null});try{const a=await ux(o,JSON.stringify(s));n(u=>({sessions:u.sessions.map(f=>f.id===o?a:f),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:a.runtime_config}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const s=r().activeSessionId;if(s)try{const o=await eo(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===s?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),Rx=(n,r)=>({workspaces:[],addWorkspace:async s=>{n({error:null});try{const o=await hx(s.trim());n(a=>({workspaces:[...a.workspaces,o]})),r().addToast("success",`Workspace added — ${o.path}`)}catch(o){r().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async s=>{n({error:null});try{await mx(s);const o=await Bm();n({workspaces:o}),r().addToast("info","Workspace hidden")}catch(o){r().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async s=>{n({error:null});try{const o=r().lastModelConfig,a=await Gu({cwd:s,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await r().selectSession(a.id),r().addLogEntry("INFO",`Session created in ${s} — ${a.id.slice(0,8)}`),r().addToast("success",`Session created in ${s.split("/").pop()||s}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const s=await gx();if(s.cancelled||!s.path)return;await r().addWorkspace(s.path)}catch(s){r().addToast("error",`Failed to pick directory — ${s.message}`)}}}),Is=new Map,Ku=new Map,Yu=new Map,Xu=new Map;function Ax(n,r){Is.set(n,r)}function Ix(n){Is.delete(n)}function ou(n,r){Ku.set(n,r)}function uh(n,r,s){const o=Ku.get(n);if(!o)return;const a=Is.get(o);a&&a({source:"agentpane-host",event:r,payload:s})}function Dx(n,r,s,o){const a=Is.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:r,tool:s,name:s,args:o}})}function Mx(n,r,s,o){const a=Ku.get(n);if(!a)return;const u=Is.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:r,itemId:s,delta:o}})}function Lx(n,r){Yu.set(n,r)}function Px(n){Yu.delete(n)}function Ox(n,r){Xu.set(n,r)}function zx(n){Xu.delete(n)}function $x(n){var s;const r=Is.get(n);r&&r({source:"agentpane-host",event:"state_changed",payload:{}}),(s=Xu.get(n))==null||s()}function Fx(n){var s;const r=Is.get(n);r&&r({source:"agentpane-host",event:"source:updated",payload:{}}),(s=Yu.get(n))==null||s()}const Ux=(n,r)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},setWsConnected:s=>n({wsConnected:s}),onTurnCreated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return!u||o.thread_id?{}:u.turns.some(f=>f.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[s]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(s,o)=>{r().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=_s(a.sessions,s,()=>({is_running:1,status:"running"})),f=a.sessionDetails[s];if(!f)return{sessions:u};const h=f.turns.findIndex(g=>g.id===o);return{sessionDetails:{...a.sessionDetails,[s]:{...Xn(f,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===s&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(s,o,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=dh(a)?Es(u.retryStates,o):u.retryStates,h=u.sessionDetails[s];return h?{sessionDetails:{...u.sessionDetails,[s]:Xn(h,o,g=>lu(g,a))},retryStates:f}:{retryStates:f}})},onItemUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Xn(f,o,h=>lu(h,a))}}:{}})},onItemCompleted:(s,o,a)=>{if(r().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",m=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${m} completed: ${h}`):r().addToast("error",`${m} failed: ${h}`)}n(u=>{const f=dh(a)?Es(u.retryStates,o):u.retryStates,h=u.sessionDetails[s];return h?{retryStates:f,sessionDetails:{...u.sessionDetails,[s]:Xn(h,o,g=>{var v,k;let m=lu(g,a);if(a.type==="agent_message"&&((v=a.data)!=null&&v.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((k=a.data)!=null&&k.text)){const x=m.thoughts?m.thoughts+`
|
|
41
|
-
`+a.data.text:a.data.text;m={...m,thoughts:x}}return m})}}:{retryStates:f}})},onItemDelta:(s,o,a,u)=>{Mx(s,o,a,u),n(f=>{const h=Es(f.retryStates,o),g=f.sessionDetails[s];return g?{sessionDetails:{...f.sessionDetails,[s]:Xn(g,o,m=>Wx(m,a,u))},retryStates:h}:{retryStates:h}})},onTurnCompleted:(s,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,g=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${h} in / ${g} out`),uh(s,"turn:completed",{turnId:o,response:f??null}),r().refreshApps(),n(m=>{const v=m.sessionDetails[s],k=v?Xn(v,o,T=>({...T,status:"completed",token_usage:a??T.token_usage??null,...f&&!T.agent_response?{agent_response:f}:{}})):null,x=au(k),b=x&&k?Aa(k):"active",E=_s(m.sessions,s,T=>({is_running:x,status:b,has_unreviewed:u?1:T.has_unreviewed})),C=Es(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[s]:{...k,is_running:x,status:b,has_unreviewed:u?1:k.has_unreviewed}},sessions:E,retryStates:C}:{sessions:E,retryStates:C}})},onTokenUsageUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Xn(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(s,o,a,u)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),uh(s,"turn:failed",{turnId:o,error:a}),n(f=>{const h=f.sessionDetails[s],g=a.includes("cancelled")||a.includes("aborted"),m=g?"aborted":"failed",v=h?Xn(h,o,C=>({...C,status:m,error:a,...u?{resume_state:u}:{},items:C.items.map(T=>T.status==="in_progress"?{...T,status:"failed"}:T)})):null,k=au(v),x=k&&v?Aa(v):g?"active":"failed",b=_s(f.sessions,s,()=>({is_running:k,status:x})),E=Es(f.retryStates,o);return v?{sessionDetails:{...f.sessionDetails,[s]:{...v,is_running:k,status:x}},sessions:b,retryStates:E}:{sessions:b,retryStates:E}})},onTurnCancelled:(s,o)=>{n(a=>{const u=a.sessionDetails[s],f=u?Xn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(x=>x.status==="in_progress"?{...x,status:"completed"}:x)})):null,h=au(f),g=h&&f?Aa(f):"active",m=_s(a.sessions,s,()=>({is_running:h,status:g})),v=Es(a.retryStates,o);return f?{sessionDetails:{...a.sessionDetails,[s]:{...f,is_running:h,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(s,o,a)=>{r().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),r().addToast("warn",Bx(a.reason)),n(u=>{const f=u.sessionDetails[s],h=f?Xn(f,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:a.reason,interrupted_at:a.interruptedAt,resume_attempts:a.attempts})):null,g=h?Aa(h):"interrupted",m=_s(u.sessions,s,()=>({is_running:1,status:g})),v=Es(u.retryStates,o);return h?{sessionDetails:{...u.sessionDetails,[s]:{...h,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(s,o,a)=>{r().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),n(u=>{const f=_s(u.sessions,s,()=>({is_running:1,status:"running"})),h=u.sessionDetails[s];return h?{sessionDetails:{...u.sessionDetails,[s]:{...Xn(h,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:a})),is_running:1,status:"running"}},sessions:f}:{sessions:f}})},onTurnResumed:(s,o)=>{r().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),r().addToast("success","Interrupted turn resumed"),n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:Xn(u,o,f=>({...f,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(s,o,a)=>{r().addLogEntry("WARN",`turn:retrying — ${s.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),n(u=>({retryStates:{...u.retryStates,[o]:a}}))},onSessionTitle:(s,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,title:o}:u),sessionDetails:a.sessionDetails[s]?{...a.sessionDetails,[s]:{...a.sessionDetails[s],title:o}}:a.sessionDetails}))},onSessionTouched:s=>{n(o=>{const a=o.sessionDetails[s];return{sessions:_s(o.sessions,s,()=>({user_touched:1})),sessionDetails:a?{...o.sessionDetails,[s]:{...a,user_touched:1}}:o.sessionDetails}})},onBackgroundTasksChanged:(s,o)=>{n(a=>{if(o.length===0&&!a.backgroundTasks[s])return{};const u={...a.backgroundTasks};return o.length>0?u[s]=o:delete u[s],{backgroundTasks:u}})},onBackgroundTasksSnapshot:s=>{const o={};for(const[a,u]of Object.entries(s))u.length>0&&(o[a]=u);n({backgroundTasks:o})}});function Bx(n){switch(n){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";default:return"The agent host restarted — resuming the turn"}}function Aa(n){const r=[...n.turns,...(n.threads??[]).flatMap(s=>s.turns??[])].filter(as);return r.length>0&&r.every(s=>s.status==="pending"&&s.resume_state==="waiting")?"interrupted":"running"}function dh(n){return n.type!=="background_task"&&n.type!=="error"&&n.type!=="interruption"}function Es(n,r){if(!(r in n))return n;const s={...n};return delete s[r],s}function au(n){return n&&(n.turns.some(as)||(n.threads??[]).some(s=>(s.turns??[]).some(as)))?1:0}function _s(n,r,s){return n.some(o=>o.id===r)?n.map(o=>o.id===r?{...o,...s(o)}:o):n}function Xn(n,r,s){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===r)?{...a,turns:(a.turns??[]).map(u=>u.id===r?s(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===r?s(a):a),threads:o}}function lu(n,r){const s=n.items.findIndex(o=>o.external_item_id===r.external_item_id);if(s>=0){const o=[...n.items];return o[s]=r,{...n,items:o}}if(r.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,r]}}return{...n,items:[...n.items,r]}}function Wx(n,r,s){var u;const o=n.items.findIndex(f=>f.external_item_id===r);if(o>=0){const f=n.items[o],g=(((u=f.data)==null?void 0:u.text)??"")+s,m=[...n.items];return m[o]={...f,data:{...f.data,text:g}},{...n,items:m,agent_response:g}}const a={id:`delta-${r}`,turn_id:n.id,external_item_id:r,type:"agent_message",data:{text:s},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:s}}function Hx(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return vn(`/providers/${n}/models${s}`)}const Cu=160,Eu=480,Vx=240,Va=220,qx=300,Gx=600,Kx=36;function qa(){return typeof window>"u"?Gx:Math.max(Va,Math.round(window.innerWidth*.7))}const fh="agentpane:sidebar-width",ph="agentpane:right-panel-width",cu="agentpane:right-panel-collapsed";function hh(n,r,s,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(s,Math.max(r,u)):o}catch{return o}}function Yx(n){try{return localStorage.getItem(n)==="true"}catch{return!1}}function mh(n,r){try{localStorage.setItem(n,String(r))}catch{}}const gh=200,Xx=(n,r)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:hh(fh,Cu,Eu,Vx),rightPanelWidth:hh(ph,Va,qa(),qx),rightPanelCollapsed:Yx(cu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:s=>n({activeTurnIndex:s}),switchRightTab:s=>{r().rightPanelCollapsed&&mh(cu,!1),n({activeRightTab:s,rightPanelCollapsed:!1})},setShowNewSessionDialog:s=>n({showNewSessionDialog:s}),setShowRemoteModal:s=>n({showRemoteModal:s}),setShowCommandPalette:s=>n({showCommandPalette:s}),setShowModelSelector:s=>n({showModelSelector:s}),setDeepLinkThreadId:s=>n({deepLinkThreadId:s}),setSidebarWidth:s=>{const o=Math.min(Eu,Math.max(Cu,Math.round(s)));n({sidebarWidth:o});try{localStorage.setItem(fh,String(o))}catch{}},setRightPanelWidth:s=>{const o=Math.min(qa(),Math.max(Va,Math.round(s)));n({rightPanelWidth:o});try{localStorage.setItem(ph,String(o))}catch{}},setRightPanelCollapsed:s=>{n({rightPanelCollapsed:s}),mh(cu,s)},toggleRightPanel:()=>r().setRightPanelCollapsed(!r().rightPanelCollapsed),toggleVscodeView:()=>{if(r().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(s,o,a)=>n({vscodeState:s,vscodeId:o,vscodeToken:a}),addToast:(s,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:s,message:o,undoAction:a,undoLabel:u}]}))},removeToast:s=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==s)}))},addLogEntry:(s,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:s,message:o}];return f.length>gh&&f.splice(0,f.length-gh),{eventLog:f}})},loadModels:async(s,o)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await Hx(s,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),Qx=(n,r)=>({createThread:async(s,o)=>{try{await wt(`/sessions/${s}/threads`,o),r().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){r().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(s,o,a)=>{try{await wt(`/sessions/${s}/threads/${o}/followup`,{message:a}),r().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){r().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(s,o)=>{try{await wt(`/sessions/${s}/cancel?threadId=${encodeURIComponent(o)}`),r().addLogEntry("INFO","Thread turn cancelled")}catch(a){r().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(s,o)=>{try{await Sr(`/sessions/${s}/threads/${o}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(s,o)=>{try{await Sr(`/sessions/${s}/threads/${o}`,{status:"open"})}catch(a){r().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(s,o,a)=>{try{const u=await wt(`/sessions/${s}/threads/${o}/summarize`,{directives:a}),f=`
|
|
40
|
+
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function Tc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function Nc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var cy=typeof WeakMap=="function"?WeakMap:Map;function Zf(e,t,i){i=Rr(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){ga||(ga=!0,Fc=l),Nc(e,t)},i}function Jf(e,t,i){i=Rr(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=t.value;i.payload=function(){return l(d)},i.callback=function(){Nc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Nc(e,t),typeof l!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var y=t.stack;this.componentDidCatch(t.value,{componentStack:y!==null?y:""})}),i}function ep(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new cy;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(i)||(d.add(i),e=by.bind(null,e,t,i),t.then(e,e))}function tp(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 np(e,t,i,l,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=Rr(-1,1),t.tag=2,Yr(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var uy=$.ReactCurrentOwner,bn=!1;function hn(e,t,i,l){t.child=e===null?Sf(t,null,i,l):Zs(t,e.child,i,l)}function rp(e,t,i,l,d){i=i.render;var p=t.ref;return ei(t,d),l=gc(e,t,i,l,p,d),i=vc(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ar(e,t,d)):(xt&&i&&Jl(t),t.flags|=1,hn(e,t,l,d),t.child)}function sp(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Gc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,ip(e,t,p,l,d)):(e=Sa(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var y=p.memoizedProps;if(i=i.compare,i=i!==null?i:Ii,i(y,l)&&e.ref===t.ref)return Ar(e,t,d)}return t.flags|=1,e=ts(p,l),e.ref=t.ref,e.return=t,t.child=e}function ip(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(Ii(p,l)&&e.ref===t.ref)if(bn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(bn=!0);else return t.lanes=e.lanes,Ar(e,t,d)}return Cc(e,t,i,l,d)}function op(e,t,i){var l=t.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(si,zn),zn|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(si,zn),zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ct(si,zn),zn|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ct(si,zn),zn|=l;return hn(e,t,d,i),t.child}function ap(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Cc(e,t,i,l,d){var p=Sn(i)?gs:on.current;return p=Ks(t,p),ei(t,d),i=gc(e,t,i,l,p,d),l=vc(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ar(e,t,d)):(xt&&l&&Jl(t),t.flags|=1,hn(e,t,i,d),t.child)}function lp(e,t,i,l,d){if(Sn(i)){var p=!0;Go(t)}else p=!1;if(ei(t,d),t.stateNode===null)da(e,t),Xf(t,i,l),bc(t,i,l,d),l=!0;else if(e===null){var y=t.stateNode,N=t.memoizedProps;y.props=N;var R=y.context,U=i.contextType;typeof U=="object"&&U!==null?U=Gn(U):(U=Sn(i)?gs:on.current,U=Ks(t,U));var J=i.getDerivedStateFromProps,te=typeof J=="function"||typeof y.getSnapshotBeforeUpdate=="function";te||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==l||R!==U)&&Qf(t,y,l,U),Kr=!1;var Z=t.memoizedState;y.state=Z,na(t,l,y,d),R=t.memoizedState,N!==l||Z!==R||kn.current||Kr?(typeof J=="function"&&(Sc(t,i,J,l),R=t.memoizedState),(N=Kr||Yf(t,i,N,l,Z,R,U))?(te||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(t.flags|=4194308)):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),y.props=l,y.state=R,y.context=U,l=N):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{y=t.stateNode,Tf(e,t),N=t.memoizedProps,U=t.type===t.elementType?N:or(t.type,N),y.props=U,te=t.pendingProps,Z=y.context,R=i.contextType,typeof R=="object"&&R!==null?R=Gn(R):(R=Sn(i)?gs:on.current,R=Ks(t,R));var me=i.getDerivedStateFromProps;(J=typeof me=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==te||Z!==R)&&Qf(t,y,l,R),Kr=!1,Z=t.memoizedState,y.state=Z,na(t,l,y,d);var ke=t.memoizedState;N!==te||Z!==ke||kn.current||Kr?(typeof me=="function"&&(Sc(t,i,me,l),ke=t.memoizedState),(U=Kr||Yf(t,i,U,l,Z,ke,R)||!1)?(J||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,ke,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,ke,R)),typeof y.componentDidUpdate=="function"&&(t.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ke),y.props=l,y.state=ke,y.context=R,l=U):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),l=!1)}return Ec(e,t,i,l,p,d)}function Ec(e,t,i,l,d,p){ap(e,t);var y=(t.flags&128)!==0;if(!l&&!y)return d&&pf(t,i,!1),Ar(e,t,p);l=t.stateNode,uy.current=t;var N=y&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&y?(t.child=Zs(t,e.child,null,p),t.child=Zs(t,null,N,p)):hn(e,t,N,p),t.memoizedState=l.state,d&&pf(t,i,!0),t.child}function cp(e){var t=e.stateNode;t.pendingContext?df(e,t.pendingContext,t.pendingContext!==t.context):t.context&&df(e,t.context,!1),uc(e,t.containerInfo)}function up(e,t,i,l,d){return Qs(),rc(d),t.flags|=256,hn(e,t,i,l),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0};function jc(e){return{baseLanes:e,cachePool:null,transitions:null}}function dp(e,t,i){var l=t.pendingProps,d=_t.current,p=!1,y=(t.flags&128)!==0,N;if((N=y)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ct(_t,d&1),e===null)return nc(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):(y=l.children,e=l.fallback,p?(l=t.mode,p=t.child,y={mode:"hidden",children:y},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=y):p=ba(y,l,0,null),e=Cs(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=jc(i),t.memoizedState=_c,e):Rc(t,y));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return dy(e,t,y,l,N,d,i);if(p){p=l.fallback,y=t.mode,d=e.child,N=d.sibling;var R={mode:"hidden",children:l.children};return(y&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=R,t.deletions=null):(l=ts(d,R),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=ts(N,p):(p=Cs(p,y,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,y=e.child.memoizedState,y=y===null?jc(i):{baseLanes:y.baseLanes|i,cachePool:null,transitions:y.transitions},p.memoizedState=y,p.childLanes=e.childLanes&~i,t.memoizedState=_c,l}return p=e.child,e=p.sibling,l=ts(p,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=i),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l}function Rc(e,t){return t=ba({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ua(e,t,i,l){return l!==null&&rc(l),Zs(t,e.child,null,i),e=Rc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dy(e,t,i,l,d,p,y){if(i)return t.flags&256?(t.flags&=-257,l=Tc(Error(s(422))),ua(e,t,y,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=ba({mode:"visible",children:l.children},d,0,null),p=Cs(p,d,y,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Zs(t,e.child,null,y),t.child.memoizedState=jc(y),t.memoizedState=_c,p);if((t.mode&1)===0)return ua(e,t,y,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(s(419)),l=Tc(p,l,void 0),ua(e,t,y,l)}if(N=(y&e.childLanes)!==0,bn||N){if(l=Yt,l!==null){switch(y&-y){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&(l.suspendedLanes|y))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,jr(e,d),cr(l,e,d,-1))}return qc(),l=Tc(Error(s(421))),ua(e,t,y,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=Ty.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,On=Hr(d.nextSibling),Pn=t,xt=!0,ir=null,e!==null&&(Vn[qn++]=Er,Vn[qn++]=_r,Vn[qn++]=vs,Er=e.id,_r=e.overflow,vs=t),t=Rc(t,l.children),t.flags|=4096,t)}function fp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ac(e.return,t,i)}function Ac(e,t,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function pp(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(hn(e,t,l.children,i),l=_t.current,(l&2)!==0)l=l&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&&fp(e,i,t);else if(e.tag===19)fp(e,i,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}l&=1}if(ct(_t,l),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&ra(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Ac(t,!1,d,i,p);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&ra(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Ac(t,!0,i,null,p);break;case"together":Ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function da(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ar(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ss|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=ts(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ts(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function fy(e,t,i){switch(t.tag){case 3:cp(t),Qs();break;case 5:Ef(t);break;case 1:Sn(t.type)&&Go(t);break;case 4:uc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ct(Jo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ct(_t,_t.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?dp(e,t,i):(ct(_t,_t.current&1),e=Ar(e,t,i),e!==null?e.sibling:null);ct(_t,_t.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return pp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ct(_t,_t.current),l)break;return null;case 22:case 23:return t.lanes=0,op(e,t,i)}return Ar(e,t,i)}var hp,Ic,mp,gp;hp=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Ic=function(){},mp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ws(yr.current);var p=null;switch(i){case"input":d=$e(e,d),l=$e(e,l),p=[];break;case"select":d=V({},d,{value:void 0}),l=V({},l,{value:void 0}),p=[];break;case"textarea":d=en(e,d),l=en(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Ho)}Rn(i,l);var y;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var N=d[U];for(y in N)N.hasOwnProperty(y)&&(i||(i={}),i[y]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var R=l[U];if(N=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&R!==N&&(R!=null||N!=null))if(U==="style")if(N){for(y in N)!N.hasOwnProperty(y)||R&&R.hasOwnProperty(y)||(i||(i={}),i[y]="");for(y in R)R.hasOwnProperty(y)&&N[y]!==R[y]&&(i||(i={}),i[y]=R[y])}else i||(p||(p=[]),p.push(U,i)),i=R;else U==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,N=N?N.__html:void 0,R!=null&&N!==R&&(p=p||[]).push(U,R)):U==="children"?typeof R!="string"&&typeof R!="number"||(p=p||[]).push(U,""+R):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(R!=null&&U==="onScroll"&&dt("scroll",e),p||N===R||(p=[])):(p=p||[]).push(U,R))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},gp=function(e,t,i,l){i!==l&&(t.flags|=4)};function Gi(e,t){if(!xt)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ln(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function py(e,t,i){var l=t.pendingProps;switch(ec(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return Sn(t.type)&&qo(),ln(t),null;case 3:return l=t.stateNode,ti(),ft(kn),ft(on),pc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Qo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ir!==null&&(Wc(ir),ir=null))),Ic(e,t),ln(t),null;case 5:dc(t);var d=ws(Bi.current);if(i=t.type,e!==null&&t.stateNode!=null)mp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ln(t),null}if(e=ws(yr.current),Qo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[vr]=t,l[Oi]=p,e=(t.mode&1)!==0,i){case"dialog":dt("cancel",l),dt("close",l);break;case"iframe":case"object":case"embed":dt("load",l);break;case"video":case"audio":for(d=0;d<Mi.length;d++)dt(Mi[d],l);break;case"source":dt("error",l);break;case"img":case"image":case"link":dt("error",l),dt("load",l);break;case"details":dt("toggle",l);break;case"input":It(l,p),dt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},dt("invalid",l);break;case"textarea":H(l,p),dt("invalid",l)}Rn(i,p),d=null;for(var y in p)if(p.hasOwnProperty(y)){var N=p[y];y==="children"?typeof N=="string"?l.textContent!==N&&(p.suppressHydrationWarning!==!0&&Wo(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&Wo(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(y)&&N!=null&&y==="onScroll"&&dt("scroll",l)}switch(i){case"input":it(l),_n(l,p,!0);break;case"textarea":it(l),Ue(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Ho)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{y=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=y.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=y.createElement(i,{is:l.is}):(e=y.createElement(i),i==="select"&&(y=e,l.multiple?y.multiple=!0:l.size&&(y.size=l.size))):e=y.createElementNS(e,i),e[vr]=t,e[Oi]=l,hp(e,t,!1,!1),t.stateNode=e;e:{switch(y=An(i,l),i){case"dialog":dt("cancel",e),dt("close",e),d=l;break;case"iframe":case"object":case"embed":dt("load",e),d=l;break;case"video":case"audio":for(d=0;d<Mi.length;d++)dt(Mi[d],e);d=l;break;case"source":dt("error",e),d=l;break;case"img":case"image":case"link":dt("error",e),dt("load",e),d=l;break;case"details":dt("toggle",e),d=l;break;case"input":It(e,l),d=$e(e,l),dt("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=V({},l,{value:void 0}),dt("invalid",e);break;case"textarea":H(e,l),d=en(e,l),dt("invalid",e);break;default:d=l}Rn(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var R=N[p];p==="style"?br(e,R):p==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Rt(e,R)):p==="children"?typeof R=="string"?(i!=="textarea"||R!=="")&&Ht(e,R):typeof R=="number"&&Ht(e,""+R):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?R!=null&&p==="onScroll"&&dt("scroll",e):R!=null&&B(e,p,R,y))}switch(i){case"input":it(e),_n(e,l,!1);break;case"textarea":it(e),Ue(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ce(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?pt(e,!!l.multiple,p,!1):l.defaultValue!=null&&pt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Ho)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ln(t),null;case 6:if(e&&t.stateNode!=null)gp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(i=ws(Bi.current),ws(yr.current),Qo(t)){if(l=t.stateNode,i=t.memoizedProps,l[vr]=t,(p=l.nodeValue!==i)&&(e=Pn,e!==null))switch(e.tag){case 3:Wo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[vr]=t,t.stateNode=l}return ln(t),null;case 13:if(ft(_t),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&On!==null&&(t.mode&1)!==0&&(t.flags&128)===0)xf(),Qs(),t.flags|=98560,p=!1;else if(p=Qo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[vr]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else ir!==null&&(Wc(ir),ir=null),p=!0;if(!p)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=i,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(_t.current&1)!==0?Bt===0&&(Bt=3):qc())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return ti(),Ic(e,t),e===null&&Li(t.stateNode.containerInfo),ln(t),null;case 10:return oc(t.type._context),ln(t),null;case 17:return Sn(t.type)&&qo(),ln(t),null;case 19:if(ft(_t),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,y=p.rendering,y===null)if(l)Gi(p,!1);else{if(Bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(y=ra(e),y!==null){for(t.flags|=128,Gi(p,!1),l=y.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)p=i,e=l,p.flags&=14680066,y=p.alternate,y===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=y.childLanes,p.lanes=y.lanes,p.child=y.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=y.memoizedProps,p.memoizedState=y.memoizedState,p.updateQueue=y.updateQueue,p.type=y.type,e=y.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ct(_t,_t.current&1|2),t.child}e=e.sibling}p.tail!==null&&Nt()>ii&&(t.flags|=128,l=!0,Gi(p,!1),t.lanes=4194304)}else{if(!l)if(e=ra(y),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Gi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!xt)return ln(t),null}else 2*Nt()-p.renderingStartTime>ii&&i!==1073741824&&(t.flags|=128,l=!0,Gi(p,!1),t.lanes=4194304);p.isBackwards?(y.sibling=t.child,t.child=y):(i=p.last,i!==null?i.sibling=y:t.child=y,p.last=y)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=Nt(),t.sibling=null,i=_t.current,ct(_t,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return Vc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(zn&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function hy(e,t){switch(ec(t),t.tag){case 1:return Sn(t.type)&&qo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(),ft(kn),ft(on),pc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return dc(t),null;case 13:if(ft(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(_t),null;case 4:return ti(),null;case 10:return oc(t.type._context),null;case 22:case 23:return Vc(),null;case 24:return null;default:return null}}var fa=!1,cn=!1,my=typeof WeakSet=="function"?WeakSet:Set,xe=null;function ri(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){At(e,t,l)}else i.current=null}function Dc(e,t,i){try{i()}catch(l){At(e,t,l)}}var vp=!1;function gy(e,t){if(Vl=Io,e=Kd(),Ol(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var y=0,N=-1,R=-1,U=0,J=0,te=e,Z=null;t:for(;;){for(var me;te!==i||d!==0&&te.nodeType!==3||(N=y+d),te!==p||l!==0&&te.nodeType!==3||(R=y+l),te.nodeType===3&&(y+=te.nodeValue.length),(me=te.firstChild)!==null;)Z=te,te=me;for(;;){if(te===e)break t;if(Z===i&&++U===d&&(N=y),Z===p&&++J===l&&(R=y),(me=te.nextSibling)!==null)break;te=Z,Z=te.parentNode}te=me}i=N===-1||R===-1?null:{start:N,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for(ql={focusedElem:e,selectionRange:i},Io=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var ke=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var be=ke.memoizedProps,Pt=ke.memoizedState,O=t.stateNode,D=O.getSnapshotBeforeUpdate(t.elementType===t.type?be:or(t.type,be),Pt);O.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(oe){At(t,t.return,oe)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return ke=vp,vp=!1,ke}function Ki(e,t,i){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Dc(t,i,p)}d=d.next}while(d!==l)}}function pa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==t)}}function Mc(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function yp(e){var t=e.alternate;t!==null&&(e.alternate=null,yp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vr],delete t[Oi],delete t[Xl],delete t[Zv],delete t[Jv])),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 xp(e){return e.tag===5||e.tag===3||e.tag===4}function wp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xp(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 Lc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Ho));else if(l!==4&&(e=e.child,e!==null))for(Lc(e,t,i),e=e.sibling;e!==null;)Lc(e,t,i),e=e.sibling}function Pc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Pc(e,t,i),e=e.sibling;e!==null;)Pc(e,t,i),e=e.sibling}var tn=null,ar=!1;function Xr(e,t,i){for(i=i.child;i!==null;)kp(e,t,i),i=i.sibling}function kp(e,t,i){if(Mn&&typeof Mn.onCommitFiberUnmount=="function")try{Mn.onCommitFiberUnmount(us,i)}catch{}switch(i.tag){case 5:cn||ri(i,t);case 6:var l=tn,d=ar;tn=null,Xr(e,t,i),tn=l,ar=d,tn!==null&&(ar?(e=tn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):tn.removeChild(i.stateNode));break;case 18:tn!==null&&(ar?(e=tn,i=i.stateNode,e.nodeType===8?Yl(e.parentNode,i):e.nodeType===1&&Yl(e,i),Ci(e)):Yl(tn,i.stateNode));break;case 4:l=tn,d=ar,tn=i.stateNode.containerInfo,ar=!0,Xr(e,t,i),tn=l,ar=d;break;case 0:case 11:case 14:case 15:if(!cn&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,y=p.destroy;p=p.tag,y!==void 0&&((p&2)!==0||(p&4)!==0)&&Dc(i,t,y),d=d.next}while(d!==l)}Xr(e,t,i);break;case 1:if(!cn&&(ri(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){At(i,t,N)}Xr(e,t,i);break;case 21:Xr(e,t,i);break;case 22:i.mode&1?(cn=(l=cn)||i.memoizedState!==null,Xr(e,t,i),cn=l):Xr(e,t,i);break;default:Xr(e,t,i)}}function Sp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new my),t.forEach(function(l){var d=Ny.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function lr(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,y=t,N=y;e:for(;N!==null;){switch(N.tag){case 5:tn=N.stateNode,ar=!1;break e;case 3:tn=N.stateNode.containerInfo,ar=!0;break e;case 4:tn=N.stateNode.containerInfo,ar=!0;break e}N=N.return}if(tn===null)throw Error(s(160));kp(p,y,d),tn=null,ar=!1;var R=d.alternate;R!==null&&(R.return=null),d.return=null}catch(U){At(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bp(t,e),t=t.sibling}function bp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lr(t,e),wr(e),l&4){try{Ki(3,e,e.return),pa(3,e)}catch(be){At(e,e.return,be)}try{Ki(5,e,e.return)}catch(be){At(e,e.return,be)}}break;case 1:lr(t,e),wr(e),l&512&&i!==null&&ri(i,i.return);break;case 5:if(lr(t,e),wr(e),l&512&&i!==null&&ri(i,i.return),e.flags&32){var d=e.stateNode;try{Ht(d,"")}catch(be){At(e,e.return,be)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,y=i!==null?i.memoizedProps:p,N=e.type,R=e.updateQueue;if(e.updateQueue=null,R!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&Fe(d,p),An(N,y);var U=An(N,p);for(y=0;y<R.length;y+=2){var J=R[y],te=R[y+1];J==="style"?br(d,te):J==="dangerouslySetInnerHTML"?Rt(d,te):J==="children"?Ht(d,te):B(d,J,te,U)}switch(N){case"input":Dt(d,p);break;case"textarea":he(d,p);break;case"select":var Z=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var me=p.value;me!=null?pt(d,!!p.multiple,me,!1):Z!==!!p.multiple&&(p.defaultValue!=null?pt(d,!!p.multiple,p.defaultValue,!0):pt(d,!!p.multiple,p.multiple?[]:"",!1))}d[Oi]=p}catch(be){At(e,e.return,be)}}break;case 6:if(lr(t,e),wr(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(be){At(e,e.return,be)}}break;case 3:if(lr(t,e),wr(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ci(t.containerInfo)}catch(be){At(e,e.return,be)}break;case 4:lr(t,e),wr(e);break;case 13:lr(t,e),wr(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||($c=Nt())),l&4&&Sp(e);break;case 22:if(J=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(U=cn)||J,lr(t,e),cn=U):lr(t,e),wr(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!J&&(e.mode&1)!==0)for(xe=e,J=e.child;J!==null;){for(te=xe=J;xe!==null;){switch(Z=xe,me=Z.child,Z.tag){case 0:case 11:case 14:case 15:Ki(4,Z,Z.return);break;case 1:ri(Z,Z.return);var ke=Z.stateNode;if(typeof ke.componentWillUnmount=="function"){l=Z,i=Z.return;try{t=l,ke.props=t.memoizedProps,ke.state=t.memoizedState,ke.componentWillUnmount()}catch(be){At(l,i,be)}}break;case 5:ri(Z,Z.return);break;case 22:if(Z.memoizedState!==null){Cp(te);continue}}me!==null?(me.return=Z,xe=me):Cp(te)}J=J.sibling}e:for(J=null,te=e;;){if(te.tag===5){if(J===null){J=te;try{d=te.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=te.stateNode,R=te.memoizedProps.style,y=R!=null&&R.hasOwnProperty("display")?R.display:null,N.style.display=Hn("display",y))}catch(be){At(e,e.return,be)}}}else if(te.tag===6){if(J===null)try{te.stateNode.nodeValue=U?"":te.memoizedProps}catch(be){At(e,e.return,be)}}else if((te.tag!==22&&te.tag!==23||te.memoizedState===null||te===e)&&te.child!==null){te.child.return=te,te=te.child;continue}if(te===e)break e;for(;te.sibling===null;){if(te.return===null||te.return===e)break e;J===te&&(J=null),te=te.return}J===te&&(J=null),te.sibling.return=te.return,te=te.sibling}}break;case 19:lr(t,e),wr(e),l&4&&Sp(e);break;case 21:break;default:lr(t,e),wr(e)}}function wr(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(xp(i)){var l=i;break e}i=i.return}throw Error(s(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(Ht(d,""),l.flags&=-33);var p=wp(e);Pc(e,p,d);break;case 3:case 4:var y=l.stateNode.containerInfo,N=wp(e);Lc(e,N,y);break;default:throw Error(s(161))}}catch(R){At(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vy(e,t,i){xe=e,Tp(e)}function Tp(e,t,i){for(var l=(e.mode&1)!==0;xe!==null;){var d=xe,p=d.child;if(d.tag===22&&l){var y=d.memoizedState!==null||fa;if(!y){var N=d.alternate,R=N!==null&&N.memoizedState!==null||cn;N=fa;var U=cn;if(fa=y,(cn=R)&&!U)for(xe=d;xe!==null;)y=xe,R=y.child,y.tag===22&&y.memoizedState!==null?Ep(d):R!==null?(R.return=y,xe=R):Ep(d);for(;p!==null;)xe=p,Tp(p),p=p.sibling;xe=d,fa=N,cn=U}Np(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,xe=p):Np(e)}}function Np(e){for(;xe!==null;){var t=xe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:cn||pa(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!cn)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:or(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&Cf(t,p,l);break;case 3:var y=t.updateQueue;if(y!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Cf(t,y,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var R=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&i.focus();break;case"img":R.src&&(i.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var J=U.memoizedState;if(J!==null){var te=J.dehydrated;te!==null&&Ci(te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}cn||t.flags&512&&Mc(t)}catch(Z){At(t,t.return,Z)}}if(t===e){xe=null;break}if(i=t.sibling,i!==null){i.return=t.return,xe=i;break}xe=t.return}}function Cp(e){for(;xe!==null;){var t=xe;if(t===e){xe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,xe=i;break}xe=t.return}}function Ep(e){for(;xe!==null;){var t=xe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{pa(4,t)}catch(R){At(t,i,R)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(R){At(t,d,R)}}var p=t.return;try{Mc(t)}catch(R){At(t,p,R)}break;case 5:var y=t.return;try{Mc(t)}catch(R){At(t,y,R)}}}catch(R){At(t,t.return,R)}if(t===e){xe=null;break}var N=t.sibling;if(N!==null){N.return=t.return,xe=N;break}xe=t.return}}var yy=Math.ceil,ha=$.ReactCurrentDispatcher,Oc=$.ReactCurrentOwner,Yn=$.ReactCurrentBatchConfig,Ye=0,Yt=null,zt=null,nn=0,zn=0,si=Vr(0),Bt=0,Yi=null,Ss=0,ma=0,zc=0,Xi=null,Tn=null,$c=0,ii=1/0,Ir=null,ga=!1,Fc=null,Qr=null,va=!1,Zr=null,ya=0,Qi=0,Uc=null,xa=-1,wa=0;function mn(){return(Ye&6)!==0?Nt():xa!==-1?xa:xa=Nt()}function Jr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&nn!==0?nn&-nn:ty.transition!==null?(wa===0&&(wa=Si()),wa):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:_d(e.type)),e)}function cr(e,t,i,l){if(50<Qi)throw Qi=0,Uc=null,Error(s(185));hs(e,i,l),((Ye&2)===0||e!==Yt)&&(e===Yt&&((Ye&2)===0&&(ma|=i),Bt===4&&es(e,nn)),Nn(e,l),i===1&&Ye===0&&(t.mode&1)===0&&(ii=Nt()+500,Ko&&Gr()))}function Nn(e,t){var i=e.callbackNode;jo(e,t);var l=ps(e,e===Yt?nn:0);if(l===0)i!==null&&rr(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&rr(i),t===1)e.tag===0?ey(jp.bind(null,e)):hf(jp.bind(null,e)),Xv(function(){(Ye&6)===0&&Gr()}),i=null;else{switch(ie(l)){case 1:i=zr;break;case 4:i=gr;break;case 16:i=Ls;break;case 536870912:i=Eo;break;default:i=Ls}i=Op(i,_p.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function _p(e,t){if(xa=-1,wa=0,(Ye&6)!==0)throw Error(s(327));var i=e.callbackNode;if(oi()&&e.callbackNode!==i)return null;var l=ps(e,e===Yt?nn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=ka(e,l);else{t=l;var d=Ye;Ye|=2;var p=Ap();(Yt!==e||nn!==t)&&(Ir=null,ii=Nt()+500,Ts(e,t));do try{ky();break}catch(N){Rp(e,N)}while(!0);ic(),ha.current=p,Ye=d,zt!==null?t=0:(Yt=null,nn=0,t=Bt)}if(t!==0){if(t===2&&(d=ki(e),d!==0&&(l=d,t=Bc(e,d))),t===1)throw i=Yi,Ts(e,0),es(e,l),Nn(e,Nt()),i;if(t===6)es(e,l);else{if(d=e.current.alternate,(l&30)===0&&!xy(d)&&(t=ka(e,l),t===2&&(p=ki(e),p!==0&&(l=p,t=Bc(e,p))),t===1))throw i=Yi,Ts(e,0),es(e,l),Nn(e,Nt()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:Ns(e,Tn,Ir);break;case 3:if(es(e,l),(l&130023424)===l&&(t=$c+500-Nt(),10<t)){if(ps(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){mn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Kl(Ns.bind(null,e,Tn,Ir),t);break}Ns(e,Tn,Ir);break;case 4:if(es(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var y=31-fn(l);p=1<<y,y=t[y],y>d&&(d=y),l&=~p}if(l=d,l=Nt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*yy(l/1960))-l,10<l){e.timeoutHandle=Kl(Ns.bind(null,e,Tn,Ir),l);break}Ns(e,Tn,Ir);break;case 5:Ns(e,Tn,Ir);break;default:throw Error(s(329))}}}return Nn(e,Nt()),e.callbackNode===i?_p.bind(null,e):null}function Bc(e,t){var i=Xi;return e.current.memoizedState.isDehydrated&&(Ts(e,t).flags|=256),e=ka(e,t),e!==2&&(t=Tn,Tn=i,t!==null&&Wc(t)),e}function Wc(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function xy(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!sr(p(),d))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 es(e,t){for(t&=~zc,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-fn(t),l=1<<i;e[i]=-1,t&=~l}}function jp(e){if((Ye&6)!==0)throw Error(s(327));oi();var t=ps(e,0);if((t&1)===0)return Nn(e,Nt()),null;var i=ka(e,t);if(e.tag!==0&&i===2){var l=ki(e);l!==0&&(t=l,i=Bc(e,l))}if(i===1)throw i=Yi,Ts(e,0),es(e,t),Nn(e,Nt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ns(e,Tn,Ir),Nn(e,Nt()),null}function Hc(e,t){var i=Ye;Ye|=1;try{return e(t)}finally{Ye=i,Ye===0&&(ii=Nt()+500,Ko&&Gr())}}function bs(e){Zr!==null&&Zr.tag===0&&(Ye&6)===0&&oi();var t=Ye;Ye|=1;var i=Yn.transition,l=Ge;try{if(Yn.transition=null,Ge=1,e)return e()}finally{Ge=l,Yn.transition=i,Ye=t,(Ye&6)===0&&Gr()}}function Vc(){zn=si.current,ft(si)}function Ts(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Yv(i)),zt!==null)for(i=zt.return;i!==null;){var l=i;switch(ec(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&qo();break;case 3:ti(),ft(kn),ft(on),pc();break;case 5:dc(l);break;case 4:ti();break;case 13:ft(_t);break;case 19:ft(_t);break;case 10:oc(l.type._context);break;case 22:case 23:Vc()}i=i.return}if(Yt=e,zt=e=ts(e.current,null),nn=zn=t,Bt=0,Yi=null,zc=ma=Ss=0,Tn=Xi=null,xs!==null){for(t=0;t<xs.length;t++)if(i=xs[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var y=p.next;p.next=d,l.next=y}i.pending=l}xs=null}return e}function Rp(e,t){do{var i=zt;try{if(ic(),sa.current=la,ia){for(var l=jt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}ia=!1}if(ks=0,Kt=Ut=jt=null,Wi=!1,Hi=0,Oc.current=null,i===null||i.return===null){Bt=1,Yi=t,zt=null;break}e:{var p=e,y=i.return,N=i,R=t;if(t=nn,N.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var U=R,J=N,te=J.tag;if((J.mode&1)===0&&(te===0||te===11||te===15)){var Z=J.alternate;Z?(J.updateQueue=Z.updateQueue,J.memoizedState=Z.memoizedState,J.lanes=Z.lanes):(J.updateQueue=null,J.memoizedState=null)}var me=tp(y);if(me!==null){me.flags&=-257,np(me,y,N,p,t),me.mode&1&&ep(p,U,t),t=me,R=U;var ke=t.updateQueue;if(ke===null){var be=new Set;be.add(R),t.updateQueue=be}else ke.add(R);break e}else{if((t&1)===0){ep(p,U,t),qc();break e}R=Error(s(426))}}else if(xt&&N.mode&1){var Pt=tp(y);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),np(Pt,y,N,p,t),rc(ni(R,N));break e}}p=R=ni(R,N),Bt!==4&&(Bt=2),Xi===null?Xi=[p]:Xi.push(p),p=y;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var O=Zf(p,R,t);Nf(p,O);break e;case 1:N=R;var D=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof D.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Qr===null||!Qr.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var oe=Jf(p,N,t);Nf(p,oe);break e}}p=p.return}while(p!==null)}Dp(i)}catch(Te){t=Te,zt===i&&i!==null&&(zt=i=i.return);continue}break}while(!0)}function Ap(){var e=ha.current;return ha.current=la,e===null?la:e}function qc(){(Bt===0||Bt===3||Bt===2)&&(Bt=4),Yt===null||(Ss&268435455)===0&&(ma&268435455)===0||es(Yt,nn)}function ka(e,t){var i=Ye;Ye|=2;var l=Ap();(Yt!==e||nn!==t)&&(Ir=null,Ts(e,t));do try{wy();break}catch(d){Rp(e,d)}while(!0);if(ic(),Ye=i,ha.current=l,zt!==null)throw Error(s(261));return Yt=null,nn=0,Bt}function wy(){for(;zt!==null;)Ip(zt)}function ky(){for(;zt!==null&&!Tl();)Ip(zt)}function Ip(e){var t=Pp(e.alternate,e,zn);e.memoizedProps=e.pendingProps,t===null?Dp(e):zt=t,Oc.current=null}function Dp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=py(i,t,zn),i!==null){zt=i;return}}else{if(i=hy(i,t),i!==null){i.flags&=32767,zt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Bt=6,zt=null;return}}if(t=t.sibling,t!==null){zt=t;return}zt=t=e}while(t!==null);Bt===0&&(Bt=5)}function Ns(e,t,i){var l=Ge,d=Yn.transition;try{Yn.transition=null,Ge=1,Sy(e,t,i,l)}finally{Yn.transition=d,Ge=l}return null}function Sy(e,t,i,l){do oi();while(Zr!==null);if((Ye&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(Ro(e,p),e===Yt&&(zt=Yt=null,nn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||va||(va=!0,Op(Ls,function(){return oi(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Yn.transition,Yn.transition=null;var y=Ge;Ge=1;var N=Ye;Ye|=4,Oc.current=null,gy(e,i),bp(i,e),Bv(ql),Io=!!Vl,ql=Vl=null,e.current=i,vy(i),Nl(),Ye=N,Ge=y,Yn.transition=p}else e.current=i;if(va&&(va=!1,Zr=e,ya=d),p=e.pendingLanes,p===0&&(Qr=null),Ps(i.stateNode),Nn(e,Nt()),t!==null)for(l=e.onRecoverableError,i=0;i<t.length;i++)d=t[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(ga)throw ga=!1,e=Fc,Fc=null,e;return(ya&1)!==0&&e.tag!==0&&oi(),p=e.pendingLanes,(p&1)!==0?e===Uc?Qi++:(Qi=0,Uc=e):Qi=0,Gr(),null}function oi(){if(Zr!==null){var e=ie(ya),t=Yn.transition,i=Ge;try{if(Yn.transition=null,Ge=16>e?16:e,Zr===null)var l=!1;else{if(e=Zr,Zr=null,ya=0,(Ye&6)!==0)throw Error(s(331));var d=Ye;for(Ye|=4,xe=e.current;xe!==null;){var p=xe,y=p.child;if((xe.flags&16)!==0){var N=p.deletions;if(N!==null){for(var R=0;R<N.length;R++){var U=N[R];for(xe=U;xe!==null;){var J=xe;switch(J.tag){case 0:case 11:case 15:Ki(8,J,p)}var te=J.child;if(te!==null)te.return=J,xe=te;else for(;xe!==null;){J=xe;var Z=J.sibling,me=J.return;if(yp(J),J===U){xe=null;break}if(Z!==null){Z.return=me,xe=Z;break}xe=me}}}var ke=p.alternate;if(ke!==null){var be=ke.child;if(be!==null){ke.child=null;do{var Pt=be.sibling;be.sibling=null,be=Pt}while(be!==null)}}xe=p}}if((p.subtreeFlags&2064)!==0&&y!==null)y.return=p,xe=y;else e:for(;xe!==null;){if(p=xe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Ki(9,p,p.return)}var O=p.sibling;if(O!==null){O.return=p.return,xe=O;break e}xe=p.return}}var D=e.current;for(xe=D;xe!==null;){y=xe;var F=y.child;if((y.subtreeFlags&2064)!==0&&F!==null)F.return=y,xe=F;else e:for(y=D;xe!==null;){if(N=xe,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:pa(9,N)}}catch(Te){At(N,N.return,Te)}if(N===y){xe=null;break e}var oe=N.sibling;if(oe!==null){oe.return=N.return,xe=oe;break e}xe=N.return}}if(Ye=d,Gr(),Mn&&typeof Mn.onPostCommitFiberRoot=="function")try{Mn.onPostCommitFiberRoot(us,e)}catch{}l=!0}return l}finally{Ge=i,Yn.transition=t}}return!1}function Mp(e,t,i){t=ni(i,t),t=Zf(e,t,1),e=Yr(e,t,1),t=mn(),e!==null&&(hs(e,1,t),Nn(e,t))}function At(e,t,i){if(e.tag===3)Mp(e,e,i);else for(;t!==null;){if(t.tag===3){Mp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Qr===null||!Qr.has(l))){e=ni(i,e),e=Jf(t,e,1),t=Yr(t,e,1),e=mn(),t!==null&&(hs(t,1,e),Nn(t,e));break}}t=t.return}}function by(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=mn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(nn&i)===i&&(Bt===4||Bt===3&&(nn&130023424)===nn&&500>Nt()-$c?Ts(e,0):zc|=i),Nn(e,t)}function Lp(e,t){t===0&&((e.mode&1)===0?t=1:(t=zs,zs<<=1,(zs&130023424)===0&&(zs=4194304)));var i=mn();e=jr(e,t),e!==null&&(hs(e,t,i),Nn(e,i))}function Ty(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Lp(e,i)}function Ny(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),Lp(e,i)}var Pp;Pp=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||kn.current)bn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return bn=!1,fy(e,t,i);bn=(e.flags&131072)!==0}else bn=!1,xt&&(t.flags&1048576)!==0&&mf(t,Xo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;da(e,t),e=t.pendingProps;var d=Ks(t,on.current);ei(t,i),d=gc(null,t,l,e,d,i);var p=vc();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,Sn(l)?(p=!0,Go(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,cc(t),d.updater=ca,t.stateNode=d,d._reactInternals=t,bc(t,l,e,i),t=Ec(null,t,l,!0,p,i)):(t.tag=0,xt&&p&&Jl(t),hn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(da(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=Ey(l),e=or(l,e),d){case 0:t=Cc(null,t,l,e,i);break e;case 1:t=lp(null,t,l,e,i);break e;case 11:t=rp(null,t,l,e,i);break e;case 14:t=sp(null,t,l,or(l.type,e),i);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),Cc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),lp(e,t,l,d,i);case 3:e:{if(cp(t),e===null)throw Error(s(387));l=t.pendingProps,p=t.memoizedState,d=p.element,Tf(e,t),na(t,l,null,i);var y=t.memoizedState;if(l=y.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=ni(Error(s(423)),t),t=up(e,t,l,i,d);break e}else if(l!==d){d=ni(Error(s(424)),t),t=up(e,t,l,i,d);break e}else for(On=Hr(t.stateNode.containerInfo.firstChild),Pn=t,xt=!0,ir=null,i=Sf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Qs(),l===d){t=Ar(e,t,i);break e}hn(e,t,l,i)}t=t.child}return t;case 5:return Ef(t),e===null&&nc(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,y=d.children,Gl(l,d)?y=null:p!==null&&Gl(l,p)&&(t.flags|=32),ap(e,t),hn(e,t,y,i),t.child;case 6:return e===null&&nc(t),null;case 13:return dp(e,t,i);case 4:return uc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Zs(t,null,l,i):hn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),rp(e,t,l,d,i);case 7:return hn(e,t,t.pendingProps,i),t.child;case 8:return hn(e,t,t.pendingProps.children,i),t.child;case 12:return hn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,y=d.value,ct(Jo,l._currentValue),l._currentValue=y,p!==null)if(sr(p.value,y)){if(p.children===d.children&&!kn.current){t=Ar(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){y=p.child;for(var R=N.firstContext;R!==null;){if(R.context===l){if(p.tag===1){R=Rr(-1,i&-i),R.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var J=U.pending;J===null?R.next=R:(R.next=J.next,J.next=R),U.pending=R}}p.lanes|=i,R=p.alternate,R!==null&&(R.lanes|=i),ac(p.return,i,t),N.lanes|=i;break}R=R.next}}else if(p.tag===10)y=p.type===t.type?null:p.child;else if(p.tag===18){if(y=p.return,y===null)throw Error(s(341));y.lanes|=i,N=y.alternate,N!==null&&(N.lanes|=i),ac(y,i,t),y=p.sibling}else y=p.child;if(y!==null)y.return=p;else for(y=p;y!==null;){if(y===t){y=null;break}if(p=y.sibling,p!==null){p.return=y.return,y=p;break}y=y.return}p=y}hn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,ei(t,i),d=Gn(d),l=l(d),t.flags|=1,hn(e,t,l,i),t.child;case 14:return l=t.type,d=or(l,t.pendingProps),d=or(l.type,d),sp(e,t,l,d,i);case 15:return ip(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),da(e,t),t.tag=1,Sn(l)?(e=!0,Go(t)):e=!1,ei(t,i),Xf(t,l,d),bc(t,l,d,i),Ec(null,t,l,!0,e,i);case 19:return pp(e,t,i);case 22:return op(e,t,i)}throw Error(s(156,t.tag))};function Op(e,t){return Tt(e,t)}function Cy(e,t,i,l){this.tag=e,this.key=i,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,t,i,l){return new Cy(e,t,i,l)}function Gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ey(e){if(typeof e=="function")return Gc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pe)return 11;if(e===ee)return 14}return 2}function ts(e,t){var i=e.alternate;return i===null?(i=Xn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Sa(e,t,i,l,d,p){var y=2;if(l=e,typeof e=="function")Gc(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case G:return Cs(i.children,d,p,t);case K:y=8,d|=8;break;case ue:return e=Xn(12,i,t,d|2),e.elementType=ue,e.lanes=p,e;case ve:return e=Xn(13,i,t,d),e.elementType=ve,e.lanes=p,e;case Me:return e=Xn(19,i,t,d),e.elementType=Me,e.lanes=p,e;case ae:return ba(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ge:y=10;break e;case de:y=9;break e;case pe:y=11;break e;case ee:y=14;break e;case re:y=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Xn(y,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function Cs(e,t,i,l){return e=Xn(7,e,l,t),e.lanes=i,e}function ba(e,t,i,l){return e=Xn(22,e,l,t),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function Kc(e,t,i){return e=Xn(6,e,null,t),e.lanes=i,e}function Yc(e,t,i){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _y(e,t,i,l,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=bi(0),this.expirationTimes=bi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Xc(e,t,i,l,d,p,y,N,R){return e=new _y(e,t,i,N,R),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Xn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},cc(p),e}function jy(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function zp(e){if(!e)return qr;e=e._reactInternals;e:{if(He(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Sn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(Sn(i))return ff(e,i,t)}return t}function $p(e,t,i,l,d,p,y,N,R){return e=Xc(i,l,!0,e,d,p,y,N,R),e.context=zp(null),i=e.current,l=mn(),d=Jr(i),p=Rr(l,d),p.callback=t??null,Yr(i,p,d),e.current.lanes=d,hs(e,d,l),Nn(e,l),e}function Ta(e,t,i,l){var d=t.current,p=mn(),y=Jr(d);return i=zp(i),t.context===null?t.context=i:t.pendingContext=i,t=Rr(p,y),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Yr(d,t,y),e!==null&&(cr(e,d,y,p),ta(e,d,y)),y}function Na(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 Fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Qc(e,t){Fp(e,t),(e=e.alternate)&&Fp(e,t)}function Ry(){return null}var Up=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zc(e){this._internalRoot=e}Ca.prototype.render=Zc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));Ta(e,t,null,null)},Ca.prototype.unmount=Zc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){Ta(null,e,null,null)}),t[Nr]=null}};function Ca(e){this._internalRoot=e}Ca.prototype.unstable_scheduleHydration=function(e){if(e){var t=Se();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ur.length&&t!==0&&t<Ur[i].priority;i++);Ur.splice(i,0,e),i===0&&Cd(e)}};function Jc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ea(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Bp(){}function Ay(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=Na(y);p.call(U)}}var y=$p(t,l,e,0,null,!1,!1,"",Bp);return e._reactRootContainer=y,e[Nr]=y.current,Li(e.nodeType===8?e.parentNode:e),bs(),y}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var U=Na(R);N.call(U)}}var R=Xc(e,0,!1,null,null,!1,!1,"",Bp);return e._reactRootContainer=R,e[Nr]=R.current,Li(e.nodeType===8?e.parentNode:e),bs(function(){Ta(t,R,i,l)}),R}function _a(e,t,i,l,d){var p=i._reactRootContainer;if(p){var y=p;if(typeof d=="function"){var N=d;d=function(){var R=Na(y);N.call(R)}}Ta(t,y,e,d)}else y=Ay(i,t,e,d,l);return Na(y)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=fs(t.pendingLanes);i!==0&&(Fr(t,i|1),Nn(t,Nt()),(Ye&6)===0&&(ii=Nt()+500,Gr()))}break;case 13:bs(function(){var l=jr(e,1);if(l!==null){var d=mn();cr(l,e,1,d)}}),Qc(e,1)}},P=function(e){if(e.tag===13){var t=jr(e,134217728);if(t!==null){var i=mn();cr(t,e,134217728,i)}Qc(e,134217728)}},Q=function(e){if(e.tag===13){var t=Jr(e),i=jr(e,t);if(i!==null){var l=mn();cr(i,e,t,l)}Qc(e,t)}},Se=function(){return Ge},Ne=function(e,t){var i=Ge;try{return Ge=e,t()}finally{Ge=i}},Ft=function(e,t,i){switch(t){case"input":if(Dt(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var d=Vo(l);if(!d)throw Error(s(90));Ee(l),Dt(l,d)}}}break;case"textarea":he(e,i);break;case"select":t=i.value,t!=null&&pt(e,!!i.multiple,t,!1)}},bt=Hc,yt=bs;var Iy={usingClientEntryPoint:!1,Events:[zi,qs,Vo,vt,qt,Hc]},Zi={findFiberByHostInstance:ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Dy={bundleType:Zi.bundleType,version:Zi.version,rendererPackageName:Zi.rendererPackageName,rendererConfig:Zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nr(e),e===null?null:e.stateNode},findFiberByHostInstance:Zi.findFiberByHostInstance||Ry,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 ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ja.isDisabled&&ja.supportsFiber)try{us=ja.inject(Dy),Mn=ja}catch{}}return Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Iy,Cn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jc(t))throw Error(s(200));return jy(e,t,null,i)},Cn.createRoot=function(e,t){if(!Jc(e))throw Error(s(299));var i=!1,l="",d=Up;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Xc(e,1,!1,null,null,i,!1,l,d),e[Nr]=t.current,Li(e.nodeType===8?e.parentNode:e),new Zc(t)},Cn.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(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=nr(t),e=e===null?null:e.stateNode,e},Cn.flushSync=function(e){return bs(e)},Cn.hydrate=function(e,t,i){if(!Ea(t))throw Error(s(200));return _a(null,e,t,!0,i)},Cn.hydrateRoot=function(e,t,i){if(!Jc(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",y=Up;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),t=$p(t,null,e,1,i??null,d,!1,p,y),e[Nr]=t.current,Li(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,d]:t.mutableSourceEagerHydrationData.push(i,d);return new Ca(t)},Cn.render=function(e,t,i){if(!Ea(t))throw Error(s(200));return _a(null,e,t,!1,i)},Cn.unmountComponentAtNode=function(e){if(!Ea(e))throw Error(s(40));return e._reactRootContainer?(bs(function(){_a(null,null,e,!1,function(){e._reactRootContainer=null,e[Nr]=null})}),!0):!1},Cn.unstable_batchedUpdates=Hc,Cn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!Ea(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return _a(e,t,i,!1,l)},Cn.version="18.3.1-next-f1338f8080-20240426",Cn}var Xp;function Dm(){if(Xp)return nu.exports;Xp=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(),nu.exports=By(),nu.exports}var Qp;function Wy(){if(Qp)return Ra;Qp=1;var n=Dm();return Ra.createRoot=n.createRoot,Ra.hydrateRoot=n.hydrateRoot,Ra}var Hy=Wy();const Vy=Im(Hy),Zp=n=>{let r;const s=new Set,o=(m,v)=>{const k=typeof m=="function"?m(r):m;if(!Object.is(k,r)){const x=r;r=v??(typeof k!="object"||k===null)?k:Object.assign({},r,k),s.forEach(b=>b(r,x))}},a=()=>r,h={setState:o,getState:a,getInitialState:()=>g,subscribe:m=>(s.add(m),()=>s.delete(m))},g=r=n(o,a,h);return h},qy=(n=>n?Zp(n):Zp),Gy=n=>n;function Ky(n,r=Gy){const s=st.useSyncExternalStore(n.subscribe,st.useCallback(()=>r(n.getState()),[n,r]),st.useCallback(()=>r(n.getInitialState()),[n,r]));return st.useDebugValue(s),s}const Yy=n=>{const r=qy(n),s=o=>Ky(r,o);return Object.assign(s,r),s},Xy=(n=>Yy),Mm="agentpane:machines",Lm="agentpane:active-machine";function Qy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Pm(n){return`${n}.repoburg.com`}function Om(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function zm(n,r){try{const s=localStorage.getItem(n);return s==null?r:JSON.parse(s)}catch{return r}}function $m(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function Fm(){return zm(Mm,[]).filter(r=>Qy(r.mahlas)&&r.hostname===Pm(r.mahlas))}function Zy(n){const r={mahlas:n,hostname:Pm(n),lastConnectedAt:new Date().toISOString()},s=Fm(),o=[r,...s.filter(a=>a.mahlas!==n)];return $m(Mm,o),r}function Jy(){const n=zm(Lm,null);return n?Fm().find(r=>r.mahlas===n)??null:null}function ex(n){$m(Lm,n)}function tx(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Om(n);r&&(Zy(r),ex(r))}const Jp="http://localhost:9998",nx=["agent.repoburg.com"];function Un(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),r=n.get("bport");if(r)return`http://localhost:${r}`;const s=n.get("host");if(s)return`https://${s}`;const o=window.location.hostname;if(nx.includes(o))return Jp;if(Om(o))return"";const a=Jy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Jp}const rx="/api";async function wo(n,r,s){const o=await fetch(`${Un()}${rx}${r}`,{method:n,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${r} failed: ${a}`)}return o.json()}function vn(n){return wo("GET",n)}function wt(n,r){return wo("POST",n,r)}function fl(n){return wo("DELETE",n)}function Sr(n,r){return wo("PATCH",n,r)}function sx(n,r){return wo("PUT",n,r)}function ix(){return vn("/sessions")}function eo(n){return vn(`/sessions/${n}`)}function Gu(n){return wt("/sessions",n)}function eh(n){return fl(`/sessions/${n}`)}function Um(n,r,s,o){return wt(`/sessions/${n}/turns`,{user_prompt:r,...s!=null&&s.length?{attachments:s}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function ox(n){return wt(`/sessions/${n}/cancel`)}function ax(n,r){return wt(`/sessions/${n}/turns/${r}/resume`)}function lx(n,r){return Sr(`/sessions/${n}`,{title:r})}function th(n){return Sr(`/sessions/${n}`,{lifecycle:"finished"})}function nh(n){return Sr(`/sessions/${n}`,{lifecycle:"working"})}function cx(n,r){return Sr(`/sessions/${n}`,{starred:r})}function rh(n){return Sr(`/sessions/${n}`,{has_unreviewed:0})}function ux(n,r,s,o){const a={model:r,model_reasoning_effort:s};return o!==void 0&&(a.runtime_type=o),Sr(`/sessions/${n}`,a)}function dx(n,r){return Sr(`/sessions/${n}`,{runtime_config:r})}function fx(n,r){return wt(`/sessions/${n}/rewind`,{turn_id:r})}function px(n){return wt(`/sessions/${n}/restore`,{})}function hx(n,r,s){return wt(`/sessions/${n}/branch`,{turn_id:r,title:s})}function Bm(){return vn("/workspaces")}function mx(n,r){return wt("/workspaces",{path:n,label:r})}function gx(n){return wt("/workspaces/hide",{path:n})}async function vx(){const n=await fetch(`${Un()}/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 Wm(){return vn("/folders")}function yx(n,r){return wt("/folders",{workspace_path:n,name:r})}function sh(n,r){return Sr(`/folders/${n}`,r)}function xx(n){return fl(`/folders/${n}`)}function wx(n){return wt("/sessions/reorder",{moves:n})}function as(n){return n.status==="pending"||n.status==="running"}function Hm(n){return!!(n!=null&&n.turns.some(as))}function pl(n){return n?n.turns.some(as)||(n.threads??[]).some(r=>(r.turns??[]).some(as)):!1}const Vm=1;function qm(){let n="";try{n=Un()}catch{}return`agentpane:tabs:${n||window.location.origin}`}function ih(n){return Array.isArray(n)&&n.every(r=>typeof r=="string")}function oh(n){return n===null||typeof n=="string"}function kx(n){if(n==null)return null;let r;try{r=JSON.parse(n)}catch{return null}if(typeof r!="object"||r===null)return null;const s=r;return s.v!==Vm||!ih(s.openTabs)||!oh(s.activeSessionId)||!ih(s.openAppTabs)||!oh(s.activeAppTabId)?null:{openTabs:s.openTabs,activeSessionId:s.activeSessionId,openAppTabs:s.openAppTabs,activeAppTabId:s.activeAppTabId}}const Gm=[()=>window.sessionStorage,()=>window.localStorage];function Sx(){const n=qm();for(const r of Gm)try{const s=kx(r().getItem(n));if(s)return s}catch{}return null}function bx(n){const r=qm(),s=JSON.stringify({v:Vm,openTabs:n.openTabs,activeSessionId:n.activeSessionId,openAppTabs:n.openAppTabs,activeAppTabId:n.activeAppTabId});for(const o of Gm)try{o().setItem(r,s)}catch{}}function Tx(n){return n.subscribe((r,s)=>{(r.openTabs!==s.openTabs||r.activeSessionId!==s.activeSessionId||r.openAppTabs!==s.openAppTabs||r.activeAppTabId!==s.activeAppTabId)&&bx(r)})}function Ha(n){return[...new Set(n)]}function Nx(n,r,s,o){const a=m=>s===null||s.has(m),u=Ha(((n==null?void 0:n.openTabs)??[]).filter(m=>r.has(m))),f=Ha(((n==null?void 0:n.openAppTabs)??[]).filter(a));let h=(n==null?void 0:n.activeSessionId)??null;h!==null&&!r.has(h)&&(h=null),h!==null&&!u.includes(h)&&u.push(h),h??(h=u.at(-1)??null);let g=(n==null?void 0:n.activeAppTabId)??null;return g!==null&&!a(g)&&(g=null),g!==null&&!f.includes(g)&&f.push(g),o!==null&&r.has(o)&&(u.includes(o)||u.push(o),h=o,g=null),{openTabs:u,activeSessionId:h,openAppTabs:f,activeAppTabId:g}}function Cx(){const n=new URLSearchParams(window.location.search);return{session:n.get("session"),thread:n.get("thread")}}function Ex(){const n=new URL(window.location.href);!n.searchParams.has("session")&&!n.searchParams.has("thread")||(n.searchParams.delete("session"),n.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",n))}let iu=0;function ah(n){return n==="sidecar"?"sidecar":"turns"}async function _x(n,r){const s=await Promise.allSettled(n.map(u=>r(u))),o=new Map;let a=null;return s.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function lh(n,r){const s={...n.sessionDetails};r.forEach(h=>delete s[h]);const o={...n.backgroundTasks};r.forEach(h=>delete o[h]);const a=n.openTabs.filter(h=>!r.has(h));let u=n.activeSessionId,f=n.activeTurnIndex;if(u&&r.has(u)){u=a.length>0?a[a.length-1]:null;const h=u?s[u]:null;f=h&&h.turns.length>0?h.turns.length-1:0}return{sessions:n.sessions.filter(h=>!r.has(h.id)),sessionDetails:s,backgroundTasks:o,openTabs:a,activeSessionId:u,activeTurnIndex:f}}function jx(n){const r={...n};return delete r.turns,delete r.threads,delete r.contextUsage,r}async function ch(n,r,s,o,a){if(s.length===0)return;n({error:null});const{updated:u,firstError:f}=await _x(s,o);u.size>0&&n(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const h=s.length-u.size;if(h===0)r().addToast("info",`${s.length} session${s.length===1?"":"s"} ${a}`);else{n({error:f});const g=a[0].toUpperCase()+a.slice(1);r().addToast(h===s.length?"error":"warn",`${g} ${u.size} of ${s.length} — ${h} failed`)}}const Rx=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const s=Cx(),o=Sx();try{const a=localStorage.getItem("agentpane:last-model-config");a&&n({lastModelConfig:JSON.parse(a)})}catch{}n({loading:!0,error:null});try{const a=r().loadApps(),[u,f,h]=await Promise.all([ix(),Bm(),Wm()]);n({sessions:u,workspaces:f,folders:h,loading:!1}),Ex();const g=await a,m=Nx(o,new Set(u.map(v=>v.id)),g?new Set(r().apps.map(v=>v.id)):null,s.session);n(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Ha([...m.openTabs,...v.openTabs]),openAppTabs:Ha([...m.openAppTabs,...v.openAppTabs]),activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!r().activeSessionId&&await r().selectSession(m.activeSessionId,{keepAppView:!0}),s.thread&&(n({deepLinkThreadId:s.thread}),r().switchRightTab("threads"))}catch(a){n({loading:!1,error:a.message})}},selectSession:async(s,o)=>{const a=++iu,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},f=h=>h.includes(s)?h:[...h,s];if(r().sessionDetails[s]){const h=r().sessionDetails[s];n({activeSessionId:s,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:ah(r().activeRightTab),...u,openTabs:f(r().openTabs)}),h.has_unreviewed===1&&(rh(s).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===s?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[s]:{...h,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const h=await eo(s);if(a!==iu){n(g=>({sessionDetails:{...g.sessionDetails,[s]:h},openTabs:f(g.openTabs),loading:!1}));return}n(g=>({sessionDetails:{...g.sessionDetails,[s]:h},activeSessionId:s,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:ah(g.activeRightTab),...u,openTabs:f(g.openTabs),loading:!1})),h.has_unreviewed===1&&(rh(s).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===s?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[s]:{...h,has_unreviewed:0}}})))}catch(h){n(a===iu?{loading:!1,error:h.message}:{loading:!1})}},closeTab:s=>{n(o=>{const a=o.openTabs.filter(u=>u!==s);if(o.activeSessionId===s&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===s?null:o.activeSessionId}})},updateModelConfig:async(s,o,a)=>{const u=r().activeSessionId;if(u){n({error:null});try{const f=await ux(u,s,o,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(g=>({sessions:g.sessions.map(m=>m.id===u?f:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:g.sessionDetails})),await r().refreshActiveSession()}catch(f){n({error:f.message}),r().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async s=>{n({error:null});try{const o=await Gu(s);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await r().selectSession(o.id),r().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),r().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},addSession:s=>{n(o=>({sessions:o.sessions.some(a=>a.id===s.id)?o.sessions:[s,...o.sessions]}))},revealSession:async s=>{let o=r().sessionDetails[s];if(!o){const a=await eo(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a}})),o=a}r().sessions.some(a=>a.id===s)||r().addSession(jx(o)),await r().selectSession(s)},deleteSession:async s=>{var a;n({error:null});const o=(a=r().sessions.find(u=>u.id===s))==null?void 0:a.title;try{await eh(s),n(u=>lh(u,new Set([s]))),r().addLogEntry("INFO",`Session deleted — ${s.slice(0,8)}`),r().addToast("info",`Session "${o||s.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),r().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(s,o)=>{n({error:null});try{const a=await lx(s,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async s=>{n({error:null});try{const o=await th(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),r().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async s=>{await ch(n,r,s,th,"marked as finished")},toggleStar:async s=>{const o=r().sessions.find(a=>a.id===s);if(o){n({error:null});try{const a=await cx(s,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async s=>{n({error:null});try{const o=await nh(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session reopened")}catch(o){n({error:o.message}),r().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async s=>{await ch(n,r,s,nh,"reopened")},deleteSessionMany:async s=>{if(s.length===0)return;n({error:null});const o=await Promise.allSettled(s.map(f=>eh(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(s[h])}),a.size===0){n({error:"Failed to delete sessions"}),r().addToast("error","Failed to delete sessions");return}n(f=>lh(f,a)),r().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=s.length-a.size;u===0?r().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),r().addToast("warn",`Deleted ${a.size} of ${s.length} — ${u} failed`))},submitPrompt:async(s,o)=>{const a=r().activeSessionId;if(a){n({error:null,submittingPrompt:s}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await Um(a,s,o);r().addLogEntry("INFO",`Turn submitted — "${s.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const g=h.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},activeTurnIndex:h.turns.length}})}catch(u){n({submittingPrompt:null,error:u.message}),r().addLogEntry("ERROR",`Turn failed — ${u.message}`),r().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const g=pl(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:g,status:g?"running":"active"}},sessions:f.sessions.map(m=>m.id===a?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const s=r().activeSessionId;if(s)try{await ox(s)}catch(o){n({error:o.message})}},rewindToTurn:async(s,o)=>{n({error:null});try{const a=await fx(s,o),u=await eo(s);n(f=>({sessionDetails:{...f.sessionDetails,[s]:u},sessions:f.sessions.map(h=>h.id===s?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.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 s=>{n({error:null});try{const o=await px(s),a=await eo(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a},sessions:u.sessions.map(f=>f.id===s?{...f,external_thread_id:o.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(o){n({error:o.message}),r().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(s,o,a)=>{n({error:null});try{const u=await hx(s,o,a);n(f=>({sessions:[u,...f.sessions]})),await r().selectSession(u.id),r().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),r().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async s=>{const o=r().activeSessionId;if(o){n({error:null});try{const a=await dx(o,JSON.stringify(s));n(u=>({sessions:u.sessions.map(f=>f.id===o?a:f),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:a.runtime_config}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const s=r().activeSessionId;if(s)try{const o=await eo(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===s?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),Ax=(n,r)=>({workspaces:[],addWorkspace:async s=>{n({error:null});try{const o=await mx(s.trim());n(a=>({workspaces:[...a.workspaces,o]})),r().addToast("success",`Workspace added — ${o.path}`)}catch(o){r().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async s=>{n({error:null});try{await gx(s);const o=await Bm();n({workspaces:o}),r().addToast("info","Workspace hidden")}catch(o){r().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async s=>{n({error:null});try{const o=r().lastModelConfig,a=await Gu({cwd:s,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await r().selectSession(a.id),r().addLogEntry("INFO",`Session created in ${s} — ${a.id.slice(0,8)}`),r().addToast("success",`Session created in ${s.split("/").pop()||s}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const s=await vx();if(s.cancelled||!s.path)return;await r().addWorkspace(s.path)}catch(s){r().addToast("error",`Failed to pick directory — ${s.message}`)}}}),Is=new Map,Ku=new Map,Yu=new Map,Xu=new Map;function Ix(n,r){Is.set(n,r)}function Dx(n){Is.delete(n)}function ou(n,r){Ku.set(n,r)}function uh(n,r,s){const o=Ku.get(n);if(!o)return;const a=Is.get(o);a&&a({source:"agentpane-host",event:r,payload:s})}function Mx(n,r,s,o){const a=Is.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:r,tool:s,name:s,args:o}})}function Lx(n,r,s,o){const a=Ku.get(n);if(!a)return;const u=Is.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:r,itemId:s,delta:o}})}function Px(n,r){Yu.set(n,r)}function Ox(n){Yu.delete(n)}function zx(n,r){Xu.set(n,r)}function $x(n){Xu.delete(n)}function Fx(n){var s;const r=Is.get(n);r&&r({source:"agentpane-host",event:"state_changed",payload:{}}),(s=Xu.get(n))==null||s()}function Ux(n){var s;const r=Is.get(n);r&&r({source:"agentpane-host",event:"source:updated",payload:{}}),(s=Yu.get(n))==null||s()}const Bx=(n,r)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},setWsConnected:s=>n({wsConnected:s}),onTurnCreated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return!u||o.thread_id?{}:u.turns.some(f=>f.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[s]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(s,o)=>{r().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=_s(a.sessions,s,()=>({is_running:1,status:"running"})),f=a.sessionDetails[s];if(!f)return{sessions:u};const h=f.turns.findIndex(g=>g.id===o);return{sessionDetails:{...a.sessionDetails,[s]:{...Qn(f,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===s&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(s,o,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=dh(a)?Es(u.retryStates,o):u.retryStates,h=u.sessionDetails[s];return h?{sessionDetails:{...u.sessionDetails,[s]:Qn(h,o,g=>lu(g,a))},retryStates:f}:{retryStates:f}})},onItemUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Qn(f,o,h=>lu(h,a))}}:{}})},onItemCompleted:(s,o,a)=>{if(r().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",m=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${m} completed: ${h}`):r().addToast("error",`${m} failed: ${h}`)}n(u=>{const f=dh(a)?Es(u.retryStates,o):u.retryStates,h=u.sessionDetails[s];return h?{retryStates:f,sessionDetails:{...u.sessionDetails,[s]:Qn(h,o,g=>{var v,k;let m=lu(g,a);if(a.type==="agent_message"&&((v=a.data)!=null&&v.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((k=a.data)!=null&&k.text)){const x=m.thoughts?m.thoughts+`
|
|
41
|
+
`+a.data.text:a.data.text;m={...m,thoughts:x}}return m})}}:{retryStates:f}})},onItemDelta:(s,o,a,u)=>{Lx(s,o,a,u),n(f=>{const h=Es(f.retryStates,o),g=f.sessionDetails[s];return g?{sessionDetails:{...f.sessionDetails,[s]:Qn(g,o,m=>Hx(m,a,u))},retryStates:h}:{retryStates:h}})},onTurnCompleted:(s,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,g=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${h} in / ${g} out`),uh(s,"turn:completed",{turnId:o,response:f??null}),r().refreshApps(),n(m=>{const v=m.sessionDetails[s],k=v?Qn(v,o,T=>({...T,status:"completed",token_usage:a??T.token_usage??null,...f&&!T.agent_response?{agent_response:f}:{}})):null,x=au(k),b=x&&k?Aa(k):"active",E=_s(m.sessions,s,T=>({is_running:x,status:b,has_unreviewed:u?1:T.has_unreviewed})),C=Es(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[s]:{...k,is_running:x,status:b,has_unreviewed:u?1:k.has_unreviewed}},sessions:E,retryStates:C}:{sessions:E,retryStates:C}})},onTokenUsageUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Qn(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(s,o,a,u)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),uh(s,"turn:failed",{turnId:o,error:a}),n(f=>{const h=f.sessionDetails[s],g=a.includes("cancelled")||a.includes("aborted"),m=g?"aborted":"failed",v=h?Qn(h,o,C=>({...C,status:m,error:a,...u?{resume_state:u}:{},items:C.items.map(T=>T.status==="in_progress"?{...T,status:"failed"}:T)})):null,k=au(v),x=k&&v?Aa(v):g?"active":"failed",b=_s(f.sessions,s,()=>({is_running:k,status:x})),E=Es(f.retryStates,o);return v?{sessionDetails:{...f.sessionDetails,[s]:{...v,is_running:k,status:x}},sessions:b,retryStates:E}:{sessions:b,retryStates:E}})},onTurnCancelled:(s,o)=>{n(a=>{const u=a.sessionDetails[s],f=u?Qn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(x=>x.status==="in_progress"?{...x,status:"completed"}:x)})):null,h=au(f),g=h&&f?Aa(f):"active",m=_s(a.sessions,s,()=>({is_running:h,status:g})),v=Es(a.retryStates,o);return f?{sessionDetails:{...a.sessionDetails,[s]:{...f,is_running:h,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(s,o,a)=>{r().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),r().addToast("warn",Wx(a.reason)),n(u=>{const f=u.sessionDetails[s],h=f?Qn(f,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:a.reason,interrupted_at:a.interruptedAt,resume_attempts:a.attempts})):null,g=h?Aa(h):"interrupted",m=_s(u.sessions,s,()=>({is_running:1,status:g})),v=Es(u.retryStates,o);return h?{sessionDetails:{...u.sessionDetails,[s]:{...h,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(s,o,a)=>{r().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),n(u=>{const f=_s(u.sessions,s,()=>({is_running:1,status:"running"})),h=u.sessionDetails[s];return h?{sessionDetails:{...u.sessionDetails,[s]:{...Qn(h,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:a})),is_running:1,status:"running"}},sessions:f}:{sessions:f}})},onTurnResumed:(s,o)=>{r().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),r().addToast("success","Interrupted turn resumed"),n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:Qn(u,o,f=>({...f,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(s,o,a)=>{r().addLogEntry("WARN",`turn:retrying — ${s.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),n(u=>({retryStates:{...u.retryStates,[o]:a}}))},onSessionTitle:(s,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,title:o}:u),sessionDetails:a.sessionDetails[s]?{...a.sessionDetails,[s]:{...a.sessionDetails[s],title:o}}:a.sessionDetails}))},onSessionTouched:s=>{n(o=>{const a=o.sessionDetails[s];return{sessions:_s(o.sessions,s,()=>({user_touched:1})),sessionDetails:a?{...o.sessionDetails,[s]:{...a,user_touched:1}}:o.sessionDetails}})},onBackgroundTasksChanged:(s,o)=>{n(a=>{if(o.length===0&&!a.backgroundTasks[s])return{};const u={...a.backgroundTasks};return o.length>0?u[s]=o:delete u[s],{backgroundTasks:u}})},onBackgroundTasksSnapshot:s=>{const o={};for(const[a,u]of Object.entries(s))u.length>0&&(o[a]=u);n({backgroundTasks:o})}});function Wx(n){switch(n){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";default:return"The agent host restarted — resuming the turn"}}function Aa(n){const r=[...n.turns,...(n.threads??[]).flatMap(s=>s.turns??[])].filter(as);return r.length>0&&r.every(s=>s.status==="pending"&&s.resume_state==="waiting")?"interrupted":"running"}function dh(n){return n.type!=="background_task"&&n.type!=="error"&&n.type!=="interruption"}function Es(n,r){if(!(r in n))return n;const s={...n};return delete s[r],s}function au(n){return n&&(n.turns.some(as)||(n.threads??[]).some(s=>(s.turns??[]).some(as)))?1:0}function _s(n,r,s){return n.some(o=>o.id===r)?n.map(o=>o.id===r?{...o,...s(o)}:o):n}function Qn(n,r,s){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===r)?{...a,turns:(a.turns??[]).map(u=>u.id===r?s(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===r?s(a):a),threads:o}}function lu(n,r){const s=n.items.findIndex(o=>o.external_item_id===r.external_item_id);if(s>=0){const o=[...n.items];return o[s]=r,{...n,items:o}}if(r.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,r]}}return{...n,items:[...n.items,r]}}function Hx(n,r,s){var u;const o=n.items.findIndex(f=>f.external_item_id===r);if(o>=0){const f=n.items[o],g=(((u=f.data)==null?void 0:u.text)??"")+s,m=[...n.items];return m[o]={...f,data:{...f.data,text:g}},{...n,items:m,agent_response:g}}const a={id:`delta-${r}`,turn_id:n.id,external_item_id:r,type:"agent_message",data:{text:s},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:s}}function Vx(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return vn(`/providers/${n}/models${s}`)}const qx="https://github.com/celalertug/repoburg-mac-app-release/releases/latest/download/repoburg-mac-app.zip",Gx=2e3,Km="agentpane:daemon-seen";function Kx(n=Un()){if(!n)return!1;try{const r=new URL(n);return r.protocol==="http:"&&(r.hostname==="localhost"||r.hostname==="127.0.0.1")}catch{return!1}}async function Yx(n=Un()){try{return await fetch(`${n}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function Xx(){try{return localStorage.getItem(Km)==="true"}catch{return!1}}function Qx(){try{localStorage.setItem(Km,"true")}catch{}}function Zx(n){let r=!1,s=!1,o=!1,a=null;function u(){a!==null&&(clearTimeout(a),a=null)}async function f(){if(r||s)return;u(),s=!0;const m=await Yx();if(s=!1,!r){if(m){Qx(),g(),n.onReady();return}o||(o=!0,n.onMissing()),a=setTimeout(()=>void f(),Gx)}}function h(){document.visibilityState==="visible"&&f()}function g(){r=!0,u(),window.removeEventListener("focus",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("focus",h),document.addEventListener("visibilitychange",h),f(),g}const Cu=160,Eu=480,Jx=240,Va=220,e0=300,t0=600,n0=36;function qa(){return typeof window>"u"?t0:Math.max(Va,Math.round(window.innerWidth*.7))}const fh="agentpane:sidebar-width",ph="agentpane:right-panel-width",cu="agentpane:right-panel-collapsed";function hh(n,r,s,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(s,Math.max(r,u)):o}catch{return o}}function r0(n){try{return localStorage.getItem(n)==="true"}catch{return!1}}function mh(n,r){try{localStorage.setItem(n,String(r))}catch{}}const gh=200,s0=(n,r)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:hh(fh,Cu,Eu,Jx),rightPanelWidth:hh(ph,Va,qa(),e0),rightPanelCollapsed:r0(cu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,daemonStatus:Kx()?"checking":"ready",setActiveTurnIndex:s=>n({activeTurnIndex:s}),switchRightTab:s=>{r().rightPanelCollapsed&&mh(cu,!1),n({activeRightTab:s,rightPanelCollapsed:!1})},setShowNewSessionDialog:s=>n({showNewSessionDialog:s}),setShowRemoteModal:s=>n({showRemoteModal:s}),setShowCommandPalette:s=>n({showCommandPalette:s}),setShowModelSelector:s=>n({showModelSelector:s}),setDeepLinkThreadId:s=>n({deepLinkThreadId:s}),setSidebarWidth:s=>{const o=Math.min(Eu,Math.max(Cu,Math.round(s)));n({sidebarWidth:o});try{localStorage.setItem(fh,String(o))}catch{}},setRightPanelWidth:s=>{const o=Math.min(qa(),Math.max(Va,Math.round(s)));n({rightPanelWidth:o});try{localStorage.setItem(ph,String(o))}catch{}},setRightPanelCollapsed:s=>{n({rightPanelCollapsed:s}),mh(cu,s)},toggleRightPanel:()=>r().setRightPanelCollapsed(!r().rightPanelCollapsed),toggleVscodeView:()=>{if(r().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(s,o,a)=>n({vscodeState:s,vscodeId:o,vscodeToken:a}),setDaemonStatus:s=>n({daemonStatus:s}),addToast:(s,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:s,message:o,undoAction:a,undoLabel:u}]}))},removeToast:s=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==s)}))},addLogEntry:(s,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:s,message:o}];return f.length>gh&&f.splice(0,f.length-gh),{eventLog:f}})},loadModels:async(s,o)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await Vx(s,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),i0=(n,r)=>({createThread:async(s,o)=>{try{await wt(`/sessions/${s}/threads`,o),r().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){r().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(s,o,a)=>{try{await wt(`/sessions/${s}/threads/${o}/followup`,{message:a}),r().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){r().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(s,o)=>{try{await wt(`/sessions/${s}/cancel?threadId=${encodeURIComponent(o)}`),r().addLogEntry("INFO","Thread turn cancelled")}catch(a){r().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(s,o)=>{try{await Sr(`/sessions/${s}/threads/${o}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(s,o)=>{try{await Sr(`/sessions/${s}/threads/${o}`,{status:"open"})}catch(a){r().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(s,o,a)=>{try{const u=await wt(`/sessions/${s}/threads/${o}/summarize`,{directives:a}),f=`
|
|
42
42
|
[Shared from a resolved discussion thread — summary of its findings]
|
|
43
43
|
|
|
44
44
|
\`\`\`QUOTE
|
|
45
45
|
${u.summary}
|
|
46
46
|
\`\`\`
|
|
47
47
|
|
|
48
|
-
`;return n({quotedText:f}),r().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),r().addToast("success","Thread summary added to your input"),!0}catch(u){return r().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(s,o)=>{try{await fl(`/sessions/${s}/threads/${o}`)}catch(a){r().addToast("error",`Failed to delete thread — ${a.message}`)}},askSidecar:async(s,o)=>{try{return await wt(`/sessions/${s}/sidecar`,{message:o}),r().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(a){return r().addToast("error",`Failed to ask the sidecar — ${a.message}`),!1}},onThreadCreated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=(f.threads??[]).map(g=>g.id===o?{...g,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:h}}}})},onThreadDeleted:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),Zx=(n,r)=>({folders:[],loadFolders:async()=>{const s=await Wm();n({folders:s})},createSidebarFolder:async(s,o)=>{try{const a=await vx(s,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return r().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(s,o)=>{try{const a=await sh(s,{name:o});n(u=>({folders:u.folders.map(f=>f.id===s?a:f)}))}catch(a){r().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async s=>{const o=r().folders,a=r().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==s),sessions:u.sessions.map(f=>f.folder_id===s?{...f,folder_id:null}:f)}));try{await yx(s)}catch(u){n({folders:o,sessions:a}),r().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async s=>{if(s.length===0)return;const o=r().sessions,a=new Map(s.map(u=>[u.id,u]));n(u=>({sessions:u.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 xx(s)}catch(u){n({sessions:o}),r().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async s=>{const o=r().folders,a=new Map(s.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(s.map((u,f)=>sh(u,{sort_order:f})))}catch(u){n({folders:o}),r().addToast("error",`Failed to save folder order — ${u.message}`)}}});function vh(){return vn("/apps")}function Jx(){return vn("/apps/root")}function yh(n){return vn(`/apps/${n}/source`)}function xh(n,r=""){return vn(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`)}function Km(n,r,s=""){return rx(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`,r)}function e0(n){return fl(`/apps/${n}`)}function t0(n){return vn(`/apps/${n}/sessions`)}function n0(){return vn("/apps/examples")}function r0(n){return wt(`/apps/examples/${n}/install`,{})}function s0(n){return wt("/apps",n)}function i0(n,r){return wt("/apps/import",{id:n,files:r})}function o0(n,r,s){return wt(`/apps/mcp/calls/${n}/result`,{result:r,error:null})}function a0(n,r){return wt(`/apps/${n}/edit-session`,r)}const $a=new Set;async function uu(n,r){$a.add(r),await n().loadApps();const s=n().apps.find(o=>o.id===r);n().openAppTab(r),n().addToast("success",`Mini app added: ${(s==null?void 0:s.title)??r}`)}const _u="agentpane:app-workspaces";function l0(){try{const n=JSON.parse(localStorage.getItem(_u)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const c0=(n,r)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:l0(),loadApps:async()=>{try{const[s,o]=await Promise.all([vh(),Jx().catch(()=>null)]);return s.forEach(a=>$a.add(a.id)),n(o?{apps:s,appsRootPath:o.root}:{apps:s}),!0}catch{return!1}},refreshApps:async()=>{try{const s=await vh();for(const o of s)$a.has(o.id)||($a.add(o.id),r().addToast("success",`New mini app discovered: ${o.title}`));n({apps:s})}catch{}},openAppTab:s=>{n(o=>({activeAppTabId:s,openAppTabs:o.openAppTabs.includes(s)?o.openAppTabs:[...o.openAppTabs,s]}))},closeAppTab:s=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==s);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===s?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:s=>n({activeAppTabId:s}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(s,o)=>{n(a=>{const u={...a.appWorkspaces,[s]:o};try{localStorage.setItem(_u,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async s=>{try{return await r0(s),await uu(r,s),!0}catch(o){return r().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async s=>{try{return await s0(s),await uu(r,s.id),!0}catch(o){return r().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(s,o)=>{try{return await i0(s,o),await uu(r,s),!0}catch(a){return r().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async s=>{try{const o=r().lastModelConfig,a=await a0(s,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});r().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await r().selectSession(a.id),r().addLogEntry("INFO",`App edit session opened for ${s}`)}catch(o){r().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async s=>{const o=r().apps.find(a=>a.id===s);if(o)try{await Km(s,{pinned:!o.pinned}),await r().loadApps()}catch(a){r().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async s=>{try{await e0(s),n(o=>{const a={...o.appWorkspaces};delete a[s];try{localStorage.setItem(_u,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==s),openAppTabs:o.openAppTabs.filter(u=>u!==s),activeAppTabId:o.activeAppTabId===s?null:o.activeAppTabId,appWorkspaces:a}}),r().addToast("success",`Mini app deleted: ${s}`)}catch(o){r().addToast("error",`Failed to delete app — ${o.message}`)}}}),wh=3e3,Fn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Un=[];let Ga=0,Qu=0,Ka=0,Zu=0,Ya=0,Ju=0,ed=0;const mo=new Map,go=new Map;let pi=new Map,di=0,hi=new Map,du=!1;function Xa(n,r,s){if(Un.push({t:Date.now(),cat:n,msg:r,ms:s}),Un.length>wh){const o=Un.length-wh;Un.splice(0,o),En=Math.max(0,En-o)}}function fi(n,r,s){Xa(n,r,s),console.log(`[perf:${n}] ${r}`)}function Ym(n){fi("note",n)}function Xm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function u0(n,r){let s=pi.get(n);s||pi.set(n,s={n:0,bytes:0}),s.n++,s.bytes+=r;let o=mo.get(n);o||mo.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r}function d0(){di++,ed++}function f0(n){hi.set(n,(hi.get(n)??0)+1),go.set(n,(go.get(n)??0)+1)}let Fa=0;function p0(){Fa=performance.now()}function h0(){const n=performance.now(),r=Fa?n-Fa:null;Fa=0,requestAnimationFrame(()=>{if(r===null)return;const s=performance.now()-n+r;s>Fn.keypressMs&&fi("input",`keystroke→paint ${Math.round(s)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const m0=5e3,Qm=500,kh=2e3;let En=0,fu=!1;function g0(n){return wt("/perf-log",{entries:n}).then(()=>{En+=n.length})}function v0(){if(fu||En>=Un.length)return;const n=Un.slice(En,En+Qm);n.length!==0&&(fu=!0,g0(n).catch(()=>{Un.length-En>kh&&(En=Math.max(En,Un.length-kh))}).finally(()=>{fu=!1}))}function Sh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||En>=Un.length)return;const n=Un.slice(En,En+Qm);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${dr()}/api/perf-log`,r),En+=n.length}catch{}}function y0(){let n=0;for(const o of pi.values())n+=o.n;const r=[];if(n>0){const o=[...pi.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Xm(u.bytes)})`).join(", ");r.push(`ws ${n}/s [${o}]`)}di>0&&r.push(`store ${di}/s`);const s=[...hi.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(s.length>0&&r.push(`renders ${s.join(" ")}`),r.length>0){const o=r.join(" · ");Xa("stat",o);const a=[...hi.values()].some(u=>u>Fn.renderPerSecLog);(n>Fn.wsPerSecLog||di>Fn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}pi=new Map,di=0,hi=new Map}function x0(n){if(n instanceof Element){const r=n.id?`#${n.id}`:"",s=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${r}${s}`}return n?"window":"unknown"}function w0(){if(du||typeof window>"u")return()=>{};du=!0,Ga=Date.now();const n=[];let r=performance.now()+250;const s=window.setInterval(()=>{const u=performance.now(),f=u-r;r=u+250,f>Fn.lagMs&&(Qu++,Ka=Math.max(Ka,f),fi("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(s)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=g=>{const m=g-u;u=g,m>Fn.frameGapMs&&fi("lag",`frame gap ${Math.round(m)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var h;for(const g of f.getEntries()){const m=g.duration;if(m<Fn.longtaskBufferMs)continue;Zu++,Ya=Math.max(Ya,m);const v=(h=g.attribution)==null?void 0:h[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",x=`long task ${Math.round(m)}ms (${k})`;m>=Fn.longtaskLogMs?fi("longtask",x,m):Xa("longtask",x,m)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const g=h.duration,m=h.processingStart-h.startTime;Ju++;const v=`${h.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${x0(h.target)}`;g>=Fn.eventLogMs?fi("input",v,g):Xa("input",v,g)}});u.observe({type:"event",durationThreshold:Fn.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(y0,1e3);n.push(()=>window.clearInterval(o)),Ym("perf logger session started");const a=window.setInterval(v0,m0);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",Sh),n.push(()=>window.removeEventListener("beforeunload",Sh)),window.__agentPanePerf={dump:Zm,reset:Jm},()=>{n.forEach(u=>u()),du=!1}}function Zm(){const n=[],r=Ga?Math.round((Date.now()-Ga)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${Un.length} buffered entries`),n.push(`event-loop lag: ${Qu} blocks >${Fn.lagMs}ms (max ${Math.round(Ka)}ms)`),n.push(`long tasks: ${Zu} ≥${Fn.longtaskBufferMs}ms (max ${Math.round(Ya)}ms)`),n.push(`slow input events (≥${Fn.eventBufferMs}ms): ${Ju}`),n.push(`store updates: ${ed} total`),mo.size>0){n.push("ws messages by type (top 15):");for(const[s,o]of[...mo.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${s}: ${o.n} msgs, ${Xm(o.bytes)}`)}if(go.size>0){n.push("render counts by component:");for(const[s,o]of[...go.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${s}: ${o}`)}n.push("--- last 200 entries ---");for(const s of Un.slice(-200))n.push(`${new Date(s.t).toISOString().slice(11,23)} [${s.cat}] ${s.msg}`);return n.join(`
|
|
49
|
-
`)}function
|
|
48
|
+
`;return n({quotedText:f}),r().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),r().addToast("success","Thread summary added to your input"),!0}catch(u){return r().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(s,o)=>{try{await fl(`/sessions/${s}/threads/${o}`)}catch(a){r().addToast("error",`Failed to delete thread — ${a.message}`)}},askSidecar:async(s,o)=>{try{return await wt(`/sessions/${s}/sidecar`,{message:o}),r().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(a){return r().addToast("error",`Failed to ask the sidecar — ${a.message}`),!1}},onThreadCreated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=(f.threads??[]).map(g=>g.id===o?{...g,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:h}}}})},onThreadDeleted:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),o0=(n,r)=>({folders:[],loadFolders:async()=>{const s=await Wm();n({folders:s})},createSidebarFolder:async(s,o)=>{try{const a=await yx(s,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return r().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(s,o)=>{try{const a=await sh(s,{name:o});n(u=>({folders:u.folders.map(f=>f.id===s?a:f)}))}catch(a){r().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async s=>{const o=r().folders,a=r().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==s),sessions:u.sessions.map(f=>f.folder_id===s?{...f,folder_id:null}:f)}));try{await xx(s)}catch(u){n({folders:o,sessions:a}),r().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async s=>{if(s.length===0)return;const o=r().sessions,a=new Map(s.map(u=>[u.id,u]));n(u=>({sessions:u.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 wx(s)}catch(u){n({sessions:o}),r().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async s=>{const o=r().folders,a=new Map(s.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(s.map((u,f)=>sh(u,{sort_order:f})))}catch(u){n({folders:o}),r().addToast("error",`Failed to save folder order — ${u.message}`)}}});function vh(){return vn("/apps")}function a0(){return vn("/apps/root")}function yh(n){return vn(`/apps/${n}/source`)}function xh(n,r=""){return vn(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`)}function Ym(n,r,s=""){return sx(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`,r)}function l0(n){return fl(`/apps/${n}`)}function c0(n){return vn(`/apps/${n}/sessions`)}function u0(){return vn("/apps/examples")}function d0(n){return wt(`/apps/examples/${n}/install`,{})}function f0(n){return wt("/apps",n)}function p0(n,r){return wt("/apps/import",{id:n,files:r})}function h0(n,r,s){return wt(`/apps/mcp/calls/${n}/result`,{result:r,error:null})}function m0(n,r){return wt(`/apps/${n}/edit-session`,r)}const $a=new Set;async function uu(n,r){$a.add(r),await n().loadApps();const s=n().apps.find(o=>o.id===r);n().openAppTab(r),n().addToast("success",`Mini app added: ${(s==null?void 0:s.title)??r}`)}const _u="agentpane:app-workspaces";function g0(){try{const n=JSON.parse(localStorage.getItem(_u)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const v0=(n,r)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:g0(),loadApps:async()=>{try{const[s,o]=await Promise.all([vh(),a0().catch(()=>null)]);return s.forEach(a=>$a.add(a.id)),n(o?{apps:s,appsRootPath:o.root}:{apps:s}),!0}catch{return!1}},refreshApps:async()=>{try{const s=await vh();for(const o of s)$a.has(o.id)||($a.add(o.id),r().addToast("success",`New mini app discovered: ${o.title}`));n({apps:s})}catch{}},openAppTab:s=>{n(o=>({activeAppTabId:s,openAppTabs:o.openAppTabs.includes(s)?o.openAppTabs:[...o.openAppTabs,s]}))},closeAppTab:s=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==s);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===s?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:s=>n({activeAppTabId:s}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(s,o)=>{n(a=>{const u={...a.appWorkspaces,[s]:o};try{localStorage.setItem(_u,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async s=>{try{return await d0(s),await uu(r,s),!0}catch(o){return r().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async s=>{try{return await f0(s),await uu(r,s.id),!0}catch(o){return r().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(s,o)=>{try{return await p0(s,o),await uu(r,s),!0}catch(a){return r().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async s=>{try{const o=r().lastModelConfig,a=await m0(s,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});r().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await r().selectSession(a.id),r().addLogEntry("INFO",`App edit session opened for ${s}`)}catch(o){r().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async s=>{const o=r().apps.find(a=>a.id===s);if(o)try{await Ym(s,{pinned:!o.pinned}),await r().loadApps()}catch(a){r().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async s=>{try{await l0(s),n(o=>{const a={...o.appWorkspaces};delete a[s];try{localStorage.setItem(_u,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==s),openAppTabs:o.openAppTabs.filter(u=>u!==s),activeAppTabId:o.activeAppTabId===s?null:o.activeAppTabId,appWorkspaces:a}}),r().addToast("success",`Mini app deleted: ${s}`)}catch(o){r().addToast("error",`Failed to delete app — ${o.message}`)}}}),wh=3e3,Fn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Bn=[];let Ga=0,Qu=0,Ka=0,Zu=0,Ya=0,Ju=0,ed=0;const mo=new Map,go=new Map;let pi=new Map,di=0,hi=new Map,du=!1;function Xa(n,r,s){if(Bn.push({t:Date.now(),cat:n,msg:r,ms:s}),Bn.length>wh){const o=Bn.length-wh;Bn.splice(0,o),En=Math.max(0,En-o)}}function fi(n,r,s){Xa(n,r,s),console.log(`[perf:${n}] ${r}`)}function Xm(n){fi("note",n)}function Qm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function y0(n,r){let s=pi.get(n);s||pi.set(n,s={n:0,bytes:0}),s.n++,s.bytes+=r;let o=mo.get(n);o||mo.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r}function x0(){di++,ed++}function w0(n){hi.set(n,(hi.get(n)??0)+1),go.set(n,(go.get(n)??0)+1)}let Fa=0;function k0(){Fa=performance.now()}function S0(){const n=performance.now(),r=Fa?n-Fa:null;Fa=0,requestAnimationFrame(()=>{if(r===null)return;const s=performance.now()-n+r;s>Fn.keypressMs&&fi("input",`keystroke→paint ${Math.round(s)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const b0=5e3,Zm=500,kh=2e3;let En=0,fu=!1;function T0(n){return wt("/perf-log",{entries:n}).then(()=>{En+=n.length})}function N0(){if(fu||En>=Bn.length)return;const n=Bn.slice(En,En+Zm);n.length!==0&&(fu=!0,T0(n).catch(()=>{Bn.length-En>kh&&(En=Math.max(En,Bn.length-kh))}).finally(()=>{fu=!1}))}function Sh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||En>=Bn.length)return;const n=Bn.slice(En,En+Zm);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${Un()}/api/perf-log`,r),En+=n.length}catch{}}function C0(){let n=0;for(const o of pi.values())n+=o.n;const r=[];if(n>0){const o=[...pi.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Qm(u.bytes)})`).join(", ");r.push(`ws ${n}/s [${o}]`)}di>0&&r.push(`store ${di}/s`);const s=[...hi.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(s.length>0&&r.push(`renders ${s.join(" ")}`),r.length>0){const o=r.join(" · ");Xa("stat",o);const a=[...hi.values()].some(u=>u>Fn.renderPerSecLog);(n>Fn.wsPerSecLog||di>Fn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}pi=new Map,di=0,hi=new Map}function E0(n){if(n instanceof Element){const r=n.id?`#${n.id}`:"",s=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${r}${s}`}return n?"window":"unknown"}function _0(){if(du||typeof window>"u")return()=>{};du=!0,Ga=Date.now();const n=[];let r=performance.now()+250;const s=window.setInterval(()=>{const u=performance.now(),f=u-r;r=u+250,f>Fn.lagMs&&(Qu++,Ka=Math.max(Ka,f),fi("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(s)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=g=>{const m=g-u;u=g,m>Fn.frameGapMs&&fi("lag",`frame gap ${Math.round(m)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var h;for(const g of f.getEntries()){const m=g.duration;if(m<Fn.longtaskBufferMs)continue;Zu++,Ya=Math.max(Ya,m);const v=(h=g.attribution)==null?void 0:h[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",x=`long task ${Math.round(m)}ms (${k})`;m>=Fn.longtaskLogMs?fi("longtask",x,m):Xa("longtask",x,m)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const g=h.duration,m=h.processingStart-h.startTime;Ju++;const v=`${h.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${E0(h.target)}`;g>=Fn.eventLogMs?fi("input",v,g):Xa("input",v,g)}});u.observe({type:"event",durationThreshold:Fn.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(C0,1e3);n.push(()=>window.clearInterval(o)),Xm("perf logger session started");const a=window.setInterval(N0,b0);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",Sh),n.push(()=>window.removeEventListener("beforeunload",Sh)),window.__agentPanePerf={dump:Jm,reset:eg},()=>{n.forEach(u=>u()),du=!1}}function Jm(){const n=[],r=Ga?Math.round((Date.now()-Ga)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${Bn.length} buffered entries`),n.push(`event-loop lag: ${Qu} blocks >${Fn.lagMs}ms (max ${Math.round(Ka)}ms)`),n.push(`long tasks: ${Zu} ≥${Fn.longtaskBufferMs}ms (max ${Math.round(Ya)}ms)`),n.push(`slow input events (≥${Fn.eventBufferMs}ms): ${Ju}`),n.push(`store updates: ${ed} total`),mo.size>0){n.push("ws messages by type (top 15):");for(const[s,o]of[...mo.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${s}: ${o.n} msgs, ${Qm(o.bytes)}`)}if(go.size>0){n.push("render counts by component:");for(const[s,o]of[...go.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${s}: ${o}`)}n.push("--- last 200 entries ---");for(const s of Bn.slice(-200))n.push(`${new Date(s.t).toISOString().slice(11,23)} [${s.cat}] ${s.msg}`);return n.join(`
|
|
49
|
+
`)}function eg(){Bn.length=0,En=0,Ga=Date.now(),Qu=0,Ka=0,Zu=0,Ya=0,Ju=0,ed=0,mo.clear(),go.clear(),pi=new Map,di=0,hi=new Map}const Ot={start:_0,note:Xm,trackWsEvent:y0,trackStoreUpdate:x0,trackRender:w0,markKeystroke:k0,markInputChange:S0,dump:Jm,reset:eg},M=Xy()((...n)=>({...Rx(...n),...Ax(...n),...Bx(...n),...s0(...n),...i0(...n),...o0(...n),...v0(...n)}));typeof window<"u"&&(M.subscribe(()=>Ot.trackStoreUpdate()),Tx(M));function ju(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 j0(n,r,s=!1,o="working",a=0){if(o==="finished")return"";if(n==="interrupted")return"interrupted";if(r)return"running";if(a>0)return"background";if(s&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function R0(n,r,s=!1,o="working",a=0){if(o==="finished")return"Finished";if(n==="interrupted")return"Interrupted";if(r)return"Running";if(a>0)return"Background";if(s&&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 hl(n,r=0){const s=n.is_running===1,o=n.lifecycle==="finished",a=ju(n.runtime_type),u=j0(n.status,s,n.has_unreviewed===1,n.lifecycle,r),f=R0(n.status,s,n.has_unreviewed===1,n.lifecycle,r);return{dot:u,label:f,dotTitle:u==="background"?`${r} background task${r===1?"":"s"} running`:f,iconClass:a.iconClass,iconText:a.iconText,isRunning:s,isFinished:o,backgroundTaskCount:r}}function ml(n,r,s=!0){w.useEffect(()=>{if(!s)return;function o(a){n.current&&!n.current.contains(a.target)&&r()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,r,s])}function td(n,r=!0){w.useEffect(()=>{if(!r)return;function s(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r])}function nd({status:n,size:r=6,title:s}){return c.jsx("span",{className:`status-dot ${n}`,style:r!==6?{width:r,height:r}:void 0,title:s})}function rd({iconClass:n,iconText:r,size:s=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:s!==20?{width:s,height:s,fontSize:s*.45}:void 0,children:r})}/**
|
|
50
50
|
* @license lucide-react v0.469.0 - ISC
|
|
51
51
|
*
|
|
52
52
|
* This source code is licensed under the ISC license.
|
|
53
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const
|
|
54
|
+
*/const A0=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tg=(...n)=>n.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim();/**
|
|
55
55
|
* @license lucide-react v0.469.0 - ISC
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var
|
|
59
|
+
*/var I0={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
60
|
* @license lucide-react v0.469.0 - ISC
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
64
|
+
*/const D0=w.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},g)=>w.createElement("svg",{ref:g,...I0,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:tg("lucide",a),...h},[...f.map(([m,v])=>w.createElement(m,v)),...Array.isArray(u)?u:[u]]));/**
|
|
65
65
|
* @license lucide-react v0.469.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const we=(n,r)=>{const s=w.forwardRef(({className:o,...a},u)=>w.createElement(
|
|
69
|
+
*/const we=(n,r)=>{const s=w.forwardRef(({className:o,...a},u)=>w.createElement(D0,{ref:u,iconNode:r,className:tg(`lucide-${A0(n)}`,o),...a}));return s.displayName=`${n}`,s};/**
|
|
70
70
|
* @license lucide-react v0.469.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const
|
|
74
|
+
*/const M0=we("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
75
75
|
* @license lucide-react v0.469.0 - ISC
|
|
76
76
|
*
|
|
77
77
|
* This source code is licensed under the ISC license.
|
|
78
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const
|
|
79
|
+
*/const L0=we("BotOff",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
|
|
80
80
|
* @license lucide-react v0.469.0 - ISC
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
@@ -86,7 +86,7 @@ ${u.summary}
|
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const
|
|
89
|
+
*/const P0=we("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"}]]);/**
|
|
90
90
|
* @license lucide-react v0.469.0 - ISC
|
|
91
91
|
*
|
|
92
92
|
* This source code is licensed under the ISC license.
|
|
@@ -111,7 +111,7 @@ ${u.summary}
|
|
|
111
111
|
*
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
113
113
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const
|
|
114
|
+
*/const O0=we("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
115
115
|
* @license lucide-react v0.469.0 - ISC
|
|
116
116
|
*
|
|
117
117
|
* This source code is licensed under the ISC license.
|
|
@@ -121,22 +121,22 @@ ${u.summary}
|
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const
|
|
124
|
+
*/const z0=we("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"}]]);/**
|
|
125
125
|
* @license lucide-react v0.469.0 - ISC
|
|
126
126
|
*
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const
|
|
129
|
+
*/const $0=we("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
130
130
|
* @license lucide-react v0.469.0 - ISC
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
133
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const
|
|
134
|
+
*/const F0=we("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"}]]);/**
|
|
135
135
|
* @license lucide-react v0.469.0 - ISC
|
|
136
136
|
*
|
|
137
137
|
* This source code is licensed under the ISC license.
|
|
138
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const
|
|
139
|
+
*/const ng=we("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"}]]);/**
|
|
140
140
|
* @license lucide-react v0.469.0 - ISC
|
|
141
141
|
*
|
|
142
142
|
* This source code is licensed under the ISC license.
|
|
@@ -151,22 +151,27 @@ ${u.summary}
|
|
|
151
151
|
*
|
|
152
152
|
* This source code is licensed under the ISC license.
|
|
153
153
|
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const
|
|
154
|
+
*/const U0=we("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
155
155
|
* @license lucide-react v0.469.0 - ISC
|
|
156
156
|
*
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
158
158
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const
|
|
159
|
+
*/const B0=we("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
160
160
|
* @license lucide-react v0.469.0 - ISC
|
|
161
161
|
*
|
|
162
162
|
* This source code is licensed under the ISC license.
|
|
163
163
|
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const
|
|
164
|
+
*/const W0=we("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
165
165
|
* @license lucide-react v0.469.0 - ISC
|
|
166
166
|
*
|
|
167
167
|
* This source code is licensed under the ISC license.
|
|
168
168
|
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const
|
|
169
|
+
*/const H0=we("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"}]]);/**
|
|
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 rg=we("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"}]]);/**
|
|
170
175
|
* @license lucide-react v0.469.0 - ISC
|
|
171
176
|
*
|
|
172
177
|
* This source code is licensed under the ISC license.
|
|
@@ -181,67 +186,67 @@ ${u.summary}
|
|
|
181
186
|
*
|
|
182
187
|
* This source code is licensed under the ISC license.
|
|
183
188
|
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const
|
|
189
|
+
*/const V0=we("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"}]]);/**
|
|
185
190
|
* @license lucide-react v0.469.0 - ISC
|
|
186
191
|
*
|
|
187
192
|
* This source code is licensed under the ISC license.
|
|
188
193
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const
|
|
194
|
+
*/const q0=we("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
190
195
|
* @license lucide-react v0.469.0 - ISC
|
|
191
196
|
*
|
|
192
197
|
* This source code is licensed under the ISC license.
|
|
193
198
|
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const
|
|
199
|
+
*/const G0=we("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"}]]);/**
|
|
195
200
|
* @license lucide-react v0.469.0 - ISC
|
|
196
201
|
*
|
|
197
202
|
* This source code is licensed under the ISC license.
|
|
198
203
|
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const
|
|
204
|
+
*/const sg=we("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
200
205
|
* @license lucide-react v0.469.0 - ISC
|
|
201
206
|
*
|
|
202
207
|
* This source code is licensed under the ISC license.
|
|
203
208
|
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const
|
|
209
|
+
*/const K0=we("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
205
210
|
* @license lucide-react v0.469.0 - ISC
|
|
206
211
|
*
|
|
207
212
|
* This source code is licensed under the ISC license.
|
|
208
213
|
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const
|
|
214
|
+
*/const Y0=we("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
210
215
|
* @license lucide-react v0.469.0 - ISC
|
|
211
216
|
*
|
|
212
217
|
* This source code is licensed under the ISC license.
|
|
213
218
|
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const
|
|
219
|
+
*/const X0=we("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"}]]);/**
|
|
215
220
|
* @license lucide-react v0.469.0 - ISC
|
|
216
221
|
*
|
|
217
222
|
* This source code is licensed under the ISC license.
|
|
218
223
|
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const
|
|
224
|
+
*/const Q0=we("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"}]]);/**
|
|
220
225
|
* @license lucide-react v0.469.0 - ISC
|
|
221
226
|
*
|
|
222
227
|
* This source code is licensed under the ISC license.
|
|
223
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const
|
|
229
|
+
*/const Jn=we("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
225
230
|
* @license lucide-react v0.469.0 - ISC
|
|
226
231
|
*
|
|
227
232
|
* This source code is licensed under the ISC license.
|
|
228
233
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const
|
|
234
|
+
*/const Z0=we("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"}]]);/**
|
|
230
235
|
* @license lucide-react v0.469.0 - ISC
|
|
231
236
|
*
|
|
232
237
|
* This source code is licensed under the ISC license.
|
|
233
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const
|
|
239
|
+
*/const J0=we("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"}]]);/**
|
|
235
240
|
* @license lucide-react v0.469.0 - ISC
|
|
236
241
|
*
|
|
237
242
|
* This source code is licensed under the ISC license.
|
|
238
243
|
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const
|
|
244
|
+
*/const ig=we("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"}]]);/**
|
|
240
245
|
* @license lucide-react v0.469.0 - ISC
|
|
241
246
|
*
|
|
242
247
|
* This source code is licensed under the ISC license.
|
|
243
248
|
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const
|
|
249
|
+
*/const ew=we("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"}]]);/**
|
|
245
250
|
* @license lucide-react v0.469.0 - ISC
|
|
246
251
|
*
|
|
247
252
|
* This source code is licensed under the ISC license.
|
|
@@ -251,27 +256,27 @@ ${u.summary}
|
|
|
251
256
|
*
|
|
252
257
|
* This source code is licensed under the ISC license.
|
|
253
258
|
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const
|
|
259
|
+
*/const tw=we("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
255
260
|
* @license lucide-react v0.469.0 - ISC
|
|
256
261
|
*
|
|
257
262
|
* This source code is licensed under the ISC license.
|
|
258
263
|
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const
|
|
264
|
+
*/const nw=we("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
|
|
260
265
|
* @license lucide-react v0.469.0 - ISC
|
|
261
266
|
*
|
|
262
267
|
* This source code is licensed under the ISC license.
|
|
263
268
|
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const
|
|
269
|
+
*/const rw=we("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
|
|
265
270
|
* @license lucide-react v0.469.0 - ISC
|
|
266
271
|
*
|
|
267
272
|
* This source code is licensed under the ISC license.
|
|
268
273
|
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const
|
|
274
|
+
*/const sw=we("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
270
275
|
* @license lucide-react v0.469.0 - ISC
|
|
271
276
|
*
|
|
272
277
|
* This source code is licensed under the ISC license.
|
|
273
278
|
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const
|
|
279
|
+
*/const iw=we("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"}]]);/**
|
|
275
280
|
* @license lucide-react v0.469.0 - ISC
|
|
276
281
|
*
|
|
277
282
|
* This source code is licensed under the ISC license.
|
|
@@ -281,12 +286,12 @@ ${u.summary}
|
|
|
281
286
|
*
|
|
282
287
|
* This source code is licensed under the ISC license.
|
|
283
288
|
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const
|
|
289
|
+
*/const ow=we("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
285
290
|
* @license lucide-react v0.469.0 - ISC
|
|
286
291
|
*
|
|
287
292
|
* This source code is licensed under the ISC license.
|
|
288
293
|
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const
|
|
294
|
+
*/const aw=we("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"}]]);/**
|
|
290
295
|
* @license lucide-react v0.469.0 - ISC
|
|
291
296
|
*
|
|
292
297
|
* This source code is licensed under the ISC license.
|
|
@@ -296,12 +301,12 @@ ${u.summary}
|
|
|
296
301
|
*
|
|
297
302
|
* This source code is licensed under the ISC license.
|
|
298
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const
|
|
304
|
+
*/const og=we("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"}]]);/**
|
|
300
305
|
* @license lucide-react v0.469.0 - ISC
|
|
301
306
|
*
|
|
302
307
|
* This source code is licensed under the ISC license.
|
|
303
308
|
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const
|
|
309
|
+
*/const lw=we("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"}]]);/**
|
|
305
310
|
* @license lucide-react v0.469.0 - ISC
|
|
306
311
|
*
|
|
307
312
|
* This source code is licensed under the ISC license.
|
|
@@ -311,17 +316,17 @@ ${u.summary}
|
|
|
311
316
|
*
|
|
312
317
|
* This source code is licensed under the ISC license.
|
|
313
318
|
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const
|
|
319
|
+
*/const ag=we("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
315
320
|
* @license lucide-react v0.469.0 - ISC
|
|
316
321
|
*
|
|
317
322
|
* This source code is licensed under the ISC license.
|
|
318
323
|
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const
|
|
324
|
+
*/const lg=we("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"}]]);/**
|
|
320
325
|
* @license lucide-react v0.469.0 - ISC
|
|
321
326
|
*
|
|
322
327
|
* This source code is licensed under the ISC license.
|
|
323
328
|
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const
|
|
329
|
+
*/const cw=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
325
330
|
* @license lucide-react v0.469.0 - ISC
|
|
326
331
|
*
|
|
327
332
|
* This source code is licensed under the ISC license.
|
|
@@ -331,7 +336,7 @@ ${u.summary}
|
|
|
331
336
|
*
|
|
332
337
|
* This source code is licensed under the ISC license.
|
|
333
338
|
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const
|
|
339
|
+
*/const uw=we("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"}]]);/**
|
|
335
340
|
* @license lucide-react v0.469.0 - ISC
|
|
336
341
|
*
|
|
337
342
|
* This source code is licensed under the ISC license.
|
|
@@ -346,60 +351,60 @@ ${u.summary}
|
|
|
346
351
|
*
|
|
347
352
|
* This source code is licensed under the ISC license.
|
|
348
353
|
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const
|
|
354
|
+
*/const cg=we("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
350
355
|
* @license lucide-react v0.469.0 - ISC
|
|
351
356
|
*
|
|
352
357
|
* This source code is licensed under the ISC license.
|
|
353
358
|
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const
|
|
359
|
+
*/const dr=we("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"}]]);/**
|
|
355
360
|
* @license lucide-react v0.469.0 - ISC
|
|
356
361
|
*
|
|
357
362
|
* This source code is licensed under the ISC license.
|
|
358
363
|
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const
|
|
364
|
+
*/const dw=we("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"}]]);/**
|
|
360
365
|
* @license lucide-react v0.469.0 - ISC
|
|
361
366
|
*
|
|
362
367
|
* This source code is licensed under the ISC license.
|
|
363
368
|
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const
|
|
369
|
+
*/const fw=we("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"}]]);/**
|
|
365
370
|
* @license lucide-react v0.469.0 - ISC
|
|
366
371
|
*
|
|
367
372
|
* This source code is licensed under the ISC license.
|
|
368
373
|
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const
|
|
374
|
+
*/const pw=we("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
370
375
|
* @license lucide-react v0.469.0 - ISC
|
|
371
376
|
*
|
|
372
377
|
* This source code is licensed under the ISC license.
|
|
373
378
|
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const
|
|
379
|
+
*/const hw=we("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"}]]);/**
|
|
375
380
|
* @license lucide-react v0.469.0 - ISC
|
|
376
381
|
*
|
|
377
382
|
* This source code is licensed under the ISC license.
|
|
378
383
|
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const
|
|
384
|
+
*/const ug=we("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
380
385
|
* @license lucide-react v0.469.0 - ISC
|
|
381
386
|
*
|
|
382
387
|
* This source code is licensed under the ISC license.
|
|
383
388
|
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const
|
|
389
|
+
*/const mw=we("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"}]]);/**
|
|
385
390
|
* @license lucide-react v0.469.0 - ISC
|
|
386
391
|
*
|
|
387
392
|
* This source code is licensed under the ISC license.
|
|
388
393
|
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const
|
|
394
|
+
*/const Wn=we("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
390
395
|
* @license lucide-react v0.469.0 - ISC
|
|
391
396
|
*
|
|
392
397
|
* This source code is licensed under the ISC license.
|
|
393
398
|
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const
|
|
399
|
+
*/const gw=we("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 oo=Dm();function vw(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>o=>{r.forEach(a=>a(o))},r)}const vl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yi(n){const r=Object.prototype.toString.call(n);return r==="[object Window]"||r==="[object global]"}function id(n){return"nodeType"in n}function yn(n){var r,s;return n?yi(n)?n:id(n)&&(r=(s=n.ownerDocument)==null?void 0:s.defaultView)!=null?r:window:window}function od(n){const{Document:r}=yn(n);return n instanceof r}function So(n){return yi(n)?!1:n instanceof yn(n).HTMLElement}function dg(n){return n instanceof yn(n).SVGElement}function xi(n){return n?yi(n)?n.document:id(n)?od(n)?n:So(n)||dg(n)?n.ownerDocument:document:document:document}const fr=vl?w.useLayoutEffect:w.useEffect;function yl(n){const r=w.useRef(n);return fr(()=>{r.current=n}),w.useCallback(function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r.current==null?void 0:r.current(...o)},[])}function yw(){const n=w.useRef(null),r=w.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),s=w.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[r,s]}function yo(n,r){r===void 0&&(r=[n]);const s=w.useRef(n);return fr(()=>{s.current!==n&&(s.current=n)},r),s}function bo(n,r){const s=w.useRef();return w.useMemo(()=>{const o=n(s.current);return s.current=o,o},[...r])}function Ja(n){const r=yl(n),s=w.useRef(null),o=w.useCallback(a=>{a!==s.current&&(r==null||r(a,s.current)),s.current=a},[]);return[s,o]}function el(n){const r=w.useRef();return w.useEffect(()=>{r.current=n},[n]),r.current}let hu={};function To(n,r){return w.useMemo(()=>{if(r)return r;const s=hu[n]==null?0:hu[n]+1;return hu[n]=s,n+"-"+s},[n,r])}function fg(n){return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const h=Object.entries(f);for(const[g,m]of h){const v=u[g];v!=null&&(u[g]=v+n*m)}return u},{...r})}}const gi=fg(1),tl=fg(-1);function xw(n){return"clientX"in n&&"clientY"in n}function xl(n){if(!n)return!1;const{KeyboardEvent:r}=yn(n.target);return r&&n instanceof r}function ww(n){if(!n)return!1;const{TouchEvent:r}=yn(n.target);return r&&n instanceof r}function nl(n){if(ww(n)){if(n.touches&&n.touches.length){const{clientX:r,clientY:s}=n.touches[0];return{x:r,y:s}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:r,clientY:s}=n.changedTouches[0];return{x:r,y:s}}}return xw(n)?{x:n.clientX,y:n.clientY}:null}const Pr=Object.freeze({Translate:{toString(n){if(!n)return;const{x:r,y:s}=n;return"translate3d("+(r?Math.round(r):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:r,scaleY:s}=n;return"scaleX("+r+") scaleY("+s+")"}},Transform:{toString(n){if(n)return[Pr.Translate.toString(n),Pr.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:r,duration:s,easing:o}=n;return r+" "+s+"ms "+o}}}),Nh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function kw(n){return n.matches(Nh)?n:n.querySelector(Nh)}const Sw={display:"none"};function bw(n){let{id:r,value:s}=n;return st.createElement("div",{id:r,style:Sw},s)}function Tw(n){let{id:r,announcement:s,ariaLiveType:o="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 st.createElement("div",{id:r,style:a,role:"status","aria-live":o,"aria-atomic":!0},s)}function Nw(){const[n,r]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&r(o)},[]),announcement:n}}const pg=w.createContext(null);function Cw(n){const r=w.useContext(pg);w.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(n)},[n,r])}function Ew(){const[n]=w.useState(()=>new Set),r=w.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[w.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[n]),r]}const _w={draggable:`
|
|
395
400
|
To pick up a draggable item, press the space bar.
|
|
396
401
|
While dragging, use the arrow keys to move the item.
|
|
397
402
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
398
|
-
`},ww={onDragStart(n){let{active:r}=n;return"Picked up draggable item "+r.id+"."},onDragOver(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was moved over droppable area "+s.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was dropped over droppable area "+s.id:"Draggable item "+r.id+" was dropped."},onDragCancel(n){let{active:r}=n;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function kw(n){let{announcements:r=ww,container:s,hiddenTextDescribedById:o,screenReaderInstructions:a=xw}=n;const{announce:u,announcement:f}=gw(),h=To("DndLiveRegion"),[g,m]=w.useState(!1);if(w.useEffect(()=>{m(!0)},[]),vw(w.useMemo(()=>({onDragStart(k){let{active:x}=k;u(r.onDragStart({active:x}))},onDragMove(k){let{active:x,over:b}=k;r.onDragMove&&u(r.onDragMove({active:x,over:b}))},onDragOver(k){let{active:x,over:b}=k;u(r.onDragOver({active:x,over:b}))},onDragEnd(k){let{active:x,over:b}=k;u(r.onDragEnd({active:x,over:b}))},onDragCancel(k){let{active:x,over:b}=k;u(r.onDragCancel({active:x,over:b}))}}),[u,r])),!g)return null;const v=st.createElement(st.Fragment,null,st.createElement(hw,{id:o,value:a.draggable}),st.createElement(mw,{id:h,announcement:f}));return s?oo.createPortal(v,s):v}var Wt;(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"})(Wt||(Wt={}));function rl(){}function Sw(n,r){return w.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function bw(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>[...r].filter(o=>o!=null),[...r])}const pr=Object.freeze({x:0,y:0});function Tw(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function Nw(n,r){const s=nl(n);if(!s)return"0 0";const o={x:(s.x-r.left)/r.width*100,y:(s.y-r.top)/r.height*100};return o.x+"% "+o.y+"%"}function Cw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return s-o}function Ew(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return o-s}function _w(n,r){if(!n||n.length===0)return null;const[s]=n;return s[r]}function Ch(n,r,s){return r===void 0&&(r=n.left),s===void 0&&(s=n.top),{x:r+n.width*.5,y:s+n.height*.5}}const jw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=Ch(r,r.left,r.top),u=[];for(const f of o){const{id:h}=f,g=s.get(h);if(g){const m=Tw(Ch(g),a);u.push({id:h,data:{droppableContainer:f,value:m}})}}return u.sort(Cw)};function Rw(n,r){const s=Math.max(r.top,n.top),o=Math.max(r.left,n.left),a=Math.min(r.left+r.width,n.left+n.width),u=Math.min(r.top+r.height,n.top+n.height),f=a-o,h=u-s;if(o<a&&s<u){const g=r.width*r.height,m=n.width*n.height,v=f*h,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const Aw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=s.get(f);if(h){const g=Rw(h,r);g>0&&a.push({id:f,data:{droppableContainer:u,value:g}})}}return a.sort(Ew)};function Iw(n,r,s){return{...n,scaleX:r&&s?r.width/s.width:1,scaleY:r&&s?r.height/s.height:1}}function pg(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:pr}function Dw(n){return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];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}),{...s})}}const Mw=Dw(1);function hg(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 Lw(n,r,s){const o=hg(r);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,g=n.left-f-(1-a)*parseFloat(s),m=n.top-h-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),v=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const Pw={ignoreTransform:!1};function wi(n,r){r===void 0&&(r=Pw);let s=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:m,transformOrigin:v}=yn(n).getComputedStyle(n);m&&(s=Lw(s,m,v))}const{top:o,left:a,width:u,height:f,bottom:h,right:g}=s;return{top:o,left:a,width:u,height:f,bottom:h,right:g}}function Eh(n){return wi(n,{ignoreTransform:!0})}function Ow(n){const r=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}function zw(n,r){return r===void 0&&(r=yn(n).getComputedStyle(n)),r.position==="fixed"}function $w(n,r){r===void 0&&(r=yn(n).getComputedStyle(n));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=r[a];return typeof u=="string"?s.test(u):!1})}function ad(n,r){const s=[];function o(a){if(r!=null&&s.length>=r||!a)return s;if(od(a)&&a.scrollingElement!=null&&!s.includes(a.scrollingElement))return s.push(a.scrollingElement),s;if(!So(a)||ug(a)||s.includes(a))return s;const u=yn(n).getComputedStyle(a);return a!==n&&$w(a,u)&&s.push(a),zw(a,u)?s:o(a.parentNode)}return n?o(n):s}function mg(n){const[r]=ad(n,1);return r??null}function mu(n){return!vl||!n?null:yi(n)?n:id(n)?od(n)||n===xi(n).scrollingElement?window:So(n)?n:null:null}function gg(n){return yi(n)?n.scrollX:n.scrollLeft}function vg(n){return yi(n)?n.scrollY:n.scrollTop}function Iu(n){return{x:gg(n),y:vg(n)}}var Jt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Jt||(Jt={}));function yg(n){return!vl||!n?!1:n===document.scrollingElement}function xg(n){const r={x:0,y:0},s=yg(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-s.width,y:n.scrollHeight-s.height},a=n.scrollTop<=r.y,u=n.scrollLeft<=r.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:r}}const Fw={x:.2,y:.2};function Uw(n,r,s,o,a){let{top:u,left:f,right:h,bottom:g}=s;o===void 0&&(o=10),a===void 0&&(a=Fw);const{isTop:m,isBottom:v,isLeft:k,isRight:x}=xg(n),b={x:0,y:0},E={x:0,y:0},C={height:r.height*a.y,width:r.width*a.x};return!m&&u<=r.top+C.height?(b.y=Jt.Backward,E.y=o*Math.abs((r.top+C.height-u)/C.height)):!v&&g>=r.bottom-C.height&&(b.y=Jt.Forward,E.y=o*Math.abs((r.bottom-C.height-g)/C.height)),!x&&h>=r.right-C.width?(b.x=Jt.Forward,E.x=o*Math.abs((r.right-C.width-h)/C.width)):!k&&f<=r.left+C.width&&(b.x=Jt.Backward,E.x=o*Math.abs((r.left+C.width-f)/C.width)),{direction:b,speed:E}}function Bw(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:r,left:s,right:o,bottom:a}=n.getBoundingClientRect();return{top:r,left:s,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function wg(n){return n.reduce((r,s)=>gi(r,Iu(s)),pr)}function Ww(n){return n.reduce((r,s)=>r+gg(s),0)}function Hw(n){return n.reduce((r,s)=>r+vg(s),0)}function kg(n,r){if(r===void 0&&(r=wi),!n)return;const{top:s,left:o,bottom:a,right:u}=r(n);mg(n)&&(a<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const Vw=[["x",["left","right"],Ww],["y",["top","bottom"],Hw]];class ld{constructor(r,s){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 o=ad(s),a=wg(o);this.rect={...r},this.width=r.width,this.height=r.height;for(const[u,f,h]of Vw)for(const g of f)Object.defineProperty(this,g,{get:()=>{const m=h(o),v=a[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class co{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...s)})},this.target=r}add(r,s,o){var a;(a=this.target)==null||a.addEventListener(r,s,o),this.listeners.push([r,s,o])}}function qw(n){const{EventTarget:r}=yn(n);return n instanceof r?n:xi(n)}function gu(n,r){const s=Math.abs(n.x),o=Math.abs(n.y);return typeof r=="number"?Math.sqrt(s**2+o**2)>r:"x"in r&&"y"in r?s>r.x&&o>r.y:"x"in r?s>r.x:"y"in r?o>r.y:!1}var Zn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Zn||(Zn={}));function _h(n){n.preventDefault()}function Gw(n){n.stopPropagation()}var et;(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"})(et||(et={}));const Sg={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},Kw=(n,r)=>{let{currentCoordinates:s}=r;switch(n.code){case et.Right:return{...s,x:s.x+25};case et.Left:return{...s,x:s.x-25};case et.Down:return{...s,y:s.y+25};case et.Up:return{...s,y:s.y-25}}};class bg{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:s}}=r;this.props=r,this.listeners=new co(xi(s)),this.windowListeners=new co(yn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Zn.Resize,this.handleCancel),this.windowListeners.add(Zn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Zn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:s}=this.props,o=r.node.current;o&&kg(o),s(pr)}handleKeyDown(r){if(xl(r)){const{active:s,context:o,options:a}=this.props,{keyboardCodes:u=Sg,coordinateGetter:f=Kw,scrollBehavior:h="smooth"}=a,{code:g}=r;if(u.end.includes(g)){this.handleEnd(r);return}if(u.cancel.includes(g)){this.handleCancel(r);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=v);const k=f(r,{active:s,context:o.current,currentCoordinates:v});if(k){const x=tl(k,v),b={x:0,y:0},{scrollableAncestors:E}=o.current;for(const C of E){const T=r.code,{isTop:I,isRight:A,isLeft:B,isBottom:$,maxScroll:W,minScroll:Y}=xg(C),G=Bw(C),K={x:Math.min(T===et.Right?G.right-G.width/2:G.right,Math.max(T===et.Right?G.left:G.left+G.width/2,k.x)),y:Math.min(T===et.Down?G.bottom-G.height/2:G.bottom,Math.max(T===et.Down?G.top:G.top+G.height/2,k.y))},ue=T===et.Right&&!A||T===et.Left&&!B,ge=T===et.Down&&!$||T===et.Up&&!I;if(ue&&K.x!==k.x){const de=C.scrollLeft+x.x,pe=T===et.Right&&de<=W.x||T===et.Left&&de>=Y.x;if(pe&&!x.y){C.scrollTo({left:de,behavior:h});return}pe?b.x=C.scrollLeft-de:b.x=T===et.Right?C.scrollLeft-W.x:C.scrollLeft-Y.x,b.x&&C.scrollBy({left:-b.x,behavior:h});break}else if(ge&&K.y!==k.y){const de=C.scrollTop+x.y,pe=T===et.Down&&de<=W.y||T===et.Up&&de>=Y.y;if(pe&&!x.x){C.scrollTo({top:de,behavior:h});return}pe?b.y=C.scrollTop-de:b.y=T===et.Down?C.scrollTop-W.y:C.scrollTop-Y.y,b.y&&C.scrollBy({top:-b.y,behavior:h});break}}this.handleMove(r,gi(tl(k,this.referenceCoordinates),b))}}}handleMove(r,s){const{onMove:o}=this.props;r.preventDefault(),o(s)}handleEnd(r){const{onEnd:s}=this.props;r.preventDefault(),this.detach(),s()}handleCancel(r){const{onCancel:s}=this.props;r.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}bg.activators=[{eventName:"onKeyDown",handler:(n,r,s)=>{let{keyboardCodes:o=Sg,onActivation:a}=r,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function jh(n){return!!(n&&"distance"in n)}function Rh(n){return!!(n&&"delay"in n)}class cd{constructor(r,s,o){var a;o===void 0&&(o=qw(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=s;const{event:u}=r,{target:f}=u;this.props=r,this.events=s,this.document=xi(f),this.documentListeners=new co(this.document),this.listeners=new co(o),this.windowListeners=new co(yn(f)),this.initialCoordinates=(a=nl(u))!=null?a:pr,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:s,bypassActivationConstraint:o}}}=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(Zn.Resize,this.handleCancel),this.windowListeners.add(Zn.DragStart,_h),this.windowListeners.add(Zn.VisibilityChange,this.handleCancel),this.windowListeners.add(Zn.ContextMenu,_h),this.documentListeners.add(Zn.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Rh(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(jh(s)){this.handlePending(s);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,s){const{active:o,onPending:a}=this.props;a(o,r,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:r}=this,{onStart:s}=this.props;r&&(this.activated=!0,this.documentListeners.add(Zn.Click,Gw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Zn.SelectionChange,this.removeTextSelection),s(r))}handleMove(r){var s;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const g=(s=nl(r))!=null?s:pr,m=tl(a,g);if(!o&&h){if(jh(h)){if(h.tolerance!=null&&gu(m,h.tolerance))return this.handleCancel();if(gu(m,h.distance))return this.handleStart()}if(Rh(h)&&gu(m,h.tolerance))return this.handleCancel();this.handlePending(h,m);return}r.cancelable&&r.preventDefault(),f(g)}handleEnd(){const{onAbort:r,onEnd:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleCancel(){const{onAbort:r,onCancel:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleKeydown(r){r.code===et.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const Yw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ud extends cd{constructor(r){const{event:s}=r,o=xi(s.target);super(r,Yw,o)}}ud.activators=[{eventName:"onPointerDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return!s.isPrimary||s.button!==0?!1:(o==null||o({event:s}),!0)}}];const Xw={move:{name:"mousemove"},end:{name:"mouseup"}};var Du;(function(n){n[n.RightClick=2]="RightClick"})(Du||(Du={}));class Qw extends cd{constructor(r){super(r,Xw,xi(r.event.target))}}Qw.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return s.button===Du.RightClick?!1:(o==null||o({event:s}),!0)}}];const vu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Zw extends cd{constructor(r){super(r,vu)}static setup(){return window.addEventListener(vu.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(vu.move.name,r)};function r(){}}}Zw.activators=[{eventName:"onTouchStart",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;const{touches:a}=s;return a.length>1?!1:(o==null||o({event:s}),!0)}}];var uo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(uo||(uo={}));var sl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(sl||(sl={}));function Jw(n){let{acceleration:r,activator:s=uo.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=sl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:x}=n;const b=t1({delta:k,disabled:!u}),[E,C]=cw(),T=w.useRef({x:0,y:0}),I=w.useRef({x:0,y:0}),A=w.useMemo(()=>{switch(s){case uo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case uo.DraggableRect:return a}},[s,a,g]),B=w.useRef(null),$=w.useCallback(()=>{const Y=B.current;if(!Y)return;const G=T.current.x*I.current.x,K=T.current.y*I.current.y;Y.scrollBy(G,K)},[]),W=w.useMemo(()=>h===sl.TreeOrder?[...m].reverse():m,[h,m]);w.useEffect(()=>{if(!u||!m.length||!A){C();return}for(const Y of W){if((o==null?void 0:o(Y))===!1)continue;const G=m.indexOf(Y),K=v[G];if(!K)continue;const{direction:ue,speed:ge}=Uw(Y,K,A,r,x);for(const de of["x","y"])b[de][ue[de]]||(ge[de]=0,ue[de]=0);if(ge.x>0||ge.y>0){C(),B.current=Y,E($,f),T.current=ge,I.current=ue;return}}T.current={x:0,y:0},I.current={x:0,y:0},C()},[r,$,o,C,u,f,JSON.stringify(A),JSON.stringify(b),E,m,W,v,JSON.stringify(x)])}const e1={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function t1(n){let{delta:r,disabled:s}=n;const o=el(r);return bo(a=>{if(s||!o||!a)return e1;const u={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Jt.Backward]:a.x[Jt.Backward]||u.x===-1,[Jt.Forward]:a.x[Jt.Forward]||u.x===1},y:{[Jt.Backward]:a.y[Jt.Backward]||u.y===-1,[Jt.Forward]:a.y[Jt.Forward]||u.y===1}}},[s,r,o])}function n1(n,r){const s=r!=null?n.get(r):void 0,o=s?s.node.current:null;return bo(a=>{var u;return r==null?null:(u=o??a)!=null?u:null},[o,r])}function r1(n,r){return w.useMemo(()=>n.reduce((s,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:r(f.handler,o)}));return[...s,...u]},[]),[n,r])}var xo;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(xo||(xo={}));var Mu;(function(n){n.Optimized="optimized"})(Mu||(Mu={}));const Ah=new Map;function s1(n,r){let{dragging:s,dependencies:o,config:a}=r;const[u,f]=w.useState(null),{frequency:h,measure:g,strategy:m}=a,v=w.useRef(n),k=T(),x=yo(k),b=w.useCallback(function(I){I===void 0&&(I=[]),!x.current&&f(A=>A===null?I:A.concat(I.filter(B=>!A.includes(B))))},[x]),E=w.useRef(null),C=bo(I=>{if(k&&!s)return Ah;if(!I||I===Ah||v.current!==n||u!=null){const A=new Map;for(let B of n){if(!B)continue;if(u&&u.length>0&&!u.includes(B.id)&&B.rect.current){A.set(B.id,B.rect.current);continue}const $=B.node.current,W=$?new ld(g($),$):null;B.rect.current=W,W&&A.set(B.id,W)}return A}return I},[n,u,s,k,g]);return w.useEffect(()=>{v.current=n},[n]),w.useEffect(()=>{k||b()},[s,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||E.current!==null||(E.current=setTimeout(()=>{b(),E.current=null},h))},[h,k,b,...o]),{droppableRects:C,measureDroppableContainers:b,measuringScheduled:u!=null};function T(){switch(m){case xo.Always:return!1;case xo.BeforeDragging:return s;default:return!s}}}function dd(n,r){return bo(s=>n?s||(typeof r=="function"?r(n):n):null,[r,n])}function i1(n,r){return dd(n,r)}function o1(n){let{callback:r,disabled:s}=n;const o=yl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function wl(n){let{callback:r,disabled:s}=n;const o=yl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function a1(n){return new ld(wi(n),n)}function Ih(n,r,s){r===void 0&&(r=a1);const[o,a]=w.useState(null);function u(){a(g=>{if(!n)return null;if(n.isConnected===!1){var m;return(m=g??s)!=null?m:null}const v=r(n);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const f=o1({callback(g){if(n)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=wl({callback:u});return fr(()=>{u(),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]),o}function l1(n){const r=dd(n);return pg(n,r)}const Dh=[];function c1(n){const r=w.useRef(n),s=bo(o=>n?o&&o!==Dh&&n&&r.current&&n.parentNode===r.current.parentNode?o:ad(n):Dh,[n]);return w.useEffect(()=>{r.current=n},[n]),s}function u1(n){const[r,s]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=mu(u.target);f&&s(h=>h?(h.set(f,Iu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(g=>{const m=mu(g);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,Iu(m)]):null}).filter(g=>g!=null);s(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(g=>{const m=mu(g);m==null||m.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?r?Array.from(r.values()).reduce((u,f)=>gi(u,f),pr):wg(n):pr,[n,r])}function Mh(n,r){r===void 0&&(r=[]);const s=w.useRef(null);return w.useEffect(()=>{s.current=null},r),w.useEffect(()=>{const o=n!==pr;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?tl(n,s.current):pr}function d1(n){w.useEffect(()=>{if(!vl)return;const r=n.map(s=>{let{sensor:o}=s;return o.setup==null?void 0:o.setup()});return()=>{for(const s of r)s==null||s()}},n.map(r=>{let{sensor:s}=r;return s}))}function f1(n,r){return w.useMemo(()=>n.reduce((s,o)=>{let{eventName:a,handler:u}=o;return s[a]=f=>{u(f,r)},s},{}),[n,r])}function Tg(n){return w.useMemo(()=>n?Ow(n):null,[n])}const Lh=[];function p1(n,r){r===void 0&&(r=wi);const[s]=n,o=Tg(s?yn(s):null),[a,u]=w.useState(Lh);function f(){u(()=>n.length?n.map(g=>yg(g)?o:new ld(r(g),g)):Lh)}const h=wl({callback:f});return fr(()=>{h==null||h.disconnect(),f(),n.forEach(g=>h==null?void 0:h.observe(g))},[n]),a}function Ng(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return So(r)?r:n}function h1(n){let{measure:r}=n;const[s,o]=w.useState(null),a=w.useCallback(m=>{for(const{target:v}of m)if(So(v)){o(k=>{const x=r(v);return k?{...k,width:x.width,height:x.height}:x});break}},[r]),u=wl({callback:a}),f=w.useCallback(m=>{const v=Ng(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?r(v):null)},[r,u]),[h,g]=Ja(f);return w.useMemo(()=>({nodeRef:h,rect:s,setRef:g}),[s,h,g])}const m1=[{sensor:ud,options:{}},{sensor:bg,options:{}}],g1={current:{}},Ba={draggable:{measure:Eh},droppable:{measure:Eh,strategy:xo.WhileDragging,frequency:Mu.Optimized},dragOverlay:{measure:wi}};class fo extends Map{get(r){var s;return r!=null&&(s=super.get(r))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:s}=r;return!s})}getNodeFor(r){var s,o;return(s=(o=this.get(r))==null?void 0:o.node.current)!=null?s:void 0}}const v1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ba,measureDroppableContainers:rl,windowRect:null,measuringScheduled:!1},Cg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rl,draggableNodes:new Map,over:null,measureDroppableContainers:rl},No=w.createContext(Cg),Eg=w.createContext(v1);function y1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fo}}}function x1(n,r){switch(r.type){case Wt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Wt.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 Wt.DragEnd:case Wt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:s}=r,{id:o}=s,a=new fo(n.droppable.containers);return a.set(o,s),{...n,droppable:{...n.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:s,key:o,disabled:a}=r,u=n.droppable.containers.get(s);if(!u||o!==u.key)return n;const f=new fo(n.droppable.containers);return f.set(s,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Wt.UnregisterDroppable:{const{id:s,key:o}=r,a=n.droppable.containers.get(s);if(!a||o!==a.key)return n;const u=new fo(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function w1(n){let{disabled:r}=n;const{active:s,activatorEvent:o,draggableNodes:a}=w.useContext(No),u=el(o),f=el(s==null?void 0:s.id);return w.useEffect(()=>{if(!r&&!o&&u&&f!=null){if(!xl(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:g,node:m}=h;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=fw(v);if(k){k.focus();break}}})}},[o,r,a,f,u]),null}function _g(n,r){let{transform:s,...o}=r;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),s):s}function k1(n){return w.useMemo(()=>({draggable:{...Ba.draggable,...n==null?void 0:n.draggable},droppable:{...Ba.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Ba.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 S1(n){let{activeNode:r,measure:s,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;fr(()=>{if(!f&&!h||!r){u.current=!1;return}if(u.current||!o)return;const m=r==null?void 0:r.node.current;if(!m||m.isConnected===!1)return;const v=s(m),k=pg(v,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const x=mg(m);x&&x.scrollBy({top:k.y,left:k.x})}},[r,f,h,o,s])}const kl=w.createContext({...pr,scaleX:1,scaleY:1});var ss;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ss||(ss={}));const b1=w.memo(function(r){var s,o,a,u;let{id:f,accessibility:h,autoScroll:g=!0,children:m,sensors:v=m1,collisionDetection:k=Aw,measuring:x,modifiers:b,...E}=r;const C=w.useReducer(x1,void 0,y1),[T,I]=C,[A,B]=yw(),[$,W]=w.useState(ss.Uninitialized),Y=$===ss.Initialized,{draggable:{active:G,nodes:K,translate:ue},droppable:{containers:ge}}=T,de=G!=null?K.get(G):null,pe=w.useRef({initial:null,translated:null}),ve=w.useMemo(()=>{var rt;return G!=null?{id:G,data:(rt=de==null?void 0:de.data)!=null?rt:g1,rect:pe}:null},[G,de]),Me=w.useRef(null),[ee,re]=w.useState(null),[ae,z]=w.useState(null),X=yo(E,Object.values(E)),V=To("DndDescribedBy",f),j=w.useMemo(()=>ge.getEnabled(),[ge]),M=k1(x),{droppableRects:ce,measureDroppableContainers:q,measuringScheduled:le}=s1(j,{dragging:Y,dependencies:[ue.x,ue.y],config:M.droppable}),fe=n1(K,G),Pe=w.useMemo(()=>ae?nl(ae):null,[ae]),Ce=Vt(),je=i1(fe,M.draggable.measure);S1({activeNode:G!=null?K.get(G):null,config:Ce.layoutShiftCompensation,initialRect:je,measure:M.draggable.measure});const _e=Ih(fe,M.draggable.measure,je),it=Ih(fe?fe.parentElement:null),Ee=w.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:K,draggingNode:null,draggingNodeRect:null,droppableContainers:ge,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=ge.getNodeFor((s=Ee.current.over)==null?void 0:s.id),$e=h1({measure:M.dragOverlay.measure}),It=(o=$e.nodeRef.current)!=null?o:fe,Fe=Y?(a=$e.rect)!=null?a:_e:null,Dt=!!($e.nodeRef.current&&$e.rect),_n=l1(Dt?null:_e),St=Tg(It?yn(It):null),Mt=c1(Y?kt??fe:null),pt=p1(Mt),en=_g(b,{transform:{x:ue.x-_n.x,y:ue.y-_n.y,scaleX:1,scaleY:1},activatorEvent:ae,active:ve,activeNodeRect:_e,containerNodeRect:it,draggingNodeRect:Fe,over:Ee.current.over,overlayNodeRect:$e.rect,scrollableAncestors:Mt,scrollableAncestorRects:pt,windowRect:St}),H=Pe?gi(Pe,ue):null,he=u1(Mt),Ue=Mh(he),tt=Mh(he,[_e]),ht=gi(en,Ue),mt=Fe?Mw(Fe,en):null,Rt=ve&&mt?k({active:ve,collisionRect:mt,droppableRects:ce,droppableContainers:j,pointerCoordinates:H}):null,Ht=_w(Rt,"id"),[ut,jn]=w.useState(null),Wn=Dt?en:gi(en,tt),br=Iw(Wn,(u=ut==null?void 0:ut.rect)!=null?u:null,_e),hr=w.useRef(null),Rn=w.useCallback((rt,gt)=>{let{sensor:vt,options:qt}=gt;if(Me.current==null)return;const bt=K.get(Me.current);if(!bt)return;const yt=rt.nativeEvent,ot=new vt({active:Me.current,activeNode:bt,event:yt,options:qt,context:Ee,onAbort(Je){if(!K.get(Je))return;const{onDragAbort:se}=X.current,ne={id:Je};se==null||se(ne),A({type:"onDragAbort",event:ne})},onPending(Je,_,se,ne){if(!K.get(Je))return;const{onDragPending:ze}=X.current,Be={id:Je,constraint:_,initialCoordinates:se,offset:ne};ze==null||ze(Be),A({type:"onDragPending",event:Be})},onStart(Je){const _=Me.current;if(_==null)return;const se=K.get(_);if(!se)return;const{onDragStart:ne}=X.current,ye={activatorEvent:yt,active:{id:_,data:se.data,rect:pe}};oo.unstable_batchedUpdates(()=>{ne==null||ne(ye),W(ss.Initializing),I({type:Wt.DragStart,initialCoordinates:Je,active:_}),A({type:"onDragStart",event:ye}),re(hr.current),z(yt)})},onMove(Je){I({type:Wt.DragMove,coordinates:Je})},onEnd:Gt(Wt.DragEnd),onCancel:Gt(Wt.DragCancel)});hr.current=ot;function Gt(Je){return async function(){const{active:se,collisions:ne,over:ye,scrollAdjustedTranslate:ze}=Ee.current;let Be=null;if(se&&ze){const{cancelDrop:De}=X.current;Be={activatorEvent:yt,active:se,collisions:ne,delta:ze,over:ye},Je===Wt.DragEnd&&typeof De=="function"&&await Promise.resolve(De(Be))&&(Je=Wt.DragCancel)}Me.current=null,oo.unstable_batchedUpdates(()=>{I({type:Je}),W(ss.Uninitialized),jn(null),re(null),z(null),hr.current=null;const De=Je===Wt.DragEnd?"onDragEnd":"onDragCancel";if(Be){const at=X.current[De];at==null||at(Be),A({type:De,event:Be})}})}}},[K]),An=w.useCallback((rt,gt)=>(vt,qt)=>{const bt=vt.nativeEvent,yt=K.get(qt);if(Me.current!==null||!yt||bt.dndKit||bt.defaultPrevented)return;const ot={active:yt};rt(vt,gt.options,ot)===!0&&(bt.dndKit={capturedBy:gt.sensor},Me.current=qt,Rn(vt,gt))},[K,Rn]),dn=r1(v,An);d1(v),fr(()=>{_e&&$===ss.Initializing&&W(ss.Initialized)},[_e,$]),w.useEffect(()=>{const{onDragMove:rt}=X.current,{active:gt,activatorEvent:vt,collisions:qt,over:bt}=Ee.current;if(!gt||!vt)return;const yt={active:gt,activatorEvent:vt,collisions:qt,delta:{x:ht.x,y:ht.y},over:bt};oo.unstable_batchedUpdates(()=>{rt==null||rt(yt),A({type:"onDragMove",event:yt})})},[ht.x,ht.y]),w.useEffect(()=>{const{active:rt,activatorEvent:gt,collisions:vt,droppableContainers:qt,scrollAdjustedTranslate:bt}=Ee.current;if(!rt||Me.current==null||!gt||!bt)return;const{onDragOver:yt}=X.current,ot=qt.get(Ht),Gt=ot&&ot.rect.current?{id:ot.id,rect:ot.rect.current,data:ot.data,disabled:ot.disabled}:null,Je={active:rt,activatorEvent:gt,collisions:vt,delta:{x:bt.x,y:bt.y},over:Gt};oo.unstable_batchedUpdates(()=>{jn(Gt),yt==null||yt(Je),A({type:"onDragOver",event:Je})})},[Ht]),fr(()=>{Ee.current={activatorEvent:ae,active:ve,activeNode:fe,collisionRect:mt,collisions:Rt,droppableRects:ce,draggableNodes:K,draggingNode:It,draggingNodeRect:Fe,droppableContainers:ge,over:ut,scrollableAncestors:Mt,scrollAdjustedTranslate:ht},pe.current={initial:Fe,translated:mt}},[ve,fe,Rt,mt,K,It,Fe,ce,ge,ut,Mt,ht]),Jw({...Ce,delta:ue,draggingRect:mt,pointerCoordinates:H,scrollableAncestors:Mt,scrollableAncestorRects:pt});const xn=w.useMemo(()=>({active:ve,activeNode:fe,activeNodeRect:_e,activatorEvent:ae,collisions:Rt,containerNodeRect:it,dragOverlay:$e,draggableNodes:K,droppableContainers:ge,droppableRects:ce,over:ut,measureDroppableContainers:q,scrollableAncestors:Mt,scrollableAncestorRects:pt,measuringConfiguration:M,measuringScheduled:le,windowRect:St}),[ve,fe,_e,ae,Rt,it,$e,K,ge,ce,ut,q,Mt,pt,M,le,St]),Ft=w.useMemo(()=>({activatorEvent:ae,activators:dn,active:ve,activeNodeRect:_e,ariaDescribedById:{draggable:V},dispatch:I,draggableNodes:K,over:ut,measureDroppableContainers:q}),[ae,dn,ve,_e,I,V,K,ut,q]);return st.createElement(fg.Provider,{value:B},st.createElement(No.Provider,{value:Ft},st.createElement(Eg.Provider,{value:xn},st.createElement(kl.Provider,{value:br},m)),st.createElement(w1,{disabled:(h==null?void 0:h.restoreFocus)===!1})),st.createElement(kw,{...h,hiddenTextDescribedById:V}));function Vt(){const rt=(ee==null?void 0:ee.autoScrollEnabled)===!1,gt=typeof g=="object"?g.enabled===!1:g===!1,vt=Y&&!rt&&!gt;return typeof g=="object"?{...g,enabled:vt}:{enabled:vt}}}),T1=w.createContext(null),Ph="button",N1="Draggable";function C1(n){let{id:r,data:s,disabled:o=!1,attributes:a}=n;const u=To(N1),{activators:f,activatorEvent:h,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:x}=w.useContext(No),{role:b=Ph,roleDescription:E="draggable",tabIndex:C=0}=a??{},T=(g==null?void 0:g.id)===r,I=w.useContext(T?kl:T1),[A,B]=Ja(),[$,W]=Ja(),Y=f1(f,r),G=yo(s);fr(()=>(k.set(r,{id:r,key:u,node:A,activatorNode:$,data:G}),()=>{const ue=k.get(r);ue&&ue.key===u&&k.delete(r)}),[k,r]);const K=w.useMemo(()=>({role:b,tabIndex:C,"aria-disabled":o,"aria-pressed":T&&b===Ph?!0:void 0,"aria-roledescription":E,"aria-describedby":v.draggable}),[o,b,C,T,E,v.draggable]);return{active:g,activatorEvent:h,activeNodeRect:m,attributes:K,isDragging:T,listeners:o?void 0:Y,node:A,over:x,setNodeRef:B,setActivatorNodeRef:W,transform:I}}function jg(){return w.useContext(Eg)}const E1="Droppable",_1={timeout:25};function Rg(n){let{data:r,disabled:s=!1,id:o,resizeObserverConfig:a}=n;const u=To(E1),{active:f,dispatch:h,over:g,measureDroppableContainers:m}=w.useContext(No),v=w.useRef({disabled:s}),k=w.useRef(!1),x=w.useRef(null),b=w.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:T}={..._1,...a},I=yo(C??o),A=w.useCallback(()=>{if(!k.current){k.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(I.current)?I.current:[I.current]),b.current=null},T)},[T]),B=wl({callback:A,disabled:E||!f}),$=w.useCallback((K,ue)=>{B&&(ue&&(B.unobserve(ue),k.current=!1),K&&B.observe(K))},[B]),[W,Y]=Ja($),G=yo(r);return w.useEffect(()=>{!B||!W.current||(B.disconnect(),k.current=!1,B.observe(W.current))},[W,B]),w.useEffect(()=>(h({type:Wt.RegisterDroppable,element:{id:o,key:u,disabled:s,node:W,rect:x,data:G}}),()=>h({type:Wt.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{s!==v.current.disabled&&(h({type:Wt.SetDroppableDisabled,id:o,key:u,disabled:s}),v.current.disabled=s)},[o,u,s,h]),{active:f,rect:x,isOver:(g==null?void 0:g.id)===o,node:W,over:g,setNodeRef:Y}}function j1(n){let{animation:r,children:s}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=el(s);return!s&&!o&&h&&a(h),fr(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){a(null);return}Promise.resolve(r(m,u)).then(()=>{a(null)})},[r,o,u]),st.createElement(st.Fragment,null,s,o?w.cloneElement(o,{ref:f}):null)}const R1={x:0,y:0,scaleX:1,scaleY:1};function A1(n){let{children:r}=n;return st.createElement(No.Provider,{value:Cg},st.createElement(kl.Provider,{value:R1},r))}const I1={position:"fixed",touchAction:"none"},D1=n=>xl(n)?"transform 250ms ease":void 0,M1=w.forwardRef((n,r)=>{let{as:s,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:g,transform:m,transition:v=D1}=n;if(!h)return null;const k=a?m:{...m,scaleX:1,scaleY:1},x={...I1,width:h.width,height:h.height,top:h.top,left:h.left,transform:Pr.Transform.toString(k),transformOrigin:a&&o?Nw(o,h):void 0,transition:typeof v=="function"?v(o):v,...g};return st.createElement(s,{className:f,style:x,ref:r},u)}),L1=n=>r=>{let{active:s,dragOverlay:o}=r;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,g]of Object.entries(u.active))g!==void 0&&(a[h]=s.node.style.getPropertyValue(h),s.node.style.setProperty(h,g));if(u!=null&&u.dragOverlay)for(const[h,g]of Object.entries(u.dragOverlay))g!==void 0&&o.node.style.setProperty(h,g);return f!=null&&f.active&&s.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[g,m]of Object.entries(a))s.node.style.setProperty(g,m);f!=null&&f.active&&s.node.classList.remove(f.active)}},P1=n=>{let{transform:{initial:r,final:s}}=n;return[{transform:Pr.Transform.toString(r)},{transform:Pr.Transform.toString(s)}]},O1={duration:250,easing:"ease",keyframes:P1,sideEffects:L1({styles:{active:{opacity:"0"}}})};function z1(n){let{config:r,draggableNodes:s,droppableContainers:o,measuringConfiguration:a}=n;return yl((u,f)=>{if(r===null)return;const h=s.get(u);if(!h)return;const g=h.node.current;if(!g)return;const m=Ng(f);if(!m)return;const{transform:v}=yn(f).getComputedStyle(f),k=hg(v);if(!k)return;const x=typeof r=="function"?r:$1(r);return kg(g,a.draggable.measure),x({active:{id:u,data:h.data,node:g,rect:a.draggable.measure(g)},draggableNodes:s,dragOverlay:{node:f,rect:a.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function $1(n){const{duration:r,easing:s,sideEffects:o,keyframes:a}={...O1,...n};return u=>{let{active:f,dragOverlay:h,transform:g,...m}=u;if(!r)return;const v={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:g.scaleX!==1?f.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?f.rect.height*g.scaleY/h.rect.height:1},x={x:g.x-v.x,y:g.y-v.y,...k},b=a({...m,active:f,dragOverlay:h,transform:{initial:g,final:x}}),[E]=b,C=b[b.length-1];if(JSON.stringify(E)===JSON.stringify(C))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...m}),I=h.node.animate(b,{duration:r,easing:s,fill:"forwards"});return new Promise(A=>{I.onfinish=()=>{T==null||T(),A()}})}}let Oh=0;function F1(n){return w.useMemo(()=>{if(n!=null)return Oh++,Oh},[n])}const U1=st.memo(n=>{let{adjustScale:r=!1,children:s,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:g,zIndex:m=999}=n;const{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:b,draggableNodes:E,droppableContainers:C,dragOverlay:T,over:I,measuringConfiguration:A,scrollableAncestors:B,scrollableAncestorRects:$,windowRect:W}=jg(),Y=w.useContext(kl),G=F1(k==null?void 0:k.id),K=_g(f,{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:b,draggingNodeRect:T.rect,over:I,overlayNodeRect:T.rect,scrollableAncestors:B,scrollableAncestorRects:$,transform:Y,windowRect:W}),ue=dd(x),ge=z1({config:o,draggableNodes:E,droppableContainers:C,measuringConfiguration:A}),de=ue?T.setRef:void 0;return st.createElement(A1,null,st.createElement(j1,{animation:ge},k&&G?st.createElement(M1,{key:G,id:k.id,ref:de,as:h,activatorEvent:v,adjustScale:r,className:g,transition:u,rect:ue,style:{zIndex:m,...a},transform:K},s):null))});function Ag(n,r,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(r,1)[0]),o}function B1(n,r){return n.reduce((s,o,a)=>{const u=r.get(o);return u&&(s[a]=u),s},Array(n.length))}function Ia(n){return n!==null&&n>=0}function W1(n,r){if(n===r)return!0;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==r[s])return!1;return!0}function H1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Ig=n=>{let{rects:r,activeIndex:s,overIndex:o,index:a}=n;const u=Ag(r,o,s),f=r[a],h=u[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}},Da={scaleX:1,scaleY:1},zh=n=>{var r;let{activeIndex:s,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(r=u[s])!=null?r:o;if(!h)return null;if(a===s){const m=u[f];return m?{x:0,y:s<f?m.top+m.height-(h.top+h.height):m.top-h.top,...Da}:null}const g=V1(u,a,s);return a>s&&a<=f?{x:0,y:-h.height-g,...Da}:a<s&&a>=f?{x:0,y:h.height+g,...Da}:{x:0,y:0,...Da}};function V1(n,r,s){const o=n[r],a=n[r-1],u=n[r+1];return o?s<r?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const Dg="Sortable",Mg=st.createContext({activeIndex:-1,containerId:Dg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ig,disabled:{draggable:!1,droppable:!1}});function $h(n){let{children:r,id:s,items:o,strategy:a=Ig,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:g,over:m,measureDroppableContainers:v}=jg(),k=To(Dg,s),x=h.rect!==null,b=w.useMemo(()=>o.map(Y=>typeof Y=="object"&&"id"in Y?Y.id:Y),[o]),E=f!=null,C=f?b.indexOf(f.id):-1,T=m?b.indexOf(m.id):-1,I=w.useRef(b),A=!W1(b,I.current),B=T!==-1&&C===-1||A,$=H1(u);fr(()=>{A&&E&&v(b)},[A,b,E,v]),w.useEffect(()=>{I.current=b},[b]);const W=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:$,disableTransforms:B,items:b,overIndex:T,useDragOverlay:x,sortedRects:B1(b,g),strategy:a}),[C,k,$.draggable,$.droppable,B,b,T,g,x,a]);return st.createElement(Mg.Provider,{value:W},r)}const q1=n=>{let{id:r,items:s,activeIndex:o,overIndex:a}=n;return Ag(s,o,a).indexOf(r)},G1=n=>{let{containerId:r,isSorting:s,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:g,transition:m}=n;return!m||!o||h!==u&&a===f?!1:s?!0:f!==a&&r===g},K1={duration:200,easing:"ease"},Lg="transform",Y1=Pr.Transition.toString({property:Lg,duration:0,easing:"linear"}),X1={roleDescription:"sortable"};function Q1(n){let{disabled:r,index:s,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(s);return fr(()=>{if(!r&&s!==h.current&&o.current){const g=a.current;if(g){const m=wi(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&f(v)}}s!==h.current&&(h.current=s)},[r,s,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function Pg(n){let{animateLayoutChanges:r=G1,attributes:s,disabled:o,data:a,getNewIndex:u=q1,id:f,strategy:h,resizeObserverConfig:g,transition:m=K1}=n;const{items:v,containerId:k,activeIndex:x,disabled:b,disableTransforms:E,sortedRects:C,overIndex:T,useDragOverlay:I,strategy:A}=w.useContext(Mg),B=Z1(o,b),$=v.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:$,items:v},...a}),[k,a,$,v]),Y=w.useMemo(()=>v.slice(v.indexOf(f)),[v,f]),{rect:G,node:K,isOver:ue,setNodeRef:ge}=Rg({id:f,data:W,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:Y,...g}}),{active:de,activatorEvent:pe,activeNodeRect:ve,attributes:Me,setNodeRef:ee,listeners:re,isDragging:ae,over:z,setActivatorNodeRef:X,transform:V}=C1({id:f,data:W,attributes:{...X1,...s},disabled:B.draggable}),j=lw(ge,ee),M=!!de,ce=M&&!E&&Ia(x)&&Ia(T),q=!I&&ae,le=q&&ce?V:null,Pe=ce?le??(h??A)({rects:C,activeNodeRect:ve,activeIndex:x,overIndex:T,index:$}):null,Ce=Ia(x)&&Ia(T)?u({id:f,items:v,activeIndex:x,overIndex:T}):$,je=de==null?void 0:de.id,_e=w.useRef({activeId:je,items:v,newIndex:Ce,containerId:k}),it=v!==_e.current.items,Ee=r({active:de,containerId:k,isDragging:ae,isSorting:M,id:f,index:$,items:v,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:m,wasDragging:_e.current.activeId!=null}),kt=Q1({disabled:!Ee,index:$,node:K,rect:G});return w.useEffect(()=>{M&&_e.current.newIndex!==Ce&&(_e.current.newIndex=Ce),k!==_e.current.containerId&&(_e.current.containerId=k),v!==_e.current.items&&(_e.current.items=v)},[M,Ce,k,v]),w.useEffect(()=>{if(je===_e.current.activeId)return;if(je!=null&&_e.current.activeId==null){_e.current.activeId=je;return}const It=setTimeout(()=>{_e.current.activeId=je},50);return()=>clearTimeout(It)},[je]),{active:de,activeIndex:x,attributes:Me,data:W,rect:G,index:$,newIndex:Ce,items:v,isOver:ue,isSorting:M,isDragging:ae,listeners:re,node:K,overIndex:T,over:z,setNodeRef:j,setActivatorNodeRef:X,setDroppableNodeRef:ge,setDraggableNodeRef:ee,transform:kt??Pe,transition:$e()};function $e(){if(kt||it&&_e.current.newIndex===$)return Y1;if(!(q&&!xl(pe)||!m)&&(M||Ee))return Pr.Transition.toString({...m,property:Lg})}}function Z1(n,r){var s,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(s=n==null?void 0:n.draggable)!=null?s:r.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:r.droppable}}et.Down,et.Right,et.Up,et.Left;function Ma(n){const[r,s]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{s(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[r,o]}function J1(n,r=!1){const[s,o]=w.useState(()=>{try{const u=localStorage.getItem(n);return u==="1"?!0:u==="0"?!1:r}catch{return r}}),a=w.useCallback(u=>{o(u);try{localStorage.setItem(n,u?"1":"0")}catch{}},[n]);return[s,a]}async function Lu(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 s=document.execCommand("copy");return document.body.removeChild(r),s}catch{return!1}}}function ek(n){return n.origin_app_id!=null&&!n.user_touched&&!n.starred}function il(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Fh(n,r){if(!r||!n.cwd)return!1;const s=il(n.cwd),o=il(r);return s.startsWith(`${o}/`)}function tk(n,r){const s=new Map;for(const f of r){const h=f.cwd||"(no directory)",g=s.get(h)??[];g.push(f),s.set(h,g)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:s.get(f.path)??[],workspace:f})}for(const[f,h]of s)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function ol(n){return[...n].sort((r,s)=>s.sort_order-r.sort_order||(r.created_at<s.created_at?1:-1))}function Uh(n,r,s,o){const a=r.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&s.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function Bh(n,r){return{working:ol(n.sessions.filter(s=>s.lifecycle!=="finished")),finished:ol(n.sessions.filter(s=>s.lifecycle==="finished")),finishedCollapsed:r.has(n.finishedKey)}}function La(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function nk(n){const r=new Set(n.map(o=>o.name));if(!r.has("New Folder"))return"New Folder";let s=2;for(;r.has(`New Folder ${s}`);)s++;return`New Folder ${s}`}function Wh({id:n,children:r,className:s}){const{setNodeRef:o,isOver:a}=Rg({id:n});return c.jsx("div",{ref:o,className:`${s??""}${a?" drop-over":""}`,children:r})}function fd({inputRef:n,value:r,onChange:s,onConfirm:o,onCancel:a}){return c.jsx("input",{ref:n,className:"tree-rename-input",value:r,onChange:u=>s(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function rk({s:n,backgroundTaskCount:r,isActive:s,isSelected:o,appIcon:a,renaming:u,renameValue:f,renameRef:h,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:x,onToggleStar:b}){const{attributes:E,listeners:C,setNodeRef:T,transform:I,transition:A,isDragging:B}=Pg({id:`s:${n.id}`}),$=hl(n,r);return c.jsxs("div",{ref:T,style:{transform:Pr.Transform.toString(I),transition:A},className:`tree-item ${s?"active":""}${o?" selected":""} ${$.isFinished?"tree-item-finished":""}${B?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,...C,onClick:k,onContextMenu:x,children:[c.jsx(rd,{iconClass:$.iconClass,iconText:$.iconText,size:16}),a&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a}),u?c.jsx(fd,{inputRef:h,value:f,onChange:g,onConfirm:m,onCancel:v}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!u&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:W=>{W.stopPropagation(),b()},onPointerDown:W=>W.stopPropagation(),children:c.jsx(Za,{size:10,fill:n.starred?"currentColor":"none"})}),$.dot&&c.jsx(nd,{status:$.dot,title:$.dotTitle})]})}function sk({folder:n,count:r,collapsed:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:x,listeners:b,setNodeRef:E,transform:C,transition:T,isDragging:I,over:A}=Pg({id:`f:${n.id}`}),B=A!=null&&String(A.id).startsWith("s:");return c.jsxs("div",{ref:E,style:{transform:Pr.Transform.toString(C),transition:T},className:`tree-folder ${s?"collapsed":""}${I?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${B?" drop-over":""}`,...x,...b,onClick:()=>{o||m()},onContextMenu:v,children:o?c.jsx(fd,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:g}):c.jsxs(c.Fragment,{children:[c.jsx(mi,{size:8,className:"tree-chevron"}),c.jsx(Au,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:r})]})}),!s&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function ik(){const n=L(_=>_.sessions),r=L(_=>_.backgroundTasks),s=L(_=>_.workspaces),o=L(_=>_.folders),a=L(_=>_.activeSessionId),u=L(_=>_.selectSession),f=L(_=>_.deleteSession),h=L(_=>_.removeWorkspace),g=L(_=>_.createSessionInWorkspace),m=L(_=>_.pickAndAddWorkspace),v=L(_=>_.renameSession),k=L(_=>_.markFinished),x=L(_=>_.markFinishedMany),b=L(_=>_.toggleStar),E=L(_=>_.reopenSession),C=L(_=>_.reopenSessionMany),T=L(_=>_.deleteSessionMany),I=L(_=>_.createSidebarFolder),A=L(_=>_.renameFolder),B=L(_=>_.deleteFolder),$=L(_=>_.applyMoves),W=L(_=>_.reorderFolders),Y=L(_=>_.apps),G=L(_=>_.appsRootPath),K=L(_=>_.activeAppTabId),ue=L(_=>_.openAppTab),ge=L(_=>_.startAppEdit),de=L(_=>_.toggleAppPin),pe=L(_=>_.deleteApp),ve=L(_=>_.openAppCatalog),[Me,ee]=Ma("agentpane:sidebar-ws-collapsed"),[re,ae]=Ma("agentpane:sidebar-sub-collapsed"),[z,X]=Ma("agentpane:sidebar-folders-collapsed"),[V,j]=Ma("agentpane:sidebar-app-edits-collapsed"),[M,ce]=J1("agentpane:sidebar-hide-auto-sessions"),[q,le]=w.useState(null),[fe,Pe]=w.useState(null),[Ce,je]=w.useState(""),[_e,it]=w.useState(null),[Ee,kt]=w.useState(new Set),[$e,It]=w.useState(null),Fe=w.useRef(null),Dt=w.useRef(null),_n=w.useRef(null),St=w.useRef(!1),Mt=bw(Sw(ud,{activationConstraint:{distance:5}}));function pt(){kt(new Set),It(null)}ml(Fe,()=>le(null),!!q),td(()=>{le(null),pt()},!!q||Ee.size>0),w.useLayoutEffect(()=>{const _=Fe.current;if(!q||!_)return;const se=8,{offsetWidth:ne,offsetHeight:ye}=_,ze=q.x+ne>window.innerWidth-se?Math.max(se,q.x-ne):q.x,Be=q.y+ye>window.innerHeight-se?Math.max(se,q.y-ye):q.y;_.style.left=`${ze}px`,_.style.top=`${Be}px`},[q]);const en=w.useMemo(()=>new Map(n.map(_=>[_.id,_])),[n]),H=w.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),he=w.useMemo(()=>{const _=new Map;for(const se of[...o].sort((ne,ye)=>ne.sort_order-ye.sort_order)){const ne=_.get(se.workspace_path)??[];ne.push(se),_.set(se.workspace_path,ne)}return _},[o]);function Ue(_){ee(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}function tt(_){ae(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}function ht(_){X(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}function mt(){ce(!M),pt()}function Rt(_){j(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}w.useEffect(()=>{fe&&Dt.current&&(Dt.current.focus(),Dt.current.select())},[fe]),w.useEffect(()=>{var _,se,ne;St.current||!a||(St.current=!0,(ne=(se=(_=_n.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:se.scrollIntoView)==null||ne.call(se,{block:"nearest"}))},[a]);function Ht(_,se,ne,ye=""){Pe({kind:_,id:se}),je(ne||ye)}function ut(){if(fe){const _=Ce.trim();_&&(fe.kind==="session"?v(fe.id,_):A(fe.id,_))}Pe(null)}function jn(){Pe(null),je("")}async function Wn(_){const se=nk(he.get(_)??[]),ne=await I(_,se);ne&&Ht("folder",ne.id,ne.name)}function br(_){const se=String(_.active.id);if(se.startsWith("s:")){const ne=en.get(se.slice(2));ne&&it({kind:"session",label:ne.title||ne.id.slice(0,8)})}else if(se.startsWith("f:")){const ne=H.get(se.slice(2));ne&&it({kind:"folder",label:ne.name})}}function hr(_){it(null);const{active:se,over:ne}=_;if(!ne)return;const ye=String(se.id),ze=String(ne.id);if(ye.startsWith("s:")){const Be=en.get(ye.slice(2));if(!Be)return;const De=Be.cwd||"(no directory)",at=La(Be,H);let In,Dn;if(ze.startsWith("f:")){const Xe=H.get(ze.slice(2));if(!Xe)return;In=Xe.workspace_path,Dn=Xe.id}else if(ze.startsWith("s:")){const Xe=en.get(ze.slice(2));if(!Xe)return;In=Xe.cwd||"(no directory)",Dn=La(Xe,H)}else if(ze.startsWith("c:")){const Xe=ze.slice(2),Tt=Xe.lastIndexOf("|");In=Xe.slice(0,Tt);const tr=Xe.slice(Tt+1);Dn=tr==="root"?null:tr}else return;if(In!==De)return;const He=ol(n.filter(Xe=>(Xe.cwd||"(no directory)")===In&&La(Xe,H)===Dn)),wn=He.filter(Xe=>Xe.id!==Be.id);let Or=wn.length;if(ze.startsWith("s:")){const Xe=wn.findIndex(Tt=>Tt.id===ze.slice(2));Xe>=0&&(Or=Xe)}const Jn=[...wn.slice(0,Or),Be,...wn.slice(Or)],er=[];if(Dn===at){if(Jn.length===He.length&&Jn.every((Xe,Tt)=>Xe.id===He[Tt].id))return;Jn.forEach((Xe,Tt)=>er.push({id:Xe.id,folder_id:Dn,sort_order:Jn.length-1-Tt}))}else{const Xe=ol(n.filter(Tt=>(Tt.cwd||"(no directory)")===De&&La(Tt,H)===at)).filter(Tt=>Tt.id!==Be.id);Xe.forEach((Tt,tr)=>er.push({id:Tt.id,folder_id:at,sort_order:Xe.length-1-tr})),Jn.forEach((Tt,tr)=>er.push({id:Tt.id,folder_id:Dn,sort_order:Jn.length-1-tr}))}$(er);return}if(ye.startsWith("f:")){if(!ze.startsWith("f:"))return;const Be=H.get(ye.slice(2)),De=H.get(ze.slice(2));if(!Be||!De||Be.id===De.id||Be.workspace_path!==De.workspace_path)return;const at=(he.get(Be.workspace_path)??[]).map(He=>He.id),In=at.indexOf(Be.id),Dn=at.indexOf(De.id);at.splice(Dn,0,...at.splice(In,1)),W(at)}}const Rn=G?n.filter(_=>!Fh(_,G)):n,An=new Set(M?Rn.filter(_=>ek(_)&&_.id!==a).map(_=>_.id):[]),dn=tk(s,An.size>0?Rn.filter(_=>!An.has(_.id)):Rn),xn=w.useMemo(()=>{const _=new Map;if(!G)return _;const se=il(G);for(const ne of n){if(!Fh(ne,G))continue;const ye=il(ne.cwd).slice(se.length+1).split("/")[0],ze=_.get(ye)??[];ze.push(ne),_.set(ye,ze)}return _},[n,G]);function Ft(_){return{folder:null,sessions:xn.get(_)??[],finishedKey:`app:${_}:finished`,hidden:V.has(_)}}const Vt=[],rt=_=>{if(_.hidden)return;const{working:se,finished:ne,finishedCollapsed:ye}=Bh(_,re);Vt.push(...se.map(ze=>ze.id)),ye||Vt.push(...ne.map(ze=>ze.id))};for(const _ of dn){if(Me.has(_.path))continue;const se=he.get(_.path)??[],ne=new Set(se.map(ye=>ye.id));Uh(_,se,ne,z).forEach(rt)}Y.forEach(_=>rt(Ft(_.id)));const gt=n.filter(_=>Ee.has(_.id)),vt=gt.filter(_=>_.lifecycle!=="finished").map(_=>_.id),qt=gt.filter(_=>_.lifecycle==="finished").map(_=>_.id);function bt(_,se){if(se.metaKey||se.ctrlKey){se.preventDefault(),It(_.id),kt(ne=>{const ye=new Set(ne);return ye.has(_.id)?ye.delete(_.id):ye.add(_.id),ye});return}if(se.shiftKey){se.preventDefault();const ne=$e??_.id;It(ne);const ye=Vt.indexOf(ne),ze=Vt.indexOf(_.id);if(ye>=0&&ze>=0){const[Be,De]=ye<ze?[ye,ze]:[ze,ye];kt(new Set(Vt.slice(Be,De+1)))}return}pt(),It(_.id),u(_.id)}function yt(_,se){se.preventDefault();const ne=Ee.has(_.id)&&Ee.size>1;Ee.has(_.id)||(kt(new Set),It(_.id)),le({x:se.clientX,y:se.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:ne})}function ot(_){var ne;const se=_.origin_app_id?Y.find(ye=>ye.id===_.origin_app_id):null;return c.jsx(rk,{s:_,backgroundTaskCount:((ne=r[_.id])==null?void 0:ne.length)??0,isActive:a===_.id,isSelected:Ee.has(_.id),appIcon:se?se.icon??"◧":null,renaming:(fe==null?void 0:fe.kind)==="session"&&fe.id===_.id,renameValue:Ce,renameRef:Dt,onRenameValue:je,onRenameConfirm:ut,onRenameCancel:jn,onSelect:ye=>bt(_,ye),onToggleStar:()=>b(_.id),onCtxMenu:ye=>yt(_,ye)},_.id)}function Gt(_){var ne;const se=hl(_,((ne=r[_.id])==null?void 0:ne.length)??0);return c.jsxs("div",{className:`sidebar-app-edit-row${a===_.id?" active":""}${Ee.has(_.id)?" selected":""}${se.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ye=>bt(_,ye),onContextMenu:ye=>yt(_,ye),children:[c.jsx(rd,{iconClass:se.iconClass,iconText:se.iconText,size:14}),(fe==null?void 0:fe.kind)==="session"&&fe.id===_.id?c.jsx(fd,{inputRef:Dt,value:Ce,onChange:je,onConfirm:ut,onCancel:jn}):c.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),se.dot&&c.jsx(nd,{status:se.dot,title:se.dotTitle})]},_.id)}function Je(_,se="workspace"){const{working:ne,finished:ye,finishedCollapsed:ze}=Bh(_,re),Be=se==="workspace"?ot:Gt,De=c.jsxs(c.Fragment,{children:[ne.length===0&&ye.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):ne.map(Be),ye.length>0&&c.jsxs("div",{className:`tree-subgroup ${ze?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>tt(_.finishedKey),children:[c.jsx(mi,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ye.length})]}),!ze&&c.jsx("div",{className:"tree-subgroup-items",children:ye.map(Be)})]})]});if(se==="app")return De;const at=[...ne,...ye].map(In=>`s:${In.id}`);return c.jsx($h,{items:at,strategy:zh,children:De})}return c.jsxs("div",{className:"ide-sidebar",ref:_n,children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsxs("div",{className:"sidebar-header-actions",children:[c.jsx("button",{className:`sidebar-add sidebar-filter${M?" active":""}`,title:M?`Show automatic sessions (${An.size} hidden)`:"Hide automatic sessions — the ones mini apps run on their own. Sessions you message, stop, rewind, rename or star stay visible.","aria-label":M?"Show automatic sessions":"Hide automatic sessions","aria-pressed":M,onClick:mt,children:M?c.jsx(E0,{size:14}):c.jsx(ls,{size:14})}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:c.jsx(Rs,{size:14})})]})]}),c.jsxs(b1,{sensors:Mt,collisionDetection:jw,onDragStart:br,onDragEnd:hr,children:[dn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):dn.map(_=>{const se=Me.has(_.path),ne=he.get(_.path)??[],ye=new Set(ne.map(De=>De.id)),ze=Uh(_,ne,ye,z),Be=ze[ze.length-1];return c.jsxs("div",{className:`tree-section ${se?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>Ue(_.path),onContextMenu:De=>{De.preventDefault(),le({x:De.clientX,y:De.clientY,type:"workspace",path:_.path})},children:[c.jsx(mi,{size:9,className:"tree-chevron"}),c.jsx(Au,{size:14}),c.jsx("span",{className:"tree-section-label",children:_.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:De=>{De.stopPropagation(),g(_.path)},children:c.jsx(Rs,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:De=>{De.stopPropagation(),Wn(_.path)},children:c.jsx(pu,{size:11})}),c.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!se&&c.jsxs("div",{className:"tree-children",children:[c.jsx($h,{items:ne.map(De=>`f:${De.id}`),strategy:zh,children:ze.filter(De=>De.folder).map(De=>c.jsx(sk,{folder:De.folder,count:De.sessions.length,collapsed:De.hidden,renaming:(fe==null?void 0:fe.kind)==="folder"&&fe.id===De.folder.id,renameValue:Ce,renameRef:Dt,onRenameValue:je,onRenameConfirm:ut,onRenameCancel:jn,onToggle:()=>ht(De.folder.id),onCtxMenu:at=>{at.preventDefault(),le({x:at.clientX,y:at.clientY,type:"folder",folderId:De.folder.id,folderName:De.folder.name})},children:c.jsx(Wh,{id:`c:${_.path}|${De.folder.id}`,children:Je(De)})},De.folder.id))}),c.jsx(Wh,{id:`c:${_.path}|root`,children:Je(Be)})]})]},_.path)}),c.jsx(U1,{children:_e&&c.jsxs("div",{className:"drag-overlay",children:[_e.kind==="folder"&&c.jsx(Au,{size:12}),c.jsx("span",{children:_e.label})]})})]}),c.jsxs("div",{className:"sidebar-apps",children:[c.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Apps"}),c.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>ve(),children:c.jsx(Rs,{size:14})})]}),Y.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),Y.map(_=>{const se=Ft(_.id),ne=se.sessions.length>0&&!se.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${K===_.id?" active":""}`,title:_.description??void 0,onClick:()=>ue(_.id),onContextMenu:ye=>{ye.preventDefault(),le({x:ye.clientX,y:ye.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[se.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${ne?"":" closed"}`,title:"Edit sessions of this app",onClick:ye=>{ye.stopPropagation(),Rt(_.id)},children:c.jsx(mi,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:_.icon??"◧"}),c.jsx("span",{className:"tree-label",children:_.title}),se.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:se.sessions.length}),_.pinned&&c.jsx(Za,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ne&&c.jsx("div",{className:"sidebar-app-edits",children:Je(se,"app")})]},_.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(pu,{size:14}),c.jsx("span",{children:"Add workspace"})]}),q&&c.jsxs("div",{ref:Fe,className:"ctx-menu",style:{position:"fixed",left:q.x,top:q.y,zIndex:500},children:[q.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(q.path),le(null)},children:[c.jsx(Rs,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Wn(q.path),le(null)},children:[c.jsx(pu,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{h(q.path),le(null)},children:[c.jsx(ur,{size:12})," Hide Workspace"]})]}),q.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("folder",q.folderId,q.folderName??""),le(null)},children:[c.jsx(Ua,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{B(q.folderId),le(null)},children:[c.jsx(ur,{size:12})," Delete Folder"]})]}),q.type==="session"&&!q.multi&&c.jsx(c.Fragment,{children:q.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("session",q.sessionId,q.sessionTitle??""),le(null)},children:[c.jsx(Ua,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(q.sessionId),le(null)},children:[c.jsx(Qa,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${q.sessionExternalId?"":" ctx-disabled"}`,title:q.sessionExternalId?void 0:"Session not started",onClick:()=>{q.sessionExternalId&&(Lu(q.sessionExternalId),le(null))},children:[c.jsx(Ru,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(q.sessionId),le(null)},children:[c.jsx(ur,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(q.sessionId),le(null)},children:[c.jsx(vo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${q.sessionExternalId?"":" ctx-disabled"}`,title:q.sessionExternalId?void 0:"Session not started",onClick:()=>{q.sessionExternalId&&(Lu(q.sessionExternalId),le(null))},children:[c.jsx(Ru,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(q.sessionId),le(null)},children:[c.jsx(ur,{size:12})," Delete Session"]})]})}),q.type==="session"&&q.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[gt.length," sessions selected"]}),vt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(vt),le(null),pt()},children:[c.jsx(Qa,{size:12})," Mark ",vt.length," as Finished"]}),qt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{C(qt),le(null),pt()},children:[c.jsx(vo,{size:12})," Reopen ",qt.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{T([...Ee]),le(null),pt()},children:[c.jsx(ur,{size:12})," Delete ",gt.length," Sessions"]})]}),q.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ge(q.appId),le(null)},children:[c.jsx(Ua,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{de(q.appId),le(null)},children:[c.jsx(Za,{size:12})," ",q.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{pe(q.appId),le(null)},children:[c.jsx(ur,{size:12})," Delete App"]})]})]})]})}function ok(){const n=L(b=>b.openTabs),r=L(b=>b.activeSessionId),s=L(b=>b.sessions),o=L(b=>b.backgroundTasks),a=L(b=>b.selectSession),u=L(b=>b.closeTab),f=L(b=>b.setShowNewSessionDialog),h=L(b=>b.apps),g=L(b=>b.openAppTabs),m=L(b=>b.activeAppTabId),v=L(b=>b.openAppTab),k=L(b=>b.closeAppTab),x=L(b=>b.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(b=>{var I;const E=s.find(A=>A.id===b);if(!E)return null;const C=hl(E,((I=o[b])==null?void 0:I.length)??0),T=r===b&&m==null;return c.jsxs("div",{className:`ide-tab ${T?"active":""}`,onClick:()=>{m!=null&&x(null),a(b)},children:[c.jsx(rd,{iconClass:C.iconClass,iconText:C.iconText,size:14}),E.title||b.slice(0,8),C.dot&&c.jsx(nd,{status:C.dot,title:C.dotTitle}),c.jsx("span",{className:"ide-tab-close",onClick:A=>{A.stopPropagation(),u(b)},children:c.jsx(Bn,{size:12})})]},b)}),g.map(b=>{const E=h.find(T=>T.id===b),C=m===b;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>v(b),children:[E!=null&&E.icon?c.jsx("span",{className:"miniapp-tab-icon",children:E.icon}):c.jsx(rg,{size:12}),(E==null?void 0:E.title)??b,c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),k(b)},children:c.jsx(Bn,{size:12})})]},b)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:c.jsx(Rs,{size:14})})]})}function pd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ms=pd();function Og(n){Ms=n}var po={exec:()=>null};function nt(n,r=""){let s=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(gn.caret,"$1"),s=s.replace(a,f),o},getRegex:()=>new RegExp(s,r)};return o}var gn={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")},ak=/^(?:[ \t]*(?:\n|$))+/,lk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ck=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Co=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,uk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hd=/(?:[*+-]|\d{1,9}[.)])/,zg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$g=nt(zg).replace(/bull/g,hd).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(),dk=nt(zg).replace(/bull/g,hd).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(),md=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,fk=/^[^\n]+/,gd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pk=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hk=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hd).getRegex(),Sl="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",vd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,mk=nt("^ {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",vd).replace("tag",Sl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fg=nt(md).replace("hr",Co).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",Sl).getRegex(),gk=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fg).getRegex(),yd={blockquote:gk,code:lk,def:pk,fences:ck,heading:uk,hr:Co,html:mk,lheading:$g,list:hk,newline:ak,paragraph:Fg,table:po,text:fk},Hh=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Co).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",Sl).getRegex(),vk={...yd,lheading:dk,table:Hh,paragraph:nt(md).replace("hr",Co).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Hh).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",Sl).getRegex()},yk={...yd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vd).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:po,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(md).replace("hr",Co).replace("heading",` *#{1,6} *[^
|
|
399
|
-
]`).replace("lheading"
|
|
403
|
+
`},jw={onDragStart(n){let{active:r}=n;return"Picked up draggable item "+r.id+"."},onDragOver(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was moved over droppable area "+s.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was dropped over droppable area "+s.id:"Draggable item "+r.id+" was dropped."},onDragCancel(n){let{active:r}=n;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function Rw(n){let{announcements:r=jw,container:s,hiddenTextDescribedById:o,screenReaderInstructions:a=_w}=n;const{announce:u,announcement:f}=Nw(),h=To("DndLiveRegion"),[g,m]=w.useState(!1);if(w.useEffect(()=>{m(!0)},[]),Cw(w.useMemo(()=>({onDragStart(k){let{active:x}=k;u(r.onDragStart({active:x}))},onDragMove(k){let{active:x,over:b}=k;r.onDragMove&&u(r.onDragMove({active:x,over:b}))},onDragOver(k){let{active:x,over:b}=k;u(r.onDragOver({active:x,over:b}))},onDragEnd(k){let{active:x,over:b}=k;u(r.onDragEnd({active:x,over:b}))},onDragCancel(k){let{active:x,over:b}=k;u(r.onDragCancel({active:x,over:b}))}}),[u,r])),!g)return null;const v=st.createElement(st.Fragment,null,st.createElement(bw,{id:o,value:a.draggable}),st.createElement(Tw,{id:h,announcement:f}));return s?oo.createPortal(v,s):v}var Wt;(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"})(Wt||(Wt={}));function rl(){}function Aw(n,r){return w.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function Iw(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>[...r].filter(o=>o!=null),[...r])}const pr=Object.freeze({x:0,y:0});function Dw(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function Mw(n,r){const s=nl(n);if(!s)return"0 0";const o={x:(s.x-r.left)/r.width*100,y:(s.y-r.top)/r.height*100};return o.x+"% "+o.y+"%"}function Lw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return s-o}function Pw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return o-s}function Ow(n,r){if(!n||n.length===0)return null;const[s]=n;return s[r]}function Ch(n,r,s){return r===void 0&&(r=n.left),s===void 0&&(s=n.top),{x:r+n.width*.5,y:s+n.height*.5}}const zw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=Ch(r,r.left,r.top),u=[];for(const f of o){const{id:h}=f,g=s.get(h);if(g){const m=Dw(Ch(g),a);u.push({id:h,data:{droppableContainer:f,value:m}})}}return u.sort(Lw)};function $w(n,r){const s=Math.max(r.top,n.top),o=Math.max(r.left,n.left),a=Math.min(r.left+r.width,n.left+n.width),u=Math.min(r.top+r.height,n.top+n.height),f=a-o,h=u-s;if(o<a&&s<u){const g=r.width*r.height,m=n.width*n.height,v=f*h,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const Fw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=s.get(f);if(h){const g=$w(h,r);g>0&&a.push({id:f,data:{droppableContainer:u,value:g}})}}return a.sort(Pw)};function Uw(n,r,s){return{...n,scaleX:r&&s?r.width/s.width:1,scaleY:r&&s?r.height/s.height:1}}function hg(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:pr}function Bw(n){return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];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}),{...s})}}const Ww=Bw(1);function mg(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 Hw(n,r,s){const o=mg(r);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,g=n.left-f-(1-a)*parseFloat(s),m=n.top-h-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),v=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const Vw={ignoreTransform:!1};function wi(n,r){r===void 0&&(r=Vw);let s=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:m,transformOrigin:v}=yn(n).getComputedStyle(n);m&&(s=Hw(s,m,v))}const{top:o,left:a,width:u,height:f,bottom:h,right:g}=s;return{top:o,left:a,width:u,height:f,bottom:h,right:g}}function Eh(n){return wi(n,{ignoreTransform:!0})}function qw(n){const r=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}function Gw(n,r){return r===void 0&&(r=yn(n).getComputedStyle(n)),r.position==="fixed"}function Kw(n,r){r===void 0&&(r=yn(n).getComputedStyle(n));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=r[a];return typeof u=="string"?s.test(u):!1})}function ad(n,r){const s=[];function o(a){if(r!=null&&s.length>=r||!a)return s;if(od(a)&&a.scrollingElement!=null&&!s.includes(a.scrollingElement))return s.push(a.scrollingElement),s;if(!So(a)||dg(a)||s.includes(a))return s;const u=yn(n).getComputedStyle(a);return a!==n&&Kw(a,u)&&s.push(a),Gw(a,u)?s:o(a.parentNode)}return n?o(n):s}function gg(n){const[r]=ad(n,1);return r??null}function mu(n){return!vl||!n?null:yi(n)?n:id(n)?od(n)||n===xi(n).scrollingElement?window:So(n)?n:null:null}function vg(n){return yi(n)?n.scrollX:n.scrollLeft}function yg(n){return yi(n)?n.scrollY:n.scrollTop}function Iu(n){return{x:vg(n),y:yg(n)}}var Jt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Jt||(Jt={}));function xg(n){return!vl||!n?!1:n===document.scrollingElement}function wg(n){const r={x:0,y:0},s=xg(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-s.width,y:n.scrollHeight-s.height},a=n.scrollTop<=r.y,u=n.scrollLeft<=r.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:r}}const Yw={x:.2,y:.2};function Xw(n,r,s,o,a){let{top:u,left:f,right:h,bottom:g}=s;o===void 0&&(o=10),a===void 0&&(a=Yw);const{isTop:m,isBottom:v,isLeft:k,isRight:x}=wg(n),b={x:0,y:0},E={x:0,y:0},C={height:r.height*a.y,width:r.width*a.x};return!m&&u<=r.top+C.height?(b.y=Jt.Backward,E.y=o*Math.abs((r.top+C.height-u)/C.height)):!v&&g>=r.bottom-C.height&&(b.y=Jt.Forward,E.y=o*Math.abs((r.bottom-C.height-g)/C.height)),!x&&h>=r.right-C.width?(b.x=Jt.Forward,E.x=o*Math.abs((r.right-C.width-h)/C.width)):!k&&f<=r.left+C.width&&(b.x=Jt.Backward,E.x=o*Math.abs((r.left+C.width-f)/C.width)),{direction:b,speed:E}}function Qw(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:r,left:s,right:o,bottom:a}=n.getBoundingClientRect();return{top:r,left:s,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function kg(n){return n.reduce((r,s)=>gi(r,Iu(s)),pr)}function Zw(n){return n.reduce((r,s)=>r+vg(s),0)}function Jw(n){return n.reduce((r,s)=>r+yg(s),0)}function Sg(n,r){if(r===void 0&&(r=wi),!n)return;const{top:s,left:o,bottom:a,right:u}=r(n);gg(n)&&(a<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const e1=[["x",["left","right"],Zw],["y",["top","bottom"],Jw]];class ld{constructor(r,s){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 o=ad(s),a=kg(o);this.rect={...r},this.width=r.width,this.height=r.height;for(const[u,f,h]of e1)for(const g of f)Object.defineProperty(this,g,{get:()=>{const m=h(o),v=a[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class co{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...s)})},this.target=r}add(r,s,o){var a;(a=this.target)==null||a.addEventListener(r,s,o),this.listeners.push([r,s,o])}}function t1(n){const{EventTarget:r}=yn(n);return n instanceof r?n:xi(n)}function gu(n,r){const s=Math.abs(n.x),o=Math.abs(n.y);return typeof r=="number"?Math.sqrt(s**2+o**2)>r:"x"in r&&"y"in r?s>r.x&&o>r.y:"x"in r?s>r.x:"y"in r?o>r.y:!1}var er;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(er||(er={}));function _h(n){n.preventDefault()}function n1(n){n.stopPropagation()}var et;(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"})(et||(et={}));const bg={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},r1=(n,r)=>{let{currentCoordinates:s}=r;switch(n.code){case et.Right:return{...s,x:s.x+25};case et.Left:return{...s,x:s.x-25};case et.Down:return{...s,y:s.y+25};case et.Up:return{...s,y:s.y-25}}};class Tg{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:s}}=r;this.props=r,this.listeners=new co(xi(s)),this.windowListeners=new co(yn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(er.Resize,this.handleCancel),this.windowListeners.add(er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:s}=this.props,o=r.node.current;o&&Sg(o),s(pr)}handleKeyDown(r){if(xl(r)){const{active:s,context:o,options:a}=this.props,{keyboardCodes:u=bg,coordinateGetter:f=r1,scrollBehavior:h="smooth"}=a,{code:g}=r;if(u.end.includes(g)){this.handleEnd(r);return}if(u.cancel.includes(g)){this.handleCancel(r);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=v);const k=f(r,{active:s,context:o.current,currentCoordinates:v});if(k){const x=tl(k,v),b={x:0,y:0},{scrollableAncestors:E}=o.current;for(const C of E){const T=r.code,{isTop:I,isRight:A,isLeft:B,isBottom:$,maxScroll:W,minScroll:Y}=wg(C),G=Qw(C),K={x:Math.min(T===et.Right?G.right-G.width/2:G.right,Math.max(T===et.Right?G.left:G.left+G.width/2,k.x)),y:Math.min(T===et.Down?G.bottom-G.height/2:G.bottom,Math.max(T===et.Down?G.top:G.top+G.height/2,k.y))},ue=T===et.Right&&!A||T===et.Left&&!B,ge=T===et.Down&&!$||T===et.Up&&!I;if(ue&&K.x!==k.x){const de=C.scrollLeft+x.x,pe=T===et.Right&&de<=W.x||T===et.Left&&de>=Y.x;if(pe&&!x.y){C.scrollTo({left:de,behavior:h});return}pe?b.x=C.scrollLeft-de:b.x=T===et.Right?C.scrollLeft-W.x:C.scrollLeft-Y.x,b.x&&C.scrollBy({left:-b.x,behavior:h});break}else if(ge&&K.y!==k.y){const de=C.scrollTop+x.y,pe=T===et.Down&&de<=W.y||T===et.Up&&de>=Y.y;if(pe&&!x.x){C.scrollTo({top:de,behavior:h});return}pe?b.y=C.scrollTop-de:b.y=T===et.Down?C.scrollTop-W.y:C.scrollTop-Y.y,b.y&&C.scrollBy({top:-b.y,behavior:h});break}}this.handleMove(r,gi(tl(k,this.referenceCoordinates),b))}}}handleMove(r,s){const{onMove:o}=this.props;r.preventDefault(),o(s)}handleEnd(r){const{onEnd:s}=this.props;r.preventDefault(),this.detach(),s()}handleCancel(r){const{onCancel:s}=this.props;r.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Tg.activators=[{eventName:"onKeyDown",handler:(n,r,s)=>{let{keyboardCodes:o=bg,onActivation:a}=r,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function jh(n){return!!(n&&"distance"in n)}function Rh(n){return!!(n&&"delay"in n)}class cd{constructor(r,s,o){var a;o===void 0&&(o=t1(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=s;const{event:u}=r,{target:f}=u;this.props=r,this.events=s,this.document=xi(f),this.documentListeners=new co(this.document),this.listeners=new co(o),this.windowListeners=new co(yn(f)),this.initialCoordinates=(a=nl(u))!=null?a:pr,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:s,bypassActivationConstraint:o}}}=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(er.Resize,this.handleCancel),this.windowListeners.add(er.DragStart,_h),this.windowListeners.add(er.VisibilityChange,this.handleCancel),this.windowListeners.add(er.ContextMenu,_h),this.documentListeners.add(er.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Rh(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(jh(s)){this.handlePending(s);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,s){const{active:o,onPending:a}=this.props;a(o,r,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:r}=this,{onStart:s}=this.props;r&&(this.activated=!0,this.documentListeners.add(er.Click,n1,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(er.SelectionChange,this.removeTextSelection),s(r))}handleMove(r){var s;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const g=(s=nl(r))!=null?s:pr,m=tl(a,g);if(!o&&h){if(jh(h)){if(h.tolerance!=null&&gu(m,h.tolerance))return this.handleCancel();if(gu(m,h.distance))return this.handleStart()}if(Rh(h)&&gu(m,h.tolerance))return this.handleCancel();this.handlePending(h,m);return}r.cancelable&&r.preventDefault(),f(g)}handleEnd(){const{onAbort:r,onEnd:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleCancel(){const{onAbort:r,onCancel:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleKeydown(r){r.code===et.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const s1={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ud extends cd{constructor(r){const{event:s}=r,o=xi(s.target);super(r,s1,o)}}ud.activators=[{eventName:"onPointerDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return!s.isPrimary||s.button!==0?!1:(o==null||o({event:s}),!0)}}];const i1={move:{name:"mousemove"},end:{name:"mouseup"}};var Du;(function(n){n[n.RightClick=2]="RightClick"})(Du||(Du={}));class o1 extends cd{constructor(r){super(r,i1,xi(r.event.target))}}o1.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return s.button===Du.RightClick?!1:(o==null||o({event:s}),!0)}}];const vu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class a1 extends cd{constructor(r){super(r,vu)}static setup(){return window.addEventListener(vu.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(vu.move.name,r)};function r(){}}}a1.activators=[{eventName:"onTouchStart",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;const{touches:a}=s;return a.length>1?!1:(o==null||o({event:s}),!0)}}];var uo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(uo||(uo={}));var sl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(sl||(sl={}));function l1(n){let{acceleration:r,activator:s=uo.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=sl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:x}=n;const b=u1({delta:k,disabled:!u}),[E,C]=yw(),T=w.useRef({x:0,y:0}),I=w.useRef({x:0,y:0}),A=w.useMemo(()=>{switch(s){case uo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case uo.DraggableRect:return a}},[s,a,g]),B=w.useRef(null),$=w.useCallback(()=>{const Y=B.current;if(!Y)return;const G=T.current.x*I.current.x,K=T.current.y*I.current.y;Y.scrollBy(G,K)},[]),W=w.useMemo(()=>h===sl.TreeOrder?[...m].reverse():m,[h,m]);w.useEffect(()=>{if(!u||!m.length||!A){C();return}for(const Y of W){if((o==null?void 0:o(Y))===!1)continue;const G=m.indexOf(Y),K=v[G];if(!K)continue;const{direction:ue,speed:ge}=Xw(Y,K,A,r,x);for(const de of["x","y"])b[de][ue[de]]||(ge[de]=0,ue[de]=0);if(ge.x>0||ge.y>0){C(),B.current=Y,E($,f),T.current=ge,I.current=ue;return}}T.current={x:0,y:0},I.current={x:0,y:0},C()},[r,$,o,C,u,f,JSON.stringify(A),JSON.stringify(b),E,m,W,v,JSON.stringify(x)])}const c1={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function u1(n){let{delta:r,disabled:s}=n;const o=el(r);return bo(a=>{if(s||!o||!a)return c1;const u={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Jt.Backward]:a.x[Jt.Backward]||u.x===-1,[Jt.Forward]:a.x[Jt.Forward]||u.x===1},y:{[Jt.Backward]:a.y[Jt.Backward]||u.y===-1,[Jt.Forward]:a.y[Jt.Forward]||u.y===1}}},[s,r,o])}function d1(n,r){const s=r!=null?n.get(r):void 0,o=s?s.node.current:null;return bo(a=>{var u;return r==null?null:(u=o??a)!=null?u:null},[o,r])}function f1(n,r){return w.useMemo(()=>n.reduce((s,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:r(f.handler,o)}));return[...s,...u]},[]),[n,r])}var xo;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(xo||(xo={}));var Mu;(function(n){n.Optimized="optimized"})(Mu||(Mu={}));const Ah=new Map;function p1(n,r){let{dragging:s,dependencies:o,config:a}=r;const[u,f]=w.useState(null),{frequency:h,measure:g,strategy:m}=a,v=w.useRef(n),k=T(),x=yo(k),b=w.useCallback(function(I){I===void 0&&(I=[]),!x.current&&f(A=>A===null?I:A.concat(I.filter(B=>!A.includes(B))))},[x]),E=w.useRef(null),C=bo(I=>{if(k&&!s)return Ah;if(!I||I===Ah||v.current!==n||u!=null){const A=new Map;for(let B of n){if(!B)continue;if(u&&u.length>0&&!u.includes(B.id)&&B.rect.current){A.set(B.id,B.rect.current);continue}const $=B.node.current,W=$?new ld(g($),$):null;B.rect.current=W,W&&A.set(B.id,W)}return A}return I},[n,u,s,k,g]);return w.useEffect(()=>{v.current=n},[n]),w.useEffect(()=>{k||b()},[s,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||E.current!==null||(E.current=setTimeout(()=>{b(),E.current=null},h))},[h,k,b,...o]),{droppableRects:C,measureDroppableContainers:b,measuringScheduled:u!=null};function T(){switch(m){case xo.Always:return!1;case xo.BeforeDragging:return s;default:return!s}}}function dd(n,r){return bo(s=>n?s||(typeof r=="function"?r(n):n):null,[r,n])}function h1(n,r){return dd(n,r)}function m1(n){let{callback:r,disabled:s}=n;const o=yl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function wl(n){let{callback:r,disabled:s}=n;const o=yl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function g1(n){return new ld(wi(n),n)}function Ih(n,r,s){r===void 0&&(r=g1);const[o,a]=w.useState(null);function u(){a(g=>{if(!n)return null;if(n.isConnected===!1){var m;return(m=g??s)!=null?m:null}const v=r(n);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const f=m1({callback(g){if(n)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=wl({callback:u});return fr(()=>{u(),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]),o}function v1(n){const r=dd(n);return hg(n,r)}const Dh=[];function y1(n){const r=w.useRef(n),s=bo(o=>n?o&&o!==Dh&&n&&r.current&&n.parentNode===r.current.parentNode?o:ad(n):Dh,[n]);return w.useEffect(()=>{r.current=n},[n]),s}function x1(n){const[r,s]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=mu(u.target);f&&s(h=>h?(h.set(f,Iu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(g=>{const m=mu(g);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,Iu(m)]):null}).filter(g=>g!=null);s(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(g=>{const m=mu(g);m==null||m.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?r?Array.from(r.values()).reduce((u,f)=>gi(u,f),pr):kg(n):pr,[n,r])}function Mh(n,r){r===void 0&&(r=[]);const s=w.useRef(null);return w.useEffect(()=>{s.current=null},r),w.useEffect(()=>{const o=n!==pr;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?tl(n,s.current):pr}function w1(n){w.useEffect(()=>{if(!vl)return;const r=n.map(s=>{let{sensor:o}=s;return o.setup==null?void 0:o.setup()});return()=>{for(const s of r)s==null||s()}},n.map(r=>{let{sensor:s}=r;return s}))}function k1(n,r){return w.useMemo(()=>n.reduce((s,o)=>{let{eventName:a,handler:u}=o;return s[a]=f=>{u(f,r)},s},{}),[n,r])}function Ng(n){return w.useMemo(()=>n?qw(n):null,[n])}const Lh=[];function S1(n,r){r===void 0&&(r=wi);const[s]=n,o=Ng(s?yn(s):null),[a,u]=w.useState(Lh);function f(){u(()=>n.length?n.map(g=>xg(g)?o:new ld(r(g),g)):Lh)}const h=wl({callback:f});return fr(()=>{h==null||h.disconnect(),f(),n.forEach(g=>h==null?void 0:h.observe(g))},[n]),a}function Cg(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return So(r)?r:n}function b1(n){let{measure:r}=n;const[s,o]=w.useState(null),a=w.useCallback(m=>{for(const{target:v}of m)if(So(v)){o(k=>{const x=r(v);return k?{...k,width:x.width,height:x.height}:x});break}},[r]),u=wl({callback:a}),f=w.useCallback(m=>{const v=Cg(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?r(v):null)},[r,u]),[h,g]=Ja(f);return w.useMemo(()=>({nodeRef:h,rect:s,setRef:g}),[s,h,g])}const T1=[{sensor:ud,options:{}},{sensor:Tg,options:{}}],N1={current:{}},Ba={draggable:{measure:Eh},droppable:{measure:Eh,strategy:xo.WhileDragging,frequency:Mu.Optimized},dragOverlay:{measure:wi}};class fo extends Map{get(r){var s;return r!=null&&(s=super.get(r))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:s}=r;return!s})}getNodeFor(r){var s,o;return(s=(o=this.get(r))==null?void 0:o.node.current)!=null?s:void 0}}const C1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ba,measureDroppableContainers:rl,windowRect:null,measuringScheduled:!1},Eg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rl,draggableNodes:new Map,over:null,measureDroppableContainers:rl},No=w.createContext(Eg),_g=w.createContext(C1);function E1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fo}}}function _1(n,r){switch(r.type){case Wt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Wt.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 Wt.DragEnd:case Wt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:s}=r,{id:o}=s,a=new fo(n.droppable.containers);return a.set(o,s),{...n,droppable:{...n.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:s,key:o,disabled:a}=r,u=n.droppable.containers.get(s);if(!u||o!==u.key)return n;const f=new fo(n.droppable.containers);return f.set(s,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Wt.UnregisterDroppable:{const{id:s,key:o}=r,a=n.droppable.containers.get(s);if(!a||o!==a.key)return n;const u=new fo(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function j1(n){let{disabled:r}=n;const{active:s,activatorEvent:o,draggableNodes:a}=w.useContext(No),u=el(o),f=el(s==null?void 0:s.id);return w.useEffect(()=>{if(!r&&!o&&u&&f!=null){if(!xl(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:g,node:m}=h;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=kw(v);if(k){k.focus();break}}})}},[o,r,a,f,u]),null}function jg(n,r){let{transform:s,...o}=r;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),s):s}function R1(n){return w.useMemo(()=>({draggable:{...Ba.draggable,...n==null?void 0:n.draggable},droppable:{...Ba.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Ba.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 A1(n){let{activeNode:r,measure:s,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;fr(()=>{if(!f&&!h||!r){u.current=!1;return}if(u.current||!o)return;const m=r==null?void 0:r.node.current;if(!m||m.isConnected===!1)return;const v=s(m),k=hg(v,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const x=gg(m);x&&x.scrollBy({top:k.y,left:k.x})}},[r,f,h,o,s])}const kl=w.createContext({...pr,scaleX:1,scaleY:1});var ss;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ss||(ss={}));const I1=w.memo(function(r){var s,o,a,u;let{id:f,accessibility:h,autoScroll:g=!0,children:m,sensors:v=T1,collisionDetection:k=Fw,measuring:x,modifiers:b,...E}=r;const C=w.useReducer(_1,void 0,E1),[T,I]=C,[A,B]=Ew(),[$,W]=w.useState(ss.Uninitialized),Y=$===ss.Initialized,{draggable:{active:G,nodes:K,translate:ue},droppable:{containers:ge}}=T,de=G!=null?K.get(G):null,pe=w.useRef({initial:null,translated:null}),ve=w.useMemo(()=>{var rt;return G!=null?{id:G,data:(rt=de==null?void 0:de.data)!=null?rt:N1,rect:pe}:null},[G,de]),Me=w.useRef(null),[ee,re]=w.useState(null),[ae,z]=w.useState(null),X=yo(E,Object.values(E)),V=To("DndDescribedBy",f),j=w.useMemo(()=>ge.getEnabled(),[ge]),L=R1(x),{droppableRects:ce,measureDroppableContainers:q,measuringScheduled:le}=p1(j,{dragging:Y,dependencies:[ue.x,ue.y],config:L.droppable}),fe=d1(K,G),Pe=w.useMemo(()=>ae?nl(ae):null,[ae]),Ce=Vt(),je=h1(fe,L.draggable.measure);A1({activeNode:G!=null?K.get(G):null,config:Ce.layoutShiftCompensation,initialRect:je,measure:L.draggable.measure});const _e=Ih(fe,L.draggable.measure,je),it=Ih(fe?fe.parentElement:null),Ee=w.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:K,draggingNode:null,draggingNodeRect:null,droppableContainers:ge,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=ge.getNodeFor((s=Ee.current.over)==null?void 0:s.id),$e=b1({measure:L.dragOverlay.measure}),It=(o=$e.nodeRef.current)!=null?o:fe,Fe=Y?(a=$e.rect)!=null?a:_e:null,Dt=!!($e.nodeRef.current&&$e.rect),_n=v1(Dt?null:_e),St=Ng(It?yn(It):null),Mt=y1(Y?kt??fe:null),pt=S1(Mt),en=jg(b,{transform:{x:ue.x-_n.x,y:ue.y-_n.y,scaleX:1,scaleY:1},activatorEvent:ae,active:ve,activeNodeRect:_e,containerNodeRect:it,draggingNodeRect:Fe,over:Ee.current.over,overlayNodeRect:$e.rect,scrollableAncestors:Mt,scrollableAncestorRects:pt,windowRect:St}),H=Pe?gi(Pe,ue):null,he=x1(Mt),Ue=Mh(he),tt=Mh(he,[_e]),ht=gi(en,Ue),mt=Fe?Ww(Fe,en):null,Rt=ve&&mt?k({active:ve,collisionRect:mt,droppableRects:ce,droppableContainers:j,pointerCoordinates:H}):null,Ht=Ow(Rt,"id"),[ut,jn]=w.useState(null),Hn=Dt?en:gi(en,tt),br=Uw(Hn,(u=ut==null?void 0:ut.rect)!=null?u:null,_e),hr=w.useRef(null),Rn=w.useCallback((rt,gt)=>{let{sensor:vt,options:qt}=gt;if(Me.current==null)return;const bt=K.get(Me.current);if(!bt)return;const yt=rt.nativeEvent,ot=new vt({active:Me.current,activeNode:bt,event:yt,options:qt,context:Ee,onAbort(Je){if(!K.get(Je))return;const{onDragAbort:se}=X.current,ne={id:Je};se==null||se(ne),A({type:"onDragAbort",event:ne})},onPending(Je,_,se,ne){if(!K.get(Je))return;const{onDragPending:ze}=X.current,Be={id:Je,constraint:_,initialCoordinates:se,offset:ne};ze==null||ze(Be),A({type:"onDragPending",event:Be})},onStart(Je){const _=Me.current;if(_==null)return;const se=K.get(_);if(!se)return;const{onDragStart:ne}=X.current,ye={activatorEvent:yt,active:{id:_,data:se.data,rect:pe}};oo.unstable_batchedUpdates(()=>{ne==null||ne(ye),W(ss.Initializing),I({type:Wt.DragStart,initialCoordinates:Je,active:_}),A({type:"onDragStart",event:ye}),re(hr.current),z(yt)})},onMove(Je){I({type:Wt.DragMove,coordinates:Je})},onEnd:Gt(Wt.DragEnd),onCancel:Gt(Wt.DragCancel)});hr.current=ot;function Gt(Je){return async function(){const{active:se,collisions:ne,over:ye,scrollAdjustedTranslate:ze}=Ee.current;let Be=null;if(se&&ze){const{cancelDrop:De}=X.current;Be={activatorEvent:yt,active:se,collisions:ne,delta:ze,over:ye},Je===Wt.DragEnd&&typeof De=="function"&&await Promise.resolve(De(Be))&&(Je=Wt.DragCancel)}Me.current=null,oo.unstable_batchedUpdates(()=>{I({type:Je}),W(ss.Uninitialized),jn(null),re(null),z(null),hr.current=null;const De=Je===Wt.DragEnd?"onDragEnd":"onDragCancel";if(Be){const at=X.current[De];at==null||at(Be),A({type:De,event:Be})}})}}},[K]),An=w.useCallback((rt,gt)=>(vt,qt)=>{const bt=vt.nativeEvent,yt=K.get(qt);if(Me.current!==null||!yt||bt.dndKit||bt.defaultPrevented)return;const ot={active:yt};rt(vt,gt.options,ot)===!0&&(bt.dndKit={capturedBy:gt.sensor},Me.current=qt,Rn(vt,gt))},[K,Rn]),dn=f1(v,An);w1(v),fr(()=>{_e&&$===ss.Initializing&&W(ss.Initialized)},[_e,$]),w.useEffect(()=>{const{onDragMove:rt}=X.current,{active:gt,activatorEvent:vt,collisions:qt,over:bt}=Ee.current;if(!gt||!vt)return;const yt={active:gt,activatorEvent:vt,collisions:qt,delta:{x:ht.x,y:ht.y},over:bt};oo.unstable_batchedUpdates(()=>{rt==null||rt(yt),A({type:"onDragMove",event:yt})})},[ht.x,ht.y]),w.useEffect(()=>{const{active:rt,activatorEvent:gt,collisions:vt,droppableContainers:qt,scrollAdjustedTranslate:bt}=Ee.current;if(!rt||Me.current==null||!gt||!bt)return;const{onDragOver:yt}=X.current,ot=qt.get(Ht),Gt=ot&&ot.rect.current?{id:ot.id,rect:ot.rect.current,data:ot.data,disabled:ot.disabled}:null,Je={active:rt,activatorEvent:gt,collisions:vt,delta:{x:bt.x,y:bt.y},over:Gt};oo.unstable_batchedUpdates(()=>{jn(Gt),yt==null||yt(Je),A({type:"onDragOver",event:Je})})},[Ht]),fr(()=>{Ee.current={activatorEvent:ae,active:ve,activeNode:fe,collisionRect:mt,collisions:Rt,droppableRects:ce,draggableNodes:K,draggingNode:It,draggingNodeRect:Fe,droppableContainers:ge,over:ut,scrollableAncestors:Mt,scrollAdjustedTranslate:ht},pe.current={initial:Fe,translated:mt}},[ve,fe,Rt,mt,K,It,Fe,ce,ge,ut,Mt,ht]),l1({...Ce,delta:ue,draggingRect:mt,pointerCoordinates:H,scrollableAncestors:Mt,scrollableAncestorRects:pt});const xn=w.useMemo(()=>({active:ve,activeNode:fe,activeNodeRect:_e,activatorEvent:ae,collisions:Rt,containerNodeRect:it,dragOverlay:$e,draggableNodes:K,droppableContainers:ge,droppableRects:ce,over:ut,measureDroppableContainers:q,scrollableAncestors:Mt,scrollableAncestorRects:pt,measuringConfiguration:L,measuringScheduled:le,windowRect:St}),[ve,fe,_e,ae,Rt,it,$e,K,ge,ce,ut,q,Mt,pt,L,le,St]),Ft=w.useMemo(()=>({activatorEvent:ae,activators:dn,active:ve,activeNodeRect:_e,ariaDescribedById:{draggable:V},dispatch:I,draggableNodes:K,over:ut,measureDroppableContainers:q}),[ae,dn,ve,_e,I,V,K,ut,q]);return st.createElement(pg.Provider,{value:B},st.createElement(No.Provider,{value:Ft},st.createElement(_g.Provider,{value:xn},st.createElement(kl.Provider,{value:br},m)),st.createElement(j1,{disabled:(h==null?void 0:h.restoreFocus)===!1})),st.createElement(Rw,{...h,hiddenTextDescribedById:V}));function Vt(){const rt=(ee==null?void 0:ee.autoScrollEnabled)===!1,gt=typeof g=="object"?g.enabled===!1:g===!1,vt=Y&&!rt&&!gt;return typeof g=="object"?{...g,enabled:vt}:{enabled:vt}}}),D1=w.createContext(null),Ph="button",M1="Draggable";function L1(n){let{id:r,data:s,disabled:o=!1,attributes:a}=n;const u=To(M1),{activators:f,activatorEvent:h,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:x}=w.useContext(No),{role:b=Ph,roleDescription:E="draggable",tabIndex:C=0}=a??{},T=(g==null?void 0:g.id)===r,I=w.useContext(T?kl:D1),[A,B]=Ja(),[$,W]=Ja(),Y=k1(f,r),G=yo(s);fr(()=>(k.set(r,{id:r,key:u,node:A,activatorNode:$,data:G}),()=>{const ue=k.get(r);ue&&ue.key===u&&k.delete(r)}),[k,r]);const K=w.useMemo(()=>({role:b,tabIndex:C,"aria-disabled":o,"aria-pressed":T&&b===Ph?!0:void 0,"aria-roledescription":E,"aria-describedby":v.draggable}),[o,b,C,T,E,v.draggable]);return{active:g,activatorEvent:h,activeNodeRect:m,attributes:K,isDragging:T,listeners:o?void 0:Y,node:A,over:x,setNodeRef:B,setActivatorNodeRef:W,transform:I}}function Rg(){return w.useContext(_g)}const P1="Droppable",O1={timeout:25};function Ag(n){let{data:r,disabled:s=!1,id:o,resizeObserverConfig:a}=n;const u=To(P1),{active:f,dispatch:h,over:g,measureDroppableContainers:m}=w.useContext(No),v=w.useRef({disabled:s}),k=w.useRef(!1),x=w.useRef(null),b=w.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:T}={...O1,...a},I=yo(C??o),A=w.useCallback(()=>{if(!k.current){k.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(I.current)?I.current:[I.current]),b.current=null},T)},[T]),B=wl({callback:A,disabled:E||!f}),$=w.useCallback((K,ue)=>{B&&(ue&&(B.unobserve(ue),k.current=!1),K&&B.observe(K))},[B]),[W,Y]=Ja($),G=yo(r);return w.useEffect(()=>{!B||!W.current||(B.disconnect(),k.current=!1,B.observe(W.current))},[W,B]),w.useEffect(()=>(h({type:Wt.RegisterDroppable,element:{id:o,key:u,disabled:s,node:W,rect:x,data:G}}),()=>h({type:Wt.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{s!==v.current.disabled&&(h({type:Wt.SetDroppableDisabled,id:o,key:u,disabled:s}),v.current.disabled=s)},[o,u,s,h]),{active:f,rect:x,isOver:(g==null?void 0:g.id)===o,node:W,over:g,setNodeRef:Y}}function z1(n){let{animation:r,children:s}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=el(s);return!s&&!o&&h&&a(h),fr(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){a(null);return}Promise.resolve(r(m,u)).then(()=>{a(null)})},[r,o,u]),st.createElement(st.Fragment,null,s,o?w.cloneElement(o,{ref:f}):null)}const $1={x:0,y:0,scaleX:1,scaleY:1};function F1(n){let{children:r}=n;return st.createElement(No.Provider,{value:Eg},st.createElement(kl.Provider,{value:$1},r))}const U1={position:"fixed",touchAction:"none"},B1=n=>xl(n)?"transform 250ms ease":void 0,W1=w.forwardRef((n,r)=>{let{as:s,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:g,transform:m,transition:v=B1}=n;if(!h)return null;const k=a?m:{...m,scaleX:1,scaleY:1},x={...U1,width:h.width,height:h.height,top:h.top,left:h.left,transform:Pr.Transform.toString(k),transformOrigin:a&&o?Mw(o,h):void 0,transition:typeof v=="function"?v(o):v,...g};return st.createElement(s,{className:f,style:x,ref:r},u)}),H1=n=>r=>{let{active:s,dragOverlay:o}=r;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,g]of Object.entries(u.active))g!==void 0&&(a[h]=s.node.style.getPropertyValue(h),s.node.style.setProperty(h,g));if(u!=null&&u.dragOverlay)for(const[h,g]of Object.entries(u.dragOverlay))g!==void 0&&o.node.style.setProperty(h,g);return f!=null&&f.active&&s.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[g,m]of Object.entries(a))s.node.style.setProperty(g,m);f!=null&&f.active&&s.node.classList.remove(f.active)}},V1=n=>{let{transform:{initial:r,final:s}}=n;return[{transform:Pr.Transform.toString(r)},{transform:Pr.Transform.toString(s)}]},q1={duration:250,easing:"ease",keyframes:V1,sideEffects:H1({styles:{active:{opacity:"0"}}})};function G1(n){let{config:r,draggableNodes:s,droppableContainers:o,measuringConfiguration:a}=n;return yl((u,f)=>{if(r===null)return;const h=s.get(u);if(!h)return;const g=h.node.current;if(!g)return;const m=Cg(f);if(!m)return;const{transform:v}=yn(f).getComputedStyle(f),k=mg(v);if(!k)return;const x=typeof r=="function"?r:K1(r);return Sg(g,a.draggable.measure),x({active:{id:u,data:h.data,node:g,rect:a.draggable.measure(g)},draggableNodes:s,dragOverlay:{node:f,rect:a.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function K1(n){const{duration:r,easing:s,sideEffects:o,keyframes:a}={...q1,...n};return u=>{let{active:f,dragOverlay:h,transform:g,...m}=u;if(!r)return;const v={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:g.scaleX!==1?f.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?f.rect.height*g.scaleY/h.rect.height:1},x={x:g.x-v.x,y:g.y-v.y,...k},b=a({...m,active:f,dragOverlay:h,transform:{initial:g,final:x}}),[E]=b,C=b[b.length-1];if(JSON.stringify(E)===JSON.stringify(C))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...m}),I=h.node.animate(b,{duration:r,easing:s,fill:"forwards"});return new Promise(A=>{I.onfinish=()=>{T==null||T(),A()}})}}let Oh=0;function Y1(n){return w.useMemo(()=>{if(n!=null)return Oh++,Oh},[n])}const X1=st.memo(n=>{let{adjustScale:r=!1,children:s,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:g,zIndex:m=999}=n;const{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:b,draggableNodes:E,droppableContainers:C,dragOverlay:T,over:I,measuringConfiguration:A,scrollableAncestors:B,scrollableAncestorRects:$,windowRect:W}=Rg(),Y=w.useContext(kl),G=Y1(k==null?void 0:k.id),K=jg(f,{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:b,draggingNodeRect:T.rect,over:I,overlayNodeRect:T.rect,scrollableAncestors:B,scrollableAncestorRects:$,transform:Y,windowRect:W}),ue=dd(x),ge=G1({config:o,draggableNodes:E,droppableContainers:C,measuringConfiguration:A}),de=ue?T.setRef:void 0;return st.createElement(F1,null,st.createElement(z1,{animation:ge},k&&G?st.createElement(W1,{key:G,id:k.id,ref:de,as:h,activatorEvent:v,adjustScale:r,className:g,transition:u,rect:ue,style:{zIndex:m,...a},transform:K},s):null))});function Ig(n,r,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(r,1)[0]),o}function Q1(n,r){return n.reduce((s,o,a)=>{const u=r.get(o);return u&&(s[a]=u),s},Array(n.length))}function Ia(n){return n!==null&&n>=0}function Z1(n,r){if(n===r)return!0;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==r[s])return!1;return!0}function J1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Dg=n=>{let{rects:r,activeIndex:s,overIndex:o,index:a}=n;const u=Ig(r,o,s),f=r[a],h=u[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}},Da={scaleX:1,scaleY:1},zh=n=>{var r;let{activeIndex:s,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(r=u[s])!=null?r:o;if(!h)return null;if(a===s){const m=u[f];return m?{x:0,y:s<f?m.top+m.height-(h.top+h.height):m.top-h.top,...Da}:null}const g=ek(u,a,s);return a>s&&a<=f?{x:0,y:-h.height-g,...Da}:a<s&&a>=f?{x:0,y:h.height+g,...Da}:{x:0,y:0,...Da}};function ek(n,r,s){const o=n[r],a=n[r-1],u=n[r+1];return o?s<r?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const Mg="Sortable",Lg=st.createContext({activeIndex:-1,containerId:Mg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Dg,disabled:{draggable:!1,droppable:!1}});function $h(n){let{children:r,id:s,items:o,strategy:a=Dg,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:g,over:m,measureDroppableContainers:v}=Rg(),k=To(Mg,s),x=h.rect!==null,b=w.useMemo(()=>o.map(Y=>typeof Y=="object"&&"id"in Y?Y.id:Y),[o]),E=f!=null,C=f?b.indexOf(f.id):-1,T=m?b.indexOf(m.id):-1,I=w.useRef(b),A=!Z1(b,I.current),B=T!==-1&&C===-1||A,$=J1(u);fr(()=>{A&&E&&v(b)},[A,b,E,v]),w.useEffect(()=>{I.current=b},[b]);const W=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:$,disableTransforms:B,items:b,overIndex:T,useDragOverlay:x,sortedRects:Q1(b,g),strategy:a}),[C,k,$.draggable,$.droppable,B,b,T,g,x,a]);return st.createElement(Lg.Provider,{value:W},r)}const tk=n=>{let{id:r,items:s,activeIndex:o,overIndex:a}=n;return Ig(s,o,a).indexOf(r)},nk=n=>{let{containerId:r,isSorting:s,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:g,transition:m}=n;return!m||!o||h!==u&&a===f?!1:s?!0:f!==a&&r===g},rk={duration:200,easing:"ease"},Pg="transform",sk=Pr.Transition.toString({property:Pg,duration:0,easing:"linear"}),ik={roleDescription:"sortable"};function ok(n){let{disabled:r,index:s,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(s);return fr(()=>{if(!r&&s!==h.current&&o.current){const g=a.current;if(g){const m=wi(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&f(v)}}s!==h.current&&(h.current=s)},[r,s,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function Og(n){let{animateLayoutChanges:r=nk,attributes:s,disabled:o,data:a,getNewIndex:u=tk,id:f,strategy:h,resizeObserverConfig:g,transition:m=rk}=n;const{items:v,containerId:k,activeIndex:x,disabled:b,disableTransforms:E,sortedRects:C,overIndex:T,useDragOverlay:I,strategy:A}=w.useContext(Lg),B=ak(o,b),$=v.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:$,items:v},...a}),[k,a,$,v]),Y=w.useMemo(()=>v.slice(v.indexOf(f)),[v,f]),{rect:G,node:K,isOver:ue,setNodeRef:ge}=Ag({id:f,data:W,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:Y,...g}}),{active:de,activatorEvent:pe,activeNodeRect:ve,attributes:Me,setNodeRef:ee,listeners:re,isDragging:ae,over:z,setActivatorNodeRef:X,transform:V}=L1({id:f,data:W,attributes:{...ik,...s},disabled:B.draggable}),j=vw(ge,ee),L=!!de,ce=L&&!E&&Ia(x)&&Ia(T),q=!I&&ae,le=q&&ce?V:null,Pe=ce?le??(h??A)({rects:C,activeNodeRect:ve,activeIndex:x,overIndex:T,index:$}):null,Ce=Ia(x)&&Ia(T)?u({id:f,items:v,activeIndex:x,overIndex:T}):$,je=de==null?void 0:de.id,_e=w.useRef({activeId:je,items:v,newIndex:Ce,containerId:k}),it=v!==_e.current.items,Ee=r({active:de,containerId:k,isDragging:ae,isSorting:L,id:f,index:$,items:v,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:m,wasDragging:_e.current.activeId!=null}),kt=ok({disabled:!Ee,index:$,node:K,rect:G});return w.useEffect(()=>{L&&_e.current.newIndex!==Ce&&(_e.current.newIndex=Ce),k!==_e.current.containerId&&(_e.current.containerId=k),v!==_e.current.items&&(_e.current.items=v)},[L,Ce,k,v]),w.useEffect(()=>{if(je===_e.current.activeId)return;if(je!=null&&_e.current.activeId==null){_e.current.activeId=je;return}const It=setTimeout(()=>{_e.current.activeId=je},50);return()=>clearTimeout(It)},[je]),{active:de,activeIndex:x,attributes:Me,data:W,rect:G,index:$,newIndex:Ce,items:v,isOver:ue,isSorting:L,isDragging:ae,listeners:re,node:K,overIndex:T,over:z,setNodeRef:j,setActivatorNodeRef:X,setDroppableNodeRef:ge,setDraggableNodeRef:ee,transform:kt??Pe,transition:$e()};function $e(){if(kt||it&&_e.current.newIndex===$)return sk;if(!(q&&!xl(pe)||!m)&&(L||Ee))return Pr.Transition.toString({...m,property:Pg})}}function ak(n,r){var s,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(s=n==null?void 0:n.draggable)!=null?s:r.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:r.droppable}}et.Down,et.Right,et.Up,et.Left;function Ma(n){const[r,s]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{s(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[r,o]}function lk(n,r=!1){const[s,o]=w.useState(()=>{try{const u=localStorage.getItem(n);return u==="1"?!0:u==="0"?!1:r}catch{return r}}),a=w.useCallback(u=>{o(u);try{localStorage.setItem(n,u?"1":"0")}catch{}},[n]);return[s,a]}async function Lu(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 s=document.execCommand("copy");return document.body.removeChild(r),s}catch{return!1}}}function ck(n){return n.origin_app_id!=null&&!n.user_touched&&!n.starred}function il(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Fh(n,r){if(!r||!n.cwd)return!1;const s=il(n.cwd),o=il(r);return s.startsWith(`${o}/`)}function uk(n,r){const s=new Map;for(const f of r){const h=f.cwd||"(no directory)",g=s.get(h)??[];g.push(f),s.set(h,g)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:s.get(f.path)??[],workspace:f})}for(const[f,h]of s)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function ol(n){return[...n].sort((r,s)=>s.sort_order-r.sort_order||(r.created_at<s.created_at?1:-1))}function Uh(n,r,s,o){const a=r.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&s.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function Bh(n,r){return{working:ol(n.sessions.filter(s=>s.lifecycle!=="finished")),finished:ol(n.sessions.filter(s=>s.lifecycle==="finished")),finishedCollapsed:r.has(n.finishedKey)}}function La(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function dk(n){const r=new Set(n.map(o=>o.name));if(!r.has("New Folder"))return"New Folder";let s=2;for(;r.has(`New Folder ${s}`);)s++;return`New Folder ${s}`}function Wh({id:n,children:r,className:s}){const{setNodeRef:o,isOver:a}=Ag({id:n});return c.jsx("div",{ref:o,className:`${s??""}${a?" drop-over":""}`,children:r})}function fd({inputRef:n,value:r,onChange:s,onConfirm:o,onCancel:a}){return c.jsx("input",{ref:n,className:"tree-rename-input",value:r,onChange:u=>s(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function fk({s:n,backgroundTaskCount:r,isActive:s,isSelected:o,appIcon:a,renaming:u,renameValue:f,renameRef:h,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:x,onToggleStar:b}){const{attributes:E,listeners:C,setNodeRef:T,transform:I,transition:A,isDragging:B}=Og({id:`s:${n.id}`}),$=hl(n,r);return c.jsxs("div",{ref:T,style:{transform:Pr.Transform.toString(I),transition:A},className:`tree-item ${s?"active":""}${o?" selected":""} ${$.isFinished?"tree-item-finished":""}${B?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,...C,onClick:k,onContextMenu:x,children:[c.jsx(rd,{iconClass:$.iconClass,iconText:$.iconText,size:16}),a&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a}),u?c.jsx(fd,{inputRef:h,value:f,onChange:g,onConfirm:m,onCancel:v}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!u&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:W=>{W.stopPropagation(),b()},onPointerDown:W=>W.stopPropagation(),children:c.jsx(Za,{size:10,fill:n.starred?"currentColor":"none"})}),$.dot&&c.jsx(nd,{status:$.dot,title:$.dotTitle})]})}function pk({folder:n,count:r,collapsed:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:x,listeners:b,setNodeRef:E,transform:C,transition:T,isDragging:I,over:A}=Og({id:`f:${n.id}`}),B=A!=null&&String(A.id).startsWith("s:");return c.jsxs("div",{ref:E,style:{transform:Pr.Transform.toString(C),transition:T},className:`tree-folder ${s?"collapsed":""}${I?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${B?" drop-over":""}`,...x,...b,onClick:()=>{o||m()},onContextMenu:v,children:o?c.jsx(fd,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:g}):c.jsxs(c.Fragment,{children:[c.jsx(mi,{size:8,className:"tree-chevron"}),c.jsx(Au,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:r})]})}),!s&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function hk(){const n=M(_=>_.sessions),r=M(_=>_.backgroundTasks),s=M(_=>_.workspaces),o=M(_=>_.folders),a=M(_=>_.activeSessionId),u=M(_=>_.selectSession),f=M(_=>_.deleteSession),h=M(_=>_.removeWorkspace),g=M(_=>_.createSessionInWorkspace),m=M(_=>_.pickAndAddWorkspace),v=M(_=>_.renameSession),k=M(_=>_.markFinished),x=M(_=>_.markFinishedMany),b=M(_=>_.toggleStar),E=M(_=>_.reopenSession),C=M(_=>_.reopenSessionMany),T=M(_=>_.deleteSessionMany),I=M(_=>_.createSidebarFolder),A=M(_=>_.renameFolder),B=M(_=>_.deleteFolder),$=M(_=>_.applyMoves),W=M(_=>_.reorderFolders),Y=M(_=>_.apps),G=M(_=>_.appsRootPath),K=M(_=>_.activeAppTabId),ue=M(_=>_.openAppTab),ge=M(_=>_.startAppEdit),de=M(_=>_.toggleAppPin),pe=M(_=>_.deleteApp),ve=M(_=>_.openAppCatalog),[Me,ee]=Ma("agentpane:sidebar-ws-collapsed"),[re,ae]=Ma("agentpane:sidebar-sub-collapsed"),[z,X]=Ma("agentpane:sidebar-folders-collapsed"),[V,j]=Ma("agentpane:sidebar-app-edits-collapsed"),[L,ce]=lk("agentpane:sidebar-hide-auto-sessions"),[q,le]=w.useState(null),[fe,Pe]=w.useState(null),[Ce,je]=w.useState(""),[_e,it]=w.useState(null),[Ee,kt]=w.useState(new Set),[$e,It]=w.useState(null),Fe=w.useRef(null),Dt=w.useRef(null),_n=w.useRef(null),St=w.useRef(!1),Mt=Iw(Aw(ud,{activationConstraint:{distance:5}}));function pt(){kt(new Set),It(null)}ml(Fe,()=>le(null),!!q),td(()=>{le(null),pt()},!!q||Ee.size>0),w.useLayoutEffect(()=>{const _=Fe.current;if(!q||!_)return;const se=8,{offsetWidth:ne,offsetHeight:ye}=_,ze=q.x+ne>window.innerWidth-se?Math.max(se,q.x-ne):q.x,Be=q.y+ye>window.innerHeight-se?Math.max(se,q.y-ye):q.y;_.style.left=`${ze}px`,_.style.top=`${Be}px`},[q]);const en=w.useMemo(()=>new Map(n.map(_=>[_.id,_])),[n]),H=w.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),he=w.useMemo(()=>{const _=new Map;for(const se of[...o].sort((ne,ye)=>ne.sort_order-ye.sort_order)){const ne=_.get(se.workspace_path)??[];ne.push(se),_.set(se.workspace_path,ne)}return _},[o]);function Ue(_){ee(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}function tt(_){ae(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}function ht(_){X(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}function mt(){ce(!L),pt()}function Rt(_){j(se=>{const ne=new Set(se);return ne.has(_)?ne.delete(_):ne.add(_),ne})}w.useEffect(()=>{fe&&Dt.current&&(Dt.current.focus(),Dt.current.select())},[fe]),w.useEffect(()=>{var _,se,ne;St.current||!a||(St.current=!0,(ne=(se=(_=_n.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:se.scrollIntoView)==null||ne.call(se,{block:"nearest"}))},[a]);function Ht(_,se,ne,ye=""){Pe({kind:_,id:se}),je(ne||ye)}function ut(){if(fe){const _=Ce.trim();_&&(fe.kind==="session"?v(fe.id,_):A(fe.id,_))}Pe(null)}function jn(){Pe(null),je("")}async function Hn(_){const se=dk(he.get(_)??[]),ne=await I(_,se);ne&&Ht("folder",ne.id,ne.name)}function br(_){const se=String(_.active.id);if(se.startsWith("s:")){const ne=en.get(se.slice(2));ne&&it({kind:"session",label:ne.title||ne.id.slice(0,8)})}else if(se.startsWith("f:")){const ne=H.get(se.slice(2));ne&&it({kind:"folder",label:ne.name})}}function hr(_){it(null);const{active:se,over:ne}=_;if(!ne)return;const ye=String(se.id),ze=String(ne.id);if(ye.startsWith("s:")){const Be=en.get(ye.slice(2));if(!Be)return;const De=Be.cwd||"(no directory)",at=La(Be,H);let In,Dn;if(ze.startsWith("f:")){const Xe=H.get(ze.slice(2));if(!Xe)return;In=Xe.workspace_path,Dn=Xe.id}else if(ze.startsWith("s:")){const Xe=en.get(ze.slice(2));if(!Xe)return;In=Xe.cwd||"(no directory)",Dn=La(Xe,H)}else if(ze.startsWith("c:")){const Xe=ze.slice(2),Tt=Xe.lastIndexOf("|");In=Xe.slice(0,Tt);const rr=Xe.slice(Tt+1);Dn=rr==="root"?null:rr}else return;if(In!==De)return;const He=ol(n.filter(Xe=>(Xe.cwd||"(no directory)")===In&&La(Xe,H)===Dn)),wn=He.filter(Xe=>Xe.id!==Be.id);let Or=wn.length;if(ze.startsWith("s:")){const Xe=wn.findIndex(Tt=>Tt.id===ze.slice(2));Xe>=0&&(Or=Xe)}const tr=[...wn.slice(0,Or),Be,...wn.slice(Or)],nr=[];if(Dn===at){if(tr.length===He.length&&tr.every((Xe,Tt)=>Xe.id===He[Tt].id))return;tr.forEach((Xe,Tt)=>nr.push({id:Xe.id,folder_id:Dn,sort_order:tr.length-1-Tt}))}else{const Xe=ol(n.filter(Tt=>(Tt.cwd||"(no directory)")===De&&La(Tt,H)===at)).filter(Tt=>Tt.id!==Be.id);Xe.forEach((Tt,rr)=>nr.push({id:Tt.id,folder_id:at,sort_order:Xe.length-1-rr})),tr.forEach((Tt,rr)=>nr.push({id:Tt.id,folder_id:Dn,sort_order:tr.length-1-rr}))}$(nr);return}if(ye.startsWith("f:")){if(!ze.startsWith("f:"))return;const Be=H.get(ye.slice(2)),De=H.get(ze.slice(2));if(!Be||!De||Be.id===De.id||Be.workspace_path!==De.workspace_path)return;const at=(he.get(Be.workspace_path)??[]).map(He=>He.id),In=at.indexOf(Be.id),Dn=at.indexOf(De.id);at.splice(Dn,0,...at.splice(In,1)),W(at)}}const Rn=G?n.filter(_=>!Fh(_,G)):n,An=new Set(L?Rn.filter(_=>ck(_)&&_.id!==a).map(_=>_.id):[]),dn=uk(s,An.size>0?Rn.filter(_=>!An.has(_.id)):Rn),xn=w.useMemo(()=>{const _=new Map;if(!G)return _;const se=il(G);for(const ne of n){if(!Fh(ne,G))continue;const ye=il(ne.cwd).slice(se.length+1).split("/")[0],ze=_.get(ye)??[];ze.push(ne),_.set(ye,ze)}return _},[n,G]);function Ft(_){return{folder:null,sessions:xn.get(_)??[],finishedKey:`app:${_}:finished`,hidden:V.has(_)}}const Vt=[],rt=_=>{if(_.hidden)return;const{working:se,finished:ne,finishedCollapsed:ye}=Bh(_,re);Vt.push(...se.map(ze=>ze.id)),ye||Vt.push(...ne.map(ze=>ze.id))};for(const _ of dn){if(Me.has(_.path))continue;const se=he.get(_.path)??[],ne=new Set(se.map(ye=>ye.id));Uh(_,se,ne,z).forEach(rt)}Y.forEach(_=>rt(Ft(_.id)));const gt=n.filter(_=>Ee.has(_.id)),vt=gt.filter(_=>_.lifecycle!=="finished").map(_=>_.id),qt=gt.filter(_=>_.lifecycle==="finished").map(_=>_.id);function bt(_,se){if(se.metaKey||se.ctrlKey){se.preventDefault(),It(_.id),kt(ne=>{const ye=new Set(ne);return ye.has(_.id)?ye.delete(_.id):ye.add(_.id),ye});return}if(se.shiftKey){se.preventDefault();const ne=$e??_.id;It(ne);const ye=Vt.indexOf(ne),ze=Vt.indexOf(_.id);if(ye>=0&&ze>=0){const[Be,De]=ye<ze?[ye,ze]:[ze,ye];kt(new Set(Vt.slice(Be,De+1)))}return}pt(),It(_.id),u(_.id)}function yt(_,se){se.preventDefault();const ne=Ee.has(_.id)&&Ee.size>1;Ee.has(_.id)||(kt(new Set),It(_.id)),le({x:se.clientX,y:se.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:ne})}function ot(_){var ne;const se=_.origin_app_id?Y.find(ye=>ye.id===_.origin_app_id):null;return c.jsx(fk,{s:_,backgroundTaskCount:((ne=r[_.id])==null?void 0:ne.length)??0,isActive:a===_.id,isSelected:Ee.has(_.id),appIcon:se?se.icon??"◧":null,renaming:(fe==null?void 0:fe.kind)==="session"&&fe.id===_.id,renameValue:Ce,renameRef:Dt,onRenameValue:je,onRenameConfirm:ut,onRenameCancel:jn,onSelect:ye=>bt(_,ye),onToggleStar:()=>b(_.id),onCtxMenu:ye=>yt(_,ye)},_.id)}function Gt(_){var ne;const se=hl(_,((ne=r[_.id])==null?void 0:ne.length)??0);return c.jsxs("div",{className:`sidebar-app-edit-row${a===_.id?" active":""}${Ee.has(_.id)?" selected":""}${se.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ye=>bt(_,ye),onContextMenu:ye=>yt(_,ye),children:[c.jsx(rd,{iconClass:se.iconClass,iconText:se.iconText,size:14}),(fe==null?void 0:fe.kind)==="session"&&fe.id===_.id?c.jsx(fd,{inputRef:Dt,value:Ce,onChange:je,onConfirm:ut,onCancel:jn}):c.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),se.dot&&c.jsx(nd,{status:se.dot,title:se.dotTitle})]},_.id)}function Je(_,se="workspace"){const{working:ne,finished:ye,finishedCollapsed:ze}=Bh(_,re),Be=se==="workspace"?ot:Gt,De=c.jsxs(c.Fragment,{children:[ne.length===0&&ye.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):ne.map(Be),ye.length>0&&c.jsxs("div",{className:`tree-subgroup ${ze?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>tt(_.finishedKey),children:[c.jsx(mi,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ye.length})]}),!ze&&c.jsx("div",{className:"tree-subgroup-items",children:ye.map(Be)})]})]});if(se==="app")return De;const at=[...ne,...ye].map(In=>`s:${In.id}`);return c.jsx($h,{items:at,strategy:zh,children:De})}return c.jsxs("div",{className:"ide-sidebar",ref:_n,children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsxs("div",{className:"sidebar-header-actions",children:[c.jsx("button",{className:`sidebar-add sidebar-filter${L?" active":""}`,title:L?`Show automatic sessions (${An.size} hidden)`:"Hide automatic sessions — the ones mini apps run on their own. Sessions you message, stop, rewind, rename or star stay visible.","aria-label":L?"Show automatic sessions":"Hide automatic sessions","aria-pressed":L,onClick:mt,children:L?c.jsx(L0,{size:14}):c.jsx(ls,{size:14})}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:c.jsx(Rs,{size:14})})]})]}),c.jsxs(I1,{sensors:Mt,collisionDetection:zw,onDragStart:br,onDragEnd:hr,children:[dn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):dn.map(_=>{const se=Me.has(_.path),ne=he.get(_.path)??[],ye=new Set(ne.map(De=>De.id)),ze=Uh(_,ne,ye,z),Be=ze[ze.length-1];return c.jsxs("div",{className:`tree-section ${se?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>Ue(_.path),onContextMenu:De=>{De.preventDefault(),le({x:De.clientX,y:De.clientY,type:"workspace",path:_.path})},children:[c.jsx(mi,{size:9,className:"tree-chevron"}),c.jsx(Au,{size:14}),c.jsx("span",{className:"tree-section-label",children:_.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:De=>{De.stopPropagation(),g(_.path)},children:c.jsx(Rs,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:De=>{De.stopPropagation(),Hn(_.path)},children:c.jsx(pu,{size:11})}),c.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!se&&c.jsxs("div",{className:"tree-children",children:[c.jsx($h,{items:ne.map(De=>`f:${De.id}`),strategy:zh,children:ze.filter(De=>De.folder).map(De=>c.jsx(pk,{folder:De.folder,count:De.sessions.length,collapsed:De.hidden,renaming:(fe==null?void 0:fe.kind)==="folder"&&fe.id===De.folder.id,renameValue:Ce,renameRef:Dt,onRenameValue:je,onRenameConfirm:ut,onRenameCancel:jn,onToggle:()=>ht(De.folder.id),onCtxMenu:at=>{at.preventDefault(),le({x:at.clientX,y:at.clientY,type:"folder",folderId:De.folder.id,folderName:De.folder.name})},children:c.jsx(Wh,{id:`c:${_.path}|${De.folder.id}`,children:Je(De)})},De.folder.id))}),c.jsx(Wh,{id:`c:${_.path}|root`,children:Je(Be)})]})]},_.path)}),c.jsx(X1,{children:_e&&c.jsxs("div",{className:"drag-overlay",children:[_e.kind==="folder"&&c.jsx(Au,{size:12}),c.jsx("span",{children:_e.label})]})})]}),c.jsxs("div",{className:"sidebar-apps",children:[c.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Apps"}),c.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>ve(),children:c.jsx(Rs,{size:14})})]}),Y.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),Y.map(_=>{const se=Ft(_.id),ne=se.sessions.length>0&&!se.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${K===_.id?" active":""}`,title:_.description??void 0,onClick:()=>ue(_.id),onContextMenu:ye=>{ye.preventDefault(),le({x:ye.clientX,y:ye.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[se.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${ne?"":" closed"}`,title:"Edit sessions of this app",onClick:ye=>{ye.stopPropagation(),Rt(_.id)},children:c.jsx(mi,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:_.icon??"◧"}),c.jsx("span",{className:"tree-label",children:_.title}),se.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:se.sessions.length}),_.pinned&&c.jsx(Za,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ne&&c.jsx("div",{className:"sidebar-app-edits",children:Je(se,"app")})]},_.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(pu,{size:14}),c.jsx("span",{children:"Add workspace"})]}),q&&c.jsxs("div",{ref:Fe,className:"ctx-menu",style:{position:"fixed",left:q.x,top:q.y,zIndex:500},children:[q.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(q.path),le(null)},children:[c.jsx(Rs,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Hn(q.path),le(null)},children:[c.jsx(pu,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{h(q.path),le(null)},children:[c.jsx(dr,{size:12})," Hide Workspace"]})]}),q.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("folder",q.folderId,q.folderName??""),le(null)},children:[c.jsx(Ua,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{B(q.folderId),le(null)},children:[c.jsx(dr,{size:12})," Delete Folder"]})]}),q.type==="session"&&!q.multi&&c.jsx(c.Fragment,{children:q.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("session",q.sessionId,q.sessionTitle??""),le(null)},children:[c.jsx(Ua,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(q.sessionId),le(null)},children:[c.jsx(Qa,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${q.sessionExternalId?"":" ctx-disabled"}`,title:q.sessionExternalId?void 0:"Session not started",onClick:()=>{q.sessionExternalId&&(Lu(q.sessionExternalId),le(null))},children:[c.jsx(Ru,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(q.sessionId),le(null)},children:[c.jsx(dr,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(q.sessionId),le(null)},children:[c.jsx(vo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${q.sessionExternalId?"":" ctx-disabled"}`,title:q.sessionExternalId?void 0:"Session not started",onClick:()=>{q.sessionExternalId&&(Lu(q.sessionExternalId),le(null))},children:[c.jsx(Ru,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(q.sessionId),le(null)},children:[c.jsx(dr,{size:12})," Delete Session"]})]})}),q.type==="session"&&q.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[gt.length," sessions selected"]}),vt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(vt),le(null),pt()},children:[c.jsx(Qa,{size:12})," Mark ",vt.length," as Finished"]}),qt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{C(qt),le(null),pt()},children:[c.jsx(vo,{size:12})," Reopen ",qt.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{T([...Ee]),le(null),pt()},children:[c.jsx(dr,{size:12})," Delete ",gt.length," Sessions"]})]}),q.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ge(q.appId),le(null)},children:[c.jsx(Ua,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{de(q.appId),le(null)},children:[c.jsx(Za,{size:12})," ",q.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{pe(q.appId),le(null)},children:[c.jsx(dr,{size:12})," Delete App"]})]})]})]})}function mk(){const n=M(b=>b.openTabs),r=M(b=>b.activeSessionId),s=M(b=>b.sessions),o=M(b=>b.backgroundTasks),a=M(b=>b.selectSession),u=M(b=>b.closeTab),f=M(b=>b.setShowNewSessionDialog),h=M(b=>b.apps),g=M(b=>b.openAppTabs),m=M(b=>b.activeAppTabId),v=M(b=>b.openAppTab),k=M(b=>b.closeAppTab),x=M(b=>b.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(b=>{var I;const E=s.find(A=>A.id===b);if(!E)return null;const C=hl(E,((I=o[b])==null?void 0:I.length)??0),T=r===b&&m==null;return c.jsxs("div",{className:`ide-tab ${T?"active":""}`,onClick:()=>{m!=null&&x(null),a(b)},children:[c.jsx(rd,{iconClass:C.iconClass,iconText:C.iconText,size:14}),E.title||b.slice(0,8),C.dot&&c.jsx(nd,{status:C.dot,title:C.dotTitle}),c.jsx("span",{className:"ide-tab-close",onClick:A=>{A.stopPropagation(),u(b)},children:c.jsx(Wn,{size:12})})]},b)}),g.map(b=>{const E=h.find(T=>T.id===b),C=m===b;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>v(b),children:[E!=null&&E.icon?c.jsx("span",{className:"miniapp-tab-icon",children:E.icon}):c.jsx(sg,{size:12}),(E==null?void 0:E.title)??b,c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),k(b)},children:c.jsx(Wn,{size:12})})]},b)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:c.jsx(Rs,{size:14})})]})}function pd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ms=pd();function zg(n){Ms=n}var po={exec:()=>null};function nt(n,r=""){let s=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(gn.caret,"$1"),s=s.replace(a,f),o},getRegex:()=>new RegExp(s,r)};return o}var gn={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")},gk=/^(?:[ \t]*(?:\n|$))+/,vk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Co=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hd=/(?:[*+-]|\d{1,9}[.)])/,$g=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fg=nt($g).replace(/bull/g,hd).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(),wk=nt($g).replace(/bull/g,hd).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(),md=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kk=/^[^\n]+/,gd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Sk=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bk=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hd).getRegex(),Sl="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",vd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tk=nt("^ {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",vd).replace("tag",Sl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ug=nt(md).replace("hr",Co).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",Sl).getRegex(),Nk=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ug).getRegex(),yd={blockquote:Nk,code:vk,def:Sk,fences:yk,heading:xk,hr:Co,html:Tk,lheading:Fg,list:bk,newline:gk,paragraph:Ug,table:po,text:kk},Hh=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Co).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",Sl).getRegex(),Ck={...yd,lheading:wk,table:Hh,paragraph:nt(md).replace("hr",Co).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Hh).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",Sl).getRegex()},Ek={...yd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vd).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:po,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(md).replace("hr",Co).replace("heading",` *#{1,6} *[^
|
|
404
|
+
]`).replace("lheading",Fg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_k=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bg=/^( {2,}|\\)\n(?!\s*$)/,Rk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bl=/[\p{P}\p{S}]/u,xd=/[\s\p{P}\p{S}]/u,Wg=/[^\s\p{P}\p{S}]/u,Ak=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xd).getRegex(),Hg=/(?!~)[\p{P}\p{S}]/u,Ik=/(?!~)[\s\p{P}\p{S}]/u,Dk=/(?:[^\s\p{P}\p{S}]|~)/u,Mk=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Vg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Lk=nt(Vg,"u").replace(/punct/g,bl).getRegex(),Pk=nt(Vg,"u").replace(/punct/g,Hg).getRegex(),qg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ok=nt(qg,"gu").replace(/notPunctSpace/g,Wg).replace(/punctSpace/g,xd).replace(/punct/g,bl).getRegex(),zk=nt(qg,"gu").replace(/notPunctSpace/g,Dk).replace(/punctSpace/g,Ik).replace(/punct/g,Hg).getRegex(),$k=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wg).replace(/punctSpace/g,xd).replace(/punct/g,bl).getRegex(),Fk=nt(/\\(punct)/,"gu").replace(/punct/g,bl).getRegex(),Uk=nt(/^<(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(),Bk=nt(vd).replace("(?:-->|$)","-->").getRegex(),Wk=nt("^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",Bk).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),al=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Hk=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",al).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gg=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",al).replace("ref",gd).getRegex(),Kg=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",gd).getRegex(),Vk=nt("reflink|nolink(?!\\()","g").replace("reflink",Gg).replace("nolink",Kg).getRegex(),wd={_backpedal:po,anyPunctuation:Fk,autolink:Uk,blockSkip:Mk,br:Bg,code:jk,del:po,emStrongLDelim:Lk,emStrongRDelimAst:Ok,emStrongRDelimUnd:$k,escape:_k,link:Hk,nolink:Kg,punctuation:Ak,reflink:Gg,reflinkSearch:Vk,tag:Wk,text:Rk,url:po},qk={...wd,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",al).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",al).getRegex()},Pu={...wd,emStrongRDelimAst:zk,emStrongLDelim:Pk,url:nt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Gk={...Pu,br:nt(Bg).replace("{2,}","*").getRegex(),text:nt(Pu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pa={normal:yd,gfm:Ck,pedantic:Ek},to={normal:wd,gfm:Pu,breaks:Gk,pedantic:qk},Kk={"&":"&","<":"<",">":">",'"':""","'":"'"},Vh=n=>Kk[n];function kr(n,r){if(r){if(gn.escapeTest.test(n))return n.replace(gn.escapeReplace,Vh)}else if(gn.escapeTestNoEncode.test(n))return n.replace(gn.escapeReplaceNoEncode,Vh);return n}function qh(n){try{n=encodeURI(n).replace(gn.percentDecode,"%")}catch{return null}return n}function Gh(n,r){var u;const s=n.replace(gn.findPipe,(f,h,g)=>{let m=!1,v=h;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=s.split(gn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(gn.slashPipe,"|");return o}function no(n,r,s){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===r;)a++;return n.slice(0,o-a)}function Yk(n,r){if(n.indexOf(r[1])===-1)return-1;let s=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===r[0])s++;else if(n[o]===r[1]&&(s--,s<0))return o;return s>0?-2:-1}function Kh(n,r,s,o,a){const u=r.href,f=r.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:n[0].charAt(0)==="!"?"image":"link",raw:s,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,g}function Xk(n,r,s){const o=n.match(s.other.indentCodeCompensation);if(o===null)return r;const a=o[1];return r.split(`
|
|
400
405
|
`).map(u=>{const f=u.match(s.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
401
406
|
`)}var ll=class{constructor(n){lt(this,"options");lt(this,"rules");lt(this,"lexer");this.options=n||Ms}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 s=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?s:no(s,`
|
|
402
|
-
`)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const s=r[0],o=
|
|
407
|
+
`)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const s=r[0],o=Xk(s,r[3]||"",this.rules);return{type:"code",raw:s,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(n){const r=this.rules.block.heading.exec(n);if(r){let s=r[2].trim();if(this.rules.other.endingHash.test(s)){const o=no(s,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(s=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(n){const r=this.rules.block.hr.exec(n);if(r)return{type:"hr",raw:no(r[0],`
|
|
403
408
|
`)}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){let s=no(r[0],`
|
|
404
409
|
`).split(`
|
|
405
410
|
`),o="",a="";const u=[];for(;s.length>0;){let f=!1;const h=[];let g;for(g=0;g<s.length;g++)if(this.rules.other.blockquoteStart.test(s[g]))h.push(s[g]),f=!0;else if(!f)h.push(s[g]);else break;s=s.slice(g);const m=h.join(`
|
|
@@ -420,7 +425,7 @@ ${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
420
425
|
`+x}!b&&!x.trim()&&(b=!0),m+=Y+`
|
|
421
426
|
`,n=n.substring(Y.length+1),k=G.slice(E)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(f=!0));let C=null,T;this.options.gfm&&(C=this.rules.other.listIsTask.exec(v),C&&(T=C[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:m,task:!!C,checked:T,loose:!1,text:v,tokens:[]}),a.raw+=m}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 g=0;g<a.items.length;g++)if(this.lexer.state.top=!1,a.items[g].tokens=this.lexer.blockTokens(a.items[g].text,[]),!a.loose){const m=a.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=v}if(a.loose)for(let g=0;g<a.items.length;g++)a.items[g].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 s=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:s,raw:r[0],href:o,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 s=Gh(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=r[3])!=null&&f.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
422
427
|
`):[],u={type:"table",raw:r[0],header:[],align:[],rows:[]};if(s.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<s.length;h++)u.header.push({text:s[h],tokens:this.lexer.inline(s[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Gh(h,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));return u}}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 s=r[1].charAt(r[1].length-1)===`
|
|
423
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:s,tokens:this.lexer.inline(s)}}}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 s=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const u=no(s.slice(0,-1),"\\");if((s.length-u.length)%2===0)return}else{const u=
|
|
428
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:s,tokens:this.lexer.inline(s)}}}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 s=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const u=no(s.slice(0,-1),"\\");if((s.length-u.length)%2===0)return}else{const u=Yk(r[2],"()");if(u===-2)return;if(u>-1){const h=(r[0].indexOf("!")===0?5:4)+r[1].length+u;r[2]=r[2].substring(0,u),r[0]=r[0].substring(0,h).trim(),r[3]=""}}let o=r[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?o=o.slice(1):o=o.slice(1,-1)),Kh(r,{href:o&&o.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 s;if((s=this.rules.inline.reflink.exec(n))||(s=this.rules.inline.nolink.exec(n))){const o=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[o.toLowerCase()];if(!a){const u=s[0].charAt(0);return{type:"text",raw:u,text:u}}return Kh(s,a,s[0],this.lexer,this.rules)}}emStrong(n,r,s=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const u=[...o[0]].length-1;let f,h,g=u,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,r=r.slice(-1*n.length+u);(o=v.exec(r))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){g+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){m+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g+m);const k=[...o[0]][0].length,x=n.slice(0,u+o.index+k+h);if(Math.min(u,h)%2){const E=x.slice(1,-1);return{type:"em",raw:x,text:E,tokens:this.lexer.inlineTokens(E)}}const b=x.slice(2,-2);return{type:"strong",raw:x,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(n){const r=this.rules.inline.code.exec(n);if(r){let s=r[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return o&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:r[0],text:s}}}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 s,o;return r[2]==="@"?(s=r[1],o="mailto:"+s):(s=r[1],o=s),{type:"link",raw:r[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(n){var s;let r;if(r=this.rules.inline.url.exec(n)){let o,a;if(r[2]==="@")o=r[0],a="mailto:"+o;else{let u;do u=r[0],r[0]=((s=this.rules.inline._backpedal.exec(r[0]))==null?void 0:s[0])??"";while(u!==r[0]);o=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const r=this.rules.inline.text.exec(n);if(r){const s=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:s}}}},Mr=class Ou{constructor(r){lt(this,"tokens");lt(this,"options");lt(this,"state");lt(this,"tokenizer");lt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Ms,this.options.tokenizer=this.options.tokenizer||new ll,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 s={other:gn,block:Pa.normal,inline:to.normal};this.options.pedantic?(s.block=Pa.pedantic,s.inline=to.pedantic):this.options.gfm&&(s.block=Pa.gfm,this.options.breaks?s.inline=to.breaks:s.inline=to.gfm),this.tokenizer.rules=s}static get rules(){return{block:Pa,inline:to}}static lex(r,s){return new Ou(s).lex(r)}static lexInline(r,s){return new Ou(s).inlineTokens(r)}lex(r){r=r.replace(gn.carriageReturn,`
|
|
424
429
|
`),this.blockTokens(r,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){const o=this.inlineQueue[s];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,s=[],o=!1){var a,u,f;for(this.options.pedantic&&(r=r.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));r;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(m=>(h=m.call({lexer:this},r,s))?(r=r.substring(h.raw.length),s.push(h),!0):!1))continue;if(h=this.tokenizer.space(r)){r=r.substring(h.raw.length);const m=s.at(-1);h.raw.length===1&&m!==void 0?m.raw+=`
|
|
425
430
|
`:s.push(h);continue}if(h=this.tokenizer.code(r)){r=r.substring(h.raw.length);const m=s.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
426
431
|
`+h.raw,m.text+=`
|
|
@@ -449,29 +454,29 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
449
454
|
${n}</tr>
|
|
450
455
|
`}tablecell(n){const r=this.parser.parseInline(n.tokens),s=n.header?"th":"td";return(n.align?`<${s} align="${n.align}">`:`<${s}>`)+r+`</${s}>
|
|
451
456
|
`}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>${kr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:r,tokens:s}){const o=this.parser.parseInline(s),a=qh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return r&&(u+=' title="'+kr(r)+'"'),u+=">"+o+"</a>",u}image({href:n,title:r,text:s,tokens:o}){o&&(s=this.parser.parseInline(o,this.parser.textRenderer));const a=qh(n);if(a===null)return kr(s);n=a;let u=`<img src="${n}" alt="${s}"`;return r&&(u+=` title="${kr(r)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:kr(n.text)}},kd=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""}},Lr=class zu{constructor(r){lt(this,"options");lt(this,"renderer");lt(this,"textRenderer");this.options=r||Ms,this.options.renderer=this.options.renderer||new cl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kd}static parse(r,s){return new zu(s).parse(r)}static parseInline(r,s){return new zu(s).parseInline(r)}parse(r,s=!0){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const m=h,v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){o+=v||"";continue}}const g=h;switch(g.type){case"space":{o+=this.renderer.space(g);continue}case"hr":{o+=this.renderer.hr(g);continue}case"heading":{o+=this.renderer.heading(g);continue}case"code":{o+=this.renderer.code(g);continue}case"table":{o+=this.renderer.table(g);continue}case"blockquote":{o+=this.renderer.blockquote(g);continue}case"list":{o+=this.renderer.list(g);continue}case"html":{o+=this.renderer.html(g);continue}case"paragraph":{o+=this.renderer.paragraph(g);continue}case"text":{let m=g,v=this.renderer.text(m);for(;f+1<r.length&&r[f+1].type==="text";)m=r[++f],v+=`
|
|
452
|
-
`+this.renderer.text(m);s?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(r,s=this.renderer){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const m=this.options.extensions.renderers[h.type].call({parser:this},h);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=m||"";continue}}const g=h;switch(g.type){case"escape":{o+=s.text(g);break}case"html":{o+=s.html(g);break}case"link":{o+=s.link(g);break}case"image":{o+=s.image(g);break}case"strong":{o+=s.strong(g);break}case"em":{o+=s.em(g);break}case"codespan":{o+=s.codespan(g);break}case"br":{o+=s.br(g);break}case"del":{o+=s.del(g);break}case"text":{o+=s.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},Nu,Wa=(Nu=class{constructor(n){lt(this,"options");lt(this,"block");this.options=n||Ms}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Mr.lex:Mr.lexInline}provideParser(){return this.block?Lr.parse:Lr.parseInline}},lt(Nu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Nu),
|
|
453
|
-
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+kr(s.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(s);throw s}}},As=new
|
|
454
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qk(n,r){return Wk(n)||Hk(n,r)||Gk(n,r)||Vk()}function Gk(n,r){if(n){if(typeof n=="string")return Yh(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Yh(n,r):void 0}}const Kg=Object.entries,Xh=Object.setPrototypeOf,Kk=Object.isFrozen,Yk=Object.getPrototypeOf,Xk=Object.getOwnPropertyDescriptor;let rn=Object.freeze,sn=Object.seal,ui=Object.create,Yg=typeof Reflect<"u"&&Reflect,$u=Yg.apply,Fu=Yg.construct;rn||(rn=function(r){return r});sn||(sn=function(r){return r});$u||($u=function(r,s){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return r.apply(s,a)});Fu||(Fu=function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return new r(...o)});const ai=$t(Array.prototype.forEach),Qk=$t(Array.prototype.lastIndexOf),Qh=$t(Array.prototype.pop),li=$t(Array.prototype.push),Zk=$t(Array.prototype.splice),is=Array.isArray,ao=$t(String.prototype.toLowerCase),yu=$t(String.prototype.toString),Zh=$t(String.prototype.match),ro=$t(String.prototype.replace),Jh=$t(String.prototype.indexOf),Jk=$t(String.prototype.trim),eS=$t(Number.prototype.toString),tS=$t(Boolean.prototype.toString),em=typeof BigInt>"u"?null:$t(BigInt.prototype.toString),tm=typeof Symbol>"u"?null:$t(Symbol.prototype.toString),Zt=$t(Object.prototype.hasOwnProperty),so=$t(Object.prototype.toString),Qt=$t(RegExp.prototype.test),js=nS(TypeError);function $t(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return $u(n,r,o)}}function nS(n){return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return Fu(n,s)}}function Ve(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ao;if(Xh&&Xh(n,null),!is(r))return n;let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const u=s(a);u!==a&&(Kk(r)||(r[o]=u),a=u)}n[a]=!0}return n}function rS(n){for(let r=0;r<n.length;r++)Zt(n,r)||(n[r]=null);return n}function un(n){const r=ui(null);for(const o of Kg(n)){var s=qk(o,2);const a=s[0],u=s[1];Zt(n,a)&&(is(u)?r[a]=rS(u):u&&typeof u=="object"&&u.constructor===Object?r[a]=un(u):r[a]=u)}return r}function sS(n){switch(typeof n){case"string":return n;case"number":return eS(n);case"boolean":return tS(n);case"bigint":return em?em(n):"0";case"symbol":return tm?tm(n):"Symbol()";case"undefined":return so(n);case"function":case"object":{if(n===null)return so(n);const r=n,s=lr(r,"toString");if(typeof s=="function"){const o=s(r);return typeof o=="string"?o:so(o)}return so(n)}default:return so(n)}}function lr(n,r){for(;n!==null;){const o=Xk(n,r);if(o){if(o.get)return $t(o.get);if(typeof o.value=="function")return $t(o.value)}n=Yk(n)}function s(){return null}return s}function iS(n){try{return Qt(n,""),!0}catch{return!1}}const nm=rn(["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"]),xu=rn(["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"]),wu=rn(["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"]),oS=rn(["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"]),ku=rn(["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"]),aS=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rm=rn(["#text"]),sm=rn(["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"]),Su=rn(["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"]),im=rn(["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"]),Oa=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lS=sn(/{{[\w\W]*|^[\w\W]*}}/g),cS=sn(/<%[\w\W]*|^[\w\W]*%>/g),uS=sn(/\${[\w\W]*/g),dS=sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),fS=sn(/^aria-[\-\w]+$/),om=sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pS=sn(/^(?:\w+script|data):/i),hS=sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mS=sn(/^html$/i),gS=sn(/^[a-z][.\w]*(-[.\w]+)+$/i),am=sn(/<[/\w!]/g),lm=sn(/<[/\w]/g),vS=sn(/<\/no(script|embed|frames)/i),yS=sn(/\/>/i),$n={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},xS=function(){return typeof window>"u"?null:window},wS=function(r,s){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(o=s.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return r.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},cm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rs=function(r,s,o,a){return Zt(r,s)&&is(r[s])?Ve(a.base?un(a.base):{},r[s],a.transform):o};function Xg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xS();const r=ie=>Xg(ie);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==$n.document||!n.Element)return r.isSupported=!1,r;let s=n.document;const o=s,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,h=n.Element,g=n.NodeFilter,m=n.NamedNodeMap;m===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const v=n.DOMParser,k=n.trustedTypes,x=h.prototype,b=lr(x,"cloneNode"),E=lr(x,"remove"),C=lr(x,"nextSibling"),T=lr(x,"childNodes"),I=lr(x,"parentNode"),A=lr(x,"shadowRoot"),B=lr(x,"attributes"),$=f&&f.prototype?lr(f.prototype,"nodeType"):null,W=f&&f.prototype?lr(f.prototype,"nodeName"):null,Y=f&&f.prototype?lr(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const ie=s.createElement("template");ie.content&&ie.content.ownerDocument&&(s=ie.content.ownerDocument)}let G,K="",ue,ge=!1,de=0;const pe=function(){if(de>0)throw js('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.')},ve=function(S){pe(),de++;try{return G.createHTML(S)}finally{de--}},Me=function(S){pe(),de++;try{return G.createScriptURL(S)}finally{de--}},ee=function(){return ge||(ue=wS(k,a),ge=!0),ue},re=s,ae=re.implementation,z=re.createNodeIterator,X=re.createDocumentFragment,V=re.getElementsByTagName,j=o.importNode;let M=cm();r.isSupported=typeof Kg=="function"&&typeof I=="function"&&ae&&ae.createHTMLDocument!==void 0;const ce=lS,q=cS,le=uS,fe=dS,Pe=fS,Ce=pS,je=hS,_e=gS;let it=om,Ee=null;const kt=Ve({},[...nm,...xu,...wu,...ku,...rm]);let $e=null;const It=Ve({},[...sm,...Su,...im,...Oa]);let Fe=Object.seal(ui(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}})),Dt=null,_n=null;const St=Object.seal(ui(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mt=!0,pt=!0,en=!1,H=!0,he=!1,Ue=!0,tt=!1,ht=!1,mt=null,Rt=null,Ht=!1,ut=!1,jn=!1,Wn=!1,br=!0,hr=!1;const Rn="user-content-";let An=!0,dn=!1,xn={},Ft=null;const Vt=Ve({},["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 rt=null;const gt=Ve({},["audio","video","img","source","image","track"]);let vt=null;const qt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Gt=ot,Je=!1,_=null;const se=Ve({},[bt,yt,ot],yu),ne=rn(["mi","mo","mn","ms","mtext"]);let ye=Ve({},ne);const ze=rn(["annotation-xml"]);let Be=Ve({},ze);const De=Ve({},["title","style","font","a","script"]);let at=null;const In=["application/xhtml+xml","text/html"],Dn="text/html";let He=null,wn=null;const Or=s.createElement("form"),Jn=function(S){return S instanceof RegExp||S instanceof Function},er=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wn&&wn===S)return;(!S||typeof S!="object")&&(S={}),S=un(S),at=In.indexOf(S.PARSER_MEDIA_TYPE)===-1?Dn:S.PARSER_MEDIA_TYPE,He=at==="application/xhtml+xml"?yu:ao,Ee=rs(S,"ALLOWED_TAGS",kt,{transform:He}),$e=rs(S,"ALLOWED_ATTR",It,{transform:He}),_=rs(S,"ALLOWED_NAMESPACES",se,{transform:yu}),vt=rs(S,"ADD_URI_SAFE_ATTR",qt,{transform:He,base:qt}),rt=rs(S,"ADD_DATA_URI_TAGS",gt,{transform:He,base:gt}),Ft=rs(S,"FORBID_CONTENTS",Vt,{transform:He}),Dt=rs(S,"FORBID_TAGS",un({}),{transform:He}),_n=rs(S,"FORBID_ATTR",un({}),{transform:He}),xn=Zt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?un(S.USE_PROFILES):S.USE_PROFILES:!1,Mt=S.ALLOW_ARIA_ATTR!==!1,pt=S.ALLOW_DATA_ATTR!==!1,en=S.ALLOW_UNKNOWN_PROTOCOLS||!1,H=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,he=S.SAFE_FOR_TEMPLATES||!1,Ue=S.SAFE_FOR_XML!==!1,tt=S.WHOLE_DOCUMENT||!1,ut=S.RETURN_DOM||!1,jn=S.RETURN_DOM_FRAGMENT||!1,Wn=S.RETURN_TRUSTED_TYPE||!1,Ht=S.FORCE_BODY||!1,br=S.SANITIZE_DOM!==!1,hr=S.SANITIZE_NAMED_PROPS||!1,An=S.KEEP_CONTENT!==!1,dn=S.IN_PLACE||!1,it=iS(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:om,Gt=typeof S.NAMESPACE=="string"?S.NAMESPACE:ot,ye=Zt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?un(S.MATHML_TEXT_INTEGRATION_POINTS):Ve({},ne),Be=Zt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?un(S.HTML_INTEGRATION_POINTS):Ve({},ze);const P=Zt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?un(S.CUSTOM_ELEMENT_HANDLING):ui(null);if(Fe=ui(null),Zt(P,"tagNameCheck")&&Jn(P.tagNameCheck)&&(Fe.tagNameCheck=P.tagNameCheck),Zt(P,"attributeNameCheck")&&Jn(P.attributeNameCheck)&&(Fe.attributeNameCheck=P.attributeNameCheck),Zt(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),sn(Fe),he&&(pt=!1),jn&&(ut=!0),xn&&(Ee=Ve({},rm),$e=ui(null),xn.html===!0&&(Ve(Ee,nm),Ve($e,sm)),xn.svg===!0&&(Ve(Ee,xu),Ve($e,Su),Ve($e,Oa)),xn.svgFilters===!0&&(Ve(Ee,wu),Ve($e,Su),Ve($e,Oa)),xn.mathMl===!0&&(Ve(Ee,ku),Ve($e,im),Ve($e,Oa))),St.tagCheck=null,St.attributeCheck=null,Zt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?St.tagCheck=S.ADD_TAGS:is(S.ADD_TAGS)&&(Ee===kt&&(Ee=un(Ee)),Ve(Ee,S.ADD_TAGS,He))),Zt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?St.attributeCheck=S.ADD_ATTR:is(S.ADD_ATTR)&&($e===It&&($e=un($e)),Ve($e,S.ADD_ATTR,He))),Zt(S,"ADD_URI_SAFE_ATTR")&&is(S.ADD_URI_SAFE_ATTR)&&Ve(vt,S.ADD_URI_SAFE_ATTR,He),Zt(S,"FORBID_CONTENTS")&&is(S.FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,S.FORBID_CONTENTS,He)),Zt(S,"ADD_FORBID_CONTENTS")&&is(S.ADD_FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,S.ADD_FORBID_CONTENTS,He)),An&&(Ee["#text"]=!0),tt&&Ve(Ee,["html","head","body"]),Ee.table&&(Ve(Ee,["tbody"]),delete Dt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw js('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw js('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Q=G;G=S.TRUSTED_TYPES_POLICY;try{K=ve("")}catch(Se){throw G=Q,Se}}else S.TRUSTED_TYPES_POLICY===null?(G=void 0,K=""):(G===void 0&&(G=ee()),G&&typeof K=="string"&&(K=ve("")));rn&&rn(S),wn=S},Xe=Ve({},[...xu,...wu,...oS]),Tt=Ve({},[...ku,...aS]),tr=function(S,P,Q){return P.namespaceURI===ot?S==="svg":P.namespaceURI===bt?S==="svg"&&(Q==="annotation-xml"||ye[Q]):!!Xe[S]},Tl=function(S,P,Q){return P.namespaceURI===ot?S==="math":P.namespaceURI===yt?S==="math"&&Be[Q]:!!Tt[S]},Nl=function(S,P,Q){return P.namespaceURI===yt&&!Be[Q]||P.namespaceURI===bt&&!ye[Q]?!1:!Tt[S]&&(De[S]||!Xe[S])},Nt=function(S){let P=I(S);(!P||!P.tagName)&&(P={namespaceURI:Gt,tagName:"template"});const Q=ao(S.tagName),Se=ao(P.tagName);return _[S.namespaceURI]?S.namespaceURI===yt?tr(Q,P,Se):S.namespaceURI===bt?Tl(Q,P,Se):S.namespaceURI===ot?Nl(Q,P,Se):!!(at==="application/xhtml+xml"&&_[S.namespaceURI]):!1},mr=function(S){li(r.removed,{element:S});try{I(S).removeChild(S)}catch{if(E(S),!I(S))throw js("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},zr=function(S){cs(S);const P=T(S);if(P){const Se=[];ai(P,Ne=>{li(Se,Ne)}),ai(Se,Ne=>{try{E(Ne)}catch{}})}const Q=B(S);if(Q)for(let Se=Q.length-1;Se>=0;--Se){const Ne=Q[Se],Oe=Ne&&Ne.name;if(typeof Oe=="string")try{S.removeAttribute(Oe)}catch{}}},gr=function(S,P){try{li(r.removed,{attribute:P.getAttributeNode(S),from:P})}catch{li(r.removed,{attribute:null,from:P})}if(P.removeAttribute(S),S==="is")if(ut||jn)try{mr(P)}catch{}else try{P.setAttribute(S,"")}catch{}},Ls=function(S){const P=B(S);if(P)for(let Q=P.length-1;Q>=0;--Q){const Se=P[Q],Ne=Se&&Se.name;if(!(typeof Ne!="string"||$e[He(Ne)]))try{S.removeAttribute(Ne)}catch{}}},cs=function(S){const P=[S];for(;P.length>0;){const Q=P.pop();($?$(Q):Q.nodeType)===$n.element&&Ls(Q);const Ne=T(Q);if(Ne)for(let Oe=Ne.length-1;Oe>=0;--Oe)P.push(Ne[Oe])}},Eo=function(S){if(!Ue)return;const P=[S];for(;P.length>0;){const Q=P.pop(),Se=$?$(Q):Q.nodeType;if(Se===$n.processingInstruction||Se===$n.comment&&Qt(lm,Q.data)){try{E(Q)}catch{}continue}if(Se===$n.element){const Oe=Q,Ke=He(W?W(Q):Q.nodeName);try{Oe.hasAttribute&&Oe.hasAttribute("patchsrc")&&Oe.removeAttribute("patchsrc"),Oe.hasAttribute&&Oe.hasAttribute("for")&&Ke!=="label"&&Ke!=="output"&&Oe.removeAttribute("for")}catch{}}const Ne=T(Q);if(Ne)for(let Oe=Ne.length-1;Oe>=0;--Oe)P.push(Ne[Oe])}},us=function(S){let P=null,Q=null;if(Ht)S="<remove></remove>"+S;else{const Oe=Zh(S,/^[\r\n\t ]+/);Q=Oe&&Oe[0]}at==="application/xhtml+xml"&&Gt===ot&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const Se=G?ve(S):S;if(Gt===ot)try{P=new v().parseFromString(Se,at)}catch{}if(!P||!P.documentElement){P=ae.createDocument(Gt,"template",null);try{P.documentElement.innerHTML=Je?K:Se}catch{}}const Ne=P.body||P.documentElement;return S&&Q&&Ne.insertBefore(s.createTextNode(Q),Ne.childNodes[0]||null),Gt===ot?V.call(P,tt?"html":"body")[0]:tt?P.documentElement:Ne},Mn=function(S){const P=Y?Y(S):S.ownerDocument;return z.call(P||S,S,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ps=function(S){return S=ro(S,ce," "),S=ro(S,q," "),S=ro(S,le," "),S},fn=function(S){var P;S.normalize();const Q=Y?Y(S):S.ownerDocument,Se=z.call(Q||S,S,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ne=Se.nextNode();for(;Ne;)Ne.data=Ps(Ne.data),Ne=Se.nextNode();const Oe=(P=S.querySelectorAll)===null||P===void 0?void 0:P.call(S,"template");Oe&&ai(Oe,Ke=>{$r(Ke.content)&&fn(Ke.content)})},Os=function(S){const P=W?W(S):null;return typeof P!="string"||He(P)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==B(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==$(S)||S.childNodes!==T(S)},$r=function(S){if(!$||typeof S!="object"||S===null)return!1;try{return $(S)===$n.documentFragment}catch{return!1}},ds=function(S){if(!$||typeof S!="object"||S===null)return!1;try{return typeof $(S)=="number"}catch{return!1}};function pn(ie,S,P){ie.length!==0&&ai(ie,Q=>{Q.call(r,S,P,wn)})}const zs=function(S,P){return!!(Ue&&S.hasChildNodes()&&!ds(S.firstElementChild)&&Qt(am,S.textContent)&&Qt(am,S.innerHTML)||Ue&&S.namespaceURI===ot&&P==="style"&&ds(S.firstElementChild)||S.nodeType===$n.processingInstruction||Ue&&S.nodeType===$n.comment&&Qt(lm,S.data))},fs=function(S,P,Q){if(!Dt[P]&&Si(P)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,P)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(P)))return!1;if(An&&!Ft[P]){const Se=I(S),Ne=T(S);if(Ne&&Se){const Oe=Ne.length;for(let Ke=Oe-1;Ke>=0;--Ke){const Qe=S===Q?b(Ne[Ke],!0):Ne[Ke];Se.insertBefore(Qe,C(S))}}}return mr(S),!0},ps=function(S,P,Q,Se){return S.length===0?P:P===Q||P===Se?un(P):P},_o=function(S,P){if(pn(M.beforeSanitizeElements,S,null),S!==P&&I(S)===null)return dn&&cs(S),!0;if(Os(S))return mr(S),!0;const Q=He(W?W(S):S.nodeName);if(Ee=ps(M.uponSanitizeElement,Ee,kt,mt),pn(M.uponSanitizeElement,S,{tagName:Q,allowedTags:Ee}),S!==P&&I(S)===null)return dn&&cs(S),!0;if(zs(S,Q))return mr(S),!0;if(Dt[Q]||!(St.tagCheck instanceof Function&&St.tagCheck(Q))&&!Ee[Q]){const Ne=fs(S,Q,P);return Ne===!1&&pn(M.afterSanitizeElements,S,null),Ne}if(($?$(S):S.nodeType)===$n.element&&!Nt(S)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&Qt(vS,S.innerHTML))return mr(S),!0;if(he&&S.nodeType===$n.text){const Ne=Ps(S.textContent);S.textContent!==Ne&&(li(r.removed,{element:S.cloneNode()}),S.textContent=Ne)}return pn(M.afterSanitizeElements,S,null),!1},jo=function(S,P,Q){if(_n[P]||Ue&&P==="patchsrc"||Ue&&P==="for"&&S!=="label"&&S!=="output"||br&&(P==="id"||P==="name")&&(Q in s||Q in Or))return!1;const Se=$e[P]||St.attributeCheck instanceof Function&&St.attributeCheck(P,S);if(!(pt&&Qt(fe,P))){if(!(Mt&&Qt(Pe,P))){if(Se){if(!vt[P]){if(!Qt(it,ro(Q,je,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&S!=="script"&&Jh(Q,"data:")===0&&rt[S])){if(!(en&&!Qt(Ce,ro(Q,je,"")))){if(Q)return!1}}}}}else if(!(Si(S)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,S)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(S))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,P)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(P,S))||P==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,Q)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(Q))))return!1}}return!0},ki=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Si=function(S){return!ki[ao(S)]&&Qt(_e,S)},bi=function(S,P,Q,Se){if(G&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Q)switch(k.getAttributeType(S,P)){case"TrustedHTML":return ve(Se);case"TrustedScriptURL":return Me(Se)}return Se},hs=function(S,P,Q,Se){try{Q?S.setAttributeNS(Q,P,Se):S.setAttribute(P,Se),Os(S)?mr(S):Qh(r.removed)}catch{gr(P,S)}},Ro=function(S){pn(M.beforeSanitizeAttributes,S,null);const P=S.attributes;if(!P||Os(S))return;$e=ps(M.uponSanitizeAttribute,$e,It,Rt);const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let Se=P.length;const Ne=He(S.nodeName);for(;Se--;){const Oe=P[Se],Ke=Oe.name,Qe=Oe.namespaceURI,Ct=Oe.value,Et=He(Ke),Tr=Ct;let Lt=Ke==="value"?Tr:Jk(Tr);if(Q.attrName=Et,Q.attrValue=Lt,Q.keepAttr=!0,Q.forceKeepAttr=void 0,pn(M.uponSanitizeAttribute,S,Q),Lt=Q.attrValue,hr&&(Et==="id"||Et==="name")&&Jh(Lt,Rn)!==0&&(gr(Ke,S),Lt=Rn+Lt),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Lt)){gr(Ke,S);continue}if(Et==="attributename"&&Zh(Lt,"href")){gr(Ke,S);continue}if(!Q.forceKeepAttr){if(!Q.keepAttr){gr(Ke,S);continue}if(!H&&Qt(yS,Lt)){gr(Ke,S);continue}if(he&&(Lt=Ps(Lt)),!jo(Ne,Et,Lt)){gr(Ke,S);continue}Lt=bi(Ne,Et,Qe,Lt),Lt!==Tr&&hs(S,Ke,Qe,Lt)}}pn(M.afterSanitizeAttributes,S,null)},Fr=function(S){let P=null;const Q=Mn(S);for(pn(M.beforeSanitizeShadowDOM,S,null);P=Q.nextNode();)if(pn(M.uponSanitizeShadowNode,P,null),_o(P,S),Ro(P),$r(P.content)&&Fr(P.content),($?$(P):P.nodeType)===$n.element){const Ne=A(P);$r(Ne)&&(Ge(Ne),Fr(Ne))}pn(M.afterSanitizeShadowDOM,S,null)},Ge=function(S){const P=[{node:S,shadow:null}];for(;P.length>0;){const Q=P.pop();if(Q.shadow){Fr(Q.shadow);continue}const Se=Q.node,Oe=($?$(Se):Se.nodeType)===$n.element,Ke=T(Se);if(Ke)for(let Qe=Ke.length-1;Qe>=0;--Qe)P.push({node:Ke[Qe],shadow:null});if(Oe){const Qe=W?W(Se):null;if(typeof Qe=="string"&&He(Qe)==="template"){const Ct=Se.content;$r(Ct)&&P.push({node:Ct,shadow:null})}}if(Oe){const Qe=A(Se);$r(Qe)&&P.push({node:null,shadow:Qe},{node:Qe,shadow:null})}}};return r.sanitize=function(ie){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,Q=null,Se=null,Ne=null;if(Je=!ie,Je&&(ie="<!-->"),typeof ie!="string"&&!ds(ie)&&(ie=sS(ie),typeof ie!="string"))throw js("dirty is not a string, aborting");if(!r.isSupported)return ie;ht?(Ee=mt,$e=Rt):er(S),(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&(Ee=un(Ee)),M.uponSanitizeAttribute.length>0&&($e=un($e)),r.removed=[];const Oe=dn&&typeof ie!="string"&&ds(ie);if(Oe){Eo(ie);const Ct=W?W(ie):ie.nodeName;if(typeof Ct=="string"){const Et=He(Ct);if(!Ee[Et]||Dt[Et])throw zr(ie),js("root node is forbidden and cannot be sanitized in-place")}if(Os(ie))throw zr(ie),js("root node is clobbered and cannot be sanitized in-place");try{Ge(ie)}catch(Et){throw zr(ie),Et}}else if(ds(ie))P=us("<!---->"),Q=P.ownerDocument.importNode(ie,!0),Q.nodeType===$n.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?P=Q:P.appendChild(Q),Ge(Q);else{if(!ut&&!he&&!tt&&ie.indexOf("<")===-1)return G&&Wn?ve(ie):ie;if(P=us(ie),!P)return ut?null:Wn?K:""}P&&Ht&&mr(P.firstChild);const Ke=Oe?ie:P;try{const Ct=Mn(Ke);for(;Se=Ct.nextNode();)_o(Se,Ke),Ro(Se),$r(Se.content)&&Fr(Se.content)}catch(Ct){throw Oe&&(zr(ie),ai(r.removed,Et=>{Et.element&&cs(Et.element)})),Ct}if(Oe)return ai(r.removed,Ct=>{Ct.element&&cs(Ct.element)}),he&&fn(ie),ie;if(ut){if(he&&fn(P),jn)for(Ne=X.call(P.ownerDocument);P.firstChild;)Ne.appendChild(P.firstChild);else Ne=P;return($e.shadowroot||$e.shadowrootmode)&&(Ne=j.call(o,Ne,!0)),Ne}let Qe=tt?P.outerHTML:P.innerHTML;return tt&&Ee["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&Qt(mS,P.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
|
|
455
|
-
`+Qe),he&&(Qe=Ps(Qe)),G&&
|
|
457
|
+
`+this.renderer.text(m);s?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(r,s=this.renderer){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const m=this.options.extensions.renderers[h.type].call({parser:this},h);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=m||"";continue}}const g=h;switch(g.type){case"escape":{o+=s.text(g);break}case"html":{o+=s.html(g);break}case"link":{o+=s.link(g);break}case"image":{o+=s.image(g);break}case"strong":{o+=s.strong(g);break}case"em":{o+=s.em(g);break}case"codespan":{o+=s.codespan(g);break}case"br":{o+=s.br(g);break}case"del":{o+=s.del(g);break}case"text":{o+=s.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},Nu,Wa=(Nu=class{constructor(n){lt(this,"options");lt(this,"block");this.options=n||Ms}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Mr.lex:Mr.lexInline}provideParser(){return this.block?Lr.parse:Lr.parseInline}},lt(Nu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Nu),Qk=class{constructor(...n){lt(this,"defaults",pd());lt(this,"options",this.setOptions);lt(this,"parse",this.parseMarkdown(!0));lt(this,"parseInline",this.parseMarkdown(!1));lt(this,"Parser",Lr);lt(this,"Renderer",cl);lt(this,"TextRenderer",kd);lt(this,"Lexer",Mr);lt(this,"Tokenizer",ll);lt(this,"Hooks",Wa);this.use(...n)}walkTokens(n,r){var o,a;let s=[];for(const u of n)switch(s=s.concat(r.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)s=s.concat(this.walkTokens(h.tokens,r));for(const h of f.rows)for(const g of h)s=s.concat(this.walkTokens(g.tokens,r));break}case"list":{const f=u;s=s.concat(this.walkTokens(f.items,r));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const g=f[h].flat(1/0);s=s.concat(this.walkTokens(g,r))}):f.tokens&&(s=s.concat(this.walkTokens(f.tokens,r)))}}return s}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(s=>{const o={...s};if(o.async=this.defaults.async||o.async||!1,s.extensions&&(s.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=r.renderers[a.name];u?r.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.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 u=r[a.level];u?u.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)}),o.extensions=r),s.renderer){const a=this.defaults.renderer||new cl(this.defaults);for(const u in s.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=s.renderer[f],g=a[f];a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v||""}}o.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new ll(this.defaults);for(const u in s.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=s.tokenizer[f],g=a[f];a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Wa;for(const u in s.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=s.hooks[f],g=a[f];Wa.passThroughHooks.has(u)?a[f]=m=>{if(this.defaults.async)return Promise.resolve(h.call(a,m)).then(k=>g.call(a,k));const v=h.call(a,m);return g.call(a,v)}:a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,u=s.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Mr.lex(n,r??this.defaults)}parser(n,r){return Lr.parse(n,r??this.defaults)}parseMarkdown(n){return(s,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.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 s>"u"||s===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?Mr.lex:Mr.lexInline,g=u.hooks?u.hooks.provideParser():n?Lr.parse:Lr.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(s):s).then(m=>h(m,u)).then(m=>u.hooks?u.hooks.processAllTokens(m):m).then(m=>u.walkTokens?Promise.all(this.walkTokens(m,u.walkTokens)).then(()=>m):m).then(m=>g(m,u)).then(m=>u.hooks?u.hooks.postprocess(m):m).catch(f);try{u.hooks&&(s=u.hooks.preprocess(s));let m=h(s,u);u.hooks&&(m=u.hooks.processAllTokens(m)),u.walkTokens&&this.walkTokens(m,u.walkTokens);let v=g(m,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(m){return f(m)}}}onError(n,r){return s=>{if(s.message+=`
|
|
458
|
+
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+kr(s.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(s);throw s}}},As=new Qk;function qe(n,r){return As.parse(n,r)}qe.options=qe.setOptions=function(n){return As.setOptions(n),qe.defaults=As.defaults,zg(qe.defaults),qe};qe.getDefaults=pd;qe.defaults=Ms;qe.use=function(...n){return As.use(...n),qe.defaults=As.defaults,zg(qe.defaults),qe};qe.walkTokens=function(n,r){return As.walkTokens(n,r)};qe.parseInline=As.parseInline;qe.Parser=Lr;qe.parser=Lr.parse;qe.Renderer=cl;qe.TextRenderer=kd;qe.Lexer=Mr;qe.lexer=Mr.lex;qe.Tokenizer=ll;qe.Hooks=Wa;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;Lr.parse;Mr.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 Yh(n,r){(r==null||r>n.length)&&(r=n.length);for(var s=0,o=Array(r);s<r;s++)o[s]=n[s];return o}function Zk(n){if(Array.isArray(n))return n}function Jk(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,u,f,h=[],g=!0,m=!1;try{if(u=(s=s.call(n)).next,r!==0)for(;!(g=(o=u.call(s)).done)&&(h.push(o.value),h.length!==r);g=!0);}catch(v){m=!0,a=v}finally{try{if(!g&&s.return!=null&&(f=s.return(),Object(f)!==f))return}finally{if(m)throw a}}return h}}function eS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tS(n,r){return Zk(n)||Jk(n,r)||nS(n,r)||eS()}function nS(n,r){if(n){if(typeof n=="string")return Yh(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Yh(n,r):void 0}}const Yg=Object.entries,Xh=Object.setPrototypeOf,rS=Object.isFrozen,sS=Object.getPrototypeOf,iS=Object.getOwnPropertyDescriptor;let rn=Object.freeze,sn=Object.seal,ui=Object.create,Xg=typeof Reflect<"u"&&Reflect,$u=Xg.apply,Fu=Xg.construct;rn||(rn=function(r){return r});sn||(sn=function(r){return r});$u||($u=function(r,s){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return r.apply(s,a)});Fu||(Fu=function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return new r(...o)});const ai=$t(Array.prototype.forEach),oS=$t(Array.prototype.lastIndexOf),Qh=$t(Array.prototype.pop),li=$t(Array.prototype.push),aS=$t(Array.prototype.splice),is=Array.isArray,ao=$t(String.prototype.toLowerCase),yu=$t(String.prototype.toString),Zh=$t(String.prototype.match),ro=$t(String.prototype.replace),Jh=$t(String.prototype.indexOf),lS=$t(String.prototype.trim),cS=$t(Number.prototype.toString),uS=$t(Boolean.prototype.toString),em=typeof BigInt>"u"?null:$t(BigInt.prototype.toString),tm=typeof Symbol>"u"?null:$t(Symbol.prototype.toString),Zt=$t(Object.prototype.hasOwnProperty),so=$t(Object.prototype.toString),Qt=$t(RegExp.prototype.test),js=dS(TypeError);function $t(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return $u(n,r,o)}}function dS(n){return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return Fu(n,s)}}function Ve(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ao;if(Xh&&Xh(n,null),!is(r))return n;let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const u=s(a);u!==a&&(rS(r)||(r[o]=u),a=u)}n[a]=!0}return n}function fS(n){for(let r=0;r<n.length;r++)Zt(n,r)||(n[r]=null);return n}function un(n){const r=ui(null);for(const o of Yg(n)){var s=tS(o,2);const a=s[0],u=s[1];Zt(n,a)&&(is(u)?r[a]=fS(u):u&&typeof u=="object"&&u.constructor===Object?r[a]=un(u):r[a]=u)}return r}function pS(n){switch(typeof n){case"string":return n;case"number":return cS(n);case"boolean":return uS(n);case"bigint":return em?em(n):"0";case"symbol":return tm?tm(n):"Symbol()";case"undefined":return so(n);case"function":case"object":{if(n===null)return so(n);const r=n,s=ur(r,"toString");if(typeof s=="function"){const o=s(r);return typeof o=="string"?o:so(o)}return so(n)}default:return so(n)}}function ur(n,r){for(;n!==null;){const o=iS(n,r);if(o){if(o.get)return $t(o.get);if(typeof o.value=="function")return $t(o.value)}n=sS(n)}function s(){return null}return s}function hS(n){try{return Qt(n,""),!0}catch{return!1}}const nm=rn(["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"]),xu=rn(["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"]),wu=rn(["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"]),mS=rn(["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"]),ku=rn(["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"]),gS=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rm=rn(["#text"]),sm=rn(["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"]),Su=rn(["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"]),im=rn(["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"]),Oa=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vS=sn(/{{[\w\W]*|^[\w\W]*}}/g),yS=sn(/<%[\w\W]*|^[\w\W]*%>/g),xS=sn(/\${[\w\W]*/g),wS=sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),kS=sn(/^aria-[\-\w]+$/),om=sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),SS=sn(/^(?:\w+script|data):/i),bS=sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TS=sn(/^html$/i),NS=sn(/^[a-z][.\w]*(-[.\w]+)+$/i),am=sn(/<[/\w!]/g),lm=sn(/<[/\w]/g),CS=sn(/<\/no(script|embed|frames)/i),ES=sn(/\/>/i),$n={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_S=function(){return typeof window>"u"?null:window},jS=function(r,s){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(o=s.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return r.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},cm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rs=function(r,s,o,a){return Zt(r,s)&&is(r[s])?Ve(a.base?un(a.base):{},r[s],a.transform):o};function Qg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_S();const r=ie=>Qg(ie);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==$n.document||!n.Element)return r.isSupported=!1,r;let s=n.document;const o=s,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,h=n.Element,g=n.NodeFilter,m=n.NamedNodeMap;m===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const v=n.DOMParser,k=n.trustedTypes,x=h.prototype,b=ur(x,"cloneNode"),E=ur(x,"remove"),C=ur(x,"nextSibling"),T=ur(x,"childNodes"),I=ur(x,"parentNode"),A=ur(x,"shadowRoot"),B=ur(x,"attributes"),$=f&&f.prototype?ur(f.prototype,"nodeType"):null,W=f&&f.prototype?ur(f.prototype,"nodeName"):null,Y=f&&f.prototype?ur(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const ie=s.createElement("template");ie.content&&ie.content.ownerDocument&&(s=ie.content.ownerDocument)}let G,K="",ue,ge=!1,de=0;const pe=function(){if(de>0)throw js('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.')},ve=function(S){pe(),de++;try{return G.createHTML(S)}finally{de--}},Me=function(S){pe(),de++;try{return G.createScriptURL(S)}finally{de--}},ee=function(){return ge||(ue=jS(k,a),ge=!0),ue},re=s,ae=re.implementation,z=re.createNodeIterator,X=re.createDocumentFragment,V=re.getElementsByTagName,j=o.importNode;let L=cm();r.isSupported=typeof Yg=="function"&&typeof I=="function"&&ae&&ae.createHTMLDocument!==void 0;const ce=vS,q=yS,le=xS,fe=wS,Pe=kS,Ce=SS,je=bS,_e=NS;let it=om,Ee=null;const kt=Ve({},[...nm,...xu,...wu,...ku,...rm]);let $e=null;const It=Ve({},[...sm,...Su,...im,...Oa]);let Fe=Object.seal(ui(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}})),Dt=null,_n=null;const St=Object.seal(ui(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mt=!0,pt=!0,en=!1,H=!0,he=!1,Ue=!0,tt=!1,ht=!1,mt=null,Rt=null,Ht=!1,ut=!1,jn=!1,Hn=!1,br=!0,hr=!1;const Rn="user-content-";let An=!0,dn=!1,xn={},Ft=null;const Vt=Ve({},["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 rt=null;const gt=Ve({},["audio","video","img","source","image","track"]);let vt=null;const qt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Gt=ot,Je=!1,_=null;const se=Ve({},[bt,yt,ot],yu),ne=rn(["mi","mo","mn","ms","mtext"]);let ye=Ve({},ne);const ze=rn(["annotation-xml"]);let Be=Ve({},ze);const De=Ve({},["title","style","font","a","script"]);let at=null;const In=["application/xhtml+xml","text/html"],Dn="text/html";let He=null,wn=null;const Or=s.createElement("form"),tr=function(S){return S instanceof RegExp||S instanceof Function},nr=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wn&&wn===S)return;(!S||typeof S!="object")&&(S={}),S=un(S),at=In.indexOf(S.PARSER_MEDIA_TYPE)===-1?Dn:S.PARSER_MEDIA_TYPE,He=at==="application/xhtml+xml"?yu:ao,Ee=rs(S,"ALLOWED_TAGS",kt,{transform:He}),$e=rs(S,"ALLOWED_ATTR",It,{transform:He}),_=rs(S,"ALLOWED_NAMESPACES",se,{transform:yu}),vt=rs(S,"ADD_URI_SAFE_ATTR",qt,{transform:He,base:qt}),rt=rs(S,"ADD_DATA_URI_TAGS",gt,{transform:He,base:gt}),Ft=rs(S,"FORBID_CONTENTS",Vt,{transform:He}),Dt=rs(S,"FORBID_TAGS",un({}),{transform:He}),_n=rs(S,"FORBID_ATTR",un({}),{transform:He}),xn=Zt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?un(S.USE_PROFILES):S.USE_PROFILES:!1,Mt=S.ALLOW_ARIA_ATTR!==!1,pt=S.ALLOW_DATA_ATTR!==!1,en=S.ALLOW_UNKNOWN_PROTOCOLS||!1,H=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,he=S.SAFE_FOR_TEMPLATES||!1,Ue=S.SAFE_FOR_XML!==!1,tt=S.WHOLE_DOCUMENT||!1,ut=S.RETURN_DOM||!1,jn=S.RETURN_DOM_FRAGMENT||!1,Hn=S.RETURN_TRUSTED_TYPE||!1,Ht=S.FORCE_BODY||!1,br=S.SANITIZE_DOM!==!1,hr=S.SANITIZE_NAMED_PROPS||!1,An=S.KEEP_CONTENT!==!1,dn=S.IN_PLACE||!1,it=hS(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:om,Gt=typeof S.NAMESPACE=="string"?S.NAMESPACE:ot,ye=Zt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?un(S.MATHML_TEXT_INTEGRATION_POINTS):Ve({},ne),Be=Zt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?un(S.HTML_INTEGRATION_POINTS):Ve({},ze);const P=Zt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?un(S.CUSTOM_ELEMENT_HANDLING):ui(null);if(Fe=ui(null),Zt(P,"tagNameCheck")&&tr(P.tagNameCheck)&&(Fe.tagNameCheck=P.tagNameCheck),Zt(P,"attributeNameCheck")&&tr(P.attributeNameCheck)&&(Fe.attributeNameCheck=P.attributeNameCheck),Zt(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),sn(Fe),he&&(pt=!1),jn&&(ut=!0),xn&&(Ee=Ve({},rm),$e=ui(null),xn.html===!0&&(Ve(Ee,nm),Ve($e,sm)),xn.svg===!0&&(Ve(Ee,xu),Ve($e,Su),Ve($e,Oa)),xn.svgFilters===!0&&(Ve(Ee,wu),Ve($e,Su),Ve($e,Oa)),xn.mathMl===!0&&(Ve(Ee,ku),Ve($e,im),Ve($e,Oa))),St.tagCheck=null,St.attributeCheck=null,Zt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?St.tagCheck=S.ADD_TAGS:is(S.ADD_TAGS)&&(Ee===kt&&(Ee=un(Ee)),Ve(Ee,S.ADD_TAGS,He))),Zt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?St.attributeCheck=S.ADD_ATTR:is(S.ADD_ATTR)&&($e===It&&($e=un($e)),Ve($e,S.ADD_ATTR,He))),Zt(S,"ADD_URI_SAFE_ATTR")&&is(S.ADD_URI_SAFE_ATTR)&&Ve(vt,S.ADD_URI_SAFE_ATTR,He),Zt(S,"FORBID_CONTENTS")&&is(S.FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,S.FORBID_CONTENTS,He)),Zt(S,"ADD_FORBID_CONTENTS")&&is(S.ADD_FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,S.ADD_FORBID_CONTENTS,He)),An&&(Ee["#text"]=!0),tt&&Ve(Ee,["html","head","body"]),Ee.table&&(Ve(Ee,["tbody"]),delete Dt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw js('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw js('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Q=G;G=S.TRUSTED_TYPES_POLICY;try{K=ve("")}catch(Se){throw G=Q,Se}}else S.TRUSTED_TYPES_POLICY===null?(G=void 0,K=""):(G===void 0&&(G=ee()),G&&typeof K=="string"&&(K=ve("")));rn&&rn(S),wn=S},Xe=Ve({},[...xu,...wu,...mS]),Tt=Ve({},[...ku,...gS]),rr=function(S,P,Q){return P.namespaceURI===ot?S==="svg":P.namespaceURI===bt?S==="svg"&&(Q==="annotation-xml"||ye[Q]):!!Xe[S]},Tl=function(S,P,Q){return P.namespaceURI===ot?S==="math":P.namespaceURI===yt?S==="math"&&Be[Q]:!!Tt[S]},Nl=function(S,P,Q){return P.namespaceURI===yt&&!Be[Q]||P.namespaceURI===bt&&!ye[Q]?!1:!Tt[S]&&(De[S]||!Xe[S])},Nt=function(S){let P=I(S);(!P||!P.tagName)&&(P={namespaceURI:Gt,tagName:"template"});const Q=ao(S.tagName),Se=ao(P.tagName);return _[S.namespaceURI]?S.namespaceURI===yt?rr(Q,P,Se):S.namespaceURI===bt?Tl(Q,P,Se):S.namespaceURI===ot?Nl(Q,P,Se):!!(at==="application/xhtml+xml"&&_[S.namespaceURI]):!1},mr=function(S){li(r.removed,{element:S});try{I(S).removeChild(S)}catch{if(E(S),!I(S))throw js("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},zr=function(S){cs(S);const P=T(S);if(P){const Se=[];ai(P,Ne=>{li(Se,Ne)}),ai(Se,Ne=>{try{E(Ne)}catch{}})}const Q=B(S);if(Q)for(let Se=Q.length-1;Se>=0;--Se){const Ne=Q[Se],Oe=Ne&&Ne.name;if(typeof Oe=="string")try{S.removeAttribute(Oe)}catch{}}},gr=function(S,P){try{li(r.removed,{attribute:P.getAttributeNode(S),from:P})}catch{li(r.removed,{attribute:null,from:P})}if(P.removeAttribute(S),S==="is")if(ut||jn)try{mr(P)}catch{}else try{P.setAttribute(S,"")}catch{}},Ls=function(S){const P=B(S);if(P)for(let Q=P.length-1;Q>=0;--Q){const Se=P[Q],Ne=Se&&Se.name;if(!(typeof Ne!="string"||$e[He(Ne)]))try{S.removeAttribute(Ne)}catch{}}},cs=function(S){const P=[S];for(;P.length>0;){const Q=P.pop();($?$(Q):Q.nodeType)===$n.element&&Ls(Q);const Ne=T(Q);if(Ne)for(let Oe=Ne.length-1;Oe>=0;--Oe)P.push(Ne[Oe])}},Eo=function(S){if(!Ue)return;const P=[S];for(;P.length>0;){const Q=P.pop(),Se=$?$(Q):Q.nodeType;if(Se===$n.processingInstruction||Se===$n.comment&&Qt(lm,Q.data)){try{E(Q)}catch{}continue}if(Se===$n.element){const Oe=Q,Ke=He(W?W(Q):Q.nodeName);try{Oe.hasAttribute&&Oe.hasAttribute("patchsrc")&&Oe.removeAttribute("patchsrc"),Oe.hasAttribute&&Oe.hasAttribute("for")&&Ke!=="label"&&Ke!=="output"&&Oe.removeAttribute("for")}catch{}}const Ne=T(Q);if(Ne)for(let Oe=Ne.length-1;Oe>=0;--Oe)P.push(Ne[Oe])}},us=function(S){let P=null,Q=null;if(Ht)S="<remove></remove>"+S;else{const Oe=Zh(S,/^[\r\n\t ]+/);Q=Oe&&Oe[0]}at==="application/xhtml+xml"&&Gt===ot&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const Se=G?ve(S):S;if(Gt===ot)try{P=new v().parseFromString(Se,at)}catch{}if(!P||!P.documentElement){P=ae.createDocument(Gt,"template",null);try{P.documentElement.innerHTML=Je?K:Se}catch{}}const Ne=P.body||P.documentElement;return S&&Q&&Ne.insertBefore(s.createTextNode(Q),Ne.childNodes[0]||null),Gt===ot?V.call(P,tt?"html":"body")[0]:tt?P.documentElement:Ne},Mn=function(S){const P=Y?Y(S):S.ownerDocument;return z.call(P||S,S,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ps=function(S){return S=ro(S,ce," "),S=ro(S,q," "),S=ro(S,le," "),S},fn=function(S){var P;S.normalize();const Q=Y?Y(S):S.ownerDocument,Se=z.call(Q||S,S,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ne=Se.nextNode();for(;Ne;)Ne.data=Ps(Ne.data),Ne=Se.nextNode();const Oe=(P=S.querySelectorAll)===null||P===void 0?void 0:P.call(S,"template");Oe&&ai(Oe,Ke=>{$r(Ke.content)&&fn(Ke.content)})},Os=function(S){const P=W?W(S):null;return typeof P!="string"||He(P)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==B(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==$(S)||S.childNodes!==T(S)},$r=function(S){if(!$||typeof S!="object"||S===null)return!1;try{return $(S)===$n.documentFragment}catch{return!1}},ds=function(S){if(!$||typeof S!="object"||S===null)return!1;try{return typeof $(S)=="number"}catch{return!1}};function pn(ie,S,P){ie.length!==0&&ai(ie,Q=>{Q.call(r,S,P,wn)})}const zs=function(S,P){return!!(Ue&&S.hasChildNodes()&&!ds(S.firstElementChild)&&Qt(am,S.textContent)&&Qt(am,S.innerHTML)||Ue&&S.namespaceURI===ot&&P==="style"&&ds(S.firstElementChild)||S.nodeType===$n.processingInstruction||Ue&&S.nodeType===$n.comment&&Qt(lm,S.data))},fs=function(S,P,Q){if(!Dt[P]&&Si(P)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,P)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(P)))return!1;if(An&&!Ft[P]){const Se=I(S),Ne=T(S);if(Ne&&Se){const Oe=Ne.length;for(let Ke=Oe-1;Ke>=0;--Ke){const Qe=S===Q?b(Ne[Ke],!0):Ne[Ke];Se.insertBefore(Qe,C(S))}}}return mr(S),!0},ps=function(S,P,Q,Se){return S.length===0?P:P===Q||P===Se?un(P):P},_o=function(S,P){if(pn(L.beforeSanitizeElements,S,null),S!==P&&I(S)===null)return dn&&cs(S),!0;if(Os(S))return mr(S),!0;const Q=He(W?W(S):S.nodeName);if(Ee=ps(L.uponSanitizeElement,Ee,kt,mt),pn(L.uponSanitizeElement,S,{tagName:Q,allowedTags:Ee}),S!==P&&I(S)===null)return dn&&cs(S),!0;if(zs(S,Q))return mr(S),!0;if(Dt[Q]||!(St.tagCheck instanceof Function&&St.tagCheck(Q))&&!Ee[Q]){const Ne=fs(S,Q,P);return Ne===!1&&pn(L.afterSanitizeElements,S,null),Ne}if(($?$(S):S.nodeType)===$n.element&&!Nt(S)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&Qt(CS,S.innerHTML))return mr(S),!0;if(he&&S.nodeType===$n.text){const Ne=Ps(S.textContent);S.textContent!==Ne&&(li(r.removed,{element:S.cloneNode()}),S.textContent=Ne)}return pn(L.afterSanitizeElements,S,null),!1},jo=function(S,P,Q){if(_n[P]||Ue&&P==="patchsrc"||Ue&&P==="for"&&S!=="label"&&S!=="output"||br&&(P==="id"||P==="name")&&(Q in s||Q in Or))return!1;const Se=$e[P]||St.attributeCheck instanceof Function&&St.attributeCheck(P,S);if(!(pt&&Qt(fe,P))){if(!(Mt&&Qt(Pe,P))){if(Se){if(!vt[P]){if(!Qt(it,ro(Q,je,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&S!=="script"&&Jh(Q,"data:")===0&&rt[S])){if(!(en&&!Qt(Ce,ro(Q,je,"")))){if(Q)return!1}}}}}else if(!(Si(S)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,S)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(S))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,P)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(P,S))||P==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,Q)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(Q))))return!1}}return!0},ki=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Si=function(S){return!ki[ao(S)]&&Qt(_e,S)},bi=function(S,P,Q,Se){if(G&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Q)switch(k.getAttributeType(S,P)){case"TrustedHTML":return ve(Se);case"TrustedScriptURL":return Me(Se)}return Se},hs=function(S,P,Q,Se){try{Q?S.setAttributeNS(Q,P,Se):S.setAttribute(P,Se),Os(S)?mr(S):Qh(r.removed)}catch{gr(P,S)}},Ro=function(S){pn(L.beforeSanitizeAttributes,S,null);const P=S.attributes;if(!P||Os(S))return;$e=ps(L.uponSanitizeAttribute,$e,It,Rt);const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let Se=P.length;const Ne=He(S.nodeName);for(;Se--;){const Oe=P[Se],Ke=Oe.name,Qe=Oe.namespaceURI,Ct=Oe.value,Et=He(Ke),Tr=Ct;let Lt=Ke==="value"?Tr:lS(Tr);if(Q.attrName=Et,Q.attrValue=Lt,Q.keepAttr=!0,Q.forceKeepAttr=void 0,pn(L.uponSanitizeAttribute,S,Q),Lt=Q.attrValue,hr&&(Et==="id"||Et==="name")&&Jh(Lt,Rn)!==0&&(gr(Ke,S),Lt=Rn+Lt),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Lt)){gr(Ke,S);continue}if(Et==="attributename"&&Zh(Lt,"href")){gr(Ke,S);continue}if(!Q.forceKeepAttr){if(!Q.keepAttr){gr(Ke,S);continue}if(!H&&Qt(ES,Lt)){gr(Ke,S);continue}if(he&&(Lt=Ps(Lt)),!jo(Ne,Et,Lt)){gr(Ke,S);continue}Lt=bi(Ne,Et,Qe,Lt),Lt!==Tr&&hs(S,Ke,Qe,Lt)}}pn(L.afterSanitizeAttributes,S,null)},Fr=function(S){let P=null;const Q=Mn(S);for(pn(L.beforeSanitizeShadowDOM,S,null);P=Q.nextNode();)if(pn(L.uponSanitizeShadowNode,P,null),_o(P,S),Ro(P),$r(P.content)&&Fr(P.content),($?$(P):P.nodeType)===$n.element){const Ne=A(P);$r(Ne)&&(Ge(Ne),Fr(Ne))}pn(L.afterSanitizeShadowDOM,S,null)},Ge=function(S){const P=[{node:S,shadow:null}];for(;P.length>0;){const Q=P.pop();if(Q.shadow){Fr(Q.shadow);continue}const Se=Q.node,Oe=($?$(Se):Se.nodeType)===$n.element,Ke=T(Se);if(Ke)for(let Qe=Ke.length-1;Qe>=0;--Qe)P.push({node:Ke[Qe],shadow:null});if(Oe){const Qe=W?W(Se):null;if(typeof Qe=="string"&&He(Qe)==="template"){const Ct=Se.content;$r(Ct)&&P.push({node:Ct,shadow:null})}}if(Oe){const Qe=A(Se);$r(Qe)&&P.push({node:null,shadow:Qe},{node:Qe,shadow:null})}}};return r.sanitize=function(ie){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,Q=null,Se=null,Ne=null;if(Je=!ie,Je&&(ie="<!-->"),typeof ie!="string"&&!ds(ie)&&(ie=pS(ie),typeof ie!="string"))throw js("dirty is not a string, aborting");if(!r.isSupported)return ie;ht?(Ee=mt,$e=Rt):nr(S),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(Ee=un(Ee)),L.uponSanitizeAttribute.length>0&&($e=un($e)),r.removed=[];const Oe=dn&&typeof ie!="string"&&ds(ie);if(Oe){Eo(ie);const Ct=W?W(ie):ie.nodeName;if(typeof Ct=="string"){const Et=He(Ct);if(!Ee[Et]||Dt[Et])throw zr(ie),js("root node is forbidden and cannot be sanitized in-place")}if(Os(ie))throw zr(ie),js("root node is clobbered and cannot be sanitized in-place");try{Ge(ie)}catch(Et){throw zr(ie),Et}}else if(ds(ie))P=us("<!---->"),Q=P.ownerDocument.importNode(ie,!0),Q.nodeType===$n.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?P=Q:P.appendChild(Q),Ge(Q);else{if(!ut&&!he&&!tt&&ie.indexOf("<")===-1)return G&&Hn?ve(ie):ie;if(P=us(ie),!P)return ut?null:Hn?K:""}P&&Ht&&mr(P.firstChild);const Ke=Oe?ie:P;try{const Ct=Mn(Ke);for(;Se=Ct.nextNode();)_o(Se,Ke),Ro(Se),$r(Se.content)&&Fr(Se.content)}catch(Ct){throw Oe&&(zr(ie),ai(r.removed,Et=>{Et.element&&cs(Et.element)})),Ct}if(Oe)return ai(r.removed,Ct=>{Ct.element&&cs(Ct.element)}),he&&fn(ie),ie;if(ut){if(he&&fn(P),jn)for(Ne=X.call(P.ownerDocument);P.firstChild;)Ne.appendChild(P.firstChild);else Ne=P;return($e.shadowroot||$e.shadowrootmode)&&(Ne=j.call(o,Ne,!0)),Ne}let Qe=tt?P.outerHTML:P.innerHTML;return tt&&Ee["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&Qt(TS,P.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
|
|
460
|
+
`+Qe),he&&(Qe=Ps(Qe)),G&&Hn?ve(Qe):Qe},r.setConfig=function(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nr(ie),ht=!0,mt=Ee,Rt=$e},r.clearConfig=function(){wn=null,ht=!1,mt=null,Rt=null,G=ue,K=""},r.isValidAttribute=function(ie,S,P){wn||nr({});const Q=He(ie),Se=He(S);return jo(Q,Se,P)},r.addHook=function(ie,S){typeof S=="function"&&Zt(L,ie)&&li(L[ie],S)},r.removeHook=function(ie,S){if(Zt(L,ie)){if(S!==void 0){const P=oS(L[ie],S);return P===-1?void 0:aS(L[ie],P,1)[0]}return Qh(L[ie])}},r.removeHooks=function(ie){Zt(L,ie)&&(L[ie]=[])},r.removeAllHooks=function(){L=cm()},r}var Sd=Qg();const RS=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function um(n){return RS.has(n.type)}function AS({items:n,runtimeType:r,turn:s,threads:o=[]}){const[a,u]=w.useState(!1);if(n.length===0)return null;const f=n.length;return c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>u(h=>!h),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(mw,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(sd,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&c.jsx("div",{className:"tool-calls-body",children:n.map(h=>c.jsx(Dr,{item:h,runtimeType:r,turn:s,threads:o},h.id))})]})}qe.setOptions({breaks:!0,gfm:!0});function IS(n){const r=qe.parse(n);return Sd.sanitize(r)}function dm(n,r){var a;const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;s.nextNode();){const u=s.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>r)return{node:u,offset:r-o};o+=f}return null}function DS(n,r,s){const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const f=document.createRange();f.selectNodeContents(u),!(f.compareBoundaryPoints(Range.START_TO_END,r)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,r)>=0||a.push(u))}for(const u of a){const f=u.length;let h=0,g=f;if(u===r.startContainer&&(h=Math.min(r.startOffset,f)),u===r.endContainer&&(g=Math.min(r.endOffset,f)),h>=g)continue;g<f&&u.splitText(g);const m=h>0?u.splitText(h):u,v=s(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function MS(n,r){n.querySelectorAll("mark[data-thread-id]").forEach(s=>{const o=s.parentNode;if(!o)return;const a=document.createTextNode(s.textContent||"");o.replaceChild(a,s),o.normalize()});for(const s of r){if(s.start_offset===null||s.end_offset===null)continue;const o=dm(n,s.start_offset),a=dm(n,s.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),DS(n,u,()=>{const f=document.createElement("mark");return f.setAttribute("data-thread-id",s.id),s.status==="resolved"&&f.classList.add("thread-mark-resolved"),f})}}function LS(n){const r=window.getSelection();if(!r||r.rangeCount===0)return null;const s=r.getRangeAt(0);if(s.collapsed||!n.contains(s.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(s.startContainer,s.startOffset);const a=o.toString().length,u=s.toString();return{start:a,end:a+u.length,text:u}}function PS({itemId:n,turnId:r,sessionId:s,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),h=w.useRef(null),g=w.useRef(""),m=w.useRef(0),[v,k]=w.useState(!1),[x,b]=w.useState({x:0,y:0}),[E,C]=w.useState(!1),[T,I]=w.useState({x:0,y:0}),[A,B]=w.useState(""),[$,W]=w.useState(null),[Y,G]=w.useState(!1),K=M(V=>V.createThread),ue=M(V=>V.switchRightTab),ge=M(V=>pl(V.sessionDetails[s])),de=w.useCallback(async()=>{await Lu(o||""),G(!0),setTimeout(()=>G(!1),1500)},[o]),pe=w.useCallback(()=>{var j;if(!$)return;const V=`
|
|
456
461
|
\`\`\`QUOTE
|
|
457
462
|
${$.text}
|
|
458
463
|
\`\`\`
|
|
459
464
|
|
|
460
|
-
`;
|
|
465
|
+
`;M.setState({quotedText:V}),k(!1),W(null),(j=window.getSelection())==null||j.removeAllRanges()},[$]),ve=w.useMemo(()=>IS(o||"…"),[o]),Me=w.useMemo(()=>a.filter(V=>V.item_id===n),[a,n]);w.useEffect(()=>{u.current&&MS(u.current,Me)},[ve,Me]),w.useEffect(()=>{g.current=A},[A]),w.useEffect(()=>{function V(j){f.current&&!f.current.contains(j.target)&&(k(!1),g.current.trim()||C(!1))}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const ee=w.useCallback(()=>{k(!1),g.current.trim()||C(!1)},[]),re=w.useCallback(()=>{const V=u.current;if(!V)return;const j=LS(V);if(j&&j.text.trim().length>0){const L=window.getSelection();if(L&&L.rangeCount>0&&L.anchorNode&&L.focusNode){const q=L.getRangeAt(0).getBoundingClientRect(),le=28,fe=6,Pe=170;let Ce=!1;try{const it=document.createRange();it.setStart(L.focusNode,L.focusOffset),it.setEnd(L.focusNode,L.focusOffset);const Ee=document.createRange();Ee.setStart(L.anchorNode,L.anchorOffset),Ee.setEnd(L.anchorNode,L.anchorOffset),Ce=Ee.compareBoundaryPoints(Range.START_TO_START,it)>0}catch{Ce=!1}let je=q.top-le-fe;je<8&&(je=q.bottom+fe);let _e=Ce?q.left-Pe:q.right;_e=Math.max(8,Math.min(_e,window.innerWidth-Pe-8)),b({x:_e,y:je}),k(!0),W(j)}}else k(!1)},[]);w.useEffect(()=>{function V(j){const L=j.target;L&&(L.closest(".selection-actions")||L.closest(".thread-create-popover"))||re()}return document.addEventListener("mouseup",V),()=>document.removeEventListener("mouseup",V)},[re]);const ae=w.useCallback(()=>{k(!1),C(!0),I({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!E)return;const V=h.current;if(!V)return;const j=V.offsetWidth,L=V.offsetHeight,ce=8;let q=x.x,le=x.y;q-j<ce&&(q=j+ce),q>window.innerWidth-ce&&(q=window.innerWidth-ce),le<ce&&(le=ce),le+L>window.innerHeight-ce&&(le=window.innerHeight-L-ce),I({x:q,y:le})},[E,x]);const z=w.useCallback(async()=>{var V;ge||!$||!A.trim()||(await K(s,{itemId:n,turnId:r,startOffset:$.start,endOffset:$.end,selectedText:$.text,message:A.trim()}),B(""),C(!1),W(null),(V=window.getSelection())==null||V.removeAllRanges(),ue("threads"))},[$,A,K,s,n,r,ue,ge]),X=w.useCallback(V=>{const j=V.target;if(j.tagName==="MARK"&&j.hasAttribute("data-thread-id")){V.preventDefault(),ue("threads");const L=j.getAttribute("data-thread-id");setTimeout(()=>{const ce=document.getElementById(`thread-${L}`);ce&&(ce.scrollIntoView({behavior:"smooth",block:"center"}),ce.classList.add("thread-card-highlighted"),setTimeout(()=>ce.classList.remove("thread-card-highlighted"),1500))},100)}},[ue]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:ve},onMouseDown:ee,onClick:X}),c.jsx("button",{className:`copy-text-btn${Y?" copied":""}`,onClick:de,title:Y?"Copied":"Copy message","aria-label":"Copy message text",children:Y?c.jsx(os,{size:14}):c.jsx(Ru,{size:14})}),v&&!E&&c.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!ge&&c.jsxs("button",{className:"discuss-button",onClick:ae,title:"Start a discussion about this text",children:[c.jsx(J0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:pe,title:"Quote this text in your message",children:[c.jsx(og,{size:14}),c.jsx("span",{children:"Quote"})]})]}),E&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:T.x,top:T.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',$==null?void 0:$.text.slice(0,80),$&&$.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),W(null)},children:c.jsx(Wn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:A,onChange:V=>B(V.target.value),autoFocus:!0,rows:2,onKeyDown:V=>{if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),z()),V.key==="Escape")if(g.current.trim()){const j=Date.now();m.current&&j-m.current<400?(m.current=0,C(!1),W(null)):m.current=j}else C(!1),W(null)}}),c.jsxs("div",{className:"thread-create-footer",children:[c.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),c.jsxs("button",{className:"thread-create-send",onClick:z,disabled:!A.trim()||ge,title:ge?"Wait for the running turn to finish first":void 0,children:[c.jsx(ko,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const fm=w.memo(PS),ul=new Map,Zg=new Set,Uu=new Set,pm=new Map;function Jg(){Uu.forEach(n=>n())}function ev(n,r){return`${n}:${r}`}function OS(n,r,s,o,a){var g;const u=ev(r,s),f=ul.get(n)??new Map,h=new Map(f);((g=h.get(u))==null?void 0:g.answer)===a?h.delete(u):h.set(u,{itemIndex:r,groupIndex:s,question:o,answer:a}),ul.set(n,h),Jg()}function zS(n){ul.delete(n),Jg()}function $S(n){Zg.add(n),zS(n)}function FS(n){const r=w.useCallback(s=>(Uu.add(s),()=>{Uu.delete(s)}),[]);return w.useSyncExternalStore(r,()=>ul.get(n)??pm,()=>pm)}function US(n){return[...n].sort((r,s)=>r.itemIndex-s.itemIndex||r.groupIndex-s.groupIndex).map(r=>`> ${r.question}
|
|
461
466
|
${r.answer}`).join(`
|
|
462
467
|
|
|
463
|
-
`)}function hm({item:n,turn:r}){var b;const s=n.data??{},o=w.useMemo(()=>Array.isArray(s.groups)?s.groups.filter(E=>!!E&&Array.isArray(E.selections)&&E.selections.length>0):[],[s.groups]),a=
|
|
464
|
-
… (truncated, click to expand)`:I;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(lg,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),B&&c.jsx("span",{className:"turn-header-meta",children:B})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),I&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),$&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(Y=>!Y),children:u?"Show less":`Show full output (${(I.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,T=Array.isArray(C)?C:[],I=`${T.length} file${T.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(L0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:I})]}),c.jsx("div",{className:"file-change-list",children:T.map((A,B)=>{const $=A.kind==="add"?"A":A.kind==="delete"?"D":"M",W=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:$}),c.jsx("span",{className:"fc-name",children:A.path})]},B)})})]})}case"mcp_tool_call":{const C=n.data||{},T=C.tool||"mcp";if(T==="Agent"){const K=C.arguments,ue=(K==null?void 0:K.description)||(K==null?void 0:K.prompt)||"Subagent",ge=n.status==="failed",de=a?"running…":ge?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ls,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ue}),c.jsx("span",{className:`agent-call-status ${a?"running":ge?"failed":"done"}`,children:de})]})}const I=C.server||"",A=C.arguments,B=C.result,$=C.error,W=n.status==="failed"||!!$,Y=a?"running…":W?"failed":"done",G=((g=B==null?void 0:B.content)==null?void 0:g.filter(K=>K.type==="text").map(K=>K.text))??[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Z0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),I&&c.jsx("span",{className:"turn-header-meta",children:I}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:Y})]}),A&&Object.keys(A).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(A).map(([K,ue])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:K}),K==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ue)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ue=="string"?ue:JSON.stringify(ue,null,2)})]},K))}),G.length>0&&G.map((K,ue)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:K})},ue)),$&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:$})})]})}case"web_search":{const C=((m=n.data)==null?void 0:m.query)||"";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(ew,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:C})]})}case"todo_list":{const C=((v=n.data)==null?void 0:v.items)||[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(U0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((T,I)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(os,{size:14}):c.jsx(Ds,{size:14})," ",T.text]},I))})]})}case"ask_user":return c.jsx(hm,{item:n,turn:s});case"final_result":{const C=n.data??{},T=C.text||"",I=C.html||null,A=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:B,iconText:$}=ju(r??"codex");return c.jsxs(c.Fragment,{children:[(T||I)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${B}`,children:$}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(fm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:T,threads:o,runtimeType:r}),I&&c.jsx(HS,{html:I})]}),A.length>0&&c.jsx(hm,{item:n,turn:s})]})}case"background_task":{const C=n.data||{},T=C.task_type||"unknown",I=C.subagent_type||null,A=C.description||"",B=C.status||"running",$=C.last_tool_name||null,W=C.token_count||null,Y=T==="local_agent",G=T==="local_bash",K=Y?ls:G?ag:tg,ue=Y?`Subagent${I?`: ${I}`:""}`:G?"Monitor":"Background Task",ge=B==="running"?"running…":B==="completed"?"done":B==="failed"?"failed":B==="stopped"?"stopped":B,de=n.status==="failed"||B==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(K,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ue}),c.jsx("span",{className:"turn-header-meta",style:de?{color:"var(--red)"}:void 0,children:ge})]}),A&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:A}),$&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",$,W!=null&&` · ${W.toLocaleString()} tokens`]}),c.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 C=((k=n.data)==null?void 0:k.trigger)??"auto",T=((x=n.data)==null?void 0:x.pre_tokens)??0,I=((b=n.data)==null?void 0:b.post_tokens)??0,A=T>0?Math.round((1-I/T)*100):0,B=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(V0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:B})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",I.toLocaleString()," tokens (",A,"% reduction)"]})]})}case"interruption":return c.jsx(PS,{item:n});case"error":{const C=((E=n.data)==null?void 0:E.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(gl,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:C})})]})}default:return null}}const Dr=w.memo(VS,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function qS({turn:n,runtimeType:r,threads:s=[]}){Ot.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const A=n.items.some(B=>B.type==="background_task"&&B.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!A&&a(!1)},[n.status,n.items]);let u=-1;for(let A=n.items.length-1;A>=0;A--)if(n.items[A].type==="agent_message"){u=A;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,g=n.items.some(A=>A.type==="final_result"||A.type==="ask_user"),m=!f&&n.status==="completed"&&n.agent_response&&!g?{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(A=>{var B;return!(A.type==="reasoning"&&(!((B=A.data)!=null&&B.text)||A.data.text===""))}).filter(A=>!(A.type==="background_task"||A.type==="ask_user"||A.type==="final_result")),x=[];let b=null;for(const A of k)A.type==="agent_message"?(b&&x.push(b),b={agentMessage:A,toolItems:[],otherItems:[]}):A.type==="interruption"||A.type==="error"?(b&&x.push(b),x.push({agentMessage:null,toolItems:[],otherItems:[A]}),b=null):(b||(b={agentMessage:null,toolItems:[],otherItems:[]}),um(A)?b.toolItems.push(A):b.otherItems.push(A));b&&x.push(b);const E=k.filter(A=>um(A)).length,C=E>0||k.length>0&&(n.status==="running"||n.status==="pending"),T=n.status==="pending"&&n.resume_state==="waiting",I=n.resume_state==="gave_up"||n.resume_state==="skipped"||n.resume_state==="unsupported";return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(FS,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(A=>!A),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(z0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:E>0?`${E} tool call${E>1?"s":""}`:T?"interrupted":"thinking…"}),c.jsx(sd,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:x.map((A,B)=>c.jsxs("div",{className:"intermediate-segment",children:[A.agentMessage&&c.jsx(Dr,{item:A.agentMessage,runtimeType:r,turn:n,threads:s}),A.otherItems.map($=>c.jsx(Dr,{item:$,runtimeType:r,turn:n,threads:s},$.id)),A.toolItems.length>0&&c.jsx(SS,{items:A.toolItems,runtimeType:r,turn:n,threads:s})]},B))})]}),n.items.filter(A=>A.type==="background_task").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},`task-${A.id}`)),f&&c.jsx(Dr,{item:n.items[u],runtimeType:r,turn:n,threads:s},n.items[u].id),m&&c.jsx(Dr,{item:m,runtimeType:r,turn:n,threads:s},m.id),f&&n.items.slice(u+1).filter(A=>A.type!=="ask_user"&&A.type!=="background_task"&&A.type!=="final_result").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},A.id)),n.items.filter(A=>A.type==="final_result").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},`final-${A.id}`)),n.items.filter(A=>A.type==="ask_user").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},`ask-${A.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&!I&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})}),n.status==="running"&&c.jsx($S,{turnId:n.id}),c.jsx(zS,{turn:n}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(Ds,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const GS=w.memo(qS),KS=[],za=50;function YS(){Ot.trackRender("RenderArea");const n=L(x=>x.activeSessionId),r=L(x=>x.activeSessionId?x.sessionDetails[x.activeSessionId]:null),s=L(x=>x.submittingPrompt),o=L(x=>x.loading),a=(r==null?void 0:r.turns)??[],u=(r==null?void 0:r.threads)??KS,f=w.useRef(null),[h,g]=w.useState(za);w.useEffect(()=>{g(za)},[n]);const m=a.filter(x=>!x.thread_id),v=Math.max(0,m.length-h),k=m.slice(v);return w.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[n,a.length]),o&&!r?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):r?c.jsxs("div",{className:"render-scroll",ref:f,children:[s&&c.jsx("div",{className:"turn-block",children:c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:s})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),a.length===0&&!s&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),v>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(x=>x+za),children:["Show ",Math.min(za,v)," earlier turns (",v," hidden)"]})}),k.map((x,b)=>c.jsx("div",{id:`turn-${v+b}`,className:"turn-block",children:c.jsx(GS,{turn:x,runtimeType:r.runtime_type,threads:u})},x.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const XS=w.memo(YS),QS=[{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 ZS(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function JS(n,r,s=[]){const o=[...QS,...ZS(s)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!r[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function eb({commands:n,selectedIndex:r,onSelect:s,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===r?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>s(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function bu({title:n,options:r,currentValue:s,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),r.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===s?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===s&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function tb(n){return vn("/skills")}function nb({filter:n,onSelect:r,onClose:s}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,g]=w.useState(0),m=w.useRef(null);w.useEffect(()=>{tb().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{g(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),g(b=>Math.min(b+1,v.length-1))):x.key==="ArrowUp"?(x.preventDefault(),g(b=>Math.max(b-1,0))):x.key==="Enter"?(x.preventDefault(),v[h]&&r(v[h])):x.key==="Escape"&&(x.preventDefault(),s())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,h,r,s]),c.jsxs("div",{className:"slash-popup",ref:m,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:s,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,x)=>c.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>g(x),onClick:()=>r(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function rb(){return vn("/providers")}function sb(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return vn(`/providers/${n}/commands${s}`)}const ib={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function ob(n){const[r,s]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{rb().then(s).catch(()=>s([])).finally(()=>a(!1))},[]);const u=r.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??ib,loading:o}}const ci=32,Tu=200;function ym(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function xm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let wm=0;function ab(){return wm+=1,`att-${Date.now()}-${wm}`}function lb(){Ot.trackRender("CommandInputBar");const[n,r]=w.useState(""),s=w.useRef(null),o=w.useRef(ci),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:g}=L(),m=L(H=>H.activeSessionId),v=L(H=>H.activeSessionId?H.sessionDetails[H.activeSessionId]:null),k=L(H=>H.quotedText),x=Hm(v),b=!!(v!=null&&v.turns.some(H=>H.status==="pending"&&H.resume_state==="waiting")),E=!m,{capabilities:C}=ob(v==null?void 0:v.runtime_type),T=(v==null?void 0:v.runtime_type)??null,I=C.imageAttachments,[A,B]=w.useState([]),[$,W]=w.useState(!1),[Y,G]=w.useState(null),[K,ue]=w.useState([]);w.useEffect(()=>{if(!T){ue([]);return}let H=!1;return sb(T,(v==null?void 0:v.cwd)??void 0).then(he=>{H||ue(he)}).catch(()=>{H||ue([])}),()=>{H=!0}},[T,v==null?void 0:v.cwd]);const[ge,de]=w.useState(!1),[pe,ve]=w.useState(""),[Me,ee]=w.useState(0),[re,ae]=w.useState(void 0),[z,X]=w.useState(!1),[V,j]=w.useState(""),[M,ce]=w.useState([]),q=ge?JS(pe,C,K):[];w.useEffect(()=>{k!==null&&(r(H=>H+k),setTimeout(()=>{if(s.current){Ee(),s.current.focus();const H=s.current.value.length;s.current.setSelectionRange(H,H)}},0),L.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function H(he){he.key==="Escape"&&(he.preventDefault(),f())}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[x,f]),w.useEffect(()=>{de(!1),ae(void 0),X(!1),ce([]),B(H=>{for(const he of H)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[m]),w.useEffect(()=>{if(!Y)return;function H(he){he.key==="Escape"&&(he.preventDefault(),G(null))}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[Y]);const le=w.useCallback(H=>{if(!H)return;const he=Array.from(H);for(const Ue of he){const tt=new FileReader;tt.onload=()=>{const mt=tt.result.split(",")[1]??"",Rt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;B(Ht=>[...Ht,{id:ab(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:mt,previewUrl:Rt,size:Ue.size}])},tt.readAsDataURL(Ue)}},[]),fe=w.useCallback(H=>{B(he=>{const Ue=he.find(tt=>tt.id===H);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(tt=>tt.id!==H)})},[]),Pe=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!(!I||x)&&W(!0)},[I,x]),Ce=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),W(!1)},[]),je=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),W(!1),!(!I||x)&&le(H.dataTransfer.files)},[I,x,le]),_e=w.useCallback(H=>{var tt;if(!I)return;const he=(tt=H.clipboardData)==null?void 0:tt.items;if(!he)return;const Ue=[];for(let ht=0;ht<he.length;ht++){const mt=he[ht];if(mt.type.startsWith("image/")){const Rt=mt.getAsFile();Rt&&Ue.push(Rt)}}Ue.length>0&&(H.preventDefault(),le(Ue))},[I,le]);function it(H){const he=s.current;he&&(he.style.height=`${H}px`,o.current=H)}function Ee(){const H=s.current;if(H){if(H.scrollHeight>H.clientHeight){const he=Math.min(H.scrollHeight,Tu);he!==o.current&&it(he);return}o.current>ci&&(H.style.height="auto",it(Math.min(H.scrollHeight,Tu)))}}function kt(){const H=n.trim();if(!H||x)return;let he=H;M.length>0&&(he=`${M.map(ht=>`$${ht.name}`).join(" ")}
|
|
468
|
+
`)}function hm({item:n,turn:r}){var b;const s=n.data??{},o=w.useMemo(()=>Array.isArray(s.groups)?s.groups.filter(E=>!!E&&Array.isArray(E.selections)&&E.selections.length>0):[],[s.groups]),a=FS(r.id),u=M(E=>r.session_id?E.sessionDetails[r.session_id]:null),f=M(E=>E.activeSessionId),h=r.items.findIndex(E=>E.id===n.id),g=u?((b=u.turns[u.turns.length-1])==null?void 0:b.id)===r.id:!0,m=Zg.has(r.id),v=m||Hm(u)||!g||r.session_id!==f,k=(E,C,T)=>{v||OS(r.id,h,E,C,T)},x=()=>{const E=[...a.values()];if(E.length===0)return;const C=US(E);$S(r.id),M.getState().submitPrompt(C)};return c.jsxs("div",{className:"render-content ask-user-card",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(z0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),m&&c.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?c.jsxs("div",{className:"ask-user-groups",children:[o.map((E,C)=>c.jsxs("div",{className:"ask-user-group",children:[E.question&&c.jsx("div",{className:"ask-user-question",children:E.question}),c.jsx("div",{className:"ask-user-options",children:E.selections.map(T=>{var A;const I=((A=a.get(ev(h,C)))==null?void 0:A.answer)===T;return c.jsx("button",{type:"button",className:`ask-user-option ${I?"selected":""}`,disabled:v,onClick:()=>k(C,E.question,T),children:T},T)})})]},C)),v?m&&c.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):c.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:x,children:[c.jsx(ko,{size:12}),"Send"]})]}):s.question?c.jsx("p",{className:"user-message",children:s.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const BS={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error"};function lo(n){return n&&BS[n]||"interrupted"}function dl(n){if(!n)return"";const r=new Date(n);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function WS(n){switch(n){case"network":return"Interrupted — network error. Will resume when the connection is back.";case"process_exit":return"Interrupted — the agent process stopped. Resuming automatically…";case"host_shutdown":return"Interrupted — the agent host shut down. Resuming automatically…";default:return"Interrupted — the agent host restarted. Resuming automatically…"}}function HS(n){return n.items.filter(r=>r.type==="interruption").map(r=>r.data)}function VS({item:n}){const r=n.data,s=dl(r.interrupted_at);let o="";switch(r.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=r.resumed_at?`resumed ${dl(r.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return c.jsx("div",{className:"interruption-marker",title:r.detail??void 0,children:c.jsxs("span",{children:["Interrupted",s?` ${s}`:""," (",lo(r.reason),") · ",o]})})}function qS({turn:n,label:r}){const[s,o]=w.useState(!1),a=M(f=>f.addToast),u=()=>{o(!0),ax(n.session_id,n.id).catch(f=>a("error",`Could not resume the turn — ${f.message}`)).finally(()=>o(!1))};return c.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:s,children:[c.jsx(ag,{size:12}),r]})}function GS({turn:n}){const r=n.resume_state;if(!r||r==="cancelled")return null;const s=n.interrupt_reason,o=HS(n),a=o[o.length-1],u=dl(n.interrupted_at??(a==null?void 0:a.interrupted_at));if(r==="resumed"){const m=dl(a==null?void 0:a.resumed_at),v=n.status==="running"||n.status==="pending";return c.jsxs("div",{className:"interruption-banner resumed","data-state":"resumed",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(ag,{size:12})}),c.jsxs("span",{className:"banner-text",children:["Interrupted",u?` ${u}`:""," (",lo(s),") · resumed",m?` ${m}`:"",v?" — continuing…":""]})]})}let f,h=null,g=null;switch(r){case"waiting":f=WS(s),g="Resume now";break;case"resuming":f=`Interrupted (${lo(s)}) — resuming from where it left off…`;break;case"gave_up":{const m=Math.max(o.length,1);f=`Interrupted ${m===1?"once":`${m} times`} — automatic resume stopped.`,h=n.error&&!n.error.startsWith("Automatic resume stopped")?n.error:null,g="Resume";break}case"skipped":f=`Interrupted${u?` ${u}`:""} (${lo(s)}) — too long ago to resume automatically.`,g="Resume";break;default:f=`Interrupted (${lo(s)}) — this turn cannot be resumed.`,h=n.error}return c.jsxs("div",{className:"interruption-banner","data-state":r,children:[c.jsx("span",{className:"banner-icon",children:s==="network"?c.jsx(ug,{size:12}):c.jsx(gl,{size:12})}),c.jsxs("span",{className:"banner-text",children:[f,h&&c.jsx("span",{className:"banner-detail",children:h})]}),g&&c.jsx(qS,{turn:n,label:g})]})}function KS({turnId:n}){const r=M(o=>o.retryStates[n]);if(!r)return null;const s=r.errorStatus?`API error ${r.errorStatus}`:"Connection problem";return c.jsxs("div",{className:"retry-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(ug,{size:12})}),c.jsxs("span",{className:"banner-text",children:[s," — retrying (attempt ",r.attempt," of ",r.maxRetries,")…"]})]})}qe.setOptions({breaks:!0,gfm:!0});function YS({attachments:n}){const[r,s]=w.useState(null);return w.useEffect(()=>{if(!r)return;function o(a){a.key==="Escape"&&s(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),!Array.isArray(n)||n.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"attachment-pills",children:n.map((o,a)=>{const u=o.media_type.startsWith("image/"),f=`data:${o.media_type};base64,${o.data}`;return c.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>s(f):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?c.jsx("img",{src:f,alt:o.name,className:"attachment-pill-thumb"}):c.jsx(rg,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),r&&c.jsx("div",{className:"image-preview-modal",onClick:()=>s(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:r,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>s(null),children:c.jsx(Wn,{size:20})})]})})]})}function XS(n){const r=qe.parse(n);return Sd.sanitize(r)}function mm(n){var r;return(r=n.data)!=null&&r.text?n.data.text:""}function QS(n){const r=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return r?r[1]:n}const gm='<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 ZS(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${gm}</body>`):n+gm}function JS({html:n}){const[r,s]=w.useState(480),o=w.useRef(null);return w.useEffect(()=>{function a(u){var f;u.source===((f=o.current)==null?void 0:f.contentWindow)&&typeof u.data=="number"&&u.data>0&&s(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:ZS(n),title:"HTML content",style:{width:"100%",height:`${r}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const vm=1e4;function eb({item:n,runtimeType:r,turn:s,threads:o}){var h,g,m,v,k,x,b,E;const a=n.status==="in_progress",[u,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:C,iconText:T}=ju(r??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${C}`,children:T}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(fm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:mm(n)||"…",threads:o,runtimeType:r})]})}case"reasoning":return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(P0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:XS(mm(n))}})]});case"command_execution":{const C=n.data||{},T=QS(C.command||""),I=C.aggregated_output||"",A=C.exit_code,B=a?"running…":A!==null?`exit ${A}`:"",$=I.length>vm,W=$&&!u?I.slice(0,vm)+`
|
|
469
|
+
… (truncated, click to expand)`:I;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(cg,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),B&&c.jsx("span",{className:"turn-header-meta",children:B})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),I&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),$&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(Y=>!Y),children:u?"Show less":`Show full output (${(I.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,T=Array.isArray(C)?C:[],I=`${T.length} file${T.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(H0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:I})]}),c.jsx("div",{className:"file-change-list",children:T.map((A,B)=>{const $=A.kind==="add"?"A":A.kind==="delete"?"D":"M",W=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:$}),c.jsx("span",{className:"fc-name",children:A.path})]},B)})})]})}case"mcp_tool_call":{const C=n.data||{},T=C.tool||"mcp";if(T==="Agent"){const K=C.arguments,ue=(K==null?void 0:K.description)||(K==null?void 0:K.prompt)||"Subagent",ge=n.status==="failed",de=a?"running…":ge?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ls,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ue}),c.jsx("span",{className:`agent-call-status ${a?"running":ge?"failed":"done"}`,children:de})]})}const I=C.server||"",A=C.arguments,B=C.result,$=C.error,W=n.status==="failed"||!!$,Y=a?"running…":W?"failed":"done",G=((g=B==null?void 0:B.content)==null?void 0:g.filter(K=>K.type==="text").map(K=>K.text))??[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(aw,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),I&&c.jsx("span",{className:"turn-header-meta",children:I}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:Y})]}),A&&Object.keys(A).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(A).map(([K,ue])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:K}),K==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ue)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ue=="string"?ue:JSON.stringify(ue,null,2)})]},K))}),G.length>0&&G.map((K,ue)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:K})},ue)),$&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:$})})]})}case"web_search":{const C=((m=n.data)==null?void 0:m.query)||"";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(cw,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:C})]})}case"todo_list":{const C=((v=n.data)==null?void 0:v.items)||[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(X0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((T,I)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(os,{size:14}):c.jsx(Ds,{size:14})," ",T.text]},I))})]})}case"ask_user":return c.jsx(hm,{item:n,turn:s});case"final_result":{const C=n.data??{},T=C.text||"",I=C.html||null,A=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:B,iconText:$}=ju(r??"codex");return c.jsxs(c.Fragment,{children:[(T||I)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${B}`,children:$}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(fm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:T,threads:o,runtimeType:r}),I&&c.jsx(JS,{html:I})]}),A.length>0&&c.jsx(hm,{item:n,turn:s})]})}case"background_task":{const C=n.data||{},T=C.task_type||"unknown",I=C.subagent_type||null,A=C.description||"",B=C.status||"running",$=C.last_tool_name||null,W=C.token_count||null,Y=T==="local_agent",G=T==="local_bash",K=Y?ls:G?lg:ng,ue=Y?`Subagent${I?`: ${I}`:""}`:G?"Monitor":"Background Task",ge=B==="running"?"running…":B==="completed"?"done":B==="failed"?"failed":B==="stopped"?"stopped":B,de=n.status==="failed"||B==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(K,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ue}),c.jsx("span",{className:"turn-header-meta",style:de?{color:"var(--red)"}:void 0,children:ge})]}),A&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:A}),$&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",$,W!=null&&` · ${W.toLocaleString()} tokens`]}),c.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 C=((k=n.data)==null?void 0:k.trigger)??"auto",T=((x=n.data)==null?void 0:x.pre_tokens)??0,I=((b=n.data)==null?void 0:b.post_tokens)??0,A=T>0?Math.round((1-I/T)*100):0,B=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(ew,{size:14})}),c.jsx("span",{className:"turn-header-title",children:B})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",I.toLocaleString()," tokens (",A,"% reduction)"]})]})}case"interruption":return c.jsx(VS,{item:n});case"error":{const C=((E=n.data)==null?void 0:E.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(gl,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:C})})]})}default:return null}}const Dr=w.memo(eb,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function tb({turn:n,runtimeType:r,threads:s=[]}){Ot.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const A=n.items.some(B=>B.type==="background_task"&&B.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!A&&a(!1)},[n.status,n.items]);let u=-1;for(let A=n.items.length-1;A>=0;A--)if(n.items[A].type==="agent_message"){u=A;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,g=n.items.some(A=>A.type==="final_result"||A.type==="ask_user"),m=!f&&n.status==="completed"&&n.agent_response&&!g?{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(A=>{var B;return!(A.type==="reasoning"&&(!((B=A.data)!=null&&B.text)||A.data.text===""))}).filter(A=>!(A.type==="background_task"||A.type==="ask_user"||A.type==="final_result")),x=[];let b=null;for(const A of k)A.type==="agent_message"?(b&&x.push(b),b={agentMessage:A,toolItems:[],otherItems:[]}):A.type==="interruption"||A.type==="error"?(b&&x.push(b),x.push({agentMessage:null,toolItems:[],otherItems:[A]}),b=null):(b||(b={agentMessage:null,toolItems:[],otherItems:[]}),um(A)?b.toolItems.push(A):b.otherItems.push(A));b&&x.push(b);const E=k.filter(A=>um(A)).length,C=E>0||k.length>0&&(n.status==="running"||n.status==="pending"),T=n.status==="pending"&&n.resume_state==="waiting",I=n.resume_state==="gave_up"||n.resume_state==="skipped"||n.resume_state==="unsupported";return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(YS,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(A=>!A),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(G0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:E>0?`${E} tool call${E>1?"s":""}`:T?"interrupted":"thinking…"}),c.jsx(sd,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:x.map((A,B)=>c.jsxs("div",{className:"intermediate-segment",children:[A.agentMessage&&c.jsx(Dr,{item:A.agentMessage,runtimeType:r,turn:n,threads:s}),A.otherItems.map($=>c.jsx(Dr,{item:$,runtimeType:r,turn:n,threads:s},$.id)),A.toolItems.length>0&&c.jsx(AS,{items:A.toolItems,runtimeType:r,turn:n,threads:s})]},B))})]}),n.items.filter(A=>A.type==="background_task").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},`task-${A.id}`)),f&&c.jsx(Dr,{item:n.items[u],runtimeType:r,turn:n,threads:s},n.items[u].id),m&&c.jsx(Dr,{item:m,runtimeType:r,turn:n,threads:s},m.id),f&&n.items.slice(u+1).filter(A=>A.type!=="ask_user"&&A.type!=="background_task"&&A.type!=="final_result").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},A.id)),n.items.filter(A=>A.type==="final_result").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},`final-${A.id}`)),n.items.filter(A=>A.type==="ask_user").map(A=>c.jsx(Dr,{item:A,runtimeType:r,turn:n,threads:s},`ask-${A.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&!I&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})}),n.status==="running"&&c.jsx(KS,{turnId:n.id}),c.jsx(GS,{turn:n}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(Ds,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const nb=w.memo(tb),rb=[],za=50;function sb(){Ot.trackRender("RenderArea");const n=M(x=>x.activeSessionId),r=M(x=>x.activeSessionId?x.sessionDetails[x.activeSessionId]:null),s=M(x=>x.submittingPrompt),o=M(x=>x.loading),a=(r==null?void 0:r.turns)??[],u=(r==null?void 0:r.threads)??rb,f=w.useRef(null),[h,g]=w.useState(za);w.useEffect(()=>{g(za)},[n]);const m=a.filter(x=>!x.thread_id),v=Math.max(0,m.length-h),k=m.slice(v);return w.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[n,a.length]),o&&!r?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):r?c.jsxs("div",{className:"render-scroll",ref:f,children:[s&&c.jsx("div",{className:"turn-block",children:c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:s})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),a.length===0&&!s&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),v>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(x=>x+za),children:["Show ",Math.min(za,v)," earlier turns (",v," hidden)"]})}),k.map((x,b)=>c.jsx("div",{id:`turn-${v+b}`,className:"turn-block",children:c.jsx(nb,{turn:x,runtimeType:r.runtime_type,threads:u})},x.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const ib=w.memo(sb),ob=[{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 ab(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function lb(n,r,s=[]){const o=[...ob,...ab(s)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!r[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function cb({commands:n,selectedIndex:r,onSelect:s,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===r?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>s(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function bu({title:n,options:r,currentValue:s,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),r.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===s?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===s&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function ub(n){return vn("/skills")}function db({filter:n,onSelect:r,onClose:s}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,g]=w.useState(0),m=w.useRef(null);w.useEffect(()=>{ub().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{g(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),g(b=>Math.min(b+1,v.length-1))):x.key==="ArrowUp"?(x.preventDefault(),g(b=>Math.max(b-1,0))):x.key==="Enter"?(x.preventDefault(),v[h]&&r(v[h])):x.key==="Escape"&&(x.preventDefault(),s())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,h,r,s]),c.jsxs("div",{className:"slash-popup",ref:m,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:s,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,x)=>c.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>g(x),onClick:()=>r(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function fb(){return vn("/providers")}function pb(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return vn(`/providers/${n}/commands${s}`)}const hb={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function mb(n){const[r,s]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{fb().then(s).catch(()=>s([])).finally(()=>a(!1))},[]);const u=r.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??hb,loading:o}}const ci=32,Tu=200;function ym(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function xm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let wm=0;function gb(){return wm+=1,`att-${Date.now()}-${wm}`}function vb(){Ot.trackRender("CommandInputBar");const[n,r]=w.useState(""),s=w.useRef(null),o=w.useRef(ci),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:g}=M(),m=M(H=>H.activeSessionId),v=M(H=>H.activeSessionId?H.sessionDetails[H.activeSessionId]:null),k=M(H=>H.quotedText),x=Hm(v),b=!!(v!=null&&v.turns.some(H=>H.status==="pending"&&H.resume_state==="waiting")),E=!m,{capabilities:C}=mb(v==null?void 0:v.runtime_type),T=(v==null?void 0:v.runtime_type)??null,I=C.imageAttachments,[A,B]=w.useState([]),[$,W]=w.useState(!1),[Y,G]=w.useState(null),[K,ue]=w.useState([]);w.useEffect(()=>{if(!T){ue([]);return}let H=!1;return pb(T,(v==null?void 0:v.cwd)??void 0).then(he=>{H||ue(he)}).catch(()=>{H||ue([])}),()=>{H=!0}},[T,v==null?void 0:v.cwd]);const[ge,de]=w.useState(!1),[pe,ve]=w.useState(""),[Me,ee]=w.useState(0),[re,ae]=w.useState(void 0),[z,X]=w.useState(!1),[V,j]=w.useState(""),[L,ce]=w.useState([]),q=ge?lb(pe,C,K):[];w.useEffect(()=>{k!==null&&(r(H=>H+k),setTimeout(()=>{if(s.current){Ee(),s.current.focus();const H=s.current.value.length;s.current.setSelectionRange(H,H)}},0),M.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function H(he){he.key==="Escape"&&(he.preventDefault(),f())}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[x,f]),w.useEffect(()=>{de(!1),ae(void 0),X(!1),ce([]),B(H=>{for(const he of H)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[m]),w.useEffect(()=>{if(!Y)return;function H(he){he.key==="Escape"&&(he.preventDefault(),G(null))}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[Y]);const le=w.useCallback(H=>{if(!H)return;const he=Array.from(H);for(const Ue of he){const tt=new FileReader;tt.onload=()=>{const mt=tt.result.split(",")[1]??"",Rt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;B(Ht=>[...Ht,{id:gb(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:mt,previewUrl:Rt,size:Ue.size}])},tt.readAsDataURL(Ue)}},[]),fe=w.useCallback(H=>{B(he=>{const Ue=he.find(tt=>tt.id===H);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(tt=>tt.id!==H)})},[]),Pe=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!(!I||x)&&W(!0)},[I,x]),Ce=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),W(!1)},[]),je=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),W(!1),!(!I||x)&&le(H.dataTransfer.files)},[I,x,le]),_e=w.useCallback(H=>{var tt;if(!I)return;const he=(tt=H.clipboardData)==null?void 0:tt.items;if(!he)return;const Ue=[];for(let ht=0;ht<he.length;ht++){const mt=he[ht];if(mt.type.startsWith("image/")){const Rt=mt.getAsFile();Rt&&Ue.push(Rt)}}Ue.length>0&&(H.preventDefault(),le(Ue))},[I,le]);function it(H){const he=s.current;he&&(he.style.height=`${H}px`,o.current=H)}function Ee(){const H=s.current;if(H){if(H.scrollHeight>H.clientHeight){const he=Math.min(H.scrollHeight,Tu);he!==o.current&&it(he);return}o.current>ci&&(H.style.height="auto",it(Math.min(H.scrollHeight,Tu)))}}function kt(){const H=n.trim();if(!H||x)return;let he=H;L.length>0&&(he=`${L.map(ht=>`$${ht.name}`).join(" ")}
|
|
465
470
|
|
|
466
|
-
${H}`);const Ue=A.map(({id:tt,previewUrl:ht,size:mt,...Rt})=>Rt);r(""),ce([]),it(ci),de(!1),ae(void 0),X(!1);for(const tt of A)tt.previewUrl&&URL.revokeObjectURL(tt.previewUrl);B([]),u(he,Ue.length>0?Ue:void 0)}function $e(H){if(H.insertAsText){const he=`/${H.id} `;r(he),de(!1),ae(void 0),requestAnimationFrame(()=>{if(s.current){s.current.focus();const Ue=he.length;s.current.setSelectionRange(Ue,Ue),Ee()}});return}H.subPopup?ae(H.subPopup):H.id==="skills"?(X(!0),j(""),de(!1),r("")):H.id==="model"?(g(!0),de(!1),r("")):(de(!1),r(""))}function It(H){ce(he=>[...he,H]),X(!1),r(""),it(ci)}function Fe(H){const he=ym(v==null?void 0:v.runtime_config);re==="sandbox"?he.sandboxMode=H:re==="websearch"?he.webSearchMode=H:re==="network"&&(he.networkAccessEnabled=H==="true"),h(he),ae(void 0),de(!1),r(""),it(ci)}function Dt(H){if(Ot.markKeystroke(),ge&&!re){if(H.key==="ArrowDown"){H.preventDefault(),ee(he=>Math.min(he+1,q.length-1));return}if(H.key==="ArrowUp"){H.preventDefault(),ee(he=>Math.max(he-1,0));return}if(H.key==="Enter"){H.preventDefault(),q[Me]&&$e(q[Me]);return}if(H.key==="Escape"){H.preventDefault(),de(!1),r("");return}}if(re&&H.key==="Escape"){H.preventDefault(),ae(void 0);return}if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&!x){H.preventDefault(),kt();return}H.key==="Escape"&&x&&(H.preventDefault(),f())}function _n(H){Ot.markInputChange();const he=H.target.value;r(he),Ee(),he.startsWith("/")&&!he.includes(" ")&&!x?(de(!0),ve(he.slice(1)),ee(0)):(de(!1),ae(void 0)),he.startsWith("$")&&!x?(X(!0),j(he.slice(1))):he.startsWith("$")||X(!1)}const St=ym(v==null?void 0:v.runtime_config),Mt=[{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"}],pt=[{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"}],en=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return c.jsxs("div",{className:`cmd-bar${$?" drag-over":""}`,onDragOver:Pe,onDragLeave:Ce,onDrop:je,children:[ge&&!re&&c.jsx(
|
|
467
|
-
… (truncated, click to expand)`:x,de=b?null:g==="completed"?c.jsx(os,{size:12}):B?c.jsx(gl,{size:12}):c.jsx(Ds,{size:12});return c.jsxs("div",{className:`task-card ${b?"task-running":""} ${B?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(pe=>!pe),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(T,{size:14})}),c.jsx("span",{className:"task-card-type",children:I}),c.jsxs("span",{className:`task-card-status ${B?"task-status-failed":b?"task-status-running":"task-status-done"}`,children:[de," ",A]}),c.jsx(sd,{size:14,className:"task-card-chevron",style:{transform:$?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),b&&v&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",v,k!=null&&` · ${k.toLocaleString()} tokens`]}),$&&c.jsxs("div",{className:"task-card-body",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:K,children:c.jsx("code",{children:ge})}),ue&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>G(pe=>!pe),children:Y?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):m?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:m})}):b?c.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):c.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),c.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",s+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const
|
|
471
|
+
${H}`);const Ue=A.map(({id:tt,previewUrl:ht,size:mt,...Rt})=>Rt);r(""),ce([]),it(ci),de(!1),ae(void 0),X(!1);for(const tt of A)tt.previewUrl&&URL.revokeObjectURL(tt.previewUrl);B([]),u(he,Ue.length>0?Ue:void 0)}function $e(H){if(H.insertAsText){const he=`/${H.id} `;r(he),de(!1),ae(void 0),requestAnimationFrame(()=>{if(s.current){s.current.focus();const Ue=he.length;s.current.setSelectionRange(Ue,Ue),Ee()}});return}H.subPopup?ae(H.subPopup):H.id==="skills"?(X(!0),j(""),de(!1),r("")):H.id==="model"?(g(!0),de(!1),r("")):(de(!1),r(""))}function It(H){ce(he=>[...he,H]),X(!1),r(""),it(ci)}function Fe(H){const he=ym(v==null?void 0:v.runtime_config);re==="sandbox"?he.sandboxMode=H:re==="websearch"?he.webSearchMode=H:re==="network"&&(he.networkAccessEnabled=H==="true"),h(he),ae(void 0),de(!1),r(""),it(ci)}function Dt(H){if(Ot.markKeystroke(),ge&&!re){if(H.key==="ArrowDown"){H.preventDefault(),ee(he=>Math.min(he+1,q.length-1));return}if(H.key==="ArrowUp"){H.preventDefault(),ee(he=>Math.max(he-1,0));return}if(H.key==="Enter"){H.preventDefault(),q[Me]&&$e(q[Me]);return}if(H.key==="Escape"){H.preventDefault(),de(!1),r("");return}}if(re&&H.key==="Escape"){H.preventDefault(),ae(void 0);return}if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&!x){H.preventDefault(),kt();return}H.key==="Escape"&&x&&(H.preventDefault(),f())}function _n(H){Ot.markInputChange();const he=H.target.value;r(he),Ee(),he.startsWith("/")&&!he.includes(" ")&&!x?(de(!0),ve(he.slice(1)),ee(0)):(de(!1),ae(void 0)),he.startsWith("$")&&!x?(X(!0),j(he.slice(1))):he.startsWith("$")||X(!1)}const St=ym(v==null?void 0:v.runtime_config),Mt=[{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"}],pt=[{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"}],en=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return c.jsxs("div",{className:`cmd-bar${$?" drag-over":""}`,onDragOver:Pe,onDragLeave:Ce,onDrop:je,children:[ge&&!re&&c.jsx(cb,{commands:q,selectedIndex:Me,onSelect:$e,onHover:ee}),ge&&re==="sandbox"&&c.jsx(bu,{title:"Sandbox Mode",options:Mt,currentValue:St.sandboxMode,onSelect:Fe,onClose:()=>ae(void 0)}),ge&&re==="websearch"&&c.jsx(bu,{title:"Web Search",options:pt,currentValue:St.webSearchMode,onSelect:Fe,onClose:()=>ae(void 0)}),ge&&re==="network"&&c.jsx(bu,{title:"Network Access",options:en,currentValue:St.networkAccessEnabled===!0?"true":"false",onSelect:Fe,onClose:()=>ae(void 0)}),z&&c.jsx(db,{filter:V,onSelect:It,onClose:()=>{X(!1),r("")}}),L.length>0&&c.jsx("div",{className:"skill-badges",children:L.map(H=>c.jsxs("span",{className:"skill-badge",children:["$",H.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>ce(he=>he.filter(Ue=>Ue.id!==H.id)),children:"×"})]},H.id))}),A.length>0&&c.jsx("div",{className:"attachment-preview-area",children:A.map(H=>c.jsxs("div",{className:"attachment-chip",title:H.name,children:[H.previewUrl?c.jsx("img",{src:H.previewUrl,alt:H.name,className:"attachment-thumb",onClick:()=>G(H),style:{cursor:"pointer"}}):c.jsx(rg,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:H.name}),c.jsx("span",{className:"attachment-size",children:xm(H.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>fe(H.id),title:"Remove attachment",children:c.jsx(Wn,{size:14})})]},H.id))}),I&&!x&&!E&&c.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:H=>{le(H.target.files),H.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[I&&!x&&!E&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var H;return(H=a.current)==null?void 0:H.click()},title:"Attach files",disabled:x,children:c.jsx(iw,{size:16})}),c.jsx("textarea",{ref:s,className:"cmd-textarea",placeholder:E?"Select or create a session…":b?"Interrupted — waiting to resume…":x?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:x||E,rows:1,style:{minHeight:ci,maxHeight:Tu},onChange:_n,onKeyDown:Dt,onPaste:_e}),x?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(Ds,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:kt,disabled:!n.trim()||E,title:"Send (⌘↵)",children:c.jsx(M0,{size:16})})]}),Y&&c.jsx("div",{className:"image-preview-modal",onClick:()=>G(null),children:c.jsxs("div",{className:"image-preview-content",onClick:H=>H.stopPropagation(),children:[c.jsx("img",{src:Y.previewUrl,alt:Y.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:Y.name}),c.jsx("span",{children:xm(Y.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>G(null),children:c.jsx(Wn,{size:20})})]})})]})}function yb(){const n=M(T=>T.activeSessionId),r=M(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),s=M(T=>T.activeTurnIndex),o=M(T=>T.setActiveTurnIndex),a=M(T=>T.rewindToTurn),u=M(T=>T.restoreSession),f=M(T=>T.branchFromTurn),h=(r==null?void 0:r.turns)??[],g=pl(r),m=!!(r!=null&&r.rewound_at_turn_id),v=(r==null?void 0:r.runtime_type)==="repoburg",k=v?"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,b]=w.useState(null),E=w.useRef(null);if(ml(E,()=>b(null),!!x),td(()=>b(null),!!x),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(T){o(T),requestAnimationFrame(()=>{var I;(I=document.getElementById(`turn-${T}`))==null||I.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((T,I)=>{const A=I===s,B=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,$=T.status==="running"||T.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${A?"active":""}`,onClick:()=>C(I),onContextMenu:W=>{W.preventDefault(),b({x:W.clientX,y:W.clientY,turnId:T.id,turnIndex:I,isLast:I===h.length-1,isSlashCommand:T.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(hw,{size:12})}),c.jsx("span",{className:"turn-item-label",children:B}),$&&c.jsx("span",{className:"turn-item-status",children:T.status==="pending"&&T.resume_state==="waiting"?"interrupted":"running…"})]})},T.id)}),x&&c.jsxs("div",{ref:E,className:"ctx-menu",style:{position:"fixed",left:x.x,top:x.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${x.isLast||g||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||g||x.isSlashCommand||(window.confirm(k)&&a(n,x.turnId),b(null))},children:[c.jsx(lw,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),m&&!v&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),b(null)},children:[c.jsx(vo,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,x.turnId),b(null)},children:[c.jsx(V0,{size:12})," Branch from Here"]})]})]})}const km=2e4;function xb(n){const r=[];return n.forEach((s,o)=>{var a;for(const u of s.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;r.push({item:u,turnIndex:o,turnPrompt:s.user_prompt})}}),r}function wb({entry:n}){const{item:r,turnIndex:s,turnPrompt:o}=n,a=r.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",g=a.status||"running",m=a.summary||null,v=a.last_tool_name||null,k=a.token_count||null,x=a.output||"",b=r.status==="in_progress",E=u==="local_agent",C=u==="local_bash",T=E?ls:C?lg:ng,I=E?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",A=g==="running"?"running…":g==="completed"?"done":g==="failed"?"failed":g==="stopped"?"stopped":g,B=r.status==="failed"||g==="failed",[$,W]=w.useState(b),[Y,G]=w.useState(!1),K=w.useRef(null);w.useEffect(()=>{b&&W(!0)},[b]),w.useEffect(()=>{$&&b&&K.current&&(K.current.scrollTop=K.current.scrollHeight)},[$,b,x]);const ue=x.length>km,ge=ue&&!Y?x.slice(0,km)+`
|
|
472
|
+
… (truncated, click to expand)`:x,de=b?null:g==="completed"?c.jsx(os,{size:12}):B?c.jsx(gl,{size:12}):c.jsx(Ds,{size:12});return c.jsxs("div",{className:`task-card ${b?"task-running":""} ${B?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(pe=>!pe),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(T,{size:14})}),c.jsx("span",{className:"task-card-type",children:I}),c.jsxs("span",{className:`task-card-status ${B?"task-status-failed":b?"task-status-running":"task-status-done"}`,children:[de," ",A]}),c.jsx(sd,{size:14,className:"task-card-chevron",style:{transform:$?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),b&&v&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",v,k!=null&&` · ${k.toLocaleString()} tokens`]}),$&&c.jsxs("div",{className:"task-card-body",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:K,children:c.jsx("code",{children:ge})}),ue&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>G(pe=>!pe),children:Y?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):m?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:m})}):b?c.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):c.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),c.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",s+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const kb=w.memo(wb);function Sb(){var g,m;const n=M(v=>v.activeSessionId?v.sessionDetails[v.activeSessionId]:null),r=M(v=>v.activeSessionId?v.backgroundTasks[v.activeSessionId]:void 0),s=(n==null?void 0:n.turns)??[],o=r??[],a=xb(s),u=[...a].sort((v,k)=>{const x=v.item.status==="in_progress",b=k.item.status==="in_progress";return x&&!b?-1:!x&&b?1:k.turnIndex-v.turnIndex}),f=new Map;for(const v of o)v.task_type==="local_bash"&&f.set(v.task_id,v.task_type);for(const v of a)if(v.item.status==="in_progress"){const k=((g=v.item.data)==null?void 0:g.task_id)??v.item.external_item_id,x=((m=v.item.data)==null?void 0:m.task_type)??"unknown";f.set(k,x)}const h=[...f.values()].filter(v=>v==="local_bash").length;return a.length===0?c.jsx("div",{className:"empty-state",children:"No background tasks yet"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Background Tasks (",a.length,")",h>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",h," running"]})]}),u.map(v=>c.jsx(kb,{entry:v},v.item.id))]})}const bb=w.memo(Sb),Tb="Your job is to answer questions about this session:",Sm="Understand the user's question below, read the session file given above, and answer.",Nb=new Set(["claude"]);function Cb(n){return Nb.has(n)}function bd(n){return n.kind==="sidecar"}function Eb(n){const r=(n??[]).filter(bd);return r.length?r[r.length-1]:null}function _b(n){if(!n.startsWith(Tb))return n;const r=n.indexOf(Sm);return r<0?n:n.slice(r+Sm.length).replace(/^\n+/,"")}function jb({thread:n,onClose:r}){const{activeSessionId:s,resolveThread:o,shareThread:a}=M(),[u,f]=w.useState(""),[h,g]=w.useState(!1),[m,v]=w.useState(!1);async function k(){if(!s||h)return;g(!0),await a(s,n.id,u)?r():g(!1)}async function x(){!s||m||(v(!0),await o(s,n.id),r())}const b=h||m;return c.jsx("div",{className:"dialog-overlay",onClick:b?void 0:r,children:c.jsxs("div",{className:"dialog",onClick:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Resolve thread"}),c.jsx("button",{className:"dialog-close",onClick:r,disabled:b,children:c.jsx(Wn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.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."}),c.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",c.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:E=>f(E.target.value),rows:3,disabled:b,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:r,disabled:b,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:x,disabled:b,title:"Resolve without sharing",children:[m?c.jsx(Jn,{size:13,className:"spin"}):c.jsx(Qa,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:b,children:[h?c.jsx(Jn,{size:13,className:"spin"}):c.jsx(uw,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const bm=[];qe.setOptions({breaks:!0,gfm:!0});function Rb(n){const r=qe.parse(n);return Sd.sanitize(r)}function Ab(n){var r,s,o;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((s=n.data)==null?void 0:s.groups)?n.data.groups:[],u=[(o=n.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
|
|
468
473
|
|
|
469
|
-
`):null}return null}function
|
|
474
|
+
`):null}return null}function Ib(n){const r=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return r?r[1]:n}function tv({turn:n,formatPrompt:r=Ib}){const s=r(n.user_prompt),o=n.items.map(Ab).filter(a=>a!==null);return o.length===0&&n.status==="completed"&&n.agent_response&&o.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:s}),o.map((a,u)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:Rb(a)}},u)),o.length===0&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"thread-card-pending",children:n.status==="running"?"AI is responding…":"Waiting…"}),n.status==="failed"&&c.jsx("div",{className:"thread-card-pending",children:n.error||"Turn failed"})]})}function Db({thread:n,threadTurns:r,onStop:s,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var ve,Me,ee;const[g,m]=w.useState(""),[v,k]=w.useState(!0),x=w.useRef(null),b=w.useRef(null),[E,C]=w.useState(!1),[T,I]=w.useState({x:0,y:0}),[A,B]=w.useState(""),$=r.some(as),W=28,Y=120,G=w.useRef(W);w.useEffect(()=>{const re=b.current;re&&(re.scrollTop=re.scrollHeight)},[r.length,v]);function K(re){const ae=x.current;ae&&(ae.style.height=`${re}px`,G.current=re)}function ue(){const re=x.current;if(re){if(re.scrollHeight>re.clientHeight){const ae=Math.min(re.scrollHeight,Y);ae!==G.current&&K(ae);return}G.current>W&&(re.style.height="auto",K(Math.min(re.scrollHeight,Y)))}}const ge=w.useCallback(()=>{C(!1)},[]),de=w.useCallback(()=>{const re=b.current;if(!re)return;const ae=window.getSelection();if(!ae||ae.rangeCount===0||ae.isCollapsed){C(!1);return}const z=ae.getRangeAt(0);if(!re.contains(z.commonAncestorContainer)){C(!1);return}const X=z.commonAncestorContainer.nodeType===Node.TEXT_NODE?z.commonAncestorContainer.parentElement:z.commonAncestorContainer;if(!(X!=null&&X.closest(".thread-card-ai-response"))){C(!1);return}const V=ae.toString();if(!V.trim()){C(!1);return}const j=z.getBoundingClientRect(),L=28,ce=6,q=170;let le=!1;if(ae.anchorNode&&ae.focusNode)try{const Ce=document.createRange();Ce.setStart(ae.focusNode,ae.focusOffset),Ce.setEnd(ae.focusNode,ae.focusOffset);const je=document.createRange();je.setStart(ae.anchorNode,ae.anchorOffset),je.setEnd(ae.anchorNode,ae.anchorOffset),le=je.compareBoundaryPoints(Range.START_TO_START,Ce)>0}catch{le=!1}let fe=j.top-L-ce;fe<8&&(fe=j.bottom+ce);let Pe=le?j.left-q:j.right;Pe=Math.max(8,Math.min(Pe,window.innerWidth-q-8)),I({x:Pe,y:fe}),B(V),C(!0)},[]);w.useEffect(()=>{function re(ae){const z=ae.target;z&&z.closest(".selection-actions")||de()}return document.addEventListener("mouseup",re),()=>document.removeEventListener("mouseup",re)},[de]);const pe=w.useCallback(()=>{var ae;const re=`
|
|
470
475
|
\`\`\`QUOTE
|
|
471
476
|
${A}
|
|
472
477
|
\`\`\`
|
|
473
478
|
|
|
474
|
-
`;m(z=>z+re),C(!1),B(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(x.current){ue(),x.current.focus();const z=x.current.value.length;x.current.setSelectionRange(z,z)}},0)},[A]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(re=>!re),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((ee=(Me=(ve=n.turns)==null?void 0:ve[0])==null?void 0:Me.user_prompt)==null?void 0:ee.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),c.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&c.jsx("button",{className:"thread-locate-btn",onClick:re=>{re.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(q0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),v&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:b,onMouseDown:ge,children:[r.map(re=>c.jsx(ev,{turn:re},re.id)),r.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),E&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:pe,title:"Quote this text in your follow-up",children:[c.jsx(ig,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:$?"Agent is running…":"Type a follow-up…",value:g,onChange:re=>{Ot.markInputChange(),m(re.target.value),ue()},disabled:$,rows:1,style:{minHeight:W,maxHeight:Y},onKeyDown:re=>{Ot.markKeystroke(),re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&!$&&g.trim()&&(re.preventDefault(),f(g.trim()),m(""),K(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:$||!g.trim(),onClick:()=>{f(g.trim()),m("")},children:c.jsx(ko,{size:13})}),$&&c.jsx("button",{className:"thread-card-followup-stop",onClick:s,title:"Stop this thread's turn (Esc)",children:c.jsx(Ds,{size:13})})]}),c.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?c.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[c.jsx(Qa,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(vo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(ur,{size:13})," Delete"]})]})]})]})}function Nb(){Ot.trackRender("ThreadsPanel");const n=L(I=>I.activeSessionId),r=L(I=>{var A;return I.activeSessionId?((A=I.sessionDetails[I.activeSessionId])==null?void 0:A.threads)??bm:bm}),s=w.useMemo(()=>r.filter(I=>!bd(I)),[r]),o=L(I=>I.followupThread),a=L(I=>I.cancelThreadTurn),u=L(I=>I.reopenThread),f=L(I=>I.deleteThread),h=L(I=>I.deepLinkThreadId),g=L(I=>I.setDeepLinkThreadId),[m,v]=w.useState("open"),[k,x]=w.useState(null);w.useEffect(()=>{if(!h)return;const I=h;g(null),v(B=>s.some($=>$.id===I&&$.status==="open")?B:"all");const A=setTimeout(()=>{const B=document.getElementById(`thread-${I}`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("thread-card-highlighted"),setTimeout(()=>B.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(A)},[h,g,s]);const b=s.filter(I=>m==="open"?I.status==="open":m==="resolved"?I.status==="resolved":!0),E=s.filter(I=>I.status==="open").length,C=s.filter(I=>I.status==="resolved").length;function T(I){setTimeout(()=>{const A=document.querySelector(`mark[data-thread-id="${I}"]`);A&&(A.scrollIntoView({behavior:"smooth",block:"center"}),A.classList.add("thread-mark-flash"),setTimeout(()=>A.classList.remove("thread-mark-flash"),1500))},50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(sg,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"No threads yet."}),c.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):c.jsxs("div",{children:[c.jsxs("div",{className:"thread-filter-tabs",children:[c.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",E,")"]}),c.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",s.length,")"]})]}),b.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):b.map(I=>c.jsx(Tb,{thread:I,threadTurns:I.turns??[],onStop:()=>a(n,I.id),onResolve:()=>x(I),onReopen:()=>u(n,I.id),onDelete:()=>f(n,I.id),onFollowup:A=>o(n,I.id,A),onLocate:()=>T(I.id)},I.id)),k&&c.jsx(wb,{thread:k,onClose:()=>x(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function Cb(){const n=L(f=>f.apps),r=L(f=>f.activeAppTabId),s=L(f=>f.openAppTab),o=L(f=>f.startAppEdit),a=L(f=>f.toggleAppPin),u=L(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${r===f.id?" active":""}`,onClick:()=>s(f.id),title:f.description??void 0,children:[c.jsx("span",{className:"sidebar-app-icon",children:f.icon??"◧"}),c.jsxs("div",{className:"apps-panel-info",children:[c.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&c.jsx("span",{className:"apps-panel-desc",children:f.description})]}),c.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:h=>{h.stopPropagation(),o(f.id)},children:c.jsx(Ua,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:h=>{h.stopPropagation(),a(f.id)},children:c.jsx(Za,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:c.jsx(ur,{size:12})})]},f.id))})}function Eb(){Ot.trackRender("SidecarPanel");const n=L(T=>T.activeSessionId),r=L(T=>{var I;return T.activeSessionId?(I=T.sessionDetails[T.activeSessionId])==null?void 0:I.runtime_type:void 0}),s=L(T=>{var I;return T.activeSessionId?yb((I=T.sessionDetails[T.activeSessionId])==null?void 0:I.threads):null}),o=L(T=>T.askSidecar),a=L(T=>T.cancelThreadTurn),u=L(T=>T.deleteThread),[f,h]=w.useState(""),[g,m]=w.useState(!1),v=w.useRef(null),k=(s==null?void 0:s.turns)??[],x=k[k.length-1],b=k.some(as);if(w.useEffect(()=>{var T,I;(I=(T=v.current)==null?void 0:T.scrollIntoView)==null||I.call(T,{block:"end"})},[k.length,x==null?void 0:x.items.length,x==null?void 0:x.status]),!n||!r)return c.jsx("div",{className:"empty-state",children:"No session selected"});if(!vb(r))return c.jsxs("div",{className:"empty-state",children:[c.jsx(ls,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsxs("div",{children:["The sidecar is not available for ",r," sessions yet."]})]});const E=!b&&!g&&f.trim().length>0;async function C(){if(!n||!E)return;m(!0);const T=await o(n,f.trim());m(!1),T&&h("")}return c.jsxs("div",{className:"sidecar-panel",children:[c.jsxs("div",{className:"sidecar-conversation",children:[k.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(ls,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"Ask about this session."}),c.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):k.map(T=>c.jsx(ev,{turn:T,formatPrompt:xb},T.id)),c.jsx("div",{ref:v})]}),c.jsxs("div",{className:"sidecar-footer",children:[c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:b?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:f,rows:2,disabled:b,onChange:T=>{Ot.markInputChange(),h(T.target.value)},onKeyDown:T=>{Ot.markKeystroke(),T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),C())}}),b&&s?c.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>a(n,s.id),children:c.jsx(Ds,{size:13})}):c.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!E,onClick:()=>void C(),children:c.jsx(ko,{size:13})})]}),s&&c.jsx("div",{className:"thread-card-actions",children:c.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:b,onClick:()=>u(n,s.id),children:[c.jsx(ur,{size:13})," Clear"]})})]})]})}function _b(){var g;Ot.trackRender("RightPanel");const n=L(m=>m.activeRightTab),r=L(m=>m.switchRightTab),s=L(m=>m.rightPanelCollapsed),o=L(m=>m.toggleRightPanel),a=L(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=L(m=>{var v;return m.activeSessionId?((v=m.backgroundTasks[m.activeSessionId])==null?void 0:v.length)??0:0}),f=((g=a==null?void 0:a.threads)==null?void 0:g.filter(m=>m.status==="open"&&!bd(m)).length)??0,h=[{id:"turns",label:"Turns",icon:F0},{id:"sidecar",label:"Sidecar",icon:ls},{id:"tasks",label:"Tasks",icon:$0,badge:u||void 0},{id:"threads",label:"Threads",icon:sg,badge:f||void 0},{id:"apps",label:"Apps",icon:rg}];return s?c.jsxs("div",{className:"ide-right collapsed",children:[c.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:c.jsx(K0,{size:15})}),c.jsx("div",{className:"right-rail-divider"}),h.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return c.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${n===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>r(m.id),children:[c.jsx(v,{size:15}),m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):c.jsxs("div",{className:"ide-right",children:[c.jsxs("div",{className:"right-header",children:[c.jsx("div",{className:"right-tabs",children:h.map(m=>c.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),c.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:c.jsx(G0,{size:14})})]}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(cb,{}),n==="sidecar"&&c.jsx(Eb,{}),n==="tasks"&&c.jsx(hb,{}),n==="threads"&&c.jsx(Nb,{}),n==="apps"&&c.jsx(Cb,{})]})]})}const Re={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"}},Bu=[{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:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.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:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]}]}];function jb(n){return Bu.find(r=>r.id===n)}function Td(n){const r=jb(n);return(r==null?void 0:r.models)??[]}function tv(n,r){return Td(n).find(s=>s.slug===r)}function Wu(n,r){var s;return((s=tv(n,r))==null?void 0:s.reasoningLevels)??[]}function Hu(n,r){var s;return(s=tv(n,r))==null?void 0:s.defaultReasoning}function Rb(){const{activeSessionId:n,sessions:r,updateModelConfig:s}=L(),o=L(ee=>ee.showModelSelector),a=L(ee=>ee.setShowModelSelector),u=r.find(ee=>ee.id===n),f=L(ee=>ee.models),h=L(ee=>ee.modelsLoading),g=L(ee=>ee.loadModels),[m,v]=w.useState(!1),k=w.useRef(null);if(ml(k,()=>v(!1),m),td(()=>v(!1),m),w.useEffect(()=>{o&&(v(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const x=u.runtime_type,b=u.model??"",E=u.model_reasoning_effort??"",C=f.length>0?f:[],T=Td(x),A=[...C.length>0?C:T];if(b&&!A.some(ee=>ee.slug===b)){const ee=T[0];A.unshift({slug:b,displayName:b,description:"Custom model",defaultReasoning:(ee==null?void 0:ee.defaultReasoning)??"medium",reasoningLevels:(ee==null?void 0:ee.reasoningLevels)??[]})}function B(ee){return A.find(re=>re.slug===ee)}function $(ee){var re;return C.length>0?((re=B(ee))==null?void 0:re.reasoningLevels)??[]:Wu(x,ee)}function W(ee){var re;return C.length>0?(re=B(ee))==null?void 0:re.defaultReasoning:Hu(x,ee)}const Y=Bu.find(ee=>ee.id===x),G=B(b),K=b?$(b):[],ue=(Y==null?void 0:Y.label)??x,ge=(G==null?void 0:G.displayName)??(b||"Default"),de=K.find(ee=>ee.effort===E),pe=(de==null?void 0:de.label)??(E||"Default");function ve(ee){var X;const re=$(ee),z=re.some(V=>V.effort===E)?E:W(ee)??((X=re[0])==null?void 0:X.effort)??"";s(ee,z),v(!1)}function Me(ee){s(b,ee),v(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ue}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:ge}),pe!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:pe})]}),c.jsx(mi,{size:12,className:"model-selector-chevron"})]}),m&&c.jsxs("div",{className:"model-selector-popover",children:[c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Bu.map(ee=>c.jsxs("div",{className:`model-selector-item ${ee.id===x?"selected":""} ${ee.available?"":"disabled"}`,onClick:()=>{if(ee.available){if(ee.id===x){v(!1);return}s("","",ee.id)}},children:[c.jsx("span",{children:ee.label}),!ee.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(W0,{size:10})," Soon"]}),ee.id===x&&c.jsx(os,{size:12})]},ee.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&A.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),A.map(ee=>c.jsxs("div",{className:`model-selector-item ${ee.slug===b?"selected":""}`,onClick:()=>ve(ee.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:ee.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:ee.description})]}),ee.slug===b&&c.jsx(os,{size:12})]},ee.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),K.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),K.map(ee=>c.jsxs("div",{className:`model-selector-item ${ee.effort===E?"selected":""}`,onClick:()=>Me(ee.effort),children:[c.jsx("span",{children:ee.label}),ee.effort===E&&c.jsx(os,{size:12})]},ee.effort))]})]})]})}function io(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Tm(){const n=L(r=>r.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(aw,{size:14})," Repoburg"]})}function Nm(){const n=L(s=>s.vscodeViewOpen),r=L(s=>s.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[c.jsx(I0,{size:14})," Code"]})}function Ab(){var x,b;Ot.trackRender("StatusBar");const n=L(E=>E.activeSessionId),r=L(E=>n?E.sessions.find(C=>C.id===n)??null:null),s=L(E=>n?E.sessionDetails[n]??null:null),o=L(E=>n?E.backgroundTasks[n]:void 0),a=L(E=>E.wsConnected),u=L(E=>E.switchRightTab),f=(s==null?void 0:s.contextUsage)??null;if(!r)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Nm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(bh,{size:14})," K"]})]});const h=o??[],g=hl(r,h.length),m=new Set,v=new Map;for(const E of h)m.add(E.task_id),v.set(E.task_id,E.task_type);for(const E of(s==null?void 0:s.turns)??[])for(const C of E.items)if(C.type==="background_task"&&C.status==="in_progress"){const T=((x=C.data)==null?void 0:x.task_id)??C.external_item_id,I=((b=C.data)==null?void 0:b.task_type)??"unknown";m.add(T),v.set(T,I)}const k=[...v.values()].filter(E=>E==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Nm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Rb,{}),k>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[c.jsx(lg,{size:14})," ",k]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:r.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),f&&c.jsx(Ib,{usage:f}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(bh,{size:14})," K"]})]})}function Ib({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",s=`${io(n.totalTokens)} / ${io(n.contextWindow)} tokens`+(n.autoCompactThreshold?` · auto-compacts at ${io(n.autoCompactThreshold)}`:"");return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:s,children:c.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",io(n.totalTokens)," / ",io(n.contextWindow)]})})]})}function Cm(n){return vn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function Db(n){return wt("/vscode-web/start",{folder:n})}function Mb(n){return wt("/vscode-web/heartbeat",{id:n})}const Lb=1e3,Pb=5*6e4;function Em({children:n}){const r=L(s=>s.toggleVscodeView);return c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[n,c.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:r,children:c.jsx(Bn,{size:16})})]})}function Ob(){const n=L(E=>E.vscodeState),r=L(E=>E.vscodeId),s=L(E=>E.vscodeToken),o=L(E=>E.setVscodeView),a=L(E=>{var T;const C=E.activeSessionId?E.sessions.find(I=>I.id===E.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((T=E.workspaces.find(I=>I.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,g]=w.useState(0),m=w.useRef(null),v=dr(),k=v===""||v===window.location.origin,x=`${v}/vscode/${r??""}/?tkn=${s??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let E=!1;function C(){m.current&&(clearInterval(m.current),m.current=null)}async function T(){try{let A=await Cm(a);if((A.state==="stopped"||A.state==="error")&&(A=await Db(a)),E||(o(A.state,A.id,A.token),A.state==="running"||A.state==="error"))return;m.current=setInterval(async()=>{const B=await Cm(a);E||(o(B.state,B.id,B.token),(B.state==="running"||B.state==="error"||B.state==="stopped")&&C())},Lb)}catch{E||o("error",null,null)}}T();const I=setInterval(()=>{const A=L.getState().vscodeId;A&&Mb(A).catch(()=>{})},Pb);return()=>{E=!0,C(),clearInterval(I)}},[h,a,o]);function b(){f(!1),o("starting",null,null),g(E=>E+1)}return n!=="running"||!s||!r?c.jsx(Em,{children:n==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"VS Code could not start."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:b,children:[c.jsx(vo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(cr,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(cr,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:x,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]}):c.jsxs(Em,{children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(x,"_blank","noopener"),children:[c.jsx(M0,{size:14})," Open VS Code in a new tab"]})]})}const zb=`(function () {
|
|
479
|
+
`;m(z=>z+re),C(!1),B(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(x.current){ue(),x.current.focus();const z=x.current.value.length;x.current.setSelectionRange(z,z)}},0)},[A]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(re=>!re),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((ee=(Me=(ve=n.turns)==null?void 0:ve[0])==null?void 0:Me.user_prompt)==null?void 0:ee.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),c.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&c.jsx("button",{className:"thread-locate-btn",onClick:re=>{re.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(tw,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),v&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:b,onMouseDown:ge,children:[r.map(re=>c.jsx(tv,{turn:re},re.id)),r.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),E&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:pe,title:"Quote this text in your follow-up",children:[c.jsx(og,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:$?"Agent is running…":"Type a follow-up…",value:g,onChange:re=>{Ot.markInputChange(),m(re.target.value),ue()},disabled:$,rows:1,style:{minHeight:W,maxHeight:Y},onKeyDown:re=>{Ot.markKeystroke(),re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&!$&&g.trim()&&(re.preventDefault(),f(g.trim()),m(""),K(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:$||!g.trim(),onClick:()=>{f(g.trim()),m("")},children:c.jsx(ko,{size:13})}),$&&c.jsx("button",{className:"thread-card-followup-stop",onClick:s,title:"Stop this thread's turn (Esc)",children:c.jsx(Ds,{size:13})})]}),c.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?c.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[c.jsx(Qa,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(vo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(dr,{size:13})," Delete"]})]})]})]})}function Mb(){Ot.trackRender("ThreadsPanel");const n=M(I=>I.activeSessionId),r=M(I=>{var A;return I.activeSessionId?((A=I.sessionDetails[I.activeSessionId])==null?void 0:A.threads)??bm:bm}),s=w.useMemo(()=>r.filter(I=>!bd(I)),[r]),o=M(I=>I.followupThread),a=M(I=>I.cancelThreadTurn),u=M(I=>I.reopenThread),f=M(I=>I.deleteThread),h=M(I=>I.deepLinkThreadId),g=M(I=>I.setDeepLinkThreadId),[m,v]=w.useState("open"),[k,x]=w.useState(null);w.useEffect(()=>{if(!h)return;const I=h;g(null),v(B=>s.some($=>$.id===I&&$.status==="open")?B:"all");const A=setTimeout(()=>{const B=document.getElementById(`thread-${I}`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("thread-card-highlighted"),setTimeout(()=>B.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(A)},[h,g,s]);const b=s.filter(I=>m==="open"?I.status==="open":m==="resolved"?I.status==="resolved":!0),E=s.filter(I=>I.status==="open").length,C=s.filter(I=>I.status==="resolved").length;function T(I){setTimeout(()=>{const A=document.querySelector(`mark[data-thread-id="${I}"]`);A&&(A.scrollIntoView({behavior:"smooth",block:"center"}),A.classList.add("thread-mark-flash"),setTimeout(()=>A.classList.remove("thread-mark-flash"),1500))},50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(ig,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"No threads yet."}),c.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):c.jsxs("div",{children:[c.jsxs("div",{className:"thread-filter-tabs",children:[c.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",E,")"]}),c.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",s.length,")"]})]}),b.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):b.map(I=>c.jsx(Db,{thread:I,threadTurns:I.turns??[],onStop:()=>a(n,I.id),onResolve:()=>x(I),onReopen:()=>u(n,I.id),onDelete:()=>f(n,I.id),onFollowup:A=>o(n,I.id,A),onLocate:()=>T(I.id)},I.id)),k&&c.jsx(jb,{thread:k,onClose:()=>x(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function Lb(){const n=M(f=>f.apps),r=M(f=>f.activeAppTabId),s=M(f=>f.openAppTab),o=M(f=>f.startAppEdit),a=M(f=>f.toggleAppPin),u=M(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${r===f.id?" active":""}`,onClick:()=>s(f.id),title:f.description??void 0,children:[c.jsx("span",{className:"sidebar-app-icon",children:f.icon??"◧"}),c.jsxs("div",{className:"apps-panel-info",children:[c.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&c.jsx("span",{className:"apps-panel-desc",children:f.description})]}),c.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:h=>{h.stopPropagation(),o(f.id)},children:c.jsx(Ua,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:h=>{h.stopPropagation(),a(f.id)},children:c.jsx(Za,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:c.jsx(dr,{size:12})})]},f.id))})}function Pb(){Ot.trackRender("SidecarPanel");const n=M(T=>T.activeSessionId),r=M(T=>{var I;return T.activeSessionId?(I=T.sessionDetails[T.activeSessionId])==null?void 0:I.runtime_type:void 0}),s=M(T=>{var I;return T.activeSessionId?Eb((I=T.sessionDetails[T.activeSessionId])==null?void 0:I.threads):null}),o=M(T=>T.askSidecar),a=M(T=>T.cancelThreadTurn),u=M(T=>T.deleteThread),[f,h]=w.useState(""),[g,m]=w.useState(!1),v=w.useRef(null),k=(s==null?void 0:s.turns)??[],x=k[k.length-1],b=k.some(as);if(w.useEffect(()=>{var T,I;(I=(T=v.current)==null?void 0:T.scrollIntoView)==null||I.call(T,{block:"end"})},[k.length,x==null?void 0:x.items.length,x==null?void 0:x.status]),!n||!r)return c.jsx("div",{className:"empty-state",children:"No session selected"});if(!Cb(r))return c.jsxs("div",{className:"empty-state",children:[c.jsx(ls,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsxs("div",{children:["The sidecar is not available for ",r," sessions yet."]})]});const E=!b&&!g&&f.trim().length>0;async function C(){if(!n||!E)return;m(!0);const T=await o(n,f.trim());m(!1),T&&h("")}return c.jsxs("div",{className:"sidecar-panel",children:[c.jsxs("div",{className:"sidecar-conversation",children:[k.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(ls,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"Ask about this session."}),c.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):k.map(T=>c.jsx(tv,{turn:T,formatPrompt:_b},T.id)),c.jsx("div",{ref:v})]}),c.jsxs("div",{className:"sidecar-footer",children:[c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:b?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:f,rows:2,disabled:b,onChange:T=>{Ot.markInputChange(),h(T.target.value)},onKeyDown:T=>{Ot.markKeystroke(),T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),C())}}),b&&s?c.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>a(n,s.id),children:c.jsx(Ds,{size:13})}):c.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!E,onClick:()=>void C(),children:c.jsx(ko,{size:13})})]}),s&&c.jsx("div",{className:"thread-card-actions",children:c.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:b,onClick:()=>u(n,s.id),children:[c.jsx(dr,{size:13})," Clear"]})})]})]})}function Ob(){var g;Ot.trackRender("RightPanel");const n=M(m=>m.activeRightTab),r=M(m=>m.switchRightTab),s=M(m=>m.rightPanelCollapsed),o=M(m=>m.toggleRightPanel),a=M(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=M(m=>{var v;return m.activeSessionId?((v=m.backgroundTasks[m.activeSessionId])==null?void 0:v.length)??0:0}),f=((g=a==null?void 0:a.threads)==null?void 0:g.filter(m=>m.status==="open"&&!bd(m)).length)??0,h=[{id:"turns",label:"Turns",icon:Y0},{id:"sidecar",label:"Sidecar",icon:ls},{id:"tasks",label:"Tasks",icon:K0,badge:u||void 0},{id:"threads",label:"Threads",icon:ig,badge:f||void 0},{id:"apps",label:"Apps",icon:sg}];return s?c.jsxs("div",{className:"ide-right collapsed",children:[c.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:c.jsx(rw,{size:15})}),c.jsx("div",{className:"right-rail-divider"}),h.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return c.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${n===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>r(m.id),children:[c.jsx(v,{size:15}),m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):c.jsxs("div",{className:"ide-right",children:[c.jsxs("div",{className:"right-header",children:[c.jsx("div",{className:"right-tabs",children:h.map(m=>c.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),c.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:c.jsx(nw,{size:14})})]}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(yb,{}),n==="sidecar"&&c.jsx(Pb,{}),n==="tasks"&&c.jsx(bb,{}),n==="threads"&&c.jsx(Mb,{}),n==="apps"&&c.jsx(Lb,{})]})]})}const Re={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"}},Bu=[{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:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.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:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]}]}];function zb(n){return Bu.find(r=>r.id===n)}function Td(n){const r=zb(n);return(r==null?void 0:r.models)??[]}function nv(n,r){return Td(n).find(s=>s.slug===r)}function Wu(n,r){var s;return((s=nv(n,r))==null?void 0:s.reasoningLevels)??[]}function Hu(n,r){var s;return(s=nv(n,r))==null?void 0:s.defaultReasoning}function $b(){const{activeSessionId:n,sessions:r,updateModelConfig:s}=M(),o=M(ee=>ee.showModelSelector),a=M(ee=>ee.setShowModelSelector),u=r.find(ee=>ee.id===n),f=M(ee=>ee.models),h=M(ee=>ee.modelsLoading),g=M(ee=>ee.loadModels),[m,v]=w.useState(!1),k=w.useRef(null);if(ml(k,()=>v(!1),m),td(()=>v(!1),m),w.useEffect(()=>{o&&(v(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const x=u.runtime_type,b=u.model??"",E=u.model_reasoning_effort??"",C=f.length>0?f:[],T=Td(x),A=[...C.length>0?C:T];if(b&&!A.some(ee=>ee.slug===b)){const ee=T[0];A.unshift({slug:b,displayName:b,description:"Custom model",defaultReasoning:(ee==null?void 0:ee.defaultReasoning)??"medium",reasoningLevels:(ee==null?void 0:ee.reasoningLevels)??[]})}function B(ee){return A.find(re=>re.slug===ee)}function $(ee){var re;return C.length>0?((re=B(ee))==null?void 0:re.reasoningLevels)??[]:Wu(x,ee)}function W(ee){var re;return C.length>0?(re=B(ee))==null?void 0:re.defaultReasoning:Hu(x,ee)}const Y=Bu.find(ee=>ee.id===x),G=B(b),K=b?$(b):[],ue=(Y==null?void 0:Y.label)??x,ge=(G==null?void 0:G.displayName)??(b||"Default"),de=K.find(ee=>ee.effort===E),pe=(de==null?void 0:de.label)??(E||"Default");function ve(ee){var X;const re=$(ee),z=re.some(V=>V.effort===E)?E:W(ee)??((X=re[0])==null?void 0:X.effort)??"";s(ee,z),v(!1)}function Me(ee){s(b,ee),v(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ue}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:ge}),pe!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:pe})]}),c.jsx(mi,{size:12,className:"model-selector-chevron"})]}),m&&c.jsxs("div",{className:"model-selector-popover",children:[c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Bu.map(ee=>c.jsxs("div",{className:`model-selector-item ${ee.id===x?"selected":""} ${ee.available?"":"disabled"}`,onClick:()=>{if(ee.available){if(ee.id===x){v(!1);return}s("","",ee.id)}},children:[c.jsx("span",{children:ee.label}),!ee.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(Z0,{size:10})," Soon"]}),ee.id===x&&c.jsx(os,{size:12})]},ee.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&A.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),A.map(ee=>c.jsxs("div",{className:`model-selector-item ${ee.slug===b?"selected":""}`,onClick:()=>ve(ee.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:ee.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:ee.description})]}),ee.slug===b&&c.jsx(os,{size:12})]},ee.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),K.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),K.map(ee=>c.jsxs("div",{className:`model-selector-item ${ee.effort===E?"selected":""}`,onClick:()=>Me(ee.effort),children:[c.jsx("span",{children:ee.label}),ee.effort===E&&c.jsx(os,{size:12})]},ee.effort))]})]})]})}function io(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Tm(){const n=M(r=>r.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(gw,{size:14})," Repoburg"]})}function Nm(){const n=M(s=>s.vscodeViewOpen),r=M(s=>s.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[c.jsx(F0,{size:14})," Code"]})}function Fb(){var x,b;Ot.trackRender("StatusBar");const n=M(E=>E.activeSessionId),r=M(E=>n?E.sessions.find(C=>C.id===n)??null:null),s=M(E=>n?E.sessionDetails[n]??null:null),o=M(E=>n?E.backgroundTasks[n]:void 0),a=M(E=>E.wsConnected),u=M(E=>E.switchRightTab),f=(s==null?void 0:s.contextUsage)??null;if(!r)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Nm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(bh,{size:14})," K"]})]});const h=o??[],g=hl(r,h.length),m=new Set,v=new Map;for(const E of h)m.add(E.task_id),v.set(E.task_id,E.task_type);for(const E of(s==null?void 0:s.turns)??[])for(const C of E.items)if(C.type==="background_task"&&C.status==="in_progress"){const T=((x=C.data)==null?void 0:x.task_id)??C.external_item_id,I=((b=C.data)==null?void 0:b.task_type)??"unknown";m.add(T),v.set(T,I)}const k=[...v.values()].filter(E=>E==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Nm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx($b,{}),k>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[c.jsx(cg,{size:14})," ",k]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:r.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),f&&c.jsx(Ub,{usage:f}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(bh,{size:14})," K"]})]})}function Ub({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",s=`${io(n.totalTokens)} / ${io(n.contextWindow)} tokens`+(n.autoCompactThreshold?` · auto-compacts at ${io(n.autoCompactThreshold)}`:"");return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:s,children:c.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",io(n.totalTokens)," / ",io(n.contextWindow)]})})]})}function Cm(n){return vn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function Bb(n){return wt("/vscode-web/start",{folder:n})}function Wb(n){return wt("/vscode-web/heartbeat",{id:n})}const Hb=1e3,Vb=5*6e4;function Em({children:n}){const r=M(s=>s.toggleVscodeView);return c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[n,c.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:r,children:c.jsx(Wn,{size:16})})]})}function qb(){const n=M(E=>E.vscodeState),r=M(E=>E.vscodeId),s=M(E=>E.vscodeToken),o=M(E=>E.setVscodeView),a=M(E=>{var T;const C=E.activeSessionId?E.sessions.find(I=>I.id===E.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((T=E.workspaces.find(I=>I.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,g]=w.useState(0),m=w.useRef(null),v=Un(),k=v===""||v===window.location.origin,x=`${v}/vscode/${r??""}/?tkn=${s??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let E=!1;function C(){m.current&&(clearInterval(m.current),m.current=null)}async function T(){try{let A=await Cm(a);if((A.state==="stopped"||A.state==="error")&&(A=await Bb(a)),E||(o(A.state,A.id,A.token),A.state==="running"||A.state==="error"))return;m.current=setInterval(async()=>{const B=await Cm(a);E||(o(B.state,B.id,B.token),(B.state==="running"||B.state==="error"||B.state==="stopped")&&C())},Hb)}catch{E||o("error",null,null)}}T();const I=setInterval(()=>{const A=M.getState().vscodeId;A&&Wb(A).catch(()=>{})},Vb);return()=>{E=!0,C(),clearInterval(I)}},[h,a,o]);function b(){f(!1),o("starting",null,null),g(E=>E+1)}return n!=="running"||!s||!r?c.jsx(Em,{children:n==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"VS Code could not start."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:b,children:[c.jsx(vo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(Jn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(Jn,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:x,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]}):c.jsxs(Em,{children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(x,"_blank","noopener"),children:[c.jsx(W0,{size:14})," Open VS Code in a new tab"]})]})}const Gb=`(function () {
|
|
475
480
|
var nextId = 1;
|
|
476
481
|
var pending = new Map();
|
|
477
482
|
var listeners = [];
|
|
@@ -559,9 +564,9 @@ ${A}
|
|
|
559
564
|
stack: (r && r.stack) || '', line: 0, col: 0
|
|
560
565
|
}, '*');
|
|
561
566
|
});
|
|
562
|
-
})();`;function _m(n){return n.replace(/<\/script/gi,"<\\/script")}function $b(n,r){const s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(s,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function jm(n,r,s){const o=$b(n,r);return o===-1?n+s:n.slice(0,o)+s+n.slice(o)}function Fb(n,r,s){let o=n;const a=`<script>${_m(r)}<\/script>`;if(/<\/head>/i.test(o)?o=jm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,s){const u=`<script>${_m(s)}<\/script>`;o=jm(o,"</body>",u)}return o}function Ub({appId:n,workspace:r=""}){const s=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[g,m]=w.useState([]);w.useEffect(()=>{let x=!0;Ax(n,E=>{var C,T;return(T=(C=s.current)==null?void 0:C.contentWindow)==null?void 0:T.postMessage(E,"*")});const b=async E=>{var B,$,W,Y,G,K,ue,ge,de;if(E.source!==((B=s.current)==null?void 0:B.contentWindow))return;const C=E.data;if(!C||C.source!=="agentpane-app")return;if(C.report==="error"){const pe={message:String(C.message??"Unknown error"),stack:String(C.stack??"")};m(ve=>{const Me=ve[ve.length-1];return Me&&Me.message===pe.message?ve:[...ve,pe].slice(-20)});return}if(typeof C.method!="string")return;let T=!0,I,A;try{switch(C.method){case"getApp":I={id:n};break;case"getState":I=o.current;break;case"setState":{const pe=(($=C.params)==null?void 0:$.data)??null,ve=await Km(n,{data:pe},r);o.current=ve,I=ve;break}case"createSession":{const pe=C.params??{},ve=await Gu({title:typeof pe.title=="string"?pe.title:void 0,runtime_type:typeof pe.runtime_type=="string"?pe.runtime_type:void 0,model:typeof pe.model=="string"?pe.model:void 0,model_reasoning_effort:typeof pe.model_reasoning_effort=="string"?pe.model_reasoning_effort:void 0,cwd:typeof pe.cwd=="string"?pe.cwd:void 0,origin_app_id:n});ou(ve.id,n),L.getState().addSession(ve),I=ve;break}case"submitTurn":{const pe=String(((W=C.params)==null?void 0:W.sessionId)??""),ve=String(((Y=C.params)==null?void 0:Y.prompt)??""),Me=await Um(pe,ve,void 0,{originAppId:n});ou(pe,n),I=Me;break}case"resolveToolCall":{const pe=String(((G=C.params)==null?void 0:G.callId)??""),ve=(K=C.params)==null?void 0:K.result;await o0(pe,ve),I={ok:!0};break}case"openSession":{if(L.getState().activeAppTabId!==n)throw new Error("openSession: the app is not on screen — call it from a click in the app");const pe=typeof((ue=C.params)==null?void 0:ue.sessionId)=="string"?C.params.sessionId.trim():"";if(!pe)throw new Error("openSession: sessionId is required");try{await L.getState().revealSession(pe)}catch(ve){throw new Error(`openSession: ${ve instanceof Error?ve.message:String(ve)}`)}I={ok:!0};break}default:throw new Error(`Unknown bridge method: ${C.method}`)}}catch(pe){T=!1,A=pe instanceof Error?pe.message:String(pe)}(de=(ge=s.current)==null?void 0:ge.contentWindow)==null||de.postMessage({source:"agentpane-host",id:C.id,ok:T,result:I,error:A},"*")};return window.addEventListener("message",b),Ox(n,()=>{xh(n,r).then(E=>{x&&(o.current=E)}).catch(()=>{})}),Lx(n,()=>{yh(n).then(E=>{x&&(u(E),m([]))}).catch(()=>{})}),(async()=>{try{const[E,C,T]=await Promise.all([yh(n),xh(n,r),t0(n).catch(()=>[])]);if(!x)return;o.current=C,T.forEach(I=>ou(I.id,n)),u(E)}catch(E){x&&h(E instanceof Error?E.message:String(E))}})(),()=>{x=!1,Ix(n),Px(n),zx(n),window.removeEventListener("message",b)}},[n,r]);const v=w.useMemo(()=>a?Fb(a.html,zb,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!v)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),k.map((x,b)=>c.jsxs("div",{className:"miniapp-diag",children:[x.file,":",x.line,":",x.column," — ",x.message]},b))]}),c.jsx("iframe",{ref:s,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",title:`Mini app: ${n}`,srcDoc:v}),g.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((x,b)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:x.message}),x.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:x.stack})]},b))})]})}function Bb({appId:n,active:r}){const s=L(x=>x.apps),o=L(x=>x.workspaces),a=L(x=>x.appWorkspaces),u=L(x=>x.setAppWorkspace),f=L(x=>x.setActiveAppTab),h=L(x=>x.startAppEdit),g=s.find(x=>x.id===n),m=a[n]??"",v=o.filter(x=>x.deleted!==1),k=m!==""&&!v.some(x=>x.path===m)?m:null;return c.jsxs("div",{className:`miniapp-view ${r?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(g==null?void 0:g.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??n}),c.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:m,onChange:x=>u(n,x.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(x=>c.jsx("option",{value:x.path,children:x.label||x.path.split("/").pop()||x.path},x.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(n),children:[c.jsx(Q0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Bn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(Ub,{appId:n,workspace:m},`${n}:${m}`)})]})}function Wb({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),g=w.useRef(0),m=w.useCallback(x=>{const b=x.clientX-h.current,E=n==="left"?g.current+b:g.current-b,C=Math.min(s,Math.max(r,E));a(C)},[n,r,s,a]),v=w.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),f(!1)},[m]);return{onPointerDown:w.useCallback(x=>{var b,E;x.preventDefault(),x.stopPropagation();try{(E=(b=x.currentTarget)==null?void 0:b.setPointerCapture)==null||E.call(b,x.pointerId)}catch{}h.current=x.clientX,g.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:u}}function Rm({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=Wb({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a});return c.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function Hb(){Ot.trackRender("IdeWorkspace");const n=L(m=>m.sidebarWidth),r=L(m=>m.rightPanelWidth),s=L(m=>m.setSidebarWidth),o=L(m=>m.setRightPanelWidth),a=L(m=>m.rightPanelCollapsed),u=L(m=>m.vscodeViewOpen),f=L(m=>m.activeAppTabId),h=L(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const v=qa(),{rightPanelWidth:k,setRightPanelWidth:x}=L.getState();k>v&&x(v)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const g=a?`${n}px 6px 1fr ${Kx}px`:`${n}px 6px 1fr 6px ${r}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${u?"ide-hidden":""}`,style:{gridTemplateColumns:g},children:[c.jsx(ik,{}),c.jsx(Rm,{side:"left",minWidth:Cu,maxWidth:Eu,getWidth:()=>L.getState().sidebarWidth,setWidth:s}),c.jsxs("div",{className:"ide-center",children:[c.jsx(ok,{}),c.jsxs("div",{className:"ide-render",children:[h.map(m=>c.jsx(Bb,{appId:m,active:f===m},m)),f==null&&c.jsx(XS,{})]}),c.jsx(lb,{})]}),!a&&c.jsx(Rm,{side:"right",minWidth:Va,maxWidth:qa(),getWidth:()=>L.getState().rightPanelWidth,setWidth:o}),c.jsx(_b,{})]}),u&&c.jsx(Ob,{}),c.jsx(Ab,{})]})}function Vb(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:s,lastModelConfig:o}=L(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,g]=w.useState(""),[m,v]=w.useState(u),[k,x]=w.useState(f),[b,E]=w.useState("");if(!n)return null;const C=Td(a),T=m?Wu(a,m):[];function I(){s({title:h.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:b.trim()||void 0,runtime_type:a}),g(""),E("")}function A($){$.key==="Escape"&&r(!1)}function B($){var G;v($);const W=Wu(a,$);W.some(K=>K.effort===k)||x(Hu(a,$)??((G=W[0])==null?void 0:G.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:$=>$.stopPropagation(),onKeyDown:A,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Bn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsxs("label",{className:"dialog-label",children:["Title (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:$=>g($.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Model",c.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:$=>B($.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map($=>c.jsxs("option",{value:$.slug,children:[$.displayName," — ",$.description]},$.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:$=>x($.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Hu(a,m),")"]}),T.map($=>c.jsx("option",{value:$.effort,children:$.label},$.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:b,onChange:$=>E($.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:I,children:"Create"})]})]})})}const qb=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Gb=512*1024;function Kb(n){const r=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(r)?r:""}function Yb(){const{appCatalogOpen:n,closeAppCatalog:r,apps:s,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=L(),[f,h]=w.useState("examples"),[g,m]=w.useState(null),[v,k]=w.useState(null),[x,b]=w.useState(!1),[E,C]=w.useState(""),[T,I]=w.useState(""),[A,B]=w.useState(""),[$,W]=w.useState(""),[Y,G]=w.useState(null),[K,ue]=w.useState(""),ge=w.useRef(null);if(w.useEffect(()=>{n&&(m(null),n0().then(m).catch(()=>m([])))},[n]),w.useEffect(()=>{ge.current&&(ge.current.webkitdirectory=!0)},[f]),!n)return null;const de=new Set(s.map(z=>z.id));async function pe(z){k(z);try{await o(z)&&r()}finally{k(null)}}async function ve(){if(x)return;const z=E.trim(),X=T.trim();if(!(!z||!X)){b(!0);try{await a({id:z,title:X,description:A.trim()||void 0,icon:$.trim()||void 0})&&(C(""),I(""),B(""),W(""),r())}finally{b(!1)}}}async function Me(z){const X=Array.from(z.target.files??[]),V={};let j="";for(const M of X){const q=(M.webkitRelativePath??"").split("/");!j&&q.length>1&&(j=q[0]);const le=q[q.length-1];if(!(!le||!qb.test(le))&&!(M.size>Gb))try{V[le]=await M.text()}catch{}}G(Object.keys(V).length>0?V:null),ue(Kb(j))}async function ee(){if(!(x||!Y||!K.trim())){b(!0);try{await u(K.trim(),Y)&&(G(null),ue(""),r())}finally{b(!1)}}}function re(z){z.key==="Escape"&&r()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:r,children:c.jsxs("div",{className:"dialog app-catalog",onClick:z=>z.stopPropagation(),onKeyDown:re,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:r,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ae.map(z=>c.jsx("button",{className:`catalog-tab${f===z.key?" active":""}`,onClick:()=>h(z.key),children:z.label},z.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:g===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(z=>{const X=de.has(z.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:z.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:z.title}),z.description&&c.jsx("span",{className:"example-desc",children:z.description})]}),c.jsx("button",{className:"example-install",disabled:X||v===z.id,onClick:()=>pe(z.id),title:X?"Already installed":"Install this example",children:X?"Installed":v===z.id?"Installing…":"Install"})]},z.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:E,onChange:z=>C(z.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:z=>I(z.target.value),placeholder:"e.g. Todo List"})]}),c.jsxs("label",{className:"dialog-label",children:["Description (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:A,onChange:z=>B(z.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:["Icon (optional, emoji)",c.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:z=>W(z.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!E.trim()||!T.trim(),onClick:ve,children:[c.jsx(Rs,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:ge,type:"file",multiple:!0,onChange:Me}),Y&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:K,onChange:z=>ue(z.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(Y).length," file(s):"," ",Object.keys(Y).slice(0,6).join(", "),Object.keys(Y).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!Y||!K.trim(),onClick:ee,children:[c.jsx(sw,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:r,children:"Close"})})]})})}function Xb(){const n=L(k=>k.showCommandPalette),r=L(k=>k.setShowCommandPalette),s=L(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),g=w.useMemo(()=>{const k=s.activeSessionId?s.sessionDetails[s.activeSessionId]:null,x=pl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Rs,action:()=>s.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:ur,action:()=>{s.activeSessionId&&s.deleteSession(s.activeSessionId)},available:!!s.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ko,action:()=>{const b=document.querySelector(".cmd-input");b==null||b.focus()},available:!!s.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Ds,action:()=>s.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:B0,action:()=>s.switchRightTab("turns"),available:!!s.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:ls,action:()=>s.switchRightTab("sidecar"),available:!!s.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:s.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:Y0,action:()=>s.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Bn,action:()=>{s.activeSessionId&&s.closeTab(s.activeSessionId)},available:!!s.activeSessionId}]},[s]),m=w.useMemo(()=>{const k=o.toLowerCase().trim(),x=g.filter(b=>b.available);return k?x.filter(b=>b.label.toLowerCase().includes(k)||b.hint.toLowerCase().includes(k)):x},[g,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,m.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=m[u];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown:v}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:m.map((k,x)=>{const b=k.icon;return c.jsxs("div",{className:`palette-item ${x===u?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(b,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),x===u&&c.jsx(D0,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Am=/^[a-z][a-z0-9-]{1,30}$/,Qb=2e3;function Zb(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:s}=L(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,g]=w.useState(!1),[m,v]=w.useState(!1),[k,x]=w.useState(!1),[b,E]=w.useState(!1),[C,T]=w.useState("main"),[I,A]=w.useState(""),[B,$]=w.useState(!1),[W,Y]=w.useState(null),G=w.useRef(null);ml(G,()=>E(!1),b);const K=m||k,ue=w.useCallback(async()=>{g(!0),f(null);try{const z=await fetch(`${dr()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);a(await z.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);w.useEffect(()=>{n&&(T("main"),Y(null),ue())},[n,ue]);const ge=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!ge)return;const z=setInterval(async()=>{try{const X=await fetch(`${dr()}/remote/enable`,{headers:{Accept:"application/json"}});X.ok&&Y(await X.json())}catch{}},Qb);return()=>clearInterval(z)},[ge]),!n)return null;const de=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function pe(z){z.key==="Escape"&&r(!1)}async function ve(z){if(Am.test(z)){$(!0);try{const X=await fetch(`${dr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!X.ok)throw new Error(`enable ${X.status}`);Y(await X.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{$(!1)}}}function Me(){W!=null&&W.troubleshootingSessionId&&(s(W.troubleshootingSessionId),r(!1))}async function ee(){v(!0);try{await fetch(`${dr()}/remote/disable`,{method:"POST"}),await ue()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function re(){if(E(!1),!!window.confirm(`Remove the tunnel completely?
|
|
567
|
+
})();`;function _m(n){return n.replace(/<\/script/gi,"<\\/script")}function Kb(n,r){const s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(s,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function jm(n,r,s){const o=Kb(n,r);return o===-1?n+s:n.slice(0,o)+s+n.slice(o)}function Yb(n,r,s){let o=n;const a=`<script>${_m(r)}<\/script>`;if(/<\/head>/i.test(o)?o=jm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,s){const u=`<script>${_m(s)}<\/script>`;o=jm(o,"</body>",u)}return o}function Xb({appId:n,workspace:r=""}){const s=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[g,m]=w.useState([]);w.useEffect(()=>{let x=!0;Ix(n,E=>{var C,T;return(T=(C=s.current)==null?void 0:C.contentWindow)==null?void 0:T.postMessage(E,"*")});const b=async E=>{var B,$,W,Y,G,K,ue,ge,de;if(E.source!==((B=s.current)==null?void 0:B.contentWindow))return;const C=E.data;if(!C||C.source!=="agentpane-app")return;if(C.report==="error"){const pe={message:String(C.message??"Unknown error"),stack:String(C.stack??"")};m(ve=>{const Me=ve[ve.length-1];return Me&&Me.message===pe.message?ve:[...ve,pe].slice(-20)});return}if(typeof C.method!="string")return;let T=!0,I,A;try{switch(C.method){case"getApp":I={id:n};break;case"getState":I=o.current;break;case"setState":{const pe=(($=C.params)==null?void 0:$.data)??null,ve=await Ym(n,{data:pe},r);o.current=ve,I=ve;break}case"createSession":{const pe=C.params??{},ve=await Gu({title:typeof pe.title=="string"?pe.title:void 0,runtime_type:typeof pe.runtime_type=="string"?pe.runtime_type:void 0,model:typeof pe.model=="string"?pe.model:void 0,model_reasoning_effort:typeof pe.model_reasoning_effort=="string"?pe.model_reasoning_effort:void 0,cwd:typeof pe.cwd=="string"?pe.cwd:void 0,origin_app_id:n});ou(ve.id,n),M.getState().addSession(ve),I=ve;break}case"submitTurn":{const pe=String(((W=C.params)==null?void 0:W.sessionId)??""),ve=String(((Y=C.params)==null?void 0:Y.prompt)??""),Me=await Um(pe,ve,void 0,{originAppId:n});ou(pe,n),I=Me;break}case"resolveToolCall":{const pe=String(((G=C.params)==null?void 0:G.callId)??""),ve=(K=C.params)==null?void 0:K.result;await h0(pe,ve),I={ok:!0};break}case"openSession":{if(M.getState().activeAppTabId!==n)throw new Error("openSession: the app is not on screen — call it from a click in the app");const pe=typeof((ue=C.params)==null?void 0:ue.sessionId)=="string"?C.params.sessionId.trim():"";if(!pe)throw new Error("openSession: sessionId is required");try{await M.getState().revealSession(pe)}catch(ve){throw new Error(`openSession: ${ve instanceof Error?ve.message:String(ve)}`)}I={ok:!0};break}default:throw new Error(`Unknown bridge method: ${C.method}`)}}catch(pe){T=!1,A=pe instanceof Error?pe.message:String(pe)}(de=(ge=s.current)==null?void 0:ge.contentWindow)==null||de.postMessage({source:"agentpane-host",id:C.id,ok:T,result:I,error:A},"*")};return window.addEventListener("message",b),zx(n,()=>{xh(n,r).then(E=>{x&&(o.current=E)}).catch(()=>{})}),Px(n,()=>{yh(n).then(E=>{x&&(u(E),m([]))}).catch(()=>{})}),(async()=>{try{const[E,C,T]=await Promise.all([yh(n),xh(n,r),c0(n).catch(()=>[])]);if(!x)return;o.current=C,T.forEach(I=>ou(I.id,n)),u(E)}catch(E){x&&h(E instanceof Error?E.message:String(E))}})(),()=>{x=!1,Dx(n),Ox(n),$x(n),window.removeEventListener("message",b)}},[n,r]);const v=w.useMemo(()=>a?Yb(a.html,Gb,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!v)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),k.map((x,b)=>c.jsxs("div",{className:"miniapp-diag",children:[x.file,":",x.line,":",x.column," — ",x.message]},b))]}),c.jsx("iframe",{ref:s,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",title:`Mini app: ${n}`,srcDoc:v}),g.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((x,b)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:x.message}),x.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:x.stack})]},b))})]})}function Qb({appId:n,active:r}){const s=M(x=>x.apps),o=M(x=>x.workspaces),a=M(x=>x.appWorkspaces),u=M(x=>x.setAppWorkspace),f=M(x=>x.setActiveAppTab),h=M(x=>x.startAppEdit),g=s.find(x=>x.id===n),m=a[n]??"",v=o.filter(x=>x.deleted!==1),k=m!==""&&!v.some(x=>x.path===m)?m:null;return c.jsxs("div",{className:`miniapp-view ${r?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(g==null?void 0:g.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??n}),c.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:m,onChange:x=>u(n,x.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(x=>c.jsx("option",{value:x.path,children:x.label||x.path.split("/").pop()||x.path},x.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(n),children:[c.jsx(ow,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Wn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(Xb,{appId:n,workspace:m},`${n}:${m}`)})]})}function Zb({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),g=w.useRef(0),m=w.useCallback(x=>{const b=x.clientX-h.current,E=n==="left"?g.current+b:g.current-b,C=Math.min(s,Math.max(r,E));a(C)},[n,r,s,a]),v=w.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),f(!1)},[m]);return{onPointerDown:w.useCallback(x=>{var b,E;x.preventDefault(),x.stopPropagation();try{(E=(b=x.currentTarget)==null?void 0:b.setPointerCapture)==null||E.call(b,x.pointerId)}catch{}h.current=x.clientX,g.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:u}}function Rm({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=Zb({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a});return c.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function Jb(){Ot.trackRender("IdeWorkspace");const n=M(m=>m.sidebarWidth),r=M(m=>m.rightPanelWidth),s=M(m=>m.setSidebarWidth),o=M(m=>m.setRightPanelWidth),a=M(m=>m.rightPanelCollapsed),u=M(m=>m.vscodeViewOpen),f=M(m=>m.activeAppTabId),h=M(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const v=qa(),{rightPanelWidth:k,setRightPanelWidth:x}=M.getState();k>v&&x(v)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const g=a?`${n}px 6px 1fr ${n0}px`:`${n}px 6px 1fr 6px ${r}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${u?"ide-hidden":""}`,style:{gridTemplateColumns:g},children:[c.jsx(hk,{}),c.jsx(Rm,{side:"left",minWidth:Cu,maxWidth:Eu,getWidth:()=>M.getState().sidebarWidth,setWidth:s}),c.jsxs("div",{className:"ide-center",children:[c.jsx(mk,{}),c.jsxs("div",{className:"ide-render",children:[h.map(m=>c.jsx(Qb,{appId:m,active:f===m},m)),f==null&&c.jsx(ib,{})]}),c.jsx(vb,{})]}),!a&&c.jsx(Rm,{side:"right",minWidth:Va,maxWidth:qa(),getWidth:()=>M.getState().rightPanelWidth,setWidth:o}),c.jsx(Ob,{})]}),u&&c.jsx(qb,{}),c.jsx(Fb,{})]})}function eT(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:s,lastModelConfig:o}=M(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,g]=w.useState(""),[m,v]=w.useState(u),[k,x]=w.useState(f),[b,E]=w.useState("");if(!n)return null;const C=Td(a),T=m?Wu(a,m):[];function I(){s({title:h.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:b.trim()||void 0,runtime_type:a}),g(""),E("")}function A($){$.key==="Escape"&&r(!1)}function B($){var G;v($);const W=Wu(a,$);W.some(K=>K.effort===k)||x(Hu(a,$)??((G=W[0])==null?void 0:G.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:$=>$.stopPropagation(),onKeyDown:A,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Wn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsxs("label",{className:"dialog-label",children:["Title (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:$=>g($.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Model",c.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:$=>B($.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map($=>c.jsxs("option",{value:$.slug,children:[$.displayName," — ",$.description]},$.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:$=>x($.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Hu(a,m),")"]}),T.map($=>c.jsx("option",{value:$.effort,children:$.label},$.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:b,onChange:$=>E($.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:I,children:"Create"})]})]})})}const tT=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,nT=512*1024;function rT(n){const r=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(r)?r:""}function sT(){const{appCatalogOpen:n,closeAppCatalog:r,apps:s,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=M(),[f,h]=w.useState("examples"),[g,m]=w.useState(null),[v,k]=w.useState(null),[x,b]=w.useState(!1),[E,C]=w.useState(""),[T,I]=w.useState(""),[A,B]=w.useState(""),[$,W]=w.useState(""),[Y,G]=w.useState(null),[K,ue]=w.useState(""),ge=w.useRef(null);if(w.useEffect(()=>{n&&(m(null),u0().then(m).catch(()=>m([])))},[n]),w.useEffect(()=>{ge.current&&(ge.current.webkitdirectory=!0)},[f]),!n)return null;const de=new Set(s.map(z=>z.id));async function pe(z){k(z);try{await o(z)&&r()}finally{k(null)}}async function ve(){if(x)return;const z=E.trim(),X=T.trim();if(!(!z||!X)){b(!0);try{await a({id:z,title:X,description:A.trim()||void 0,icon:$.trim()||void 0})&&(C(""),I(""),B(""),W(""),r())}finally{b(!1)}}}async function Me(z){const X=Array.from(z.target.files??[]),V={};let j="";for(const L of X){const q=(L.webkitRelativePath??"").split("/");!j&&q.length>1&&(j=q[0]);const le=q[q.length-1];if(!(!le||!tT.test(le))&&!(L.size>nT))try{V[le]=await L.text()}catch{}}G(Object.keys(V).length>0?V:null),ue(rT(j))}async function ee(){if(!(x||!Y||!K.trim())){b(!0);try{await u(K.trim(),Y)&&(G(null),ue(""),r())}finally{b(!1)}}}function re(z){z.key==="Escape"&&r()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:r,children:c.jsxs("div",{className:"dialog app-catalog",onClick:z=>z.stopPropagation(),onKeyDown:re,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:r,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ae.map(z=>c.jsx("button",{className:`catalog-tab${f===z.key?" active":""}`,onClick:()=>h(z.key),children:z.label},z.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:g===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(z=>{const X=de.has(z.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:z.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:z.title}),z.description&&c.jsx("span",{className:"example-desc",children:z.description})]}),c.jsx("button",{className:"example-install",disabled:X||v===z.id,onClick:()=>pe(z.id),title:X?"Already installed":"Install this example",children:X?"Installed":v===z.id?"Installing…":"Install"})]},z.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:E,onChange:z=>C(z.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:z=>I(z.target.value),placeholder:"e.g. Todo List"})]}),c.jsxs("label",{className:"dialog-label",children:["Description (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:A,onChange:z=>B(z.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:["Icon (optional, emoji)",c.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:z=>W(z.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!E.trim()||!T.trim(),onClick:ve,children:[c.jsx(Rs,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:ge,type:"file",multiple:!0,onChange:Me}),Y&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:K,onChange:z=>ue(z.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(Y).length," file(s):"," ",Object.keys(Y).slice(0,6).join(", "),Object.keys(Y).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!Y||!K.trim(),onClick:ee,children:[c.jsx(pw,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:r,children:"Close"})})]})})}function iT(){const n=M(k=>k.showCommandPalette),r=M(k=>k.setShowCommandPalette),s=M(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),g=w.useMemo(()=>{const k=s.activeSessionId?s.sessionDetails[s.activeSessionId]:null,x=pl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Rs,action:()=>s.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:dr,action:()=>{s.activeSessionId&&s.deleteSession(s.activeSessionId)},available:!!s.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ko,action:()=>{const b=document.querySelector(".cmd-input");b==null||b.focus()},available:!!s.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Ds,action:()=>s.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:Q0,action:()=>s.switchRightTab("turns"),available:!!s.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:ls,action:()=>s.switchRightTab("sidecar"),available:!!s.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:s.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:sw,action:()=>s.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Wn,action:()=>{s.activeSessionId&&s.closeTab(s.activeSessionId)},available:!!s.activeSessionId}]},[s]),m=w.useMemo(()=>{const k=o.toLowerCase().trim(),x=g.filter(b=>b.available);return k?x.filter(b=>b.label.toLowerCase().includes(k)||b.hint.toLowerCase().includes(k)):x},[g,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,m.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=m[u];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown:v}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:m.map((k,x)=>{const b=k.icon;return c.jsxs("div",{className:`palette-item ${x===u?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(b,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),x===u&&c.jsx(U0,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Am=/^[a-z][a-z0-9-]{1,30}$/,oT=2e3;function aT(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:s}=M(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,g]=w.useState(!1),[m,v]=w.useState(!1),[k,x]=w.useState(!1),[b,E]=w.useState(!1),[C,T]=w.useState("main"),[I,A]=w.useState(""),[B,$]=w.useState(!1),[W,Y]=w.useState(null),G=w.useRef(null);ml(G,()=>E(!1),b);const K=m||k,ue=w.useCallback(async()=>{g(!0),f(null);try{const z=await fetch(`${Un()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);a(await z.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);w.useEffect(()=>{n&&(T("main"),Y(null),ue())},[n,ue]);const ge=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!ge)return;const z=setInterval(async()=>{try{const X=await fetch(`${Un()}/remote/enable`,{headers:{Accept:"application/json"}});X.ok&&Y(await X.json())}catch{}},oT);return()=>clearInterval(z)},[ge]),!n)return null;const de=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function pe(z){z.key==="Escape"&&r(!1)}async function ve(z){if(Am.test(z)){$(!0);try{const X=await fetch(`${Un()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!X.ok)throw new Error(`enable ${X.status}`);Y(await X.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{$(!1)}}}function Me(){W!=null&&W.troubleshootingSessionId&&(s(W.troubleshootingSessionId),r(!1))}async function ee(){v(!0);try{await fetch(`${Un()}/remote/disable`,{method:"POST"}),await ue()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function re(){if(E(!1),!!window.confirm(`Remove the tunnel completely?
|
|
563
568
|
|
|
564
569
|
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
565
570
|
|
|
566
|
-
This cannot be undone.`)){x(!0);try{const X=await fetch(`${
|
|
567
|
-
`)}),W.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.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."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Me,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ue(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:pe,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Bn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[h&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(cr,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),C==="setup"?ae():c.jsxs(c.Fragment,{children:[de&&(o==null?void 0:o.tunnel.hostname)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),c.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[c.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void ee(),disabled:K,children:[m?c.jsx(cr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),c.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>E(z=>!z),disabled:K,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":b,children:k?c.jsx(cr,{size:14,className:"spin"}):c.jsx(mi,{size:14})}),b&&c.jsx("div",{ref:G,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:c.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void re(),children:[c.jsx(ur,{size:12})," Remove tunnel"]})})]})]}),!de&&c.jsx(c.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void ve(o.tunnel.mahlas),disabled:B,children:[B?c.jsx(cr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(Th,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>T("setup"),children:[c.jsx(Th,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const Jb={success:j0,error:gl,info:O0,warn:nw},eT=4e3;function tT({toast:n}){const r=L(f=>f.removeToast),s=Jb[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>r(n.id),eT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,r]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>r(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(s,{size:16}),c.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&c.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),r(n.id)},children:[c.jsx(rw,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:c.jsx(Bn,{size:14})})]})}function nT(){const n=L(r=>r.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(r=>c.jsx(tT,{toast:r},r.id))})}let Qn=null,vi=null,ho=1e3;const rT=1e4;function sT(){const n=dr();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Vu(){Qn&&(Qn.readyState===WebSocket.OPEN||Qn.readyState===WebSocket.CONNECTING)||(Qn=new WebSocket(sT()),Qn.onopen=()=>{const n=ho>1e3;if(ho=1e3,L.getState().setWsConnected(!0),L.getState().addLogEntry("INFO","WebSocket connected"),n){const r=L.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},Qn.onclose=()=>{L.getState().setWsConnected(!1),L.getState().addLogEntry("WARN","WebSocket disconnected"),L.getState().addToast("warn","WebSocket disconnected — reconnecting…"),oT()},Qn.onerror=()=>{},Qn.onmessage=n=>{try{const r=JSON.parse(n.data);Ot.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const s=aT[r.event];s&&s(r.data)}catch{}})}function iT(){vi&&(clearTimeout(vi),vi=null),Qn&&(Qn.onclose=null,Qn.close(),Qn=null),L.getState().setWsConnected(!1)}function oT(){vi||(vi=window.setTimeout(()=>{vi=null,Vu()},ho),ho=Math.min(ho*2,rT))}const aT={"turn:created":n=>{const r=n;L.getState().onTurnCreated(r.sessionId,r.turn)},"turn:started":n=>{const r=n;Ot.note(`turn:started — ${r.turnId.slice(0,8)}`),L.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;L.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;L.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;L.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;L.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;Ot.note(`turn:completed — ${r.turnId.slice(0,8)}`),L.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;L.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,s={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage,...r.autoCompactThreshold?{autoCompactThreshold:r.autoCompactThreshold}:{}};L.getState().onContextUsageUpdated(r.sessionId,s)},"turn:failed":n=>{const r=n;L.getState().onTurnFailed(r.sessionId,r.turnId,r.error,r.resumeState)},"turn:interrupted":n=>{const r=n;Ot.note(`turn:interrupted — ${r.turnId.slice(0,8)} (${r.reason})`),L.getState().onTurnInterrupted(r.sessionId,r.turnId,{reason:r.reason,interruptedAt:r.interruptedAt,attempts:r.attempts,detail:r.detail??null})},"turn:resuming":n=>{const r=n;L.getState().onTurnResuming(r.sessionId,r.turnId,r.attempt)},"turn:resumed":n=>{const r=n;L.getState().onTurnResumed(r.sessionId,r.turnId)},"turn:retrying":n=>{const r=n;L.getState().onTurnRetrying(r.sessionId,r.turnId,{attempt:r.attempt,maxRetries:r.maxRetries,retryDelayMs:r.retryDelayMs,errorStatus:r.errorStatus??null,error:r.error??null})},"turn:cancelled":n=>{const r=n;L.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;L.getState().onSessionTitle(r.sessionId,r.title)},"session:touched":n=>{const r=n;L.getState().onSessionTouched(r.sessionId)},background_tasks:n=>{const r=n;Ot.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(s=>s.task_type).join(", ")||"none"})`),L.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"background_tasks:snapshot":n=>{const r=n;L.getState().onBackgroundTasksSnapshot(r.sessions??{})},"thread:created":n=>{const r=n;L.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;L.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;L.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;L.getState().onThreadDeleted(r.sessionId,r.threadId)},"app:tool_call":n=>{const r=n;Dx(r.appId,r.callId,r.tool,r.args??{})},"app:source:updated":n=>{Fx(n.appId)},"app:state_changed":n=>{$x(n.appId)}};function lT(){const n=L(r=>r.init);return w.useEffect(()=>{ex(),n(),Vu();function r(){if(document.visibilityState!=="visible")return;const s=L.getState(),o=s.activeSessionId;if(!o)return;const a=s.sessionDetails[o];s.wsConnected||Vu(),a&&a.is_running===1&&(s.refreshActiveSession(),s.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",r),()=>{iT(),document.removeEventListener("visibilitychange",r)}},[n]),null}function cT(){const n=L(a=>a.loading),r=L(a=>a.error),s=L(a=>a.sessions),o=L(a=>a.setShowCommandPalette);return w.useEffect(()=>Ot.start(),[]),w.useEffect(()=>{function a(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]),c.jsxs(c.Fragment,{children:[c.jsx(lT,{}),n&&s.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):r&&s.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",r]}):c.jsxs(c.Fragment,{children:[c.jsx(Hb,{}),c.jsx(Vb,{}),c.jsx(Yb,{}),c.jsx(Zb,{}),c.jsx(Xb,{}),c.jsx(nT,{})]})]})}Hy.createRoot(document.getElementById("root")).render(c.jsx(st.StrictMode,{children:c.jsx(cT,{})}));
|
|
571
|
+
This cannot be undone.`)){x(!0);try{const X=await fetch(`${Un()}/remote/uninstall`,{method:"DELETE"});if(!X.ok)throw new Error(`uninstall ${X.status}`);await ue()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function ae(){if(!W)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:I,onChange:j=>A(j.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>T("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!Am.test(I)||B,onClick:()=>void ve(I),children:[B?c.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const z=["detect","provision","install","verify","ready"],X=z.indexOf(W.step),V=W.state==="ready";return c.jsxs(c.Fragment,{children:[W.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(Jn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),W.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(os,{size:14})," Setup complete — you can close this window."]}),W.state==="ready"&&W.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${W.hostname}`,target:"_blank",rel:"noreferrer",children:W.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:z.map((j,L)=>{const ce=V||X>-1&&L<X,q=!V&&L===X&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:ce||q?1:.4,color:ce?"var(--green)":void 0},children:[ce?c.jsx(os,{size:13}):q?c.jsx(Jn,{size:13,className:"spin"}):c.jsx($0,{size:9,style:{marginLeft:2,marginRight:2}}),j]},j)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(j=>j.message).join(`
|
|
572
|
+
`)}),W.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.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."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Me,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ue(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:pe,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Wn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[h&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(Jn,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),C==="setup"?ae():c.jsxs(c.Fragment,{children:[de&&(o==null?void 0:o.tunnel.hostname)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),c.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[c.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void ee(),disabled:K,children:[m?c.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),c.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>E(z=>!z),disabled:K,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":b,children:k?c.jsx(Jn,{size:14,className:"spin"}):c.jsx(mi,{size:14})}),b&&c.jsx("div",{ref:G,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:c.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void re(),children:[c.jsx(dr,{size:12})," Remove tunnel"]})})]})]}),!de&&c.jsx(c.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void ve(o.tunnel.mahlas),disabled:B,children:[B?c.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(Th,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>T("setup"),children:[c.jsx(Th,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const lT={success:O0,error:gl,info:q0,warn:dw},cT=4e3;function uT({toast:n}){const r=M(f=>f.removeToast),s=lT[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>r(n.id),cT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,r]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>r(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(s,{size:16}),c.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&c.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),r(n.id)},children:[c.jsx(fw,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:c.jsx(Wn,{size:14})})]})}function dT(){const n=M(r=>r.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(r=>c.jsx(uT,{toast:r},r.id))})}function fT(){const[n]=w.useState(Xx),[r,s]=w.useState(!1);return c.jsxs("main",{className:"daemon-download",children:[c.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),n&&c.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg Daemon app to continue."}),c.jsxs("a",{className:n?"daemon-download-link":"daemon-download-btn",href:qx,onClick:()=>s(!0),children:[c.jsx(B0,{size:n?13:16}),"Download for Mac"]}),(n||r)&&c.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[c.jsx(Jn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Zn=null,vi=null,ho=1e3;const pT=1e4;function hT(){const n=Un();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Vu(){Zn&&(Zn.readyState===WebSocket.OPEN||Zn.readyState===WebSocket.CONNECTING)||(Zn=new WebSocket(hT()),Zn.onopen=()=>{const n=ho>1e3;if(ho=1e3,M.getState().setWsConnected(!0),M.getState().addLogEntry("INFO","WebSocket connected"),n){const r=M.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},Zn.onclose=()=>{M.getState().setWsConnected(!1),M.getState().addLogEntry("WARN","WebSocket disconnected"),M.getState().addToast("warn","WebSocket disconnected — reconnecting…"),gT()},Zn.onerror=()=>{},Zn.onmessage=n=>{try{const r=JSON.parse(n.data);Ot.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const s=vT[r.event];s&&s(r.data)}catch{}})}function mT(){vi&&(clearTimeout(vi),vi=null),Zn&&(Zn.onclose=null,Zn.close(),Zn=null),M.getState().setWsConnected(!1)}function gT(){vi||(vi=window.setTimeout(()=>{vi=null,Vu()},ho),ho=Math.min(ho*2,pT))}const vT={"turn:created":n=>{const r=n;M.getState().onTurnCreated(r.sessionId,r.turn)},"turn:started":n=>{const r=n;Ot.note(`turn:started — ${r.turnId.slice(0,8)}`),M.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;M.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;M.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;M.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;M.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;Ot.note(`turn:completed — ${r.turnId.slice(0,8)}`),M.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;M.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,s={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage,...r.autoCompactThreshold?{autoCompactThreshold:r.autoCompactThreshold}:{}};M.getState().onContextUsageUpdated(r.sessionId,s)},"turn:failed":n=>{const r=n;M.getState().onTurnFailed(r.sessionId,r.turnId,r.error,r.resumeState)},"turn:interrupted":n=>{const r=n;Ot.note(`turn:interrupted — ${r.turnId.slice(0,8)} (${r.reason})`),M.getState().onTurnInterrupted(r.sessionId,r.turnId,{reason:r.reason,interruptedAt:r.interruptedAt,attempts:r.attempts,detail:r.detail??null})},"turn:resuming":n=>{const r=n;M.getState().onTurnResuming(r.sessionId,r.turnId,r.attempt)},"turn:resumed":n=>{const r=n;M.getState().onTurnResumed(r.sessionId,r.turnId)},"turn:retrying":n=>{const r=n;M.getState().onTurnRetrying(r.sessionId,r.turnId,{attempt:r.attempt,maxRetries:r.maxRetries,retryDelayMs:r.retryDelayMs,errorStatus:r.errorStatus??null,error:r.error??null})},"turn:cancelled":n=>{const r=n;M.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;M.getState().onSessionTitle(r.sessionId,r.title)},"session:touched":n=>{const r=n;M.getState().onSessionTouched(r.sessionId)},background_tasks:n=>{const r=n;Ot.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(s=>s.task_type).join(", ")||"none"})`),M.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"background_tasks:snapshot":n=>{const r=n;M.getState().onBackgroundTasksSnapshot(r.sessions??{})},"thread:created":n=>{const r=n;M.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;M.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;M.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;M.getState().onThreadDeleted(r.sessionId,r.threadId)},"app:tool_call":n=>{const r=n;Mx(r.appId,r.callId,r.tool,r.args??{})},"app:source:updated":n=>{Ux(n.appId)},"app:state_changed":n=>{Fx(n.appId)}};function yT(){const n=M(r=>r.init);return w.useEffect(()=>{tx();function r(){n(),Vu()}const{daemonStatus:s,setDaemonStatus:o}=M.getState();let a=null;s==="ready"?r():a=Zx({onMissing:()=>o("missing"),onReady:()=>{o("ready"),r()}});function u(){if(document.visibilityState!=="visible")return;const f=M.getState(),h=f.activeSessionId;if(!h)return;const g=f.sessionDetails[h];f.wsConnected||Vu(),g&&g.is_running===1&&(f.refreshActiveSession(),f.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",u),()=>{a==null||a(),mT(),document.removeEventListener("visibilitychange",u)}},[n]),null}function xT(){const n=M(u=>u.loading),r=M(u=>u.error),s=M(u=>u.sessions),o=M(u=>u.daemonStatus),a=M(u=>u.setShowCommandPalette);return w.useEffect(()=>Ot.start(),[]),w.useEffect(()=>{function u(f){(f.metaKey||f.ctrlKey)&&f.key==="k"&&(f.preventDefault(),a(!0))}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[a]),c.jsxs(c.Fragment,{children:[c.jsx(yT,{}),o==="missing"?c.jsx(fT,{}):o==="checking"||n&&s.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):r&&s.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",r]}):c.jsxs(c.Fragment,{children:[c.jsx(Jb,{}),c.jsx(eT,{}),c.jsx(sT,{}),c.jsx(aT,{}),c.jsx(iT,{}),c.jsx(dT,{})]})]})}Vy.createRoot(document.getElementById("root")).render(c.jsx(st.StrictMode,{children:c.jsx(xT,{})}));
|