repoburg 1.3.235 → 1.3.236
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 +1188 -260
- package/agent-pane/backend/dist/server.js +1188 -260
- package/agent-pane/frontend/dist/assets/index-BKidPoB0.js +475 -0
- package/agent-pane/frontend/dist/assets/{index-B8tLcszC.css → index-qS_kafxG.css} +1 -1
- package/agent-pane/frontend/dist/index.html +2 -2
- package/daemon/dist/instance-entry.spec.js +57 -0
- package/daemon/dist/instanceEntry.js +19 -0
- package/daemon/dist/serviceManager.js +32 -16
- package/daemon/dist/serviceManager.spec.js +22 -4
- package/daemon/instance-entry-keys.js +22 -0
- package/daemon/instance-entry.js +28 -0
- package/miniapp-catalog-modal.png +0 -0
- package/miniapp-daemon-e2e-green.png +0 -0
- package/miniapp-faz31-codex-green.png +0 -0
- package/miniapp-pr-review-green.png +0 -0
- package/miniapp-workspace-scoped.png +0 -0
- package/package.json +1 -1
- package/agent-pane/frontend/dist/assets/index-CpjdL6KA.js +0 -424
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
var ny=Object.defineProperty;var ry=(n,r,s)=>r in n?ny(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var st=(n,r,s)=>ry(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function lm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bc={exports:{}},Wi={},Wc={exports:{}},Ue={};/**
|
|
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 Ip;function sy(){if(Ip)return Ue;Ip=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),w=Symbol.iterator;function y(E){return E===null||typeof E!="object"?null:(E=w&&E[w]||E["@@iterator"],typeof E=="function"?E:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function b(E,I,le){this.props=E,this.context=I,this.refs=C,this.updater=le||T}b.prototype.isReactComponent={},b.prototype.setState=function(E,I){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,I,"setState")},b.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function D(){}D.prototype=b.prototype;function A(E,I,le){this.props=E,this.context=I,this.refs=C,this.updater=le||T}var U=A.prototype=new D;U.constructor=A,j(U,b.prototype),U.isPureReactComponent=!0;var L=Array.isArray,H=Object.prototype.hasOwnProperty,X={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function q(E,I,le){var ae,he={},ye=null,_e=null;if(I!=null)for(ae in I.ref!==void 0&&(_e=I.ref),I.key!==void 0&&(ye=""+I.key),I)H.call(I,ae)&&!K.hasOwnProperty(ae)&&(he[ae]=I[ae]);var Se=arguments.length-2;if(Se===1)he.children=le;else if(1<Se){for(var Ae=Array(Se),be=0;be<Se;be++)Ae[be]=arguments[be+2];he.children=Ae}if(E&&E.defaultProps)for(ae in Se=E.defaultProps,Se)he[ae]===void 0&&(he[ae]=Se[ae]);return{$$typeof:n,type:E,key:ye,ref:_e,props:he,_owner:X.current}}function ie(E,I){return{$$typeof:n,type:E.type,key:I,ref:E.ref,props:E.props,_owner:E._owner}}function fe(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function ce(E){var I={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(le){return I[le]})}var Le=/\/+/g;function Re(E,I){return typeof E=="object"&&E!==null&&E.key!=null?ce(""+E.key):I.toString(36)}function Oe(E,I,le,ae,he){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var _e=!1;if(E===null)_e=!0;else switch(ye){case"string":case"number":_e=!0;break;case"object":switch(E.$$typeof){case n:case r:_e=!0}}if(_e)return _e=E,he=he(_e),E=ae===""?"."+Re(_e,0):ae,L(he)?(le="",E!=null&&(le=E.replace(Le,"$&/")+"/"),Oe(he,I,le,"",function(be){return be})):he!=null&&(fe(he)&&(he=ie(he,le+(!he.key||_e&&_e.key===he.key?"":(""+he.key).replace(Le,"$&/")+"/")+E)),I.push(he)),1;if(_e=0,ae=ae===""?".":ae+":",L(E))for(var Se=0;Se<E.length;Se++){ye=E[Se];var Ae=ae+Re(ye,Se);_e+=Oe(ye,I,le,Ae,he)}else if(Ae=y(E),typeof Ae=="function")for(E=Ae.call(E),Se=0;!(ye=E.next()).done;)ye=ye.value,Ae=ae+Re(ye,Se++),_e+=Oe(ye,I,le,Ae,he);else if(ye==="object")throw I=String(E),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return _e}function G(E,I,le){if(E==null)return E;var ae=[],he=0;return Oe(E,ae,"","",function(ye){return I.call(le,ye,he++)}),ae}function Y(E){if(E._status===-1){var I=E._result;I=I(),I.then(function(le){(E._status===0||E._status===-1)&&(E._status=1,E._result=le)},function(le){(E._status===0||E._status===-1)&&(E._status=2,E._result=le)}),E._status===-1&&(E._status=0,E._result=I)}if(E._status===1)return E._result.default;throw E._result}var te={current:null},z={transition:null},Q={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:z,ReactCurrentOwner:X};function V(){throw Error("act(...) is not supported in production builds of React.")}return Ue.Children={map:G,forEach:function(E,I,le){G(E,function(){I.apply(this,arguments)},le)},count:function(E){var I=0;return G(E,function(){I++}),I},toArray:function(E){return G(E,function(I){return I})||[]},only:function(E){if(!fe(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},Ue.Component=b,Ue.Fragment=s,Ue.Profiler=a,Ue.PureComponent=A,Ue.StrictMode=o,Ue.Suspense=m,Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Ue.act=V,Ue.cloneElement=function(E,I,le){if(E==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+E+".");var ae=j({},E.props),he=E.key,ye=E.ref,_e=E._owner;if(I!=null){if(I.ref!==void 0&&(ye=I.ref,_e=X.current),I.key!==void 0&&(he=""+I.key),E.type&&E.type.defaultProps)var Se=E.type.defaultProps;for(Ae in I)H.call(I,Ae)&&!K.hasOwnProperty(Ae)&&(ae[Ae]=I[Ae]===void 0&&Se!==void 0?Se[Ae]:I[Ae])}var Ae=arguments.length-2;if(Ae===1)ae.children=le;else if(1<Ae){Se=Array(Ae);for(var be=0;be<Ae;be++)Se[be]=arguments[be+2];ae.children=Se}return{$$typeof:n,type:E.type,key:he,ref:ye,props:ae,_owner:_e}},Ue.createContext=function(E){return E={$$typeof:f,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},E.Provider={$$typeof:u,_context:E},E.Consumer=E},Ue.createElement=q,Ue.createFactory=function(E){var I=q.bind(null,E);return I.type=E,I},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(E){return{$$typeof:h,render:E}},Ue.isValidElement=fe,Ue.lazy=function(E){return{$$typeof:x,_payload:{_status:-1,_result:E},_init:Y}},Ue.memo=function(E,I){return{$$typeof:g,type:E,compare:I===void 0?null:I}},Ue.startTransition=function(E){var I=z.transition;z.transition={};try{E()}finally{z.transition=I}},Ue.unstable_act=V,Ue.useCallback=function(E,I){return te.current.useCallback(E,I)},Ue.useContext=function(E){return te.current.useContext(E)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(E){return te.current.useDeferredValue(E)},Ue.useEffect=function(E,I){return te.current.useEffect(E,I)},Ue.useId=function(){return te.current.useId()},Ue.useImperativeHandle=function(E,I,le){return te.current.useImperativeHandle(E,I,le)},Ue.useInsertionEffect=function(E,I){return te.current.useInsertionEffect(E,I)},Ue.useLayoutEffect=function(E,I){return te.current.useLayoutEffect(E,I)},Ue.useMemo=function(E,I){return te.current.useMemo(E,I)},Ue.useReducer=function(E,I,le){return te.current.useReducer(E,I,le)},Ue.useRef=function(E){return te.current.useRef(E)},Ue.useState=function(E){return te.current.useState(E)},Ue.useSyncExternalStore=function(E,I,le){return te.current.useSyncExternalStore(E,I,le)},Ue.useTransition=function(){return te.current.useTransition()},Ue.version="18.3.1",Ue}var Dp;function Mu(){return Dp||(Dp=1,Wc.exports=sy()),Wc.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 Mp;function iy(){if(Mp)return Wi;Mp=1;var n=Mu(),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,m,g){var x,w={},y=null,T=null;g!==void 0&&(y=""+g),m.key!==void 0&&(y=""+m.key),m.ref!==void 0&&(T=m.ref);for(x in m)o.call(m,x)&&!u.hasOwnProperty(x)&&(w[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)w[x]===void 0&&(w[x]=m[x]);return{$$typeof:r,type:h,key:y,ref:T,props:w,_owner:a.current}}return Wi.Fragment=s,Wi.jsx=f,Wi.jsxs=f,Wi}var Lp;function oy(){return Lp||(Lp=1,Bc.exports=iy()),Bc.exports}var c=oy(),k=Mu();const et=lm(k);var wl={},Hc={exports:{}},kn={},Vc={exports:{}},Gc={};/**
|
|
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 Pp;function ly(){return Pp||(Pp=1,(function(n){function r(z,Q){var V=z.length;z.push(Q);e:for(;0<V;){var E=V-1>>>1,I=z[E];if(0<a(I,Q))z[E]=Q,z[V]=I,V=E;else break e}}function s(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var Q=z[0],V=z.pop();if(V!==Q){z[0]=V;e:for(var E=0,I=z.length,le=I>>>1;E<le;){var ae=2*(E+1)-1,he=z[ae],ye=ae+1,_e=z[ye];if(0>a(he,V))ye<I&&0>a(_e,he)?(z[E]=_e,z[ye]=V,E=ye):(z[E]=he,z[ae]=V,E=ae);else if(ye<I&&0>a(_e,V))z[E]=_e,z[ye]=V,E=ye;else break e}}return Q}function a(z,Q){var V=z.sortIndex-Q.sortIndex;return V!==0?V:z.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],g=[],x=1,w=null,y=3,T=!1,j=!1,C=!1,b=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(z){for(var Q=s(g);Q!==null;){if(Q.callback===null)o(g);else if(Q.startTime<=z)o(g),Q.sortIndex=Q.expirationTime,r(m,Q);else break;Q=s(g)}}function L(z){if(C=!1,U(z),!j)if(s(m)!==null)j=!0,Y(H);else{var Q=s(g);Q!==null&&te(L,Q.startTime-z)}}function H(z,Q){j=!1,C&&(C=!1,D(q),q=-1),T=!0;var V=y;try{for(U(Q),w=s(m);w!==null&&(!(w.expirationTime>Q)||z&&!ce());){var E=w.callback;if(typeof E=="function"){w.callback=null,y=w.priorityLevel;var I=E(w.expirationTime<=Q);Q=n.unstable_now(),typeof I=="function"?w.callback=I:w===s(m)&&o(m),U(Q)}else o(m);w=s(m)}if(w!==null)var le=!0;else{var ae=s(g);ae!==null&&te(L,ae.startTime-Q),le=!1}return le}finally{w=null,y=V,T=!1}}var X=!1,K=null,q=-1,ie=5,fe=-1;function ce(){return!(n.unstable_now()-fe<ie)}function Le(){if(K!==null){var z=n.unstable_now();fe=z;var Q=!0;try{Q=K(!0,z)}finally{Q?Re():(X=!1,K=null)}}else X=!1}var Re;if(typeof A=="function")Re=function(){A(Le)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,G=Oe.port2;Oe.port1.onmessage=Le,Re=function(){G.postMessage(null)}}else Re=function(){b(Le,0)};function Y(z){K=z,X||(X=!0,Re())}function te(z,Q){q=b(function(){z(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_continueExecution=function(){j||T||(j=!0,Y(H))},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ie=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return s(m)},n.unstable_next=function(z){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var V=y;y=Q;try{return z()}finally{y=V}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=y;y=z;try{return Q()}finally{y=V}},n.unstable_scheduleCallback=function(z,Q,V){var E=n.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?E+V:E):V=E,z){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=V+I,z={id:x++,callback:Q,priorityLevel:z,startTime:V,expirationTime:I,sortIndex:-1},V>E?(z.sortIndex=V,r(g,z),s(m)===null&&z===s(g)&&(C?(D(q),q=-1):C=!0,te(L,V-E))):(z.sortIndex=I,r(m,z),j||T||(j=!0,Y(H))),z},n.unstable_shouldYield=ce,n.unstable_wrapCallback=function(z){var Q=y;return function(){var V=y;y=Q;try{return z.apply(this,arguments)}finally{y=V}}}})(Gc)),Gc}var Op;function ay(){return Op||(Op=1,Vc.exports=ly()),Vc.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 zp;function cy(){if(zp)return kn;zp=1;var n=Mu(),r=ay();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function u(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x={},w={};function y(e){return m.call(w,e)?!0:m.call(x,e)?!1:g.test(e)?w[e]=!0:(x[e]=!0,!1)}function T(e,t,i,l){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,t,i,l){if(t===null||typeof t>"u"||T(e,t,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,i,l,d,p,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=v}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function A(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(D,A);b[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(D,A);b[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(D,A);b[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,i,l){var d=b.hasOwnProperty(t)?b[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(j(t,i,d,l)&&(i=null),l||d===null?y(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(t=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(t):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,t,i):e.setAttribute(t,i))))}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),X=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),ie=Symbol.for("react.profiler"),fe=Symbol.for("react.provider"),ce=Symbol.for("react.context"),Le=Symbol.for("react.forward_ref"),Re=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),z=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var V=Object.assign,E;function I(e){if(E===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);E=t&&t[1]||""}return`
|
|
34
|
+
`+E+e}var le=!1;function ae(e,t){if(!e||le)return"";le=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(B){var l=B}Reflect.construct(e,[],t)}else{try{t.call()}catch(B){l=B}e.call(t.prototype)}else{try{throw Error()}catch(B){l=B}e()}}catch(B){if(B&&l&&typeof B.stack=="string"){for(var d=B.stack.split(`
|
|
35
|
+
`),p=l.stack.split(`
|
|
36
|
+
`),v=d.length-1,N=p.length-1;1<=v&&0<=N&&d[v]!==p[N];)N--;for(;1<=v&&0<=N;v--,N--)if(d[v]!==p[N]){if(v!==1||N!==1)do if(v--,N--,0>N||d[v]!==p[N]){var _=`
|
|
37
|
+
`+d[v].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),_}while(1<=v&&0<=N);break}}}finally{le=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?I(e):""}function he(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=ae(e.type,!1),e;case 11:return e=ae(e.type.render,!1),e;case 1:return e=ae(e.type,!0),e;default:return""}}function ye(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 X:return"Portal";case ie:return"Profiler";case q:return"StrictMode";case Re:return"Suspense";case Oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case fe:return(e._context.displayName||"Context")+".Provider";case Le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case Y:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function _e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(t);case 8:return t===q?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Se(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ae(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function be(e){var t=Ae(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lt(e){e._valueTracker||(e._valueTracker=be(e))}function je(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=Ae(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function St(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Pe(e,t){var i=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Mt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Se(t.value!=null?t.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $e(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function Yt(e,t){$e(e,t);var i=Se(t.value),l=t.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pt(e,t.type,i):t.hasOwnProperty("defaultValue")&&pt(e,t.type,Se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function bn(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function pt(e,t,i){(t!=="number"||St(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var xt=Array.isArray;function W(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Se(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Ie(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function M(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(s(92));if(xt(i)){if(1<i.length)throw Error(s(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Se(i)}}function oe(e,t){var i=Se(t.value),l=Se(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Ne(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ue(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 ze(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ue(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fe,Je=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(t,i,l,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fe=Fe||document.createElement("div"),Fe.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function dt(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var tt={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},fn=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(e){fn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tt[t]=tt[e]})});function Nn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||tt.hasOwnProperty(e)&&tt[e]?(""+t).trim():t+"px"}function pn(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Nn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Cn=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Be(e,t){if(t){if(Cn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function nt(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Lt=null;function Pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,On=null,it=null;function Rt(e){if(e=_i(e)){if(typeof Xt!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Lo(t),Xt(e.stateNode,e.type,t))}}function Ct(e){On?it?it.push(e):it=[e]:On=e}function hn(){if(On){var e=On,t=it;if(it=On=null,Rt(e),t)for(e=0;e<t.length;e++)Rt(t[e])}}function Et(e,t){return e(t)}function Tt(){}var at=!1;function Qt(e,t,i){if(at)return e(t,i);at=!0;try{return Et(e,t,i)}finally{at=!1,(On!==null||it!==null)&&(Tt(),hn())}}function rt(e,t){var i=e.stateNode;if(i===null)return null;var l=Lo(i);if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var Zt=!1;if(h)try{var Pt={};Object.defineProperty(Pt,"passive",{get:function(){Zt=!0}}),window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{Zt=!1}function mn(e,t,i,l,d,p,v,N,_){var B=Array.prototype.slice.call(arguments,3);try{t.apply(i,B)}catch(ee){this.onError(ee)}}var sn=!1,En=null,Wt=!1,qn=null,Kn={onError:function(e){sn=!0,En=e}};function ua(e,t,i,l,d,p,v,N,_){sn=!1,En=null,mn.apply(Kn,arguments)}function da(e,t,i,l,d,p,v,N,_){if(ua.apply(this,arguments),sn){if(sn){var B=En;sn=!1,En=null}else throw Error(s(198));Wt||(Wt=!0,qn=B)}}function Xe(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function hr(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ho(e){if(Xe(e)!==e)throw Error(s(188))}function mo(e){var t=e.alternate;if(!t){if(t=Xe(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return ho(d),e;if(p===l)return ho(d),t;p=p.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,N=d.child;N;){if(N===i){v=!0,i=d,l=p;break}if(N===l){v=!0,l=d,i=p;break}N=N.sibling}if(!v){for(N=p.child;N;){if(N===i){v=!0,i=p,l=d;break}if(N===l){v=!0,l=p,i=d;break}N=N.sibling}if(!v)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function Ss(e){return e=mo(e),e!==null?ci(e):null}function ci(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ci(e);if(t!==null)return t;e=e.sibling}return null}var ui=r.unstable_scheduleCallback,go=r.unstable_cancelCallback,fa=r.unstable_shouldYield,pa=r.unstable_requestPaint,ht=r.unstable_now,ir=r.unstable_getCurrentPriorityLevel,jr=r.unstable_ImmediatePriority,or=r.unstable_UserBlockingPriority,Ts=r.unstable_NormalPriority,Jr=r.unstable_LowPriority,vo=r.unstable_IdlePriority,es=null,_n=null;function bs(e){if(_n&&typeof _n.onCommitFiberRoot=="function")try{_n.onCommitFiberRoot(es,e,void 0,(e.current.flags&128)===128)}catch{}}var on=Math.clz32?Math.clz32:ts,Ns=Math.log,Rr=Math.LN2;function ts(e){return e>>>=0,e===0?32:31-(Ns(e)/Rr|0)|0}var ln=64,Cs=4194304;function ns(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 rs(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,v=i&268435455;if(v!==0){var N=v&~d;N!==0?l=ns(N):(p&=v,p!==0&&(l=ns(p)))}else v=i&~d,v!==0?l=ns(v):p!==0&&(l=ns(p));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((l&4)!==0&&(l|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)i=31-on(t),d=1<<i,l|=e[i],t&=~d;return l}function yo(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xo(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-on(p),N=1<<v,_=d[v];_===-1?((N&i)===0||(N&l)!==0)&&(d[v]=yo(N,t)):_<=t&&(e.expiredLanes|=N),p&=~N}}function di(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function fi(){var e=ln;return ln<<=1,(ln&4194240)===0&&(ln=64),e}function pi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ss(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-on(t),e[t]=i}function wo(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-on(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Ar(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-on(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ve=0;function re(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,O,Z,ge,we,Me=!1,Ge=[],Ke=null,mt=null,gt=null,mr=new Map,bt=new Map,Ir=[],bg="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 hd(e,t){switch(e){case"focusin":case"focusout":Ke=null;break;case"dragenter":case"dragleave":mt=null;break;case"mouseover":case"mouseout":gt=null;break;case"pointerover":case"pointerout":mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bt.delete(t.pointerId)}}function hi(e,t,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},t!==null&&(t=_i(t),t!==null&&O(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Ng(e,t,i,l,d){switch(t){case"focusin":return Ke=hi(Ke,e,t,i,l,d),!0;case"dragenter":return mt=hi(mt,e,t,i,l,d),!0;case"mouseover":return gt=hi(gt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return mr.set(p,hi(mr.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,bt.set(p,hi(bt.get(p)||null,e,t,i,l,d)),!0}return!1}function md(e){var t=is(e.target);if(t!==null){var i=Xe(t);if(i!==null){if(t=i.tag,t===13){if(t=hr(i),t!==null){e.blockedOn=t,we(e.priority,function(){Z(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ko(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ma(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Lt=l,i.target.dispatchEvent(l),Lt=null}else return t=_i(i),t!==null&&O(t),e.blockedOn=i,!1;t.shift()}return!0}function gd(e,t,i){ko(e)&&i.delete(t)}function Cg(){Me=!1,Ke!==null&&ko(Ke)&&(Ke=null),mt!==null&&ko(mt)&&(mt=null),gt!==null&&ko(gt)&&(gt=null),mr.forEach(gd),bt.forEach(gd)}function mi(e,t){e.blockedOn===t&&(e.blockedOn=null,Me||(Me=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Cg)))}function gi(e){function t(d){return mi(d,e)}if(0<Ge.length){mi(Ge[0],e);for(var i=1;i<Ge.length;i++){var l=Ge[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Ke!==null&&mi(Ke,e),mt!==null&&mi(mt,e),gt!==null&&mi(gt,e),mr.forEach(t),bt.forEach(t),i=0;i<Ir.length;i++)l=Ir[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ir.length&&(i=Ir[0],i.blockedOn===null);)md(i),i.blockedOn===null&&Ir.shift()}var Es=L.ReactCurrentBatchConfig,So=!0;function Eg(e,t,i,l){var d=Ve,p=Es.transition;Es.transition=null;try{Ve=1,ha(e,t,i,l)}finally{Ve=d,Es.transition=p}}function _g(e,t,i,l){var d=Ve,p=Es.transition;Es.transition=null;try{Ve=4,ha(e,t,i,l)}finally{Ve=d,Es.transition=p}}function ha(e,t,i,l){if(So){var d=ma(e,t,i,l);if(d===null)Ia(e,t,l,To,i),hd(e,l);else if(Ng(d,e,t,i,l))l.stopPropagation();else if(hd(e,l),t&4&&-1<bg.indexOf(e)){for(;d!==null;){var p=_i(d);if(p!==null&&S(p),p=ma(e,t,i,l),p===null&&Ia(e,t,l,To,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Ia(e,t,l,null,i)}}var To=null;function ma(e,t,i,l){if(To=null,e=Pn(l),e=is(e),e!==null)if(t=Xe(e),t===null)e=null;else if(i=t.tag,i===13){if(e=hr(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return To=e,null}function vd(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(ir()){case jr:return 1;case or:return 4;case Ts:case Jr:return 16;case vo:return 536870912;default:return 16}default:return 16}}var Dr=null,ga=null,bo=null;function yd(){if(bo)return bo;var e,t=ga,i=t.length,l,d="value"in Dr?Dr.value:Dr.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var v=i-e;for(l=1;l<=v&&t[i-l]===d[p-l];l++);return bo=d.slice(e,1<l?1-l:void 0)}function No(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Co(){return!0}function xd(){return!1}function jn(e){function t(i,l,d,p,v){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=v,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)?Co:xd,this.isPropagationStopped=xd,this}return V(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Co)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Co)},persist:function(){},isPersistent:Co}),t}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},va=jn(_s),vi=V({},_s,{view:0,detail:0}),jg=jn(vi),ya,xa,yi,Eo=V({},vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ka,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!==yi&&(yi&&e.type==="mousemove"?(ya=e.screenX-yi.screenX,xa=e.screenY-yi.screenY):xa=ya=0,yi=e),ya)},movementY:function(e){return"movementY"in e?e.movementY:xa}}),wd=jn(Eo),Rg=V({},Eo,{dataTransfer:0}),Ag=jn(Rg),Ig=V({},vi,{relatedTarget:0}),wa=jn(Ig),Dg=V({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),Mg=jn(Dg),Lg=V({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pg=jn(Lg),Og=V({},_s,{data:0}),kd=jn(Og),zg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$g={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"},Fg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ug(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fg[e])?!!t[e]:!1}function ka(){return Ug}var Bg=V({},vi,{key:function(e){if(e.key){var t=zg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=No(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$g[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ka,charCode:function(e){return e.type==="keypress"?No(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?No(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wg=jn(Bg),Hg=V({},Eo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sd=jn(Hg),Vg=V({},vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ka}),Gg=jn(Vg),qg=V({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kg=jn(qg),Yg=V({},Eo,{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}),Xg=jn(Yg),Qg=[9,13,27,32],Sa=h&&"CompositionEvent"in window,xi=null;h&&"documentMode"in document&&(xi=document.documentMode);var Zg=h&&"TextEvent"in window&&!xi,Td=h&&(!Sa||xi&&8<xi&&11>=xi),bd=" ",Nd=!1;function Cd(e,t){switch(e){case"keyup":return Qg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ed(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var js=!1;function Jg(e,t){switch(e){case"compositionend":return Ed(t);case"keypress":return t.which!==32?null:(Nd=!0,bd);case"textInput":return e=t.data,e===bd&&Nd?null:e;default:return null}}function ev(e,t){if(js)return e==="compositionend"||!Sa&&Cd(e,t)?(e=yd(),bo=ga=Dr=null,js=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Td&&t.locale!=="ko"?null:t.data;default:return null}}var tv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tv[e.type]:t==="textarea"}function jd(e,t,i,l){Ct(l),t=Io(t,"onChange"),0<t.length&&(i=new va("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var wi=null,ki=null;function nv(e){qd(e,0)}function _o(e){var t=Ms(e);if(je(t))return e}function rv(e,t){if(e==="change")return t}var Rd=!1;if(h){var Ta;if(h){var ba="oninput"in document;if(!ba){var Ad=document.createElement("div");Ad.setAttribute("oninput","return;"),ba=typeof Ad.oninput=="function"}Ta=ba}else Ta=!1;Rd=Ta&&(!document.documentMode||9<document.documentMode)}function Id(){wi&&(wi.detachEvent("onpropertychange",Dd),ki=wi=null)}function Dd(e){if(e.propertyName==="value"&&_o(ki)){var t=[];jd(t,ki,e,Pn(e)),Qt(nv,t)}}function sv(e,t,i){e==="focusin"?(Id(),wi=t,ki=i,wi.attachEvent("onpropertychange",Dd)):e==="focusout"&&Id()}function iv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _o(ki)}function ov(e,t){if(e==="click")return _o(t)}function lv(e,t){if(e==="input"||e==="change")return _o(t)}function av(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yn=typeof Object.is=="function"?Object.is:av;function Si(e,t){if(Yn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(t,d)||!Yn(e[d],t[d]))return!1}return!0}function Md(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ld(e,t){var i=Md(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Md(i)}}function Pd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Od(){for(var e=window,t=St();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=St(e.document)}return t}function Na(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cv(e){var t=Od(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&Pd(i.ownerDocument.documentElement,i)){if(l!==null&&Na(i)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=Ld(i,p);var v=Ld(i,l);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uv=h&&"documentMode"in document&&11>=document.documentMode,Rs=null,Ca=null,Ti=null,Ea=!1;function zd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ea||Rs==null||Rs!==St(l)||(l=Rs,"selectionStart"in l&&Na(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ti&&Si(Ti,l)||(Ti=l,l=Io(Ca,"onSelect"),0<l.length&&(t=new va("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Rs)))}function jo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var As={animationend:jo("Animation","AnimationEnd"),animationiteration:jo("Animation","AnimationIteration"),animationstart:jo("Animation","AnimationStart"),transitionend:jo("Transition","TransitionEnd")},_a={},$d={};h&&($d=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Ro(e){if(_a[e])return _a[e];if(!As[e])return e;var t=As[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in $d)return _a[e]=t[i];return e}var Fd=Ro("animationend"),Ud=Ro("animationiteration"),Bd=Ro("animationstart"),Wd=Ro("transitionend"),Hd=new Map,Vd="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 Mr(e,t){Hd.set(e,t),u(t,[e])}for(var ja=0;ja<Vd.length;ja++){var Ra=Vd[ja],dv=Ra.toLowerCase(),fv=Ra[0].toUpperCase()+Ra.slice(1);Mr(dv,"on"+fv)}Mr(Fd,"onAnimationEnd"),Mr(Ud,"onAnimationIteration"),Mr(Bd,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr(Wd,"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 bi="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(" "),pv=new Set("cancel close invalid load scroll toggle".split(" ").concat(bi));function Gd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,da(l,t,void 0,e),e.currentTarget=null}function qd(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(t)for(var v=l.length-1;0<=v;v--){var N=l[v],_=N.instance,B=N.currentTarget;if(N=N.listener,_!==p&&d.isPropagationStopped())break e;Gd(d,N,B),p=_}else for(v=0;v<l.length;v++){if(N=l[v],_=N.instance,B=N.currentTarget,N=N.listener,_!==p&&d.isPropagationStopped())break e;Gd(d,N,B),p=_}}}if(Wt)throw e=qn,Wt=!1,qn=null,e}function ct(e,t){var i=t[za];i===void 0&&(i=t[za]=new Set);var l=e+"__bubble";i.has(l)||(Kd(t,e,2,!1),i.add(l))}function Aa(e,t,i){var l=0;t&&(l|=4),Kd(i,e,l,t)}var Ao="_reactListening"+Math.random().toString(36).slice(2);function Ni(e){if(!e[Ao]){e[Ao]=!0,o.forEach(function(i){i!=="selectionchange"&&(pv.has(i)||Aa(i,!1,e),Aa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ao]||(t[Ao]=!0,Aa("selectionchange",!1,t))}}function Kd(e,t,i,l){switch(vd(t)){case 1:var d=Eg;break;case 4:d=_g;break;default:d=ha}i=d.bind(null,t,i,e),d=void 0,!Zt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function Ia(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(v===4)for(v=l.return;v!==null;){var _=v.tag;if((_===3||_===4)&&(_=v.stateNode.containerInfo,_===d||_.nodeType===8&&_.parentNode===d))return;v=v.return}for(;N!==null;){if(v=is(N),v===null)return;if(_=v.tag,_===5||_===6){l=p=v;continue e}N=N.parentNode}}l=l.return}Qt(function(){var B=p,ee=Pn(i),ne=[];e:{var J=Hd.get(e);if(J!==void 0){var de=va,me=e;switch(e){case"keypress":if(No(i)===0)break e;case"keydown":case"keyup":de=Wg;break;case"focusin":me="focus",de=wa;break;case"focusout":me="blur",de=wa;break;case"beforeblur":case"afterblur":de=wa;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":de=wd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Ag;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=Gg;break;case Fd:case Ud:case Bd:de=Mg;break;case Wd:de=Kg;break;case"scroll":de=jg;break;case"wheel":de=Xg;break;case"copy":case"cut":case"paste":de=Pg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Sd}var ve=(t&4)!==0,Nt=!ve&&e==="scroll",$=ve?J!==null?J+"Capture":null:J;ve=[];for(var R=B,F;R!==null;){F=R;var se=F.stateNode;if(F.tag===5&&se!==null&&(F=se,$!==null&&(se=rt(R,$),se!=null&&ve.push(Ci(R,se,F)))),Nt)break;R=R.return}0<ve.length&&(J=new de(J,me,null,i,ee),ne.push({event:J,listeners:ve}))}}if((t&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",J&&i!==Lt&&(me=i.relatedTarget||i.fromElement)&&(is(me)||me[gr]))break e;if((de||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,de?(me=i.relatedTarget||i.toElement,de=B,me=me?is(me):null,me!==null&&(Nt=Xe(me),me!==Nt||me.tag!==5&&me.tag!==6)&&(me=null)):(de=null,me=B),de!==me)){if(ve=wd,se="onMouseLeave",$="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Sd,se="onPointerLeave",$="onPointerEnter",R="pointer"),Nt=de==null?J:Ms(de),F=me==null?J:Ms(me),J=new ve(se,R+"leave",de,i,ee),J.target=Nt,J.relatedTarget=F,se=null,is(ee)===B&&(ve=new ve($,R+"enter",me,i,ee),ve.target=F,ve.relatedTarget=Nt,se=ve),Nt=se,de&&me)t:{for(ve=de,$=me,R=0,F=ve;F;F=Is(F))R++;for(F=0,se=$;se;se=Is(se))F++;for(;0<R-F;)ve=Is(ve),R--;for(;0<F-R;)$=Is($),F--;for(;R--;){if(ve===$||$!==null&&ve===$.alternate)break t;ve=Is(ve),$=Is($)}ve=null}else ve=null;de!==null&&Yd(ne,J,de,ve,!1),me!==null&&Nt!==null&&Yd(ne,Nt,me,ve,!0)}}e:{if(J=B?Ms(B):window,de=J.nodeName&&J.nodeName.toLowerCase(),de==="select"||de==="input"&&J.type==="file")var xe=rv;else if(_d(J))if(Rd)xe=lv;else{xe=iv;var Ce=sv}else(de=J.nodeName)&&de.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(xe=ov);if(xe&&(xe=xe(e,B))){jd(ne,xe,i,ee);break e}Ce&&Ce(e,J,B),e==="focusout"&&(Ce=J._wrapperState)&&Ce.controlled&&J.type==="number"&&pt(J,"number",J.value)}switch(Ce=B?Ms(B):window,e){case"focusin":(_d(Ce)||Ce.contentEditable==="true")&&(Rs=Ce,Ca=B,Ti=null);break;case"focusout":Ti=Ca=Rs=null;break;case"mousedown":Ea=!0;break;case"contextmenu":case"mouseup":case"dragend":Ea=!1,zd(ne,i,ee);break;case"selectionchange":if(uv)break;case"keydown":case"keyup":zd(ne,i,ee)}var Ee;if(Sa)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else js?Cd(e,i)&&(De="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(De="onCompositionStart");De&&(Td&&i.locale!=="ko"&&(js||De!=="onCompositionStart"?De==="onCompositionEnd"&&js&&(Ee=yd()):(Dr=ee,ga="value"in Dr?Dr.value:Dr.textContent,js=!0)),Ce=Io(B,De),0<Ce.length&&(De=new kd(De,e,null,i,ee),ne.push({event:De,listeners:Ce}),Ee?De.data=Ee:(Ee=Ed(i),Ee!==null&&(De.data=Ee)))),(Ee=Zg?Jg(e,i):ev(e,i))&&(B=Io(B,"onBeforeInput"),0<B.length&&(ee=new kd("onBeforeInput","beforeinput",null,i,ee),ne.push({event:ee,listeners:B}),ee.data=Ee))}qd(ne,t)})}function Ci(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Io(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=rt(e,i),p!=null&&l.unshift(Ci(e,p,d)),p=rt(e,t),p!=null&&l.push(Ci(e,p,d))),e=e.return}return l}function Is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Yd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var N=i,_=N.alternate,B=N.stateNode;if(_!==null&&_===l)break;N.tag===5&&B!==null&&(N=B,d?(_=rt(i,p),_!=null&&v.unshift(Ci(i,_,N))):d||(_=rt(i,p),_!=null&&v.push(Ci(i,_,N)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var hv=/\r\n?/g,mv=/\u0000|\uFFFD/g;function Xd(e){return(typeof e=="string"?e:""+e).replace(hv,`
|
|
38
|
+
`).replace(mv,"")}function Do(e,t,i){if(t=Xd(t),Xd(e)!==t&&i)throw Error(s(425))}function Mo(){}var Da=null,Ma=null;function La(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pa=typeof setTimeout=="function"?setTimeout:void 0,gv=typeof clearTimeout=="function"?clearTimeout:void 0,Qd=typeof Promise=="function"?Promise:void 0,vv=typeof queueMicrotask=="function"?queueMicrotask:typeof Qd<"u"?function(e){return Qd.resolve(null).then(e).catch(yv)}:Pa;function yv(e){setTimeout(function(){throw e})}function Oa(e,t){var i=t,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),gi(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);gi(t)}function Lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Zd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var Ds=Math.random().toString(36).slice(2),lr="__reactFiber$"+Ds,Ei="__reactProps$"+Ds,gr="__reactContainer$"+Ds,za="__reactEvents$"+Ds,xv="__reactListeners$"+Ds,wv="__reactHandles$"+Ds;function is(e){var t=e[lr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[gr]||i[lr]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Zd(e);e!==null;){if(i=e[lr])return i;e=Zd(e)}return t}e=i,i=e.parentNode}return null}function _i(e){return e=e[lr]||e[gr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ms(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Lo(e){return e[Ei]||null}var $a=[],Ls=-1;function Pr(e){return{current:e}}function ut(e){0>Ls||(e.current=$a[Ls],$a[Ls]=null,Ls--)}function ot(e,t){Ls++,$a[Ls]=e.current,e.current=t}var Or={},Jt=Pr(Or),gn=Pr(!1),os=Or;function Ps(e,t){var i=e.type.contextTypes;if(!i)return Or;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=t[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function vn(e){return e=e.childContextTypes,e!=null}function Po(){ut(gn),ut(Jt)}function Jd(e,t,i){if(Jt.current!==Or)throw Error(s(168));ot(Jt,t),ot(gn,i)}function ef(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(s(108,_e(e)||"Unknown",d));return V({},i,l)}function Oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Or,os=Jt.current,ot(Jt,e),ot(gn,gn.current),!0}function tf(e,t,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=ef(e,t,os),l.__reactInternalMemoizedMergedChildContext=e,ut(gn),ut(Jt),ot(Jt,e)):ut(gn),ot(gn,i)}var vr=null,zo=!1,Fa=!1;function nf(e){vr===null?vr=[e]:vr.push(e)}function kv(e){zo=!0,nf(e)}function zr(){if(!Fa&&vr!==null){Fa=!0;var e=0,t=Ve;try{var i=vr;for(Ve=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}vr=null,zo=!1}catch(d){throw vr!==null&&(vr=vr.slice(e+1)),ui(jr,zr),d}finally{Ve=t,Fa=!1}}return null}var Os=[],zs=0,$o=null,Fo=0,zn=[],$n=0,ls=null,yr=1,xr="";function as(e,t){Os[zs++]=Fo,Os[zs++]=$o,$o=e,Fo=t}function rf(e,t,i){zn[$n++]=yr,zn[$n++]=xr,zn[$n++]=ls,ls=e;var l=yr;e=xr;var d=32-on(l)-1;l&=~(1<<d),i+=1;var p=32-on(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,yr=1<<32-on(t)+d|i<<d|l,xr=p+e}else yr=1<<p|i<<d|l,xr=e}function Ua(e){e.return!==null&&(as(e,1),rf(e,1,0))}function Ba(e){for(;e===$o;)$o=Os[--zs],Os[zs]=null,Fo=Os[--zs],Os[zs]=null;for(;e===ls;)ls=zn[--$n],zn[$n]=null,xr=zn[--$n],zn[$n]=null,yr=zn[--$n],zn[$n]=null}var Rn=null,An=null,ft=!1,Xn=null;function sf(e,t){var i=Wn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function of(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Rn=e,An=Lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rn=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=ls!==null?{id:yr,overflow:xr}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Wn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Rn=e,An=null,!0):!1;default:return!1}}function Wa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ha(e){if(ft){var t=An;if(t){var i=t;if(!of(e,t)){if(Wa(e))throw Error(s(418));t=Lr(i.nextSibling);var l=Rn;t&&of(e,t)?sf(l,i):(e.flags=e.flags&-4097|2,ft=!1,Rn=e)}}else{if(Wa(e))throw Error(s(418));e.flags=e.flags&-4097|2,ft=!1,Rn=e}}}function lf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rn=e}function Uo(e){if(e!==Rn)return!1;if(!ft)return lf(e),ft=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!La(e.type,e.memoizedProps)),t&&(t=An)){if(Wa(e))throw af(),Error(s(418));for(;t;)sf(e,t),t=Lr(t.nextSibling)}if(lf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){An=Lr(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}An=null}}else An=Rn?Lr(e.stateNode.nextSibling):null;return!0}function af(){for(var e=An;e;)e=Lr(e.nextSibling)}function $s(){An=Rn=null,ft=!1}function Va(e){Xn===null?Xn=[e]:Xn.push(e)}var Sv=L.ReactCurrentBatchConfig;function ji(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var l=i.stateNode}if(!l)throw Error(s(147,e));var d=l,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(v){var N=d.refs;v===null?delete N[p]:N[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Bo(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function cf(e){var t=e._init;return t(e._payload)}function uf(e){function t($,R){if(e){var F=$.deletions;F===null?($.deletions=[R],$.flags|=16):F.push(R)}}function i($,R){if(!e)return null;for(;R!==null;)t($,R),R=R.sibling;return null}function l($,R){for($=new Map;R!==null;)R.key!==null?$.set(R.key,R):$.set(R.index,R),R=R.sibling;return $}function d($,R){return $=Gr($,R),$.index=0,$.sibling=null,$}function p($,R,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<R?($.flags|=2,R):F):($.flags|=2,R)):($.flags|=1048576,R)}function v($){return e&&$.alternate===null&&($.flags|=2),$}function N($,R,F,se){return R===null||R.tag!==6?(R=Pc(F,$.mode,se),R.return=$,R):(R=d(R,F),R.return=$,R)}function _($,R,F,se){var xe=F.type;return xe===K?ee($,R,F.props.children,se,F.key):R!==null&&(R.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===Y&&cf(xe)===R.type)?(se=d(R,F.props),se.ref=ji($,R,F),se.return=$,se):(se=fl(F.type,F.key,F.props,null,$.mode,se),se.ref=ji($,R,F),se.return=$,se)}function B($,R,F,se){return R===null||R.tag!==4||R.stateNode.containerInfo!==F.containerInfo||R.stateNode.implementation!==F.implementation?(R=Oc(F,$.mode,se),R.return=$,R):(R=d(R,F.children||[]),R.return=$,R)}function ee($,R,F,se,xe){return R===null||R.tag!==7?(R=gs(F,$.mode,se,xe),R.return=$,R):(R=d(R,F),R.return=$,R)}function ne($,R,F){if(typeof R=="string"&&R!==""||typeof R=="number")return R=Pc(""+R,$.mode,F),R.return=$,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case H:return F=fl(R.type,R.key,R.props,null,$.mode,F),F.ref=ji($,null,R),F.return=$,F;case X:return R=Oc(R,$.mode,F),R.return=$,R;case Y:var se=R._init;return ne($,se(R._payload),F)}if(xt(R)||Q(R))return R=gs(R,$.mode,F,null),R.return=$,R;Bo($,R)}return null}function J($,R,F,se){var xe=R!==null?R.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return xe!==null?null:N($,R,""+F,se);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case H:return F.key===xe?_($,R,F,se):null;case X:return F.key===xe?B($,R,F,se):null;case Y:return xe=F._init,J($,R,xe(F._payload),se)}if(xt(F)||Q(F))return xe!==null?null:ee($,R,F,se,null);Bo($,F)}return null}function de($,R,F,se,xe){if(typeof se=="string"&&se!==""||typeof se=="number")return $=$.get(F)||null,N(R,$,""+se,xe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case H:return $=$.get(se.key===null?F:se.key)||null,_(R,$,se,xe);case X:return $=$.get(se.key===null?F:se.key)||null,B(R,$,se,xe);case Y:var Ce=se._init;return de($,R,F,Ce(se._payload),xe)}if(xt(se)||Q(se))return $=$.get(F)||null,ee(R,$,se,xe,null);Bo(R,se)}return null}function me($,R,F,se){for(var xe=null,Ce=null,Ee=R,De=R=0,$t=null;Ee!==null&&De<F.length;De++){Ee.index>De?($t=Ee,Ee=null):$t=Ee.sibling;var Ye=J($,Ee,F[De],se);if(Ye===null){Ee===null&&(Ee=$t);break}e&&Ee&&Ye.alternate===null&&t($,Ee),R=p(Ye,R,De),Ce===null?xe=Ye:Ce.sibling=Ye,Ce=Ye,Ee=$t}if(De===F.length)return i($,Ee),ft&&as($,De),xe;if(Ee===null){for(;De<F.length;De++)Ee=ne($,F[De],se),Ee!==null&&(R=p(Ee,R,De),Ce===null?xe=Ee:Ce.sibling=Ee,Ce=Ee);return ft&&as($,De),xe}for(Ee=l($,Ee);De<F.length;De++)$t=de(Ee,$,De,F[De],se),$t!==null&&(e&&$t.alternate!==null&&Ee.delete($t.key===null?De:$t.key),R=p($t,R,De),Ce===null?xe=$t:Ce.sibling=$t,Ce=$t);return e&&Ee.forEach(function(qr){return t($,qr)}),ft&&as($,De),xe}function ve($,R,F,se){var xe=Q(F);if(typeof xe!="function")throw Error(s(150));if(F=xe.call(F),F==null)throw Error(s(151));for(var Ce=xe=null,Ee=R,De=R=0,$t=null,Ye=F.next();Ee!==null&&!Ye.done;De++,Ye=F.next()){Ee.index>De?($t=Ee,Ee=null):$t=Ee.sibling;var qr=J($,Ee,Ye.value,se);if(qr===null){Ee===null&&(Ee=$t);break}e&&Ee&&qr.alternate===null&&t($,Ee),R=p(qr,R,De),Ce===null?xe=qr:Ce.sibling=qr,Ce=qr,Ee=$t}if(Ye.done)return i($,Ee),ft&&as($,De),xe;if(Ee===null){for(;!Ye.done;De++,Ye=F.next())Ye=ne($,Ye.value,se),Ye!==null&&(R=p(Ye,R,De),Ce===null?xe=Ye:Ce.sibling=Ye,Ce=Ye);return ft&&as($,De),xe}for(Ee=l($,Ee);!Ye.done;De++,Ye=F.next())Ye=de(Ee,$,De,Ye.value,se),Ye!==null&&(e&&Ye.alternate!==null&&Ee.delete(Ye.key===null?De:Ye.key),R=p(Ye,R,De),Ce===null?xe=Ye:Ce.sibling=Ye,Ce=Ye);return e&&Ee.forEach(function(ty){return t($,ty)}),ft&&as($,De),xe}function Nt($,R,F,se){if(typeof F=="object"&&F!==null&&F.type===K&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case H:e:{for(var xe=F.key,Ce=R;Ce!==null;){if(Ce.key===xe){if(xe=F.type,xe===K){if(Ce.tag===7){i($,Ce.sibling),R=d(Ce,F.props.children),R.return=$,$=R;break e}}else if(Ce.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===Y&&cf(xe)===Ce.type){i($,Ce.sibling),R=d(Ce,F.props),R.ref=ji($,Ce,F),R.return=$,$=R;break e}i($,Ce);break}else t($,Ce);Ce=Ce.sibling}F.type===K?(R=gs(F.props.children,$.mode,se,F.key),R.return=$,$=R):(se=fl(F.type,F.key,F.props,null,$.mode,se),se.ref=ji($,R,F),se.return=$,$=se)}return v($);case X:e:{for(Ce=F.key;R!==null;){if(R.key===Ce)if(R.tag===4&&R.stateNode.containerInfo===F.containerInfo&&R.stateNode.implementation===F.implementation){i($,R.sibling),R=d(R,F.children||[]),R.return=$,$=R;break e}else{i($,R);break}else t($,R);R=R.sibling}R=Oc(F,$.mode,se),R.return=$,$=R}return v($);case Y:return Ce=F._init,Nt($,R,Ce(F._payload),se)}if(xt(F))return me($,R,F,se);if(Q(F))return ve($,R,F,se);Bo($,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,R!==null&&R.tag===6?(i($,R.sibling),R=d(R,F),R.return=$,$=R):(i($,R),R=Pc(F,$.mode,se),R.return=$,$=R),v($)):i($,R)}return Nt}var Fs=uf(!0),df=uf(!1),Wo=Pr(null),Ho=null,Us=null,Ga=null;function qa(){Ga=Us=Ho=null}function Ka(e){var t=Wo.current;ut(Wo),e._currentValue=t}function Ya(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Bs(e,t){Ho=e,Ga=Us=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(yn=!0),e.firstContext=null)}function Fn(e){var t=e._currentValue;if(Ga!==e)if(e={context:e,memoizedValue:t,next:null},Us===null){if(Ho===null)throw Error(s(308));Us=e,Ho.dependencies={lanes:0,firstContext:e}}else Us=Us.next=e;return t}var cs=null;function Xa(e){cs===null?cs=[e]:cs.push(e)}function ff(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,Xa(t)):(i.next=d.next,d.next=i),t.interleaved=i,wr(e,l)}function wr(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var $r=!1;function Qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fr(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(qe&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,wr(e,i)}return d=l.interleaved,d===null?(t.next=t,Xa(l)):(t.next=d.next,d.next=t),l.interleaved=t,wr(e,i)}function Vo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ar(e,i)}}function hf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var v={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=v:p=p.next=v,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function Go(e,t,i,l){var d=e.updateQueue;$r=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var _=N,B=_.next;_.next=null,v===null?p=B:v.next=B,v=_;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==v&&(N===null?ee.firstBaseUpdate=B:N.next=B,ee.lastBaseUpdate=_))}if(p!==null){var ne=d.baseState;v=0,ee=B=_=null,N=p;do{var J=N.lane,de=N.eventTime;if((l&J)===J){ee!==null&&(ee=ee.next={eventTime:de,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var me=e,ve=N;switch(J=t,de=i,ve.tag){case 1:if(me=ve.payload,typeof me=="function"){ne=me.call(de,ne,J);break e}ne=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ve.payload,J=typeof me=="function"?me.call(de,ne,J):me,J==null)break e;ne=V({},ne,J);break e;case 2:$r=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,J=d.effects,J===null?d.effects=[N]:J.push(N))}else de={eventTime:de,lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(B=ee=de,_=ne):ee=ee.next=de,v|=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&&(_=ne),d.baseState=_,d.firstBaseUpdate=B,d.lastBaseUpdate=ee,t=d.shared.interleaved,t!==null){d=t;do v|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);fs|=v,e.lanes=v,e.memoizedState=ne}}function mf(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(s(191,d));d.call(l)}}}var Ri={},ar=Pr(Ri),Ai=Pr(Ri),Ii=Pr(Ri);function us(e){if(e===Ri)throw Error(s(174));return e}function Za(e,t){switch(ot(Ii,t),ot(Ai,e),ot(ar,Ri),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ze(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ze(t,e)}ut(ar),ot(ar,t)}function Ws(){ut(ar),ut(Ai),ut(Ii)}function gf(e){us(Ii.current);var t=us(ar.current),i=ze(t,e.type);t!==i&&(ot(Ai,e),ot(ar,i))}function Ja(e){Ai.current===e&&(ut(ar),ut(Ai))}var vt=Pr(0);function qo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ec=[];function tc(){for(var e=0;e<ec.length;e++)ec[e]._workInProgressVersionPrimary=null;ec.length=0}var Ko=L.ReactCurrentDispatcher,nc=L.ReactCurrentBatchConfig,ds=0,yt=null,At=null,Ot=null,Yo=!1,Di=!1,Mi=0,Tv=0;function en(){throw Error(s(321))}function rc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Yn(e[i],t[i]))return!1;return!0}function sc(e,t,i,l,d,p){if(ds=p,yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ko.current=e===null||e.memoizedState===null?Ev:_v,e=i(l,d),Di){p=0;do{if(Di=!1,Mi=0,25<=p)throw Error(s(301));p+=1,Ot=At=null,t.updateQueue=null,Ko.current=jv,e=i(l,d)}while(Di)}if(Ko.current=Zo,t=At!==null&&At.next!==null,ds=0,Ot=At=yt=null,Yo=!1,t)throw Error(s(300));return e}function ic(){var e=Mi!==0;return Mi=0,e}function cr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?yt.memoizedState=Ot=e:Ot=Ot.next=e,Ot}function Un(){if(At===null){var e=yt.alternate;e=e!==null?e.memoizedState:null}else e=At.next;var t=Ot===null?yt.memoizedState:Ot.next;if(t!==null)Ot=t,At=e;else{if(e===null)throw Error(s(310));At=e,e={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Ot===null?yt.memoizedState=Ot=e:Ot=Ot.next=e}return Ot}function Li(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=Un(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=At,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var v=d.next;d.next=p.next,p.next=v}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var N=v=null,_=null,B=p;do{var ee=B.lane;if((ds&ee)===ee)_!==null&&(_=_.next={lane:0,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),l=B.hasEagerState?B.eagerState:e(l,B.action);else{var ne={lane:ee,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null};_===null?(N=_=ne,v=l):_=_.next=ne,yt.lanes|=ee,fs|=ee}B=B.next}while(B!==null&&B!==p);_===null?v=l:_.next=N,Yn(l,t.memoizedState)||(yn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=_,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,yt.lanes|=p,fs|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function lc(e){var t=Un(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var v=d=d.next;do p=e(p,v.action),v=v.next;while(v!==d);Yn(p,t.memoizedState)||(yn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function vf(){}function yf(e,t){var i=yt,l=Un(),d=t(),p=!Yn(l.memoizedState,d);if(p&&(l.memoizedState=d,yn=!0),l=l.queue,ac(kf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Ot!==null&&Ot.memoizedState.tag&1){if(i.flags|=2048,Pi(9,wf.bind(null,i,l,d,t),void 0,null),zt===null)throw Error(s(349));(ds&30)!==0||xf(i,t,d)}return d}function xf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function wf(e,t,i,l){t.value=i,t.getSnapshot=l,Sf(t)&&Tf(e)}function kf(e,t,i){return i(function(){Sf(t)&&Tf(e)})}function Sf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Yn(e,i)}catch{return!0}}function Tf(e){var t=wr(e,1);t!==null&&er(t,e,1,-1)}function bf(e){var t=cr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Li,lastRenderedState:e},t.queue=e,e=e.dispatch=Cv.bind(null,yt,e),[t.memoizedState,e]}function Pi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function Nf(){return Un().memoizedState}function Xo(e,t,i,l){var d=cr();yt.flags|=e,d.memoizedState=Pi(1|t,i,void 0,l===void 0?null:l)}function Qo(e,t,i,l){var d=Un();l=l===void 0?null:l;var p=void 0;if(At!==null){var v=At.memoizedState;if(p=v.destroy,l!==null&&rc(l,v.deps)){d.memoizedState=Pi(t,i,p,l);return}}yt.flags|=e,d.memoizedState=Pi(1|t,i,p,l)}function Cf(e,t){return Xo(8390656,8,e,t)}function ac(e,t){return Qo(2048,8,e,t)}function Ef(e,t){return Qo(4,2,e,t)}function _f(e,t){return Qo(4,4,e,t)}function jf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rf(e,t,i){return i=i!=null?i.concat([e]):null,Qo(4,4,jf.bind(null,t,e),i)}function cc(){}function Af(e,t){var i=Un();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&rc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function If(e,t){var i=Un();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&rc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Df(e,t,i){return(ds&21)===0?(e.baseState&&(e.baseState=!1,yn=!0),e.memoizedState=i):(Yn(i,t)||(i=fi(),yt.lanes|=i,fs|=i,e.baseState=!0),t)}function bv(e,t){var i=Ve;Ve=i!==0&&4>i?i:4,e(!0);var l=nc.transition;nc.transition={};try{e(!1),t()}finally{Ve=i,nc.transition=l}}function Mf(){return Un().memoizedState}function Nv(e,t,i){var l=Hr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Lf(e))Pf(t,i);else if(i=ff(e,t,i,l),i!==null){var d=cn();er(i,e,l,d),Of(i,t,l)}}function Cv(e,t,i){var l=Hr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Lf(e))Pf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var v=t.lastRenderedState,N=p(v,i);if(d.hasEagerState=!0,d.eagerState=N,Yn(N,v)){var _=t.interleaved;_===null?(d.next=d,Xa(t)):(d.next=_.next,_.next=d),t.interleaved=d;return}}catch{}finally{}i=ff(e,t,d,l),i!==null&&(d=cn(),er(i,e,l,d),Of(i,t,l))}}function Lf(e){var t=e.alternate;return e===yt||t!==null&&t===yt}function Pf(e,t){Di=Yo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Of(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ar(e,i)}}var Zo={readContext:Fn,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useInsertionEffect:en,useLayoutEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useMutableSource:en,useSyncExternalStore:en,useId:en,unstable_isNewReconciler:!1},Ev={readContext:Fn,useCallback:function(e,t){return cr().memoizedState=[e,t===void 0?null:t],e},useContext:Fn,useEffect:Cf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Xo(4194308,4,jf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Xo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xo(4,2,e,t)},useMemo:function(e,t){var i=cr();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=cr();return t=i!==void 0?i(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Nv.bind(null,yt,e),[l.memoizedState,e]},useRef:function(e){var t=cr();return e={current:e},t.memoizedState=e},useState:bf,useDebugValue:cc,useDeferredValue:function(e){return cr().memoizedState=e},useTransition:function(){var e=bf(!1),t=e[0];return e=bv.bind(null,e[1]),cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=yt,d=cr();if(ft){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),zt===null)throw Error(s(349));(ds&30)!==0||xf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,Cf(kf.bind(null,l,p,e),[e]),l.flags|=2048,Pi(9,wf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=cr(),t=zt.identifierPrefix;if(ft){var i=xr,l=yr;i=(l&~(1<<32-on(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Mi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Tv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_v={readContext:Fn,useCallback:Af,useContext:Fn,useEffect:ac,useImperativeHandle:Rf,useInsertionEffect:Ef,useLayoutEffect:_f,useMemo:If,useReducer:oc,useRef:Nf,useState:function(){return oc(Li)},useDebugValue:cc,useDeferredValue:function(e){var t=Un();return Df(t,At.memoizedState,e)},useTransition:function(){var e=oc(Li)[0],t=Un().memoizedState;return[e,t]},useMutableSource:vf,useSyncExternalStore:yf,useId:Mf,unstable_isNewReconciler:!1},jv={readContext:Fn,useCallback:Af,useContext:Fn,useEffect:ac,useImperativeHandle:Rf,useInsertionEffect:Ef,useLayoutEffect:_f,useMemo:If,useReducer:lc,useRef:Nf,useState:function(){return lc(Li)},useDebugValue:cc,useDeferredValue:function(e){var t=Un();return At===null?t.memoizedState=e:Df(t,At.memoizedState,e)},useTransition:function(){var e=lc(Li)[0],t=Un().memoizedState;return[e,t]},useMutableSource:vf,useSyncExternalStore:yf,useId:Mf,unstable_isNewReconciler:!1};function Qn(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function uc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:V({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Jo={isMounted:function(e){return(e=e._reactInternals)?Xe(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=cn(),d=Hr(e),p=kr(l,d);p.payload=t,i!=null&&(p.callback=i),t=Fr(e,p,d),t!==null&&(er(t,e,d,l),Vo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=cn(),d=Hr(e),p=kr(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Fr(e,p,d),t!==null&&(er(t,e,d,l),Vo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=cn(),l=Hr(e),d=kr(i,l);d.tag=2,t!=null&&(d.callback=t),t=Fr(e,d,l),t!==null&&(er(t,e,l,i),Vo(t,e,l))}};function zf(e,t,i,l,d,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,v):t.prototype&&t.prototype.isPureReactComponent?!Si(i,l)||!Si(d,p):!0}function $f(e,t,i){var l=!1,d=Or,p=t.contextType;return typeof p=="object"&&p!==null?p=Fn(p):(d=vn(t)?os:Jt.current,l=t.contextTypes,p=(l=l!=null)?Ps(e,d):Or),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Jo,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Ff(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&Jo.enqueueReplaceState(t,t.state,null)}function dc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},Qa(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Fn(p):(p=vn(t)?os:Jt.current,d.context=Ps(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(uc(e,t,p,i),d.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(t=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),t!==d.state&&Jo.enqueueReplaceState(d,d.state,null),Go(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Hs(e,t){try{var i="",l=t;do i+=he(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
|
+
Error generating stack: `+p.message+`
|
|
40
|
+
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function fc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function pc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Rv=typeof WeakMap=="function"?WeakMap:Map;function Uf(e,t,i){i=kr(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){ol||(ol=!0,_c=l),pc(e,t)},i}function Bf(e,t,i){i=kr(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=t.value;i.payload=function(){return l(d)},i.callback=function(){pc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){pc(e,t),typeof l!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Wf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Rv;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(i)||(d.add(i),e=Hv.bind(null,e,t,i),t.then(e,e))}function Hf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Vf(e,t,i,l,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=kr(-1,1),t.tag=2,Fr(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Av=L.ReactCurrentOwner,yn=!1;function an(e,t,i,l){t.child=e===null?df(t,null,i,l):Fs(t,e.child,i,l)}function Gf(e,t,i,l,d){i=i.render;var p=t.ref;return Bs(t,d),l=sc(e,t,i,l,p,d),i=ic(),e!==null&&!yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Sr(e,t,d)):(ft&&i&&Ua(t),t.flags|=1,an(e,t,l,d),t.child)}function qf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Lc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Kf(e,t,p,l,d)):(e=fl(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var v=p.memoizedProps;if(i=i.compare,i=i!==null?i:Si,i(v,l)&&e.ref===t.ref)return Sr(e,t,d)}return t.flags|=1,e=Gr(p,l),e.ref=t.ref,e.return=t,t.child=e}function Kf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(Si(p,l)&&e.ref===t.ref)if(yn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(yn=!0);else return t.lanes=e.lanes,Sr(e,t,d)}return hc(e,t,i,l,d)}function Yf(e,t,i){var l=t.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(Gs,In),In|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(Gs,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ot(Gs,In),In|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ot(Gs,In),In|=l;return an(e,t,d,i),t.child}function Xf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function hc(e,t,i,l,d){var p=vn(i)?os:Jt.current;return p=Ps(t,p),Bs(t,d),i=sc(e,t,i,l,p,d),l=ic(),e!==null&&!yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Sr(e,t,d)):(ft&&l&&Ua(t),t.flags|=1,an(e,t,i,d),t.child)}function Qf(e,t,i,l,d){if(vn(i)){var p=!0;Oo(t)}else p=!1;if(Bs(t,d),t.stateNode===null)tl(e,t),$f(t,i,l),dc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,N=t.memoizedProps;v.props=N;var _=v.context,B=i.contextType;typeof B=="object"&&B!==null?B=Fn(B):(B=vn(i)?os:Jt.current,B=Ps(t,B));var ee=i.getDerivedStateFromProps,ne=typeof ee=="function"||typeof v.getSnapshotBeforeUpdate=="function";ne||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==l||_!==B)&&Ff(t,v,l,B),$r=!1;var J=t.memoizedState;v.state=J,Go(t,l,v,d),_=t.memoizedState,N!==l||J!==_||gn.current||$r?(typeof ee=="function"&&(uc(t,i,ee,l),_=t.memoizedState),(N=$r||zf(t,i,N,l,J,_,B))?(ne||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=_),v.props=l,v.state=_,v.context=B,l=N):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,pf(e,t),N=t.memoizedProps,B=t.type===t.elementType?N:Qn(t.type,N),v.props=B,ne=t.pendingProps,J=v.context,_=i.contextType,typeof _=="object"&&_!==null?_=Fn(_):(_=vn(i)?os:Jt.current,_=Ps(t,_));var de=i.getDerivedStateFromProps;(ee=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==ne||J!==_)&&Ff(t,v,l,_),$r=!1,J=t.memoizedState,v.state=J,Go(t,l,v,d);var me=t.memoizedState;N!==ne||J!==me||gn.current||$r?(typeof de=="function"&&(uc(t,i,de,l),me=t.memoizedState),(B=$r||zf(t,i,B,l,J,me,_)||!1)?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,me,_),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,me,_)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=me),v.props=l,v.state=me,v.context=_,l=B):(typeof v.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),l=!1)}return mc(e,t,i,l,p,d)}function mc(e,t,i,l,d,p){Xf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&tf(t,i,!1),Sr(e,t,p);l=t.stateNode,Av.current=t;var N=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Fs(t,e.child,null,p),t.child=Fs(t,null,N,p)):an(e,t,N,p),t.memoizedState=l.state,d&&tf(t,i,!0),t.child}function Zf(e){var t=e.stateNode;t.pendingContext?Jd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jd(e,t.context,!1),Za(e,t.containerInfo)}function Jf(e,t,i,l,d){return $s(),Va(d),t.flags|=256,an(e,t,i,l),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0};function vc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ep(e,t,i){var l=t.pendingProps,d=vt.current,p=!1,v=(t.flags&128)!==0,N;if((N=v)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ot(vt,d&1),e===null)return Ha(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(v=l.children,e=l.fallback,p?(l=t.mode,p=t.child,v={mode:"hidden",children:v},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=v):p=pl(v,l,0,null),e=gs(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=vc(i),t.memoizedState=gc,e):yc(t,v));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return Iv(e,t,v,l,N,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,N=d.sibling;var _={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=_,t.deletions=null):(l=Gr(d,_),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=Gr(N,p):(p=gs(p,v,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,v=e.child.memoizedState,v=v===null?vc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=gc,l}return p=e.child,e=p.sibling,l=Gr(p,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=i),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l}function yc(e,t){return t=pl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function el(e,t,i,l){return l!==null&&Va(l),Fs(t,e.child,null,i),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Iv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=fc(Error(s(422))),el(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=pl({mode:"visible",children:l.children},d,0,null),p=gs(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Fs(t,e.child,null,v),t.child.memoizedState=vc(v),t.memoizedState=gc,p);if((t.mode&1)===0)return el(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(s(419)),l=fc(p,l,void 0),el(e,t,v,l)}if(N=(v&e.childLanes)!==0,yn||N){if(l=zt,l!==null){switch(v&-v){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|v))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,wr(e,d),er(l,e,d,-1))}return Mc(),l=fc(Error(s(421))),el(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=Vv.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,An=Lr(d.nextSibling),Rn=t,ft=!0,Xn=null,e!==null&&(zn[$n++]=yr,zn[$n++]=xr,zn[$n++]=ls,yr=e.id,xr=e.overflow,ls=t),t=yc(t,l.children),t.flags|=4096,t)}function tp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Ya(e.return,t,i)}function xc(e,t,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function np(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(an(e,t,l.children,i),l=vt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tp(e,i,t);else if(e.tag===19)tp(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(ot(vt,l),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&qo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),xc(t,!1,d,i,p);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&qo(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}xc(t,!0,i,null,p);break;case"together":xc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function tl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Sr(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fs|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=Gr(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Gr(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Dv(e,t,i){switch(t.tag){case 3:Zf(t),$s();break;case 5:gf(t);break;case 1:vn(t.type)&&Oo(t);break;case 4:Za(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ot(Wo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ot(vt,vt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?ep(e,t,i):(ot(vt,vt.current&1),e=Sr(e,t,i),e!==null?e.sibling:null);ot(vt,vt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return np(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ot(vt,vt.current),l)break;return null;case 22:case 23:return t.lanes=0,Yf(e,t,i)}return Sr(e,t,i)}var rp,wc,sp,ip;rp=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},wc=function(){},sp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,us(ar.current);var p=null;switch(i){case"input":d=Pe(e,d),l=Pe(e,l),p=[];break;case"select":d=V({},d,{value:void 0}),l=V({},l,{value:void 0}),p=[];break;case"textarea":d=Ie(e,d),l=Ie(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Mo)}Be(i,l);var v;i=null;for(B in d)if(!l.hasOwnProperty(B)&&d.hasOwnProperty(B)&&d[B]!=null)if(B==="style"){var N=d[B];for(v in N)N.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else B!=="dangerouslySetInnerHTML"&&B!=="children"&&B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(a.hasOwnProperty(B)?p||(p=[]):(p=p||[]).push(B,null));for(B in l){var _=l[B];if(N=d!=null?d[B]:void 0,l.hasOwnProperty(B)&&_!==N&&(_!=null||N!=null))if(B==="style")if(N){for(v in N)!N.hasOwnProperty(v)||_&&_.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in _)_.hasOwnProperty(v)&&N[v]!==_[v]&&(i||(i={}),i[v]=_[v])}else i||(p||(p=[]),p.push(B,i)),i=_;else B==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,N=N?N.__html:void 0,_!=null&&N!==_&&(p=p||[]).push(B,_)):B==="children"?typeof _!="string"&&typeof _!="number"||(p=p||[]).push(B,""+_):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&(a.hasOwnProperty(B)?(_!=null&&B==="onScroll"&&ct("scroll",e),p||N===_||(p=[])):(p=p||[]).push(B,_))}i&&(p=p||[]).push("style",i);var B=p;(t.updateQueue=B)&&(t.flags|=4)}},ip=function(e,t,i,l){i!==l&&(t.flags|=4)};function Oi(e,t){if(!ft)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function tn(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Mv(e,t,i){var l=t.pendingProps;switch(Ba(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(t),null;case 1:return vn(t.type)&&Po(),tn(t),null;case 3:return l=t.stateNode,Ws(),ut(gn),ut(Jt),tc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Uo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xn!==null&&(Ac(Xn),Xn=null))),wc(e,t),tn(t),null;case 5:Ja(t);var d=us(Ii.current);if(i=t.type,e!==null&&t.stateNode!=null)sp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return tn(t),null}if(e=us(ar.current),Uo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[lr]=t,l[Ei]=p,e=(t.mode&1)!==0,i){case"dialog":ct("cancel",l),ct("close",l);break;case"iframe":case"object":case"embed":ct("load",l);break;case"video":case"audio":for(d=0;d<bi.length;d++)ct(bi[d],l);break;case"source":ct("error",l);break;case"img":case"image":case"link":ct("error",l),ct("load",l);break;case"details":ct("toggle",l);break;case"input":Mt(l,p),ct("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},ct("invalid",l);break;case"textarea":M(l,p),ct("invalid",l)}Be(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var N=p[v];v==="children"?typeof N=="string"?l.textContent!==N&&(p.suppressHydrationWarning!==!0&&Do(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&Do(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(v)&&N!=null&&v==="onScroll"&&ct("scroll",l)}switch(i){case"input":lt(l),bn(l,p,!0);break;case"textarea":lt(l),Ne(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Mo)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ue(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(i,{is:l.is}):(e=v.createElement(i),i==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,i),e[lr]=t,e[Ei]=l,rp(e,t,!1,!1),t.stateNode=e;e:{switch(v=nt(i,l),i){case"dialog":ct("cancel",e),ct("close",e),d=l;break;case"iframe":case"object":case"embed":ct("load",e),d=l;break;case"video":case"audio":for(d=0;d<bi.length;d++)ct(bi[d],e);d=l;break;case"source":ct("error",e),d=l;break;case"img":case"image":case"link":ct("error",e),ct("load",e),d=l;break;case"details":ct("toggle",e),d=l;break;case"input":Mt(e,l),d=Pe(e,l),ct("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=V({},l,{value:void 0}),ct("invalid",e);break;case"textarea":M(e,l),d=Ie(e,l),ct("invalid",e);break;default:d=l}Be(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var _=N[p];p==="style"?pn(e,_):p==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,_!=null&&Je(e,_)):p==="children"?typeof _=="string"?(i!=="textarea"||_!=="")&&dt(e,_):typeof _=="number"&&dt(e,""+_):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?_!=null&&p==="onScroll"&&ct("scroll",e):_!=null&&U(e,p,_,v))}switch(i){case"input":lt(e),bn(e,l,!1);break;case"textarea":lt(e),Ne(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Se(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?W(e,!!l.multiple,p,!1):l.defaultValue!=null&&W(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Mo)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tn(t),null;case 6:if(e&&t.stateNode!=null)ip(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(i=us(Ii.current),us(ar.current),Uo(t)){if(l=t.stateNode,i=t.memoizedProps,l[lr]=t,(p=l.nodeValue!==i)&&(e=Rn,e!==null))switch(e.tag){case 3:Do(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Do(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[lr]=t,t.stateNode=l}return tn(t),null;case 13:if(ut(vt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ft&&An!==null&&(t.mode&1)!==0&&(t.flags&128)===0)af(),$s(),t.flags|=98560,p=!1;else if(p=Uo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[lr]=t}else $s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tn(t),p=!1}else Xn!==null&&(Ac(Xn),Xn=null),p=!0;if(!p)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=i,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(vt.current&1)!==0?It===0&&(It=3):Mc())),t.updateQueue!==null&&(t.flags|=4),tn(t),null);case 4:return Ws(),wc(e,t),e===null&&Ni(t.stateNode.containerInfo),tn(t),null;case 10:return Ka(t.type._context),tn(t),null;case 17:return vn(t.type)&&Po(),tn(t),null;case 19:if(ut(vt),p=t.memoizedState,p===null)return tn(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)Oi(p,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=qo(e),v!==null){for(t.flags|=128,Oi(p,!1),l=v.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)p=i,e=l,p.flags&=14680066,v=p.alternate,v===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=v.childLanes,p.lanes=v.lanes,p.child=v.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=v.memoizedProps,p.memoizedState=v.memoizedState,p.updateQueue=v.updateQueue,p.type=v.type,e=v.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ot(vt,vt.current&1|2),t.child}e=e.sibling}p.tail!==null&&ht()>qs&&(t.flags|=128,l=!0,Oi(p,!1),t.lanes=4194304)}else{if(!l)if(e=qo(v),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Oi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ft)return tn(t),null}else 2*ht()-p.renderingStartTime>qs&&i!==1073741824&&(t.flags|=128,l=!0,Oi(p,!1),t.lanes=4194304);p.isBackwards?(v.sibling=t.child,t.child=v):(i=p.last,i!==null?i.sibling=v:t.child=v,p.last=v)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=ht(),t.sibling=null,i=vt.current,ot(vt,l?i&1|2:i&1),t):(tn(t),null);case 22:case 23:return Dc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(In&1073741824)!==0&&(tn(t),t.subtreeFlags&6&&(t.flags|=8192)):tn(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Lv(e,t){switch(Ba(t),t.tag){case 1:return vn(t.type)&&Po(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ws(),ut(gn),ut(Jt),tc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ja(t),null;case 13:if(ut(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));$s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(vt),null;case 4:return Ws(),null;case 10:return Ka(t.type._context),null;case 22:case 23:return Dc(),null;case 24:return null;default:return null}}var nl=!1,nn=!1,Pv=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Vs(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){wt(e,t,l)}else i.current=null}function kc(e,t,i){try{i()}catch(l){wt(e,t,l)}}var op=!1;function Ov(e,t){if(Da=So,e=Od(),Na(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var v=0,N=-1,_=-1,B=0,ee=0,ne=e,J=null;t:for(;;){for(var de;ne!==i||d!==0&&ne.nodeType!==3||(N=v+d),ne!==p||l!==0&&ne.nodeType!==3||(_=v+l),ne.nodeType===3&&(v+=ne.nodeValue.length),(de=ne.firstChild)!==null;)J=ne,ne=de;for(;;){if(ne===e)break t;if(J===i&&++B===d&&(N=v),J===p&&++ee===l&&(_=v),(de=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=de}i=N===-1||_===-1?null:{start:N,end:_}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ma={focusedElem:e,selectionRange:i},So=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var me=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(me!==null){var ve=me.memoizedProps,Nt=me.memoizedState,$=t.stateNode,R=$.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Qn(t.type,ve),Nt);$.__reactInternalSnapshotBeforeUpdate=R}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(se){wt(t,t.return,se)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return me=op,op=!1,me}function zi(e,t,i){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&kc(t,i,p)}d=d.next}while(d!==l)}}function rl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==t)}}function Sc(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function lp(e){var t=e.alternate;t!==null&&(e.alternate=null,lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lr],delete t[Ei],delete t[za],delete t[xv],delete t[wv])),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 ap(e){return e.tag===5||e.tag===3||e.tag===4}function cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ap(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 Tc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Mo));else if(l!==4&&(e=e.child,e!==null))for(Tc(e,t,i),e=e.sibling;e!==null;)Tc(e,t,i),e=e.sibling}function bc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(bc(e,t,i),e=e.sibling;e!==null;)bc(e,t,i),e=e.sibling}var Ht=null,Zn=!1;function Ur(e,t,i){for(i=i.child;i!==null;)up(e,t,i),i=i.sibling}function up(e,t,i){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(es,i)}catch{}switch(i.tag){case 5:nn||Vs(i,t);case 6:var l=Ht,d=Zn;Ht=null,Ur(e,t,i),Ht=l,Zn=d,Ht!==null&&(Zn?(e=Ht,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Ht.removeChild(i.stateNode));break;case 18:Ht!==null&&(Zn?(e=Ht,i=i.stateNode,e.nodeType===8?Oa(e.parentNode,i):e.nodeType===1&&Oa(e,i),gi(e)):Oa(Ht,i.stateNode));break;case 4:l=Ht,d=Zn,Ht=i.stateNode.containerInfo,Zn=!0,Ur(e,t,i),Ht=l,Zn=d;break;case 0:case 11:case 14:case 15:if(!nn&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,v=p.destroy;p=p.tag,v!==void 0&&((p&2)!==0||(p&4)!==0)&&kc(i,t,v),d=d.next}while(d!==l)}Ur(e,t,i);break;case 1:if(!nn&&(Vs(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){wt(i,t,N)}Ur(e,t,i);break;case 21:Ur(e,t,i);break;case 22:i.mode&1?(nn=(l=nn)||i.memoizedState!==null,Ur(e,t,i),nn=l):Ur(e,t,i);break;default:Ur(e,t,i)}}function dp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Pv),t.forEach(function(l){var d=Gv.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function Jn(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,v=t,N=v;e:for(;N!==null;){switch(N.tag){case 5:Ht=N.stateNode,Zn=!1;break e;case 3:Ht=N.stateNode.containerInfo,Zn=!0;break e;case 4:Ht=N.stateNode.containerInfo,Zn=!0;break e}N=N.return}if(Ht===null)throw Error(s(160));up(p,v,d),Ht=null,Zn=!1;var _=d.alternate;_!==null&&(_.return=null),d.return=null}catch(B){wt(d,t,B)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)fp(t,e),t=t.sibling}function fp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jn(t,e),ur(e),l&4){try{zi(3,e,e.return),rl(3,e)}catch(ve){wt(e,e.return,ve)}try{zi(5,e,e.return)}catch(ve){wt(e,e.return,ve)}}break;case 1:Jn(t,e),ur(e),l&512&&i!==null&&Vs(i,i.return);break;case 5:if(Jn(t,e),ur(e),l&512&&i!==null&&Vs(i,i.return),e.flags&32){var d=e.stateNode;try{dt(d,"")}catch(ve){wt(e,e.return,ve)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,N=e.type,_=e.updateQueue;if(e.updateQueue=null,_!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&$e(d,p),nt(N,v);var B=nt(N,p);for(v=0;v<_.length;v+=2){var ee=_[v],ne=_[v+1];ee==="style"?pn(d,ne):ee==="dangerouslySetInnerHTML"?Je(d,ne):ee==="children"?dt(d,ne):U(d,ee,ne,B)}switch(N){case"input":Yt(d,p);break;case"textarea":oe(d,p);break;case"select":var J=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?W(d,!!p.multiple,de,!1):J!==!!p.multiple&&(p.defaultValue!=null?W(d,!!p.multiple,p.defaultValue,!0):W(d,!!p.multiple,p.multiple?[]:"",!1))}d[Ei]=p}catch(ve){wt(e,e.return,ve)}}break;case 6:if(Jn(t,e),ur(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ve){wt(e,e.return,ve)}}break;case 3:if(Jn(t,e),ur(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{gi(t.containerInfo)}catch(ve){wt(e,e.return,ve)}break;case 4:Jn(t,e),ur(e);break;case 13:Jn(t,e),ur(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Ec=ht())),l&4&&dp(e);break;case 22:if(ee=i!==null&&i.memoizedState!==null,e.mode&1?(nn=(B=nn)||ee,Jn(t,e),nn=B):Jn(t,e),ur(e),l&8192){if(B=e.memoizedState!==null,(e.stateNode.isHidden=B)&&!ee&&(e.mode&1)!==0)for(pe=e,ee=e.child;ee!==null;){for(ne=pe=ee;pe!==null;){switch(J=pe,de=J.child,J.tag){case 0:case 11:case 14:case 15:zi(4,J,J.return);break;case 1:Vs(J,J.return);var me=J.stateNode;if(typeof me.componentWillUnmount=="function"){l=J,i=J.return;try{t=l,me.props=t.memoizedProps,me.state=t.memoizedState,me.componentWillUnmount()}catch(ve){wt(l,i,ve)}}break;case 5:Vs(J,J.return);break;case 22:if(J.memoizedState!==null){mp(ne);continue}}de!==null?(de.return=J,pe=de):mp(ne)}ee=ee.sibling}e:for(ee=null,ne=e;;){if(ne.tag===5){if(ee===null){ee=ne;try{d=ne.stateNode,B?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=ne.stateNode,_=ne.memoizedProps.style,v=_!=null&&_.hasOwnProperty("display")?_.display:null,N.style.display=Nn("display",v))}catch(ve){wt(e,e.return,ve)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=B?"":ne.memoizedProps}catch(ve){wt(e,e.return,ve)}}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:Jn(t,e),ur(e),l&4&&dp(e);break;case 21:break;default:Jn(t,e),ur(e)}}function ur(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(ap(i)){var l=i;break e}i=i.return}throw Error(s(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(dt(d,""),l.flags&=-33);var p=cp(e);bc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,N=cp(e);Tc(e,N,v);break;default:throw Error(s(161))}}catch(_){wt(e,e.return,_)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zv(e,t,i){pe=e,pp(e)}function pp(e,t,i){for(var l=(e.mode&1)!==0;pe!==null;){var d=pe,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||nl;if(!v){var N=d.alternate,_=N!==null&&N.memoizedState!==null||nn;N=nl;var B=nn;if(nl=v,(nn=_)&&!B)for(pe=d;pe!==null;)v=pe,_=v.child,v.tag===22&&v.memoizedState!==null?gp(d):_!==null?(_.return=v,pe=_):gp(d);for(;p!==null;)pe=p,pp(p),p=p.sibling;pe=d,nl=N,nn=B}hp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,pe=p):hp(e)}}function hp(e){for(;pe!==null;){var t=pe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:nn||rl(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!nn)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:Qn(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&mf(t,p,l);break;case 3:var v=t.updateQueue;if(v!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}mf(t,v,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var _=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":_.autoFocus&&i.focus();break;case"img":_.src&&(i.src=_.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var B=t.alternate;if(B!==null){var ee=B.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&gi(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}nn||t.flags&512&&Sc(t)}catch(J){wt(t,t.return,J)}}if(t===e){pe=null;break}if(i=t.sibling,i!==null){i.return=t.return,pe=i;break}pe=t.return}}function mp(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,pe=i;break}pe=t.return}}function gp(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{rl(4,t)}catch(_){wt(t,i,_)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(_){wt(t,d,_)}}var p=t.return;try{Sc(t)}catch(_){wt(t,p,_)}break;case 5:var v=t.return;try{Sc(t)}catch(_){wt(t,v,_)}}}catch(_){wt(t,t.return,_)}if(t===e){pe=null;break}var N=t.sibling;if(N!==null){N.return=t.return,pe=N;break}pe=t.return}}var $v=Math.ceil,sl=L.ReactCurrentDispatcher,Nc=L.ReactCurrentOwner,Bn=L.ReactCurrentBatchConfig,qe=0,zt=null,_t=null,Vt=0,In=0,Gs=Pr(0),It=0,$i=null,fs=0,il=0,Cc=0,Fi=null,xn=null,Ec=0,qs=1/0,Tr=null,ol=!1,_c=null,Br=null,ll=!1,Wr=null,al=0,Ui=0,jc=null,cl=-1,ul=0;function cn(){return(qe&6)!==0?ht():cl!==-1?cl:cl=ht()}function Hr(e){return(e.mode&1)===0?1:(qe&2)!==0&&Vt!==0?Vt&-Vt:Sv.transition!==null?(ul===0&&(ul=fi()),ul):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:vd(e.type)),e)}function er(e,t,i,l){if(50<Ui)throw Ui=0,jc=null,Error(s(185));ss(e,i,l),((qe&2)===0||e!==zt)&&(e===zt&&((qe&2)===0&&(il|=i),It===4&&Vr(e,Vt)),wn(e,l),i===1&&qe===0&&(t.mode&1)===0&&(qs=ht()+500,zo&&zr()))}function wn(e,t){var i=e.callbackNode;xo(e,t);var l=rs(e,e===zt?Vt:0);if(l===0)i!==null&&go(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&go(i),t===1)e.tag===0?kv(yp.bind(null,e)):nf(yp.bind(null,e)),vv(function(){(qe&6)===0&&zr()}),i=null;else{switch(re(l)){case 1:i=jr;break;case 4:i=or;break;case 16:i=Ts;break;case 536870912:i=vo;break;default:i=Ts}i=Cp(i,vp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function vp(e,t){if(cl=-1,ul=0,(qe&6)!==0)throw Error(s(327));var i=e.callbackNode;if(Ks()&&e.callbackNode!==i)return null;var l=rs(e,e===zt?Vt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=dl(e,l);else{t=l;var d=qe;qe|=2;var p=wp();(zt!==e||Vt!==t)&&(Tr=null,qs=ht()+500,hs(e,t));do try{Bv();break}catch(N){xp(e,N)}while(!0);qa(),sl.current=p,qe=d,_t!==null?t=0:(zt=null,Vt=0,t=It)}if(t!==0){if(t===2&&(d=di(e),d!==0&&(l=d,t=Rc(e,d))),t===1)throw i=$i,hs(e,0),Vr(e,l),wn(e,ht()),i;if(t===6)Vr(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Fv(d)&&(t=dl(e,l),t===2&&(p=di(e),p!==0&&(l=p,t=Rc(e,p))),t===1))throw i=$i,hs(e,0),Vr(e,l),wn(e,ht()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:ms(e,xn,Tr);break;case 3:if(Vr(e,l),(l&130023424)===l&&(t=Ec+500-ht(),10<t)){if(rs(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){cn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Pa(ms.bind(null,e,xn,Tr),t);break}ms(e,xn,Tr);break;case 4:if(Vr(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-on(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=ht()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*$v(l/1960))-l,10<l){e.timeoutHandle=Pa(ms.bind(null,e,xn,Tr),l);break}ms(e,xn,Tr);break;case 5:ms(e,xn,Tr);break;default:throw Error(s(329))}}}return wn(e,ht()),e.callbackNode===i?vp.bind(null,e):null}function Rc(e,t){var i=Fi;return e.current.memoizedState.isDehydrated&&(hs(e,t).flags|=256),e=dl(e,t),e!==2&&(t=xn,xn=i,t!==null&&Ac(t)),e}function Ac(e){xn===null?xn=e:xn.push.apply(xn,e)}function Fv(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!Yn(p(),d))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vr(e,t){for(t&=~Cc,t&=~il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-on(t),l=1<<i;e[i]=-1,t&=~l}}function yp(e){if((qe&6)!==0)throw Error(s(327));Ks();var t=rs(e,0);if((t&1)===0)return wn(e,ht()),null;var i=dl(e,t);if(e.tag!==0&&i===2){var l=di(e);l!==0&&(t=l,i=Rc(e,l))}if(i===1)throw i=$i,hs(e,0),Vr(e,t),wn(e,ht()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ms(e,xn,Tr),wn(e,ht()),null}function Ic(e,t){var i=qe;qe|=1;try{return e(t)}finally{qe=i,qe===0&&(qs=ht()+500,zo&&zr())}}function ps(e){Wr!==null&&Wr.tag===0&&(qe&6)===0&&Ks();var t=qe;qe|=1;var i=Bn.transition,l=Ve;try{if(Bn.transition=null,Ve=1,e)return e()}finally{Ve=l,Bn.transition=i,qe=t,(qe&6)===0&&zr()}}function Dc(){In=Gs.current,ut(Gs)}function hs(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,gv(i)),_t!==null)for(i=_t.return;i!==null;){var l=i;switch(Ba(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Po();break;case 3:Ws(),ut(gn),ut(Jt),tc();break;case 5:Ja(l);break;case 4:Ws();break;case 13:ut(vt);break;case 19:ut(vt);break;case 10:Ka(l.type._context);break;case 22:case 23:Dc()}i=i.return}if(zt=e,_t=e=Gr(e.current,null),Vt=In=t,It=0,$i=null,Cc=il=fs=0,xn=Fi=null,cs!==null){for(t=0;t<cs.length;t++)if(i=cs[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var v=p.next;p.next=d,l.next=v}i.pending=l}cs=null}return e}function xp(e,t){do{var i=_t;try{if(qa(),Ko.current=Zo,Yo){for(var l=yt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Yo=!1}if(ds=0,Ot=At=yt=null,Di=!1,Mi=0,Nc.current=null,i===null||i.return===null){It=1,$i=t,_t=null;break}e:{var p=e,v=i.return,N=i,_=t;if(t=Vt,N.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){var B=_,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 de=Hf(v);if(de!==null){de.flags&=-257,Vf(de,v,N,p,t),de.mode&1&&Wf(p,B,t),t=de,_=B;var me=t.updateQueue;if(me===null){var ve=new Set;ve.add(_),t.updateQueue=ve}else me.add(_);break e}else{if((t&1)===0){Wf(p,B,t),Mc();break e}_=Error(s(426))}}else if(ft&&N.mode&1){var Nt=Hf(v);if(Nt!==null){(Nt.flags&65536)===0&&(Nt.flags|=256),Vf(Nt,v,N,p,t),Va(Hs(_,N));break e}}p=_=Hs(_,N),It!==4&&(It=2),Fi===null?Fi=[p]:Fi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var $=Uf(p,_,t);hf(p,$);break e;case 1:N=_;var R=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof R.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Br===null||!Br.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var se=Bf(p,N,t);hf(p,se);break e}}p=p.return}while(p!==null)}Sp(i)}catch(xe){t=xe,_t===i&&i!==null&&(_t=i=i.return);continue}break}while(!0)}function wp(){var e=sl.current;return sl.current=Zo,e===null?Zo:e}function Mc(){(It===0||It===3||It===2)&&(It=4),zt===null||(fs&268435455)===0&&(il&268435455)===0||Vr(zt,Vt)}function dl(e,t){var i=qe;qe|=2;var l=wp();(zt!==e||Vt!==t)&&(Tr=null,hs(e,t));do try{Uv();break}catch(d){xp(e,d)}while(!0);if(qa(),qe=i,sl.current=l,_t!==null)throw Error(s(261));return zt=null,Vt=0,It}function Uv(){for(;_t!==null;)kp(_t)}function Bv(){for(;_t!==null&&!fa();)kp(_t)}function kp(e){var t=Np(e.alternate,e,In);e.memoizedProps=e.pendingProps,t===null?Sp(e):_t=t,Nc.current=null}function Sp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Mv(i,t,In),i!==null){_t=i;return}}else{if(i=Lv(i,t),i!==null){i.flags&=32767,_t=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{It=6,_t=null;return}}if(t=t.sibling,t!==null){_t=t;return}_t=t=e}while(t!==null);It===0&&(It=5)}function ms(e,t,i){var l=Ve,d=Bn.transition;try{Bn.transition=null,Ve=1,Wv(e,t,i,l)}finally{Bn.transition=d,Ve=l}return null}function Wv(e,t,i,l){do Ks();while(Wr!==null);if((qe&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(wo(e,p),e===zt&&(_t=zt=null,Vt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||ll||(ll=!0,Cp(Ts,function(){return Ks(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Bn.transition,Bn.transition=null;var v=Ve;Ve=1;var N=qe;qe|=4,Nc.current=null,Ov(e,i),fp(i,e),cv(Ma),So=!!Da,Ma=Da=null,e.current=i,zv(i),pa(),qe=N,Ve=v,Bn.transition=p}else e.current=i;if(ll&&(ll=!1,Wr=e,al=d),p=e.pendingLanes,p===0&&(Br=null),bs(i.stateNode),wn(e,ht()),t!==null)for(l=e.onRecoverableError,i=0;i<t.length;i++)d=t[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(ol)throw ol=!1,e=_c,_c=null,e;return(al&1)!==0&&e.tag!==0&&Ks(),p=e.pendingLanes,(p&1)!==0?e===jc?Ui++:(Ui=0,jc=e):Ui=0,zr(),null}function Ks(){if(Wr!==null){var e=re(al),t=Bn.transition,i=Ve;try{if(Bn.transition=null,Ve=16>e?16:e,Wr===null)var l=!1;else{if(e=Wr,Wr=null,al=0,(qe&6)!==0)throw Error(s(331));var d=qe;for(qe|=4,pe=e.current;pe!==null;){var p=pe,v=p.child;if((pe.flags&16)!==0){var N=p.deletions;if(N!==null){for(var _=0;_<N.length;_++){var B=N[_];for(pe=B;pe!==null;){var ee=pe;switch(ee.tag){case 0:case 11:case 15:zi(8,ee,p)}var ne=ee.child;if(ne!==null)ne.return=ee,pe=ne;else for(;pe!==null;){ee=pe;var J=ee.sibling,de=ee.return;if(lp(ee),ee===B){pe=null;break}if(J!==null){J.return=de,pe=J;break}pe=de}}}var me=p.alternate;if(me!==null){var ve=me.child;if(ve!==null){me.child=null;do{var Nt=ve.sibling;ve.sibling=null,ve=Nt}while(ve!==null)}}pe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,pe=v;else e:for(;pe!==null;){if(p=pe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:zi(9,p,p.return)}var $=p.sibling;if($!==null){$.return=p.return,pe=$;break e}pe=p.return}}var R=e.current;for(pe=R;pe!==null;){v=pe;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,pe=F;else e:for(v=R;pe!==null;){if(N=pe,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:rl(9,N)}}catch(xe){wt(N,N.return,xe)}if(N===v){pe=null;break e}var se=N.sibling;if(se!==null){se.return=N.return,pe=se;break e}pe=N.return}}if(qe=d,zr(),_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(es,e)}catch{}l=!0}return l}finally{Ve=i,Bn.transition=t}}return!1}function Tp(e,t,i){t=Hs(i,t),t=Uf(e,t,1),e=Fr(e,t,1),t=cn(),e!==null&&(ss(e,1,t),wn(e,t))}function wt(e,t,i){if(e.tag===3)Tp(e,e,i);else for(;t!==null;){if(t.tag===3){Tp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Br===null||!Br.has(l))){e=Hs(i,e),e=Bf(t,e,1),t=Fr(t,e,1),e=cn(),t!==null&&(ss(t,1,e),wn(t,e));break}}t=t.return}}function Hv(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=cn(),e.pingedLanes|=e.suspendedLanes&i,zt===e&&(Vt&i)===i&&(It===4||It===3&&(Vt&130023424)===Vt&&500>ht()-Ec?hs(e,0):Cc|=i),wn(e,t)}function bp(e,t){t===0&&((e.mode&1)===0?t=1:(t=Cs,Cs<<=1,(Cs&130023424)===0&&(Cs=4194304)));var i=cn();e=wr(e,t),e!==null&&(ss(e,t,i),wn(e,i))}function Vv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),bp(e,i)}function Gv(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),bp(e,i)}var Np;Np=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||gn.current)yn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return yn=!1,Dv(e,t,i);yn=(e.flags&131072)!==0}else yn=!1,ft&&(t.flags&1048576)!==0&&rf(t,Fo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;tl(e,t),e=t.pendingProps;var d=Ps(t,Jt.current);Bs(t,i),d=sc(null,t,l,e,d,i);var p=ic();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vn(l)?(p=!0,Oo(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Qa(t),d.updater=Jo,t.stateNode=d,d._reactInternals=t,dc(t,l,e,i),t=mc(null,t,l,!0,p,i)):(t.tag=0,ft&&p&&Ua(t),an(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(tl(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=Kv(l),e=Qn(l,e),d){case 0:t=hc(null,t,l,e,i);break e;case 1:t=Qf(null,t,l,e,i);break e;case 11:t=Gf(null,t,l,e,i);break e;case 14:t=qf(null,t,l,Qn(l.type,e),i);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),hc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Qf(e,t,l,d,i);case 3:e:{if(Zf(t),e===null)throw Error(s(387));l=t.pendingProps,p=t.memoizedState,d=p.element,pf(e,t),Go(t,l,null,i);var v=t.memoizedState;if(l=v.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Hs(Error(s(423)),t),t=Jf(e,t,l,i,d);break e}else if(l!==d){d=Hs(Error(s(424)),t),t=Jf(e,t,l,i,d);break e}else for(An=Lr(t.stateNode.containerInfo.firstChild),Rn=t,ft=!0,Xn=null,i=df(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if($s(),l===d){t=Sr(e,t,i);break e}an(e,t,l,i)}t=t.child}return t;case 5:return gf(t),e===null&&Ha(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,La(l,d)?v=null:p!==null&&La(l,p)&&(t.flags|=32),Xf(e,t),an(e,t,v,i),t.child;case 6:return e===null&&Ha(t),null;case 13:return ep(e,t,i);case 4:return Za(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fs(t,null,l,i):an(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Gf(e,t,l,d,i);case 7:return an(e,t,t.pendingProps,i),t.child;case 8:return an(e,t,t.pendingProps.children,i),t.child;case 12:return an(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,v=d.value,ot(Wo,l._currentValue),l._currentValue=v,p!==null)if(Yn(p.value,v)){if(p.children===d.children&&!gn.current){t=Sr(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){v=p.child;for(var _=N.firstContext;_!==null;){if(_.context===l){if(p.tag===1){_=kr(-1,i&-i),_.tag=2;var B=p.updateQueue;if(B!==null){B=B.shared;var ee=B.pending;ee===null?_.next=_:(_.next=ee.next,ee.next=_),B.pending=_}}p.lanes|=i,_=p.alternate,_!==null&&(_.lanes|=i),Ya(p.return,i,t),N.lanes|=i;break}_=_.next}}else if(p.tag===10)v=p.type===t.type?null:p.child;else if(p.tag===18){if(v=p.return,v===null)throw Error(s(341));v.lanes|=i,N=v.alternate,N!==null&&(N.lanes|=i),Ya(v,i,t),v=p.sibling}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===t){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}an(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Bs(t,i),d=Fn(d),l=l(d),t.flags|=1,an(e,t,l,i),t.child;case 14:return l=t.type,d=Qn(l,t.pendingProps),d=Qn(l.type,d),qf(e,t,l,d,i);case 15:return Kf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),tl(e,t),t.tag=1,vn(l)?(e=!0,Oo(t)):e=!1,Bs(t,i),$f(t,l,d),dc(t,l,d,i),mc(null,t,l,!0,e,i);case 19:return np(e,t,i);case 22:return Yf(e,t,i)}throw Error(s(156,t.tag))};function Cp(e,t){return ui(e,t)}function qv(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(e,t,i,l){return new qv(e,t,i,l)}function Lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kv(e){if(typeof e=="function")return Lc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Le)return 11;if(e===G)return 14}return 2}function Gr(e,t){var i=e.alternate;return i===null?(i=Wn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function fl(e,t,i,l,d,p){var v=2;if(l=e,typeof e=="function")Lc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case K:return gs(i.children,d,p,t);case q:v=8,d|=8;break;case ie:return e=Wn(12,i,t,d|2),e.elementType=ie,e.lanes=p,e;case Re:return e=Wn(13,i,t,d),e.elementType=Re,e.lanes=p,e;case Oe:return e=Wn(19,i,t,d),e.elementType=Oe,e.lanes=p,e;case te:return pl(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fe:v=10;break e;case ce:v=9;break e;case Le:v=11;break e;case G:v=14;break e;case Y:v=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Wn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function gs(e,t,i,l){return e=Wn(7,e,l,t),e.lanes=i,e}function pl(e,t,i,l){return e=Wn(22,e,l,t),e.elementType=te,e.lanes=i,e.stateNode={isHidden:!1},e}function Pc(e,t,i){return e=Wn(6,e,null,t),e.lanes=i,e}function Oc(e,t,i){return t=Wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yv(e,t,i,l,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pi(0),this.expirationTimes=pi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function zc(e,t,i,l,d,p,v,N,_){return e=new Yv(e,t,i,N,_),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Wn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qa(p),e}function Xv(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:X,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function Ep(e){if(!e)return Or;e=e._reactInternals;e:{if(Xe(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(vn(i))return ef(e,i,t)}return t}function _p(e,t,i,l,d,p,v,N,_){return e=zc(i,l,!0,e,d,p,v,N,_),e.context=Ep(null),i=e.current,l=cn(),d=Hr(i),p=kr(l,d),p.callback=t??null,Fr(i,p,d),e.current.lanes=d,ss(e,d,l),wn(e,l),e}function hl(e,t,i,l){var d=t.current,p=cn(),v=Hr(d);return i=Ep(i),t.context===null?t.context=i:t.pendingContext=i,t=kr(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Fr(d,t,v),e!==null&&(er(e,d,v,p),Vo(e,d,v)),v}function ml(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 jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function $c(e,t){jp(e,t),(e=e.alternate)&&jp(e,t)}function Qv(){return null}var Rp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Fc(e){this._internalRoot=e}gl.prototype.render=Fc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));hl(e,t,null,null)},gl.prototype.unmount=Fc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ps(function(){hl(null,e,null,null)}),t[gr]=null}};function gl(e){this._internalRoot=e}gl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ge();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ir.length&&t!==0&&t<Ir[i].priority;i++);Ir.splice(i,0,e),i===0&&md(e)}};function Uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ap(){}function Zv(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var B=ml(v);p.call(B)}}var v=_p(t,l,e,0,null,!1,!1,"",Ap);return e._reactRootContainer=v,e[gr]=v.current,Ni(e.nodeType===8?e.parentNode:e),ps(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var B=ml(_);N.call(B)}}var _=zc(e,0,!1,null,null,!1,!1,"",Ap);return e._reactRootContainer=_,e[gr]=_.current,Ni(e.nodeType===8?e.parentNode:e),ps(function(){hl(t,_,i,l)}),_}function yl(e,t,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var N=d;d=function(){var _=ml(v);N.call(_)}}hl(t,v,e,d)}else v=Zv(i,t,e,d,l);return ml(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=ns(t.pendingLanes);i!==0&&(Ar(t,i|1),wn(t,ht()),(qe&6)===0&&(qs=ht()+500,zr()))}break;case 13:ps(function(){var l=wr(e,1);if(l!==null){var d=cn();er(l,e,1,d)}}),$c(e,1)}},O=function(e){if(e.tag===13){var t=wr(e,134217728);if(t!==null){var i=cn();er(t,e,134217728,i)}$c(e,134217728)}},Z=function(e){if(e.tag===13){var t=Hr(e),i=wr(e,t);if(i!==null){var l=cn();er(i,e,t,l)}$c(e,t)}},ge=function(){return Ve},we=function(e,t){var i=Ve;try{return Ve=e,t()}finally{Ve=i}},Xt=function(e,t,i){switch(t){case"input":if(Yt(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var d=Lo(l);if(!d)throw Error(s(90));je(l),Yt(l,d)}}}break;case"textarea":oe(e,i);break;case"select":t=i.value,t!=null&&W(e,!!i.multiple,t,!1)}},Et=Ic,Tt=ps;var Jv={usingClientEntryPoint:!1,Events:[_i,Ms,Lo,Ct,hn,Ic]},Bi={findFiberByHostInstance:is,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ey={bundleType:Bi.bundleType,version:Bi.version,rendererPackageName:Bi.rendererPackageName,rendererConfig:Bi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ss(e),e===null?null:e.stateNode},findFiberByHostInstance:Bi.findFiberByHostInstance||Qv,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 xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xl.isDisabled&&xl.supportsFiber)try{es=xl.inject(ey),_n=xl}catch{}}return kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jv,kn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uc(t))throw Error(s(200));return Xv(e,t,null,i)},kn.createRoot=function(e,t){if(!Uc(e))throw Error(s(299));var i=!1,l="",d=Rp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=zc(e,1,!1,null,null,i,!1,l,d),e[gr]=t.current,Ni(e.nodeType===8?e.parentNode:e),new Fc(t)},kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=Ss(t),e=e===null?null:e.stateNode,e},kn.flushSync=function(e){return ps(e)},kn.hydrate=function(e,t,i){if(!vl(t))throw Error(s(200));return yl(null,e,t,!0,i)},kn.hydrateRoot=function(e,t,i){if(!Uc(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Rp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=_p(t,null,e,1,i??null,d,!1,p,v),e[gr]=t.current,Ni(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,d]:t.mutableSourceEagerHydrationData.push(i,d);return new gl(t)},kn.render=function(e,t,i){if(!vl(t))throw Error(s(200));return yl(null,e,t,!1,i)},kn.unmountComponentAtNode=function(e){if(!vl(e))throw Error(s(40));return e._reactRootContainer?(ps(function(){yl(null,null,e,!1,function(){e._reactRootContainer=null,e[gr]=null})}),!0):!1},kn.unstable_batchedUpdates=Ic,kn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!vl(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return yl(e,t,i,!1,l)},kn.version="18.3.1-next-f1338f8080-20240426",kn}var $p;function am(){if($p)return Hc.exports;$p=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Hc.exports=cy(),Hc.exports}var Fp;function uy(){if(Fp)return wl;Fp=1;var n=am();return wl.createRoot=n.createRoot,wl.hydrateRoot=n.hydrateRoot,wl}var dy=uy();const fy=lm(dy),Up=n=>{let r;const s=new Set,o=(g,x)=>{const w=typeof g=="function"?g(r):g;if(!Object.is(w,r)){const y=r;r=x??(typeof w!="object"||w===null)?w:Object.assign({},r,w),s.forEach(T=>T(r,y))}},a=()=>r,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(s.add(g),()=>s.delete(g))},m=r=n(o,a,h);return h},py=(n=>n?Up(n):Up),hy=n=>n;function my(n,r=hy){const s=et.useSyncExternalStore(n.subscribe,et.useCallback(()=>r(n.getState()),[n,r]),et.useCallback(()=>r(n.getInitialState()),[n,r]));return et.useDebugValue(s),s}const gy=n=>{const r=py(n),s=o=>my(r,o);return Object.assign(s,r),s},vy=(n=>gy),cm="agentpane:machines",um="agentpane:active-machine";function yy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function dm(n){return`${n}.repoburg.com`}function Lu(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function fm(n,r){try{const s=localStorage.getItem(n);return s==null?r:JSON.parse(s)}catch{return r}}function pm(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function hm(){return fm(cm,[]).filter(r=>yy(r.mahlas)&&r.hostname===dm(r.mahlas))}function xy(n){const r={mahlas:n,hostname:dm(n),lastConnectedAt:new Date().toISOString()},s=hm(),o=[r,...s.filter(a=>a.mahlas!==n)];return pm(cm,o),r}function wy(){const n=fm(um,null);return n?hm().find(r=>r.mahlas===n)??null:null}function ky(n){pm(um,n)}function Sy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Lu(n);r&&(xy(r),ky(r))}const Bp="http://localhost:9998",Ty=["agent.repoburg.com"];function fr(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),r=n.get("bport");if(r)return`http://localhost:${r}`;const s=n.get("host");if(s)return`https://${s}`;const o=window.location.hostname;if(Ty.includes(o))return Bp;if(Lu(o))return"";const a=wy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Bp}const by="/api";async function oo(n,r,s){const o=await fetch(`${fr()}${by}${r}`,{method:n,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${r} failed: ${a}`)}return o.json()}function Tn(n){return oo("GET",n)}function kt(n,r){return oo("POST",n,r)}function Zl(n){return oo("DELETE",n)}function pr(n,r){return oo("PATCH",n,r)}function Ny(n,r){return oo("PUT",n,r)}function Cy(){return Tn("/sessions")}function kl(n){return Tn(`/sessions/${n}`)}function Pu(n){return kt("/sessions",n)}function Ey(n){return Zl(`/sessions/${n}`)}function mm(n,r,s){return kt(`/sessions/${n}/turns`,{user_prompt:r,...s!=null&&s.length?{attachments:s}:{}})}function _y(n){return kt(`/sessions/${n}/cancel`)}function jy(n,r){return pr(`/sessions/${n}`,{title:r})}function Ry(n){return pr(`/sessions/${n}`,{lifecycle:"finished"})}function Ay(n){return pr(`/sessions/${n}`,{lifecycle:"working"})}function Iy(n,r){return pr(`/sessions/${n}`,{starred:r})}function Wp(n){return pr(`/sessions/${n}`,{has_unreviewed:0})}function Dy(n,r,s,o){const a={model:r,model_reasoning_effort:s};return o!==void 0&&(a.runtime_type=o),pr(`/sessions/${n}`,a)}function My(n,r){return pr(`/sessions/${n}`,{runtime_config:r})}function Ly(n,r){return kt(`/sessions/${n}/rewind`,{turn_id:r})}function Py(n){return kt(`/sessions/${n}/restore`,{})}function Oy(n,r,s){return kt(`/sessions/${n}/branch`,{turn_id:r,title:s})}function gm(){return Tn("/workspaces")}function zy(n,r){return kt("/workspaces",{path:n,label:r})}function $y(n){return kt("/workspaces/hide",{path:n})}async function Fy(){const n=await fetch(`${fr()}/api/pick-directory`);if(n.status===204)return{cancelled:!0};if(!n.ok)throw new Error(`GET /api/pick-directory failed: ${n.status} ${n.statusText}`);return n.json()}function vm(){return Tn("/folders")}function Uy(n,r){return kt("/folders",{workspace_path:n,name:r})}function Hp(n,r){return pr(`/folders/${n}`,r)}function By(n){return Zl(`/folders/${n}`)}function Wy(n){return kt("/sessions/reorder",{moves:n})}function ii(n){return n.status==="pending"||n.status==="running"}function ym(n){return!!(n!=null&&n.turns.some(ii))}function Jl(n){return n?n.turns.some(ii)||(n.threads??[]).some(r=>(r.turns??[]).some(ii)):!1}const Hy=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,restoredPrompt:null,quotedText:null,init:async()=>{var s;try{const o=localStorage.getItem("agentpane:last-model-config");o&&n({lastModelConfig:JSON.parse(o)})}catch{}n({loading:!0,error:null});try{const[o,a,u]=await Promise.all([Cy(),gm(),vm()]);n({sessions:o,workspaces:a,folders:u,loading:!1});const f=new URLSearchParams(window.location.search),h=f.get("session"),m=f.get("thread"),g=h&&o.some(x=>x.id===h)?h:(s=o[0])==null?void 0:s.id;g&&!r().activeSessionId&&await r().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async s=>{if(r().sessionDetails[s]){const o=r().sessionDetails[s];n({activeSessionId:s,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",openTabs:r().openTabs.includes(s)?r().openTabs:[...r().openTabs,s]}),o.has_unreviewed===1&&(Wp(s).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[s]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await kl(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeSessionId:s,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",loading:!1})),o.has_unreviewed===1&&(Wp(s).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[s]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},closeTab:s=>{n(o=>{const a=o.openTabs.filter(u=>u!==s);if(o.activeSessionId===s&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===s?null:o.activeSessionId}})},updateModelConfig:async(s,o,a)=>{const u=r().activeSessionId;if(u){n({error:null});try{const f=await Dy(u,s,o,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),n(m=>({sessions:m.sessions.map(g=>g.id===u?f:g),sessionDetails:m.sessionDetails[u]?{...m.sessionDetails,[u]:{...m.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:m.sessionDetails})),await r().refreshActiveSession()}catch(f){n({error:f.message}),r().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async s=>{n({error:null});try{const o=await Pu(s);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await r().selectSession(o.id),r().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),r().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},deleteSession:async s=>{var a;n({error:null});const o=(a=r().sessions.find(u=>u.id===s))==null?void 0:a.title;try{await Ey(s),n(u=>{const f={...u.sessionDetails};delete f[s];const h=u.openTabs.filter(x=>x!==s);let m=u.activeSessionId,g=u.activeTurnIndex;if(u.activeSessionId===s){m=h.length>0?h[h.length-1]:null;const x=m?f[m]:null;g=x&&x.turns.length>0?x.turns.length-1:0}return{sessions:u.sessions.filter(x=>x.id!==s),sessionDetails:f,openTabs:h,activeSessionId:m,activeTurnIndex:g}}),r().addLogEntry("INFO",`Session deleted — ${s.slice(0,8)}`),r().addToast("info",`Session "${o||s.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),r().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(s,o)=>{n({error:null});try{const a=await jy(s,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async s=>{n({error:null});try{const o=await Ry(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),r().addToast("error",`Failed to mark as finished — ${o.message}`)}},toggleStar:async s=>{const o=r().sessions.find(a=>a.id===s);if(o){n({error:null});try{const a=await Iy(s,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async s=>{n({error:null});try{const o=await Ay(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session reopened")}catch(o){n({error:o.message}),r().addToast("error",`Failed to reopen session — ${o.message}`)}},submitPrompt:async(s,o)=>{const a=r().activeSessionId;if(a){n({error:null,submittingPrompt:s}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await mm(a,s,o);r().addLogEntry("INFO",`Turn submitted — "${s.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},activeTurnIndex:h.turns.length}})}catch(u){n({submittingPrompt:null,error:u.message}),r().addLogEntry("ERROR",`Turn failed — ${u.message}`),r().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const m=Jl(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:m,status:m?"running":"active"}},sessions:f.sessions.map(g=>g.id===a?{...g,is_running:m,status:m?"running":"active"}:g)}})}}},cancelTurn:async()=>{const s=r().activeSessionId;if(s)try{await _y(s)}catch(o){n({error:o.message})}},rewindToTurn:async(s,o)=>{n({error:null});try{const a=await Ly(s,o),u=await kl(s);n(f=>({sessionDetails:{...f.sessionDetails,[s]:u},sessions:f.sessions.map(h=>h.id===s?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),r().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),r().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async s=>{n({error:null});try{const o=await Py(s),a=await kl(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a},sessions:u.sessions.map(f=>f.id===s?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),r().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),r().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(s,o,a)=>{n({error:null});try{const u=await Oy(s,o,a);n(f=>({sessions:[u,...f.sessions]})),await r().selectSession(u.id),r().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),r().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async s=>{const o=r().activeSessionId;if(o){n({error:null});try{const a=await My(o,JSON.stringify(s));n(u=>({sessions:u.sessions.map(f=>f.id===o?a:f),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:a.runtime_config}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const s=r().activeSessionId;if(s)try{const o=await kl(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===s?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),Vy=(n,r)=>({workspaces:[],addWorkspace:async s=>{n({error:null});try{const o=await zy(s.trim());n(a=>({workspaces:[...a.workspaces,o]})),r().addToast("success",`Workspace added — ${o.path}`)}catch(o){r().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async s=>{n({error:null});try{await $y(s);const o=await gm();n({workspaces:o}),r().addToast("info","Workspace hidden")}catch(o){r().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async s=>{n({error:null});try{const o=r().lastModelConfig,a=await Pu({cwd:s,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await r().selectSession(a.id),r().addLogEntry("INFO",`Session created in ${s} — ${a.id.slice(0,8)}`),r().addToast("success",`Session created in ${s.split("/").pop()||s}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const s=await Fy();if(s.cancelled||!s.path)return;await r().addWorkspace(s.path)}catch(s){r().addToast("error",`Failed to pick directory — ${s.message}`)}}}),ws=new Map,Ou=new Map,zu=new Map,$u=new Map;function Gy(n,r){ws.set(n,r)}function qy(n){ws.delete(n)}function qc(n,r){Ou.set(n,r)}function Vp(n,r,s){const o=Ou.get(n);if(!o)return;const a=ws.get(o);a&&a({source:"agentpane-host",event:r,payload:s})}function Ky(n,r,s,o){const a=ws.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:r,tool:s,name:s,args:o}})}function Yy(n,r,s,o){const a=Ou.get(n);if(!a)return;const u=ws.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:r,itemId:s,delta:o}})}function Xy(n,r){zu.set(n,r)}function Qy(n){zu.delete(n)}function Zy(n,r){$u.set(n,r)}function Jy(n){$u.delete(n)}function ex(n){var s;const r=ws.get(n);r&&r({source:"agentpane-host",event:"state_changed",payload:{}}),(s=$u.get(n))==null||s()}function tx(n){var s;const r=ws.get(n);r&&r({source:"agentpane-host",event:"source:updated",payload:{}}),(s=zu.get(n))==null||s()}const nx=(n,r)=>({wsConnected:!1,setWsConnected:s=>n({wsConnected:s}),onTurnStarted:(s,o)=>{r().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=a.sessionDetails[s];if(!u)return{};const f=u.turns.findIndex(h=>h.id===o);return{sessionDetails:{...a.sessionDetails,[s]:{...Kr(u,o,h=>({...h,status:"running"})),is_running:1,status:"running"}},sessions:a.sessions.map(h=>h.id===s?{...h,is_running:1,status:"running"}:h),activeTurnIndex:a.activeSessionId===s&&f>=0?f:a.activeTurnIndex}})},onItemStarted:(s,o,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Kr(f,o,h=>Yc(h,a))}}:{}})},onItemUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Kr(f,o,h=>Yc(h,a))}}:{}})},onItemCompleted:(s,o,a)=>{if(r().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${g} completed: ${h}`):r().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Kr(f,o,h=>{var g,x;let m=Yc(h,a);if(a.type==="agent_message"&&((g=a.data)!=null&&g.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((x=a.data)!=null&&x.text)){const w=m.thoughts?m.thoughts+`
|
|
41
|
+
`+a.data.text:a.data.text;m={...m,thoughts:w}}return m})}}:{}})},onItemDelta:(s,o,a,u)=>{Yy(s,o,a,u),n(f=>{const h=f.sessionDetails[s];return h?{sessionDetails:{...f.sessionDetails,[s]:Kr(h,o,m=>rx(m,a,u))}}:{}})},onTurnCompleted:(s,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),Vp(s,"turn:completed",{turnId:o,response:f??null}),r().refreshApps(),n(g=>{const x=g.sessionDetails[s];if(!x)return{};const w=Kr(x,o,T=>({...T,status:"completed",token_usage:a??T.token_usage??null,...f&&!T.agent_response?{agent_response:f}:{}})),y=Kc(w);return{sessionDetails:{...g.sessionDetails,[s]:{...w,is_running:y,status:y?"running":"active",has_unreviewed:u?1:x.has_unreviewed}},sessions:g.sessions.map(T=>T.id===s?{...T,is_running:y,status:y?"running":"active",has_unreviewed:u?1:T.has_unreviewed}:T)}})},onTokenUsageUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Kr(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(s,o,a)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),Vp(s,"turn:failed",{turnId:o,error:a}),n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=Kr(f,o,y=>({...y,status:m,error:a,items:y.items.map(T=>T.status==="in_progress"?{...T,status:"failed"}:T)})),x=Kc(g),w=x?"running":h?"active":"failed";return{sessionDetails:{...u.sessionDetails,[s]:{...g,is_running:x,status:w}},sessions:u.sessions.map(y=>y.id===s?{...y,is_running:x,status:w}:y)}})},onTurnCancelled:(s,o)=>{n(a=>{const u=a.sessionDetails[s];if(!u)return{};const h=[...u.turns,...(u.threads??[]).flatMap(y=>y.turns??[])].find(y=>y.id===o),m=(h==null?void 0:h.user_prompt)??null,g=u.turns.filter(y=>y.id!==o),x={...u,turns:g,threads:(u.threads??[]).map(y=>({...y,turns:(y.turns??[]).filter(T=>T.id!==o)}))},w=Kc(x);return{restoredPrompt:m,sessionDetails:{...a.sessionDetails,[s]:{...x,is_running:w,status:w?"running":"active"}},sessions:a.sessions.map(y=>y.id===s?{...y,is_running:w,status:w?"running":"active"}:y),activeTurnIndex:g.length>0?Math.min(a.activeTurnIndex,g.length-1):0}})},onSessionTitle:(s,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,title:o}:u),sessionDetails:a.sessionDetails[s]?{...a.sessionDetails,[s]:{...a.sessionDetails[s],title:o}}:a.sessionDetails}))},onBackgroundTasksChanged:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,backgroundTasks:o}}}:{}})}});function Kc(n){return n.turns.some(ii)||(n.threads??[]).some(s=>(s.turns??[]).some(ii))?1:0}function Kr(n,r,s){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===r)?{...a,turns:(a.turns??[]).map(u=>u.id===r?s(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===r?s(a):a),threads:o}}function Yc(n,r){const s=n.items.findIndex(o=>o.external_item_id===r.external_item_id);if(s>=0){const o=[...n.items];return o[s]=r,{...n,items:o}}if(r.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,r]}}return{...n,items:[...n.items,r]}}function rx(n,r,s){var u;const o=n.items.findIndex(f=>f.external_item_id===r);if(o>=0){const f=n.items[o],m=(((u=f.data)==null?void 0:u.text)??"")+s,g=[...n.items];return g[o]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${r}`,turn_id:n.id,external_item_id:r,type:"agent_message",data:{text:s},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:s}}function sx(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return Tn(`/providers/${n}/models${s}`)}const pu=160,hu=480,ix=240,Ll=220,ox=300,lx=600;function Pl(){return typeof window>"u"?lx:Math.max(Ll,Math.round(window.innerWidth*.7))}const Gp="agentpane:sidebar-width",qp="agentpane:right-panel-width";function Kp(n,r,s,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(s,Math.max(r,u)):o}catch{return o}}const Yp=200,ax=(n,r)=>({activeRightTab:"turns",changesScope:"session",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,selectedChangePath:null,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:Kp(Gp,pu,hu,ix),rightPanelWidth:Kp(qp,Ll,Pl(),ox),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:s=>n({activeTurnIndex:s}),switchRightTab:s=>n({activeRightTab:s}),setChangesScope:s=>n({changesScope:s}),setShowNewSessionDialog:s=>n({showNewSessionDialog:s}),setShowRemoteModal:s=>n({showRemoteModal:s}),setShowCommandPalette:s=>n({showCommandPalette:s}),setShowModelSelector:s=>n({showModelSelector:s}),setSelectedChangePath:s=>n({selectedChangePath:s}),setDeepLinkThreadId:s=>n({deepLinkThreadId:s}),setSidebarWidth:s=>{const o=Math.min(hu,Math.max(pu,Math.round(s)));n({sidebarWidth:o});try{localStorage.setItem(Gp,String(o))}catch{}},setRightPanelWidth:s=>{const o=Math.min(Pl(),Math.max(Ll,Math.round(s)));n({rightPanelWidth:o});try{localStorage.setItem(qp,String(o))}catch{}},toggleVscodeView:()=>{if(r().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(s,o,a)=>n({vscodeState:s,vscodeId:o,vscodeToken:a}),addToast:(s,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:s,message:o,undoAction:a,undoLabel:u}]}))},removeToast:s=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==s)}))},addLogEntry:(s,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:s,message:o}];return f.length>Yp&&f.splice(0,f.length-Yp),{eventLog:f}})},loadModels:async(s,o)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await sx(s,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),cx=(n,r)=>({createThread:async(s,o)=>{try{await kt(`/sessions/${s}/threads`,o),r().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){r().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(s,o,a)=>{try{await kt(`/sessions/${s}/threads/${o}/followup`,{message:a}),r().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){r().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(s,o)=>{try{await kt(`/sessions/${s}/cancel?threadId=${encodeURIComponent(o)}`),r().addLogEntry("INFO","Thread turn cancelled")}catch(a){r().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(s,o)=>{try{await pr(`/sessions/${s}/threads/${o}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(s,o)=>{try{await pr(`/sessions/${s}/threads/${o}`,{status:"open"})}catch(a){r().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(s,o,a)=>{try{const u=await kt(`/sessions/${s}/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 n({quotedText:f}),r().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),r().addToast("success","Thread summary added to your input"),!0}catch(u){return r().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(s,o)=>{try{await Zl(`/sessions/${s}/threads/${o}`)}catch(a){r().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=(f.threads??[]).map(m=>m.id===o?{...m,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:m);return{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:h}}}})},onThreadDeleted:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),ux=(n,r)=>({folders:[],loadFolders:async()=>{const s=await vm();n({folders:s})},createSidebarFolder:async(s,o)=>{try{const a=await Uy(s,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return r().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(s,o)=>{try{const a=await Hp(s,{name:o});n(u=>({folders:u.folders.map(f=>f.id===s?a:f)}))}catch(a){r().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async s=>{const o=r().folders,a=r().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==s),sessions:u.sessions.map(f=>f.folder_id===s?{...f,folder_id:null}:f)}));try{await By(s)}catch(u){n({folders:o,sessions:a}),r().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async s=>{if(s.length===0)return;const o=r().sessions,a=new Map(s.map(u=>[u.id,u]));n(u=>({sessions:u.sessions.map(f=>{const h=a.get(f.id);return h?{...f,folder_id:h.folder_id,sort_order:h.sort_order}:f})}));try{await Wy(s)}catch(u){n({sessions:o}),r().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async s=>{const o=r().folders,a=new Map(s.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(s.map((u,f)=>Hp(u,{sort_order:f})))}catch(u){n({folders:o}),r().addToast("error",`Failed to save folder order — ${u.message}`)}}});function Xp(){return Tn("/apps")}function Qp(n){return Tn(`/apps/${n}/source`)}function Zp(n,r=""){return Tn(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`)}function xm(n,r,s=""){return Ny(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`,r)}function dx(n){return Zl(`/apps/${n}`)}function fx(n){return Tn(`/apps/${n}/sessions`)}function px(){return Tn("/apps/examples")}function hx(n){return kt(`/apps/examples/${n}/install`,{})}function mx(n){return kt("/apps",n)}function gx(n,r){return kt("/apps/import",{id:n,files:r})}function vx(n,r,s){return kt(`/apps/mcp/calls/${n}/result`,{result:r,error:null})}function yx(n,r){return kt(`/apps/${n}/edit-session`,r)}const Rl=new Set;async function Xc(n,r){Rl.add(r),await n().loadApps();const s=n().apps.find(o=>o.id===r);n().openAppTab(r),n().addToast("success",`Mini app added: ${(s==null?void 0:s.title)??r}`)}const mu="agentpane:app-workspaces";function xx(){try{const n=JSON.parse(localStorage.getItem(mu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const wx=(n,r)=>({apps:[],openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:xx(),loadApps:async()=>{try{const s=await Xp();s.forEach(o=>Rl.add(o.id)),n({apps:s})}catch{}},refreshApps:async()=>{try{const s=await Xp();for(const o of s)Rl.has(o.id)||(Rl.add(o.id),r().addToast("success",`New mini app discovered: ${o.title}`));n({apps:s})}catch{}},openAppTab:s=>{n(o=>({activeAppTabId:s,openAppTabs:o.openAppTabs.includes(s)?o.openAppTabs:[...o.openAppTabs,s]}))},closeAppTab:s=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==s);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===s?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:s=>n({activeAppTabId:s}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(s,o)=>{n(a=>{const u={...a.appWorkspaces,[s]:o};try{localStorage.setItem(mu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async s=>{try{return await hx(s),await Xc(r,s),!0}catch(o){return r().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async s=>{try{return await mx(s),await Xc(r,s.id),!0}catch(o){return r().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(s,o)=>{try{return await gx(s,o),await Xc(r,s),!0}catch(a){return r().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async s=>{try{const o=r().lastModelConfig,a=await yx(s,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});r().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await r().selectSession(a.id),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,a.id]})),r().addLogEntry("INFO",`App edit session opened for ${s}`)}catch(o){r().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async s=>{const o=r().apps.find(a=>a.id===s);if(o)try{await xm(s,{pinned:!o.pinned}),await r().loadApps()}catch(a){r().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async s=>{try{await dx(s),n(o=>{const a={...o.appWorkspaces};delete a[s];try{localStorage.setItem(mu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==s),openAppTabs:o.openAppTabs.filter(u=>u!==s),activeAppTabId:o.activeAppTabId===s?null:o.activeAppTabId,appWorkspaces:a}}),r().addToast("success",`Mini app deleted: ${s}`)}catch(o){r().addToast("error",`Failed to delete app — ${o.message}`)}}}),Jp=3e3,Mn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Ln=[];let Ol=0,Fu=0,zl=0,Uu=0,$l=0,Bu=0,Wu=0;const to=new Map,no=new Map;let ti=new Map,Js=0,ni=new Map,Qc=!1;function Fl(n,r,s){if(Ln.push({t:Date.now(),cat:n,msg:r,ms:s}),Ln.length>Jp){const o=Ln.length-Jp;Ln.splice(0,o),Sn=Math.max(0,Sn-o)}}function ei(n,r,s){Fl(n,r,s),console.log(`[perf:${n}] ${r}`)}function wm(n){ei("note",n)}function km(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function kx(n,r){let s=ti.get(n);s||ti.set(n,s={n:0,bytes:0}),s.n++,s.bytes+=r;let o=to.get(n);o||to.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r}function Sx(){Js++,Wu++}function Tx(n){ni.set(n,(ni.get(n)??0)+1),no.set(n,(no.get(n)??0)+1)}let Al=0;function bx(){Al=performance.now()}function Nx(){const n=performance.now(),r=Al?n-Al:null;Al=0,requestAnimationFrame(()=>{if(r===null)return;const s=performance.now()-n+r;s>Mn.keypressMs&&ei("input",`keystroke→paint ${Math.round(s)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Cx=5e3,Sm=500,eh=2e3;let Sn=0,Zc=!1;function Ex(n){return kt("/perf-log",{entries:n}).then(()=>{Sn+=n.length})}function _x(){if(Zc||Sn>=Ln.length)return;const n=Ln.slice(Sn,Sn+Sm);n.length!==0&&(Zc=!0,Ex(n).catch(()=>{Ln.length-Sn>eh&&(Sn=Math.max(Sn,Ln.length-eh))}).finally(()=>{Zc=!1}))}function th(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Sn>=Ln.length)return;const n=Ln.slice(Sn,Sn+Sm);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${fr()}/api/perf-log`,r),Sn+=n.length}catch{}}function jx(){let n=0;for(const o of ti.values())n+=o.n;const r=[];if(n>0){const o=[...ti.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${km(u.bytes)})`).join(", ");r.push(`ws ${n}/s [${o}]`)}Js>0&&r.push(`store ${Js}/s`);const s=[...ni.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(s.length>0&&r.push(`renders ${s.join(" ")}`),r.length>0){const o=r.join(" · ");Fl("stat",o);const a=[...ni.values()].some(u=>u>Mn.renderPerSecLog);(n>Mn.wsPerSecLog||Js>Mn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ti=new Map,Js=0,ni=new Map}function Rx(n){if(n instanceof Element){const r=n.id?`#${n.id}`:"",s=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${r}${s}`}return n?"window":"unknown"}function Ax(){if(Qc||typeof window>"u")return()=>{};Qc=!0,Ol=Date.now();const n=[];let r=performance.now()+250;const s=window.setInterval(()=>{const u=performance.now(),f=u-r;r=u+250,f>Mn.lagMs&&(Fu++,zl=Math.max(zl,f),ei("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(s)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=m=>{const g=m-u;u=m,g>Mn.frameGapMs&&ei("lag",`frame gap ${Math.round(g)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var h;for(const m of f.getEntries()){const g=m.duration;if(g<Mn.longtaskBufferMs)continue;Uu++,$l=Math.max($l,g);const x=(h=m.attribution)==null?void 0:h[0],w=(x==null?void 0:x.containerName)||(x==null?void 0:x.name)||"unknown",y=`long task ${Math.round(g)}ms (${w})`;g>=Mn.longtaskLogMs?ei("longtask",y,g):Fl("longtask",y,g)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const m=h.duration,g=h.processingStart-h.startTime;Bu++;const x=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${Rx(h.target)}`;m>=Mn.eventLogMs?ei("input",x,m):Fl("input",x,m)}});u.observe({type:"event",durationThreshold:Mn.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(jx,1e3);n.push(()=>window.clearInterval(o)),wm("perf logger session started");const a=window.setInterval(_x,Cx);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",th),n.push(()=>window.removeEventListener("beforeunload",th)),window.__agentPanePerf={dump:Tm,reset:bm},()=>{n.forEach(u=>u()),Qc=!1}}function Tm(){const n=[],r=Ol?Math.round((Date.now()-Ol)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${Ln.length} buffered entries`),n.push(`event-loop lag: ${Fu} blocks >${Mn.lagMs}ms (max ${Math.round(zl)}ms)`),n.push(`long tasks: ${Uu} ≥${Mn.longtaskBufferMs}ms (max ${Math.round($l)}ms)`),n.push(`slow input events (≥${Mn.eventBufferMs}ms): ${Bu}`),n.push(`store updates: ${Wu} total`),to.size>0){n.push("ws messages by type (top 15):");for(const[s,o]of[...to.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${s}: ${o.n} msgs, ${km(o.bytes)}`)}if(no.size>0){n.push("render counts by component:");for(const[s,o]of[...no.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${s}: ${o}`)}n.push("--- last 200 entries ---");for(const s of Ln.slice(-200))n.push(`${new Date(s.t).toISOString().slice(11,23)} [${s.cat}] ${s.msg}`);return n.join(`
|
|
49
|
+
`)}function bm(){Ln.length=0,Sn=0,Ol=Date.now(),Fu=0,zl=0,Uu=0,$l=0,Bu=0,Wu=0,to.clear(),no.clear(),ti=new Map,Js=0,ni=new Map}const qt={start:Ax,note:wm,trackWsEvent:kx,trackStoreUpdate:Sx,trackRender:Tx,markKeystroke:bx,markInputChange:Nx,dump:Tm,reset:bm},P=vy()((...n)=>({...Hy(...n),...Vy(...n),...nx(...n),...ax(...n),...cx(...n),...ux(...n),...wx(...n)}));typeof window<"u"&&P.subscribe(()=>qt.trackStoreUpdate());function gu(n){switch(n){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function Ix(n,r){const s=new Date(n).getTime(),o=r?new Date(r).getTime():Date.now(),a=Math.max(0,Math.floor((o-s)/1e3));if(a<60)return`${a}s`;const u=Math.floor(a/60),f=a%60;if(u<60)return`${u}m ${f}s`;const h=Math.floor(u/60),m=u%60;return`${h}h ${m}m`}function Dx(n,r,s=!1,o="working"){if(o==="finished")return"";if(r)return"running";if(s&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Mx(n,r,s=!1,o="working"){if(o==="finished")return"Finished";if(r)return"Running";if(s&&n!=="failed")return"Review Pending";switch(n){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return n}}function Hu(n){const r=n.is_running===1,s=n.lifecycle==="finished",o=gu(n.runtime_type);return{dot:Dx(n.status,r,n.has_unreviewed===1,n.lifecycle),label:Mx(n.status,r,n.has_unreviewed===1,n.lifecycle),iconClass:o.iconClass,iconText:o.iconText,isRunning:r,isFinished:s}}function ea(n,r,s=!0){k.useEffect(()=>{if(!s)return;function o(a){n.current&&!n.current.contains(a.target)&&r()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,r,s])}function Vu(n,r=!0){k.useEffect(()=>{if(!r)return;function s(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r])}function Gu({status:n,size:r=6}){return c.jsx("span",{className:`status-dot ${n}`,style:r!==6?{width:r,height:r}:void 0})}function Nm({iconClass:n,iconText:r,size:s=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:s!==20?{width:s,height:s,fontSize:s*.45}:void 0,children:r})}/**
|
|
50
|
+
* @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 Lx=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cm=(...n)=>n.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).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 Px={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 Ox=k.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},m)=>k.createElement("svg",{ref:m,...Px,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:Cm("lucide",a),...h},[...f.map(([g,x])=>k.createElement(g,x)),...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 ke=(n,r)=>{const s=k.forwardRef(({className:o,...a},u)=>k.createElement(Ox,{ref:u,iconNode:r,className:Cm(`lucide-${Lx(n)}`,o),...a}));return s.displayName=`${n}`,s};/**
|
|
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 zx=ke("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 vu=ke("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
80
|
+
* @license lucide-react v0.469.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const $x=ke("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
85
|
+
* @license lucide-react v0.469.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const Zr=ke("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
90
|
+
* @license lucide-react v0.469.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const ro=ke("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
95
|
+
* @license lucide-react v0.469.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const qu=ke("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
100
|
+
* @license lucide-react v0.469.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const Ku=ke("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
105
|
+
* @license lucide-react v0.469.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const Fx=ke("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
110
|
+
* @license lucide-react v0.469.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const Yu=ke("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
115
|
+
* @license lucide-react v0.469.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const Ux=ke("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
120
|
+
* @license lucide-react v0.469.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const Bx=ke("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
125
|
+
* @license lucide-react v0.469.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const Wx=ke("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
130
|
+
* @license lucide-react v0.469.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const Em=ke("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
135
|
+
* @license lucide-react v0.469.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const nh=ke("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
140
|
+
* @license lucide-react v0.469.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const yu=ke("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
145
|
+
* @license lucide-react v0.469.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const Hx=ke("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
150
|
+
* @license lucide-react v0.469.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const Vx=ke("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
155
|
+
* @license lucide-react v0.469.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const Gx=ke("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
160
|
+
* @license lucide-react v0.469.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const _m=ke("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
165
|
+
* @license lucide-react v0.469.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const Jc=ke("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
170
|
+
* @license lucide-react v0.469.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const xu=ke("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
175
|
+
* @license lucide-react v0.469.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const qx=ke("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
180
|
+
* @license lucide-react v0.469.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const Kx=ke("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
185
|
+
* @license lucide-react v0.469.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const Yx=ke("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
190
|
+
* @license lucide-react v0.469.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const Xx=ke("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"}]]);/**
|
|
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 Qx=ke("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"}]]);/**
|
|
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 Zx=ke("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"}]]);/**
|
|
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 nr=ke("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 Jx=ke("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"}]]);/**
|
|
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 e0=ke("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"}]]);/**
|
|
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 t0=ke("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"}]]);/**
|
|
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 n0=ke("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"}]]);/**
|
|
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 rh=ke("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"}]]);/**
|
|
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 r0=ke("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
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 s0=ke("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"}]]);/**
|
|
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 Il=ke("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"}]]);/**
|
|
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 i0=ke("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"}]]);/**
|
|
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 o0=ke("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"}]]);/**
|
|
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 ys=ke("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 jm=ke("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"}]]);/**
|
|
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 l0=ke("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"}]]);/**
|
|
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 ta=ke("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"}]]);/**
|
|
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 Rm=ke("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"}]]);/**
|
|
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 a0=ke("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 na=ke("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"}]]);/**
|
|
295
|
+
* @license lucide-react v0.469.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const c0=ke("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"}]]);/**
|
|
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 lo=ke("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 Ul=ke("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"}]]);/**
|
|
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 Am=ke("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 Nr=ke("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"}]]);/**
|
|
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 u0=ke("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"}]]);/**
|
|
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 d0=ke("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"}]]);/**
|
|
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 f0=ke("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"}]]);/**
|
|
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 p0=ke("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"}]]);/**
|
|
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 h0=ke("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"}]]);/**
|
|
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 Gn=ke("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 m0=ke("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var Ki=am();function g0(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return k.useMemo(()=>o=>{r.forEach(a=>a(o))},r)}const ra=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function oi(n){const r=Object.prototype.toString.call(n);return r==="[object Window]"||r==="[object global]"}function Xu(n){return"nodeType"in n}function dn(n){var r,s;return n?oi(n)?n:Xu(n)&&(r=(s=n.ownerDocument)==null?void 0:s.defaultView)!=null?r:window:window}function Qu(n){const{Document:r}=dn(n);return n instanceof r}function ao(n){return oi(n)?!1:n instanceof dn(n).HTMLElement}function Im(n){return n instanceof dn(n).SVGElement}function li(n){return n?oi(n)?n.document:Xu(n)?Qu(n)?n:ao(n)||Im(n)?n.ownerDocument:document:document:document}const rr=ra?k.useLayoutEffect:k.useEffect;function sa(n){const r=k.useRef(n);return rr(()=>{r.current=n}),k.useCallback(function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r.current==null?void 0:r.current(...o)},[])}function v0(){const n=k.useRef(null),r=k.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),s=k.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[r,s]}function so(n,r){r===void 0&&(r=[n]);const s=k.useRef(n);return rr(()=>{s.current!==n&&(s.current=n)},r),s}function co(n,r){const s=k.useRef();return k.useMemo(()=>{const o=n(s.current);return s.current=o,o},[...r])}function Bl(n){const r=sa(n),s=k.useRef(null),o=k.useCallback(a=>{a!==s.current&&(r==null||r(a,s.current)),s.current=a},[]);return[s,o]}function Wl(n){const r=k.useRef();return k.useEffect(()=>{r.current=n},[n]),r.current}let eu={};function uo(n,r){return k.useMemo(()=>{if(r)return r;const s=eu[n]==null?0:eu[n]+1;return eu[n]=s,n+"-"+s},[n,r])}function Dm(n){return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const h=Object.entries(f);for(const[m,g]of h){const x=u[m];x!=null&&(u[m]=x+n*g)}return u},{...r})}}const ri=Dm(1),Hl=Dm(-1);function y0(n){return"clientX"in n&&"clientY"in n}function ia(n){if(!n)return!1;const{KeyboardEvent:r}=dn(n.target);return r&&n instanceof r}function x0(n){if(!n)return!1;const{TouchEvent:r}=dn(n.target);return r&&n instanceof r}function Vl(n){if(x0(n)){if(n.touches&&n.touches.length){const{clientX:r,clientY:s}=n.touches[0];return{x:r,y:s}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:r,clientY:s}=n.changedTouches[0];return{x:r,y:s}}}return y0(n)?{x:n.clientX,y:n.clientY}:null}const _r=Object.freeze({Translate:{toString(n){if(!n)return;const{x:r,y:s}=n;return"translate3d("+(r?Math.round(r):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:r,scaleY:s}=n;return"scaleX("+r+") scaleY("+s+")"}},Transform:{toString(n){if(n)return[_r.Translate.toString(n),_r.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:r,duration:s,easing:o}=n;return r+" "+s+"ms "+o}}}),sh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function w0(n){return n.matches(sh)?n:n.querySelector(sh)}const k0={display:"none"};function S0(n){let{id:r,value:s}=n;return et.createElement("div",{id:r,style:k0},s)}function T0(n){let{id:r,announcement:s,ariaLiveType:o="assertive"}=n;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return et.createElement("div",{id:r,style:a,role:"status","aria-live":o,"aria-atomic":!0},s)}function b0(){const[n,r]=k.useState("");return{announce:k.useCallback(o=>{o!=null&&r(o)},[]),announcement:n}}const Mm=k.createContext(null);function N0(n){const r=k.useContext(Mm);k.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(n)},[n,r])}function C0(){const[n]=k.useState(()=>new Set),r=k.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[k.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[n]),r]}const E0={draggable:`
|
|
355
|
+
To pick up a draggable item, press the space bar.
|
|
356
|
+
While dragging, use the arrow keys to move the item.
|
|
357
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
358
|
+
`},_0={onDragStart(n){let{active:r}=n;return"Picked up draggable item "+r.id+"."},onDragOver(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was moved over droppable area "+s.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was dropped over droppable area "+s.id:"Draggable item "+r.id+" was dropped."},onDragCancel(n){let{active:r}=n;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function j0(n){let{announcements:r=_0,container:s,hiddenTextDescribedById:o,screenReaderInstructions:a=E0}=n;const{announce:u,announcement:f}=b0(),h=uo("DndLiveRegion"),[m,g]=k.useState(!1);if(k.useEffect(()=>{g(!0)},[]),N0(k.useMemo(()=>({onDragStart(w){let{active:y}=w;u(r.onDragStart({active:y}))},onDragMove(w){let{active:y,over:T}=w;r.onDragMove&&u(r.onDragMove({active:y,over:T}))},onDragOver(w){let{active:y,over:T}=w;u(r.onDragOver({active:y,over:T}))},onDragEnd(w){let{active:y,over:T}=w;u(r.onDragEnd({active:y,over:T}))},onDragCancel(w){let{active:y,over:T}=w;u(r.onDragCancel({active:y,over:T}))}}),[u,r])),!m)return null;const x=et.createElement(et.Fragment,null,et.createElement(S0,{id:o,value:a.draggable}),et.createElement(T0,{id:h,announcement:f}));return s?Ki.createPortal(x,s):x}var Dt;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Dt||(Dt={}));function Gl(){}function R0(n,r){return k.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function A0(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return k.useMemo(()=>[...r].filter(o=>o!=null),[...r])}const sr=Object.freeze({x:0,y:0});function I0(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function D0(n,r){const s=Vl(n);if(!s)return"0 0";const o={x:(s.x-r.left)/r.width*100,y:(s.y-r.top)/r.height*100};return o.x+"% "+o.y+"%"}function M0(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return s-o}function L0(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return o-s}function P0(n,r){if(!n||n.length===0)return null;const[s]=n;return s[r]}function ih(n,r,s){return r===void 0&&(r=n.left),s===void 0&&(s=n.top),{x:r+n.width*.5,y:s+n.height*.5}}const O0=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=ih(r,r.left,r.top),u=[];for(const f of o){const{id:h}=f,m=s.get(h);if(m){const g=I0(ih(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(M0)};function z0(n,r){const s=Math.max(r.top,n.top),o=Math.max(r.left,n.left),a=Math.min(r.left+r.width,n.left+n.width),u=Math.min(r.top+r.height,n.top+n.height),f=a-o,h=u-s;if(o<a&&s<u){const m=r.width*r.height,g=n.width*n.height,x=f*h,w=x/(m+g-x);return Number(w.toFixed(4))}return 0}const $0=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=s.get(f);if(h){const m=z0(h,r);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(L0)};function F0(n,r,s){return{...n,scaleX:r&&s?r.width/s.width:1,scaleY:r&&s?r.height/s.height:1}}function Lm(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:sr}function U0(n){return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];return a.reduce((f,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...s})}}const B0=U0(1);function Pm(n){if(n.startsWith("matrix3d(")){const r=n.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(n.startsWith("matrix(")){const r=n.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function W0(n,r,s){const o=Pm(r);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(s),g=n.top-h-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),x=a?n.width/a:n.width,w=u?n.height/u:n.height;return{width:x,height:w,top:g,right:m+x,bottom:g+w,left:m}}const H0={ignoreTransform:!1};function ai(n,r){r===void 0&&(r=H0);let s=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:g,transformOrigin:x}=dn(n).getComputedStyle(n);g&&(s=W0(s,g,x))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=s;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function oh(n){return ai(n,{ignoreTransform:!0})}function V0(n){const r=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}function G0(n,r){return r===void 0&&(r=dn(n).getComputedStyle(n)),r.position==="fixed"}function q0(n,r){r===void 0&&(r=dn(n).getComputedStyle(n));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=r[a];return typeof u=="string"?s.test(u):!1})}function Zu(n,r){const s=[];function o(a){if(r!=null&&s.length>=r||!a)return s;if(Qu(a)&&a.scrollingElement!=null&&!s.includes(a.scrollingElement))return s.push(a.scrollingElement),s;if(!ao(a)||Im(a)||s.includes(a))return s;const u=dn(n).getComputedStyle(a);return a!==n&&q0(a,u)&&s.push(a),G0(a,u)?s:o(a.parentNode)}return n?o(n):s}function Om(n){const[r]=Zu(n,1);return r??null}function tu(n){return!ra||!n?null:oi(n)?n:Xu(n)?Qu(n)||n===li(n).scrollingElement?window:ao(n)?n:null:null}function zm(n){return oi(n)?n.scrollX:n.scrollLeft}function $m(n){return oi(n)?n.scrollY:n.scrollTop}function wu(n){return{x:zm(n),y:$m(n)}}var Bt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Bt||(Bt={}));function Fm(n){return!ra||!n?!1:n===document.scrollingElement}function Um(n){const r={x:0,y:0},s=Fm(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-s.width,y:n.scrollHeight-s.height},a=n.scrollTop<=r.y,u=n.scrollLeft<=r.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:r}}const K0={x:.2,y:.2};function Y0(n,r,s,o,a){let{top:u,left:f,right:h,bottom:m}=s;o===void 0&&(o=10),a===void 0&&(a=K0);const{isTop:g,isBottom:x,isLeft:w,isRight:y}=Um(n),T={x:0,y:0},j={x:0,y:0},C={height:r.height*a.y,width:r.width*a.x};return!g&&u<=r.top+C.height?(T.y=Bt.Backward,j.y=o*Math.abs((r.top+C.height-u)/C.height)):!x&&m>=r.bottom-C.height&&(T.y=Bt.Forward,j.y=o*Math.abs((r.bottom-C.height-m)/C.height)),!y&&h>=r.right-C.width?(T.x=Bt.Forward,j.x=o*Math.abs((r.right-C.width-h)/C.width)):!w&&f<=r.left+C.width&&(T.x=Bt.Backward,j.x=o*Math.abs((r.left+C.width-f)/C.width)),{direction:T,speed:j}}function X0(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:r,left:s,right:o,bottom:a}=n.getBoundingClientRect();return{top:r,left:s,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function Bm(n){return n.reduce((r,s)=>ri(r,wu(s)),sr)}function Q0(n){return n.reduce((r,s)=>r+zm(s),0)}function Z0(n){return n.reduce((r,s)=>r+$m(s),0)}function Wm(n,r){if(r===void 0&&(r=ai),!n)return;const{top:s,left:o,bottom:a,right:u}=r(n);Om(n)&&(a<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const J0=[["x",["left","right"],Q0],["y",["top","bottom"],Z0]];class Ju{constructor(r,s){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Zu(s),a=Bm(o);this.rect={...r},this.width=r.width,this.height=r.height;for(const[u,f,h]of J0)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=h(o),x=a[u]-g;return this.rect[m]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xi{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...s)})},this.target=r}add(r,s,o){var a;(a=this.target)==null||a.addEventListener(r,s,o),this.listeners.push([r,s,o])}}function ew(n){const{EventTarget:r}=dn(n);return n instanceof r?n:li(n)}function nu(n,r){const s=Math.abs(n.x),o=Math.abs(n.y);return typeof r=="number"?Math.sqrt(s**2+o**2)>r:"x"in r&&"y"in r?s>r.x&&o>r.y:"x"in r?s>r.x:"y"in r?o>r.y:!1}var Vn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Vn||(Vn={}));function lh(n){n.preventDefault()}function tw(n){n.stopPropagation()}var Qe;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Qe||(Qe={}));const Hm={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},nw=(n,r)=>{let{currentCoordinates:s}=r;switch(n.code){case Qe.Right:return{...s,x:s.x+25};case Qe.Left:return{...s,x:s.x-25};case Qe.Down:return{...s,y:s.y+25};case Qe.Up:return{...s,y:s.y-25}}};class Vm{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;const{event:{target:s}}=r;this.props=r,this.listeners=new Xi(li(s)),this.windowListeners=new Xi(dn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Vn.Resize,this.handleCancel),this.windowListeners.add(Vn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Vn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:s}=this.props,o=r.node.current;o&&Wm(o),s(sr)}handleKeyDown(r){if(ia(r)){const{active:s,context:o,options:a}=this.props,{keyboardCodes:u=Hm,coordinateGetter:f=nw,scrollBehavior:h="smooth"}=a,{code:m}=r;if(u.end.includes(m)){this.handleEnd(r);return}if(u.cancel.includes(m)){this.handleCancel(r);return}const{collisionRect:g}=o.current,x=g?{x:g.left,y:g.top}:sr;this.referenceCoordinates||(this.referenceCoordinates=x);const w=f(r,{active:s,context:o.current,currentCoordinates:x});if(w){const y=Hl(w,x),T={x:0,y:0},{scrollableAncestors:j}=o.current;for(const C of j){const b=r.code,{isTop:D,isRight:A,isLeft:U,isBottom:L,maxScroll:H,minScroll:X}=Um(C),K=X0(C),q={x:Math.min(b===Qe.Right?K.right-K.width/2:K.right,Math.max(b===Qe.Right?K.left:K.left+K.width/2,w.x)),y:Math.min(b===Qe.Down?K.bottom-K.height/2:K.bottom,Math.max(b===Qe.Down?K.top:K.top+K.height/2,w.y))},ie=b===Qe.Right&&!A||b===Qe.Left&&!U,fe=b===Qe.Down&&!L||b===Qe.Up&&!D;if(ie&&q.x!==w.x){const ce=C.scrollLeft+y.x,Le=b===Qe.Right&&ce<=H.x||b===Qe.Left&&ce>=X.x;if(Le&&!y.y){C.scrollTo({left:ce,behavior:h});return}Le?T.x=C.scrollLeft-ce:T.x=b===Qe.Right?C.scrollLeft-H.x:C.scrollLeft-X.x,T.x&&C.scrollBy({left:-T.x,behavior:h});break}else if(fe&&q.y!==w.y){const ce=C.scrollTop+y.y,Le=b===Qe.Down&&ce<=H.y||b===Qe.Up&&ce>=X.y;if(Le&&!y.x){C.scrollTo({top:ce,behavior:h});return}Le?T.y=C.scrollTop-ce:T.y=b===Qe.Down?C.scrollTop-H.y:C.scrollTop-X.y,T.y&&C.scrollBy({top:-T.y,behavior:h});break}}this.handleMove(r,ri(Hl(w,this.referenceCoordinates),T))}}}handleMove(r,s){const{onMove:o}=this.props;r.preventDefault(),o(s)}handleEnd(r){const{onEnd:s}=this.props;r.preventDefault(),this.detach(),s()}handleCancel(r){const{onCancel:s}=this.props;r.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Vm.activators=[{eventName:"onKeyDown",handler:(n,r,s)=>{let{keyboardCodes:o=Hm,onActivation:a}=r,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function ah(n){return!!(n&&"distance"in n)}function ch(n){return!!(n&&"delay"in n)}class ed{constructor(r,s,o){var a;o===void 0&&(o=ew(r.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=r,this.events=s;const{event:u}=r,{target:f}=u;this.props=r,this.events=s,this.document=li(f),this.documentListeners=new Xi(this.document),this.listeners=new Xi(o),this.windowListeners=new Xi(dn(f)),this.initialCoordinates=(a=Vl(u))!=null?a:sr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:r,props:{options:{activationConstraint:s,bypassActivationConstraint:o}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(Vn.Resize,this.handleCancel),this.windowListeners.add(Vn.DragStart,lh),this.windowListeners.add(Vn.VisibilityChange,this.handleCancel),this.windowListeners.add(Vn.ContextMenu,lh),this.documentListeners.add(Vn.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ch(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(ah(s)){this.handlePending(s);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(r,s){const{active:o,onPending:a}=this.props;a(o,r,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:r}=this,{onStart:s}=this.props;r&&(this.activated=!0,this.documentListeners.add(Vn.Click,tw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Vn.SelectionChange,this.removeTextSelection),s(r))}handleMove(r){var s;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(s=Vl(r))!=null?s:sr,g=Hl(a,m);if(!o&&h){if(ah(h)){if(h.tolerance!=null&&nu(g,h.tolerance))return this.handleCancel();if(nu(g,h.distance))return this.handleStart()}if(ch(h)&&nu(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}r.cancelable&&r.preventDefault(),f(m)}handleEnd(){const{onAbort:r,onEnd:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleCancel(){const{onAbort:r,onCancel:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleKeydown(r){r.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const rw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class td extends ed{constructor(r){const{event:s}=r,o=li(s.target);super(r,rw,o)}}td.activators=[{eventName:"onPointerDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return!s.isPrimary||s.button!==0?!1:(o==null||o({event:s}),!0)}}];const sw={move:{name:"mousemove"},end:{name:"mouseup"}};var ku;(function(n){n[n.RightClick=2]="RightClick"})(ku||(ku={}));class iw extends ed{constructor(r){super(r,sw,li(r.event.target))}}iw.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return s.button===ku.RightClick?!1:(o==null||o({event:s}),!0)}}];const ru={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ow extends ed{constructor(r){super(r,ru)}static setup(){return window.addEventListener(ru.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(ru.move.name,r)};function r(){}}}ow.activators=[{eventName:"onTouchStart",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;const{touches:a}=s;return a.length>1?!1:(o==null||o({event:s}),!0)}}];var Qi;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Qi||(Qi={}));var ql;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(ql||(ql={}));function lw(n){let{acceleration:r,activator:s=Qi.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=ql.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:x,delta:w,threshold:y}=n;const T=cw({delta:w,disabled:!u}),[j,C]=v0(),b=k.useRef({x:0,y:0}),D=k.useRef({x:0,y:0}),A=k.useMemo(()=>{switch(s){case Qi.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case Qi.DraggableRect:return a}},[s,a,m]),U=k.useRef(null),L=k.useCallback(()=>{const X=U.current;if(!X)return;const K=b.current.x*D.current.x,q=b.current.y*D.current.y;X.scrollBy(K,q)},[]),H=k.useMemo(()=>h===ql.TreeOrder?[...g].reverse():g,[h,g]);k.useEffect(()=>{if(!u||!g.length||!A){C();return}for(const X of H){if((o==null?void 0:o(X))===!1)continue;const K=g.indexOf(X),q=x[K];if(!q)continue;const{direction:ie,speed:fe}=Y0(X,q,A,r,y);for(const ce of["x","y"])T[ce][ie[ce]]||(fe[ce]=0,ie[ce]=0);if(fe.x>0||fe.y>0){C(),U.current=X,j(L,f),b.current=fe,D.current=ie;return}}b.current={x:0,y:0},D.current={x:0,y:0},C()},[r,L,o,C,u,f,JSON.stringify(A),JSON.stringify(T),j,g,H,x,JSON.stringify(y)])}const aw={x:{[Bt.Backward]:!1,[Bt.Forward]:!1},y:{[Bt.Backward]:!1,[Bt.Forward]:!1}};function cw(n){let{delta:r,disabled:s}=n;const o=Wl(r);return co(a=>{if(s||!o||!a)return aw;const u={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Bt.Backward]:a.x[Bt.Backward]||u.x===-1,[Bt.Forward]:a.x[Bt.Forward]||u.x===1},y:{[Bt.Backward]:a.y[Bt.Backward]||u.y===-1,[Bt.Forward]:a.y[Bt.Forward]||u.y===1}}},[s,r,o])}function uw(n,r){const s=r!=null?n.get(r):void 0,o=s?s.node.current:null;return co(a=>{var u;return r==null?null:(u=o??a)!=null?u:null},[o,r])}function dw(n,r){return k.useMemo(()=>n.reduce((s,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:r(f.handler,o)}));return[...s,...u]},[]),[n,r])}var io;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(io||(io={}));var Su;(function(n){n.Optimized="optimized"})(Su||(Su={}));const uh=new Map;function fw(n,r){let{dragging:s,dependencies:o,config:a}=r;const[u,f]=k.useState(null),{frequency:h,measure:m,strategy:g}=a,x=k.useRef(n),w=b(),y=so(w),T=k.useCallback(function(D){D===void 0&&(D=[]),!y.current&&f(A=>A===null?D:A.concat(D.filter(U=>!A.includes(U))))},[y]),j=k.useRef(null),C=co(D=>{if(w&&!s)return uh;if(!D||D===uh||x.current!==n||u!=null){const A=new Map;for(let U of n){if(!U)continue;if(u&&u.length>0&&!u.includes(U.id)&&U.rect.current){A.set(U.id,U.rect.current);continue}const L=U.node.current,H=L?new Ju(m(L),L):null;U.rect.current=H,H&&A.set(U.id,H)}return A}return D},[n,u,s,w,m]);return k.useEffect(()=>{x.current=n},[n]),k.useEffect(()=>{w||T()},[s,w]),k.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),k.useEffect(()=>{w||typeof h!="number"||j.current!==null||(j.current=setTimeout(()=>{T(),j.current=null},h))},[h,w,T,...o]),{droppableRects:C,measureDroppableContainers:T,measuringScheduled:u!=null};function b(){switch(g){case io.Always:return!1;case io.BeforeDragging:return s;default:return!s}}}function nd(n,r){return co(s=>n?s||(typeof r=="function"?r(n):n):null,[r,n])}function pw(n,r){return nd(n,r)}function hw(n){let{callback:r,disabled:s}=n;const o=sa(r),a=k.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return k.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function oa(n){let{callback:r,disabled:s}=n;const o=sa(r),a=k.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return k.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function mw(n){return new Ju(ai(n),n)}function dh(n,r,s){r===void 0&&(r=mw);const[o,a]=k.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??s)!=null?g:null}const x=r(n);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const f=hw({callback(m){if(n)for(const g of m){const{type:x,target:w}=g;if(x==="childList"&&w instanceof HTMLElement&&w.contains(n)){u();break}}}}),h=oa({callback:u});return rr(()=>{u(),n?(h==null||h.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),f==null||f.disconnect())},[n]),o}function gw(n){const r=nd(n);return Lm(n,r)}const fh=[];function vw(n){const r=k.useRef(n),s=co(o=>n?o&&o!==fh&&n&&r.current&&n.parentNode===r.current.parentNode?o:Zu(n):fh,[n]);return k.useEffect(()=>{r.current=n},[n]),s}function yw(n){const[r,s]=k.useState(null),o=k.useRef(n),a=k.useCallback(u=>{const f=tu(u.target);f&&s(h=>h?(h.set(f,wu(f)),new Map(h)):null)},[]);return k.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=tu(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,wu(g)]):null}).filter(m=>m!=null);s(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=tu(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),k.useMemo(()=>n.length?r?Array.from(r.values()).reduce((u,f)=>ri(u,f),sr):Bm(n):sr,[n,r])}function ph(n,r){r===void 0&&(r=[]);const s=k.useRef(null);return k.useEffect(()=>{s.current=null},r),k.useEffect(()=>{const o=n!==sr;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?Hl(n,s.current):sr}function xw(n){k.useEffect(()=>{if(!ra)return;const r=n.map(s=>{let{sensor:o}=s;return o.setup==null?void 0:o.setup()});return()=>{for(const s of r)s==null||s()}},n.map(r=>{let{sensor:s}=r;return s}))}function ww(n,r){return k.useMemo(()=>n.reduce((s,o)=>{let{eventName:a,handler:u}=o;return s[a]=f=>{u(f,r)},s},{}),[n,r])}function Gm(n){return k.useMemo(()=>n?V0(n):null,[n])}const hh=[];function kw(n,r){r===void 0&&(r=ai);const[s]=n,o=Gm(s?dn(s):null),[a,u]=k.useState(hh);function f(){u(()=>n.length?n.map(m=>Fm(m)?o:new Ju(r(m),m)):hh)}const h=oa({callback:f});return rr(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function qm(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return ao(r)?r:n}function Sw(n){let{measure:r}=n;const[s,o]=k.useState(null),a=k.useCallback(g=>{for(const{target:x}of g)if(ao(x)){o(w=>{const y=r(x);return w?{...w,width:y.width,height:y.height}:y});break}},[r]),u=oa({callback:a}),f=k.useCallback(g=>{const x=qm(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?r(x):null)},[r,u]),[h,m]=Bl(f);return k.useMemo(()=>({nodeRef:h,rect:s,setRef:m}),[s,h,m])}const Tw=[{sensor:td,options:{}},{sensor:Vm,options:{}}],bw={current:{}},Dl={draggable:{measure:oh},droppable:{measure:oh,strategy:io.WhileDragging,frequency:Su.Optimized},dragOverlay:{measure:ai}};class Zi extends Map{get(r){var s;return r!=null&&(s=super.get(r))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:s}=r;return!s})}getNodeFor(r){var s,o;return(s=(o=this.get(r))==null?void 0:o.node.current)!=null?s:void 0}}const Nw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Gl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Dl,measureDroppableContainers:Gl,windowRect:null,measuringScheduled:!1},Km={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Gl,draggableNodes:new Map,over:null,measureDroppableContainers:Gl},fo=k.createContext(Km),Ym=k.createContext(Nw);function Cw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zi}}}function Ew(n,r){switch(r.type){case Dt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Dt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:r.coordinates.x-n.draggable.initialCoordinates.x,y:r.coordinates.y-n.draggable.initialCoordinates.y}}};case Dt.DragEnd:case Dt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Dt.RegisterDroppable:{const{element:s}=r,{id:o}=s,a=new Zi(n.droppable.containers);return a.set(o,s),{...n,droppable:{...n.droppable,containers:a}}}case Dt.SetDroppableDisabled:{const{id:s,key:o,disabled:a}=r,u=n.droppable.containers.get(s);if(!u||o!==u.key)return n;const f=new Zi(n.droppable.containers);return f.set(s,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Dt.UnregisterDroppable:{const{id:s,key:o}=r,a=n.droppable.containers.get(s);if(!a||o!==a.key)return n;const u=new Zi(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function _w(n){let{disabled:r}=n;const{active:s,activatorEvent:o,draggableNodes:a}=k.useContext(fo),u=Wl(o),f=Wl(s==null?void 0:s.id);return k.useEffect(()=>{if(!r&&!o&&u&&f!=null){if(!ia(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:m,node:g}=h;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[m.current,g.current]){if(!x)continue;const w=w0(x);if(w){w.focus();break}}})}},[o,r,a,f,u]),null}function Xm(n,r){let{transform:s,...o}=r;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),s):s}function jw(n){return k.useMemo(()=>({draggable:{...Dl.draggable,...n==null?void 0:n.draggable},droppable:{...Dl.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Dl.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function Rw(n){let{activeNode:r,measure:s,initialRect:o,config:a=!0}=n;const u=k.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;rr(()=>{if(!f&&!h||!r){u.current=!1;return}if(u.current||!o)return;const g=r==null?void 0:r.node.current;if(!g||g.isConnected===!1)return;const x=s(g),w=Lm(x,o);if(f||(w.x=0),h||(w.y=0),u.current=!0,Math.abs(w.x)>0||Math.abs(w.y)>0){const y=Om(g);y&&y.scrollBy({top:w.y,left:w.x})}},[r,f,h,o,s])}const la=k.createContext({...sr,scaleX:1,scaleY:1});var Xr;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Xr||(Xr={}));const Aw=k.memo(function(r){var s,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:x=Tw,collisionDetection:w=$0,measuring:y,modifiers:T,...j}=r;const C=k.useReducer(Ew,void 0,Cw),[b,D]=C,[A,U]=C0(),[L,H]=k.useState(Xr.Uninitialized),X=L===Xr.Initialized,{draggable:{active:K,nodes:q,translate:ie},droppable:{containers:fe}}=b,ce=K!=null?q.get(K):null,Le=k.useRef({initial:null,translated:null}),Re=k.useMemo(()=>{var it;return K!=null?{id:K,data:(it=ce==null?void 0:ce.data)!=null?it:bw,rect:Le}:null},[K,ce]),Oe=k.useRef(null),[G,Y]=k.useState(null),[te,z]=k.useState(null),Q=so(j,Object.values(j)),V=uo("DndDescribedBy",f),E=k.useMemo(()=>fe.getEnabled(),[fe]),I=jw(y),{droppableRects:le,measureDroppableContainers:ae,measuringScheduled:he}=fw(E,{dragging:X,dependencies:[ie.x,ie.y],config:I.droppable}),ye=uw(q,K),_e=k.useMemo(()=>te?Vl(te):null,[te]),Se=On(),Ae=pw(ye,I.draggable.measure);Rw({activeNode:K!=null?q.get(K):null,config:Se.layoutShiftCompensation,initialRect:Ae,measure:I.draggable.measure});const be=dh(ye,I.draggable.measure,Ae),lt=dh(ye?ye.parentElement:null),je=k.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:q,draggingNode:null,draggingNodeRect:null,droppableContainers:fe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),St=fe.getNodeFor((s=je.current.over)==null?void 0:s.id),Pe=Sw({measure:I.dragOverlay.measure}),Mt=(o=Pe.nodeRef.current)!=null?o:ye,$e=X?(a=Pe.rect)!=null?a:be:null,Yt=!!(Pe.nodeRef.current&&Pe.rect),bn=gw(Yt?null:be),pt=Gm(Mt?dn(Mt):null),xt=vw(X?St??ye:null),W=kw(xt),Ie=Xm(T,{transform:{x:ie.x-bn.x,y:ie.y-bn.y,scaleX:1,scaleY:1},activatorEvent:te,active:Re,activeNodeRect:be,containerNodeRect:lt,draggingNodeRect:$e,over:je.current.over,overlayNodeRect:Pe.rect,scrollableAncestors:xt,scrollableAncestorRects:W,windowRect:pt}),M=_e?ri(_e,ie):null,oe=yw(xt),Ne=ph(oe),ue=ph(oe,[be]),ze=ri(Ie,Ne),Fe=$e?B0($e,Ie):null,Je=Re&&Fe?w({active:Re,collisionRect:Fe,droppableRects:le,droppableContainers:E,pointerCoordinates:M}):null,dt=P0(Je,"id"),[tt,fn]=k.useState(null),Nn=Yt?Ie:ri(Ie,ue),pn=F0(Nn,(u=tt==null?void 0:tt.rect)!=null?u:null,be),Cn=k.useRef(null),Be=k.useCallback((it,Rt)=>{let{sensor:Ct,options:hn}=Rt;if(Oe.current==null)return;const Et=q.get(Oe.current);if(!Et)return;const Tt=it.nativeEvent,at=new Ct({active:Oe.current,activeNode:Et,event:Tt,options:hn,context:je,onAbort(rt){if(!q.get(rt))return;const{onDragAbort:Pt}=Q.current,mn={id:rt};Pt==null||Pt(mn),A({type:"onDragAbort",event:mn})},onPending(rt,Zt,Pt,mn){if(!q.get(rt))return;const{onDragPending:En}=Q.current,Wt={id:rt,constraint:Zt,initialCoordinates:Pt,offset:mn};En==null||En(Wt),A({type:"onDragPending",event:Wt})},onStart(rt){const Zt=Oe.current;if(Zt==null)return;const Pt=q.get(Zt);if(!Pt)return;const{onDragStart:mn}=Q.current,sn={activatorEvent:Tt,active:{id:Zt,data:Pt.data,rect:Le}};Ki.unstable_batchedUpdates(()=>{mn==null||mn(sn),H(Xr.Initializing),D({type:Dt.DragStart,initialCoordinates:rt,active:Zt}),A({type:"onDragStart",event:sn}),Y(Cn.current),z(Tt)})},onMove(rt){D({type:Dt.DragMove,coordinates:rt})},onEnd:Qt(Dt.DragEnd),onCancel:Qt(Dt.DragCancel)});Cn.current=at;function Qt(rt){return async function(){const{active:Pt,collisions:mn,over:sn,scrollAdjustedTranslate:En}=je.current;let Wt=null;if(Pt&&En){const{cancelDrop:qn}=Q.current;Wt={activatorEvent:Tt,active:Pt,collisions:mn,delta:En,over:sn},rt===Dt.DragEnd&&typeof qn=="function"&&await Promise.resolve(qn(Wt))&&(rt=Dt.DragCancel)}Oe.current=null,Ki.unstable_batchedUpdates(()=>{D({type:rt}),H(Xr.Uninitialized),fn(null),Y(null),z(null),Cn.current=null;const qn=rt===Dt.DragEnd?"onDragEnd":"onDragCancel";if(Wt){const Kn=Q.current[qn];Kn==null||Kn(Wt),A({type:qn,event:Wt})}})}}},[q]),nt=k.useCallback((it,Rt)=>(Ct,hn)=>{const Et=Ct.nativeEvent,Tt=q.get(hn);if(Oe.current!==null||!Tt||Et.dndKit||Et.defaultPrevented)return;const at={active:Tt};it(Ct,Rt.options,at)===!0&&(Et.dndKit={capturedBy:Rt.sensor},Oe.current=hn,Be(Ct,Rt))},[q,Be]),Lt=dw(x,nt);xw(x),rr(()=>{be&&L===Xr.Initializing&&H(Xr.Initialized)},[be,L]),k.useEffect(()=>{const{onDragMove:it}=Q.current,{active:Rt,activatorEvent:Ct,collisions:hn,over:Et}=je.current;if(!Rt||!Ct)return;const Tt={active:Rt,activatorEvent:Ct,collisions:hn,delta:{x:ze.x,y:ze.y},over:Et};Ki.unstable_batchedUpdates(()=>{it==null||it(Tt),A({type:"onDragMove",event:Tt})})},[ze.x,ze.y]),k.useEffect(()=>{const{active:it,activatorEvent:Rt,collisions:Ct,droppableContainers:hn,scrollAdjustedTranslate:Et}=je.current;if(!it||Oe.current==null||!Rt||!Et)return;const{onDragOver:Tt}=Q.current,at=hn.get(dt),Qt=at&&at.rect.current?{id:at.id,rect:at.rect.current,data:at.data,disabled:at.disabled}:null,rt={active:it,activatorEvent:Rt,collisions:Ct,delta:{x:Et.x,y:Et.y},over:Qt};Ki.unstable_batchedUpdates(()=>{fn(Qt),Tt==null||Tt(rt),A({type:"onDragOver",event:rt})})},[dt]),rr(()=>{je.current={activatorEvent:te,active:Re,activeNode:ye,collisionRect:Fe,collisions:Je,droppableRects:le,draggableNodes:q,draggingNode:Mt,draggingNodeRect:$e,droppableContainers:fe,over:tt,scrollableAncestors:xt,scrollAdjustedTranslate:ze},Le.current={initial:$e,translated:Fe}},[Re,ye,Je,Fe,q,Mt,$e,le,fe,tt,xt,ze]),lw({...Se,delta:ie,draggingRect:Fe,pointerCoordinates:M,scrollableAncestors:xt,scrollableAncestorRects:W});const Pn=k.useMemo(()=>({active:Re,activeNode:ye,activeNodeRect:be,activatorEvent:te,collisions:Je,containerNodeRect:lt,dragOverlay:Pe,draggableNodes:q,droppableContainers:fe,droppableRects:le,over:tt,measureDroppableContainers:ae,scrollableAncestors:xt,scrollableAncestorRects:W,measuringConfiguration:I,measuringScheduled:he,windowRect:pt}),[Re,ye,be,te,Je,lt,Pe,q,fe,le,tt,ae,xt,W,I,he,pt]),Xt=k.useMemo(()=>({activatorEvent:te,activators:Lt,active:Re,activeNodeRect:be,ariaDescribedById:{draggable:V},dispatch:D,draggableNodes:q,over:tt,measureDroppableContainers:ae}),[te,Lt,Re,be,D,V,q,tt,ae]);return et.createElement(Mm.Provider,{value:U},et.createElement(fo.Provider,{value:Xt},et.createElement(Ym.Provider,{value:Pn},et.createElement(la.Provider,{value:pn},g)),et.createElement(_w,{disabled:(h==null?void 0:h.restoreFocus)===!1})),et.createElement(j0,{...h,hiddenTextDescribedById:V}));function On(){const it=(G==null?void 0:G.autoScrollEnabled)===!1,Rt=typeof m=="object"?m.enabled===!1:m===!1,Ct=X&&!it&&!Rt;return typeof m=="object"?{...m,enabled:Ct}:{enabled:Ct}}}),Iw=k.createContext(null),mh="button",Dw="Draggable";function Mw(n){let{id:r,data:s,disabled:o=!1,attributes:a}=n;const u=uo(Dw),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:x,draggableNodes:w,over:y}=k.useContext(fo),{role:T=mh,roleDescription:j="draggable",tabIndex:C=0}=a??{},b=(m==null?void 0:m.id)===r,D=k.useContext(b?la:Iw),[A,U]=Bl(),[L,H]=Bl(),X=ww(f,r),K=so(s);rr(()=>(w.set(r,{id:r,key:u,node:A,activatorNode:L,data:K}),()=>{const ie=w.get(r);ie&&ie.key===u&&w.delete(r)}),[w,r]);const q=k.useMemo(()=>({role:T,tabIndex:C,"aria-disabled":o,"aria-pressed":b&&T===mh?!0:void 0,"aria-roledescription":j,"aria-describedby":x.draggable}),[o,T,C,b,j,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:q,isDragging:b,listeners:o?void 0:X,node:A,over:y,setNodeRef:U,setActivatorNodeRef:H,transform:D}}function Qm(){return k.useContext(Ym)}const Lw="Droppable",Pw={timeout:25};function Zm(n){let{data:r,disabled:s=!1,id:o,resizeObserverConfig:a}=n;const u=uo(Lw),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=k.useContext(fo),x=k.useRef({disabled:s}),w=k.useRef(!1),y=k.useRef(null),T=k.useRef(null),{disabled:j,updateMeasurementsFor:C,timeout:b}={...Pw,...a},D=so(C??o),A=k.useCallback(()=>{if(!w.current){w.current=!0;return}T.current!=null&&clearTimeout(T.current),T.current=setTimeout(()=>{g(Array.isArray(D.current)?D.current:[D.current]),T.current=null},b)},[b]),U=oa({callback:A,disabled:j||!f}),L=k.useCallback((q,ie)=>{U&&(ie&&(U.unobserve(ie),w.current=!1),q&&U.observe(q))},[U]),[H,X]=Bl(L),K=so(r);return k.useEffect(()=>{!U||!H.current||(U.disconnect(),w.current=!1,U.observe(H.current))},[H,U]),k.useEffect(()=>(h({type:Dt.RegisterDroppable,element:{id:o,key:u,disabled:s,node:H,rect:y,data:K}}),()=>h({type:Dt.UnregisterDroppable,key:u,id:o})),[o]),k.useEffect(()=>{s!==x.current.disabled&&(h({type:Dt.SetDroppableDisabled,id:o,key:u,disabled:s}),x.current.disabled=s)},[o,u,s,h]),{active:f,rect:y,isOver:(m==null?void 0:m.id)===o,node:H,over:m,setNodeRef:X}}function Ow(n){let{animation:r,children:s}=n;const[o,a]=k.useState(null),[u,f]=k.useState(null),h=Wl(s);return!s&&!o&&h&&a(h),rr(()=>{if(!u)return;const m=o==null?void 0:o.key,g=o==null?void 0:o.props.id;if(m==null||g==null){a(null);return}Promise.resolve(r(g,u)).then(()=>{a(null)})},[r,o,u]),et.createElement(et.Fragment,null,s,o?k.cloneElement(o,{ref:f}):null)}const zw={x:0,y:0,scaleX:1,scaleY:1};function $w(n){let{children:r}=n;return et.createElement(fo.Provider,{value:Km},et.createElement(la.Provider,{value:zw},r))}const Fw={position:"fixed",touchAction:"none"},Uw=n=>ia(n)?"transform 250ms ease":void 0,Bw=k.forwardRef((n,r)=>{let{as:s,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:x=Uw}=n;if(!h)return null;const w=a?g:{...g,scaleX:1,scaleY:1},y={...Fw,width:h.width,height:h.height,top:h.top,left:h.left,transform:_r.Transform.toString(w),transformOrigin:a&&o?D0(o,h):void 0,transition:typeof x=="function"?x(o):x,...m};return et.createElement(s,{className:f,style:y,ref:r},u)}),Ww=n=>r=>{let{active:s,dragOverlay:o}=r;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,m]of Object.entries(u.active))m!==void 0&&(a[h]=s.node.style.getPropertyValue(h),s.node.style.setProperty(h,m));if(u!=null&&u.dragOverlay)for(const[h,m]of Object.entries(u.dragOverlay))m!==void 0&&o.node.style.setProperty(h,m);return f!=null&&f.active&&s.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))s.node.style.setProperty(m,g);f!=null&&f.active&&s.node.classList.remove(f.active)}},Hw=n=>{let{transform:{initial:r,final:s}}=n;return[{transform:_r.Transform.toString(r)},{transform:_r.Transform.toString(s)}]},Vw={duration:250,easing:"ease",keyframes:Hw,sideEffects:Ww({styles:{active:{opacity:"0"}}})};function Gw(n){let{config:r,draggableNodes:s,droppableContainers:o,measuringConfiguration:a}=n;return sa((u,f)=>{if(r===null)return;const h=s.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=qm(f);if(!g)return;const{transform:x}=dn(f).getComputedStyle(f),w=Pm(x);if(!w)return;const y=typeof r=="function"?r:qw(r);return Wm(m,a.draggable.measure),y({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:s,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:w})})}function qw(n){const{duration:r,easing:s,sideEffects:o,keyframes:a}={...Vw,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!r)return;const x={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},w={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},y={x:m.x-x.x,y:m.y-x.y,...w},T=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:y}}),[j]=T,C=T[T.length-1];if(JSON.stringify(j)===JSON.stringify(C))return;const b=o==null?void 0:o({active:f,dragOverlay:h,...g}),D=h.node.animate(T,{duration:r,easing:s,fill:"forwards"});return new Promise(A=>{D.onfinish=()=>{b==null||b(),A()}})}}let gh=0;function Kw(n){return k.useMemo(()=>{if(n!=null)return gh++,gh},[n])}const Yw=et.memo(n=>{let{adjustScale:r=!1,children:s,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:x,active:w,activeNodeRect:y,containerNodeRect:T,draggableNodes:j,droppableContainers:C,dragOverlay:b,over:D,measuringConfiguration:A,scrollableAncestors:U,scrollableAncestorRects:L,windowRect:H}=Qm(),X=k.useContext(la),K=Kw(w==null?void 0:w.id),q=Xm(f,{activatorEvent:x,active:w,activeNodeRect:y,containerNodeRect:T,draggingNodeRect:b.rect,over:D,overlayNodeRect:b.rect,scrollableAncestors:U,scrollableAncestorRects:L,transform:X,windowRect:H}),ie=nd(y),fe=Gw({config:o,draggableNodes:j,droppableContainers:C,measuringConfiguration:A}),ce=ie?b.setRef:void 0;return et.createElement($w,null,et.createElement(Ow,{animation:fe},w&&K?et.createElement(Bw,{key:K,id:w.id,ref:ce,as:h,activatorEvent:x,adjustScale:r,className:m,transition:u,rect:ie,style:{zIndex:g,...a},transform:q},s):null))});function Jm(n,r,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(r,1)[0]),o}function Xw(n,r){return n.reduce((s,o,a)=>{const u=r.get(o);return u&&(s[a]=u),s},Array(n.length))}function Sl(n){return n!==null&&n>=0}function Qw(n,r){if(n===r)return!0;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==r[s])return!1;return!0}function Zw(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const eg=n=>{let{rects:r,activeIndex:s,overIndex:o,index:a}=n;const u=Jm(r,o,s),f=r[a],h=u[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},Tl={scaleX:1,scaleY:1},vh=n=>{var r;let{activeIndex:s,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(r=u[s])!=null?r:o;if(!h)return null;if(a===s){const g=u[f];return g?{x:0,y:s<f?g.top+g.height-(h.top+h.height):g.top-h.top,...Tl}:null}const m=Jw(u,a,s);return a>s&&a<=f?{x:0,y:-h.height-m,...Tl}:a<s&&a>=f?{x:0,y:h.height+m,...Tl}:{x:0,y:0,...Tl}};function Jw(n,r,s){const o=n[r],a=n[r-1],u=n[r+1];return o?s<r?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const tg="Sortable",ng=et.createContext({activeIndex:-1,containerId:tg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:eg,disabled:{draggable:!1,droppable:!1}});function yh(n){let{children:r,id:s,items:o,strategy:a=eg,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:x}=Qm(),w=uo(tg,s),y=h.rect!==null,T=k.useMemo(()=>o.map(X=>typeof X=="object"&&"id"in X?X.id:X),[o]),j=f!=null,C=f?T.indexOf(f.id):-1,b=g?T.indexOf(g.id):-1,D=k.useRef(T),A=!Qw(T,D.current),U=b!==-1&&C===-1||A,L=Zw(u);rr(()=>{A&&j&&x(T)},[A,T,j,x]),k.useEffect(()=>{D.current=T},[T]);const H=k.useMemo(()=>({activeIndex:C,containerId:w,disabled:L,disableTransforms:U,items:T,overIndex:b,useDragOverlay:y,sortedRects:Xw(T,m),strategy:a}),[C,w,L.draggable,L.droppable,U,T,b,m,y,a]);return et.createElement(ng.Provider,{value:H},r)}const e1=n=>{let{id:r,items:s,activeIndex:o,overIndex:a}=n;return Jm(s,o,a).indexOf(r)},t1=n=>{let{containerId:r,isSorting:s,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:s?!0:f!==a&&r===m},n1={duration:200,easing:"ease"},rg="transform",r1=_r.Transition.toString({property:rg,duration:0,easing:"linear"}),s1={roleDescription:"sortable"};function i1(n){let{disabled:r,index:s,node:o,rect:a}=n;const[u,f]=k.useState(null),h=k.useRef(s);return rr(()=>{if(!r&&s!==h.current&&o.current){const m=a.current;if(m){const g=ai(o.current,{ignoreTransform:!0}),x={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(x.x||x.y)&&f(x)}}s!==h.current&&(h.current=s)},[r,s,o,a]),k.useEffect(()=>{u&&f(null)},[u]),u}function sg(n){let{animateLayoutChanges:r=t1,attributes:s,disabled:o,data:a,getNewIndex:u=e1,id:f,strategy:h,resizeObserverConfig:m,transition:g=n1}=n;const{items:x,containerId:w,activeIndex:y,disabled:T,disableTransforms:j,sortedRects:C,overIndex:b,useDragOverlay:D,strategy:A}=k.useContext(ng),U=o1(o,T),L=x.indexOf(f),H=k.useMemo(()=>({sortable:{containerId:w,index:L,items:x},...a}),[w,a,L,x]),X=k.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:K,node:q,isOver:ie,setNodeRef:fe}=Zm({id:f,data:H,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:X,...m}}),{active:ce,activatorEvent:Le,activeNodeRect:Re,attributes:Oe,setNodeRef:G,listeners:Y,isDragging:te,over:z,setActivatorNodeRef:Q,transform:V}=Mw({id:f,data:H,attributes:{...s1,...s},disabled:U.draggable}),E=g0(fe,G),I=!!ce,le=I&&!j&&Sl(y)&&Sl(b),ae=!D&&te,he=ae&&le?V:null,_e=le?he??(h??A)({rects:C,activeNodeRect:Re,activeIndex:y,overIndex:b,index:L}):null,Se=Sl(y)&&Sl(b)?u({id:f,items:x,activeIndex:y,overIndex:b}):L,Ae=ce==null?void 0:ce.id,be=k.useRef({activeId:Ae,items:x,newIndex:Se,containerId:w}),lt=x!==be.current.items,je=r({active:ce,containerId:w,isDragging:te,isSorting:I,id:f,index:L,items:x,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:g,wasDragging:be.current.activeId!=null}),St=i1({disabled:!je,index:L,node:q,rect:K});return k.useEffect(()=>{I&&be.current.newIndex!==Se&&(be.current.newIndex=Se),w!==be.current.containerId&&(be.current.containerId=w),x!==be.current.items&&(be.current.items=x)},[I,Se,w,x]),k.useEffect(()=>{if(Ae===be.current.activeId)return;if(Ae!=null&&be.current.activeId==null){be.current.activeId=Ae;return}const Mt=setTimeout(()=>{be.current.activeId=Ae},50);return()=>clearTimeout(Mt)},[Ae]),{active:ce,activeIndex:y,attributes:Oe,data:H,rect:K,index:L,newIndex:Se,items:x,isOver:ie,isSorting:I,isDragging:te,listeners:Y,node:q,overIndex:b,over:z,setNodeRef:E,setActivatorNodeRef:Q,setDroppableNodeRef:fe,setDraggableNodeRef:G,transform:St??_e,transition:Pe()};function Pe(){if(St||lt&&be.current.newIndex===L)return r1;if(!(ae&&!ia(Le)||!g)&&(I||je))return _r.Transition.toString({...g,property:rg})}}function o1(n,r){var s,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(s=n==null?void 0:n.draggable)!=null?s:r.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:r.droppable}}Qe.Down,Qe.Right,Qe.Up,Qe.Left;function su(n){const[r,s]=k.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=k.useCallback(a=>{s(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[r,o]}async function Tu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const s=document.execCommand("copy");return document.body.removeChild(r),s}catch{return!1}}}function l1(n,r){const s=new Map;for(const f of r){const h=f.cwd||"(no directory)",m=s.get(h)??[];m.push(f),s.set(h,m)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:s.get(f.path)??[],workspace:f})}for(const[f,h]of s)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function bl(n){return[...n].sort((r,s)=>s.sort_order-r.sort_order||(r.created_at<s.created_at?1:-1))}function Nl(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function a1(n){const r=new Set(n.map(o=>o.name));if(!r.has("New Folder"))return"New Folder";let s=2;for(;r.has(`New Folder ${s}`);)s++;return`New Folder ${s}`}function xh({id:n,children:r,className:s}){const{setNodeRef:o,isOver:a}=Zm({id:n});return c.jsx("div",{ref:o,className:`${s??""}${a?" drop-over":""}`,children:r})}function c1({s:n,isActive:r,appIcon:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onSelect:g,onCtxMenu:x,onToggleStar:w}){const{attributes:y,listeners:T,setNodeRef:j,transform:C,transition:b,isDragging:D}=sg({id:`s:${n.id}`}),A=Hu(n);return c.jsxs("div",{ref:j,style:{transform:_r.Transform.toString(C),transition:b},className:`tree-item ${r?"active":""} ${A.isFinished?"tree-item-finished":""}${D?" dragging":""}${n.starred?" tree-item-starred":""}`,...y,...T,onClick:g,onContextMenu:x,children:[c.jsx(Nm,{iconClass:A.iconClass,iconText:A.iconText,size:16}),s&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:s}),o?c.jsx("input",{ref:u,className:"tree-rename-input",value:a,onChange:U=>f(U.target.value),onClick:U=>U.stopPropagation(),onPointerDown:U=>U.stopPropagation(),onKeyDown:U=>{U.key==="Enter"&&h(),U.key==="Escape"&&m()},onBlur:h}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!o&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:U=>{U.stopPropagation(),w()},onPointerDown:U=>U.stopPropagation(),children:c.jsx(Ul,{size:10,fill:n.starred?"currentColor":"none"})}),A.dot&&c.jsx(Gu,{status:A.dot})]})}function u1({folder:n,count:r,collapsed:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:x,children:w}){const{attributes:y,listeners:T,setNodeRef:j,transform:C,transition:b,isDragging:D,over:A}=sg({id:`f:${n.id}`}),U=A!=null&&String(A.id).startsWith("s:");return c.jsxs("div",{ref:j,style:{transform:_r.Transform.toString(C),transition:b},className:`tree-folder ${s?"collapsed":""}${D?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${U?" drop-over":""}`,...y,...T,onClick:()=>{o||g()},onContextMenu:x,children:o?c.jsx("input",{ref:u,className:"tree-rename-input",value:a,onChange:L=>f(L.target.value),onClick:L=>L.stopPropagation(),onPointerDown:L=>L.stopPropagation(),onKeyDown:L=>{L.key==="Enter"&&h(),L.key==="Escape"&&m()},onBlur:h}):c.jsxs(c.Fragment,{children:[c.jsx(ro,{size:8,className:"tree-chevron"}),c.jsx(xu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:r})]})}),!s&&c.jsx("div",{className:"tree-folder-children",children:w})]})}function d1(){const n=P(W=>W.sessions),r=P(W=>W.workspaces),s=P(W=>W.folders),o=P(W=>W.activeSessionId),a=P(W=>W.selectSession),u=P(W=>W.deleteSession),f=P(W=>W.removeWorkspace),h=P(W=>W.createSessionInWorkspace),m=P(W=>W.pickAndAddWorkspace),g=P(W=>W.renameSession),x=P(W=>W.markFinished),w=P(W=>W.toggleStar),y=P(W=>W.reopenSession),T=P(W=>W.createSidebarFolder),j=P(W=>W.renameFolder),C=P(W=>W.deleteFolder),b=P(W=>W.applyMoves),D=P(W=>W.reorderFolders),A=P(W=>W.apps),U=P(W=>W.activeAppTabId),L=P(W=>W.openAppTab),H=P(W=>W.startAppEdit),X=P(W=>W.toggleAppPin),K=P(W=>W.deleteApp),q=P(W=>W.openAppCatalog),[ie,fe]=su("agentpane:sidebar-ws-collapsed"),[ce,Le]=su("agentpane:sidebar-sub-collapsed"),[Re,Oe]=su("agentpane:sidebar-folders-collapsed"),[G,Y]=k.useState(null),[te,z]=k.useState(null),[Q,V]=k.useState(""),[E,I]=k.useState(null),le=k.useRef(null),ae=k.useRef(null),he=A0(R0(td,{activationConstraint:{distance:5}}));ea(le,()=>Y(null),!!G),Vu(()=>Y(null),!!G);const ye=k.useMemo(()=>new Map(n.map(W=>[W.id,W])),[n]),_e=k.useMemo(()=>new Map(s.map(W=>[W.id,W])),[s]),Se=k.useMemo(()=>{const W=new Map;for(const Ie of[...s].sort((M,oe)=>M.sort_order-oe.sort_order)){const M=W.get(Ie.workspace_path)??[];M.push(Ie),W.set(Ie.workspace_path,M)}return W},[s]);function Ae(W){fe(Ie=>{const M=new Set(Ie);return M.has(W)?M.delete(W):M.add(W),M})}function be(W){Le(Ie=>{const M=new Set(Ie);return M.has(W)?M.delete(W):M.add(W),M})}function lt(W){Oe(Ie=>{const M=new Set(Ie);return M.has(W)?M.delete(W):M.add(W),M})}k.useEffect(()=>{te&&ae.current&&(ae.current.focus(),ae.current.select())},[te]);function je(W,Ie,M,oe=""){z({kind:W,id:Ie}),V(M||oe)}function St(){if(te){const W=Q.trim();W&&(te.kind==="session"?g(te.id,W):j(te.id,W))}z(null)}function Pe(){z(null),V("")}async function Mt(W){const Ie=a1(Se.get(W)??[]),M=await T(W,Ie);M&&je("folder",M.id,M.name)}function $e(W){const Ie=String(W.active.id);if(Ie.startsWith("s:")){const M=ye.get(Ie.slice(2));M&&I({kind:"session",label:M.title||M.id.slice(0,8)})}else if(Ie.startsWith("f:")){const M=_e.get(Ie.slice(2));M&&I({kind:"folder",label:M.name})}}function Yt(W){I(null);const{active:Ie,over:M}=W;if(!M)return;const oe=String(Ie.id),Ne=String(M.id);if(oe.startsWith("s:")){const ue=ye.get(oe.slice(2));if(!ue)return;const ze=ue.cwd||"(no directory)",Fe=Nl(ue,_e);let Je,dt;if(Ne.startsWith("f:")){const Be=_e.get(Ne.slice(2));if(!Be)return;Je=Be.workspace_path,dt=Be.id}else if(Ne.startsWith("s:")){const Be=ye.get(Ne.slice(2));if(!Be)return;Je=Be.cwd||"(no directory)",dt=Nl(Be,_e)}else if(Ne.startsWith("c:")){const Be=Ne.slice(2),nt=Be.lastIndexOf("|");Je=Be.slice(0,nt);const Lt=Be.slice(nt+1);dt=Lt==="root"?null:Lt}else return;if(Je!==ze)return;const tt=bl(n.filter(Be=>(Be.cwd||"(no directory)")===Je&&Nl(Be,_e)===dt)),fn=tt.filter(Be=>Be.id!==ue.id);let Nn=fn.length;if(Ne.startsWith("s:")){const Be=fn.findIndex(nt=>nt.id===Ne.slice(2));Be>=0&&(Nn=Be)}const pn=[...fn.slice(0,Nn),ue,...fn.slice(Nn)],Cn=[];if(dt===Fe){if(pn.length===tt.length&&pn.every((Be,nt)=>Be.id===tt[nt].id))return;pn.forEach((Be,nt)=>Cn.push({id:Be.id,folder_id:dt,sort_order:pn.length-1-nt}))}else{const Be=bl(n.filter(nt=>(nt.cwd||"(no directory)")===ze&&Nl(nt,_e)===Fe)).filter(nt=>nt.id!==ue.id);Be.forEach((nt,Lt)=>Cn.push({id:nt.id,folder_id:Fe,sort_order:Be.length-1-Lt})),pn.forEach((nt,Lt)=>Cn.push({id:nt.id,folder_id:dt,sort_order:pn.length-1-Lt}))}b(Cn);return}if(oe.startsWith("f:")){if(!Ne.startsWith("f:"))return;const ue=_e.get(oe.slice(2)),ze=_e.get(Ne.slice(2));if(!ue||!ze||ue.id===ze.id||ue.workspace_path!==ze.workspace_path)return;const Fe=(Se.get(ue.workspace_path)??[]).map(tt=>tt.id),Je=Fe.indexOf(ue.id),dt=Fe.indexOf(ze.id);Fe.splice(dt,0,...Fe.splice(Je,1)),D(Fe)}}const bn=l1(r,n);function pt(W){const Ie=W.origin_app_id?A.find(M=>M.id===W.origin_app_id):null;return c.jsx(c1,{s:W,isActive:o===W.id,appIcon:Ie?Ie.icon??"◧":null,renaming:(te==null?void 0:te.kind)==="session"&&te.id===W.id,renameValue:Q,renameRef:ae,onRenameValue:V,onRenameConfirm:St,onRenameCancel:Pe,onSelect:()=>a(W.id),onToggleStar:()=>w(W.id),onCtxMenu:M=>{M.preventDefault(),Y({x:M.clientX,y:M.clientY,type:"session",sessionId:W.id,sessionTitle:W.title,sessionLifecycle:W.lifecycle,sessionExternalId:W.external_thread_id})}},W.id)}function xt(W,Ie){const M=bl(W.filter(ze=>ze.lifecycle!=="finished")),oe=bl(W.filter(ze=>ze.lifecycle==="finished")),Ne=[...M,...oe].map(ze=>`s:${ze.id}`),ue=ce.has(Ie);return c.jsxs(yh,{items:Ne,strategy:vh,children:[M.length===0&&oe.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):M.map(pt),oe.length>0&&c.jsxs("div",{className:`tree-subgroup ${ue?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>be(Ie),children:[c.jsx(ro,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:oe.length})]}),!ue&&c.jsx("div",{className:"tree-subgroup-items",children:oe.map(pt)})]})]})}return c.jsxs("div",{className:"ide-sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:c.jsx(ys,{size:14})})]}),c.jsxs(Aw,{sensors:he,collisionDetection:O0,onDragStart:$e,onDragEnd:Yt,children:[bn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):bn.map(W=>{const Ie=ie.has(W.path),M=Se.get(W.path)??[],oe=new Set(M.map(ue=>ue.id)),Ne=W.sessions.filter(ue=>!(ue.folder_id&&oe.has(ue.folder_id)));return c.jsxs("div",{className:`tree-section ${Ie?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>Ae(W.path),onContextMenu:ue=>{ue.preventDefault(),Y({x:ue.clientX,y:ue.clientY,type:"workspace",path:W.path})},children:[c.jsx(ro,{size:9,className:"tree-chevron"}),c.jsx(xu,{size:14}),c.jsx("span",{className:"tree-section-label",children:W.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:ue=>{ue.stopPropagation(),h(W.path)},children:c.jsx(ys,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:ue=>{ue.stopPropagation(),Mt(W.path)},children:c.jsx(Jc,{size:11})}),c.jsx("span",{className:"tree-count",children:W.sessions.length})]}),!Ie&&c.jsxs("div",{className:"tree-children",children:[c.jsx(yh,{items:M.map(ue=>`f:${ue.id}`),strategy:vh,children:M.map(ue=>{const ze=W.sessions.filter(Fe=>Fe.folder_id===ue.id);return c.jsx(u1,{folder:ue,count:ze.length,collapsed:Re.has(ue.id),renaming:(te==null?void 0:te.kind)==="folder"&&te.id===ue.id,renameValue:Q,renameRef:ae,onRenameValue:V,onRenameConfirm:St,onRenameCancel:Pe,onToggle:()=>lt(ue.id),onCtxMenu:Fe=>{Fe.preventDefault(),Y({x:Fe.clientX,y:Fe.clientY,type:"folder",folderId:ue.id,folderName:ue.name})},children:c.jsx(xh,{id:`c:${W.path}|${ue.id}`,children:xt(ze,`folder:${ue.id}:finished`)})},ue.id)})}),c.jsx(xh,{id:`c:${W.path}|root`,children:xt(Ne,`${W.path}:finished`)})]})]},W.path)}),c.jsx(Yw,{children:E&&c.jsxs("div",{className:"drag-overlay",children:[E.kind==="folder"&&c.jsx(xu,{size:12}),c.jsx("span",{children:E.label})]})})]}),c.jsxs("div",{className:"sidebar-apps",children:[c.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Apps"}),c.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>q(),children:c.jsx(ys,{size:14})})]}),A.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),A.map(W=>c.jsxs("div",{className:`sidebar-app-row${U===W.id?" active":""}`,title:W.description??void 0,onClick:()=>L(W.id),onContextMenu:Ie=>{Ie.preventDefault(),Y({x:Ie.clientX,y:Ie.clientY,type:"app",appId:W.id,appPinned:W.pinned})},children:[c.jsx("span",{className:"sidebar-app-icon",children:W.icon??"◧"}),c.jsx("span",{className:"tree-label",children:W.title}),W.pinned&&c.jsx(Ul,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]},W.id))]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(Jc,{size:14}),c.jsx("span",{children:"Add workspace"})]}),G&&c.jsxs("div",{ref:le,className:"ctx-menu",style:{position:"fixed",left:G.x,top:G.y,zIndex:500},children:[G.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{h(G.path),Y(null)},children:[c.jsx(ys,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Mt(G.path),Y(null)},children:[c.jsx(Jc,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(G.path),Y(null)},children:[c.jsx(Nr,{size:12})," Hide Workspace"]})]}),G.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{je("folder",G.folderId,G.folderName??""),Y(null)},children:[c.jsx(Il,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{C(G.folderId),Y(null)},children:[c.jsx(Nr,{size:12})," Delete Folder"]})]}),G.type==="session"&&c.jsx(c.Fragment,{children:G.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{je("session",G.sessionId,G.sessionTitle??""),Y(null)},children:[c.jsx(Il,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(G.sessionId),Y(null)},children:[c.jsx(Yu,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${G.sessionExternalId?"":" ctx-disabled"}`,title:G.sessionExternalId?void 0:"Session not started",onClick:()=>{G.sessionExternalId&&(Tu(G.sessionExternalId),Y(null))},children:[c.jsx(yu,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(G.sessionId),Y(null)},children:[c.jsx(Nr,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{y(G.sessionId),Y(null)},children:[c.jsx(ta,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${G.sessionExternalId?"":" ctx-disabled"}`,title:G.sessionExternalId?void 0:"Session not started",onClick:()=>{G.sessionExternalId&&(Tu(G.sessionExternalId),Y(null))},children:[c.jsx(yu,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(G.sessionId),Y(null)},children:[c.jsx(Nr,{size:12})," Delete Session"]})]})}),G.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{H(G.appId),Y(null)},children:[c.jsx(Il,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{X(G.appId),Y(null)},children:[c.jsx(Ul,{size:12})," ",G.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{K(G.appId),Y(null)},children:[c.jsx(Nr,{size:12})," Delete App"]})]})]})]})}function f1(){const n=P(y=>y.openTabs),r=P(y=>y.activeSessionId),s=P(y=>y.sessions),o=P(y=>y.selectSession),a=P(y=>y.closeTab),u=P(y=>y.setShowNewSessionDialog),f=P(y=>y.apps),h=P(y=>y.openAppTabs),m=P(y=>y.activeAppTabId),g=P(y=>y.openAppTab),x=P(y=>y.closeAppTab),w=P(y=>y.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(y=>{const T=s.find(b=>b.id===y);if(!T)return null;const j=Hu(T),C=r===y&&m==null;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>{m!=null&&w(null),o(y)},children:[c.jsx(Nm,{iconClass:j.iconClass,iconText:j.iconText,size:14}),T.title||y.slice(0,8),j.dot&&c.jsx(Gu,{status:j.dot}),c.jsx("span",{className:"ide-tab-close",onClick:b=>{b.stopPropagation(),a(y)},children:c.jsx(Gn,{size:12})})]},y)}),h.map(y=>{const T=f.find(C=>C.id===y),j=m===y;return c.jsxs("div",{className:`ide-tab ${j?"active":""}`,onClick:()=>g(y),children:[T!=null&&T.icon?c.jsx("span",{className:"miniapp-tab-icon",children:T.icon}):c.jsx(Xx,{size:12}),(T==null?void 0:T.title)??y,c.jsx("span",{className:"ide-tab-close",onClick:C=>{C.stopPropagation(),x(y)},children:c.jsx(Gn,{size:12})})]},y)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>u(!0),children:c.jsx(ys,{size:14})})]})}function rd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ks=rd();function ig(n){ks=n}var Ji={exec:()=>null};function Ze(n,r=""){let s=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(un.caret,"$1"),s=s.replace(a,f),o},getRegex:()=>new RegExp(s,r)};return o}var un={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},p1=/^(?:[ \t]*(?:\n|$))+/,h1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,m1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,po=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,sd=/(?:[*+-]|\d{1,9}[.)])/,og=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lg=Ze(og).replace(/bull/g,sd).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(),v1=Ze(og).replace(/bull/g,sd).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(),id=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,y1=/^[^\n]+/,od=/(?!\s*\])(?:\\.|[^\[\]\\])+/,x1=Ze(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",od).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),w1=Ze(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,sd).getRegex(),aa="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",ld=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,k1=Ze("^ {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",ld).replace("tag",aa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ag=Ze(id).replace("hr",po).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",aa).getRegex(),S1=Ze(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ag).getRegex(),ad={blockquote:S1,code:h1,def:x1,fences:m1,heading:g1,hr:po,html:k1,lheading:lg,list:w1,newline:p1,paragraph:ag,table:Ji,text:y1},wh=Ze("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",po).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",aa).getRegex(),T1={...ad,lheading:v1,table:wh,paragraph:Ze(id).replace("hr",po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wh).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",aa).getRegex()},b1={...ad,html:Ze(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ld).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:Ji,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ze(id).replace("hr",po).replace("heading",` *#{1,6} *[^
|
|
359
|
+
]`).replace("lheading",lg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},N1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,C1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cg=/^( {2,}|\\)\n(?!\s*$)/,E1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ca=/[\p{P}\p{S}]/u,cd=/[\s\p{P}\p{S}]/u,ug=/[^\s\p{P}\p{S}]/u,_1=Ze(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,cd).getRegex(),dg=/(?!~)[\p{P}\p{S}]/u,j1=/(?!~)[\s\p{P}\p{S}]/u,R1=/(?:[^\s\p{P}\p{S}]|~)/u,A1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,fg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,I1=Ze(fg,"u").replace(/punct/g,ca).getRegex(),D1=Ze(fg,"u").replace(/punct/g,dg).getRegex(),pg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",M1=Ze(pg,"gu").replace(/notPunctSpace/g,ug).replace(/punctSpace/g,cd).replace(/punct/g,ca).getRegex(),L1=Ze(pg,"gu").replace(/notPunctSpace/g,R1).replace(/punctSpace/g,j1).replace(/punct/g,dg).getRegex(),P1=Ze("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ug).replace(/punctSpace/g,cd).replace(/punct/g,ca).getRegex(),O1=Ze(/\\(punct)/,"gu").replace(/punct/g,ca).getRegex(),z1=Ze(/^<(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(),$1=Ze(ld).replace("(?:-->|$)","-->").getRegex(),F1=Ze("^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",$1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U1=Ze(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Kl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hg=Ze(/^!?\[(label)\]\[(ref)\]/).replace("label",Kl).replace("ref",od).getRegex(),mg=Ze(/^!?\[(ref)\](?:\[\])?/).replace("ref",od).getRegex(),B1=Ze("reflink|nolink(?!\\()","g").replace("reflink",hg).replace("nolink",mg).getRegex(),ud={_backpedal:Ji,anyPunctuation:O1,autolink:z1,blockSkip:A1,br:cg,code:C1,del:Ji,emStrongLDelim:I1,emStrongRDelimAst:M1,emStrongRDelimUnd:P1,escape:N1,link:U1,nolink:mg,punctuation:_1,reflink:hg,reflinkSearch:B1,tag:F1,text:E1,url:Ji},W1={...ud,link:Ze(/^!?\[(label)\]\((.*?)\)/).replace("label",Kl).getRegex(),reflink:Ze(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kl).getRegex()},bu={...ud,emStrongRDelimAst:L1,emStrongLDelim:D1,url:Ze(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},H1={...bu,br:Ze(cg).replace("{2,}","*").getRegex(),text:Ze(bu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Cl={normal:ad,gfm:T1,pedantic:b1},Hi={normal:ud,gfm:bu,breaks:H1,pedantic:W1},V1={"&":"&","<":"<",">":">",'"':""","'":"'"},kh=n=>V1[n];function dr(n,r){if(r){if(un.escapeTest.test(n))return n.replace(un.escapeReplace,kh)}else if(un.escapeTestNoEncode.test(n))return n.replace(un.escapeReplaceNoEncode,kh);return n}function Sh(n){try{n=encodeURI(n).replace(un.percentDecode,"%")}catch{return null}return n}function Th(n,r){var u;const s=n.replace(un.findPipe,(f,h,m)=>{let g=!1,x=h;for(;--x>=0&&m[x]==="\\";)g=!g;return g?"|":" |"}),o=s.split(un.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(un.slashPipe,"|");return o}function Vi(n,r,s){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===r;)a++;return n.slice(0,o-a)}function G1(n,r){if(n.indexOf(r[1])===-1)return-1;let s=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===r[0])s++;else if(n[o]===r[1]&&(s--,s<0))return o;return s>0?-2:-1}function bh(n,r,s,o,a){const u=r.href,f=r.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:s,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,m}function q1(n,r,s){const o=n.match(s.other.indentCodeCompensation);if(o===null)return r;const a=o[1];return r.split(`
|
|
360
|
+
`).map(u=>{const f=u.match(s.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
361
|
+
`)}var Yl=class{constructor(n){st(this,"options");st(this,"rules");st(this,"lexer");this.options=n||ks}space(n){const r=this.rules.block.newline.exec(n);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(n){const r=this.rules.block.code.exec(n);if(r){const s=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Vi(s,`
|
|
362
|
+
`)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const s=r[0],o=q1(s,r[3]||"",this.rules);return{type:"code",raw:s,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(n){const r=this.rules.block.heading.exec(n);if(r){let s=r[2].trim();if(this.rules.other.endingHash.test(s)){const o=Vi(s,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(s=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(n){const r=this.rules.block.hr.exec(n);if(r)return{type:"hr",raw:Vi(r[0],`
|
|
363
|
+
`)}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){let s=Vi(r[0],`
|
|
364
|
+
`).split(`
|
|
365
|
+
`),o="",a="";const u=[];for(;s.length>0;){let f=!1;const h=[];let m;for(m=0;m<s.length;m++)if(this.rules.other.blockquoteStart.test(s[m]))h.push(s[m]),f=!0;else if(!f)h.push(s[m]);else break;s=s.slice(m);const g=h.join(`
|
|
366
|
+
`),x=g.replace(this.rules.other.blockquoteSetextReplace,`
|
|
367
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
368
|
+
${g}`:g,a=a?`${a}
|
|
369
|
+
${x}`:x;const w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,u,!0),this.lexer.state.top=w,s.length===0)break;const y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){const T=y,j=T.raw+`
|
|
370
|
+
`+s.join(`
|
|
371
|
+
`),C=this.blockquote(j);u[u.length-1]=C,o=o.substring(0,o.length-T.raw.length)+C.raw,a=a.substring(0,a.length-T.text.length)+C.text;break}else if((y==null?void 0:y.type)==="list"){const T=y,j=T.raw+`
|
|
372
|
+
`+s.join(`
|
|
373
|
+
`),C=this.list(j);u[u.length-1]=C,o=o.substring(0,o.length-y.raw.length)+C.raw,a=a.substring(0,a.length-T.raw.length)+C.raw,s=j.substring(u.at(-1).raw.length).split(`
|
|
374
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let r=this.rules.block.list.exec(n);if(r){let s=r[1].trim();const o=s.length>1,a={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");const u=this.rules.other.listItemRegex(s);let f=!1;for(;n;){let m=!1,g="",x="";if(!(r=u.exec(n))||this.rules.block.hr.test(n))break;g=r[0],n=n.substring(g.length);let w=r[2].split(`
|
|
375
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),y=n.split(`
|
|
376
|
+
`,1)[0],T=!w.trim(),j=0;if(this.options.pedantic?(j=2,x=w.trimStart()):T?j=r[1].length+1:(j=r[2].search(this.rules.other.nonSpaceChar),j=j>4?1:j,x=w.slice(j),j+=r[1].length),T&&this.rules.other.blankLine.test(y)&&(g+=y+`
|
|
377
|
+
`,n=n.substring(y.length+1),m=!0),!m){const D=this.rules.other.nextBulletRegex(j),A=this.rules.other.hrRegex(j),U=this.rules.other.fencesBeginRegex(j),L=this.rules.other.headingBeginRegex(j),H=this.rules.other.htmlBeginRegex(j);for(;n;){const X=n.split(`
|
|
378
|
+
`,1)[0];let K;if(y=X,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),K=y):K=y.replace(this.rules.other.tabCharGlobal," "),U.test(y)||L.test(y)||H.test(y)||D.test(y)||A.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=j||!y.trim())x+=`
|
|
379
|
+
`+K.slice(j);else{if(T||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(w)||L.test(w)||A.test(w))break;x+=`
|
|
380
|
+
`+y}!T&&!y.trim()&&(T=!0),g+=X+`
|
|
381
|
+
`,n=n.substring(X.length+1),w=K.slice(j)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let C=null,b;this.options.gfm&&(C=this.rules.other.listIsTask.exec(x),C&&(b=C[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!C,checked:b,loose:!1,text:x,tokens:[]}),a.raw+=g}const h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m=0;m<a.items.length;m++)if(this.lexer.state.top=!1,a.items[m].tokens=this.lexer.blockTokens(a.items[m].text,[]),!a.loose){const g=a.items[m].tokens.filter(w=>w.type==="space"),x=g.length>0&&g.some(w=>this.rules.other.anyLine.test(w.raw));a.loose=x}if(a.loose)for(let m=0;m<a.items.length;m++)a.items[m].loose=!0;return a}}html(n){const r=this.rules.block.html.exec(n);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(n){const r=this.rules.block.def.exec(n);if(r){const s=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:s,raw:r[0],href:o,title:a}}}table(n){var f;const r=this.rules.block.table.exec(n);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const s=Th(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=r[3])!=null&&f.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
382
|
+
`):[],u={type:"table",raw:r[0],header:[],align:[],rows:[]};if(s.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<s.length;h++)u.header.push({text:s[h],tokens:this.lexer.inline(s[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Th(h,u.header.length).map((m,g)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:u.align[g]})));return u}}lheading(n){const r=this.rules.block.lheading.exec(n);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(n){const r=this.rules.block.paragraph.exec(n);if(r){const s=r[1].charAt(r[1].length-1)===`
|
|
383
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:s,tokens:this.lexer.inline(s)}}}text(n){const r=this.rules.block.text.exec(n);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(n){const r=this.rules.inline.escape.exec(n);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(n){const r=this.rules.inline.tag.exec(n);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(n){const r=this.rules.inline.link.exec(n);if(r){const s=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const u=Vi(s.slice(0,-1),"\\");if((s.length-u.length)%2===0)return}else{const u=G1(r[2],"()");if(u===-2)return;if(u>-1){const h=(r[0].indexOf("!")===0?5:4)+r[1].length+u;r[2]=r[2].substring(0,u),r[0]=r[0].substring(0,h).trim(),r[3]=""}}let o=r[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?o=o.slice(1):o=o.slice(1,-1)),bh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(n,r){let s;if((s=this.rules.inline.reflink.exec(n))||(s=this.rules.inline.nolink.exec(n))){const o=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[o.toLowerCase()];if(!a){const u=s[0].charAt(0);return{type:"text",raw:u,text:u}}return bh(s,a,s[0],this.lexer,this.rules)}}emStrong(n,r,s=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const u=[...o[0]].length-1;let f,h,m=u,g=0;const x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,r=r.slice(-1*n.length+u);(o=x.exec(r))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){m+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);const w=[...o[0]][0].length,y=n.slice(0,u+o.index+w+h);if(Math.min(u,h)%2){const j=y.slice(1,-1);return{type:"em",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}const T=y.slice(2,-2);return{type:"strong",raw:y,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(n){const r=this.rules.inline.code.exec(n);if(r){let s=r[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return o&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:r[0],text:s}}}br(n){const r=this.rules.inline.br.exec(n);if(r)return{type:"br",raw:r[0]}}del(n){const r=this.rules.inline.del.exec(n);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(n){const r=this.rules.inline.autolink.exec(n);if(r){let s,o;return r[2]==="@"?(s=r[1],o="mailto:"+s):(s=r[1],o=s),{type:"link",raw:r[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(n){var s;let r;if(r=this.rules.inline.url.exec(n)){let o,a;if(r[2]==="@")o=r[0],a="mailto:"+o;else{let u;do u=r[0],r[0]=((s=this.rules.inline._backpedal.exec(r[0]))==null?void 0:s[0])??"";while(u!==r[0]);o=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const r=this.rules.inline.text.exec(n);if(r){const s=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:s}}}},Cr=class Nu{constructor(r){st(this,"tokens");st(this,"options");st(this,"state");st(this,"tokenizer");st(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||ks,this.options.tokenizer=this.options.tokenizer||new Yl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:un,block:Cl.normal,inline:Hi.normal};this.options.pedantic?(s.block=Cl.pedantic,s.inline=Hi.pedantic):this.options.gfm&&(s.block=Cl.gfm,this.options.breaks?s.inline=Hi.breaks:s.inline=Hi.gfm),this.tokenizer.rules=s}static get rules(){return{block:Cl,inline:Hi}}static lex(r,s){return new Nu(s).lex(r)}static lexInline(r,s){return new Nu(s).inlineTokens(r)}lex(r){r=r.replace(un.carriageReturn,`
|
|
384
|
+
`),this.blockTokens(r,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){const o=this.inlineQueue[s];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,s=[],o=!1){var a,u,f;for(this.options.pedantic&&(r=r.replace(un.tabCharGlobal," ").replace(un.spaceLine,""));r;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(h=g.call({lexer:this},r,s))?(r=r.substring(h.raw.length),s.push(h),!0):!1))continue;if(h=this.tokenizer.space(r)){r=r.substring(h.raw.length);const g=s.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
|
|
385
|
+
`:s.push(h);continue}if(h=this.tokenizer.code(r)){r=r.substring(h.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
386
|
+
`+h.raw,g.text+=`
|
|
387
|
+
`+h.text,this.inlineQueue.at(-1).src=g.text):s.push(h);continue}if(h=this.tokenizer.fences(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.heading(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.hr(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.blockquote(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.list(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.html(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.def(r)){r=r.substring(h.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
388
|
+
`+h.raw,g.text+=`
|
|
389
|
+
`+h.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.lheading(r)){r=r.substring(h.raw.length),s.push(h);continue}let m=r;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const x=r.slice(1);let w;this.options.extensions.startBlock.forEach(y=>{w=y.call({lexer:this},x),typeof w=="number"&&w>=0&&(g=Math.min(g,w))}),g<1/0&&g>=0&&(m=r.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){const g=s.at(-1);o&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
|
|
390
|
+
`+h.raw,g.text+=`
|
|
391
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):s.push(h),o=m.length!==r.length,r=r.substring(h.raw.length);continue}if(h=this.tokenizer.text(r)){r=r.substring(h.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
392
|
+
`+h.raw,g.text+=`
|
|
393
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):s.push(h);continue}if(r){const g="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,s}inline(r,s=[]){return this.inlineQueue.push({src:r,tokens:s}),s}inlineTokens(r,s=[]){var h,m,g;let o=r,a=null;if(this.tokens.links){const x=Object.keys(this.tokens.links);if(x.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)x.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(;r;){u||(f=""),u=!1;let x;if((m=(h=this.options.extensions)==null?void 0:h.inline)!=null&&m.some(y=>(x=y.call({lexer:this},r,s))?(r=r.substring(x.raw.length),s.push(x),!0):!1))continue;if(x=this.tokenizer.escape(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.tag(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.link(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(x.raw.length);const y=s.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):s.push(x);continue}if(x=this.tokenizer.emStrong(r,o,f)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.codespan(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.br(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.del(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.autolink(r)){r=r.substring(x.raw.length),s.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(r))){r=r.substring(x.raw.length),s.push(x);continue}let w=r;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0;const T=r.slice(1);let j;this.options.extensions.startInline.forEach(C=>{j=C.call({lexer:this},T),typeof j=="number"&&j>=0&&(y=Math.min(y,j))}),y<1/0&&y>=0&&(w=r.substring(0,y+1))}if(x=this.tokenizer.inlineText(w)){r=r.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(f=x.raw.slice(-1)),u=!0;const y=s.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):s.push(x);continue}if(r){const y="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return s}},Xl=class{constructor(n){st(this,"options");st(this,"parser");this.options=n||ks}space(n){return""}code({text:n,lang:r,escaped:s}){var u;const o=(u=(r||"").match(un.notSpaceStart))==null?void 0:u[0],a=n.replace(un.endingNewline,"")+`
|
|
394
|
+
`;return o?'<pre><code class="language-'+dr(o)+'">'+(s?a:dr(a,!0))+`</code></pre>
|
|
395
|
+
`:"<pre><code>"+(s?a:dr(a,!0))+`</code></pre>
|
|
396
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
397
|
+
${this.parser.parse(n)}</blockquote>
|
|
398
|
+
`}html({text:n}){return n}heading({tokens:n,depth:r}){return`<h${r}>${this.parser.parseInline(n)}</h${r}>
|
|
399
|
+
`}hr(n){return`<hr>
|
|
400
|
+
`}list(n){const r=n.ordered,s=n.start;let o="";for(let f=0;f<n.items.length;f++){const h=n.items[f];o+=this.listitem(h)}const a=r?"ol":"ul",u=r&&s!==1?' start="'+s+'"':"";return"<"+a+u+`>
|
|
401
|
+
`+o+"</"+a+`>
|
|
402
|
+
`}listitem(n){var s;let r="";if(n.task){const o=this.checkbox({checked:!!n.checked});n.loose?((s=n.tokens[0])==null?void 0:s.type)==="paragraph"?(n.tokens[0].text=o+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=o+" "+dr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):r+=o+" "}return r+=this.parser.parse(n.tokens,!!n.loose),`<li>${r}</li>
|
|
403
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
404
|
+
`}table(n){let r="",s="";for(let a=0;a<n.header.length;a++)s+=this.tablecell(n.header[a]);r+=this.tablerow({text:s});let o="";for(let a=0;a<n.rows.length;a++){const u=n.rows[a];s="";for(let f=0;f<u.length;f++)s+=this.tablecell(u[f]);o+=this.tablerow({text:s})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
405
|
+
<thead>
|
|
406
|
+
`+r+`</thead>
|
|
407
|
+
`+o+`</table>
|
|
408
|
+
`}tablerow({text:n}){return`<tr>
|
|
409
|
+
${n}</tr>
|
|
410
|
+
`}tablecell(n){const r=this.parser.parseInline(n.tokens),s=n.header?"th":"td";return(n.align?`<${s} align="${n.align}">`:`<${s}>`)+r+`</${s}>
|
|
411
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${dr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:r,tokens:s}){const o=this.parser.parseInline(s),a=Sh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return r&&(u+=' title="'+dr(r)+'"'),u+=">"+o+"</a>",u}image({href:n,title:r,text:s,tokens:o}){o&&(s=this.parser.parseInline(o,this.parser.textRenderer));const a=Sh(n);if(a===null)return dr(s);n=a;let u=`<img src="${n}" alt="${s}"`;return r&&(u+=` title="${dr(r)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:dr(n.text)}},dd=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Er=class Cu{constructor(r){st(this,"options");st(this,"renderer");st(this,"textRenderer");this.options=r||ks,this.options.renderer=this.options.renderer||new Xl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dd}static parse(r,s){return new Cu(s).parse(r)}static parseInline(r,s){return new Cu(s).parseInline(r)}parse(r,s=!0){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){o+=x||"";continue}}const m=h;switch(m.type){case"space":{o+=this.renderer.space(m);continue}case"hr":{o+=this.renderer.hr(m);continue}case"heading":{o+=this.renderer.heading(m);continue}case"code":{o+=this.renderer.code(m);continue}case"table":{o+=this.renderer.table(m);continue}case"blockquote":{o+=this.renderer.blockquote(m);continue}case"list":{o+=this.renderer.list(m);continue}case"html":{o+=this.renderer.html(m);continue}case"paragraph":{o+=this.renderer.paragraph(m);continue}case"text":{let g=m,x=this.renderer.text(g);for(;f+1<r.length&&r[f+1].type==="text";)g=r[++f],x+=`
|
|
412
|
+
`+this.renderer.text(g);s?o+=this.renderer.paragraph({type:"paragraph",raw:x,text:x,tokens:[{type:"text",raw:x,text:x,escaped:!0}]}):o+=x;continue}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}parseInline(r,s=this.renderer){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=this.options.extensions.renderers[h.type].call({parser:this},h);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=g||"";continue}}const m=h;switch(m.type){case"escape":{o+=s.text(m);break}case"html":{o+=s.html(m);break}case"link":{o+=s.link(m);break}case"image":{o+=s.image(m);break}case"strong":{o+=s.strong(m);break}case"em":{o+=s.em(m);break}case"codespan":{o+=s.codespan(m);break}case"br":{o+=s.br(m);break}case"del":{o+=s.del(m);break}case"text":{o+=s.text(m);break}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},fu,Ml=(fu=class{constructor(n){st(this,"options");st(this,"block");this.options=n||ks}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Cr.lex:Cr.lexInline}provideParser(){return this.block?Er.parse:Er.parseInline}},st(fu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),fu),K1=class{constructor(...n){st(this,"defaults",rd());st(this,"options",this.setOptions);st(this,"parse",this.parseMarkdown(!0));st(this,"parseInline",this.parseMarkdown(!1));st(this,"Parser",Er);st(this,"Renderer",Xl);st(this,"TextRenderer",dd);st(this,"Lexer",Cr);st(this,"Tokenizer",Yl);st(this,"Hooks",Ml);this.use(...n)}walkTokens(n,r){var o,a;let s=[];for(const u of n)switch(s=s.concat(r.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)s=s.concat(this.walkTokens(h.tokens,r));for(const h of f.rows)for(const m of h)s=s.concat(this.walkTokens(m.tokens,r));break}case"list":{const f=u;s=s.concat(this.walkTokens(f.items,r));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const m=f[h].flat(1/0);s=s.concat(this.walkTokens(m,r))}):f.tokens&&(s=s.concat(this.walkTokens(f.tokens,r)))}}return s}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(s=>{const o={...s};if(o.async=this.defaults.async||o.async||!1,s.extensions&&(s.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=r.renderers[a.name];u?r.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=r[a.level];u?u.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),o.extensions=r),s.renderer){const a=this.defaults.renderer||new Xl(this.defaults);for(const u in s.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=s.renderer[f],m=a[f];a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x||""}}o.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new Yl(this.defaults);for(const u in s.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=s.tokenizer[f],m=a[f];a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x}}o.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Ml;for(const u in s.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=s.hooks[f],m=a[f];Ml.passThroughHooks.has(u)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(h.call(a,g)).then(w=>m.call(a,w));const x=h.call(a,g);return m.call(a,x)}:a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x}}o.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,u=s.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Cr.lex(n,r??this.defaults)}parser(n,r){return Er.parse(n,r??this.defaults)}parseMarkdown(n){return(s,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&a.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?Cr.lex:Cr.lexInline,m=u.hooks?u.hooks.provideParser():n?Er.parse:Er.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(s):s).then(g=>h(g,u)).then(g=>u.hooks?u.hooks.processAllTokens(g):g).then(g=>u.walkTokens?Promise.all(this.walkTokens(g,u.walkTokens)).then(()=>g):g).then(g=>m(g,u)).then(g=>u.hooks?u.hooks.postprocess(g):g).catch(f);try{u.hooks&&(s=u.hooks.preprocess(s));let g=h(s,u);u.hooks&&(g=u.hooks.processAllTokens(g)),u.walkTokens&&this.walkTokens(g,u.walkTokens);let x=m(g,u);return u.hooks&&(x=u.hooks.postprocess(x)),x}catch(g){return f(g)}}}onError(n,r){return s=>{if(s.message+=`
|
|
413
|
+
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+dr(s.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(s);throw s}}},xs=new K1;function He(n,r){return xs.parse(n,r)}He.options=He.setOptions=function(n){return xs.setOptions(n),He.defaults=xs.defaults,ig(He.defaults),He};He.getDefaults=rd;He.defaults=ks;He.use=function(...n){return xs.use(...n),He.defaults=xs.defaults,ig(He.defaults),He};He.walkTokens=function(n,r){return xs.walkTokens(n,r)};He.parseInline=xs.parseInline;He.Parser=Er;He.parser=Er.parse;He.Renderer=Xl;He.TextRenderer=dd;He.Lexer=Cr;He.lexer=Cr.lex;He.Tokenizer=Yl;He.Hooks=Ml;He.parse=He;He.options;He.setOptions;He.use;He.walkTokens;He.parseInline;Er.parse;Cr.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 Nh(n,r){(r==null||r>n.length)&&(r=n.length);for(var s=0,o=Array(r);s<r;s++)o[s]=n[s];return o}function Y1(n){if(Array.isArray(n))return n}function X1(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,u,f,h=[],m=!0,g=!1;try{if(u=(s=s.call(n)).next,r!==0)for(;!(m=(o=u.call(s)).done)&&(h.push(o.value),h.length!==r);m=!0);}catch(x){g=!0,a=x}finally{try{if(!m&&s.return!=null&&(f=s.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function Q1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
414
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z1(n,r){return Y1(n)||X1(n,r)||J1(n,r)||Q1()}function J1(n,r){if(n){if(typeof n=="string")return Nh(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Nh(n,r):void 0}}const gg=Object.entries,Ch=Object.setPrototypeOf,ek=Object.isFrozen,tk=Object.getPrototypeOf,nk=Object.getOwnPropertyDescriptor;let Gt=Object.freeze,Kt=Object.seal,Zs=Object.create,vg=typeof Reflect<"u"&&Reflect,Eu=vg.apply,_u=vg.construct;Gt||(Gt=function(r){return r});Kt||(Kt=function(r){return r});Eu||(Eu=function(r,s){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return r.apply(s,a)});_u||(_u=function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return new r(...o)});const Ys=jt(Array.prototype.forEach),rk=jt(Array.prototype.lastIndexOf),Eh=jt(Array.prototype.pop),Xs=jt(Array.prototype.push),sk=jt(Array.prototype.splice),Qr=Array.isArray,Yi=jt(String.prototype.toLowerCase),iu=jt(String.prototype.toString),_h=jt(String.prototype.match),Gi=jt(String.prototype.replace),jh=jt(String.prototype.indexOf),ik=jt(String.prototype.trim),ok=jt(Number.prototype.toString),lk=jt(Boolean.prototype.toString),Rh=typeof BigInt>"u"?null:jt(BigInt.prototype.toString),Ah=typeof Symbol>"u"?null:jt(Symbol.prototype.toString),Ut=jt(Object.prototype.hasOwnProperty),qi=jt(Object.prototype.toString),Ft=jt(RegExp.prototype.test),vs=ak(TypeError);function jt(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return Eu(n,r,o)}}function ak(n){return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return _u(n,s)}}function We(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yi;if(Ch&&Ch(n,null),!Qr(r))return n;let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const u=s(a);u!==a&&(ek(r)||(r[o]=u),a=u)}n[a]=!0}return n}function ck(n){for(let r=0;r<n.length;r++)Ut(n,r)||(n[r]=null);return n}function rn(n){const r=Zs(null);for(const o of gg(n)){var s=Z1(o,2);const a=s[0],u=s[1];Ut(n,a)&&(Qr(u)?r[a]=ck(u):u&&typeof u=="object"&&u.constructor===Object?r[a]=rn(u):r[a]=u)}return r}function uk(n){switch(typeof n){case"string":return n;case"number":return ok(n);case"boolean":return lk(n);case"bigint":return Rh?Rh(n):"0";case"symbol":return Ah?Ah(n):"Symbol()";case"undefined":return qi(n);case"function":case"object":{if(n===null)return qi(n);const r=n,s=tr(r,"toString");if(typeof s=="function"){const o=s(r);return typeof o=="string"?o:qi(o)}return qi(n)}default:return qi(n)}}function tr(n,r){for(;n!==null;){const o=nk(n,r);if(o){if(o.get)return jt(o.get);if(typeof o.value=="function")return jt(o.value)}n=tk(n)}function s(){return null}return s}function dk(n){try{return Ft(n,""),!0}catch{return!1}}const Ih=Gt(["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"]),ou=Gt(["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"]),lu=Gt(["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"]),fk=Gt(["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"]),au=Gt(["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"]),pk=Gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dh=Gt(["#text"]),Mh=Gt(["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"]),cu=Gt(["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"]),Lh=Gt(["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"]),El=Gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hk=Kt(/{{[\w\W]*|^[\w\W]*}}/g),mk=Kt(/<%[\w\W]*|^[\w\W]*%>/g),gk=Kt(/\${[\w\W]*/g),vk=Kt(/^data-[\-\w.\u00B7-\uFFFF]+$/),yk=Kt(/^aria-[\-\w]+$/),Ph=Kt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xk=Kt(/^(?:\w+script|data):/i),wk=Kt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kk=Kt(/^html$/i),Sk=Kt(/^[a-z][.\w]*(-[.\w]+)+$/i),Oh=Kt(/<[/\w!]/g),zh=Kt(/<[/\w]/g),Tk=Kt(/<\/no(script|embed|frames)/i),bk=Kt(/\/>/i),Dn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Nk=function(){return typeof window>"u"?null:window},Ck=function(r,s){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(o=s.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return r.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},$h=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Yr=function(r,s,o,a){return Ut(r,s)&&Qr(r[s])?We(a.base?rn(a.base):{},r[s],a.transform):o};function yg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nk();const r=re=>yg(re);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==Dn.document||!n.Element)return r.isSupported=!1,r;let s=n.document;const o=s,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,h=n.Element,m=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const x=n.DOMParser,w=n.trustedTypes,y=h.prototype,T=tr(y,"cloneNode"),j=tr(y,"remove"),C=tr(y,"nextSibling"),b=tr(y,"childNodes"),D=tr(y,"parentNode"),A=tr(y,"shadowRoot"),U=tr(y,"attributes"),L=f&&f.prototype?tr(f.prototype,"nodeType"):null,H=f&&f.prototype?tr(f.prototype,"nodeName"):null,X=f&&f.prototype?tr(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const re=s.createElement("template");re.content&&re.content.ownerDocument&&(s=re.content.ownerDocument)}let K,q="",ie,fe=!1,ce=0;const Le=function(){if(ce>0)throw vs('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.')},Re=function(S){Le(),ce++;try{return K.createHTML(S)}finally{ce--}},Oe=function(S){Le(),ce++;try{return K.createScriptURL(S)}finally{ce--}},G=function(){return fe||(ie=Ck(w,a),fe=!0),ie},Y=s,te=Y.implementation,z=Y.createNodeIterator,Q=Y.createDocumentFragment,V=Y.getElementsByTagName,E=o.importNode;let I=$h();r.isSupported=typeof gg=="function"&&typeof D=="function"&&te&&te.createHTMLDocument!==void 0;const le=hk,ae=mk,he=gk,ye=vk,_e=yk,Se=xk,Ae=wk,be=Sk;let lt=Ph,je=null;const St=We({},[...Ih,...ou,...lu,...au,...Dh]);let Pe=null;const Mt=We({},[...Mh,...cu,...Lh,...El]);let $e=Object.seal(Zs(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}})),Yt=null,bn=null;const pt=Object.seal(Zs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xt=!0,W=!0,Ie=!1,M=!0,oe=!1,Ne=!0,ue=!1,ze=!1,Fe=null,Je=null,dt=!1,tt=!1,fn=!1,Nn=!1,pn=!0,Cn=!1;const Be="user-content-";let nt=!0,Lt=!1,Pn={},Xt=null;const On=We({},["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 it=null;const Rt=We({},["audio","video","img","source","image","track"]);let Ct=null;const hn=We({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Et="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml";let Qt=at,rt=!1,Zt=null;const Pt=We({},[Et,Tt,at],iu),mn=Gt(["mi","mo","mn","ms","mtext"]);let sn=We({},mn);const En=Gt(["annotation-xml"]);let Wt=We({},En);const qn=We({},["title","style","font","a","script"]);let Kn=null;const ua=["application/xhtml+xml","text/html"],da="text/html";let Xe=null,hr=null;const ho=s.createElement("form"),mo=function(S){return S instanceof RegExp||S instanceof Function},Ss=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(hr&&hr===S)return;(!S||typeof S!="object")&&(S={}),S=rn(S),Kn=ua.indexOf(S.PARSER_MEDIA_TYPE)===-1?da:S.PARSER_MEDIA_TYPE,Xe=Kn==="application/xhtml+xml"?iu:Yi,je=Yr(S,"ALLOWED_TAGS",St,{transform:Xe}),Pe=Yr(S,"ALLOWED_ATTR",Mt,{transform:Xe}),Zt=Yr(S,"ALLOWED_NAMESPACES",Pt,{transform:iu}),Ct=Yr(S,"ADD_URI_SAFE_ATTR",hn,{transform:Xe,base:hn}),it=Yr(S,"ADD_DATA_URI_TAGS",Rt,{transform:Xe,base:Rt}),Xt=Yr(S,"FORBID_CONTENTS",On,{transform:Xe}),Yt=Yr(S,"FORBID_TAGS",rn({}),{transform:Xe}),bn=Yr(S,"FORBID_ATTR",rn({}),{transform:Xe}),Pn=Ut(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?rn(S.USE_PROFILES):S.USE_PROFILES:!1,xt=S.ALLOW_ARIA_ATTR!==!1,W=S.ALLOW_DATA_ATTR!==!1,Ie=S.ALLOW_UNKNOWN_PROTOCOLS||!1,M=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,oe=S.SAFE_FOR_TEMPLATES||!1,Ne=S.SAFE_FOR_XML!==!1,ue=S.WHOLE_DOCUMENT||!1,tt=S.RETURN_DOM||!1,fn=S.RETURN_DOM_FRAGMENT||!1,Nn=S.RETURN_TRUSTED_TYPE||!1,dt=S.FORCE_BODY||!1,pn=S.SANITIZE_DOM!==!1,Cn=S.SANITIZE_NAMED_PROPS||!1,nt=S.KEEP_CONTENT!==!1,Lt=S.IN_PLACE||!1,lt=dk(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:Ph,Qt=typeof S.NAMESPACE=="string"?S.NAMESPACE:at,sn=Ut(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?rn(S.MATHML_TEXT_INTEGRATION_POINTS):We({},mn),Wt=Ut(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?rn(S.HTML_INTEGRATION_POINTS):We({},En);const O=Ut(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?rn(S.CUSTOM_ELEMENT_HANDLING):Zs(null);if($e=Zs(null),Ut(O,"tagNameCheck")&&mo(O.tagNameCheck)&&($e.tagNameCheck=O.tagNameCheck),Ut(O,"attributeNameCheck")&&mo(O.attributeNameCheck)&&($e.attributeNameCheck=O.attributeNameCheck),Ut(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),Kt($e),oe&&(W=!1),fn&&(tt=!0),Pn&&(je=We({},Dh),Pe=Zs(null),Pn.html===!0&&(We(je,Ih),We(Pe,Mh)),Pn.svg===!0&&(We(je,ou),We(Pe,cu),We(Pe,El)),Pn.svgFilters===!0&&(We(je,lu),We(Pe,cu),We(Pe,El)),Pn.mathMl===!0&&(We(je,au),We(Pe,Lh),We(Pe,El))),pt.tagCheck=null,pt.attributeCheck=null,Ut(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?pt.tagCheck=S.ADD_TAGS:Qr(S.ADD_TAGS)&&(je===St&&(je=rn(je)),We(je,S.ADD_TAGS,Xe))),Ut(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?pt.attributeCheck=S.ADD_ATTR:Qr(S.ADD_ATTR)&&(Pe===Mt&&(Pe=rn(Pe)),We(Pe,S.ADD_ATTR,Xe))),Ut(S,"ADD_URI_SAFE_ATTR")&&Qr(S.ADD_URI_SAFE_ATTR)&&We(Ct,S.ADD_URI_SAFE_ATTR,Xe),Ut(S,"FORBID_CONTENTS")&&Qr(S.FORBID_CONTENTS)&&(Xt===On&&(Xt=rn(Xt)),We(Xt,S.FORBID_CONTENTS,Xe)),Ut(S,"ADD_FORBID_CONTENTS")&&Qr(S.ADD_FORBID_CONTENTS)&&(Xt===On&&(Xt=rn(Xt)),We(Xt,S.ADD_FORBID_CONTENTS,Xe)),nt&&(je["#text"]=!0),ue&&We(je,["html","head","body"]),je.table&&(We(je,["tbody"]),delete Yt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw vs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=K;K=S.TRUSTED_TYPES_POLICY;try{q=Re("")}catch(ge){throw K=Z,ge}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,q=""):(K===void 0&&(K=G()),K&&typeof q=="string"&&(q=Re("")));Gt&&Gt(S),hr=S},ci=We({},[...ou,...lu,...fk]),ui=We({},[...au,...pk]),go=function(S,O,Z){return O.namespaceURI===at?S==="svg":O.namespaceURI===Et?S==="svg"&&(Z==="annotation-xml"||sn[Z]):!!ci[S]},fa=function(S,O,Z){return O.namespaceURI===at?S==="math":O.namespaceURI===Tt?S==="math"&&Wt[Z]:!!ui[S]},pa=function(S,O,Z){return O.namespaceURI===Tt&&!Wt[Z]||O.namespaceURI===Et&&!sn[Z]?!1:!ui[S]&&(qn[S]||!ci[S])},ht=function(S){let O=D(S);(!O||!O.tagName)&&(O={namespaceURI:Qt,tagName:"template"});const Z=Yi(S.tagName),ge=Yi(O.tagName);return Zt[S.namespaceURI]?S.namespaceURI===Tt?go(Z,O,ge):S.namespaceURI===Et?fa(Z,O,ge):S.namespaceURI===at?pa(Z,O,ge):!!(Kn==="application/xhtml+xml"&&Zt[S.namespaceURI]):!1},ir=function(S){Xs(r.removed,{element:S});try{D(S).removeChild(S)}catch{if(j(S),!D(S))throw vs("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},jr=function(S){Jr(S);const O=b(S);if(O){const ge=[];Ys(O,we=>{Xs(ge,we)}),Ys(ge,we=>{try{j(we)}catch{}})}const Z=U(S);if(Z)for(let ge=Z.length-1;ge>=0;--ge){const we=Z[ge],Me=we&&we.name;if(typeof Me=="string")try{S.removeAttribute(Me)}catch{}}},or=function(S,O){try{Xs(r.removed,{attribute:O.getAttributeNode(S),from:O})}catch{Xs(r.removed,{attribute:null,from:O})}if(O.removeAttribute(S),S==="is")if(tt||fn)try{ir(O)}catch{}else try{O.setAttribute(S,"")}catch{}},Ts=function(S){const O=U(S);if(O)for(let Z=O.length-1;Z>=0;--Z){const ge=O[Z],we=ge&&ge.name;if(!(typeof we!="string"||Pe[Xe(we)]))try{S.removeAttribute(we)}catch{}}},Jr=function(S){const O=[S];for(;O.length>0;){const Z=O.pop();(L?L(Z):Z.nodeType)===Dn.element&&Ts(Z);const we=b(Z);if(we)for(let Me=we.length-1;Me>=0;--Me)O.push(we[Me])}},vo=function(S){if(!Ne)return;const O=[S];for(;O.length>0;){const Z=O.pop(),ge=L?L(Z):Z.nodeType;if(ge===Dn.processingInstruction||ge===Dn.comment&&Ft(zh,Z.data)){try{j(Z)}catch{}continue}if(ge===Dn.element){const Me=Z,Ge=Xe(H?H(Z):Z.nodeName);try{Me.hasAttribute&&Me.hasAttribute("patchsrc")&&Me.removeAttribute("patchsrc"),Me.hasAttribute&&Me.hasAttribute("for")&&Ge!=="label"&&Ge!=="output"&&Me.removeAttribute("for")}catch{}}const we=b(Z);if(we)for(let Me=we.length-1;Me>=0;--Me)O.push(we[Me])}},es=function(S){let O=null,Z=null;if(dt)S="<remove></remove>"+S;else{const Me=_h(S,/^[\r\n\t ]+/);Z=Me&&Me[0]}Kn==="application/xhtml+xml"&&Qt===at&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const ge=K?Re(S):S;if(Qt===at)try{O=new x().parseFromString(ge,Kn)}catch{}if(!O||!O.documentElement){O=te.createDocument(Qt,"template",null);try{O.documentElement.innerHTML=rt?q:ge}catch{}}const we=O.body||O.documentElement;return S&&Z&&we.insertBefore(s.createTextNode(Z),we.childNodes[0]||null),Qt===at?V.call(O,ue?"html":"body")[0]:ue?O.documentElement:we},_n=function(S){const O=X?X(S):S.ownerDocument;return z.call(O||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},bs=function(S){return S=Gi(S,le," "),S=Gi(S,ae," "),S=Gi(S,he," "),S},on=function(S){var O;S.normalize();const Z=X?X(S):S.ownerDocument,ge=z.call(Z||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let we=ge.nextNode();for(;we;)we.data=bs(we.data),we=ge.nextNode();const Me=(O=S.querySelectorAll)===null||O===void 0?void 0:O.call(S,"template");Me&&Ys(Me,Ge=>{Rr(Ge.content)&&on(Ge.content)})},Ns=function(S){const O=H?H(S):null;return typeof O!="string"||Xe(O)!=="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!==L(S)||S.childNodes!==b(S)},Rr=function(S){if(!L||typeof S!="object"||S===null)return!1;try{return L(S)===Dn.documentFragment}catch{return!1}},ts=function(S){if(!L||typeof S!="object"||S===null)return!1;try{return typeof L(S)=="number"}catch{return!1}};function ln(re,S,O){re.length!==0&&Ys(re,Z=>{Z.call(r,S,O,hr)})}const Cs=function(S,O){return!!(Ne&&S.hasChildNodes()&&!ts(S.firstElementChild)&&Ft(Oh,S.textContent)&&Ft(Oh,S.innerHTML)||Ne&&S.namespaceURI===at&&O==="style"&&ts(S.firstElementChild)||S.nodeType===Dn.processingInstruction||Ne&&S.nodeType===Dn.comment&&Ft(zh,S.data))},ns=function(S,O,Z){if(!Yt[O]&&fi(O)&&($e.tagNameCheck instanceof RegExp&&Ft($e.tagNameCheck,O)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(O)))return!1;if(nt&&!Xt[O]){const ge=D(S),we=b(S);if(we&&ge){const Me=we.length;for(let Ge=Me-1;Ge>=0;--Ge){const Ke=S===Z?T(we[Ge],!0):we[Ge];ge.insertBefore(Ke,C(S))}}}return ir(S),!0},rs=function(S,O,Z,ge){return S.length===0?O:O===Z||O===ge?rn(O):O},yo=function(S,O){if(ln(I.beforeSanitizeElements,S,null),S!==O&&D(S)===null)return Lt&&Jr(S),!0;if(Ns(S))return ir(S),!0;const Z=Xe(H?H(S):S.nodeName);if(je=rs(I.uponSanitizeElement,je,St,Fe),ln(I.uponSanitizeElement,S,{tagName:Z,allowedTags:je}),S!==O&&D(S)===null)return Lt&&Jr(S),!0;if(Cs(S,Z))return ir(S),!0;if(Yt[Z]||!(pt.tagCheck instanceof Function&&pt.tagCheck(Z))&&!je[Z]){const we=ns(S,Z,O);return we===!1&&ln(I.afterSanitizeElements,S,null),we}if((L?L(S):S.nodeType)===Dn.element&&!ht(S)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&Ft(Tk,S.innerHTML))return ir(S),!0;if(oe&&S.nodeType===Dn.text){const we=bs(S.textContent);S.textContent!==we&&(Xs(r.removed,{element:S.cloneNode()}),S.textContent=we)}return ln(I.afterSanitizeElements,S,null),!1},xo=function(S,O,Z){if(bn[O]||Ne&&O==="patchsrc"||Ne&&O==="for"&&S!=="label"&&S!=="output"||pn&&(O==="id"||O==="name")&&(Z in s||Z in ho))return!1;const ge=Pe[O]||pt.attributeCheck instanceof Function&&pt.attributeCheck(O,S);if(!(W&&Ft(ye,O))){if(!(xt&&Ft(_e,O))){if(ge){if(!Ct[O]){if(!Ft(lt,Gi(Z,Ae,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&S!=="script"&&jh(Z,"data:")===0&&it[S])){if(!(Ie&&!Ft(Se,Gi(Z,Ae,"")))){if(Z)return!1}}}}}else if(!(fi(S)&&($e.tagNameCheck instanceof RegExp&&Ft($e.tagNameCheck,S)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(S))&&($e.attributeNameCheck instanceof RegExp&&Ft($e.attributeNameCheck,O)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(O,S))||O==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&Ft($e.tagNameCheck,Z)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(Z))))return!1}}return!0},di=We({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),fi=function(S){return!di[Yi(S)]&&Ft(be,S)},pi=function(S,O,Z,ge){if(K&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Z)switch(w.getAttributeType(S,O)){case"TrustedHTML":return Re(ge);case"TrustedScriptURL":return Oe(ge)}return ge},ss=function(S,O,Z,ge){try{Z?S.setAttributeNS(Z,O,ge):S.setAttribute(O,ge),Ns(S)?ir(S):Eh(r.removed)}catch{or(O,S)}},wo=function(S){ln(I.beforeSanitizeAttributes,S,null);const O=S.attributes;if(!O||Ns(S))return;Pe=rs(I.uponSanitizeAttribute,Pe,Mt,Je);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let ge=O.length;const we=Xe(S.nodeName);for(;ge--;){const Me=O[ge],Ge=Me.name,Ke=Me.namespaceURI,mt=Me.value,gt=Xe(Ge),mr=mt;let bt=Ge==="value"?mr:ik(mr);if(Z.attrName=gt,Z.attrValue=bt,Z.keepAttr=!0,Z.forceKeepAttr=void 0,ln(I.uponSanitizeAttribute,S,Z),bt=Z.attrValue,Cn&&(gt==="id"||gt==="name")&&jh(bt,Be)!==0&&(or(Ge,S),bt=Be+bt),Ne&&Ft(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,bt)){or(Ge,S);continue}if(gt==="attributename"&&_h(bt,"href")){or(Ge,S);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){or(Ge,S);continue}if(!M&&Ft(bk,bt)){or(Ge,S);continue}if(oe&&(bt=bs(bt)),!xo(we,gt,bt)){or(Ge,S);continue}bt=pi(we,gt,Ke,bt),bt!==mr&&ss(S,Ge,Ke,bt)}}ln(I.afterSanitizeAttributes,S,null)},Ar=function(S){let O=null;const Z=_n(S);for(ln(I.beforeSanitizeShadowDOM,S,null);O=Z.nextNode();)if(ln(I.uponSanitizeShadowNode,O,null),yo(O,S),wo(O),Rr(O.content)&&Ar(O.content),(L?L(O):O.nodeType)===Dn.element){const we=A(O);Rr(we)&&(Ve(we),Ar(we))}ln(I.afterSanitizeShadowDOM,S,null)},Ve=function(S){const O=[{node:S,shadow:null}];for(;O.length>0;){const Z=O.pop();if(Z.shadow){Ar(Z.shadow);continue}const ge=Z.node,Me=(L?L(ge):ge.nodeType)===Dn.element,Ge=b(ge);if(Ge)for(let Ke=Ge.length-1;Ke>=0;--Ke)O.push({node:Ge[Ke],shadow:null});if(Me){const Ke=H?H(ge):null;if(typeof Ke=="string"&&Xe(Ke)==="template"){const mt=ge.content;Rr(mt)&&O.push({node:mt,shadow:null})}}if(Me){const Ke=A(ge);Rr(Ke)&&O.push({node:null,shadow:Ke},{node:Ke,shadow:null})}}};return r.sanitize=function(re){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,Z=null,ge=null,we=null;if(rt=!re,rt&&(re="<!-->"),typeof re!="string"&&!ts(re)&&(re=uk(re),typeof re!="string"))throw vs("dirty is not a string, aborting");if(!r.isSupported)return re;ze?(je=Fe,Pe=Je):Ss(S),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(je=rn(je)),I.uponSanitizeAttribute.length>0&&(Pe=rn(Pe)),r.removed=[];const Me=Lt&&typeof re!="string"&&ts(re);if(Me){vo(re);const mt=H?H(re):re.nodeName;if(typeof mt=="string"){const gt=Xe(mt);if(!je[gt]||Yt[gt])throw jr(re),vs("root node is forbidden and cannot be sanitized in-place")}if(Ns(re))throw jr(re),vs("root node is clobbered and cannot be sanitized in-place");try{Ve(re)}catch(gt){throw jr(re),gt}}else if(ts(re))O=es("<!---->"),Z=O.ownerDocument.importNode(re,!0),Z.nodeType===Dn.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?O=Z:O.appendChild(Z),Ve(Z);else{if(!tt&&!oe&&!ue&&re.indexOf("<")===-1)return K&&Nn?Re(re):re;if(O=es(re),!O)return tt?null:Nn?q:""}O&&dt&&ir(O.firstChild);const Ge=Me?re:O;try{const mt=_n(Ge);for(;ge=mt.nextNode();)yo(ge,Ge),wo(ge),Rr(ge.content)&&Ar(ge.content)}catch(mt){throw Me&&(jr(re),Ys(r.removed,gt=>{gt.element&&Jr(gt.element)})),mt}if(Me)return Ys(r.removed,mt=>{mt.element&&Jr(mt.element)}),oe&&on(re),re;if(tt){if(oe&&on(O),fn)for(we=Q.call(O.ownerDocument);O.firstChild;)we.appendChild(O.firstChild);else we=O;return(Pe.shadowroot||Pe.shadowrootmode)&&(we=E.call(o,we,!0)),we}let Ke=ue?O.outerHTML:O.innerHTML;return ue&&je["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Ft(kk,O.ownerDocument.doctype.name)&&(Ke="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
415
|
+
`+Ke),oe&&(Ke=bs(Ke)),K&&Nn?Re(Ke):Ke},r.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ss(re),ze=!0,Fe=je,Je=Pe},r.clearConfig=function(){hr=null,ze=!1,Fe=null,Je=null,K=ie,q=""},r.isValidAttribute=function(re,S,O){hr||Ss({});const Z=Xe(re),ge=Xe(S);return xo(Z,ge,O)},r.addHook=function(re,S){typeof S=="function"&&Ut(I,re)&&Xs(I[re],S)},r.removeHook=function(re,S){if(Ut(I,re)){if(S!==void 0){const O=rk(I[re],S);return O===-1?void 0:sk(I[re],O,1)[0]}return Eh(I[re])}},r.removeHooks=function(re){Ut(I,re)&&(I[re]=[])},r.removeAllHooks=function(){I=$h()},r}var fd=yg();const Ek=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Fh(n){return Ek.has(n.type)}function _k({items:n,runtimeType:r,turn:s,threads:o=[]}){const[a,u]=k.useState(!1);if(n.length===0)return null;const f=n.length;return c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>u(h=>!h),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(h0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(qu,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&c.jsx("div",{className:"tool-calls-body",children:n.map(h=>c.jsx(br,{item:h,runtimeType:r,turn:s,threads:o},h.id))})]})}He.setOptions({breaks:!0,gfm:!0});function jk(n){const r=He.parse(n);return fd.sanitize(r)}function Uh(n,r){var a;const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;s.nextNode();){const u=s.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>r)return{node:u,offset:r-o};o+=f}return null}function Rk(n,r){n.querySelectorAll("mark[data-thread-id]").forEach(s=>{const o=s.parentNode;if(!o)return;const a=document.createTextNode(s.textContent||"");o.replaceChild(a,s),o.normalize()});for(const s of r){if(s.start_offset===null||s.end_offset===null)continue;const o=Uh(n,s.start_offset),a=Uh(n,s.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset);const f=document.createElement("mark");f.setAttribute("data-thread-id",s.id),s.status==="resolved"&&f.classList.add("thread-mark-resolved");try{u.surroundContents(f)}catch{const h=u.extractContents();f.appendChild(h),u.insertNode(f)}}}function Ak(n){const r=window.getSelection();if(!r||r.rangeCount===0)return null;const s=r.getRangeAt(0);if(s.collapsed||!n.contains(s.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(s.startContainer,s.startOffset);const a=o.toString().length,u=s.toString();return{start:a,end:a+u.length,text:u}}function Ik({itemId:n,turnId:r,sessionId:s,content:o,threads:a}){const u=k.useRef(null),f=k.useRef(null),h=k.useRef(null),m=k.useRef(""),g=k.useRef(0),[x,w]=k.useState(!1),[y,T]=k.useState({x:0,y:0}),[j,C]=k.useState(!1),[b,D]=k.useState({x:0,y:0}),[A,U]=k.useState(""),[L,H]=k.useState(null),[X,K]=k.useState(!1),q=P(V=>V.createThread),ie=P(V=>V.switchRightTab),fe=P(V=>Jl(V.sessionDetails[s])),ce=k.useCallback(async()=>{await Tu(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),Le=k.useCallback(()=>{var E;if(!L)return;const V=`
|
|
416
|
+
\`\`\`QUOTE
|
|
417
|
+
${L.text}
|
|
418
|
+
\`\`\`
|
|
419
|
+
|
|
420
|
+
`;P.setState({quotedText:V}),w(!1),H(null),(E=window.getSelection())==null||E.removeAllRanges()},[L]),Re=k.useMemo(()=>jk(o||"…"),[o]),Oe=k.useMemo(()=>a.filter(V=>V.item_id===n),[a,n]);k.useEffect(()=>{u.current&&Rk(u.current,Oe)},[Re,Oe]),k.useEffect(()=>{m.current=A},[A]),k.useEffect(()=>{function V(E){f.current&&!f.current.contains(E.target)&&(w(!1),m.current.trim()||C(!1))}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const G=k.useCallback(()=>{w(!1),m.current.trim()||C(!1)},[]),Y=k.useCallback(()=>{const V=u.current;if(!V)return;const E=Ak(V);if(E&&E.text.trim().length>0){const I=window.getSelection();if(I&&I.rangeCount>0&&I.anchorNode&&I.focusNode){const ae=I.getRangeAt(0).getBoundingClientRect(),he=28,ye=6,_e=170;let Se=!1;try{const lt=document.createRange();lt.setStart(I.focusNode,I.focusOffset),lt.setEnd(I.focusNode,I.focusOffset);const je=document.createRange();je.setStart(I.anchorNode,I.anchorOffset),je.setEnd(I.anchorNode,I.anchorOffset),Se=je.compareBoundaryPoints(Range.START_TO_START,lt)>0}catch{Se=!1}let Ae=ae.top-he-ye;Ae<8&&(Ae=ae.bottom+ye);let be=Se?ae.left-_e:ae.right;be=Math.max(8,Math.min(be,window.innerWidth-_e-8)),T({x:be,y:Ae}),w(!0),H(E)}}else w(!1)},[]);k.useEffect(()=>{function V(E){const I=E.target;I&&(I.closest(".selection-actions")||I.closest(".thread-create-popover"))||Y()}return document.addEventListener("mouseup",V),()=>document.removeEventListener("mouseup",V)},[Y]);const te=k.useCallback(()=>{w(!1),C(!0),D({x:y.x,y:y.y})},[y]);k.useLayoutEffect(()=>{if(!j)return;const V=h.current;if(!V)return;const E=V.offsetWidth,I=V.offsetHeight,le=8;let ae=y.x,he=y.y;ae-E<le&&(ae=E+le),ae>window.innerWidth-le&&(ae=window.innerWidth-le),he<le&&(he=le),he+I>window.innerHeight-le&&(he=window.innerHeight-I-le),D({x:ae,y:he})},[j,y]);const z=k.useCallback(async()=>{var V;fe||!L||!A.trim()||(await q(s,{itemId:n,turnId:r,startOffset:L.start,endOffset:L.end,selectedText:L.text,message:A.trim()}),U(""),C(!1),H(null),(V=window.getSelection())==null||V.removeAllRanges(),ie("threads"))},[L,A,q,s,n,r,ie,fe]),Q=k.useCallback(V=>{const E=V.target;if(E.tagName==="MARK"&&E.hasAttribute("data-thread-id")){V.preventDefault(),ie("threads");const I=E.getAttribute("data-thread-id");setTimeout(()=>{const le=document.getElementById(`thread-${I}`);le&&(le.scrollIntoView({behavior:"smooth",block:"center"}),le.classList.add("thread-card-highlighted"),setTimeout(()=>le.classList.remove("thread-card-highlighted"),1500))},100)}},[ie]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:Re},onMouseDown:G,onClick:Q}),c.jsx("button",{className:`copy-text-btn${X?" copied":""}`,onClick:ce,title:X?"Copied":"Copy message","aria-label":"Copy message text",children:X?c.jsx(Zr,{size:14}):c.jsx(yu,{size:14})}),x&&!j&&c.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!fe&&c.jsxs("button",{className:"discuss-button",onClick:te,title:"Start a discussion about this text",children:[c.jsx(e0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:Le,title:"Quote this text in your message",children:[c.jsx(jm,{size:14}),c.jsx("span",{children:"Quote"})]})]}),j&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:b.x,top:b.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',L==null?void 0:L.text.slice(0,80),L&&L.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),H(null)},children:c.jsx(Gn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:A,onChange:V=>U(V.target.value),autoFocus:!0,rows:2,onKeyDown:V=>{if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),z()),V.key==="Escape")if(m.current.trim()){const E=Date.now();g.current&&E-g.current<400?(g.current=0,C(!1),H(null)):g.current=E}else C(!1),H(null)}}),c.jsxs("div",{className:"thread-create-footer",children:[c.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),c.jsxs("button",{className:"thread-create-send",onClick:z,disabled:!A.trim()||fe,title:fe?"Wait for the running turn to finish first":void 0,children:[c.jsx(na,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const Bh=k.memo(Ik),Ql=new Map,xg=new Set,ju=new Set,Wh=new Map;function wg(){ju.forEach(n=>n())}function kg(n,r){return`${n}:${r}`}function Dk(n,r,s,o,a){var m;const u=kg(r,s),f=Ql.get(n)??new Map,h=new Map(f);((m=h.get(u))==null?void 0:m.answer)===a?h.delete(u):h.set(u,{itemIndex:r,groupIndex:s,question:o,answer:a}),Ql.set(n,h),wg()}function Mk(n){Ql.delete(n),wg()}function Lk(n){xg.add(n),Mk(n)}function Pk(n){const r=k.useCallback(s=>(ju.add(s),()=>{ju.delete(s)}),[]);return k.useSyncExternalStore(r,()=>Ql.get(n)??Wh,()=>Wh)}function Ok(n){return[...n].sort((r,s)=>r.itemIndex-s.itemIndex||r.groupIndex-s.groupIndex).map(r=>`> ${r.question}
|
|
421
|
+
${r.answer}`).join(`
|
|
422
|
+
|
|
423
|
+
`)}function Hh({item:n,turn:r}){var T;const s=n.data??{},o=k.useMemo(()=>Array.isArray(s.groups)?s.groups.filter(j=>!!j&&Array.isArray(j.selections)&&j.selections.length>0):[],[s.groups]),a=Pk(r.id),u=P(j=>r.session_id?j.sessionDetails[r.session_id]:null),f=P(j=>j.activeSessionId),h=r.items.findIndex(j=>j.id===n.id),m=u?((T=u.turns[u.turns.length-1])==null?void 0:T.id)===r.id:!0,g=xg.has(r.id),x=g||ym(u)||!m||r.session_id!==f,w=(j,C,b)=>{x||Dk(r.id,h,j,C,b)},y=()=>{const j=[...a.values()];if(j.length===0)return;const C=Ok(j);Lk(r.id),P.getState().submitPrompt(C)};return c.jsxs("div",{className:"render-content ask-user-card",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Ux,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),g&&c.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?c.jsxs("div",{className:"ask-user-groups",children:[o.map((j,C)=>c.jsxs("div",{className:"ask-user-group",children:[j.question&&c.jsx("div",{className:"ask-user-question",children:j.question}),c.jsx("div",{className:"ask-user-options",children:j.selections.map(b=>{var A;const D=((A=a.get(kg(h,C)))==null?void 0:A.answer)===b;return c.jsx("button",{type:"button",className:`ask-user-option ${D?"selected":""}`,disabled:x,onClick:()=>w(C,j.question,b),children:b},b)})})]},C)),x?g&&c.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):c.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:y,children:[c.jsx(na,{size:12}),"Send"]})]}):s.question?c.jsx("p",{className:"user-message",children:s.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}He.setOptions({breaks:!0,gfm:!0});function zk({attachments:n}){const[r,s]=k.useState(null);return k.useEffect(()=>{if(!r)return;function o(a){a.key==="Escape"&&s(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),!Array.isArray(n)||n.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"attachment-pills",children:n.map((o,a)=>{const u=o.media_type.startsWith("image/"),f=`data:${o.media_type};base64,${o.data}`;return c.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>s(f):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?c.jsx("img",{src:f,alt:o.name,className:"attachment-pill-thumb"}):c.jsx(_m,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),r&&c.jsx("div",{className:"image-preview-modal",onClick:()=>s(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:r,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>s(null),children:c.jsx(Gn,{size:20})})]})})]})}function $k(n){const r=He.parse(n);return fd.sanitize(r)}function Vh(n){var r;return(r=n.data)!=null&&r.text?n.data.text:""}function Fk(n){const r=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return r?r[1]:n}const Gh='<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 Uk(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${Gh}</body>`):n+Gh}function Bk({html:n}){const[r,s]=k.useState(480),o=k.useRef(null);return k.useEffect(()=>{function a(u){var f;u.source===((f=o.current)==null?void 0:f.contentWindow)&&typeof u.data=="number"&&u.data>0&&s(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:Uk(n),title:"HTML content",style:{width:"100%",height:`${r}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const qh=1e4;function Wk({item:n,runtimeType:r,turn:s,threads:o}){var h,m,g,x,w,y,T,j;const a=n.status==="in_progress",[u,f]=k.useState(!1);switch(n.type){case"agent_message":{const{iconClass:C,iconText:b}=gu(r??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${C}`,children:b}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(Bh,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:Vh(n)||"…",threads:o,runtimeType:r})]})}case"reasoning":return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx($x,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:$k(Vh(n))}})]});case"command_execution":{const C=n.data||{},b=Fk(C.command||""),D=C.aggregated_output||"",A=C.exit_code,U=a?"running…":A!==null?`exit ${A}`:"",L=D.length>qh,H=L&&!u?D.slice(0,qh)+`
|
|
424
|
+
… (truncated, click to expand)`:D;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Am,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),U&&c.jsx("span",{className:"turn-header-meta",children:U})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:b})}),D&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:H})}),L&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(X=>!X),children:u?"Show less":`Show full output (${(D.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,b=Array.isArray(C)?C:[],D=`${b.length} file${b.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Gx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:D})]}),c.jsx("div",{className:"file-change-list",children:b.map((A,U)=>{const L=A.kind==="add"?"A":A.kind==="delete"?"D":"M",H=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${H}`,children:L}),c.jsx("span",{className:"fc-name",children:A.path})]},U)})})]})}case"mcp_tool_call":{const C=n.data||{},b=C.tool||"mcp";if(b==="Agent"){const q=C.arguments,ie=(q==null?void 0:q.description)||(q==null?void 0:q.prompt)||"Subagent",fe=n.status==="failed",ce=a?"running…":fe?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(vu,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ie}),c.jsx("span",{className:`agent-call-status ${a?"running":fe?"failed":"done"}`,children:ce})]})}const D=C.server||"",A=C.arguments,U=C.result,L=C.error,H=n.status==="failed"||!!L,X=a?"running…":H?"failed":"done",K=((m=U==null?void 0:U.content)==null?void 0:m.filter(q=>q.type==="text").map(q=>q.text))??[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(o0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",b]}),D&&c.jsx("span",{className:"turn-header-meta",children:D}),c.jsx("span",{className:"turn-header-meta",style:H?{color:"var(--red)"}:void 0,children:X})]}),A&&Object.keys(A).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(A).map(([q,ie])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:q}),q==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ie)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ie=="string"?ie:JSON.stringify(ie,null,2)})]},q))}),K.length>0&&K.map((q,ie)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:q})},ie)),L&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:L})})]})}case"web_search":{const C=((g=n.data)==null?void 0:g.query)||"";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(a0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:C})]})}case"todo_list":{const C=((x=n.data)==null?void 0:x.items)||[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Qx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((b,D)=>c.jsxs("li",{className:b.completed?"todo-done":"todo-pending",children:[b.completed?c.jsx(Zr,{size:14}):c.jsx(lo,{size:14})," ",b.text]},D))})]})}case"ask_user":return c.jsx(Hh,{item:n,turn:s});case"final_result":{const C=n.data??{},b=C.text||"",D=C.html||null,A=Array.isArray(C.groups)?C.groups.filter(H=>!!H&&Array.isArray(H.selections)&&H.selections.length>0):[],{iconClass:U,iconText:L}=gu(r??"codex");return c.jsxs(c.Fragment,{children:[(b||D)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${U}`,children:L}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),b&&c.jsx(Bh,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:b,threads:o,runtimeType:r}),D&&c.jsx(Bk,{html:D})]}),A.length>0&&c.jsx(Hh,{item:n,turn:s})]})}case"background_task":{const C=n.data||{},b=C.task_type||"unknown",D=C.subagent_type||null,A=C.description||"",U=C.status||"running",L=C.last_tool_name||null,H=C.token_count||null,X=b==="local_agent",K=b==="local_bash",q=X?vu:K?Rm:Em,ie=X?`Subagent${D?`: ${D}`:""}`:K?"Monitor":"Background Task",fe=U==="running"?"running…":U==="completed"?"done":U==="failed"?"failed":U==="stopped"?"stopped":U,ce=n.status==="failed"||U==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(q,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ie}),c.jsx("span",{className:"turn-header-meta",style:ce?{color:"var(--red)"}:void 0,children:fe})]}),A&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:A}),L&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",L,H!=null&&` · ${H.toLocaleString()} tokens`]}),c.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const C=((w=n.data)==null?void 0:w.trigger)??"auto",b=((y=n.data)==null?void 0:y.pre_tokens)??0,D=((T=n.data)==null?void 0:T.post_tokens)??0,A=b>0?Math.round((1-D/b)*100):0,U=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(n0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:U})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[b.toLocaleString()," → ",D.toLocaleString()," tokens (",A,"% reduction)"]})]})}case"error":{const C=((j=n.data)==null?void 0:j.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(Ku,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:C})})]})}default:return null}}const br=k.memo(Wk,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function Hk({turn:n,runtimeType:r,threads:s=[]}){qt.trackRender("TurnContent");const[o,a]=k.useState(!1);k.useEffect(()=>{const b=n.items.some(D=>D.type==="background_task"&&D.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!b&&a(!1)},[n.status,n.items]);let u=-1;for(let b=n.items.length-1;b>=0;b--)if(n.items[b].type==="agent_message"){u=b;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,m=n.items.some(b=>b.type==="final_result"||b.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,w=h.filter(b=>{var D;return!(b.type==="reasoning"&&(!((D=b.data)!=null&&D.text)||b.data.text===""))}).filter(b=>!(b.type==="background_task"||b.type==="ask_user"||b.type==="final_result")),y=[];let T=null;for(const b of w)b.type==="agent_message"?(T&&y.push(T),T={agentMessage:b,toolItems:[],otherItems:[]}):(T||(T={agentMessage:null,toolItems:[],otherItems:[]}),Fh(b)?T.toolItems.push(b):T.otherItems.push(b));T&&y.push(T);const j=w.filter(b=>Fh(b)).length,C=j>0||w.length>0&&(n.status==="running"||n.status==="pending");return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(zk,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(b=>!b),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(Yx,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:j>0?`${j} tool call${j>1?"s":""}`:"thinking…"}),c.jsx(qu,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:y.map((b,D)=>c.jsxs("div",{className:"intermediate-segment",children:[b.agentMessage&&c.jsx(br,{item:b.agentMessage,runtimeType:r,turn:n,threads:s}),b.otherItems.map(A=>c.jsx(br,{item:A,runtimeType:r,turn:n,threads:s},A.id)),b.toolItems.length>0&&c.jsx(_k,{items:b.toolItems,runtimeType:r,turn:n,threads:s})]},D))})]}),n.items.filter(b=>b.type==="background_task").map(b=>c.jsx(br,{item:b,runtimeType:r,turn:n,threads:s},`task-${b.id}`)),f&&c.jsx(br,{item:n.items[u],runtimeType:r,turn:n,threads:s},n.items[u].id),g&&c.jsx(br,{item:g,runtimeType:r,turn:n,threads:s},g.id),f&&n.items.slice(u+1).filter(b=>b.type!=="ask_user"&&b.type!=="background_task"&&b.type!=="final_result").map(b=>c.jsx(br,{item:b,runtimeType:r,turn:n,threads:s},b.id)),n.items.filter(b=>b.type==="final_result").map(b=>c.jsx(br,{item:b,runtimeType:r,turn:n,threads:s},`final-${b.id}`)),n.items.filter(b=>b.type==="ask_user").map(b=>c.jsx(br,{item:b,runtimeType:r,turn:n,threads:s},`ask-${b.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})})]})}const Vk=k.memo(Hk);function Sg(n,r="session",s=0){const o=[];if(r==="session")n.forEach((u,f)=>Kh(u,f,o));else{const u=n[s];u&&Kh(u,s,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function Kh(n,r,s){var o;for(const a of n.items)if(a.type==="file_change"&&((o=a.data)!=null&&o.changes)){const u=a.data.changes;for(const f of u)s.push({path:f.path,kind:f.kind,turnIdx:r})}}const Gk=[],_l=50;function qk(){qt.trackRender("RenderArea");const n=P(D=>D.activeSessionId),r=P(D=>D.activeSessionId?D.sessionDetails[D.activeSessionId]:null),s=P(D=>D.activeTurnIndex),o=P(D=>D.activeRightTab),a=P(D=>D.changesScope),u=P(D=>D.submittingPrompt),f=P(D=>D.loading),h=P(D=>D.selectedChangePath),m=P(D=>D.setSelectedChangePath),g=(r==null?void 0:r.turns)??[],x=(r==null?void 0:r.threads)??Gk,w=k.useRef(null),[y,T]=k.useState(_l);k.useEffect(()=>{T(_l)},[n]);const j=g.filter(D=>!D.thread_id),C=Math.max(0,j.length-y),b=j.slice(C);if(k.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[n,g.length]),k.useEffect(()=>{if(!h||o!=="changes")return;const D=setTimeout(()=>{const A=h.replace(/[^a-zA-Z0-9]/g,"-"),U=document.getElementById(`diff-${A}`);U&&(U.scrollIntoView({behavior:"smooth",block:"start"}),U.classList.add("diff-highlight"),setTimeout(()=>U.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(D)},[h,o,m]),o==="changes"){if(!r)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const D=Sg(g,a,s);return D.length===0?c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):c.jsx("div",{className:"render-scroll",ref:w,children:c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{style:{marginBottom:"20px"},children:[c.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"var(--text)"},children:a==="session"?"All Session Changes":"Current Turn Changes"}),c.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px"},children:[D.length," file",D.length>1?"s":""]})]}),D.map(A=>{const U=A.path.split("/").pop()||A.path,L=A.path.replace("/"+U,""),H=A.kind==="add"?"Added":A.kind==="delete"?"Deleted":"Modified",X=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod",K=A.kind==="add"?"A":A.kind==="delete"?"D":"M",q=A.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${q}`,children:[c.jsx("span",{className:`diff-file-status ${X}`,children:K}),c.jsxs("span",{className:"diff-file-name",children:[L&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[L,"/"]}),U]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${X}`,children:H})})]}),c.jsx("p",{style:{color:"var(--text-muted)",fontSize:"12px",fontStyle:"italic",padding:"8px 16px"},children:"Diff content not available (Codex SDK limitation)."})]},A.path)})]})})}return f&&!r?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):r?c.jsxs("div",{className:"render-scroll",ref:w,children:[u&&c.jsx("div",{className:"turn-block",children:c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:u})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),g.length===0&&!u&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),C>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>T(D=>D+_l),children:["Show ",Math.min(_l,C)," earlier turns (",C," hidden)"]})}),b.map((D,A)=>c.jsx("div",{id:`turn-${C+A}`,className:"turn-block",children:c.jsx(Vk,{turn:D,runtimeType:r.runtime_type,threads:x})},D.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const Kk=k.memo(qk),Yk=[{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 Xk(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function Qk(n,r,s=[]){const o=[...Yk,...Xk(s)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!r[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function Zk({commands:n,selectedIndex:r,onSelect:s,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===r?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>s(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function uu({title:n,options:r,currentValue:s,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),r.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===s?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===s&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function Jk(n){return Tn("/skills")}function eS({filter:n,onSelect:r,onClose:s}){const[o,a]=k.useState([]),[u,f]=k.useState(!0),[h,m]=k.useState(0),g=k.useRef(null);k.useEffect(()=>{Jk().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const x=o.filter(w=>w.name.toLowerCase().includes(n.toLowerCase())||w.description.toLowerCase().includes(n.toLowerCase()));return k.useEffect(()=>{m(0)},[n]),k.useEffect(()=>{function w(y){y.key==="ArrowDown"?(y.preventDefault(),m(T=>Math.min(T+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),m(T=>Math.max(T-1,0))):y.key==="Enter"?(y.preventDefault(),x[h]&&r(x[h])):y.key==="Escape"&&(y.preventDefault(),s())}return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[x,h,r,s]),c.jsxs("div",{className:"slash-popup",ref:g,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:s,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&x.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),x.map((w,y)=>c.jsxs("div",{className:`slash-popup-item ${y===h?"selected":""}`,onMouseEnter:()=>m(y),onClick:()=>r(w),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:w.name}),w.description&&c.jsx("span",{className:"slash-popup-hint",children:w.description})]}),!!w.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},w.id))]})}function tS(){return Tn("/providers")}function nS(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return Tn(`/providers/${n}/commands${s}`)}const rS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function sS(n){const[r,s]=k.useState([]),[o,a]=k.useState(!0);k.useEffect(()=>{tS().then(s).catch(()=>s([])).finally(()=>a(!1))},[]);const u=r.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??rS,loading:o}}const Qs=32,du=200;function Yh(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function Xh(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let Qh=0;function iS(){return Qh+=1,`att-${Date.now()}-${Qh}`}function oS(){qt.trackRender("CommandInputBar");const[n,r]=k.useState(""),s=k.useRef(null),o=k.useRef(Qs),a=k.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=P(),g=P(M=>M.activeSessionId),x=P(M=>M.activeSessionId?M.sessionDetails[M.activeSessionId]:null),w=P(M=>M.restoredPrompt),y=P(M=>M.quotedText),T=ym(x),j=!g,{capabilities:C}=sS(x==null?void 0:x.runtime_type),b=(x==null?void 0:x.runtime_type)??null,D=C.imageAttachments,[A,U]=k.useState([]),[L,H]=k.useState(!1),[X,K]=k.useState(null),[q,ie]=k.useState([]);k.useEffect(()=>{if(!b){ie([]);return}let M=!1;return nS(b,(x==null?void 0:x.cwd)??void 0).then(oe=>{M||ie(oe)}).catch(()=>{M||ie([])}),()=>{M=!0}},[b,x==null?void 0:x.cwd]);const[fe,ce]=k.useState(!1),[Le,Re]=k.useState(""),[Oe,G]=k.useState(0),[Y,te]=k.useState(void 0),[z,Q]=k.useState(!1),[V,E]=k.useState(""),[I,le]=k.useState([]),ae=fe?Qk(Le,C,q):[];k.useEffect(()=>{w!==null&&(r(w),requestAnimationFrame(()=>je()),P.setState({restoredPrompt:null}))},[w]),k.useEffect(()=>{y!==null&&(r(M=>M+y),setTimeout(()=>{if(s.current){je(),s.current.focus();const M=s.current.value.length;s.current.setSelectionRange(M,M)}},0),P.setState({quotedText:null}))},[y]),k.useEffect(()=>{if(!T)return;function M(oe){oe.key==="Escape"&&(oe.preventDefault(),f())}return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[T,f]),k.useEffect(()=>{ce(!1),te(void 0),Q(!1),le([]),U(M=>{for(const oe of M)oe.previewUrl&&URL.revokeObjectURL(oe.previewUrl);return[]})},[g]),k.useEffect(()=>{if(!X)return;function M(oe){oe.key==="Escape"&&(oe.preventDefault(),K(null))}return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[X]);const he=k.useCallback(M=>{if(!M)return;const oe=Array.from(M);for(const Ne of oe){const ue=new FileReader;ue.onload=()=>{const Fe=ue.result.split(",")[1]??"",Je=Ne.type.startsWith("image/")?URL.createObjectURL(Ne):void 0;U(dt=>[...dt,{id:iS(),name:Ne.name,media_type:Ne.type||"application/octet-stream",data:Fe,previewUrl:Je,size:Ne.size}])},ue.readAsDataURL(Ne)}},[]),ye=k.useCallback(M=>{U(oe=>{const Ne=oe.find(ue=>ue.id===M);return Ne!=null&&Ne.previewUrl&&URL.revokeObjectURL(Ne.previewUrl),oe.filter(ue=>ue.id!==M)})},[]),_e=k.useCallback(M=>{M.preventDefault(),M.stopPropagation(),!(!D||T)&&H(!0)},[D,T]),Se=k.useCallback(M=>{M.preventDefault(),M.stopPropagation(),H(!1)},[]),Ae=k.useCallback(M=>{M.preventDefault(),M.stopPropagation(),H(!1),!(!D||T)&&he(M.dataTransfer.files)},[D,T,he]),be=k.useCallback(M=>{var ue;if(!D)return;const oe=(ue=M.clipboardData)==null?void 0:ue.items;if(!oe)return;const Ne=[];for(let ze=0;ze<oe.length;ze++){const Fe=oe[ze];if(Fe.type.startsWith("image/")){const Je=Fe.getAsFile();Je&&Ne.push(Je)}}Ne.length>0&&(M.preventDefault(),he(Ne))},[D,he]);function lt(M){const oe=s.current;oe&&(oe.style.height=`${M}px`,o.current=M)}function je(){const M=s.current;if(M){if(M.scrollHeight>M.clientHeight){const oe=Math.min(M.scrollHeight,du);oe!==o.current&<(oe);return}o.current>Qs&&(M.style.height="auto",lt(Math.min(M.scrollHeight,du)))}}function St(){const M=n.trim();if(!M||T)return;let oe=M;I.length>0&&(oe=`${I.map(ze=>`$${ze.name}`).join(" ")}
|
|
425
|
+
|
|
426
|
+
${M}`);const Ne=A.map(({id:ue,previewUrl:ze,size:Fe,...Je})=>Je);r(""),le([]),lt(Qs),ce(!1),te(void 0),Q(!1);for(const ue of A)ue.previewUrl&&URL.revokeObjectURL(ue.previewUrl);U([]),u(oe,Ne.length>0?Ne:void 0)}function Pe(M){if(M.insertAsText){const oe=`/${M.id} `;r(oe),ce(!1),te(void 0),requestAnimationFrame(()=>{if(s.current){s.current.focus();const Ne=oe.length;s.current.setSelectionRange(Ne,Ne),je()}});return}M.subPopup?te(M.subPopup):M.id==="skills"?(Q(!0),E(""),ce(!1),r("")):M.id==="model"?(m(!0),ce(!1),r("")):(ce(!1),r(""))}function Mt(M){le(oe=>[...oe,M]),Q(!1),r(""),lt(Qs)}function $e(M){const oe=Yh(x==null?void 0:x.runtime_config);Y==="sandbox"?oe.sandboxMode=M:Y==="websearch"?oe.webSearchMode=M:Y==="network"&&(oe.networkAccessEnabled=M==="true"),h(oe),te(void 0),ce(!1),r(""),lt(Qs)}function Yt(M){if(qt.markKeystroke(),fe&&!Y){if(M.key==="ArrowDown"){M.preventDefault(),G(oe=>Math.min(oe+1,ae.length-1));return}if(M.key==="ArrowUp"){M.preventDefault(),G(oe=>Math.max(oe-1,0));return}if(M.key==="Enter"){M.preventDefault(),ae[Oe]&&Pe(ae[Oe]);return}if(M.key==="Escape"){M.preventDefault(),ce(!1),r("");return}}if(Y&&M.key==="Escape"){M.preventDefault(),te(void 0);return}if(M.key==="Enter"&&(M.metaKey||M.ctrlKey)&&!T){M.preventDefault(),St();return}M.key==="Escape"&&T&&(M.preventDefault(),f())}function bn(M){qt.markInputChange();const oe=M.target.value;r(oe),je(),oe.startsWith("/")&&!oe.includes(" ")&&!T?(ce(!0),Re(oe.slice(1)),G(0)):(ce(!1),te(void 0)),oe.startsWith("$")&&!T?(Q(!0),E(oe.slice(1))):oe.startsWith("$")||Q(!1)}const pt=Yh(x==null?void 0:x.runtime_config),xt=[{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"}],W=[{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"}],Ie=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return c.jsxs("div",{className:`cmd-bar${L?" drag-over":""}`,onDragOver:_e,onDragLeave:Se,onDrop:Ae,children:[fe&&!Y&&c.jsx(Zk,{commands:ae,selectedIndex:Oe,onSelect:Pe,onHover:G}),fe&&Y==="sandbox"&&c.jsx(uu,{title:"Sandbox Mode",options:xt,currentValue:pt.sandboxMode,onSelect:$e,onClose:()=>te(void 0)}),fe&&Y==="websearch"&&c.jsx(uu,{title:"Web Search",options:W,currentValue:pt.webSearchMode,onSelect:$e,onClose:()=>te(void 0)}),fe&&Y==="network"&&c.jsx(uu,{title:"Network Access",options:Ie,currentValue:pt.networkAccessEnabled===!0?"true":"false",onSelect:$e,onClose:()=>te(void 0)}),z&&c.jsx(eS,{filter:V,onSelect:Mt,onClose:()=>{Q(!1),r("")}}),I.length>0&&c.jsx("div",{className:"skill-badges",children:I.map(M=>c.jsxs("span",{className:"skill-badge",children:["$",M.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>le(oe=>oe.filter(Ne=>Ne.id!==M.id)),children:"×"})]},M.id))}),A.length>0&&c.jsx("div",{className:"attachment-preview-area",children:A.map(M=>c.jsxs("div",{className:"attachment-chip",title:M.name,children:[M.previewUrl?c.jsx("img",{src:M.previewUrl,alt:M.name,className:"attachment-thumb",onClick:()=>K(M),style:{cursor:"pointer"}}):c.jsx(_m,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:M.name}),c.jsx("span",{className:"attachment-size",children:Xh(M.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>ye(M.id),title:"Remove attachment",children:c.jsx(Gn,{size:14})})]},M.id))}),D&&!T&&!j&&c.jsx("input",{ref:a,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:M=>{he(M.target.files),M.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[D&&!T&&!j&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var M;return(M=a.current)==null?void 0:M.click()},title:"Attach files",disabled:T,children:c.jsx(s0,{size:16})}),c.jsx("textarea",{ref:s,className:"cmd-textarea",placeholder:j?"Select or create a session…":T?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:T||j,rows:1,style:{minHeight:Qs,maxHeight:du},onChange:bn,onKeyDown:Yt,onPaste:be}),T?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(lo,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:St,disabled:!n.trim()||j,title:"Send (⌘↵)",children:c.jsx(zx,{size:16})})]}),X&&c.jsx("div",{className:"image-preview-modal",onClick:()=>K(null),children:c.jsxs("div",{className:"image-preview-content",onClick:M=>M.stopPropagation(),children:[c.jsx("img",{src:X.previewUrl,alt:X.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:X.name}),c.jsx("span",{children:Xh(X.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>K(null),children:c.jsx(Gn,{size:20})})]})})]})}function lS(){const n=P(b=>b.activeSessionId),r=P(b=>b.activeSessionId?b.sessionDetails[b.activeSessionId]:null),s=P(b=>b.activeTurnIndex),o=P(b=>b.setActiveTurnIndex),a=P(b=>b.rewindToTurn),u=P(b=>b.restoreSession),f=P(b=>b.branchFromTurn),h=(r==null?void 0:r.turns)??[],m=Jl(r),g=!!(r!=null&&r.rewound_at_turn_id),x=(r==null?void 0:r.runtime_type)==="repoburg",w=x?"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.",[y,T]=k.useState(null),j=k.useRef(null);if(ea(j,()=>T(null),!!y),Vu(()=>T(null),!!y),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(b){o(b),requestAnimationFrame(()=>{var D;(D=document.getElementById(`turn-${b}`))==null||D.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((b,D)=>{const A=D===s,U=b.user_prompt.length>50?b.user_prompt.slice(0,50)+"…":b.user_prompt,L=b.status==="running"||b.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${A?"active":""}`,onClick:()=>C(D),onContextMenu:H=>{H.preventDefault(),T({x:H.clientX,y:H.clientY,turnId:b.id,turnIndex:D,isLast:D===h.length-1,isSlashCommand:b.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(p0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:U}),L&&c.jsx("span",{className:"turn-item-status",children:"running…"})]})},b.id)}),y&&c.jsxs("div",{ref:j,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${y.isLast||m||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||m||y.isSlashCommand||(window.confirm(w)&&a(n,y.turnId),T(null))},children:[c.jsx(l0,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),g&&!x&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),T(null)},children:[c.jsx(ta,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,y.turnId),T(null)},children:[c.jsx(qx,{size:12})," Branch from Here"]})]})]})}function aS(){const n=P(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),r=P(h=>h.changesScope),s=P(h=>h.setChangesScope),o=P(h=>h.activeTurnIndex),a=P(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Sg(u,r,o);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changes-scope-toggle",children:[c.jsx("button",{className:`scope-btn ${r==="session"?"active":""}`,onClick:()=>s("session"),children:"Session"}),c.jsx("button",{className:`scope-btn ${r==="turngroup"?"active":""}`,onClick:()=>s("turngroup"),children:"Current Turn"})]}),f.length===0?c.jsx("div",{className:"empty-state",children:"No file changes in this scope"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Changed Files (",f.length,")"]}),f.map(h=>{const m=h.kind==="add"?"fc-add":h.kind==="delete"?"fc-del":"fc-mod",g=h.kind==="add"?"A":h.kind==="delete"?"D":"M",x=h.path.split("/").pop()||h.path,w=h.path.replace("/"+x,"");return c.jsxs("div",{className:"file-change clickable",onClick:()=>a(h.path),children:[c.jsx("span",{className:`fc-status ${m}`,children:g}),c.jsxs("span",{className:"fc-name",children:[w&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[w,"/"]}),x]})]},h.path)})]})]})}const Zh=2e4;function cS(n){const r=[];return n.forEach((s,o)=>{var a;for(const u of s.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;r.push({item:u,turnIndex:o,turnPrompt:s.user_prompt})}}),r}function uS({entry:n}){const{item:r,turnIndex:s,turnPrompt:o}=n,a=r.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",m=a.status||"running",g=a.summary||null,x=a.last_tool_name||null,w=a.token_count||null,y=a.output||"",T=r.status==="in_progress",j=u==="local_agent",C=u==="local_bash",b=j?vu:C?Rm:Em,D=j?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",A=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,U=r.status==="failed"||m==="failed",[L,H]=k.useState(T),[X,K]=k.useState(!1),q=k.useRef(null);k.useEffect(()=>{T&&H(!0)},[T]),k.useEffect(()=>{L&&T&&q.current&&(q.current.scrollTop=q.current.scrollHeight)},[L,T,y]);const ie=y.length>Zh,fe=ie&&!X?y.slice(0,Zh)+`
|
|
427
|
+
… (truncated, click to expand)`:y,ce=T?null:m==="completed"?c.jsx(Zr,{size:12}):U?c.jsx(Ku,{size:12}):c.jsx(lo,{size:12});return c.jsxs("div",{className:`task-card ${T?"task-running":""} ${U?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>H(Le=>!Le),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(b,{size:14})}),c.jsx("span",{className:"task-card-type",children:D}),c.jsxs("span",{className:`task-card-status ${U?"task-status-failed":T?"task-status-running":"task-status-done"}`,children:[ce," ",A]}),c.jsx(qu,{size:14,className:"task-card-chevron",style:{transform:L?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),T&&x&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",x,w!=null&&` · ${w.toLocaleString()} tokens`]}),L&&c.jsxs("div",{className:"task-card-body",children:[y?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:q,children:c.jsx("code",{children:fe})}),ie&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(Le=>!Le),children:X?"Show less":`Show full output (${(y.length/1024).toFixed(0)}KB)`})]}):g?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:g})}):T?c.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):c.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),c.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",s+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const dS=k.memo(uS);function fS(){var h,m;const n=P(g=>g.activeSessionId?g.sessionDetails[g.activeSessionId]:null),r=(n==null?void 0:n.turns)??[],s=(n==null?void 0:n.backgroundTasks)??[],o=cS(r),a=[...o].sort((g,x)=>{const w=g.item.status==="in_progress",y=x.item.status==="in_progress";return w&&!y?-1:!w&&y?1:x.turnIndex-g.turnIndex}),u=new Map;for(const g of s)g.task_type==="local_bash"&&u.set(g.task_id,g.task_type);for(const g of o)if(g.item.status==="in_progress"){const x=((h=g.item.data)==null?void 0:h.task_id)??g.item.external_item_id,w=((m=g.item.data)==null?void 0:m.task_type)??"unknown";u.set(x,w)}const f=[...u.values()].filter(g=>g==="local_bash").length;return o.length===0?c.jsx("div",{className:"empty-state",children:"No background tasks yet"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Background Tasks (",o.length,")",f>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",f," running"]})]}),a.map(g=>c.jsx(dS,{entry:g},g.item.id))]})}const pS=k.memo(fS);function hS({thread:n,onClose:r}){const{activeSessionId:s,resolveThread:o,shareThread:a}=P(),[u,f]=k.useState(""),[h,m]=k.useState(!1),[g,x]=k.useState(!1);async function w(){if(!s||h)return;m(!0),await a(s,n.id,u)?r():m(!1)}async function y(){!s||g||(x(!0),await o(s,n.id),r())}const T=h||g;return c.jsx("div",{className:"dialog-overlay",onClick:T?void 0:r,children:c.jsxs("div",{className:"dialog",onClick:j=>j.stopPropagation(),children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Resolve thread"}),c.jsx("button",{className:"dialog-close",onClick:r,disabled:T,children:c.jsx(Gn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),c.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",c.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:j=>f(j.target.value),rows:3,disabled:T,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:r,disabled:T,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:T,title:"Resolve without sharing",children:[g?c.jsx(nr,{size:13,className:"spin"}):c.jsx(Yu,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:w,disabled:T,children:[h?c.jsx(nr,{size:13,className:"spin"}):c.jsx(c0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const Jh=[];He.setOptions({breaks:!0,gfm:!0});function mS(n){const r=He.parse(n);return fd.sanitize(r)}function gS(n){var r,s,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(r=n.data)==null?void 0:r.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((s=n.data)==null?void 0:s.groups)?n.data.groups:[],u=[(o=n.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
|
|
428
|
+
|
|
429
|
+
`):null}return null}function vS(n){const r=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return r?r[1]:n}function yS({turn:n}){const r=vS(n.user_prompt),s=n.items.map(gS).filter(o=>o!==null);return s.length===0&&n.status==="completed"&&n.agent_response&&s.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:r}),s.map((o,a)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:mS(o)}},a)),s.length===0&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"thread-card-pending",children:n.status==="running"?"AI is responding…":"Waiting…"}),n.status==="failed"&&c.jsx("div",{className:"thread-card-pending",children:n.error||"Turn failed"})]})}function xS({thread:n,threadTurns:r,onStop:s,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var Re,Oe,G;const[m,g]=k.useState(""),[x,w]=k.useState(!0),y=k.useRef(null),T=k.useRef(null),[j,C]=k.useState(!1),[b,D]=k.useState({x:0,y:0}),[A,U]=k.useState(""),L=r.some(ii),H=28,X=120,K=k.useRef(H);k.useEffect(()=>{const Y=T.current;Y&&(Y.scrollTop=Y.scrollHeight)},[r.length,x]);function q(Y){const te=y.current;te&&(te.style.height=`${Y}px`,K.current=Y)}function ie(){const Y=y.current;if(Y){if(Y.scrollHeight>Y.clientHeight){const te=Math.min(Y.scrollHeight,X);te!==K.current&&q(te);return}K.current>H&&(Y.style.height="auto",q(Math.min(Y.scrollHeight,X)))}}const fe=k.useCallback(()=>{C(!1)},[]),ce=k.useCallback(()=>{const Y=T.current;if(!Y)return;const te=window.getSelection();if(!te||te.rangeCount===0||te.isCollapsed){C(!1);return}const z=te.getRangeAt(0);if(!Y.contains(z.commonAncestorContainer)){C(!1);return}const Q=z.commonAncestorContainer.nodeType===Node.TEXT_NODE?z.commonAncestorContainer.parentElement:z.commonAncestorContainer;if(!(Q!=null&&Q.closest(".thread-card-ai-response"))){C(!1);return}const V=te.toString();if(!V.trim()){C(!1);return}const E=z.getBoundingClientRect(),I=28,le=6,ae=170;let he=!1;if(te.anchorNode&&te.focusNode)try{const Se=document.createRange();Se.setStart(te.focusNode,te.focusOffset),Se.setEnd(te.focusNode,te.focusOffset);const Ae=document.createRange();Ae.setStart(te.anchorNode,te.anchorOffset),Ae.setEnd(te.anchorNode,te.anchorOffset),he=Ae.compareBoundaryPoints(Range.START_TO_START,Se)>0}catch{he=!1}let ye=E.top-I-le;ye<8&&(ye=E.bottom+le);let _e=he?E.left-ae:E.right;_e=Math.max(8,Math.min(_e,window.innerWidth-ae-8)),D({x:_e,y:ye}),U(V),C(!0)},[]);k.useEffect(()=>{function Y(te){const z=te.target;z&&z.closest(".selection-actions")||ce()}return document.addEventListener("mouseup",Y),()=>document.removeEventListener("mouseup",Y)},[ce]);const Le=k.useCallback(()=>{var te;const Y=`
|
|
430
|
+
\`\`\`QUOTE
|
|
431
|
+
${A}
|
|
432
|
+
\`\`\`
|
|
433
|
+
|
|
434
|
+
`;g(z=>z+Y),C(!1),U(""),(te=window.getSelection())==null||te.removeAllRanges(),setTimeout(()=>{if(y.current){ie(),y.current.focus();const z=y.current.value.length;y.current.setSelectionRange(z,z)}},0)},[A]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>w(Y=>!Y),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((G=(Oe=(Re=n.turns)==null?void 0:Re[0])==null?void 0:Oe.user_prompt)==null?void 0:G.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),c.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&c.jsx("button",{className:"thread-locate-btn",onClick:Y=>{Y.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(r0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),x&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:T,onMouseDown:fe,children:[r.map(Y=>c.jsx(yS,{turn:Y},Y.id)),r.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),j&&c.jsx("div",{className:"selection-actions",style:{left:b.x,top:b.y},children:c.jsxs("button",{className:"discuss-button",onClick:Le,title:"Quote this text in your follow-up",children:[c.jsx(jm,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:L?"Agent is running…":"Type a follow-up…",value:m,onChange:Y=>{qt.markInputChange(),g(Y.target.value),ie()},disabled:L,rows:1,style:{minHeight:H,maxHeight:X},onKeyDown:Y=>{qt.markKeystroke(),Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&!L&&m.trim()&&(Y.preventDefault(),f(m.trim()),g(""),q(H))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:L||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(na,{size:13})}),L&&c.jsx("button",{className:"thread-card-followup-stop",onClick:s,title:"Stop this thread's turn (Esc)",children:c.jsx(lo,{size:13})})]}),c.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?c.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[c.jsx(Yu,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(ta,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(Nr,{size:13})," Delete"]})]})]})]})}function wS(){qt.trackRender("ThreadsPanel");const n=P(A=>A.activeSessionId),r=P(A=>{var U;return A.activeSessionId?((U=A.sessionDetails[A.activeSessionId])==null?void 0:U.threads)??Jh:Jh}),s=P(A=>A.followupThread),o=P(A=>A.cancelThreadTurn),a=P(A=>A.reopenThread),u=P(A=>A.deleteThread),f=P(A=>A.activeRightTab),h=P(A=>A.switchRightTab),m=P(A=>A.deepLinkThreadId),g=P(A=>A.setDeepLinkThreadId),[x,w]=k.useState("open"),[y,T]=k.useState(null);k.useEffect(()=>{if(!m)return;const A=m;g(null),w(L=>r.some(H=>H.id===A&&H.status==="open")?L:"all");const U=setTimeout(()=>{const L=document.getElementById(`thread-${A}`);L&&(L.scrollIntoView({behavior:"smooth",block:"center"}),L.classList.add("thread-card-highlighted"),setTimeout(()=>L.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(U)},[m,g,r]);const j=r.filter(A=>x==="open"?A.status==="open":x==="resolved"?A.status==="resolved":!0),C=r.filter(A=>A.status==="open").length,b=r.filter(A=>A.status==="resolved").length;function D(A){f==="changes"&&h("turns"),setTimeout(()=>{const U=document.querySelector(`mark[data-thread-id="${A}"]`);U&&(U.scrollIntoView({behavior:"smooth",block:"center"}),U.classList.add("thread-mark-flash"),setTimeout(()=>U.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?r.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(t0,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"No threads yet."}),c.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):c.jsxs("div",{children:[c.jsxs("div",{className:"thread-filter-tabs",children:[c.jsxs("button",{className:`thread-filter-tab ${x==="open"?"active":""}`,onClick:()=>w("open"),children:["Open (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="resolved"?"active":""}`,onClick:()=>w("resolved"),children:["Resolved (",b,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="all"?"active":""}`,onClick:()=>w("all"),children:["All (",r.length,")"]})]}),j.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",x," threads."]}):j.map(A=>c.jsx(xS,{thread:A,threadTurns:A.turns??[],onStop:()=>o(n,A.id),onResolve:()=>T(A),onReopen:()=>a(n,A.id),onDelete:()=>u(n,A.id),onFollowup:U=>s(n,A.id,U),onLocate:()=>D(A.id)},A.id)),y&&c.jsx(hS,{thread:y,onClose:()=>T(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function kS(){const n=P(f=>f.apps),r=P(f=>f.activeAppTabId),s=P(f=>f.openAppTab),o=P(f=>f.startAppEdit),a=P(f=>f.toggleAppPin),u=P(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${r===f.id?" active":""}`,onClick:()=>s(f.id),title:f.description??void 0,children:[c.jsx("span",{className:"sidebar-app-icon",children:f.icon??"◧"}),c.jsxs("div",{className:"apps-panel-info",children:[c.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&c.jsx("span",{className:"apps-panel-desc",children:f.description})]}),c.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:h=>{h.stopPropagation(),o(f.id)},children:c.jsx(Il,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:h=>{h.stopPropagation(),a(f.id)},children:c.jsx(Ul,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:c.jsx(Nr,{size:12})})]},f.id))})}function SS(){var f,h;qt.trackRender("RightPanel");const n=P(m=>m.activeRightTab),r=P(m=>m.switchRightTab),s=P(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),o=((f=s==null?void 0:s.backgroundTasks)==null?void 0:f.length)??0,a=((h=s==null?void 0:s.threads)==null?void 0:h.filter(m=>m.status==="open").length)??0,u=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:o||void 0},{id:"threads",label:"Threads",badge:a||void 0},{id:"apps",label:"Apps"}];return c.jsxs("div",{className:"ide-right",children:[c.jsx("div",{className:"right-tabs",children:u.map(m=>c.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(lS,{}),n==="changes"&&c.jsx(aS,{}),n==="tasks"&&c.jsx(pS,{}),n==="threads"&&c.jsx(wS,{}),n==="apps"&&c.jsx(kS,{})]})]})}const Te={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"}},Ru=[{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:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max,Te.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max,Te.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high,Te.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:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high,Te.xhigh,Te.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Te.low,Te.medium,Te.high]}]}];function TS(n){return Ru.find(r=>r.id===n)}function pd(n){const r=TS(n);return(r==null?void 0:r.models)??[]}function Tg(n,r){return pd(n).find(s=>s.slug===r)}function Au(n,r){var s;return((s=Tg(n,r))==null?void 0:s.reasoningLevels)??[]}function Iu(n,r){var s;return(s=Tg(n,r))==null?void 0:s.defaultReasoning}function bS(){const{activeSessionId:n,sessions:r,updateModelConfig:s}=P(),o=P(G=>G.showModelSelector),a=P(G=>G.setShowModelSelector),u=r.find(G=>G.id===n),f=P(G=>G.models),h=P(G=>G.modelsLoading),m=P(G=>G.loadModels),[g,x]=k.useState(!1),w=k.useRef(null);if(ea(w,()=>x(!1),g),Vu(()=>x(!1),g),k.useEffect(()=>{o&&(x(!0),a(!1))},[o,a]),k.useEffect(()=>{u!=null&&u.runtime_type&&m(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,m]),!u)return null;const y=u.runtime_type,T=u.model??"",j=u.model_reasoning_effort??"",C=f.length>0?f:[],b=pd(y),A=[...C.length>0?C:b];if(T&&!A.some(G=>G.slug===T)){const G=b[0];A.unshift({slug:T,displayName:T,description:"Custom model",defaultReasoning:(G==null?void 0:G.defaultReasoning)??"medium",reasoningLevels:(G==null?void 0:G.reasoningLevels)??[]})}function U(G){return A.find(Y=>Y.slug===G)}function L(G){var Y;return C.length>0?((Y=U(G))==null?void 0:Y.reasoningLevels)??[]:Au(y,G)}function H(G){var Y;return C.length>0?(Y=U(G))==null?void 0:Y.defaultReasoning:Iu(y,G)}const X=Ru.find(G=>G.id===y),K=U(T),q=T?L(T):[],ie=(X==null?void 0:X.label)??y,fe=(K==null?void 0:K.displayName)??(T||"Default"),ce=q.find(G=>G.effort===j),Le=(ce==null?void 0:ce.label)??(j||"Default");function Re(G){var Q;const Y=L(G),z=Y.some(V=>V.effort===j)?j:H(G)??((Q=Y[0])==null?void 0:Q.effort)??"";s(G,z),x(!1)}function Oe(G){s(T,G),x(!1)}return c.jsxs("div",{className:"model-selector",ref:w,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>x(!g),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ie}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:fe}),Le!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:Le})]}),c.jsx(ro,{size:12,className:"model-selector-chevron"})]}),g&&c.jsxs("div",{className:"model-selector-popover",children:[c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Ru.map(G=>c.jsxs("div",{className:`model-selector-item ${G.id===y?"selected":""} ${G.available?"":"disabled"}`,onClick:()=>{if(G.available){if(G.id===y){x(!1);return}s("","",G.id)}},children:[c.jsx("span",{children:G.label}),!G.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(Jx,{size:10})," Soon"]}),G.id===y&&c.jsx(Zr,{size:12})]},G.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&A.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),A.map(G=>c.jsxs("div",{className:`model-selector-item ${G.slug===T?"selected":""}`,onClick:()=>Re(G.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:G.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:G.description})]}),G.slug===T&&c.jsx(Zr,{size:12})]},G.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),q.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),q.map(G=>c.jsxs("div",{className:`model-selector-item ${G.effort===j?"selected":""}`,onClick:()=>Oe(G.effort),children:[c.jsx("span",{children:G.label}),G.effort===j&&c.jsx(Zr,{size:12})]},G.effort))]})]})]})}function NS(n,r){if(!n||n.turns.length===0)return"—";const s=n.turns[0],o=n.turns[n.turns.length-1],a=r?null:o.updated_at;return Ix(s.created_at,a)}function jl(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function em(){const n=P(s=>s.setShowRemoteModal),r=Lu(window.location.hostname);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(m0,{size:14})," Repoburg",r?` · ${r}`:""]})}function tm(){const n=P(s=>s.vscodeViewOpen),r=P(s=>s.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[c.jsx(Wx,{size:14})," VS Code"]})}function CS(){var y,T;qt.trackRender("StatusBar");const n=P(j=>j.activeSessionId),r=P(j=>n?j.sessions.find(C=>C.id===n)??null:null),s=P(j=>n?j.sessionDetails[n]??null:null),o=P(j=>j.wsConnected),a=P(j=>j.switchRightTab),u=(s==null?void 0:s.contextUsage)??null;if(!r)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(em,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:[c.jsx("span",{className:`status-dot ${o?"done":"error"}`}),o?"Live":"Offline"]}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(nh,{size:14})," K"]})]});const f=Hu(r),h=NS(s,f.isRunning),m=(s==null?void 0:s.backgroundTasks)??[],g=new Set,x=new Map;for(const j of m)g.add(j.task_id),x.set(j.task_id,j.task_type);for(const j of(s==null?void 0:s.turns)??[])for(const C of j.items)if(C.type==="background_task"&&C.status==="in_progress"){const b=((y=C.data)==null?void 0:y.task_id)??C.external_item_id,D=((T=C.data)==null?void 0:T.task_type)??"unknown";g.add(b),x.set(b,D)}const w=[...x.values()].filter(j=>j==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(em,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(bS,{}),w>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${w} Monitor task${w>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[c.jsx(Am,{size:14})," ",w]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:[c.jsx("span",{className:`status-dot ${o?"done":"error"}`}),o?"Live":"Offline"]}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:r.status==="failed"?{color:"var(--red)"}:void 0,children:[c.jsx(Gu,{status:f.dot})," ",f.label]}),u&&c.jsx(ES,{usage:u}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",children:h}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(nh,{size:14})," K"]})]})}function ES({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",s=`${jl(n.totalTokens)} / ${jl(n.contextWindow)} tokens`;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:s,children:c.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",jl(n.totalTokens)," / ",jl(n.contextWindow)]})})]})}function nm(n){return Tn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function _S(n){return kt("/vscode-web/start",{folder:n})}function jS(n){return kt("/vscode-web/heartbeat",{id:n})}const RS=1e3,AS=5*6e4;function IS(){const n=P(w=>w.vscodeState),r=P(w=>w.vscodeId),s=P(w=>w.vscodeToken),o=P(w=>w.setVscodeView),a=P(w=>{var T;const y=w.activeSessionId?w.sessions.find(j=>j.id===w.activeSessionId):null;return y!=null&&y.cwd?y.cwd:((T=w.workspaces.find(j=>j.deleted===0))==null?void 0:T.path)??null}),[u,f]=k.useState(!1),[h,m]=k.useState(0),g=k.useRef(null);k.useEffect(()=>{let w=!1;function y(){g.current&&(clearInterval(g.current),g.current=null)}async function T(){try{let C=await nm(a);if((C.state==="stopped"||C.state==="error")&&(C=await _S(a)),w||(o(C.state,C.id,C.token),C.state==="running"||C.state==="error"))return;g.current=setInterval(async()=>{const b=await nm(a);w||(o(b.state,b.id,b.token),(b.state==="running"||b.state==="error"||b.state==="stopped")&&y())},RS)}catch{w||o("error",null,null)}}T();const j=setInterval(()=>{const C=P.getState().vscodeId;C&&jS(C).catch(()=>{})},AS);return()=>{w=!0,y(),clearInterval(j)}},[h,a,o]);function x(){f(!1),o("starting",null,null),m(w=>w+1)}return n!=="running"||!s||!r?c.jsx("div",{className:"vscode-view vscode-view--loading",children:n==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"VS Code could not start."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:x,children:[c.jsx(ta,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(nr,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(nr,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:`${fr()}/vscode/${r}/?tkn=${s}${a?`&folder=${encodeURIComponent(a)}`:""}`,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]})}const DS=`(function () {
|
|
435
|
+
var nextId = 1;
|
|
436
|
+
var pending = new Map();
|
|
437
|
+
var listeners = [];
|
|
438
|
+
window.addEventListener('message', function (e) {
|
|
439
|
+
var msg = e.data;
|
|
440
|
+
if (!msg || msg.source !== 'agentpane-host') return;
|
|
441
|
+
if (msg.id != null && pending.has(msg.id)) {
|
|
442
|
+
var p = pending.get(msg.id);
|
|
443
|
+
pending.delete(msg.id);
|
|
444
|
+
if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
|
|
445
|
+
} else if (msg.event) {
|
|
446
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
447
|
+
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
function call(method, params) {
|
|
452
|
+
return new Promise(function (resolve, reject) {
|
|
453
|
+
var id = nextId++;
|
|
454
|
+
pending.set(id, { resolve: resolve, reject: reject });
|
|
455
|
+
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
window.AgentPane = {
|
|
459
|
+
getApp: function () { return call('getApp'); },
|
|
460
|
+
getState: function () { return call('getState'); },
|
|
461
|
+
setState: function (data) { return call('setState', { data: data }); },
|
|
462
|
+
createSession: function (opts) { return call('createSession', opts); },
|
|
463
|
+
submitTurn: function (sessionId, prompt) { return call('submitTurn', { sessionId: sessionId, prompt: prompt }); },
|
|
464
|
+
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
465
|
+
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
466
|
+
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
467
|
+
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
468
|
+
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); }
|
|
469
|
+
};
|
|
470
|
+
})();`;function rm(n){return n.replace(/<\/script/gi,"<\\/script")}function sm(n,r,s){const o=n.toLowerCase().lastIndexOf(r.toLowerCase());return o===-1?n+s:n.slice(0,o)+s+n.slice(o)}function MS(n,r,s){let o=n;const a=`<script>${rm(r)}<\/script>`;if(/<\/head>/i.test(o)?o=sm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,s){const u=`<script>${rm(s)}<\/script>`;o=sm(o,"</body>",u)}return o}function LS({appId:n,workspace:r=""}){const s=k.useRef(null),o=k.useRef({pinned:!1,data:null}),[a,u]=k.useState(null),[f,h]=k.useState(null);k.useEffect(()=>{let g=!0;Gy(n,w=>{var y,T;return(T=(y=s.current)==null?void 0:y.contentWindow)==null?void 0:T.postMessage(w,"*")});const x=async w=>{var b,D,A,U,L,H,X,K;if(w.source!==((b=s.current)==null?void 0:b.contentWindow))return;const y=w.data;if(!y||y.source!=="agentpane-app"||typeof y.method!="string")return;let T=!0,j,C;try{switch(y.method){case"getApp":j={id:n};break;case"getState":j=o.current;break;case"setState":{const q=((D=y.params)==null?void 0:D.data)??null,ie=await xm(n,{data:q},r);o.current=ie,j=ie;break}case"createSession":{const q=y.params??{},ie=await Pu({title:typeof q.title=="string"?q.title:void 0,runtime_type:typeof q.runtime_type=="string"?q.runtime_type:void 0,model:typeof q.model=="string"?q.model:void 0,cwd:typeof q.cwd=="string"?q.cwd:void 0,origin_app_id:n});qc(ie.id,n),j=ie;break}case"submitTurn":{const q=String(((A=y.params)==null?void 0:A.sessionId)??""),ie=String(((U=y.params)==null?void 0:U.prompt)??""),fe=await mm(q,ie);qc(q,n),j=fe;break}case"resolveToolCall":{const q=String(((L=y.params)==null?void 0:L.callId)??""),ie=(H=y.params)==null?void 0:H.result;await vx(q,ie),j={ok:!0};break}default:throw new Error(`Unknown bridge method: ${y.method}`)}}catch(q){T=!1,C=q instanceof Error?q.message:String(q)}(K=(X=s.current)==null?void 0:X.contentWindow)==null||K.postMessage({source:"agentpane-host",id:y.id,ok:T,result:j,error:C},"*")};return window.addEventListener("message",x),Zy(n,()=>{Zp(n,r).then(w=>{g&&(o.current=w)}).catch(()=>{})}),Xy(n,()=>{Qp(n).then(w=>{g&&u(w)}).catch(()=>{})}),(async()=>{try{const[w,y,T]=await Promise.all([Qp(n),Zp(n,r),fx(n).catch(()=>[])]);if(!g)return;o.current=y,T.forEach(j=>qc(j.id,n)),u(w)}catch(w){g&&h(w instanceof Error?w.message:String(w))}})(),()=>{g=!1,qy(n),Qy(n),Jy(n),window.removeEventListener("message",x)}},[n,r]);const m=k.useMemo(()=>a?MS(a.html,DS,a.js):"",[a]);return f?c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]}):m?c.jsx("iframe",{ref:s,className:"miniapp-frame",sandbox:"allow-scripts",title:`Mini app: ${n}`,srcDoc:m}):c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"})}function PS(){const n=P(w=>w.activeAppTabId),r=P(w=>w.apps),s=P(w=>w.workspaces),o=P(w=>w.appWorkspaces),a=P(w=>w.setAppWorkspace),u=P(w=>w.setActiveAppTab),f=P(w=>w.startAppEdit);if(!n)return null;const h=r.find(w=>w.id===n),m=o[n]??"",g=s.filter(w=>w.deleted!==1),x=m!==""&&!g.some(w=>w.path===m)?m:null;return c.jsxs("div",{className:"miniapp-view",children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(h==null?void 0:h.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(h==null?void 0:h.title)??n}),c.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:m,onChange:w=>a(n,w.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),g.map(w=>c.jsx("option",{value:w.path,children:w.label||w.path.split("/").pop()||w.path},w.path)),x&&c.jsx("option",{value:x,children:`${x} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void f(n),children:[c.jsx(i0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>u(null),children:c.jsx(Gn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(LS,{appId:n,workspace:m},`${n}:${m}`)})]})}function OS({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const[u,f]=k.useState(!1),h=k.useRef(0),m=k.useRef(0),g=k.useCallback(y=>{const T=y.clientX-h.current,j=n==="left"?m.current+T:m.current-T,C=Math.min(s,Math.max(r,j));a(C)},[n,r,s,a]),x=k.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",x),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:k.useCallback(y=>{y.preventDefault(),y.stopPropagation(),h.current=y.clientX,m.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",x)},[o,g,x]),dragging:u}}function im({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=OS({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a});return c.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function zS(){qt.trackRender("IdeWorkspace");const n=P(h=>h.sidebarWidth),r=P(h=>h.rightPanelWidth),s=P(h=>h.setSidebarWidth),o=P(h=>h.setRightPanelWidth),a=P(h=>h.vscodeViewOpen),u=P(h=>h.activeAppTabId);k.useEffect(()=>{const h=()=>{const m=Pl(),{rightPanelWidth:g,setRightPanelWidth:x}=P.getState();g>m&&x(m)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]);const f=`${n}px 6px 1fr 6px ${r}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a||u!=null?"ide-hidden":""}`,style:{gridTemplateColumns:f},children:[c.jsx(d1,{}),c.jsx(im,{side:"left",minWidth:pu,maxWidth:hu,getWidth:()=>P.getState().sidebarWidth,setWidth:s}),c.jsxs("div",{className:"ide-center",children:[c.jsx(f1,{}),c.jsx("div",{className:"ide-render",children:c.jsx(Kk,{})}),c.jsx(oS,{})]}),c.jsx(im,{side:"right",minWidth:Ll,maxWidth:Pl(),getWidth:()=>P.getState().rightPanelWidth,setWidth:o}),c.jsx(SS,{})]}),a&&c.jsx(IS,{}),!a&&u!=null&&c.jsx(PS,{}),c.jsx(CS,{})]})}function $S(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:s,lastModelConfig:o}=P(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,m]=k.useState(""),[g,x]=k.useState(u),[w,y]=k.useState(f),[T,j]=k.useState("");if(!n)return null;const C=pd(a),b=g?Au(a,g):[];function D(){s({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:w||void 0,cwd:T.trim()||void 0,runtime_type:a}),m(""),j("")}function A(L){L.key==="Escape"&&r(!1)}function U(L){var K;x(L);const H=Au(a,L);H.some(q=>q.effort===w)||y(Iu(a,L)??((K=H[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:L=>L.stopPropagation(),onKeyDown:A,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Gn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsxs("label",{className:"dialog-label",children:["Title (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:L=>m(L.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Model",c.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:L=>U(L.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map(L=>c.jsxs("option",{value:L.slug,children:[L.displayName," — ",L.description]},L.slug))]})]}),b.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:w,onChange:L=>y(L.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Iu(a,g),")"]}),b.map(L=>c.jsx("option",{value:L.effort,children:L.label},L.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:L=>j(L.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:D,children:"Create"})]})]})})}const FS=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,US=512*1024;function BS(n){const r=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(r)?r:""}function WS(){const{appCatalogOpen:n,closeAppCatalog:r,apps:s,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=P(),[f,h]=k.useState("examples"),[m,g]=k.useState(null),[x,w]=k.useState(null),[y,T]=k.useState(!1),[j,C]=k.useState(""),[b,D]=k.useState(""),[A,U]=k.useState(""),[L,H]=k.useState(""),[X,K]=k.useState(null),[q,ie]=k.useState(""),fe=k.useRef(null);if(k.useEffect(()=>{n&&(g(null),px().then(g).catch(()=>g([])))},[n]),k.useEffect(()=>{fe.current&&(fe.current.webkitdirectory=!0)},[f]),!n)return null;const ce=new Set(s.map(z=>z.id));async function Le(z){w(z);try{await o(z)&&r()}finally{w(null)}}async function Re(){if(y)return;const z=j.trim(),Q=b.trim();if(!(!z||!Q)){T(!0);try{await a({id:z,title:Q,description:A.trim()||void 0,icon:L.trim()||void 0})&&(C(""),D(""),U(""),H(""),r())}finally{T(!1)}}}async function Oe(z){const Q=Array.from(z.target.files??[]),V={};let E="";for(const I of Q){const ae=(I.webkitRelativePath??"").split("/");!E&&ae.length>1&&(E=ae[0]);const he=ae[ae.length-1];if(!(!he||!FS.test(he))&&!(I.size>US))try{V[he]=await I.text()}catch{}}K(Object.keys(V).length>0?V:null),ie(BS(E))}async function G(){if(!(y||!X||!q.trim())){T(!0);try{await u(q.trim(),X)&&(K(null),ie(""),r())}finally{T(!1)}}}function Y(z){z.key==="Escape"&&r()}const te=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:r,children:c.jsxs("div",{className:"dialog app-catalog",onClick:z=>z.stopPropagation(),onKeyDown:Y,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:r,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:te.map(z=>c.jsx("button",{className:`catalog-tab${f===z.key?" active":""}`,onClick:()=>h(z.key),children:z.label},z.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:m===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):m.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):m.map(z=>{const Q=ce.has(z.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:z.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:z.title}),z.description&&c.jsx("span",{className:"example-desc",children:z.description})]}),c.jsx("button",{className:"example-install",disabled:Q||x===z.id,onClick:()=>Le(z.id),title:Q?"Already installed":"Install this example",children:Q?"Installed":x===z.id?"Installing…":"Install"})]},z.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:j,onChange:z=>C(z.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:b,onChange:z=>D(z.target.value),placeholder:"e.g. Todo List"})]}),c.jsxs("label",{className:"dialog-label",children:["Description (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:A,onChange:z=>U(z.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:["Icon (optional, emoji)",c.jsx("input",{className:"dialog-input",type:"text",value:L,onChange:z=>H(z.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!j.trim()||!b.trim(),onClick:Re,children:[c.jsx(ys,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.js, …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:fe,type:"file",multiple:!0,onChange:Oe}),X&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:q,onChange:z=>ie(z.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(X).length," file(s):"," ",Object.keys(X).slice(0,6).join(", "),Object.keys(X).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!X||!q.trim(),onClick:G,children:[c.jsx(f0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:r,children:"Close"})})]})})}function HS(){const n=P(w=>w.showCommandPalette),r=P(w=>w.setShowCommandPalette),s=P(),[o,a]=k.useState(""),[u,f]=k.useState(0),h=k.useRef(null),m=k.useMemo(()=>{const w=s.activeSessionId?s.sessionDetails[s.activeSessionId]:null,y=Jl(w);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:ys,action:()=>s.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:Nr,action:()=>{s.activeSessionId&&s.deleteSession(s.activeSessionId)},available:!!s.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:na,action:()=>{const T=document.querySelector(".cmd-input");T==null||T.focus()},available:!!s.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:lo,action:()=>s.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:Zx,action:()=>s.switchRightTab("turns"),available:!!s.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:Vx,action:()=>s.switchRightTab("changes"),available:!!s.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Gn,action:()=>{s.activeSessionId&&s.closeTab(s.activeSessionId)},available:!!s.activeSessionId}]},[s]),g=k.useMemo(()=>{const w=o.toLowerCase().trim(),y=m.filter(T=>T.available);return w?y.filter(T=>T.label.toLowerCase().includes(w)||T.hint.toLowerCase().includes(w)):y},[m,o]);k.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var w;return(w=h.current)==null?void 0:w.focus()},50))},[n]);function x(w){if(w.key==="ArrowDown")w.preventDefault(),f(y=>Math.min(y+1,g.length-1));else if(w.key==="ArrowUp")w.preventDefault(),f(y=>Math.max(y-1,0));else if(w.key==="Enter"){w.preventDefault();const y=g[u];y&&(y.action(),r(!1))}else w.key==="Escape"&&r(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"palette",onClick:w=>w.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:w=>{a(w.target.value),f(0)},onKeyDown:x}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:g.map((w,y)=>{const T=w.icon;return c.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{w.action(),r(!1)},onMouseEnter:()=>f(y),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(T,{size:16})}),c.jsx("span",{className:"palette-item-label",children:w.label}),c.jsx("span",{className:"palette-item-hint",children:w.hint}),y===u&&c.jsx(Hx,{size:12,className:"palette-item-enter"})]},w.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const om=/^[a-z][a-z0-9-]{1,30}$/,VS=2e3;function GS(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:s}=P(),[o,a]=k.useState(null),[u,f]=k.useState(null),[h,m]=k.useState(!1),[g,x]=k.useState(!1),[w,y]=k.useState(!1),[T,j]=k.useState(!1),[C,b]=k.useState("main"),[D,A]=k.useState(""),[U,L]=k.useState(!1),[H,X]=k.useState(null),K=k.useRef(null);ea(K,()=>j(!1),T);const q=g||w,ie=k.useCallback(async()=>{m(!0),f(null);try{const z=await fetch(`${fr()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);a(await z.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);k.useEffect(()=>{n&&(b("main"),X(null),ie())},[n,ie]);const fe=H!==null&&H.state==="running";if(k.useEffect(()=>{if(!fe)return;const z=setInterval(async()=>{try{const Q=await fetch(`${fr()}/remote/enable`,{headers:{Accept:"application/json"}});Q.ok&&X(await Q.json())}catch{}},VS);return()=>clearInterval(z)},[fe]),!n)return null;const ce=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function Le(z){z.key==="Escape"&&r(!1)}async function Re(z){if(om.test(z)){L(!0);try{const Q=await fetch(`${fr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!Q.ok)throw new Error(`enable ${Q.status}`);X(await Q.json()),b("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{L(!1)}}}function Oe(){H!=null&&H.troubleshootingSessionId&&(s(H.troubleshootingSessionId),r(!1))}async function G(){x(!0);try{await fetch(`${fr()}/remote/disable`,{method:"POST"}),await ie()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{x(!1)}}async function Y(){if(j(!1),!!window.confirm(`Remove the tunnel completely?
|
|
471
|
+
|
|
472
|
+
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
473
|
+
|
|
474
|
+
This cannot be undone.`)){y(!0);try{const Q=await fetch(`${fr()}/remote/uninstall`,{method:"DELETE"});if(!Q.ok)throw new Error(`uninstall ${Q.status}`);await ie()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function te(){if(!H)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:D,onChange:E=>A(E.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>b("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!om.test(D)||U,onClick:()=>void Re(D),children:[U?c.jsx(nr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const z=["detect","provision","install","verify","ready"],Q=z.indexOf(H.step),V=H.state==="ready";return c.jsxs(c.Fragment,{children:[H.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(nr,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),H.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(Zr,{size:14})," Setup complete — you can close this window."]}),H.state==="ready"&&H.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${H.hostname}`,target:"_blank",rel:"noreferrer",children:H.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:z.map((E,I)=>{const le=V||Q>-1&&I<Q,ae=!V&&I===Q&&H.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:le||ae?1:.4,color:le?"var(--green)":void 0},children:[le?c.jsx(Zr,{size:13}):ae?c.jsx(nr,{size:13,className:"spin"}):c.jsx(Bx,{size:9,style:{marginLeft:2,marginRight:2}}),E]},E)})}),H.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:H.logs.slice(-3).map(E=>E.message).join(`
|
|
475
|
+
`)}),H.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Oe,children:"Open troubleshooting session"})})]}),H.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",H.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ie(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:Le,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Gn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[h&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(nr,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),C==="setup"?te():c.jsxs(c.Fragment,{children:[ce&&(o==null?void 0:o.tunnel.hostname)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),c.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[c.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void G(),disabled:q,children:[g?c.jsx(nr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),c.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>j(z=>!z),disabled:q,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":T,children:w?c.jsx(nr,{size:14,className:"spin"}):c.jsx(ro,{size:14})}),T&&c.jsx("div",{ref:K,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:c.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void Y(),children:[c.jsx(Nr,{size:12})," Remove tunnel"]})})]})]}),!ce&&c.jsx(c.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void Re(o.tunnel.mahlas),disabled:U,children:[U?c.jsx(nr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(rh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>b("setup"),children:[c.jsx(rh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const qS={success:Fx,error:Ku,info:Kx,warn:u0},KS=4e3;function YS({toast:n}){const r=P(f=>f.removeToast),s=qS[n.type],o=k.useRef(null);k.useEffect(()=>{function f(){o.current=setTimeout(()=>r(n.id),KS)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,r]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>r(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(s,{size:16}),c.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&c.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),r(n.id)},children:[c.jsx(d0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:c.jsx(Gn,{size:14})})]})}function XS(){const n=P(r=>r.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(r=>c.jsx(YS,{toast:r},r.id))})}let Hn=null,si=null,eo=1e3;const QS=1e4;function ZS(){const n=fr();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Du(){Hn&&(Hn.readyState===WebSocket.OPEN||Hn.readyState===WebSocket.CONNECTING)||(Hn=new WebSocket(ZS()),Hn.onopen=()=>{const n=eo>1e3;if(eo=1e3,P.getState().setWsConnected(!0),P.getState().addLogEntry("INFO","WebSocket connected"),n){const r=P.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},Hn.onclose=()=>{P.getState().setWsConnected(!1),P.getState().addLogEntry("WARN","WebSocket disconnected"),P.getState().addToast("warn","WebSocket disconnected — reconnecting…"),eT()},Hn.onerror=()=>{},Hn.onmessage=n=>{try{const r=JSON.parse(n.data);qt.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const s=tT[r.event];s&&s(r.data)}catch{}})}function JS(){si&&(clearTimeout(si),si=null),Hn&&(Hn.onclose=null,Hn.close(),Hn=null),P.getState().setWsConnected(!1)}function eT(){si||(si=window.setTimeout(()=>{si=null,Du()},eo),eo=Math.min(eo*2,QS))}const tT={"turn:started":n=>{const r=n;qt.note(`turn:started — ${r.turnId.slice(0,8)}`),P.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;P.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;P.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;P.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;P.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;qt.note(`turn:completed — ${r.turnId.slice(0,8)}`),P.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;P.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,s={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage};P.getState().onContextUsageUpdated(r.sessionId,s)},"turn:failed":n=>{const r=n;P.getState().onTurnFailed(r.sessionId,r.turnId,r.error)},"turn:cancelled":n=>{const r=n;P.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;P.getState().onSessionTitle(r.sessionId,r.title)},background_tasks:n=>{const r=n;qt.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(s=>s.task_type).join(", ")||"none"})`),P.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"thread:created":n=>{const r=n;P.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;P.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;P.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;P.getState().onThreadDeleted(r.sessionId,r.threadId)},"app:tool_call":n=>{const r=n;Ky(r.appId,r.callId,r.tool,r.args??{})},"app:source:updated":n=>{tx(n.appId)},"app:state_changed":n=>{ex(n.appId)}};function nT(){const n=P(r=>r.init);return k.useEffect(()=>{Sy(),n(),P.getState().loadApps(),Du();function r(){if(document.visibilityState!=="visible")return;const s=P.getState(),o=s.activeSessionId;if(!o)return;const a=s.sessionDetails[o];s.wsConnected||Du(),a&&a.is_running===1&&(s.refreshActiveSession(),s.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",r),()=>{JS(),document.removeEventListener("visibilitychange",r)}},[n]),null}function rT(){const n=P(a=>a.loading),r=P(a=>a.error),s=P(a=>a.sessions),o=P(a=>a.setShowCommandPalette);return k.useEffect(()=>qt.start(),[]),k.useEffect(()=>{function a(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]),c.jsxs(c.Fragment,{children:[c.jsx(nT,{}),n&&s.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):r&&s.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",r]}):c.jsxs(c.Fragment,{children:[c.jsx(zS,{}),c.jsx($S,{}),c.jsx(WS,{}),c.jsx(GS,{}),c.jsx(HS,{}),c.jsx(XS,{})]})]})}fy.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(rT,{})}));
|