repoburg 1.3.277 → 1.3.278
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/backend/dist/index.js +974 -404
- package/agent-pane/backend/dist/server.js +974 -404
- package/agent-pane/frontend/dist/assets/index-BD6rEkyH.css +1 -0
- package/agent-pane/frontend/dist/assets/index-DMFO29nN.js +639 -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-_wc4JDGr.js +0 -624
- package/agent-pane/frontend/dist/assets/index-l4iJLb5_.css +0 -1
|
@@ -1,624 +0,0 @@
|
|
|
1
|
-
var tx=Object.defineProperty;var nx=(t,s,r)=>s in t?tx(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;var rt=(t,s,r)=>nx(t,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.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 r(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=r(a);fetch(a.href,u)}})();function Bm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lu={exports:{}},no={},cu={exports:{}},We={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Gp;function sx(){if(Gp)return We;Gp=1;var t=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=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(C){return C===null||typeof C!="object"?null:(C=k&&C[k]||C["@@iterator"],typeof C=="function"?C:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function T(C,D,oe){this.props=C,this.context=D,this.refs=_,this.updater=oe||b}T.prototype.isReactComponent={},T.prototype.setState=function(C,D){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,D,"setState")},T.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function A(){}A.prototype=T.prototype;function R(C,D,oe){this.props=C,this.context=D,this.refs=_,this.updater=oe||b}var U=R.prototype=new A;U.constructor=R,j(U,T.prototype),U.isPureReactComponent=!0;var P=Array.isArray,H=Object.prototype.hasOwnProperty,Y={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function X(C,D,oe){var G,ue={},fe=null,Pe=null;if(D!=null)for(G in D.ref!==void 0&&(Pe=D.ref),D.key!==void 0&&(fe=""+D.key),D)H.call(D,G)&&!K.hasOwnProperty(G)&&(ue[G]=D[G]);var Ce=arguments.length-2;if(Ce===1)ue.children=oe;else if(1<Ce){for(var Ee=Array(Ce),_e=0;_e<Ce;_e++)Ee[_e]=arguments[_e+2];ue.children=Ee}if(C&&C.defaultProps)for(G in Ce=C.defaultProps,Ce)ue[G]===void 0&&(ue[G]=Ce[G]);return{$$typeof:t,type:C,key:fe,ref:Pe,props:ue,_owner:Y.current}}function de(C,D){return{$$typeof:t,type:C.type,key:D,ref:C.ref,props:C.props,_owner:C._owner}}function he(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function V(C){var D={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(oe){return D[oe]})}var Te=/\/+/g;function Ne(C,D){return typeof C=="object"&&C!==null&&C.key!=null?V(""+C.key):D.toString(36)}function Le(C,D,oe,G,ue){var fe=typeof C;(fe==="undefined"||fe==="boolean")&&(C=null);var Pe=!1;if(C===null)Pe=!0;else switch(fe){case"string":case"number":Pe=!0;break;case"object":switch(C.$$typeof){case t:case s:Pe=!0}}if(Pe)return Pe=C,ue=ue(Pe),C=G===""?"."+Ne(Pe,0):G,P(ue)?(oe="",C!=null&&(oe=C.replace(Te,"$&/")+"/"),Le(ue,D,oe,"",function(_e){return _e})):ue!=null&&(he(ue)&&(ue=de(ue,oe+(!ue.key||Pe&&Pe.key===ue.key?"":(""+ue.key).replace(Te,"$&/")+"/")+C)),D.push(ue)),1;if(Pe=0,G=G===""?".":G+":",P(C))for(var Ce=0;Ce<C.length;Ce++){fe=C[Ce];var Ee=G+Ne(fe,Ce);Pe+=Le(fe,D,oe,Ee,ue)}else if(Ee=x(C),typeof Ee=="function")for(C=Ee.call(C),Ce=0;!(fe=C.next()).done;)fe=fe.value,Ee=G+Ne(fe,Ce++),Pe+=Le(fe,D,oe,Ee,ue);else if(fe==="object")throw D=String(C),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return Pe}function te(C,D,oe){if(C==null)return C;var G=[],ue=0;return Le(C,G,"","",function(fe){return D.call(oe,fe,ue++)}),G}function se(C){if(C._status===-1){var D=C._result;D=D(),D.then(function(oe){(C._status===0||C._status===-1)&&(C._status=1,C._result=oe)},function(oe){(C._status===0||C._status===-1)&&(C._status=2,C._result=oe)}),C._status===-1&&(C._status=0,C._result=D)}if(C._status===1)return C._result.default;throw C._result}var ie={current:null},O={transition:null},Q={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:O,ReactCurrentOwner:Y};function F(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:te,forEach:function(C,D,oe){te(C,function(){D.apply(this,arguments)},oe)},count:function(C){var D=0;return te(C,function(){D++}),D},toArray:function(C){return te(C,function(D){return D})||[]},only:function(C){if(!he(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},We.Component=T,We.Fragment=r,We.Profiler=a,We.PureComponent=R,We.StrictMode=o,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,We.act=F,We.cloneElement=function(C,D,oe){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var G=j({},C.props),ue=C.key,fe=C.ref,Pe=C._owner;if(D!=null){if(D.ref!==void 0&&(fe=D.ref,Pe=Y.current),D.key!==void 0&&(ue=""+D.key),C.type&&C.type.defaultProps)var Ce=C.type.defaultProps;for(Ee in D)H.call(D,Ee)&&!K.hasOwnProperty(Ee)&&(G[Ee]=D[Ee]===void 0&&Ce!==void 0?Ce[Ee]:D[Ee])}var Ee=arguments.length-2;if(Ee===1)G.children=oe;else if(1<Ee){Ce=Array(Ee);for(var _e=0;_e<Ee;_e++)Ce[_e]=arguments[_e+2];G.children=Ce}return{$$typeof:t,type:C.type,key:ue,ref:fe,props:G,_owner:Pe}},We.createContext=function(C){return C={$$typeof:f,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},C.Provider={$$typeof:u,_context:C},C.Consumer=C},We.createElement=X,We.createFactory=function(C){var D=X.bind(null,C);return D.type=C,D},We.createRef=function(){return{current:null}},We.forwardRef=function(C){return{$$typeof:h,render:C}},We.isValidElement=he,We.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:se}},We.memo=function(C,D){return{$$typeof:m,type:C,compare:D===void 0?null:D}},We.startTransition=function(C){var D=O.transition;O.transition={};try{C()}finally{O.transition=D}},We.unstable_act=F,We.useCallback=function(C,D){return ie.current.useCallback(C,D)},We.useContext=function(C){return ie.current.useContext(C)},We.useDebugValue=function(){},We.useDeferredValue=function(C){return ie.current.useDeferredValue(C)},We.useEffect=function(C,D){return ie.current.useEffect(C,D)},We.useId=function(){return ie.current.useId()},We.useImperativeHandle=function(C,D,oe){return ie.current.useImperativeHandle(C,D,oe)},We.useInsertionEffect=function(C,D){return ie.current.useInsertionEffect(C,D)},We.useLayoutEffect=function(C,D){return ie.current.useLayoutEffect(C,D)},We.useMemo=function(C,D){return ie.current.useMemo(C,D)},We.useReducer=function(C,D,oe){return ie.current.useReducer(C,D,oe)},We.useRef=function(C){return ie.current.useRef(C)},We.useState=function(C){return ie.current.useState(C)},We.useSyncExternalStore=function(C,D,oe){return ie.current.useSyncExternalStore(C,D,oe)},We.useTransition=function(){return ie.current.useTransition()},We.version="18.3.1",We}var Kp;function Zu(){return Kp||(Kp=1,cu.exports=sx()),cu.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Yp;function rx(){if(Yp)return no;Yp=1;var t=Zu(),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=t.__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:s,type:h,key:x,ref:b,props:k,_owner:a.current}}return no.Fragment=r,no.jsx=f,no.jsxs=f,no}var Xp;function ix(){return Xp||(Xp=1,lu.exports=rx()),lu.exports}var l=ix(),w=Zu();const it=Bm(w);var Da={},uu={exports:{}},jn={},du={exports:{}},fu={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Qp;function ox(){return Qp||(Qp=1,(function(t){function s(O,Q){var F=O.length;O.push(Q);e:for(;0<F;){var C=F-1>>>1,D=O[C];if(0<a(D,Q))O[C]=Q,O[F]=D,F=C;else break e}}function r(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var Q=O[0],F=O.pop();if(F!==Q){O[0]=F;e:for(var C=0,D=O.length,oe=D>>>1;C<oe;){var G=2*(C+1)-1,ue=O[G],fe=G+1,Pe=O[fe];if(0>a(ue,F))fe<D&&0>a(Pe,ue)?(O[C]=Pe,O[fe]=F,C=fe):(O[C]=ue,O[G]=F,C=G);else if(fe<D&&0>a(Pe,F))O[C]=Pe,O[fe]=F,C=fe;else break e}}return Q}function a(O,Q){var F=O.sortIndex-Q.sortIndex;return F!==0?F:O.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var g=[],m=[],v=1,k=null,x=3,b=!1,j=!1,_=!1,T=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(O){for(var Q=r(m);Q!==null;){if(Q.callback===null)o(m);else if(Q.startTime<=O)o(m),Q.sortIndex=Q.expirationTime,s(g,Q);else break;Q=r(m)}}function P(O){if(_=!1,U(O),!j)if(r(g)!==null)j=!0,se(H);else{var Q=r(m);Q!==null&&ie(P,Q.startTime-O)}}function H(O,Q){j=!1,_&&(_=!1,A(X),X=-1),b=!0;var F=x;try{for(U(Q),k=r(g);k!==null&&(!(k.expirationTime>Q)||O&&!V());){var C=k.callback;if(typeof C=="function"){k.callback=null,x=k.priorityLevel;var D=C(k.expirationTime<=Q);Q=t.unstable_now(),typeof D=="function"?k.callback=D:k===r(g)&&o(g),U(Q)}else o(g);k=r(g)}if(k!==null)var oe=!0;else{var G=r(m);G!==null&&ie(P,G.startTime-Q),oe=!1}return oe}finally{k=null,x=F,b=!1}}var Y=!1,K=null,X=-1,de=5,he=-1;function V(){return!(t.unstable_now()-he<de)}function Te(){if(K!==null){var O=t.unstable_now();he=O;var Q=!0;try{Q=K(!0,O)}finally{Q?Ne():(Y=!1,K=null)}}else Y=!1}var Ne;if(typeof R=="function")Ne=function(){R(Te)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,te=Le.port2;Le.port1.onmessage=Te,Ne=function(){te.postMessage(null)}}else Ne=function(){T(Te,0)};function se(O){K=O,Y||(Y=!0,Ne())}function ie(O,Q){X=T(function(){O(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(O){O.callback=null},t.unstable_continueExecution=function(){j||b||(j=!0,se(H))},t.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<O?Math.floor(1e3/O):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return r(g)},t.unstable_next=function(O){switch(x){case 1:case 2:case 3:var Q=3;break;default:Q=x}var F=x;x=Q;try{return O()}finally{x=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(O,Q){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var F=x;x=O;try{return Q()}finally{x=F}},t.unstable_scheduleCallback=function(O,Q,F){var C=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?C+F:C):F=C,O){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=F+D,O={id:v++,callback:Q,priorityLevel:O,startTime:F,expirationTime:D,sortIndex:-1},F>C?(O.sortIndex=F,s(m,O),r(g)===null&&O===r(m)&&(_?(A(X),X=-1):_=!0,ie(P,F-C))):(O.sortIndex=D,s(g,O),j||b||(j=!0,se(H))),O},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(O){var Q=x;return function(){var F=x;x=Q;try{return O.apply(this,arguments)}finally{x=F}}}})(fu)),fu}var Zp;function ax(){return Zp||(Zp=1,du.exports=ox()),du.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Jp;function lx(){if(Jp)return jn;Jp=1;var t=Zu(),s=ax();function r(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+n+" 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,n){f(e,n),f(e+"Capture",n)}function f(e,n){for(a[e]=n,e=0;e<n.length;e++)o.add(n[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,n,i,c){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,i,c){if(n===null||typeof n>"u"||b(e,n,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function _(e,n,i,c,d,p,y){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=y}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new _(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new _(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new _(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 _(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new _(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new _(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new _(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function R(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 n=e.replace(A,R);T[n]=new _(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(A,R);T[n]=new _(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(A,R);T[n]=new _(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,n,i,c){var d=T.hasOwnProperty(n)?T[n]:null;(d!==null?d.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,i,d,c)&&(i=null),c||d===null?x(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(n=d.attributeName,c=d.attributeNamespace,i===null?e.removeAttribute(n):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,c?e.setAttributeNS(c,n,i):e.setAttribute(n,i))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),Y=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),he=Symbol.for("react.provider"),V=Symbol.for("react.context"),Te=Symbol.for("react.forward_ref"),Ne=Symbol.for("react.suspense"),Le=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),O=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=O&&e[O]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,C;function D(e){if(C===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);C=n&&n[1]||""}return`
|
|
34
|
-
`+C+e}var oe=!1;function G(e,n){if(!e||oe)return"";oe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(W){var c=W}Reflect.construct(e,[],n)}else{try{n.call()}catch(W){c=W}e.call(n.prototype)}else{try{throw Error()}catch(W){c=W}e()}}catch(W){if(W&&c&&typeof W.stack=="string"){for(var d=W.stack.split(`
|
|
35
|
-
`),p=c.stack.split(`
|
|
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 I=`
|
|
37
|
-
`+d[y].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),I}while(1<=y&&0<=N);break}}}finally{oe=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?D(e):""}function ue(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1),e;case 11:return e=G(e.type.render,!1),e;case 1:return e=G(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 K:return"Fragment";case Y:return"Portal";case de:return"Profiler";case X:return"StrictMode";case Ne:return"Suspense";case Le:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case V:return(e.displayName||"Context")+".Consumer";case he:return(e._context.displayName||"Context")+".Provider";case Te:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case se:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}function Pe(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(n);case 8:return n===X?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}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 Ee(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _e(e){var n=Ee(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(y){c=""+y,p.call(this,y)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(y){c=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function ot(e){e._valueTracker||(e._valueTracker=_e(e))}function je(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),c="";return e&&(c=Ee(e)?e.checked?"true":"false":e.value),e=c,e!==i?(n.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 ze(e,n){var i=n.checked;return F({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function It(e,n){var i=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;i=Ce(n.value!=null?n.value:i),e._wrapperState={initialChecked:c,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Fe(e,n){n=n.checked,n!=null&&U(e,"checked",n,!1)}function Dt(e,n){Fe(e,n);var i=Ce(n.value),c=n.type;if(i!=null)c==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?St(e,n.type,i):n.hasOwnProperty("defaultValue")&&St(e,n.type,Ce(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Rn(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function St(e,n,i){(n!=="number"||kt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Mt=Array.isArray;function ht(e,n,i,c){if(e=e.options,n){n={};for(var d=0;d<i.length;d++)n["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=n.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&c&&(e[i].defaultSelected=!0)}else{for(i=""+Ce(i),n=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,c&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function en(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(r(91));return F({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function q(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(r(92));if(Mt(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:Ce(i)}}function pe(e,n){var i=Ce(n.value),c=Ce(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),c!=null&&(e.defaultValue=""+c)}function Ue(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}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 mt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gt,Rt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,c,d){MSApp.execUnsafeLocalFunction(function(){return e(n,i,c,d)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(gt=gt||document.createElement("div"),gt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=gt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ht(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}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},An=["Webkit","ms","Moz","O"];Object.keys(ut).forEach(function(e){An.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),ut[n]=ut[e]})});function Hn(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||ut.hasOwnProperty(e)&&ut[e]?(""+n).trim():n+"px"}function Ts(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var c=i.indexOf("--")===0,d=Hn(i,n[i],c);i==="float"&&(i="cssFloat"),c?e.setProperty(i,d):e[i]=d}}var ms=F({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 In(e,n){if(n){if(ms[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(r(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(r(61))}if(n.style!=null&&typeof n.style!="object")throw Error(r(62))}}function Dn(e,n){if(e.indexOf("-")===-1)return typeof n.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 pn=null;function wn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ft=null,Vt=null,st=null;function vt(e){if(e=Ui(e)){if(typeof Ft!="function")throw Error(r(280));var n=e.stateNode;n&&(n=Ko(n),Ft(e.stateNode,e.type,n))}}function yt(e){Vt?st?st.push(e):st=[e]:Vt=e}function qt(){if(Vt){var e=Vt,n=st;if(st=Vt=null,vt(e),n)for(e=0;e<n.length;e++)vt(n[e])}}function bt(e,n){return e(n)}function xt(){}var at=!1;function Gt(e,n,i){if(at)return e(n,i);at=!0;try{return bt(e,n,i)}finally{at=!1,(Vt!==null||st!==null)&&(xt(),qt())}}function Je(e,n){var i=e.stateNode;if(i===null)return null;var c=Ko(i);if(c===null)return null;i=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,n,typeof i));return i}var E=!1;if(h)try{var ae={};Object.defineProperty(ae,"passive",{get:function(){E=!0}}),window.addEventListener("test",ae,ae),window.removeEventListener("test",ae,ae)}catch{E=!1}function re(e,n,i,c,d,p,y,N,I){var W=Array.prototype.slice.call(arguments,3);try{n.apply(i,W)}catch(ee){this.onError(ee)}}var ge=!1,$e=null,Be=!1,De=null,lt={onError:function(e){ge=!0,$e=e}};function Mn(e,n,i,c,d,p,y,N,I){ge=!1,$e=null,re.apply(lt,arguments)}function Ln(e,n,i,c,d,p,y,N,I){if(Mn.apply(this,arguments),ge){if(ge){var W=$e;ge=!1,$e=null}else throw Error(r(198));Be||(Be=!0,De=W)}}function He(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function kn(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Fs(e){if(He(e)!==e)throw Error(r(188))}function ts(e){var n=e.alternate;if(!n){if(n=He(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,c=n;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(c=d.return,c!==null){i=c;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return Fs(d),e;if(p===c)return Fs(d),n;p=p.sibling}throw Error(r(188))}if(i.return!==c.return)i=d,c=p;else{for(var y=!1,N=d.child;N;){if(N===i){y=!0,i=d,c=p;break}if(N===c){y=!0,c=d,i=p;break}N=N.sibling}if(!y){for(N=p.child;N;){if(N===i){y=!0,i=p,c=d;break}if(N===c){y=!0,c=p,i=d;break}N=N.sibling}if(!y)throw Error(r(189))}}if(i.alternate!==c)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function ns(e){return e=ts(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 n=Xe(e);if(n!==null)return n;e=e.sibling}return null}var Tt=s.unstable_scheduleCallback,ss=s.unstable_cancelCallback,Il=s.unstable_shouldYield,Dl=s.unstable_requestPaint,Nt=s.unstable_now,gs=s.unstable_getCurrentPriorityLevel,Us=s.unstable_ImmediatePriority,vs=s.unstable_UserBlockingPriority,Or=s.unstable_NormalPriority,fr=s.unstable_LowPriority,Ro=s.unstable_IdlePriority,pr=null,Pn=null;function $r(e){if(Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(pr,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:hr,zr=Math.log,Bs=Math.LN2;function hr(e){return e>>>=0,e===0?32:31-(zr(e)/Bs|0)|0}var mn=64,Fr=4194304;function mr(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 gr(e,n){var i=e.pendingLanes;if(i===0)return 0;var c=0,d=e.suspendedLanes,p=e.pingedLanes,y=i&268435455;if(y!==0){var N=y&~d;N!==0?c=mr(N):(p&=y,p!==0&&(c=mr(p)))}else y=i&~d,y!==0?c=mr(y):p!==0&&(c=mr(p));if(c===0)return 0;if(n!==0&&n!==c&&(n&d)===0&&(d=c&-c,p=n&-n,d>=p||d===16&&(p&4194240)!==0))return n;if((c&4)!==0&&(c|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=c;0<n;)i=31-hn(n),d=1<<i,c|=e[i],n&=~d;return c}function Ao(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 Io(e,n){for(var i=e.suspendedLanes,c=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var y=31-hn(p),N=1<<y,I=d[y];I===-1?((N&i)===0||(N&c)!==0)&&(d[y]=Ao(N,n)):I<=n&&(e.expiredLanes|=N),p&=~N}}function Ti(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ni(){var e=mn;return mn<<=1,(mn&4194240)===0&&(mn=64),e}function Ci(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function vr(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-hn(n),e[n]=i}function Do(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var c=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-hn(i),p=1<<d;n[d]=0,c[d]=-1,e[d]=-1,i&=~p}}function Ws(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var c=31-hn(i),d=1<<c;d&n|e[c]&n&&(e[c]|=n),i&=~d}}var Ge=0;function le(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,$,Z,we,be,Oe=!1,Ke=[],Qe=null,Ct=null,jt=null,Ns=new Map,Lt=new Map,Hs=[],bv="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 Ed(e,n){switch(e){case"focusin":case"focusout":Qe=null;break;case"dragenter":case"dragleave":Ct=null;break;case"mouseover":case"mouseout":jt=null;break;case"pointerover":case"pointerout":Ns.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lt.delete(n.pointerId)}}function ji(e,n,i,c,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:i,eventSystemFlags:c,nativeEvent:p,targetContainers:[d]},n!==null&&(n=Ui(n),n!==null&&$(n)),e):(e.eventSystemFlags|=c,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function Tv(e,n,i,c,d){switch(n){case"focusin":return Qe=ji(Qe,e,n,i,c,d),!0;case"dragenter":return Ct=ji(Ct,e,n,i,c,d),!0;case"mouseover":return jt=ji(jt,e,n,i,c,d),!0;case"pointerover":var p=d.pointerId;return Ns.set(p,ji(Ns.get(p)||null,e,n,i,c,d)),!0;case"gotpointercapture":return p=d.pointerId,Lt.set(p,ji(Lt.get(p)||null,e,n,i,c,d)),!0}return!1}function Rd(e){var n=yr(e.target);if(n!==null){var i=He(n);if(i!==null){if(n=i.tag,n===13){if(n=kn(i),n!==null){e.blockedOn=n,be(e.priority,function(){Z(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Ll(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var c=new i.constructor(i.type,i);pn=c,i.target.dispatchEvent(c),pn=null}else return n=Ui(i),n!==null&&$(n),e.blockedOn=i,!1;n.shift()}return!0}function Ad(e,n,i){Mo(e)&&i.delete(n)}function Nv(){Oe=!1,Qe!==null&&Mo(Qe)&&(Qe=null),Ct!==null&&Mo(Ct)&&(Ct=null),jt!==null&&Mo(jt)&&(jt=null),Ns.forEach(Ad),Lt.forEach(Ad)}function _i(e,n){e.blockedOn===n&&(e.blockedOn=null,Oe||(Oe=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Nv)))}function Ei(e){function n(d){return _i(d,e)}if(0<Ke.length){_i(Ke[0],e);for(var i=1;i<Ke.length;i++){var c=Ke[i];c.blockedOn===e&&(c.blockedOn=null)}}for(Qe!==null&&_i(Qe,e),Ct!==null&&_i(Ct,e),jt!==null&&_i(jt,e),Ns.forEach(n),Lt.forEach(n),i=0;i<Hs.length;i++)c=Hs[i],c.blockedOn===e&&(c.blockedOn=null);for(;0<Hs.length&&(i=Hs[0],i.blockedOn===null);)Rd(i),i.blockedOn===null&&Hs.shift()}var Ur=P.ReactCurrentBatchConfig,Lo=!0;function Cv(e,n,i,c){var d=Ge,p=Ur.transition;Ur.transition=null;try{Ge=1,Ml(e,n,i,c)}finally{Ge=d,Ur.transition=p}}function jv(e,n,i,c){var d=Ge,p=Ur.transition;Ur.transition=null;try{Ge=4,Ml(e,n,i,c)}finally{Ge=d,Ur.transition=p}}function Ml(e,n,i,c){if(Lo){var d=Ll(e,n,i,c);if(d===null)Zl(e,n,c,Po,i),Ed(e,c);else if(Tv(d,e,n,i,c))c.stopPropagation();else if(Ed(e,c),n&4&&-1<bv.indexOf(e)){for(;d!==null;){var p=Ui(d);if(p!==null&&S(p),p=Ll(e,n,i,c),p===null&&Zl(e,n,c,Po,i),p===d)break;d=p}d!==null&&c.stopPropagation()}else Zl(e,n,c,null,i)}}var Po=null;function Ll(e,n,i,c){if(Po=null,e=wn(c),e=yr(e),e!==null)if(n=He(e),n===null)e=null;else if(i=n.tag,i===13){if(e=kn(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Po=e,null}function Id(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(gs()){case Us:return 1;case vs:return 4;case Or:case fr:return 16;case Ro:return 536870912;default:return 16}default:return 16}}var Vs=null,Pl=null,Oo=null;function Dd(){if(Oo)return Oo;var e,n=Pl,i=n.length,c,d="value"in Vs?Vs.value:Vs.textContent,p=d.length;for(e=0;e<i&&n[e]===d[e];e++);var y=i-e;for(c=1;c<=y&&n[i-c]===d[p-c];c++);return Oo=d.slice(e,1<c?1-c:void 0)}function $o(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function zo(){return!0}function Md(){return!1}function On(e){function n(i,c,d,p,y){this._reactName=i,this._targetInst=d,this.type=c,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)?zo:Md,this.isPropagationStopped=Md,this}return F(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=zo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=zo)},persist:function(){},isPersistent:zo}),n}var Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=On(Br),Ri=F({},Br,{view:0,detail:0}),_v=On(Ri),$l,zl,Ai,Fo=F({},Ri,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ul,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!==Ai&&(Ai&&e.type==="mousemove"?($l=e.screenX-Ai.screenX,zl=e.screenY-Ai.screenY):zl=$l=0,Ai=e),$l)},movementY:function(e){return"movementY"in e?e.movementY:zl}}),Ld=On(Fo),Ev=F({},Fo,{dataTransfer:0}),Rv=On(Ev),Av=F({},Ri,{relatedTarget:0}),Fl=On(Av),Iv=F({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),Dv=On(Iv),Mv=F({},Br,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lv=On(Mv),Pv=F({},Br,{data:0}),Pd=On(Pv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$v={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"},zv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=zv[e])?!!n[e]:!1}function Ul(){return Fv}var Uv=F({},Ri,{key:function(e){if(e.key){var n=Ov[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=$o(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$v[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ul,charCode:function(e){return e.type==="keypress"?$o(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$o(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bv=On(Uv),Wv=F({},Fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Od=On(Wv),Hv=F({},Ri,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ul}),Vv=On(Hv),qv=F({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gv=On(qv),Kv=F({},Fo,{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}),Yv=On(Kv),Xv=[9,13,27,32],Bl=h&&"CompositionEvent"in window,Ii=null;h&&"documentMode"in document&&(Ii=document.documentMode);var Qv=h&&"TextEvent"in window&&!Ii,$d=h&&(!Bl||Ii&&8<Ii&&11>=Ii),zd=" ",Fd=!1;function Ud(e,n){switch(e){case"keyup":return Xv.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Zv(e,n){switch(e){case"compositionend":return Bd(n);case"keypress":return n.which!==32?null:(Fd=!0,zd);case"textInput":return e=n.data,e===zd&&Fd?null:e;default:return null}}function Jv(e,n){if(Wr)return e==="compositionend"||!Bl&&Ud(e,n)?(e=Dd(),Oo=Pl=Vs=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return $d&&n.locale!=="ko"?null:n.data;default:return null}}var ey={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 Wd(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ey[e.type]:n==="textarea"}function Hd(e,n,i,c){yt(c),n=Vo(n,"onChange"),0<n.length&&(i=new Ol("onChange","change",null,i,c),e.push({event:i,listeners:n}))}var Di=null,Mi=null;function ty(e){cf(e,0)}function Uo(e){var n=Kr(e);if(je(n))return e}function ny(e,n){if(e==="change")return n}var Vd=!1;if(h){var Wl;if(h){var Hl="oninput"in document;if(!Hl){var qd=document.createElement("div");qd.setAttribute("oninput","return;"),Hl=typeof qd.oninput=="function"}Wl=Hl}else Wl=!1;Vd=Wl&&(!document.documentMode||9<document.documentMode)}function Gd(){Di&&(Di.detachEvent("onpropertychange",Kd),Mi=Di=null)}function Kd(e){if(e.propertyName==="value"&&Uo(Mi)){var n=[];Hd(n,Mi,e,wn(e)),Gt(ty,n)}}function sy(e,n,i){e==="focusin"?(Gd(),Di=n,Mi=i,Di.attachEvent("onpropertychange",Kd)):e==="focusout"&&Gd()}function ry(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Uo(Mi)}function iy(e,n){if(e==="click")return Uo(n)}function oy(e,n){if(e==="input"||e==="change")return Uo(n)}function ay(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var rs=typeof Object.is=="function"?Object.is:ay;function Li(e,n){if(rs(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),c=Object.keys(n);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var d=i[c];if(!g.call(n,d)||!rs(e[d],n[d]))return!1}return!0}function Yd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xd(e,n){var i=Yd(e);e=0;for(var c;i;){if(i.nodeType===3){if(c=e+i.textContent.length,e<=n&&c>=n)return{node:i,offset:n-e};e=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Yd(i)}}function Qd(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Qd(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Zd(){for(var e=window,n=kt();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=kt(e.document)}return n}function Vl(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function ly(e){var n=Zd(),i=e.focusedElem,c=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&Qd(i.ownerDocument.documentElement,i)){if(c!==null&&Vl(i)){if(n=c.start,e=c.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(c.start,d);c=c.end===void 0?p:Math.min(c.end,d),!e.extend&&p>c&&(d=c,c=p,p=d),d=Xd(i,p);var y=Xd(i,c);d&&y&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(n=n.createRange(),n.setStart(d.node,d.offset),e.removeAllRanges(),p>c?(e.addRange(n),e.extend(y.node,y.offset)):(n.setEnd(y.node,y.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var cy=h&&"documentMode"in document&&11>=document.documentMode,Hr=null,ql=null,Pi=null,Gl=!1;function Jd(e,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Gl||Hr==null||Hr!==kt(c)||(c=Hr,"selectionStart"in c&&Vl(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Pi&&Li(Pi,c)||(Pi=c,c=Vo(ql,"onSelect"),0<c.length&&(n=new Ol("onSelect","select",null,n,i),e.push({event:n,listeners:c}),n.target=Hr)))}function Bo(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Vr={animationend:Bo("Animation","AnimationEnd"),animationiteration:Bo("Animation","AnimationIteration"),animationstart:Bo("Animation","AnimationStart"),transitionend:Bo("Transition","TransitionEnd")},Kl={},ef={};h&&(ef=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function Wo(e){if(Kl[e])return Kl[e];if(!Vr[e])return e;var n=Vr[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in ef)return Kl[e]=n[i];return e}var tf=Wo("animationend"),nf=Wo("animationiteration"),sf=Wo("animationstart"),rf=Wo("transitionend"),of=new Map,af="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 qs(e,n){of.set(e,n),u(n,[e])}for(var Yl=0;Yl<af.length;Yl++){var Xl=af[Yl],uy=Xl.toLowerCase(),dy=Xl[0].toUpperCase()+Xl.slice(1);qs(uy,"on"+dy)}qs(tf,"onAnimationEnd"),qs(nf,"onAnimationIteration"),qs(sf,"onAnimationStart"),qs("dblclick","onDoubleClick"),qs("focusin","onFocus"),qs("focusout","onBlur"),qs(rf,"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 Oi="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(" "),fy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function lf(e,n,i){var c=e.type||"unknown-event";e.currentTarget=i,Ln(c,n,void 0,e),e.currentTarget=null}function cf(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var c=e[i],d=c.event;c=c.listeners;e:{var p=void 0;if(n)for(var y=c.length-1;0<=y;y--){var N=c[y],I=N.instance,W=N.currentTarget;if(N=N.listener,I!==p&&d.isPropagationStopped())break e;lf(d,N,W),p=I}else for(y=0;y<c.length;y++){if(N=c[y],I=N.instance,W=N.currentTarget,N=N.listener,I!==p&&d.isPropagationStopped())break e;lf(d,N,W),p=I}}}if(Be)throw e=De,Be=!1,De=null,e}function dt(e,n){var i=n[rc];i===void 0&&(i=n[rc]=new Set);var c=e+"__bubble";i.has(c)||(uf(n,e,2,!1),i.add(c))}function Ql(e,n,i){var c=0;n&&(c|=4),uf(i,e,c,n)}var Ho="_reactListening"+Math.random().toString(36).slice(2);function $i(e){if(!e[Ho]){e[Ho]=!0,o.forEach(function(i){i!=="selectionchange"&&(fy.has(i)||Ql(i,!1,e),Ql(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ho]||(n[Ho]=!0,Ql("selectionchange",!1,n))}}function uf(e,n,i,c){switch(Id(n)){case 1:var d=Cv;break;case 4:d=jv;break;default:d=Ml}i=d.bind(null,n,i,e),d=void 0,!E||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),c?d!==void 0?e.addEventListener(n,i,{capture:!0,passive:d}):e.addEventListener(n,i,!0):d!==void 0?e.addEventListener(n,i,{passive:d}):e.addEventListener(n,i,!1)}function Zl(e,n,i,c,d){var p=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var y=c.tag;if(y===3||y===4){var N=c.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(y===4)for(y=c.return;y!==null;){var I=y.tag;if((I===3||I===4)&&(I=y.stateNode.containerInfo,I===d||I.nodeType===8&&I.parentNode===d))return;y=y.return}for(;N!==null;){if(y=yr(N),y===null)return;if(I=y.tag,I===5||I===6){c=p=y;continue e}N=N.parentNode}}c=c.return}Gt(function(){var W=p,ee=wn(i),ne=[];e:{var J=of.get(e);if(J!==void 0){var me=Ol,xe=e;switch(e){case"keypress":if($o(i)===0)break e;case"keydown":case"keyup":me=Bv;break;case"focusin":xe="focus",me=Fl;break;case"focusout":xe="blur",me=Fl;break;case"beforeblur":case"afterblur":me=Fl;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=Ld;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=Vv;break;case tf:case nf:case sf:me=Dv;break;case rf:me=Gv;break;case"scroll":me=_v;break;case"wheel":me=Yv;break;case"copy":case"cut":case"paste":me=Lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Od}var ke=(n&4)!==0,Pt=!ke&&e==="scroll",z=ke?J!==null?J+"Capture":null:J;ke=[];for(var M=W,B;M!==null;){B=M;var ce=B.stateNode;if(B.tag===5&&ce!==null&&(B=ce,z!==null&&(ce=Je(M,z),ce!=null&&ke.push(zi(M,ce,B)))),Pt)break;M=M.return}0<ke.length&&(J=new me(J,xe,null,i,ee),ne.push({event:J,listeners:ke}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",me=e==="mouseout"||e==="pointerout",J&&i!==pn&&(xe=i.relatedTarget||i.fromElement)&&(yr(xe)||xe[Cs]))break e;if((me||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,me?(xe=i.relatedTarget||i.toElement,me=W,xe=xe?yr(xe):null,xe!==null&&(Pt=He(xe),xe!==Pt||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(me=null,xe=W),me!==xe)){if(ke=Ld,ce="onMouseLeave",z="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ke=Od,ce="onPointerLeave",z="onPointerEnter",M="pointer"),Pt=me==null?J:Kr(me),B=xe==null?J:Kr(xe),J=new ke(ce,M+"leave",me,i,ee),J.target=Pt,J.relatedTarget=B,ce=null,yr(ee)===W&&(ke=new ke(z,M+"enter",xe,i,ee),ke.target=B,ke.relatedTarget=Pt,ce=ke),Pt=ce,me&&xe)t:{for(ke=me,z=xe,M=0,B=ke;B;B=qr(B))M++;for(B=0,ce=z;ce;ce=qr(ce))B++;for(;0<M-B;)ke=qr(ke),M--;for(;0<B-M;)z=qr(z),B--;for(;M--;){if(ke===z||z!==null&&ke===z.alternate)break t;ke=qr(ke),z=qr(z)}ke=null}else ke=null;me!==null&&df(ne,J,me,ke,!1),xe!==null&&Pt!==null&&df(ne,Pt,xe,ke,!0)}}e:{if(J=W?Kr(W):window,me=J.nodeName&&J.nodeName.toLowerCase(),me==="select"||me==="input"&&J.type==="file")var Se=ny;else if(Wd(J))if(Vd)Se=oy;else{Se=ry;var Ae=sy}else(me=J.nodeName)&&me.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Se=iy);if(Se&&(Se=Se(e,W))){Hd(ne,Se,i,ee);break e}Ae&&Ae(e,J,W),e==="focusout"&&(Ae=J._wrapperState)&&Ae.controlled&&J.type==="number"&&St(J,"number",J.value)}switch(Ae=W?Kr(W):window,e){case"focusin":(Wd(Ae)||Ae.contentEditable==="true")&&(Hr=Ae,ql=W,Pi=null);break;case"focusout":Pi=ql=Hr=null;break;case"mousedown":Gl=!0;break;case"contextmenu":case"mouseup":case"dragend":Gl=!1,Jd(ne,i,ee);break;case"selectionchange":if(cy)break;case"keydown":case"keyup":Jd(ne,i,ee)}var Ie;if(Bl)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Wr?Ud(e,i)&&(Me="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Me="onCompositionStart");Me&&($d&&i.locale!=="ko"&&(Wr||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Wr&&(Ie=Dd()):(Vs=ee,Pl="value"in Vs?Vs.value:Vs.textContent,Wr=!0)),Ae=Vo(W,Me),0<Ae.length&&(Me=new Pd(Me,e,null,i,ee),ne.push({event:Me,listeners:Ae}),Ie?Me.data=Ie:(Ie=Bd(i),Ie!==null&&(Me.data=Ie)))),(Ie=Qv?Zv(e,i):Jv(e,i))&&(W=Vo(W,"onBeforeInput"),0<W.length&&(ee=new Pd("onBeforeInput","beforeinput",null,i,ee),ne.push({event:ee,listeners:W}),ee.data=Ie))}cf(ne,n)})}function zi(e,n,i){return{instance:e,listener:n,currentTarget:i}}function Vo(e,n){for(var i=n+"Capture",c=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Je(e,i),p!=null&&c.unshift(zi(e,p,d)),p=Je(e,n),p!=null&&c.push(zi(e,p,d))),e=e.return}return c}function qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function df(e,n,i,c,d){for(var p=n._reactName,y=[];i!==null&&i!==c;){var N=i,I=N.alternate,W=N.stateNode;if(I!==null&&I===c)break;N.tag===5&&W!==null&&(N=W,d?(I=Je(i,p),I!=null&&y.unshift(zi(i,I,N))):d||(I=Je(i,p),I!=null&&y.push(zi(i,I,N)))),i=i.return}y.length!==0&&e.push({event:n,listeners:y})}var py=/\r\n?/g,hy=/\u0000|\uFFFD/g;function ff(e){return(typeof e=="string"?e:""+e).replace(py,`
|
|
38
|
-
`).replace(hy,"")}function qo(e,n,i){if(n=ff(n),ff(e)!==n&&i)throw Error(r(425))}function Go(){}var Jl=null,ec=null;function tc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var nc=typeof setTimeout=="function"?setTimeout:void 0,my=typeof clearTimeout=="function"?clearTimeout:void 0,pf=typeof Promise=="function"?Promise:void 0,gy=typeof queueMicrotask=="function"?queueMicrotask:typeof pf<"u"?function(e){return pf.resolve(null).then(e).catch(vy)}:nc;function vy(e){setTimeout(function(){throw e})}function sc(e,n){var i=n,c=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(c===0){e.removeChild(d),Ei(n);return}c--}else i!=="$"&&i!=="$?"&&i!=="$!"||c++;i=d}while(i);Ei(n)}function Gs(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function hf(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var Gr=Math.random().toString(36).slice(2),ys="__reactFiber$"+Gr,Fi="__reactProps$"+Gr,Cs="__reactContainer$"+Gr,rc="__reactEvents$"+Gr,yy="__reactListeners$"+Gr,xy="__reactHandles$"+Gr;function yr(e){var n=e[ys];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Cs]||i[ys]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=hf(e);e!==null;){if(i=e[ys])return i;e=hf(e)}return n}e=i,i=e.parentNode}return null}function Ui(e){return e=e[ys]||e[Cs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Kr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ko(e){return e[Fi]||null}var ic=[],Yr=-1;function Ks(e){return{current:e}}function ft(e){0>Yr||(e.current=ic[Yr],ic[Yr]=null,Yr--)}function ct(e,n){Yr++,ic[Yr]=e.current,e.current=n}var Ys={},on=Ks(Ys),Sn=Ks(!1),xr=Ys;function Xr(e,n){var i=e.type.contextTypes;if(!i)return Ys;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=n[p];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),d}function bn(e){return e=e.childContextTypes,e!=null}function Yo(){ft(Sn),ft(on)}function mf(e,n,i){if(on.current!==Ys)throw Error(r(168));ct(on,n),ct(Sn,i)}function gf(e,n,i){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var d in c)if(!(d in n))throw Error(r(108,Pe(e)||"Unknown",d));return F({},i,c)}function Xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ys,xr=on.current,ct(on,e),ct(Sn,Sn.current),!0}function vf(e,n,i){var c=e.stateNode;if(!c)throw Error(r(169));i?(e=gf(e,n,xr),c.__reactInternalMemoizedMergedChildContext=e,ft(Sn),ft(on),ct(on,e)):ft(Sn),ct(Sn,i)}var js=null,Qo=!1,oc=!1;function yf(e){js===null?js=[e]:js.push(e)}function wy(e){Qo=!0,yf(e)}function Xs(){if(!oc&&js!==null){oc=!0;var e=0,n=Ge;try{var i=js;for(Ge=1;e<i.length;e++){var c=i[e];do c=c(!0);while(c!==null)}js=null,Qo=!1}catch(d){throw js!==null&&(js=js.slice(e+1)),Tt(Us,Xs),d}finally{Ge=n,oc=!1}}return null}var Qr=[],Zr=0,Zo=null,Jo=0,Vn=[],qn=0,wr=null,_s=1,Es="";function kr(e,n){Qr[Zr++]=Jo,Qr[Zr++]=Zo,Zo=e,Jo=n}function xf(e,n,i){Vn[qn++]=_s,Vn[qn++]=Es,Vn[qn++]=wr,wr=e;var c=_s;e=Es;var d=32-hn(c)-1;c&=~(1<<d),i+=1;var p=32-hn(n)+d;if(30<p){var y=d-d%5;p=(c&(1<<y)-1).toString(32),c>>=y,d-=y,_s=1<<32-hn(n)+d|i<<d|c,Es=p+e}else _s=1<<p|i<<d|c,Es=e}function ac(e){e.return!==null&&(kr(e,1),xf(e,1,0))}function lc(e){for(;e===Zo;)Zo=Qr[--Zr],Qr[Zr]=null,Jo=Qr[--Zr],Qr[Zr]=null;for(;e===wr;)wr=Vn[--qn],Vn[qn]=null,Es=Vn[--qn],Vn[qn]=null,_s=Vn[--qn],Vn[qn]=null}var $n=null,zn=null,wt=!1,is=null;function wf(e,n){var i=Xn(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function kf(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,$n=e,zn=Gs(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,$n=e,zn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=wr!==null?{id:_s,overflow:Es}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=Xn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,$n=e,zn=null,!0):!1;default:return!1}}function cc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function uc(e){if(wt){var n=zn;if(n){var i=n;if(!kf(e,n)){if(cc(e))throw Error(r(418));n=Gs(i.nextSibling);var c=$n;n&&kf(e,n)?wf(c,i):(e.flags=e.flags&-4097|2,wt=!1,$n=e)}}else{if(cc(e))throw Error(r(418));e.flags=e.flags&-4097|2,wt=!1,$n=e}}}function Sf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$n=e}function ea(e){if(e!==$n)return!1;if(!wt)return Sf(e),wt=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!tc(e.type,e.memoizedProps)),n&&(n=zn)){if(cc(e))throw bf(),Error(r(418));for(;n;)wf(e,n),n=Gs(n.nextSibling)}if(Sf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){zn=Gs(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}zn=null}}else zn=$n?Gs(e.stateNode.nextSibling):null;return!0}function bf(){for(var e=zn;e;)e=Gs(e.nextSibling)}function Jr(){zn=$n=null,wt=!1}function dc(e){is===null?is=[e]:is.push(e)}var ky=P.ReactCurrentBatchConfig;function Bi(e,n,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(r(309));var c=i.stateNode}if(!c)throw Error(r(147,e));var d=c,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(y){var N=d.refs;y===null?delete N[p]:N[p]=y},n._stringRef=p,n)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function ta(e,n){throw e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Tf(e){var n=e._init;return n(e._payload)}function Nf(e){function n(z,M){if(e){var B=z.deletions;B===null?(z.deletions=[M],z.flags|=16):B.push(M)}}function i(z,M){if(!e)return null;for(;M!==null;)n(z,M),M=M.sibling;return null}function c(z,M){for(z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function d(z,M){return z=rr(z,M),z.index=0,z.sibling=null,z}function p(z,M,B){return z.index=B,e?(B=z.alternate,B!==null?(B=B.index,B<M?(z.flags|=2,M):B):(z.flags|=2,M)):(z.flags|=1048576,M)}function y(z){return e&&z.alternate===null&&(z.flags|=2),z}function N(z,M,B,ce){return M===null||M.tag!==6?(M=nu(B,z.mode,ce),M.return=z,M):(M=d(M,B),M.return=z,M)}function I(z,M,B,ce){var Se=B.type;return Se===K?ee(z,M,B.props.children,ce,B.key):M!==null&&(M.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===se&&Tf(Se)===M.type)?(ce=d(M,B.props),ce.ref=Bi(z,M,B),ce.return=z,ce):(ce=Na(B.type,B.key,B.props,null,z.mode,ce),ce.ref=Bi(z,M,B),ce.return=z,ce)}function W(z,M,B,ce){return M===null||M.tag!==4||M.stateNode.containerInfo!==B.containerInfo||M.stateNode.implementation!==B.implementation?(M=su(B,z.mode,ce),M.return=z,M):(M=d(M,B.children||[]),M.return=z,M)}function ee(z,M,B,ce,Se){return M===null||M.tag!==7?(M=Er(B,z.mode,ce,Se),M.return=z,M):(M=d(M,B),M.return=z,M)}function ne(z,M,B){if(typeof M=="string"&&M!==""||typeof M=="number")return M=nu(""+M,z.mode,B),M.return=z,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case H:return B=Na(M.type,M.key,M.props,null,z.mode,B),B.ref=Bi(z,null,M),B.return=z,B;case Y:return M=su(M,z.mode,B),M.return=z,M;case se:var ce=M._init;return ne(z,ce(M._payload),B)}if(Mt(M)||Q(M))return M=Er(M,z.mode,B,null),M.return=z,M;ta(z,M)}return null}function J(z,M,B,ce){var Se=M!==null?M.key:null;if(typeof B=="string"&&B!==""||typeof B=="number")return Se!==null?null:N(z,M,""+B,ce);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case H:return B.key===Se?I(z,M,B,ce):null;case Y:return B.key===Se?W(z,M,B,ce):null;case se:return Se=B._init,J(z,M,Se(B._payload),ce)}if(Mt(B)||Q(B))return Se!==null?null:ee(z,M,B,ce,null);ta(z,B)}return null}function me(z,M,B,ce,Se){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return z=z.get(B)||null,N(M,z,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case H:return z=z.get(ce.key===null?B:ce.key)||null,I(M,z,ce,Se);case Y:return z=z.get(ce.key===null?B:ce.key)||null,W(M,z,ce,Se);case se:var Ae=ce._init;return me(z,M,B,Ae(ce._payload),Se)}if(Mt(ce)||Q(ce))return z=z.get(B)||null,ee(M,z,ce,Se,null);ta(M,ce)}return null}function xe(z,M,B,ce){for(var Se=null,Ae=null,Ie=M,Me=M=0,Xt=null;Ie!==null&&Me<B.length;Me++){Ie.index>Me?(Xt=Ie,Ie=null):Xt=Ie.sibling;var Ze=J(z,Ie,B[Me],ce);if(Ze===null){Ie===null&&(Ie=Xt);break}e&&Ie&&Ze.alternate===null&&n(z,Ie),M=p(Ze,M,Me),Ae===null?Se=Ze:Ae.sibling=Ze,Ae=Ze,Ie=Xt}if(Me===B.length)return i(z,Ie),wt&&kr(z,Me),Se;if(Ie===null){for(;Me<B.length;Me++)Ie=ne(z,B[Me],ce),Ie!==null&&(M=p(Ie,M,Me),Ae===null?Se=Ie:Ae.sibling=Ie,Ae=Ie);return wt&&kr(z,Me),Se}for(Ie=c(z,Ie);Me<B.length;Me++)Xt=me(Ie,z,Me,B[Me],ce),Xt!==null&&(e&&Xt.alternate!==null&&Ie.delete(Xt.key===null?Me:Xt.key),M=p(Xt,M,Me),Ae===null?Se=Xt:Ae.sibling=Xt,Ae=Xt);return e&&Ie.forEach(function(ir){return n(z,ir)}),wt&&kr(z,Me),Se}function ke(z,M,B,ce){var Se=Q(B);if(typeof Se!="function")throw Error(r(150));if(B=Se.call(B),B==null)throw Error(r(151));for(var Ae=Se=null,Ie=M,Me=M=0,Xt=null,Ze=B.next();Ie!==null&&!Ze.done;Me++,Ze=B.next()){Ie.index>Me?(Xt=Ie,Ie=null):Xt=Ie.sibling;var ir=J(z,Ie,Ze.value,ce);if(ir===null){Ie===null&&(Ie=Xt);break}e&&Ie&&ir.alternate===null&&n(z,Ie),M=p(ir,M,Me),Ae===null?Se=ir:Ae.sibling=ir,Ae=ir,Ie=Xt}if(Ze.done)return i(z,Ie),wt&&kr(z,Me),Se;if(Ie===null){for(;!Ze.done;Me++,Ze=B.next())Ze=ne(z,Ze.value,ce),Ze!==null&&(M=p(Ze,M,Me),Ae===null?Se=Ze:Ae.sibling=Ze,Ae=Ze);return wt&&kr(z,Me),Se}for(Ie=c(z,Ie);!Ze.done;Me++,Ze=B.next())Ze=me(Ie,z,Me,Ze.value,ce),Ze!==null&&(e&&Ze.alternate!==null&&Ie.delete(Ze.key===null?Me:Ze.key),M=p(Ze,M,Me),Ae===null?Se=Ze:Ae.sibling=Ze,Ae=Ze);return e&&Ie.forEach(function(ex){return n(z,ex)}),wt&&kr(z,Me),Se}function Pt(z,M,B,ce){if(typeof B=="object"&&B!==null&&B.type===K&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case H:e:{for(var Se=B.key,Ae=M;Ae!==null;){if(Ae.key===Se){if(Se=B.type,Se===K){if(Ae.tag===7){i(z,Ae.sibling),M=d(Ae,B.props.children),M.return=z,z=M;break e}}else if(Ae.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===se&&Tf(Se)===Ae.type){i(z,Ae.sibling),M=d(Ae,B.props),M.ref=Bi(z,Ae,B),M.return=z,z=M;break e}i(z,Ae);break}else n(z,Ae);Ae=Ae.sibling}B.type===K?(M=Er(B.props.children,z.mode,ce,B.key),M.return=z,z=M):(ce=Na(B.type,B.key,B.props,null,z.mode,ce),ce.ref=Bi(z,M,B),ce.return=z,z=ce)}return y(z);case Y:e:{for(Ae=B.key;M!==null;){if(M.key===Ae)if(M.tag===4&&M.stateNode.containerInfo===B.containerInfo&&M.stateNode.implementation===B.implementation){i(z,M.sibling),M=d(M,B.children||[]),M.return=z,z=M;break e}else{i(z,M);break}else n(z,M);M=M.sibling}M=su(B,z.mode,ce),M.return=z,z=M}return y(z);case se:return Ae=B._init,Pt(z,M,Ae(B._payload),ce)}if(Mt(B))return xe(z,M,B,ce);if(Q(B))return ke(z,M,B,ce);ta(z,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,M!==null&&M.tag===6?(i(z,M.sibling),M=d(M,B),M.return=z,z=M):(i(z,M),M=nu(B,z.mode,ce),M.return=z,z=M),y(z)):i(z,M)}return Pt}var ei=Nf(!0),Cf=Nf(!1),na=Ks(null),sa=null,ti=null,fc=null;function pc(){fc=ti=sa=null}function hc(e){var n=na.current;ft(na),e._currentValue=n}function mc(e,n,i){for(;e!==null;){var c=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),e===i)break;e=e.return}}function ni(e,n){sa=e,fc=ti=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Tn=!0),e.firstContext=null)}function Gn(e){var n=e._currentValue;if(fc!==e)if(e={context:e,memoizedValue:n,next:null},ti===null){if(sa===null)throw Error(r(308));ti=e,sa.dependencies={lanes:0,firstContext:e}}else ti=ti.next=e;return n}var Sr=null;function gc(e){Sr===null?Sr=[e]:Sr.push(e)}function jf(e,n,i,c){var d=n.interleaved;return d===null?(i.next=i,gc(n)):(i.next=d.next,d.next=i),n.interleaved=i,Rs(e,c)}function Rs(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Qs=!1;function vc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _f(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function As(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Zs(e,n,i){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(Ye&2)!==0){var d=c.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),c.pending=n,Rs(e,i)}return d=c.interleaved,d===null?(n.next=n,gc(c)):(n.next=d.next,d.next=n),c.interleaved=n,Rs(e,i)}function ra(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Ws(e,i)}}function Ef(e,n){var i=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,i===c)){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=n:p=p.next=n}else d=p=n;i={baseState:c.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:c.shared,effects:c.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function ia(e,n,i,c){var d=e.updateQueue;Qs=!1;var p=d.firstBaseUpdate,y=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var I=N,W=I.next;I.next=null,y===null?p=W:y.next=W,y=I;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==y&&(N===null?ee.firstBaseUpdate=W:N.next=W,ee.lastBaseUpdate=I))}if(p!==null){var ne=d.baseState;y=0,ee=W=I=null,N=p;do{var J=N.lane,me=N.eventTime;if((c&J)===J){ee!==null&&(ee=ee.next={eventTime:me,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var xe=e,ke=N;switch(J=n,me=i,ke.tag){case 1:if(xe=ke.payload,typeof xe=="function"){ne=xe.call(me,ne,J);break e}ne=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ke.payload,J=typeof xe=="function"?xe.call(me,ne,J):xe,J==null)break e;ne=F({},ne,J);break e;case 2:Qs=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,J=d.effects,J===null?d.effects=[N]:J.push(N))}else me={eventTime:me,lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(W=ee=me,I=ne):ee=ee.next=me,y|=J;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;J=N,N=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);if(ee===null&&(I=ne),d.baseState=I,d.firstBaseUpdate=W,d.lastBaseUpdate=ee,n=d.shared.interleaved,n!==null){d=n;do y|=d.lane,d=d.next;while(d!==n)}else p===null&&(d.shared.lanes=0);Nr|=y,e.lanes=y,e.memoizedState=ne}}function Rf(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var c=e[n],d=c.callback;if(d!==null){if(c.callback=null,c=i,typeof d!="function")throw Error(r(191,d));d.call(c)}}}var Wi={},xs=Ks(Wi),Hi=Ks(Wi),Vi=Ks(Wi);function br(e){if(e===Wi)throw Error(r(174));return e}function yc(e,n){switch(ct(Vi,n),ct(Hi,e),ct(xs,Wi),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=mt(n,e)}ft(xs),ct(xs,n)}function si(){ft(xs),ft(Hi),ft(Vi)}function Af(e){br(Vi.current);var n=br(xs.current),i=mt(n,e.type);n!==i&&(ct(Hi,e),ct(xs,i))}function xc(e){Hi.current===e&&(ft(xs),ft(Hi))}var _t=Ks(0);function oa(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var wc=[];function kc(){for(var e=0;e<wc.length;e++)wc[e]._workInProgressVersionPrimary=null;wc.length=0}var aa=P.ReactCurrentDispatcher,Sc=P.ReactCurrentBatchConfig,Tr=0,Et=null,Ut=null,Kt=null,la=!1,qi=!1,Gi=0,Sy=0;function an(){throw Error(r(321))}function bc(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!rs(e[i],n[i]))return!1;return!0}function Tc(e,n,i,c,d,p){if(Tr=p,Et=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,aa.current=e===null||e.memoizedState===null?Cy:jy,e=i(c,d),qi){p=0;do{if(qi=!1,Gi=0,25<=p)throw Error(r(301));p+=1,Kt=Ut=null,n.updateQueue=null,aa.current=_y,e=i(c,d)}while(qi)}if(aa.current=da,n=Ut!==null&&Ut.next!==null,Tr=0,Kt=Ut=Et=null,la=!1,n)throw Error(r(300));return e}function Nc(){var e=Gi!==0;return Gi=0,e}function ws(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Et.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Kn(){if(Ut===null){var e=Et.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var n=Kt===null?Et.memoizedState:Kt.next;if(n!==null)Kt=n,Ut=e;else{if(e===null)throw Error(r(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Kt===null?Et.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Ki(e,n){return typeof n=="function"?n(e):n}function Cc(e){var n=Kn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=Ut,d=c.baseQueue,p=i.pending;if(p!==null){if(d!==null){var y=d.next;d.next=p.next,p.next=y}c.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,c=c.baseState;var N=y=null,I=null,W=p;do{var ee=W.lane;if((Tr&ee)===ee)I!==null&&(I=I.next={lane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),c=W.hasEagerState?W.eagerState:e(c,W.action);else{var ne={lane:ee,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null};I===null?(N=I=ne,y=c):I=I.next=ne,Et.lanes|=ee,Nr|=ee}W=W.next}while(W!==null&&W!==p);I===null?y=c:I.next=N,rs(c,n.memoizedState)||(Tn=!0),n.memoizedState=c,n.baseState=y,n.baseQueue=I,i.lastRenderedState=c}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Et.lanes|=p,Nr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function jc(e){var n=Kn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=i.dispatch,d=i.pending,p=n.memoizedState;if(d!==null){i.pending=null;var y=d=d.next;do p=e(p,y.action),y=y.next;while(y!==d);rs(p,n.memoizedState)||(Tn=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),i.lastRenderedState=p}return[p,c]}function If(){}function Df(e,n){var i=Et,c=Kn(),d=n(),p=!rs(c.memoizedState,d);if(p&&(c.memoizedState=d,Tn=!0),c=c.queue,_c(Pf.bind(null,i,c,e),[e]),c.getSnapshot!==n||p||Kt!==null&&Kt.memoizedState.tag&1){if(i.flags|=2048,Yi(9,Lf.bind(null,i,c,d,n),void 0,null),Yt===null)throw Error(r(349));(Tr&30)!==0||Mf(i,n,d)}return d}function Mf(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Et.updateQueue,n===null?(n={lastEffect:null,stores:null},Et.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Lf(e,n,i,c){n.value=i,n.getSnapshot=c,Of(n)&&$f(e)}function Pf(e,n,i){return i(function(){Of(n)&&$f(e)})}function Of(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!rs(e,i)}catch{return!0}}function $f(e){var n=Rs(e,1);n!==null&&cs(n,e,1,-1)}function zf(e){var n=ws();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ki,lastRenderedState:e},n.queue=e,e=e.dispatch=Ny.bind(null,Et,e),[n.memoizedState,e]}function Yi(e,n,i,c){return e={tag:e,create:n,destroy:i,deps:c,next:null},n=Et.updateQueue,n===null?(n={lastEffect:null,stores:null},Et.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(c=i.next,i.next=e,e.next=c,n.lastEffect=e)),e}function Ff(){return Kn().memoizedState}function ca(e,n,i,c){var d=ws();Et.flags|=e,d.memoizedState=Yi(1|n,i,void 0,c===void 0?null:c)}function ua(e,n,i,c){var d=Kn();c=c===void 0?null:c;var p=void 0;if(Ut!==null){var y=Ut.memoizedState;if(p=y.destroy,c!==null&&bc(c,y.deps)){d.memoizedState=Yi(n,i,p,c);return}}Et.flags|=e,d.memoizedState=Yi(1|n,i,p,c)}function Uf(e,n){return ca(8390656,8,e,n)}function _c(e,n){return ua(2048,8,e,n)}function Bf(e,n){return ua(4,2,e,n)}function Wf(e,n){return ua(4,4,e,n)}function Hf(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Vf(e,n,i){return i=i!=null?i.concat([e]):null,ua(4,4,Hf.bind(null,n,e),i)}function Ec(){}function qf(e,n){var i=Kn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&bc(n,c[1])?c[0]:(i.memoizedState=[e,n],e)}function Gf(e,n){var i=Kn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&bc(n,c[1])?c[0]:(e=e(),i.memoizedState=[e,n],e)}function Kf(e,n,i){return(Tr&21)===0?(e.baseState&&(e.baseState=!1,Tn=!0),e.memoizedState=i):(rs(i,n)||(i=Ni(),Et.lanes|=i,Nr|=i,e.baseState=!0),n)}function by(e,n){var i=Ge;Ge=i!==0&&4>i?i:4,e(!0);var c=Sc.transition;Sc.transition={};try{e(!1),n()}finally{Ge=i,Sc.transition=c}}function Yf(){return Kn().memoizedState}function Ty(e,n,i){var c=nr(e);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},Xf(e))Qf(n,i);else if(i=jf(e,n,i,c),i!==null){var d=vn();cs(i,e,c,d),Zf(i,n,c)}}function Ny(e,n,i){var c=nr(e),d={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(Xf(e))Qf(n,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var y=n.lastRenderedState,N=p(y,i);if(d.hasEagerState=!0,d.eagerState=N,rs(N,y)){var I=n.interleaved;I===null?(d.next=d,gc(n)):(d.next=I.next,I.next=d),n.interleaved=d;return}}catch{}finally{}i=jf(e,n,d,c),i!==null&&(d=vn(),cs(i,e,c,d),Zf(i,n,c))}}function Xf(e){var n=e.alternate;return e===Et||n!==null&&n===Et}function Qf(e,n){qi=la=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Zf(e,n,i){if((i&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Ws(e,i)}}var da={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},Cy={readContext:Gn,useCallback:function(e,n){return ws().memoizedState=[e,n===void 0?null:n],e},useContext:Gn,useEffect:Uf,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,ca(4194308,4,Hf.bind(null,n,e),i)},useLayoutEffect:function(e,n){return ca(4194308,4,e,n)},useInsertionEffect:function(e,n){return ca(4,2,e,n)},useMemo:function(e,n){var i=ws();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var c=ws();return n=i!==void 0?i(n):n,c.memoizedState=c.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},c.queue=e,e=e.dispatch=Ty.bind(null,Et,e),[c.memoizedState,e]},useRef:function(e){var n=ws();return e={current:e},n.memoizedState=e},useState:zf,useDebugValue:Ec,useDeferredValue:function(e){return ws().memoizedState=e},useTransition:function(){var e=zf(!1),n=e[0];return e=by.bind(null,e[1]),ws().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var c=Et,d=ws();if(wt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=n(),Yt===null)throw Error(r(349));(Tr&30)!==0||Mf(c,n,i)}d.memoizedState=i;var p={value:i,getSnapshot:n};return d.queue=p,Uf(Pf.bind(null,c,p,e),[e]),c.flags|=2048,Yi(9,Lf.bind(null,c,p,i,n),void 0,null),i},useId:function(){var e=ws(),n=Yt.identifierPrefix;if(wt){var i=Es,c=_s;i=(c&~(1<<32-hn(c)-1)).toString(32)+i,n=":"+n+"R"+i,i=Gi++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=Sy++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},jy={readContext:Gn,useCallback:qf,useContext:Gn,useEffect:_c,useImperativeHandle:Vf,useInsertionEffect:Bf,useLayoutEffect:Wf,useMemo:Gf,useReducer:Cc,useRef:Ff,useState:function(){return Cc(Ki)},useDebugValue:Ec,useDeferredValue:function(e){var n=Kn();return Kf(n,Ut.memoizedState,e)},useTransition:function(){var e=Cc(Ki)[0],n=Kn().memoizedState;return[e,n]},useMutableSource:If,useSyncExternalStore:Df,useId:Yf,unstable_isNewReconciler:!1},_y={readContext:Gn,useCallback:qf,useContext:Gn,useEffect:_c,useImperativeHandle:Vf,useInsertionEffect:Bf,useLayoutEffect:Wf,useMemo:Gf,useReducer:jc,useRef:Ff,useState:function(){return jc(Ki)},useDebugValue:Ec,useDeferredValue:function(e){var n=Kn();return Ut===null?n.memoizedState=e:Kf(n,Ut.memoizedState,e)},useTransition:function(){var e=jc(Ki)[0],n=Kn().memoizedState;return[e,n]},useMutableSource:If,useSyncExternalStore:Df,useId:Yf,unstable_isNewReconciler:!1};function os(e,n){if(e&&e.defaultProps){n=F({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function Rc(e,n,i,c){n=e.memoizedState,i=i(c,n),i=i==null?n:F({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var fa={isMounted:function(e){return(e=e._reactInternals)?He(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var c=vn(),d=nr(e),p=As(c,d);p.payload=n,i!=null&&(p.callback=i),n=Zs(e,p,d),n!==null&&(cs(n,e,d,c),ra(n,e,d))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var c=vn(),d=nr(e),p=As(c,d);p.tag=1,p.payload=n,i!=null&&(p.callback=i),n=Zs(e,p,d),n!==null&&(cs(n,e,d,c),ra(n,e,d))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=vn(),c=nr(e),d=As(i,c);d.tag=2,n!=null&&(d.callback=n),n=Zs(e,d,c),n!==null&&(cs(n,e,c,i),ra(n,e,c))}};function Jf(e,n,i,c,d,p,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,p,y):n.prototype&&n.prototype.isPureReactComponent?!Li(i,c)||!Li(d,p):!0}function ep(e,n,i){var c=!1,d=Ys,p=n.contextType;return typeof p=="object"&&p!==null?p=Gn(p):(d=bn(n)?xr:on.current,c=n.contextTypes,p=(c=c!=null)?Xr(e,d):Ys),n=new n(i,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=fa,e.stateNode=n,n._reactInternals=e,c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),n}function tp(e,n,i,c){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,c),n.state!==e&&fa.enqueueReplaceState(n,n.state,null)}function Ac(e,n,i,c){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},vc(e);var p=n.contextType;typeof p=="object"&&p!==null?d.context=Gn(p):(p=bn(n)?xr:on.current,d.context=Xr(e,p)),d.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(Rc(e,n,p,i),d.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(n=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),n!==d.state&&fa.enqueueReplaceState(d,d.state,null),ia(e,i,d,c),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function ri(e,n){try{var i="",c=n;do i+=ue(c),c=c.return;while(c);var d=i}catch(p){d=`
|
|
39
|
-
Error generating stack: `+p.message+`
|
|
40
|
-
`+p.stack}return{value:e,source:n,stack:d,digest:null}}function Ic(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function Dc(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var Ey=typeof WeakMap=="function"?WeakMap:Map;function np(e,n,i){i=As(-1,i),i.tag=3,i.payload={element:null};var c=n.value;return i.callback=function(){xa||(xa=!0,Kc=c),Dc(e,n)},i}function sp(e,n,i){i=As(-1,i),i.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var d=n.value;i.payload=function(){return c(d)},i.callback=function(){Dc(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Dc(e,n),typeof c!="function"&&(er===null?er=new Set([this]):er.add(this));var y=n.stack;this.componentDidCatch(n.value,{componentStack:y!==null?y:""})}),i}function rp(e,n,i){var c=e.pingCache;if(c===null){c=e.pingCache=new Ey;var d=new Set;c.set(n,d)}else d=c.get(n),d===void 0&&(d=new Set,c.set(n,d));d.has(i)||(d.add(i),e=Wy.bind(null,e,n,i),n.then(e,e))}function ip(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function op(e,n,i,c,d){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=As(-1,1),n.tag=2,Zs(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Ry=P.ReactCurrentOwner,Tn=!1;function gn(e,n,i,c){n.child=e===null?Cf(n,null,i,c):ei(n,e.child,i,c)}function ap(e,n,i,c,d){i=i.render;var p=n.ref;return ni(n,d),c=Tc(e,n,i,c,p,d),i=Nc(),e!==null&&!Tn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,Is(e,n,d)):(wt&&i&&ac(n),n.flags|=1,gn(e,n,c,d),n.child)}function lp(e,n,i,c,d){if(e===null){var p=i.type;return typeof p=="function"&&!tu(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=p,cp(e,n,p,c,d)):(e=Na(i.type,null,c,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&d)===0){var y=p.memoizedProps;if(i=i.compare,i=i!==null?i:Li,i(y,c)&&e.ref===n.ref)return Is(e,n,d)}return n.flags|=1,e=rr(p,c),e.ref=n.ref,e.return=n,n.child=e}function cp(e,n,i,c,d){if(e!==null){var p=e.memoizedProps;if(Li(p,c)&&e.ref===n.ref)if(Tn=!1,n.pendingProps=c=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Tn=!0);else return n.lanes=e.lanes,Is(e,n,d)}return Mc(e,n,i,c,d)}function up(e,n,i){var c=n.pendingProps,d=c.children,p=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(oi,Fn),Fn|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,ct(oi,Fn),Fn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=p!==null?p.baseLanes:i,ct(oi,Fn),Fn|=c}else p!==null?(c=p.baseLanes|i,n.memoizedState=null):c=i,ct(oi,Fn),Fn|=c;return gn(e,n,d,i),n.child}function dp(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function Mc(e,n,i,c,d){var p=bn(i)?xr:on.current;return p=Xr(n,p),ni(n,d),i=Tc(e,n,i,c,p,d),c=Nc(),e!==null&&!Tn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,Is(e,n,d)):(wt&&c&&ac(n),n.flags|=1,gn(e,n,i,d),n.child)}function fp(e,n,i,c,d){if(bn(i)){var p=!0;Xo(n)}else p=!1;if(ni(n,d),n.stateNode===null)ha(e,n),ep(n,i,c),Ac(n,i,c,d),c=!0;else if(e===null){var y=n.stateNode,N=n.memoizedProps;y.props=N;var I=y.context,W=i.contextType;typeof W=="object"&&W!==null?W=Gn(W):(W=bn(i)?xr:on.current,W=Xr(n,W));var ee=i.getDerivedStateFromProps,ne=typeof ee=="function"||typeof y.getSnapshotBeforeUpdate=="function";ne||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==c||I!==W)&&tp(n,y,c,W),Qs=!1;var J=n.memoizedState;y.state=J,ia(n,c,y,d),I=n.memoizedState,N!==c||J!==I||Sn.current||Qs?(typeof ee=="function"&&(Rc(n,i,ee,c),I=n.memoizedState),(N=Qs||Jf(n,i,N,c,J,I,W))?(ne||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"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=I),y.props=c,y.state=I,y.context=W,c=N):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{y=n.stateNode,_f(e,n),N=n.memoizedProps,W=n.type===n.elementType?N:os(n.type,N),y.props=W,ne=n.pendingProps,J=y.context,I=i.contextType,typeof I=="object"&&I!==null?I=Gn(I):(I=bn(i)?xr:on.current,I=Xr(n,I));var me=i.getDerivedStateFromProps;(ee=typeof me=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==ne||J!==I)&&tp(n,y,c,I),Qs=!1,J=n.memoizedState,y.state=J,ia(n,c,y,d);var xe=n.memoizedState;N!==ne||J!==xe||Sn.current||Qs?(typeof me=="function"&&(Rc(n,i,me,c),xe=n.memoizedState),(W=Qs||Jf(n,i,W,c,J,xe,I)||!1)?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,xe,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,xe,I)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=xe),y.props=c,y.state=xe,y.context=I,c=W):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),c=!1)}return Lc(e,n,i,c,p,d)}function Lc(e,n,i,c,d,p){dp(e,n);var y=(n.flags&128)!==0;if(!c&&!y)return d&&vf(n,i,!1),Is(e,n,p);c=n.stateNode,Ry.current=n;var N=y&&typeof i.getDerivedStateFromError!="function"?null:c.render();return n.flags|=1,e!==null&&y?(n.child=ei(n,e.child,null,p),n.child=ei(n,null,N,p)):gn(e,n,N,p),n.memoizedState=c.state,d&&vf(n,i,!0),n.child}function pp(e){var n=e.stateNode;n.pendingContext?mf(e,n.pendingContext,n.pendingContext!==n.context):n.context&&mf(e,n.context,!1),yc(e,n.containerInfo)}function hp(e,n,i,c,d){return Jr(),dc(d),n.flags|=256,gn(e,n,i,c),n.child}var Pc={dehydrated:null,treeContext:null,retryLane:0};function Oc(e){return{baseLanes:e,cachePool:null,transitions:null}}function mp(e,n,i){var c=n.pendingProps,d=_t.current,p=!1,y=(n.flags&128)!==0,N;if((N=y)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ct(_t,d&1),e===null)return uc(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(y=c.children,e=c.fallback,p?(c=n.mode,p=n.child,y={mode:"hidden",children:y},(c&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=y):p=Ca(y,c,0,null),e=Er(e,c,i,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=Oc(i),n.memoizedState=Pc,e):$c(n,y));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return Ay(e,n,y,c,N,d,i);if(p){p=c.fallback,y=n.mode,d=e.child,N=d.sibling;var I={mode:"hidden",children:c.children};return(y&1)===0&&n.child!==d?(c=n.child,c.childLanes=0,c.pendingProps=I,n.deletions=null):(c=rr(d,I),c.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=rr(N,p):(p=Er(p,y,i,null),p.flags|=2),p.return=n,c.return=n,c.sibling=p,n.child=c,c=p,p=n.child,y=e.child.memoizedState,y=y===null?Oc(i):{baseLanes:y.baseLanes|i,cachePool:null,transitions:y.transitions},p.memoizedState=y,p.childLanes=e.childLanes&~i,n.memoizedState=Pc,c}return p=e.child,e=p.sibling,c=rr(p,{mode:"visible",children:c.children}),(n.mode&1)===0&&(c.lanes=i),c.return=n,c.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=c,n.memoizedState=null,c}function $c(e,n){return n=Ca({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function pa(e,n,i,c){return c!==null&&dc(c),ei(n,e.child,null,i),e=$c(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ay(e,n,i,c,d,p,y){if(i)return n.flags&256?(n.flags&=-257,c=Ic(Error(r(422))),pa(e,n,y,c)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=c.fallback,d=n.mode,c=Ca({mode:"visible",children:c.children},d,0,null),p=Er(p,d,y,null),p.flags|=2,c.return=n,p.return=n,c.sibling=p,n.child=c,(n.mode&1)!==0&&ei(n,e.child,null,y),n.child.memoizedState=Oc(y),n.memoizedState=Pc,p);if((n.mode&1)===0)return pa(e,n,y,null);if(d.data==="$!"){if(c=d.nextSibling&&d.nextSibling.dataset,c)var N=c.dgst;return c=N,p=Error(r(419)),c=Ic(p,c,void 0),pa(e,n,y,c)}if(N=(y&e.childLanes)!==0,Tn||N){if(c=Yt,c!==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&(c.suspendedLanes|y))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,Rs(e,d),cs(c,e,d,-1))}return eu(),c=Ic(Error(r(421))),pa(e,n,y,c)}return d.data==="$?"?(n.flags|=128,n.child=e.child,n=Hy.bind(null,e),d._reactRetry=n,null):(e=p.treeContext,zn=Gs(d.nextSibling),$n=n,wt=!0,is=null,e!==null&&(Vn[qn++]=_s,Vn[qn++]=Es,Vn[qn++]=wr,_s=e.id,Es=e.overflow,wr=n),n=$c(n,c.children),n.flags|=4096,n)}function gp(e,n,i){e.lanes|=n;var c=e.alternate;c!==null&&(c.lanes|=n),mc(e.return,n,i)}function zc(e,n,i,c,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:d}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=c,p.tail=i,p.tailMode=d)}function vp(e,n,i){var c=n.pendingProps,d=c.revealOrder,p=c.tail;if(gn(e,n,c.children,i),c=_t.current,(c&2)!==0)c=c&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gp(e,i,n);else if(e.tag===19)gp(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}c&=1}if(ct(_t,c),(n.mode&1)===0)n.memoizedState=null;else switch(d){case"forwards":for(i=n.child,d=null;i!==null;)e=i.alternate,e!==null&&oa(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=n.child,n.child=null):(d=i.sibling,i.sibling=null),zc(n,!1,d,i,p);break;case"backwards":for(i=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&oa(e)===null){n.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}zc(n,!0,i,null,p);break;case"together":zc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function ha(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Is(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Nr|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,i=rr(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=rr(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function Iy(e,n,i){switch(n.tag){case 3:pp(n),Jr();break;case 5:Af(n);break;case 1:bn(n.type)&&Xo(n);break;case 4:yc(n,n.stateNode.containerInfo);break;case 10:var c=n.type._context,d=n.memoizedProps.value;ct(na,c._currentValue),c._currentValue=d;break;case 13:if(c=n.memoizedState,c!==null)return c.dehydrated!==null?(ct(_t,_t.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?mp(e,n,i):(ct(_t,_t.current&1),e=Is(e,n,i),e!==null?e.sibling:null);ct(_t,_t.current&1);break;case 19:if(c=(i&n.childLanes)!==0,(e.flags&128)!==0){if(c)return vp(e,n,i);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ct(_t,_t.current),c)break;return null;case 22:case 23:return n.lanes=0,up(e,n,i)}return Is(e,n,i)}var yp,Fc,xp,wp;yp=function(e,n){for(var i=n.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===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Fc=function(){},xp=function(e,n,i,c){var d=e.memoizedProps;if(d!==c){e=n.stateNode,br(xs.current);var p=null;switch(i){case"input":d=ze(e,d),c=ze(e,c),p=[];break;case"select":d=F({},d,{value:void 0}),c=F({},c,{value:void 0}),p=[];break;case"textarea":d=en(e,d),c=en(e,c),p=[];break;default:typeof d.onClick!="function"&&typeof c.onClick=="function"&&(e.onclick=Go)}In(i,c);var y;i=null;for(W in d)if(!c.hasOwnProperty(W)&&d.hasOwnProperty(W)&&d[W]!=null)if(W==="style"){var N=d[W];for(y in N)N.hasOwnProperty(y)&&(i||(i={}),i[y]="")}else W!=="dangerouslySetInnerHTML"&&W!=="children"&&W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(a.hasOwnProperty(W)?p||(p=[]):(p=p||[]).push(W,null));for(W in c){var I=c[W];if(N=d!=null?d[W]:void 0,c.hasOwnProperty(W)&&I!==N&&(I!=null||N!=null))if(W==="style")if(N){for(y in N)!N.hasOwnProperty(y)||I&&I.hasOwnProperty(y)||(i||(i={}),i[y]="");for(y in I)I.hasOwnProperty(y)&&N[y]!==I[y]&&(i||(i={}),i[y]=I[y])}else i||(p||(p=[]),p.push(W,i)),i=I;else W==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,N=N?N.__html:void 0,I!=null&&N!==I&&(p=p||[]).push(W,I)):W==="children"?typeof I!="string"&&typeof I!="number"||(p=p||[]).push(W,""+I):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&(a.hasOwnProperty(W)?(I!=null&&W==="onScroll"&&dt("scroll",e),p||N===I||(p=[])):(p=p||[]).push(W,I))}i&&(p=p||[]).push("style",i);var W=p;(n.updateQueue=W)&&(n.flags|=4)}},wp=function(e,n,i,c){i!==c&&(n.flags|=4)};function Xi(e,n){if(!wt)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function ln(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,c=0;if(n)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,c|=d.subtreeFlags&14680064,c|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,c|=d.subtreeFlags,c|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=c,e.childLanes=i,n}function Dy(e,n,i){var c=n.pendingProps;switch(lc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(n),null;case 1:return bn(n.type)&&Yo(),ln(n),null;case 3:return c=n.stateNode,si(),ft(Sn),ft(on),kc(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(e===null||e.child===null)&&(ea(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,is!==null&&(Qc(is),is=null))),Fc(e,n),ln(n),null;case 5:xc(n);var d=br(Vi.current);if(i=n.type,e!==null&&n.stateNode!=null)xp(e,n,i,c,d),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!c){if(n.stateNode===null)throw Error(r(166));return ln(n),null}if(e=br(xs.current),ea(n)){c=n.stateNode,i=n.type;var p=n.memoizedProps;switch(c[ys]=n,c[Fi]=p,e=(n.mode&1)!==0,i){case"dialog":dt("cancel",c),dt("close",c);break;case"iframe":case"object":case"embed":dt("load",c);break;case"video":case"audio":for(d=0;d<Oi.length;d++)dt(Oi[d],c);break;case"source":dt("error",c);break;case"img":case"image":case"link":dt("error",c),dt("load",c);break;case"details":dt("toggle",c);break;case"input":It(c,p),dt("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!p.multiple},dt("invalid",c);break;case"textarea":q(c,p),dt("invalid",c)}In(i,p),d=null;for(var y in p)if(p.hasOwnProperty(y)){var N=p[y];y==="children"?typeof N=="string"?c.textContent!==N&&(p.suppressHydrationWarning!==!0&&qo(c.textContent,N,e),d=["children",N]):typeof N=="number"&&c.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&qo(c.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(y)&&N!=null&&y==="onScroll"&&dt("scroll",c)}switch(i){case"input":ot(c),Rn(c,p,!0);break;case"textarea":ot(c),Ue(c);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(c.onclick=Go)}c=d,n.updateQueue=c,c!==null&&(n.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 c.is=="string"?e=y.createElement(i,{is:c.is}):(e=y.createElement(i),i==="select"&&(y=e,c.multiple?y.multiple=!0:c.size&&(y.size=c.size))):e=y.createElementNS(e,i),e[ys]=n,e[Fi]=c,yp(e,n,!1,!1),n.stateNode=e;e:{switch(y=Dn(i,c),i){case"dialog":dt("cancel",e),dt("close",e),d=c;break;case"iframe":case"object":case"embed":dt("load",e),d=c;break;case"video":case"audio":for(d=0;d<Oi.length;d++)dt(Oi[d],e);d=c;break;case"source":dt("error",e),d=c;break;case"img":case"image":case"link":dt("error",e),dt("load",e),d=c;break;case"details":dt("toggle",e),d=c;break;case"input":It(e,c),d=ze(e,c),dt("invalid",e);break;case"option":d=c;break;case"select":e._wrapperState={wasMultiple:!!c.multiple},d=F({},c,{value:void 0}),dt("invalid",e);break;case"textarea":q(e,c),d=en(e,c),dt("invalid",e);break;default:d=c}In(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var I=N[p];p==="style"?Ts(e,I):p==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,I!=null&&Rt(e,I)):p==="children"?typeof I=="string"?(i!=="textarea"||I!=="")&&Ht(e,I):typeof I=="number"&&Ht(e,""+I):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?I!=null&&p==="onScroll"&&dt("scroll",e):I!=null&&U(e,p,I,y))}switch(i){case"input":ot(e),Rn(e,c,!1);break;case"textarea":ot(e),Ue(e);break;case"option":c.value!=null&&e.setAttribute("value",""+Ce(c.value));break;case"select":e.multiple=!!c.multiple,p=c.value,p!=null?ht(e,!!c.multiple,p,!1):c.defaultValue!=null&&ht(e,!!c.multiple,c.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Go)}switch(i){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return ln(n),null;case 6:if(e&&n.stateNode!=null)wp(e,n,e.memoizedProps,c);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(i=br(Vi.current),br(xs.current),ea(n)){if(c=n.stateNode,i=n.memoizedProps,c[ys]=n,(p=c.nodeValue!==i)&&(e=$n,e!==null))switch(e.tag){case 3:qo(c.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&qo(c.nodeValue,i,(e.mode&1)!==0)}p&&(n.flags|=4)}else c=(i.nodeType===9?i:i.ownerDocument).createTextNode(c),c[ys]=n,n.stateNode=c}return ln(n),null;case 13:if(ft(_t),c=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wt&&zn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)bf(),Jr(),n.flags|=98560,p=!1;else if(p=ea(n),c!==null&&c.dehydrated!==null){if(e===null){if(!p)throw Error(r(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[ys]=n}else Jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),p=!1}else is!==null&&(Qc(is),is=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(c=c!==null,c!==(e!==null&&e.memoizedState!==null)&&c&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(_t.current&1)!==0?Bt===0&&(Bt=3):eu())),n.updateQueue!==null&&(n.flags|=4),ln(n),null);case 4:return si(),Fc(e,n),e===null&&$i(n.stateNode.containerInfo),ln(n),null;case 10:return hc(n.type._context),ln(n),null;case 17:return bn(n.type)&&Yo(),ln(n),null;case 19:if(ft(_t),p=n.memoizedState,p===null)return ln(n),null;if(c=(n.flags&128)!==0,y=p.rendering,y===null)if(c)Xi(p,!1);else{if(Bt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(y=oa(e),y!==null){for(n.flags|=128,Xi(p,!1),c=y.updateQueue,c!==null&&(n.updateQueue=c,n.flags|=4),n.subtreeFlags=0,c=i,i=n.child;i!==null;)p=i,e=c,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),n.child}e=e.sibling}p.tail!==null&&Nt()>ai&&(n.flags|=128,c=!0,Xi(p,!1),n.lanes=4194304)}else{if(!c)if(e=oa(y),e!==null){if(n.flags|=128,c=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Xi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!wt)return ln(n),null}else 2*Nt()-p.renderingStartTime>ai&&i!==1073741824&&(n.flags|=128,c=!0,Xi(p,!1),n.lanes=4194304);p.isBackwards?(y.sibling=n.child,n.child=y):(i=p.last,i!==null?i.sibling=y:n.child=y,p.last=y)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=Nt(),n.sibling=null,i=_t.current,ct(_t,c?i&1|2:i&1),n):(ln(n),null);case 22:case 23:return Jc(),c=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==c&&(n.flags|=8192),c&&(n.mode&1)!==0?(Fn&1073741824)!==0&&(ln(n),n.subtreeFlags&6&&(n.flags|=8192)):ln(n),null;case 24:return null;case 25:return null}throw Error(r(156,n.tag))}function My(e,n){switch(lc(n),n.tag){case 1:return bn(n.type)&&Yo(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return si(),ft(Sn),ft(on),kc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return xc(n),null;case 13:if(ft(_t),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Jr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ft(_t),null;case 4:return si(),null;case 10:return hc(n.type._context),null;case 22:case 23:return Jc(),null;case 24:return null;default:return null}}var ma=!1,cn=!1,Ly=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ii(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){At(e,n,c)}else i.current=null}function Uc(e,n,i){try{i()}catch(c){At(e,n,c)}}var kp=!1;function Py(e,n){if(Jl=Lo,e=Zd(),Vl(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var d=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var y=0,N=-1,I=-1,W=0,ee=0,ne=e,J=null;t:for(;;){for(var me;ne!==i||d!==0&&ne.nodeType!==3||(N=y+d),ne!==p||c!==0&&ne.nodeType!==3||(I=y+c),ne.nodeType===3&&(y+=ne.nodeValue.length),(me=ne.firstChild)!==null;)J=ne,ne=me;for(;;){if(ne===e)break t;if(J===i&&++W===d&&(N=y),J===p&&++ee===c&&(I=y),(me=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=me}i=N===-1||I===-1?null:{start:N,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(ec={focusedElem:e,selectionRange:i},Lo=!1,ye=n;ye!==null;)if(n=ye,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ye=e;else for(;ye!==null;){n=ye;try{var xe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ke=xe.memoizedProps,Pt=xe.memoizedState,z=n.stateNode,M=z.getSnapshotBeforeUpdate(n.elementType===n.type?ke:os(n.type,ke),Pt);z.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var B=n.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ce){At(n,n.return,ce)}if(e=n.sibling,e!==null){e.return=n.return,ye=e;break}ye=n.return}return xe=kp,kp=!1,xe}function Qi(e,n,i){var c=n.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var d=c=c.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Uc(n,i,p)}d=d.next}while(d!==c)}}function ga(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var c=i.create;i.destroy=c()}i=i.next}while(i!==n)}}function Bc(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function Sp(e){var n=e.alternate;n!==null&&(e.alternate=null,Sp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ys],delete n[Fi],delete n[rc],delete n[yy],delete n[xy])),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 bp(e){return e.tag===5||e.tag===3||e.tag===4}function Tp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bp(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 Wc(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Go));else if(c!==4&&(e=e.child,e!==null))for(Wc(e,n,i),e=e.sibling;e!==null;)Wc(e,n,i),e=e.sibling}function Hc(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(c!==4&&(e=e.child,e!==null))for(Hc(e,n,i),e=e.sibling;e!==null;)Hc(e,n,i),e=e.sibling}var tn=null,as=!1;function Js(e,n,i){for(i=i.child;i!==null;)Np(e,n,i),i=i.sibling}function Np(e,n,i){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(pr,i)}catch{}switch(i.tag){case 5:cn||ii(i,n);case 6:var c=tn,d=as;tn=null,Js(e,n,i),tn=c,as=d,tn!==null&&(as?(e=tn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):tn.removeChild(i.stateNode));break;case 18:tn!==null&&(as?(e=tn,i=i.stateNode,e.nodeType===8?sc(e.parentNode,i):e.nodeType===1&&sc(e,i),Ei(e)):sc(tn,i.stateNode));break;case 4:c=tn,d=as,tn=i.stateNode.containerInfo,as=!0,Js(e,n,i),tn=c,as=d;break;case 0:case 11:case 14:case 15:if(!cn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){d=c=c.next;do{var p=d,y=p.destroy;p=p.tag,y!==void 0&&((p&2)!==0||(p&4)!==0)&&Uc(i,n,y),d=d.next}while(d!==c)}Js(e,n,i);break;case 1:if(!cn&&(ii(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(N){At(i,n,N)}Js(e,n,i);break;case 21:Js(e,n,i);break;case 22:i.mode&1?(cn=(c=cn)||i.memoizedState!==null,Js(e,n,i),cn=c):Js(e,n,i);break;default:Js(e,n,i)}}function Cp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Ly),n.forEach(function(c){var d=Vy.bind(null,e,c);i.has(c)||(i.add(c),c.then(d,d))})}}function ls(e,n){var i=n.deletions;if(i!==null)for(var c=0;c<i.length;c++){var d=i[c];try{var p=e,y=n,N=y;e:for(;N!==null;){switch(N.tag){case 5:tn=N.stateNode,as=!1;break e;case 3:tn=N.stateNode.containerInfo,as=!0;break e;case 4:tn=N.stateNode.containerInfo,as=!0;break e}N=N.return}if(tn===null)throw Error(r(160));Np(p,y,d),tn=null,as=!1;var I=d.alternate;I!==null&&(I.return=null),d.return=null}catch(W){At(d,n,W)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)jp(n,e),n=n.sibling}function jp(e,n){var i=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ls(n,e),ks(e),c&4){try{Qi(3,e,e.return),ga(3,e)}catch(ke){At(e,e.return,ke)}try{Qi(5,e,e.return)}catch(ke){At(e,e.return,ke)}}break;case 1:ls(n,e),ks(e),c&512&&i!==null&&ii(i,i.return);break;case 5:if(ls(n,e),ks(e),c&512&&i!==null&&ii(i,i.return),e.flags&32){var d=e.stateNode;try{Ht(d,"")}catch(ke){At(e,e.return,ke)}}if(c&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,y=i!==null?i.memoizedProps:p,N=e.type,I=e.updateQueue;if(e.updateQueue=null,I!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&Fe(d,p),Dn(N,y);var W=Dn(N,p);for(y=0;y<I.length;y+=2){var ee=I[y],ne=I[y+1];ee==="style"?Ts(d,ne):ee==="dangerouslySetInnerHTML"?Rt(d,ne):ee==="children"?Ht(d,ne):U(d,ee,ne,W)}switch(N){case"input":Dt(d,p);break;case"textarea":pe(d,p);break;case"select":var J=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var me=p.value;me!=null?ht(d,!!p.multiple,me,!1):J!==!!p.multiple&&(p.defaultValue!=null?ht(d,!!p.multiple,p.defaultValue,!0):ht(d,!!p.multiple,p.multiple?[]:"",!1))}d[Fi]=p}catch(ke){At(e,e.return,ke)}}break;case 6:if(ls(n,e),ks(e),c&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ke){At(e,e.return,ke)}}break;case 3:if(ls(n,e),ks(e),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Ei(n.containerInfo)}catch(ke){At(e,e.return,ke)}break;case 4:ls(n,e),ks(e);break;case 13:ls(n,e),ks(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Gc=Nt())),c&4&&Cp(e);break;case 22:if(ee=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(W=cn)||ee,ls(n,e),cn=W):ls(n,e),ks(e),c&8192){if(W=e.memoizedState!==null,(e.stateNode.isHidden=W)&&!ee&&(e.mode&1)!==0)for(ye=e,ee=e.child;ee!==null;){for(ne=ye=ee;ye!==null;){switch(J=ye,me=J.child,J.tag){case 0:case 11:case 14:case 15:Qi(4,J,J.return);break;case 1:ii(J,J.return);var xe=J.stateNode;if(typeof xe.componentWillUnmount=="function"){c=J,i=J.return;try{n=c,xe.props=n.memoizedProps,xe.state=n.memoizedState,xe.componentWillUnmount()}catch(ke){At(c,i,ke)}}break;case 5:ii(J,J.return);break;case 22:if(J.memoizedState!==null){Rp(ne);continue}}me!==null?(me.return=J,ye=me):Rp(ne)}ee=ee.sibling}e:for(ee=null,ne=e;;){if(ne.tag===5){if(ee===null){ee=ne;try{d=ne.stateNode,W?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=ne.stateNode,I=ne.memoizedProps.style,y=I!=null&&I.hasOwnProperty("display")?I.display:null,N.style.display=Hn("display",y))}catch(ke){At(e,e.return,ke)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=W?"":ne.memoizedProps}catch(ke){At(e,e.return,ke)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===e)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===e)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===e)break e;ee===ne&&(ee=null),ne=ne.return}ee===ne&&(ee=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:ls(n,e),ks(e),c&4&&Cp(e);break;case 21:break;default:ls(n,e),ks(e)}}function ks(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(bp(i)){var c=i;break e}i=i.return}throw Error(r(160))}switch(c.tag){case 5:var d=c.stateNode;c.flags&32&&(Ht(d,""),c.flags&=-33);var p=Tp(e);Hc(e,p,d);break;case 3:case 4:var y=c.stateNode.containerInfo,N=Tp(e);Wc(e,N,y);break;default:throw Error(r(161))}}catch(I){At(e,e.return,I)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Oy(e,n,i){ye=e,_p(e)}function _p(e,n,i){for(var c=(e.mode&1)!==0;ye!==null;){var d=ye,p=d.child;if(d.tag===22&&c){var y=d.memoizedState!==null||ma;if(!y){var N=d.alternate,I=N!==null&&N.memoizedState!==null||cn;N=ma;var W=cn;if(ma=y,(cn=I)&&!W)for(ye=d;ye!==null;)y=ye,I=y.child,y.tag===22&&y.memoizedState!==null?Ap(d):I!==null?(I.return=y,ye=I):Ap(d);for(;p!==null;)ye=p,_p(p),p=p.sibling;ye=d,ma=N,cn=W}Ep(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,ye=p):Ep(e)}}function Ep(e){for(;ye!==null;){var n=ye;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:cn||ga(5,n);break;case 1:var c=n.stateNode;if(n.flags&4&&!cn)if(i===null)c.componentDidMount();else{var d=n.elementType===n.type?i.memoizedProps:os(n.type,i.memoizedProps);c.componentDidUpdate(d,i.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&Rf(n,p,c);break;case 3:var y=n.updateQueue;if(y!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Rf(n,y,i)}break;case 5:var N=n.stateNode;if(i===null&&n.flags&4){i=N;var I=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":I.autoFocus&&i.focus();break;case"img":I.src&&(i.src=I.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var W=n.alternate;if(W!==null){var ee=W.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Ei(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}cn||n.flags&512&&Bc(n)}catch(J){At(n,n.return,J)}}if(n===e){ye=null;break}if(i=n.sibling,i!==null){i.return=n.return,ye=i;break}ye=n.return}}function Rp(e){for(;ye!==null;){var n=ye;if(n===e){ye=null;break}var i=n.sibling;if(i!==null){i.return=n.return,ye=i;break}ye=n.return}}function Ap(e){for(;ye!==null;){var n=ye;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{ga(4,n)}catch(I){At(n,i,I)}break;case 1:var c=n.stateNode;if(typeof c.componentDidMount=="function"){var d=n.return;try{c.componentDidMount()}catch(I){At(n,d,I)}}var p=n.return;try{Bc(n)}catch(I){At(n,p,I)}break;case 5:var y=n.return;try{Bc(n)}catch(I){At(n,y,I)}}}catch(I){At(n,n.return,I)}if(n===e){ye=null;break}var N=n.sibling;if(N!==null){N.return=n.return,ye=N;break}ye=n.return}}var $y=Math.ceil,va=P.ReactCurrentDispatcher,Vc=P.ReactCurrentOwner,Yn=P.ReactCurrentBatchConfig,Ye=0,Yt=null,$t=null,nn=0,Fn=0,oi=Ks(0),Bt=0,Zi=null,Nr=0,ya=0,qc=0,Ji=null,Nn=null,Gc=0,ai=1/0,Ds=null,xa=!1,Kc=null,er=null,wa=!1,tr=null,ka=0,eo=0,Yc=null,Sa=-1,ba=0;function vn(){return(Ye&6)!==0?Nt():Sa!==-1?Sa:Sa=Nt()}function nr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&nn!==0?nn&-nn:ky.transition!==null?(ba===0&&(ba=Ni()),ba):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:Id(e.type)),e)}function cs(e,n,i,c){if(50<eo)throw eo=0,Yc=null,Error(r(185));vr(e,i,c),((Ye&2)===0||e!==Yt)&&(e===Yt&&((Ye&2)===0&&(ya|=i),Bt===4&&sr(e,nn)),Cn(e,c),i===1&&Ye===0&&(n.mode&1)===0&&(ai=Nt()+500,Qo&&Xs()))}function Cn(e,n){var i=e.callbackNode;Io(e,n);var c=gr(e,e===Yt?nn:0);if(c===0)i!==null&&ss(i),e.callbackNode=null,e.callbackPriority=0;else if(n=c&-c,e.callbackPriority!==n){if(i!=null&&ss(i),n===1)e.tag===0?wy(Dp.bind(null,e)):yf(Dp.bind(null,e)),gy(function(){(Ye&6)===0&&Xs()}),i=null;else{switch(le(c)){case 1:i=Us;break;case 4:i=vs;break;case 16:i=Or;break;case 536870912:i=Ro;break;default:i=Or}i=Up(i,Ip.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function Ip(e,n){if(Sa=-1,ba=0,(Ye&6)!==0)throw Error(r(327));var i=e.callbackNode;if(li()&&e.callbackNode!==i)return null;var c=gr(e,e===Yt?nn:0);if(c===0)return null;if((c&30)!==0||(c&e.expiredLanes)!==0||n)n=Ta(e,c);else{n=c;var d=Ye;Ye|=2;var p=Lp();(Yt!==e||nn!==n)&&(Ds=null,ai=Nt()+500,jr(e,n));do try{Uy();break}catch(N){Mp(e,N)}while(!0);pc(),va.current=p,Ye=d,$t!==null?n=0:(Yt=null,nn=0,n=Bt)}if(n!==0){if(n===2&&(d=Ti(e),d!==0&&(c=d,n=Xc(e,d))),n===1)throw i=Zi,jr(e,0),sr(e,c),Cn(e,Nt()),i;if(n===6)sr(e,c);else{if(d=e.current.alternate,(c&30)===0&&!zy(d)&&(n=Ta(e,c),n===2&&(p=Ti(e),p!==0&&(c=p,n=Xc(e,p))),n===1))throw i=Zi,jr(e,0),sr(e,c),Cn(e,Nt()),i;switch(e.finishedWork=d,e.finishedLanes=c,n){case 0:case 1:throw Error(r(345));case 2:_r(e,Nn,Ds);break;case 3:if(sr(e,c),(c&130023424)===c&&(n=Gc+500-Nt(),10<n)){if(gr(e,0)!==0)break;if(d=e.suspendedLanes,(d&c)!==c){vn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=nc(_r.bind(null,e,Nn,Ds),n);break}_r(e,Nn,Ds);break;case 4:if(sr(e,c),(c&4194240)===c)break;for(n=e.eventTimes,d=-1;0<c;){var y=31-hn(c);p=1<<y,y=n[y],y>d&&(d=y),c&=~p}if(c=d,c=Nt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*$y(c/1960))-c,10<c){e.timeoutHandle=nc(_r.bind(null,e,Nn,Ds),c);break}_r(e,Nn,Ds);break;case 5:_r(e,Nn,Ds);break;default:throw Error(r(329))}}}return Cn(e,Nt()),e.callbackNode===i?Ip.bind(null,e):null}function Xc(e,n){var i=Ji;return e.current.memoizedState.isDehydrated&&(jr(e,n).flags|=256),e=Ta(e,n),e!==2&&(n=Nn,Nn=i,n!==null&&Qc(n)),e}function Qc(e){Nn===null?Nn=e:Nn.push.apply(Nn,e)}function zy(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var c=0;c<i.length;c++){var d=i[c],p=d.getSnapshot;d=d.value;try{if(!rs(p(),d))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function sr(e,n){for(n&=~qc,n&=~ya,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-hn(n),c=1<<i;e[i]=-1,n&=~c}}function Dp(e){if((Ye&6)!==0)throw Error(r(327));li();var n=gr(e,0);if((n&1)===0)return Cn(e,Nt()),null;var i=Ta(e,n);if(e.tag!==0&&i===2){var c=Ti(e);c!==0&&(n=c,i=Xc(e,c))}if(i===1)throw i=Zi,jr(e,0),sr(e,n),Cn(e,Nt()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,_r(e,Nn,Ds),Cn(e,Nt()),null}function Zc(e,n){var i=Ye;Ye|=1;try{return e(n)}finally{Ye=i,Ye===0&&(ai=Nt()+500,Qo&&Xs())}}function Cr(e){tr!==null&&tr.tag===0&&(Ye&6)===0&&li();var n=Ye;Ye|=1;var i=Yn.transition,c=Ge;try{if(Yn.transition=null,Ge=1,e)return e()}finally{Ge=c,Yn.transition=i,Ye=n,(Ye&6)===0&&Xs()}}function Jc(){Fn=oi.current,ft(oi)}function jr(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,my(i)),$t!==null)for(i=$t.return;i!==null;){var c=i;switch(lc(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&Yo();break;case 3:si(),ft(Sn),ft(on),kc();break;case 5:xc(c);break;case 4:si();break;case 13:ft(_t);break;case 19:ft(_t);break;case 10:hc(c.type._context);break;case 22:case 23:Jc()}i=i.return}if(Yt=e,$t=e=rr(e.current,null),nn=Fn=n,Bt=0,Zi=null,qc=ya=Nr=0,Nn=Ji=null,Sr!==null){for(n=0;n<Sr.length;n++)if(i=Sr[n],c=i.interleaved,c!==null){i.interleaved=null;var d=c.next,p=i.pending;if(p!==null){var y=p.next;p.next=d,c.next=y}i.pending=c}Sr=null}return e}function Mp(e,n){do{var i=$t;try{if(pc(),aa.current=da,la){for(var c=Et.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}la=!1}if(Tr=0,Kt=Ut=Et=null,qi=!1,Gi=0,Vc.current=null,i===null||i.return===null){Bt=1,Zi=n,$t=null;break}e:{var p=e,y=i.return,N=i,I=n;if(n=nn,N.flags|=32768,I!==null&&typeof I=="object"&&typeof I.then=="function"){var W=I,ee=N,ne=ee.tag;if((ee.mode&1)===0&&(ne===0||ne===11||ne===15)){var J=ee.alternate;J?(ee.updateQueue=J.updateQueue,ee.memoizedState=J.memoizedState,ee.lanes=J.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var me=ip(y);if(me!==null){me.flags&=-257,op(me,y,N,p,n),me.mode&1&&rp(p,W,n),n=me,I=W;var xe=n.updateQueue;if(xe===null){var ke=new Set;ke.add(I),n.updateQueue=ke}else xe.add(I);break e}else{if((n&1)===0){rp(p,W,n),eu();break e}I=Error(r(426))}}else if(wt&&N.mode&1){var Pt=ip(y);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),op(Pt,y,N,p,n),dc(ri(I,N));break e}}p=I=ri(I,N),Bt!==4&&(Bt=2),Ji===null?Ji=[p]:Ji.push(p),p=y;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var z=np(p,I,n);Ef(p,z);break e;case 1:N=I;var M=p.type,B=p.stateNode;if((p.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(er===null||!er.has(B)))){p.flags|=65536,n&=-n,p.lanes|=n;var ce=sp(p,N,n);Ef(p,ce);break e}}p=p.return}while(p!==null)}Op(i)}catch(Se){n=Se,$t===i&&i!==null&&($t=i=i.return);continue}break}while(!0)}function Lp(){var e=va.current;return va.current=da,e===null?da:e}function eu(){(Bt===0||Bt===3||Bt===2)&&(Bt=4),Yt===null||(Nr&268435455)===0&&(ya&268435455)===0||sr(Yt,nn)}function Ta(e,n){var i=Ye;Ye|=2;var c=Lp();(Yt!==e||nn!==n)&&(Ds=null,jr(e,n));do try{Fy();break}catch(d){Mp(e,d)}while(!0);if(pc(),Ye=i,va.current=c,$t!==null)throw Error(r(261));return Yt=null,nn=0,Bt}function Fy(){for(;$t!==null;)Pp($t)}function Uy(){for(;$t!==null&&!Il();)Pp($t)}function Pp(e){var n=Fp(e.alternate,e,Fn);e.memoizedProps=e.pendingProps,n===null?Op(e):$t=n,Vc.current=null}function Op(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=Dy(i,n,Fn),i!==null){$t=i;return}}else{if(i=My(i,n),i!==null){i.flags&=32767,$t=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Bt=6,$t=null;return}}if(n=n.sibling,n!==null){$t=n;return}$t=n=e}while(n!==null);Bt===0&&(Bt=5)}function _r(e,n,i){var c=Ge,d=Yn.transition;try{Yn.transition=null,Ge=1,By(e,n,i,c)}finally{Yn.transition=d,Ge=c}return null}function By(e,n,i,c){do li();while(tr!==null);if((Ye&6)!==0)throw Error(r(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(r(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(Do(e,p),e===Yt&&($t=Yt=null,nn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||wa||(wa=!0,Up(Or,function(){return li(),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,Vc.current=null,Py(e,i),jp(i,e),ly(ec),Lo=!!Jl,ec=Jl=null,e.current=i,Oy(i),Dl(),Ye=N,Ge=y,Yn.transition=p}else e.current=i;if(wa&&(wa=!1,tr=e,ka=d),p=e.pendingLanes,p===0&&(er=null),$r(i.stateNode),Cn(e,Nt()),n!==null)for(c=e.onRecoverableError,i=0;i<n.length;i++)d=n[i],c(d.value,{componentStack:d.stack,digest:d.digest});if(xa)throw xa=!1,e=Kc,Kc=null,e;return(ka&1)!==0&&e.tag!==0&&li(),p=e.pendingLanes,(p&1)!==0?e===Yc?eo++:(eo=0,Yc=e):eo=0,Xs(),null}function li(){if(tr!==null){var e=le(ka),n=Yn.transition,i=Ge;try{if(Yn.transition=null,Ge=16>e?16:e,tr===null)var c=!1;else{if(e=tr,tr=null,ka=0,(Ye&6)!==0)throw Error(r(331));var d=Ye;for(Ye|=4,ye=e.current;ye!==null;){var p=ye,y=p.child;if((ye.flags&16)!==0){var N=p.deletions;if(N!==null){for(var I=0;I<N.length;I++){var W=N[I];for(ye=W;ye!==null;){var ee=ye;switch(ee.tag){case 0:case 11:case 15:Qi(8,ee,p)}var ne=ee.child;if(ne!==null)ne.return=ee,ye=ne;else for(;ye!==null;){ee=ye;var J=ee.sibling,me=ee.return;if(Sp(ee),ee===W){ye=null;break}if(J!==null){J.return=me,ye=J;break}ye=me}}}var xe=p.alternate;if(xe!==null){var ke=xe.child;if(ke!==null){xe.child=null;do{var Pt=ke.sibling;ke.sibling=null,ke=Pt}while(ke!==null)}}ye=p}}if((p.subtreeFlags&2064)!==0&&y!==null)y.return=p,ye=y;else e:for(;ye!==null;){if(p=ye,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Qi(9,p,p.return)}var z=p.sibling;if(z!==null){z.return=p.return,ye=z;break e}ye=p.return}}var M=e.current;for(ye=M;ye!==null;){y=ye;var B=y.child;if((y.subtreeFlags&2064)!==0&&B!==null)B.return=y,ye=B;else e:for(y=M;ye!==null;){if(N=ye,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:ga(9,N)}}catch(Se){At(N,N.return,Se)}if(N===y){ye=null;break e}var ce=N.sibling;if(ce!==null){ce.return=N.return,ye=ce;break e}ye=N.return}}if(Ye=d,Xs(),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(pr,e)}catch{}c=!0}return c}finally{Ge=i,Yn.transition=n}}return!1}function $p(e,n,i){n=ri(i,n),n=np(e,n,1),e=Zs(e,n,1),n=vn(),e!==null&&(vr(e,1,n),Cn(e,n))}function At(e,n,i){if(e.tag===3)$p(e,e,i);else for(;n!==null;){if(n.tag===3){$p(n,e,i);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(er===null||!er.has(c))){e=ri(i,e),e=sp(n,e,1),n=Zs(n,e,1),e=vn(),n!==null&&(vr(n,1,e),Cn(n,e));break}}n=n.return}}function Wy(e,n,i){var c=e.pingCache;c!==null&&c.delete(n),n=vn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(nn&i)===i&&(Bt===4||Bt===3&&(nn&130023424)===nn&&500>Nt()-Gc?jr(e,0):qc|=i),Cn(e,n)}function zp(e,n){n===0&&((e.mode&1)===0?n=1:(n=Fr,Fr<<=1,(Fr&130023424)===0&&(Fr=4194304)));var i=vn();e=Rs(e,n),e!==null&&(vr(e,n,i),Cn(e,i))}function Hy(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),zp(e,i)}function Vy(e,n){var i=0;switch(e.tag){case 13:var c=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:c=e.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(n),zp(e,i)}var Fp;Fp=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||Sn.current)Tn=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return Tn=!1,Iy(e,n,i);Tn=(e.flags&131072)!==0}else Tn=!1,wt&&(n.flags&1048576)!==0&&xf(n,Jo,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;ha(e,n),e=n.pendingProps;var d=Xr(n,on.current);ni(n,i),d=Tc(null,n,c,e,d,i);var p=Nc();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,bn(c)?(p=!0,Xo(n)):p=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,vc(n),d.updater=fa,n.stateNode=d,d._reactInternals=n,Ac(n,c,e,i),n=Lc(null,n,c,!0,p,i)):(n.tag=0,wt&&p&&ac(n),gn(null,n,d,i),n=n.child),n;case 16:c=n.elementType;e:{switch(ha(e,n),e=n.pendingProps,d=c._init,c=d(c._payload),n.type=c,d=n.tag=Gy(c),e=os(c,e),d){case 0:n=Mc(null,n,c,e,i);break e;case 1:n=fp(null,n,c,e,i);break e;case 11:n=ap(null,n,c,e,i);break e;case 14:n=lp(null,n,c,os(c.type,e),i);break e}throw Error(r(306,c,""))}return n;case 0:return c=n.type,d=n.pendingProps,d=n.elementType===c?d:os(c,d),Mc(e,n,c,d,i);case 1:return c=n.type,d=n.pendingProps,d=n.elementType===c?d:os(c,d),fp(e,n,c,d,i);case 3:e:{if(pp(n),e===null)throw Error(r(387));c=n.pendingProps,p=n.memoizedState,d=p.element,_f(e,n),ia(n,c,null,i);var y=n.memoizedState;if(c=y.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){d=ri(Error(r(423)),n),n=hp(e,n,c,i,d);break e}else if(c!==d){d=ri(Error(r(424)),n),n=hp(e,n,c,i,d);break e}else for(zn=Gs(n.stateNode.containerInfo.firstChild),$n=n,wt=!0,is=null,i=Cf(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Jr(),c===d){n=Is(e,n,i);break e}gn(e,n,c,i)}n=n.child}return n;case 5:return Af(n),e===null&&uc(n),c=n.type,d=n.pendingProps,p=e!==null?e.memoizedProps:null,y=d.children,tc(c,d)?y=null:p!==null&&tc(c,p)&&(n.flags|=32),dp(e,n),gn(e,n,y,i),n.child;case 6:return e===null&&uc(n),null;case 13:return mp(e,n,i);case 4:return yc(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=ei(n,null,c,i):gn(e,n,c,i),n.child;case 11:return c=n.type,d=n.pendingProps,d=n.elementType===c?d:os(c,d),ap(e,n,c,d,i);case 7:return gn(e,n,n.pendingProps,i),n.child;case 8:return gn(e,n,n.pendingProps.children,i),n.child;case 12:return gn(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(c=n.type._context,d=n.pendingProps,p=n.memoizedProps,y=d.value,ct(na,c._currentValue),c._currentValue=y,p!==null)if(rs(p.value,y)){if(p.children===d.children&&!Sn.current){n=Is(e,n,i);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var N=p.dependencies;if(N!==null){y=p.child;for(var I=N.firstContext;I!==null;){if(I.context===c){if(p.tag===1){I=As(-1,i&-i),I.tag=2;var W=p.updateQueue;if(W!==null){W=W.shared;var ee=W.pending;ee===null?I.next=I:(I.next=ee.next,ee.next=I),W.pending=I}}p.lanes|=i,I=p.alternate,I!==null&&(I.lanes|=i),mc(p.return,i,n),N.lanes|=i;break}I=I.next}}else if(p.tag===10)y=p.type===n.type?null:p.child;else if(p.tag===18){if(y=p.return,y===null)throw Error(r(341));y.lanes|=i,N=y.alternate,N!==null&&(N.lanes|=i),mc(y,i,n),y=p.sibling}else y=p.child;if(y!==null)y.return=p;else for(y=p;y!==null;){if(y===n){y=null;break}if(p=y.sibling,p!==null){p.return=y.return,y=p;break}y=y.return}p=y}gn(e,n,d.children,i),n=n.child}return n;case 9:return d=n.type,c=n.pendingProps.children,ni(n,i),d=Gn(d),c=c(d),n.flags|=1,gn(e,n,c,i),n.child;case 14:return c=n.type,d=os(c,n.pendingProps),d=os(c.type,d),lp(e,n,c,d,i);case 15:return cp(e,n,n.type,n.pendingProps,i);case 17:return c=n.type,d=n.pendingProps,d=n.elementType===c?d:os(c,d),ha(e,n),n.tag=1,bn(c)?(e=!0,Xo(n)):e=!1,ni(n,i),ep(n,c,d),Ac(n,c,d,i),Lc(null,n,c,!0,e,i);case 19:return vp(e,n,i);case 22:return up(e,n,i)}throw Error(r(156,n.tag))};function Up(e,n){return Tt(e,n)}function qy(e,n,i,c){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,n,i,c){return new qy(e,n,i,c)}function tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gy(e){if(typeof e=="function")return tu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Te)return 11;if(e===te)return 14}return 2}function rr(e,n){var i=e.alternate;return i===null?(i=Xn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,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,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Na(e,n,i,c,d,p){var y=2;if(c=e,typeof e=="function")tu(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case K:return Er(i.children,d,p,n);case X:y=8,d|=8;break;case de:return e=Xn(12,i,n,d|2),e.elementType=de,e.lanes=p,e;case Ne:return e=Xn(13,i,n,d),e.elementType=Ne,e.lanes=p,e;case Le:return e=Xn(19,i,n,d),e.elementType=Le,e.lanes=p,e;case ie:return Ca(i,d,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case he:y=10;break e;case V:y=9;break e;case Te:y=11;break e;case te:y=14;break e;case se:y=16,c=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return n=Xn(y,i,n,d),n.elementType=e,n.type=c,n.lanes=p,n}function Er(e,n,i,c){return e=Xn(7,e,c,n),e.lanes=i,e}function Ca(e,n,i,c){return e=Xn(22,e,c,n),e.elementType=ie,e.lanes=i,e.stateNode={isHidden:!1},e}function nu(e,n,i){return e=Xn(6,e,null,n),e.lanes=i,e}function su(e,n,i){return n=Xn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Ky(e,n,i,c,d){this.tag=n,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=Ci(0),this.expirationTimes=Ci(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ci(0),this.identifierPrefix=c,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function ru(e,n,i,c,d,p,y,N,I){return e=new Ky(e,n,i,N,I),n===1?(n=1,p===!0&&(n|=8)):n=0,p=Xn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},vc(p),e}function Yy(e,n,i){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:c==null?null:""+c,children:e,containerInfo:n,implementation:i}}function Bp(e){if(!e)return Ys;e=e._reactInternals;e:{if(He(e)!==e||e.tag!==1)throw Error(r(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(bn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(bn(i))return gf(e,i,n)}return n}function Wp(e,n,i,c,d,p,y,N,I){return e=ru(i,c,!0,e,d,p,y,N,I),e.context=Bp(null),i=e.current,c=vn(),d=nr(i),p=As(c,d),p.callback=n??null,Zs(i,p,d),e.current.lanes=d,vr(e,d,c),Cn(e,c),e}function ja(e,n,i,c){var d=n.current,p=vn(),y=nr(d);return i=Bp(i),n.context===null?n.context=i:n.pendingContext=i,n=As(p,y),n.payload={element:e},c=c===void 0?null:c,c!==null&&(n.callback=c),e=Zs(d,n,y),e!==null&&(cs(e,d,y,p),ra(e,d,y)),y}function _a(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 Hp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function iu(e,n){Hp(e,n),(e=e.alternate)&&Hp(e,n)}function Xy(){return null}var Vp=typeof reportError=="function"?reportError:function(e){console.error(e)};function ou(e){this._internalRoot=e}Ea.prototype.render=ou.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));ja(e,n,null,null)},Ea.prototype.unmount=ou.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Cr(function(){ja(null,e,null,null)}),n[Cs]=null}};function Ea(e){this._internalRoot=e}Ea.prototype.unstable_scheduleHydration=function(e){if(e){var n=we();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Hs.length&&n!==0&&n<Hs[i].priority;i++);Hs.splice(i,0,e),i===0&&Rd(e)}};function au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ra(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qp(){}function Qy(e,n,i,c,d){if(d){if(typeof c=="function"){var p=c;c=function(){var W=_a(y);p.call(W)}}var y=Wp(n,c,e,0,null,!1,!1,"",qp);return e._reactRootContainer=y,e[Cs]=y.current,$i(e.nodeType===8?e.parentNode:e),Cr(),y}for(;d=e.lastChild;)e.removeChild(d);if(typeof c=="function"){var N=c;c=function(){var W=_a(I);N.call(W)}}var I=ru(e,0,!1,null,null,!1,!1,"",qp);return e._reactRootContainer=I,e[Cs]=I.current,$i(e.nodeType===8?e.parentNode:e),Cr(function(){ja(n,I,i,c)}),I}function Aa(e,n,i,c,d){var p=i._reactRootContainer;if(p){var y=p;if(typeof d=="function"){var N=d;d=function(){var I=_a(y);N.call(I)}}ja(n,y,e,d)}else y=Qy(i,n,e,d,c);return _a(y)}S=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=mr(n.pendingLanes);i!==0&&(Ws(n,i|1),Cn(n,Nt()),(Ye&6)===0&&(ai=Nt()+500,Xs()))}break;case 13:Cr(function(){var c=Rs(e,1);if(c!==null){var d=vn();cs(c,e,1,d)}}),iu(e,1)}},$=function(e){if(e.tag===13){var n=Rs(e,134217728);if(n!==null){var i=vn();cs(n,e,134217728,i)}iu(e,134217728)}},Z=function(e){if(e.tag===13){var n=nr(e),i=Rs(e,n);if(i!==null){var c=vn();cs(i,e,n,c)}iu(e,n)}},we=function(){return Ge},be=function(e,n){var i=Ge;try{return Ge=e,n()}finally{Ge=i}},Ft=function(e,n,i){switch(n){case"input":if(Dt(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var c=i[n];if(c!==e&&c.form===e.form){var d=Ko(c);if(!d)throw Error(r(90));je(c),Dt(c,d)}}}break;case"textarea":pe(e,i);break;case"select":n=i.value,n!=null&&ht(e,!!i.multiple,n,!1)}},bt=Zc,xt=Cr;var Zy={usingClientEntryPoint:!1,Events:[Ui,Kr,Ko,yt,qt,Zc]},to={findFiberByHostInstance:yr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jy={bundleType:to.bundleType,version:to.version,rendererPackageName:to.rendererPackageName,rendererConfig:to.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ns(e),e===null?null:e.stateNode},findFiberByHostInstance:to.findFiberByHostInstance||Xy,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 Ia=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ia.isDisabled&&Ia.supportsFiber)try{pr=Ia.inject(Jy),Pn=Ia}catch{}}return jn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zy,jn.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!au(n))throw Error(r(200));return Yy(e,n,null,i)},jn.createRoot=function(e,n){if(!au(e))throw Error(r(299));var i=!1,c="",d=Vp;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(d=n.onRecoverableError)),n=ru(e,1,!1,null,null,i,!1,c,d),e[Cs]=n.current,$i(e.nodeType===8?e.parentNode:e),new ou(n)},jn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=ns(n),e=e===null?null:e.stateNode,e},jn.flushSync=function(e){return Cr(e)},jn.hydrate=function(e,n,i){if(!Ra(n))throw Error(r(200));return Aa(null,e,n,!0,i)},jn.hydrateRoot=function(e,n,i){if(!au(e))throw Error(r(405));var c=i!=null&&i.hydratedSources||null,d=!1,p="",y=Vp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),n=Wp(n,null,e,1,i??null,d,!1,p,y),e[Cs]=n.current,$i(e),c)for(e=0;e<c.length;e++)i=c[e],d=i._getVersion,d=d(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,d]:n.mutableSourceEagerHydrationData.push(i,d);return new Ea(n)},jn.render=function(e,n,i){if(!Ra(n))throw Error(r(200));return Aa(null,e,n,!1,i)},jn.unmountComponentAtNode=function(e){if(!Ra(e))throw Error(r(40));return e._reactRootContainer?(Cr(function(){Aa(null,null,e,!1,function(){e._reactRootContainer=null,e[Cs]=null})}),!0):!1},jn.unstable_batchedUpdates=Zc,jn.unstable_renderSubtreeIntoContainer=function(e,n,i,c){if(!Ra(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Aa(e,n,i,!1,c)},jn.version="18.3.1-next-f1338f8080-20240426",jn}var eh;function Wm(){if(eh)return uu.exports;eh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),uu.exports=lx(),uu.exports}var th;function cx(){if(th)return Da;th=1;var t=Wm();return Da.createRoot=t.createRoot,Da.hydrateRoot=t.hydrateRoot,Da}var ux=cx();const dx=Bm(ux),nh=t=>{let s;const r=new Set,o=(m,v)=>{const k=typeof m=="function"?m(s):m;if(!Object.is(k,s)){const x=s;s=v??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(b=>b(s,x))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>g,subscribe:m=>(r.add(m),()=>r.delete(m))},g=s=t(o,a,h);return h},fx=(t=>t?nh(t):nh),px=t=>t;function hx(t,s=px){const r=it.useSyncExternalStore(t.subscribe,it.useCallback(()=>s(t.getState()),[t,s]),it.useCallback(()=>s(t.getInitialState()),[t,s]));return it.useDebugValue(r),r}const mx=t=>{const s=fx(t),r=o=>hx(s,o);return Object.assign(r,s),r},gx=(t=>mx),Hm="agentpane:machines",Vm="agentpane:active-machine";function vx(t){return/^[a-z][a-z0-9-]{1,30}$/.test(t)}function qm(t){return`${t}.repoburg.com`}function Gm(t){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(t);return s?s[1]:null}function Km(t,s){try{const r=localStorage.getItem(t);return r==null?s:JSON.parse(r)}catch{return s}}function Ym(t,s){try{localStorage.setItem(t,JSON.stringify(s))}catch{}}function Xm(){return Km(Hm,[]).filter(s=>vx(s.mahlas)&&s.hostname===qm(s.mahlas))}function yx(t){const s={mahlas:t,hostname:qm(t),lastConnectedAt:new Date().toISOString()},r=Xm(),o=[s,...r.filter(a=>a.mahlas!==t)];return Ym(Hm,o),s}function xx(){const t=Km(Vm,null);return t?Xm().find(s=>s.mahlas===t)??null:null}function wx(t){Ym(Vm,t)}function kx(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("host");if(!t)return;const s=Gm(t);s&&(yx(s),wx(s))}const sh="http://localhost:9998",Sx=["agent.repoburg.com"];function dn(){if(typeof window>"u")return"";const t=new URLSearchParams(window.location.search),s=t.get("bport");if(s)return`http://localhost:${s}`;const r=t.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(Sx.includes(o))return sh;if(Gm(o))return"";const a=xx();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":sh}const bx="/api";class Qm extends Error{constructor(r,o,a){super(r);rt(this,"status");rt(this,"body");this.name="ApiError",this.status=o,this.body=a}}async function bo(t,s,r){const o=await fetch(`${dn()}${bx}${s}`,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`,u=null;try{u=await o.json();const f=u==null?void 0:u.error;typeof f=="string"&&f&&(a=`${a} — ${f}`)}catch{}throw new Qm(`${t} ${s} failed: ${a}`,o.status,u)}return o.json()}function fn(t){return bo("GET",t)}function pt(t,s){return bo("POST",t,s)}function yl(t){return bo("DELETE",t)}function bs(t,s){return bo("PATCH",t,s)}function Tx(t,s){return bo("PUT",t,s)}function Nx(){return fn("/sessions")}function so(t){return fn(`/sessions/${t}`)}function Ju(t){return pt("/sessions",t)}function rh(t){return yl(`/sessions/${t}`)}function Zm(t,s,r,o){return pt(`/sessions/${t}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function Cx(t){return pt(`/sessions/${t}/cancel`)}function jx(t,s){return pt(`/sessions/${t}/turns/${s}/resume`)}function _x(t,s){return bs(`/sessions/${t}`,{title:s})}function ih(t){return bs(`/sessions/${t}`,{lifecycle:"finished"})}function oh(t){return bs(`/sessions/${t}`,{lifecycle:"working"})}function Ex(t,s){return bs(`/sessions/${t}`,{starred:s})}function ah(t){return bs(`/sessions/${t}`,{has_unreviewed:0})}function Rx(t,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),bs(`/sessions/${t}`,a)}function Ax(t,s){return bs(`/sessions/${t}`,{runtime_config:s})}function Ix(t,s){return pt(`/sessions/${t}/rewind`,{turn_id:s})}function Dx(t){return pt(`/sessions/${t}/restore`,{})}function Mx(t,s,r){return pt(`/sessions/${t}/branch`,{turn_id:s,title:r})}function Jm(){return fn("/workspaces")}function Lx(t,s){return pt("/workspaces",{path:t,label:s})}function Px(t){return pt("/workspaces/hide",{path:t})}async function Ox(){const t=await fetch(`${dn()}/api/pick-directory`);if(t.status===204)return{cancelled:!0};if(!t.ok)throw new Error(`GET /api/pick-directory failed: ${t.status} ${t.statusText}`);return t.json()}function eg(){return fn("/folders")}function $x(t,s){return pt("/folders",{workspace_path:t,name:s})}function lh(t,s){return bs(`/folders/${t}`,s)}function zx(t){return yl(`/folders/${t}`)}function Fx(t){return pt("/sessions/reorder",{moves:t})}function ur(t){return t.status==="pending"||t.status==="running"}function tg(t){return!!(t!=null&&t.turns.some(ur))}function xl(t){return t?t.turns.some(ur)||(t.threads??[]).some(s=>(s.turns??[]).some(ur)):!1}const ng=1;function sg(){let t="";try{t=dn()}catch{}return`agentpane:tabs:${t||window.location.origin}`}function ch(t){return Array.isArray(t)&&t.every(s=>typeof s=="string")}function uh(t){return t===null||typeof t=="string"}function Ux(t){if(t==null)return null;let s;try{s=JSON.parse(t)}catch{return null}if(typeof s!="object"||s===null)return null;const r=s;return r.v!==ng||!ch(r.openTabs)||!uh(r.activeSessionId)||!ch(r.openAppTabs)||!uh(r.activeAppTabId)?null:{openTabs:r.openTabs,activeSessionId:r.activeSessionId,openAppTabs:r.openAppTabs,activeAppTabId:r.activeAppTabId}}const rg=[()=>window.sessionStorage,()=>window.localStorage];function Bx(){const t=sg();for(const s of rg)try{const r=Ux(s().getItem(t));if(r)return r}catch{}return null}function Wx(t){const s=sg(),r=JSON.stringify({v:ng,openTabs:t.openTabs,activeSessionId:t.activeSessionId,openAppTabs:t.openAppTabs,activeAppTabId:t.activeAppTabId});for(const o of rg)try{o().setItem(s,r)}catch{}}function Hx(t){return t.subscribe((s,r)=>{(s.openTabs!==r.openTabs||s.activeSessionId!==r.activeSessionId||s.openAppTabs!==r.openAppTabs||s.activeAppTabId!==r.activeAppTabId)&&Wx(s)})}function Ka(t){return[...new Set(t)]}function Vx(t,s,r,o){const a=m=>r===null||r.has(m),u=Ka(((t==null?void 0:t.openTabs)??[]).filter(m=>s.has(m))),f=Ka(((t==null?void 0:t.openAppTabs)??[]).filter(a));let h=(t==null?void 0:t.activeSessionId)??null;h!==null&&!s.has(h)&&(h=null),h!==null&&!u.includes(h)&&u.push(h),h??(h=u.at(-1)??null);let g=(t==null?void 0:t.activeAppTabId)??null;return g!==null&&!a(g)&&(g=null),g!==null&&!f.includes(g)&&f.push(g),o!==null&&s.has(o)&&(u.includes(o)||u.push(o),h=o,g=null),{openTabs:u,activeSessionId:h,openAppTabs:f,activeAppTabId:g}}function qx(){const t=new URLSearchParams(window.location.search);return{session:t.get("session"),thread:t.get("thread")}}function Gx(){const t=new URL(window.location.href);!t.searchParams.has("session")&&!t.searchParams.has("thread")||(t.searchParams.delete("session"),t.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",t))}let pu=0;function dh(t){return t==="sidecar"?"sidecar":"turns"}async function Kx(t,s){const r=await Promise.allSettled(t.map(u=>s(u))),o=new Map;let a=null;return r.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(t[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function fh(t,s){const r={...t.sessionDetails};s.forEach(h=>delete r[h]);const o={...t.backgroundTasks};s.forEach(h=>delete o[h]);const a=t.openTabs.filter(h=>!s.has(h));let u=t.activeSessionId,f=t.activeTurnIndex;if(u&&s.has(u)){u=a.length>0?a[a.length-1]:null;const h=u?r[u]:null;f=h&&h.turns.length>0?h.turns.length-1:0}return{sessions:t.sessions.filter(h=>!s.has(h.id)),sessionDetails:r,backgroundTasks:o,openTabs:a,activeSessionId:u,activeTurnIndex:f}}function Yx(t){const s={...t};return delete s.turns,delete s.threads,delete s.contextUsage,s}async function ph(t,s,r,o,a){if(r.length===0)return;t({error:null});const{updated:u,firstError:f}=await Kx(r,o);u.size>0&&t(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const h=r.length-u.size;if(h===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{t({error:f});const g=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${g} ${u.size} of ${r.length} — ${h} failed`)}}const Xx=(t,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const r=qx(),o=Bx();try{const a=localStorage.getItem("agentpane:last-model-config");a&&t({lastModelConfig:JSON.parse(a)})}catch{}t({loading:!0,error:null});try{const a=s().loadApps(),[u,f,h]=await Promise.all([Nx(),Jm(),eg()]);t({sessions:u,workspaces:f,folders:h,loading:!1}),Gx();const g=await a,m=Vx(o,new Set(u.map(v=>v.id)),g?new Set(s().apps.map(v=>v.id)):null,r.session);t(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Ka([...m.openTabs,...v.openTabs]),openAppTabs:Ka([...m.openAppTabs,...v.openAppTabs]),activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!s().activeSessionId&&await s().selectSession(m.activeSessionId,{keepAppView:!0}),r.thread&&(t({deepLinkThreadId:r.thread}),s().switchRightTab("threads"))}catch(a){t({loading:!1,error:a.message})}},selectSession:async(r,o)=>{const a=++pu,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},f=h=>h.includes(r)?h:[...h,r];if(s().sessionDetails[r]){const h=s().sessionDetails[r];t({activeSessionId:r,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:dh(s().activeRightTab),...u,openTabs:f(s().openTabs)}),h.has_unreviewed===1&&(ah(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...h,has_unreviewed:0}}})));return}t({loading:!0,error:null});try{const h=await so(r);if(a!==pu){t(g=>({sessionDetails:{...g.sessionDetails,[r]:h},openTabs:f(g.openTabs),loading:!1}));return}t(g=>({sessionDetails:{...g.sessionDetails,[r]:h},activeSessionId:r,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:dh(g.activeRightTab),...u,openTabs:f(g.openTabs),loading:!1})),h.has_unreviewed===1&&(ah(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...h,has_unreviewed:0}}})))}catch(h){t(a===pu?{loading:!1,error:h.message}:{loading:!1})}},closeTab:r=>{t(o=>{const a=o.openTabs.filter(u=>u!==r);if(o.activeSessionId===r&&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===r?null:o.activeSessionId}})},updateModelConfig:async(r,o,a)=>{const u=s().activeSessionId;if(u){t({error:null});try{const f=await Rx(u,r,o,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};t({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),t(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 s().refreshActiveSession()}catch(f){t({error:f.message}),s().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async r=>{t({error:null});try{const o=await Ju(r);t(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};t({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{t(o=>({sessions:o.sessions.some(a=>a.id===r.id)?o.sessions:[r,...o.sessions]}))},revealSession:async r=>{let o=s().sessionDetails[r];if(!o){const a=await so(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:a}})),o=a}s().sessions.some(a=>a.id===r)||s().addSession(Yx(o)),await s().selectSession(r)},deleteSession:async r=>{var a;t({error:null});const o=(a=s().sessions.find(u=>u.id===r))==null?void 0:a.title;try{await rh(r),t(u=>fh(u,new Set([r]))),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){t({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{t({error:null});try{const a=await _x(r,o.trim());t(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:a.title}}:u.sessionDetails}))}catch(a){t({error:a.message}),s().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{t({error:null});try{const o=await ih(r);t(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){t({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await ph(t,s,r,ih,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){t({error:null});try{const a=await Ex(r,o.starred?0:1);t(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:a.starred}}:u.sessionDetails}))}catch(a){t({error:a.message}),s().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{t({error:null});try{const o=await oh(r);t(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){t({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await ph(t,s,r,oh,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;t({error:null});const o=await Promise.allSettled(r.map(f=>rh(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(r[h])}),a.size===0){t({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}t(f=>fh(f,a)),s().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=r.length-a.size;u===0?s().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(t({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${a.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const a=s().activeSessionId;if(a){t({error:null,submittingPrompt:r}),t(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 Zm(a,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),t(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){t({submittingPrompt:null,error:u.message}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),t(f=>{const h=f.sessionDetails[a];if(!h)return{};const g=xl(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 r=s().activeSessionId;if(r)try{await Cx(r)}catch(o){t({error:o.message})}},rewindToTurn:async(r,o)=>{t({error:null});try{const a=await Ix(r,o),u=await so(r);t(f=>({sessionDetails:{...f.sessionDetails,[r]:u},sessions:f.sessions.map(h=>h.id===r?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(a){t({error:a.message}),s().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async r=>{t({error:null});try{const o=await Dx(r),a=await so(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:a},sessions:u.sessions.map(f=>f.id===r?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){t({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,a)=>{t({error:null});try{const u=await Mx(r,o,a);t(f=>({sessions:[u,...f.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){t({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){t({error:null});try{const a=await Ax(o,JSON.stringify(r));t(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){t({error:a.message}),s().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await so(r);t(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){t({error:o.message})}}}),Qx=(t,s)=>({workspaces:[],addWorkspace:async r=>{t({error:null});try{const o=await Lx(r.trim());t(a=>({workspaces:[...a.workspaces,o]})),s().addToast("success",`Workspace added — ${o.path}`)}catch(o){s().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async r=>{t({error:null});try{await Px(r);const o=await Jm();t({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{t({error:null});try{const o=s().lastModelConfig,a=await Ju({cwd:r,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});t(u=>({sessions:[a,...u.sessions]})),await s().selectSession(a.id),s().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const r=await Ox();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),zs=new Map,wl=new Map,ed=new Map,kl=new Map;function Zx(t,s){zs.set(t,s)}function Jx(t){zs.delete(t)}function hu(t,s){wl.set(t,s)}function hh(t,s,r){const o=wl.get(t);if(!o)return;const a=zs.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function mh(t,s){const r=wl.get(t);if(!r)return;const o=zs.get(r);o&&o({source:"agentpane-host",event:"background_tasks",payload:{sessionId:t,tasks:s}})}function e0(t,s,r,o){const a=zs.get(t);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function t0(t,s,r,o){const a=wl.get(t);if(!a)return;const u=zs.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:t,turnId:s,itemId:r,delta:o}})}function n0(t,s){ed.set(t,s)}function s0(t){ed.delete(t)}function r0(t,s){kl.set(t,s)}function i0(t){kl.delete(t)}function ig(t,s={}){const r=kl.get(t);if(r){r(s);return}const o=zs.get(t);o&&o({source:"agentpane-host",event:"state_changed",payload:{}})}function o0(){for(const t of new Set([...zs.keys(),...kl.keys()]))ig(t)}function a0(t){var r;const s=zs.get(t);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=ed.get(t))==null||r()}const l0=(t,s)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},setWsConnected:r=>t({wsConnected:r}),onTurnCreated:(r,o)=>{t(a=>{const u=a.sessionDetails[r];return!u||o.thread_id?{}:u.turns.some(f=>f.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[r]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),t(a=>{const u=or(a.sessions,r,()=>({is_running:1,status:"running"})),f=a.sessionDetails[r];if(!f)return{sessions:u};const h=f.turns.findIndex(g=>g.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Qn(f,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===r&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{s().addLogEntry("DEBUG",`item:started — ${a.type}`),t(u=>{const f=gh(a)?Rr(u.retryStates,o):u.retryStates,h=u.sessionDetails[r];return h?{sessionDetails:{...u.sessionDetails,[r]:Qn(h,o,g=>gu(g,a))},retryStates:f}:{retryStates:f}})},onItemUpdated:(r,o,a)=>{t(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Qn(f,o,h=>gu(h,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(s().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"?s().addToast("success",`${m} completed: ${h}`):s().addToast("error",`${m} failed: ${h}`)}t(u=>{const f=gh(a)?Rr(u.retryStates,o):u.retryStates,h=u.sessionDetails[r];return h?{retryStates:f,sessionDetails:{...u.sessionDetails,[r]:Qn(h,o,g=>{var v,k;let m=gu(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:(r,o,a,u)=>{t0(r,o,a,u),t(f=>{const h=Rr(f.retryStates,o),g=f.sessionDetails[r];return g?{sessionDetails:{...f.sessionDetails,[r]:Qn(g,o,m=>u0(m,a,u))},retryStates:h}:{retryStates:h}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,g=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${g} out`),hh(r,"turn:completed",{turnId:o,response:f??null}),s().refreshApps(),t(m=>{const v=m.sessionDetails[r],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=mu(k),b=x&&k?Ma(k):"active",j=or(m.sessions,r,T=>({is_running:x,status:b,has_unreviewed:u?1:T.has_unreviewed})),_=Rr(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[r]:{...k,is_running:x,status:b,has_unreviewed:u?1:k.has_unreviewed}},sessions:j,retryStates:_}:{sessions:j,retryStates:_}})},onTokenUsageUpdated:(r,o,a)=>{t(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Qn(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(r,o)=>{t(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,a,u)=>{s().addLogEntry("ERROR",`turn:failed — ${a}`),s().addToast("error",`Turn failed — ${a}`),hh(r,"turn:failed",{turnId:o,error:a}),t(f=>{const h=f.sessionDetails[r],g=a.includes("cancelled")||a.includes("aborted"),m=g?"aborted":"failed",v=h?Qn(h,o,_=>({..._,status:m,error:a,...u?{resume_state:u}:{},items:_.items.map(T=>T.status==="in_progress"?{...T,status:"failed"}:T)})):null,k=mu(v),x=k&&v?Ma(v):g?"active":"failed",b=or(f.sessions,r,()=>({is_running:k,status:x})),j=Rr(f.retryStates,o);return v?{sessionDetails:{...f.sessionDetails,[r]:{...v,is_running:k,status:x}},sessions:b,retryStates:j}:{sessions:b,retryStates:j}})},onTurnCancelled:(r,o)=>{t(a=>{const u=a.sessionDetails[r],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=mu(f),g=h&&f?Ma(f):"active",m=or(a.sessions,r,()=>({is_running:h,status:g})),v=Rr(a.retryStates,o);return f?{sessionDetails:{...a.sessionDetails,[r]:{...f,is_running:h,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(r,o,a)=>{s().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),s().addToast("warn",c0(a.reason)),t(u=>{const f=u.sessionDetails[r],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?Ma(h):"interrupted",m=or(u.sessions,r,()=>({is_running:1,status:g})),v=Rr(u.retryStates,o);return h?{sessionDetails:{...u.sessionDetails,[r]:{...h,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(r,o,a)=>{s().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),t(u=>{const f=or(u.sessions,r,()=>({is_running:1,status:"running"})),h=u.sessionDetails[r];return h?{sessionDetails:{...u.sessionDetails,[r]:{...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:(r,o)=>{s().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),s().addToast("success","Interrupted turn resumed"),t(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:Qn(u,o,f=>({...f,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(r,o,a)=>{s().addLogEntry("WARN",`turn:retrying — ${r.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),t(u=>({retryStates:{...u.retryStates,[o]:a}}))},onSessionTitle:(r,o)=>{t(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:a.sessionDetails[r]?{...a.sessionDetails,[r]:{...a.sessionDetails[r],title:o}}:a.sessionDetails}))},onSessionTouched:r=>{t(o=>{const a=o.sessionDetails[r];return{sessions:or(o.sessions,r,()=>({user_touched:1})),sessionDetails:a?{...o.sessionDetails,[r]:{...a,user_touched:1}}:o.sessionDetails}})},onSessionUpdated:r=>{const o={...r};delete o.is_running,delete o.status,t(a=>{const u=a.sessionDetails[r.id];return{sessions:or(a.sessions,r.id,()=>o),sessionDetails:u?{...a.sessionDetails,[r.id]:{...u,...o}}:a.sessionDetails}})},onBackgroundTasksChanged:(r,o)=>{mh(r,o),t(a=>{if(o.length===0&&!a.backgroundTasks[r])return{};const u={...a.backgroundTasks};return o.length>0?u[r]=o:delete u[r],{backgroundTasks:u}})},onBackgroundTasksSnapshot:r=>{for(const[a,u]of Object.entries(r))mh(a,u);const o={};for(const[a,u]of Object.entries(r))u.length>0&&(o[a]=u);t({backgroundTasks:o})}});function c0(t){switch(t){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 Ma(t){const s=[...t.turns,...(t.threads??[]).flatMap(r=>r.turns??[])].filter(ur);return s.length>0&&s.every(r=>r.status==="pending"&&r.resume_state==="waiting")?"interrupted":"running"}function gh(t){return t.type!=="background_task"&&t.type!=="error"&&t.type!=="interruption"}function Rr(t,s){if(!(s in t))return t;const r={...t};return delete r[s],r}function mu(t){return t&&(t.turns.some(ur)||(t.threads??[]).some(r=>(r.turns??[]).some(ur)))?1:0}function or(t,s,r){return t.some(o=>o.id===s)?t.map(o=>o.id===s?{...o,...r(o)}:o):t}function Qn(t,s,r){const o=(t.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===s)?{...a,turns:(a.turns??[]).map(u=>u.id===s?r(u):u)}:a);return{...t,turns:t.turns.map(a=>a.id===s?r(a):a),threads:o}}function og(t,s){for(let r=t.length-1;r>=0;r--)if(t[r].external_item_id===s)return r;return-1}function gu(t,s){const r=og(t.items,s.external_item_id);if(r>=0){const o=[...t.items];return o[r]=s,{...t,items:o}}if(s.type==="agent_message"){const o=t.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...t,items:[...o,s]}}return{...t,items:[...t.items,s]}}function u0(t,s,r){var u;const o=og(t.items,s);if(o>=0){const f=t.items[o],g=(((u=f.data)==null?void 0:u.text)??"")+r,m=[...t.items];return m[o]={...f,data:{...f.data,text:g}},{...t,items:m,agent_response:g}}const a={id:`delta-${s}`,turn_id:t.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...t,items:[...t.items,a],agent_response:r}}function d0(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return fn(`/providers/${t}/models${r}`)}const vh="curl -fsSL https://repoburg.com/install.sh | bash",f0=2e3,ag="agentpane:daemon-seen";function p0(t=dn()){if(!t)return!1;try{const s=new URL(t);return s.protocol==="http:"&&(s.hostname==="localhost"||s.hostname==="127.0.0.1")}catch{return!1}}async function h0(t=dn()){try{return await fetch(`${t}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function m0(){try{return localStorage.getItem(ag)==="true"}catch{return!1}}function g0(){try{localStorage.setItem(ag,"true")}catch{}}function v0(t){let s=!1,r=!1,o=!1,a=null;function u(){a!==null&&(clearTimeout(a),a=null)}async function f(){if(s||r)return;u(),r=!0;const m=await h0();if(r=!1,!s){if(m){g0(),g(),t.onReady();return}o||(o=!0,t.onMissing()),a=setTimeout(()=>void f(),f0)}}function h(){document.visibilityState==="visible"&&f()}function g(){s=!0,u(),window.removeEventListener("focus",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("focus",h),document.addEventListener("visibilitychange",h),f(),g}const Mu=160,Lu=480,y0=240,Ya=220,x0=300,w0=600,k0=36;function Xa(){return typeof window>"u"?w0:Math.max(Ya,Math.round(window.innerWidth*.7))}const yh="agentpane:sidebar-width",xh="agentpane:right-panel-width",vu="agentpane:right-panel-collapsed";function wh(t,s,r,o){try{const a=localStorage.getItem(t);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}function S0(t){try{return localStorage.getItem(t)==="true"}catch{return!1}}function kh(t,s){try{localStorage.setItem(t,String(s))}catch{}}const Sh=200,b0=(t,s)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:wh(yh,Mu,Lu,y0),rightPanelWidth:wh(xh,Ya,Xa(),x0),rightPanelCollapsed:S0(vu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,usageViewOpen:!1,daemonStatus:p0()?"checking":"ready",setActiveTurnIndex:r=>t({activeTurnIndex:r}),switchRightTab:r=>{s().rightPanelCollapsed&&kh(vu,!1),t({activeRightTab:r,rightPanelCollapsed:!1})},setShowNewSessionDialog:r=>t({showNewSessionDialog:r}),setShowRemoteModal:r=>t({showRemoteModal:r}),setShowCommandPalette:r=>t({showCommandPalette:r}),setShowModelSelector:r=>t({showModelSelector:r}),setDeepLinkThreadId:r=>t({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(Lu,Math.max(Mu,Math.round(r)));t({sidebarWidth:o});try{localStorage.setItem(yh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(Xa(),Math.max(Ya,Math.round(r)));t({rightPanelWidth:o});try{localStorage.setItem(xh,String(o))}catch{}},setRightPanelCollapsed:r=>{t({rightPanelCollapsed:r}),kh(vu,r)},toggleRightPanel:()=>s().setRightPanelCollapsed(!s().rightPanelCollapsed),toggleVscodeView:()=>{if(s().vscodeViewOpen){t({vscodeViewOpen:!1});return}t({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,a)=>t({vscodeState:r,vscodeId:o,vscodeToken:a}),toggleUsageView:()=>t({usageViewOpen:!s().usageViewOpen}),setDaemonStatus:r=>t({daemonStatus:r}),addToast:(r,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);t(h=>({toasts:[...h.toasts,{id:f,type:r,message:o,undoAction:a,undoLabel:u}]}))},removeToast:r=>{t(o=>({toasts:o.toasts.filter(a=>a.id!==r)}))},addLogEntry:(r,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});t(u=>{const f=[...u.eventLog,{time:a,level:r,message:o}];return f.length>Sh&&f.splice(0,f.length-Sh),{eventLog:f}})},loadModels:async(r,o)=>{if(!s().modelsLoading){t({modelsLoading:!0,models:[]});try{const a=await d0(r,o);t({models:a,modelsLoading:!1})}catch{t({modelsLoading:!1})}}}}),T0=(t,s)=>({createThread:async(r,o)=>{try{await pt(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){s().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(r,o,a)=>{try{await pt(`/sessions/${r}/threads/${o}/followup`,{message:a}),s().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await pt(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(a){s().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(r,o)=>{try{await bs(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){s().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await bs(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(a){s().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(r,o,a)=>{try{const u=await pt(`/sessions/${r}/threads/${o}/summarize`,{directives:a}),f=`
|
|
42
|
-
[Shared from a resolved discussion thread — summary of its findings]
|
|
43
|
-
|
|
44
|
-
\`\`\`QUOTE
|
|
45
|
-
${u.summary}
|
|
46
|
-
\`\`\`
|
|
47
|
-
|
|
48
|
-
`;return t({quotedText:f}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await yl(`/sessions/${r}/threads/${o}`)}catch(a){s().addToast("error",`Failed to delete thread — ${a.message}`)}},askSidecar:async(r,o)=>{try{return await pt(`/sessions/${r}/sidecar`,{message:o}),s().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(a){return s().addToast("error",`Failed to ask the sidecar — ${a.message}`),!1}},onThreadCreated:(r,o,a)=>{t(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{t(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(r,o,a)=>{t(u=>{const f=u.sessionDetails[r];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,[r]:{...f,threads:h}}}})},onThreadDeleted:(r,o)=>{t(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),N0=(t,s)=>({folders:[],loadFolders:async()=>{const r=await eg();t({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await $x(r,o);return t(u=>({folders:[...u.folders,a]})),a}catch(a){return s().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await lh(r,{name:o});t(u=>({folders:u.folders.map(f=>f.id===r?a:f)}))}catch(a){s().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=s().folders,a=s().sessions;t(u=>({folders:u.folders.filter(f=>f.id!==r),sessions:u.sessions.map(f=>f.folder_id===r?{...f,folder_id:null}:f)}));try{await zx(r)}catch(u){t({folders:o,sessions:a}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,a=new Map(r.map(u=>[u.id,u]));t(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 Fx(r)}catch(u){t({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,a=new Map(r.map((u,f)=>[u,f]));t(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(r.map((u,f)=>lh(u,{sort_order:f})))}catch(u){t({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function bh(){return fn("/apps")}function C0(){return fn("/apps/root")}function Th(t){return fn(`/apps/${t}/source`)}function Nh(t,s=""){return fn(`/apps/${t}/state?workspace=${encodeURIComponent(s)}`)}function lg(t,s,r=""){return Tx(`/apps/${t}/state?workspace=${encodeURIComponent(r)}`,s)}function j0(t){return yl(`/apps/${t}`)}function _0(t){return fn(`/apps/${t}/sessions`)}function E0(){return fn("/apps/examples")}function R0(t){return pt(`/apps/examples/${t}/install`,{})}function A0(t){return pt("/apps",t)}function I0(t,s){return pt("/apps/import",{id:t,files:s})}function D0(t,s,r){return pt(`/apps/mcp/calls/${t}/result`,{result:s,error:null})}function M0(t,s){return pt(`/apps/${t}/edit-session`,s)}function L0(t,s){return pt(`/apps/${t}/files`,s)}async function P0(t,s){const r=await fetch(`${dn()}/api/apps/${t}/files/${encodeURIComponent(s)}/meta`);if(r.status===404)return null;if(!r.ok)throw new Error(`GET /apps/${t}/files/${s}/meta failed: ${r.status} ${r.statusText}`);return await r.json()}async function O0(t,s){const r=await fetch(`${dn()}/api/apps/${t}/files/${encodeURIComponent(s)}`);if(!r.ok)throw new Error(`GET /apps/${t}/files/${s} failed: ${r.status} ${r.statusText}`);return r.blob()}const Wa=new Set;async function yu(t,s){Wa.add(s),await t().loadApps();const r=t().apps.find(o=>o.id===s);t().openAppTab(s),t().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const Pu="agentpane:app-workspaces";function $0(){try{const t=JSON.parse(localStorage.getItem(Pu)??"{}");return t&&typeof t=="object"?t:{}}catch{return{}}}const z0=(t,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:$0(),loadApps:async()=>{try{const[r,o]=await Promise.all([bh(),C0().catch(()=>null)]);return r.forEach(a=>Wa.add(a.id)),t(o?{apps:r,appsRootPath:o.root}:{apps:r}),!0}catch{return!1}},refreshApps:async()=>{try{const r=await bh();for(const o of r)Wa.has(o.id)||(Wa.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));t({apps:r})}catch{}},openAppTab:r=>{t(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>{t(o=>{const a=o.openAppTabs.filter(u=>u!==r);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===r?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:r=>t({activeAppTabId:r}),openAppCatalog:()=>t({appCatalogOpen:!0}),closeAppCatalog:()=>t({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{t(a=>{const u={...a.appWorkspaces,[r]:o};try{localStorage.setItem(Pu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await R0(r),await yu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await A0(r),await yu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await I0(r,o),await yu(s,r),!0}catch(a){return s().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,a=await M0(r,{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});s().sessions.some(u=>u.id===a.id)||t(u=>({sessions:[a,...u.sessions]})),t({activeAppTabId:null}),await s().selectSession(a.id),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(a=>a.id===r);if(o)try{await lg(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await j0(r),t(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(Pu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==r),openAppTabs:o.openAppTabs.filter(u=>u!==r),activeAppTabId:o.activeAppTabId===r?null:o.activeAppTabId,appWorkspaces:a}}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),Ch=3e3,Bn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Wn=[];let Qa=0,td=0,Za=0,nd=0,Ja=0,sd=0,rd=0;const yo=new Map,xo=new Map;let mi=new Map,pi=0,gi=new Map,xu=!1;function el(t,s,r){if(Wn.push({t:Date.now(),cat:t,msg:s,ms:r}),Wn.length>Ch){const o=Wn.length-Ch;Wn.splice(0,o),_n=Math.max(0,_n-o)}}function hi(t,s,r){el(t,s,r),console.log(`[perf:${t}] ${s}`)}function cg(t){hi("note",t)}function ug(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function F0(t,s){let r=mi.get(t);r||mi.set(t,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=yo.get(t);o||yo.set(t,o={n:0,bytes:0}),o.n++,o.bytes+=s}function U0(){pi++,rd++}function B0(t){gi.set(t,(gi.get(t)??0)+1),xo.set(t,(xo.get(t)??0)+1)}let Ha=0;function W0(){Ha=performance.now()}function H0(){const t=performance.now(),s=Ha?t-Ha:null;Ha=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-t+s;r>Bn.keypressMs&&hi("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-t)}ms)`)})}const V0=5e3,dg=500,jh=2e3;let _n=0,wu=!1;function q0(t){return pt("/perf-log",{entries:t}).then(()=>{_n+=t.length})}function G0(){if(wu||_n>=Wn.length)return;const t=Wn.slice(_n,_n+dg);t.length!==0&&(wu=!0,q0(t).catch(()=>{Wn.length-_n>jh&&(_n=Math.max(_n,Wn.length-jh))}).finally(()=>{wu=!1}))}function _h(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||_n>=Wn.length)return;const t=Wn.slice(_n,_n+dg);if(t.length!==0)try{const s=new Blob([JSON.stringify({entries:t})],{type:"application/json"});navigator.sendBeacon(`${dn()}/api/perf-log`,s),_n+=t.length}catch{}}function K0(){let t=0;for(const o of mi.values())t+=o.n;const s=[];if(t>0){const o=[...mi.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${ug(u.bytes)})`).join(", ");s.push(`ws ${t}/s [${o}]`)}pi>0&&s.push(`store ${pi}/s`);const r=[...gi.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");el("stat",o);const a=[...gi.values()].some(u=>u>Bn.renderPerSecLog);(t>Bn.wsPerSecLog||pi>Bn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}mi=new Map,pi=0,gi=new Map}function Y0(t){if(t instanceof Element){const s=t.id?`#${t.id}`:"",r=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/)[0]}`:"";return`${t.tagName.toLowerCase()}${s}${r}`}return t?"window":"unknown"}function X0(){if(xu||typeof window>"u")return()=>{};xu=!0,Qa=Date.now();const t=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>Bn.lagMs&&(td++,Za=Math.max(Za,f),hi("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(t.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=g=>{const m=g-u;u=g,m>Bn.frameGapMs&&hi("lag",`frame gap ${Math.round(m)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),t.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<Bn.longtaskBufferMs)continue;nd++,Ja=Math.max(Ja,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>=Bn.longtaskLogMs?hi("longtask",x,m):el("longtask",x,m)}});u.observe({type:"longtask",buffered:!1}),t.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;sd++;const v=`${h.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${Y0(h.target)}`;g>=Bn.eventLogMs?hi("input",v,g):el("input",v,g)}});u.observe({type:"event",durationThreshold:Bn.eventBufferMs}),t.push(()=>u.disconnect())}catch{}}const o=window.setInterval(K0,1e3);t.push(()=>window.clearInterval(o)),cg("perf logger session started");const a=window.setInterval(G0,V0);return t.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",_h),t.push(()=>window.removeEventListener("beforeunload",_h)),window.__agentPanePerf={dump:fg,reset:pg},()=>{t.forEach(u=>u()),xu=!1}}function fg(){const t=[],s=Qa?Math.round((Date.now()-Qa)/1e3):0;if(t.push("=== agent-pane perf report ==="),t.push(`uptime ${s}s · ${Wn.length} buffered entries`),t.push(`event-loop lag: ${td} blocks >${Bn.lagMs}ms (max ${Math.round(Za)}ms)`),t.push(`long tasks: ${nd} ≥${Bn.longtaskBufferMs}ms (max ${Math.round(Ja)}ms)`),t.push(`slow input events (≥${Bn.eventBufferMs}ms): ${sd}`),t.push(`store updates: ${rd} total`),yo.size>0){t.push("ws messages by type (top 15):");for(const[r,o]of[...yo.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))t.push(` ${r}: ${o.n} msgs, ${ug(o.bytes)}`)}if(xo.size>0){t.push("render counts by component:");for(const[r,o]of[...xo.entries()].sort((a,u)=>u[1]-a[1]))t.push(` ${r}: ${o}`)}t.push("--- last 200 entries ---");for(const r of Wn.slice(-200))t.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return t.join(`
|
|
49
|
-
`)}function pg(){Wn.length=0,_n=0,Qa=Date.now(),td=0,Za=0,nd=0,Ja=0,sd=0,rd=0,yo.clear(),xo.clear(),mi=new Map,pi=0,gi=new Map}const Ot={start:X0,note:cg,trackWsEvent:F0,trackStoreUpdate:U0,trackRender:B0,markKeystroke:W0,markInputChange:H0,dump:fg,reset:pg},L=gx()((...t)=>({...Xx(...t),...Qx(...t),...l0(...t),...b0(...t),...T0(...t),...N0(...t),...z0(...t)}));typeof window<"u"&&(L.subscribe(()=>Ot.trackStoreUpdate()),Hx(L));function Ou(t){switch(t){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 Q0(t,s,r=!1,o="working",a=0){if(o==="finished")return"";if(t==="interrupted")return"interrupted";if(s)return"running";if(a>0)return"background";if(r&&t!=="failed")return"queued";switch(t){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Z0(t,s,r=!1,o="working",a=0){if(o==="finished")return"Finished";if(t==="interrupted")return"Interrupted";if(s)return"Running";if(a>0)return"Background";if(r&&t!=="failed")return"Review Pending";switch(t){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return t}}function Sl(t,s=0){const r=t.is_running===1,o=t.lifecycle==="finished",a=Ou(t.runtime_type),u=Q0(t.status,r,t.has_unreviewed===1,t.lifecycle,s),f=Z0(t.status,r,t.has_unreviewed===1,t.lifecycle,s);return{dot:u,label:f,dotTitle:u==="background"?`${s} background task${s===1?"":"s"} running`:f,iconClass:a.iconClass,iconText:a.iconText,isRunning:r,isFinished:o,backgroundTaskCount:s}}function bl(t,s,r=!0){w.useEffect(()=>{if(!r)return;function o(a){t.current&&!t.current.contains(a.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[t,s,r])}function id(t,s=!0){w.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&t()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,s])}function od({status:t,size:s=6,title:r}){return l.jsx("span",{className:`status-dot ${t}`,style:s!==6?{width:s,height:s}:void 0,title:r})}function ad({iconClass:t,iconText:s,size:r=20}){return l.jsx("span",{className:`runtime-icon ${t}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
|
|
50
|
-
* @license lucide-react v0.469.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const J0=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hg=(...t)=>t.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
|
|
55
|
-
* @license lucide-react v0.469.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var ew={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
60
|
-
* @license lucide-react v0.469.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const mg=w.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},g)=>w.createElement("svg",{ref:g,...ew,width:s,height:s,stroke:t,strokeWidth:o?Number(r)*24/Number(s):r,className:hg("lucide",a),...h},[...f.map(([m,v])=>w.createElement(m,v)),...Array.isArray(u)?u:[u]]));/**
|
|
65
|
-
* @license lucide-react v0.469.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const ve=(t,s)=>{const r=w.forwardRef(({className:o,...a},u)=>w.createElement(mg,{ref:u,iconNode:s,className:hg(`lucide-${J0(t)}`,o),...a}));return r.displayName=`${t}`,r};/**
|
|
70
|
-
* @license lucide-react v0.469.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const tw=ve("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
75
|
-
* @license lucide-react v0.469.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const nw=ve("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
|
-
* @license lucide-react v0.469.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const dr=ve("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
85
|
-
* @license lucide-react v0.469.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const sw=ve("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
|
-
* @license lucide-react v0.469.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const Os=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
95
|
-
* @license lucide-react v0.469.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const vi=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
100
|
-
* @license lucide-react v0.469.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const ld=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
105
|
-
* @license lucide-react v0.469.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Tl=ve("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
110
|
-
* @license lucide-react v0.469.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const rw=ve("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
|
-
* @license lucide-react v0.469.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const tl=ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
120
|
-
* @license lucide-react v0.469.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const iw=ve("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
|
-
* @license lucide-react v0.469.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const ow=ve("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
130
|
-
* @license lucide-react v0.469.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const aw=ve("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
|
-
* @license lucide-react v0.469.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const gg=ve("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
|
-
* @license lucide-react v0.469.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const Eh=ve("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
145
|
-
* @license lucide-react v0.469.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const nl=ve("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
150
|
-
* @license lucide-react v0.469.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const lw=ve("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
155
|
-
* @license lucide-react v0.469.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const cw=ve("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"}]]);/**
|
|
160
|
-
* @license lucide-react v0.469.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const uw=ve("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"}]]);/**
|
|
165
|
-
* @license lucide-react v0.469.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const vg=ve("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
|
-
* @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 ku=ve("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
175
|
-
* @license lucide-react v0.469.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const $u=ve("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
180
|
-
* @license lucide-react v0.469.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const yg=ve("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
185
|
-
* @license lucide-react v0.469.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const dw=ve("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"}]]);/**
|
|
190
|
-
* @license lucide-react v0.469.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const fw=ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
195
|
-
* @license lucide-react v0.469.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const pw=ve("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"}]]);/**
|
|
200
|
-
* @license lucide-react v0.469.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const xg=ve("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"}]]);/**
|
|
205
|
-
* @license lucide-react v0.469.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const hw=ve("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"}]]);/**
|
|
210
|
-
* @license lucide-react v0.469.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const mw=ve("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"}]]);/**
|
|
215
|
-
* @license lucide-react v0.469.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const gw=ve("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"}]]);/**
|
|
220
|
-
* @license lucide-react v0.469.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const vw=ve("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"}]]);/**
|
|
225
|
-
* @license lucide-react v0.469.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const Jn=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
230
|
-
* @license lucide-react v0.469.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const yw=ve("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"}]]);/**
|
|
235
|
-
* @license lucide-react v0.469.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const xw=ve("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"}]]);/**
|
|
240
|
-
* @license lucide-react v0.469.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const wg=ve("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"}]]);/**
|
|
245
|
-
* @license lucide-react v0.469.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const ww=ve("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"}]]);/**
|
|
250
|
-
* @license lucide-react v0.469.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const Rh=ve("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
|
|
255
|
-
* @license lucide-react v0.469.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const kw=ve("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
260
|
-
* @license lucide-react v0.469.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const Sw=ve("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"}]]);/**
|
|
265
|
-
* @license lucide-react v0.469.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const bw=ve("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"}]]);/**
|
|
270
|
-
* @license lucide-react v0.469.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const Tw=ve("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
275
|
-
* @license lucide-react v0.469.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const Nw=ve("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"}]]);/**
|
|
280
|
-
* @license lucide-react v0.469.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const Va=ve("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
285
|
-
* @license lucide-react v0.469.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const Cw=ve("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"}]]);/**
|
|
290
|
-
* @license lucide-react v0.469.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const jw=ve("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"}]]);/**
|
|
295
|
-
* @license lucide-react v0.469.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const Dr=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
300
|
-
* @license lucide-react v0.469.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const kg=ve("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"}]]);/**
|
|
305
|
-
* @license lucide-react v0.469.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const _w=ve("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
310
|
-
* @license lucide-react v0.469.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const Ew=ve("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"}]]);/**
|
|
315
|
-
* @license lucide-react v0.469.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const wo=ve("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
320
|
-
* @license lucide-react v0.469.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const Sg=ve("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"}]]);/**
|
|
325
|
-
* @license lucide-react v0.469.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const bg=ve("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"}]]);/**
|
|
330
|
-
* @license lucide-react v0.469.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const Rw=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
335
|
-
* @license lucide-react v0.469.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const To=ve("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
340
|
-
* @license lucide-react v0.469.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const Aw=ve("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"}]]);/**
|
|
345
|
-
* @license lucide-react v0.469.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const Lr=ve("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
350
|
-
* @license lucide-react v0.469.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const sl=ve("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
355
|
-
* @license lucide-react v0.469.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const Tg=ve("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
360
|
-
* @license lucide-react v0.469.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const fs=ve("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"}]]);/**
|
|
365
|
-
* @license lucide-react v0.469.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const Iw=ve("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"}]]);/**
|
|
370
|
-
* @license lucide-react v0.469.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const Dw=ve("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"}]]);/**
|
|
375
|
-
* @license lucide-react v0.469.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const Mw=ve("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"}]]);/**
|
|
380
|
-
* @license lucide-react v0.469.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const Lw=ve("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"}]]);/**
|
|
385
|
-
* @license lucide-react v0.469.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const Ng=ve("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"}]]);/**
|
|
390
|
-
* @license lucide-react v0.469.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const Pw=ve("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"}]]);/**
|
|
395
|
-
* @license lucide-react v0.469.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const En=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
400
|
-
* @license lucide-react v0.469.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const Ow=ve("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"}]]),$w=new Set(["path","circle","rect","line","ellipse","polyline","polygon"]),zw=new Set("d cx cy r rx ry x y width height x1 x2 y1 y2 points fill".split(" "));function Fw(t){return t.filter(([s])=>$w.has(s)).map(([s,r],o)=>[s,{...Object.fromEntries(Object.entries(r).filter(([a])=>zw.has(a))),key:String(o)}])}function wi({iconNode:t,size:s=14,className:r}){const o=w.useMemo(()=>t?Fw(t):[],[t]);return o.length===0?l.jsx(xg,{size:s,className:r,"aria-hidden":"true","data-testid":"app-icon-default"}):l.jsx(mg,{iconNode:o,size:s,className:r,"aria-hidden":"true","data-testid":"app-icon"})}var co=Wm();function Uw(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return w.useMemo(()=>o=>{s.forEach(a=>a(o))},s)}const Nl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ki(t){const s=Object.prototype.toString.call(t);return s==="[object Window]"||s==="[object global]"}function cd(t){return"nodeType"in t}function xn(t){var s,r;return t?ki(t)?t:cd(t)&&(s=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function ud(t){const{Document:s}=xn(t);return t instanceof s}function No(t){return ki(t)?!1:t instanceof xn(t).HTMLElement}function Cg(t){return t instanceof xn(t).SVGElement}function Si(t){return t?ki(t)?t.document:cd(t)?ud(t)?t:No(t)||Cg(t)?t.ownerDocument:document:document:document}const ps=Nl?w.useLayoutEffect:w.useEffect;function Cl(t){const s=w.useRef(t);return ps(()=>{s.current=t}),w.useCallback(function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return s.current==null?void 0:s.current(...o)},[])}function Bw(){const t=w.useRef(null),s=w.useCallback((o,a)=>{t.current=setInterval(o,a)},[]),r=w.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[s,r]}function ko(t,s){s===void 0&&(s=[t]);const r=w.useRef(t);return ps(()=>{r.current!==t&&(r.current=t)},s),r}function Co(t,s){const r=w.useRef();return w.useMemo(()=>{const o=t(r.current);return r.current=o,o},[...s])}function rl(t){const s=Cl(t),r=w.useRef(null),o=w.useCallback(a=>{a!==r.current&&(s==null||s(a,r.current)),r.current=a},[]);return[r,o]}function il(t){const s=w.useRef();return w.useEffect(()=>{s.current=t},[t]),s.current}let Su={};function jo(t,s){return w.useMemo(()=>{if(s)return s;const r=Su[t]==null?0:Su[t]+1;return Su[t]=r,t+"-"+r},[t,s])}function jg(t){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;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+t*m)}return u},{...s})}}const yi=jg(1),ol=jg(-1);function Ww(t){return"clientX"in t&&"clientY"in t}function jl(t){if(!t)return!1;const{KeyboardEvent:s}=xn(t.target);return s&&t instanceof s}function Hw(t){if(!t)return!1;const{TouchEvent:s}=xn(t.target);return s&&t instanceof s}function al(t){if(Hw(t)){if(t.touches&&t.touches.length){const{clientX:s,clientY:r}=t.touches[0];return{x:s,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:s,clientY:r}=t.changedTouches[0];return{x:s,y:r}}}return Ww(t)?{x:t.clientX,y:t.clientY}:null}const $s=Object.freeze({Translate:{toString(t){if(!t)return;const{x:s,y:r}=t;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:s,scaleY:r}=t;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[$s.Translate.toString(t),$s.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:s,duration:r,easing:o}=t;return s+" "+r+"ms "+o}}}),Ah="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vw(t){return t.matches(Ah)?t:t.querySelector(Ah)}const qw={display:"none"};function Gw(t){let{id:s,value:r}=t;return it.createElement("div",{id:s,style:qw},r)}function Kw(t){let{id:s,announcement:r,ariaLiveType:o="assertive"}=t;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 it.createElement("div",{id:s,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function Yw(){const[t,s]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&s(o)},[]),announcement:t}}const _g=w.createContext(null);function Xw(t){const s=w.useContext(_g);w.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(t)},[t,s])}function Qw(){const[t]=w.useState(()=>new Set),s=w.useCallback(o=>(t.add(o),()=>t.delete(o)),[t]);return[w.useCallback(o=>{let{type:a,event:u}=o;t.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[t]),s]}const Zw={draggable:`
|
|
405
|
-
To pick up a draggable item, press the space bar.
|
|
406
|
-
While dragging, use the arrow keys to move the item.
|
|
407
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
408
|
-
`},Jw={onDragStart(t){let{active:s}=t;return"Picked up draggable item "+s.id+"."},onDragOver(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(t){let{active:s}=t;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function e1(t){let{announcements:s=Jw,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=Zw}=t;const{announce:u,announcement:f}=Yw(),h=jo("DndLiveRegion"),[g,m]=w.useState(!1);if(w.useEffect(()=>{m(!0)},[]),Xw(w.useMemo(()=>({onDragStart(k){let{active:x}=k;u(s.onDragStart({active:x}))},onDragMove(k){let{active:x,over:b}=k;s.onDragMove&&u(s.onDragMove({active:x,over:b}))},onDragOver(k){let{active:x,over:b}=k;u(s.onDragOver({active:x,over:b}))},onDragEnd(k){let{active:x,over:b}=k;u(s.onDragEnd({active:x,over:b}))},onDragCancel(k){let{active:x,over:b}=k;u(s.onDragCancel({active:x,over:b}))}}),[u,s])),!g)return null;const v=it.createElement(it.Fragment,null,it.createElement(Gw,{id:o,value:a.draggable}),it.createElement(Kw,{id:h,announcement:f}));return r?co.createPortal(v,r):v}var Wt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Wt||(Wt={}));function ll(){}function t1(t,s){return w.useMemo(()=>({sensor:t,options:s??{}}),[t,s])}function n1(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return w.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const hs=Object.freeze({x:0,y:0});function s1(t,s){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function r1(t,s){const r=al(t);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function i1(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return r-o}function o1(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return o-r}function a1(t,s){if(!t||t.length===0)return null;const[r]=t;return r[s]}function Ih(t,s,r){return s===void 0&&(s=t.left),r===void 0&&(r=t.top),{x:s+t.width*.5,y:r+t.height*.5}}const l1=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const a=Ih(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,g=r.get(h);if(g){const m=s1(Ih(g),a);u.push({id:h,data:{droppableContainer:f,value:m}})}}return u.sort(i1)};function c1(t,s){const r=Math.max(s.top,t.top),o=Math.max(s.left,t.left),a=Math.min(s.left+s.width,t.left+t.width),u=Math.min(s.top+s.height,t.top+t.height),f=a-o,h=u-r;if(o<a&&r<u){const g=s.width*s.height,m=t.width*t.height,v=f*h,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const u1=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const a=[];for(const u of o){const{id:f}=u,h=r.get(f);if(h){const g=c1(h,s);g>0&&a.push({id:f,data:{droppableContainer:u,value:g}})}}return a.sort(o1)};function d1(t,s,r){return{...t,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function Eg(t,s){return t&&s?{x:t.left-s.left,y:t.top-s.top}:hs}function f1(t){return function(r){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+t*h.y,bottom:f.bottom+t*h.y,left:f.left+t*h.x,right:f.right+t*h.x}),{...r})}}const p1=f1(1);function Rg(t){if(t.startsWith("matrix3d(")){const s=t.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(t.startsWith("matrix(")){const s=t.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function h1(t,s,r){const o=Rg(s);if(!o)return t;const{scaleX:a,scaleY:u,x:f,y:h}=o,g=t.left-f-(1-a)*parseFloat(r),m=t.top-h-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),v=a?t.width/a:t.width,k=u?t.height/u:t.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const m1={ignoreTransform:!1};function bi(t,s){s===void 0&&(s=m1);let r=t.getBoundingClientRect();if(s.ignoreTransform){const{transform:m,transformOrigin:v}=xn(t).getComputedStyle(t);m&&(r=h1(r,m,v))}const{top:o,left:a,width:u,height:f,bottom:h,right:g}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:g}}function Dh(t){return bi(t,{ignoreTransform:!0})}function g1(t){const s=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function v1(t,s){return s===void 0&&(s=xn(t).getComputedStyle(t)),s.position==="fixed"}function y1(t,s){s===void 0&&(s=xn(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=s[a];return typeof u=="string"?r.test(u):!1})}function dd(t,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(ud(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!No(a)||Cg(a)||r.includes(a))return r;const u=xn(t).getComputedStyle(a);return a!==t&&y1(a,u)&&r.push(a),v1(a,u)?r:o(a.parentNode)}return t?o(t):r}function Ag(t){const[s]=dd(t,1);return s??null}function bu(t){return!Nl||!t?null:ki(t)?t:cd(t)?ud(t)||t===Si(t).scrollingElement?window:No(t)?t:null:null}function Ig(t){return ki(t)?t.scrollX:t.scrollLeft}function Dg(t){return ki(t)?t.scrollY:t.scrollTop}function zu(t){return{x:Ig(t),y:Dg(t)}}var Jt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Jt||(Jt={}));function Mg(t){return!Nl||!t?!1:t===document.scrollingElement}function Lg(t){const s={x:0,y:0},r=Mg(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},a=t.scrollTop<=s.y,u=t.scrollLeft<=s.x,f=t.scrollTop>=o.y,h=t.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:s}}const x1={x:.2,y:.2};function w1(t,s,r,o,a){let{top:u,left:f,right:h,bottom:g}=r;o===void 0&&(o=10),a===void 0&&(a=x1);const{isTop:m,isBottom:v,isLeft:k,isRight:x}=Lg(t),b={x:0,y:0},j={x:0,y:0},_={height:s.height*a.y,width:s.width*a.x};return!m&&u<=s.top+_.height?(b.y=Jt.Backward,j.y=o*Math.abs((s.top+_.height-u)/_.height)):!v&&g>=s.bottom-_.height&&(b.y=Jt.Forward,j.y=o*Math.abs((s.bottom-_.height-g)/_.height)),!x&&h>=s.right-_.width?(b.x=Jt.Forward,j.x=o*Math.abs((s.right-_.width-h)/_.width)):!k&&f<=s.left+_.width&&(b.x=Jt.Backward,j.x=o*Math.abs((s.left+_.width-f)/_.width)),{direction:b,speed:j}}function k1(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:s,left:r,right:o,bottom:a}=t.getBoundingClientRect();return{top:s,left:r,right:o,bottom:a,width:t.clientWidth,height:t.clientHeight}}function Pg(t){return t.reduce((s,r)=>yi(s,zu(r)),hs)}function S1(t){return t.reduce((s,r)=>s+Ig(r),0)}function b1(t){return t.reduce((s,r)=>s+Dg(r),0)}function Og(t,s){if(s===void 0&&(s=bi),!t)return;const{top:r,left:o,bottom:a,right:u}=s(t);Ag(t)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const T1=[["x",["left","right"],S1],["y",["top","bottom"],b1]];class fd{constructor(s,r){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=dd(r),a=Pg(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of T1)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 po{constructor(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var a;(a=this.target)==null||a.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function N1(t){const{EventTarget:s}=xn(t);return t instanceof s?t:Si(t)}function Tu(t,s){const r=Math.abs(t.x),o=Math.abs(t.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var es;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(es||(es={}));function Mh(t){t.preventDefault()}function C1(t){t.stopPropagation()}var et;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(et||(et={}));const $g={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},j1=(t,s)=>{let{currentCoordinates:r}=s;switch(t.code){case et.Right:return{...r,x:r.x+25};case et.Left:return{...r,x:r.x-25};case et.Down:return{...r,y:r.y+25};case et.Up:return{...r,y:r.y-25}}};class zg{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new po(Si(r)),this.windowListeners=new po(xn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(es.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&Og(o),r(hs)}handleKeyDown(s){if(jl(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=$g,coordinateGetter:f=j1,scrollBehavior:h="smooth"}=a,{code:g}=s;if(u.end.includes(g)){this.handleEnd(s);return}if(u.cancel.includes(g)){this.handleCancel(s);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:hs;this.referenceCoordinates||(this.referenceCoordinates=v);const k=f(s,{active:r,context:o.current,currentCoordinates:v});if(k){const x=ol(k,v),b={x:0,y:0},{scrollableAncestors:j}=o.current;for(const _ of j){const T=s.code,{isTop:A,isRight:R,isLeft:U,isBottom:P,maxScroll:H,minScroll:Y}=Lg(_),K=k1(_),X={x:Math.min(T===et.Right?K.right-K.width/2:K.right,Math.max(T===et.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(T===et.Down?K.bottom-K.height/2:K.bottom,Math.max(T===et.Down?K.top:K.top+K.height/2,k.y))},de=T===et.Right&&!R||T===et.Left&&!U,he=T===et.Down&&!P||T===et.Up&&!A;if(de&&X.x!==k.x){const V=_.scrollLeft+x.x,Te=T===et.Right&&V<=H.x||T===et.Left&&V>=Y.x;if(Te&&!x.y){_.scrollTo({left:V,behavior:h});return}Te?b.x=_.scrollLeft-V:b.x=T===et.Right?_.scrollLeft-H.x:_.scrollLeft-Y.x,b.x&&_.scrollBy({left:-b.x,behavior:h});break}else if(he&&X.y!==k.y){const V=_.scrollTop+x.y,Te=T===et.Down&&V<=H.y||T===et.Up&&V>=Y.y;if(Te&&!x.x){_.scrollTo({top:V,behavior:h});return}Te?b.y=_.scrollTop-V:b.y=T===et.Down?_.scrollTop-H.y:_.scrollTop-Y.y,b.y&&_.scrollBy({top:-b.y,behavior:h});break}}this.handleMove(s,yi(ol(k,this.referenceCoordinates),b))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}zg.activators=[{eventName:"onKeyDown",handler:(t,s,r)=>{let{keyboardCodes:o=$g,onActivation:a}=s,{active:u}=r;const{code:f}=t.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&t.target!==h?!1:(t.preventDefault(),a==null||a({event:t.nativeEvent}),!0)}return!1}}];function Lh(t){return!!(t&&"distance"in t)}function Ph(t){return!!(t&&"delay"in t)}class pd{constructor(s,r,o){var a;o===void 0&&(o=N1(s.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=s,this.events=r;const{event:u}=s,{target:f}=u;this.props=s,this.events=r,this.document=Si(f),this.documentListeners=new po(this.document),this.listeners=new po(o),this.windowListeners=new po(xn(f)),this.initialCoordinates=(a=al(u))!=null?a:hs,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:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.DragStart,Mh),this.windowListeners.add(es.VisibilityChange,this.handleCancel),this.windowListeners.add(es.ContextMenu,Mh),this.documentListeners.add(es.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ph(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Lh(r)){this.handlePending(r);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(s,r){const{active:o,onPending:a}=this.props;a(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(es.Click,C1,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(es.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const g=(r=al(s))!=null?r:hs,m=ol(a,g);if(!o&&h){if(Lh(h)){if(h.tolerance!=null&&Tu(m,h.tolerance))return this.handleCancel();if(Tu(m,h.distance))return this.handleStart()}if(Ph(h)&&Tu(m,h.tolerance))return this.handleCancel();this.handlePending(h,m);return}s.cancelable&&s.preventDefault(),f(g)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===et.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const _1={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class hd extends pd{constructor(s){const{event:r}=s,o=Si(r.target);super(s,_1,o)}}hd.activators=[{eventName:"onPointerDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const E1={move:{name:"mousemove"},end:{name:"mouseup"}};var Fu;(function(t){t[t.RightClick=2]="RightClick"})(Fu||(Fu={}));class R1 extends pd{constructor(s){super(s,E1,Si(s.event.target))}}R1.activators=[{eventName:"onMouseDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return r.button===Fu.RightClick?!1:(o==null||o({event:r}),!0)}}];const Nu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class A1 extends pd{constructor(s){super(s,Nu)}static setup(){return window.addEventListener(Nu.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(Nu.move.name,s)};function s(){}}}A1.activators=[{eventName:"onTouchStart",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;const{touches:a}=r;return a.length>1?!1:(o==null||o({event:r}),!0)}}];var ho;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ho||(ho={}));var cl;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(cl||(cl={}));function I1(t){let{acceleration:s,activator:r=ho.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=cl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:x}=t;const b=M1({delta:k,disabled:!u}),[j,_]=Bw(),T=w.useRef({x:0,y:0}),A=w.useRef({x:0,y:0}),R=w.useMemo(()=>{switch(r){case ho.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ho.DraggableRect:return a}},[r,a,g]),U=w.useRef(null),P=w.useCallback(()=>{const Y=U.current;if(!Y)return;const K=T.current.x*A.current.x,X=T.current.y*A.current.y;Y.scrollBy(K,X)},[]),H=w.useMemo(()=>h===cl.TreeOrder?[...m].reverse():m,[h,m]);w.useEffect(()=>{if(!u||!m.length||!R){_();return}for(const Y of H){if((o==null?void 0:o(Y))===!1)continue;const K=m.indexOf(Y),X=v[K];if(!X)continue;const{direction:de,speed:he}=w1(Y,X,R,s,x);for(const V of["x","y"])b[V][de[V]]||(he[V]=0,de[V]=0);if(he.x>0||he.y>0){_(),U.current=Y,j(P,f),T.current=he,A.current=de;return}}T.current={x:0,y:0},A.current={x:0,y:0},_()},[s,P,o,_,u,f,JSON.stringify(R),JSON.stringify(b),j,m,H,v,JSON.stringify(x)])}const D1={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function M1(t){let{delta:s,disabled:r}=t;const o=il(s);return Co(a=>{if(r||!o||!a)return D1;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.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}}},[r,s,o])}function L1(t,s){const r=s!=null?t.get(s):void 0,o=r?r.node.current:null;return Co(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function P1(t,s){return w.useMemo(()=>t.reduce((r,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:s(f.handler,o)}));return[...r,...u]},[]),[t,s])}var So;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(So||(So={}));var Uu;(function(t){t.Optimized="optimized"})(Uu||(Uu={}));const Oh=new Map;function O1(t,s){let{dragging:r,dependencies:o,config:a}=s;const[u,f]=w.useState(null),{frequency:h,measure:g,strategy:m}=a,v=w.useRef(t),k=T(),x=ko(k),b=w.useCallback(function(A){A===void 0&&(A=[]),!x.current&&f(R=>R===null?A:R.concat(A.filter(U=>!R.includes(U))))},[x]),j=w.useRef(null),_=Co(A=>{if(k&&!r)return Oh;if(!A||A===Oh||v.current!==t||u!=null){const R=new Map;for(let U of t){if(!U)continue;if(u&&u.length>0&&!u.includes(U.id)&&U.rect.current){R.set(U.id,U.rect.current);continue}const P=U.node.current,H=P?new fd(g(P),P):null;U.rect.current=H,H&&R.set(U.id,H)}return R}return A},[t,u,r,k,g]);return w.useEffect(()=>{v.current=t},[t]),w.useEffect(()=>{k||b()},[r,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||j.current!==null||(j.current=setTimeout(()=>{b(),j.current=null},h))},[h,k,b,...o]),{droppableRects:_,measureDroppableContainers:b,measuringScheduled:u!=null};function T(){switch(m){case So.Always:return!1;case So.BeforeDragging:return r;default:return!r}}}function md(t,s){return Co(r=>t?r||(typeof s=="function"?s(t):t):null,[s,t])}function $1(t,s){return md(t,s)}function z1(t){let{callback:s,disabled:r}=t;const o=Cl(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function _l(t){let{callback:s,disabled:r}=t;const o=Cl(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function F1(t){return new fd(bi(t),t)}function $h(t,s,r){s===void 0&&(s=F1);const[o,a]=w.useState(null);function u(){a(g=>{if(!t)return null;if(t.isConnected===!1){var m;return(m=g??r)!=null?m:null}const v=s(t);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const f=z1({callback(g){if(t)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(t)){u();break}}}}),h=_l({callback:u});return ps(()=>{u(),t?(h==null||h.observe(t),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),f==null||f.disconnect())},[t]),o}function U1(t){const s=md(t);return Eg(t,s)}const zh=[];function B1(t){const s=w.useRef(t),r=Co(o=>t?o&&o!==zh&&t&&s.current&&t.parentNode===s.current.parentNode?o:dd(t):zh,[t]);return w.useEffect(()=>{s.current=t},[t]),r}function W1(t){const[s,r]=w.useState(null),o=w.useRef(t),a=w.useCallback(u=>{const f=bu(u.target);f&&r(h=>h?(h.set(f,zu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(t!==u){f(u);const h=t.map(g=>{const m=bu(g);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,zu(m)]):null}).filter(g=>g!=null);r(h.length?new Map(h):null),o.current=t}return()=>{f(t),f(u)};function f(h){h.forEach(g=>{const m=bu(g);m==null||m.removeEventListener("scroll",a)})}},[a,t]),w.useMemo(()=>t.length?s?Array.from(s.values()).reduce((u,f)=>yi(u,f),hs):Pg(t):hs,[t,s])}function Fh(t,s){s===void 0&&(s=[]);const r=w.useRef(null);return w.useEffect(()=>{r.current=null},s),w.useEffect(()=>{const o=t!==hs;o&&!r.current&&(r.current=t),!o&&r.current&&(r.current=null)},[t]),r.current?ol(t,r.current):hs}function H1(t){w.useEffect(()=>{if(!Nl)return;const s=t.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},t.map(s=>{let{sensor:r}=s;return r}))}function V1(t,s){return w.useMemo(()=>t.reduce((r,o)=>{let{eventName:a,handler:u}=o;return r[a]=f=>{u(f,s)},r},{}),[t,s])}function Fg(t){return w.useMemo(()=>t?g1(t):null,[t])}const Uh=[];function q1(t,s){s===void 0&&(s=bi);const[r]=t,o=Fg(r?xn(r):null),[a,u]=w.useState(Uh);function f(){u(()=>t.length?t.map(g=>Mg(g)?o:new fd(s(g),g)):Uh)}const h=_l({callback:f});return ps(()=>{h==null||h.disconnect(),f(),t.forEach(g=>h==null?void 0:h.observe(g))},[t]),a}function Ug(t){if(!t)return null;if(t.children.length>1)return t;const s=t.children[0];return No(s)?s:t}function G1(t){let{measure:s}=t;const[r,o]=w.useState(null),a=w.useCallback(m=>{for(const{target:v}of m)if(No(v)){o(k=>{const x=s(v);return k?{...k,width:x.width,height:x.height}:x});break}},[s]),u=_l({callback:a}),f=w.useCallback(m=>{const v=Ug(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?s(v):null)},[s,u]),[h,g]=rl(f);return w.useMemo(()=>({nodeRef:h,rect:r,setRef:g}),[r,h,g])}const K1=[{sensor:hd,options:{}},{sensor:zg,options:{}}],Y1={current:{}},qa={draggable:{measure:Dh},droppable:{measure:Dh,strategy:So.WhileDragging,frequency:Uu.Optimized},dragOverlay:{measure:bi}};class mo extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const X1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ll},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:qa,measureDroppableContainers:ll,windowRect:null,measuringScheduled:!1},Bg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ll,draggableNodes:new Map,over:null,measureDroppableContainers:ll},_o=w.createContext(Bg),Wg=w.createContext(X1);function Q1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mo}}}function Z1(t,s){switch(s.type){case Wt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Wt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:s.coordinates.x-t.draggable.initialCoordinates.x,y:s.coordinates.y-t.draggable.initialCoordinates.y}}};case Wt.DragEnd:case Wt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new mo(t.droppable.containers);return a.set(o,r),{...t,droppable:{...t.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:r,key:o,disabled:a}=s,u=t.droppable.containers.get(r);if(!u||o!==u.key)return t;const f=new mo(t.droppable.containers);return f.set(r,{...u,disabled:a}),{...t,droppable:{...t.droppable,containers:f}}}case Wt.UnregisterDroppable:{const{id:r,key:o}=s,a=t.droppable.containers.get(r);if(!a||o!==a.key)return t;const u=new mo(t.droppable.containers);return u.delete(r),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function J1(t){let{disabled:s}=t;const{active:r,activatorEvent:o,draggableNodes:a}=w.useContext(_o),u=il(o),f=il(r==null?void 0:r.id);return w.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!jl(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=Vw(v);if(k){k.focus();break}}})}},[o,s,a,f,u]),null}function Hg(t,s){let{transform:r,...o}=s;return t!=null&&t.length?t.reduce((a,u)=>u({transform:a,...o}),r):r}function ek(t){return w.useMemo(()=>({draggable:{...qa.draggable,...t==null?void 0:t.draggable},droppable:{...qa.droppable,...t==null?void 0:t.droppable},dragOverlay:{...qa.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function tk(t){let{activeNode:s,measure:r,initialRect:o,config:a=!0}=t;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;ps(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const m=s==null?void 0:s.node.current;if(!m||m.isConnected===!1)return;const v=r(m),k=Eg(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=Ag(m);x&&x.scrollBy({top:k.y,left:k.x})}},[s,f,h,o,r])}const El=w.createContext({...hs,scaleX:1,scaleY:1});var lr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(lr||(lr={}));const nk=w.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:g=!0,children:m,sensors:v=K1,collisionDetection:k=u1,measuring:x,modifiers:b,...j}=s;const _=w.useReducer(Z1,void 0,Q1),[T,A]=_,[R,U]=Qw(),[P,H]=w.useState(lr.Uninitialized),Y=P===lr.Initialized,{draggable:{active:K,nodes:X,translate:de},droppable:{containers:he}}=T,V=K!=null?X.get(K):null,Te=w.useRef({initial:null,translated:null}),Ne=w.useMemo(()=>{var st;return K!=null?{id:K,data:(st=V==null?void 0:V.data)!=null?st:Y1,rect:Te}:null},[K,V]),Le=w.useRef(null),[te,se]=w.useState(null),[ie,O]=w.useState(null),Q=ko(j,Object.values(j)),F=jo("DndDescribedBy",f),C=w.useMemo(()=>he.getEnabled(),[he]),D=ek(x),{droppableRects:oe,measureDroppableContainers:G,measuringScheduled:ue}=O1(C,{dragging:Y,dependencies:[de.x,de.y],config:D.droppable}),fe=L1(X,K),Pe=w.useMemo(()=>ie?al(ie):null,[ie]),Ce=Vt(),Ee=$1(fe,D.draggable.measure);tk({activeNode:K!=null?X.get(K):null,config:Ce.layoutShiftCompensation,initialRect:Ee,measure:D.draggable.measure});const _e=$h(fe,D.draggable.measure,Ee),ot=$h(fe?fe.parentElement:null),je=w.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:X,draggingNode:null,draggingNodeRect:null,droppableContainers:he,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=he.getNodeFor((r=je.current.over)==null?void 0:r.id),ze=G1({measure:D.dragOverlay.measure}),It=(o=ze.nodeRef.current)!=null?o:fe,Fe=Y?(a=ze.rect)!=null?a:_e:null,Dt=!!(ze.nodeRef.current&&ze.rect),Rn=U1(Dt?null:_e),St=Fg(It?xn(It):null),Mt=B1(Y?kt??fe:null),ht=q1(Mt),en=Hg(b,{transform:{x:de.x-Rn.x,y:de.y-Rn.y,scaleX:1,scaleY:1},activatorEvent:ie,active:Ne,activeNodeRect:_e,containerNodeRect:ot,draggingNodeRect:Fe,over:je.current.over,overlayNodeRect:ze.rect,scrollableAncestors:Mt,scrollableAncestorRects:ht,windowRect:St}),q=Pe?yi(Pe,de):null,pe=W1(Mt),Ue=Fh(pe),tt=Fh(pe,[_e]),mt=yi(en,Ue),gt=Fe?p1(Fe,en):null,Rt=Ne&>?k({active:Ne,collisionRect:gt,droppableRects:oe,droppableContainers:C,pointerCoordinates:q}):null,Ht=a1(Rt,"id"),[ut,An]=w.useState(null),Hn=Dt?en:yi(en,tt),Ts=d1(Hn,(u=ut==null?void 0:ut.rect)!=null?u:null,_e),ms=w.useRef(null),In=w.useCallback((st,vt)=>{let{sensor:yt,options:qt}=vt;if(Le.current==null)return;const bt=X.get(Le.current);if(!bt)return;const xt=st.nativeEvent,at=new yt({active:Le.current,activeNode:bt,event:xt,options:qt,context:je,onAbort(Je){if(!X.get(Je))return;const{onDragAbort:ae}=Q.current,re={id:Je};ae==null||ae(re),R({type:"onDragAbort",event:re})},onPending(Je,E,ae,re){if(!X.get(Je))return;const{onDragPending:$e}=Q.current,Be={id:Je,constraint:E,initialCoordinates:ae,offset:re};$e==null||$e(Be),R({type:"onDragPending",event:Be})},onStart(Je){const E=Le.current;if(E==null)return;const ae=X.get(E);if(!ae)return;const{onDragStart:re}=Q.current,ge={activatorEvent:xt,active:{id:E,data:ae.data,rect:Te}};co.unstable_batchedUpdates(()=>{re==null||re(ge),H(lr.Initializing),A({type:Wt.DragStart,initialCoordinates:Je,active:E}),R({type:"onDragStart",event:ge}),se(ms.current),O(xt)})},onMove(Je){A({type:Wt.DragMove,coordinates:Je})},onEnd:Gt(Wt.DragEnd),onCancel:Gt(Wt.DragCancel)});ms.current=at;function Gt(Je){return async function(){const{active:ae,collisions:re,over:ge,scrollAdjustedTranslate:$e}=je.current;let Be=null;if(ae&&$e){const{cancelDrop:De}=Q.current;Be={activatorEvent:xt,active:ae,collisions:re,delta:$e,over:ge},Je===Wt.DragEnd&&typeof De=="function"&&await Promise.resolve(De(Be))&&(Je=Wt.DragCancel)}Le.current=null,co.unstable_batchedUpdates(()=>{A({type:Je}),H(lr.Uninitialized),An(null),se(null),O(null),ms.current=null;const De=Je===Wt.DragEnd?"onDragEnd":"onDragCancel";if(Be){const lt=Q.current[De];lt==null||lt(Be),R({type:De,event:Be})}})}}},[X]),Dn=w.useCallback((st,vt)=>(yt,qt)=>{const bt=yt.nativeEvent,xt=X.get(qt);if(Le.current!==null||!xt||bt.dndKit||bt.defaultPrevented)return;const at={active:xt};st(yt,vt.options,at)===!0&&(bt.dndKit={capturedBy:vt.sensor},Le.current=qt,In(yt,vt))},[X,In]),pn=P1(v,Dn);H1(v),ps(()=>{_e&&P===lr.Initializing&&H(lr.Initialized)},[_e,P]),w.useEffect(()=>{const{onDragMove:st}=Q.current,{active:vt,activatorEvent:yt,collisions:qt,over:bt}=je.current;if(!vt||!yt)return;const xt={active:vt,activatorEvent:yt,collisions:qt,delta:{x:mt.x,y:mt.y},over:bt};co.unstable_batchedUpdates(()=>{st==null||st(xt),R({type:"onDragMove",event:xt})})},[mt.x,mt.y]),w.useEffect(()=>{const{active:st,activatorEvent:vt,collisions:yt,droppableContainers:qt,scrollAdjustedTranslate:bt}=je.current;if(!st||Le.current==null||!vt||!bt)return;const{onDragOver:xt}=Q.current,at=qt.get(Ht),Gt=at&&at.rect.current?{id:at.id,rect:at.rect.current,data:at.data,disabled:at.disabled}:null,Je={active:st,activatorEvent:vt,collisions:yt,delta:{x:bt.x,y:bt.y},over:Gt};co.unstable_batchedUpdates(()=>{An(Gt),xt==null||xt(Je),R({type:"onDragOver",event:Je})})},[Ht]),ps(()=>{je.current={activatorEvent:ie,active:Ne,activeNode:fe,collisionRect:gt,collisions:Rt,droppableRects:oe,draggableNodes:X,draggingNode:It,draggingNodeRect:Fe,droppableContainers:he,over:ut,scrollableAncestors:Mt,scrollAdjustedTranslate:mt},Te.current={initial:Fe,translated:gt}},[Ne,fe,Rt,gt,X,It,Fe,oe,he,ut,Mt,mt]),I1({...Ce,delta:de,draggingRect:gt,pointerCoordinates:q,scrollableAncestors:Mt,scrollableAncestorRects:ht});const wn=w.useMemo(()=>({active:Ne,activeNode:fe,activeNodeRect:_e,activatorEvent:ie,collisions:Rt,containerNodeRect:ot,dragOverlay:ze,draggableNodes:X,droppableContainers:he,droppableRects:oe,over:ut,measureDroppableContainers:G,scrollableAncestors:Mt,scrollableAncestorRects:ht,measuringConfiguration:D,measuringScheduled:ue,windowRect:St}),[Ne,fe,_e,ie,Rt,ot,ze,X,he,oe,ut,G,Mt,ht,D,ue,St]),Ft=w.useMemo(()=>({activatorEvent:ie,activators:pn,active:Ne,activeNodeRect:_e,ariaDescribedById:{draggable:F},dispatch:A,draggableNodes:X,over:ut,measureDroppableContainers:G}),[ie,pn,Ne,_e,A,F,X,ut,G]);return it.createElement(_g.Provider,{value:U},it.createElement(_o.Provider,{value:Ft},it.createElement(Wg.Provider,{value:wn},it.createElement(El.Provider,{value:Ts},m)),it.createElement(J1,{disabled:(h==null?void 0:h.restoreFocus)===!1})),it.createElement(e1,{...h,hiddenTextDescribedById:F}));function Vt(){const st=(te==null?void 0:te.autoScrollEnabled)===!1,vt=typeof g=="object"?g.enabled===!1:g===!1,yt=Y&&!st&&!vt;return typeof g=="object"?{...g,enabled:yt}:{enabled:yt}}}),sk=w.createContext(null),Bh="button",rk="Draggable";function ik(t){let{id:s,data:r,disabled:o=!1,attributes:a}=t;const u=jo(rk),{activators:f,activatorEvent:h,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:x}=w.useContext(_o),{role:b=Bh,roleDescription:j="draggable",tabIndex:_=0}=a??{},T=(g==null?void 0:g.id)===s,A=w.useContext(T?El:sk),[R,U]=rl(),[P,H]=rl(),Y=V1(f,s),K=ko(r);ps(()=>(k.set(s,{id:s,key:u,node:R,activatorNode:P,data:K}),()=>{const de=k.get(s);de&&de.key===u&&k.delete(s)}),[k,s]);const X=w.useMemo(()=>({role:b,tabIndex:_,"aria-disabled":o,"aria-pressed":T&&b===Bh?!0:void 0,"aria-roledescription":j,"aria-describedby":v.draggable}),[o,b,_,T,j,v.draggable]);return{active:g,activatorEvent:h,activeNodeRect:m,attributes:X,isDragging:T,listeners:o?void 0:Y,node:R,over:x,setNodeRef:U,setActivatorNodeRef:H,transform:A}}function Vg(){return w.useContext(Wg)}const ok="Droppable",ak={timeout:25};function qg(t){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=t;const u=jo(ok),{active:f,dispatch:h,over:g,measureDroppableContainers:m}=w.useContext(_o),v=w.useRef({disabled:r}),k=w.useRef(!1),x=w.useRef(null),b=w.useRef(null),{disabled:j,updateMeasurementsFor:_,timeout:T}={...ak,...a},A=ko(_??o),R=w.useCallback(()=>{if(!k.current){k.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(A.current)?A.current:[A.current]),b.current=null},T)},[T]),U=_l({callback:R,disabled:j||!f}),P=w.useCallback((X,de)=>{U&&(de&&(U.unobserve(de),k.current=!1),X&&U.observe(X))},[U]),[H,Y]=rl(P),K=ko(s);return w.useEffect(()=>{!U||!H.current||(U.disconnect(),k.current=!1,U.observe(H.current))},[H,U]),w.useEffect(()=>(h({type:Wt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:H,rect:x,data:K}}),()=>h({type:Wt.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{r!==v.current.disabled&&(h({type:Wt.SetDroppableDisabled,id:o,key:u,disabled:r}),v.current.disabled=r)},[o,u,r,h]),{active:f,rect:x,isOver:(g==null?void 0:g.id)===o,node:H,over:g,setNodeRef:Y}}function lk(t){let{animation:s,children:r}=t;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=il(r);return!r&&!o&&h&&a(h),ps(()=>{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(s(m,u)).then(()=>{a(null)})},[s,o,u]),it.createElement(it.Fragment,null,r,o?w.cloneElement(o,{ref:f}):null)}const ck={x:0,y:0,scaleX:1,scaleY:1};function uk(t){let{children:s}=t;return it.createElement(_o.Provider,{value:Bg},it.createElement(El.Provider,{value:ck},s))}const dk={position:"fixed",touchAction:"none"},fk=t=>jl(t)?"transform 250ms ease":void 0,pk=w.forwardRef((t,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:g,transform:m,transition:v=fk}=t;if(!h)return null;const k=a?m:{...m,scaleX:1,scaleY:1},x={...dk,width:h.width,height:h.height,top:h.top,left:h.left,transform:$s.Transform.toString(k),transformOrigin:a&&o?r1(o,h):void 0,transition:typeof v=="function"?v(o):v,...g};return it.createElement(r,{className:f,style:x,ref:s},u)}),hk=t=>s=>{let{active:r,dragOverlay:o}=s;const a={},{styles:u,className:f}=t;if(u!=null&&u.active)for(const[h,g]of Object.entries(u.active))g!==void 0&&(a[h]=r.node.style.getPropertyValue(h),r.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&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[g,m]of Object.entries(a))r.node.style.setProperty(g,m);f!=null&&f.active&&r.node.classList.remove(f.active)}},mk=t=>{let{transform:{initial:s,final:r}}=t;return[{transform:$s.Transform.toString(s)},{transform:$s.Transform.toString(r)}]},gk={duration:250,easing:"ease",keyframes:mk,sideEffects:hk({styles:{active:{opacity:"0"}}})};function vk(t){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=t;return Cl((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const g=h.node.current;if(!g)return;const m=Ug(f);if(!m)return;const{transform:v}=xn(f).getComputedStyle(f),k=Rg(v);if(!k)return;const x=typeof s=="function"?s:yk(s);return Og(g,a.draggable.measure),x({active:{id:u,data:h.data,node:g,rect:a.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function yk(t){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...gk,...t};return u=>{let{active:f,dragOverlay:h,transform:g,...m}=u;if(!s)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}}),[j]=b,_=b[b.length-1];if(JSON.stringify(j)===JSON.stringify(_))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...m}),A=h.node.animate(b,{duration:s,easing:r,fill:"forwards"});return new Promise(R=>{A.onfinish=()=>{T==null||T(),R()}})}}let Wh=0;function xk(t){return w.useMemo(()=>{if(t!=null)return Wh++,Wh},[t])}const wk=it.memo(t=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:g,zIndex:m=999}=t;const{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:b,draggableNodes:j,droppableContainers:_,dragOverlay:T,over:A,measuringConfiguration:R,scrollableAncestors:U,scrollableAncestorRects:P,windowRect:H}=Vg(),Y=w.useContext(El),K=xk(k==null?void 0:k.id),X=Hg(f,{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:b,draggingNodeRect:T.rect,over:A,overlayNodeRect:T.rect,scrollableAncestors:U,scrollableAncestorRects:P,transform:Y,windowRect:H}),de=md(x),he=vk({config:o,draggableNodes:j,droppableContainers:_,measuringConfiguration:R}),V=de?T.setRef:void 0;return it.createElement(uk,null,it.createElement(lk,{animation:he},k&&K?it.createElement(pk,{key:K,id:k.id,ref:V,as:h,activatorEvent:v,adjustScale:s,className:g,transition:u,rect:de,style:{zIndex:m,...a},transform:X},r):null))});function Gg(t,s,r){const o=t.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function kk(t,s){return t.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(t.length))}function La(t){return t!==null&&t>=0}function Sk(t,s){if(t===s)return!0;if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==s[r])return!1;return!0}function bk(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Kg=t=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=t;const u=Gg(s,o,r),f=s[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}},Pa={scaleX:1,scaleY:1},Hh=t=>{var s;let{activeIndex:r,activeNodeRect:o,index:a,rects:u,overIndex:f}=t;const h=(s=u[r])!=null?s:o;if(!h)return null;if(a===r){const m=u[f];return m?{x:0,y:r<f?m.top+m.height-(h.top+h.height):m.top-h.top,...Pa}:null}const g=Tk(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-g,...Pa}:a<r&&a>=f?{x:0,y:h.height+g,...Pa}:{x:0,y:0,...Pa}};function Tk(t,s,r){const o=t[s],a=t[s-1],u=t[s+1];return o?r<s?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 Yg="Sortable",Xg=it.createContext({activeIndex:-1,containerId:Yg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Kg,disabled:{draggable:!1,droppable:!1}});function Vh(t){let{children:s,id:r,items:o,strategy:a=Kg,disabled:u=!1}=t;const{active:f,dragOverlay:h,droppableRects:g,over:m,measureDroppableContainers:v}=Vg(),k=jo(Yg,r),x=h.rect!==null,b=w.useMemo(()=>o.map(Y=>typeof Y=="object"&&"id"in Y?Y.id:Y),[o]),j=f!=null,_=f?b.indexOf(f.id):-1,T=m?b.indexOf(m.id):-1,A=w.useRef(b),R=!Sk(b,A.current),U=T!==-1&&_===-1||R,P=bk(u);ps(()=>{R&&j&&v(b)},[R,b,j,v]),w.useEffect(()=>{A.current=b},[b]);const H=w.useMemo(()=>({activeIndex:_,containerId:k,disabled:P,disableTransforms:U,items:b,overIndex:T,useDragOverlay:x,sortedRects:kk(b,g),strategy:a}),[_,k,P.draggable,P.droppable,U,b,T,g,x,a]);return it.createElement(Xg.Provider,{value:H},s)}const Nk=t=>{let{id:s,items:r,activeIndex:o,overIndex:a}=t;return Gg(r,o,a).indexOf(s)},Ck=t=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:g,transition:m}=t;return!m||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===g},jk={duration:200,easing:"ease"},Qg="transform",_k=$s.Transition.toString({property:Qg,duration:0,easing:"linear"}),Ek={roleDescription:"sortable"};function Rk(t){let{disabled:s,index:r,node:o,rect:a}=t;const[u,f]=w.useState(null),h=w.useRef(r);return ps(()=>{if(!s&&r!==h.current&&o.current){const g=a.current;if(g){const m=bi(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)}}r!==h.current&&(h.current=r)},[s,r,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function Zg(t){let{animateLayoutChanges:s=Ck,attributes:r,disabled:o,data:a,getNewIndex:u=Nk,id:f,strategy:h,resizeObserverConfig:g,transition:m=jk}=t;const{items:v,containerId:k,activeIndex:x,disabled:b,disableTransforms:j,sortedRects:_,overIndex:T,useDragOverlay:A,strategy:R}=w.useContext(Xg),U=Ak(o,b),P=v.indexOf(f),H=w.useMemo(()=>({sortable:{containerId:k,index:P,items:v},...a}),[k,a,P,v]),Y=w.useMemo(()=>v.slice(v.indexOf(f)),[v,f]),{rect:K,node:X,isOver:de,setNodeRef:he}=qg({id:f,data:H,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:Y,...g}}),{active:V,activatorEvent:Te,activeNodeRect:Ne,attributes:Le,setNodeRef:te,listeners:se,isDragging:ie,over:O,setActivatorNodeRef:Q,transform:F}=ik({id:f,data:H,attributes:{...Ek,...r},disabled:U.draggable}),C=Uw(he,te),D=!!V,oe=D&&!j&&La(x)&&La(T),G=!A&&ie,ue=G&&oe?F:null,Pe=oe?ue??(h??R)({rects:_,activeNodeRect:Ne,activeIndex:x,overIndex:T,index:P}):null,Ce=La(x)&&La(T)?u({id:f,items:v,activeIndex:x,overIndex:T}):P,Ee=V==null?void 0:V.id,_e=w.useRef({activeId:Ee,items:v,newIndex:Ce,containerId:k}),ot=v!==_e.current.items,je=s({active:V,containerId:k,isDragging:ie,isSorting:D,id:f,index:P,items:v,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:m,wasDragging:_e.current.activeId!=null}),kt=Rk({disabled:!je,index:P,node:X,rect:K});return w.useEffect(()=>{D&&_e.current.newIndex!==Ce&&(_e.current.newIndex=Ce),k!==_e.current.containerId&&(_e.current.containerId=k),v!==_e.current.items&&(_e.current.items=v)},[D,Ce,k,v]),w.useEffect(()=>{if(Ee===_e.current.activeId)return;if(Ee!=null&&_e.current.activeId==null){_e.current.activeId=Ee;return}const It=setTimeout(()=>{_e.current.activeId=Ee},50);return()=>clearTimeout(It)},[Ee]),{active:V,activeIndex:x,attributes:Le,data:H,rect:K,index:P,newIndex:Ce,items:v,isOver:de,isSorting:D,isDragging:ie,listeners:se,node:X,overIndex:T,over:O,setNodeRef:C,setActivatorNodeRef:Q,setDroppableNodeRef:he,setDraggableNodeRef:te,transform:kt??Pe,transition:ze()};function ze(){if(kt||ot&&_e.current.newIndex===P)return _k;if(!(G&&!jl(Te)||!m)&&(D||je))return $s.Transition.toString({...m,property:Qg})}}function Ak(t,s){var r,o;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:s.draggable,droppable:(o=t==null?void 0:t.droppable)!=null?o:s.droppable}}et.Down,et.Right,et.Up,et.Left;function Oa(t){const[s,r]=w.useState(()=>{try{const a=localStorage.getItem(t);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=>{r(u=>{const f=a(new Set(u));try{localStorage.setItem(t,JSON.stringify([...f]))}catch{}return f})},[t]);return[s,o]}function Ik(t,s=!1){const[r,o]=w.useState(()=>{try{const u=localStorage.getItem(t);return u==="1"?!0:u==="0"?!1:s}catch{return s}}),a=w.useCallback(u=>{o(u);try{localStorage.setItem(t,u?"1":"0")}catch{}},[t]);return[r,a]}async function ul(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const s=document.createElement("textarea");s.value=t,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function Dk(t){return t.origin_app_id!=null&&!t.user_touched&&!t.starred}function dl(t){return t.replaceAll("\\","/").replace(/\/+$/,"")}function qh(t,s){if(!s||!t.cwd)return!1;const r=dl(t.cwd),o=dl(s);return r.startsWith(`${o}/`)}function Mk(t,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",g=r.get(h)??[];g.push(f),r.set(h,g)}const o=new Set,a=new Set(t.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of t){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:r.get(f.path)??[],workspace:f})}for(const[f,h]of r)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 fl(t){return[...t].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function Gh(t,s,r,o){const a=s.map(u=>({folder:u,sessions:t.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:t.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${t.path}:finished`,hidden:!1}),a}function Kh(t,s){return{working:fl(t.sessions.filter(r=>r.lifecycle!=="finished")),finished:fl(t.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(t.finishedKey)}}function $a(t,s){return t.folder_id&&s.has(t.folder_id)?t.folder_id:null}function Lk(t){const s=new Set(t.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function Yh({id:t,children:s,className:r}){const{setNodeRef:o,isOver:a}=qg({id:t});return l.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function gd({inputRef:t,value:s,onChange:r,onConfirm:o,onCancel:a}){return l.jsx("input",{ref:t,className:"tree-rename-input",value:s,onChange:u=>r(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function Pk({s:t,backgroundTaskCount:s,isActive:r,isSelected:o,originApp:a,renaming:u,renameValue:f,renameRef:h,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:x,onToggleStar:b}){const{attributes:j,listeners:_,setNodeRef:T,transform:A,transition:R,isDragging:U}=Zg({id:`s:${t.id}`}),P=Sl(t,s);return l.jsxs("div",{ref:T,style:{transform:$s.Transform.toString(A),transition:R},className:`tree-item ${r?"active":""}${o?" selected":""} ${P.isFinished?"tree-item-finished":""}${U?" dragging":""}${t.starred?" tree-item-starred":""}`,...j,..._,onClick:k,onContextMenu:x,children:[l.jsx(ad,{iconClass:P.iconClass,iconText:P.iconText,size:16}),a&&l.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:l.jsx(wi,{iconNode:a.iconNode,size:10})}),u?l.jsx(gd,{inputRef:h,value:f,onChange:g,onConfirm:m,onCancel:v}):l.jsx("span",{className:"tree-label",children:t.title||t.id.slice(0,8)}),!u&&l.jsx("button",{className:`star-btn${t.starred?" starred":""}`,title:t.starred?"Unstar session":"Star session",onClick:H=>{H.stopPropagation(),b()},onPointerDown:H=>H.stopPropagation(),children:l.jsx(sl,{size:10,fill:t.starred?"currentColor":"none"})}),P.dot&&l.jsx(od,{status:P.dot,title:P.dotTitle})]})}function Ok({folder:t,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:x,listeners:b,setNodeRef:j,transform:_,transition:T,isDragging:A,over:R}=Zg({id:`f:${t.id}`}),U=R!=null&&String(R.id).startsWith("s:");return l.jsxs("div",{ref:j,style:{transform:$s.Transform.toString(_),transition:T},className:`tree-folder ${r?"collapsed":""}${A?" dragging":""}`,children:[l.jsx("div",{className:`tree-folder-header${U?" drop-over":""}`,...x,...b,onClick:()=>{o||m()},onContextMenu:v,children:o?l.jsx(gd,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:g}):l.jsxs(l.Fragment,{children:[l.jsx(vi,{size:8,className:"tree-chevron"}),l.jsx($u,{size:12}),l.jsx("span",{className:"tree-folder-label",children:t.name}),l.jsx("span",{className:"tree-count",children:s})]})}),!r&&l.jsx("div",{className:"tree-folder-children",children:k})]})}function $k(){const t=L(E=>E.sessions),s=L(E=>E.backgroundTasks),r=L(E=>E.workspaces),o=L(E=>E.folders),a=L(E=>E.activeSessionId),u=L(E=>E.selectSession),f=L(E=>E.deleteSession),h=L(E=>E.removeWorkspace),g=L(E=>E.createSessionInWorkspace),m=L(E=>E.pickAndAddWorkspace),v=L(E=>E.renameSession),k=L(E=>E.markFinished),x=L(E=>E.markFinishedMany),b=L(E=>E.toggleStar),j=L(E=>E.reopenSession),_=L(E=>E.reopenSessionMany),T=L(E=>E.deleteSessionMany),A=L(E=>E.createSidebarFolder),R=L(E=>E.renameFolder),U=L(E=>E.deleteFolder),P=L(E=>E.applyMoves),H=L(E=>E.reorderFolders),Y=L(E=>E.apps),K=L(E=>E.appsRootPath),X=L(E=>E.activeAppTabId),de=L(E=>E.openAppTab),he=L(E=>E.startAppEdit),V=L(E=>E.toggleAppPin),Te=L(E=>E.deleteApp),Ne=L(E=>E.openAppCatalog),[Le,te]=Oa("agentpane:sidebar-ws-collapsed"),[se,ie]=Oa("agentpane:sidebar-sub-collapsed"),[O,Q]=Oa("agentpane:sidebar-folders-collapsed"),[F,C]=Oa("agentpane:sidebar-app-edits-collapsed"),[D,oe]=Ik("agentpane:sidebar-hide-auto-sessions"),[G,ue]=w.useState(null),[fe,Pe]=w.useState(null),[Ce,Ee]=w.useState(""),[_e,ot]=w.useState(null),[je,kt]=w.useState(new Set),[ze,It]=w.useState(null),Fe=w.useRef(null),Dt=w.useRef(null),Rn=w.useRef(null),St=w.useRef(!1),Mt=n1(t1(hd,{activationConstraint:{distance:5}}));function ht(){kt(new Set),It(null)}bl(Fe,()=>ue(null),!!G),id(()=>{ue(null),ht()},!!G||je.size>0),w.useLayoutEffect(()=>{const E=Fe.current;if(!G||!E)return;const ae=8,{offsetWidth:re,offsetHeight:ge}=E,$e=G.x+re>window.innerWidth-ae?Math.max(ae,G.x-re):G.x,Be=G.y+ge>window.innerHeight-ae?Math.max(ae,G.y-ge):G.y;E.style.left=`${$e}px`,E.style.top=`${Be}px`},[G]);const en=w.useMemo(()=>new Map(t.map(E=>[E.id,E])),[t]),q=w.useMemo(()=>new Map(o.map(E=>[E.id,E])),[o]),pe=w.useMemo(()=>{const E=new Map;for(const ae of[...o].sort((re,ge)=>re.sort_order-ge.sort_order)){const re=E.get(ae.workspace_path)??[];re.push(ae),E.set(ae.workspace_path,re)}return E},[o]);function Ue(E){te(ae=>{const re=new Set(ae);return re.has(E)?re.delete(E):re.add(E),re})}function tt(E){ie(ae=>{const re=new Set(ae);return re.has(E)?re.delete(E):re.add(E),re})}function mt(E){Q(ae=>{const re=new Set(ae);return re.has(E)?re.delete(E):re.add(E),re})}function gt(){oe(!D),ht()}function Rt(E){C(ae=>{const re=new Set(ae);return re.has(E)?re.delete(E):re.add(E),re})}w.useEffect(()=>{fe&&Dt.current&&(Dt.current.focus(),Dt.current.select())},[fe]),w.useEffect(()=>{var E,ae,re;St.current||!a||(St.current=!0,(re=(ae=(E=Rn.current)==null?void 0:E.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:ae.scrollIntoView)==null||re.call(ae,{block:"nearest"}))},[a]);function Ht(E,ae,re,ge=""){Pe({kind:E,id:ae}),Ee(re||ge)}function ut(){if(fe){const E=Ce.trim();E&&(fe.kind==="session"?v(fe.id,E):R(fe.id,E))}Pe(null)}function An(){Pe(null),Ee("")}async function Hn(E){const ae=Lk(pe.get(E)??[]),re=await A(E,ae);re&&Ht("folder",re.id,re.name)}function Ts(E){const ae=String(E.active.id);if(ae.startsWith("s:")){const re=en.get(ae.slice(2));re&&ot({kind:"session",label:re.title||re.id.slice(0,8)})}else if(ae.startsWith("f:")){const re=q.get(ae.slice(2));re&&ot({kind:"folder",label:re.name})}}function ms(E){ot(null);const{active:ae,over:re}=E;if(!re)return;const ge=String(ae.id),$e=String(re.id);if(ge.startsWith("s:")){const Be=en.get(ge.slice(2));if(!Be)return;const De=Be.cwd||"(no directory)",lt=$a(Be,q);let Mn,Ln;if($e.startsWith("f:")){const Xe=q.get($e.slice(2));if(!Xe)return;Mn=Xe.workspace_path,Ln=Xe.id}else if($e.startsWith("s:")){const Xe=en.get($e.slice(2));if(!Xe)return;Mn=Xe.cwd||"(no directory)",Ln=$a(Xe,q)}else if($e.startsWith("c:")){const Xe=$e.slice(2),Tt=Xe.lastIndexOf("|");Mn=Xe.slice(0,Tt);const ss=Xe.slice(Tt+1);Ln=ss==="root"?null:ss}else return;if(Mn!==De)return;const He=fl(t.filter(Xe=>(Xe.cwd||"(no directory)")===Mn&&$a(Xe,q)===Ln)),kn=He.filter(Xe=>Xe.id!==Be.id);let Fs=kn.length;if($e.startsWith("s:")){const Xe=kn.findIndex(Tt=>Tt.id===$e.slice(2));Xe>=0&&(Fs=Xe)}const ts=[...kn.slice(0,Fs),Be,...kn.slice(Fs)],ns=[];if(Ln===lt){if(ts.length===He.length&&ts.every((Xe,Tt)=>Xe.id===He[Tt].id))return;ts.forEach((Xe,Tt)=>ns.push({id:Xe.id,folder_id:Ln,sort_order:ts.length-1-Tt}))}else{const Xe=fl(t.filter(Tt=>(Tt.cwd||"(no directory)")===De&&$a(Tt,q)===lt)).filter(Tt=>Tt.id!==Be.id);Xe.forEach((Tt,ss)=>ns.push({id:Tt.id,folder_id:lt,sort_order:Xe.length-1-ss})),ts.forEach((Tt,ss)=>ns.push({id:Tt.id,folder_id:Ln,sort_order:ts.length-1-ss}))}P(ns);return}if(ge.startsWith("f:")){if(!$e.startsWith("f:"))return;const Be=q.get(ge.slice(2)),De=q.get($e.slice(2));if(!Be||!De||Be.id===De.id||Be.workspace_path!==De.workspace_path)return;const lt=(pe.get(Be.workspace_path)??[]).map(He=>He.id),Mn=lt.indexOf(Be.id),Ln=lt.indexOf(De.id);lt.splice(Ln,0,...lt.splice(Mn,1)),H(lt)}}const In=K?t.filter(E=>!qh(E,K)):t,Dn=new Set(D?In.filter(E=>Dk(E)&&E.id!==a).map(E=>E.id):[]),pn=Mk(r,Dn.size>0?In.filter(E=>!Dn.has(E.id)):In),wn=w.useMemo(()=>{const E=new Map;if(!K)return E;const ae=dl(K);for(const re of t){if(!qh(re,K))continue;const ge=dl(re.cwd).slice(ae.length+1).split("/")[0],$e=E.get(ge)??[];$e.push(re),E.set(ge,$e)}return E},[t,K]);function Ft(E){return{folder:null,sessions:wn.get(E)??[],finishedKey:`app:${E}:finished`,hidden:F.has(E)}}const Vt=[],st=E=>{if(E.hidden)return;const{working:ae,finished:re,finishedCollapsed:ge}=Kh(E,se);Vt.push(...ae.map($e=>$e.id)),ge||Vt.push(...re.map($e=>$e.id))};for(const E of pn){if(Le.has(E.path))continue;const ae=pe.get(E.path)??[],re=new Set(ae.map(ge=>ge.id));Gh(E,ae,re,O).forEach(st)}Y.forEach(E=>st(Ft(E.id)));const vt=t.filter(E=>je.has(E.id)),yt=vt.filter(E=>E.lifecycle!=="finished").map(E=>E.id),qt=vt.filter(E=>E.lifecycle==="finished").map(E=>E.id);function bt(E,ae){if(ae.metaKey||ae.ctrlKey){ae.preventDefault(),It(E.id),kt(re=>{const ge=new Set(re);return ge.has(E.id)?ge.delete(E.id):ge.add(E.id),ge});return}if(ae.shiftKey){ae.preventDefault();const re=ze??E.id;It(re);const ge=Vt.indexOf(re),$e=Vt.indexOf(E.id);if(ge>=0&&$e>=0){const[Be,De]=ge<$e?[ge,$e]:[$e,ge];kt(new Set(Vt.slice(Be,De+1)))}return}ht(),It(E.id),u(E.id)}function xt(E,ae){ae.preventDefault();const re=je.has(E.id)&&je.size>1;je.has(E.id)||(kt(new Set),It(E.id)),ue({x:ae.clientX,y:ae.clientY,type:"session",sessionId:E.id,sessionTitle:E.title,sessionLifecycle:E.lifecycle,sessionExternalId:E.external_thread_id,multi:re})}function at(E){var re;const ae=E.origin_app_id?Y.find(ge=>ge.id===E.origin_app_id):null;return l.jsx(Pk,{s:E,backgroundTaskCount:((re=s[E.id])==null?void 0:re.length)??0,isActive:a===E.id,isSelected:je.has(E.id),originApp:ae??null,renaming:(fe==null?void 0:fe.kind)==="session"&&fe.id===E.id,renameValue:Ce,renameRef:Dt,onRenameValue:Ee,onRenameConfirm:ut,onRenameCancel:An,onSelect:ge=>bt(E,ge),onToggleStar:()=>b(E.id),onCtxMenu:ge=>xt(E,ge)},E.id)}function Gt(E){var re;const ae=Sl(E,((re=s[E.id])==null?void 0:re.length)??0);return l.jsxs("div",{className:`sidebar-app-edit-row${a===E.id?" active":""}${je.has(E.id)?" selected":""}${ae.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ge=>bt(E,ge),onContextMenu:ge=>xt(E,ge),children:[l.jsx(ad,{iconClass:ae.iconClass,iconText:ae.iconText,size:14}),(fe==null?void 0:fe.kind)==="session"&&fe.id===E.id?l.jsx(gd,{inputRef:Dt,value:Ce,onChange:Ee,onConfirm:ut,onCancel:An}):l.jsx("span",{className:"tree-label",children:E.title||E.id.slice(0,8)}),ae.dot&&l.jsx(od,{status:ae.dot,title:ae.dotTitle})]},E.id)}function Je(E,ae="workspace"){const{working:re,finished:ge,finishedCollapsed:$e}=Kh(E,se),Be=ae==="workspace"?at:Gt,De=l.jsxs(l.Fragment,{children:[re.length===0&&ge.length===0?l.jsx("div",{className:"tree-empty",children:"No sessions"}):re.map(Be),ge.length>0&&l.jsxs("div",{className:`tree-subgroup ${$e?"collapsed":""}`,children:[l.jsxs("div",{className:"tree-subgroup-header",onClick:()=>tt(E.finishedKey),children:[l.jsx(vi,{size:8,className:"tree-chevron"}),l.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),l.jsx("span",{className:"tree-subgroup-count",children:ge.length})]}),!$e&&l.jsx("div",{className:"tree-subgroup-items",children:ge.map(Be)})]})]});if(ae==="app")return De;const lt=[...re,...ge].map(Mn=>`s:${Mn.id}`);return l.jsx(Vh,{items:lt,strategy:Hh,children:De})}return l.jsxs("div",{className:"ide-sidebar",ref:Rn,children:[l.jsxs("div",{className:"sidebar-header",children:[l.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),l.jsxs("div",{className:"sidebar-header-actions",children:[l.jsx("button",{className:`sidebar-add sidebar-filter${D?" active":""}`,title:D?`Show automatic sessions (${Dn.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":D?"Show automatic sessions":"Hide automatic sessions","aria-pressed":D,onClick:gt,children:D?l.jsx(nw,{size:14}):l.jsx(dr,{size:14})}),l.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:l.jsx(Dr,{size:14})})]})]}),l.jsxs(nk,{sensors:Mt,collisionDetection:l1,onDragStart:Ts,onDragEnd:ms,children:[pn.length===0?l.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):pn.map(E=>{const ae=Le.has(E.path),re=pe.get(E.path)??[],ge=new Set(re.map(De=>De.id)),$e=Gh(E,re,ge,O),Be=$e[$e.length-1];return l.jsxs("div",{className:`tree-section ${ae?"collapsed":""}`,children:[l.jsxs("div",{className:"tree-section-header",onClick:()=>Ue(E.path),onContextMenu:De=>{De.preventDefault(),ue({x:De.clientX,y:De.clientY,type:"workspace",path:E.path})},children:[l.jsx(vi,{size:9,className:"tree-chevron"}),l.jsx($u,{size:14}),l.jsx("span",{className:"tree-section-label",children:E.label}),l.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:De=>{De.stopPropagation(),g(E.path)},children:l.jsx(Dr,{size:11})}),l.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:De=>{De.stopPropagation(),Hn(E.path)},children:l.jsx(ku,{size:11})}),l.jsx("span",{className:"tree-count",children:E.sessions.length})]}),!ae&&l.jsxs("div",{className:"tree-children",children:[l.jsx(Vh,{items:re.map(De=>`f:${De.id}`),strategy:Hh,children:$e.filter(De=>De.folder).map(De=>l.jsx(Ok,{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:Ee,onRenameConfirm:ut,onRenameCancel:An,onToggle:()=>mt(De.folder.id),onCtxMenu:lt=>{lt.preventDefault(),ue({x:lt.clientX,y:lt.clientY,type:"folder",folderId:De.folder.id,folderName:De.folder.name})},children:l.jsx(Yh,{id:`c:${E.path}|${De.folder.id}`,children:Je(De)})},De.folder.id))}),l.jsx(Yh,{id:`c:${E.path}|root`,children:Je(Be)})]})]},E.path)}),l.jsx(wk,{children:_e&&l.jsxs("div",{className:"drag-overlay",children:[_e.kind==="folder"&&l.jsx($u,{size:12}),l.jsx("span",{children:_e.label})]})})]}),l.jsxs("div",{className:"sidebar-apps",children:[l.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[l.jsx("span",{className:"sidebar-header-title",children:"Apps"}),l.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>Ne(),children:l.jsx(Dr,{size:14})})]}),Y.length===0&&l.jsx("div",{className:"tree-empty",children:"No apps yet"}),Y.map(E=>{const ae=Ft(E.id),re=ae.sessions.length>0&&!ae.hidden;return l.jsxs("div",{className:"sidebar-app-block",children:[l.jsxs("div",{className:`sidebar-app-row${X===E.id?" active":""}`,title:E.description??void 0,onClick:()=>de(E.id),onContextMenu:ge=>{ge.preventDefault(),ue({x:ge.clientX,y:ge.clientY,type:"app",appId:E.id,appPinned:E.pinned})},children:[ae.sessions.length>0&&l.jsx("button",{className:`sidebar-app-chevron${re?"":" closed"}`,title:"Edit sessions of this app",onClick:ge=>{ge.stopPropagation(),Rt(E.id)},children:l.jsx(vi,{size:10,className:"tree-chevron"})}),l.jsx(wi,{iconNode:E.iconNode,size:14,className:"sidebar-app-icon"}),l.jsx("span",{className:"tree-label",children:E.title}),ae.sessions.length>0&&l.jsx("span",{className:"sidebar-app-count",children:ae.sessions.length}),E.pinned&&l.jsx(sl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),re&&l.jsx("div",{className:"sidebar-app-edits",children:Je(ae,"app")})]},E.id)})]}),l.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[l.jsx(ku,{size:14}),l.jsx("span",{children:"Add workspace"})]}),G&&l.jsxs("div",{ref:Fe,className:"ctx-menu",style:{position:"fixed",left:G.x,top:G.y,zIndex:500},children:[G.type==="workspace"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(G.path),ue(null)},children:[l.jsx(Dr,{size:12})," New Session"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Hn(G.path),ue(null)},children:[l.jsx(ku,{size:12})," New Folder"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{h(G.path),ue(null)},children:[l.jsx(fs,{size:12})," Hide Workspace"]})]}),G.type==="folder"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("folder",G.folderId,G.folderName??""),ue(null)},children:[l.jsx(Va,{size:12})," Rename Folder"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{U(G.folderId),ue(null)},children:[l.jsx(fs,{size:12})," Delete Folder"]})]}),G.type==="session"&&!G.multi&&l.jsx(l.Fragment,{children:G.sessionLifecycle!=="finished"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("session",G.sessionId,G.sessionTitle??""),ue(null)},children:[l.jsx(Va,{size:12})," Rename"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(G.sessionId),ue(null)},children:[l.jsx(tl,{size:12})," Mark as Finished"]}),l.jsxs("div",{className:`ctx-menu-item${G.sessionExternalId?"":" ctx-disabled"}`,title:G.sessionExternalId?void 0:"Session not started",onClick:()=>{G.sessionExternalId&&(ul(G.sessionExternalId),ue(null))},children:[l.jsx(nl,{size:12})," Copy Session ID"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(G.sessionId),ue(null)},children:[l.jsx(fs,{size:12})," Delete Session"]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{j(G.sessionId),ue(null)},children:[l.jsx(wo,{size:12})," Reopen"]}),l.jsxs("div",{className:`ctx-menu-item${G.sessionExternalId?"":" ctx-disabled"}`,title:G.sessionExternalId?void 0:"Session not started",onClick:()=>{G.sessionExternalId&&(ul(G.sessionExternalId),ue(null))},children:[l.jsx(nl,{size:12})," Copy Session ID"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(G.sessionId),ue(null)},children:[l.jsx(fs,{size:12})," Delete Session"]})]})}),G.type==="session"&&G.multi&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-header",children:[vt.length," sessions selected"]}),yt.length>0&&l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(yt),ue(null),ht()},children:[l.jsx(tl,{size:12})," Mark ",yt.length," as Finished"]}),qt.length>0&&l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{_(qt),ue(null),ht()},children:[l.jsx(wo,{size:12})," Reopen ",qt.length]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{T([...je]),ue(null),ht()},children:[l.jsx(fs,{size:12})," Delete ",vt.length," Sessions"]})]}),G.type==="app"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{he(G.appId),ue(null)},children:[l.jsx(Va,{size:12})," Edit App"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{V(G.appId),ue(null)},children:[l.jsx(sl,{size:12})," ",G.appPinned?"Unpin":"Pin"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{Te(G.appId),ue(null)},children:[l.jsx(fs,{size:12})," Delete App"]})]})]})]})}function zk(){const t=L(b=>b.openTabs),s=L(b=>b.activeSessionId),r=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 l.jsxs("div",{className:"ide-tabs",children:[t.map(b=>{var A;const j=r.find(R=>R.id===b);if(!j)return null;const _=Sl(j,((A=o[b])==null?void 0:A.length)??0),T=s===b&&m==null;return l.jsxs("div",{className:`ide-tab ${T?"active":""}`,onClick:()=>{m!=null&&x(null),a(b)},children:[l.jsx(ad,{iconClass:_.iconClass,iconText:_.iconText,size:14}),j.title||b.slice(0,8),_.dot&&l.jsx(od,{status:_.dot,title:_.dotTitle}),l.jsx("span",{className:"ide-tab-close",onClick:R=>{R.stopPropagation(),u(b)},children:l.jsx(En,{size:12})})]},b)}),g.map(b=>{const j=h.find(T=>T.id===b),_=m===b;return l.jsxs("div",{className:`ide-tab ${_?"active":""}`,onClick:()=>v(b),children:[l.jsx(wi,{iconNode:j==null?void 0:j.iconNode,size:12,className:"miniapp-tab-icon"}),(j==null?void 0:j.title)??b,l.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),k(b)},children:l.jsx(En,{size:12})})]},b)}),l.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:l.jsx(Dr,{size:14})})]})}function vd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pr=vd();function Jg(t){Pr=t}var go={exec:()=>null};function nt(t,s=""){let r=typeof t=="string"?t:t.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(yn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var yn={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:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Fk=/^(?:[ \t]*(?:\n|$))+/,Uk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Eo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yd=/(?:[*+-]|\d{1,9}[.)])/,ev=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tv=nt(ev).replace(/bull/g,yd).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(),Hk=nt(ev).replace(/bull/g,yd).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(),xd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vk=/^[^\n]+/,wd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,qk=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gk=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yd).getRegex(),Rl="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",kd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kk=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",kd).replace("tag",Rl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nv=nt(xd).replace("hr",Eo).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",Rl).getRegex(),Yk=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nv).getRegex(),Sd={blockquote:Yk,code:Uk,def:qk,fences:Bk,heading:Wk,hr:Eo,html:Kk,lheading:tv,list:Gk,newline:Fk,paragraph:nv,table:go,text:Vk},Xh=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Eo).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",Rl).getRegex(),Xk={...Sd,lheading:Hk,table:Xh,paragraph:nt(xd).replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xh).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",Rl).getRegex()},Qk={...Sd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",kd).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:go,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(xd).replace("hr",Eo).replace("heading",` *#{1,6} *[^
|
|
409
|
-
]`).replace("lheading",tv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sv=/^( {2,}|\\)\n(?!\s*$)/,eS=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Al=/[\p{P}\p{S}]/u,bd=/[\s\p{P}\p{S}]/u,rv=/[^\s\p{P}\p{S}]/u,tS=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,bd).getRegex(),iv=/(?!~)[\p{P}\p{S}]/u,nS=/(?!~)[\s\p{P}\p{S}]/u,sS=/(?:[^\s\p{P}\p{S}]|~)/u,rS=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ov=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iS=nt(ov,"u").replace(/punct/g,Al).getRegex(),oS=nt(ov,"u").replace(/punct/g,iv).getRegex(),av="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",aS=nt(av,"gu").replace(/notPunctSpace/g,rv).replace(/punctSpace/g,bd).replace(/punct/g,Al).getRegex(),lS=nt(av,"gu").replace(/notPunctSpace/g,sS).replace(/punctSpace/g,nS).replace(/punct/g,iv).getRegex(),cS=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,rv).replace(/punctSpace/g,bd).replace(/punct/g,Al).getRegex(),uS=nt(/\\(punct)/,"gu").replace(/punct/g,Al).getRegex(),dS=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(),fS=nt(kd).replace("(?:-->|$)","-->").getRegex(),pS=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",fS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,hS=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",pl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lv=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",pl).replace("ref",wd).getRegex(),cv=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",wd).getRegex(),mS=nt("reflink|nolink(?!\\()","g").replace("reflink",lv).replace("nolink",cv).getRegex(),Td={_backpedal:go,anyPunctuation:uS,autolink:dS,blockSkip:rS,br:sv,code:Jk,del:go,emStrongLDelim:iS,emStrongRDelimAst:aS,emStrongRDelimUnd:cS,escape:Zk,link:hS,nolink:cv,punctuation:tS,reflink:lv,reflinkSearch:mS,tag:pS,text:eS,url:go},gS={...Td,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",pl).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pl).getRegex()},Bu={...Td,emStrongRDelimAst:lS,emStrongLDelim:oS,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.!#$%&'*+\/=?_`{\|}~-]+@)))/},vS={...Bu,br:nt(sv).replace("{2,}","*").getRegex(),text:nt(Bu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},za={normal:Sd,gfm:Xk,pedantic:Qk},ro={normal:Td,gfm:Bu,breaks:vS,pedantic:gS},yS={"&":"&","<":"<",">":">",'"':""","'":"'"},Qh=t=>yS[t];function Ss(t,s){if(s){if(yn.escapeTest.test(t))return t.replace(yn.escapeReplace,Qh)}else if(yn.escapeTestNoEncode.test(t))return t.replace(yn.escapeReplaceNoEncode,Qh);return t}function Zh(t){try{t=encodeURI(t).replace(yn.percentDecode,"%")}catch{return null}return t}function Jh(t,s){var u;const r=t.replace(yn.findPipe,(f,h,g)=>{let m=!1,v=h;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=r.split(yn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(yn.slashPipe,"|");return o}function io(t,s,r){const o=t.length;if(o===0)return"";let a=0;for(;a<o&&t.charAt(o-a-1)===s;)a++;return t.slice(0,o-a)}function xS(t,s){if(t.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===s[0])r++;else if(t[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function em(t,s,r,o,a){const u=s.href,f=s.title||null,h=t[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,g}function wS(t,s,r){const o=t.match(r.other.indentCodeCompensation);if(o===null)return s;const a=o[1];return s.split(`
|
|
410
|
-
`).map(u=>{const f=u.match(r.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
411
|
-
`)}var hl=class{constructor(t){rt(this,"options");rt(this,"rules");rt(this,"lexer");this.options=t||Pr}space(t){const s=this.rules.block.newline.exec(t);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(t){const s=this.rules.block.code.exec(t);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:io(r,`
|
|
412
|
-
`)}}}fences(t){const s=this.rules.block.fences.exec(t);if(s){const r=s[0],o=wS(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(t){const s=this.rules.block.heading.exec(t);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=io(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const s=this.rules.block.hr.exec(t);if(s)return{type:"hr",raw:io(s[0],`
|
|
413
|
-
`)}}blockquote(t){const s=this.rules.block.blockquote.exec(t);if(s){let r=io(s[0],`
|
|
414
|
-
`).split(`
|
|
415
|
-
`),o="",a="";const u=[];for(;r.length>0;){let f=!1;const h=[];let g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))h.push(r[g]),f=!0;else if(!f)h.push(r[g]);else break;r=r.slice(g);const m=h.join(`
|
|
416
|
-
`),v=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
417
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
418
|
-
${m}`:m,a=a?`${a}
|
|
419
|
-
${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,u,!0),this.lexer.state.top=k,r.length===0)break;const x=u.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){const b=x,j=b.raw+`
|
|
420
|
-
`+r.join(`
|
|
421
|
-
`),_=this.blockquote(j);u[u.length-1]=_,o=o.substring(0,o.length-b.raw.length)+_.raw,a=a.substring(0,a.length-b.text.length)+_.text;break}else if((x==null?void 0:x.type)==="list"){const b=x,j=b.raw+`
|
|
422
|
-
`+r.join(`
|
|
423
|
-
`),_=this.list(j);u[u.length-1]=_,o=o.substring(0,o.length-x.raw.length)+_.raw,a=a.substring(0,a.length-b.raw.length)+_.raw,r=j.substring(u.at(-1).raw.length).split(`
|
|
424
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(t){let s=this.rules.block.list.exec(t);if(s){let r=s[1].trim();const o=r.length>1,a={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const u=this.rules.other.listItemRegex(r);let f=!1;for(;t;){let g=!1,m="",v="";if(!(s=u.exec(t))||this.rules.block.hr.test(t))break;m=s[0],t=t.substring(m.length);let k=s[2].split(`
|
|
425
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),x=t.split(`
|
|
426
|
-
`,1)[0],b=!k.trim(),j=0;if(this.options.pedantic?(j=2,v=k.trimStart()):b?j=s[1].length+1:(j=s[2].search(this.rules.other.nonSpaceChar),j=j>4?1:j,v=k.slice(j),j+=s[1].length),b&&this.rules.other.blankLine.test(x)&&(m+=x+`
|
|
427
|
-
`,t=t.substring(x.length+1),g=!0),!g){const A=this.rules.other.nextBulletRegex(j),R=this.rules.other.hrRegex(j),U=this.rules.other.fencesBeginRegex(j),P=this.rules.other.headingBeginRegex(j),H=this.rules.other.htmlBeginRegex(j);for(;t;){const Y=t.split(`
|
|
428
|
-
`,1)[0];let K;if(x=Y,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),K=x):K=x.replace(this.rules.other.tabCharGlobal," "),U.test(x)||P.test(x)||H.test(x)||A.test(x)||R.test(x))break;if(K.search(this.rules.other.nonSpaceChar)>=j||!x.trim())v+=`
|
|
429
|
-
`+K.slice(j);else{if(b||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(k)||P.test(k)||R.test(k))break;v+=`
|
|
430
|
-
`+x}!b&&!x.trim()&&(b=!0),m+=Y+`
|
|
431
|
-
`,t=t.substring(Y.length+1),k=K.slice(j)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(f=!0));let _=null,T;this.options.gfm&&(_=this.rules.other.listIsTask.exec(v),_&&(T=_[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:m,task:!!_,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(t){const s=this.rules.block.html.exec(t);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(t){const s=this.rules.block.def.exec(t);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:a}}}table(t){var f;const s=this.rules.block.table.exec(t);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Jh(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=s[3])!=null&&f.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
432
|
-
`):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.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<r.length;h++)u.header.push({text:r[h],tokens:this.lexer.inline(r[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Jh(h,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));return u}}lheading(t){const s=this.rules.block.lheading.exec(t);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(t){const s=this.rules.block.paragraph.exec(t);if(s){const r=s[1].charAt(s[1].length-1)===`
|
|
433
|
-
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const s=this.rules.block.text.exec(t);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(t){const s=this.rules.inline.escape.exec(t);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(t){const s=this.rules.inline.tag.exec(t);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(t){const s=this.rules.inline.link.exec(t);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=io(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=xS(s[2],"()");if(u===-2)return;if(u>-1){const h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let o=s[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),em(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(t,s){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=s[o.toLowerCase()];if(!a){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return em(r,a,r[0],this.lexer,this.rules)}}emStrong(t,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){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,s=s.slice(-1*t.length+u);(o=v.exec(s))!=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=t.slice(0,u+o.index+k+h);if(Math.min(u,h)%2){const j=x.slice(1,-1);return{type:"em",raw:x,text:j,tokens:this.lexer.inlineTokens(j)}}const b=x.slice(2,-2);return{type:"strong",raw:x,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){const s=this.rules.inline.code.exec(t);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(t){const s=this.rules.inline.br.exec(t);if(s)return{type:"br",raw:s[0]}}del(t){const s=this.rules.inline.del.exec(t);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(t){const s=this.rules.inline.autolink.exec(t);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let s;if(s=this.rules.inline.url.exec(t)){let o,a;if(s[2]==="@")o=s[0],a="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?a="http://"+s[0]:a=s[0]}return{type:"link",raw:s[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t){const s=this.rules.inline.text.exec(t);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Ls=class Wu{constructor(s){rt(this,"tokens");rt(this,"options");rt(this,"state");rt(this,"tokenizer");rt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Pr,this.options.tokenizer=this.options.tokenizer||new hl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:yn,block:za.normal,inline:ro.normal};this.options.pedantic?(r.block=za.pedantic,r.inline=ro.pedantic):this.options.gfm&&(r.block=za.gfm,this.options.breaks?r.inline=ro.breaks:r.inline=ro.gfm),this.tokenizer.rules=r}static get rules(){return{block:za,inline:ro}}static lex(s,r){return new Wu(r).lex(s)}static lexInline(s,r){return new Wu(r).inlineTokens(s)}lex(s){s=s.replace(yn.carriageReturn,`
|
|
434
|
-
`),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],o=!1){var a,u,f;for(this.options.pedantic&&(s=s.replace(yn.tabCharGlobal," ").replace(yn.spaceLine,""));s;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(m=>(h=m.call({lexer:this},s,r))?(s=s.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.space(s)){s=s.substring(h.raw.length);const m=r.at(-1);h.raw.length===1&&m!==void 0?m.raw+=`
|
|
435
|
-
`:r.push(h);continue}if(h=this.tokenizer.code(s)){s=s.substring(h.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
436
|
-
`+h.raw,m.text+=`
|
|
437
|
-
`+h.text,this.inlineQueue.at(-1).src=m.text):r.push(h);continue}if(h=this.tokenizer.fences(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.heading(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.hr(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.blockquote(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.list(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.html(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.def(s)){s=s.substring(h.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
438
|
-
`+h.raw,m.text+=`
|
|
439
|
-
`+h.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.lheading(s)){s=s.substring(h.raw.length),r.push(h);continue}let g=s;if((f=this.options.extensions)!=null&&f.startBlock){let m=1/0;const v=s.slice(1);let k;this.options.extensions.startBlock.forEach(x=>{k=x.call({lexer:this},v),typeof k=="number"&&k>=0&&(m=Math.min(m,k))}),m<1/0&&m>=0&&(g=s.substring(0,m+1))}if(this.state.top&&(h=this.tokenizer.paragraph(g))){const m=r.at(-1);o&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=`
|
|
440
|
-
`+h.raw,m.text+=`
|
|
441
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(h),o=g.length!==s.length,s=s.substring(h.raw.length);continue}if(h=this.tokenizer.text(s)){s=s.substring(h.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
442
|
-
`+h.raw,m.text+=`
|
|
443
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(h);continue}if(s){const m="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,g,m;let o=s,a=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,f="";for(;s;){u||(f=""),u=!1;let v;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(x=>(v=x.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);const x=r.at(-1);v.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,o,f)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let k=s;if((m=this.options.extensions)!=null&&m.startInline){let x=1/0;const b=s.slice(1);let j;this.options.extensions.startInline.forEach(_=>{j=_.call({lexer:this},b),typeof j=="number"&&j>=0&&(x=Math.min(x,j))}),x<1/0&&x>=0&&(k=s.substring(0,x+1))}if(v=this.tokenizer.inlineText(k)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(f=v.raw.slice(-1)),u=!0;const x=r.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):r.push(v);continue}if(s){const x="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return r}},ml=class{constructor(t){rt(this,"options");rt(this,"parser");this.options=t||Pr}space(t){return""}code({text:t,lang:s,escaped:r}){var u;const o=(u=(s||"").match(yn.notSpaceStart))==null?void 0:u[0],a=t.replace(yn.endingNewline,"")+`
|
|
444
|
-
`;return o?'<pre><code class="language-'+Ss(o)+'">'+(r?a:Ss(a,!0))+`</code></pre>
|
|
445
|
-
`:"<pre><code>"+(r?a:Ss(a,!0))+`</code></pre>
|
|
446
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
447
|
-
${this.parser.parse(t)}</blockquote>
|
|
448
|
-
`}html({text:t}){return t}heading({tokens:t,depth:s}){return`<h${s}>${this.parser.parseInline(t)}</h${s}>
|
|
449
|
-
`}hr(t){return`<hr>
|
|
450
|
-
`}list(t){const s=t.ordered,r=t.start;let o="";for(let f=0;f<t.items.length;f++){const h=t.items[f];o+=this.listitem(h)}const a=s?"ol":"ul",u=s&&r!==1?' start="'+r+'"':"";return"<"+a+u+`>
|
|
451
|
-
`+o+"</"+a+`>
|
|
452
|
-
`}listitem(t){var r;let s="";if(t.task){const o=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=o+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=o+" "+Ss(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(t.tokens,!!t.loose),`<li>${s}</li>
|
|
453
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
454
|
-
`}table(t){let s="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);s+=this.tablerow({text:r});let o="";for(let a=0;a<t.rows.length;a++){const u=t.rows[a];r="";for(let f=0;f<u.length;f++)r+=this.tablecell(u[f]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
455
|
-
<thead>
|
|
456
|
-
`+s+`</thead>
|
|
457
|
-
`+o+`</table>
|
|
458
|
-
`}tablerow({text:t}){return`<tr>
|
|
459
|
-
${t}</tr>
|
|
460
|
-
`}tablecell(t){const s=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+s+`</${r}>
|
|
461
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ss(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:s,tokens:r}){const o=this.parser.parseInline(r),a=Zh(t);if(a===null)return o;t=a;let u='<a href="'+t+'"';return s&&(u+=' title="'+Ss(s)+'"'),u+=">"+o+"</a>",u}image({href:t,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const a=Zh(t);if(a===null)return Ss(r);t=a;let u=`<img src="${t}" alt="${r}"`;return s&&(u+=` title="${Ss(s)}"`),u+=">",u}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ss(t.text)}},Nd=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ps=class Hu{constructor(s){rt(this,"options");rt(this,"renderer");rt(this,"textRenderer");this.options=s||Pr,this.options.renderer=this.options.renderer||new ml,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Nd}static parse(s,r){return new Hu(r).parse(s)}static parseInline(s,r){return new Hu(r).parseInline(s)}parse(s,r=!0){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[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<s.length&&s[f+1].type==="text";)m=s[++f],v+=`
|
|
462
|
-
`+this.renderer.text(m);r?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(s,r=this.renderer){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[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+=r.text(g);break}case"html":{o+=r.html(g);break}case"link":{o+=r.link(g);break}case"image":{o+=r.image(g);break}case"strong":{o+=r.strong(g);break}case"em":{o+=r.em(g);break}case"codespan":{o+=r.codespan(g);break}case"br":{o+=r.br(g);break}case"del":{o+=r.del(g);break}case"text":{o+=r.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}},Du,Ga=(Du=class{constructor(t){rt(this,"options");rt(this,"block");this.options=t||Pr}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Ls.lex:Ls.lexInline}provideParser(){return this.block?Ps.parse:Ps.parseInline}},rt(Du,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Du),kS=class{constructor(...t){rt(this,"defaults",vd());rt(this,"options",this.setOptions);rt(this,"parse",this.parseMarkdown(!0));rt(this,"parseInline",this.parseMarkdown(!1));rt(this,"Parser",Ps);rt(this,"Renderer",ml);rt(this,"TextRenderer",Nd);rt(this,"Lexer",Ls);rt(this,"Tokenizer",hl);rt(this,"Hooks",Ga);this.use(...t)}walkTokens(t,s){var o,a;let r=[];for(const u of t)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)r=r.concat(this.walkTokens(h.tokens,s));for(const h of f.rows)for(const g of h)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{const f=u;r=r.concat(this.walkTokens(f.items,s));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);r=r.concat(this.walkTokens(g,s))}):f.tokens&&(r=r.concat(this.walkTokens(f.tokens,s)))}}return r}use(...t){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=s.renderers[a.name];u?s.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:s.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=s[a.level];u?u.unshift(a.tokenizer):s[a.level]=[a.tokenizer],a.start&&(a.level==="block"?s.startBlock?s.startBlock.push(a.start):s.startBlock=[a.start]:a.level==="inline"&&(s.startInline?s.startInline.push(a.start):s.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(s.childTokens[a.name]=a.childTokens)}),o.extensions=s),r.renderer){const a=this.defaults.renderer||new ml(this.defaults);for(const u in r.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=r.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(r.tokenizer){const a=this.defaults.tokenizer||new hl(this.defaults);for(const u in r.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=r.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(r.hooks){const a=this.defaults.hooks||new Ga;for(const u in r.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=r.hooks[f],g=a[f];Ga.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(r.walkTokens){const a=this.defaults.walkTokens,u=r.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(t){return this.defaults={...this.defaults,...t},this}lexer(t,s){return Ls.lex(t,s??this.defaults)}parser(t,s){return Ps.parse(t,s??this.defaults)}parseMarkdown(t){return(r,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 r>"u"||r===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=t);const h=u.hooks?u.hooks.provideLexer():t?Ls.lex:Ls.lexInline,g=u.hooks?u.hooks.provideParser():t?Ps.parse:Ps.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).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&&(r=u.hooks.preprocess(r));let m=h(r,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(t,s){return r=>{if(r.message+=`
|
|
463
|
-
Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+Ss(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},Mr=new kS;function qe(t,s){return Mr.parse(t,s)}qe.options=qe.setOptions=function(t){return Mr.setOptions(t),qe.defaults=Mr.defaults,Jg(qe.defaults),qe};qe.getDefaults=vd;qe.defaults=Pr;qe.use=function(...t){return Mr.use(...t),qe.defaults=Mr.defaults,Jg(qe.defaults),qe};qe.walkTokens=function(t,s){return Mr.walkTokens(t,s)};qe.parseInline=Mr.parseInline;qe.Parser=Ps;qe.parser=Ps.parse;qe.Renderer=ml;qe.TextRenderer=Nd;qe.Lexer=Ls;qe.lexer=Ls.lex;qe.Tokenizer=hl;qe.Hooks=Ga;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;Ps.parse;Ls.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 tm(t,s){(s==null||s>t.length)&&(s=t.length);for(var r=0,o=Array(s);r<s;r++)o[r]=t[r];return o}function SS(t){if(Array.isArray(t))return t}function bS(t,s){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var o,a,u,f,h=[],g=!0,m=!1;try{if(u=(r=r.call(t)).next,s!==0)for(;!(g=(o=u.call(r)).done)&&(h.push(o.value),h.length!==s);g=!0);}catch(v){m=!0,a=v}finally{try{if(!g&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(m)throw a}}return h}}function TS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
464
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NS(t,s){return SS(t)||bS(t,s)||CS(t,s)||TS()}function CS(t,s){if(t){if(typeof t=="string")return tm(t,s);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tm(t,s):void 0}}const uv=Object.entries,nm=Object.setPrototypeOf,jS=Object.isFrozen,_S=Object.getPrototypeOf,ES=Object.getOwnPropertyDescriptor;let sn=Object.freeze,rn=Object.seal,fi=Object.create,dv=typeof Reflect<"u"&&Reflect,Vu=dv.apply,qu=dv.construct;sn||(sn=function(s){return s});rn||(rn=function(s){return s});Vu||(Vu=function(s,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return s.apply(r,a)});qu||(qu=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new s(...o)});const ci=zt(Array.prototype.forEach),RS=zt(Array.prototype.lastIndexOf),sm=zt(Array.prototype.pop),ui=zt(Array.prototype.push),AS=zt(Array.prototype.splice),cr=Array.isArray,uo=zt(String.prototype.toLowerCase),Cu=zt(String.prototype.toString),rm=zt(String.prototype.match),oo=zt(String.prototype.replace),im=zt(String.prototype.indexOf),IS=zt(String.prototype.trim),DS=zt(Number.prototype.toString),MS=zt(Boolean.prototype.toString),om=typeof BigInt>"u"?null:zt(BigInt.prototype.toString),am=typeof Symbol>"u"?null:zt(Symbol.prototype.toString),Zt=zt(Object.prototype.hasOwnProperty),ao=zt(Object.prototype.toString),Qt=zt(RegExp.prototype.test),Ar=LS(TypeError);function zt(t){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Vu(t,s,o)}}function LS(t){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return qu(t,r)}}function Ve(t,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:uo;if(nm&&nm(t,null),!cr(s))return t;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(jS(s)||(s[o]=u),a=u)}t[a]=!0}return t}function PS(t){for(let s=0;s<t.length;s++)Zt(t,s)||(t[s]=null);return t}function un(t){const s=fi(null);for(const o of uv(t)){var r=NS(o,2);const a=r[0],u=r[1];Zt(t,a)&&(cr(u)?s[a]=PS(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=un(u):s[a]=u)}return s}function OS(t){switch(typeof t){case"string":return t;case"number":return DS(t);case"boolean":return MS(t);case"bigint":return om?om(t):"0";case"symbol":return am?am(t):"Symbol()";case"undefined":return ao(t);case"function":case"object":{if(t===null)return ao(t);const s=t,r=us(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:ao(o)}return ao(t)}default:return ao(t)}}function us(t,s){for(;t!==null;){const o=ES(t,s);if(o){if(o.get)return zt(o.get);if(typeof o.value=="function")return zt(o.value)}t=_S(t)}function r(){return null}return r}function $S(t){try{return Qt(t,""),!0}catch{return!1}}const lm=sn(["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"]),ju=sn(["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"]),_u=sn(["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"]),zS=sn(["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"]),Eu=sn(["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"]),FS=sn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cm=sn(["#text"]),um=sn(["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"]),Ru=sn(["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"]),dm=sn(["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"]),Fa=sn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),US=rn(/{{[\w\W]*|^[\w\W]*}}/g),BS=rn(/<%[\w\W]*|^[\w\W]*%>/g),WS=rn(/\${[\w\W]*/g),HS=rn(/^data-[\-\w.\u00B7-\uFFFF]+$/),VS=rn(/^aria-[\-\w]+$/),fm=rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qS=rn(/^(?:\w+script|data):/i),GS=rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),KS=rn(/^html$/i),YS=rn(/^[a-z][.\w]*(-[.\w]+)+$/i),pm=rn(/<[/\w!]/g),hm=rn(/<[/\w]/g),XS=rn(/<\/no(script|embed|frames)/i),QS=rn(/\/>/i),Un={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ZS=function(){return typeof window>"u"?null:window},JS=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},mm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ar=function(s,r,o,a){return Zt(s,r)&&cr(s[r])?Ve(a.base?un(a.base):{},s[r],a.transform):o};function fv(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZS();const s=le=>fv(le);if(s.version="3.4.13",s.removed=[],!t||!t.document||t.document.nodeType!==Un.document||!t.Element)return s.isSupported=!1,s;let r=t.document;const o=r,a=o.currentScript;t.DocumentFragment;const u=t.HTMLTemplateElement,f=t.Node,h=t.Element,g=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const v=t.DOMParser,k=t.trustedTypes,x=h.prototype,b=us(x,"cloneNode"),j=us(x,"remove"),_=us(x,"nextSibling"),T=us(x,"childNodes"),A=us(x,"parentNode"),R=us(x,"shadowRoot"),U=us(x,"attributes"),P=f&&f.prototype?us(f.prototype,"nodeType"):null,H=f&&f.prototype?us(f.prototype,"nodeName"):null,Y=f&&f.prototype?us(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const le=r.createElement("template");le.content&&le.content.ownerDocument&&(r=le.content.ownerDocument)}let K,X="",de,he=!1,V=0;const Te=function(){if(V>0)throw Ar('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.')},Ne=function(S){Te(),V++;try{return K.createHTML(S)}finally{V--}},Le=function(S){Te(),V++;try{return K.createScriptURL(S)}finally{V--}},te=function(){return he||(de=JS(k,a),he=!0),de},se=r,ie=se.implementation,O=se.createNodeIterator,Q=se.createDocumentFragment,F=se.getElementsByTagName,C=o.importNode;let D=mm();s.isSupported=typeof uv=="function"&&typeof A=="function"&&ie&&ie.createHTMLDocument!==void 0;const oe=US,G=BS,ue=WS,fe=HS,Pe=VS,Ce=qS,Ee=GS,_e=YS;let ot=fm,je=null;const kt=Ve({},[...lm,...ju,..._u,...Eu,...cm]);let ze=null;const It=Ve({},[...um,...Ru,...dm,...Fa]);let Fe=Object.seal(fi(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,Rn=null;const St=Object.seal(fi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mt=!0,ht=!0,en=!1,q=!0,pe=!1,Ue=!0,tt=!1,mt=!1,gt=null,Rt=null,Ht=!1,ut=!1,An=!1,Hn=!1,Ts=!0,ms=!1;const In="user-content-";let Dn=!0,pn=!1,wn={},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 st=null;const vt=Ve({},["audio","video","img","source","image","track"]);let yt=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",xt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml";let Gt=at,Je=!1,E=null;const ae=Ve({},[bt,xt,at],Cu),re=sn(["mi","mo","mn","ms","mtext"]);let ge=Ve({},re);const $e=sn(["annotation-xml"]);let Be=Ve({},$e);const De=Ve({},["title","style","font","a","script"]);let lt=null;const Mn=["application/xhtml+xml","text/html"],Ln="text/html";let He=null,kn=null;const Fs=r.createElement("form"),ts=function(S){return S instanceof RegExp||S instanceof Function},ns=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===S)return;(!S||typeof S!="object")&&(S={}),S=un(S),lt=Mn.indexOf(S.PARSER_MEDIA_TYPE)===-1?Ln:S.PARSER_MEDIA_TYPE,He=lt==="application/xhtml+xml"?Cu:uo,je=ar(S,"ALLOWED_TAGS",kt,{transform:He}),ze=ar(S,"ALLOWED_ATTR",It,{transform:He}),E=ar(S,"ALLOWED_NAMESPACES",ae,{transform:Cu}),yt=ar(S,"ADD_URI_SAFE_ATTR",qt,{transform:He,base:qt}),st=ar(S,"ADD_DATA_URI_TAGS",vt,{transform:He,base:vt}),Ft=ar(S,"FORBID_CONTENTS",Vt,{transform:He}),Dt=ar(S,"FORBID_TAGS",un({}),{transform:He}),Rn=ar(S,"FORBID_ATTR",un({}),{transform:He}),wn=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,ht=S.ALLOW_DATA_ATTR!==!1,en=S.ALLOW_UNKNOWN_PROTOCOLS||!1,q=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=S.SAFE_FOR_TEMPLATES||!1,Ue=S.SAFE_FOR_XML!==!1,tt=S.WHOLE_DOCUMENT||!1,ut=S.RETURN_DOM||!1,An=S.RETURN_DOM_FRAGMENT||!1,Hn=S.RETURN_TRUSTED_TYPE||!1,Ht=S.FORCE_BODY||!1,Ts=S.SANITIZE_DOM!==!1,ms=S.SANITIZE_NAMED_PROPS||!1,Dn=S.KEEP_CONTENT!==!1,pn=S.IN_PLACE||!1,ot=$S(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:fm,Gt=typeof S.NAMESPACE=="string"?S.NAMESPACE:at,ge=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({},re),Be=Zt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?un(S.HTML_INTEGRATION_POINTS):Ve({},$e);const $=Zt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?un(S.CUSTOM_ELEMENT_HANDLING):fi(null);if(Fe=fi(null),Zt($,"tagNameCheck")&&ts($.tagNameCheck)&&(Fe.tagNameCheck=$.tagNameCheck),Zt($,"attributeNameCheck")&&ts($.attributeNameCheck)&&(Fe.attributeNameCheck=$.attributeNameCheck),Zt($,"allowCustomizedBuiltInElements")&&typeof $.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=$.allowCustomizedBuiltInElements),rn(Fe),pe&&(ht=!1),An&&(ut=!0),wn&&(je=Ve({},cm),ze=fi(null),wn.html===!0&&(Ve(je,lm),Ve(ze,um)),wn.svg===!0&&(Ve(je,ju),Ve(ze,Ru),Ve(ze,Fa)),wn.svgFilters===!0&&(Ve(je,_u),Ve(ze,Ru),Ve(ze,Fa)),wn.mathMl===!0&&(Ve(je,Eu),Ve(ze,dm),Ve(ze,Fa))),St.tagCheck=null,St.attributeCheck=null,Zt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?St.tagCheck=S.ADD_TAGS:cr(S.ADD_TAGS)&&(je===kt&&(je=un(je)),Ve(je,S.ADD_TAGS,He))),Zt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?St.attributeCheck=S.ADD_ATTR:cr(S.ADD_ATTR)&&(ze===It&&(ze=un(ze)),Ve(ze,S.ADD_ATTR,He))),Zt(S,"ADD_URI_SAFE_ATTR")&&cr(S.ADD_URI_SAFE_ATTR)&&Ve(yt,S.ADD_URI_SAFE_ATTR,He),Zt(S,"FORBID_CONTENTS")&&cr(S.FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,S.FORBID_CONTENTS,He)),Zt(S,"ADD_FORBID_CONTENTS")&&cr(S.ADD_FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,S.ADD_FORBID_CONTENTS,He)),Dn&&(je["#text"]=!0),tt&&Ve(je,["html","head","body"]),je.table&&(Ve(je,["tbody"]),delete Dt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ar('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ar('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=K;K=S.TRUSTED_TYPES_POLICY;try{X=Ne("")}catch(we){throw K=Z,we}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,X=""):(K===void 0&&(K=te()),K&&typeof X=="string"&&(X=Ne("")));sn&&sn(S),kn=S},Xe=Ve({},[...ju,..._u,...zS]),Tt=Ve({},[...Eu,...FS]),ss=function(S,$,Z){return $.namespaceURI===at?S==="svg":$.namespaceURI===bt?S==="svg"&&(Z==="annotation-xml"||ge[Z]):!!Xe[S]},Il=function(S,$,Z){return $.namespaceURI===at?S==="math":$.namespaceURI===xt?S==="math"&&Be[Z]:!!Tt[S]},Dl=function(S,$,Z){return $.namespaceURI===xt&&!Be[Z]||$.namespaceURI===bt&&!ge[Z]?!1:!Tt[S]&&(De[S]||!Xe[S])},Nt=function(S){let $=A(S);(!$||!$.tagName)&&($={namespaceURI:Gt,tagName:"template"});const Z=uo(S.tagName),we=uo($.tagName);return E[S.namespaceURI]?S.namespaceURI===xt?ss(Z,$,we):S.namespaceURI===bt?Il(Z,$,we):S.namespaceURI===at?Dl(Z,$,we):!!(lt==="application/xhtml+xml"&&E[S.namespaceURI]):!1},gs=function(S){ui(s.removed,{element:S});try{A(S).removeChild(S)}catch{if(j(S),!A(S))throw Ar("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Us=function(S){fr(S);const $=T(S);if($){const we=[];ci($,be=>{ui(we,be)}),ci(we,be=>{try{j(be)}catch{}})}const Z=U(S);if(Z)for(let we=Z.length-1;we>=0;--we){const be=Z[we],Oe=be&&be.name;if(typeof Oe=="string")try{S.removeAttribute(Oe)}catch{}}},vs=function(S,$){try{ui(s.removed,{attribute:$.getAttributeNode(S),from:$})}catch{ui(s.removed,{attribute:null,from:$})}if($.removeAttribute(S),S==="is")if(ut||An)try{gs($)}catch{}else try{$.setAttribute(S,"")}catch{}},Or=function(S){const $=U(S);if($)for(let Z=$.length-1;Z>=0;--Z){const we=$[Z],be=we&&we.name;if(!(typeof be!="string"||ze[He(be)]))try{S.removeAttribute(be)}catch{}}},fr=function(S){const $=[S];for(;$.length>0;){const Z=$.pop();(P?P(Z):Z.nodeType)===Un.element&&Or(Z);const be=T(Z);if(be)for(let Oe=be.length-1;Oe>=0;--Oe)$.push(be[Oe])}},Ro=function(S){if(!Ue)return;const $=[S];for(;$.length>0;){const Z=$.pop(),we=P?P(Z):Z.nodeType;if(we===Un.processingInstruction||we===Un.comment&&Qt(hm,Z.data)){try{j(Z)}catch{}continue}if(we===Un.element){const Oe=Z,Ke=He(H?H(Z):Z.nodeName);try{Oe.hasAttribute&&Oe.hasAttribute("patchsrc")&&Oe.removeAttribute("patchsrc"),Oe.hasAttribute&&Oe.hasAttribute("for")&&Ke!=="label"&&Ke!=="output"&&Oe.removeAttribute("for")}catch{}}const be=T(Z);if(be)for(let Oe=be.length-1;Oe>=0;--Oe)$.push(be[Oe])}},pr=function(S){let $=null,Z=null;if(Ht)S="<remove></remove>"+S;else{const Oe=rm(S,/^[\r\n\t ]+/);Z=Oe&&Oe[0]}lt==="application/xhtml+xml"&&Gt===at&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const we=K?Ne(S):S;if(Gt===at)try{$=new v().parseFromString(we,lt)}catch{}if(!$||!$.documentElement){$=ie.createDocument(Gt,"template",null);try{$.documentElement.innerHTML=Je?X:we}catch{}}const be=$.body||$.documentElement;return S&&Z&&be.insertBefore(r.createTextNode(Z),be.childNodes[0]||null),Gt===at?F.call($,tt?"html":"body")[0]:tt?$.documentElement:be},Pn=function(S){const $=Y?Y(S):S.ownerDocument;return O.call($||S,S,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},$r=function(S){return S=oo(S,oe," "),S=oo(S,G," "),S=oo(S,ue," "),S},hn=function(S){var $;S.normalize();const Z=Y?Y(S):S.ownerDocument,we=O.call(Z||S,S,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let be=we.nextNode();for(;be;)be.data=$r(be.data),be=we.nextNode();const Oe=($=S.querySelectorAll)===null||$===void 0?void 0:$.call(S,"template");Oe&&ci(Oe,Ke=>{Bs(Ke.content)&&hn(Ke.content)})},zr=function(S){const $=H?H(S):null;return typeof $!="string"||He($)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==U(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==P(S)||S.childNodes!==T(S)},Bs=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return P(S)===Un.documentFragment}catch{return!1}},hr=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return typeof P(S)=="number"}catch{return!1}};function mn(le,S,$){le.length!==0&&ci(le,Z=>{Z.call(s,S,$,kn)})}const Fr=function(S,$){return!!(Ue&&S.hasChildNodes()&&!hr(S.firstElementChild)&&Qt(pm,S.textContent)&&Qt(pm,S.innerHTML)||Ue&&S.namespaceURI===at&&$==="style"&&hr(S.firstElementChild)||S.nodeType===Un.processingInstruction||Ue&&S.nodeType===Un.comment&&Qt(hm,S.data))},mr=function(S,$,Z){if(!Dt[$]&&Ni($)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,$)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck($)))return!1;if(Dn&&!Ft[$]){const we=A(S),be=T(S);if(be&&we){const Oe=be.length;for(let Ke=Oe-1;Ke>=0;--Ke){const Qe=S===Z?b(be[Ke],!0):be[Ke];we.insertBefore(Qe,_(S))}}}return gs(S),!0},gr=function(S,$,Z,we){return S.length===0?$:$===Z||$===we?un($):$},Ao=function(S,$){if(mn(D.beforeSanitizeElements,S,null),S!==$&&A(S)===null)return pn&&fr(S),!0;if(zr(S))return gs(S),!0;const Z=He(H?H(S):S.nodeName);if(je=gr(D.uponSanitizeElement,je,kt,gt),mn(D.uponSanitizeElement,S,{tagName:Z,allowedTags:je}),S!==$&&A(S)===null)return pn&&fr(S),!0;if(Fr(S,Z))return gs(S),!0;if(Dt[Z]||!(St.tagCheck instanceof Function&&St.tagCheck(Z))&&!je[Z]){const be=mr(S,Z,$);return be===!1&&mn(D.afterSanitizeElements,S,null),be}if((P?P(S):S.nodeType)===Un.element&&!Nt(S)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&Qt(XS,S.innerHTML))return gs(S),!0;if(pe&&S.nodeType===Un.text){const be=$r(S.textContent);S.textContent!==be&&(ui(s.removed,{element:S.cloneNode()}),S.textContent=be)}return mn(D.afterSanitizeElements,S,null),!1},Io=function(S,$,Z){if(Rn[$]||Ue&&$==="patchsrc"||Ue&&$==="for"&&S!=="label"&&S!=="output"||Ts&&($==="id"||$==="name")&&(Z in r||Z in Fs))return!1;const we=ze[$]||St.attributeCheck instanceof Function&&St.attributeCheck($,S);if(!(ht&&Qt(fe,$))){if(!(Mt&&Qt(Pe,$))){if(we){if(!yt[$]){if(!Qt(ot,oo(Z,Ee,""))){if(!(($==="src"||$==="xlink:href"||$==="href")&&S!=="script"&&im(Z,"data:")===0&&st[S])){if(!(en&&!Qt(Ce,oo(Z,Ee,"")))){if(Z)return!1}}}}}else if(!(Ni(S)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,S)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(S))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,$)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck($,S))||$==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,Z)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(Z))))return!1}}return!0},Ti=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ni=function(S){return!Ti[uo(S)]&&Qt(_e,S)},Ci=function(S,$,Z,we){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Z)switch(k.getAttributeType(S,$)){case"TrustedHTML":return Ne(we);case"TrustedScriptURL":return Le(we)}return we},vr=function(S,$,Z,we){try{Z?S.setAttributeNS(Z,$,we):S.setAttribute($,we),zr(S)?gs(S):sm(s.removed)}catch{vs($,S)}},Do=function(S){mn(D.beforeSanitizeAttributes,S,null);const $=S.attributes;if(!$||zr(S))return;ze=gr(D.uponSanitizeAttribute,ze,It,Rt);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let we=$.length;const be=He(S.nodeName);for(;we--;){const Oe=$[we],Ke=Oe.name,Qe=Oe.namespaceURI,Ct=Oe.value,jt=He(Ke),Ns=Ct;let Lt=Ke==="value"?Ns:IS(Ns);if(Z.attrName=jt,Z.attrValue=Lt,Z.keepAttr=!0,Z.forceKeepAttr=void 0,mn(D.uponSanitizeAttribute,S,Z),Lt=Z.attrValue,ms&&(jt==="id"||jt==="name")&&im(Lt,In)!==0&&(vs(Ke,S),Lt=In+Lt),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Lt)){vs(Ke,S);continue}if(jt==="attributename"&&rm(Lt,"href")){vs(Ke,S);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){vs(Ke,S);continue}if(!q&&Qt(QS,Lt)){vs(Ke,S);continue}if(pe&&(Lt=$r(Lt)),!Io(be,jt,Lt)){vs(Ke,S);continue}Lt=Ci(be,jt,Qe,Lt),Lt!==Ns&&vr(S,Ke,Qe,Lt)}}mn(D.afterSanitizeAttributes,S,null)},Ws=function(S){let $=null;const Z=Pn(S);for(mn(D.beforeSanitizeShadowDOM,S,null);$=Z.nextNode();)if(mn(D.uponSanitizeShadowNode,$,null),Ao($,S),Do($),Bs($.content)&&Ws($.content),(P?P($):$.nodeType)===Un.element){const be=R($);Bs(be)&&(Ge(be),Ws(be))}mn(D.afterSanitizeShadowDOM,S,null)},Ge=function(S){const $=[{node:S,shadow:null}];for(;$.length>0;){const Z=$.pop();if(Z.shadow){Ws(Z.shadow);continue}const we=Z.node,Oe=(P?P(we):we.nodeType)===Un.element,Ke=T(we);if(Ke)for(let Qe=Ke.length-1;Qe>=0;--Qe)$.push({node:Ke[Qe],shadow:null});if(Oe){const Qe=H?H(we):null;if(typeof Qe=="string"&&He(Qe)==="template"){const Ct=we.content;Bs(Ct)&&$.push({node:Ct,shadow:null})}}if(Oe){const Qe=R(we);Bs(Qe)&&$.push({node:null,shadow:Qe},{node:Qe,shadow:null})}}};return s.sanitize=function(le){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,Z=null,we=null,be=null;if(Je=!le,Je&&(le="<!-->"),typeof le!="string"&&!hr(le)&&(le=OS(le),typeof le!="string"))throw Ar("dirty is not a string, aborting");if(!s.isSupported)return le;mt?(je=gt,ze=Rt):ns(S),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(je=un(je)),D.uponSanitizeAttribute.length>0&&(ze=un(ze)),s.removed=[];const Oe=pn&&typeof le!="string"&&hr(le);if(Oe){Ro(le);const Ct=H?H(le):le.nodeName;if(typeof Ct=="string"){const jt=He(Ct);if(!je[jt]||Dt[jt])throw Us(le),Ar("root node is forbidden and cannot be sanitized in-place")}if(zr(le))throw Us(le),Ar("root node is clobbered and cannot be sanitized in-place");try{Ge(le)}catch(jt){throw Us(le),jt}}else if(hr(le))$=pr("<!---->"),Z=$.ownerDocument.importNode(le,!0),Z.nodeType===Un.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?$=Z:$.appendChild(Z),Ge(Z);else{if(!ut&&!pe&&!tt&&le.indexOf("<")===-1)return K&&Hn?Ne(le):le;if($=pr(le),!$)return ut?null:Hn?X:""}$&&Ht&&gs($.firstChild);const Ke=Oe?le:$;try{const Ct=Pn(Ke);for(;we=Ct.nextNode();)Ao(we,Ke),Do(we),Bs(we.content)&&Ws(we.content)}catch(Ct){throw Oe&&(Us(le),ci(s.removed,jt=>{jt.element&&fr(jt.element)})),Ct}if(Oe)return ci(s.removed,Ct=>{Ct.element&&fr(Ct.element)}),pe&&hn(le),le;if(ut){if(pe&&hn($),An)for(be=Q.call($.ownerDocument);$.firstChild;)be.appendChild($.firstChild);else be=$;return(ze.shadowroot||ze.shadowrootmode)&&(be=C.call(o,be,!0)),be}let Qe=tt?$.outerHTML:$.innerHTML;return tt&&je["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Qt(KS,$.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
|
|
465
|
-
`+Qe),pe&&(Qe=$r(Qe)),K&&Hn?Ne(Qe):Qe},s.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ns(le),mt=!0,gt=je,Rt=ze},s.clearConfig=function(){kn=null,mt=!1,gt=null,Rt=null,K=de,X=""},s.isValidAttribute=function(le,S,$){kn||ns({});const Z=He(le),we=He(S);return Io(Z,we,$)},s.addHook=function(le,S){typeof S=="function"&&Zt(D,le)&&ui(D[le],S)},s.removeHook=function(le,S){if(Zt(D,le)){if(S!==void 0){const $=RS(D[le],S);return $===-1?void 0:AS(D[le],$,1)[0]}return sm(D[le])}},s.removeHooks=function(le){Zt(D,le)&&(D[le]=[])},s.removeAllHooks=function(){D=mm()},s}var Cd=fv();const eb=new Set(["command_execution","file_change","mcp_tool_call","web_search"]),tb=100;function gm(t){return eb.has(t.type)}function nb({items:t,runtimeType:s,turn:r,threads:o=[]}){const[a,u]=w.useState(!1),[f,h]=w.useState(!1);if(t.length===0)return null;const g=t.length,m=f?0:Math.max(0,g-tb),v=m>0?t.slice(m):t;return l.jsxs("div",{className:"tool-calls",children:[l.jsxs("div",{className:"tool-calls-header",onClick:()=>u(k=>!k),children:[l.jsx("span",{className:"tool-calls-icon",children:l.jsx(Pw,{size:12})}),l.jsxs("span",{className:"tool-calls-summary",children:[g," tool call",g>1?"s":""]}),l.jsx(ld,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&l.jsxs("div",{className:"tool-calls-body",children:[m>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>h(!0),children:["Show ",m," earlier tool call",m>1?"s":""]})}),v.map(k=>l.jsx(Ms,{item:k,runtimeType:s,turn:r,threads:o},k.id))]})]})}qe.setOptions({breaks:!0,gfm:!0});function sb(t){const s=qe.parse(t);return Cd.sanitize(s)}function vm(t,s){var a;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>s)return{node:u,offset:s-o};o+=f}return null}function rb(t,s,r){const o=document.createTreeWalker(t,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,s)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,s)>=0||a.push(u))}for(const u of a){const f=u.length;let h=0,g=f;if(u===s.startContainer&&(h=Math.min(s.startOffset,f)),u===s.endContainer&&(g=Math.min(s.endOffset,f)),h>=g)continue;g<f&&u.splitText(g);const m=h>0?u.splitText(h):u,v=r(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function ib(t,s){t.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const a=document.createTextNode(r.textContent||"");o.replaceChild(a,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=vm(t,r.start_offset),a=vm(t,r.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),rb(t,u,()=>{const f=document.createElement("mark");return f.setAttribute("data-thread-id",r.id),r.status==="resolved"&&f.classList.add("thread-mark-resolved"),f})}}function ob(t){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.getRangeAt(0);if(r.collapsed||!t.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(t,0),o.setEnd(r.startContainer,r.startOffset);const a=o.toString().length,u=r.toString();return{start:a,end:a+u.length,text:u}}function ab({itemId:t,turnId:s,sessionId:r,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}),[j,_]=w.useState(!1),[T,A]=w.useState({x:0,y:0}),[R,U]=w.useState(""),[P,H]=w.useState(null),[Y,K]=w.useState(!1),X=L(F=>F.createThread),de=L(F=>F.switchRightTab),he=L(F=>xl(F.sessionDetails[r])),V=w.useCallback(async()=>{await ul(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),Te=w.useCallback(()=>{var C;if(!P)return;const F=`
|
|
466
|
-
\`\`\`QUOTE
|
|
467
|
-
${P.text}
|
|
468
|
-
\`\`\`
|
|
469
|
-
|
|
470
|
-
`;L.setState({quotedText:F}),k(!1),H(null),(C=window.getSelection())==null||C.removeAllRanges()},[P]),Ne=w.useMemo(()=>sb(o||"…"),[o]),Le=w.useMemo(()=>a.filter(F=>F.item_id===t),[a,t]);w.useEffect(()=>{u.current&&ib(u.current,Le)},[Ne,Le]),w.useEffect(()=>{g.current=R},[R]),w.useEffect(()=>{function F(C){f.current&&!f.current.contains(C.target)&&(k(!1),g.current.trim()||_(!1))}return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);const te=w.useCallback(()=>{k(!1),g.current.trim()||_(!1)},[]),se=w.useCallback(()=>{const F=u.current;if(!F)return;const C=ob(F);if(C&&C.text.trim().length>0){const D=window.getSelection();if(D&&D.rangeCount>0&&D.anchorNode&&D.focusNode){const G=D.getRangeAt(0).getBoundingClientRect(),ue=28,fe=6,Pe=170;let Ce=!1;try{const ot=document.createRange();ot.setStart(D.focusNode,D.focusOffset),ot.setEnd(D.focusNode,D.focusOffset);const je=document.createRange();je.setStart(D.anchorNode,D.anchorOffset),je.setEnd(D.anchorNode,D.anchorOffset),Ce=je.compareBoundaryPoints(Range.START_TO_START,ot)>0}catch{Ce=!1}let Ee=G.top-ue-fe;Ee<8&&(Ee=G.bottom+fe);let _e=Ce?G.left-Pe:G.right;_e=Math.max(8,Math.min(_e,window.innerWidth-Pe-8)),b({x:_e,y:Ee}),k(!0),H(C)}}else k(!1)},[]);w.useEffect(()=>{function F(C){const D=C.target;D&&(D.closest(".selection-actions")||D.closest(".thread-create-popover"))||se()}return document.addEventListener("mouseup",F),()=>document.removeEventListener("mouseup",F)},[se]);const ie=w.useCallback(()=>{k(!1),_(!0),A({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!j)return;const F=h.current;if(!F)return;const C=F.offsetWidth,D=F.offsetHeight,oe=8;let G=x.x,ue=x.y;G-C<oe&&(G=C+oe),G>window.innerWidth-oe&&(G=window.innerWidth-oe),ue<oe&&(ue=oe),ue+D>window.innerHeight-oe&&(ue=window.innerHeight-D-oe),A({x:G,y:ue})},[j,x]);const O=w.useCallback(async()=>{var F;he||!P||!R.trim()||(await X(r,{itemId:t,turnId:s,startOffset:P.start,endOffset:P.end,selectedText:P.text,message:R.trim()}),U(""),_(!1),H(null),(F=window.getSelection())==null||F.removeAllRanges(),de("threads"))},[P,R,X,r,t,s,de,he]),Q=w.useCallback(F=>{const C=F.target;if(C.tagName==="MARK"&&C.hasAttribute("data-thread-id")){F.preventDefault(),de("threads");const D=C.getAttribute("data-thread-id");setTimeout(()=>{const oe=document.getElementById(`thread-${D}`);oe&&(oe.scrollIntoView({behavior:"smooth",block:"center"}),oe.classList.add("thread-card-highlighted"),setTimeout(()=>oe.classList.remove("thread-card-highlighted"),1500))},100)}},[de]);return l.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[l.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:Ne},onMouseDown:te,onClick:Q}),l.jsx("button",{className:`copy-text-btn${Y?" copied":""}`,onClick:V,title:Y?"Copied":"Copy message","aria-label":"Copy message text",children:Y?l.jsx(Os,{size:14}):l.jsx(nl,{size:14})}),v&&!j&&l.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!he&&l.jsxs("button",{className:"discuss-button",onClick:ie,title:"Start a discussion about this text",children:[l.jsx(xw,{size:14}),l.jsx("span",{children:"Discuss"})]}),l.jsxs("button",{className:"discuss-button",onClick:Te,title:"Quote this text in your message",children:[l.jsx(kg,{size:14}),l.jsx("span",{children:"Quote"})]})]}),j&&l.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:T.x,top:T.y},children:[l.jsxs("div",{className:"thread-create-header",children:[l.jsxs("span",{className:"thread-create-quote",children:['"',P==null?void 0:P.text.slice(0,80),P&&P.text.length>80?"…":"",'"']}),l.jsx("button",{className:"thread-create-close",onClick:()=>{_(!1),H(null)},children:l.jsx(En,{size:14})})]}),l.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:R,onChange:F=>U(F.target.value),autoFocus:!0,rows:2,onKeyDown:F=>{if(F.key==="Enter"&&(F.metaKey||F.ctrlKey)&&(F.preventDefault(),O()),F.key==="Escape")if(g.current.trim()){const C=Date.now();m.current&&C-m.current<400?(m.current=0,_(!1),H(null)):m.current=C}else _(!1),H(null)}}),l.jsxs("div",{className:"thread-create-footer",children:[l.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),l.jsxs("button",{className:"thread-create-send",onClick:O,disabled:!R.trim()||he,title:he?"Wait for the running turn to finish first":void 0,children:[l.jsx(To,{size:13}),l.jsx("span",{children:"Send"})]})]})]})]})}const ym=w.memo(ab),gl=new Map,pv=new Set,Gu=new Set,xm=new Map;function hv(){Gu.forEach(t=>t())}function mv(t,s){return`${t}:${s}`}function lb(t,s,r,o,a){var g;const u=mv(s,r),f=gl.get(t)??new Map,h=new Map(f);((g=h.get(u))==null?void 0:g.answer)===a?h.delete(u):h.set(u,{itemIndex:s,groupIndex:r,question:o,answer:a}),gl.set(t,h),hv()}function cb(t){gl.delete(t),hv()}function ub(t){pv.add(t),cb(t)}function db(t){const s=w.useCallback(r=>(Gu.add(r),()=>{Gu.delete(r)}),[]);return w.useSyncExternalStore(s,()=>gl.get(t)??xm,()=>xm)}function fb(t){return[...t].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
|
|
471
|
-
${s.answer}`).join(`
|
|
472
|
-
|
|
473
|
-
`)}function wm({item:t,turn:s}){var b;const r=t.data??{},o=w.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(j=>!!j&&Array.isArray(j.selections)&&j.selections.length>0):[],[r.groups]),a=db(s.id),u=L(j=>s.session_id?j.sessionDetails[s.session_id]:null),f=L(j=>j.activeSessionId),h=s.items.findIndex(j=>j.id===t.id),g=u?((b=u.turns[u.turns.length-1])==null?void 0:b.id)===s.id:!0,m=pv.has(s.id),v=m||tg(u)||!g||s.session_id!==f,k=(j,_,T)=>{v||lb(s.id,h,j,_,T)},x=()=>{const j=[...a.values()];if(j.length===0)return;const _=fb(j);ub(s.id),L.getState().submitPrompt(_)};return l.jsxs("div",{className:"render-content ask-user-card",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(iw,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Question"}),m&&l.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?l.jsxs("div",{className:"ask-user-groups",children:[o.map((j,_)=>l.jsxs("div",{className:"ask-user-group",children:[j.question&&l.jsx("div",{className:"ask-user-question",children:j.question}),l.jsx("div",{className:"ask-user-options",children:j.selections.map(T=>{var R;const A=((R=a.get(mv(h,_)))==null?void 0:R.answer)===T;return l.jsx("button",{type:"button",className:`ask-user-option ${A?"selected":""}`,disabled:v,onClick:()=>k(_,j.question,T),children:T},T)})})]},_)),v?m&&l.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):l.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:x,children:[l.jsx(To,{size:12}),"Send"]})]}):r.question?l.jsx("p",{className:"user-message",children:r.question}):l.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const pb={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error"};function fo(t){return t&&pb[t]||"interrupted"}function vl(t){if(!t)return"";const s=new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function hb(t){switch(t){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 mb(t){return t.items.filter(s=>s.type==="interruption").map(s=>s.data)}function gb({item:t}){const s=t.data,r=vl(s.interrupted_at);let o="";switch(s.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=s.resumed_at?`resumed ${vl(s.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return l.jsx("div",{className:"interruption-marker",title:s.detail??void 0,children:l.jsxs("span",{children:["Interrupted",r?` ${r}`:""," (",fo(s.reason),") · ",o]})})}function vb({turn:t,label:s}){const[r,o]=w.useState(!1),a=L(f=>f.addToast),u=()=>{o(!0),jx(t.session_id,t.id).catch(f=>a("error",`Could not resume the turn — ${f.message}`)).finally(()=>o(!1))};return l.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:r,children:[l.jsx(Sg,{size:12}),s]})}function yb({turn:t}){const s=t.resume_state;if(!s||s==="cancelled")return null;const r=t.interrupt_reason,o=mb(t),a=o[o.length-1],u=vl(t.interrupted_at??(a==null?void 0:a.interrupted_at));if(s==="resumed"){const m=vl(a==null?void 0:a.resumed_at),v=t.status==="running"||t.status==="pending";return l.jsxs("div",{className:"interruption-banner resumed","data-state":"resumed",children:[l.jsx("span",{className:"banner-icon",children:l.jsx(Sg,{size:12})}),l.jsxs("span",{className:"banner-text",children:["Interrupted",u?` ${u}`:""," (",fo(r),") · resumed",m?` ${m}`:"",v?" — continuing…":""]})]})}let f,h=null,g=null;switch(s){case"waiting":f=hb(r),g="Resume now";break;case"resuming":f=`Interrupted (${fo(r)}) — 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=t.error&&!t.error.startsWith("Automatic resume stopped")?t.error:null,g="Resume";break}case"skipped":f=`Interrupted${u?` ${u}`:""} (${fo(r)}) — too long ago to resume automatically.`,g="Resume";break;default:f=`Interrupted (${fo(r)}) — this turn cannot be resumed.`,h=t.error}return l.jsxs("div",{className:"interruption-banner","data-state":s,children:[l.jsx("span",{className:"banner-icon",children:r==="network"?l.jsx(Ng,{size:12}):l.jsx(Tl,{size:12})}),l.jsxs("span",{className:"banner-text",children:[f,h&&l.jsx("span",{className:"banner-detail",children:h})]}),g&&l.jsx(vb,{turn:t,label:g})]})}function xb({turnId:t}){const s=L(o=>o.retryStates[t]);if(!s)return null;const r=s.errorStatus?`API error ${s.errorStatus}`:"Connection problem";return l.jsxs("div",{className:"retry-banner",children:[l.jsx("span",{className:"banner-icon",children:l.jsx(Ng,{size:12})}),l.jsxs("span",{className:"banner-text",children:[r," — retrying (attempt ",s.attempt," of ",s.maxRetries,")…"]})]})}qe.setOptions({breaks:!0,gfm:!0});const wb=10,kb=100;function Sb({attachments:t}){const[s,r]=w.useState(null);return w.useEffect(()=>{if(!s)return;function o(a){a.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!Array.isArray(t)||t.length===0?null:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"attachment-pills",children:t.map((o,a)=>{const u=o.media_type.startsWith("image/"),f=`data:${o.media_type};base64,${o.data}`;return l.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>r(f):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?l.jsx("img",{src:f,alt:o.name,className:"attachment-pill-thumb"}):l.jsx(vg,{size:12,className:"attachment-pill-icon"}),l.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),s&&l.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:l.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[l.jsx("img",{src:s,alt:"preview"}),l.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:l.jsx(En,{size:20})})]})})]})}function bb(t){const s=qe.parse(t);return Cd.sanitize(s)}function km(t){var s;return(s=t.data)!=null&&s.text?t.data.text:""}function Tb(t){const s=t.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:t}const Sm='<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 Nb(t){return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${Sm}</body>`):t+Sm}function Cb({html:t}){const[s,r]=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&&r(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),l.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:Nb(t),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const bm=1e4;function jb({item:t,runtimeType:s,turn:r,threads:o}){var h,g,m,v,k,x,b,j;const a=t.status==="in_progress",[u,f]=w.useState(!1);switch(t.type){case"agent_message":{const{iconClass:_,iconText:T}=Ou(s??"codex");return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:`turn-header-icon ${_}`,children:T}),l.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&l.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),l.jsx(ym,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:km(t)||"…",threads:o,runtimeType:s})]})}case"reasoning":return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(sw,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),l.jsx("div",{dangerouslySetInnerHTML:{__html:bb(km(t))}})]});case"command_execution":{const _=t.data||{},T=Tb(_.command||""),A=_.aggregated_output||"",R=_.exit_code,U=a?"running…":R!==null?`exit ${R}`:"",P=A.length>bm,H=P&&!u?A.slice(0,bm)+`
|
|
474
|
-
… (truncated, click to expand)`:A;return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(Tg,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Command"}),U&&l.jsx("span",{className:"turn-header-meta",children:U})]}),l.jsx("pre",{className:"cmd-block",children:l.jsx("code",{children:T})}),A&&l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"cmd-output",children:l.jsx("code",{children:H})}),P&&l.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(Y=>!Y),children:u?"Show less":`Show full output (${(A.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const _=(h=t.data)==null?void 0:h.changes,T=Array.isArray(_)?_:[],A=`${T.length} file${T.length!==1?"s":""}`;return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(uw,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"File Changes"}),l.jsx("span",{className:"turn-header-meta",children:A})]}),l.jsx("div",{className:"file-change-list",children:T.map((R,U)=>{const P=R.kind==="add"?"A":R.kind==="delete"?"D":"M",H=R.kind==="add"?"fc-add":R.kind==="delete"?"fc-del":"fc-mod";return l.jsxs("div",{className:"file-change",children:[l.jsx("span",{className:`fc-status ${H}`,children:P}),l.jsx("span",{className:"fc-name",children:R.path})]},U)})})]})}case"mcp_tool_call":{const _=t.data||{},T=_.tool||"mcp";if(T==="Agent"){const X=_.arguments,de=(X==null?void 0:X.description)||(X==null?void 0:X.prompt)||"Subagent",he=t.status==="failed",V=a?"running…":he?"failed":"done";return l.jsxs("div",{className:"agent-call-card",children:[l.jsx("span",{className:"agent-call-icon",children:l.jsx(dr,{size:14})}),l.jsx("span",{className:"agent-call-desc",children:de}),l.jsx("span",{className:`agent-call-status ${a?"running":he?"failed":"done"}`,children:V})]})}const A=_.server||"",R=_.arguments,U=_.result,P=_.error,H=t.status==="failed"||!!P,Y=a?"running…":H?"failed":"done",K=((g=U==null?void 0:U.content)==null?void 0:g.filter(X=>X.type==="text").map(X=>X.text))??[];return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(jw,{size:14})}),l.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),A&&l.jsx("span",{className:"turn-header-meta",children:A}),l.jsx("span",{className:"turn-header-meta",style:H?{color:"var(--red)"}:void 0,children:Y})]}),R&&Object.keys(R).length>0&&l.jsx("div",{className:"mcp-args",children:Object.entries(R).map(([X,de])=>l.jsxs("div",{className:"mcp-arg",children:[l.jsx("span",{className:"mcp-arg-key",children:X}),X==="code"?l.jsx("pre",{className:"cmd-block",children:l.jsx("code",{children:String(de)})}):l.jsx("span",{className:"mcp-arg-value",children:typeof de=="string"?de:JSON.stringify(de,null,2)})]},X))}),K.length>0&&K.map((X,de)=>l.jsx("pre",{className:"cmd-output",children:l.jsx("code",{children:X})},de)),P&&l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:P})})]})}case"web_search":{const _=((m=t.data)==null?void 0:m.query)||"";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(Rw,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),l.jsx("p",{className:"user-message",children:_})]})}case"todo_list":{const _=((v=t.data)==null?void 0:v.items)||[];return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(gw,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),l.jsx("ul",{className:"todo-list",children:_.map((T,A)=>l.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?l.jsx(Os,{size:14}):l.jsx(Lr,{size:14})," ",T.text]},A))})]})}case"ask_user":return l.jsx(wm,{item:t,turn:r});case"final_result":{const _=t.data??{},T=_.text||"",A=_.html||null,R=Array.isArray(_.groups)?_.groups.filter(H=>!!H&&Array.isArray(H.selections)&&H.selections.length>0):[],{iconClass:U,iconText:P}=Ou(s??"codex");return l.jsxs(l.Fragment,{children:[(T||A)&&l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:`turn-header-icon ${U}`,children:P}),l.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&l.jsx(ym,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:T,threads:o,runtimeType:s}),A&&l.jsx(Cb,{html:A})]}),R.length>0&&l.jsx(wm,{item:t,turn:r})]})}case"background_task":{const _=t.data||{},T=_.task_type||"unknown",A=_.subagent_type||null,R=_.description||"",U=_.status||"running",P=_.last_tool_name||null,H=_.token_count||null,Y=T==="local_agent",K=T==="local_bash",X=Y?dr:K?bg:gg,de=Y?`Subagent${A?`: ${A}`:""}`:K?"Monitor":"Background Task",he=U==="running"?"running…":U==="completed"?"done":U==="failed"?"failed":U==="stopped"?"stopped":U,V=t.status==="failed"||U==="failed";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(X,{size:14})}),l.jsx("span",{className:"turn-header-title",children:de}),l.jsx("span",{className:"turn-header-meta",style:V?{color:"var(--red)"}:void 0,children:he})]}),R&&l.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:R}),P&&a&&l.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",P,H!=null&&` · ${H.toLocaleString()} tokens`]}),l.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 _=((k=t.data)==null?void 0:k.trigger)??"auto",T=((x=t.data)==null?void 0:x.pre_tokens)??0,A=((b=t.data)==null?void 0:b.post_tokens)??0,R=T>0?Math.round((1-A/T)*100):0,U=_==="manual"?"Context compacted (/compact)":"Context auto-compacted";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(ww,{size:14})}),l.jsx("span",{className:"turn-header-title",children:U})]}),l.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",A.toLocaleString()," tokens (",R,"% reduction)"]})]})}case"interruption":return l.jsx(gb,{item:t});case"error":{const _=((j=t.data)==null?void 0:j.message)||"Unknown error";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:l.jsx(Tl,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Error"})]}),l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:_})})]})}default:return null}}const Ms=w.memo(jb,(t,s)=>t.item===s.item&&t.runtimeType===s.runtimeType&&t.threads===s.threads&&t.turn.id===s.turn.id);function _b({turn:t,runtimeType:s,threads:r=[]}){Ot.trackRender("TurnContent");const[o,a]=w.useState(!1),[u,f]=w.useState(!1),[h,g]=w.useState(!1);w.useEffect(()=>{const V=t.items.some(Te=>Te.type==="background_task"&&Te.status==="in_progress");t.status==="running"||t.status==="pending"?a(!0):t.status==="completed"&&!V&&a(!1)},[t.status,t.items]);let m=-1;for(let V=t.items.length-1;V>=0;V--)if(t.items[V].type==="agent_message"){m=V;break}const v=m>=0,k=v?t.items.slice(0,m):t.items,x=t.items.some(V=>V.type==="final_result"||V.type==="ask_user"),b=!v&&t.status==="completed"&&t.agent_response&&!x?{id:`response-${t.id}`,turn_id:t.id,external_item_id:`response-${t.id}`,type:"agent_message",data:{text:t.agent_response},status:"completed",created_at:t.created_at,updated_at:t.updated_at}:null,_=k.filter(V=>{var Te;return!(V.type==="reasoning"&&(!((Te=V.data)!=null&&Te.text)||V.data.text===""))}).filter(V=>!(V.type==="background_task"||V.type==="ask_user"||V.type==="final_result")),T=u?0:Math.max(0,_.length-kb),A=T>0?_.slice(T):_,R=[];let U=null;for(const V of A)V.type==="agent_message"?(U&&R.push(U),U={agentMessage:V,toolItems:[],otherItems:[]}):V.type==="interruption"||V.type==="error"?(U&&R.push(U),R.push({agentMessage:null,toolItems:[],otherItems:[V]}),U=null):(U||(U={agentMessage:null,toolItems:[],otherItems:[]}),gm(V)?U.toolItems.push(V):U.otherItems.push(V));U&&R.push(U);const P=t.items.filter(V=>V.type==="background_task"),H=h?0:Math.max(0,P.length-wb),Y=H>0?P.slice(H):P,K=_.filter(V=>gm(V)).length,X=K>0||_.length>0&&(t.status==="running"||t.status==="pending"),de=t.status==="pending"&&t.resume_state==="waiting",he=t.resume_state==="gave_up"||t.resume_state==="skipped"||t.resume_state==="unsupported";return l.jsxs("div",{className:"turn-group",children:[l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),l.jsx("span",{className:"turn-header-title",children:"You"})]}),l.jsx("p",{className:"user-message",children:t.user_prompt}),Array.isArray(t.attachments)&&t.attachments.length>0&&l.jsx(Sb,{attachments:t.attachments})]}),X&&l.jsxs("div",{className:"tool-calls",children:[l.jsxs("div",{className:"tool-calls-header",onClick:()=>a(V=>!V),children:[l.jsx("span",{className:"tool-calls-icon",children:l.jsx(pw,{size:12})}),l.jsx("span",{className:"tool-calls-summary",children:K>0?`${K} tool call${K>1?"s":""}`:de?"interrupted":"thinking…"}),l.jsx(ld,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&l.jsxs("div",{className:"tool-calls-body",children:[T>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>f(!0),children:["Show ",T," earlier step",T>1?"s":""]})}),R.map((V,Te)=>l.jsxs("div",{className:"intermediate-segment",children:[V.agentMessage&&l.jsx(Ms,{item:V.agentMessage,runtimeType:s,turn:t,threads:r}),V.otherItems.map(Ne=>l.jsx(Ms,{item:Ne,runtimeType:s,turn:t,threads:r},Ne.id)),V.toolItems.length>0&&l.jsx(nb,{items:V.toolItems,runtimeType:s,turn:t,threads:r})]},Te))]})]}),H>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(!0),children:["Show ",H," earlier background task",H>1?"s":""]})}),Y.map(V=>l.jsx(Ms,{item:V,runtimeType:s,turn:t,threads:r},`task-${V.id}`)),v&&l.jsx(Ms,{item:t.items[m],runtimeType:s,turn:t,threads:r},t.items[m].id),b&&l.jsx(Ms,{item:b,runtimeType:s,turn:t,threads:r},b.id),v&&t.items.slice(m+1).filter(V=>V.type!=="ask_user"&&V.type!=="background_task"&&V.type!=="final_result").map(V=>l.jsx(Ms,{item:V,runtimeType:s,turn:t,threads:r},V.id)),t.items.filter(V=>V.type==="final_result").map(V=>l.jsx(Ms,{item:V,runtimeType:s,turn:t,threads:r},`final-${V.id}`)),t.items.filter(V=>V.type==="ask_user").map(V=>l.jsx(Ms,{item:V,runtimeType:s,turn:t,threads:r},`ask-${V.id}`)),t.items.length===0&&!t.error&&(t.status==="pending"||t.status==="running")&&l.jsx("div",{className:"render-content",children:l.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:t.status==="running"?"Agent is thinking…":"Waiting to start…"})}),t.error&&!he&&l.jsx("div",{className:"render-content",children:l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:t.error})})}),t.status==="running"&&l.jsx(xb,{turnId:t.id}),l.jsx(yb,{turn:t}),t.status==="aborted"&&l.jsxs("div",{className:"aborted-banner",children:[l.jsx("span",{className:"banner-icon",children:l.jsx(Lr,{size:12})}),l.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const Eb=w.memo(_b),Rb=[],Ua=50;function Ab(){Ot.trackRender("RenderArea");const t=L(x=>x.activeSessionId),s=L(x=>x.activeSessionId?x.sessionDetails[x.activeSessionId]:null),r=L(x=>x.submittingPrompt),o=L(x=>x.loading),a=(s==null?void 0:s.turns)??[],u=(s==null?void 0:s.threads)??Rb,f=w.useRef(null),[h,g]=w.useState(Ua);w.useEffect(()=>{g(Ua)},[t]);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)},[t,a.length]),o&&!s?l.jsx("div",{className:"render-scroll",children:l.jsxs("div",{className:"skeleton-bars",children:[l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"})]})}):s?l.jsxs("div",{className:"render-scroll",ref:f,children:[r&&l.jsx("div",{className:"turn-block",children:l.jsxs("div",{className:"turn-group",children:[l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),l.jsx("span",{className:"turn-header-title",children:"You"})]}),l.jsx("p",{className:"user-message",children:r})]}),l.jsx("div",{className:"render-content",children:l.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),a.length===0&&!r&&l.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),v>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(x=>x+Ua),children:["Show ",Math.min(Ua,v)," earlier turns (",v," hidden)"]})}),k.map((x,b)=>l.jsx("div",{id:`turn-${v+b}`,className:"turn-block",children:l.jsx(Eb,{turn:x,runtimeType:s.runtime_type,threads:u})},x.id))]}):l.jsx("div",{className:"render-scroll",children:l.jsx("div",{className:"empty-state",children:"No session selected"})})}const Ib=w.memo(Ab),Db=[{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 Mb(t){return t.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function Lb(t,s,r=[]){const o=[...Db,...Mb(r)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!s[u.capability])||t&&!u.label.toLowerCase().includes(t.toLowerCase())))}function Pb({commands:t,selectedIndex:s,onSelect:r,onHover:o}){return l.jsxs("div",{className:"slash-popup",children:[l.jsx("div",{className:"slash-popup-header",children:"Commands"}),t.length===0&&l.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),t.map((a,u)=>l.jsxs("div",{className:`slash-popup-item ${u===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(a),children:[l.jsx("span",{className:"slash-popup-label",children:a.label}),l.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function Au({title:t,options:s,currentValue:r,onSelect:o,onClose:a}){return l.jsxs("div",{className:"slash-popup",children:[l.jsxs("div",{className:"slash-popup-header",children:[l.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),l.jsx("span",{children:t})]}),s.map(u=>l.jsxs("div",{className:`slash-popup-item ${u.value===r?"selected":""}`,onClick:()=>o(u.value),children:[l.jsxs("div",{className:"slash-popup-item-main",children:[l.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&l.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===r&&l.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function Ob(t){return fn("/skills")}function $b({filter:t,onSelect:s,onClose:r}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,g]=w.useState(0),m=w.useRef(null);w.useEffect(()=>{Ob().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(t.toLowerCase())||k.description.toLowerCase().includes(t.toLowerCase()));return w.useEffect(()=>{g(0)},[t]),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]&&s(v[h])):x.key==="Escape"&&(x.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,h,s,r]),l.jsxs("div",{className:"slash-popup",ref:m,children:[l.jsxs("div",{className:"slash-popup-header",children:[l.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),l.jsx("span",{children:"Skills"})]}),u&&l.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&l.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,x)=>l.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>g(x),onClick:()=>s(k),children:[l.jsxs("div",{className:"slash-popup-item-main",children:[l.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&l.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&l.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function zb(){return fn("/providers")}function Fb(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return fn(`/providers/${t}/commands${r}`)}const Ub={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function Bb(t){const[s,r]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{zb().then(r).catch(()=>r([])).finally(()=>a(!1))},[]);const u=s.find(f=>f.id===t)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??Ub,loading:o}}const di=32,Iu=200;function Tm(t){if(!t)return{};try{return JSON.parse(t)}catch{return{}}}function Nm(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}let Cm=0;function Wb(){return Cm+=1,`att-${Date.now()}-${Cm}`}function Hb(){Ot.trackRender("CommandInputBar");const[t,s]=w.useState(""),r=w.useRef(null),o=w.useRef(di),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:g}=L(),m=L(q=>q.activeSessionId),v=L(q=>q.activeSessionId?q.sessionDetails[q.activeSessionId]:null),k=L(q=>q.quotedText),x=tg(v),b=!!(v!=null&&v.turns.some(q=>q.status==="pending"&&q.resume_state==="waiting")),j=!m,{capabilities:_}=Bb(v==null?void 0:v.runtime_type),T=(v==null?void 0:v.runtime_type)??null,A=_.imageAttachments,[R,U]=w.useState([]),[P,H]=w.useState(!1),[Y,K]=w.useState(null),[X,de]=w.useState([]);w.useEffect(()=>{if(!T){de([]);return}let q=!1;return Fb(T,(v==null?void 0:v.cwd)??void 0).then(pe=>{q||de(pe)}).catch(()=>{q||de([])}),()=>{q=!0}},[T,v==null?void 0:v.cwd]);const[he,V]=w.useState(!1),[Te,Ne]=w.useState(""),[Le,te]=w.useState(0),[se,ie]=w.useState(void 0),[O,Q]=w.useState(!1),[F,C]=w.useState(""),[D,oe]=w.useState([]),G=he?Lb(Te,_,X):[];w.useEffect(()=>{k!==null&&(s(q=>q+k),setTimeout(()=>{if(r.current){je(),r.current.focus();const q=r.current.value.length;r.current.setSelectionRange(q,q)}},0),L.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function q(pe){pe.key==="Escape"&&(pe.preventDefault(),f())}return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[x,f]),w.useEffect(()=>{V(!1),ie(void 0),Q(!1),oe([]),U(q=>{for(const pe of q)pe.previewUrl&&URL.revokeObjectURL(pe.previewUrl);return[]})},[m]),w.useEffect(()=>{if(!Y)return;function q(pe){pe.key==="Escape"&&(pe.preventDefault(),K(null))}return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[Y]);const ue=w.useCallback(q=>{if(!q)return;const pe=Array.from(q);for(const Ue of pe){const tt=new FileReader;tt.onload=()=>{const gt=tt.result.split(",")[1]??"",Rt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;U(Ht=>[...Ht,{id:Wb(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:gt,previewUrl:Rt,size:Ue.size}])},tt.readAsDataURL(Ue)}},[]),fe=w.useCallback(q=>{U(pe=>{const Ue=pe.find(tt=>tt.id===q);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),pe.filter(tt=>tt.id!==q)})},[]),Pe=w.useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(!A||x)&&H(!0)},[A,x]),Ce=w.useCallback(q=>{q.preventDefault(),q.stopPropagation(),H(!1)},[]),Ee=w.useCallback(q=>{q.preventDefault(),q.stopPropagation(),H(!1),!(!A||x)&&ue(q.dataTransfer.files)},[A,x,ue]),_e=w.useCallback(q=>{var tt;if(!A)return;const pe=(tt=q.clipboardData)==null?void 0:tt.items;if(!pe)return;const Ue=[];for(let mt=0;mt<pe.length;mt++){const gt=pe[mt];if(gt.type.startsWith("image/")){const Rt=gt.getAsFile();Rt&&Ue.push(Rt)}}Ue.length>0&&(q.preventDefault(),ue(Ue))},[A,ue]);function ot(q){const pe=r.current;pe&&(pe.style.height=`${q}px`,o.current=q)}function je(){const q=r.current;if(q){if(q.scrollHeight>q.clientHeight){const pe=Math.min(q.scrollHeight,Iu);pe!==o.current&&ot(pe);return}o.current>di&&(q.style.height="auto",ot(Math.min(q.scrollHeight,Iu)))}}function kt(){const q=t.trim();if(!q||x)return;let pe=q;D.length>0&&(pe=`${D.map(mt=>`$${mt.name}`).join(" ")}
|
|
475
|
-
|
|
476
|
-
${q}`);const Ue=R.map(({id:tt,previewUrl:mt,size:gt,...Rt})=>Rt);s(""),oe([]),ot(di),V(!1),ie(void 0),Q(!1);for(const tt of R)tt.previewUrl&&URL.revokeObjectURL(tt.previewUrl);U([]),u(pe,Ue.length>0?Ue:void 0)}function ze(q){if(q.insertAsText){const pe=`/${q.id} `;s(pe),V(!1),ie(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=pe.length;r.current.setSelectionRange(Ue,Ue),je()}});return}q.subPopup?ie(q.subPopup):q.id==="skills"?(Q(!0),C(""),V(!1),s("")):q.id==="model"?(g(!0),V(!1),s("")):(V(!1),s(""))}function It(q){oe(pe=>[...pe,q]),Q(!1),s(""),ot(di)}function Fe(q){const pe=Tm(v==null?void 0:v.runtime_config);se==="sandbox"?pe.sandboxMode=q:se==="websearch"?pe.webSearchMode=q:se==="network"&&(pe.networkAccessEnabled=q==="true"),h(pe),ie(void 0),V(!1),s(""),ot(di)}function Dt(q){if(Ot.markKeystroke(),he&&!se){if(q.key==="ArrowDown"){q.preventDefault(),te(pe=>Math.min(pe+1,G.length-1));return}if(q.key==="ArrowUp"){q.preventDefault(),te(pe=>Math.max(pe-1,0));return}if(q.key==="Enter"){q.preventDefault(),G[Le]&&ze(G[Le]);return}if(q.key==="Escape"){q.preventDefault(),V(!1),s("");return}}if(se&&q.key==="Escape"){q.preventDefault(),ie(void 0);return}if(q.key==="Enter"&&(q.metaKey||q.ctrlKey)&&!x){q.preventDefault(),kt();return}q.key==="Escape"&&x&&(q.preventDefault(),f())}function Rn(q){Ot.markInputChange();const pe=q.target.value;s(pe),je(),pe.startsWith("/")&&!pe.includes(" ")&&!x?(V(!0),Ne(pe.slice(1)),te(0)):(V(!1),ie(void 0)),pe.startsWith("$")&&!x?(Q(!0),C(pe.slice(1))):pe.startsWith("$")||Q(!1)}const St=Tm(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"}],ht=[{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 l.jsxs("div",{className:`cmd-bar${P?" drag-over":""}`,onDragOver:Pe,onDragLeave:Ce,onDrop:Ee,children:[he&&!se&&l.jsx(Pb,{commands:G,selectedIndex:Le,onSelect:ze,onHover:te}),he&&se==="sandbox"&&l.jsx(Au,{title:"Sandbox Mode",options:Mt,currentValue:St.sandboxMode,onSelect:Fe,onClose:()=>ie(void 0)}),he&&se==="websearch"&&l.jsx(Au,{title:"Web Search",options:ht,currentValue:St.webSearchMode,onSelect:Fe,onClose:()=>ie(void 0)}),he&&se==="network"&&l.jsx(Au,{title:"Network Access",options:en,currentValue:St.networkAccessEnabled===!0?"true":"false",onSelect:Fe,onClose:()=>ie(void 0)}),O&&l.jsx($b,{filter:F,onSelect:It,onClose:()=>{Q(!1),s("")}}),D.length>0&&l.jsx("div",{className:"skill-badges",children:D.map(q=>l.jsxs("span",{className:"skill-badge",children:["$",q.name,l.jsx("button",{className:"skill-badge-remove",onClick:()=>oe(pe=>pe.filter(Ue=>Ue.id!==q.id)),children:"×"})]},q.id))}),R.length>0&&l.jsx("div",{className:"attachment-preview-area",children:R.map(q=>l.jsxs("div",{className:"attachment-chip",title:q.name,children:[q.previewUrl?l.jsx("img",{src:q.previewUrl,alt:q.name,className:"attachment-thumb",onClick:()=>K(q),style:{cursor:"pointer"}}):l.jsx(vg,{size:20,className:"attachment-file-icon"}),l.jsxs("div",{className:"attachment-info",children:[l.jsx("span",{className:"attachment-name",children:q.name}),l.jsx("span",{className:"attachment-size",children:Nm(q.size)})]}),l.jsx("button",{className:"attachment-remove",onClick:()=>fe(q.id),title:"Remove attachment",children:l.jsx(En,{size:14})})]},q.id))}),A&&!x&&!j&&l.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:q=>{ue(q.target.files),q.target.value=""}}),l.jsxs("div",{className:"cmd-input-row",children:[A&&!x&&!j&&l.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var q;return(q=a.current)==null?void 0:q.click()},title:"Attach files",disabled:x,children:l.jsx(Nw,{size:16})}),l.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:j?"Select or create a session…":b?"Interrupted — waiting to resume…":x?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:t,disabled:x||j,rows:1,style:{minHeight:di,maxHeight:Iu},onChange:Rn,onKeyDown:Dt,onPaste:_e}),x?l.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:l.jsx(Lr,{size:15})}):l.jsx("button",{className:"cmd-send-btn",onClick:kt,disabled:!t.trim()||j,title:"Send (⌘↵)",children:l.jsx(tw,{size:16})})]}),Y&&l.jsx("div",{className:"image-preview-modal",onClick:()=>K(null),children:l.jsxs("div",{className:"image-preview-content",onClick:q=>q.stopPropagation(),children:[l.jsx("img",{src:Y.previewUrl,alt:Y.name}),l.jsxs("div",{className:"image-preview-info",children:[l.jsx("span",{children:Y.name}),l.jsx("span",{children:Nm(Y.size)})]}),l.jsx("button",{className:"image-preview-close",onClick:()=>K(null),children:l.jsx(En,{size:20})})]})})]})}function Vb(){const t=L(T=>T.activeSessionId),s=L(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),r=L(T=>T.activeTurnIndex),o=L(T=>T.setActiveTurnIndex),a=L(T=>T.rewindToTurn),u=L(T=>T.restoreSession),f=L(T=>T.branchFromTurn),h=(s==null?void 0:s.turns)??[],g=xl(s),m=!!(s!=null&&s.rewound_at_turn_id),v=(s==null?void 0:s.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),j=w.useRef(null);if(bl(j,()=>b(null),!!x),id(()=>b(null),!!x),h.length===0)return l.jsx("div",{className:"empty-state",children:"No turns yet"});function _(T){o(T),requestAnimationFrame(()=>{var A;(A=document.getElementById(`turn-${T}`))==null||A.scrollIntoView({behavior:"smooth",block:"start"})})}return l.jsxs("div",{className:"right-section",children:[l.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((T,A)=>{const R=A===r,U=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,P=T.status==="running"||T.status==="pending";return l.jsx("div",{children:l.jsxs("div",{className:`turn-item ${R?"active":""}`,onClick:()=>_(A),onContextMenu:H=>{H.preventDefault(),b({x:H.clientX,y:H.clientY,turnId:T.id,turnIndex:A,isLast:A===h.length-1,isSlashCommand:T.user_prompt.trimStart().startsWith("/")})},children:[l.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:l.jsx(Lw,{size:12})}),l.jsx("span",{className:"turn-item-label",children:U}),P&&l.jsx("span",{className:"turn-item-status",children:T.status==="pending"&&T.resume_state==="waiting"?"interrupted":"running…"})]})},T.id)}),x&&l.jsxs("div",{ref:j,className:"ctx-menu",style:{position:"fixed",left:x.x,top:x.y,zIndex:500},children:[l.jsxs("div",{className:`ctx-menu-item ${x.isLast||g||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||g||x.isSlashCommand||(window.confirm(k)&&a(t,x.turnId),b(null))},children:[l.jsx(Ew,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),m&&!v&&l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(t),b(null)},children:[l.jsx(wo,{size:12})," Restore Rewind"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(t,x.turnId),b(null)},children:[l.jsx(dw,{size:12})," Branch from Here"]})]})]})}const jm=2e4;function qb(t){const s=[];return t.forEach((r,o)=>{var a;for(const u of r.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function Gb({entry:t}){const{item:s,turnIndex:r,turnPrompt:o}=t,a=s.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=s.status==="in_progress",j=u==="local_agent",_=u==="local_bash",T=j?dr:_?bg:gg,A=j?`Subagent${f?`: ${f}`:""}`:_?"Monitor":"Background Task",R=g==="running"?"running…":g==="completed"?"done":g==="failed"?"failed":g==="stopped"?"stopped":g,U=s.status==="failed"||g==="failed",[P,H]=w.useState(b),[Y,K]=w.useState(!1),X=w.useRef(null);w.useEffect(()=>{b&&H(!0)},[b]),w.useEffect(()=>{P&&b&&X.current&&(X.current.scrollTop=X.current.scrollHeight)},[P,b,x]);const de=x.length>jm,he=de&&!Y?x.slice(0,jm)+`
|
|
477
|
-
… (truncated, click to expand)`:x,V=b?null:g==="completed"?l.jsx(Os,{size:12}):U?l.jsx(Tl,{size:12}):l.jsx(Lr,{size:12});return l.jsxs("div",{className:`task-card ${b?"task-running":""} ${U?"task-failed":""}`,children:[l.jsxs("div",{className:"task-card-header",onClick:()=>H(Te=>!Te),style:{cursor:"pointer"},children:[l.jsx("span",{className:"task-card-icon",children:l.jsx(T,{size:14})}),l.jsx("span",{className:"task-card-type",children:A}),l.jsxs("span",{className:`task-card-status ${U?"task-status-failed":b?"task-status-running":"task-status-done"}`,children:[V," ",R]}),l.jsx(ld,{size:14,className:"task-card-chevron",style:{transform:P?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&l.jsx("div",{className:"task-card-desc",children:h}),b&&v&&l.jsxs("div",{className:"task-card-meta",children:["last tool: ",v,k!=null&&` · ${k.toLocaleString()} tokens`]}),P&&l.jsxs("div",{className:"task-card-body",children:[x?l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"cmd-output task-output",ref:X,children:l.jsx("code",{children:he})}),de&&l.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(Te=>!Te),children:Y?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):m?l.jsx("pre",{className:"cmd-output task-output",children:l.jsx("code",{children:m})}):b?l.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):l.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),l.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const Kb=w.memo(Gb);function Yb(){var g,m;const t=L(v=>v.activeSessionId?v.sessionDetails[v.activeSessionId]:null),s=L(v=>v.activeSessionId?v.backgroundTasks[v.activeSessionId]:void 0),r=(t==null?void 0:t.turns)??[],o=s??[],a=qb(r),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?l.jsx("div",{className:"empty-state",children:"No background tasks yet"}):l.jsxs("div",{className:"right-section",children:[l.jsxs("div",{className:"right-section-title",children:["Background Tasks (",a.length,")",h>0&&l.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",h," running"]})]}),u.map(v=>l.jsx(Kb,{entry:v},v.item.id))]})}const Xb=w.memo(Yb),Qb="Your job is to answer questions about this session:",_m="Understand the user's question below, read the session file given above, and answer.",Zb=new Set(["claude"]);function Jb(t){return Zb.has(t)}function jd(t){return t.kind==="sidecar"}function eT(t){const s=(t??[]).filter(jd);return s.length?s[s.length-1]:null}function tT(t){if(!t.startsWith(Qb))return t;const s=t.indexOf(_m);return s<0?t:t.slice(s+_m.length).replace(/^\n+/,"")}function nT({thread:t,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:a}=L(),[u,f]=w.useState(""),[h,g]=w.useState(!1),[m,v]=w.useState(!1);async function k(){if(!r||h)return;g(!0),await a(r,t.id,u)?s():g(!1)}async function x(){!r||m||(v(!0),await o(r,t.id),s())}const b=h||m;return l.jsx("div",{className:"dialog-overlay",onClick:b?void 0:s,children:l.jsxs("div",{className:"dialog",onClick:j=>j.stopPropagation(),children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"Resolve thread"}),l.jsx("button",{className:"dialog-close",onClick:s,disabled:b,children:l.jsx(En,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[l.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."}),l.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",l.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:j=>f(j.target.value),rows:3,disabled:b,autoFocus:!0})]})]}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:b,children:"Cancel"}),l.jsxs("button",{className:"dialog-btn-cancel",onClick:x,disabled:b,title:"Resolve without sharing",children:[m?l.jsx(Jn,{size:13,className:"spin"}):l.jsx(tl,{size:13}),"Resolve only"]}),l.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:b,children:[h?l.jsx(Jn,{size:13,className:"spin"}):l.jsx(Aw,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const Em=[];qe.setOptions({breaks:!0,gfm:!0});function sT(t){const s=qe.parse(t);return Cd.sanitize(s)}function rT(t){var s,r,o;if(t.type==="agent_message"||t.type==="final_result"){const a=(s=t.data)==null?void 0:s.text;return typeof a=="string"&&a?a:null}if(t.type==="ask_user"){const a=Array.isArray((r=t.data)==null?void 0:r.groups)?t.data.groups:[],u=[(o=t.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
|
|
478
|
-
|
|
479
|
-
`):null}return null}function iT(t){const s=t.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:t}function gv({turn:t,formatPrompt:s=iT}){const r=s(t.user_prompt),o=t.items.map(rT).filter(a=>a!==null);return o.length===0&&t.status==="completed"&&t.agent_response&&o.push(t.agent_response),l.jsxs("div",{className:"thread-card-turn",children:[l.jsx("div",{className:"thread-card-user-message",children:r}),o.map((a,u)=>l.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:sT(a)}},u)),o.length===0&&(t.status==="pending"||t.status==="running")&&l.jsx("div",{className:"thread-card-pending",children:t.status==="running"?"AI is responding…":"Waiting…"}),t.status==="failed"&&l.jsx("div",{className:"thread-card-pending",children:t.error||"Turn failed"})]})}function oT({thread:t,threadTurns:s,onStop:r,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var Ne,Le,te;const[g,m]=w.useState(""),[v,k]=w.useState(!0),x=w.useRef(null),b=w.useRef(null),[j,_]=w.useState(!1),[T,A]=w.useState({x:0,y:0}),[R,U]=w.useState(""),P=s.some(ur),H=28,Y=120,K=w.useRef(H);w.useEffect(()=>{const se=b.current;se&&(se.scrollTop=se.scrollHeight)},[s.length,v]);function X(se){const ie=x.current;ie&&(ie.style.height=`${se}px`,K.current=se)}function de(){const se=x.current;if(se){if(se.scrollHeight>se.clientHeight){const ie=Math.min(se.scrollHeight,Y);ie!==K.current&&X(ie);return}K.current>H&&(se.style.height="auto",X(Math.min(se.scrollHeight,Y)))}}const he=w.useCallback(()=>{_(!1)},[]),V=w.useCallback(()=>{const se=b.current;if(!se)return;const ie=window.getSelection();if(!ie||ie.rangeCount===0||ie.isCollapsed){_(!1);return}const O=ie.getRangeAt(0);if(!se.contains(O.commonAncestorContainer)){_(!1);return}const Q=O.commonAncestorContainer.nodeType===Node.TEXT_NODE?O.commonAncestorContainer.parentElement:O.commonAncestorContainer;if(!(Q!=null&&Q.closest(".thread-card-ai-response"))){_(!1);return}const F=ie.toString();if(!F.trim()){_(!1);return}const C=O.getBoundingClientRect(),D=28,oe=6,G=170;let ue=!1;if(ie.anchorNode&&ie.focusNode)try{const Ce=document.createRange();Ce.setStart(ie.focusNode,ie.focusOffset),Ce.setEnd(ie.focusNode,ie.focusOffset);const Ee=document.createRange();Ee.setStart(ie.anchorNode,ie.anchorOffset),Ee.setEnd(ie.anchorNode,ie.anchorOffset),ue=Ee.compareBoundaryPoints(Range.START_TO_START,Ce)>0}catch{ue=!1}let fe=C.top-D-oe;fe<8&&(fe=C.bottom+oe);let Pe=ue?C.left-G:C.right;Pe=Math.max(8,Math.min(Pe,window.innerWidth-G-8)),A({x:Pe,y:fe}),U(F),_(!0)},[]);w.useEffect(()=>{function se(ie){const O=ie.target;O&&O.closest(".selection-actions")||V()}return document.addEventListener("mouseup",se),()=>document.removeEventListener("mouseup",se)},[V]);const Te=w.useCallback(()=>{var ie;const se=`
|
|
480
|
-
\`\`\`QUOTE
|
|
481
|
-
${R}
|
|
482
|
-
\`\`\`
|
|
483
|
-
|
|
484
|
-
`;m(O=>O+se),_(!1),U(""),(ie=window.getSelection())==null||ie.removeAllRanges(),setTimeout(()=>{if(x.current){de(),x.current.focus();const O=x.current.value.length;x.current.setSelectionRange(O,O)}},0)},[R]);return l.jsxs("div",{className:`thread-card ${t.status==="resolved"?"thread-resolved":""}`,id:`thread-${t.id}`,children:[l.jsxs("div",{className:"thread-card-header",onClick:()=>k(se=>!se),children:[l.jsx("div",{className:"thread-card-quote",children:t.selected_text===null?((te=(Le=(Ne=t.turns)==null?void 0:Ne[0])==null?void 0:Le.user_prompt)==null?void 0:te.slice(0,100))||"Quick question":`“${t.selected_text.slice(0,100)}${t.selected_text.length>100?"…":""}”`}),l.jsxs("div",{className:"thread-card-header-right",children:[t.selected_text!==null&&l.jsx("button",{className:"thread-locate-btn",onClick:se=>{se.stopPropagation(),h()},title:"Scroll to text",children:l.jsx(kw,{size:12})}),l.jsx("span",{className:`thread-status-badge ${t.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:t.status==="open"?"Open":"Resolved"})]})]}),v&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"thread-card-conversation",ref:b,onMouseDown:he,children:[s.map(se=>l.jsx(gv,{turn:se},se.id)),s.length===0&&l.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),j&&l.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:l.jsxs("button",{className:"discuss-button",onClick:Te,title:"Quote this text in your follow-up",children:[l.jsx(kg,{size:14}),l.jsx("span",{children:"Quote"})]})}),t.status==="open"&&l.jsxs("div",{className:"thread-card-followup",children:[l.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:P?"Agent is running…":"Type a follow-up…",value:g,onChange:se=>{Ot.markInputChange(),m(se.target.value),de()},disabled:P,rows:1,style:{minHeight:H,maxHeight:Y},onKeyDown:se=>{Ot.markKeystroke(),se.key==="Enter"&&(se.metaKey||se.ctrlKey)&&!P&&g.trim()&&(se.preventDefault(),f(g.trim()),m(""),X(H))}}),l.jsx("button",{className:"thread-card-followup-send",disabled:P||!g.trim(),onClick:()=>{f(g.trim()),m("")},children:l.jsx(To,{size:13})}),P&&l.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:l.jsx(Lr,{size:13})})]}),l.jsxs("div",{className:"thread-card-actions",children:[t.status==="open"?l.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[l.jsx(tl,{size:13})," Resolve"]}):l.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[l.jsx(wo,{size:13})," Reopen"]}),l.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[l.jsx(fs,{size:13})," Delete"]})]})]})]})}function aT(){Ot.trackRender("ThreadsPanel");const t=L(A=>A.activeSessionId),s=L(A=>{var R;return A.activeSessionId?((R=A.sessionDetails[A.activeSessionId])==null?void 0:R.threads)??Em:Em}),r=w.useMemo(()=>s.filter(A=>!jd(A)),[s]),o=L(A=>A.followupThread),a=L(A=>A.cancelThreadTurn),u=L(A=>A.reopenThread),f=L(A=>A.deleteThread),h=L(A=>A.deepLinkThreadId),g=L(A=>A.setDeepLinkThreadId),[m,v]=w.useState("open"),[k,x]=w.useState(null);w.useEffect(()=>{if(!h)return;const A=h;g(null),v(U=>r.some(P=>P.id===A&&P.status==="open")?U:"all");const R=setTimeout(()=>{const U=document.getElementById(`thread-${A}`);U&&(U.scrollIntoView({behavior:"smooth",block:"center"}),U.classList.add("thread-card-highlighted"),setTimeout(()=>U.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(R)},[h,g,r]);const b=r.filter(A=>m==="open"?A.status==="open":m==="resolved"?A.status==="resolved":!0),j=r.filter(A=>A.status==="open").length,_=r.filter(A=>A.status==="resolved").length;function T(A){setTimeout(()=>{const R=document.querySelector(`mark[data-thread-id="${A}"]`);R&&(R.scrollIntoView({behavior:"smooth",block:"center"}),R.classList.add("thread-mark-flash"),setTimeout(()=>R.classList.remove("thread-mark-flash"),1500))},50)}return t?r.length===0?l.jsxs("div",{className:"empty-state",children:[l.jsx(wg,{size:24,style:{opacity:.3,marginBottom:8}}),l.jsx("div",{children:"No threads yet."}),l.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):l.jsxs("div",{children:[l.jsxs("div",{className:"thread-filter-tabs",children:[l.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",j,")"]}),l.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",_,")"]}),l.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",r.length,")"]})]}),b.length===0?l.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):b.map(A=>l.jsx(oT,{thread:A,threadTurns:A.turns??[],onStop:()=>a(t,A.id),onResolve:()=>x(A),onReopen:()=>u(t,A.id),onDelete:()=>f(t,A.id),onFollowup:R=>o(t,A.id,R),onLocate:()=>T(A.id)},A.id)),k&&l.jsx(nT,{thread:k,onClose:()=>x(null)})]}):l.jsx("div",{className:"empty-state",children:"No session selected"})}function lT(){const t=L(f=>f.apps),s=L(f=>f.activeAppTabId),r=L(f=>f.openAppTab),o=L(f=>f.startAppEdit),a=L(f=>f.toggleAppPin),u=L(f=>f.deleteApp);return t.length===0?l.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):l.jsx("div",{className:"apps-panel",children:t.map(f=>l.jsxs("div",{className:`apps-panel-row${s===f.id?" active":""}`,onClick:()=>r(f.id),title:f.description??void 0,children:[l.jsx(wi,{iconNode:f.iconNode,size:14,className:"sidebar-app-icon"}),l.jsxs("div",{className:"apps-panel-info",children:[l.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&l.jsx("span",{className:"apps-panel-desc",children:f.description})]}),l.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:h=>{h.stopPropagation(),o(f.id)},children:l.jsx(Va,{size:12})}),l.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:l.jsx(sl,{size:12,fill:f.pinned?"currentColor":"none"})}),l.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:l.jsx(fs,{size:12})})]},f.id))})}function cT(){Ot.trackRender("SidecarPanel");const t=L(T=>T.activeSessionId),s=L(T=>{var A;return T.activeSessionId?(A=T.sessionDetails[T.activeSessionId])==null?void 0:A.runtime_type:void 0}),r=L(T=>{var A;return T.activeSessionId?eT((A=T.sessionDetails[T.activeSessionId])==null?void 0:A.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=(r==null?void 0:r.turns)??[],x=k[k.length-1],b=k.some(ur);if(w.useEffect(()=>{var T,A;(A=(T=v.current)==null?void 0:T.scrollIntoView)==null||A.call(T,{block:"end"})},[k.length,x==null?void 0:x.items.length,x==null?void 0:x.status]),!t||!s)return l.jsx("div",{className:"empty-state",children:"No session selected"});if(!Jb(s))return l.jsxs("div",{className:"empty-state",children:[l.jsx(dr,{size:24,style:{opacity:.3,marginBottom:8}}),l.jsxs("div",{children:["The sidecar is not available for ",s," sessions yet."]})]});const j=!b&&!g&&f.trim().length>0;async function _(){if(!t||!j)return;m(!0);const T=await o(t,f.trim());m(!1),T&&h("")}return l.jsxs("div",{className:"sidecar-panel",children:[l.jsxs("div",{className:"sidecar-conversation",children:[k.length===0?l.jsxs("div",{className:"empty-state",children:[l.jsx(dr,{size:24,style:{opacity:.3,marginBottom:8}}),l.jsx("div",{children:"Ask about this session."}),l.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=>l.jsx(gv,{turn:T,formatPrompt:tT},T.id)),l.jsx("div",{ref:v})]}),l.jsxs("div",{className:"sidecar-footer",children:[l.jsxs("div",{className:"thread-card-followup",children:[l.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(),_())}}),b&&r?l.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>a(t,r.id),children:l.jsx(Lr,{size:13})}):l.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!j,onClick:()=>void _(),children:l.jsx(To,{size:13})})]}),r&&l.jsx("div",{className:"thread-card-actions",children:l.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:b,onClick:()=>u(t,r.id),children:[l.jsx(fs,{size:13})," Clear"]})})]})]})}function uT(){var g;Ot.trackRender("RightPanel");const t=L(m=>m.activeRightTab),s=L(m=>m.switchRightTab),r=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"&&!jd(m)).length)??0,h=[{id:"turns",label:"Turns",icon:mw},{id:"sidecar",label:"Sidecar",icon:dr},{id:"tasks",label:"Tasks",icon:hw,badge:u||void 0},{id:"threads",label:"Threads",icon:wg,badge:f||void 0},{id:"apps",label:"Apps",icon:xg}];return r?l.jsxs("div",{className:"ide-right collapsed",children:[l.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:l.jsx(bw,{size:15})}),l.jsx("div",{className:"right-rail-divider"}),h.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return l.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${t===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>s(m.id),children:[l.jsx(v,{size:15}),m.badge?l.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):l.jsxs("div",{className:"ide-right",children:[l.jsxs("div",{className:"right-header",children:[l.jsx("div",{className:"right-tabs",children:h.map(m=>l.jsxs("div",{className:`right-tab ${t===m.id?"active":""}`,onClick:()=>s(m.id),children:[m.label,m.badge?l.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),l.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:l.jsx(Sw,{size:14})})]}),l.jsxs("div",{className:"right-content",children:[t==="turns"&&l.jsx(Vb,{}),t==="sidecar"&&l.jsx(cT,{}),t==="tasks"&&l.jsx(Xb,{}),t==="threads"&&l.jsx(aT,{}),t==="apps"&&l.jsx(lT,{})]})]})}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"}},Ku=[{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 dT(t){return Ku.find(s=>s.id===t)}function _d(t){const s=dT(t);return(s==null?void 0:s.models)??[]}function vv(t,s){return _d(t).find(r=>r.slug===s)}function Yu(t,s){var r;return((r=vv(t,s))==null?void 0:r.reasoningLevels)??[]}function Xu(t,s){var r;return(r=vv(t,s))==null?void 0:r.defaultReasoning}function fT(){const{activeSessionId:t,sessions:s,updateModelConfig:r}=L(),o=L(te=>te.showModelSelector),a=L(te=>te.setShowModelSelector),u=s.find(te=>te.id===t),f=L(te=>te.models),h=L(te=>te.modelsLoading),g=L(te=>te.loadModels),[m,v]=w.useState(!1),k=w.useRef(null);if(bl(k,()=>v(!1),m),id(()=>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??"",j=u.model_reasoning_effort??"",_=f.length>0?f:[],T=_d(x),R=[..._.length>0?_:T];if(b&&!R.some(te=>te.slug===b)){const te=T[0];R.unshift({slug:b,displayName:b,description:"Custom model",defaultReasoning:(te==null?void 0:te.defaultReasoning)??"medium",reasoningLevels:(te==null?void 0:te.reasoningLevels)??[]})}function U(te){return R.find(se=>se.slug===te)}function P(te){var se;return _.length>0?((se=U(te))==null?void 0:se.reasoningLevels)??[]:Yu(x,te)}function H(te){var se;return _.length>0?(se=U(te))==null?void 0:se.defaultReasoning:Xu(x,te)}const Y=Ku.find(te=>te.id===x),K=U(b),X=b?P(b):[],de=(Y==null?void 0:Y.label)??x,he=(K==null?void 0:K.displayName)??(b||"Default"),V=X.find(te=>te.effort===j),Te=(V==null?void 0:V.label)??(j||"Default");function Ne(te){var Q;const se=P(te),O=se.some(F=>F.effort===j)?j:H(te)??((Q=se[0])==null?void 0:Q.effort)??"";r(te,O),v(!1)}function Le(te){r(b,te),v(!1)}return l.jsxs("div",{className:"model-selector",ref:k,children:[l.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[l.jsx("span",{className:"model-selector-provider",children:de}),l.jsx("span",{className:"model-selector-sep",children:"›"}),l.jsx("span",{className:"model-selector-model",children:he}),Te!=="Default"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"model-selector-sep",children:"›"}),l.jsx("span",{className:"model-selector-reasoning",children:Te})]}),l.jsx(vi,{size:12,className:"model-selector-chevron"})]}),m&&l.jsxs("div",{className:"model-selector-popover",children:[l.jsxs("div",{className:"model-selector-column",children:[l.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Ku.map(te=>l.jsxs("div",{className:`model-selector-item ${te.id===x?"selected":""} ${te.available?"":"disabled"}`,onClick:()=>{if(te.available){if(te.id===x){v(!1);return}r("","",te.id)}},children:[l.jsx("span",{children:te.label}),!te.available&&l.jsxs("span",{className:"model-selector-coming-soon",children:[l.jsx(yw,{size:10})," Soon"]}),te.id===x&&l.jsx(Os,{size:12})]},te.id))]}),l.jsxs("div",{className:"model-selector-column",children:[l.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&l.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&R.length===0&&l.jsx("div",{className:"model-selector-empty",children:"No models available"}),R.map(te=>l.jsxs("div",{className:`model-selector-item ${te.slug===b?"selected":""}`,onClick:()=>Ne(te.slug),children:[l.jsxs("div",{className:"model-selector-item-main",children:[l.jsx("span",{className:"model-selector-item-name",children:te.displayName}),l.jsx("span",{className:"model-selector-item-desc",children:te.description})]}),te.slug===b&&l.jsx(Os,{size:12})]},te.slug))]}),l.jsxs("div",{className:"model-selector-column",children:[l.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),X.length===0&&l.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),X.map(te=>l.jsxs("div",{className:`model-selector-item ${te.effort===j?"selected":""}`,onClick:()=>Le(te.effort),children:[l.jsx("span",{children:te.label}),te.effort===j&&l.jsx(Os,{size:12})]},te.effort))]})]})]})}function lo(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function Rm(){const t=L(s=>s.setShowRemoteModal);return l.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>t(!0),children:[l.jsx(Ow,{size:14})," Repoburg"]})}function Am(){const t=L(r=>r.usageViewOpen),s=L(r=>r.toggleUsageView);return l.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Usage Center",onClick:s,children:[l.jsx(yg,{size:14})," Usage"]})}function Im(){const t=L(r=>r.vscodeViewOpen),s=L(r=>r.toggleVscodeView);return l.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open VS Code",onClick:s,children:[l.jsx(aw,{size:14})," Code"]})}function pT(){var x,b;Ot.trackRender("StatusBar");const t=L(j=>j.activeSessionId),s=L(j=>t?j.sessions.find(_=>_.id===t)??null:null),r=L(j=>t?j.sessionDetails[t]??null:null),o=L(j=>t?j.backgroundTasks[t]:void 0),a=L(j=>j.wsConnected),u=L(j=>j.switchRightTab),f=(r==null?void 0:r.contextUsage)??null;if(!s)return l.jsxs("div",{className:"ide-statusbar",children:[l.jsx(Rm,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Im,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Am,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),l.jsx("div",{className:"sb-spacer"}),l.jsxs("div",{className:"sb-item",children:[l.jsx(Eh,{size:14})," K"]})]});const h=o??[],g=Sl(s,h.length),m=new Set,v=new Map;for(const j of h)m.add(j.task_id),v.set(j.task_id,j.task_type);for(const j of(r==null?void 0:r.turns)??[])for(const _ of j.items)if(_.type==="background_task"&&_.status==="in_progress"){const T=((x=_.data)==null?void 0:x.task_id)??_.external_item_id,A=((b=_.data)==null?void 0:b.task_type)??"unknown";m.add(T),v.set(T,A)}const k=[...v.values()].filter(j=>j==="local_bash").length;return l.jsxs("div",{className:"ide-statusbar",children:[l.jsx(Rm,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Im,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Am,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(fT,{}),k>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sb-divider",children:"|"}),l.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:[l.jsx(Tg,{size:14})," ",k]})]}),l.jsx("div",{className:"sb-spacer"}),l.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:s.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),f&&l.jsx(hT,{usage:f}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsxs("div",{className:"sb-item",children:[l.jsx(Eh,{size:14})," K"]})]})}function hT({usage:t}){const s=t.percentage>=85?"var(--red)":t.percentage>=60?"var(--amber)":"var(--green)",r=`${lo(t.totalTokens)} / ${lo(t.contextWindow)} tokens`+(t.autoCompactThreshold?` · auto-compacts at ${lo(t.autoCompactThreshold)}`:"");return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx("div",{className:"sb-context",title:r,children:l.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(t.percentage),"% / ",lo(t.totalTokens)," / ",lo(t.contextWindow)]})})]})}function Dm(t){return fn(`/vscode-web/status?folder=${encodeURIComponent(t??"")}`)}function mT(t){return pt("/vscode-web/start",{folder:t})}function gT(t){return pt("/vscode-web/heartbeat",{id:t})}const vT=1e3,yT=5*6e4;function Mm({children:t}){const s=L(r=>r.toggleVscodeView);return l.jsxs("div",{className:"vscode-view vscode-view--loading",children:[t,l.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:s,children:l.jsx(En,{size:16})})]})}function xT(){const t=L(j=>j.vscodeState),s=L(j=>j.vscodeId),r=L(j=>j.vscodeToken),o=L(j=>j.setVscodeView),a=L(j=>{var T;const _=j.activeSessionId?j.sessions.find(A=>A.id===j.activeSessionId):null;return _!=null&&_.cwd?_.cwd:((T=j.workspaces.find(A=>A.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,g]=w.useState(0),m=w.useRef(null),v=dn(),k=v===""||v===window.location.origin,x=`${v}/vscode/${s??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let j=!1;function _(){m.current&&(clearInterval(m.current),m.current=null)}async function T(){try{let R=await Dm(a);if((R.state==="stopped"||R.state==="error")&&(R=await mT(a)),j||(o(R.state,R.id,R.token),R.state==="running"||R.state==="error"))return;m.current=setInterval(async()=>{const U=await Dm(a);j||(o(U.state,U.id,U.token),(U.state==="running"||U.state==="error"||U.state==="stopped")&&_())},vT)}catch{j||o("error",null,null)}}T();const A=setInterval(()=>{const R=L.getState().vscodeId;R&&gT(R).catch(()=>{})},yT);return()=>{j=!0,_(),clearInterval(A)}},[h,a,o]);function b(){f(!1),o("starting",null,null),g(j=>j+1)}return t!=="running"||!r||!s?l.jsx(Mm,{children:t==="error"?l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"VS Code could not start."}),l.jsxs("button",{className:"dialog-btn-cancel",onClick:b,children:[l.jsx(wo,{size:14})," Retry"]})]}):l.jsxs("span",{className:"vscode-view-hint",children:[l.jsx(Jn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?l.jsxs("div",{className:"vscode-view",children:[!u&&l.jsxs("div",{className:"vscode-view-overlay",children:[l.jsx(Jn,{size:16,className:"spin"})," Loading VS Code…"]}),l.jsx("iframe",{src:x,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},s)]}):l.jsxs(Mm,{children:[l.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),l.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(x,"_blank","noopener"),children:[l.jsx(cw,{size:14})," Open VS Code in a new tab"]})]})}function Lm(t,s){const r=new URLSearchParams;t&&r.set("since",t),s&&r.set("until",s);const o=r.toString();return fn(`/usage/summary${o?`?${o}`:""}`)}const yv="agentpane:usage-budget";function ds(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function Ir(t){return`$${t>=100?t.toFixed(0):t>=1?t.toFixed(2):t.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`}function wT(t,s=new Date){if(t==="all")return{since:null,until:null};const r=new Date(s);return t==="today"?r.setHours(0,0,0,0):r.setDate(r.getDate()-(t==="7d"?7:30)),{since:r.toISOString(),until:null}}function kT(t=new Date){return new Date(t.getFullYear(),t.getMonth(),1).toISOString()}function ST(){try{const t=Number(localStorage.getItem(yv));return Number.isFinite(t)&&t>0?t:0}catch{return 0}}function bT(t){try{localStorage.setItem(yv,String(t))}catch{}}const TT={claude:"Claude",codex:"Codex",repoburg:"Repoburg"};function Ba({label:t,value:s,sub:r,tone:o}){return l.jsxs("div",{className:"usage-kpi",children:[l.jsx("div",{className:"usage-kpi-label",children:t}),l.jsx("div",{className:"usage-kpi-value",style:o?{color:o}:void 0,children:s}),r&&l.jsx("div",{className:"usage-kpi-sub",children:r})]})}function NT({day:t,max:s}){const r=o=>s>0?o/s*100:0;return l.jsxs("div",{className:"usage-day",title:`${t.date} · ${ds(t.input_tokens)} input · ${ds(t.cached_input_tokens)} cached · ${ds(t.output_tokens)} output · ${Ir(t.cost_usd)}`,children:[l.jsxs("div",{className:"usage-day-bar",children:[l.jsx("div",{className:"usage-seg usage-seg-output",style:{height:`${r(t.output_tokens)}%`}}),l.jsx("div",{className:"usage-seg usage-seg-cached",style:{height:`${r(t.cached_input_tokens+t.cache_write_input_tokens)}%`}}),l.jsx("div",{className:"usage-seg usage-seg-input",style:{height:`${r(t.input_tokens)}%`}})]}),l.jsx("div",{className:"usage-day-label",children:t.date.slice(5)})]})}function CT(){const t=L(R=>R.toggleUsageView),[s,r]=w.useState("30d"),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,g]=w.useState(ST),[m,v]=w.useState(null),[k,x]=w.useState(!1),b=w.useCallback(async()=>{x(!0),v(null);try{const{since:R,until:U}=wT(s),[P,H]=await Promise.all([Lm(R,U),Lm(kT(),null)]);a(P),f(H.totals.cost_usd)}catch(R){v(R.message)}finally{x(!1)}},[s]);w.useEffect(()=>{b()},[b]);const j=o==null?void 0:o.totals,_=h>0&&u!==null?h-u:null,T=w.useMemo(()=>Math.max(0,...((o==null?void 0:o.daily)??[]).map(R=>R.input_tokens+R.cached_input_tokens+R.output_tokens)),[o]),A=R=>{const U=Number(R.replace(",",".")),P=Number.isFinite(U)&&U>0?U:0;g(P),bT(P)};return l.jsxs("div",{className:"usage-view",children:[l.jsxs("div",{className:"usage-header",children:[l.jsxs("div",{className:"usage-title",children:[l.jsx(yg,{size:18})," Usage Center"]}),l.jsxs("div",{className:"usage-controls",children:[["today","7d","30d","all"].map(R=>l.jsx("button",{className:`usage-range-btn${s===R?" usage-range-btn-active":""}`,onClick:()=>r(R),children:R==="today"?"Today":R==="7d"?"7 days":R==="30d"?"30 days":"All"},R)),l.jsx("button",{className:"usage-range-btn",onClick:()=>void b(),title:"Refresh",children:l.jsx(_w,{size:13,className:k?"spin":void 0})}),l.jsx("button",{className:"dialog-close",title:"Close usage view","aria-label":"Close usage view",onClick:t,children:l.jsx(En,{size:16})})]})]}),m&&l.jsxs("div",{className:"usage-error",children:["Could not load usage data: ",m]}),!o&&!m&&l.jsx("div",{className:"usage-empty",children:"Loading…"}),o&&j&&l.jsxs("div",{className:"usage-body",children:[l.jsxs("div",{className:"usage-kpis",children:[l.jsx(Ba,{label:"Spend",value:Ir(j.cost_usd),sub:j.unpriced_models.length>0?"excluding unpriced models":void 0}),l.jsx(Ba,{label:"Remaining (monthly)",value:_===null?"—":_>=0?Ir(_):Ir(0),sub:h>0&&u!==null?`this month ${Ir(u)} / budget ${Ir(h)}`:"no budget set",tone:_!==null&&_<0?"var(--red)":void 0}),l.jsx(Ba,{label:"Tokens",value:ds(j.input_tokens+j.cached_input_tokens+j.cache_write_input_tokens+j.output_tokens),sub:`input ${ds(j.input_tokens)} · cached ${ds(j.cached_input_tokens)} · write ${ds(j.cache_write_input_tokens)} · output ${ds(j.output_tokens)}`}),l.jsx(Ba,{label:"Calls",value:String(j.calls),sub:j.errors>0?`${j.errors} failed`:void 0,tone:j.errors>0?"var(--amber)":void 0})]}),l.jsxs("div",{className:"usage-budget",children:[l.jsx("label",{htmlFor:"usage-budget-input",children:"Monthly budget (USD)"}),l.jsx("input",{id:"usage-budget-input",type:"number",min:"0",step:"1",defaultValue:h>0?h:"",placeholder:"e.g. 50",onBlur:R=>A(R.target.value)}),h>0&&u!==null&&l.jsx("div",{className:"usage-budget-bar",children:l.jsx("div",{className:"usage-budget-fill",style:{width:`${Math.min(100,u/h*100)}%`,background:u>=h?"var(--red)":void 0}})})]}),j.unpriced_models.length>0&&l.jsxs("div",{className:"usage-note",children:["Unpriced models: ",j.unpriced_models.join(", ")]}),l.jsxs("div",{className:"usage-chart",children:[l.jsx("div",{className:"usage-section-title",children:"Daily usage"}),o.daily.length===0?l.jsx("div",{className:"usage-empty",children:"No usage in this range."}):l.jsx("div",{className:"usage-days",children:o.daily.map(R=>l.jsx(NT,{day:R,max:T},R.date))}),l.jsxs("div",{className:"usage-legend",children:[l.jsxs("span",{children:[l.jsx("span",{className:"usage-dot usage-seg-input"})," input"]}),l.jsxs("span",{children:[l.jsx("span",{className:"usage-dot usage-seg-cached"})," cached"]}),l.jsxs("span",{children:[l.jsx("span",{className:"usage-dot usage-seg-output"})," output"]})]})]}),l.jsxs("div",{className:"usage-table-wrap",children:[l.jsx("div",{className:"usage-section-title",children:"By model"}),l.jsxs("table",{className:"usage-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Runtime"}),l.jsx("th",{children:"Provider"}),l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Effort"}),l.jsx("th",{children:"Calls"}),l.jsx("th",{children:"Input"}),l.jsx("th",{children:"Cached"}),l.jsx("th",{children:"Output"}),l.jsx("th",{children:"Cost"})]})}),l.jsxs("tbody",{children:[o.by_model.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:9,className:"usage-empty",children:"No usage records yet."})}),o.by_model.map(R=>l.jsxs("tr",{children:[l.jsx("td",{children:TT[R.runtime_type]??R.runtime_type}),l.jsx("td",{children:R.provider??"—"}),l.jsx("td",{title:R.model,children:R.model}),l.jsx("td",{children:R.reasoning_effort??"default"}),l.jsxs("td",{children:[R.calls,R.errors>0&&l.jsxs("span",{className:"usage-err",children:[" (",R.errors," failed)"]})]}),l.jsx("td",{children:ds(R.input_tokens)}),l.jsx("td",{children:ds(R.cached_input_tokens+R.cache_write_input_tokens)}),l.jsx("td",{children:ds(R.output_tokens)}),l.jsx("td",{children:R.cost_usd===null?l.jsx("span",{className:"usage-unpriced",children:"unknown"}):Ir(R.cost_usd)})]},`${R.runtime_type}|${R.provider??""}|${R.model}|${R.reasoning_effort??""}`))]})]})]})]})]})}const Pm=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,jT=/^(?:https?:\/\/[^/?#]+)?\/api\/apps\/([^/?#]+)\/files\/([^/?#]+)$/i,_T={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function xv(){return dn()||window.location.origin}function wv(t,s){let r=s;if(r&&typeof r=="object"){const f=r;r=typeof f.id=="string"?f.id:f.url}if(typeof r!="string")return null;const o=r.trim();if(Pm.test(o))return o;const a=jT.exec(o);if(!a)return null;let u;try{u=decodeURIComponent(a[1])}catch{return null}return u===t&&Pm.test(a[2])?a[2]:null}function Om(t){return/^https?:\/\//i.test(t.url)?t:{...t,url:`${xv()}${t.url}`}}function ET(t){return _T[t.slice(t.lastIndexOf(".")+1)]??"application/octet-stream"}function kv(t){return new Promise((s,r)=>{const o=new FileReader;o.onload=()=>{const a=String(o.result??"");s(a.slice(a.indexOf(",")+1))},o.onerror=()=>r(o.error??new Error("Could not read the file")),o.readAsDataURL(t)})}function RT(t,s){const r=/^data:([^;,]*)(?:;[^;,]*)*;base64,/i.exec(t);return r?{type:s||r[1]||void 0,data:t.slice(r[0].length)}:{type:s,data:t}}async function Sv(t){if(t instanceof Blob){const s=t.name;return{name:typeof s=="string"&&s?s:void 0,type:t.type||void 0,data:await kv(t)}}if(t&&typeof t=="object"&&typeof t.data=="string"){const s=t;return{name:typeof s.name=="string"&&s.name?s.name:void 0,type:typeof s.type=="string"&&s.type?s.type:void 0,data:s.data}}return null}async function AT(t){const s=await Sv(t);if(!s)throw new Error("uploadFile: expected a Blob/File or { name, type, data }");return s}async function IT(t,s,r){if(s==null)return[];if(!Array.isArray(s))throw new Error("submitTurn: attachments must be an array");const o=[];for(let a=0;a<s.length;a++){const u=s[a],f=await Sv(u);if(f){const{type:m,data:v}=RT(f.data,f.type);if(!m)throw new Error(`submitTurn: attachment ${a+1} has no type`);o.push({name:f.name??`attachment-${a+1}`,media_type:m,data:v});continue}const h=wv(t,u);if(!h)throw new Error(`submitTurn: attachment ${a+1} is not a file of this app`);const g=await r(h);o.push({name:h,media_type:ET(h),data:await kv(g)})}return o}const DT=`function (config) {
|
|
485
|
-
var nextId = 1;
|
|
486
|
-
var pending = new Map();
|
|
487
|
-
var listeners = [];
|
|
488
|
-
// Absolute http(s) URL, or null. Relative and #fragment hrefs are not
|
|
489
|
-
// external and keep their in-frame behavior.
|
|
490
|
-
function externalUrl(raw) {
|
|
491
|
-
if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
|
|
492
|
-
try { return new URL(raw.trim()).href; } catch (err) { return null; }
|
|
493
|
-
}
|
|
494
|
-
// New browser tab. The sandbox lets popups escape it, so the page loads
|
|
495
|
-
// like any other tab; noopener leaves it no handle back to this frame.
|
|
496
|
-
function openTab(url) {
|
|
497
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
498
|
-
}
|
|
499
|
-
// A plain external link would navigate THIS frame: the app disappears and
|
|
500
|
-
// most sites refuse to be framed anyway. Open it in a new tab instead.
|
|
501
|
-
// Bubble phase on window, so the app's own handlers run first and can
|
|
502
|
-
// still claim the click with preventDefault(). Modifier clicks and
|
|
503
|
-
// target="_blank" links already open a tab natively.
|
|
504
|
-
window.addEventListener('click', function (e) {
|
|
505
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
506
|
-
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
507
|
-
if (!a) return;
|
|
508
|
-
var target = (a.getAttribute('target') || '').toLowerCase();
|
|
509
|
-
if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
|
|
510
|
-
var url = externalUrl(a.getAttribute('href'));
|
|
511
|
-
if (!url) return;
|
|
512
|
-
e.preventDefault();
|
|
513
|
-
openTab(url);
|
|
514
|
-
});
|
|
515
|
-
// Stored files: <apiOrigin>/api/apps/<app-id>/files/<id>. Same reference
|
|
516
|
-
// rules as the pane (utils/appFiles.ts): an id, a file URL of this app on
|
|
517
|
-
// any origin, or an object carrying id/url.
|
|
518
|
-
var FILE_ID_RE = /^[a-f0-9]{64}\\.(?:png|jpg|gif|webp)$/;
|
|
519
|
-
var FILE_URL_RE = /^(?:https?:\\/\\/[^\\/?#]+)?\\/api\\/apps\\/([^\\/?#]+)\\/files\\/([^\\/?#]+)$/i;
|
|
520
|
-
function fileRefId(ref) {
|
|
521
|
-
if (ref && typeof ref === 'object') ref = typeof ref.id === 'string' ? ref.id : ref.url;
|
|
522
|
-
if (typeof ref !== 'string') return null;
|
|
523
|
-
var s = ref.trim();
|
|
524
|
-
if (FILE_ID_RE.test(s)) return s;
|
|
525
|
-
var m = FILE_URL_RE.exec(s);
|
|
526
|
-
if (!m) return null;
|
|
527
|
-
var owner;
|
|
528
|
-
try { owner = decodeURIComponent(m[1]); } catch (err) { return null; }
|
|
529
|
-
return owner === config.appId && FILE_ID_RE.test(m[2]) ? m[2] : null;
|
|
530
|
-
}
|
|
531
|
-
function fileUrl(ref) {
|
|
532
|
-
var id = fileRefId(ref);
|
|
533
|
-
if (!id) return typeof ref === 'string' ? ref : '';
|
|
534
|
-
return config.apiOrigin + '/api/apps/' + encodeURIComponent(config.appId) + '/files/' + id;
|
|
535
|
-
}
|
|
536
|
-
window.addEventListener('message', function (e) {
|
|
537
|
-
var msg = e.data;
|
|
538
|
-
if (!msg || msg.source !== 'agentpane-host') return;
|
|
539
|
-
if (msg.id != null && pending.has(msg.id)) {
|
|
540
|
-
var p = pending.get(msg.id);
|
|
541
|
-
pending.delete(msg.id);
|
|
542
|
-
if (msg.ok) {
|
|
543
|
-
p.resolve(msg.result);
|
|
544
|
-
} else {
|
|
545
|
-
var err = new Error(msg.error || 'bridge error');
|
|
546
|
-
// code 'conflict': setState's ifVersion is stale; state = the stored copy.
|
|
547
|
-
if (msg.code) err.code = msg.code;
|
|
548
|
-
if (msg.state) err.state = msg.state;
|
|
549
|
-
p.reject(err);
|
|
550
|
-
}
|
|
551
|
-
} else if (msg.event) {
|
|
552
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
553
|
-
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
function call(method, params) {
|
|
558
|
-
return new Promise(function (resolve, reject) {
|
|
559
|
-
var id = nextId++;
|
|
560
|
-
pending.set(id, { resolve: resolve, reject: reject });
|
|
561
|
-
try {
|
|
562
|
-
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
563
|
-
} catch (err) {
|
|
564
|
-
// Params that cannot be cloned (functions, DOM nodes, ...).
|
|
565
|
-
pending.delete(id);
|
|
566
|
-
reject(err);
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
window.AgentPane = {
|
|
571
|
-
getApp: function () { return call('getApp'); },
|
|
572
|
-
getState: function () { return call('getState'); },
|
|
573
|
-
setState: function (data, opts) {
|
|
574
|
-
var params = { data: data };
|
|
575
|
-
if (opts && typeof opts.ifVersion === 'number') params.ifVersion = opts.ifVersion;
|
|
576
|
-
return call('setState', params);
|
|
577
|
-
},
|
|
578
|
-
createSession: function (opts) { return call('createSession', opts); },
|
|
579
|
-
submitTurn: function (sessionId, prompt, opts) {
|
|
580
|
-
var params = { sessionId: sessionId, prompt: prompt };
|
|
581
|
-
if (opts && opts.attachments != null) params.attachments = opts.attachments;
|
|
582
|
-
return call('submitTurn', params);
|
|
583
|
-
},
|
|
584
|
-
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
585
|
-
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
586
|
-
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
587
|
-
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
588
|
-
onBackgroundTasks: function (cb) { listeners.push(function (event, payload) { if (event === 'background_tasks' && payload) cb(payload); }); },
|
|
589
|
-
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
|
|
590
|
-
openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
|
|
591
|
-
openUrl: function (url) {
|
|
592
|
-
var href = externalUrl(url);
|
|
593
|
-
if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
|
|
594
|
-
try { openTab(href); } catch (err) { return Promise.reject(err); }
|
|
595
|
-
return Promise.resolve({ ok: true });
|
|
596
|
-
},
|
|
597
|
-
uploadFile: function (file) { return call('uploadFile', { file: file }); },
|
|
598
|
-
getFile: function (ref) { return call('getFile', { ref: ref }); },
|
|
599
|
-
fileUrl: fileUrl
|
|
600
|
-
};
|
|
601
|
-
// Runtime error reporting — surface compile checks' blind side to the pane.
|
|
602
|
-
window.addEventListener('error', function (e) {
|
|
603
|
-
parent.postMessage({
|
|
604
|
-
source: 'agentpane-app', report: 'error',
|
|
605
|
-
message: e.message || 'Unknown error',
|
|
606
|
-
stack: (e.error && e.error.stack) || '',
|
|
607
|
-
line: e.lineno || 0, col: e.colno || 0
|
|
608
|
-
}, '*');
|
|
609
|
-
});
|
|
610
|
-
window.addEventListener('unhandledrejection', function (e) {
|
|
611
|
-
var r = e.reason;
|
|
612
|
-
var msg = r && (r.message || String(r)) || 'unknown';
|
|
613
|
-
parent.postMessage({
|
|
614
|
-
source: 'agentpane-app', report: 'error',
|
|
615
|
-
message: 'Unhandled promise rejection: ' + msg,
|
|
616
|
-
stack: (r && r.stack) || '', line: 0, col: 0
|
|
617
|
-
}, '*');
|
|
618
|
-
});
|
|
619
|
-
}`;function MT(t){return`(${DT})(${JSON.stringify(t)});`}function $m(t){return t.replace(/<\/script/gi,"<\\/script")}function LT(t,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let a=-1,u;for(;(u=o.exec(t))!==null;)a=u.index;return a}function zm(t,s,r){const o=LT(t,s);return o===-1?t+r:t.slice(0,o)+r+t.slice(o)}function PT(t,s,r){let o=t;const a=`<script>${$m(s)}<\/script>`;if(/<\/head>/i.test(o)?o=zm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${$m(r)}<\/script>`;o=zm(o,"</body>",u)}return o}function OT(){const t=globalThis.crypto;return t&&typeof t.randomUUID=="function"?`tab-${t.randomUUID()}`:`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function $T(t){var r;if(!(t instanceof Qm)||t.status!==409)return null;const s=(r=t.body)==null?void 0:r.state;return s&&typeof s=="object"?s:null}function zT({appId:t,workspace:s=""}){const r=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 b=!0;const j=OT(),_=A=>{const R=o.current.version;typeof A.version=="number"&&typeof R=="number"&&A.version<R||(o.current=A)};Zx(t,A=>{var R,U;return(U=(R=r.current)==null?void 0:R.contentWindow)==null?void 0:U.postMessage(A,"*")});const T=async A=>{var K,X,de,he,V,Te,Ne,Le,te,se,ie,O,Q;if(A.source!==((K=r.current)==null?void 0:K.contentWindow))return;const R=A.data;if(!R||R.source!=="agentpane-app")return;if(R.report==="error"){const F={message:String(R.message??"Unknown error"),stack:String(R.stack??"")};m(C=>{const D=C[C.length-1];return D&&D.message===F.message?C:[...C,F].slice(-20)});return}if(typeof R.method!="string")return;let U=!0,P,H,Y=null;try{switch(R.method){case"getApp":P={id:t};break;case"getState":try{const F=await Nh(t,s);_(F),P=F}catch{P=o.current}break;case"setState":{const F=((X=R.params)==null?void 0:X.data)??null,C=(de=R.params)==null?void 0:de.ifVersion,D={data:F,writer:j};typeof C=="number"&&(D.ifVersion=C);try{const oe=await lg(t,D,s);_(oe),P=oe}catch(oe){if(Y=$T(oe),!Y)throw oe;_(Y);const G=oe.body;throw new Error(typeof(G==null?void 0:G.error)=="string"?G.error:"App state changed since that version")}break}case"createSession":{const F=R.params??{},C=await Ju({title:typeof F.title=="string"?F.title:void 0,runtime_type:typeof F.runtime_type=="string"?F.runtime_type:void 0,model:typeof F.model=="string"?F.model:void 0,model_reasoning_effort:typeof F.model_reasoning_effort=="string"?F.model_reasoning_effort:void 0,cwd:typeof F.cwd=="string"?F.cwd:void 0,origin_app_id:t});hu(C.id,t),L.getState().addSession(C),P=C;break}case"submitTurn":{const F=String(((he=R.params)==null?void 0:he.sessionId)??""),C=String(((V=R.params)==null?void 0:V.prompt)??""),D=await IT(t,(Te=R.params)==null?void 0:Te.attachments,G=>O0(t,G)),oe=await Zm(F,C,D.length?D:void 0,{originAppId:t});hu(F,t),P=oe;break}case"resolveToolCall":{const F=String(((Ne=R.params)==null?void 0:Ne.callId)??""),C=(Le=R.params)==null?void 0:Le.result;await D0(F,C),P={ok:!0};break}case"openSession":{if(L.getState().activeAppTabId!==t)throw new Error("openSession: the app is not on screen — call it from a click in the app");const F=typeof((te=R.params)==null?void 0:te.sessionId)=="string"?R.params.sessionId.trim():"";if(!F)throw new Error("openSession: sessionId is required");try{await L.getState().revealSession(F)}catch(C){throw new Error(`openSession: ${C instanceof Error?C.message:String(C)}`)}P={ok:!0};break}case"uploadFile":{const F=await AT((se=R.params)==null?void 0:se.file);try{P=Om(await L0(t,F))}catch(C){throw new Error(`uploadFile: ${C instanceof Error?C.message:String(C)}`)}break}case"getFile":{const F=wv(t,(ie=R.params)==null?void 0:ie.ref),C=F?await P0(t,F):null;P=C?Om(C):null;break}default:throw new Error(`Unknown bridge method: ${R.method}`)}}catch(F){U=!1,H=F instanceof Error?F.message:String(F)}(Q=(O=r.current)==null?void 0:O.contentWindow)==null||Q.postMessage(Y?{source:"agentpane-host",id:R.id,ok:U,error:H,code:"conflict",state:Y}:{source:"agentpane-host",id:R.id,ok:U,result:P,error:H},"*")};return window.addEventListener("message",T),r0(t,A=>{var R,U;typeof A.workspace=="string"&&A.workspace!==s||A.writer!==j&&((U=(R=r.current)==null?void 0:R.contentWindow)==null||U.postMessage({source:"agentpane-host",event:"state_changed",payload:typeof A.version=="number"?{version:A.version}:{}},"*"))}),n0(t,()=>{Th(t).then(A=>{b&&(u(A),m([]))}).catch(()=>{})}),(async()=>{try{const[A,R,U]=await Promise.all([Th(t),Nh(t,s),_0(t).catch(()=>[])]);if(!b)return;o.current=R,U.forEach(P=>hu(P.id,t)),u(A)}catch(A){b&&h(A instanceof Error?A.message:String(A))}})(),()=>{b=!1,Jx(t),s0(t),i0(t),window.removeEventListener("message",T)}},[t,s]);const v=w.useMemo(()=>a?PT(a.html,MT({appId:t,apiOrigin:xv()}),a.js):"",[a,t]);if(f)return l.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!v)return l.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[],x=k.some(b=>b.severity==="error");return l.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&l.jsxs("div",{className:`miniapp-diagnostics${x?"":" miniapp-diagnostics-warn"}`,"data-testid":"miniapp-diagnostics",children:[l.jsx("div",{className:"miniapp-diagnostics-title",children:x?`Compile errors in ${(a==null?void 0:a.sourceFile)??"the app logic"} — the pane serves the last code that parsed:`:"Warnings — the app runs, but fix these:"}),k.map((b,j)=>l.jsxs("div",{className:"miniapp-diag",children:[b.file,":",b.line,":",b.column," — ",b.message]},j))]}),l.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",title:`Mini app: ${t}`,srcDoc:v}),g.length>0&&l.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((b,j)=>l.jsxs("div",{className:"miniapp-rt-error",children:[l.jsx("div",{className:"miniapp-rt-error-message",children:b.message}),b.stack&&l.jsx("pre",{className:"miniapp-rt-error-stack",children:b.stack})]},j))})]})}function FT({appId:t,active:s}){const r=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=r.find(x=>x.id===t),m=a[t]??"",v=o.filter(x=>x.deleted!==1),k=m!==""&&!v.some(x=>x.path===m)?m:null;return l.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[l.jsxs("div",{className:"miniapp-header",children:[l.jsx(wi,{iconNode:g==null?void 0:g.iconNode,size:14,className:"miniapp-header-icon"}),l.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??t}),l.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(t,x.target.value),children:[l.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(x=>l.jsx("option",{value:x.path,children:x.label||x.path.split("/").pop()||x.path},x.path)),k&&l.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),l.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(t),children:[l.jsx(Cw,{size:13}),"Edit"]}),l.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:l.jsx(En,{size:14})})]}),l.jsx("div",{className:"miniapp-body",children:l.jsx(zT,{appId:t,workspace:m},`${t}:${m}`)})]})}function UT({side:t,minWidth:s,maxWidth:r,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,j=t==="left"?g.current+b:g.current-b,_=Math.min(r,Math.max(s,j));a(_)},[t,s,r,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,j;x.preventDefault(),x.stopPropagation();try{(j=(b=x.currentTarget)==null?void 0:b.setPointerCapture)==null||j.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 Fm({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=UT({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:a});return l.jsx("div",{className:`resize-handle ${t}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${t} panel`,"data-resizing":f?"":void 0})}function BT(){Ot.trackRender("IdeWorkspace");const t=L(v=>v.sidebarWidth),s=L(v=>v.rightPanelWidth),r=L(v=>v.setSidebarWidth),o=L(v=>v.setRightPanelWidth),a=L(v=>v.rightPanelCollapsed),u=L(v=>v.vscodeViewOpen),f=L(v=>v.usageViewOpen),h=L(v=>v.activeAppTabId),g=L(v=>v.openAppTabs);w.useEffect(()=>{const v=()=>{const k=Xa(),{rightPanelWidth:x,setRightPanelWidth:b}=L.getState();x>k&&b(k)};return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const m=a?`${t}px 6px 1fr ${k0}px`:`${t}px 6px 1fr 6px ${s}px`;return l.jsxs("div",{className:"ide-root",children:[l.jsxs("div",{className:`ide-layout ${u||f?"ide-hidden":""}`,style:{gridTemplateColumns:m},children:[l.jsx($k,{}),l.jsx(Fm,{side:"left",minWidth:Mu,maxWidth:Lu,getWidth:()=>L.getState().sidebarWidth,setWidth:r}),l.jsxs("div",{className:"ide-center",children:[l.jsx(zk,{}),l.jsxs("div",{className:"ide-render",children:[g.map(v=>l.jsx(FT,{appId:v,active:h===v},v)),h==null&&l.jsx(Ib,{})]}),l.jsx(Hb,{})]}),!a&&l.jsx(Fm,{side:"right",minWidth:Ya,maxWidth:Xa(),getWidth:()=>L.getState().rightPanelWidth,setWidth:o}),l.jsx(uT,{})]}),u&&l.jsx(xT,{}),f&&l.jsx(CT,{}),l.jsx(pT,{})]})}function WT(){const{showNewSessionDialog:t,setShowNewSessionDialog:s,createSession:r,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,j]=w.useState("");if(!t)return null;const _=_d(a),T=m?Yu(a,m):[];function A(){r({title:h.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:b.trim()||void 0,runtime_type:a}),g(""),j("")}function R(P){P.key==="Escape"&&s(!1)}function U(P){var K;v(P);const H=Yu(a,P);H.some(X=>X.effort===k)||x(Xu(a,P)??((K=H[0])==null?void 0:K.effort)??"")}return l.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:l.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:R,children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"New Session"}),l.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:l.jsx(En,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[l.jsxs("label",{className:"dialog-label",children:["Title (optional)",l.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:P=>g(P.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),l.jsxs("label",{className:"dialog-label",children:["Model",l.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:P=>U(P.target.value),children:[l.jsx("option",{value:"",children:"Default (Codex picks)"}),_.map(P=>l.jsxs("option",{value:P.slug,children:[P.displayName," — ",P.description]},P.slug))]})]}),T.length>0&&l.jsxs("label",{className:"dialog-label",children:["Thinking Level",l.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:P=>x(P.target.value),children:[l.jsxs("option",{value:"",children:["Default (",Xu(a,m),")"]}),T.map(P=>l.jsx("option",{value:P.effort,children:P.label},P.effort))]})]}),l.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",l.jsx("input",{className:"dialog-input",type:"text",value:b,onChange:P=>j(P.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:()=>s(!1),children:"Cancel"}),l.jsx("button",{className:"dialog-btn-create",onClick:A,children:"Create"})]})]})})}const HT=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,VT=512*1024;function qT(t){const s=t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function GT(){const{appCatalogOpen:t,closeAppCatalog:s,apps:r,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),[j,_]=w.useState(""),[T,A]=w.useState(""),[R,U]=w.useState(""),[P,H]=w.useState(""),[Y,K]=w.useState(null),[X,de]=w.useState(""),he=w.useRef(null);if(w.useEffect(()=>{t&&(m(null),E0().then(m).catch(()=>m([])))},[t]),w.useEffect(()=>{he.current&&(he.current.webkitdirectory=!0)},[f]),!t)return null;const V=new Set(r.map(O=>O.id));async function Te(O){k(O);try{await o(O)&&s()}finally{k(null)}}async function Ne(){if(x)return;const O=j.trim(),Q=T.trim();if(!(!O||!Q)){b(!0);try{await a({id:O,title:Q,description:R.trim()||void 0,icon:P.trim()||void 0})&&(_(""),A(""),U(""),H(""),s())}finally{b(!1)}}}async function Le(O){const Q=Array.from(O.target.files??[]),F={};let C="";for(const D of Q){const G=(D.webkitRelativePath??"").split("/");!C&&G.length>1&&(C=G[0]);const ue=G[G.length-1];if(!(!ue||!HT.test(ue))&&!(D.size>VT))try{F[ue]=await D.text()}catch{}}K(Object.keys(F).length>0?F:null),de(qT(C))}async function te(){if(!(x||!Y||!X.trim())){b(!0);try{await u(X.trim(),Y)&&(K(null),de(""),s())}finally{b(!1)}}}function se(O){O.key==="Escape"&&s()}const ie=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return l.jsx("div",{className:"dialog-overlay",onClick:s,children:l.jsxs("div",{className:"dialog app-catalog",onClick:O=>O.stopPropagation(),onKeyDown:se,children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"Add Mini App"}),l.jsx("button",{className:"dialog-close",onClick:s,children:"✕"})]}),l.jsx("div",{className:"catalog-tabs",children:ie.map(O=>l.jsx("button",{className:`catalog-tab${f===O.key?" active":""}`,onClick:()=>h(O.key),children:O.label},O.key))}),l.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&l.jsx("div",{className:"catalog-examples",children:g===null?l.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?l.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(O=>{const Q=V.has(O.id);return l.jsxs("div",{className:"example-row",children:[l.jsx(wi,{iconNode:O.iconNode,size:14,className:"sidebar-app-icon"}),l.jsxs("div",{className:"example-info",children:[l.jsx("span",{className:"example-title",children:O.title}),O.description&&l.jsx("span",{className:"example-desc",children:O.description})]}),l.jsx("button",{className:"example-install",disabled:Q||v===O.id,onClick:()=>Te(O.id),title:Q?"Already installed":"Install this example",children:Q?"Installed":v===O.id?"Installing…":"Install"})]},O.id)})}),f==="new"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"dialog-label",children:["App id (folder name)",l.jsx("input",{className:"dialog-input",type:"text",value:j,onChange:O=>_(O.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),l.jsxs("label",{className:"dialog-label",children:["Title",l.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:O=>A(O.target.value),placeholder:"e.g. Todo List"})]}),l.jsxs("label",{className:"dialog-label",children:["Description (optional)",l.jsx("input",{className:"dialog-input",type:"text",value:R,onChange:O=>U(O.target.value),placeholder:"What does this app do?"})]}),l.jsxs("label",{className:"dialog-label",children:[l.jsxs("span",{children:["Icon (optional, a"," ",l.jsx("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noreferrer",children:"Lucide icon"})," ","name)"]}),l.jsx("input",{className:"dialog-input",type:"text",value:P,onChange:O=>H(O.target.value),placeholder:"e.g. notebook-pen",spellCheck:!1,autoCapitalize:"off"})]}),l.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!j.trim()||!T.trim(),onClick:Ne,children:[l.jsx(Dr,{size:13})," Create App"]})]}),f==="upload"&&l.jsxs(l.Fragment,{children:[l.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."}),l.jsx("input",{ref:he,type:"file",multiple:!0,onChange:Le}),Y&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"dialog-label",children:["App id",l.jsx("input",{className:"dialog-input",type:"text",value:X,onChange:O=>de(O.target.value)})]}),l.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?", …":""]})]}),l.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!Y||!X.trim(),onClick:te,children:[l.jsx(Mw,{size:13})," Import App"]})]})]}),l.jsx("div",{className:"dialog-footer",children:l.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function KT(){const t=L(k=>k.showCommandPalette),s=L(k=>k.setShowCommandPalette),r=L(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),g=w.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,x=xl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Dr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:fs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:To,action:()=>{const b=document.querySelector(".cmd-input");b==null||b.focus()},available:!!r.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Lr,action:()=>r.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:vw,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:dr,action:()=>r.switchRightTab("sidecar"),available:!!r.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:r.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:Tw,action:()=>r.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:En,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),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(()=>{t&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[t]);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(),s(!1))}else k.key==="Escape"&&s(!1)}return t?l.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:l.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[l.jsxs("div",{className:"palette-search",children:[l.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown:v}),l.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?l.jsx("div",{className:"palette-empty",children:"No matching commands"}):l.jsx("div",{className:"palette-list",children:m.map((k,x)=>{const b=k.icon;return l.jsxs("div",{className:`palette-item ${x===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>f(x),children:[l.jsx("span",{className:"palette-item-icon",children:l.jsx(b,{size:16})}),l.jsx("span",{className:"palette-item-label",children:k.label}),l.jsx("span",{className:"palette-item-hint",children:k.hint}),x===u&&l.jsx(lw,{size:12,className:"palette-item-enter"})]},k.id)})}),l.jsxs("div",{className:"palette-footer",children:[l.jsxs("span",{className:"palette-footer-hint",children:[l.jsx("span",{className:"kbd",children:"↑"}),l.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),l.jsxs("span",{className:"palette-footer-hint",children:[l.jsx("span",{className:"kbd",children:"↵"})," Select"]}),l.jsxs("span",{className:"palette-footer-hint",children:[l.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Um=/^[a-z][a-z0-9-]{1,30}$/,YT=2e3;function XT(){const{showRemoteModal:t,setShowRemoteModal:s,selectSession:r}=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,j]=w.useState(!1),[_,T]=w.useState("main"),[A,R]=w.useState(""),[U,P]=w.useState(!1),[H,Y]=w.useState(null),K=w.useRef(null);bl(K,()=>j(!1),b);const X=m||k,de=w.useCallback(async()=>{g(!0),f(null);try{const O=await fetch(`${dn()}/remote/status`,{headers:{Accept:"application/json"}});if(!O.ok)throw new Error(`status ${O.status}`);a(await O.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);w.useEffect(()=>{t&&(T("main"),Y(null),de())},[t,de]);const he=H!==null&&H.state==="running";if(w.useEffect(()=>{if(!he)return;const O=setInterval(async()=>{try{const Q=await fetch(`${dn()}/remote/enable`,{headers:{Accept:"application/json"}});Q.ok&&Y(await Q.json())}catch{}},YT);return()=>clearInterval(O)},[he]),!t)return null;const V=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function Te(O){O.key==="Escape"&&s(!1)}async function Ne(O){if(Um.test(O)){P(!0);try{const Q=await fetch(`${dn()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:O})});if(!Q.ok)throw new Error(`enable ${Q.status}`);Y(await Q.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{P(!1)}}}function Le(){H!=null&&H.troubleshootingSessionId&&(r(H.troubleshootingSessionId),s(!1))}async function te(){v(!0);try{await fetch(`${dn()}/remote/disable`,{method:"POST"}),await de()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function se(){if(j(!1),!!window.confirm(`Remove the tunnel completely?
|
|
620
|
-
|
|
621
|
-
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
622
|
-
|
|
623
|
-
This cannot be undone.`)){x(!0);try{const Q=await fetch(`${dn()}/remote/uninstall`,{method:"DELETE"});if(!Q.ok)throw new Error(`uninstall ${Q.status}`);await de()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function ie(){if(!H)return l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",l.jsx("input",{className:"dialog-input",value:A,onChange:C=>R(C.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),l.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:()=>T("main"),children:"Back"}),l.jsxs("button",{className:"dialog-btn-create",disabled:!Um.test(A)||U,onClick:()=>void Ne(A),children:[U?l.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const O=["detect","provision","install","verify","ready"],Q=O.indexOf(H.step),F=H.state==="ready";return l.jsxs(l.Fragment,{children:[H.state==="running"&&l.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[l.jsx(Jn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),H.state==="ready"&&l.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[l.jsx(Os,{size:14})," Setup complete — you can close this window."]}),H.state==="ready"&&H.hostname&&l.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",l.jsx("a",{href:`https://${H.hostname}`,target:"_blank",rel:"noreferrer",children:H.hostname})]}),l.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:O.map((C,D)=>{const oe=F||Q>-1&&D<Q,G=!F&&D===Q&&H.state==="running";return l.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:oe||G?1:.4,color:oe?"var(--green)":void 0},children:[oe?l.jsx(Os,{size:13}):G?l.jsx(Jn,{size:13,className:"spin"}):l.jsx(ow,{size:9,style:{marginLeft:2,marginRight:2}}),C]},C)})}),H.logs.length>0&&l.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:H.logs.slice(-3).map(C=>C.message).join(`
|
|
624
|
-
`)}),H.state==="troubleshooting"&&l.jsxs(l.Fragment,{children:[l.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."}),l.jsx("div",{className:"dialog-footer",children:l.jsx("button",{className:"dialog-btn-create",onClick:Le,children:"Open troubleshooting session"})})]}),H.state==="failed"&&l.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",H.error]}),l.jsx("div",{className:"dialog-footer",children:l.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void de(),children:"Refresh status"})})]})}return l.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:l.jsxs("div",{className:"dialog",onClick:O=>O.stopPropagation(),onKeyDown:Te,children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"Remote Access"}),l.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:l.jsx(En,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[h&&l.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[l.jsx(Jn,{size:14,className:"spin"})," Loading machine status…"]}),u&&l.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),_==="setup"?ie():l.jsxs(l.Fragment,{children:[V&&(o==null?void 0:o.tunnel.hostname)&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",l.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),l.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[l.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void te(),disabled:X,children:[m?l.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),l.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>j(O=>!O),disabled:X,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":b,children:k?l.jsx(Jn,{size:14,className:"spin"}):l.jsx(vi,{size:14})}),b&&l.jsx("div",{ref:K,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:l.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void se(),children:[l.jsx(fs,{size:12})," Remove tunnel"]})})]})]}),!V&&l.jsx(l.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",l.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),l.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void Ne(o.tunnel.mahlas),disabled:U,children:[U?l.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):l.jsx(Rh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>T("setup"),children:[l.jsx(Rh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),l.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const QT={success:rw,error:Tl,info:fw,warn:Iw},ZT=4e3;function JT({toast:t}){const s=L(f=>f.removeToast),r=QT[t.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>s(t.id),ZT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[t.id,s]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(t.id),2e3)}return l.jsxs("div",{className:`toast toast-${t.type}`,onMouseEnter:a,onMouseLeave:u,children:[l.jsx(r,{size:16}),l.jsx("span",{className:"toast-message",children:t.message}),t.undoAction&&l.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=t.undoAction)==null||f.call(t),s(t.id)},children:[l.jsx(Dw,{size:12})," ",t.undoLabel||"Undo"]}),l.jsx("button",{className:"toast-close",onClick:()=>s(t.id),children:l.jsx(En,{size:14})})]})}function eN(){const t=L(s=>s.toasts);return t.length===0?null:l.jsx("div",{className:"toast-container",children:t.map(s=>l.jsx(JT,{toast:s},s.id))})}function tN(){const[t]=w.useState(m0),[s,r]=w.useState(!1),[o,a]=w.useState(!1),u=w.useRef(void 0);w.useEffect(()=>()=>clearTimeout(u.current),[]);async function f(){await ul(vh)&&(r(!0),a(!0),clearTimeout(u.current),u.current=setTimeout(()=>r(!1),1500))}return l.jsxs("main",{className:"daemon-download",children:[l.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),t&&l.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg app to continue."}),l.jsxs("div",{className:"daemon-download-install",children:[t&&l.jsx("p",{className:"daemon-download-label",children:"Not installed? Run this in Terminal:"}),l.jsxs("div",{className:"daemon-download-cmd",onCopy:()=>a(!0),children:[l.jsx("span",{className:"daemon-download-prompt","aria-hidden":"true",children:"$"}),l.jsx("code",{children:vh}),l.jsx("button",{type:"button",className:`daemon-download-copy${s?" copied":""}`,onClick:()=>void f(),"aria-label":"Copy the install command",title:s?"Copied":"Copy",children:s?l.jsx(Os,{size:15}):l.jsx(nl,{size:15})})]}),!t&&l.jsx("p",{className:"daemon-download-meta",children:"Apple Silicon · macOS 13+"})]}),o&&l.jsx("p",{className:"daemon-download-hint",children:"Paste it into Terminal and press Return. Repoburg installs and opens in your menu bar."}),(t||o)&&l.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[l.jsx(Jn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Zn=null,xi=null,vo=1e3;const nN=1e4;function sN(){const t=dn();return t?`${t.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Qu(){Zn&&(Zn.readyState===WebSocket.OPEN||Zn.readyState===WebSocket.CONNECTING)||(Zn=new WebSocket(sN()),Zn.onopen=()=>{const t=vo>1e3;if(vo=1e3,L.getState().setWsConnected(!0),L.getState().addLogEntry("INFO","WebSocket connected"),t){o0();const s=L.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Zn.onclose=()=>{L.getState().setWsConnected(!1),L.getState().addLogEntry("WARN","WebSocket disconnected"),L.getState().addToast("warn","WebSocket disconnected — reconnecting…"),iN()},Zn.onerror=()=>{},Zn.onmessage=t=>{try{const s=JSON.parse(t.data);Ot.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof t.data=="string"?t.data.length:0);const r=oN[s.event];r&&r(s.data)}catch{}})}function rN(){xi&&(clearTimeout(xi),xi=null),Zn&&(Zn.onclose=null,Zn.close(),Zn=null),L.getState().setWsConnected(!1)}function iN(){xi||(xi=window.setTimeout(()=>{xi=null,Qu()},vo),vo=Math.min(vo*2,nN))}const oN={"turn:created":t=>{const s=t;L.getState().onTurnCreated(s.sessionId,s.turn)},"turn:started":t=>{const s=t;Ot.note(`turn:started — ${s.turnId.slice(0,8)}`),L.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":t=>{const s=t;L.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":t=>{const s=t;L.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":t=>{const s=t;L.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":t=>{const s=t;L.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":t=>{const s=t;Ot.note(`turn:completed — ${s.turnId.slice(0,8)}`),L.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":t=>{const s=t;L.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":t=>{const s=t,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage,...s.autoCompactThreshold?{autoCompactThreshold:s.autoCompactThreshold}:{}};L.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":t=>{const s=t;L.getState().onTurnFailed(s.sessionId,s.turnId,s.error,s.resumeState)},"turn:interrupted":t=>{const s=t;Ot.note(`turn:interrupted — ${s.turnId.slice(0,8)} (${s.reason})`),L.getState().onTurnInterrupted(s.sessionId,s.turnId,{reason:s.reason,interruptedAt:s.interruptedAt,attempts:s.attempts,detail:s.detail??null})},"turn:resuming":t=>{const s=t;L.getState().onTurnResuming(s.sessionId,s.turnId,s.attempt)},"turn:resumed":t=>{const s=t;L.getState().onTurnResumed(s.sessionId,s.turnId)},"turn:retrying":t=>{const s=t;L.getState().onTurnRetrying(s.sessionId,s.turnId,{attempt:s.attempt,maxRetries:s.maxRetries,retryDelayMs:s.retryDelayMs,errorStatus:s.errorStatus??null,error:s.error??null})},"turn:cancelled":t=>{const s=t;L.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":t=>{const s=t;L.getState().onSessionTitle(s.sessionId,s.title)},"session:touched":t=>{const s=t;L.getState().onSessionTouched(s.sessionId)},"session:updated":t=>{const s=t;L.getState().onSessionUpdated(s.session)},background_tasks:t=>{const s=t;Ot.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),L.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"background_tasks:snapshot":t=>{const s=t;L.getState().onBackgroundTasksSnapshot(s.sessions??{})},"thread:created":t=>{const s=t;L.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":t=>{const s=t;L.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":t=>{const s=t;L.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":t=>{const s=t;L.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":t=>{const s=t;e0(s.appId,s.callId,s.tool,s.args??{})},"app:source:updated":t=>{a0(t.appId)},"app:state_changed":t=>{const{appId:s,...r}=t;ig(s,r)}};function aN(){const t=L(s=>s.init);return w.useEffect(()=>{kx();function s(){t(),Qu()}const{daemonStatus:r,setDaemonStatus:o}=L.getState();let a=null;r==="ready"?s():a=v0({onMissing:()=>o("missing"),onReady:()=>{o("ready"),s()}});function u(){if(document.visibilityState!=="visible")return;const f=L.getState(),h=f.activeSessionId;if(!h)return;const g=f.sessionDetails[h];f.wsConnected||Qu(),g&&g.is_running===1&&(f.refreshActiveSession(),f.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",u),()=>{a==null||a(),rN(),document.removeEventListener("visibilitychange",u)}},[t]),null}function lN(){const t=L(u=>u.loading),s=L(u=>u.error),r=L(u=>u.sessions),o=L(u=>u.daemonStatus),a=L(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]),l.jsxs(l.Fragment,{children:[l.jsx(aN,{}),o==="missing"?l.jsx(tN,{}):o==="checking"||t&&r.length===0?l.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?l.jsxs("div",{className:"empty-state",children:["Error: ",s]}):l.jsxs(l.Fragment,{children:[l.jsx(BT,{}),l.jsx(WT,{}),l.jsx(GT,{}),l.jsx(XT,{}),l.jsx(KT,{}),l.jsx(eN,{})]})]})}dx.createRoot(document.getElementById("root")).render(l.jsx(it.StrictMode,{children:l.jsx(lN,{})}));
|