repoburg 1.3.254 → 1.3.255
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var fy=Object.defineProperty;var py=(n,s,r)=>s in n?fy(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var ct=(n,s,r)=>py(n,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();function
|
|
1
|
+
var fy=Object.defineProperty;var py=(n,s,r)=>s in n?fy(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var ct=(n,s,r)=>py(n,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();function vm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qc={exports:{}},Vi={},Kc={exports:{}},He={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var fy=Object.defineProperty;var py=(n,s,r)=>s in n?fy(n,s,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Mp;function hy(){if(Mp)return He;Mp=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),k=Symbol.iterator;function y(b){return b===null||typeof b!="object"?null:(b=k&&b[k]||b["@@iterator"],typeof b=="function"?b:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function T(b,R,te){this.props=b,this.context=R,this.refs=E,this.updater=te||N}T.prototype.isReactComponent={},T.prototype.setState=function(b,R){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,R,"setState")},T.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function L(){}L.prototype=T.prototype;function A(b,R,te){this.props=b,this.context=R,this.refs=E,this.updater=te||N}var B=A.prototype=new L;B.constructor=A,_(B,T.prototype),B.isPureReactComponent=!0;var M=Array.isArray,W=Object.prototype.hasOwnProperty,q={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function G(b,R,te){var ce,ge={},ye=null,Oe=null;if(R!=null)for(ce in R.ref!==void 0&&(Oe=R.ref),R.key!==void 0&&(ye=""+R.key),R)W.call(R,ce)&&!K.hasOwnProperty(ce)&&(ge[ce]=R[ce]);var Re=arguments.length-2;if(Re===1)ge.children=te;else if(1<Re){for(var je=Array(Re),be=0;be<Re;be++)je[be]=arguments[be+2];ge.children=je}if(b&&b.defaultProps)for(ce in Re=b.defaultProps,Re)ge[ce]===void 0&&(ge[ce]=Re[ce]);return{$$typeof:n,type:b,key:ye,ref:Oe,props:ge,_owner:q.current}}function oe(b,R){return{$$typeof:n,type:b.type,key:R,ref:b.ref,props:b.props,_owner:b._owner}}function ue(b){return typeof b=="object"&&b!==null&&b.$$typeof===n}function ie(b){var R={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(te){return R[te]})}var we=/\/+/g;function Ce(b,R){return typeof b=="object"&&b!==null&&b.key!=null?ie(""+b.key):R.toString(36)}function Fe(b,R,te,ce,ge){var ye=typeof b;(ye==="undefined"||ye==="boolean")&&(b=null);var Oe=!1;if(b===null)Oe=!0;else switch(ye){case"string":case"number":Oe=!0;break;case"object":switch(b.$$typeof){case n:case s:Oe=!0}}if(Oe)return Oe=b,ge=ge(Oe),b=ce===""?"."+Ce(Oe,0):ce,M(ge)?(te="",b!=null&&(te=b.replace(we,"$&/")+"/"),Fe(ge,R,te,"",function(be){return be})):ge!=null&&(ue(ge)&&(ge=oe(ge,te+(!ge.key||Oe&&Oe.key===ge.key?"":(""+ge.key).replace(we,"$&/")+"/")+b)),R.push(ge)),1;if(Oe=0,ce=ce===""?".":ce+":",M(b))for(var Re=0;Re<b.length;Re++){ye=b[Re];var je=ce+Ce(ye,Re);Oe+=Fe(ye,R,te,je,ge)}else if(je=y(b),typeof je=="function")for(b=je.call(b),Re=0;!(ye=b.next()).done;)ye=ye.value,je=ce+Ce(ye,Re++),Oe+=Fe(ye,R,te,je,ge);else if(ye==="object")throw R=String(b),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.");return Oe}function Q(b,R,te){if(b==null)return b;var ce=[],ge=0;return Fe(b,ce,"","",function(ye){return R.call(te,ye,ge++)}),ce}function ne(b){if(b._status===-1){var R=b._result;R=R(),R.then(function(te){(b._status===0||b._status===-1)&&(b._status=1,b._result=te)},function(te){(b._status===0||b._status===-1)&&(b._status=2,b._result=te)}),b._status===-1&&(b._status=0,b._result=R)}if(b._status===1)return b._result.default;throw b._result}var ae={current:null},O={transition:null},J={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:O,ReactCurrentOwner:q};function H(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:Q,forEach:function(b,R,te){Q(b,function(){R.apply(this,arguments)},te)},count:function(b){var R=0;return Q(b,function(){R++}),R},toArray:function(b){return Q(b,function(R){return R})||[]},only:function(b){if(!ue(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},He.Component=T,He.Fragment=r,He.Profiler=a,He.PureComponent=A,He.StrictMode=o,He.Suspense=m,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,He.act=H,He.cloneElement=function(b,R,te){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var ce=_({},b.props),ge=b.key,ye=b.ref,Oe=b._owner;if(R!=null){if(R.ref!==void 0&&(ye=R.ref,Oe=q.current),R.key!==void 0&&(ge=""+R.key),b.type&&b.type.defaultProps)var Re=b.type.defaultProps;for(je in R)W.call(R,je)&&!K.hasOwnProperty(je)&&(ce[je]=R[je]===void 0&&Re!==void 0?Re[je]:R[je])}var je=arguments.length-2;if(je===1)ce.children=te;else if(1<je){Re=Array(je);for(var be=0;be<je;be++)Re[be]=arguments[be+2];ce.children=Re}return{$$typeof:n,type:b.type,key:ge,ref:ye,props:ce,_owner:Oe}},He.createContext=function(b){return b={$$typeof:f,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:u,_context:b},b.Consumer=b},He.createElement=G,He.createFactory=function(b){var R=G.bind(null,b);return R.type=b,R},He.createRef=function(){return{current:null}},He.forwardRef=function(b){return{$$typeof:h,render:b}},He.isValidElement=ue,He.lazy=function(b){return{$$typeof:x,_payload:{_status:-1,_result:b},_init:ne}},He.memo=function(b,R){return{$$typeof:g,type:b,compare:R===void 0?null:R}},He.startTransition=function(b){var R=O.transition;O.transition={};try{b()}finally{O.transition=R}},He.unstable_act=H,He.useCallback=function(b,R){return ae.current.useCallback(b,R)},He.useContext=function(b){return ae.current.useContext(b)},He.useDebugValue=function(){},He.useDeferredValue=function(b){return ae.current.useDeferredValue(b)},He.useEffect=function(b,R){return ae.current.useEffect(b,R)},He.useId=function(){return ae.current.useId()},He.useImperativeHandle=function(b,R,te){return ae.current.useImperativeHandle(b,R,te)},He.useInsertionEffect=function(b,R){return ae.current.useInsertionEffect(b,R)},He.useLayoutEffect=function(b,R){return ae.current.useLayoutEffect(b,R)},He.useMemo=function(b,R){return ae.current.useMemo(b,R)},He.useReducer=function(b,R,te){return ae.current.useReducer(b,R,te)},He.useRef=function(b){return ae.current.useRef(b)},He.useState=function(b){return ae.current.useState(b)},He.useSyncExternalStore=function(b,R,te){return ae.current.useSyncExternalStore(b,R,te)},He.useTransition=function(){return ae.current.useTransition()},He.version="18.3.1",He}var Lp;function zu(){return Lp||(Lp=1,Kc.exports=hy()),Kc.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var fy=Object.defineProperty;var py=(n,s,r)=>s in n?fy(n,s,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Pp;function my(){if(Pp)return Vi;Pp=1;var n=zu(),s=Symbol.for("react.element"),r=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,k={},y=null,N=null;g!==void 0&&(y=""+g),m.key!==void 0&&(y=""+m.key),m.ref!==void 0&&(N=m.ref);for(x in m)o.call(m,x)&&!u.hasOwnProperty(x)&&(k[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)k[x]===void 0&&(k[x]=m[x]);return{$$typeof:s,type:h,key:y,ref:N,props:k,_owner:a.current}}return Vi.Fragment=r,Vi.jsx=f,Vi.jsxs=f,Vi}var Op;function gy(){return Op||(Op=1,qc.exports=my()),qc.exports}var c=gy(),w=zu();const at=vm(w);var Sl={},Xc={exports:{}},bn={},Yc={exports:{}},Qc={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var fy=Object.defineProperty;var py=(n,s,r)=>s in n?fy(n,s,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var zp;function vy(){return zp||(zp=1,(function(n){function s(O,J){var H=O.length;O.push(J);e:for(;0<H;){var b=H-1>>>1,R=O[b];if(0<a(R,J))O[b]=J,O[H]=R,H=b;else break e}}function r(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var J=O[0],H=O.pop();if(H!==J){O[0]=H;e:for(var b=0,R=O.length,te=R>>>1;b<te;){var ce=2*(b+1)-1,ge=O[ce],ye=ce+1,Oe=O[ye];if(0>a(ge,H))ye<R&&0>a(Oe,ge)?(O[b]=Oe,O[ye]=H,b=ye):(O[b]=ge,O[ce]=H,b=ce);else if(ye<R&&0>a(Oe,H))O[b]=Oe,O[ye]=H,b=ye;else break e}}return J}function a(O,J){var H=O.sortIndex-J.sortIndex;return H!==0?H:O.id-J.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,k=null,y=3,N=!1,_=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(O){for(var J=r(g);J!==null;){if(J.callback===null)o(g);else if(J.startTime<=O)o(g),J.sortIndex=J.expirationTime,s(m,J);else break;J=r(g)}}function M(O){if(E=!1,B(O),!_)if(r(m)!==null)_=!0,ne(W);else{var J=r(g);J!==null&&ae(M,J.startTime-O)}}function W(O,J){_=!1,E&&(E=!1,L(G),G=-1),N=!0;var H=y;try{for(B(J),k=r(m);k!==null&&(!(k.expirationTime>J)||O&&!ie());){var b=k.callback;if(typeof b=="function"){k.callback=null,y=k.priorityLevel;var R=b(k.expirationTime<=J);J=n.unstable_now(),typeof R=="function"?k.callback=R:k===r(m)&&o(m),B(J)}else o(m);k=r(m)}if(k!==null)var te=!0;else{var ce=r(g);ce!==null&&ae(M,ce.startTime-J),te=!1}return te}finally{k=null,y=H,N=!1}}var q=!1,K=null,G=-1,oe=5,ue=-1;function ie(){return!(n.unstable_now()-ue<oe)}function we(){if(K!==null){var O=n.unstable_now();ue=O;var J=!0;try{J=K(!0,O)}finally{J?Ce():(q=!1,K=null)}}else q=!1}var Ce;if(typeof A=="function")Ce=function(){A(we)};else if(typeof MessageChannel<"u"){var Fe=new MessageChannel,Q=Fe.port2;Fe.port1.onmessage=we,Ce=function(){Q.postMessage(null)}}else Ce=function(){T(we,0)};function ne(O){K=O,q||(q=!0,Ce())}function ae(O,J){G=T(function(){O(n.unstable_now())},J)}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(O){O.callback=null},n.unstable_continueExecution=function(){_||N||(_=!0,ne(W))},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return r(m)},n.unstable_next=function(O){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var H=y;y=J;try{return O()}finally{y=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(O,J){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var H=y;y=O;try{return J()}finally{y=H}},n.unstable_scheduleCallback=function(O,J,H){var b=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?b+H:b):H=b,O){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=H+R,O={id:x++,callback:J,priorityLevel:O,startTime:H,expirationTime:R,sortIndex:-1},H>b?(O.sortIndex=H,s(g,O),r(m)===null&&O===r(g)&&(E?(L(G),G=-1):E=!0,ae(M,H-b))):(O.sortIndex=R,s(m,O),_||N||(_=!0,ne(W))),O},n.unstable_shouldYield=ie,n.unstable_wrapCallback=function(O){var J=y;return function(){var H=y;y=J;try{return O.apply(this,arguments)}finally{y=H}}}})(Qc)),Qc}var $p;function yy(){return $p||($p=1,Yc.exports=vy()),Yc.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,58 +30,58 @@ var fy=Object.defineProperty;var py=(n,s,r)=>s in n?fy(n,s,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var Fp;function xy(){if(Fp)return bn;Fp=1;var n=zu(),s=yy();function r(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={},k={};function y(e){return m.call(k,e)?!0:m.call(x,e)?!1:g.test(e)?k[e]=!0:(x[e]=!0,!1)}function N(e,t,i,l){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _(e,t,i,l){if(t===null||typeof t>"u"||N(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 E(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 T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];T[t]=new E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new E(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var L=/[\-:]([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(L,A);T[t]=new E(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(L,A);T[t]=new E(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(L,A);T[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function B(e,t,i,l){var d=T.hasOwnProperty(t)?T[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_(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 M=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),q=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),ue=Symbol.for("react.provider"),ie=Symbol.for("react.context"),we=Symbol.for("react.forward_ref"),Ce=Symbol.for("react.suspense"),Fe=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),O=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=O&&e[O]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,b;function R(e){if(b===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);b=t&&t[1]||""}return`
|
|
34
34
|
`+b+e}var te=!1;function ce(e,t){if(!e||te)return"";te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(U){var l=U}Reflect.construct(e,[],t)}else{try{t.call()}catch(U){l=U}e.call(t.prototype)}else{try{throw Error()}catch(U){l=U}e()}}catch(U){if(U&&l&&typeof U.stack=="string"){for(var d=U.stack.split(`
|
|
35
35
|
`),p=l.stack.split(`
|
|
36
|
-
`),v=d.length-1,
|
|
37
|
-
`+d[v].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),j}while(1<=v&&0<=N);break}}}finally{te=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?R(e):""}function ge(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(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 q:return"Portal";case oe:return"Profiler";case G:return"StrictMode";case Ce:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ie:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case we:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function Oe(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===G?"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 Re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function be(e){var t=je(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(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 mt(e){e._valueTracker||(e._valueTracker=be(e))}function Me(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=je(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function jt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ze(e,t){var i=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function zt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Re(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 We(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Wt(e,t){We(e,t);var i=Re(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")?gt(e,t.type,i):t.hasOwnProperty("defaultValue")&>(e,t.type,Re(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rt(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 gt(e,t,i){(t!=="number"||jt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var At=Array.isArray;function $t(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=""+Re(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 V(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function he(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(r(92));if(At(i)){if(1<i.length)throw Error(r(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Re(i)}}function Ue(e,t){var i=Re(t.value),l=Re(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 Ze(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vt(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 yt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dt,Yt=(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(dt=dt||document.createElement("div"),dt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var xt={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},un=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){un.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function yn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function Gn(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=yn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Mn=H({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 Ln(e,t){if(t){if(Mn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!="object")throw Error(r(62))}}function Pn(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 D=null;function _e(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var le=null,xe=null,ke=null;function Le(e){if(e=Ri(e)){if(typeof le!="function")throw Error(r(280));var t=e.stateNode;t&&(t=Oo(t),le(e.stateNode,e.type,t))}}function Se(e){xe?ke?ke.push(e):ke=[e]:xe=e}function Ve(){if(xe){var e=xe,t=ke;if(ke=xe=null,Le(e),t)for(e=0;e<t.length;e++)Le(t[e])}}function ot(e,t){return e(t)}function tt(){}var nt=!1;function It(e,t,i){if(nt)return e(t,i);nt=!0;try{return ot(e,t,i)}finally{nt=!1,(xe!==null||ke!==null)&&(tt(),Ve())}}function st(e,t){var i=e.stateNode;if(i===null)return null;var l=Oo(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(r(231,t,typeof i));return i}var wt=!1;if(h)try{var kt={};Object.defineProperty(kt,"passive",{get:function(){wt=!0}}),window.addEventListener("test",kt,kt),window.removeEventListener("test",kt,kt)}catch{wt=!1}function Be(e,t,i,l,d,p,v,N,j){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(Z){this.onError(Z)}}var Ke=!1,Lt=null,Qt=!1,qn=null,Kn={onError:function(e){Ke=!0,Lt=e}};function ga(e,t,i,l,d,p,v,N,j){Ke=!1,Lt=null,Be.apply(Kn,arguments)}function va(e,t,i,l,d,p,v,N,j){if(ga.apply(this,arguments),Ke){if(Ke){var U=Lt;Ke=!1,Lt=null}else throw Error(r(198));Qt||(Qt=!0,qn=U)}}function rt(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 ms(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 go(e){if(rt(e)!==e)throw Error(r(188))}function vo(e){var t=e.alternate;if(!t){if(t=rt(e),t===null)throw Error(r(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 go(d),e;if(p===l)return go(d),t;p=p.sibling}throw Error(r(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(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:t}function Sr(e){return e=vo(e),e!==null?di(e):null}function di(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=di(e);if(t!==null)return t;e=e.sibling}return null}var fi=s.unstable_scheduleCallback,yo=s.unstable_cancelCallback,ya=s.unstable_shouldYield,xa=s.unstable_requestPaint,St=s.unstable_now,is=s.unstable_getCurrentPriorityLevel,Rs=s.unstable_ImmediatePriority,os=s.unstable_UserBlockingPriority,Tr=s.unstable_NormalPriority,Js=s.unstable_LowPriority,xo=s.unstable_IdlePriority,er=null,Cn=null;function br(e){if(Cn&&typeof Cn.onCommitFiberRoot=="function")try{Cn.onCommitFiberRoot(er,e,void 0,(e.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:tr,Nr=Math.log,As=Math.LN2;function tr(e){return e>>>=0,e===0?32:31-(Nr(e)/As|0)|0}var fn=64,Cr=4194304;function nr(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 sr(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=nr(N):(p&=v,p!==0&&(l=nr(p)))}else v=i&~d,v!==0?l=nr(v):p!==0&&(l=nr(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-dn(t),d=1<<i,l|=e[i],t&=~d;return l}function wo(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 ko(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-dn(p),N=1<<v,j=d[v];j===-1?((N&i)===0||(N&l)!==0)&&(d[v]=wo(N,t)):j<=t&&(e.expiredLanes|=N),p&=~N}}function pi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hi(){var e=fn;return fn<<=1,(fn&4194240)===0&&(fn=64),e}function mi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function rr(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dn(t),e[t]=i}function So(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-dn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Is(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-dn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Xe=0;function se(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,z,X,me,Ee,$e=!1,Ye=[],Je=null,Tt=null,bt=null,gs=new Map,Dt=new Map,Ds=[],Mg="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 vd(e,t){switch(e){case"focusin":case"focusout":Je=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dt.delete(t.pointerId)}}function gi(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=Ri(t),t!==null&&z(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Lg(e,t,i,l,d){switch(t){case"focusin":return Je=gi(Je,e,t,i,l,d),!0;case"dragenter":return Tt=gi(Tt,e,t,i,l,d),!0;case"mouseover":return bt=gi(bt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return gs.set(p,gi(gs.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Dt.set(p,gi(Dt.get(p)||null,e,t,i,l,d)),!0}return!1}function yd(e){var t=ir(e.target);if(t!==null){var i=rt(t);if(i!==null){if(t=i.tag,t===13){if(t=ms(i),t!==null){e.blockedOn=t,Ee(e.priority,function(){X(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 To(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ka(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);D=l,i.target.dispatchEvent(l),D=null}else return t=Ri(i),t!==null&&z(t),e.blockedOn=i,!1;t.shift()}return!0}function xd(e,t,i){To(e)&&i.delete(t)}function Pg(){$e=!1,Je!==null&&To(Je)&&(Je=null),Tt!==null&&To(Tt)&&(Tt=null),bt!==null&&To(bt)&&(bt=null),gs.forEach(xd),Dt.forEach(xd)}function vi(e,t){e.blockedOn===t&&(e.blockedOn=null,$e||($e=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Pg)))}function yi(e){function t(d){return vi(d,e)}if(0<Ye.length){vi(Ye[0],e);for(var i=1;i<Ye.length;i++){var l=Ye[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Je!==null&&vi(Je,e),Tt!==null&&vi(Tt,e),bt!==null&&vi(bt,e),gs.forEach(t),Dt.forEach(t),i=0;i<Ds.length;i++)l=Ds[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ds.length&&(i=Ds[0],i.blockedOn===null);)yd(i),i.blockedOn===null&&Ds.shift()}var Er=M.ReactCurrentBatchConfig,bo=!0;function Og(e,t,i,l){var d=Xe,p=Er.transition;Er.transition=null;try{Xe=1,wa(e,t,i,l)}finally{Xe=d,Er.transition=p}}function zg(e,t,i,l){var d=Xe,p=Er.transition;Er.transition=null;try{Xe=4,wa(e,t,i,l)}finally{Xe=d,Er.transition=p}}function wa(e,t,i,l){if(bo){var d=ka(e,t,i,l);if(d===null)za(e,t,l,No,i),vd(e,l);else if(Lg(d,e,t,i,l))l.stopPropagation();else if(vd(e,l),t&4&&-1<Mg.indexOf(e)){for(;d!==null;){var p=Ri(d);if(p!==null&&S(p),p=ka(e,t,i,l),p===null&&za(e,t,l,No,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else za(e,t,l,null,i)}}var No=null;function ka(e,t,i,l){if(No=null,e=_e(l),e=ir(e),e!==null)if(t=rt(e),t===null)e=null;else if(i=t.tag,i===13){if(e=ms(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 No=e,null}function wd(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(is()){case Rs:return 1;case os:return 4;case Tr:case Js:return 16;case xo:return 536870912;default:return 16}default:return 16}}var Ms=null,Sa=null,Co=null;function kd(){if(Co)return Co;var e,t=Sa,i=t.length,l,d="value"in Ms?Ms.value:Ms.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 Co=d.slice(e,1<l?1-l:void 0)}function Eo(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 _o(){return!0}function Sd(){return!1}function En(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)?_o:Sd,this.isPropagationStopped=Sd,this}return H(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=_o)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ta=En(_r),xi=H({},_r,{view:0,detail:0}),$g=En(xi),ba,Na,wi,jo=H({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ea,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!==wi&&(wi&&e.type==="mousemove"?(ba=e.screenX-wi.screenX,Na=e.screenY-wi.screenY):Na=ba=0,wi=e),ba)},movementY:function(e){return"movementY"in e?e.movementY:Na}}),Td=En(jo),Fg=H({},jo,{dataTransfer:0}),Ug=En(Fg),Bg=H({},xi,{relatedTarget:0}),Ca=En(Bg),Wg=H({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Hg=En(Wg),Vg=H({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gg=En(Vg),qg=H({},_r,{data:0}),bd=En(qg),Kg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xg={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"},Yg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yg[e])?!!t[e]:!1}function Ea(){return Qg}var Zg=H({},xi,{key:function(e){if(e.key){var t=Kg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ea,charCode:function(e){return e.type==="keypress"?Eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jg=En(Zg),ev=H({},jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nd=En(ev),tv=H({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ea}),nv=En(tv),sv=H({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),rv=En(sv),iv=H({},jo,{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}),ov=En(iv),lv=[9,13,27,32],_a=h&&"CompositionEvent"in window,ki=null;h&&"documentMode"in document&&(ki=document.documentMode);var av=h&&"TextEvent"in window&&!ki,Cd=h&&(!_a||ki&&8<ki&&11>=ki),Ed=" ",_d=!1;function jd(e,t){switch(e){case"keyup":return lv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function cv(e,t){switch(e){case"compositionend":return Rd(t);case"keypress":return t.which!==32?null:(_d=!0,Ed);case"textInput":return e=t.data,e===Ed&&_d?null:e;default:return null}}function uv(e,t){if(jr)return e==="compositionend"||!_a&&jd(e,t)?(e=kd(),Co=Sa=Ms=null,jr=!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 Cd&&t.locale!=="ko"?null:t.data;default:return null}}var dv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dv[e.type]:t==="textarea"}function Id(e,t,i,l){Se(l),t=Mo(t,"onChange"),0<t.length&&(i=new Ta("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Si=null,Ti=null;function fv(e){Yd(e,0)}function Ro(e){var t=Mr(e);if(Me(t))return e}function pv(e,t){if(e==="change")return t}var Dd=!1;if(h){var ja;if(h){var Ra="oninput"in document;if(!Ra){var Md=document.createElement("div");Md.setAttribute("oninput","return;"),Ra=typeof Md.oninput=="function"}ja=Ra}else ja=!1;Dd=ja&&(!document.documentMode||9<document.documentMode)}function Ld(){Si&&(Si.detachEvent("onpropertychange",Pd),Ti=Si=null)}function Pd(e){if(e.propertyName==="value"&&Ro(Ti)){var t=[];Id(t,Ti,e,_e(e)),It(fv,t)}}function hv(e,t,i){e==="focusin"?(Ld(),Si=t,Ti=i,Si.attachEvent("onpropertychange",Pd)):e==="focusout"&&Ld()}function mv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ro(Ti)}function gv(e,t){if(e==="click")return Ro(t)}function vv(e,t){if(e==="input"||e==="change")return Ro(t)}function yv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xn=typeof Object.is=="function"?Object.is:yv;function bi(e,t){if(Xn(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)||!Xn(e[d],t[d]))return!1}return!0}function Od(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zd(e,t){var i=Od(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=Od(i)}}function $d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fd(){for(var e=window,t=jt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=jt(e.document)}return t}function Aa(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 xv(e){var t=Fd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&$d(i.ownerDocument.documentElement,i)){if(l!==null&&Aa(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=zd(i,p);var v=zd(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 wv=h&&"documentMode"in document&&11>=document.documentMode,Rr=null,Ia=null,Ni=null,Da=!1;function Ud(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Da||Rr==null||Rr!==jt(l)||(l=Rr,"selectionStart"in l&&Aa(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}),Ni&&bi(Ni,l)||(Ni=l,l=Mo(Ia,"onSelect"),0<l.length&&(t=new Ta("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Rr)))}function Ao(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ar={animationend:Ao("Animation","AnimationEnd"),animationiteration:Ao("Animation","AnimationIteration"),animationstart:Ao("Animation","AnimationStart"),transitionend:Ao("Transition","TransitionEnd")},Ma={},Bd={};h&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function Io(e){if(Ma[e])return Ma[e];if(!Ar[e])return e;var t=Ar[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Bd)return Ma[e]=t[i];return e}var Wd=Io("animationend"),Hd=Io("animationiteration"),Vd=Io("animationstart"),Gd=Io("transitionend"),qd=new Map,Kd="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 Ls(e,t){qd.set(e,t),u(t,[e])}for(var La=0;La<Kd.length;La++){var Pa=Kd[La],kv=Pa.toLowerCase(),Sv=Pa[0].toUpperCase()+Pa.slice(1);Ls(kv,"on"+Sv)}Ls(Wd,"onAnimationEnd"),Ls(Hd,"onAnimationIteration"),Ls(Vd,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(Gd,"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 Ci="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(" "),Tv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Xd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,va(l,t,void 0,e),e.currentTarget=null}function Yd(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],j=N.instance,U=N.currentTarget;if(N=N.listener,j!==p&&d.isPropagationStopped())break e;Xd(d,N,U),p=j}else for(v=0;v<l.length;v++){if(N=l[v],j=N.instance,U=N.currentTarget,N=N.listener,j!==p&&d.isPropagationStopped())break e;Xd(d,N,U),p=j}}}if(Qt)throw e=qn,Qt=!1,qn=null,e}function ft(e,t){var i=t[Ha];i===void 0&&(i=t[Ha]=new Set);var l=e+"__bubble";i.has(l)||(Qd(t,e,2,!1),i.add(l))}function Oa(e,t,i){var l=0;t&&(l|=4),Qd(i,e,l,t)}var Do="_reactListening"+Math.random().toString(36).slice(2);function Ei(e){if(!e[Do]){e[Do]=!0,o.forEach(function(i){i!=="selectionchange"&&(Tv.has(i)||Oa(i,!1,e),Oa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Do]||(t[Do]=!0,Oa("selectionchange",!1,t))}}function Qd(e,t,i,l){switch(wd(t)){case 1:var d=Og;break;case 4:d=zg;break;default:d=wa}i=d.bind(null,t,i,e),d=void 0,!wt||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 za(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 j=v.tag;if((j===3||j===4)&&(j=v.stateNode.containerInfo,j===d||j.nodeType===8&&j.parentNode===d))return;v=v.return}for(;N!==null;){if(v=ir(N),v===null)return;if(j=v.tag,j===5||j===6){l=p=v;continue e}N=N.parentNode}}l=l.return}It(function(){var U=p,Z=_e(i),ee=[];e:{var Y=qd.get(e);if(Y!==void 0){var de=Ta,pe=e;switch(e){case"keypress":if(Eo(i)===0)break e;case"keydown":case"keyup":de=Jg;break;case"focusin":pe="focus",de=Ca;break;case"focusout":pe="blur",de=Ca;break;case"beforeblur":case"afterblur":de=Ca;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=Td;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Ug;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=nv;break;case Wd:case Hd:case Vd:de=Hg;break;case Gd:de=rv;break;case"scroll":de=$g;break;case"wheel":de=ov;break;case"copy":case"cut":case"paste":de=Gg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Nd}var ve=(t&4)!==0,Mt=!ve&&e==="scroll",$=ve?Y!==null?Y+"Capture":null:Y;ve=[];for(var I=U,F;I!==null;){F=I;var re=F.stateNode;if(F.tag===5&&re!==null&&(F=re,$!==null&&(re=st(I,$),re!=null&&ve.push(_i(I,re,F)))),Mt)break;I=I.return}0<ve.length&&(Y=new de(Y,pe,null,i,Z),ee.push({event:Y,listeners:ve}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",Y&&i!==D&&(pe=i.relatedTarget||i.fromElement)&&(ir(pe)||pe[vs]))break e;if((de||Y)&&(Y=Z.window===Z?Z:(Y=Z.ownerDocument)?Y.defaultView||Y.parentWindow:window,de?(pe=i.relatedTarget||i.toElement,de=U,pe=pe?ir(pe):null,pe!==null&&(Mt=rt(pe),pe!==Mt||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(de=null,pe=U),de!==pe)){if(ve=Td,re="onMouseLeave",$="onMouseEnter",I="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Nd,re="onPointerLeave",$="onPointerEnter",I="pointer"),Mt=de==null?Y:Mr(de),F=pe==null?Y:Mr(pe),Y=new ve(re,I+"leave",de,i,Z),Y.target=Mt,Y.relatedTarget=F,re=null,ir(Z)===U&&(ve=new ve($,I+"enter",pe,i,Z),ve.target=F,ve.relatedTarget=Mt,re=ve),Mt=re,de&&pe)t:{for(ve=de,$=pe,I=0,F=ve;F;F=Ir(F))I++;for(F=0,re=$;re;re=Ir(re))F++;for(;0<I-F;)ve=Ir(ve),I--;for(;0<F-I;)$=Ir($),F--;for(;I--;){if(ve===$||$!==null&&ve===$.alternate)break t;ve=Ir(ve),$=Ir($)}ve=null}else ve=null;de!==null&&Zd(ee,Y,de,ve,!1),pe!==null&&Mt!==null&&Zd(ee,Mt,pe,ve,!0)}}e:{if(Y=U?Mr(U):window,de=Y.nodeName&&Y.nodeName.toLowerCase(),de==="select"||de==="input"&&Y.type==="file")var Te=pv;else if(Ad(Y))if(Dd)Te=vv;else{Te=mv;var Ie=hv}else(de=Y.nodeName)&&de.toLowerCase()==="input"&&(Y.type==="checkbox"||Y.type==="radio")&&(Te=gv);if(Te&&(Te=Te(e,U))){Id(ee,Te,i,Z);break e}Ie&&Ie(e,Y,U),e==="focusout"&&(Ie=Y._wrapperState)&&Ie.controlled&&Y.type==="number"&>(Y,"number",Y.value)}switch(Ie=U?Mr(U):window,e){case"focusin":(Ad(Ie)||Ie.contentEditable==="true")&&(Rr=Ie,Ia=U,Ni=null);break;case"focusout":Ni=Ia=Rr=null;break;case"mousedown":Da=!0;break;case"contextmenu":case"mouseup":case"dragend":Da=!1,Ud(ee,i,Z);break;case"selectionchange":if(wv)break;case"keydown":case"keyup":Ud(ee,i,Z)}var De;if(_a)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else jr?jd(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(Cd&&i.locale!=="ko"&&(jr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&jr&&(De=kd()):(Ms=Z,Sa="value"in Ms?Ms.value:Ms.textContent,jr=!0)),Ie=Mo(U,Pe),0<Ie.length&&(Pe=new bd(Pe,e,null,i,Z),ee.push({event:Pe,listeners:Ie}),De?Pe.data=De:(De=Rd(i),De!==null&&(Pe.data=De)))),(De=av?cv(e,i):uv(e,i))&&(U=Mo(U,"onBeforeInput"),0<U.length&&(Z=new bd("onBeforeInput","beforeinput",null,i,Z),ee.push({event:Z,listeners:U}),Z.data=De))}Yd(ee,t)})}function _i(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Mo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=st(e,i),p!=null&&l.unshift(_i(e,p,d)),p=st(e,t),p!=null&&l.push(_i(e,p,d))),e=e.return}return l}function Ir(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var N=i,j=N.alternate,U=N.stateNode;if(j!==null&&j===l)break;N.tag===5&&U!==null&&(N=U,d?(j=st(i,p),j!=null&&v.unshift(_i(i,j,N))):d||(j=st(i,p),j!=null&&v.push(_i(i,j,N)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var bv=/\r\n?/g,Nv=/\u0000|\uFFFD/g;function Jd(e){return(typeof e=="string"?e:""+e).replace(bv,`
|
|
38
|
-
`).replace(Nv,"")}function Lo(e,t,i){if(t=Jd(t),Jd(e)!==t&&i)throw Error(r(425))}function Po(){}var $a=null,Fa=null;function Ua(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 Ba=typeof setTimeout=="function"?setTimeout:void 0,Cv=typeof clearTimeout=="function"?clearTimeout:void 0,ef=typeof Promise=="function"?Promise:void 0,Ev=typeof queueMicrotask=="function"?queueMicrotask:typeof ef<"u"?function(e){return ef.resolve(null).then(e).catch(_v)}:Ba;function _v(e){setTimeout(function(){throw e})}function Wa(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),yi(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);yi(t)}function Ps(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 tf(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 Dr=Math.random().toString(36).slice(2),ls="__reactFiber$"+Dr,ji="__reactProps$"+Dr,vs="__reactContainer$"+Dr,Ha="__reactEvents$"+Dr,jv="__reactListeners$"+Dr,Rv="__reactHandles$"+Dr;function ir(e){var t=e[ls];if(t)return t;for(var i=e.parentNode;i;){if(t=i[vs]||i[ls]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=tf(e);e!==null;){if(i=e[ls])return i;e=tf(e)}return t}e=i,i=e.parentNode}return null}function Ri(e){return e=e[ls]||e[vs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Oo(e){return e[ji]||null}var Va=[],Lr=-1;function Os(e){return{current:e}}function pt(e){0>Lr||(e.current=Va[Lr],Va[Lr]=null,Lr--)}function ut(e,t){Lr++,Va[Lr]=e.current,e.current=t}var zs={},rn=Os(zs),xn=Os(!1),or=zs;function Pr(e,t){var i=e.type.contextTypes;if(!i)return zs;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 wn(e){return e=e.childContextTypes,e!=null}function zo(){pt(xn),pt(rn)}function nf(e,t,i){if(rn.current!==zs)throw Error(r(168));ut(rn,t),ut(xn,i)}function sf(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(r(108,Oe(e)||"Unknown",d));return H({},i,l)}function $o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zs,or=rn.current,ut(rn,e),ut(xn,xn.current),!0}function rf(e,t,i){var l=e.stateNode;if(!l)throw Error(r(169));i?(e=sf(e,t,or),l.__reactInternalMemoizedMergedChildContext=e,pt(xn),pt(rn),ut(rn,e)):pt(xn),ut(xn,i)}var ys=null,Fo=!1,Ga=!1;function of(e){ys===null?ys=[e]:ys.push(e)}function Av(e){Fo=!0,of(e)}function $s(){if(!Ga&&ys!==null){Ga=!0;var e=0,t=Xe;try{var i=ys;for(Xe=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}ys=null,Fo=!1}catch(d){throw ys!==null&&(ys=ys.slice(e+1)),fi(Rs,$s),d}finally{Xe=t,Ga=!1}}return null}var Or=[],zr=0,Uo=null,Bo=0,On=[],zn=0,lr=null,xs=1,ws="";function ar(e,t){Or[zr++]=Bo,Or[zr++]=Uo,Uo=e,Bo=t}function lf(e,t,i){On[zn++]=xs,On[zn++]=ws,On[zn++]=lr,lr=e;var l=xs;e=ws;var d=32-dn(l)-1;l&=~(1<<d),i+=1;var p=32-dn(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,xs=1<<32-dn(t)+d|i<<d|l,ws=p+e}else xs=1<<p|i<<d|l,ws=e}function qa(e){e.return!==null&&(ar(e,1),lf(e,1,0))}function Ka(e){for(;e===Uo;)Uo=Or[--zr],Or[zr]=null,Bo=Or[--zr],Or[zr]=null;for(;e===lr;)lr=On[--zn],On[zn]=null,ws=On[--zn],On[zn]=null,xs=On[--zn],On[zn]=null}var _n=null,jn=null,ht=!1,Yn=null;function af(e,t){var i=Bn(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 cf(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,_n=e,jn=Ps(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_n=e,jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=lr!==null?{id:xs,overflow:ws}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Bn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,_n=e,jn=null,!0):!1;default:return!1}}function Xa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ya(e){if(ht){var t=jn;if(t){var i=t;if(!cf(e,t)){if(Xa(e))throw Error(r(418));t=Ps(i.nextSibling);var l=_n;t&&cf(e,t)?af(l,i):(e.flags=e.flags&-4097|2,ht=!1,_n=e)}}else{if(Xa(e))throw Error(r(418));e.flags=e.flags&-4097|2,ht=!1,_n=e}}}function uf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_n=e}function Wo(e){if(e!==_n)return!1;if(!ht)return uf(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ua(e.type,e.memoizedProps)),t&&(t=jn)){if(Xa(e))throw df(),Error(r(418));for(;t;)af(e,t),t=Ps(t.nextSibling)}if(uf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){jn=Ps(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}jn=null}}else jn=_n?Ps(e.stateNode.nextSibling):null;return!0}function df(){for(var e=jn;e;)e=Ps(e.nextSibling)}function $r(){jn=_n=null,ht=!1}function Qa(e){Yn===null?Yn=[e]:Yn.push(e)}var Iv=M.ReactCurrentBatchConfig;function Ai(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(r(309));var l=i.stateNode}if(!l)throw Error(r(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(r(284));if(!i._owner)throw Error(r(290,e))}return e}function Ho(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ff(e){var t=e._init;return t(e._payload)}function pf(e){function t($,I){if(e){var F=$.deletions;F===null?($.deletions=[I],$.flags|=16):F.push(I)}}function i($,I){if(!e)return null;for(;I!==null;)t($,I),I=I.sibling;return null}function l($,I){for($=new Map;I!==null;)I.key!==null?$.set(I.key,I):$.set(I.index,I),I=I.sibling;return $}function d($,I){return $=qs($,I),$.index=0,$.sibling=null,$}function p($,I,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<I?($.flags|=2,I):F):($.flags|=2,I)):($.flags|=1048576,I)}function v($){return e&&$.alternate===null&&($.flags|=2),$}function N($,I,F,re){return I===null||I.tag!==6?(I=Bc(F,$.mode,re),I.return=$,I):(I=d(I,F),I.return=$,I)}function j($,I,F,re){var Te=F.type;return Te===K?Z($,I,F.props.children,re,F.key):I!==null&&(I.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===ne&&ff(Te)===I.type)?(re=d(I,F.props),re.ref=Ai($,I,F),re.return=$,re):(re=hl(F.type,F.key,F.props,null,$.mode,re),re.ref=Ai($,I,F),re.return=$,re)}function U($,I,F,re){return I===null||I.tag!==4||I.stateNode.containerInfo!==F.containerInfo||I.stateNode.implementation!==F.implementation?(I=Wc(F,$.mode,re),I.return=$,I):(I=d(I,F.children||[]),I.return=$,I)}function Z($,I,F,re,Te){return I===null||I.tag!==7?(I=gr(F,$.mode,re,Te),I.return=$,I):(I=d(I,F),I.return=$,I)}function ee($,I,F){if(typeof I=="string"&&I!==""||typeof I=="number")return I=Bc(""+I,$.mode,F),I.return=$,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case W:return F=hl(I.type,I.key,I.props,null,$.mode,F),F.ref=Ai($,null,I),F.return=$,F;case q:return I=Wc(I,$.mode,F),I.return=$,I;case ne:var re=I._init;return ee($,re(I._payload),F)}if(At(I)||J(I))return I=gr(I,$.mode,F,null),I.return=$,I;Ho($,I)}return null}function Y($,I,F,re){var Te=I!==null?I.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Te!==null?null:N($,I,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Te?j($,I,F,re):null;case q:return F.key===Te?U($,I,F,re):null;case ne:return Te=F._init,Y($,I,Te(F._payload),re)}if(At(F)||J(F))return Te!==null?null:Z($,I,F,re,null);Ho($,F)}return null}function de($,I,F,re,Te){if(typeof re=="string"&&re!==""||typeof re=="number")return $=$.get(F)||null,N(I,$,""+re,Te);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case W:return $=$.get(re.key===null?F:re.key)||null,j(I,$,re,Te);case q:return $=$.get(re.key===null?F:re.key)||null,U(I,$,re,Te);case ne:var Ie=re._init;return de($,I,F,Ie(re._payload),Te)}if(At(re)||J(re))return $=$.get(F)||null,Z(I,$,re,Te,null);Ho(I,re)}return null}function pe($,I,F,re){for(var Te=null,Ie=null,De=I,Pe=I=0,Gt=null;De!==null&&Pe<F.length;Pe++){De.index>Pe?(Gt=De,De=null):Gt=De.sibling;var et=Y($,De,F[Pe],re);if(et===null){De===null&&(De=Gt);break}e&&De&&et.alternate===null&&t($,De),I=p(et,I,Pe),Ie===null?Te=et:Ie.sibling=et,Ie=et,De=Gt}if(Pe===F.length)return i($,De),ht&&ar($,Pe),Te;if(De===null){for(;Pe<F.length;Pe++)De=ee($,F[Pe],re),De!==null&&(I=p(De,I,Pe),Ie===null?Te=De:Ie.sibling=De,Ie=De);return ht&&ar($,Pe),Te}for(De=l($,De);Pe<F.length;Pe++)Gt=de(De,$,Pe,F[Pe],re),Gt!==null&&(e&&Gt.alternate!==null&&De.delete(Gt.key===null?Pe:Gt.key),I=p(Gt,I,Pe),Ie===null?Te=Gt:Ie.sibling=Gt,Ie=Gt);return e&&De.forEach(function(Ks){return t($,Ks)}),ht&&ar($,Pe),Te}function ve($,I,F,re){var Te=J(F);if(typeof Te!="function")throw Error(r(150));if(F=Te.call(F),F==null)throw Error(r(151));for(var Ie=Te=null,De=I,Pe=I=0,Gt=null,et=F.next();De!==null&&!et.done;Pe++,et=F.next()){De.index>Pe?(Gt=De,De=null):Gt=De.sibling;var Ks=Y($,De,et.value,re);if(Ks===null){De===null&&(De=Gt);break}e&&De&&Ks.alternate===null&&t($,De),I=p(Ks,I,Pe),Ie===null?Te=Ks:Ie.sibling=Ks,Ie=Ks,De=Gt}if(et.done)return i($,De),ht&&ar($,Pe),Te;if(De===null){for(;!et.done;Pe++,et=F.next())et=ee($,et.value,re),et!==null&&(I=p(et,I,Pe),Ie===null?Te=et:Ie.sibling=et,Ie=et);return ht&&ar($,Pe),Te}for(De=l($,De);!et.done;Pe++,et=F.next())et=de(De,$,Pe,et.value,re),et!==null&&(e&&et.alternate!==null&&De.delete(et.key===null?Pe:et.key),I=p(et,I,Pe),Ie===null?Te=et:Ie.sibling=et,Ie=et);return e&&De.forEach(function(dy){return t($,dy)}),ht&&ar($,Pe),Te}function Mt($,I,F,re){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 W:e:{for(var Te=F.key,Ie=I;Ie!==null;){if(Ie.key===Te){if(Te=F.type,Te===K){if(Ie.tag===7){i($,Ie.sibling),I=d(Ie,F.props.children),I.return=$,$=I;break e}}else if(Ie.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===ne&&ff(Te)===Ie.type){i($,Ie.sibling),I=d(Ie,F.props),I.ref=Ai($,Ie,F),I.return=$,$=I;break e}i($,Ie);break}else t($,Ie);Ie=Ie.sibling}F.type===K?(I=gr(F.props.children,$.mode,re,F.key),I.return=$,$=I):(re=hl(F.type,F.key,F.props,null,$.mode,re),re.ref=Ai($,I,F),re.return=$,$=re)}return v($);case q:e:{for(Ie=F.key;I!==null;){if(I.key===Ie)if(I.tag===4&&I.stateNode.containerInfo===F.containerInfo&&I.stateNode.implementation===F.implementation){i($,I.sibling),I=d(I,F.children||[]),I.return=$,$=I;break e}else{i($,I);break}else t($,I);I=I.sibling}I=Wc(F,$.mode,re),I.return=$,$=I}return v($);case ne:return Ie=F._init,Mt($,I,Ie(F._payload),re)}if(At(F))return pe($,I,F,re);if(J(F))return ve($,I,F,re);Ho($,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,I!==null&&I.tag===6?(i($,I.sibling),I=d(I,F),I.return=$,$=I):(i($,I),I=Bc(F,$.mode,re),I.return=$,$=I),v($)):i($,I)}return Mt}var Fr=pf(!0),hf=pf(!1),Vo=Os(null),Go=null,Ur=null,Za=null;function Ja(){Za=Ur=Go=null}function ec(e){var t=Vo.current;pt(Vo),e._currentValue=t}function tc(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 Br(e,t){Go=e,Za=Ur=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(kn=!0),e.firstContext=null)}function $n(e){var t=e._currentValue;if(Za!==e)if(e={context:e,memoizedValue:t,next:null},Ur===null){if(Go===null)throw Error(r(308));Ur=e,Go.dependencies={lanes:0,firstContext:e}}else Ur=Ur.next=e;return t}var cr=null;function nc(e){cr===null?cr=[e]:cr.push(e)}function mf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,nc(t)):(i.next=d.next,d.next=i),t.interleaved=i,ks(e,l)}function ks(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 Fs=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gf(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 Ss(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(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,ks(e,i)}return d=l.interleaved,d===null?(t.next=t,nc(l)):(t.next=d.next,d.next=t),l.interleaved=t,ks(e,i)}function qo(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,Is(e,i)}}function vf(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 Ko(e,t,i,l){var d=e.updateQueue;Fs=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var j=N,U=j.next;j.next=null,v===null?p=U:v.next=U,v=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,N=Z.lastBaseUpdate,N!==v&&(N===null?Z.firstBaseUpdate=U:N.next=U,Z.lastBaseUpdate=j))}if(p!==null){var ee=d.baseState;v=0,Z=U=j=null,N=p;do{var Y=N.lane,de=N.eventTime;if((l&Y)===Y){Z!==null&&(Z=Z.next={eventTime:de,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var pe=e,ve=N;switch(Y=t,de=i,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){ee=pe.call(de,ee,Y);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,Y=typeof pe=="function"?pe.call(de,ee,Y):pe,Y==null)break e;ee=H({},ee,Y);break e;case 2:Fs=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,Y=d.effects,Y===null?d.effects=[N]:Y.push(N))}else de={eventTime:de,lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Z===null?(U=Z=de,j=ee):Z=Z.next=de,v|=Y;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Y=N,N=Y.next,Y.next=null,d.lastBaseUpdate=Y,d.shared.pending=null}}while(!0);if(Z===null&&(j=ee),d.baseState=j,d.firstBaseUpdate=U,d.lastBaseUpdate=Z,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);fr|=v,e.lanes=v,e.memoizedState=ee}}function yf(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(r(191,d));d.call(l)}}}var Ii={},as=Os(Ii),Di=Os(Ii),Mi=Os(Ii);function ur(e){if(e===Ii)throw Error(r(174));return e}function rc(e,t){switch(ut(Mi,t),ut(Di,e),ut(as,Ii),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yt(t,e)}pt(as),ut(as,t)}function Wr(){pt(as),pt(Di),pt(Mi)}function xf(e){ur(Mi.current);var t=ur(as.current),i=yt(t,e.type);t!==i&&(ut(Di,e),ut(as,i))}function ic(e){Di.current===e&&(pt(as),pt(Di))}var Nt=Os(0);function Xo(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 oc=[];function lc(){for(var e=0;e<oc.length;e++)oc[e]._workInProgressVersionPrimary=null;oc.length=0}var Yo=M.ReactCurrentDispatcher,ac=M.ReactCurrentBatchConfig,dr=0,Ct=null,Ft=null,Ht=null,Qo=!1,Li=!1,Pi=0,Dv=0;function on(){throw Error(r(321))}function cc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Xn(e[i],t[i]))return!1;return!0}function uc(e,t,i,l,d,p){if(dr=p,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yo.current=e===null||e.memoizedState===null?Ov:zv,e=i(l,d),Li){p=0;do{if(Li=!1,Pi=0,25<=p)throw Error(r(301));p+=1,Ht=Ft=null,t.updateQueue=null,Yo.current=$v,e=i(l,d)}while(Li)}if(Yo.current=el,t=Ft!==null&&Ft.next!==null,dr=0,Ht=Ft=Ct=null,Qo=!1,t)throw Error(r(300));return e}function dc(){var e=Pi!==0;return Pi=0,e}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Fn(){if(Ft===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var t=Ht===null?Ct.memoizedState:Ht.next;if(t!==null)Ht=t,Ft=e;else{if(e===null)throw Error(r(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function Oi(e,t){return typeof t=="function"?t(e):t}function fc(e){var t=Fn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=Ft,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,j=null,U=p;do{var Z=U.lane;if((dr&Z)===Z)j!==null&&(j=j.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var ee={lane:Z,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};j===null?(N=j=ee,v=l):j=j.next=ee,Ct.lanes|=Z,fr|=Z}U=U.next}while(U!==null&&U!==p);j===null?v=l:j.next=N,Xn(l,t.memoizedState)||(kn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=j,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Ct.lanes|=p,fr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function pc(e){var t=Fn(),i=t.queue;if(i===null)throw Error(r(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);Xn(p,t.memoizedState)||(kn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function wf(){}function kf(e,t){var i=Ct,l=Fn(),d=t(),p=!Xn(l.memoizedState,d);if(p&&(l.memoizedState=d,kn=!0),l=l.queue,hc(bf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Ht!==null&&Ht.memoizedState.tag&1){if(i.flags|=2048,zi(9,Tf.bind(null,i,l,d,t),void 0,null),Vt===null)throw Error(r(349));(dr&30)!==0||Sf(i,t,d)}return d}function Sf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Tf(e,t,i,l){t.value=i,t.getSnapshot=l,Nf(t)&&Cf(e)}function bf(e,t,i){return i(function(){Nf(t)&&Cf(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Xn(e,i)}catch{return!0}}function Cf(e){var t=ks(e,1);t!==null&&es(t,e,1,-1)}function Ef(e){var t=cs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:e},t.queue=e,e=e.dispatch=Pv.bind(null,Ct,e),[t.memoizedState,e]}function zi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.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 _f(){return Fn().memoizedState}function Zo(e,t,i,l){var d=cs();Ct.flags|=e,d.memoizedState=zi(1|t,i,void 0,l===void 0?null:l)}function Jo(e,t,i,l){var d=Fn();l=l===void 0?null:l;var p=void 0;if(Ft!==null){var v=Ft.memoizedState;if(p=v.destroy,l!==null&&cc(l,v.deps)){d.memoizedState=zi(t,i,p,l);return}}Ct.flags|=e,d.memoizedState=zi(1|t,i,p,l)}function jf(e,t){return Zo(8390656,8,e,t)}function hc(e,t){return Jo(2048,8,e,t)}function Rf(e,t){return Jo(4,2,e,t)}function Af(e,t){return Jo(4,4,e,t)}function If(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 Df(e,t,i){return i=i!=null?i.concat([e]):null,Jo(4,4,If.bind(null,t,e),i)}function mc(){}function Mf(e,t){var i=Fn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&cc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Lf(e,t){var i=Fn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&cc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Pf(e,t,i){return(dr&21)===0?(e.baseState&&(e.baseState=!1,kn=!0),e.memoizedState=i):(Xn(i,t)||(i=hi(),Ct.lanes|=i,fr|=i,e.baseState=!0),t)}function Mv(e,t){var i=Xe;Xe=i!==0&&4>i?i:4,e(!0);var l=ac.transition;ac.transition={};try{e(!1),t()}finally{Xe=i,ac.transition=l}}function Of(){return Fn().memoizedState}function Lv(e,t,i){var l=Vs(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},zf(e))$f(t,i);else if(i=mf(e,t,i,l),i!==null){var d=hn();es(i,e,l,d),Ff(i,t,l)}}function Pv(e,t,i){var l=Vs(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(zf(e))$f(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,Xn(N,v)){var j=t.interleaved;j===null?(d.next=d,nc(t)):(d.next=j.next,j.next=d),t.interleaved=d;return}}catch{}finally{}i=mf(e,t,d,l),i!==null&&(d=hn(),es(i,e,l,d),Ff(i,t,l))}}function zf(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function $f(e,t){Li=Qo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ff(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Is(e,i)}}var el={readContext:$n,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},Ov={readContext:$n,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:$n,useEffect:jf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Zo(4194308,4,If.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zo(4,2,e,t)},useMemo:function(e,t){var i=cs();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=cs();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=Lv.bind(null,Ct,e),[l.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:Ef,useDebugValue:mc,useDeferredValue:function(e){return cs().memoizedState=e},useTransition:function(){var e=Ef(!1),t=e[0];return e=Mv.bind(null,e[1]),cs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Ct,d=cs();if(ht){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),Vt===null)throw Error(r(349));(dr&30)!==0||Sf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,jf(bf.bind(null,l,p,e),[e]),l.flags|=2048,zi(9,Tf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=cs(),t=Vt.identifierPrefix;if(ht){var i=ws,l=xs;i=(l&~(1<<32-dn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Pi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Dv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zv={readContext:$n,useCallback:Mf,useContext:$n,useEffect:hc,useImperativeHandle:Df,useInsertionEffect:Rf,useLayoutEffect:Af,useMemo:Lf,useReducer:fc,useRef:_f,useState:function(){return fc(Oi)},useDebugValue:mc,useDeferredValue:function(e){var t=Fn();return Pf(t,Ft.memoizedState,e)},useTransition:function(){var e=fc(Oi)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Of,unstable_isNewReconciler:!1},$v={readContext:$n,useCallback:Mf,useContext:$n,useEffect:hc,useImperativeHandle:Df,useInsertionEffect:Rf,useLayoutEffect:Af,useMemo:Lf,useReducer:pc,useRef:_f,useState:function(){return pc(Oi)},useDebugValue:mc,useDeferredValue:function(e){var t=Fn();return Ft===null?t.memoizedState=e:Pf(t,Ft.memoizedState,e)},useTransition:function(){var e=pc(Oi)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Of,unstable_isNewReconciler:!1};function Qn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function gc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:H({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var tl={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=hn(),d=Vs(e),p=Ss(l,d);p.payload=t,i!=null&&(p.callback=i),t=Us(e,p,d),t!==null&&(es(t,e,d,l),qo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=hn(),d=Vs(e),p=Ss(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Us(e,p,d),t!==null&&(es(t,e,d,l),qo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=hn(),l=Vs(e),d=Ss(i,l);d.tag=2,t!=null&&(d.callback=t),t=Us(e,d,l),t!==null&&(es(t,e,l,i),qo(t,e,l))}};function Uf(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?!bi(i,l)||!bi(d,p):!0}function Bf(e,t,i){var l=!1,d=zs,p=t.contextType;return typeof p=="object"&&p!==null?p=$n(p):(d=wn(t)?or:rn.current,l=t.contextTypes,p=(l=l!=null)?Pr(e,d):zs),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Wf(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&&tl.enqueueReplaceState(t,t.state,null)}function vc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},sc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=$n(p):(p=wn(t)?or:rn.current,d.context=Pr(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(gc(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&&tl.enqueueReplaceState(d,d.state,null),Ko(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Hr(e,t){try{var i="",l=t;do i+=ge(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
36
|
+
`),v=d.length-1,C=p.length-1;1<=v&&0<=C&&d[v]!==p[C];)C--;for(;1<=v&&0<=C;v--,C--)if(d[v]!==p[C]){if(v!==1||C!==1)do if(v--,C--,0>C||d[v]!==p[C]){var j=`
|
|
37
|
+
`+d[v].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),j}while(1<=v&&0<=C);break}}}finally{te=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?R(e):""}function ge(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(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 q:return"Portal";case oe:return"Profiler";case G:return"StrictMode";case Ce:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ie:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case we:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function Oe(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===G?"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 Re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function be(e){var t=je(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(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 mt(e){e._valueTracker||(e._valueTracker=be(e))}function Me(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=je(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function jt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ze(e,t){var i=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function zt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Re(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 We(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Wt(e,t){We(e,t);var i=Re(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")?gt(e,t.type,i):t.hasOwnProperty("defaultValue")&>(e,t.type,Re(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rt(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 gt(e,t,i){(t!=="number"||jt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var At=Array.isArray;function $t(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=""+Re(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 V(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function he(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(r(92));if(At(i)){if(1<i.length)throw Error(r(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Re(i)}}function Ue(e,t){var i=Re(t.value),l=Re(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 Ze(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vt(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 yt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dt,Yt=(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(dt=dt||document.createElement("div"),dt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var xt={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},un=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){un.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function yn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function Gn(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=yn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Mn=H({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 Ln(e,t){if(t){if(Mn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!="object")throw Error(r(62))}}function Pn(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 D=null;function _e(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var le=null,xe=null,ke=null;function Le(e){if(e=Ri(e)){if(typeof le!="function")throw Error(r(280));var t=e.stateNode;t&&(t=Oo(t),le(e.stateNode,e.type,t))}}function Se(e){xe?ke?ke.push(e):ke=[e]:xe=e}function Ve(){if(xe){var e=xe,t=ke;if(ke=xe=null,Le(e),t)for(e=0;e<t.length;e++)Le(t[e])}}function ot(e,t){return e(t)}function tt(){}var nt=!1;function It(e,t,i){if(nt)return e(t,i);nt=!0;try{return ot(e,t,i)}finally{nt=!1,(xe!==null||ke!==null)&&(tt(),Ve())}}function st(e,t){var i=e.stateNode;if(i===null)return null;var l=Oo(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(r(231,t,typeof i));return i}var wt=!1;if(h)try{var kt={};Object.defineProperty(kt,"passive",{get:function(){wt=!0}}),window.addEventListener("test",kt,kt),window.removeEventListener("test",kt,kt)}catch{wt=!1}function Be(e,t,i,l,d,p,v,C,j){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(Z){this.onError(Z)}}var Ke=!1,Lt=null,Qt=!1,qn=null,Kn={onError:function(e){Ke=!0,Lt=e}};function ma(e,t,i,l,d,p,v,C,j){Ke=!1,Lt=null,Be.apply(Kn,arguments)}function ga(e,t,i,l,d,p,v,C,j){if(ma.apply(this,arguments),Ke){if(Ke){var U=Lt;Ke=!1,Lt=null}else throw Error(r(198));Qt||(Qt=!0,qn=U)}}function rt(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 ms(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 go(e){if(rt(e)!==e)throw Error(r(188))}function vo(e){var t=e.alternate;if(!t){if(t=rt(e),t===null)throw Error(r(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 go(d),e;if(p===l)return go(d),t;p=p.sibling}throw Error(r(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,C=d.child;C;){if(C===i){v=!0,i=d,l=p;break}if(C===l){v=!0,l=d,i=p;break}C=C.sibling}if(!v){for(C=p.child;C;){if(C===i){v=!0,i=p,l=d;break}if(C===l){v=!0,l=p,i=d;break}C=C.sibling}if(!v)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:t}function Sr(e){return e=vo(e),e!==null?di(e):null}function di(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=di(e);if(t!==null)return t;e=e.sibling}return null}var fi=s.unstable_scheduleCallback,yo=s.unstable_cancelCallback,va=s.unstable_shouldYield,ya=s.unstable_requestPaint,St=s.unstable_now,is=s.unstable_getCurrentPriorityLevel,Rs=s.unstable_ImmediatePriority,os=s.unstable_UserBlockingPriority,Tr=s.unstable_NormalPriority,Js=s.unstable_LowPriority,xo=s.unstable_IdlePriority,er=null,Cn=null;function br(e){if(Cn&&typeof Cn.onCommitFiberRoot=="function")try{Cn.onCommitFiberRoot(er,e,void 0,(e.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:tr,Nr=Math.log,As=Math.LN2;function tr(e){return e>>>=0,e===0?32:31-(Nr(e)/As|0)|0}var fn=64,Cr=4194304;function nr(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 sr(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 C=v&~d;C!==0?l=nr(C):(p&=v,p!==0&&(l=nr(p)))}else v=i&~d,v!==0?l=nr(v):p!==0&&(l=nr(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-dn(t),d=1<<i,l|=e[i],t&=~d;return l}function wo(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 ko(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-dn(p),C=1<<v,j=d[v];j===-1?((C&i)===0||(C&l)!==0)&&(d[v]=wo(C,t)):j<=t&&(e.expiredLanes|=C),p&=~C}}function pi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hi(){var e=fn;return fn<<=1,(fn&4194240)===0&&(fn=64),e}function mi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function rr(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dn(t),e[t]=i}function So(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-dn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Is(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-dn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Xe=0;function se(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,z,X,me,Ee,$e=!1,Ye=[],Je=null,Tt=null,bt=null,gs=new Map,Dt=new Map,Ds=[],Mg="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 gd(e,t){switch(e){case"focusin":case"focusout":Je=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dt.delete(t.pointerId)}}function gi(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=Ri(t),t!==null&&z(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Lg(e,t,i,l,d){switch(t){case"focusin":return Je=gi(Je,e,t,i,l,d),!0;case"dragenter":return Tt=gi(Tt,e,t,i,l,d),!0;case"mouseover":return bt=gi(bt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return gs.set(p,gi(gs.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Dt.set(p,gi(Dt.get(p)||null,e,t,i,l,d)),!0}return!1}function vd(e){var t=ir(e.target);if(t!==null){var i=rt(t);if(i!==null){if(t=i.tag,t===13){if(t=ms(i),t!==null){e.blockedOn=t,Ee(e.priority,function(){X(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 To(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);D=l,i.target.dispatchEvent(l),D=null}else return t=Ri(i),t!==null&&z(t),e.blockedOn=i,!1;t.shift()}return!0}function yd(e,t,i){To(e)&&i.delete(t)}function Pg(){$e=!1,Je!==null&&To(Je)&&(Je=null),Tt!==null&&To(Tt)&&(Tt=null),bt!==null&&To(bt)&&(bt=null),gs.forEach(yd),Dt.forEach(yd)}function vi(e,t){e.blockedOn===t&&(e.blockedOn=null,$e||($e=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Pg)))}function yi(e){function t(d){return vi(d,e)}if(0<Ye.length){vi(Ye[0],e);for(var i=1;i<Ye.length;i++){var l=Ye[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Je!==null&&vi(Je,e),Tt!==null&&vi(Tt,e),bt!==null&&vi(bt,e),gs.forEach(t),Dt.forEach(t),i=0;i<Ds.length;i++)l=Ds[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ds.length&&(i=Ds[0],i.blockedOn===null);)vd(i),i.blockedOn===null&&Ds.shift()}var Er=M.ReactCurrentBatchConfig,bo=!0;function Og(e,t,i,l){var d=Xe,p=Er.transition;Er.transition=null;try{Xe=1,xa(e,t,i,l)}finally{Xe=d,Er.transition=p}}function zg(e,t,i,l){var d=Xe,p=Er.transition;Er.transition=null;try{Xe=4,xa(e,t,i,l)}finally{Xe=d,Er.transition=p}}function xa(e,t,i,l){if(bo){var d=wa(e,t,i,l);if(d===null)Oa(e,t,l,No,i),gd(e,l);else if(Lg(d,e,t,i,l))l.stopPropagation();else if(gd(e,l),t&4&&-1<Mg.indexOf(e)){for(;d!==null;){var p=Ri(d);if(p!==null&&S(p),p=wa(e,t,i,l),p===null&&Oa(e,t,l,No,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Oa(e,t,l,null,i)}}var No=null;function wa(e,t,i,l){if(No=null,e=_e(l),e=ir(e),e!==null)if(t=rt(e),t===null)e=null;else if(i=t.tag,i===13){if(e=ms(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 No=e,null}function xd(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(is()){case Rs:return 1;case os:return 4;case Tr:case Js:return 16;case xo:return 536870912;default:return 16}default:return 16}}var Ms=null,ka=null,Co=null;function wd(){if(Co)return Co;var e,t=ka,i=t.length,l,d="value"in Ms?Ms.value:Ms.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 Co=d.slice(e,1<l?1-l:void 0)}function Eo(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 _o(){return!0}function kd(){return!1}function En(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 C in e)e.hasOwnProperty(C)&&(i=e[C],this[C]=i?i(p):p[C]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?_o:kd,this.isPropagationStopped=kd,this}return H(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=_o)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sa=En(_r),xi=H({},_r,{view:0,detail:0}),$g=En(xi),Ta,ba,wi,jo=H({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ca,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!==wi&&(wi&&e.type==="mousemove"?(Ta=e.screenX-wi.screenX,ba=e.screenY-wi.screenY):ba=Ta=0,wi=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:ba}}),Sd=En(jo),Fg=H({},jo,{dataTransfer:0}),Ug=En(Fg),Bg=H({},xi,{relatedTarget:0}),Na=En(Bg),Wg=H({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Hg=En(Wg),Vg=H({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gg=En(Vg),qg=H({},_r,{data:0}),Td=En(qg),Kg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xg={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"},Yg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yg[e])?!!t[e]:!1}function Ca(){return Qg}var Zg=H({},xi,{key:function(e){if(e.key){var t=Kg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ca,charCode:function(e){return e.type==="keypress"?Eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jg=En(Zg),ev=H({},jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bd=En(ev),tv=H({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ca}),nv=En(tv),sv=H({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),rv=En(sv),iv=H({},jo,{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}),ov=En(iv),lv=[9,13,27,32],Ea=h&&"CompositionEvent"in window,ki=null;h&&"documentMode"in document&&(ki=document.documentMode);var av=h&&"TextEvent"in window&&!ki,Nd=h&&(!Ea||ki&&8<ki&&11>=ki),Cd=" ",Ed=!1;function _d(e,t){switch(e){case"keyup":return lv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function cv(e,t){switch(e){case"compositionend":return jd(t);case"keypress":return t.which!==32?null:(Ed=!0,Cd);case"textInput":return e=t.data,e===Cd&&Ed?null:e;default:return null}}function uv(e,t){if(jr)return e==="compositionend"||!Ea&&_d(e,t)?(e=wd(),Co=ka=Ms=null,jr=!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 Nd&&t.locale!=="ko"?null:t.data;default:return null}}var dv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dv[e.type]:t==="textarea"}function Ad(e,t,i,l){Se(l),t=Mo(t,"onChange"),0<t.length&&(i=new Sa("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Si=null,Ti=null;function fv(e){Xd(e,0)}function Ro(e){var t=Mr(e);if(Me(t))return e}function pv(e,t){if(e==="change")return t}var Id=!1;if(h){var _a;if(h){var ja="oninput"in document;if(!ja){var Dd=document.createElement("div");Dd.setAttribute("oninput","return;"),ja=typeof Dd.oninput=="function"}_a=ja}else _a=!1;Id=_a&&(!document.documentMode||9<document.documentMode)}function Md(){Si&&(Si.detachEvent("onpropertychange",Ld),Ti=Si=null)}function Ld(e){if(e.propertyName==="value"&&Ro(Ti)){var t=[];Ad(t,Ti,e,_e(e)),It(fv,t)}}function hv(e,t,i){e==="focusin"?(Md(),Si=t,Ti=i,Si.attachEvent("onpropertychange",Ld)):e==="focusout"&&Md()}function mv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ro(Ti)}function gv(e,t){if(e==="click")return Ro(t)}function vv(e,t){if(e==="input"||e==="change")return Ro(t)}function yv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xn=typeof Object.is=="function"?Object.is:yv;function bi(e,t){if(Xn(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)||!Xn(e[d],t[d]))return!1}return!0}function Pd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Od(e,t){var i=Pd(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=Pd(i)}}function zd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $d(){for(var e=window,t=jt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=jt(e.document)}return t}function Ra(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 xv(e){var t=$d(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&zd(i.ownerDocument.documentElement,i)){if(l!==null&&Ra(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=Od(i,p);var v=Od(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 wv=h&&"documentMode"in document&&11>=document.documentMode,Rr=null,Aa=null,Ni=null,Ia=!1;function Fd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ia||Rr==null||Rr!==jt(l)||(l=Rr,"selectionStart"in l&&Ra(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}),Ni&&bi(Ni,l)||(Ni=l,l=Mo(Aa,"onSelect"),0<l.length&&(t=new Sa("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Rr)))}function Ao(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ar={animationend:Ao("Animation","AnimationEnd"),animationiteration:Ao("Animation","AnimationIteration"),animationstart:Ao("Animation","AnimationStart"),transitionend:Ao("Transition","TransitionEnd")},Da={},Ud={};h&&(Ud=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function Io(e){if(Da[e])return Da[e];if(!Ar[e])return e;var t=Ar[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Ud)return Da[e]=t[i];return e}var Bd=Io("animationend"),Wd=Io("animationiteration"),Hd=Io("animationstart"),Vd=Io("transitionend"),Gd=new Map,qd="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 Ls(e,t){Gd.set(e,t),u(t,[e])}for(var Ma=0;Ma<qd.length;Ma++){var La=qd[Ma],kv=La.toLowerCase(),Sv=La[0].toUpperCase()+La.slice(1);Ls(kv,"on"+Sv)}Ls(Bd,"onAnimationEnd"),Ls(Wd,"onAnimationIteration"),Ls(Hd,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(Vd,"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 Ci="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(" "),Tv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Kd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,ga(l,t,void 0,e),e.currentTarget=null}function Xd(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 C=l[v],j=C.instance,U=C.currentTarget;if(C=C.listener,j!==p&&d.isPropagationStopped())break e;Kd(d,C,U),p=j}else for(v=0;v<l.length;v++){if(C=l[v],j=C.instance,U=C.currentTarget,C=C.listener,j!==p&&d.isPropagationStopped())break e;Kd(d,C,U),p=j}}}if(Qt)throw e=qn,Qt=!1,qn=null,e}function ft(e,t){var i=t[Wa];i===void 0&&(i=t[Wa]=new Set);var l=e+"__bubble";i.has(l)||(Yd(t,e,2,!1),i.add(l))}function Pa(e,t,i){var l=0;t&&(l|=4),Yd(i,e,l,t)}var Do="_reactListening"+Math.random().toString(36).slice(2);function Ei(e){if(!e[Do]){e[Do]=!0,o.forEach(function(i){i!=="selectionchange"&&(Tv.has(i)||Pa(i,!1,e),Pa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Do]||(t[Do]=!0,Pa("selectionchange",!1,t))}}function Yd(e,t,i,l){switch(xd(t)){case 1:var d=Og;break;case 4:d=zg;break;default:d=xa}i=d.bind(null,t,i,e),d=void 0,!wt||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 Oa(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 C=l.stateNode.containerInfo;if(C===d||C.nodeType===8&&C.parentNode===d)break;if(v===4)for(v=l.return;v!==null;){var j=v.tag;if((j===3||j===4)&&(j=v.stateNode.containerInfo,j===d||j.nodeType===8&&j.parentNode===d))return;v=v.return}for(;C!==null;){if(v=ir(C),v===null)return;if(j=v.tag,j===5||j===6){l=p=v;continue e}C=C.parentNode}}l=l.return}It(function(){var U=p,Z=_e(i),ee=[];e:{var Y=Gd.get(e);if(Y!==void 0){var de=Sa,pe=e;switch(e){case"keypress":if(Eo(i)===0)break e;case"keydown":case"keyup":de=Jg;break;case"focusin":pe="focus",de=Na;break;case"focusout":pe="blur",de=Na;break;case"beforeblur":case"afterblur":de=Na;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=Sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Ug;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=nv;break;case Bd:case Wd:case Hd:de=Hg;break;case Vd:de=rv;break;case"scroll":de=$g;break;case"wheel":de=ov;break;case"copy":case"cut":case"paste":de=Gg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=bd}var ve=(t&4)!==0,Mt=!ve&&e==="scroll",$=ve?Y!==null?Y+"Capture":null:Y;ve=[];for(var I=U,F;I!==null;){F=I;var re=F.stateNode;if(F.tag===5&&re!==null&&(F=re,$!==null&&(re=st(I,$),re!=null&&ve.push(_i(I,re,F)))),Mt)break;I=I.return}0<ve.length&&(Y=new de(Y,pe,null,i,Z),ee.push({event:Y,listeners:ve}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",Y&&i!==D&&(pe=i.relatedTarget||i.fromElement)&&(ir(pe)||pe[vs]))break e;if((de||Y)&&(Y=Z.window===Z?Z:(Y=Z.ownerDocument)?Y.defaultView||Y.parentWindow:window,de?(pe=i.relatedTarget||i.toElement,de=U,pe=pe?ir(pe):null,pe!==null&&(Mt=rt(pe),pe!==Mt||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(de=null,pe=U),de!==pe)){if(ve=Sd,re="onMouseLeave",$="onMouseEnter",I="mouse",(e==="pointerout"||e==="pointerover")&&(ve=bd,re="onPointerLeave",$="onPointerEnter",I="pointer"),Mt=de==null?Y:Mr(de),F=pe==null?Y:Mr(pe),Y=new ve(re,I+"leave",de,i,Z),Y.target=Mt,Y.relatedTarget=F,re=null,ir(Z)===U&&(ve=new ve($,I+"enter",pe,i,Z),ve.target=F,ve.relatedTarget=Mt,re=ve),Mt=re,de&&pe)t:{for(ve=de,$=pe,I=0,F=ve;F;F=Ir(F))I++;for(F=0,re=$;re;re=Ir(re))F++;for(;0<I-F;)ve=Ir(ve),I--;for(;0<F-I;)$=Ir($),F--;for(;I--;){if(ve===$||$!==null&&ve===$.alternate)break t;ve=Ir(ve),$=Ir($)}ve=null}else ve=null;de!==null&&Qd(ee,Y,de,ve,!1),pe!==null&&Mt!==null&&Qd(ee,Mt,pe,ve,!0)}}e:{if(Y=U?Mr(U):window,de=Y.nodeName&&Y.nodeName.toLowerCase(),de==="select"||de==="input"&&Y.type==="file")var Te=pv;else if(Rd(Y))if(Id)Te=vv;else{Te=mv;var Ie=hv}else(de=Y.nodeName)&&de.toLowerCase()==="input"&&(Y.type==="checkbox"||Y.type==="radio")&&(Te=gv);if(Te&&(Te=Te(e,U))){Ad(ee,Te,i,Z);break e}Ie&&Ie(e,Y,U),e==="focusout"&&(Ie=Y._wrapperState)&&Ie.controlled&&Y.type==="number"&>(Y,"number",Y.value)}switch(Ie=U?Mr(U):window,e){case"focusin":(Rd(Ie)||Ie.contentEditable==="true")&&(Rr=Ie,Aa=U,Ni=null);break;case"focusout":Ni=Aa=Rr=null;break;case"mousedown":Ia=!0;break;case"contextmenu":case"mouseup":case"dragend":Ia=!1,Fd(ee,i,Z);break;case"selectionchange":if(wv)break;case"keydown":case"keyup":Fd(ee,i,Z)}var De;if(Ea)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else jr?_d(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(Nd&&i.locale!=="ko"&&(jr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&jr&&(De=wd()):(Ms=Z,ka="value"in Ms?Ms.value:Ms.textContent,jr=!0)),Ie=Mo(U,Pe),0<Ie.length&&(Pe=new Td(Pe,e,null,i,Z),ee.push({event:Pe,listeners:Ie}),De?Pe.data=De:(De=jd(i),De!==null&&(Pe.data=De)))),(De=av?cv(e,i):uv(e,i))&&(U=Mo(U,"onBeforeInput"),0<U.length&&(Z=new Td("onBeforeInput","beforeinput",null,i,Z),ee.push({event:Z,listeners:U}),Z.data=De))}Xd(ee,t)})}function _i(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Mo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=st(e,i),p!=null&&l.unshift(_i(e,p,d)),p=st(e,t),p!=null&&l.push(_i(e,p,d))),e=e.return}return l}function Ir(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var C=i,j=C.alternate,U=C.stateNode;if(j!==null&&j===l)break;C.tag===5&&U!==null&&(C=U,d?(j=st(i,p),j!=null&&v.unshift(_i(i,j,C))):d||(j=st(i,p),j!=null&&v.push(_i(i,j,C)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var bv=/\r\n?/g,Nv=/\u0000|\uFFFD/g;function Zd(e){return(typeof e=="string"?e:""+e).replace(bv,`
|
|
38
|
+
`).replace(Nv,"")}function Lo(e,t,i){if(t=Zd(t),Zd(e)!==t&&i)throw Error(r(425))}function Po(){}var za=null,$a=null;function Fa(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 Ua=typeof setTimeout=="function"?setTimeout:void 0,Cv=typeof clearTimeout=="function"?clearTimeout:void 0,Jd=typeof Promise=="function"?Promise:void 0,Ev=typeof queueMicrotask=="function"?queueMicrotask:typeof Jd<"u"?function(e){return Jd.resolve(null).then(e).catch(_v)}:Ua;function _v(e){setTimeout(function(){throw e})}function Ba(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),yi(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);yi(t)}function Ps(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 ef(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 Dr=Math.random().toString(36).slice(2),ls="__reactFiber$"+Dr,ji="__reactProps$"+Dr,vs="__reactContainer$"+Dr,Wa="__reactEvents$"+Dr,jv="__reactListeners$"+Dr,Rv="__reactHandles$"+Dr;function ir(e){var t=e[ls];if(t)return t;for(var i=e.parentNode;i;){if(t=i[vs]||i[ls]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=ef(e);e!==null;){if(i=e[ls])return i;e=ef(e)}return t}e=i,i=e.parentNode}return null}function Ri(e){return e=e[ls]||e[vs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Oo(e){return e[ji]||null}var Ha=[],Lr=-1;function Os(e){return{current:e}}function pt(e){0>Lr||(e.current=Ha[Lr],Ha[Lr]=null,Lr--)}function ut(e,t){Lr++,Ha[Lr]=e.current,e.current=t}var zs={},rn=Os(zs),xn=Os(!1),or=zs;function Pr(e,t){var i=e.type.contextTypes;if(!i)return zs;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 wn(e){return e=e.childContextTypes,e!=null}function zo(){pt(xn),pt(rn)}function tf(e,t,i){if(rn.current!==zs)throw Error(r(168));ut(rn,t),ut(xn,i)}function nf(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(r(108,Oe(e)||"Unknown",d));return H({},i,l)}function $o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zs,or=rn.current,ut(rn,e),ut(xn,xn.current),!0}function sf(e,t,i){var l=e.stateNode;if(!l)throw Error(r(169));i?(e=nf(e,t,or),l.__reactInternalMemoizedMergedChildContext=e,pt(xn),pt(rn),ut(rn,e)):pt(xn),ut(xn,i)}var ys=null,Fo=!1,Va=!1;function rf(e){ys===null?ys=[e]:ys.push(e)}function Av(e){Fo=!0,rf(e)}function $s(){if(!Va&&ys!==null){Va=!0;var e=0,t=Xe;try{var i=ys;for(Xe=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}ys=null,Fo=!1}catch(d){throw ys!==null&&(ys=ys.slice(e+1)),fi(Rs,$s),d}finally{Xe=t,Va=!1}}return null}var Or=[],zr=0,Uo=null,Bo=0,On=[],zn=0,lr=null,xs=1,ws="";function ar(e,t){Or[zr++]=Bo,Or[zr++]=Uo,Uo=e,Bo=t}function of(e,t,i){On[zn++]=xs,On[zn++]=ws,On[zn++]=lr,lr=e;var l=xs;e=ws;var d=32-dn(l)-1;l&=~(1<<d),i+=1;var p=32-dn(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,xs=1<<32-dn(t)+d|i<<d|l,ws=p+e}else xs=1<<p|i<<d|l,ws=e}function Ga(e){e.return!==null&&(ar(e,1),of(e,1,0))}function qa(e){for(;e===Uo;)Uo=Or[--zr],Or[zr]=null,Bo=Or[--zr],Or[zr]=null;for(;e===lr;)lr=On[--zn],On[zn]=null,ws=On[--zn],On[zn]=null,xs=On[--zn],On[zn]=null}var _n=null,jn=null,ht=!1,Yn=null;function lf(e,t){var i=Bn(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 af(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,_n=e,jn=Ps(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_n=e,jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=lr!==null?{id:xs,overflow:ws}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Bn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,_n=e,jn=null,!0):!1;default:return!1}}function Ka(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xa(e){if(ht){var t=jn;if(t){var i=t;if(!af(e,t)){if(Ka(e))throw Error(r(418));t=Ps(i.nextSibling);var l=_n;t&&af(e,t)?lf(l,i):(e.flags=e.flags&-4097|2,ht=!1,_n=e)}}else{if(Ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,ht=!1,_n=e}}}function cf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_n=e}function Wo(e){if(e!==_n)return!1;if(!ht)return cf(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fa(e.type,e.memoizedProps)),t&&(t=jn)){if(Ka(e))throw uf(),Error(r(418));for(;t;)lf(e,t),t=Ps(t.nextSibling)}if(cf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){jn=Ps(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}jn=null}}else jn=_n?Ps(e.stateNode.nextSibling):null;return!0}function uf(){for(var e=jn;e;)e=Ps(e.nextSibling)}function $r(){jn=_n=null,ht=!1}function Ya(e){Yn===null?Yn=[e]:Yn.push(e)}var Iv=M.ReactCurrentBatchConfig;function Ai(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(r(309));var l=i.stateNode}if(!l)throw Error(r(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 C=d.refs;v===null?delete C[p]:C[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function Ho(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function df(e){var t=e._init;return t(e._payload)}function ff(e){function t($,I){if(e){var F=$.deletions;F===null?($.deletions=[I],$.flags|=16):F.push(I)}}function i($,I){if(!e)return null;for(;I!==null;)t($,I),I=I.sibling;return null}function l($,I){for($=new Map;I!==null;)I.key!==null?$.set(I.key,I):$.set(I.index,I),I=I.sibling;return $}function d($,I){return $=qs($,I),$.index=0,$.sibling=null,$}function p($,I,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<I?($.flags|=2,I):F):($.flags|=2,I)):($.flags|=1048576,I)}function v($){return e&&$.alternate===null&&($.flags|=2),$}function C($,I,F,re){return I===null||I.tag!==6?(I=Uc(F,$.mode,re),I.return=$,I):(I=d(I,F),I.return=$,I)}function j($,I,F,re){var Te=F.type;return Te===K?Z($,I,F.props.children,re,F.key):I!==null&&(I.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===ne&&df(Te)===I.type)?(re=d(I,F.props),re.ref=Ai($,I,F),re.return=$,re):(re=hl(F.type,F.key,F.props,null,$.mode,re),re.ref=Ai($,I,F),re.return=$,re)}function U($,I,F,re){return I===null||I.tag!==4||I.stateNode.containerInfo!==F.containerInfo||I.stateNode.implementation!==F.implementation?(I=Bc(F,$.mode,re),I.return=$,I):(I=d(I,F.children||[]),I.return=$,I)}function Z($,I,F,re,Te){return I===null||I.tag!==7?(I=gr(F,$.mode,re,Te),I.return=$,I):(I=d(I,F),I.return=$,I)}function ee($,I,F){if(typeof I=="string"&&I!==""||typeof I=="number")return I=Uc(""+I,$.mode,F),I.return=$,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case W:return F=hl(I.type,I.key,I.props,null,$.mode,F),F.ref=Ai($,null,I),F.return=$,F;case q:return I=Bc(I,$.mode,F),I.return=$,I;case ne:var re=I._init;return ee($,re(I._payload),F)}if(At(I)||J(I))return I=gr(I,$.mode,F,null),I.return=$,I;Ho($,I)}return null}function Y($,I,F,re){var Te=I!==null?I.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Te!==null?null:C($,I,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Te?j($,I,F,re):null;case q:return F.key===Te?U($,I,F,re):null;case ne:return Te=F._init,Y($,I,Te(F._payload),re)}if(At(F)||J(F))return Te!==null?null:Z($,I,F,re,null);Ho($,F)}return null}function de($,I,F,re,Te){if(typeof re=="string"&&re!==""||typeof re=="number")return $=$.get(F)||null,C(I,$,""+re,Te);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case W:return $=$.get(re.key===null?F:re.key)||null,j(I,$,re,Te);case q:return $=$.get(re.key===null?F:re.key)||null,U(I,$,re,Te);case ne:var Ie=re._init;return de($,I,F,Ie(re._payload),Te)}if(At(re)||J(re))return $=$.get(F)||null,Z(I,$,re,Te,null);Ho(I,re)}return null}function pe($,I,F,re){for(var Te=null,Ie=null,De=I,Pe=I=0,Gt=null;De!==null&&Pe<F.length;Pe++){De.index>Pe?(Gt=De,De=null):Gt=De.sibling;var et=Y($,De,F[Pe],re);if(et===null){De===null&&(De=Gt);break}e&&De&&et.alternate===null&&t($,De),I=p(et,I,Pe),Ie===null?Te=et:Ie.sibling=et,Ie=et,De=Gt}if(Pe===F.length)return i($,De),ht&&ar($,Pe),Te;if(De===null){for(;Pe<F.length;Pe++)De=ee($,F[Pe],re),De!==null&&(I=p(De,I,Pe),Ie===null?Te=De:Ie.sibling=De,Ie=De);return ht&&ar($,Pe),Te}for(De=l($,De);Pe<F.length;Pe++)Gt=de(De,$,Pe,F[Pe],re),Gt!==null&&(e&&Gt.alternate!==null&&De.delete(Gt.key===null?Pe:Gt.key),I=p(Gt,I,Pe),Ie===null?Te=Gt:Ie.sibling=Gt,Ie=Gt);return e&&De.forEach(function(Ks){return t($,Ks)}),ht&&ar($,Pe),Te}function ve($,I,F,re){var Te=J(F);if(typeof Te!="function")throw Error(r(150));if(F=Te.call(F),F==null)throw Error(r(151));for(var Ie=Te=null,De=I,Pe=I=0,Gt=null,et=F.next();De!==null&&!et.done;Pe++,et=F.next()){De.index>Pe?(Gt=De,De=null):Gt=De.sibling;var Ks=Y($,De,et.value,re);if(Ks===null){De===null&&(De=Gt);break}e&&De&&Ks.alternate===null&&t($,De),I=p(Ks,I,Pe),Ie===null?Te=Ks:Ie.sibling=Ks,Ie=Ks,De=Gt}if(et.done)return i($,De),ht&&ar($,Pe),Te;if(De===null){for(;!et.done;Pe++,et=F.next())et=ee($,et.value,re),et!==null&&(I=p(et,I,Pe),Ie===null?Te=et:Ie.sibling=et,Ie=et);return ht&&ar($,Pe),Te}for(De=l($,De);!et.done;Pe++,et=F.next())et=de(De,$,Pe,et.value,re),et!==null&&(e&&et.alternate!==null&&De.delete(et.key===null?Pe:et.key),I=p(et,I,Pe),Ie===null?Te=et:Ie.sibling=et,Ie=et);return e&&De.forEach(function(dy){return t($,dy)}),ht&&ar($,Pe),Te}function Mt($,I,F,re){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 W:e:{for(var Te=F.key,Ie=I;Ie!==null;){if(Ie.key===Te){if(Te=F.type,Te===K){if(Ie.tag===7){i($,Ie.sibling),I=d(Ie,F.props.children),I.return=$,$=I;break e}}else if(Ie.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===ne&&df(Te)===Ie.type){i($,Ie.sibling),I=d(Ie,F.props),I.ref=Ai($,Ie,F),I.return=$,$=I;break e}i($,Ie);break}else t($,Ie);Ie=Ie.sibling}F.type===K?(I=gr(F.props.children,$.mode,re,F.key),I.return=$,$=I):(re=hl(F.type,F.key,F.props,null,$.mode,re),re.ref=Ai($,I,F),re.return=$,$=re)}return v($);case q:e:{for(Ie=F.key;I!==null;){if(I.key===Ie)if(I.tag===4&&I.stateNode.containerInfo===F.containerInfo&&I.stateNode.implementation===F.implementation){i($,I.sibling),I=d(I,F.children||[]),I.return=$,$=I;break e}else{i($,I);break}else t($,I);I=I.sibling}I=Bc(F,$.mode,re),I.return=$,$=I}return v($);case ne:return Ie=F._init,Mt($,I,Ie(F._payload),re)}if(At(F))return pe($,I,F,re);if(J(F))return ve($,I,F,re);Ho($,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,I!==null&&I.tag===6?(i($,I.sibling),I=d(I,F),I.return=$,$=I):(i($,I),I=Uc(F,$.mode,re),I.return=$,$=I),v($)):i($,I)}return Mt}var Fr=ff(!0),pf=ff(!1),Vo=Os(null),Go=null,Ur=null,Qa=null;function Za(){Qa=Ur=Go=null}function Ja(e){var t=Vo.current;pt(Vo),e._currentValue=t}function ec(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 Br(e,t){Go=e,Qa=Ur=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(kn=!0),e.firstContext=null)}function $n(e){var t=e._currentValue;if(Qa!==e)if(e={context:e,memoizedValue:t,next:null},Ur===null){if(Go===null)throw Error(r(308));Ur=e,Go.dependencies={lanes:0,firstContext:e}}else Ur=Ur.next=e;return t}var cr=null;function tc(e){cr===null?cr=[e]:cr.push(e)}function hf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,tc(t)):(i.next=d.next,d.next=i),t.interleaved=i,ks(e,l)}function ks(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 Fs=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mf(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 Ss(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(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,ks(e,i)}return d=l.interleaved,d===null?(t.next=t,tc(l)):(t.next=d.next,d.next=t),l.interleaved=t,ks(e,i)}function qo(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,Is(e,i)}}function gf(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 Ko(e,t,i,l){var d=e.updateQueue;Fs=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var j=C,U=j.next;j.next=null,v===null?p=U:v.next=U,v=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,C=Z.lastBaseUpdate,C!==v&&(C===null?Z.firstBaseUpdate=U:C.next=U,Z.lastBaseUpdate=j))}if(p!==null){var ee=d.baseState;v=0,Z=U=j=null,C=p;do{var Y=C.lane,de=C.eventTime;if((l&Y)===Y){Z!==null&&(Z=Z.next={eventTime:de,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var pe=e,ve=C;switch(Y=t,de=i,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){ee=pe.call(de,ee,Y);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,Y=typeof pe=="function"?pe.call(de,ee,Y):pe,Y==null)break e;ee=H({},ee,Y);break e;case 2:Fs=!0}}C.callback!==null&&C.lane!==0&&(e.flags|=64,Y=d.effects,Y===null?d.effects=[C]:Y.push(C))}else de={eventTime:de,lane:Y,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Z===null?(U=Z=de,j=ee):Z=Z.next=de,v|=Y;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;Y=C,C=Y.next,Y.next=null,d.lastBaseUpdate=Y,d.shared.pending=null}}while(!0);if(Z===null&&(j=ee),d.baseState=j,d.firstBaseUpdate=U,d.lastBaseUpdate=Z,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);fr|=v,e.lanes=v,e.memoizedState=ee}}function vf(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(r(191,d));d.call(l)}}}var Ii={},as=Os(Ii),Di=Os(Ii),Mi=Os(Ii);function ur(e){if(e===Ii)throw Error(r(174));return e}function sc(e,t){switch(ut(Mi,t),ut(Di,e),ut(as,Ii),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yt(t,e)}pt(as),ut(as,t)}function Wr(){pt(as),pt(Di),pt(Mi)}function yf(e){ur(Mi.current);var t=ur(as.current),i=yt(t,e.type);t!==i&&(ut(Di,e),ut(as,i))}function rc(e){Di.current===e&&(pt(as),pt(Di))}var Nt=Os(0);function Xo(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 ic=[];function oc(){for(var e=0;e<ic.length;e++)ic[e]._workInProgressVersionPrimary=null;ic.length=0}var Yo=M.ReactCurrentDispatcher,lc=M.ReactCurrentBatchConfig,dr=0,Ct=null,Ft=null,Ht=null,Qo=!1,Li=!1,Pi=0,Dv=0;function on(){throw Error(r(321))}function ac(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Xn(e[i],t[i]))return!1;return!0}function cc(e,t,i,l,d,p){if(dr=p,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yo.current=e===null||e.memoizedState===null?Ov:zv,e=i(l,d),Li){p=0;do{if(Li=!1,Pi=0,25<=p)throw Error(r(301));p+=1,Ht=Ft=null,t.updateQueue=null,Yo.current=$v,e=i(l,d)}while(Li)}if(Yo.current=el,t=Ft!==null&&Ft.next!==null,dr=0,Ht=Ft=Ct=null,Qo=!1,t)throw Error(r(300));return e}function uc(){var e=Pi!==0;return Pi=0,e}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Fn(){if(Ft===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var t=Ht===null?Ct.memoizedState:Ht.next;if(t!==null)Ht=t,Ft=e;else{if(e===null)throw Error(r(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function Oi(e,t){return typeof t=="function"?t(e):t}function dc(e){var t=Fn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=Ft,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 C=v=null,j=null,U=p;do{var Z=U.lane;if((dr&Z)===Z)j!==null&&(j=j.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var ee={lane:Z,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};j===null?(C=j=ee,v=l):j=j.next=ee,Ct.lanes|=Z,fr|=Z}U=U.next}while(U!==null&&U!==p);j===null?v=l:j.next=C,Xn(l,t.memoizedState)||(kn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=j,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Ct.lanes|=p,fr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function fc(e){var t=Fn(),i=t.queue;if(i===null)throw Error(r(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);Xn(p,t.memoizedState)||(kn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function xf(){}function wf(e,t){var i=Ct,l=Fn(),d=t(),p=!Xn(l.memoizedState,d);if(p&&(l.memoizedState=d,kn=!0),l=l.queue,pc(Tf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Ht!==null&&Ht.memoizedState.tag&1){if(i.flags|=2048,zi(9,Sf.bind(null,i,l,d,t),void 0,null),Vt===null)throw Error(r(349));(dr&30)!==0||kf(i,t,d)}return d}function kf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Sf(e,t,i,l){t.value=i,t.getSnapshot=l,bf(t)&&Nf(e)}function Tf(e,t,i){return i(function(){bf(t)&&Nf(e)})}function bf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Xn(e,i)}catch{return!0}}function Nf(e){var t=ks(e,1);t!==null&&es(t,e,1,-1)}function Cf(e){var t=cs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:e},t.queue=e,e=e.dispatch=Pv.bind(null,Ct,e),[t.memoizedState,e]}function zi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.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 Ef(){return Fn().memoizedState}function Zo(e,t,i,l){var d=cs();Ct.flags|=e,d.memoizedState=zi(1|t,i,void 0,l===void 0?null:l)}function Jo(e,t,i,l){var d=Fn();l=l===void 0?null:l;var p=void 0;if(Ft!==null){var v=Ft.memoizedState;if(p=v.destroy,l!==null&&ac(l,v.deps)){d.memoizedState=zi(t,i,p,l);return}}Ct.flags|=e,d.memoizedState=zi(1|t,i,p,l)}function _f(e,t){return Zo(8390656,8,e,t)}function pc(e,t){return Jo(2048,8,e,t)}function jf(e,t){return Jo(4,2,e,t)}function Rf(e,t){return Jo(4,4,e,t)}function Af(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 If(e,t,i){return i=i!=null?i.concat([e]):null,Jo(4,4,Af.bind(null,t,e),i)}function hc(){}function Df(e,t){var i=Fn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Mf(e,t){var i=Fn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Lf(e,t,i){return(dr&21)===0?(e.baseState&&(e.baseState=!1,kn=!0),e.memoizedState=i):(Xn(i,t)||(i=hi(),Ct.lanes|=i,fr|=i,e.baseState=!0),t)}function Mv(e,t){var i=Xe;Xe=i!==0&&4>i?i:4,e(!0);var l=lc.transition;lc.transition={};try{e(!1),t()}finally{Xe=i,lc.transition=l}}function Pf(){return Fn().memoizedState}function Lv(e,t,i){var l=Vs(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Of(e))zf(t,i);else if(i=hf(e,t,i,l),i!==null){var d=hn();es(i,e,l,d),$f(i,t,l)}}function Pv(e,t,i){var l=Vs(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Of(e))zf(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,C=p(v,i);if(d.hasEagerState=!0,d.eagerState=C,Xn(C,v)){var j=t.interleaved;j===null?(d.next=d,tc(t)):(d.next=j.next,j.next=d),t.interleaved=d;return}}catch{}finally{}i=hf(e,t,d,l),i!==null&&(d=hn(),es(i,e,l,d),$f(i,t,l))}}function Of(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function zf(e,t){Li=Qo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function $f(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Is(e,i)}}var el={readContext:$n,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},Ov={readContext:$n,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:$n,useEffect:_f,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Zo(4194308,4,Af.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zo(4,2,e,t)},useMemo:function(e,t){var i=cs();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=cs();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=Lv.bind(null,Ct,e),[l.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:Cf,useDebugValue:hc,useDeferredValue:function(e){return cs().memoizedState=e},useTransition:function(){var e=Cf(!1),t=e[0];return e=Mv.bind(null,e[1]),cs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Ct,d=cs();if(ht){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),Vt===null)throw Error(r(349));(dr&30)!==0||kf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,_f(Tf.bind(null,l,p,e),[e]),l.flags|=2048,zi(9,Sf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=cs(),t=Vt.identifierPrefix;if(ht){var i=ws,l=xs;i=(l&~(1<<32-dn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Pi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Dv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zv={readContext:$n,useCallback:Df,useContext:$n,useEffect:pc,useImperativeHandle:If,useInsertionEffect:jf,useLayoutEffect:Rf,useMemo:Mf,useReducer:dc,useRef:Ef,useState:function(){return dc(Oi)},useDebugValue:hc,useDeferredValue:function(e){var t=Fn();return Lf(t,Ft.memoizedState,e)},useTransition:function(){var e=dc(Oi)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:xf,useSyncExternalStore:wf,useId:Pf,unstable_isNewReconciler:!1},$v={readContext:$n,useCallback:Df,useContext:$n,useEffect:pc,useImperativeHandle:If,useInsertionEffect:jf,useLayoutEffect:Rf,useMemo:Mf,useReducer:fc,useRef:Ef,useState:function(){return fc(Oi)},useDebugValue:hc,useDeferredValue:function(e){var t=Fn();return Ft===null?t.memoizedState=e:Lf(t,Ft.memoizedState,e)},useTransition:function(){var e=fc(Oi)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:xf,useSyncExternalStore:wf,useId:Pf,unstable_isNewReconciler:!1};function Qn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function mc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:H({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var tl={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=hn(),d=Vs(e),p=Ss(l,d);p.payload=t,i!=null&&(p.callback=i),t=Us(e,p,d),t!==null&&(es(t,e,d,l),qo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=hn(),d=Vs(e),p=Ss(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Us(e,p,d),t!==null&&(es(t,e,d,l),qo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=hn(),l=Vs(e),d=Ss(i,l);d.tag=2,t!=null&&(d.callback=t),t=Us(e,d,l),t!==null&&(es(t,e,l,i),qo(t,e,l))}};function Ff(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?!bi(i,l)||!bi(d,p):!0}function Uf(e,t,i){var l=!1,d=zs,p=t.contextType;return typeof p=="object"&&p!==null?p=$n(p):(d=wn(t)?or:rn.current,l=t.contextTypes,p=(l=l!=null)?Pr(e,d):zs),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Bf(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&&tl.enqueueReplaceState(t,t.state,null)}function gc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},nc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=$n(p):(p=wn(t)?or:rn.current,d.context=Pr(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(mc(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&&tl.enqueueReplaceState(d,d.state,null),Ko(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Hr(e,t){try{var i="",l=t;do i+=ge(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
39
|
Error generating stack: `+p.message+`
|
|
40
|
-
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function yc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function xc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Fv=typeof WeakMap=="function"?WeakMap:Map;function Hf(e,t,i){i=Ss(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){al||(al=!0,Mc=l),xc(e,t)},i}function Vf(e,t,i){i=Ss(-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(){xc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){xc(e,t),typeof l!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Gf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Fv;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=ey.bind(null,e,t,i),t.then(e,e))}function qf(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 Kf(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=Ss(-1,1),t.tag=2,Us(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Uv=M.ReactCurrentOwner,kn=!1;function pn(e,t,i,l){t.child=e===null?hf(t,null,i,l):Fr(t,e.child,i,l)}function Xf(e,t,i,l,d){i=i.render;var p=t.ref;return Br(t,d),l=uc(e,t,i,l,p,d),i=dc(),e!==null&&!kn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ts(e,t,d)):(ht&&i&&qa(t),t.flags|=1,pn(e,t,l,d),t.child)}function Yf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Uc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Qf(e,t,p,l,d)):(e=hl(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:bi,i(v,l)&&e.ref===t.ref)return Ts(e,t,d)}return t.flags|=1,e=qs(p,l),e.ref=t.ref,e.return=t,t.child=e}function Qf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(bi(p,l)&&e.ref===t.ref)if(kn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(kn=!0);else return t.lanes=e.lanes,Ts(e,t,d)}return wc(e,t,i,l,d)}function Zf(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},ut(Gr,Rn),Rn|=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,ut(Gr,Rn),Rn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ut(Gr,Rn),Rn|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ut(Gr,Rn),Rn|=l;return pn(e,t,d,i),t.child}function Jf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function wc(e,t,i,l,d){var p=wn(i)?or:rn.current;return p=Pr(t,p),Br(t,d),i=uc(e,t,i,l,p,d),l=dc(),e!==null&&!kn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ts(e,t,d)):(ht&&l&&qa(t),t.flags|=1,pn(e,t,i,d),t.child)}function ep(e,t,i,l,d){if(wn(i)){var p=!0;$o(t)}else p=!1;if(Br(t,d),t.stateNode===null)sl(e,t),Bf(t,i,l),vc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,N=t.memoizedProps;v.props=N;var j=v.context,U=i.contextType;typeof U=="object"&&U!==null?U=$n(U):(U=wn(i)?or:rn.current,U=Pr(t,U));var Z=i.getDerivedStateFromProps,ee=typeof Z=="function"||typeof v.getSnapshotBeforeUpdate=="function";ee||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==l||j!==U)&&Wf(t,v,l,U),Fs=!1;var Y=t.memoizedState;v.state=Y,Ko(t,l,v,d),j=t.memoizedState,N!==l||Y!==j||xn.current||Fs?(typeof Z=="function"&&(gc(t,i,Z,l),j=t.memoizedState),(N=Fs||Uf(t,i,N,l,Y,j,U))?(ee||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=j),v.props=l,v.state=j,v.context=U,l=N):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,gf(e,t),N=t.memoizedProps,U=t.type===t.elementType?N:Qn(t.type,N),v.props=U,ee=t.pendingProps,Y=v.context,j=i.contextType,typeof j=="object"&&j!==null?j=$n(j):(j=wn(i)?or:rn.current,j=Pr(t,j));var de=i.getDerivedStateFromProps;(Z=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==ee||Y!==j)&&Wf(t,v,l,j),Fs=!1,Y=t.memoizedState,v.state=Y,Ko(t,l,v,d);var pe=t.memoizedState;N!==ee||Y!==pe||xn.current||Fs?(typeof de=="function"&&(gc(t,i,de,l),pe=t.memoizedState),(U=Fs||Uf(t,i,U,l,Y,pe,j)||!1)?(Z||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,pe,j),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,pe,j)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=pe),v.props=l,v.state=pe,v.context=j,l=U):(typeof v.componentDidUpdate!="function"||N===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),l=!1)}return kc(e,t,i,l,p,d)}function kc(e,t,i,l,d,p){Jf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&rf(t,i,!1),Ts(e,t,p);l=t.stateNode,Uv.current=t;var N=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Fr(t,e.child,null,p),t.child=Fr(t,null,N,p)):pn(e,t,N,p),t.memoizedState=l.state,d&&rf(t,i,!0),t.child}function tp(e){var t=e.stateNode;t.pendingContext?nf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nf(e,t.context,!1),rc(e,t.containerInfo)}function np(e,t,i,l,d){return $r(),Qa(d),t.flags|=256,pn(e,t,i,l),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0};function Tc(e){return{baseLanes:e,cachePool:null,transitions:null}}function sp(e,t,i){var l=t.pendingProps,d=Nt.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),ut(Nt,d&1),e===null)return Ya(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=ml(v,l,0,null),e=gr(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Tc(i),t.memoizedState=Sc,e):bc(t,v));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return Bv(e,t,v,l,N,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,N=d.sibling;var j={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=j,t.deletions=null):(l=qs(d,j),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=qs(N,p):(p=gr(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?Tc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=Sc,l}return p=e.child,e=p.sibling,l=qs(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 bc(e,t){return t=ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nl(e,t,i,l){return l!==null&&Qa(l),Fr(t,e.child,null,i),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=yc(Error(r(422))),nl(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=ml({mode:"visible",children:l.children},d,0,null),p=gr(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Fr(t,e.child,null,v),t.child.memoizedState=Tc(v),t.memoizedState=Sc,p);if((t.mode&1)===0)return nl(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(r(419)),l=yc(p,l,void 0),nl(e,t,v,l)}if(N=(v&e.childLanes)!==0,kn||N){if(l=Vt,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,ks(e,d),es(l,e,d,-1))}return Fc(),l=yc(Error(r(421))),nl(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=ty.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,jn=Ps(d.nextSibling),_n=t,ht=!0,Yn=null,e!==null&&(On[zn++]=xs,On[zn++]=ws,On[zn++]=lr,xs=e.id,ws=e.overflow,lr=t),t=bc(t,l.children),t.flags|=4096,t)}function rp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),tc(e.return,t,i)}function Nc(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 ip(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(pn(e,t,l.children,i),l=Nt.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&&rp(e,i,t);else if(e.tag===19)rp(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(ut(Nt,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&&Xo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Nc(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&&Xo(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Nc(t,!0,i,null,p);break;case"together":Nc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ts(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,i=qs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=qs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Wv(e,t,i){switch(t.tag){case 3:tp(t),$r();break;case 5:xf(t);break;case 1:wn(t.type)&&$o(t);break;case 4:rc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ut(Vo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ut(Nt,Nt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?sp(e,t,i):(ut(Nt,Nt.current&1),e=Ts(e,t,i),e!==null?e.sibling:null);ut(Nt,Nt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return ip(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ut(Nt,Nt.current),l)break;return null;case 22:case 23:return t.lanes=0,Zf(e,t,i)}return Ts(e,t,i)}var op,Cc,lp,ap;op=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}},Cc=function(){},lp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ur(as.current);var p=null;switch(i){case"input":d=ze(e,d),l=ze(e,l),p=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),p=[];break;case"textarea":d=V(e,d),l=V(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Po)}Ln(i,l);var v;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var N=d[U];for(v in N)N.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var j=l[U];if(N=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&j!==N&&(j!=null||N!=null))if(U==="style")if(N){for(v in N)!N.hasOwnProperty(v)||j&&j.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in j)j.hasOwnProperty(v)&&N[v]!==j[v]&&(i||(i={}),i[v]=j[v])}else i||(p||(p=[]),p.push(U,i)),i=j;else U==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,N=N?N.__html:void 0,j!=null&&N!==j&&(p=p||[]).push(U,j)):U==="children"?typeof j!="string"&&typeof j!="number"||(p=p||[]).push(U,""+j):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(j!=null&&U==="onScroll"&&ft("scroll",e),p||N===j||(p=[])):(p=p||[]).push(U,j))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},ap=function(e,t,i,l){i!==l&&(t.flags|=4)};function $i(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ln(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Hv(e,t,i){var l=t.pendingProps;switch(Ka(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return wn(t.type)&&zo(),ln(t),null;case 3:return l=t.stateNode,Wr(),pt(xn),pt(rn),lc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yn!==null&&(Oc(Yn),Yn=null))),Cc(e,t),ln(t),null;case 5:ic(t);var d=ur(Mi.current);if(i=t.type,e!==null&&t.stateNode!=null)lp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ln(t),null}if(e=ur(as.current),Wo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[ls]=t,l[ji]=p,e=(t.mode&1)!==0,i){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(d=0;d<Ci.length;d++)ft(Ci[d],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":zt(l,p),ft("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},ft("invalid",l);break;case"textarea":he(l,p),ft("invalid",l)}Ln(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&&Lo(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(v)&&N!=null&&v==="onScroll"&&ft("scroll",l)}switch(i){case"input":mt(l),Rt(l,p,!0);break;case"textarea":mt(l),Ze(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Po)}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=vt(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[ls]=t,e[ji]=l,op(e,t,!1,!1),t.stateNode=e;e:{switch(v=Pn(i,l),i){case"dialog":ft("cancel",e),ft("close",e),d=l;break;case"iframe":case"object":case"embed":ft("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ci.length;d++)ft(Ci[d],e);d=l;break;case"source":ft("error",e),d=l;break;case"img":case"image":case"link":ft("error",e),ft("load",e),d=l;break;case"details":ft("toggle",e),d=l;break;case"input":zt(e,l),d=ze(e,l),ft("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),ft("invalid",e);break;case"textarea":he(e,l),d=V(e,l),ft("invalid",e);break;default:d=l}Ln(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var j=N[p];p==="style"?Gn(e,j):p==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,j!=null&&Yt(e,j)):p==="children"?typeof j=="string"?(i!=="textarea"||j!=="")&&sn(e,j):typeof j=="number"&&sn(e,""+j):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?j!=null&&p==="onScroll"&&ft("scroll",e):j!=null&&B(e,p,j,v))}switch(i){case"input":mt(e),Rt(e,l,!1);break;case"textarea":mt(e),Ze(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Re(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?$t(e,!!l.multiple,p,!1):l.defaultValue!=null&&$t(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Po)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ln(t),null;case 6:if(e&&t.stateNode!=null)ap(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(i=ur(Mi.current),ur(as.current),Wo(t)){if(l=t.stateNode,i=t.memoizedProps,l[ls]=t,(p=l.nodeValue!==i)&&(e=_n,e!==null))switch(e.tag){case 3:Lo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Lo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[ls]=t,t.stateNode=l}return ln(t),null;case 13:if(pt(Nt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&jn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)df(),$r(),t.flags|=98560,p=!1;else if(p=Wo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(r(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[ls]=t}else $r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else Yn!==null&&(Oc(Yn),Yn=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||(Nt.current&1)!==0?Ut===0&&(Ut=3):Fc())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return Wr(),Cc(e,t),e===null&&Ei(t.stateNode.containerInfo),ln(t),null;case 10:return ec(t.type._context),ln(t),null;case 17:return wn(t.type)&&zo(),ln(t),null;case 19:if(pt(Nt),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)$i(p,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Xo(e),v!==null){for(t.flags|=128,$i(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 ut(Nt,Nt.current&1|2),t.child}e=e.sibling}p.tail!==null&&St()>qr&&(t.flags|=128,l=!0,$i(p,!1),t.lanes=4194304)}else{if(!l)if(e=Xo(v),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),$i(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ht)return ln(t),null}else 2*St()-p.renderingStartTime>qr&&i!==1073741824&&(t.flags|=128,l=!0,$i(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=St(),t.sibling=null,i=Nt.current,ut(Nt,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return $c(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Rn&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function Vv(e,t){switch(Ka(t),t.tag){case 1:return wn(t.type)&&zo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wr(),pt(xn),pt(rn),lc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ic(t),null;case 13:if(pt(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));$r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(Nt),null;case 4:return Wr(),null;case 10:return ec(t.type._context),null;case 22:case 23:return $c(),null;case 24:return null;default:return null}}var rl=!1,an=!1,Gv=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Vr(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Et(e,t,l)}else i.current=null}function Ec(e,t,i){try{i()}catch(l){Et(e,t,l)}}var cp=!1;function qv(e,t){if($a=bo,e=Fd(),Aa(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,j=-1,U=0,Z=0,ee=e,Y=null;t:for(;;){for(var de;ee!==i||d!==0&&ee.nodeType!==3||(N=v+d),ee!==p||l!==0&&ee.nodeType!==3||(j=v+l),ee.nodeType===3&&(v+=ee.nodeValue.length),(de=ee.firstChild)!==null;)Y=ee,ee=de;for(;;){if(ee===e)break t;if(Y===i&&++U===d&&(N=v),Y===p&&++Z===l&&(j=v),(de=ee.nextSibling)!==null)break;ee=Y,Y=ee.parentNode}ee=de}i=N===-1||j===-1?null:{start:N,end:j}}else i=null}i=i||{start:0,end:0}}else i=null;for(Fa={focusedElem:e,selectionRange:i},bo=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,Mt=pe.memoizedState,$=t.stateNode,I=$.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Qn(t.type,ve),Mt);$.__reactInternalSnapshotBeforeUpdate=I}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(r(163))}}catch(re){Et(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return pe=cp,cp=!1,pe}function Fi(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&&Ec(t,i,p)}d=d.next}while(d!==l)}}function il(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 _c(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 up(e){var t=e.alternate;t!==null&&(e.alternate=null,up(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ls],delete t[ji],delete t[Ha],delete t[jv],delete t[Rv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dp(e){return e.tag===5||e.tag===3||e.tag===4}function fp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dp(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 jc(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=Po));else if(l!==4&&(e=e.child,e!==null))for(jc(e,t,i),e=e.sibling;e!==null;)jc(e,t,i),e=e.sibling}function Rc(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(Rc(e,t,i),e=e.sibling;e!==null;)Rc(e,t,i),e=e.sibling}var Zt=null,Zn=!1;function Bs(e,t,i){for(i=i.child;i!==null;)pp(e,t,i),i=i.sibling}function pp(e,t,i){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(er,i)}catch{}switch(i.tag){case 5:an||Vr(i,t);case 6:var l=Zt,d=Zn;Zt=null,Bs(e,t,i),Zt=l,Zn=d,Zt!==null&&(Zn?(e=Zt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Zt.removeChild(i.stateNode));break;case 18:Zt!==null&&(Zn?(e=Zt,i=i.stateNode,e.nodeType===8?Wa(e.parentNode,i):e.nodeType===1&&Wa(e,i),yi(e)):Wa(Zt,i.stateNode));break;case 4:l=Zt,d=Zn,Zt=i.stateNode.containerInfo,Zn=!0,Bs(e,t,i),Zt=l,Zn=d;break;case 0:case 11:case 14:case 15:if(!an&&(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)&&Ec(i,t,v),d=d.next}while(d!==l)}Bs(e,t,i);break;case 1:if(!an&&(Vr(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){Et(i,t,N)}Bs(e,t,i);break;case 21:Bs(e,t,i);break;case 22:i.mode&1?(an=(l=an)||i.memoizedState!==null,Bs(e,t,i),an=l):Bs(e,t,i);break;default:Bs(e,t,i)}}function hp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Gv),t.forEach(function(l){var d=ny.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:Zt=N.stateNode,Zn=!1;break e;case 3:Zt=N.stateNode.containerInfo,Zn=!0;break e;case 4:Zt=N.stateNode.containerInfo,Zn=!0;break e}N=N.return}if(Zt===null)throw Error(r(160));pp(p,v,d),Zt=null,Zn=!1;var j=d.alternate;j!==null&&(j.return=null),d.return=null}catch(U){Et(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mp(t,e),t=t.sibling}function mp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jn(t,e),us(e),l&4){try{Fi(3,e,e.return),il(3,e)}catch(ve){Et(e,e.return,ve)}try{Fi(5,e,e.return)}catch(ve){Et(e,e.return,ve)}}break;case 1:Jn(t,e),us(e),l&512&&i!==null&&Vr(i,i.return);break;case 5:if(Jn(t,e),us(e),l&512&&i!==null&&Vr(i,i.return),e.flags&32){var d=e.stateNode;try{sn(d,"")}catch(ve){Et(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,j=e.updateQueue;if(e.updateQueue=null,j!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&We(d,p),Pn(N,v);var U=Pn(N,p);for(v=0;v<j.length;v+=2){var Z=j[v],ee=j[v+1];Z==="style"?Gn(d,ee):Z==="dangerouslySetInnerHTML"?Yt(d,ee):Z==="children"?sn(d,ee):B(d,Z,ee,U)}switch(N){case"input":Wt(d,p);break;case"textarea":Ue(d,p);break;case"select":var Y=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?$t(d,!!p.multiple,de,!1):Y!==!!p.multiple&&(p.defaultValue!=null?$t(d,!!p.multiple,p.defaultValue,!0):$t(d,!!p.multiple,p.multiple?[]:"",!1))}d[ji]=p}catch(ve){Et(e,e.return,ve)}}break;case 6:if(Jn(t,e),us(e),l&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ve){Et(e,e.return,ve)}}break;case 3:if(Jn(t,e),us(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ve){Et(e,e.return,ve)}break;case 4:Jn(t,e),us(e);break;case 13:Jn(t,e),us(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Dc=St())),l&4&&hp(e);break;case 22:if(Z=i!==null&&i.memoizedState!==null,e.mode&1?(an=(U=an)||Z,Jn(t,e),an=U):Jn(t,e),us(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!Z&&(e.mode&1)!==0)for(fe=e,Z=e.child;Z!==null;){for(ee=fe=Z;fe!==null;){switch(Y=fe,de=Y.child,Y.tag){case 0:case 11:case 14:case 15:Fi(4,Y,Y.return);break;case 1:Vr(Y,Y.return);var pe=Y.stateNode;if(typeof pe.componentWillUnmount=="function"){l=Y,i=Y.return;try{t=l,pe.props=t.memoizedProps,pe.state=t.memoizedState,pe.componentWillUnmount()}catch(ve){Et(l,i,ve)}}break;case 5:Vr(Y,Y.return);break;case 22:if(Y.memoizedState!==null){yp(ee);continue}}de!==null?(de.return=Y,fe=de):yp(ee)}Z=Z.sibling}e:for(Z=null,ee=e;;){if(ee.tag===5){if(Z===null){Z=ee;try{d=ee.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=ee.stateNode,j=ee.memoizedProps.style,v=j!=null&&j.hasOwnProperty("display")?j.display:null,N.style.display=yn("display",v))}catch(ve){Et(e,e.return,ve)}}}else if(ee.tag===6){if(Z===null)try{ee.stateNode.nodeValue=U?"":ee.memoizedProps}catch(ve){Et(e,e.return,ve)}}else if((ee.tag!==22&&ee.tag!==23||ee.memoizedState===null||ee===e)&&ee.child!==null){ee.child.return=ee,ee=ee.child;continue}if(ee===e)break e;for(;ee.sibling===null;){if(ee.return===null||ee.return===e)break e;Z===ee&&(Z=null),ee=ee.return}Z===ee&&(Z=null),ee.sibling.return=ee.return,ee=ee.sibling}}break;case 19:Jn(t,e),us(e),l&4&&hp(e);break;case 21:break;default:Jn(t,e),us(e)}}function us(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(dp(i)){var l=i;break e}i=i.return}throw Error(r(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(sn(d,""),l.flags&=-33);var p=fp(e);Rc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,N=fp(e);jc(e,N,v);break;default:throw Error(r(161))}}catch(j){Et(e,e.return,j)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kv(e,t,i){fe=e,gp(e)}function gp(e,t,i){for(var l=(e.mode&1)!==0;fe!==null;){var d=fe,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||rl;if(!v){var N=d.alternate,j=N!==null&&N.memoizedState!==null||an;N=rl;var U=an;if(rl=v,(an=j)&&!U)for(fe=d;fe!==null;)v=fe,j=v.child,v.tag===22&&v.memoizedState!==null?xp(d):j!==null?(j.return=v,fe=j):xp(d);for(;p!==null;)fe=p,gp(p),p=p.sibling;fe=d,rl=N,an=U}vp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,fe=p):vp(e)}}function vp(e){for(;fe!==null;){var t=fe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:an||il(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!an)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&&yf(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}yf(t,v,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var j=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":j.autoFocus&&i.focus();break;case"img":j.src&&(i.src=j.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var Z=U.memoizedState;if(Z!==null){var ee=Z.dehydrated;ee!==null&&yi(ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}an||t.flags&512&&_c(t)}catch(Y){Et(t,t.return,Y)}}if(t===e){fe=null;break}if(i=t.sibling,i!==null){i.return=t.return,fe=i;break}fe=t.return}}function yp(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,fe=i;break}fe=t.return}}function xp(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{il(4,t)}catch(j){Et(t,i,j)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(j){Et(t,d,j)}}var p=t.return;try{_c(t)}catch(j){Et(t,p,j)}break;case 5:var v=t.return;try{_c(t)}catch(j){Et(t,v,j)}}}catch(j){Et(t,t.return,j)}if(t===e){fe=null;break}var N=t.sibling;if(N!==null){N.return=t.return,fe=N;break}fe=t.return}}var Xv=Math.ceil,ol=M.ReactCurrentDispatcher,Ac=M.ReactCurrentOwner,Un=M.ReactCurrentBatchConfig,Qe=0,Vt=null,Pt=null,Jt=0,Rn=0,Gr=Os(0),Ut=0,Ui=null,fr=0,ll=0,Ic=0,Bi=null,Sn=null,Dc=0,qr=1/0,bs=null,al=!1,Mc=null,Ws=null,cl=!1,Hs=null,ul=0,Wi=0,Lc=null,dl=-1,fl=0;function hn(){return(Qe&6)!==0?St():dl!==-1?dl:dl=St()}function Vs(e){return(e.mode&1)===0?1:(Qe&2)!==0&&Jt!==0?Jt&-Jt:Iv.transition!==null?(fl===0&&(fl=hi()),fl):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:wd(e.type)),e)}function es(e,t,i,l){if(50<Wi)throw Wi=0,Lc=null,Error(r(185));rr(e,i,l),((Qe&2)===0||e!==Vt)&&(e===Vt&&((Qe&2)===0&&(ll|=i),Ut===4&&Gs(e,Jt)),Tn(e,l),i===1&&Qe===0&&(t.mode&1)===0&&(qr=St()+500,Fo&&$s()))}function Tn(e,t){var i=e.callbackNode;ko(e,t);var l=sr(e,e===Vt?Jt:0);if(l===0)i!==null&&yo(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&yo(i),t===1)e.tag===0?Av(kp.bind(null,e)):of(kp.bind(null,e)),Ev(function(){(Qe&6)===0&&$s()}),i=null;else{switch(se(l)){case 1:i=Rs;break;case 4:i=os;break;case 16:i=Tr;break;case 536870912:i=xo;break;default:i=Tr}i=jp(i,wp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function wp(e,t){if(dl=-1,fl=0,(Qe&6)!==0)throw Error(r(327));var i=e.callbackNode;if(Kr()&&e.callbackNode!==i)return null;var l=sr(e,e===Vt?Jt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=pl(e,l);else{t=l;var d=Qe;Qe|=2;var p=Tp();(Vt!==e||Jt!==t)&&(bs=null,qr=St()+500,hr(e,t));do try{Zv();break}catch(N){Sp(e,N)}while(!0);Ja(),ol.current=p,Qe=d,Pt!==null?t=0:(Vt=null,Jt=0,t=Ut)}if(t!==0){if(t===2&&(d=pi(e),d!==0&&(l=d,t=Pc(e,d))),t===1)throw i=Ui,hr(e,0),Gs(e,l),Tn(e,St()),i;if(t===6)Gs(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Yv(d)&&(t=pl(e,l),t===2&&(p=pi(e),p!==0&&(l=p,t=Pc(e,p))),t===1))throw i=Ui,hr(e,0),Gs(e,l),Tn(e,St()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(r(345));case 2:mr(e,Sn,bs);break;case 3:if(Gs(e,l),(l&130023424)===l&&(t=Dc+500-St(),10<t)){if(sr(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){hn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ba(mr.bind(null,e,Sn,bs),t);break}mr(e,Sn,bs);break;case 4:if(Gs(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-dn(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=St()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Xv(l/1960))-l,10<l){e.timeoutHandle=Ba(mr.bind(null,e,Sn,bs),l);break}mr(e,Sn,bs);break;case 5:mr(e,Sn,bs);break;default:throw Error(r(329))}}}return Tn(e,St()),e.callbackNode===i?wp.bind(null,e):null}function Pc(e,t){var i=Bi;return e.current.memoizedState.isDehydrated&&(hr(e,t).flags|=256),e=pl(e,t),e!==2&&(t=Sn,Sn=i,t!==null&&Oc(t)),e}function Oc(e){Sn===null?Sn=e:Sn.push.apply(Sn,e)}function Yv(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(!Xn(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 Gs(e,t){for(t&=~Ic,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-dn(t),l=1<<i;e[i]=-1,t&=~l}}function kp(e){if((Qe&6)!==0)throw Error(r(327));Kr();var t=sr(e,0);if((t&1)===0)return Tn(e,St()),null;var i=pl(e,t);if(e.tag!==0&&i===2){var l=pi(e);l!==0&&(t=l,i=Pc(e,l))}if(i===1)throw i=Ui,hr(e,0),Gs(e,t),Tn(e,St()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mr(e,Sn,bs),Tn(e,St()),null}function zc(e,t){var i=Qe;Qe|=1;try{return e(t)}finally{Qe=i,Qe===0&&(qr=St()+500,Fo&&$s())}}function pr(e){Hs!==null&&Hs.tag===0&&(Qe&6)===0&&Kr();var t=Qe;Qe|=1;var i=Un.transition,l=Xe;try{if(Un.transition=null,Xe=1,e)return e()}finally{Xe=l,Un.transition=i,Qe=t,(Qe&6)===0&&$s()}}function $c(){Rn=Gr.current,pt(Gr)}function hr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Cv(i)),Pt!==null)for(i=Pt.return;i!==null;){var l=i;switch(Ka(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&zo();break;case 3:Wr(),pt(xn),pt(rn),lc();break;case 5:ic(l);break;case 4:Wr();break;case 13:pt(Nt);break;case 19:pt(Nt);break;case 10:ec(l.type._context);break;case 22:case 23:$c()}i=i.return}if(Vt=e,Pt=e=qs(e.current,null),Jt=Rn=t,Ut=0,Ui=null,Ic=ll=fr=0,Sn=Bi=null,cr!==null){for(t=0;t<cr.length;t++)if(i=cr[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}cr=null}return e}function Sp(e,t){do{var i=Pt;try{if(Ja(),Yo.current=el,Qo){for(var l=Ct.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Qo=!1}if(dr=0,Ht=Ft=Ct=null,Li=!1,Pi=0,Ac.current=null,i===null||i.return===null){Ut=1,Ui=t,Pt=null;break}e:{var p=e,v=i.return,N=i,j=t;if(t=Jt,N.flags|=32768,j!==null&&typeof j=="object"&&typeof j.then=="function"){var U=j,Z=N,ee=Z.tag;if((Z.mode&1)===0&&(ee===0||ee===11||ee===15)){var Y=Z.alternate;Y?(Z.updateQueue=Y.updateQueue,Z.memoizedState=Y.memoizedState,Z.lanes=Y.lanes):(Z.updateQueue=null,Z.memoizedState=null)}var de=qf(v);if(de!==null){de.flags&=-257,Kf(de,v,N,p,t),de.mode&1&&Gf(p,U,t),t=de,j=U;var pe=t.updateQueue;if(pe===null){var ve=new Set;ve.add(j),t.updateQueue=ve}else pe.add(j);break e}else{if((t&1)===0){Gf(p,U,t),Fc();break e}j=Error(r(426))}}else if(ht&&N.mode&1){var Mt=qf(v);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),Kf(Mt,v,N,p,t),Qa(Hr(j,N));break e}}p=j=Hr(j,N),Ut!==4&&(Ut=2),Bi===null?Bi=[p]:Bi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var $=Hf(p,j,t);vf(p,$);break e;case 1:N=j;var I=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof I.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Ws===null||!Ws.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var re=Vf(p,N,t);vf(p,re);break e}}p=p.return}while(p!==null)}Np(i)}catch(Te){t=Te,Pt===i&&i!==null&&(Pt=i=i.return);continue}break}while(!0)}function Tp(){var e=ol.current;return ol.current=el,e===null?el:e}function Fc(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Vt===null||(fr&268435455)===0&&(ll&268435455)===0||Gs(Vt,Jt)}function pl(e,t){var i=Qe;Qe|=2;var l=Tp();(Vt!==e||Jt!==t)&&(bs=null,hr(e,t));do try{Qv();break}catch(d){Sp(e,d)}while(!0);if(Ja(),Qe=i,ol.current=l,Pt!==null)throw Error(r(261));return Vt=null,Jt=0,Ut}function Qv(){for(;Pt!==null;)bp(Pt)}function Zv(){for(;Pt!==null&&!ya();)bp(Pt)}function bp(e){var t=_p(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?Np(e):Pt=t,Ac.current=null}function Np(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Hv(i,t,Rn),i!==null){Pt=i;return}}else{if(i=Vv(i,t),i!==null){i.flags&=32767,Pt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ut=6,Pt=null;return}}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Ut===0&&(Ut=5)}function mr(e,t,i){var l=Xe,d=Un.transition;try{Un.transition=null,Xe=1,Jv(e,t,i,l)}finally{Un.transition=d,Xe=l}return null}function Jv(e,t,i,l){do Kr();while(Hs!==null);if((Qe&6)!==0)throw Error(r(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(So(e,p),e===Vt&&(Pt=Vt=null,Jt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||cl||(cl=!0,jp(Tr,function(){return Kr(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Un.transition,Un.transition=null;var v=Xe;Xe=1;var N=Qe;Qe|=4,Ac.current=null,qv(e,i),mp(i,e),xv(Fa),bo=!!$a,Fa=$a=null,e.current=i,Kv(i),xa(),Qe=N,Xe=v,Un.transition=p}else e.current=i;if(cl&&(cl=!1,Hs=e,ul=d),p=e.pendingLanes,p===0&&(Ws=null),br(i.stateNode),Tn(e,St()),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(al)throw al=!1,e=Mc,Mc=null,e;return(ul&1)!==0&&e.tag!==0&&Kr(),p=e.pendingLanes,(p&1)!==0?e===Lc?Wi++:(Wi=0,Lc=e):Wi=0,$s(),null}function Kr(){if(Hs!==null){var e=se(ul),t=Un.transition,i=Xe;try{if(Un.transition=null,Xe=16>e?16:e,Hs===null)var l=!1;else{if(e=Hs,Hs=null,ul=0,(Qe&6)!==0)throw Error(r(331));var d=Qe;for(Qe|=4,fe=e.current;fe!==null;){var p=fe,v=p.child;if((fe.flags&16)!==0){var N=p.deletions;if(N!==null){for(var j=0;j<N.length;j++){var U=N[j];for(fe=U;fe!==null;){var Z=fe;switch(Z.tag){case 0:case 11:case 15:Fi(8,Z,p)}var ee=Z.child;if(ee!==null)ee.return=Z,fe=ee;else for(;fe!==null;){Z=fe;var Y=Z.sibling,de=Z.return;if(up(Z),Z===U){fe=null;break}if(Y!==null){Y.return=de,fe=Y;break}fe=de}}}var pe=p.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var Mt=ve.sibling;ve.sibling=null,ve=Mt}while(ve!==null)}}fe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,fe=v;else e:for(;fe!==null;){if(p=fe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Fi(9,p,p.return)}var $=p.sibling;if($!==null){$.return=p.return,fe=$;break e}fe=p.return}}var I=e.current;for(fe=I;fe!==null;){v=fe;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,fe=F;else e:for(v=I;fe!==null;){if(N=fe,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:il(9,N)}}catch(Te){Et(N,N.return,Te)}if(N===v){fe=null;break e}var re=N.sibling;if(re!==null){re.return=N.return,fe=re;break e}fe=N.return}}if(Qe=d,$s(),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(er,e)}catch{}l=!0}return l}finally{Xe=i,Un.transition=t}}return!1}function Cp(e,t,i){t=Hr(i,t),t=Hf(e,t,1),e=Us(e,t,1),t=hn(),e!==null&&(rr(e,1,t),Tn(e,t))}function Et(e,t,i){if(e.tag===3)Cp(e,e,i);else for(;t!==null;){if(t.tag===3){Cp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ws===null||!Ws.has(l))){e=Hr(i,e),e=Vf(t,e,1),t=Us(t,e,1),e=hn(),t!==null&&(rr(t,1,e),Tn(t,e));break}}t=t.return}}function ey(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=hn(),e.pingedLanes|=e.suspendedLanes&i,Vt===e&&(Jt&i)===i&&(Ut===4||Ut===3&&(Jt&130023424)===Jt&&500>St()-Dc?hr(e,0):Ic|=i),Tn(e,t)}function Ep(e,t){t===0&&((e.mode&1)===0?t=1:(t=Cr,Cr<<=1,(Cr&130023424)===0&&(Cr=4194304)));var i=hn();e=ks(e,t),e!==null&&(rr(e,t,i),Tn(e,i))}function ty(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Ep(e,i)}function ny(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(r(314))}l!==null&&l.delete(t),Ep(e,i)}var _p;_p=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||xn.current)kn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return kn=!1,Wv(e,t,i);kn=(e.flags&131072)!==0}else kn=!1,ht&&(t.flags&1048576)!==0&&lf(t,Bo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;sl(e,t),e=t.pendingProps;var d=Pr(t,rn.current);Br(t,i),d=uc(null,t,l,e,d,i);var p=dc();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,wn(l)?(p=!0,$o(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,sc(t),d.updater=tl,t.stateNode=d,d._reactInternals=t,vc(t,l,e,i),t=kc(null,t,l,!0,p,i)):(t.tag=0,ht&&p&&qa(t),pn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=ry(l),e=Qn(l,e),d){case 0:t=wc(null,t,l,e,i);break e;case 1:t=ep(null,t,l,e,i);break e;case 11:t=Xf(null,t,l,e,i);break e;case 14:t=Yf(null,t,l,Qn(l.type,e),i);break e}throw Error(r(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),wc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),ep(e,t,l,d,i);case 3:e:{if(tp(t),e===null)throw Error(r(387));l=t.pendingProps,p=t.memoizedState,d=p.element,gf(e,t),Ko(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=Hr(Error(r(423)),t),t=np(e,t,l,i,d);break e}else if(l!==d){d=Hr(Error(r(424)),t),t=np(e,t,l,i,d);break e}else for(jn=Ps(t.stateNode.containerInfo.firstChild),_n=t,ht=!0,Yn=null,i=hf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if($r(),l===d){t=Ts(e,t,i);break e}pn(e,t,l,i)}t=t.child}return t;case 5:return xf(t),e===null&&Ya(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,Ua(l,d)?v=null:p!==null&&Ua(l,p)&&(t.flags|=32),Jf(e,t),pn(e,t,v,i),t.child;case 6:return e===null&&Ya(t),null;case 13:return sp(e,t,i);case 4:return rc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fr(t,null,l,i):pn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Xf(e,t,l,d,i);case 7:return pn(e,t,t.pendingProps,i),t.child;case 8:return pn(e,t,t.pendingProps.children,i),t.child;case 12:return pn(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,ut(Vo,l._currentValue),l._currentValue=v,p!==null)if(Xn(p.value,v)){if(p.children===d.children&&!xn.current){t=Ts(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 j=N.firstContext;j!==null;){if(j.context===l){if(p.tag===1){j=Ss(-1,i&-i),j.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var Z=U.pending;Z===null?j.next=j:(j.next=Z.next,Z.next=j),U.pending=j}}p.lanes|=i,j=p.alternate,j!==null&&(j.lanes|=i),tc(p.return,i,t),N.lanes|=i;break}j=j.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(r(341));v.lanes|=i,N=v.alternate,N!==null&&(N.lanes|=i),tc(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}pn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Br(t,i),d=$n(d),l=l(d),t.flags|=1,pn(e,t,l,i),t.child;case 14:return l=t.type,d=Qn(l,t.pendingProps),d=Qn(l.type,d),Yf(e,t,l,d,i);case 15:return Qf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),sl(e,t),t.tag=1,wn(l)?(e=!0,$o(t)):e=!1,Br(t,i),Bf(t,l,d),vc(t,l,d,i),kc(null,t,l,!0,e,i);case 19:return ip(e,t,i);case 22:return Zf(e,t,i)}throw Error(r(156,t.tag))};function jp(e,t){return fi(e,t)}function sy(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 Bn(e,t,i,l){return new sy(e,t,i,l)}function Uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ry(e){if(typeof e=="function")return Uc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===we)return 11;if(e===Q)return 14}return 2}function qs(e,t){var i=e.alternate;return i===null?(i=Bn(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 hl(e,t,i,l,d,p){var v=2;if(l=e,typeof e=="function")Uc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case K:return gr(i.children,d,p,t);case G:v=8,d|=8;break;case oe:return e=Bn(12,i,t,d|2),e.elementType=oe,e.lanes=p,e;case Ce:return e=Bn(13,i,t,d),e.elementType=Ce,e.lanes=p,e;case Fe:return e=Bn(19,i,t,d),e.elementType=Fe,e.lanes=p,e;case ae:return ml(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:v=10;break e;case ie:v=9;break e;case we:v=11;break e;case Q:v=14;break e;case ne:v=16,l=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return t=Bn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function gr(e,t,i,l){return e=Bn(7,e,l,t),e.lanes=i,e}function ml(e,t,i,l){return e=Bn(22,e,l,t),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function Bc(e,t,i){return e=Bn(6,e,null,t),e.lanes=i,e}function Wc(e,t,i){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iy(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=mi(0),this.expirationTimes=mi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Hc(e,t,i,l,d,p,v,N,j){return e=new iy(e,t,i,N,j),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Bn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},sc(p),e}function oy(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function Rp(e){if(!e)return zs;e=e._reactInternals;e:{if(rt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(wn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(wn(i))return sf(e,i,t)}return t}function Ap(e,t,i,l,d,p,v,N,j){return e=Hc(i,l,!0,e,d,p,v,N,j),e.context=Rp(null),i=e.current,l=hn(),d=Vs(i),p=Ss(l,d),p.callback=t??null,Us(i,p,d),e.current.lanes=d,rr(e,d,l),Tn(e,l),e}function gl(e,t,i,l){var d=t.current,p=hn(),v=Vs(d);return i=Rp(i),t.context===null?t.context=i:t.pendingContext=i,t=Ss(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Us(d,t,v),e!==null&&(es(e,d,v,p),qo(e,d,v)),v}function vl(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 Ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Vc(e,t){Ip(e,t),(e=e.alternate)&&Ip(e,t)}function ly(){return null}var Dp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Gc(e){this._internalRoot=e}yl.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));gl(e,t,null,null)},yl.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){gl(null,e,null,null)}),t[vs]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=me();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ds.length&&t!==0&&t<Ds[i].priority;i++);Ds.splice(i,0,e),i===0&&yd(e)}};function qc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Mp(){}function ay(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=vl(v);p.call(U)}}var v=Ap(t,l,e,0,null,!1,!1,"",Mp);return e._reactRootContainer=v,e[vs]=v.current,Ei(e.nodeType===8?e.parentNode:e),pr(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var U=vl(j);N.call(U)}}var j=Hc(e,0,!1,null,null,!1,!1,"",Mp);return e._reactRootContainer=j,e[vs]=j.current,Ei(e.nodeType===8?e.parentNode:e),pr(function(){gl(t,j,i,l)}),j}function wl(e,t,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var N=d;d=function(){var j=vl(v);N.call(j)}}gl(t,v,e,d)}else v=ay(i,t,e,d,l);return vl(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=nr(t.pendingLanes);i!==0&&(Is(t,i|1),Tn(t,St()),(Qe&6)===0&&(qr=St()+500,$s()))}break;case 13:pr(function(){var l=ks(e,1);if(l!==null){var d=hn();es(l,e,1,d)}}),Vc(e,1)}},z=function(e){if(e.tag===13){var t=ks(e,134217728);if(t!==null){var i=hn();es(t,e,134217728,i)}Vc(e,134217728)}},X=function(e){if(e.tag===13){var t=Vs(e),i=ks(e,t);if(i!==null){var l=hn();es(i,e,t,l)}Vc(e,t)}},me=function(){return Xe},Ee=function(e,t){var i=Xe;try{return Xe=e,t()}finally{Xe=i}},le=function(e,t,i){switch(t){case"input":if(Wt(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=Oo(l);if(!d)throw Error(r(90));Me(l),Wt(l,d)}}}break;case"textarea":Ue(e,i);break;case"select":t=i.value,t!=null&&$t(e,!!i.multiple,t,!1)}},ot=zc,tt=pr;var cy={usingClientEntryPoint:!1,Events:[Ri,Mr,Oo,Se,Ve,zc]},Hi={findFiberByHostInstance:ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uy={bundleType:Hi.bundleType,version:Hi.version,rendererPackageName:Hi.rendererPackageName,rendererConfig:Hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Sr(e),e===null?null:e.stateNode},findFiberByHostInstance:Hi.findFiberByHostInstance||ly,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 kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{er=kl.inject(uy),Cn=kl}catch{}}return bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cy,bn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qc(t))throw Error(r(200));return oy(e,t,null,i)},bn.createRoot=function(e,t){if(!qc(e))throw Error(r(299));var i=!1,l="",d=Dp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Hc(e,1,!1,null,null,i,!1,l,d),e[vs]=t.current,Ei(e.nodeType===8?e.parentNode:e),new Gc(t)},bn.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(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=Sr(t),e=e===null?null:e.stateNode,e},bn.flushSync=function(e){return pr(e)},bn.hydrate=function(e,t,i){if(!xl(t))throw Error(r(200));return wl(null,e,t,!0,i)},bn.hydrateRoot=function(e,t,i){if(!qc(e))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Dp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=Ap(t,null,e,1,i??null,d,!1,p,v),e[vs]=t.current,Ei(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 yl(t)},bn.render=function(e,t,i){if(!xl(t))throw Error(r(200));return wl(null,e,t,!1,i)},bn.unmountComponentAtNode=function(e){if(!xl(e))throw Error(r(40));return e._reactRootContainer?(pr(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[vs]=null})}),!0):!1},bn.unstable_batchedUpdates=zc,bn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!xl(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return wl(e,t,i,!1,l)},bn.version="18.3.1-next-f1338f8080-20240426",bn}var Bp;function xm(){if(Bp)return Yc.exports;Bp=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(s){console.error(s)}}return n(),Yc.exports=xy(),Yc.exports}var Wp;function wy(){if(Wp)return Sl;Wp=1;var n=xm();return Sl.createRoot=n.createRoot,Sl.hydrateRoot=n.hydrateRoot,Sl}var ky=wy();const Sy=ym(ky),Hp=n=>{let s;const r=new Set,o=(g,x)=>{const k=typeof g=="function"?g(s):g;if(!Object.is(k,s)){const y=s;s=x??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(E=>E(s,y))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(r.add(g),()=>r.delete(g))},m=s=n(o,a,h);return h},Ty=(n=>n?Hp(n):Hp),by=n=>n;function Ny(n,s=by){const r=at.useSyncExternalStore(n.subscribe,at.useCallback(()=>s(n.getState()),[n,s]),at.useCallback(()=>s(n.getInitialState()),[n,s]));return at.useDebugValue(r),r}const Cy=n=>{const s=Ty(n),r=o=>Ny(s,o);return Object.assign(r,s),r},Ey=(n=>Cy),wm="agentpane:machines",km="agentpane:active-machine";function _y(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Sm(n){return`${n}.repoburg.com`}function Fu(n){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return s?s[1]:null}function Tm(n,s){try{const r=localStorage.getItem(n);return r==null?s:JSON.parse(r)}catch{return s}}function bm(n,s){try{localStorage.setItem(n,JSON.stringify(s))}catch{}}function Nm(){return Tm(wm,[]).filter(s=>_y(s.mahlas)&&s.hostname===Sm(s.mahlas))}function jy(n){const s={mahlas:n,hostname:Sm(n),lastConnectedAt:new Date().toISOString()},r=Nm(),o=[s,...r.filter(a=>a.mahlas!==n)];return bm(wm,o),s}function Ry(){const n=Tm(km,null);return n?Nm().find(s=>s.mahlas===n)??null:null}function Ay(n){bm(km,n)}function Iy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const s=Fu(n);s&&(jy(s),Ay(s))}const Vp="http://localhost:9998",Dy=["agent.repoburg.com"];function ps(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),s=n.get("bport");if(s)return`http://localhost:${s}`;const r=n.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(Dy.includes(o))return Vp;if(Fu(o))return"";const a=Ry();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Vp}const My="/api";async function co(n,s,r){const o=await fetch(`${ps()}${My}${s}`,{method:n,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):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} ${s} failed: ${a}`)}return o.json()}function gn(n){return co("GET",n)}function _t(n,s){return co("POST",n,s)}function sa(n){return co("DELETE",n)}function hs(n,s){return co("PATCH",n,s)}function Ly(n,s){return co("PUT",n,s)}function Py(){return gn("/sessions")}function Tl(n){return gn(`/sessions/${n}`)}function Uu(n){return _t("/sessions",n)}function Gp(n){return sa(`/sessions/${n}`)}function Cm(n,s,r){return _t(`/sessions/${n}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{}})}function Oy(n){return _t(`/sessions/${n}/cancel`)}function zy(n,s){return hs(`/sessions/${n}`,{title:s})}function qp(n){return hs(`/sessions/${n}`,{lifecycle:"finished"})}function Kp(n){return hs(`/sessions/${n}`,{lifecycle:"working"})}function $y(n,s){return hs(`/sessions/${n}`,{starred:s})}function Xp(n){return hs(`/sessions/${n}`,{has_unreviewed:0})}function Fy(n,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),hs(`/sessions/${n}`,a)}function Uy(n,s){return hs(`/sessions/${n}`,{runtime_config:s})}function By(n,s){return _t(`/sessions/${n}/rewind`,{turn_id:s})}function Wy(n){return _t(`/sessions/${n}/restore`,{})}function Hy(n,s,r){return _t(`/sessions/${n}/branch`,{turn_id:s,title:r})}function Em(){return gn("/workspaces")}function Vy(n,s){return _t("/workspaces",{path:n,label:s})}function Gy(n){return _t("/workspaces/hide",{path:n})}async function qy(){const n=await fetch(`${ps()}/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 _m(){return gn("/folders")}function Ky(n,s){return _t("/folders",{workspace_path:n,name:s})}function Yp(n,s){return hs(`/folders/${n}`,s)}function Xy(n){return sa(`/folders/${n}`)}function Yy(n){return _t("/sessions/reorder",{moves:n})}function oi(n){return n.status==="pending"||n.status==="running"}function jm(n){return!!(n!=null&&n.turns.some(oi))}function ra(n){return n?n.turns.some(oi)||(n.threads??[]).some(s=>(s.turns??[]).some(oi)):!1}async function Qy(n,s){const r=await Promise.allSettled(n.map(u=>s(u))),o=new Map;let a=null;return r.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function Qp(n,s){const r={...n.sessionDetails};s.forEach(f=>delete r[f]);const o=n.openTabs.filter(f=>!s.has(f));let a=n.activeSessionId,u=n.activeTurnIndex;if(a&&s.has(a)){a=o.length>0?o[o.length-1]:null;const f=a?r[a]:null;u=f&&f.turns.length>0?f.turns.length-1:0}return{sessions:n.sessions.filter(f=>!s.has(f.id)),sessionDetails:r,openTabs:o,activeSessionId:a,activeTurnIndex:u}}async function Zp(n,s,r,o,a){if(r.length===0)return;n({error:null});const{updated:u,firstError:f}=await Qy(r,o);u.size>0&&n(m=>({sessions:m.sessions.map(g=>u.get(g.id)??g)}));const h=r.length-u.size;if(h===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{n({error:f});const m=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${m} ${u.size} of ${r.length} — ${h} failed`)}}const Zy=(n,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{var r;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([Py(),Em(),_m()]);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:(r=o[0])==null?void 0:r.id;g&&!s().activeSessionId&&await s().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async r=>{if(s().sessionDetails[r]){const o=s().sessionDetails[r];n({activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,openTabs:s().openTabs.includes(r)?s().openTabs:[...s().openTabs,r]}),o.has_unreviewed===1&&(Xp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await Tl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,loading:!1})),o.has_unreviewed===1&&(Xp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},closeTab:r=>{n(o=>{const a=o.openTabs.filter(u=>u!==r);if(o.activeSessionId===r&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===r?null:o.activeSessionId}})},updateModelConfig:async(r,o,a)=>{const u=s().activeSessionId;if(u){n({error:null});try{const f=await Fy(u,r,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 s().refreshActiveSession()}catch(f){n({error:f.message}),s().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async r=>{n({error:null});try{const o=await Uu(r);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 s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{n(o=>({sessions:o.sessions.some(a=>a.id===r.id)?o.sessions:[r,...o.sessions]}))},deleteSession:async r=>{var a;n({error:null});const o=(a=s().sessions.find(u=>u.id===r))==null?void 0:a.title;try{await Gp(r),n(u=>Qp(u,new Set([r]))),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{n({error:null});try{const a=await zy(r,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{n({error:null});try{const o=await qp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Zp(n,s,r,qp,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){n({error:null});try{const a=await $y(r,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{n({error:null});try{const o=await Kp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){n({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Zp(n,s,r,Kp,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;n({error:null});const o=await Promise.allSettled(r.map(f=>Gp(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(r[h])}),a.size===0){n({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}n(f=>Qp(f,a)),s().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=r.length-a.size;u===0?s().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${a.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const a=s().activeSessionId;if(a){n({error:null,submittingPrompt:r}),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 Cm(a,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.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}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const m=ra(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 r=s().activeSessionId;if(r)try{await Oy(r)}catch(o){n({error:o.message})}},rewindToTurn:async(r,o)=>{n({error:null});try{const a=await By(r,o),u=await Tl(r);n(f=>({sessionDetails:{...f.sessionDetails,[r]:u},sessions:f.sessions.map(h=>h.id===r?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),s().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async r=>{n({error:null});try{const o=await Wy(r),a=await Tl(r);n(u=>({sessionDetails:{...u.sessionDetails,[r]:a},sessions:u.sessions.map(f=>f.id===r?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,a)=>{n({error:null});try{const u=await Hy(r,o,a);n(f=>({sessions:[u,...f.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){n({error:null});try{const a=await Uy(o,JSON.stringify(r));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}),s().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await Tl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),Jy=(n,s)=>({workspaces:[],addWorkspace:async r=>{n({error:null});try{const o=await Vy(r.trim());n(a=>({workspaces:[...a.workspaces,o]})),s().addToast("success",`Workspace added — ${o.path}`)}catch(o){s().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async r=>{n({error:null});try{await Gy(r);const o=await Em();n({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{n({error:null});try{const o=s().lastModelConfig,a=await Uu({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await s().selectSession(a.id),s().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const r=await qy();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),wr=new Map,Bu=new Map,Wu=new Map,Hu=new Map;function ex(n,s){wr.set(n,s)}function tx(n){wr.delete(n)}function Jc(n,s){Bu.set(n,s)}function Jp(n,s,r){const o=Bu.get(n);if(!o)return;const a=wr.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function nx(n,s,r,o){const a=wr.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function sx(n,s,r,o){const a=Bu.get(n);if(!a)return;const u=wr.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:s,itemId:r,delta:o}})}function rx(n,s){Wu.set(n,s)}function ix(n){Wu.delete(n)}function ox(n,s){Hu.set(n,s)}function lx(n){Hu.delete(n)}function ax(n){var r;const s=wr.get(n);s&&s({source:"agentpane-host",event:"state_changed",payload:{}}),(r=Hu.get(n))==null||r()}function cx(n){var r;const s=wr.get(n);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Wu.get(n))==null||r()}const ux=(n,s)=>({wsConnected:!1,setWsConnected:r=>n({wsConnected:r}),onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=bl(a.sessions,r,()=>({is_running:1,status:"running"})),f=a.sessionDetails[r];if(!f)return{sessions:u};const h=f.turns.findIndex(m=>m.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Ns(f,o,m=>({...m,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===r&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{s().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>tu(h,a))}}:{}})},onItemUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>tu(h,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(s().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?s().addToast("success",`${g} completed: ${h}`):s().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>{var g,x;let m=tu(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 k=m.thoughts?m.thoughts+`
|
|
41
|
-
`+a.data.text:a.data.text;m={...m,thoughts:k}}return m})}}:{}})},onItemDelta:(r,o,a,u)=>{sx(r,o,a,u),n(f=>{const h=f.sessionDetails[r];return h?{sessionDetails:{...f.sessionDetails,[r]:Ns(h,o,m=>dx(m,a,u))}}:{}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),
|
|
40
|
+
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function vc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function yc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Fv=typeof WeakMap=="function"?WeakMap:Map;function Wf(e,t,i){i=Ss(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){al||(al=!0,Dc=l),yc(e,t)},i}function Hf(e,t,i){i=Ss(-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(){yc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){yc(e,t),typeof l!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Vf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Fv;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=ey.bind(null,e,t,i),t.then(e,e))}function Gf(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 qf(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=Ss(-1,1),t.tag=2,Us(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Uv=M.ReactCurrentOwner,kn=!1;function pn(e,t,i,l){t.child=e===null?pf(t,null,i,l):Fr(t,e.child,i,l)}function Kf(e,t,i,l,d){i=i.render;var p=t.ref;return Br(t,d),l=cc(e,t,i,l,p,d),i=uc(),e!==null&&!kn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ts(e,t,d)):(ht&&i&&Ga(t),t.flags|=1,pn(e,t,l,d),t.child)}function Xf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Fc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Yf(e,t,p,l,d)):(e=hl(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:bi,i(v,l)&&e.ref===t.ref)return Ts(e,t,d)}return t.flags|=1,e=qs(p,l),e.ref=t.ref,e.return=t,t.child=e}function Yf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(bi(p,l)&&e.ref===t.ref)if(kn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(kn=!0);else return t.lanes=e.lanes,Ts(e,t,d)}return xc(e,t,i,l,d)}function Qf(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},ut(Gr,Rn),Rn|=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,ut(Gr,Rn),Rn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ut(Gr,Rn),Rn|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ut(Gr,Rn),Rn|=l;return pn(e,t,d,i),t.child}function Zf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function xc(e,t,i,l,d){var p=wn(i)?or:rn.current;return p=Pr(t,p),Br(t,d),i=cc(e,t,i,l,p,d),l=uc(),e!==null&&!kn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ts(e,t,d)):(ht&&l&&Ga(t),t.flags|=1,pn(e,t,i,d),t.child)}function Jf(e,t,i,l,d){if(wn(i)){var p=!0;$o(t)}else p=!1;if(Br(t,d),t.stateNode===null)sl(e,t),Uf(t,i,l),gc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,C=t.memoizedProps;v.props=C;var j=v.context,U=i.contextType;typeof U=="object"&&U!==null?U=$n(U):(U=wn(i)?or:rn.current,U=Pr(t,U));var Z=i.getDerivedStateFromProps,ee=typeof Z=="function"||typeof v.getSnapshotBeforeUpdate=="function";ee||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==l||j!==U)&&Bf(t,v,l,U),Fs=!1;var Y=t.memoizedState;v.state=Y,Ko(t,l,v,d),j=t.memoizedState,C!==l||Y!==j||xn.current||Fs?(typeof Z=="function"&&(mc(t,i,Z,l),j=t.memoizedState),(C=Fs||Ff(t,i,C,l,Y,j,U))?(ee||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=j),v.props=l,v.state=j,v.context=U,l=C):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,mf(e,t),C=t.memoizedProps,U=t.type===t.elementType?C:Qn(t.type,C),v.props=U,ee=t.pendingProps,Y=v.context,j=i.contextType,typeof j=="object"&&j!==null?j=$n(j):(j=wn(i)?or:rn.current,j=Pr(t,j));var de=i.getDerivedStateFromProps;(Z=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==ee||Y!==j)&&Bf(t,v,l,j),Fs=!1,Y=t.memoizedState,v.state=Y,Ko(t,l,v,d);var pe=t.memoizedState;C!==ee||Y!==pe||xn.current||Fs?(typeof de=="function"&&(mc(t,i,de,l),pe=t.memoizedState),(U=Fs||Ff(t,i,U,l,Y,pe,j)||!1)?(Z||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,pe,j),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,pe,j)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=pe),v.props=l,v.state=pe,v.context=j,l=U):(typeof v.componentDidUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),l=!1)}return wc(e,t,i,l,p,d)}function wc(e,t,i,l,d,p){Zf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&sf(t,i,!1),Ts(e,t,p);l=t.stateNode,Uv.current=t;var C=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Fr(t,e.child,null,p),t.child=Fr(t,null,C,p)):pn(e,t,C,p),t.memoizedState=l.state,d&&sf(t,i,!0),t.child}function ep(e){var t=e.stateNode;t.pendingContext?tf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tf(e,t.context,!1),sc(e,t.containerInfo)}function tp(e,t,i,l,d){return $r(),Ya(d),t.flags|=256,pn(e,t,i,l),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0};function Sc(e){return{baseLanes:e,cachePool:null,transitions:null}}function np(e,t,i){var l=t.pendingProps,d=Nt.current,p=!1,v=(t.flags&128)!==0,C;if((C=v)||(C=e!==null&&e.memoizedState===null?!1:(d&2)!==0),C?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ut(Nt,d&1),e===null)return Xa(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=ml(v,l,0,null),e=gr(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Sc(i),t.memoizedState=kc,e):Tc(t,v));if(d=e.memoizedState,d!==null&&(C=d.dehydrated,C!==null))return Bv(e,t,v,l,C,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,C=d.sibling;var j={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=j,t.deletions=null):(l=qs(d,j),l.subtreeFlags=d.subtreeFlags&14680064),C!==null?p=qs(C,p):(p=gr(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?Sc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=kc,l}return p=e.child,e=p.sibling,l=qs(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 Tc(e,t){return t=ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nl(e,t,i,l){return l!==null&&Ya(l),Fr(t,e.child,null,i),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=vc(Error(r(422))),nl(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=ml({mode:"visible",children:l.children},d,0,null),p=gr(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Fr(t,e.child,null,v),t.child.memoizedState=Sc(v),t.memoizedState=kc,p);if((t.mode&1)===0)return nl(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var C=l.dgst;return l=C,p=Error(r(419)),l=vc(p,l,void 0),nl(e,t,v,l)}if(C=(v&e.childLanes)!==0,kn||C){if(l=Vt,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,ks(e,d),es(l,e,d,-1))}return $c(),l=vc(Error(r(421))),nl(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=ty.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,jn=Ps(d.nextSibling),_n=t,ht=!0,Yn=null,e!==null&&(On[zn++]=xs,On[zn++]=ws,On[zn++]=lr,xs=e.id,ws=e.overflow,lr=t),t=Tc(t,l.children),t.flags|=4096,t)}function sp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ec(e.return,t,i)}function bc(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 rp(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(pn(e,t,l.children,i),l=Nt.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&&sp(e,i,t);else if(e.tag===19)sp(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(ut(Nt,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&&Xo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),bc(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&&Xo(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}bc(t,!0,i,null,p);break;case"together":bc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ts(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,i=qs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=qs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Wv(e,t,i){switch(t.tag){case 3:ep(t),$r();break;case 5:yf(t);break;case 1:wn(t.type)&&$o(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ut(Vo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ut(Nt,Nt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?np(e,t,i):(ut(Nt,Nt.current&1),e=Ts(e,t,i),e!==null?e.sibling:null);ut(Nt,Nt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return rp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ut(Nt,Nt.current),l)break;return null;case 22:case 23:return t.lanes=0,Qf(e,t,i)}return Ts(e,t,i)}var ip,Nc,op,lp;ip=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}},Nc=function(){},op=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ur(as.current);var p=null;switch(i){case"input":d=ze(e,d),l=ze(e,l),p=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),p=[];break;case"textarea":d=V(e,d),l=V(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Po)}Ln(i,l);var v;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var C=d[U];for(v in C)C.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var j=l[U];if(C=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&j!==C&&(j!=null||C!=null))if(U==="style")if(C){for(v in C)!C.hasOwnProperty(v)||j&&j.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in j)j.hasOwnProperty(v)&&C[v]!==j[v]&&(i||(i={}),i[v]=j[v])}else i||(p||(p=[]),p.push(U,i)),i=j;else U==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,C=C?C.__html:void 0,j!=null&&C!==j&&(p=p||[]).push(U,j)):U==="children"?typeof j!="string"&&typeof j!="number"||(p=p||[]).push(U,""+j):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(j!=null&&U==="onScroll"&&ft("scroll",e),p||C===j||(p=[])):(p=p||[]).push(U,j))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},lp=function(e,t,i,l){i!==l&&(t.flags|=4)};function $i(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ln(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Hv(e,t,i){var l=t.pendingProps;switch(qa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return wn(t.type)&&zo(),ln(t),null;case 3:return l=t.stateNode,Wr(),pt(xn),pt(rn),oc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yn!==null&&(Pc(Yn),Yn=null))),Nc(e,t),ln(t),null;case 5:rc(t);var d=ur(Mi.current);if(i=t.type,e!==null&&t.stateNode!=null)op(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ln(t),null}if(e=ur(as.current),Wo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[ls]=t,l[ji]=p,e=(t.mode&1)!==0,i){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(d=0;d<Ci.length;d++)ft(Ci[d],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":zt(l,p),ft("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},ft("invalid",l);break;case"textarea":he(l,p),ft("invalid",l)}Ln(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var C=p[v];v==="children"?typeof C=="string"?l.textContent!==C&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,C,e),d=["children",C]):typeof C=="number"&&l.textContent!==""+C&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,C,e),d=["children",""+C]):a.hasOwnProperty(v)&&C!=null&&v==="onScroll"&&ft("scroll",l)}switch(i){case"input":mt(l),Rt(l,p,!0);break;case"textarea":mt(l),Ze(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Po)}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=vt(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[ls]=t,e[ji]=l,ip(e,t,!1,!1),t.stateNode=e;e:{switch(v=Pn(i,l),i){case"dialog":ft("cancel",e),ft("close",e),d=l;break;case"iframe":case"object":case"embed":ft("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ci.length;d++)ft(Ci[d],e);d=l;break;case"source":ft("error",e),d=l;break;case"img":case"image":case"link":ft("error",e),ft("load",e),d=l;break;case"details":ft("toggle",e),d=l;break;case"input":zt(e,l),d=ze(e,l),ft("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),ft("invalid",e);break;case"textarea":he(e,l),d=V(e,l),ft("invalid",e);break;default:d=l}Ln(i,d),C=d;for(p in C)if(C.hasOwnProperty(p)){var j=C[p];p==="style"?Gn(e,j):p==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,j!=null&&Yt(e,j)):p==="children"?typeof j=="string"?(i!=="textarea"||j!=="")&&sn(e,j):typeof j=="number"&&sn(e,""+j):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?j!=null&&p==="onScroll"&&ft("scroll",e):j!=null&&B(e,p,j,v))}switch(i){case"input":mt(e),Rt(e,l,!1);break;case"textarea":mt(e),Ze(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Re(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?$t(e,!!l.multiple,p,!1):l.defaultValue!=null&&$t(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Po)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ln(t),null;case 6:if(e&&t.stateNode!=null)lp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(i=ur(Mi.current),ur(as.current),Wo(t)){if(l=t.stateNode,i=t.memoizedProps,l[ls]=t,(p=l.nodeValue!==i)&&(e=_n,e!==null))switch(e.tag){case 3:Lo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Lo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[ls]=t,t.stateNode=l}return ln(t),null;case 13:if(pt(Nt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&jn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)uf(),$r(),t.flags|=98560,p=!1;else if(p=Wo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(r(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[ls]=t}else $r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else Yn!==null&&(Pc(Yn),Yn=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||(Nt.current&1)!==0?Ut===0&&(Ut=3):$c())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return Wr(),Nc(e,t),e===null&&Ei(t.stateNode.containerInfo),ln(t),null;case 10:return Ja(t.type._context),ln(t),null;case 17:return wn(t.type)&&zo(),ln(t),null;case 19:if(pt(Nt),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)$i(p,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Xo(e),v!==null){for(t.flags|=128,$i(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 ut(Nt,Nt.current&1|2),t.child}e=e.sibling}p.tail!==null&&St()>qr&&(t.flags|=128,l=!0,$i(p,!1),t.lanes=4194304)}else{if(!l)if(e=Xo(v),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),$i(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ht)return ln(t),null}else 2*St()-p.renderingStartTime>qr&&i!==1073741824&&(t.flags|=128,l=!0,$i(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=St(),t.sibling=null,i=Nt.current,ut(Nt,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return zc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Rn&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function Vv(e,t){switch(qa(t),t.tag){case 1:return wn(t.type)&&zo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wr(),pt(xn),pt(rn),oc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return rc(t),null;case 13:if(pt(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));$r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(Nt),null;case 4:return Wr(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var rl=!1,an=!1,Gv=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Vr(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Et(e,t,l)}else i.current=null}function Cc(e,t,i){try{i()}catch(l){Et(e,t,l)}}var ap=!1;function qv(e,t){if(za=bo,e=$d(),Ra(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,C=-1,j=-1,U=0,Z=0,ee=e,Y=null;t:for(;;){for(var de;ee!==i||d!==0&&ee.nodeType!==3||(C=v+d),ee!==p||l!==0&&ee.nodeType!==3||(j=v+l),ee.nodeType===3&&(v+=ee.nodeValue.length),(de=ee.firstChild)!==null;)Y=ee,ee=de;for(;;){if(ee===e)break t;if(Y===i&&++U===d&&(C=v),Y===p&&++Z===l&&(j=v),(de=ee.nextSibling)!==null)break;ee=Y,Y=ee.parentNode}ee=de}i=C===-1||j===-1?null:{start:C,end:j}}else i=null}i=i||{start:0,end:0}}else i=null;for($a={focusedElem:e,selectionRange:i},bo=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,Mt=pe.memoizedState,$=t.stateNode,I=$.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Qn(t.type,ve),Mt);$.__reactInternalSnapshotBeforeUpdate=I}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(r(163))}}catch(re){Et(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return pe=ap,ap=!1,pe}function Fi(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&&Cc(t,i,p)}d=d.next}while(d!==l)}}function il(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 Ec(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 cp(e){var t=e.alternate;t!==null&&(e.alternate=null,cp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ls],delete t[ji],delete t[Wa],delete t[jv],delete t[Rv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function up(e){return e.tag===5||e.tag===3||e.tag===4}function dp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||up(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 _c(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=Po));else if(l!==4&&(e=e.child,e!==null))for(_c(e,t,i),e=e.sibling;e!==null;)_c(e,t,i),e=e.sibling}function jc(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(jc(e,t,i),e=e.sibling;e!==null;)jc(e,t,i),e=e.sibling}var Zt=null,Zn=!1;function Bs(e,t,i){for(i=i.child;i!==null;)fp(e,t,i),i=i.sibling}function fp(e,t,i){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(er,i)}catch{}switch(i.tag){case 5:an||Vr(i,t);case 6:var l=Zt,d=Zn;Zt=null,Bs(e,t,i),Zt=l,Zn=d,Zt!==null&&(Zn?(e=Zt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Zt.removeChild(i.stateNode));break;case 18:Zt!==null&&(Zn?(e=Zt,i=i.stateNode,e.nodeType===8?Ba(e.parentNode,i):e.nodeType===1&&Ba(e,i),yi(e)):Ba(Zt,i.stateNode));break;case 4:l=Zt,d=Zn,Zt=i.stateNode.containerInfo,Zn=!0,Bs(e,t,i),Zt=l,Zn=d;break;case 0:case 11:case 14:case 15:if(!an&&(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)&&Cc(i,t,v),d=d.next}while(d!==l)}Bs(e,t,i);break;case 1:if(!an&&(Vr(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(C){Et(i,t,C)}Bs(e,t,i);break;case 21:Bs(e,t,i);break;case 22:i.mode&1?(an=(l=an)||i.memoizedState!==null,Bs(e,t,i),an=l):Bs(e,t,i);break;default:Bs(e,t,i)}}function pp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Gv),t.forEach(function(l){var d=ny.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,C=v;e:for(;C!==null;){switch(C.tag){case 5:Zt=C.stateNode,Zn=!1;break e;case 3:Zt=C.stateNode.containerInfo,Zn=!0;break e;case 4:Zt=C.stateNode.containerInfo,Zn=!0;break e}C=C.return}if(Zt===null)throw Error(r(160));fp(p,v,d),Zt=null,Zn=!1;var j=d.alternate;j!==null&&(j.return=null),d.return=null}catch(U){Et(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)hp(t,e),t=t.sibling}function hp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jn(t,e),us(e),l&4){try{Fi(3,e,e.return),il(3,e)}catch(ve){Et(e,e.return,ve)}try{Fi(5,e,e.return)}catch(ve){Et(e,e.return,ve)}}break;case 1:Jn(t,e),us(e),l&512&&i!==null&&Vr(i,i.return);break;case 5:if(Jn(t,e),us(e),l&512&&i!==null&&Vr(i,i.return),e.flags&32){var d=e.stateNode;try{sn(d,"")}catch(ve){Et(e,e.return,ve)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,C=e.type,j=e.updateQueue;if(e.updateQueue=null,j!==null)try{C==="input"&&p.type==="radio"&&p.name!=null&&We(d,p),Pn(C,v);var U=Pn(C,p);for(v=0;v<j.length;v+=2){var Z=j[v],ee=j[v+1];Z==="style"?Gn(d,ee):Z==="dangerouslySetInnerHTML"?Yt(d,ee):Z==="children"?sn(d,ee):B(d,Z,ee,U)}switch(C){case"input":Wt(d,p);break;case"textarea":Ue(d,p);break;case"select":var Y=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?$t(d,!!p.multiple,de,!1):Y!==!!p.multiple&&(p.defaultValue!=null?$t(d,!!p.multiple,p.defaultValue,!0):$t(d,!!p.multiple,p.multiple?[]:"",!1))}d[ji]=p}catch(ve){Et(e,e.return,ve)}}break;case 6:if(Jn(t,e),us(e),l&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ve){Et(e,e.return,ve)}}break;case 3:if(Jn(t,e),us(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ve){Et(e,e.return,ve)}break;case 4:Jn(t,e),us(e);break;case 13:Jn(t,e),us(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Ic=St())),l&4&&pp(e);break;case 22:if(Z=i!==null&&i.memoizedState!==null,e.mode&1?(an=(U=an)||Z,Jn(t,e),an=U):Jn(t,e),us(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!Z&&(e.mode&1)!==0)for(fe=e,Z=e.child;Z!==null;){for(ee=fe=Z;fe!==null;){switch(Y=fe,de=Y.child,Y.tag){case 0:case 11:case 14:case 15:Fi(4,Y,Y.return);break;case 1:Vr(Y,Y.return);var pe=Y.stateNode;if(typeof pe.componentWillUnmount=="function"){l=Y,i=Y.return;try{t=l,pe.props=t.memoizedProps,pe.state=t.memoizedState,pe.componentWillUnmount()}catch(ve){Et(l,i,ve)}}break;case 5:Vr(Y,Y.return);break;case 22:if(Y.memoizedState!==null){vp(ee);continue}}de!==null?(de.return=Y,fe=de):vp(ee)}Z=Z.sibling}e:for(Z=null,ee=e;;){if(ee.tag===5){if(Z===null){Z=ee;try{d=ee.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(C=ee.stateNode,j=ee.memoizedProps.style,v=j!=null&&j.hasOwnProperty("display")?j.display:null,C.style.display=yn("display",v))}catch(ve){Et(e,e.return,ve)}}}else if(ee.tag===6){if(Z===null)try{ee.stateNode.nodeValue=U?"":ee.memoizedProps}catch(ve){Et(e,e.return,ve)}}else if((ee.tag!==22&&ee.tag!==23||ee.memoizedState===null||ee===e)&&ee.child!==null){ee.child.return=ee,ee=ee.child;continue}if(ee===e)break e;for(;ee.sibling===null;){if(ee.return===null||ee.return===e)break e;Z===ee&&(Z=null),ee=ee.return}Z===ee&&(Z=null),ee.sibling.return=ee.return,ee=ee.sibling}}break;case 19:Jn(t,e),us(e),l&4&&pp(e);break;case 21:break;default:Jn(t,e),us(e)}}function us(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(up(i)){var l=i;break e}i=i.return}throw Error(r(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(sn(d,""),l.flags&=-33);var p=dp(e);jc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,C=dp(e);_c(e,C,v);break;default:throw Error(r(161))}}catch(j){Et(e,e.return,j)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kv(e,t,i){fe=e,mp(e)}function mp(e,t,i){for(var l=(e.mode&1)!==0;fe!==null;){var d=fe,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||rl;if(!v){var C=d.alternate,j=C!==null&&C.memoizedState!==null||an;C=rl;var U=an;if(rl=v,(an=j)&&!U)for(fe=d;fe!==null;)v=fe,j=v.child,v.tag===22&&v.memoizedState!==null?yp(d):j!==null?(j.return=v,fe=j):yp(d);for(;p!==null;)fe=p,mp(p),p=p.sibling;fe=d,rl=C,an=U}gp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,fe=p):gp(e)}}function gp(e){for(;fe!==null;){var t=fe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:an||il(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!an)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&&vf(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}vf(t,v,i)}break;case 5:var C=t.stateNode;if(i===null&&t.flags&4){i=C;var j=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":j.autoFocus&&i.focus();break;case"img":j.src&&(i.src=j.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var Z=U.memoizedState;if(Z!==null){var ee=Z.dehydrated;ee!==null&&yi(ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}an||t.flags&512&&Ec(t)}catch(Y){Et(t,t.return,Y)}}if(t===e){fe=null;break}if(i=t.sibling,i!==null){i.return=t.return,fe=i;break}fe=t.return}}function vp(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,fe=i;break}fe=t.return}}function yp(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{il(4,t)}catch(j){Et(t,i,j)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(j){Et(t,d,j)}}var p=t.return;try{Ec(t)}catch(j){Et(t,p,j)}break;case 5:var v=t.return;try{Ec(t)}catch(j){Et(t,v,j)}}}catch(j){Et(t,t.return,j)}if(t===e){fe=null;break}var C=t.sibling;if(C!==null){C.return=t.return,fe=C;break}fe=t.return}}var Xv=Math.ceil,ol=M.ReactCurrentDispatcher,Rc=M.ReactCurrentOwner,Un=M.ReactCurrentBatchConfig,Qe=0,Vt=null,Pt=null,Jt=0,Rn=0,Gr=Os(0),Ut=0,Ui=null,fr=0,ll=0,Ac=0,Bi=null,Sn=null,Ic=0,qr=1/0,bs=null,al=!1,Dc=null,Ws=null,cl=!1,Hs=null,ul=0,Wi=0,Mc=null,dl=-1,fl=0;function hn(){return(Qe&6)!==0?St():dl!==-1?dl:dl=St()}function Vs(e){return(e.mode&1)===0?1:(Qe&2)!==0&&Jt!==0?Jt&-Jt:Iv.transition!==null?(fl===0&&(fl=hi()),fl):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:xd(e.type)),e)}function es(e,t,i,l){if(50<Wi)throw Wi=0,Mc=null,Error(r(185));rr(e,i,l),((Qe&2)===0||e!==Vt)&&(e===Vt&&((Qe&2)===0&&(ll|=i),Ut===4&&Gs(e,Jt)),Tn(e,l),i===1&&Qe===0&&(t.mode&1)===0&&(qr=St()+500,Fo&&$s()))}function Tn(e,t){var i=e.callbackNode;ko(e,t);var l=sr(e,e===Vt?Jt:0);if(l===0)i!==null&&yo(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&yo(i),t===1)e.tag===0?Av(wp.bind(null,e)):rf(wp.bind(null,e)),Ev(function(){(Qe&6)===0&&$s()}),i=null;else{switch(se(l)){case 1:i=Rs;break;case 4:i=os;break;case 16:i=Tr;break;case 536870912:i=xo;break;default:i=Tr}i=_p(i,xp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function xp(e,t){if(dl=-1,fl=0,(Qe&6)!==0)throw Error(r(327));var i=e.callbackNode;if(Kr()&&e.callbackNode!==i)return null;var l=sr(e,e===Vt?Jt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=pl(e,l);else{t=l;var d=Qe;Qe|=2;var p=Sp();(Vt!==e||Jt!==t)&&(bs=null,qr=St()+500,hr(e,t));do try{Zv();break}catch(C){kp(e,C)}while(!0);Za(),ol.current=p,Qe=d,Pt!==null?t=0:(Vt=null,Jt=0,t=Ut)}if(t!==0){if(t===2&&(d=pi(e),d!==0&&(l=d,t=Lc(e,d))),t===1)throw i=Ui,hr(e,0),Gs(e,l),Tn(e,St()),i;if(t===6)Gs(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Yv(d)&&(t=pl(e,l),t===2&&(p=pi(e),p!==0&&(l=p,t=Lc(e,p))),t===1))throw i=Ui,hr(e,0),Gs(e,l),Tn(e,St()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(r(345));case 2:mr(e,Sn,bs);break;case 3:if(Gs(e,l),(l&130023424)===l&&(t=Ic+500-St(),10<t)){if(sr(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){hn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ua(mr.bind(null,e,Sn,bs),t);break}mr(e,Sn,bs);break;case 4:if(Gs(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-dn(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=St()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Xv(l/1960))-l,10<l){e.timeoutHandle=Ua(mr.bind(null,e,Sn,bs),l);break}mr(e,Sn,bs);break;case 5:mr(e,Sn,bs);break;default:throw Error(r(329))}}}return Tn(e,St()),e.callbackNode===i?xp.bind(null,e):null}function Lc(e,t){var i=Bi;return e.current.memoizedState.isDehydrated&&(hr(e,t).flags|=256),e=pl(e,t),e!==2&&(t=Sn,Sn=i,t!==null&&Pc(t)),e}function Pc(e){Sn===null?Sn=e:Sn.push.apply(Sn,e)}function Yv(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(!Xn(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 Gs(e,t){for(t&=~Ac,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-dn(t),l=1<<i;e[i]=-1,t&=~l}}function wp(e){if((Qe&6)!==0)throw Error(r(327));Kr();var t=sr(e,0);if((t&1)===0)return Tn(e,St()),null;var i=pl(e,t);if(e.tag!==0&&i===2){var l=pi(e);l!==0&&(t=l,i=Lc(e,l))}if(i===1)throw i=Ui,hr(e,0),Gs(e,t),Tn(e,St()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mr(e,Sn,bs),Tn(e,St()),null}function Oc(e,t){var i=Qe;Qe|=1;try{return e(t)}finally{Qe=i,Qe===0&&(qr=St()+500,Fo&&$s())}}function pr(e){Hs!==null&&Hs.tag===0&&(Qe&6)===0&&Kr();var t=Qe;Qe|=1;var i=Un.transition,l=Xe;try{if(Un.transition=null,Xe=1,e)return e()}finally{Xe=l,Un.transition=i,Qe=t,(Qe&6)===0&&$s()}}function zc(){Rn=Gr.current,pt(Gr)}function hr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Cv(i)),Pt!==null)for(i=Pt.return;i!==null;){var l=i;switch(qa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&zo();break;case 3:Wr(),pt(xn),pt(rn),oc();break;case 5:rc(l);break;case 4:Wr();break;case 13:pt(Nt);break;case 19:pt(Nt);break;case 10:Ja(l.type._context);break;case 22:case 23:zc()}i=i.return}if(Vt=e,Pt=e=qs(e.current,null),Jt=Rn=t,Ut=0,Ui=null,Ac=ll=fr=0,Sn=Bi=null,cr!==null){for(t=0;t<cr.length;t++)if(i=cr[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}cr=null}return e}function kp(e,t){do{var i=Pt;try{if(Za(),Yo.current=el,Qo){for(var l=Ct.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Qo=!1}if(dr=0,Ht=Ft=Ct=null,Li=!1,Pi=0,Rc.current=null,i===null||i.return===null){Ut=1,Ui=t,Pt=null;break}e:{var p=e,v=i.return,C=i,j=t;if(t=Jt,C.flags|=32768,j!==null&&typeof j=="object"&&typeof j.then=="function"){var U=j,Z=C,ee=Z.tag;if((Z.mode&1)===0&&(ee===0||ee===11||ee===15)){var Y=Z.alternate;Y?(Z.updateQueue=Y.updateQueue,Z.memoizedState=Y.memoizedState,Z.lanes=Y.lanes):(Z.updateQueue=null,Z.memoizedState=null)}var de=Gf(v);if(de!==null){de.flags&=-257,qf(de,v,C,p,t),de.mode&1&&Vf(p,U,t),t=de,j=U;var pe=t.updateQueue;if(pe===null){var ve=new Set;ve.add(j),t.updateQueue=ve}else pe.add(j);break e}else{if((t&1)===0){Vf(p,U,t),$c();break e}j=Error(r(426))}}else if(ht&&C.mode&1){var Mt=Gf(v);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),qf(Mt,v,C,p,t),Ya(Hr(j,C));break e}}p=j=Hr(j,C),Ut!==4&&(Ut=2),Bi===null?Bi=[p]:Bi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var $=Wf(p,j,t);gf(p,$);break e;case 1:C=j;var I=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof I.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Ws===null||!Ws.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var re=Hf(p,C,t);gf(p,re);break e}}p=p.return}while(p!==null)}bp(i)}catch(Te){t=Te,Pt===i&&i!==null&&(Pt=i=i.return);continue}break}while(!0)}function Sp(){var e=ol.current;return ol.current=el,e===null?el:e}function $c(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Vt===null||(fr&268435455)===0&&(ll&268435455)===0||Gs(Vt,Jt)}function pl(e,t){var i=Qe;Qe|=2;var l=Sp();(Vt!==e||Jt!==t)&&(bs=null,hr(e,t));do try{Qv();break}catch(d){kp(e,d)}while(!0);if(Za(),Qe=i,ol.current=l,Pt!==null)throw Error(r(261));return Vt=null,Jt=0,Ut}function Qv(){for(;Pt!==null;)Tp(Pt)}function Zv(){for(;Pt!==null&&!va();)Tp(Pt)}function Tp(e){var t=Ep(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?bp(e):Pt=t,Rc.current=null}function bp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Hv(i,t,Rn),i!==null){Pt=i;return}}else{if(i=Vv(i,t),i!==null){i.flags&=32767,Pt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ut=6,Pt=null;return}}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Ut===0&&(Ut=5)}function mr(e,t,i){var l=Xe,d=Un.transition;try{Un.transition=null,Xe=1,Jv(e,t,i,l)}finally{Un.transition=d,Xe=l}return null}function Jv(e,t,i,l){do Kr();while(Hs!==null);if((Qe&6)!==0)throw Error(r(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(So(e,p),e===Vt&&(Pt=Vt=null,Jt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||cl||(cl=!0,_p(Tr,function(){return Kr(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Un.transition,Un.transition=null;var v=Xe;Xe=1;var C=Qe;Qe|=4,Rc.current=null,qv(e,i),hp(i,e),xv($a),bo=!!za,$a=za=null,e.current=i,Kv(i),ya(),Qe=C,Xe=v,Un.transition=p}else e.current=i;if(cl&&(cl=!1,Hs=e,ul=d),p=e.pendingLanes,p===0&&(Ws=null),br(i.stateNode),Tn(e,St()),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(al)throw al=!1,e=Dc,Dc=null,e;return(ul&1)!==0&&e.tag!==0&&Kr(),p=e.pendingLanes,(p&1)!==0?e===Mc?Wi++:(Wi=0,Mc=e):Wi=0,$s(),null}function Kr(){if(Hs!==null){var e=se(ul),t=Un.transition,i=Xe;try{if(Un.transition=null,Xe=16>e?16:e,Hs===null)var l=!1;else{if(e=Hs,Hs=null,ul=0,(Qe&6)!==0)throw Error(r(331));var d=Qe;for(Qe|=4,fe=e.current;fe!==null;){var p=fe,v=p.child;if((fe.flags&16)!==0){var C=p.deletions;if(C!==null){for(var j=0;j<C.length;j++){var U=C[j];for(fe=U;fe!==null;){var Z=fe;switch(Z.tag){case 0:case 11:case 15:Fi(8,Z,p)}var ee=Z.child;if(ee!==null)ee.return=Z,fe=ee;else for(;fe!==null;){Z=fe;var Y=Z.sibling,de=Z.return;if(cp(Z),Z===U){fe=null;break}if(Y!==null){Y.return=de,fe=Y;break}fe=de}}}var pe=p.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var Mt=ve.sibling;ve.sibling=null,ve=Mt}while(ve!==null)}}fe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,fe=v;else e:for(;fe!==null;){if(p=fe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Fi(9,p,p.return)}var $=p.sibling;if($!==null){$.return=p.return,fe=$;break e}fe=p.return}}var I=e.current;for(fe=I;fe!==null;){v=fe;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,fe=F;else e:for(v=I;fe!==null;){if(C=fe,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:il(9,C)}}catch(Te){Et(C,C.return,Te)}if(C===v){fe=null;break e}var re=C.sibling;if(re!==null){re.return=C.return,fe=re;break e}fe=C.return}}if(Qe=d,$s(),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(er,e)}catch{}l=!0}return l}finally{Xe=i,Un.transition=t}}return!1}function Np(e,t,i){t=Hr(i,t),t=Wf(e,t,1),e=Us(e,t,1),t=hn(),e!==null&&(rr(e,1,t),Tn(e,t))}function Et(e,t,i){if(e.tag===3)Np(e,e,i);else for(;t!==null;){if(t.tag===3){Np(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ws===null||!Ws.has(l))){e=Hr(i,e),e=Hf(t,e,1),t=Us(t,e,1),e=hn(),t!==null&&(rr(t,1,e),Tn(t,e));break}}t=t.return}}function ey(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=hn(),e.pingedLanes|=e.suspendedLanes&i,Vt===e&&(Jt&i)===i&&(Ut===4||Ut===3&&(Jt&130023424)===Jt&&500>St()-Ic?hr(e,0):Ac|=i),Tn(e,t)}function Cp(e,t){t===0&&((e.mode&1)===0?t=1:(t=Cr,Cr<<=1,(Cr&130023424)===0&&(Cr=4194304)));var i=hn();e=ks(e,t),e!==null&&(rr(e,t,i),Tn(e,i))}function ty(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Cp(e,i)}function ny(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(r(314))}l!==null&&l.delete(t),Cp(e,i)}var Ep;Ep=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||xn.current)kn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return kn=!1,Wv(e,t,i);kn=(e.flags&131072)!==0}else kn=!1,ht&&(t.flags&1048576)!==0&&of(t,Bo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;sl(e,t),e=t.pendingProps;var d=Pr(t,rn.current);Br(t,i),d=cc(null,t,l,e,d,i);var p=uc();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,wn(l)?(p=!0,$o(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,nc(t),d.updater=tl,t.stateNode=d,d._reactInternals=t,gc(t,l,e,i),t=wc(null,t,l,!0,p,i)):(t.tag=0,ht&&p&&Ga(t),pn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=ry(l),e=Qn(l,e),d){case 0:t=xc(null,t,l,e,i);break e;case 1:t=Jf(null,t,l,e,i);break e;case 11:t=Kf(null,t,l,e,i);break e;case 14:t=Xf(null,t,l,Qn(l.type,e),i);break e}throw Error(r(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),xc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Jf(e,t,l,d,i);case 3:e:{if(ep(t),e===null)throw Error(r(387));l=t.pendingProps,p=t.memoizedState,d=p.element,mf(e,t),Ko(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=Hr(Error(r(423)),t),t=tp(e,t,l,i,d);break e}else if(l!==d){d=Hr(Error(r(424)),t),t=tp(e,t,l,i,d);break e}else for(jn=Ps(t.stateNode.containerInfo.firstChild),_n=t,ht=!0,Yn=null,i=pf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if($r(),l===d){t=Ts(e,t,i);break e}pn(e,t,l,i)}t=t.child}return t;case 5:return yf(t),e===null&&Xa(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,Fa(l,d)?v=null:p!==null&&Fa(l,p)&&(t.flags|=32),Zf(e,t),pn(e,t,v,i),t.child;case 6:return e===null&&Xa(t),null;case 13:return np(e,t,i);case 4:return sc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fr(t,null,l,i):pn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Kf(e,t,l,d,i);case 7:return pn(e,t,t.pendingProps,i),t.child;case 8:return pn(e,t,t.pendingProps.children,i),t.child;case 12:return pn(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,ut(Vo,l._currentValue),l._currentValue=v,p!==null)if(Xn(p.value,v)){if(p.children===d.children&&!xn.current){t=Ts(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var C=p.dependencies;if(C!==null){v=p.child;for(var j=C.firstContext;j!==null;){if(j.context===l){if(p.tag===1){j=Ss(-1,i&-i),j.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var Z=U.pending;Z===null?j.next=j:(j.next=Z.next,Z.next=j),U.pending=j}}p.lanes|=i,j=p.alternate,j!==null&&(j.lanes|=i),ec(p.return,i,t),C.lanes|=i;break}j=j.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(r(341));v.lanes|=i,C=v.alternate,C!==null&&(C.lanes|=i),ec(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}pn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Br(t,i),d=$n(d),l=l(d),t.flags|=1,pn(e,t,l,i),t.child;case 14:return l=t.type,d=Qn(l,t.pendingProps),d=Qn(l.type,d),Xf(e,t,l,d,i);case 15:return Yf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),sl(e,t),t.tag=1,wn(l)?(e=!0,$o(t)):e=!1,Br(t,i),Uf(t,l,d),gc(t,l,d,i),wc(null,t,l,!0,e,i);case 19:return rp(e,t,i);case 22:return Qf(e,t,i)}throw Error(r(156,t.tag))};function _p(e,t){return fi(e,t)}function sy(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 Bn(e,t,i,l){return new sy(e,t,i,l)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ry(e){if(typeof e=="function")return Fc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===we)return 11;if(e===Q)return 14}return 2}function qs(e,t){var i=e.alternate;return i===null?(i=Bn(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 hl(e,t,i,l,d,p){var v=2;if(l=e,typeof e=="function")Fc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case K:return gr(i.children,d,p,t);case G:v=8,d|=8;break;case oe:return e=Bn(12,i,t,d|2),e.elementType=oe,e.lanes=p,e;case Ce:return e=Bn(13,i,t,d),e.elementType=Ce,e.lanes=p,e;case Fe:return e=Bn(19,i,t,d),e.elementType=Fe,e.lanes=p,e;case ae:return ml(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:v=10;break e;case ie:v=9;break e;case we:v=11;break e;case Q:v=14;break e;case ne:v=16,l=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return t=Bn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function gr(e,t,i,l){return e=Bn(7,e,l,t),e.lanes=i,e}function ml(e,t,i,l){return e=Bn(22,e,l,t),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function Uc(e,t,i){return e=Bn(6,e,null,t),e.lanes=i,e}function Bc(e,t,i){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iy(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=mi(0),this.expirationTimes=mi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Wc(e,t,i,l,d,p,v,C,j){return e=new iy(e,t,i,C,j),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Bn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},nc(p),e}function oy(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function jp(e){if(!e)return zs;e=e._reactInternals;e:{if(rt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(wn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(wn(i))return nf(e,i,t)}return t}function Rp(e,t,i,l,d,p,v,C,j){return e=Wc(i,l,!0,e,d,p,v,C,j),e.context=jp(null),i=e.current,l=hn(),d=Vs(i),p=Ss(l,d),p.callback=t??null,Us(i,p,d),e.current.lanes=d,rr(e,d,l),Tn(e,l),e}function gl(e,t,i,l){var d=t.current,p=hn(),v=Vs(d);return i=jp(i),t.context===null?t.context=i:t.pendingContext=i,t=Ss(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Us(d,t,v),e!==null&&(es(e,d,v,p),qo(e,d,v)),v}function vl(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 Ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Hc(e,t){Ap(e,t),(e=e.alternate)&&Ap(e,t)}function ly(){return null}var Ip=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vc(e){this._internalRoot=e}yl.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));gl(e,t,null,null)},yl.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){gl(null,e,null,null)}),t[vs]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=me();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ds.length&&t!==0&&t<Ds[i].priority;i++);Ds.splice(i,0,e),i===0&&vd(e)}};function Gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dp(){}function ay(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=vl(v);p.call(U)}}var v=Rp(t,l,e,0,null,!1,!1,"",Dp);return e._reactRootContainer=v,e[vs]=v.current,Ei(e.nodeType===8?e.parentNode:e),pr(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var C=l;l=function(){var U=vl(j);C.call(U)}}var j=Wc(e,0,!1,null,null,!1,!1,"",Dp);return e._reactRootContainer=j,e[vs]=j.current,Ei(e.nodeType===8?e.parentNode:e),pr(function(){gl(t,j,i,l)}),j}function wl(e,t,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var C=d;d=function(){var j=vl(v);C.call(j)}}gl(t,v,e,d)}else v=ay(i,t,e,d,l);return vl(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=nr(t.pendingLanes);i!==0&&(Is(t,i|1),Tn(t,St()),(Qe&6)===0&&(qr=St()+500,$s()))}break;case 13:pr(function(){var l=ks(e,1);if(l!==null){var d=hn();es(l,e,1,d)}}),Hc(e,1)}},z=function(e){if(e.tag===13){var t=ks(e,134217728);if(t!==null){var i=hn();es(t,e,134217728,i)}Hc(e,134217728)}},X=function(e){if(e.tag===13){var t=Vs(e),i=ks(e,t);if(i!==null){var l=hn();es(i,e,t,l)}Hc(e,t)}},me=function(){return Xe},Ee=function(e,t){var i=Xe;try{return Xe=e,t()}finally{Xe=i}},le=function(e,t,i){switch(t){case"input":if(Wt(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=Oo(l);if(!d)throw Error(r(90));Me(l),Wt(l,d)}}}break;case"textarea":Ue(e,i);break;case"select":t=i.value,t!=null&&$t(e,!!i.multiple,t,!1)}},ot=Oc,tt=pr;var cy={usingClientEntryPoint:!1,Events:[Ri,Mr,Oo,Se,Ve,Oc]},Hi={findFiberByHostInstance:ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uy={bundleType:Hi.bundleType,version:Hi.version,rendererPackageName:Hi.rendererPackageName,rendererConfig:Hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Sr(e),e===null?null:e.stateNode},findFiberByHostInstance:Hi.findFiberByHostInstance||ly,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 kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{er=kl.inject(uy),Cn=kl}catch{}}return bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cy,bn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gc(t))throw Error(r(200));return oy(e,t,null,i)},bn.createRoot=function(e,t){if(!Gc(e))throw Error(r(299));var i=!1,l="",d=Ip;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Wc(e,1,!1,null,null,i,!1,l,d),e[vs]=t.current,Ei(e.nodeType===8?e.parentNode:e),new Vc(t)},bn.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(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=Sr(t),e=e===null?null:e.stateNode,e},bn.flushSync=function(e){return pr(e)},bn.hydrate=function(e,t,i){if(!xl(t))throw Error(r(200));return wl(null,e,t,!0,i)},bn.hydrateRoot=function(e,t,i){if(!Gc(e))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Ip;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=Rp(t,null,e,1,i??null,d,!1,p,v),e[vs]=t.current,Ei(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 yl(t)},bn.render=function(e,t,i){if(!xl(t))throw Error(r(200));return wl(null,e,t,!1,i)},bn.unmountComponentAtNode=function(e){if(!xl(e))throw Error(r(40));return e._reactRootContainer?(pr(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[vs]=null})}),!0):!1},bn.unstable_batchedUpdates=Oc,bn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!xl(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return wl(e,t,i,!1,l)},bn.version="18.3.1-next-f1338f8080-20240426",bn}var Up;function ym(){if(Up)return Xc.exports;Up=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(s){console.error(s)}}return n(),Xc.exports=xy(),Xc.exports}var Bp;function wy(){if(Bp)return Sl;Bp=1;var n=ym();return Sl.createRoot=n.createRoot,Sl.hydrateRoot=n.hydrateRoot,Sl}var ky=wy();const Sy=vm(ky),Wp=n=>{let s;const r=new Set,o=(g,x)=>{const k=typeof g=="function"?g(s):g;if(!Object.is(k,s)){const y=s;s=x??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(N=>N(s,y))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(r.add(g),()=>r.delete(g))},m=s=n(o,a,h);return h},Ty=(n=>n?Wp(n):Wp),by=n=>n;function Ny(n,s=by){const r=at.useSyncExternalStore(n.subscribe,at.useCallback(()=>s(n.getState()),[n,s]),at.useCallback(()=>s(n.getInitialState()),[n,s]));return at.useDebugValue(r),r}const Cy=n=>{const s=Ty(n),r=o=>Ny(s,o);return Object.assign(r,s),r},Ey=(n=>Cy),xm="agentpane:machines",wm="agentpane:active-machine";function _y(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function km(n){return`${n}.repoburg.com`}function Sm(n){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return s?s[1]:null}function Tm(n,s){try{const r=localStorage.getItem(n);return r==null?s:JSON.parse(r)}catch{return s}}function bm(n,s){try{localStorage.setItem(n,JSON.stringify(s))}catch{}}function Nm(){return Tm(xm,[]).filter(s=>_y(s.mahlas)&&s.hostname===km(s.mahlas))}function jy(n){const s={mahlas:n,hostname:km(n),lastConnectedAt:new Date().toISOString()},r=Nm(),o=[s,...r.filter(a=>a.mahlas!==n)];return bm(xm,o),s}function Ry(){const n=Tm(wm,null);return n?Nm().find(s=>s.mahlas===n)??null:null}function Ay(n){bm(wm,n)}function Iy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const s=Sm(n);s&&(jy(s),Ay(s))}const Hp="http://localhost:9998",Dy=["agent.repoburg.com"];function ps(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),s=n.get("bport");if(s)return`http://localhost:${s}`;const r=n.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(Dy.includes(o))return Hp;if(Sm(o))return"";const a=Ry();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Hp}const My="/api";async function co(n,s,r){const o=await fetch(`${ps()}${My}${s}`,{method:n,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):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} ${s} failed: ${a}`)}return o.json()}function gn(n){return co("GET",n)}function _t(n,s){return co("POST",n,s)}function sa(n){return co("DELETE",n)}function hs(n,s){return co("PATCH",n,s)}function Ly(n,s){return co("PUT",n,s)}function Py(){return gn("/sessions")}function Tl(n){return gn(`/sessions/${n}`)}function $u(n){return _t("/sessions",n)}function Vp(n){return sa(`/sessions/${n}`)}function Cm(n,s,r){return _t(`/sessions/${n}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{}})}function Oy(n){return _t(`/sessions/${n}/cancel`)}function zy(n,s){return hs(`/sessions/${n}`,{title:s})}function Gp(n){return hs(`/sessions/${n}`,{lifecycle:"finished"})}function qp(n){return hs(`/sessions/${n}`,{lifecycle:"working"})}function $y(n,s){return hs(`/sessions/${n}`,{starred:s})}function Kp(n){return hs(`/sessions/${n}`,{has_unreviewed:0})}function Fy(n,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),hs(`/sessions/${n}`,a)}function Uy(n,s){return hs(`/sessions/${n}`,{runtime_config:s})}function By(n,s){return _t(`/sessions/${n}/rewind`,{turn_id:s})}function Wy(n){return _t(`/sessions/${n}/restore`,{})}function Hy(n,s,r){return _t(`/sessions/${n}/branch`,{turn_id:s,title:r})}function Em(){return gn("/workspaces")}function Vy(n,s){return _t("/workspaces",{path:n,label:s})}function Gy(n){return _t("/workspaces/hide",{path:n})}async function qy(){const n=await fetch(`${ps()}/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 _m(){return gn("/folders")}function Ky(n,s){return _t("/folders",{workspace_path:n,name:s})}function Xp(n,s){return hs(`/folders/${n}`,s)}function Xy(n){return sa(`/folders/${n}`)}function Yy(n){return _t("/sessions/reorder",{moves:n})}function oi(n){return n.status==="pending"||n.status==="running"}function jm(n){return!!(n!=null&&n.turns.some(oi))}function ra(n){return n?n.turns.some(oi)||(n.threads??[]).some(s=>(s.turns??[]).some(oi)):!1}async function Qy(n,s){const r=await Promise.allSettled(n.map(u=>s(u))),o=new Map;let a=null;return r.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function Yp(n,s){const r={...n.sessionDetails};s.forEach(f=>delete r[f]);const o=n.openTabs.filter(f=>!s.has(f));let a=n.activeSessionId,u=n.activeTurnIndex;if(a&&s.has(a)){a=o.length>0?o[o.length-1]:null;const f=a?r[a]:null;u=f&&f.turns.length>0?f.turns.length-1:0}return{sessions:n.sessions.filter(f=>!s.has(f.id)),sessionDetails:r,openTabs:o,activeSessionId:a,activeTurnIndex:u}}async function Qp(n,s,r,o,a){if(r.length===0)return;n({error:null});const{updated:u,firstError:f}=await Qy(r,o);u.size>0&&n(m=>({sessions:m.sessions.map(g=>u.get(g.id)??g)}));const h=r.length-u.size;if(h===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{n({error:f});const m=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${m} ${u.size} of ${r.length} — ${h} failed`)}}const Zy=(n,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{var r;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([Py(),Em(),_m()]);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:(r=o[0])==null?void 0:r.id;g&&!s().activeSessionId&&await s().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async r=>{if(s().sessionDetails[r]){const o=s().sessionDetails[r];n({activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,openTabs:s().openTabs.includes(r)?s().openTabs:[...s().openTabs,r]}),o.has_unreviewed===1&&(Kp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await Tl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,loading:!1})),o.has_unreviewed===1&&(Kp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},closeTab:r=>{n(o=>{const a=o.openTabs.filter(u=>u!==r);if(o.activeSessionId===r&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===r?null:o.activeSessionId}})},updateModelConfig:async(r,o,a)=>{const u=s().activeSessionId;if(u){n({error:null});try{const f=await Fy(u,r,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 s().refreshActiveSession()}catch(f){n({error:f.message}),s().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async r=>{n({error:null});try{const o=await $u(r);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 s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{n(o=>({sessions:o.sessions.some(a=>a.id===r.id)?o.sessions:[r,...o.sessions]}))},deleteSession:async r=>{var a;n({error:null});const o=(a=s().sessions.find(u=>u.id===r))==null?void 0:a.title;try{await Vp(r),n(u=>Yp(u,new Set([r]))),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{n({error:null});try{const a=await zy(r,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{n({error:null});try{const o=await Gp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Qp(n,s,r,Gp,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){n({error:null});try{const a=await $y(r,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{n({error:null});try{const o=await qp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){n({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Qp(n,s,r,qp,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;n({error:null});const o=await Promise.allSettled(r.map(f=>Vp(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(r[h])}),a.size===0){n({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}n(f=>Yp(f,a)),s().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=r.length-a.size;u===0?s().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${a.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const a=s().activeSessionId;if(a){n({error:null,submittingPrompt:r}),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 Cm(a,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.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}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const m=ra(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 r=s().activeSessionId;if(r)try{await Oy(r)}catch(o){n({error:o.message})}},rewindToTurn:async(r,o)=>{n({error:null});try{const a=await By(r,o),u=await Tl(r);n(f=>({sessionDetails:{...f.sessionDetails,[r]:u},sessions:f.sessions.map(h=>h.id===r?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),s().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async r=>{n({error:null});try{const o=await Wy(r),a=await Tl(r);n(u=>({sessionDetails:{...u.sessionDetails,[r]:a},sessions:u.sessions.map(f=>f.id===r?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,a)=>{n({error:null});try{const u=await Hy(r,o,a);n(f=>({sessions:[u,...f.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){n({error:null});try{const a=await Uy(o,JSON.stringify(r));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}),s().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await Tl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),Jy=(n,s)=>({workspaces:[],addWorkspace:async r=>{n({error:null});try{const o=await Vy(r.trim());n(a=>({workspaces:[...a.workspaces,o]})),s().addToast("success",`Workspace added — ${o.path}`)}catch(o){s().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async r=>{n({error:null});try{await Gy(r);const o=await Em();n({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{n({error:null});try{const o=s().lastModelConfig,a=await $u({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await s().selectSession(a.id),s().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const r=await qy();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),wr=new Map,Fu=new Map,Uu=new Map,Bu=new Map;function ex(n,s){wr.set(n,s)}function tx(n){wr.delete(n)}function Zc(n,s){Fu.set(n,s)}function Zp(n,s,r){const o=Fu.get(n);if(!o)return;const a=wr.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function nx(n,s,r,o){const a=wr.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function sx(n,s,r,o){const a=Fu.get(n);if(!a)return;const u=wr.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:s,itemId:r,delta:o}})}function rx(n,s){Uu.set(n,s)}function ix(n){Uu.delete(n)}function ox(n,s){Bu.set(n,s)}function lx(n){Bu.delete(n)}function ax(n){var r;const s=wr.get(n);s&&s({source:"agentpane-host",event:"state_changed",payload:{}}),(r=Bu.get(n))==null||r()}function cx(n){var r;const s=wr.get(n);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Uu.get(n))==null||r()}const ux=(n,s)=>({wsConnected:!1,setWsConnected:r=>n({wsConnected:r}),onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=bl(a.sessions,r,()=>({is_running:1,status:"running"})),f=a.sessionDetails[r];if(!f)return{sessions:u};const h=f.turns.findIndex(m=>m.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Ns(f,o,m=>({...m,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===r&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{s().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>eu(h,a))}}:{}})},onItemUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>eu(h,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(s().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?s().addToast("success",`${g} completed: ${h}`):s().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>{var g,x;let m=eu(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 k=m.thoughts?m.thoughts+`
|
|
41
|
+
`+a.data.text:a.data.text;m={...m,thoughts:k}}return m})}}:{}})},onItemDelta:(r,o,a,u)=>{sx(r,o,a,u),n(f=>{const h=f.sessionDetails[r];return h?{sessionDetails:{...f.sessionDetails,[r]:Ns(h,o,m=>dx(m,a,u))}}:{}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),Zp(r,"turn:completed",{turnId:o,response:f??null}),s().refreshApps(),n(g=>{const x=g.sessionDetails[r],k=x?Ns(x,o,E=>({...E,status:"completed",token_usage:a??E.token_usage??null,...f&&!E.agent_response?{agent_response:f}:{}})):null,y=Jc(k),N=y?"running":"active",_=bl(g.sessions,r,E=>({is_running:y,status:N,has_unreviewed:u?1:E.has_unreviewed}));return k?{sessionDetails:{...g.sessionDetails,[r]:{...k,is_running:y,status:N,has_unreviewed:u?1:k.has_unreviewed}},sessions:_}:{sessions:_}})},onTokenUsageUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,a)=>{s().addLogEntry("ERROR",`turn:failed — ${a}`),s().addToast("error",`Turn failed — ${a}`),Zp(r,"turn:failed",{turnId:o,error:a}),n(u=>{const f=u.sessionDetails[r],h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=f?Ns(f,o,N=>({...N,status:m,error:a,items:N.items.map(_=>_.status==="in_progress"?{..._,status:"failed"}:_)})):null,x=Jc(g),k=x?"running":h?"active":"failed",y=bl(u.sessions,r,()=>({is_running:x,status:k}));return g?{sessionDetails:{...u.sessionDetails,[r]:{...g,is_running:x,status:k}},sessions:y}:{sessions:y}})},onTurnCancelled:(r,o)=>{n(a=>{const u=a.sessionDetails[r],f=u?Ns(u,o,x=>({...x,status:"aborted",items:x.items.map(k=>k.status==="in_progress"?{...k,status:"completed"}:k)})):null,h=Jc(f),m=h?"running":"active",g=bl(a.sessions,r,()=>({is_running:h,status:m}));return f?{sessionDetails:{...a.sessionDetails,[r]:{...f,is_running:h,status:m}},sessions:g}:{sessions:g}})},onSessionTitle:(r,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:a.sessionDetails[r]?{...a.sessionDetails,[r]:{...a.sessionDetails[r],title:o}}:a.sessionDetails}))},onBackgroundTasksChanged:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,backgroundTasks:o}}}:{}})}});function Jc(n){return n&&(n.turns.some(oi)||(n.threads??[]).some(r=>(r.turns??[]).some(oi)))?1:0}function bl(n,s,r){return n.some(o=>o.id===s)?n.map(o=>o.id===s?{...o,...r(o)}:o):n}function Ns(n,s,r){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===s)?{...a,turns:(a.turns??[]).map(u=>u.id===s?r(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===s?r(a):a),threads:o}}function eu(n,s){const r=n.items.findIndex(o=>o.external_item_id===s.external_item_id);if(r>=0){const o=[...n.items];return o[r]=s,{...n,items:o}}if(s.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,s]}}return{...n,items:[...n.items,s]}}function dx(n,s,r){var u;const o=n.items.findIndex(f=>f.external_item_id===s);if(o>=0){const f=n.items[o],m=(((u=f.data)==null?void 0:u.text)??"")+r,g=[...n.items];return g[o]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${s}`,turn_id:n.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:r}}function fx(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return gn(`/providers/${n}/models${r}`)}const vu=160,yu=480,px=240,zl=220,hx=300,mx=600;function $l(){return typeof window>"u"?mx:Math.max(zl,Math.round(window.innerWidth*.7))}const Jp="agentpane:sidebar-width",eh="agentpane:right-panel-width";function th(n,s,r,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}const nh=200,gx=(n,s)=>({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:th(Jp,vu,yu,px),rightPanelWidth:th(eh,zl,$l(),hx),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:r=>n({activeTurnIndex:r}),switchRightTab:r=>n({activeRightTab:r}),setChangesScope:r=>n({changesScope:r}),setShowNewSessionDialog:r=>n({showNewSessionDialog:r}),setShowRemoteModal:r=>n({showRemoteModal:r}),setShowCommandPalette:r=>n({showCommandPalette:r}),setShowModelSelector:r=>n({showModelSelector:r}),setSelectedChangePath:r=>n({selectedChangePath:r}),setDeepLinkThreadId:r=>n({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(yu,Math.max(vu,Math.round(r)));n({sidebarWidth:o});try{localStorage.setItem(Jp,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min($l(),Math.max(zl,Math.round(r)));n({rightPanelWidth:o});try{localStorage.setItem(eh,String(o))}catch{}},toggleVscodeView:()=>{if(s().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,a)=>n({vscodeState:r,vscodeId:o,vscodeToken:a}),addToast:(r,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:r,message:o,undoAction:a,undoLabel:u}]}))},removeToast:r=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==r)}))},addLogEntry:(r,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:r,message:o}];return f.length>nh&&f.splice(0,f.length-nh),{eventLog:f}})},loadModels:async(r,o)=>{if(!s().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await fx(r,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),vx=(n,s)=>({createThread:async(r,o)=>{try{await _t(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){s().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(r,o,a)=>{try{await _t(`/sessions/${r}/threads/${o}/followup`,{message:a}),s().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await _t(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(a){s().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(r,o)=>{try{await hs(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){s().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await hs(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(a){s().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(r,o,a)=>{try{const u=await _t(`/sessions/${r}/threads/${o}/summarize`,{directives:a}),f=`
|
|
42
42
|
[Shared from a resolved discussion thread — summary of its findings]
|
|
43
43
|
|
|
44
44
|
\`\`\`QUOTE
|
|
45
45
|
${u.summary}
|
|
46
46
|
\`\`\`
|
|
47
47
|
|
|
48
|
-
`;return n({quotedText:f}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await sa(`/sessions/${r}/threads/${o}`)}catch(a){s().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];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,[r]:{...f,threads:h}}}})},onThreadDeleted:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),yx=(n,s)=>({folders:[],loadFolders:async()=>{const r=await _m();n({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await Ky(r,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return s().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await Yp(r,{name:o});n(u=>({folders:u.folders.map(f=>f.id===r?a:f)}))}catch(a){s().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=s().folders,a=s().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==r),sessions:u.sessions.map(f=>f.folder_id===r?{...f,folder_id:null}:f)}));try{await Xy(r)}catch(u){n({folders:o,sessions:a}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,a=new Map(r.map(u=>[u.id,u]));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 Yy(r)}catch(u){n({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,a=new Map(r.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(r.map((u,f)=>Yp(u,{sort_order:f})))}catch(u){n({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function rh(){return gn("/apps")}function xx(){return gn("/apps/root")}function ih(n){return gn(`/apps/${n}/source`)}function oh(n,s=""){return gn(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`)}function Rm(n,s,r=""){return Ly(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`,s)}function wx(n){return sa(`/apps/${n}`)}function kx(n){return gn(`/apps/${n}/sessions`)}function Sx(){return gn("/apps/examples")}function Tx(n){return _t(`/apps/examples/${n}/install`,{})}function bx(n){return _t("/apps",n)}function Nx(n,s){return _t("/apps/import",{id:n,files:s})}function Cx(n,s,r){return _t(`/apps/mcp/calls/${n}/result`,{result:s,error:null})}function Ex(n,s){return _t(`/apps/${n}/edit-session`,s)}const Dl=new Set;async function nu(n,s){Dl.add(s),await n().loadApps();const r=n().apps.find(o=>o.id===s);n().openAppTab(s),n().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const wu="agentpane:app-workspaces";function _x(){try{const n=JSON.parse(localStorage.getItem(wu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const jx=(n,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:_x(),loadApps:async()=>{try{const[r,o]=await Promise.all([rh(),xx().catch(()=>null)]);r.forEach(a=>Dl.add(a.id)),n(o?{apps:r,appsRootPath:o.root}:{apps:r})}catch{}},refreshApps:async()=>{try{const r=await rh();for(const o of r)Dl.has(o.id)||(Dl.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));n({apps:r})}catch{}},openAppTab:r=>{n(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==r);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===r?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:r=>n({activeAppTabId:r}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{n(a=>{const u={...a.appWorkspaces,[r]:o};try{localStorage.setItem(wu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await Tx(r),await nu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await bx(r),await nu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Nx(r,o),await nu(s,r),!0}catch(a){return s().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,a=await Ex(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await s().selectSession(a.id),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,a.id]})),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(a=>a.id===r);if(o)try{await Rm(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await wx(r),n(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(wu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==r),openAppTabs:o.openAppTabs.filter(u=>u!==r),activeAppTabId:o.activeAppTabId===r?null:o.activeAppTabId,appWorkspaces:a}}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),lh=3e3,In={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Dn=[];let Fl=0,Vu=0,Ul=0,Gu=0,Bl=0,qu=0,Ku=0;const ro=new Map,io=new Map;let ti=new Map,Jr=0,ni=new Map,su=!1;function Wl(n,s,r){if(Dn.push({t:Date.now(),cat:n,msg:s,ms:r}),Dn.length>lh){const o=Dn.length-lh;Dn.splice(0,o),Nn=Math.max(0,Nn-o)}}function ei(n,s,r){Wl(n,s,r),console.log(`[perf:${n}] ${s}`)}function Am(n){ei("note",n)}function Im(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Rx(n,s){let r=ti.get(n);r||ti.set(n,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=ro.get(n);o||ro.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Ax(){Jr++,Ku++}function Ix(n){ni.set(n,(ni.get(n)??0)+1),io.set(n,(io.get(n)??0)+1)}let Ml=0;function Dx(){Ml=performance.now()}function Mx(){const n=performance.now(),s=Ml?n-Ml:null;Ml=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-n+s;r>In.keypressMs&&ei("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Lx=5e3,Dm=500,ah=2e3;let Nn=0,ru=!1;function Px(n){return _t("/perf-log",{entries:n}).then(()=>{Nn+=n.length})}function Ox(){if(ru||Nn>=Dn.length)return;const n=Dn.slice(Nn,Nn+Dm);n.length!==0&&(ru=!0,Px(n).catch(()=>{Dn.length-Nn>ah&&(Nn=Math.max(Nn,Dn.length-ah))}).finally(()=>{ru=!1}))}function ch(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Nn>=Dn.length)return;const n=Dn.slice(Nn,Nn+Dm);if(n.length!==0)try{const s=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${ps()}/api/perf-log`,s),Nn+=n.length}catch{}}function zx(){let n=0;for(const o of ti.values())n+=o.n;const s=[];if(n>0){const o=[...ti.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Im(u.bytes)})`).join(", ");s.push(`ws ${n}/s [${o}]`)}Jr>0&&s.push(`store ${Jr}/s`);const r=[...ni.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");Wl("stat",o);const a=[...ni.values()].some(u=>u>In.renderPerSecLog);(n>In.wsPerSecLog||Jr>In.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ti=new Map,Jr=0,ni=new Map}function $x(n){if(n instanceof Element){const s=n.id?`#${n.id}`:"",r=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${s}${r}`}return n?"window":"unknown"}function Fx(){if(su||typeof window>"u")return()=>{};su=!0,Fl=Date.now();const n=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>In.lagMs&&(Vu++,Ul=Math.max(Ul,f),ei("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=m=>{const g=m-u;u=m,g>In.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<In.longtaskBufferMs)continue;Gu++,Bl=Math.max(Bl,g);const x=(h=m.attribution)==null?void 0:h[0],k=(x==null?void 0:x.containerName)||(x==null?void 0:x.name)||"unknown",y=`long task ${Math.round(g)}ms (${k})`;g>=In.longtaskLogMs?ei("longtask",y,g):Wl("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;qu++;const x=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${$x(h.target)}`;m>=In.eventLogMs?ei("input",x,m):Wl("input",x,m)}});u.observe({type:"event",durationThreshold:In.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(zx,1e3);n.push(()=>window.clearInterval(o)),Am("perf logger session started");const a=window.setInterval(Ox,Lx);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",ch),n.push(()=>window.removeEventListener("beforeunload",ch)),window.__agentPanePerf={dump:Mm,reset:Lm},()=>{n.forEach(u=>u()),su=!1}}function Mm(){const n=[],s=Fl?Math.round((Date.now()-Fl)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${s}s · ${Dn.length} buffered entries`),n.push(`event-loop lag: ${Vu} blocks >${In.lagMs}ms (max ${Math.round(Ul)}ms)`),n.push(`long tasks: ${Gu} ≥${In.longtaskBufferMs}ms (max ${Math.round(Bl)}ms)`),n.push(`slow input events (≥${In.eventBufferMs}ms): ${qu}`),n.push(`store updates: ${Ku} total`),ro.size>0){n.push("ws messages by type (top 15):");for(const[r,o]of[...ro.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${r}: ${o.n} msgs, ${Im(o.bytes)}`)}if(io.size>0){n.push("render counts by component:");for(const[r,o]of[...io.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${r}: ${o}`)}n.push("--- last 200 entries ---");for(const r of Dn.slice(-200))n.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return n.join(`
|
|
49
|
-
`)}function Lm(){Dn.length=0,Nn=0,Fl=Date.now(),
|
|
48
|
+
`;return n({quotedText:f}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await sa(`/sessions/${r}/threads/${o}`)}catch(a){s().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];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,[r]:{...f,threads:h}}}})},onThreadDeleted:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),yx=(n,s)=>({folders:[],loadFolders:async()=>{const r=await _m();n({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await Ky(r,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return s().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await Xp(r,{name:o});n(u=>({folders:u.folders.map(f=>f.id===r?a:f)}))}catch(a){s().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=s().folders,a=s().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==r),sessions:u.sessions.map(f=>f.folder_id===r?{...f,folder_id:null}:f)}));try{await Xy(r)}catch(u){n({folders:o,sessions:a}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,a=new Map(r.map(u=>[u.id,u]));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 Yy(r)}catch(u){n({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,a=new Map(r.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(r.map((u,f)=>Xp(u,{sort_order:f})))}catch(u){n({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function sh(){return gn("/apps")}function xx(){return gn("/apps/root")}function rh(n){return gn(`/apps/${n}/source`)}function ih(n,s=""){return gn(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`)}function Rm(n,s,r=""){return Ly(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`,s)}function wx(n){return sa(`/apps/${n}`)}function kx(n){return gn(`/apps/${n}/sessions`)}function Sx(){return gn("/apps/examples")}function Tx(n){return _t(`/apps/examples/${n}/install`,{})}function bx(n){return _t("/apps",n)}function Nx(n,s){return _t("/apps/import",{id:n,files:s})}function Cx(n,s,r){return _t(`/apps/mcp/calls/${n}/result`,{result:s,error:null})}function Ex(n,s){return _t(`/apps/${n}/edit-session`,s)}const Dl=new Set;async function tu(n,s){Dl.add(s),await n().loadApps();const r=n().apps.find(o=>o.id===s);n().openAppTab(s),n().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const xu="agentpane:app-workspaces";function _x(){try{const n=JSON.parse(localStorage.getItem(xu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const jx=(n,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:_x(),loadApps:async()=>{try{const[r,o]=await Promise.all([sh(),xx().catch(()=>null)]);r.forEach(a=>Dl.add(a.id)),n(o?{apps:r,appsRootPath:o.root}:{apps:r})}catch{}},refreshApps:async()=>{try{const r=await sh();for(const o of r)Dl.has(o.id)||(Dl.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));n({apps:r})}catch{}},openAppTab:r=>{n(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==r);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===r?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:r=>n({activeAppTabId:r}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{n(a=>{const u={...a.appWorkspaces,[r]:o};try{localStorage.setItem(xu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await Tx(r),await tu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await bx(r),await tu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Nx(r,o),await tu(s,r),!0}catch(a){return s().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,a=await Ex(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await s().selectSession(a.id),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,a.id]})),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(a=>a.id===r);if(o)try{await Rm(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await wx(r),n(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(xu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==r),openAppTabs:o.openAppTabs.filter(u=>u!==r),activeAppTabId:o.activeAppTabId===r?null:o.activeAppTabId,appWorkspaces:a}}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),oh=3e3,In={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Dn=[];let Fl=0,Wu=0,Ul=0,Hu=0,Bl=0,Vu=0,Gu=0;const ro=new Map,io=new Map;let ti=new Map,Jr=0,ni=new Map,nu=!1;function Wl(n,s,r){if(Dn.push({t:Date.now(),cat:n,msg:s,ms:r}),Dn.length>oh){const o=Dn.length-oh;Dn.splice(0,o),Nn=Math.max(0,Nn-o)}}function ei(n,s,r){Wl(n,s,r),console.log(`[perf:${n}] ${s}`)}function Am(n){ei("note",n)}function Im(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Rx(n,s){let r=ti.get(n);r||ti.set(n,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=ro.get(n);o||ro.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Ax(){Jr++,Gu++}function Ix(n){ni.set(n,(ni.get(n)??0)+1),io.set(n,(io.get(n)??0)+1)}let Ml=0;function Dx(){Ml=performance.now()}function Mx(){const n=performance.now(),s=Ml?n-Ml:null;Ml=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-n+s;r>In.keypressMs&&ei("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Lx=5e3,Dm=500,lh=2e3;let Nn=0,su=!1;function Px(n){return _t("/perf-log",{entries:n}).then(()=>{Nn+=n.length})}function Ox(){if(su||Nn>=Dn.length)return;const n=Dn.slice(Nn,Nn+Dm);n.length!==0&&(su=!0,Px(n).catch(()=>{Dn.length-Nn>lh&&(Nn=Math.max(Nn,Dn.length-lh))}).finally(()=>{su=!1}))}function ah(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Nn>=Dn.length)return;const n=Dn.slice(Nn,Nn+Dm);if(n.length!==0)try{const s=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${ps()}/api/perf-log`,s),Nn+=n.length}catch{}}function zx(){let n=0;for(const o of ti.values())n+=o.n;const s=[];if(n>0){const o=[...ti.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Im(u.bytes)})`).join(", ");s.push(`ws ${n}/s [${o}]`)}Jr>0&&s.push(`store ${Jr}/s`);const r=[...ni.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");Wl("stat",o);const a=[...ni.values()].some(u=>u>In.renderPerSecLog);(n>In.wsPerSecLog||Jr>In.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ti=new Map,Jr=0,ni=new Map}function $x(n){if(n instanceof Element){const s=n.id?`#${n.id}`:"",r=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${s}${r}`}return n?"window":"unknown"}function Fx(){if(nu||typeof window>"u")return()=>{};nu=!0,Fl=Date.now();const n=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>In.lagMs&&(Wu++,Ul=Math.max(Ul,f),ei("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=m=>{const g=m-u;u=m,g>In.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<In.longtaskBufferMs)continue;Hu++,Bl=Math.max(Bl,g);const x=(h=m.attribution)==null?void 0:h[0],k=(x==null?void 0:x.containerName)||(x==null?void 0:x.name)||"unknown",y=`long task ${Math.round(g)}ms (${k})`;g>=In.longtaskLogMs?ei("longtask",y,g):Wl("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;Vu++;const x=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${$x(h.target)}`;m>=In.eventLogMs?ei("input",x,m):Wl("input",x,m)}});u.observe({type:"event",durationThreshold:In.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(zx,1e3);n.push(()=>window.clearInterval(o)),Am("perf logger session started");const a=window.setInterval(Ox,Lx);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",ah),n.push(()=>window.removeEventListener("beforeunload",ah)),window.__agentPanePerf={dump:Mm,reset:Lm},()=>{n.forEach(u=>u()),nu=!1}}function Mm(){const n=[],s=Fl?Math.round((Date.now()-Fl)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${s}s · ${Dn.length} buffered entries`),n.push(`event-loop lag: ${Wu} blocks >${In.lagMs}ms (max ${Math.round(Ul)}ms)`),n.push(`long tasks: ${Hu} ≥${In.longtaskBufferMs}ms (max ${Math.round(Bl)}ms)`),n.push(`slow input events (≥${In.eventBufferMs}ms): ${Vu}`),n.push(`store updates: ${Gu} total`),ro.size>0){n.push("ws messages by type (top 15):");for(const[r,o]of[...ro.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${r}: ${o.n} msgs, ${Im(o.bytes)}`)}if(io.size>0){n.push("render counts by component:");for(const[r,o]of[...io.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${r}: ${o}`)}n.push("--- last 200 entries ---");for(const r of Dn.slice(-200))n.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return n.join(`
|
|
49
|
+
`)}function Lm(){Dn.length=0,Nn=0,Fl=Date.now(),Wu=0,Ul=0,Hu=0,Bl=0,Vu=0,Gu=0,ro.clear(),io.clear(),ti=new Map,Jr=0,ni=new Map}const tn={start:Fx,note:Am,trackWsEvent:Rx,trackStoreUpdate:Ax,trackRender:Ix,markKeystroke:Dx,markInputChange:Mx,dump:Mm,reset:Lm},P=Ey()((...n)=>({...Zy(...n),...Jy(...n),...ux(...n),...gx(...n),...vx(...n),...yx(...n),...jx(...n)}));typeof window<"u"&&P.subscribe(()=>tn.trackStoreUpdate());function wu(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 Ux(n,s,r=!1,o="working"){if(o==="finished")return"";if(s)return"running";if(r&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Bx(n,s,r=!1,o="working"){if(o==="finished")return"Finished";if(s)return"Running";if(r&&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 ia(n){const s=n.is_running===1,r=n.lifecycle==="finished",o=wu(n.runtime_type);return{dot:Ux(n.status,s,n.has_unreviewed===1,n.lifecycle),label:Bx(n.status,s,n.has_unreviewed===1,n.lifecycle),iconClass:o.iconClass,iconText:o.iconText,isRunning:s,isFinished:r}}function oa(n,s,r=!0){w.useEffect(()=>{if(!r)return;function o(a){n.current&&!n.current.contains(a.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,s,r])}function qu(n,s=!0){w.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n,s])}function Ku({status:n,size:s=6}){return c.jsx("span",{className:`status-dot ${n}`,style:s!==6?{width:s,height:s}:void 0})}function Xu({iconClass:n,iconText:s,size:r=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
|
|
50
50
|
* @license lucide-react v0.469.0 - ISC
|
|
51
51
|
*
|
|
52
52
|
* This source code is licensed under the ISC license.
|
|
53
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const
|
|
54
|
+
*/const Wx=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pm=(...n)=>n.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
|
|
55
55
|
* @license lucide-react v0.469.0 - ISC
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var
|
|
59
|
+
*/var Hx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
60
60
|
* @license lucide-react v0.469.0 - ISC
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
64
|
+
*/const Vx=w.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},m)=>w.createElement("svg",{ref:m,...Hx,width:s,height:s,stroke:n,strokeWidth:o?Number(r)*24/Number(s):r,className:Pm("lucide",a),...h},[...f.map(([g,x])=>w.createElement(g,x)),...Array.isArray(u)?u:[u]]));/**
|
|
65
65
|
* @license lucide-react v0.469.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const Ne=(n,s)=>{const r=w.forwardRef(({className:o,...a},u)=>w.createElement(
|
|
69
|
+
*/const Ne=(n,s)=>{const r=w.forwardRef(({className:o,...a},u)=>w.createElement(Vx,{ref:u,iconNode:s,className:Pm(`lucide-${Wx(n)}`,o),...a}));return r.displayName=`${n}`,r};/**
|
|
70
70
|
* @license lucide-react v0.469.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const
|
|
74
|
+
*/const Gx=Ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
75
75
|
* @license lucide-react v0.469.0 - ISC
|
|
76
76
|
*
|
|
77
77
|
* This source code is licensed under the ISC license.
|
|
78
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const
|
|
79
|
+
*/const ku=Ne("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
80
|
* @license lucide-react v0.469.0 - ISC
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const
|
|
84
|
+
*/const qx=Ne("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
85
|
* @license lucide-react v0.469.0 - ISC
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
@@ -96,17 +96,17 @@ ${u.summary}
|
|
|
96
96
|
*
|
|
97
97
|
* This source code is licensed under the ISC license.
|
|
98
98
|
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const
|
|
99
|
+
*/const Yu=Ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
100
100
|
* @license lucide-react v0.469.0 - ISC
|
|
101
101
|
*
|
|
102
102
|
* This source code is licensed under the ISC license.
|
|
103
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const
|
|
104
|
+
*/const Qu=Ne("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
105
|
* @license lucide-react v0.469.0 - ISC
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const
|
|
109
|
+
*/const Kx=Ne("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
110
|
* @license lucide-react v0.469.0 - ISC
|
|
111
111
|
*
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
@@ -116,17 +116,17 @@ ${u.summary}
|
|
|
116
116
|
*
|
|
117
117
|
* This source code is licensed under the ISC license.
|
|
118
118
|
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const
|
|
119
|
+
*/const Xx=Ne("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
120
|
* @license lucide-react v0.469.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const
|
|
124
|
+
*/const Yx=Ne("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
125
125
|
* @license lucide-react v0.469.0 - ISC
|
|
126
126
|
*
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const
|
|
129
|
+
*/const Qx=Ne("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
130
|
* @license lucide-react v0.469.0 - ISC
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
@@ -136,32 +136,32 @@ ${u.summary}
|
|
|
136
136
|
*
|
|
137
137
|
* This source code is licensed under the ISC license.
|
|
138
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const
|
|
139
|
+
*/const ch=Ne("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
140
|
* @license lucide-react v0.469.0 - ISC
|
|
141
141
|
*
|
|
142
142
|
* This source code is licensed under the ISC license.
|
|
143
143
|
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const
|
|
144
|
+
*/const Su=Ne("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
145
|
* @license lucide-react v0.469.0 - ISC
|
|
146
146
|
*
|
|
147
147
|
* This source code is licensed under the ISC license.
|
|
148
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const
|
|
149
|
+
*/const Zx=Ne("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
150
150
|
* @license lucide-react v0.469.0 - ISC
|
|
151
151
|
*
|
|
152
152
|
* This source code is licensed under the ISC license.
|
|
153
153
|
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const
|
|
154
|
+
*/const Jx=Ne("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
155
155
|
* @license lucide-react v0.469.0 - ISC
|
|
156
156
|
*
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
158
158
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const
|
|
159
|
+
*/const e0=Ne("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"}]]);/**
|
|
160
160
|
* @license lucide-react v0.469.0 - ISC
|
|
161
161
|
*
|
|
162
162
|
* This source code is licensed under the ISC license.
|
|
163
163
|
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const
|
|
164
|
+
*/const t0=Ne("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
165
165
|
* @license lucide-react v0.469.0 - ISC
|
|
166
166
|
*
|
|
167
167
|
* This source code is licensed under the ISC license.
|
|
@@ -171,42 +171,42 @@ ${u.summary}
|
|
|
171
171
|
*
|
|
172
172
|
* This source code is licensed under the ISC license.
|
|
173
173
|
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const
|
|
174
|
+
*/const ru=Ne("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
175
175
|
* @license lucide-react v0.469.0 - ISC
|
|
176
176
|
*
|
|
177
177
|
* This source code is licensed under the ISC license.
|
|
178
178
|
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const
|
|
179
|
+
*/const Tu=Ne("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
180
180
|
* @license lucide-react v0.469.0 - ISC
|
|
181
181
|
*
|
|
182
182
|
* This source code is licensed under the ISC license.
|
|
183
183
|
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const
|
|
184
|
+
*/const n0=Ne("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
185
185
|
* @license lucide-react v0.469.0 - ISC
|
|
186
186
|
*
|
|
187
187
|
* This source code is licensed under the ISC license.
|
|
188
188
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const
|
|
189
|
+
*/const s0=Ne("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
190
190
|
* @license lucide-react v0.469.0 - ISC
|
|
191
191
|
*
|
|
192
192
|
* This source code is licensed under the ISC license.
|
|
193
193
|
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const
|
|
194
|
+
*/const r0=Ne("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
195
195
|
* @license lucide-react v0.469.0 - ISC
|
|
196
196
|
*
|
|
197
197
|
* This source code is licensed under the ISC license.
|
|
198
198
|
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const
|
|
199
|
+
*/const i0=Ne("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
200
200
|
* @license lucide-react v0.469.0 - ISC
|
|
201
201
|
*
|
|
202
202
|
* This source code is licensed under the ISC license.
|
|
203
203
|
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const
|
|
204
|
+
*/const o0=Ne("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"}]]);/**
|
|
205
205
|
* @license lucide-react v0.469.0 - ISC
|
|
206
206
|
*
|
|
207
207
|
* This source code is licensed under the ISC license.
|
|
208
208
|
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const
|
|
209
|
+
*/const l0=Ne("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"}]]);/**
|
|
210
210
|
* @license lucide-react v0.469.0 - ISC
|
|
211
211
|
*
|
|
212
212
|
* This source code is licensed under the ISC license.
|
|
@@ -216,37 +216,37 @@ ${u.summary}
|
|
|
216
216
|
*
|
|
217
217
|
* This source code is licensed under the ISC license.
|
|
218
218
|
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const
|
|
219
|
+
*/const a0=Ne("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"}]]);/**
|
|
220
220
|
* @license lucide-react v0.469.0 - ISC
|
|
221
221
|
*
|
|
222
222
|
* This source code is licensed under the ISC license.
|
|
223
223
|
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const
|
|
224
|
+
*/const c0=Ne("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"}]]);/**
|
|
225
225
|
* @license lucide-react v0.469.0 - ISC
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const
|
|
229
|
+
*/const u0=Ne("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"}]]);/**
|
|
230
230
|
* @license lucide-react v0.469.0 - ISC
|
|
231
231
|
*
|
|
232
232
|
* This source code is licensed under the ISC license.
|
|
233
233
|
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const
|
|
234
|
+
*/const d0=Ne("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"}]]);/**
|
|
235
235
|
* @license lucide-react v0.469.0 - ISC
|
|
236
236
|
*
|
|
237
237
|
* This source code is licensed under the ISC license.
|
|
238
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const
|
|
239
|
+
*/const uh=Ne("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"}]]);/**
|
|
240
240
|
* @license lucide-react v0.469.0 - ISC
|
|
241
241
|
*
|
|
242
242
|
* This source code is licensed under the ISC license.
|
|
243
243
|
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const
|
|
244
|
+
*/const f0=Ne("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
245
245
|
* @license lucide-react v0.469.0 - ISC
|
|
246
246
|
*
|
|
247
247
|
* This source code is licensed under the ISC license.
|
|
248
248
|
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const
|
|
249
|
+
*/const p0=Ne("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"}]]);/**
|
|
250
250
|
* @license lucide-react v0.469.0 - ISC
|
|
251
251
|
*
|
|
252
252
|
* This source code is licensed under the ISC license.
|
|
@@ -256,12 +256,12 @@ ${u.summary}
|
|
|
256
256
|
*
|
|
257
257
|
* This source code is licensed under the ISC license.
|
|
258
258
|
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const
|
|
259
|
+
*/const h0=Ne("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"}]]);/**
|
|
260
260
|
* @license lucide-react v0.469.0 - ISC
|
|
261
261
|
*
|
|
262
262
|
* This source code is licensed under the ISC license.
|
|
263
263
|
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const
|
|
264
|
+
*/const m0=Ne("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"}]]);/**
|
|
265
265
|
* @license lucide-react v0.469.0 - ISC
|
|
266
266
|
*
|
|
267
267
|
* This source code is licensed under the ISC license.
|
|
@@ -276,7 +276,7 @@ ${u.summary}
|
|
|
276
276
|
*
|
|
277
277
|
* This source code is licensed under the ISC license.
|
|
278
278
|
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const
|
|
279
|
+
*/const g0=Ne("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"}]]);/**
|
|
280
280
|
* @license lucide-react v0.469.0 - ISC
|
|
281
281
|
*
|
|
282
282
|
* This source code is licensed under the ISC license.
|
|
@@ -291,17 +291,17 @@ ${u.summary}
|
|
|
291
291
|
*
|
|
292
292
|
* This source code is licensed under the ISC license.
|
|
293
293
|
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const
|
|
294
|
+
*/const v0=Ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
295
295
|
* @license lucide-react v0.469.0 - ISC
|
|
296
296
|
*
|
|
297
297
|
* This source code is licensed under the ISC license.
|
|
298
298
|
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const
|
|
299
|
+
*/const la=Ne("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"}]]);/**
|
|
300
300
|
* @license lucide-react v0.469.0 - ISC
|
|
301
301
|
*
|
|
302
302
|
* This source code is licensed under the ISC license.
|
|
303
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const
|
|
304
|
+
*/const y0=Ne("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"}]]);/**
|
|
305
305
|
* @license lucide-react v0.469.0 - ISC
|
|
306
306
|
*
|
|
307
307
|
* This source code is licensed under the ISC license.
|
|
@@ -326,27 +326,27 @@ ${u.summary}
|
|
|
326
326
|
*
|
|
327
327
|
* This source code is licensed under the ISC license.
|
|
328
328
|
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const
|
|
329
|
+
*/const x0=Ne("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"}]]);/**
|
|
330
330
|
* @license lucide-react v0.469.0 - ISC
|
|
331
331
|
*
|
|
332
332
|
* This source code is licensed under the ISC license.
|
|
333
333
|
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const
|
|
334
|
+
*/const w0=Ne("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"}]]);/**
|
|
335
335
|
* @license lucide-react v0.469.0 - ISC
|
|
336
336
|
*
|
|
337
337
|
* This source code is licensed under the ISC license.
|
|
338
338
|
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const
|
|
339
|
+
*/const k0=Ne("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"}]]);/**
|
|
340
340
|
* @license lucide-react v0.469.0 - ISC
|
|
341
341
|
*
|
|
342
342
|
* This source code is licensed under the ISC license.
|
|
343
343
|
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const
|
|
344
|
+
*/const S0=Ne("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"}]]);/**
|
|
345
345
|
* @license lucide-react v0.469.0 - ISC
|
|
346
346
|
*
|
|
347
347
|
* This source code is licensed under the ISC license.
|
|
348
348
|
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const
|
|
349
|
+
*/const T0=Ne("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"}]]);/**
|
|
350
350
|
* @license lucide-react v0.469.0 - ISC
|
|
351
351
|
*
|
|
352
352
|
* This source code is licensed under the ISC license.
|
|
@@ -356,36 +356,36 @@ ${u.summary}
|
|
|
356
356
|
*
|
|
357
357
|
* This source code is licensed under the ISC license.
|
|
358
358
|
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const
|
|
359
|
+
*/const b0=Ne("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 Yi=ym();function N0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return w.useMemo(()=>o=>{s.forEach(a=>a(o))},s)}const aa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ai(n){const s=Object.prototype.toString.call(n);return s==="[object Window]"||s==="[object global]"}function Zu(n){return"nodeType"in n}function vn(n){var s,r;return n?ai(n)?n:Zu(n)&&(s=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Ju(n){const{Document:s}=vn(n);return n instanceof s}function uo(n){return ai(n)?!1:n instanceof vn(n).HTMLElement}function Bm(n){return n instanceof vn(n).SVGElement}function ci(n){return n?ai(n)?n.document:Zu(n)?Ju(n)?n:uo(n)||Bm(n)?n.ownerDocument:document:document:document}const ss=aa?w.useLayoutEffect:w.useEffect;function ca(n){const s=w.useRef(n);return ss(()=>{s.current=n}),w.useCallback(function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return s.current==null?void 0:s.current(...o)},[])}function C0(){const n=w.useRef(null),s=w.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),r=w.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[s,r]}function lo(n,s){s===void 0&&(s=[n]);const r=w.useRef(n);return ss(()=>{r.current!==n&&(r.current=n)},s),r}function fo(n,s){const r=w.useRef();return w.useMemo(()=>{const o=n(r.current);return r.current=o,o},[...s])}function Gl(n){const s=ca(n),r=w.useRef(null),o=w.useCallback(a=>{a!==r.current&&(s==null||s(a,r.current)),r.current=a},[]);return[r,o]}function ql(n){const s=w.useRef();return w.useEffect(()=>{s.current=n},[n]),s.current}let iu={};function po(n,s){return w.useMemo(()=>{if(s)return s;const r=iu[n]==null?0:iu[n]+1;return iu[n]=r,n+"-"+r},[n,s])}function Wm(n){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const h=Object.entries(f);for(const[m,g]of h){const x=u[m];x!=null&&(u[m]=x+n*g)}return u},{...s})}}const ri=Wm(1),Kl=Wm(-1);function E0(n){return"clientX"in n&&"clientY"in n}function ua(n){if(!n)return!1;const{KeyboardEvent:s}=vn(n.target);return s&&n instanceof s}function _0(n){if(!n)return!1;const{TouchEvent:s}=vn(n.target);return s&&n instanceof s}function Xl(n){if(_0(n)){if(n.touches&&n.touches.length){const{clientX:s,clientY:r}=n.touches[0];return{x:s,y:r}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:s,clientY:r}=n.changedTouches[0];return{x:s,y:r}}}return E0(n)?{x:n.clientX,y:n.clientY}:null}const js=Object.freeze({Translate:{toString(n){if(!n)return;const{x:s,y:r}=n;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:s,scaleY:r}=n;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[js.Translate.toString(n),js.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:s,duration:r,easing:o}=n;return s+" "+r+"ms "+o}}}),dh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function j0(n){return n.matches(dh)?n:n.querySelector(dh)}const R0={display:"none"};function A0(n){let{id:s,value:r}=n;return at.createElement("div",{id:s,style:R0},r)}function I0(n){let{id:s,announcement:r,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 at.createElement("div",{id:s,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function D0(){const[n,s]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&s(o)},[]),announcement:n}}const Hm=w.createContext(null);function M0(n){const s=w.useContext(Hm);w.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(n)},[n,s])}function L0(){const[n]=w.useState(()=>new Set),s=w.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[w.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[n]),s]}const P0={draggable:`
|
|
360
360
|
To pick up a draggable item, press the space bar.
|
|
361
361
|
While dragging, use the arrow keys to move the item.
|
|
362
362
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
363
|
-
`},z0={onDragStart(n){let{active:s}=n;return"Picked up draggable item "+s.id+"."},onDragOver(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(n){let{active:s}=n;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function $0(n){let{announcements:s=z0,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=O0}=n;const{announce:u,announcement:f}=M0(),h=po("DndLiveRegion"),[m,g]=w.useState(!1);if(w.useEffect(()=>{g(!0)},[]),L0(w.useMemo(()=>({onDragStart(k){let{active:y}=k;u(s.onDragStart({active:y}))},onDragMove(k){let{active:y,over:E}=k;s.onDragMove&&u(s.onDragMove({active:y,over:E}))},onDragOver(k){let{active:y,over:E}=k;u(s.onDragOver({active:y,over:E}))},onDragEnd(k){let{active:y,over:E}=k;u(s.onDragEnd({active:y,over:E}))},onDragCancel(k){let{active:y,over:E}=k;u(s.onDragCancel({active:y,over:E}))}}),[u,s])),!m)return null;const x=at.createElement(at.Fragment,null,at.createElement(I0,{id:o,value:a.draggable}),at.createElement(D0,{id:h,announcement:f}));return r?Yi.createPortal(x,r):x}var Bt;(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"})(Bt||(Bt={}));function Yl(){}function F0(n,s){return w.useMemo(()=>({sensor:n,options:s??{}}),[n,s])}function U0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return w.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const rs=Object.freeze({x:0,y:0});function B0(n,s){return Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2))}function W0(n,s){const r=Xl(n);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function H0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return r-o}function V0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return o-r}function G0(n,s){if(!n||n.length===0)return null;const[r]=n;return r[s]}function ph(n,s,r){return s===void 0&&(s=n.left),r===void 0&&(r=n.top),{x:s+n.width*.5,y:r+n.height*.5}}const q0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=ph(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,m=r.get(h);if(m){const g=B0(ph(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(H0)};function K0(n,s){const r=Math.max(s.top,n.top),o=Math.max(s.left,n.left),a=Math.min(s.left+s.width,n.left+n.width),u=Math.min(s.top+s.height,n.top+n.height),f=a-o,h=u-r;if(o<a&&r<u){const m=s.width*s.height,g=n.width*n.height,x=f*h,k=x/(m+g-x);return Number(k.toFixed(4))}return 0}const X0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=r.get(f);if(h){const m=K0(h,s);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(V0)};function Y0(n,s,r){return{...n,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function Vm(n,s){return n&&s?{x:n.left-s.left,y:n.top-s.top}:rs}function Q0(n){return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];return a.reduce((f,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...r})}}const Z0=Q0(1);function Gm(n){if(n.startsWith("matrix3d(")){const s=n.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(n.startsWith("matrix(")){const s=n.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function J0(n,s,r){const o=Gm(s);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(r),g=n.top-h-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),x=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:x,height:k,top:g,right:m+x,bottom:g+k,left:m}}const ew={ignoreTransform:!1};function ui(n,s){s===void 0&&(s=ew);let r=n.getBoundingClientRect();if(s.ignoreTransform){const{transform:g,transformOrigin:x}=vn(n).getComputedStyle(n);g&&(r=J0(r,g,x))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function hh(n){return ui(n,{ignoreTransform:!0})}function tw(n){const s=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function nw(n,s){return s===void 0&&(s=vn(n).getComputedStyle(n)),s.position==="fixed"}function sw(n,s){s===void 0&&(s=vn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=s[a];return typeof u=="string"?r.test(u):!1})}function td(n,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(ed(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!uo(a)||Bm(a)||r.includes(a))return r;const u=vn(n).getComputedStyle(a);return a!==n&&sw(a,u)&&r.push(a),nw(a,u)?r:o(a.parentNode)}return n?o(n):r}function qm(n){const[s]=td(n,1);return s??null}function lu(n){return!ca||!n?null:ai(n)?n:Ju(n)?ed(n)||n===ci(n).scrollingElement?window:uo(n)?n:null:null}function Km(n){return ai(n)?n.scrollX:n.scrollLeft}function Xm(n){return ai(n)?n.scrollY:n.scrollTop}function Nu(n){return{x:Km(n),y:Xm(n)}}var Xt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Xt||(Xt={}));function Ym(n){return!ca||!n?!1:n===document.scrollingElement}function Qm(n){const s={x:0,y:0},r=Ym(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},a=n.scrollTop<=s.y,u=n.scrollLeft<=s.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:s}}const rw={x:.2,y:.2};function iw(n,s,r,o,a){let{top:u,left:f,right:h,bottom:m}=r;o===void 0&&(o=10),a===void 0&&(a=rw);const{isTop:g,isBottom:x,isLeft:k,isRight:y}=Qm(n),E={x:0,y:0},_={x:0,y:0},C={height:s.height*a.y,width:s.width*a.x};return!g&&u<=s.top+C.height?(E.y=Xt.Backward,_.y=o*Math.abs((s.top+C.height-u)/C.height)):!x&&m>=s.bottom-C.height&&(E.y=Xt.Forward,_.y=o*Math.abs((s.bottom-C.height-m)/C.height)),!y&&h>=s.right-C.width?(E.x=Xt.Forward,_.x=o*Math.abs((s.right-C.width-h)/C.width)):!k&&f<=s.left+C.width&&(E.x=Xt.Backward,_.x=o*Math.abs((s.left+C.width-f)/C.width)),{direction:E,speed:_}}function ow(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:s,left:r,right:o,bottom:a}=n.getBoundingClientRect();return{top:s,left:r,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function Zm(n){return n.reduce((s,r)=>ri(s,Nu(r)),rs)}function lw(n){return n.reduce((s,r)=>s+Km(r),0)}function aw(n){return n.reduce((s,r)=>s+Xm(r),0)}function Jm(n,s){if(s===void 0&&(s=ui),!n)return;const{top:r,left:o,bottom:a,right:u}=s(n);qm(n)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const cw=[["x",["left","right"],lw],["y",["top","bottom"],aw]];class nd{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=td(r),a=Zm(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of cw)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 Zi{constructor(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var a;(a=this.target)==null||a.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function uw(n){const{EventTarget:s}=vn(n);return n instanceof s?n:ci(n)}function au(n,s){const r=Math.abs(n.x),o=Math.abs(n.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var Hn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Hn||(Hn={}));function mh(n){n.preventDefault()}function dw(n){n.stopPropagation()}var it;(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"})(it||(it={}));const eg={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},fw=(n,s)=>{let{currentCoordinates:r}=s;switch(n.code){case it.Right:return{...r,x:r.x+25};case it.Left:return{...r,x:r.x-25};case it.Down:return{...r,y:r.y+25};case it.Up:return{...r,y:r.y-25}}};class tg{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new Zi(ci(r)),this.windowListeners=new Zi(vn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Hn.Resize,this.handleCancel),this.windowListeners.add(Hn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Hn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&Jm(o),r(rs)}handleKeyDown(s){if(da(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=eg,coordinateGetter:f=fw,scrollBehavior:h="smooth"}=a,{code:m}=s;if(u.end.includes(m)){this.handleEnd(s);return}if(u.cancel.includes(m)){this.handleCancel(s);return}const{collisionRect:g}=o.current,x=g?{x:g.left,y:g.top}:rs;this.referenceCoordinates||(this.referenceCoordinates=x);const k=f(s,{active:r,context:o.current,currentCoordinates:x});if(k){const y=Kl(k,x),E={x:0,y:0},{scrollableAncestors:_}=o.current;for(const C of _){const T=s.code,{isTop:L,isRight:A,isLeft:B,isBottom:M,maxScroll:W,minScroll:q}=Qm(C),K=ow(C),G={x:Math.min(T===it.Right?K.right-K.width/2:K.right,Math.max(T===it.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(T===it.Down?K.bottom-K.height/2:K.bottom,Math.max(T===it.Down?K.top:K.top+K.height/2,k.y))},oe=T===it.Right&&!A||T===it.Left&&!B,ue=T===it.Down&&!M||T===it.Up&&!L;if(oe&&G.x!==k.x){const ie=C.scrollLeft+y.x,we=T===it.Right&&ie<=W.x||T===it.Left&&ie>=q.x;if(we&&!y.y){C.scrollTo({left:ie,behavior:h});return}we?E.x=C.scrollLeft-ie:E.x=T===it.Right?C.scrollLeft-W.x:C.scrollLeft-q.x,E.x&&C.scrollBy({left:-E.x,behavior:h});break}else if(ue&&G.y!==k.y){const ie=C.scrollTop+y.y,we=T===it.Down&&ie<=W.y||T===it.Up&&ie>=q.y;if(we&&!y.x){C.scrollTo({top:ie,behavior:h});return}we?E.y=C.scrollTop-ie:E.y=T===it.Down?C.scrollTop-W.y:C.scrollTop-q.y,E.y&&C.scrollBy({top:-E.y,behavior:h});break}}this.handleMove(s,ri(Kl(k,this.referenceCoordinates),E))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tg.activators=[{eventName:"onKeyDown",handler:(n,s,r)=>{let{keyboardCodes:o=eg,onActivation:a}=s,{active:u}=r;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 gh(n){return!!(n&&"distance"in n)}function vh(n){return!!(n&&"delay"in n)}class sd{constructor(s,r,o){var a;o===void 0&&(o=uw(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:f}=u;this.props=s,this.events=r,this.document=ci(f),this.documentListeners=new Zi(this.document),this.listeners=new Zi(o),this.windowListeners=new Zi(vn(f)),this.initialCoordinates=(a=Xl(u))!=null?a:rs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(Hn.Resize,this.handleCancel),this.windowListeners.add(Hn.DragStart,mh),this.windowListeners.add(Hn.VisibilityChange,this.handleCancel),this.windowListeners.add(Hn.ContextMenu,mh),this.documentListeners.add(Hn.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(vh(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(gh(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:a}=this.props;a(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(Hn.Click,dw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Hn.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(r=Xl(s))!=null?r:rs,g=Kl(a,m);if(!o&&h){if(gh(h)){if(h.tolerance!=null&&au(g,h.tolerance))return this.handleCancel();if(au(g,h.distance))return this.handleStart()}if(vh(h)&&au(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}s.cancelable&&s.preventDefault(),f(m)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===it.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const pw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rd extends sd{constructor(s){const{event:r}=s,o=ci(r.target);super(s,pw,o)}}rd.activators=[{eventName:"onPointerDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const hw={move:{name:"mousemove"},end:{name:"mouseup"}};var Cu;(function(n){n[n.RightClick=2]="RightClick"})(Cu||(Cu={}));class mw extends sd{constructor(s){super(s,hw,ci(s.event.target))}}mw.activators=[{eventName:"onMouseDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return r.button===Cu.RightClick?!1:(o==null||o({event:r}),!0)}}];const cu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gw extends sd{constructor(s){super(s,cu)}static setup(){return window.addEventListener(cu.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(cu.move.name,s)};function s(){}}}gw.activators=[{eventName:"onTouchStart",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;const{touches:a}=r;return a.length>1?!1:(o==null||o({event:r}),!0)}}];var Ji;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Ji||(Ji={}));var Ql;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ql||(Ql={}));function vw(n){let{acceleration:s,activator:r=Ji.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=Ql.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:x,delta:k,threshold:y}=n;const E=xw({delta:k,disabled:!u}),[_,C]=E0(),T=w.useRef({x:0,y:0}),L=w.useRef({x:0,y:0}),A=w.useMemo(()=>{switch(r){case Ji.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case Ji.DraggableRect:return a}},[r,a,m]),B=w.useRef(null),M=w.useCallback(()=>{const q=B.current;if(!q)return;const K=T.current.x*L.current.x,G=T.current.y*L.current.y;q.scrollBy(K,G)},[]),W=w.useMemo(()=>h===Ql.TreeOrder?[...g].reverse():g,[h,g]);w.useEffect(()=>{if(!u||!g.length||!A){C();return}for(const q of W){if((o==null?void 0:o(q))===!1)continue;const K=g.indexOf(q),G=x[K];if(!G)continue;const{direction:oe,speed:ue}=iw(q,G,A,s,y);for(const ie of["x","y"])E[ie][oe[ie]]||(ue[ie]=0,oe[ie]=0);if(ue.x>0||ue.y>0){C(),B.current=q,_(M,f),T.current=ue,L.current=oe;return}}T.current={x:0,y:0},L.current={x:0,y:0},C()},[s,M,o,C,u,f,JSON.stringify(A),JSON.stringify(E),_,g,W,x,JSON.stringify(y)])}const yw={x:{[Xt.Backward]:!1,[Xt.Forward]:!1},y:{[Xt.Backward]:!1,[Xt.Forward]:!1}};function xw(n){let{delta:s,disabled:r}=n;const o=ql(s);return fo(a=>{if(r||!o||!a)return yw;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Xt.Backward]:a.x[Xt.Backward]||u.x===-1,[Xt.Forward]:a.x[Xt.Forward]||u.x===1},y:{[Xt.Backward]:a.y[Xt.Backward]||u.y===-1,[Xt.Forward]:a.y[Xt.Forward]||u.y===1}}},[r,s,o])}function ww(n,s){const r=s!=null?n.get(s):void 0,o=r?r.node.current:null;return fo(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function kw(n,s){return w.useMemo(()=>n.reduce((r,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:s(f.handler,o)}));return[...r,...u]},[]),[n,s])}var ao;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ao||(ao={}));var Eu;(function(n){n.Optimized="optimized"})(Eu||(Eu={}));const yh=new Map;function Sw(n,s){let{dragging:r,dependencies:o,config:a}=s;const[u,f]=w.useState(null),{frequency:h,measure:m,strategy:g}=a,x=w.useRef(n),k=T(),y=lo(k),E=w.useCallback(function(L){L===void 0&&(L=[]),!y.current&&f(A=>A===null?L:A.concat(L.filter(B=>!A.includes(B))))},[y]),_=w.useRef(null),C=fo(L=>{if(k&&!r)return yh;if(!L||L===yh||x.current!==n||u!=null){const A=new Map;for(let B of n){if(!B)continue;if(u&&u.length>0&&!u.includes(B.id)&&B.rect.current){A.set(B.id,B.rect.current);continue}const M=B.node.current,W=M?new nd(m(M),M):null;B.rect.current=W,W&&A.set(B.id,W)}return A}return L},[n,u,r,k,m]);return w.useEffect(()=>{x.current=n},[n]),w.useEffect(()=>{k||E()},[r,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||_.current!==null||(_.current=setTimeout(()=>{E(),_.current=null},h))},[h,k,E,...o]),{droppableRects:C,measureDroppableContainers:E,measuringScheduled:u!=null};function T(){switch(g){case ao.Always:return!1;case ao.BeforeDragging:return r;default:return!r}}}function id(n,s){return fo(r=>n?r||(typeof s=="function"?s(n):n):null,[s,n])}function Tw(n,s){return id(n,s)}function bw(n){let{callback:s,disabled:r}=n;const o=ua(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function fa(n){let{callback:s,disabled:r}=n;const o=ua(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Nw(n){return new nd(ui(n),n)}function xh(n,s,r){s===void 0&&(s=Nw);const[o,a]=w.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??r)!=null?g:null}const x=s(n);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const f=bw({callback(m){if(n)for(const g of m){const{type:x,target:k}=g;if(x==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=fa({callback:u});return ss(()=>{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 Cw(n){const s=id(n);return Vm(n,s)}const wh=[];function Ew(n){const s=w.useRef(n),r=fo(o=>n?o&&o!==wh&&n&&s.current&&n.parentNode===s.current.parentNode?o:td(n):wh,[n]);return w.useEffect(()=>{s.current=n},[n]),r}function _w(n){const[s,r]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=lu(u.target);f&&r(h=>h?(h.set(f,Nu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=lu(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,Nu(g)]):null}).filter(m=>m!=null);r(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=lu(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?s?Array.from(s.values()).reduce((u,f)=>ri(u,f),rs):Zm(n):rs,[n,s])}function kh(n,s){s===void 0&&(s=[]);const r=w.useRef(null);return w.useEffect(()=>{r.current=null},s),w.useEffect(()=>{const o=n!==rs;o&&!r.current&&(r.current=n),!o&&r.current&&(r.current=null)},[n]),r.current?Kl(n,r.current):rs}function jw(n){w.useEffect(()=>{if(!ca)return;const s=n.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},n.map(s=>{let{sensor:r}=s;return r}))}function Rw(n,s){return w.useMemo(()=>n.reduce((r,o)=>{let{eventName:a,handler:u}=o;return r[a]=f=>{u(f,s)},r},{}),[n,s])}function ng(n){return w.useMemo(()=>n?tw(n):null,[n])}const Sh=[];function Aw(n,s){s===void 0&&(s=ui);const[r]=n,o=ng(r?vn(r):null),[a,u]=w.useState(Sh);function f(){u(()=>n.length?n.map(m=>Ym(m)?o:new nd(s(m),m)):Sh)}const h=fa({callback:f});return ss(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function sg(n){if(!n)return null;if(n.children.length>1)return n;const s=n.children[0];return uo(s)?s:n}function Iw(n){let{measure:s}=n;const[r,o]=w.useState(null),a=w.useCallback(g=>{for(const{target:x}of g)if(uo(x)){o(k=>{const y=s(x);return k?{...k,width:y.width,height:y.height}:y});break}},[s]),u=fa({callback:a}),f=w.useCallback(g=>{const x=sg(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?s(x):null)},[s,u]),[h,m]=Gl(f);return w.useMemo(()=>({nodeRef:h,rect:r,setRef:m}),[r,h,m])}const Dw=[{sensor:rd,options:{}},{sensor:tg,options:{}}],Mw={current:{}},Pl={draggable:{measure:hh},droppable:{measure:hh,strategy:ao.WhileDragging,frequency:Eu.Optimized},dragOverlay:{measure:ui}};class eo extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const Lw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new eo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Pl,measureDroppableContainers:Yl,windowRect:null,measuringScheduled:!1},rg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Yl,draggableNodes:new Map,over:null,measureDroppableContainers:Yl},ho=w.createContext(rg),ig=w.createContext(Lw);function Pw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eo}}}function Ow(n,s){switch(s.type){case Bt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Bt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:s.coordinates.x-n.draggable.initialCoordinates.x,y:s.coordinates.y-n.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new eo(n.droppable.containers);return a.set(o,r),{...n,droppable:{...n.droppable,containers:a}}}case Bt.SetDroppableDisabled:{const{id:r,key:o,disabled:a}=s,u=n.droppable.containers.get(r);if(!u||o!==u.key)return n;const f=new eo(n.droppable.containers);return f.set(r,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Bt.UnregisterDroppable:{const{id:r,key:o}=s,a=n.droppable.containers.get(r);if(!a||o!==a.key)return n;const u=new eo(n.droppable.containers);return u.delete(r),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function zw(n){let{disabled:s}=n;const{active:r,activatorEvent:o,draggableNodes:a}=w.useContext(ho),u=ql(o),f=ql(r==null?void 0:r.id);return w.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!da(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 k=R0(x);if(k){k.focus();break}}})}},[o,s,a,f,u]),null}function og(n,s){let{transform:r,...o}=s;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),r):r}function $w(n){return w.useMemo(()=>({draggable:{...Pl.draggable,...n==null?void 0:n.draggable},droppable:{...Pl.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Pl.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 Fw(n){let{activeNode:s,measure:r,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;ss(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const g=s==null?void 0:s.node.current;if(!g||g.isConnected===!1)return;const x=r(g),k=Vm(x,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=qm(g);y&&y.scrollBy({top:k.y,left:k.x})}},[s,f,h,o,r])}const pa=w.createContext({...rs,scaleX:1,scaleY:1});var Ys;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Ys||(Ys={}));const Uw=w.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:x=Dw,collisionDetection:k=X0,measuring:y,modifiers:E,..._}=s;const C=w.useReducer(Ow,void 0,Pw),[T,L]=C,[A,B]=P0(),[M,W]=w.useState(Ys.Uninitialized),q=M===Ys.Initialized,{draggable:{active:K,nodes:G,translate:oe},droppable:{containers:ue}}=T,ie=K!=null?G.get(K):null,we=w.useRef({initial:null,translated:null}),Ce=w.useMemo(()=>{var ke;return K!=null?{id:K,data:(ke=ie==null?void 0:ie.data)!=null?ke:Mw,rect:we}:null},[K,ie]),Fe=w.useRef(null),[Q,ne]=w.useState(null),[ae,O]=w.useState(null),J=lo(_,Object.values(_)),H=po("DndDescribedBy",f),b=w.useMemo(()=>ue.getEnabled(),[ue]),R=$w(y),{droppableRects:te,measureDroppableContainers:ce,measuringScheduled:ge}=Sw(b,{dragging:q,dependencies:[oe.x,oe.y],config:R.droppable}),ye=ww(G,K),Oe=w.useMemo(()=>ae?Xl(ae):null,[ae]),Re=xe(),je=Tw(ye,R.draggable.measure);Fw({activeNode:K!=null?G.get(K):null,config:Re.layoutShiftCompensation,initialRect:je,measure:R.draggable.measure});const be=xh(ye,R.draggable.measure,je),mt=xh(ye?ye.parentElement:null),Me=w.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:G,draggingNode:null,draggingNodeRect:null,droppableContainers:ue,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),jt=ue.getNodeFor((r=Me.current.over)==null?void 0:r.id),ze=Iw({measure:R.dragOverlay.measure}),zt=(o=ze.nodeRef.current)!=null?o:ye,We=q?(a=ze.rect)!=null?a:be:null,Wt=!!(ze.nodeRef.current&&ze.rect),Rt=Cw(Wt?null:be),gt=ng(zt?vn(zt):null),At=Ew(q?jt??ye:null),$t=Aw(At),V=og(E,{transform:{x:oe.x-Rt.x,y:oe.y-Rt.y,scaleX:1,scaleY:1},activatorEvent:ae,active:Ce,activeNodeRect:be,containerNodeRect:mt,draggingNodeRect:We,over:Me.current.over,overlayNodeRect:ze.rect,scrollableAncestors:At,scrollableAncestorRects:$t,windowRect:gt}),he=Oe?ri(Oe,oe):null,Ue=_w(At),Ze=kh(Ue),vt=kh(Ue,[be]),yt=ri(V,Ze),dt=We?Z0(We,V):null,Yt=Ce&&dt?k({active:Ce,collisionRect:dt,droppableRects:te,droppableContainers:b,pointerCoordinates:he}):null,sn=G0(Yt,"id"),[xt,un]=w.useState(null),yn=Wt?V:ri(V,vt),Gn=Y0(yn,(u=xt==null?void 0:xt.rect)!=null?u:null,be),Mn=w.useRef(null),Ln=w.useCallback((ke,Le)=>{let{sensor:Se,options:Ve}=Le;if(Fe.current==null)return;const ot=G.get(Fe.current);if(!ot)return;const tt=ke.nativeEvent,nt=new Se({active:Fe.current,activeNode:ot,event:tt,options:Ve,context:Me,onAbort(st){if(!G.get(st))return;const{onDragAbort:kt}=J.current,Be={id:st};kt==null||kt(Be),A({type:"onDragAbort",event:Be})},onPending(st,wt,kt,Be){if(!G.get(st))return;const{onDragPending:Lt}=J.current,Qt={id:st,constraint:wt,initialCoordinates:kt,offset:Be};Lt==null||Lt(Qt),A({type:"onDragPending",event:Qt})},onStart(st){const wt=Fe.current;if(wt==null)return;const kt=G.get(wt);if(!kt)return;const{onDragStart:Be}=J.current,Ke={activatorEvent:tt,active:{id:wt,data:kt.data,rect:we}};Yi.unstable_batchedUpdates(()=>{Be==null||Be(Ke),W(Ys.Initializing),L({type:Bt.DragStart,initialCoordinates:st,active:wt}),A({type:"onDragStart",event:Ke}),ne(Mn.current),O(tt)})},onMove(st){L({type:Bt.DragMove,coordinates:st})},onEnd:It(Bt.DragEnd),onCancel:It(Bt.DragCancel)});Mn.current=nt;function It(st){return async function(){const{active:kt,collisions:Be,over:Ke,scrollAdjustedTranslate:Lt}=Me.current;let Qt=null;if(kt&&Lt){const{cancelDrop:qn}=J.current;Qt={activatorEvent:tt,active:kt,collisions:Be,delta:Lt,over:Ke},st===Bt.DragEnd&&typeof qn=="function"&&await Promise.resolve(qn(Qt))&&(st=Bt.DragCancel)}Fe.current=null,Yi.unstable_batchedUpdates(()=>{L({type:st}),W(Ys.Uninitialized),un(null),ne(null),O(null),Mn.current=null;const qn=st===Bt.DragEnd?"onDragEnd":"onDragCancel";if(Qt){const Kn=J.current[qn];Kn==null||Kn(Qt),A({type:qn,event:Qt})}})}}},[G]),Pn=w.useCallback((ke,Le)=>(Se,Ve)=>{const ot=Se.nativeEvent,tt=G.get(Ve);if(Fe.current!==null||!tt||ot.dndKit||ot.defaultPrevented)return;const nt={active:tt};ke(Se,Le.options,nt)===!0&&(ot.dndKit={capturedBy:Le.sensor},Fe.current=Ve,Ln(Se,Le))},[G,Ln]),D=kw(x,Pn);jw(x),ss(()=>{be&&M===Ys.Initializing&&W(Ys.Initialized)},[be,M]),w.useEffect(()=>{const{onDragMove:ke}=J.current,{active:Le,activatorEvent:Se,collisions:Ve,over:ot}=Me.current;if(!Le||!Se)return;const tt={active:Le,activatorEvent:Se,collisions:Ve,delta:{x:yt.x,y:yt.y},over:ot};Yi.unstable_batchedUpdates(()=>{ke==null||ke(tt),A({type:"onDragMove",event:tt})})},[yt.x,yt.y]),w.useEffect(()=>{const{active:ke,activatorEvent:Le,collisions:Se,droppableContainers:Ve,scrollAdjustedTranslate:ot}=Me.current;if(!ke||Fe.current==null||!Le||!ot)return;const{onDragOver:tt}=J.current,nt=Ve.get(sn),It=nt&&nt.rect.current?{id:nt.id,rect:nt.rect.current,data:nt.data,disabled:nt.disabled}:null,st={active:ke,activatorEvent:Le,collisions:Se,delta:{x:ot.x,y:ot.y},over:It};Yi.unstable_batchedUpdates(()=>{un(It),tt==null||tt(st),A({type:"onDragOver",event:st})})},[sn]),ss(()=>{Me.current={activatorEvent:ae,active:Ce,activeNode:ye,collisionRect:dt,collisions:Yt,droppableRects:te,draggableNodes:G,draggingNode:zt,draggingNodeRect:We,droppableContainers:ue,over:xt,scrollableAncestors:At,scrollAdjustedTranslate:yt},we.current={initial:We,translated:dt}},[Ce,ye,Yt,dt,G,zt,We,te,ue,xt,At,yt]),vw({...Re,delta:oe,draggingRect:dt,pointerCoordinates:he,scrollableAncestors:At,scrollableAncestorRects:$t});const _e=w.useMemo(()=>({active:Ce,activeNode:ye,activeNodeRect:be,activatorEvent:ae,collisions:Yt,containerNodeRect:mt,dragOverlay:ze,draggableNodes:G,droppableContainers:ue,droppableRects:te,over:xt,measureDroppableContainers:ce,scrollableAncestors:At,scrollableAncestorRects:$t,measuringConfiguration:R,measuringScheduled:ge,windowRect:gt}),[Ce,ye,be,ae,Yt,mt,ze,G,ue,te,xt,ce,At,$t,R,ge,gt]),le=w.useMemo(()=>({activatorEvent:ae,activators:D,active:Ce,activeNodeRect:be,ariaDescribedById:{draggable:H},dispatch:L,draggableNodes:G,over:xt,measureDroppableContainers:ce}),[ae,D,Ce,be,L,H,G,xt,ce]);return at.createElement(Hm.Provider,{value:B},at.createElement(ho.Provider,{value:le},at.createElement(ig.Provider,{value:_e},at.createElement(pa.Provider,{value:Gn},g)),at.createElement(zw,{disabled:(h==null?void 0:h.restoreFocus)===!1})),at.createElement($0,{...h,hiddenTextDescribedById:H}));function xe(){const ke=(Q==null?void 0:Q.autoScrollEnabled)===!1,Le=typeof m=="object"?m.enabled===!1:m===!1,Se=q&&!ke&&!Le;return typeof m=="object"?{...m,enabled:Se}:{enabled:Se}}}),Bw=w.createContext(null),Th="button",Ww="Draggable";function Hw(n){let{id:s,data:r,disabled:o=!1,attributes:a}=n;const u=po(Ww),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:x,draggableNodes:k,over:y}=w.useContext(ho),{role:E=Th,roleDescription:_="draggable",tabIndex:C=0}=a??{},T=(m==null?void 0:m.id)===s,L=w.useContext(T?pa:Bw),[A,B]=Gl(),[M,W]=Gl(),q=Rw(f,s),K=lo(r);ss(()=>(k.set(s,{id:s,key:u,node:A,activatorNode:M,data:K}),()=>{const oe=k.get(s);oe&&oe.key===u&&k.delete(s)}),[k,s]);const G=w.useMemo(()=>({role:E,tabIndex:C,"aria-disabled":o,"aria-pressed":T&&E===Th?!0:void 0,"aria-roledescription":_,"aria-describedby":x.draggable}),[o,E,C,T,_,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:G,isDragging:T,listeners:o?void 0:q,node:A,over:y,setNodeRef:B,setActivatorNodeRef:W,transform:L}}function lg(){return w.useContext(ig)}const Vw="Droppable",Gw={timeout:25};function ag(n){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=n;const u=po(Vw),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=w.useContext(ho),x=w.useRef({disabled:r}),k=w.useRef(!1),y=w.useRef(null),E=w.useRef(null),{disabled:_,updateMeasurementsFor:C,timeout:T}={...Gw,...a},L=lo(C??o),A=w.useCallback(()=>{if(!k.current){k.current=!0;return}E.current!=null&&clearTimeout(E.current),E.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),E.current=null},T)},[T]),B=fa({callback:A,disabled:_||!f}),M=w.useCallback((G,oe)=>{B&&(oe&&(B.unobserve(oe),k.current=!1),G&&B.observe(G))},[B]),[W,q]=Gl(M),K=lo(s);return w.useEffect(()=>{!B||!W.current||(B.disconnect(),k.current=!1,B.observe(W.current))},[W,B]),w.useEffect(()=>(h({type:Bt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:W,rect:y,data:K}}),()=>h({type:Bt.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{r!==x.current.disabled&&(h({type:Bt.SetDroppableDisabled,id:o,key:u,disabled:r}),x.current.disabled=r)},[o,u,r,h]),{active:f,rect:y,isOver:(m==null?void 0:m.id)===o,node:W,over:m,setNodeRef:q}}function qw(n){let{animation:s,children:r}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=ql(r);return!r&&!o&&h&&a(h),ss(()=>{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(s(g,u)).then(()=>{a(null)})},[s,o,u]),at.createElement(at.Fragment,null,r,o?w.cloneElement(o,{ref:f}):null)}const Kw={x:0,y:0,scaleX:1,scaleY:1};function Xw(n){let{children:s}=n;return at.createElement(ho.Provider,{value:rg},at.createElement(pa.Provider,{value:Kw},s))}const Yw={position:"fixed",touchAction:"none"},Qw=n=>da(n)?"transform 250ms ease":void 0,Zw=w.forwardRef((n,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:x=Qw}=n;if(!h)return null;const k=a?g:{...g,scaleX:1,scaleY:1},y={...Yw,width:h.width,height:h.height,top:h.top,left:h.left,transform:js.Transform.toString(k),transformOrigin:a&&o?W0(o,h):void 0,transition:typeof x=="function"?x(o):x,...m};return at.createElement(r,{className:f,style:y,ref:s},u)}),Jw=n=>s=>{let{active:r,dragOverlay:o}=s;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]=r.node.style.getPropertyValue(h),r.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&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))r.node.style.setProperty(m,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},e1=n=>{let{transform:{initial:s,final:r}}=n;return[{transform:js.Transform.toString(s)},{transform:js.Transform.toString(r)}]},t1={duration:250,easing:"ease",keyframes:e1,sideEffects:Jw({styles:{active:{opacity:"0"}}})};function n1(n){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=n;return ua((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=sg(f);if(!g)return;const{transform:x}=vn(f).getComputedStyle(f),k=Gm(x);if(!k)return;const y=typeof s=="function"?s:s1(s);return Jm(m,a.draggable.measure),y({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function s1(n){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...t1,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!s)return;const x={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},y={x:m.x-x.x,y:m.y-x.y,...k},E=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:y}}),[_]=E,C=E[E.length-1];if(JSON.stringify(_)===JSON.stringify(C))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...g}),L=h.node.animate(E,{duration:s,easing:r,fill:"forwards"});return new Promise(A=>{L.onfinish=()=>{T==null||T(),A()}})}}let bh=0;function r1(n){return w.useMemo(()=>{if(n!=null)return bh++,bh},[n])}const i1=at.memo(n=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:x,active:k,activeNodeRect:y,containerNodeRect:E,draggableNodes:_,droppableContainers:C,dragOverlay:T,over:L,measuringConfiguration:A,scrollableAncestors:B,scrollableAncestorRects:M,windowRect:W}=lg(),q=w.useContext(pa),K=r1(k==null?void 0:k.id),G=og(f,{activatorEvent:x,active:k,activeNodeRect:y,containerNodeRect:E,draggingNodeRect:T.rect,over:L,overlayNodeRect:T.rect,scrollableAncestors:B,scrollableAncestorRects:M,transform:q,windowRect:W}),oe=id(y),ue=n1({config:o,draggableNodes:_,droppableContainers:C,measuringConfiguration:A}),ie=oe?T.setRef:void 0;return at.createElement(Xw,null,at.createElement(qw,{animation:ue},k&&K?at.createElement(Zw,{key:K,id:k.id,ref:ie,as:h,activatorEvent:x,adjustScale:s,className:m,transition:u,rect:oe,style:{zIndex:g,...a},transform:G},r):null))});function cg(n,s,r){const o=n.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function o1(n,s){return n.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(n.length))}function Nl(n){return n!==null&&n>=0}function l1(n,s){if(n===s)return!0;if(n.length!==s.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==s[r])return!1;return!0}function a1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const ug=n=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=n;const u=cg(s,o,r),f=s[a],h=u[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},Cl={scaleX:1,scaleY:1},Nh=n=>{var s;let{activeIndex:r,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(s=u[r])!=null?s:o;if(!h)return null;if(a===r){const g=u[f];return g?{x:0,y:r<f?g.top+g.height-(h.top+h.height):g.top-h.top,...Cl}:null}const m=c1(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-m,...Cl}:a<r&&a>=f?{x:0,y:h.height+m,...Cl}:{x:0,y:0,...Cl}};function c1(n,s,r){const o=n[s],a=n[s-1],u=n[s+1];return o?r<s?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const dg="Sortable",fg=at.createContext({activeIndex:-1,containerId:dg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ug,disabled:{draggable:!1,droppable:!1}});function Ch(n){let{children:s,id:r,items:o,strategy:a=ug,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:x}=lg(),k=po(dg,r),y=h.rect!==null,E=w.useMemo(()=>o.map(q=>typeof q=="object"&&"id"in q?q.id:q),[o]),_=f!=null,C=f?E.indexOf(f.id):-1,T=g?E.indexOf(g.id):-1,L=w.useRef(E),A=!l1(E,L.current),B=T!==-1&&C===-1||A,M=a1(u);ss(()=>{A&&_&&x(E)},[A,E,_,x]),w.useEffect(()=>{L.current=E},[E]);const W=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:M,disableTransforms:B,items:E,overIndex:T,useDragOverlay:y,sortedRects:o1(E,m),strategy:a}),[C,k,M.draggable,M.droppable,B,E,T,m,y,a]);return at.createElement(fg.Provider,{value:W},s)}const u1=n=>{let{id:s,items:r,activeIndex:o,overIndex:a}=n;return cg(r,o,a).indexOf(s)},d1=n=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===m},f1={duration:200,easing:"ease"},pg="transform",p1=js.Transition.toString({property:pg,duration:0,easing:"linear"}),h1={roleDescription:"sortable"};function m1(n){let{disabled:s,index:r,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(r);return ss(()=>{if(!s&&r!==h.current&&o.current){const m=a.current;if(m){const g=ui(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)}}r!==h.current&&(h.current=r)},[s,r,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function hg(n){let{animateLayoutChanges:s=d1,attributes:r,disabled:o,data:a,getNewIndex:u=u1,id:f,strategy:h,resizeObserverConfig:m,transition:g=f1}=n;const{items:x,containerId:k,activeIndex:y,disabled:E,disableTransforms:_,sortedRects:C,overIndex:T,useDragOverlay:L,strategy:A}=w.useContext(fg),B=g1(o,E),M=x.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:M,items:x},...a}),[k,a,M,x]),q=w.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:K,node:G,isOver:oe,setNodeRef:ue}=ag({id:f,data:W,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...m}}),{active:ie,activatorEvent:we,activeNodeRect:Ce,attributes:Fe,setNodeRef:Q,listeners:ne,isDragging:ae,over:O,setActivatorNodeRef:J,transform:H}=Hw({id:f,data:W,attributes:{...h1,...r},disabled:B.draggable}),b=C0(ue,Q),R=!!ie,te=R&&!_&&Nl(y)&&Nl(T),ce=!L&&ae,ge=ce&&te?H:null,Oe=te?ge??(h??A)({rects:C,activeNodeRect:Ce,activeIndex:y,overIndex:T,index:M}):null,Re=Nl(y)&&Nl(T)?u({id:f,items:x,activeIndex:y,overIndex:T}):M,je=ie==null?void 0:ie.id,be=w.useRef({activeId:je,items:x,newIndex:Re,containerId:k}),mt=x!==be.current.items,Me=s({active:ie,containerId:k,isDragging:ae,isSorting:R,id:f,index:M,items:x,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:g,wasDragging:be.current.activeId!=null}),jt=m1({disabled:!Me,index:M,node:G,rect:K});return w.useEffect(()=>{R&&be.current.newIndex!==Re&&(be.current.newIndex=Re),k!==be.current.containerId&&(be.current.containerId=k),x!==be.current.items&&(be.current.items=x)},[R,Re,k,x]),w.useEffect(()=>{if(je===be.current.activeId)return;if(je!=null&&be.current.activeId==null){be.current.activeId=je;return}const zt=setTimeout(()=>{be.current.activeId=je},50);return()=>clearTimeout(zt)},[je]),{active:ie,activeIndex:y,attributes:Fe,data:W,rect:K,index:M,newIndex:Re,items:x,isOver:oe,isSorting:R,isDragging:ae,listeners:ne,node:G,overIndex:T,over:O,setNodeRef:b,setActivatorNodeRef:J,setDroppableNodeRef:ue,setDraggableNodeRef:Q,transform:jt??Oe,transition:ze()};function ze(){if(jt||mt&&be.current.newIndex===M)return p1;if(!(ce&&!da(we)||!g)&&(R||Me))return js.Transition.toString({...g,property:pg})}}function g1(n,s){var r,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n==null?void 0:n.draggable)!=null?r:s.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:s.droppable}}it.Down,it.Right,it.Up,it.Left;function El(n){const[s,r]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{r(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[s,o]}async function _u(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function Zl(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Eh(n,s){if(!s||!n.cwd)return!1;const r=Zl(n.cwd),o=Zl(s);return r.startsWith(`${o}/`)}function v1(n,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",m=r.get(h)??[];m.push(f),r.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:r.get(f.path)??[],workspace:f})}for(const[f,h]of r)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function to(n){return[...n].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function _h(n,s,r,o){const a=s.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function jh(n,s){return{working:to(n.sessions.filter(r=>r.lifecycle!=="finished")),finished:to(n.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(n.finishedKey)}}function _l(n,s){return n.folder_id&&s.has(n.folder_id)?n.folder_id:null}function y1(n){const s=new Set(n.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function Rh({id:n,children:s,className:r}){const{setNodeRef:o,isOver:a}=ag({id:n});return c.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function x1({s:n,isActive:s,isSelected:r,appIcon:o,renaming:a,renameValue:u,renameRef:f,onRenameValue:h,onRenameConfirm:m,onRenameCancel:g,onSelect:x,onCtxMenu:k,onToggleStar:y}){const{attributes:E,listeners:_,setNodeRef:C,transform:T,transition:L,isDragging:A}=hg({id:`s:${n.id}`}),B=ia(n);return c.jsxs("div",{ref:C,style:{transform:js.Transform.toString(T),transition:L},className:`tree-item ${s?"active":""}${r?" selected":""} ${B.isFinished?"tree-item-finished":""}${A?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,..._,onClick:x,onContextMenu:k,children:[c.jsx(Yu,{iconClass:B.iconClass,iconText:B.iconText,size:16}),o&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:o}),a?c.jsx("input",{ref:f,className:"tree-rename-input",value:u,onChange:M=>h(M.target.value),onClick:M=>M.stopPropagation(),onPointerDown:M=>M.stopPropagation(),onKeyDown:M=>{M.key==="Enter"&&m(),M.key==="Escape"&&g()},onBlur:m}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!a&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:M=>{M.stopPropagation(),y()},onPointerDown:M=>M.stopPropagation(),children:c.jsx(Vl,{size:10,fill:n.starred?"currentColor":"none"})}),B.dot&&c.jsx(la,{status:B.dot})]})}function w1({folder:n,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:x,children:k}){const{attributes:y,listeners:E,setNodeRef:_,transform:C,transition:T,isDragging:L,over:A}=hg({id:`f:${n.id}`}),B=A!=null&&String(A.id).startsWith("s:");return c.jsxs("div",{ref:_,style:{transform:js.Transform.toString(C),transition:T},className:`tree-folder ${r?"collapsed":""}${L?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${B?" drop-over":""}`,...y,...E,onClick:()=>{o||g()},onContextMenu:x,children:o?c.jsx("input",{ref:u,className:"tree-rename-input",value:a,onChange:M=>f(M.target.value),onClick:M=>M.stopPropagation(),onPointerDown:M=>M.stopPropagation(),onKeyDown:M=>{M.key==="Enter"&&h(),M.key==="Escape"&&m()},onBlur:h}):c.jsxs(c.Fragment,{children:[c.jsx(si,{size:8,className:"tree-chevron"}),c.jsx(bu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:s})]})}),!r&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function k1(){const n=P(D=>D.sessions),s=P(D=>D.workspaces),r=P(D=>D.folders),o=P(D=>D.activeSessionId),a=P(D=>D.selectSession),u=P(D=>D.deleteSession),f=P(D=>D.removeWorkspace),h=P(D=>D.createSessionInWorkspace),m=P(D=>D.pickAndAddWorkspace),g=P(D=>D.renameSession),x=P(D=>D.markFinished),k=P(D=>D.markFinishedMany),y=P(D=>D.toggleStar),E=P(D=>D.reopenSession),_=P(D=>D.reopenSessionMany),C=P(D=>D.deleteSessionMany),T=P(D=>D.createSidebarFolder),L=P(D=>D.renameFolder),A=P(D=>D.deleteFolder),B=P(D=>D.applyMoves),M=P(D=>D.reorderFolders),W=P(D=>D.apps),q=P(D=>D.appsRootPath),K=P(D=>D.activeAppTabId),G=P(D=>D.openAppTab),oe=P(D=>D.startAppEdit),ue=P(D=>D.toggleAppPin),ie=P(D=>D.deleteApp),we=P(D=>D.openAppCatalog),[Ce,Fe]=El("agentpane:sidebar-ws-collapsed"),[Q,ne]=El("agentpane:sidebar-sub-collapsed"),[ae,O]=El("agentpane:sidebar-folders-collapsed"),[J,H]=El("agentpane:sidebar-app-edits-collapsed"),[b,R]=w.useState(null),[te,ce]=w.useState(null),[ge,ye]=w.useState(""),[Oe,Re]=w.useState(null),[je,be]=w.useState(new Set),[mt,Me]=w.useState(null),jt=w.useRef(null),ze=w.useRef(null),zt=U0(F0(rd,{activationConstraint:{distance:5}}));function We(){be(new Set),Me(null)}oa(jt,()=>R(null),!!b),Xu(()=>{R(null),We()},!!b||je.size>0);const Wt=w.useMemo(()=>new Map(n.map(D=>[D.id,D])),[n]),Rt=w.useMemo(()=>new Map(r.map(D=>[D.id,D])),[r]),gt=w.useMemo(()=>{const D=new Map;for(const _e of[...r].sort((le,xe)=>le.sort_order-xe.sort_order)){const le=D.get(_e.workspace_path)??[];le.push(_e),D.set(_e.workspace_path,le)}return D},[r]);function At(D){Fe(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}function $t(D){ne(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}function V(D){O(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}function he(D){H(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}w.useEffect(()=>{te&&ze.current&&(ze.current.focus(),ze.current.select())},[te]);function Ue(D,_e,le,xe=""){ce({kind:D,id:_e}),ye(le||xe)}function Ze(){if(te){const D=ge.trim();D&&(te.kind==="session"?g(te.id,D):L(te.id,D))}ce(null)}function vt(){ce(null),ye("")}async function yt(D){const _e=y1(gt.get(D)??[]),le=await T(D,_e);le&&Ue("folder",le.id,le.name)}function dt(D){const _e=String(D.active.id);if(_e.startsWith("s:")){const le=Wt.get(_e.slice(2));le&&Re({kind:"session",label:le.title||le.id.slice(0,8)})}else if(_e.startsWith("f:")){const le=Rt.get(_e.slice(2));le&&Re({kind:"folder",label:le.name})}}function Yt(D){Re(null);const{active:_e,over:le}=D;if(!le)return;const xe=String(_e.id),ke=String(le.id);if(xe.startsWith("s:")){const Le=Wt.get(xe.slice(2));if(!Le)return;const Se=Le.cwd||"(no directory)",Ve=_l(Le,Rt);let ot,tt;if(ke.startsWith("f:")){const Be=Rt.get(ke.slice(2));if(!Be)return;ot=Be.workspace_path,tt=Be.id}else if(ke.startsWith("s:")){const Be=Wt.get(ke.slice(2));if(!Be)return;ot=Be.cwd||"(no directory)",tt=_l(Be,Rt)}else if(ke.startsWith("c:")){const Be=ke.slice(2),Ke=Be.lastIndexOf("|");ot=Be.slice(0,Ke);const Lt=Be.slice(Ke+1);tt=Lt==="root"?null:Lt}else return;if(ot!==Se)return;const nt=to(n.filter(Be=>(Be.cwd||"(no directory)")===ot&&_l(Be,Rt)===tt)),It=nt.filter(Be=>Be.id!==Le.id);let st=It.length;if(ke.startsWith("s:")){const Be=It.findIndex(Ke=>Ke.id===ke.slice(2));Be>=0&&(st=Be)}const wt=[...It.slice(0,st),Le,...It.slice(st)],kt=[];if(tt===Ve){if(wt.length===nt.length&&wt.every((Be,Ke)=>Be.id===nt[Ke].id))return;wt.forEach((Be,Ke)=>kt.push({id:Be.id,folder_id:tt,sort_order:wt.length-1-Ke}))}else{const Be=to(n.filter(Ke=>(Ke.cwd||"(no directory)")===Se&&_l(Ke,Rt)===Ve)).filter(Ke=>Ke.id!==Le.id);Be.forEach((Ke,Lt)=>kt.push({id:Ke.id,folder_id:Ve,sort_order:Be.length-1-Lt})),wt.forEach((Ke,Lt)=>kt.push({id:Ke.id,folder_id:tt,sort_order:wt.length-1-Lt}))}B(kt);return}if(xe.startsWith("f:")){if(!ke.startsWith("f:"))return;const Le=Rt.get(xe.slice(2)),Se=Rt.get(ke.slice(2));if(!Le||!Se||Le.id===Se.id||Le.workspace_path!==Se.workspace_path)return;const Ve=(gt.get(Le.workspace_path)??[]).map(nt=>nt.id),ot=Ve.indexOf(Le.id),tt=Ve.indexOf(Se.id);Ve.splice(tt,0,...Ve.splice(ot,1)),M(Ve)}}const sn=v1(s,q?n.filter(D=>!Eh(D,q)):n),xt=w.useMemo(()=>{const D=new Map;if(!q)return D;const _e=Zl(q);for(const le of n){if(!Eh(le,q))continue;const xe=Zl(le.cwd).slice(_e.length+1).split("/")[0],ke=D.get(xe)??[];ke.push(le),D.set(xe,ke)}for(const[le,xe]of D)D.set(le,to(xe));return D},[n,q]),un=[];for(const D of sn){if(Ce.has(D.path))continue;const _e=gt.get(D.path)??[],le=new Set(_e.map(xe=>xe.id));for(const xe of _h(D,_e,le,ae)){if(xe.hidden)continue;const{working:ke,finished:Le,finishedCollapsed:Se}=jh(xe,Q);un.push(...ke.map(Ve=>Ve.id)),Se||un.push(...Le.map(Ve=>Ve.id))}}const yn=n.filter(D=>je.has(D.id)),Gn=yn.filter(D=>D.lifecycle!=="finished").map(D=>D.id),Mn=yn.filter(D=>D.lifecycle==="finished").map(D=>D.id);function Ln(D){const _e=D.origin_app_id?W.find(xe=>xe.id===D.origin_app_id):null,le=xe=>{if(xe.metaKey||xe.ctrlKey){xe.preventDefault(),Me(D.id),be(ke=>{const Le=new Set(ke);return Le.has(D.id)?Le.delete(D.id):Le.add(D.id),Le});return}if(xe.shiftKey){xe.preventDefault();const ke=mt??D.id;Me(ke);const Le=un.indexOf(ke),Se=un.indexOf(D.id);if(Le>=0&&Se>=0){const[Ve,ot]=Le<Se?[Le,Se]:[Se,Le];be(new Set(un.slice(Ve,ot+1)))}return}We(),Me(D.id),a(D.id)};return c.jsx(x1,{s:D,isActive:o===D.id,isSelected:je.has(D.id),appIcon:_e?_e.icon??"◧":null,renaming:(te==null?void 0:te.kind)==="session"&&te.id===D.id,renameValue:ge,renameRef:ze,onRenameValue:ye,onRenameConfirm:Ze,onRenameCancel:vt,onSelect:le,onToggleStar:()=>y(D.id),onCtxMenu:xe=>{xe.preventDefault();const ke=je.has(D.id)&&je.size>1;je.has(D.id)||(be(new Set),Me(D.id)),R({x:xe.clientX,y:xe.clientY,type:"session",sessionId:D.id,sessionTitle:D.title,sessionLifecycle:D.lifecycle,sessionExternalId:D.external_thread_id,multi:ke})}},D.id)}function Pn(D){const{working:_e,finished:le,finishedCollapsed:xe}=jh(D,Q),ke=[..._e,...le].map(Le=>`s:${Le.id}`);return c.jsxs(Ch,{items:ke,strategy:Nh,children:[_e.length===0&&le.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):_e.map(Ln),le.length>0&&c.jsxs("div",{className:`tree-subgroup ${xe?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>$t(D.finishedKey),children:[c.jsx(si,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:le.length})]}),!xe&&c.jsx("div",{className:"tree-subgroup-items",children:le.map(Ln)})]})]})}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(yr,{size:14})})]}),c.jsxs(Uw,{sensors:zt,collisionDetection:q0,onDragStart:dt,onDragEnd:Yt,children:[sn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):sn.map(D=>{const _e=Ce.has(D.path),le=gt.get(D.path)??[],xe=new Set(le.map(Se=>Se.id)),ke=_h(D,le,xe,ae),Le=ke[ke.length-1];return c.jsxs("div",{className:`tree-section ${_e?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>At(D.path),onContextMenu:Se=>{Se.preventDefault(),R({x:Se.clientX,y:Se.clientY,type:"workspace",path:D.path})},children:[c.jsx(si,{size:9,className:"tree-chevron"}),c.jsx(bu,{size:14}),c.jsx("span",{className:"tree-section-label",children:D.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:Se=>{Se.stopPropagation(),h(D.path)},children:c.jsx(yr,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:Se=>{Se.stopPropagation(),yt(D.path)},children:c.jsx(iu,{size:11})}),c.jsx("span",{className:"tree-count",children:D.sessions.length})]}),!_e&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Ch,{items:le.map(Se=>`f:${Se.id}`),strategy:Nh,children:ke.filter(Se=>Se.folder).map(Se=>c.jsx(w1,{folder:Se.folder,count:Se.sessions.length,collapsed:Se.hidden,renaming:(te==null?void 0:te.kind)==="folder"&&te.id===Se.folder.id,renameValue:ge,renameRef:ze,onRenameValue:ye,onRenameConfirm:Ze,onRenameCancel:vt,onToggle:()=>V(Se.folder.id),onCtxMenu:Ve=>{Ve.preventDefault(),R({x:Ve.clientX,y:Ve.clientY,type:"folder",folderId:Se.folder.id,folderName:Se.folder.name})},children:c.jsx(Rh,{id:`c:${D.path}|${Se.folder.id}`,children:Pn(Se)})},Se.folder.id))}),c.jsx(Rh,{id:`c:${D.path}|root`,children:Pn(Le)})]})]},D.path)}),c.jsx(i1,{children:Oe&&c.jsxs("div",{className:"drag-overlay",children:[Oe.kind==="folder"&&c.jsx(bu,{size:12}),c.jsx("span",{children:Oe.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:()=>we(),children:c.jsx(yr,{size:14})})]}),W.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),W.map(D=>{const _e=xt.get(D.id)??[],le=_e.length>0&&!J.has(D.id);return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${K===D.id?" active":""}`,title:D.description??void 0,onClick:()=>G(D.id),onContextMenu:xe=>{xe.preventDefault(),R({x:xe.clientX,y:xe.clientY,type:"app",appId:D.id,appPinned:D.pinned})},children:[_e.length>0&&c.jsx("button",{className:`sidebar-app-chevron${le?"":" closed"}`,title:"Edit sessions of this app",onClick:xe=>{xe.stopPropagation(),he(D.id)},children:c.jsx(si,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:D.icon??"◧"}),c.jsx("span",{className:"tree-label",children:D.title}),_e.length>0&&c.jsx("span",{className:"sidebar-app-count",children:_e.length}),D.pinned&&c.jsx(Vl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),le&&c.jsx("div",{className:"sidebar-app-edits",children:_e.map(xe=>{const ke=ia(xe);return c.jsxs("div",{className:`sidebar-app-edit-row${o===xe.id?" active":""}`,title:"App edit session — click to open",onClick:()=>a(xe.id),children:[c.jsx(Yu,{iconClass:ke.iconClass,iconText:ke.iconText,size:14}),c.jsx("span",{className:"tree-label",children:xe.title||xe.id.slice(0,8)}),ke.dot&&c.jsx(la,{status:ke.dot})]},xe.id)})})]},D.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(iu,{size:14}),c.jsx("span",{children:"Add workspace"})]}),b&&c.jsxs("div",{ref:jt,className:"ctx-menu",style:{position:"fixed",left:b.x,top:b.y,zIndex:500},children:[b.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{h(b.path),R(null)},children:[c.jsx(yr,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{yt(b.path),R(null)},children:[c.jsx(iu,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(b.path),R(null)},children:[c.jsx(fs,{size:12})," Hide Workspace"]})]}),b.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ue("folder",b.folderId,b.folderName??""),R(null)},children:[c.jsx(Ll,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{A(b.folderId),R(null)},children:[c.jsx(fs,{size:12})," Delete Folder"]})]}),b.type==="session"&&!b.multi&&c.jsx(c.Fragment,{children:b.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ue("session",b.sessionId,b.sessionTitle??""),R(null)},children:[c.jsx(Ll,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(b.sessionId),R(null)},children:[c.jsx(Hl,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(_u(b.sessionExternalId),R(null))},children:[c.jsx(Tu,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),R(null)},children:[c.jsx(fs,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(b.sessionId),R(null)},children:[c.jsx(oo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(_u(b.sessionExternalId),R(null))},children:[c.jsx(Tu,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),R(null)},children:[c.jsx(fs,{size:12})," Delete Session"]})]})}),b.type==="session"&&b.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[yn.length," sessions selected"]}),Gn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(Gn),R(null),We()},children:[c.jsx(Hl,{size:12})," Mark ",Gn.length," as Finished"]}),Mn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{_(Mn),R(null),We()},children:[c.jsx(oo,{size:12})," Reopen ",Mn.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{C([...je]),R(null),We()},children:[c.jsx(fs,{size:12})," Delete ",yn.length," Sessions"]})]}),b.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{oe(b.appId),R(null)},children:[c.jsx(Ll,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ue(b.appId),R(null)},children:[c.jsx(Vl,{size:12})," ",b.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{ie(b.appId),R(null)},children:[c.jsx(fs,{size:12})," Delete App"]})]})]})]})}function S1(){const n=P(y=>y.openTabs),s=P(y=>y.activeSessionId),r=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),k=P(y=>y.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(y=>{const E=r.find(T=>T.id===y);if(!E)return null;const _=ia(E),C=s===y&&m==null;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>{m!=null&&k(null),o(y)},children:[c.jsx(Yu,{iconClass:_.iconClass,iconText:_.iconText,size:14}),E.title||y.slice(0,8),_.dot&&c.jsx(la,{status:_.dot}),c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),a(y)},children:c.jsx(Vn,{size:12})})]},y)}),h.map(y=>{const E=f.find(C=>C.id===y),_=m===y;return c.jsxs("div",{className:`ide-tab ${_?"active":""}`,onClick:()=>g(y),children:[E!=null&&E.icon?c.jsx("span",{className:"miniapp-tab-icon",children:E.icon}):c.jsx(o0,{size:12}),(E==null?void 0:E.title)??y,c.jsx("span",{className:"ide-tab-close",onClick:C=>{C.stopPropagation(),x(y)},children:c.jsx(Vn,{size:12})})]},y)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>u(!0),children:c.jsx(yr,{size:14})})]})}function od(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var kr=od();function mg(n){kr=n}var no={exec:()=>null};function lt(n,s=""){let r=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(mn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var mn={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")},T1=/^(?:[ \t]*(?:\n|$))+/,b1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,N1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,C1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ld=/(?:[*+-]|\d{1,9}[.)])/,gg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vg=lt(gg).replace(/bull/g,ld).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(),E1=lt(gg).replace(/bull/g,ld).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(),ad=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_1=/^[^\n]+/,cd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,j1=lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),R1=lt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ld).getRegex(),ha="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",ud=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,A1=lt("^ {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",ud).replace("tag",ha).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yg=lt(ad).replace("hr",mo).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",ha).getRegex(),I1=lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yg).getRegex(),dd={blockquote:I1,code:b1,def:j1,fences:N1,heading:C1,hr:mo,html:A1,lheading:vg,list:R1,newline:T1,paragraph:yg,table:no,text:_1},Ah=lt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mo).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",ha).getRegex(),D1={...dd,lheading:E1,table:Ah,paragraph:lt(ad).replace("hr",mo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ah).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",ha).getRegex()},M1={...dd,html:lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ud).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:no,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lt(ad).replace("hr",mo).replace("heading",` *#{1,6} *[^
|
|
364
|
-
]`).replace("lheading",vg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
363
|
+
`},O0={onDragStart(n){let{active:s}=n;return"Picked up draggable item "+s.id+"."},onDragOver(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(n){let{active:s}=n;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function z0(n){let{announcements:s=O0,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=P0}=n;const{announce:u,announcement:f}=D0(),h=po("DndLiveRegion"),[m,g]=w.useState(!1);if(w.useEffect(()=>{g(!0)},[]),M0(w.useMemo(()=>({onDragStart(k){let{active:y}=k;u(s.onDragStart({active:y}))},onDragMove(k){let{active:y,over:N}=k;s.onDragMove&&u(s.onDragMove({active:y,over:N}))},onDragOver(k){let{active:y,over:N}=k;u(s.onDragOver({active:y,over:N}))},onDragEnd(k){let{active:y,over:N}=k;u(s.onDragEnd({active:y,over:N}))},onDragCancel(k){let{active:y,over:N}=k;u(s.onDragCancel({active:y,over:N}))}}),[u,s])),!m)return null;const x=at.createElement(at.Fragment,null,at.createElement(A0,{id:o,value:a.draggable}),at.createElement(I0,{id:h,announcement:f}));return r?Yi.createPortal(x,r):x}var Bt;(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"})(Bt||(Bt={}));function Yl(){}function $0(n,s){return w.useMemo(()=>({sensor:n,options:s??{}}),[n,s])}function F0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return w.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const rs=Object.freeze({x:0,y:0});function U0(n,s){return Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2))}function B0(n,s){const r=Xl(n);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function W0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return r-o}function H0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return o-r}function V0(n,s){if(!n||n.length===0)return null;const[r]=n;return r[s]}function fh(n,s,r){return s===void 0&&(s=n.left),r===void 0&&(r=n.top),{x:s+n.width*.5,y:r+n.height*.5}}const G0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=fh(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,m=r.get(h);if(m){const g=U0(fh(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(W0)};function q0(n,s){const r=Math.max(s.top,n.top),o=Math.max(s.left,n.left),a=Math.min(s.left+s.width,n.left+n.width),u=Math.min(s.top+s.height,n.top+n.height),f=a-o,h=u-r;if(o<a&&r<u){const m=s.width*s.height,g=n.width*n.height,x=f*h,k=x/(m+g-x);return Number(k.toFixed(4))}return 0}const K0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=r.get(f);if(h){const m=q0(h,s);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(H0)};function X0(n,s,r){return{...n,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function Vm(n,s){return n&&s?{x:n.left-s.left,y:n.top-s.top}:rs}function Y0(n){return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];return a.reduce((f,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...r})}}const Q0=Y0(1);function Gm(n){if(n.startsWith("matrix3d(")){const s=n.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(n.startsWith("matrix(")){const s=n.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function Z0(n,s,r){const o=Gm(s);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(r),g=n.top-h-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),x=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:x,height:k,top:g,right:m+x,bottom:g+k,left:m}}const J0={ignoreTransform:!1};function ui(n,s){s===void 0&&(s=J0);let r=n.getBoundingClientRect();if(s.ignoreTransform){const{transform:g,transformOrigin:x}=vn(n).getComputedStyle(n);g&&(r=Z0(r,g,x))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function ph(n){return ui(n,{ignoreTransform:!0})}function ew(n){const s=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function tw(n,s){return s===void 0&&(s=vn(n).getComputedStyle(n)),s.position==="fixed"}function nw(n,s){s===void 0&&(s=vn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=s[a];return typeof u=="string"?r.test(u):!1})}function ed(n,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(Ju(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!uo(a)||Bm(a)||r.includes(a))return r;const u=vn(n).getComputedStyle(a);return a!==n&&nw(a,u)&&r.push(a),tw(a,u)?r:o(a.parentNode)}return n?o(n):r}function qm(n){const[s]=ed(n,1);return s??null}function ou(n){return!aa||!n?null:ai(n)?n:Zu(n)?Ju(n)||n===ci(n).scrollingElement?window:uo(n)?n:null:null}function Km(n){return ai(n)?n.scrollX:n.scrollLeft}function Xm(n){return ai(n)?n.scrollY:n.scrollTop}function bu(n){return{x:Km(n),y:Xm(n)}}var Xt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Xt||(Xt={}));function Ym(n){return!aa||!n?!1:n===document.scrollingElement}function Qm(n){const s={x:0,y:0},r=Ym(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},a=n.scrollTop<=s.y,u=n.scrollLeft<=s.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:s}}const sw={x:.2,y:.2};function rw(n,s,r,o,a){let{top:u,left:f,right:h,bottom:m}=r;o===void 0&&(o=10),a===void 0&&(a=sw);const{isTop:g,isBottom:x,isLeft:k,isRight:y}=Qm(n),N={x:0,y:0},_={x:0,y:0},E={height:s.height*a.y,width:s.width*a.x};return!g&&u<=s.top+E.height?(N.y=Xt.Backward,_.y=o*Math.abs((s.top+E.height-u)/E.height)):!x&&m>=s.bottom-E.height&&(N.y=Xt.Forward,_.y=o*Math.abs((s.bottom-E.height-m)/E.height)),!y&&h>=s.right-E.width?(N.x=Xt.Forward,_.x=o*Math.abs((s.right-E.width-h)/E.width)):!k&&f<=s.left+E.width&&(N.x=Xt.Backward,_.x=o*Math.abs((s.left+E.width-f)/E.width)),{direction:N,speed:_}}function iw(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:s,left:r,right:o,bottom:a}=n.getBoundingClientRect();return{top:s,left:r,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function Zm(n){return n.reduce((s,r)=>ri(s,bu(r)),rs)}function ow(n){return n.reduce((s,r)=>s+Km(r),0)}function lw(n){return n.reduce((s,r)=>s+Xm(r),0)}function Jm(n,s){if(s===void 0&&(s=ui),!n)return;const{top:r,left:o,bottom:a,right:u}=s(n);qm(n)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const aw=[["x",["left","right"],ow],["y",["top","bottom"],lw]];class td{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=ed(r),a=Zm(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of aw)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 Zi{constructor(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var a;(a=this.target)==null||a.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function cw(n){const{EventTarget:s}=vn(n);return n instanceof s?n:ci(n)}function lu(n,s){const r=Math.abs(n.x),o=Math.abs(n.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var Hn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Hn||(Hn={}));function hh(n){n.preventDefault()}function uw(n){n.stopPropagation()}var it;(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"})(it||(it={}));const eg={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},dw=(n,s)=>{let{currentCoordinates:r}=s;switch(n.code){case it.Right:return{...r,x:r.x+25};case it.Left:return{...r,x:r.x-25};case it.Down:return{...r,y:r.y+25};case it.Up:return{...r,y:r.y-25}}};class tg{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new Zi(ci(r)),this.windowListeners=new Zi(vn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Hn.Resize,this.handleCancel),this.windowListeners.add(Hn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Hn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&Jm(o),r(rs)}handleKeyDown(s){if(ua(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=eg,coordinateGetter:f=dw,scrollBehavior:h="smooth"}=a,{code:m}=s;if(u.end.includes(m)){this.handleEnd(s);return}if(u.cancel.includes(m)){this.handleCancel(s);return}const{collisionRect:g}=o.current,x=g?{x:g.left,y:g.top}:rs;this.referenceCoordinates||(this.referenceCoordinates=x);const k=f(s,{active:r,context:o.current,currentCoordinates:x});if(k){const y=Kl(k,x),N={x:0,y:0},{scrollableAncestors:_}=o.current;for(const E of _){const T=s.code,{isTop:L,isRight:A,isLeft:B,isBottom:M,maxScroll:W,minScroll:q}=Qm(E),K=iw(E),G={x:Math.min(T===it.Right?K.right-K.width/2:K.right,Math.max(T===it.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(T===it.Down?K.bottom-K.height/2:K.bottom,Math.max(T===it.Down?K.top:K.top+K.height/2,k.y))},oe=T===it.Right&&!A||T===it.Left&&!B,ue=T===it.Down&&!M||T===it.Up&&!L;if(oe&&G.x!==k.x){const ie=E.scrollLeft+y.x,we=T===it.Right&&ie<=W.x||T===it.Left&&ie>=q.x;if(we&&!y.y){E.scrollTo({left:ie,behavior:h});return}we?N.x=E.scrollLeft-ie:N.x=T===it.Right?E.scrollLeft-W.x:E.scrollLeft-q.x,N.x&&E.scrollBy({left:-N.x,behavior:h});break}else if(ue&&G.y!==k.y){const ie=E.scrollTop+y.y,we=T===it.Down&&ie<=W.y||T===it.Up&&ie>=q.y;if(we&&!y.x){E.scrollTo({top:ie,behavior:h});return}we?N.y=E.scrollTop-ie:N.y=T===it.Down?E.scrollTop-W.y:E.scrollTop-q.y,N.y&&E.scrollBy({top:-N.y,behavior:h});break}}this.handleMove(s,ri(Kl(k,this.referenceCoordinates),N))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tg.activators=[{eventName:"onKeyDown",handler:(n,s,r)=>{let{keyboardCodes:o=eg,onActivation:a}=s,{active:u}=r;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 mh(n){return!!(n&&"distance"in n)}function gh(n){return!!(n&&"delay"in n)}class nd{constructor(s,r,o){var a;o===void 0&&(o=cw(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:f}=u;this.props=s,this.events=r,this.document=ci(f),this.documentListeners=new Zi(this.document),this.listeners=new Zi(o),this.windowListeners=new Zi(vn(f)),this.initialCoordinates=(a=Xl(u))!=null?a:rs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(Hn.Resize,this.handleCancel),this.windowListeners.add(Hn.DragStart,hh),this.windowListeners.add(Hn.VisibilityChange,this.handleCancel),this.windowListeners.add(Hn.ContextMenu,hh),this.documentListeners.add(Hn.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gh(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(mh(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:a}=this.props;a(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(Hn.Click,uw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Hn.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(r=Xl(s))!=null?r:rs,g=Kl(a,m);if(!o&&h){if(mh(h)){if(h.tolerance!=null&&lu(g,h.tolerance))return this.handleCancel();if(lu(g,h.distance))return this.handleStart()}if(gh(h)&&lu(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}s.cancelable&&s.preventDefault(),f(m)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===it.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const fw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sd extends nd{constructor(s){const{event:r}=s,o=ci(r.target);super(s,fw,o)}}sd.activators=[{eventName:"onPointerDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const pw={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;(function(n){n[n.RightClick=2]="RightClick"})(Nu||(Nu={}));class hw extends nd{constructor(s){super(s,pw,ci(s.event.target))}}hw.activators=[{eventName:"onMouseDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return r.button===Nu.RightClick?!1:(o==null||o({event:r}),!0)}}];const au={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class mw extends nd{constructor(s){super(s,au)}static setup(){return window.addEventListener(au.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(au.move.name,s)};function s(){}}}mw.activators=[{eventName:"onTouchStart",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;const{touches:a}=r;return a.length>1?!1:(o==null||o({event:r}),!0)}}];var Ji;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Ji||(Ji={}));var Ql;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ql||(Ql={}));function gw(n){let{acceleration:s,activator:r=Ji.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=Ql.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:x,delta:k,threshold:y}=n;const N=yw({delta:k,disabled:!u}),[_,E]=C0(),T=w.useRef({x:0,y:0}),L=w.useRef({x:0,y:0}),A=w.useMemo(()=>{switch(r){case Ji.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case Ji.DraggableRect:return a}},[r,a,m]),B=w.useRef(null),M=w.useCallback(()=>{const q=B.current;if(!q)return;const K=T.current.x*L.current.x,G=T.current.y*L.current.y;q.scrollBy(K,G)},[]),W=w.useMemo(()=>h===Ql.TreeOrder?[...g].reverse():g,[h,g]);w.useEffect(()=>{if(!u||!g.length||!A){E();return}for(const q of W){if((o==null?void 0:o(q))===!1)continue;const K=g.indexOf(q),G=x[K];if(!G)continue;const{direction:oe,speed:ue}=rw(q,G,A,s,y);for(const ie of["x","y"])N[ie][oe[ie]]||(ue[ie]=0,oe[ie]=0);if(ue.x>0||ue.y>0){E(),B.current=q,_(M,f),T.current=ue,L.current=oe;return}}T.current={x:0,y:0},L.current={x:0,y:0},E()},[s,M,o,E,u,f,JSON.stringify(A),JSON.stringify(N),_,g,W,x,JSON.stringify(y)])}const vw={x:{[Xt.Backward]:!1,[Xt.Forward]:!1},y:{[Xt.Backward]:!1,[Xt.Forward]:!1}};function yw(n){let{delta:s,disabled:r}=n;const o=ql(s);return fo(a=>{if(r||!o||!a)return vw;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Xt.Backward]:a.x[Xt.Backward]||u.x===-1,[Xt.Forward]:a.x[Xt.Forward]||u.x===1},y:{[Xt.Backward]:a.y[Xt.Backward]||u.y===-1,[Xt.Forward]:a.y[Xt.Forward]||u.y===1}}},[r,s,o])}function xw(n,s){const r=s!=null?n.get(s):void 0,o=r?r.node.current:null;return fo(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function ww(n,s){return w.useMemo(()=>n.reduce((r,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:s(f.handler,o)}));return[...r,...u]},[]),[n,s])}var ao;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ao||(ao={}));var Cu;(function(n){n.Optimized="optimized"})(Cu||(Cu={}));const vh=new Map;function kw(n,s){let{dragging:r,dependencies:o,config:a}=s;const[u,f]=w.useState(null),{frequency:h,measure:m,strategy:g}=a,x=w.useRef(n),k=T(),y=lo(k),N=w.useCallback(function(L){L===void 0&&(L=[]),!y.current&&f(A=>A===null?L:A.concat(L.filter(B=>!A.includes(B))))},[y]),_=w.useRef(null),E=fo(L=>{if(k&&!r)return vh;if(!L||L===vh||x.current!==n||u!=null){const A=new Map;for(let B of n){if(!B)continue;if(u&&u.length>0&&!u.includes(B.id)&&B.rect.current){A.set(B.id,B.rect.current);continue}const M=B.node.current,W=M?new td(m(M),M):null;B.rect.current=W,W&&A.set(B.id,W)}return A}return L},[n,u,r,k,m]);return w.useEffect(()=>{x.current=n},[n]),w.useEffect(()=>{k||N()},[r,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||_.current!==null||(_.current=setTimeout(()=>{N(),_.current=null},h))},[h,k,N,...o]),{droppableRects:E,measureDroppableContainers:N,measuringScheduled:u!=null};function T(){switch(g){case ao.Always:return!1;case ao.BeforeDragging:return r;default:return!r}}}function rd(n,s){return fo(r=>n?r||(typeof s=="function"?s(n):n):null,[s,n])}function Sw(n,s){return rd(n,s)}function Tw(n){let{callback:s,disabled:r}=n;const o=ca(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function da(n){let{callback:s,disabled:r}=n;const o=ca(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function bw(n){return new td(ui(n),n)}function yh(n,s,r){s===void 0&&(s=bw);const[o,a]=w.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??r)!=null?g:null}const x=s(n);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const f=Tw({callback(m){if(n)for(const g of m){const{type:x,target:k}=g;if(x==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=da({callback:u});return ss(()=>{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 Nw(n){const s=rd(n);return Vm(n,s)}const xh=[];function Cw(n){const s=w.useRef(n),r=fo(o=>n?o&&o!==xh&&n&&s.current&&n.parentNode===s.current.parentNode?o:ed(n):xh,[n]);return w.useEffect(()=>{s.current=n},[n]),r}function Ew(n){const[s,r]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=ou(u.target);f&&r(h=>h?(h.set(f,bu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=ou(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,bu(g)]):null}).filter(m=>m!=null);r(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=ou(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?s?Array.from(s.values()).reduce((u,f)=>ri(u,f),rs):Zm(n):rs,[n,s])}function wh(n,s){s===void 0&&(s=[]);const r=w.useRef(null);return w.useEffect(()=>{r.current=null},s),w.useEffect(()=>{const o=n!==rs;o&&!r.current&&(r.current=n),!o&&r.current&&(r.current=null)},[n]),r.current?Kl(n,r.current):rs}function _w(n){w.useEffect(()=>{if(!aa)return;const s=n.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},n.map(s=>{let{sensor:r}=s;return r}))}function jw(n,s){return w.useMemo(()=>n.reduce((r,o)=>{let{eventName:a,handler:u}=o;return r[a]=f=>{u(f,s)},r},{}),[n,s])}function ng(n){return w.useMemo(()=>n?ew(n):null,[n])}const kh=[];function Rw(n,s){s===void 0&&(s=ui);const[r]=n,o=ng(r?vn(r):null),[a,u]=w.useState(kh);function f(){u(()=>n.length?n.map(m=>Ym(m)?o:new td(s(m),m)):kh)}const h=da({callback:f});return ss(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function sg(n){if(!n)return null;if(n.children.length>1)return n;const s=n.children[0];return uo(s)?s:n}function Aw(n){let{measure:s}=n;const[r,o]=w.useState(null),a=w.useCallback(g=>{for(const{target:x}of g)if(uo(x)){o(k=>{const y=s(x);return k?{...k,width:y.width,height:y.height}:y});break}},[s]),u=da({callback:a}),f=w.useCallback(g=>{const x=sg(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?s(x):null)},[s,u]),[h,m]=Gl(f);return w.useMemo(()=>({nodeRef:h,rect:r,setRef:m}),[r,h,m])}const Iw=[{sensor:sd,options:{}},{sensor:tg,options:{}}],Dw={current:{}},Pl={draggable:{measure:ph},droppable:{measure:ph,strategy:ao.WhileDragging,frequency:Cu.Optimized},dragOverlay:{measure:ui}};class eo extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const Mw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new eo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Pl,measureDroppableContainers:Yl,windowRect:null,measuringScheduled:!1},rg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Yl,draggableNodes:new Map,over:null,measureDroppableContainers:Yl},ho=w.createContext(rg),ig=w.createContext(Mw);function Lw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eo}}}function Pw(n,s){switch(s.type){case Bt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Bt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:s.coordinates.x-n.draggable.initialCoordinates.x,y:s.coordinates.y-n.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new eo(n.droppable.containers);return a.set(o,r),{...n,droppable:{...n.droppable,containers:a}}}case Bt.SetDroppableDisabled:{const{id:r,key:o,disabled:a}=s,u=n.droppable.containers.get(r);if(!u||o!==u.key)return n;const f=new eo(n.droppable.containers);return f.set(r,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Bt.UnregisterDroppable:{const{id:r,key:o}=s,a=n.droppable.containers.get(r);if(!a||o!==a.key)return n;const u=new eo(n.droppable.containers);return u.delete(r),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function Ow(n){let{disabled:s}=n;const{active:r,activatorEvent:o,draggableNodes:a}=w.useContext(ho),u=ql(o),f=ql(r==null?void 0:r.id);return w.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!ua(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 k=j0(x);if(k){k.focus();break}}})}},[o,s,a,f,u]),null}function og(n,s){let{transform:r,...o}=s;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),r):r}function zw(n){return w.useMemo(()=>({draggable:{...Pl.draggable,...n==null?void 0:n.draggable},droppable:{...Pl.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Pl.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 $w(n){let{activeNode:s,measure:r,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;ss(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const g=s==null?void 0:s.node.current;if(!g||g.isConnected===!1)return;const x=r(g),k=Vm(x,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=qm(g);y&&y.scrollBy({top:k.y,left:k.x})}},[s,f,h,o,r])}const fa=w.createContext({...rs,scaleX:1,scaleY:1});var Ys;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Ys||(Ys={}));const Fw=w.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:x=Iw,collisionDetection:k=K0,measuring:y,modifiers:N,..._}=s;const E=w.useReducer(Pw,void 0,Lw),[T,L]=E,[A,B]=L0(),[M,W]=w.useState(Ys.Uninitialized),q=M===Ys.Initialized,{draggable:{active:K,nodes:G,translate:oe},droppable:{containers:ue}}=T,ie=K!=null?G.get(K):null,we=w.useRef({initial:null,translated:null}),Ce=w.useMemo(()=>{var ke;return K!=null?{id:K,data:(ke=ie==null?void 0:ie.data)!=null?ke:Dw,rect:we}:null},[K,ie]),Fe=w.useRef(null),[Q,ne]=w.useState(null),[ae,O]=w.useState(null),J=lo(_,Object.values(_)),H=po("DndDescribedBy",f),b=w.useMemo(()=>ue.getEnabled(),[ue]),R=zw(y),{droppableRects:te,measureDroppableContainers:ce,measuringScheduled:ge}=kw(b,{dragging:q,dependencies:[oe.x,oe.y],config:R.droppable}),ye=xw(G,K),Oe=w.useMemo(()=>ae?Xl(ae):null,[ae]),Re=xe(),je=Sw(ye,R.draggable.measure);$w({activeNode:K!=null?G.get(K):null,config:Re.layoutShiftCompensation,initialRect:je,measure:R.draggable.measure});const be=yh(ye,R.draggable.measure,je),mt=yh(ye?ye.parentElement:null),Me=w.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:G,draggingNode:null,draggingNodeRect:null,droppableContainers:ue,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),jt=ue.getNodeFor((r=Me.current.over)==null?void 0:r.id),ze=Aw({measure:R.dragOverlay.measure}),zt=(o=ze.nodeRef.current)!=null?o:ye,We=q?(a=ze.rect)!=null?a:be:null,Wt=!!(ze.nodeRef.current&&ze.rect),Rt=Nw(Wt?null:be),gt=ng(zt?vn(zt):null),At=Cw(q?jt??ye:null),$t=Rw(At),V=og(N,{transform:{x:oe.x-Rt.x,y:oe.y-Rt.y,scaleX:1,scaleY:1},activatorEvent:ae,active:Ce,activeNodeRect:be,containerNodeRect:mt,draggingNodeRect:We,over:Me.current.over,overlayNodeRect:ze.rect,scrollableAncestors:At,scrollableAncestorRects:$t,windowRect:gt}),he=Oe?ri(Oe,oe):null,Ue=Ew(At),Ze=wh(Ue),vt=wh(Ue,[be]),yt=ri(V,Ze),dt=We?Q0(We,V):null,Yt=Ce&&dt?k({active:Ce,collisionRect:dt,droppableRects:te,droppableContainers:b,pointerCoordinates:he}):null,sn=V0(Yt,"id"),[xt,un]=w.useState(null),yn=Wt?V:ri(V,vt),Gn=X0(yn,(u=xt==null?void 0:xt.rect)!=null?u:null,be),Mn=w.useRef(null),Ln=w.useCallback((ke,Le)=>{let{sensor:Se,options:Ve}=Le;if(Fe.current==null)return;const ot=G.get(Fe.current);if(!ot)return;const tt=ke.nativeEvent,nt=new Se({active:Fe.current,activeNode:ot,event:tt,options:Ve,context:Me,onAbort(st){if(!G.get(st))return;const{onDragAbort:kt}=J.current,Be={id:st};kt==null||kt(Be),A({type:"onDragAbort",event:Be})},onPending(st,wt,kt,Be){if(!G.get(st))return;const{onDragPending:Lt}=J.current,Qt={id:st,constraint:wt,initialCoordinates:kt,offset:Be};Lt==null||Lt(Qt),A({type:"onDragPending",event:Qt})},onStart(st){const wt=Fe.current;if(wt==null)return;const kt=G.get(wt);if(!kt)return;const{onDragStart:Be}=J.current,Ke={activatorEvent:tt,active:{id:wt,data:kt.data,rect:we}};Yi.unstable_batchedUpdates(()=>{Be==null||Be(Ke),W(Ys.Initializing),L({type:Bt.DragStart,initialCoordinates:st,active:wt}),A({type:"onDragStart",event:Ke}),ne(Mn.current),O(tt)})},onMove(st){L({type:Bt.DragMove,coordinates:st})},onEnd:It(Bt.DragEnd),onCancel:It(Bt.DragCancel)});Mn.current=nt;function It(st){return async function(){const{active:kt,collisions:Be,over:Ke,scrollAdjustedTranslate:Lt}=Me.current;let Qt=null;if(kt&&Lt){const{cancelDrop:qn}=J.current;Qt={activatorEvent:tt,active:kt,collisions:Be,delta:Lt,over:Ke},st===Bt.DragEnd&&typeof qn=="function"&&await Promise.resolve(qn(Qt))&&(st=Bt.DragCancel)}Fe.current=null,Yi.unstable_batchedUpdates(()=>{L({type:st}),W(Ys.Uninitialized),un(null),ne(null),O(null),Mn.current=null;const qn=st===Bt.DragEnd?"onDragEnd":"onDragCancel";if(Qt){const Kn=J.current[qn];Kn==null||Kn(Qt),A({type:qn,event:Qt})}})}}},[G]),Pn=w.useCallback((ke,Le)=>(Se,Ve)=>{const ot=Se.nativeEvent,tt=G.get(Ve);if(Fe.current!==null||!tt||ot.dndKit||ot.defaultPrevented)return;const nt={active:tt};ke(Se,Le.options,nt)===!0&&(ot.dndKit={capturedBy:Le.sensor},Fe.current=Ve,Ln(Se,Le))},[G,Ln]),D=ww(x,Pn);_w(x),ss(()=>{be&&M===Ys.Initializing&&W(Ys.Initialized)},[be,M]),w.useEffect(()=>{const{onDragMove:ke}=J.current,{active:Le,activatorEvent:Se,collisions:Ve,over:ot}=Me.current;if(!Le||!Se)return;const tt={active:Le,activatorEvent:Se,collisions:Ve,delta:{x:yt.x,y:yt.y},over:ot};Yi.unstable_batchedUpdates(()=>{ke==null||ke(tt),A({type:"onDragMove",event:tt})})},[yt.x,yt.y]),w.useEffect(()=>{const{active:ke,activatorEvent:Le,collisions:Se,droppableContainers:Ve,scrollAdjustedTranslate:ot}=Me.current;if(!ke||Fe.current==null||!Le||!ot)return;const{onDragOver:tt}=J.current,nt=Ve.get(sn),It=nt&&nt.rect.current?{id:nt.id,rect:nt.rect.current,data:nt.data,disabled:nt.disabled}:null,st={active:ke,activatorEvent:Le,collisions:Se,delta:{x:ot.x,y:ot.y},over:It};Yi.unstable_batchedUpdates(()=>{un(It),tt==null||tt(st),A({type:"onDragOver",event:st})})},[sn]),ss(()=>{Me.current={activatorEvent:ae,active:Ce,activeNode:ye,collisionRect:dt,collisions:Yt,droppableRects:te,draggableNodes:G,draggingNode:zt,draggingNodeRect:We,droppableContainers:ue,over:xt,scrollableAncestors:At,scrollAdjustedTranslate:yt},we.current={initial:We,translated:dt}},[Ce,ye,Yt,dt,G,zt,We,te,ue,xt,At,yt]),gw({...Re,delta:oe,draggingRect:dt,pointerCoordinates:he,scrollableAncestors:At,scrollableAncestorRects:$t});const _e=w.useMemo(()=>({active:Ce,activeNode:ye,activeNodeRect:be,activatorEvent:ae,collisions:Yt,containerNodeRect:mt,dragOverlay:ze,draggableNodes:G,droppableContainers:ue,droppableRects:te,over:xt,measureDroppableContainers:ce,scrollableAncestors:At,scrollableAncestorRects:$t,measuringConfiguration:R,measuringScheduled:ge,windowRect:gt}),[Ce,ye,be,ae,Yt,mt,ze,G,ue,te,xt,ce,At,$t,R,ge,gt]),le=w.useMemo(()=>({activatorEvent:ae,activators:D,active:Ce,activeNodeRect:be,ariaDescribedById:{draggable:H},dispatch:L,draggableNodes:G,over:xt,measureDroppableContainers:ce}),[ae,D,Ce,be,L,H,G,xt,ce]);return at.createElement(Hm.Provider,{value:B},at.createElement(ho.Provider,{value:le},at.createElement(ig.Provider,{value:_e},at.createElement(fa.Provider,{value:Gn},g)),at.createElement(Ow,{disabled:(h==null?void 0:h.restoreFocus)===!1})),at.createElement(z0,{...h,hiddenTextDescribedById:H}));function xe(){const ke=(Q==null?void 0:Q.autoScrollEnabled)===!1,Le=typeof m=="object"?m.enabled===!1:m===!1,Se=q&&!ke&&!Le;return typeof m=="object"?{...m,enabled:Se}:{enabled:Se}}}),Uw=w.createContext(null),Sh="button",Bw="Draggable";function Ww(n){let{id:s,data:r,disabled:o=!1,attributes:a}=n;const u=po(Bw),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:x,draggableNodes:k,over:y}=w.useContext(ho),{role:N=Sh,roleDescription:_="draggable",tabIndex:E=0}=a??{},T=(m==null?void 0:m.id)===s,L=w.useContext(T?fa:Uw),[A,B]=Gl(),[M,W]=Gl(),q=jw(f,s),K=lo(r);ss(()=>(k.set(s,{id:s,key:u,node:A,activatorNode:M,data:K}),()=>{const oe=k.get(s);oe&&oe.key===u&&k.delete(s)}),[k,s]);const G=w.useMemo(()=>({role:N,tabIndex:E,"aria-disabled":o,"aria-pressed":T&&N===Sh?!0:void 0,"aria-roledescription":_,"aria-describedby":x.draggable}),[o,N,E,T,_,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:G,isDragging:T,listeners:o?void 0:q,node:A,over:y,setNodeRef:B,setActivatorNodeRef:W,transform:L}}function lg(){return w.useContext(ig)}const Hw="Droppable",Vw={timeout:25};function ag(n){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=n;const u=po(Hw),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=w.useContext(ho),x=w.useRef({disabled:r}),k=w.useRef(!1),y=w.useRef(null),N=w.useRef(null),{disabled:_,updateMeasurementsFor:E,timeout:T}={...Vw,...a},L=lo(E??o),A=w.useCallback(()=>{if(!k.current){k.current=!0;return}N.current!=null&&clearTimeout(N.current),N.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),N.current=null},T)},[T]),B=da({callback:A,disabled:_||!f}),M=w.useCallback((G,oe)=>{B&&(oe&&(B.unobserve(oe),k.current=!1),G&&B.observe(G))},[B]),[W,q]=Gl(M),K=lo(s);return w.useEffect(()=>{!B||!W.current||(B.disconnect(),k.current=!1,B.observe(W.current))},[W,B]),w.useEffect(()=>(h({type:Bt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:W,rect:y,data:K}}),()=>h({type:Bt.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{r!==x.current.disabled&&(h({type:Bt.SetDroppableDisabled,id:o,key:u,disabled:r}),x.current.disabled=r)},[o,u,r,h]),{active:f,rect:y,isOver:(m==null?void 0:m.id)===o,node:W,over:m,setNodeRef:q}}function Gw(n){let{animation:s,children:r}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=ql(r);return!r&&!o&&h&&a(h),ss(()=>{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(s(g,u)).then(()=>{a(null)})},[s,o,u]),at.createElement(at.Fragment,null,r,o?w.cloneElement(o,{ref:f}):null)}const qw={x:0,y:0,scaleX:1,scaleY:1};function Kw(n){let{children:s}=n;return at.createElement(ho.Provider,{value:rg},at.createElement(fa.Provider,{value:qw},s))}const Xw={position:"fixed",touchAction:"none"},Yw=n=>ua(n)?"transform 250ms ease":void 0,Qw=w.forwardRef((n,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:x=Yw}=n;if(!h)return null;const k=a?g:{...g,scaleX:1,scaleY:1},y={...Xw,width:h.width,height:h.height,top:h.top,left:h.left,transform:js.Transform.toString(k),transformOrigin:a&&o?B0(o,h):void 0,transition:typeof x=="function"?x(o):x,...m};return at.createElement(r,{className:f,style:y,ref:s},u)}),Zw=n=>s=>{let{active:r,dragOverlay:o}=s;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]=r.node.style.getPropertyValue(h),r.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&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))r.node.style.setProperty(m,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},Jw=n=>{let{transform:{initial:s,final:r}}=n;return[{transform:js.Transform.toString(s)},{transform:js.Transform.toString(r)}]},e1={duration:250,easing:"ease",keyframes:Jw,sideEffects:Zw({styles:{active:{opacity:"0"}}})};function t1(n){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=n;return ca((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=sg(f);if(!g)return;const{transform:x}=vn(f).getComputedStyle(f),k=Gm(x);if(!k)return;const y=typeof s=="function"?s:n1(s);return Jm(m,a.draggable.measure),y({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function n1(n){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...e1,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!s)return;const x={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},y={x:m.x-x.x,y:m.y-x.y,...k},N=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:y}}),[_]=N,E=N[N.length-1];if(JSON.stringify(_)===JSON.stringify(E))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...g}),L=h.node.animate(N,{duration:s,easing:r,fill:"forwards"});return new Promise(A=>{L.onfinish=()=>{T==null||T(),A()}})}}let Th=0;function s1(n){return w.useMemo(()=>{if(n!=null)return Th++,Th},[n])}const r1=at.memo(n=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:x,active:k,activeNodeRect:y,containerNodeRect:N,draggableNodes:_,droppableContainers:E,dragOverlay:T,over:L,measuringConfiguration:A,scrollableAncestors:B,scrollableAncestorRects:M,windowRect:W}=lg(),q=w.useContext(fa),K=s1(k==null?void 0:k.id),G=og(f,{activatorEvent:x,active:k,activeNodeRect:y,containerNodeRect:N,draggingNodeRect:T.rect,over:L,overlayNodeRect:T.rect,scrollableAncestors:B,scrollableAncestorRects:M,transform:q,windowRect:W}),oe=rd(y),ue=t1({config:o,draggableNodes:_,droppableContainers:E,measuringConfiguration:A}),ie=oe?T.setRef:void 0;return at.createElement(Kw,null,at.createElement(Gw,{animation:ue},k&&K?at.createElement(Qw,{key:K,id:k.id,ref:ie,as:h,activatorEvent:x,adjustScale:s,className:m,transition:u,rect:oe,style:{zIndex:g,...a},transform:G},r):null))});function cg(n,s,r){const o=n.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function i1(n,s){return n.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(n.length))}function Nl(n){return n!==null&&n>=0}function o1(n,s){if(n===s)return!0;if(n.length!==s.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==s[r])return!1;return!0}function l1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const ug=n=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=n;const u=cg(s,o,r),f=s[a],h=u[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},Cl={scaleX:1,scaleY:1},bh=n=>{var s;let{activeIndex:r,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(s=u[r])!=null?s:o;if(!h)return null;if(a===r){const g=u[f];return g?{x:0,y:r<f?g.top+g.height-(h.top+h.height):g.top-h.top,...Cl}:null}const m=a1(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-m,...Cl}:a<r&&a>=f?{x:0,y:h.height+m,...Cl}:{x:0,y:0,...Cl}};function a1(n,s,r){const o=n[s],a=n[s-1],u=n[s+1];return o?r<s?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const dg="Sortable",fg=at.createContext({activeIndex:-1,containerId:dg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ug,disabled:{draggable:!1,droppable:!1}});function Nh(n){let{children:s,id:r,items:o,strategy:a=ug,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:x}=lg(),k=po(dg,r),y=h.rect!==null,N=w.useMemo(()=>o.map(q=>typeof q=="object"&&"id"in q?q.id:q),[o]),_=f!=null,E=f?N.indexOf(f.id):-1,T=g?N.indexOf(g.id):-1,L=w.useRef(N),A=!o1(N,L.current),B=T!==-1&&E===-1||A,M=l1(u);ss(()=>{A&&_&&x(N)},[A,N,_,x]),w.useEffect(()=>{L.current=N},[N]);const W=w.useMemo(()=>({activeIndex:E,containerId:k,disabled:M,disableTransforms:B,items:N,overIndex:T,useDragOverlay:y,sortedRects:i1(N,m),strategy:a}),[E,k,M.draggable,M.droppable,B,N,T,m,y,a]);return at.createElement(fg.Provider,{value:W},s)}const c1=n=>{let{id:s,items:r,activeIndex:o,overIndex:a}=n;return cg(r,o,a).indexOf(s)},u1=n=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===m},d1={duration:200,easing:"ease"},pg="transform",f1=js.Transition.toString({property:pg,duration:0,easing:"linear"}),p1={roleDescription:"sortable"};function h1(n){let{disabled:s,index:r,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(r);return ss(()=>{if(!s&&r!==h.current&&o.current){const m=a.current;if(m){const g=ui(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)}}r!==h.current&&(h.current=r)},[s,r,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function hg(n){let{animateLayoutChanges:s=u1,attributes:r,disabled:o,data:a,getNewIndex:u=c1,id:f,strategy:h,resizeObserverConfig:m,transition:g=d1}=n;const{items:x,containerId:k,activeIndex:y,disabled:N,disableTransforms:_,sortedRects:E,overIndex:T,useDragOverlay:L,strategy:A}=w.useContext(fg),B=m1(o,N),M=x.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:M,items:x},...a}),[k,a,M,x]),q=w.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:K,node:G,isOver:oe,setNodeRef:ue}=ag({id:f,data:W,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...m}}),{active:ie,activatorEvent:we,activeNodeRect:Ce,attributes:Fe,setNodeRef:Q,listeners:ne,isDragging:ae,over:O,setActivatorNodeRef:J,transform:H}=Ww({id:f,data:W,attributes:{...p1,...r},disabled:B.draggable}),b=N0(ue,Q),R=!!ie,te=R&&!_&&Nl(y)&&Nl(T),ce=!L&&ae,ge=ce&&te?H:null,Oe=te?ge??(h??A)({rects:E,activeNodeRect:Ce,activeIndex:y,overIndex:T,index:M}):null,Re=Nl(y)&&Nl(T)?u({id:f,items:x,activeIndex:y,overIndex:T}):M,je=ie==null?void 0:ie.id,be=w.useRef({activeId:je,items:x,newIndex:Re,containerId:k}),mt=x!==be.current.items,Me=s({active:ie,containerId:k,isDragging:ae,isSorting:R,id:f,index:M,items:x,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:g,wasDragging:be.current.activeId!=null}),jt=h1({disabled:!Me,index:M,node:G,rect:K});return w.useEffect(()=>{R&&be.current.newIndex!==Re&&(be.current.newIndex=Re),k!==be.current.containerId&&(be.current.containerId=k),x!==be.current.items&&(be.current.items=x)},[R,Re,k,x]),w.useEffect(()=>{if(je===be.current.activeId)return;if(je!=null&&be.current.activeId==null){be.current.activeId=je;return}const zt=setTimeout(()=>{be.current.activeId=je},50);return()=>clearTimeout(zt)},[je]),{active:ie,activeIndex:y,attributes:Fe,data:W,rect:K,index:M,newIndex:Re,items:x,isOver:oe,isSorting:R,isDragging:ae,listeners:ne,node:G,overIndex:T,over:O,setNodeRef:b,setActivatorNodeRef:J,setDroppableNodeRef:ue,setDraggableNodeRef:Q,transform:jt??Oe,transition:ze()};function ze(){if(jt||mt&&be.current.newIndex===M)return f1;if(!(ce&&!ua(we)||!g)&&(R||Me))return js.Transition.toString({...g,property:pg})}}function m1(n,s){var r,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n==null?void 0:n.draggable)!=null?r:s.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:s.droppable}}it.Down,it.Right,it.Up,it.Left;function El(n){const[s,r]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{r(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[s,o]}async function Eu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function Zl(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Ch(n,s){if(!s||!n.cwd)return!1;const r=Zl(n.cwd),o=Zl(s);return r.startsWith(`${o}/`)}function g1(n,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",m=r.get(h)??[];m.push(f),r.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:r.get(f.path)??[],workspace:f})}for(const[f,h]of r)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function to(n){return[...n].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function Eh(n,s,r,o){const a=s.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function _h(n,s){return{working:to(n.sessions.filter(r=>r.lifecycle!=="finished")),finished:to(n.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(n.finishedKey)}}function _l(n,s){return n.folder_id&&s.has(n.folder_id)?n.folder_id:null}function v1(n){const s=new Set(n.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function jh({id:n,children:s,className:r}){const{setNodeRef:o,isOver:a}=ag({id:n});return c.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function y1({s:n,isActive:s,isSelected:r,appIcon:o,renaming:a,renameValue:u,renameRef:f,onRenameValue:h,onRenameConfirm:m,onRenameCancel:g,onSelect:x,onCtxMenu:k,onToggleStar:y}){const{attributes:N,listeners:_,setNodeRef:E,transform:T,transition:L,isDragging:A}=hg({id:`s:${n.id}`}),B=ia(n);return c.jsxs("div",{ref:E,style:{transform:js.Transform.toString(T),transition:L},className:`tree-item ${s?"active":""}${r?" selected":""} ${B.isFinished?"tree-item-finished":""}${A?" dragging":""}${n.starred?" tree-item-starred":""}`,...N,..._,onClick:x,onContextMenu:k,children:[c.jsx(Xu,{iconClass:B.iconClass,iconText:B.iconText,size:16}),o&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:o}),a?c.jsx("input",{ref:f,className:"tree-rename-input",value:u,onChange:M=>h(M.target.value),onClick:M=>M.stopPropagation(),onPointerDown:M=>M.stopPropagation(),onKeyDown:M=>{M.key==="Enter"&&m(),M.key==="Escape"&&g()},onBlur:m}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!a&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:M=>{M.stopPropagation(),y()},onPointerDown:M=>M.stopPropagation(),children:c.jsx(Vl,{size:10,fill:n.starred?"currentColor":"none"})}),B.dot&&c.jsx(Ku,{status:B.dot})]})}function x1({folder:n,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:x,children:k}){const{attributes:y,listeners:N,setNodeRef:_,transform:E,transition:T,isDragging:L,over:A}=hg({id:`f:${n.id}`}),B=A!=null&&String(A.id).startsWith("s:");return c.jsxs("div",{ref:_,style:{transform:js.Transform.toString(E),transition:T},className:`tree-folder ${r?"collapsed":""}${L?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${B?" drop-over":""}`,...y,...N,onClick:()=>{o||g()},onContextMenu:x,children:o?c.jsx("input",{ref:u,className:"tree-rename-input",value:a,onChange:M=>f(M.target.value),onClick:M=>M.stopPropagation(),onPointerDown:M=>M.stopPropagation(),onKeyDown:M=>{M.key==="Enter"&&h(),M.key==="Escape"&&m()},onBlur:h}):c.jsxs(c.Fragment,{children:[c.jsx(si,{size:8,className:"tree-chevron"}),c.jsx(Tu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:s})]})}),!r&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function w1(){const n=P(D=>D.sessions),s=P(D=>D.workspaces),r=P(D=>D.folders),o=P(D=>D.activeSessionId),a=P(D=>D.selectSession),u=P(D=>D.deleteSession),f=P(D=>D.removeWorkspace),h=P(D=>D.createSessionInWorkspace),m=P(D=>D.pickAndAddWorkspace),g=P(D=>D.renameSession),x=P(D=>D.markFinished),k=P(D=>D.markFinishedMany),y=P(D=>D.toggleStar),N=P(D=>D.reopenSession),_=P(D=>D.reopenSessionMany),E=P(D=>D.deleteSessionMany),T=P(D=>D.createSidebarFolder),L=P(D=>D.renameFolder),A=P(D=>D.deleteFolder),B=P(D=>D.applyMoves),M=P(D=>D.reorderFolders),W=P(D=>D.apps),q=P(D=>D.appsRootPath),K=P(D=>D.activeAppTabId),G=P(D=>D.openAppTab),oe=P(D=>D.startAppEdit),ue=P(D=>D.toggleAppPin),ie=P(D=>D.deleteApp),we=P(D=>D.openAppCatalog),[Ce,Fe]=El("agentpane:sidebar-ws-collapsed"),[Q,ne]=El("agentpane:sidebar-sub-collapsed"),[ae,O]=El("agentpane:sidebar-folders-collapsed"),[J,H]=El("agentpane:sidebar-app-edits-collapsed"),[b,R]=w.useState(null),[te,ce]=w.useState(null),[ge,ye]=w.useState(""),[Oe,Re]=w.useState(null),[je,be]=w.useState(new Set),[mt,Me]=w.useState(null),jt=w.useRef(null),ze=w.useRef(null),zt=F0($0(sd,{activationConstraint:{distance:5}}));function We(){be(new Set),Me(null)}oa(jt,()=>R(null),!!b),qu(()=>{R(null),We()},!!b||je.size>0);const Wt=w.useMemo(()=>new Map(n.map(D=>[D.id,D])),[n]),Rt=w.useMemo(()=>new Map(r.map(D=>[D.id,D])),[r]),gt=w.useMemo(()=>{const D=new Map;for(const _e of[...r].sort((le,xe)=>le.sort_order-xe.sort_order)){const le=D.get(_e.workspace_path)??[];le.push(_e),D.set(_e.workspace_path,le)}return D},[r]);function At(D){Fe(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}function $t(D){ne(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}function V(D){O(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}function he(D){H(_e=>{const le=new Set(_e);return le.has(D)?le.delete(D):le.add(D),le})}w.useEffect(()=>{te&&ze.current&&(ze.current.focus(),ze.current.select())},[te]);function Ue(D,_e,le,xe=""){ce({kind:D,id:_e}),ye(le||xe)}function Ze(){if(te){const D=ge.trim();D&&(te.kind==="session"?g(te.id,D):L(te.id,D))}ce(null)}function vt(){ce(null),ye("")}async function yt(D){const _e=v1(gt.get(D)??[]),le=await T(D,_e);le&&Ue("folder",le.id,le.name)}function dt(D){const _e=String(D.active.id);if(_e.startsWith("s:")){const le=Wt.get(_e.slice(2));le&&Re({kind:"session",label:le.title||le.id.slice(0,8)})}else if(_e.startsWith("f:")){const le=Rt.get(_e.slice(2));le&&Re({kind:"folder",label:le.name})}}function Yt(D){Re(null);const{active:_e,over:le}=D;if(!le)return;const xe=String(_e.id),ke=String(le.id);if(xe.startsWith("s:")){const Le=Wt.get(xe.slice(2));if(!Le)return;const Se=Le.cwd||"(no directory)",Ve=_l(Le,Rt);let ot,tt;if(ke.startsWith("f:")){const Be=Rt.get(ke.slice(2));if(!Be)return;ot=Be.workspace_path,tt=Be.id}else if(ke.startsWith("s:")){const Be=Wt.get(ke.slice(2));if(!Be)return;ot=Be.cwd||"(no directory)",tt=_l(Be,Rt)}else if(ke.startsWith("c:")){const Be=ke.slice(2),Ke=Be.lastIndexOf("|");ot=Be.slice(0,Ke);const Lt=Be.slice(Ke+1);tt=Lt==="root"?null:Lt}else return;if(ot!==Se)return;const nt=to(n.filter(Be=>(Be.cwd||"(no directory)")===ot&&_l(Be,Rt)===tt)),It=nt.filter(Be=>Be.id!==Le.id);let st=It.length;if(ke.startsWith("s:")){const Be=It.findIndex(Ke=>Ke.id===ke.slice(2));Be>=0&&(st=Be)}const wt=[...It.slice(0,st),Le,...It.slice(st)],kt=[];if(tt===Ve){if(wt.length===nt.length&&wt.every((Be,Ke)=>Be.id===nt[Ke].id))return;wt.forEach((Be,Ke)=>kt.push({id:Be.id,folder_id:tt,sort_order:wt.length-1-Ke}))}else{const Be=to(n.filter(Ke=>(Ke.cwd||"(no directory)")===Se&&_l(Ke,Rt)===Ve)).filter(Ke=>Ke.id!==Le.id);Be.forEach((Ke,Lt)=>kt.push({id:Ke.id,folder_id:Ve,sort_order:Be.length-1-Lt})),wt.forEach((Ke,Lt)=>kt.push({id:Ke.id,folder_id:tt,sort_order:wt.length-1-Lt}))}B(kt);return}if(xe.startsWith("f:")){if(!ke.startsWith("f:"))return;const Le=Rt.get(xe.slice(2)),Se=Rt.get(ke.slice(2));if(!Le||!Se||Le.id===Se.id||Le.workspace_path!==Se.workspace_path)return;const Ve=(gt.get(Le.workspace_path)??[]).map(nt=>nt.id),ot=Ve.indexOf(Le.id),tt=Ve.indexOf(Se.id);Ve.splice(tt,0,...Ve.splice(ot,1)),M(Ve)}}const sn=g1(s,q?n.filter(D=>!Ch(D,q)):n),xt=w.useMemo(()=>{const D=new Map;if(!q)return D;const _e=Zl(q);for(const le of n){if(!Ch(le,q))continue;const xe=Zl(le.cwd).slice(_e.length+1).split("/")[0],ke=D.get(xe)??[];ke.push(le),D.set(xe,ke)}for(const[le,xe]of D)D.set(le,to(xe));return D},[n,q]),un=[];for(const D of sn){if(Ce.has(D.path))continue;const _e=gt.get(D.path)??[],le=new Set(_e.map(xe=>xe.id));for(const xe of Eh(D,_e,le,ae)){if(xe.hidden)continue;const{working:ke,finished:Le,finishedCollapsed:Se}=_h(xe,Q);un.push(...ke.map(Ve=>Ve.id)),Se||un.push(...Le.map(Ve=>Ve.id))}}const yn=n.filter(D=>je.has(D.id)),Gn=yn.filter(D=>D.lifecycle!=="finished").map(D=>D.id),Mn=yn.filter(D=>D.lifecycle==="finished").map(D=>D.id);function Ln(D){const _e=D.origin_app_id?W.find(xe=>xe.id===D.origin_app_id):null,le=xe=>{if(xe.metaKey||xe.ctrlKey){xe.preventDefault(),Me(D.id),be(ke=>{const Le=new Set(ke);return Le.has(D.id)?Le.delete(D.id):Le.add(D.id),Le});return}if(xe.shiftKey){xe.preventDefault();const ke=mt??D.id;Me(ke);const Le=un.indexOf(ke),Se=un.indexOf(D.id);if(Le>=0&&Se>=0){const[Ve,ot]=Le<Se?[Le,Se]:[Se,Le];be(new Set(un.slice(Ve,ot+1)))}return}We(),Me(D.id),a(D.id)};return c.jsx(y1,{s:D,isActive:o===D.id,isSelected:je.has(D.id),appIcon:_e?_e.icon??"◧":null,renaming:(te==null?void 0:te.kind)==="session"&&te.id===D.id,renameValue:ge,renameRef:ze,onRenameValue:ye,onRenameConfirm:Ze,onRenameCancel:vt,onSelect:le,onToggleStar:()=>y(D.id),onCtxMenu:xe=>{xe.preventDefault();const ke=je.has(D.id)&&je.size>1;je.has(D.id)||(be(new Set),Me(D.id)),R({x:xe.clientX,y:xe.clientY,type:"session",sessionId:D.id,sessionTitle:D.title,sessionLifecycle:D.lifecycle,sessionExternalId:D.external_thread_id,multi:ke})}},D.id)}function Pn(D){const{working:_e,finished:le,finishedCollapsed:xe}=_h(D,Q),ke=[..._e,...le].map(Le=>`s:${Le.id}`);return c.jsxs(Nh,{items:ke,strategy:bh,children:[_e.length===0&&le.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):_e.map(Ln),le.length>0&&c.jsxs("div",{className:`tree-subgroup ${xe?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>$t(D.finishedKey),children:[c.jsx(si,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:le.length})]}),!xe&&c.jsx("div",{className:"tree-subgroup-items",children:le.map(Ln)})]})]})}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(yr,{size:14})})]}),c.jsxs(Fw,{sensors:zt,collisionDetection:G0,onDragStart:dt,onDragEnd:Yt,children:[sn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):sn.map(D=>{const _e=Ce.has(D.path),le=gt.get(D.path)??[],xe=new Set(le.map(Se=>Se.id)),ke=Eh(D,le,xe,ae),Le=ke[ke.length-1];return c.jsxs("div",{className:`tree-section ${_e?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>At(D.path),onContextMenu:Se=>{Se.preventDefault(),R({x:Se.clientX,y:Se.clientY,type:"workspace",path:D.path})},children:[c.jsx(si,{size:9,className:"tree-chevron"}),c.jsx(Tu,{size:14}),c.jsx("span",{className:"tree-section-label",children:D.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:Se=>{Se.stopPropagation(),h(D.path)},children:c.jsx(yr,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:Se=>{Se.stopPropagation(),yt(D.path)},children:c.jsx(ru,{size:11})}),c.jsx("span",{className:"tree-count",children:D.sessions.length})]}),!_e&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Nh,{items:le.map(Se=>`f:${Se.id}`),strategy:bh,children:ke.filter(Se=>Se.folder).map(Se=>c.jsx(x1,{folder:Se.folder,count:Se.sessions.length,collapsed:Se.hidden,renaming:(te==null?void 0:te.kind)==="folder"&&te.id===Se.folder.id,renameValue:ge,renameRef:ze,onRenameValue:ye,onRenameConfirm:Ze,onRenameCancel:vt,onToggle:()=>V(Se.folder.id),onCtxMenu:Ve=>{Ve.preventDefault(),R({x:Ve.clientX,y:Ve.clientY,type:"folder",folderId:Se.folder.id,folderName:Se.folder.name})},children:c.jsx(jh,{id:`c:${D.path}|${Se.folder.id}`,children:Pn(Se)})},Se.folder.id))}),c.jsx(jh,{id:`c:${D.path}|root`,children:Pn(Le)})]})]},D.path)}),c.jsx(r1,{children:Oe&&c.jsxs("div",{className:"drag-overlay",children:[Oe.kind==="folder"&&c.jsx(Tu,{size:12}),c.jsx("span",{children:Oe.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:()=>we(),children:c.jsx(yr,{size:14})})]}),W.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),W.map(D=>{const _e=xt.get(D.id)??[],le=_e.length>0&&!J.has(D.id);return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${K===D.id?" active":""}`,title:D.description??void 0,onClick:()=>G(D.id),onContextMenu:xe=>{xe.preventDefault(),R({x:xe.clientX,y:xe.clientY,type:"app",appId:D.id,appPinned:D.pinned})},children:[_e.length>0&&c.jsx("button",{className:`sidebar-app-chevron${le?"":" closed"}`,title:"Edit sessions of this app",onClick:xe=>{xe.stopPropagation(),he(D.id)},children:c.jsx(si,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:D.icon??"◧"}),c.jsx("span",{className:"tree-label",children:D.title}),_e.length>0&&c.jsx("span",{className:"sidebar-app-count",children:_e.length}),D.pinned&&c.jsx(Vl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),le&&c.jsx("div",{className:"sidebar-app-edits",children:_e.map(xe=>{const ke=ia(xe);return c.jsxs("div",{className:`sidebar-app-edit-row${o===xe.id?" active":""}`,title:"App edit session — click to open",onClick:()=>a(xe.id),children:[c.jsx(Xu,{iconClass:ke.iconClass,iconText:ke.iconText,size:14}),c.jsx("span",{className:"tree-label",children:xe.title||xe.id.slice(0,8)}),ke.dot&&c.jsx(Ku,{status:ke.dot})]},xe.id)})})]},D.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(ru,{size:14}),c.jsx("span",{children:"Add workspace"})]}),b&&c.jsxs("div",{ref:jt,className:"ctx-menu",style:{position:"fixed",left:b.x,top:b.y,zIndex:500},children:[b.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{h(b.path),R(null)},children:[c.jsx(yr,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{yt(b.path),R(null)},children:[c.jsx(ru,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(b.path),R(null)},children:[c.jsx(fs,{size:12})," Hide Workspace"]})]}),b.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ue("folder",b.folderId,b.folderName??""),R(null)},children:[c.jsx(Ll,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{A(b.folderId),R(null)},children:[c.jsx(fs,{size:12})," Delete Folder"]})]}),b.type==="session"&&!b.multi&&c.jsx(c.Fragment,{children:b.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ue("session",b.sessionId,b.sessionTitle??""),R(null)},children:[c.jsx(Ll,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(b.sessionId),R(null)},children:[c.jsx(Hl,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(Eu(b.sessionExternalId),R(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),R(null)},children:[c.jsx(fs,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(b.sessionId),R(null)},children:[c.jsx(oo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(Eu(b.sessionExternalId),R(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),R(null)},children:[c.jsx(fs,{size:12})," Delete Session"]})]})}),b.type==="session"&&b.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[yn.length," sessions selected"]}),Gn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(Gn),R(null),We()},children:[c.jsx(Hl,{size:12})," Mark ",Gn.length," as Finished"]}),Mn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{_(Mn),R(null),We()},children:[c.jsx(oo,{size:12})," Reopen ",Mn.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{E([...je]),R(null),We()},children:[c.jsx(fs,{size:12})," Delete ",yn.length," Sessions"]})]}),b.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{oe(b.appId),R(null)},children:[c.jsx(Ll,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ue(b.appId),R(null)},children:[c.jsx(Vl,{size:12})," ",b.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{ie(b.appId),R(null)},children:[c.jsx(fs,{size:12})," Delete App"]})]})]})]})}function k1(){const n=P(y=>y.openTabs),s=P(y=>y.activeSessionId),r=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),k=P(y=>y.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(y=>{const N=r.find(T=>T.id===y);if(!N)return null;const _=ia(N),E=s===y&&m==null;return c.jsxs("div",{className:`ide-tab ${E?"active":""}`,onClick:()=>{m!=null&&k(null),o(y)},children:[c.jsx(Xu,{iconClass:_.iconClass,iconText:_.iconText,size:14}),N.title||y.slice(0,8),_.dot&&c.jsx(Ku,{status:_.dot}),c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),a(y)},children:c.jsx(Vn,{size:12})})]},y)}),h.map(y=>{const N=f.find(E=>E.id===y),_=m===y;return c.jsxs("div",{className:`ide-tab ${_?"active":""}`,onClick:()=>g(y),children:[N!=null&&N.icon?c.jsx("span",{className:"miniapp-tab-icon",children:N.icon}):c.jsx(i0,{size:12}),(N==null?void 0:N.title)??y,c.jsx("span",{className:"ide-tab-close",onClick:E=>{E.stopPropagation(),x(y)},children:c.jsx(Vn,{size:12})})]},y)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>u(!0),children:c.jsx(yr,{size:14})})]})}function id(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var kr=id();function mg(n){kr=n}var no={exec:()=>null};function lt(n,s=""){let r=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(mn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var mn={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")},S1=/^(?:[ \t]*(?:\n|$))+/,T1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,b1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,N1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,od=/(?:[*+-]|\d{1,9}[.)])/,gg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vg=lt(gg).replace(/bull/g,od).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(),C1=lt(gg).replace(/bull/g,od).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(),ld=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,E1=/^[^\n]+/,ad=/(?!\s*\])(?:\\.|[^\[\]\\])+/,_1=lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ad).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),j1=lt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,od).getRegex(),pa="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",cd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,R1=lt("^ {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",cd).replace("tag",pa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yg=lt(ld).replace("hr",mo).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",pa).getRegex(),A1=lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yg).getRegex(),ud={blockquote:A1,code:T1,def:_1,fences:b1,heading:N1,hr:mo,html:R1,lheading:vg,list:j1,newline:S1,paragraph:yg,table:no,text:E1},Rh=lt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mo).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",pa).getRegex(),I1={...ud,lheading:C1,table:Rh,paragraph:lt(ld).replace("hr",mo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Rh).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",pa).getRegex()},D1={...ud,html:lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cd).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:no,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lt(ld).replace("hr",mo).replace("heading",` *#{1,6} *[^
|
|
364
|
+
]`).replace("lheading",vg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},M1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,L1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xg=/^( {2,}|\\)\n(?!\s*$)/,P1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ha=/[\p{P}\p{S}]/u,dd=/[\s\p{P}\p{S}]/u,wg=/[^\s\p{P}\p{S}]/u,O1=lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dd).getRegex(),kg=/(?!~)[\p{P}\p{S}]/u,z1=/(?!~)[\s\p{P}\p{S}]/u,$1=/(?:[^\s\p{P}\p{S}]|~)/u,F1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Sg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,U1=lt(Sg,"u").replace(/punct/g,ha).getRegex(),B1=lt(Sg,"u").replace(/punct/g,kg).getRegex(),Tg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",W1=lt(Tg,"gu").replace(/notPunctSpace/g,wg).replace(/punctSpace/g,dd).replace(/punct/g,ha).getRegex(),H1=lt(Tg,"gu").replace(/notPunctSpace/g,$1).replace(/punctSpace/g,z1).replace(/punct/g,kg).getRegex(),V1=lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wg).replace(/punctSpace/g,dd).replace(/punct/g,ha).getRegex(),G1=lt(/\\(punct)/,"gu").replace(/punct/g,ha).getRegex(),q1=lt(/^<(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(),K1=lt(cd).replace("(?:-->|$)","-->").getRegex(),X1=lt("^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",K1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y1=lt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bg=lt(/^!?\[(label)\]\[(ref)\]/).replace("label",Jl).replace("ref",ad).getRegex(),Ng=lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",ad).getRegex(),Q1=lt("reflink|nolink(?!\\()","g").replace("reflink",bg).replace("nolink",Ng).getRegex(),fd={_backpedal:no,anyPunctuation:G1,autolink:q1,blockSkip:F1,br:xg,code:L1,del:no,emStrongLDelim:U1,emStrongRDelimAst:W1,emStrongRDelimUnd:V1,escape:M1,link:Y1,nolink:Ng,punctuation:O1,reflink:bg,reflinkSearch:Q1,tag:X1,text:P1,url:no},Z1={...fd,link:lt(/^!?\[(label)\]\((.*?)\)/).replace("label",Jl).getRegex(),reflink:lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jl).getRegex()},_u={...fd,emStrongRDelimAst:H1,emStrongLDelim:B1,url:lt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},J1={..._u,br:lt(xg).replace("{2,}","*").getRegex(),text:lt(_u.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jl={normal:ud,gfm:I1,pedantic:D1},Gi={normal:fd,gfm:_u,breaks:J1,pedantic:Z1},ek={"&":"&","<":"<",">":">",'"':""","'":"'"},Ah=n=>ek[n];function ds(n,s){if(s){if(mn.escapeTest.test(n))return n.replace(mn.escapeReplace,Ah)}else if(mn.escapeTestNoEncode.test(n))return n.replace(mn.escapeReplaceNoEncode,Ah);return n}function Ih(n){try{n=encodeURI(n).replace(mn.percentDecode,"%")}catch{return null}return n}function Dh(n,s){var u;const r=n.replace(mn.findPipe,(f,h,m)=>{let g=!1,x=h;for(;--x>=0&&m[x]==="\\";)g=!g;return g?"|":" |"}),o=r.split(mn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(mn.slashPipe,"|");return o}function qi(n,s,r){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===s;)a++;return n.slice(0,o-a)}function tk(n,s){if(n.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===s[0])r++;else if(n[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function Mh(n,s,r,o,a){const u=s.href,f=s.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,m}function nk(n,s,r){const o=n.match(r.other.indentCodeCompensation);if(o===null)return s;const a=o[1];return s.split(`
|
|
365
365
|
`).map(u=>{const f=u.match(r.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
366
366
|
`)}var ea=class{constructor(n){ct(this,"options");ct(this,"rules");ct(this,"lexer");this.options=n||kr}space(n){const s=this.rules.block.newline.exec(n);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(n){const s=this.rules.block.code.exec(n);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:qi(r,`
|
|
367
|
-
`)}}}fences(n){const s=this.rules.block.fences.exec(n);if(s){const r=s[0],o=
|
|
367
|
+
`)}}}fences(n){const s=this.rules.block.fences.exec(n);if(s){const r=s[0],o=nk(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(n){const s=this.rules.block.heading.exec(n);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=qi(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){const s=this.rules.block.hr.exec(n);if(s)return{type:"hr",raw:qi(s[0],`
|
|
368
368
|
`)}}blockquote(n){const s=this.rules.block.blockquote.exec(n);if(s){let r=qi(s[0],`
|
|
369
369
|
`).split(`
|
|
370
370
|
`),o="",a="";const u=[];for(;r.length>0;){let f=!1;const h=[];let m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))h.push(r[m]),f=!0;else if(!f)h.push(r[m]);else break;r=r.slice(m);const g=h.join(`
|
|
371
371
|
`),x=g.replace(this.rules.other.blockquoteSetextReplace,`
|
|
372
372
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
373
373
|
${g}`:g,a=a?`${a}
|
|
374
|
-
${x}`:x;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,u,!0),this.lexer.state.top=k,r.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
|
|
374
|
+
${x}`:x;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,u,!0),this.lexer.state.top=k,r.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 N=y,_=N.raw+`
|
|
375
375
|
`+r.join(`
|
|
376
|
-
`),
|
|
376
|
+
`),E=this.blockquote(_);u[u.length-1]=E,o=o.substring(0,o.length-N.raw.length)+E.raw,a=a.substring(0,a.length-N.text.length)+E.text;break}else if((y==null?void 0:y.type)==="list"){const N=y,_=N.raw+`
|
|
377
377
|
`+r.join(`
|
|
378
|
-
`),
|
|
378
|
+
`),E=this.list(_);u[u.length-1]=E,o=o.substring(0,o.length-y.raw.length)+E.raw,a=a.substring(0,a.length-N.raw.length)+E.raw,r=_.substring(u.at(-1).raw.length).split(`
|
|
379
379
|
`);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let s=this.rules.block.list.exec(n);if(s){let r=s[1].trim();const o=r.length>1,a={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const u=this.rules.other.listItemRegex(r);let f=!1;for(;n;){let m=!1,g="",x="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;g=s[0],n=n.substring(g.length);let k=s[2].split(`
|
|
380
380
|
`,1)[0].replace(this.rules.other.listReplaceTabs,L=>" ".repeat(3*L.length)),y=n.split(`
|
|
381
|
-
`,1)[0],
|
|
381
|
+
`,1)[0],N=!k.trim(),_=0;if(this.options.pedantic?(_=2,x=k.trimStart()):N?_=s[1].length+1:(_=s[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,x=k.slice(_),_+=s[1].length),N&&this.rules.other.blankLine.test(y)&&(g+=y+`
|
|
382
382
|
`,n=n.substring(y.length+1),m=!0),!m){const L=this.rules.other.nextBulletRegex(_),A=this.rules.other.hrRegex(_),B=this.rules.other.fencesBeginRegex(_),M=this.rules.other.headingBeginRegex(_),W=this.rules.other.htmlBeginRegex(_);for(;n;){const q=n.split(`
|
|
383
383
|
`,1)[0];let K;if(y=q,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),K=y):K=y.replace(this.rules.other.tabCharGlobal," "),B.test(y)||M.test(y)||W.test(y)||L.test(y)||A.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=_||!y.trim())x+=`
|
|
384
|
-
`+K.slice(_);else{if(
|
|
385
|
-
`+y}!
|
|
386
|
-
`,n=n.substring(q.length+1),k=K.slice(_)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let
|
|
387
|
-
`):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<r.length;h++)u.header.push({text:r[h],tokens:this.lexer.inline(r[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(
|
|
388
|
-
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(n){const s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){const s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){const s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){const s=this.rules.inline.link.exec(n);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=qi(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=
|
|
384
|
+
`+K.slice(_);else{if(N||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(k)||M.test(k)||A.test(k))break;x+=`
|
|
385
|
+
`+y}!N&&!y.trim()&&(N=!0),g+=q+`
|
|
386
|
+
`,n=n.substring(q.length+1),k=K.slice(_)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let E=null,T;this.options.gfm&&(E=this.rules.other.listIsTask.exec(x),E&&(T=E[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!E,checked:T,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(k=>k.type==="space"),x=g.length>0&&g.some(k=>this.rules.other.anyLine.test(k.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 s=this.rules.block.html.exec(n);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(n){const s=this.rules.block.def.exec(n);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:a}}}table(n){var f;const s=this.rules.block.table.exec(n);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Dh(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=s[3])!=null&&f.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
387
|
+
`):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<r.length;h++)u.header.push({text:r[h],tokens:this.lexer.inline(r[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Dh(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 s=this.rules.block.lheading.exec(n);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(n){const s=this.rules.block.paragraph.exec(n);if(s){const r=s[1].charAt(s[1].length-1)===`
|
|
388
|
+
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(n){const s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){const s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){const s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){const s=this.rules.inline.link.exec(n);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=qi(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=tk(s[2],"()");if(u===-2)return;if(u>-1){const h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let o=s[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Mh(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(n,s){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=s[o.toLowerCase()];if(!a){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return Mh(r,a,r[0],this.lexer,this.rules)}}emStrong(n,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const u=[...o[0]].length-1;let f,h,m=u,g=0;const x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*n.length+u);(o=x.exec(s))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){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 k=[...o[0]][0].length,y=n.slice(0,u+o.index+k+h);if(Math.min(u,h)%2){const _=y.slice(1,-1);return{type:"em",raw:y,text:_,tokens:this.lexer.inlineTokens(_)}}const N=y.slice(2,-2);return{type:"strong",raw:y,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(n){const s=this.rules.inline.code.exec(n);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(n){const s=this.rules.inline.br.exec(n);if(s)return{type:"br",raw:s[0]}}del(n){const s=this.rules.inline.del.exec(n);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(n){const s=this.rules.inline.autolink.exec(n);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let s;if(s=this.rules.inline.url.exec(n)){let o,a;if(s[2]==="@")o=s[0],a="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?a="http://"+s[0]:a=s[0]}return{type:"link",raw:s[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const s=this.rules.inline.text.exec(n);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Es=class ju{constructor(s){ct(this,"tokens");ct(this,"options");ct(this,"state");ct(this,"tokenizer");ct(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||kr,this.options.tokenizer=this.options.tokenizer||new ea,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:mn,block:jl.normal,inline:Gi.normal};this.options.pedantic?(r.block=jl.pedantic,r.inline=Gi.pedantic):this.options.gfm&&(r.block=jl.gfm,this.options.breaks?r.inline=Gi.breaks:r.inline=Gi.gfm),this.tokenizer.rules=r}static get rules(){return{block:jl,inline:Gi}}static lex(s,r){return new ju(r).lex(s)}static lexInline(s,r){return new ju(r).inlineTokens(s)}lex(s){s=s.replace(mn.carriageReturn,`
|
|
389
389
|
`),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],o=!1){var a,u,f;for(this.options.pedantic&&(s=s.replace(mn.tabCharGlobal," ").replace(mn.spaceLine,""));s;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(h=g.call({lexer:this},s,r))?(s=s.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.space(s)){s=s.substring(h.raw.length);const g=r.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
|
|
390
390
|
`:r.push(h);continue}if(h=this.tokenizer.code(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
391
391
|
`+h.raw,g.text+=`
|
|
@@ -395,7 +395,7 @@ ${x}`:x;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
395
395
|
`+h.raw,g.text+=`
|
|
396
396
|
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h),o=m.length!==s.length,s=s.substring(h.raw.length);continue}if(h=this.tokenizer.text(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
397
397
|
`+h.raw,g.text+=`
|
|
398
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h);continue}if(s){const g="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,m,g;let o=s,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(;s;){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},s,r))?(s=s.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(x.raw.length);const y=r.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(s,o,f)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(s)){s=s.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(s))){s=s.substring(x.raw.length),r.push(x);continue}let k=s;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0;const
|
|
398
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h);continue}if(s){const g="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,m,g;let o=s,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(;s;){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},s,r))?(s=s.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(x.raw.length);const y=r.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(s,o,f)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(s)){s=s.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(s))){s=s.substring(x.raw.length),r.push(x);continue}let k=s;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0;const N=s.slice(1);let _;this.options.extensions.startInline.forEach(E=>{_=E.call({lexer:this},N),typeof _=="number"&&_>=0&&(y=Math.min(y,_))}),y<1/0&&y>=0&&(k=s.substring(0,y+1))}if(x=this.tokenizer.inlineText(k)){s=s.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(f=x.raw.slice(-1)),u=!0;const y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},ta=class{constructor(n){ct(this,"options");ct(this,"parser");this.options=n||kr}space(n){return""}code({text:n,lang:s,escaped:r}){var u;const o=(u=(s||"").match(mn.notSpaceStart))==null?void 0:u[0],a=n.replace(mn.endingNewline,"")+`
|
|
399
399
|
`;return o?'<pre><code class="language-'+ds(o)+'">'+(r?a:ds(a,!0))+`</code></pre>
|
|
400
400
|
`:"<pre><code>"+(r?a:ds(a,!0))+`</code></pre>
|
|
401
401
|
`}blockquote({tokens:n}){return`<blockquote>
|
|
@@ -413,30 +413,30 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
413
413
|
`}tablerow({text:n}){return`<tr>
|
|
414
414
|
${n}</tr>
|
|
415
415
|
`}tablecell(n){const s=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+s+`</${r}>
|
|
416
|
-
`}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>${ds(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:r}){const o=this.parser.parseInline(r),a=
|
|
417
|
-
`+this.renderer.text(g);r?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(s,r=this.renderer){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const 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+=r.text(m);break}case"html":{o+=r.html(m);break}case"link":{o+=r.link(m);break}case"image":{o+=r.image(m);break}case"strong":{o+=r.strong(m);break}case"em":{o+=r.em(m);break}case"codespan":{o+=r.codespan(m);break}case"br":{o+=r.br(m);break}case"del":{o+=r.del(m);break}case"text":{o+=r.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}},
|
|
418
|
-
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+ds(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},xr=new
|
|
419
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ak(n,s){return ik(n)||ok(n,s)||ck(n,s)||lk()}function ck(n,s){if(n){if(typeof n=="string")return Ph(n,s);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ph(n,s):void 0}}const Cg=Object.entries,Oh=Object.setPrototypeOf,uk=Object.isFrozen,dk=Object.getPrototypeOf,fk=Object.getOwnPropertyDescriptor;let en=Object.freeze,nn=Object.seal,Zr=Object.create,Eg=typeof Reflect<"u"&&Reflect,Iu=Eg.apply,Du=Eg.construct;en||(en=function(s){return s});nn||(nn=function(s){return s});Iu||(Iu=function(s,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return s.apply(r,a)});Du||(Du=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new s(...o)});const Xr=Ot(Array.prototype.forEach),pk=Ot(Array.prototype.lastIndexOf),zh=Ot(Array.prototype.pop),Yr=Ot(Array.prototype.push),hk=Ot(Array.prototype.splice),Qs=Array.isArray,Qi=Ot(String.prototype.toLowerCase),uu=Ot(String.prototype.toString),$h=Ot(String.prototype.match),Ki=Ot(String.prototype.replace),Fh=Ot(String.prototype.indexOf),mk=Ot(String.prototype.trim),gk=Ot(Number.prototype.toString),vk=Ot(Boolean.prototype.toString),Uh=typeof BigInt>"u"?null:Ot(BigInt.prototype.toString),Bh=typeof Symbol>"u"?null:Ot(Symbol.prototype.toString),Kt=Ot(Object.prototype.hasOwnProperty),Xi=Ot(Object.prototype.toString),qt=Ot(RegExp.prototype.test),vr=yk(TypeError);function Ot(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Iu(n,s,o)}}function yk(n){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return Du(n,r)}}function Ge(n,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qi;if(Oh&&Oh(n,null),!Qs(s))return n;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(uk(s)||(s[o]=u),a=u)}n[a]=!0}return n}function xk(n){for(let s=0;s<n.length;s++)Kt(n,s)||(n[s]=null);return n}function cn(n){const s=Zr(null);for(const o of Cg(n)){var r=ak(o,2);const a=r[0],u=r[1];Kt(n,a)&&(Qs(u)?s[a]=xk(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=cn(u):s[a]=u)}return s}function wk(n){switch(typeof n){case"string":return n;case"number":return gk(n);case"boolean":return vk(n);case"bigint":return Uh?Uh(n):"0";case"symbol":return Bh?Bh(n):"Symbol()";case"undefined":return Xi(n);case"function":case"object":{if(n===null)return Xi(n);const s=n,r=ts(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:Xi(o)}return Xi(n)}default:return Xi(n)}}function ts(n,s){for(;n!==null;){const o=fk(n,s);if(o){if(o.get)return Ot(o.get);if(typeof o.value=="function")return Ot(o.value)}n=dk(n)}function r(){return null}return r}function kk(n){try{return qt(n,""),!0}catch{return!1}}const Wh=en(["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"]),du=en(["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"]),fu=en(["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"]),Sk=en(["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"]),pu=en(["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"]),Tk=en(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hh=en(["#text"]),Vh=en(["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"]),hu=en(["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"]),Gh=en(["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"]),Rl=en(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bk=nn(/{{[\w\W]*|^[\w\W]*}}/g),Nk=nn(/<%[\w\W]*|^[\w\W]*%>/g),Ck=nn(/\${[\w\W]*/g),Ek=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),_k=nn(/^aria-[\-\w]+$/),qh=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jk=nn(/^(?:\w+script|data):/i),Rk=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ak=nn(/^html$/i),Ik=nn(/^[a-z][.\w]*(-[.\w]+)+$/i),Kh=nn(/<[/\w!]/g),Xh=nn(/<[/\w]/g),Dk=nn(/<\/no(script|embed|frames)/i),Mk=nn(/\/>/i),An={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lk=function(){return typeof window>"u"?null:window},Pk=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Yh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Xs=function(s,r,o,a){return Kt(s,r)&&Qs(s[r])?Ge(a.base?cn(a.base):{},s[r],a.transform):o};function _g(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lk();const s=se=>_g(se);if(s.version="3.4.13",s.removed=[],!n||!n.document||n.document.nodeType!==An.document||!n.Element)return s.isSupported=!1,s;let r=n.document;const o=r,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,k=n.trustedTypes,y=h.prototype,E=ts(y,"cloneNode"),_=ts(y,"remove"),C=ts(y,"nextSibling"),T=ts(y,"childNodes"),L=ts(y,"parentNode"),A=ts(y,"shadowRoot"),B=ts(y,"attributes"),M=f&&f.prototype?ts(f.prototype,"nodeType"):null,W=f&&f.prototype?ts(f.prototype,"nodeName"):null,q=f&&f.prototype?ts(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const se=r.createElement("template");se.content&&se.content.ownerDocument&&(r=se.content.ownerDocument)}let K,G="",oe,ue=!1,ie=0;const we=function(){if(ie>0)throw vr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ce=function(S){we(),ie++;try{return K.createHTML(S)}finally{ie--}},Fe=function(S){we(),ie++;try{return K.createScriptURL(S)}finally{ie--}},Q=function(){return ue||(oe=Pk(k,a),ue=!0),oe},ne=r,ae=ne.implementation,O=ne.createNodeIterator,J=ne.createDocumentFragment,H=ne.getElementsByTagName,b=o.importNode;let R=Yh();s.isSupported=typeof Cg=="function"&&typeof L=="function"&&ae&&ae.createHTMLDocument!==void 0;const te=bk,ce=Nk,ge=Ck,ye=Ek,Oe=_k,Re=jk,je=Rk,be=Ik;let mt=qh,Me=null;const jt=Ge({},[...Wh,...du,...fu,...pu,...Hh]);let ze=null;const zt=Ge({},[...Vh,...hu,...Gh,...Rl]);let We=Object.seal(Zr(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}})),Wt=null,Rt=null;const gt=Object.seal(Zr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let At=!0,$t=!0,V=!1,he=!0,Ue=!1,Ze=!0,vt=!1,yt=!1,dt=null,Yt=null,sn=!1,xt=!1,un=!1,yn=!1,Gn=!0,Mn=!1;const Ln="user-content-";let Pn=!0,D=!1,_e={},le=null;const xe=Ge({},["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 ke=null;const Le=Ge({},["audio","video","img","source","image","track"]);let Se=null;const Ve=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let It=nt,st=!1,wt=null;const kt=Ge({},[ot,tt,nt],uu),Be=en(["mi","mo","mn","ms","mtext"]);let Ke=Ge({},Be);const Lt=en(["annotation-xml"]);let Qt=Ge({},Lt);const qn=Ge({},["title","style","font","a","script"]);let Kn=null;const ga=["application/xhtml+xml","text/html"],va="text/html";let rt=null,ms=null;const go=r.createElement("form"),vo=function(S){return S instanceof RegExp||S instanceof Function},Sr=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ms&&ms===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),Kn=ga.indexOf(S.PARSER_MEDIA_TYPE)===-1?va:S.PARSER_MEDIA_TYPE,rt=Kn==="application/xhtml+xml"?uu:Qi,Me=Xs(S,"ALLOWED_TAGS",jt,{transform:rt}),ze=Xs(S,"ALLOWED_ATTR",zt,{transform:rt}),wt=Xs(S,"ALLOWED_NAMESPACES",kt,{transform:uu}),Se=Xs(S,"ADD_URI_SAFE_ATTR",Ve,{transform:rt,base:Ve}),ke=Xs(S,"ADD_DATA_URI_TAGS",Le,{transform:rt,base:Le}),le=Xs(S,"FORBID_CONTENTS",xe,{transform:rt}),Wt=Xs(S,"FORBID_TAGS",cn({}),{transform:rt}),Rt=Xs(S,"FORBID_ATTR",cn({}),{transform:rt}),_e=Kt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,At=S.ALLOW_ARIA_ATTR!==!1,$t=S.ALLOW_DATA_ATTR!==!1,V=S.ALLOW_UNKNOWN_PROTOCOLS||!1,he=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=S.SAFE_FOR_TEMPLATES||!1,Ze=S.SAFE_FOR_XML!==!1,vt=S.WHOLE_DOCUMENT||!1,xt=S.RETURN_DOM||!1,un=S.RETURN_DOM_FRAGMENT||!1,yn=S.RETURN_TRUSTED_TYPE||!1,sn=S.FORCE_BODY||!1,Gn=S.SANITIZE_DOM!==!1,Mn=S.SANITIZE_NAMED_PROPS||!1,Pn=S.KEEP_CONTENT!==!1,D=S.IN_PLACE||!1,mt=kk(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:qh,It=typeof S.NAMESPACE=="string"?S.NAMESPACE:nt,Ke=Kt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ge({},Be),Qt=Kt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ge({},Lt);const z=Kt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):Zr(null);if(We=Zr(null),Kt(z,"tagNameCheck")&&vo(z.tagNameCheck)&&(We.tagNameCheck=z.tagNameCheck),Kt(z,"attributeNameCheck")&&vo(z.attributeNameCheck)&&(We.attributeNameCheck=z.attributeNameCheck),Kt(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),nn(We),Ue&&($t=!1),un&&(xt=!0),_e&&(Me=Ge({},Hh),ze=Zr(null),_e.html===!0&&(Ge(Me,Wh),Ge(ze,Vh)),_e.svg===!0&&(Ge(Me,du),Ge(ze,hu),Ge(ze,Rl)),_e.svgFilters===!0&&(Ge(Me,fu),Ge(ze,hu),Ge(ze,Rl)),_e.mathMl===!0&&(Ge(Me,pu),Ge(ze,Gh),Ge(ze,Rl))),gt.tagCheck=null,gt.attributeCheck=null,Kt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?gt.tagCheck=S.ADD_TAGS:Qs(S.ADD_TAGS)&&(Me===jt&&(Me=cn(Me)),Ge(Me,S.ADD_TAGS,rt))),Kt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?gt.attributeCheck=S.ADD_ATTR:Qs(S.ADD_ATTR)&&(ze===zt&&(ze=cn(ze)),Ge(ze,S.ADD_ATTR,rt))),Kt(S,"ADD_URI_SAFE_ATTR")&&Qs(S.ADD_URI_SAFE_ATTR)&&Ge(Se,S.ADD_URI_SAFE_ATTR,rt),Kt(S,"FORBID_CONTENTS")&&Qs(S.FORBID_CONTENTS)&&(le===xe&&(le=cn(le)),Ge(le,S.FORBID_CONTENTS,rt)),Kt(S,"ADD_FORBID_CONTENTS")&&Qs(S.ADD_FORBID_CONTENTS)&&(le===xe&&(le=cn(le)),Ge(le,S.ADD_FORBID_CONTENTS,rt)),Pn&&(Me["#text"]=!0),vt&&Ge(Me,["html","head","body"]),Me.table&&(Ge(Me,["tbody"]),delete Wt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=K;K=S.TRUSTED_TYPES_POLICY;try{G=Ce("")}catch(me){throw K=X,me}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,G=""):(K===void 0&&(K=Q()),K&&typeof G=="string"&&(G=Ce("")));en&&en(S),ms=S},di=Ge({},[...du,...fu,...Sk]),fi=Ge({},[...pu,...Tk]),yo=function(S,z,X){return z.namespaceURI===nt?S==="svg":z.namespaceURI===ot?S==="svg"&&(X==="annotation-xml"||Ke[X]):!!di[S]},ya=function(S,z,X){return z.namespaceURI===nt?S==="math":z.namespaceURI===tt?S==="math"&&Qt[X]:!!fi[S]},xa=function(S,z,X){return z.namespaceURI===tt&&!Qt[X]||z.namespaceURI===ot&&!Ke[X]?!1:!fi[S]&&(qn[S]||!di[S])},St=function(S){let z=L(S);(!z||!z.tagName)&&(z={namespaceURI:It,tagName:"template"});const X=Qi(S.tagName),me=Qi(z.tagName);return wt[S.namespaceURI]?S.namespaceURI===tt?yo(X,z,me):S.namespaceURI===ot?ya(X,z,me):S.namespaceURI===nt?xa(X,z,me):!!(Kn==="application/xhtml+xml"&&wt[S.namespaceURI]):!1},is=function(S){Yr(s.removed,{element:S});try{L(S).removeChild(S)}catch{if(_(S),!L(S))throw vr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rs=function(S){Js(S);const z=T(S);if(z){const me=[];Xr(z,Ee=>{Yr(me,Ee)}),Xr(me,Ee=>{try{_(Ee)}catch{}})}const X=B(S);if(X)for(let me=X.length-1;me>=0;--me){const Ee=X[me],$e=Ee&&Ee.name;if(typeof $e=="string")try{S.removeAttribute($e)}catch{}}},os=function(S,z){try{Yr(s.removed,{attribute:z.getAttributeNode(S),from:z})}catch{Yr(s.removed,{attribute:null,from:z})}if(z.removeAttribute(S),S==="is")if(xt||un)try{is(z)}catch{}else try{z.setAttribute(S,"")}catch{}},Tr=function(S){const z=B(S);if(z)for(let X=z.length-1;X>=0;--X){const me=z[X],Ee=me&&me.name;if(!(typeof Ee!="string"||ze[rt(Ee)]))try{S.removeAttribute(Ee)}catch{}}},Js=function(S){const z=[S];for(;z.length>0;){const X=z.pop();(M?M(X):X.nodeType)===An.element&&Tr(X);const Ee=T(X);if(Ee)for(let $e=Ee.length-1;$e>=0;--$e)z.push(Ee[$e])}},xo=function(S){if(!Ze)return;const z=[S];for(;z.length>0;){const X=z.pop(),me=M?M(X):X.nodeType;if(me===An.processingInstruction||me===An.comment&&qt(Xh,X.data)){try{_(X)}catch{}continue}if(me===An.element){const $e=X,Ye=rt(W?W(X):X.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&$e.removeAttribute("for")}catch{}}const Ee=T(X);if(Ee)for(let $e=Ee.length-1;$e>=0;--$e)z.push(Ee[$e])}},er=function(S){let z=null,X=null;if(sn)S="<remove></remove>"+S;else{const $e=$h(S,/^[\r\n\t ]+/);X=$e&&$e[0]}Kn==="application/xhtml+xml"&&It===nt&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const me=K?Ce(S):S;if(It===nt)try{z=new x().parseFromString(me,Kn)}catch{}if(!z||!z.documentElement){z=ae.createDocument(It,"template",null);try{z.documentElement.innerHTML=st?G:me}catch{}}const Ee=z.body||z.documentElement;return S&&X&&Ee.insertBefore(r.createTextNode(X),Ee.childNodes[0]||null),It===nt?H.call(z,vt?"html":"body")[0]:vt?z.documentElement:Ee},Cn=function(S){const z=q?q(S):S.ownerDocument;return O.call(z||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},br=function(S){return S=Ki(S,te," "),S=Ki(S,ce," "),S=Ki(S,ge," "),S},dn=function(S){var z;S.normalize();const X=q?q(S):S.ownerDocument,me=O.call(X||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ee=me.nextNode();for(;Ee;)Ee.data=br(Ee.data),Ee=me.nextNode();const $e=(z=S.querySelectorAll)===null||z===void 0?void 0:z.call(S,"template");$e&&Xr($e,Ye=>{As(Ye.content)&&dn(Ye.content)})},Nr=function(S){const z=W?W(S):null;return typeof z!="string"||rt(z)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==B(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==M(S)||S.childNodes!==T(S)},As=function(S){if(!M||typeof S!="object"||S===null)return!1;try{return M(S)===An.documentFragment}catch{return!1}},tr=function(S){if(!M||typeof S!="object"||S===null)return!1;try{return typeof M(S)=="number"}catch{return!1}};function fn(se,S,z){se.length!==0&&Xr(se,X=>{X.call(s,S,z,ms)})}const Cr=function(S,z){return!!(Ze&&S.hasChildNodes()&&!tr(S.firstElementChild)&&qt(Kh,S.textContent)&&qt(Kh,S.innerHTML)||Ze&&S.namespaceURI===nt&&z==="style"&&tr(S.firstElementChild)||S.nodeType===An.processingInstruction||Ze&&S.nodeType===An.comment&&qt(Xh,S.data))},nr=function(S,z,X){if(!Wt[z]&&hi(z)&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,z)||We.tagNameCheck instanceof Function&&We.tagNameCheck(z)))return!1;if(Pn&&!le[z]){const me=L(S),Ee=T(S);if(Ee&&me){const $e=Ee.length;for(let Ye=$e-1;Ye>=0;--Ye){const Je=S===X?E(Ee[Ye],!0):Ee[Ye];me.insertBefore(Je,C(S))}}}return is(S),!0},sr=function(S,z,X,me){return S.length===0?z:z===X||z===me?cn(z):z},wo=function(S,z){if(fn(R.beforeSanitizeElements,S,null),S!==z&&L(S)===null)return D&&Js(S),!0;if(Nr(S))return is(S),!0;const X=rt(W?W(S):S.nodeName);if(Me=sr(R.uponSanitizeElement,Me,jt,dt),fn(R.uponSanitizeElement,S,{tagName:X,allowedTags:Me}),S!==z&&L(S)===null)return D&&Js(S),!0;if(Cr(S,X))return is(S),!0;if(Wt[X]||!(gt.tagCheck instanceof Function&>.tagCheck(X))&&!Me[X]){const Ee=nr(S,X,z);return Ee===!1&&fn(R.afterSanitizeElements,S,null),Ee}if((M?M(S):S.nodeType)===An.element&&!St(S)||(X==="noscript"||X==="noembed"||X==="noframes")&&qt(Dk,S.innerHTML))return is(S),!0;if(Ue&&S.nodeType===An.text){const Ee=br(S.textContent);S.textContent!==Ee&&(Yr(s.removed,{element:S.cloneNode()}),S.textContent=Ee)}return fn(R.afterSanitizeElements,S,null),!1},ko=function(S,z,X){if(Rt[z]||Ze&&z==="patchsrc"||Ze&&z==="for"&&S!=="label"&&S!=="output"||Gn&&(z==="id"||z==="name")&&(X in r||X in go))return!1;const me=ze[z]||gt.attributeCheck instanceof Function&>.attributeCheck(z,S);if(!($t&&qt(ye,z))){if(!(At&&qt(Oe,z))){if(me){if(!Se[z]){if(!qt(mt,Ki(X,je,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&S!=="script"&&Fh(X,"data:")===0&&ke[S])){if(!(V&&!qt(Re,Ki(X,je,"")))){if(X)return!1}}}}}else if(!(hi(S)&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,S)||We.tagNameCheck instanceof Function&&We.tagNameCheck(S))&&(We.attributeNameCheck instanceof RegExp&&qt(We.attributeNameCheck,z)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(z,S))||z==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,X)||We.tagNameCheck instanceof Function&&We.tagNameCheck(X))))return!1}}return!0},pi=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),hi=function(S){return!pi[Qi(S)]&&qt(be,S)},mi=function(S,z,X,me){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!X)switch(k.getAttributeType(S,z)){case"TrustedHTML":return Ce(me);case"TrustedScriptURL":return Fe(me)}return me},rr=function(S,z,X,me){try{X?S.setAttributeNS(X,z,me):S.setAttribute(z,me),Nr(S)?is(S):zh(s.removed)}catch{os(z,S)}},So=function(S){fn(R.beforeSanitizeAttributes,S,null);const z=S.attributes;if(!z||Nr(S))return;ze=sr(R.uponSanitizeAttribute,ze,zt,Yt);const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let me=z.length;const Ee=rt(S.nodeName);for(;me--;){const $e=z[me],Ye=$e.name,Je=$e.namespaceURI,Tt=$e.value,bt=rt(Ye),gs=Tt;let Dt=Ye==="value"?gs:mk(gs);if(X.attrName=bt,X.attrValue=Dt,X.keepAttr=!0,X.forceKeepAttr=void 0,fn(R.uponSanitizeAttribute,S,X),Dt=X.attrValue,Mn&&(bt==="id"||bt==="name")&&Fh(Dt,Ln)!==0&&(os(Ye,S),Dt=Ln+Dt),Ze&&qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Dt)){os(Ye,S);continue}if(bt==="attributename"&&$h(Dt,"href")){os(Ye,S);continue}if(!X.forceKeepAttr){if(!X.keepAttr){os(Ye,S);continue}if(!he&&qt(Mk,Dt)){os(Ye,S);continue}if(Ue&&(Dt=br(Dt)),!ko(Ee,bt,Dt)){os(Ye,S);continue}Dt=mi(Ee,bt,Je,Dt),Dt!==gs&&rr(S,Ye,Je,Dt)}}fn(R.afterSanitizeAttributes,S,null)},Is=function(S){let z=null;const X=Cn(S);for(fn(R.beforeSanitizeShadowDOM,S,null);z=X.nextNode();)if(fn(R.uponSanitizeShadowNode,z,null),wo(z,S),So(z),As(z.content)&&Is(z.content),(M?M(z):z.nodeType)===An.element){const Ee=A(z);As(Ee)&&(Xe(Ee),Is(Ee))}fn(R.afterSanitizeShadowDOM,S,null)},Xe=function(S){const z=[{node:S,shadow:null}];for(;z.length>0;){const X=z.pop();if(X.shadow){Is(X.shadow);continue}const me=X.node,$e=(M?M(me):me.nodeType)===An.element,Ye=T(me);if(Ye)for(let Je=Ye.length-1;Je>=0;--Je)z.push({node:Ye[Je],shadow:null});if($e){const Je=W?W(me):null;if(typeof Je=="string"&&rt(Je)==="template"){const Tt=me.content;As(Tt)&&z.push({node:Tt,shadow:null})}}if($e){const Je=A(me);As(Je)&&z.push({node:null,shadow:Je},{node:Je,shadow:null})}}};return s.sanitize=function(se){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,X=null,me=null,Ee=null;if(st=!se,st&&(se="<!-->"),typeof se!="string"&&!tr(se)&&(se=wk(se),typeof se!="string"))throw vr("dirty is not a string, aborting");if(!s.isSupported)return se;yt?(Me=dt,ze=Yt):Sr(S),(R.uponSanitizeElement.length>0||R.uponSanitizeAttribute.length>0)&&(Me=cn(Me)),R.uponSanitizeAttribute.length>0&&(ze=cn(ze)),s.removed=[];const $e=D&&typeof se!="string"&&tr(se);if($e){xo(se);const Tt=W?W(se):se.nodeName;if(typeof Tt=="string"){const bt=rt(Tt);if(!Me[bt]||Wt[bt])throw Rs(se),vr("root node is forbidden and cannot be sanitized in-place")}if(Nr(se))throw Rs(se),vr("root node is clobbered and cannot be sanitized in-place");try{Xe(se)}catch(bt){throw Rs(se),bt}}else if(tr(se))z=er("<!---->"),X=z.ownerDocument.importNode(se,!0),X.nodeType===An.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?z=X:z.appendChild(X),Xe(X);else{if(!xt&&!Ue&&!vt&&se.indexOf("<")===-1)return K&&yn?Ce(se):se;if(z=er(se),!z)return xt?null:yn?G:""}z&&sn&&is(z.firstChild);const Ye=$e?se:z;try{const Tt=Cn(Ye);for(;me=Tt.nextNode();)wo(me,Ye),So(me),As(me.content)&&Is(me.content)}catch(Tt){throw $e&&(Rs(se),Xr(s.removed,bt=>{bt.element&&Js(bt.element)})),Tt}if($e)return Xr(s.removed,Tt=>{Tt.element&&Js(Tt.element)}),Ue&&dn(se),se;if(xt){if(Ue&&dn(z),un)for(Ee=J.call(z.ownerDocument);z.firstChild;)Ee.appendChild(z.firstChild);else Ee=z;return(ze.shadowroot||ze.shadowrootmode)&&(Ee=b.call(o,Ee,!0)),Ee}let Je=vt?z.outerHTML:z.innerHTML;return vt&&Me["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&qt(Ak,z.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
420
|
-
`+Je),Ue&&(Je=br(Je)),K&&yn?Ce(Je):Je},s.setConfig=function(){let se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(se),yt=!0,dt=Me,Yt=ze},s.clearConfig=function(){ms=null,yt=!1,dt=null,Yt=null,K=oe,G=""},s.isValidAttribute=function(se,S,z){ms||Sr({});const X=rt(se),me=rt(S);return ko(X,me,z)},s.addHook=function(se,S){typeof S=="function"&&Kt(R,se)&&Yr(R[se],S)},s.removeHook=function(se,S){if(Kt(R,se)){if(S!==void 0){const z=
|
|
416
|
+
`}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>${ds(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:r}){const o=this.parser.parseInline(r),a=Ih(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return s&&(u+=' title="'+ds(s)+'"'),u+=">"+o+"</a>",u}image({href:n,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const a=Ih(n);if(a===null)return ds(r);n=a;let u=`<img src="${n}" alt="${r}"`;return s&&(u+=` title="${ds(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ds(n.text)}},pd=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""}},_s=class Ru{constructor(s){ct(this,"options");ct(this,"renderer");ct(this,"textRenderer");this.options=s||kr,this.options.renderer=this.options.renderer||new ta,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new pd}static parse(s,r){return new Ru(r).parse(s)}static parseInline(s,r){return new Ru(r).parseInline(s)}parse(s,r=!0){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const 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<s.length&&s[f+1].type==="text";)g=s[++f],x+=`
|
|
417
|
+
`+this.renderer.text(g);r?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(s,r=this.renderer){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const 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+=r.text(m);break}case"html":{o+=r.html(m);break}case"link":{o+=r.link(m);break}case"image":{o+=r.image(m);break}case"strong":{o+=r.strong(m);break}case"em":{o+=r.em(m);break}case"codespan":{o+=r.codespan(m);break}case"br":{o+=r.br(m);break}case"del":{o+=r.del(m);break}case"text":{o+=r.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}},gu,Ol=(gu=class{constructor(n){ct(this,"options");ct(this,"block");this.options=n||kr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Es.lex:Es.lexInline}provideParser(){return this.block?_s.parse:_s.parseInline}},ct(gu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),gu),sk=class{constructor(...n){ct(this,"defaults",id());ct(this,"options",this.setOptions);ct(this,"parse",this.parseMarkdown(!0));ct(this,"parseInline",this.parseMarkdown(!1));ct(this,"Parser",_s);ct(this,"Renderer",ta);ct(this,"TextRenderer",pd);ct(this,"Lexer",Es);ct(this,"Tokenizer",ea);ct(this,"Hooks",Ol);this.use(...n)}walkTokens(n,s){var o,a;let r=[];for(const u of n)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)r=r.concat(this.walkTokens(h.tokens,s));for(const h of f.rows)for(const m of h)r=r.concat(this.walkTokens(m.tokens,s));break}case"list":{const f=u;r=r.concat(this.walkTokens(f.items,s));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const m=f[h].flat(1/0);r=r.concat(this.walkTokens(m,s))}):f.tokens&&(r=r.concat(this.walkTokens(f.tokens,s)))}}return r}use(...n){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=s.renderers[a.name];u?s.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:s.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=s[a.level];u?u.unshift(a.tokenizer):s[a.level]=[a.tokenizer],a.start&&(a.level==="block"?s.startBlock?s.startBlock.push(a.start):s.startBlock=[a.start]:a.level==="inline"&&(s.startInline?s.startInline.push(a.start):s.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(s.childTokens[a.name]=a.childTokens)}),o.extensions=s),r.renderer){const a=this.defaults.renderer||new ta(this.defaults);for(const u in r.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=r.renderer[f],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(r.tokenizer){const a=this.defaults.tokenizer||new ea(this.defaults);for(const u in r.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=r.tokenizer[f],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(r.hooks){const a=this.defaults.hooks||new Ol;for(const u in r.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=r.hooks[f],m=a[f];Ol.passThroughHooks.has(u)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(h.call(a,g)).then(k=>m.call(a,k));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(r.walkTokens){const a=this.defaults.walkTokens,u=r.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,s){return Es.lex(n,s??this.defaults)}parser(n,s){return _s.parse(n,s??this.defaults)}parseMarkdown(n){return(r,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&a.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?Es.lex:Es.lexInline,m=u.hooks?u.hooks.provideParser():n?_s.parse:_s.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).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&&(r=u.hooks.preprocess(r));let g=h(r,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,s){return r=>{if(r.message+=`
|
|
418
|
+
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+ds(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},xr=new sk;function qe(n,s){return xr.parse(n,s)}qe.options=qe.setOptions=function(n){return xr.setOptions(n),qe.defaults=xr.defaults,mg(qe.defaults),qe};qe.getDefaults=id;qe.defaults=kr;qe.use=function(...n){return xr.use(...n),qe.defaults=xr.defaults,mg(qe.defaults),qe};qe.walkTokens=function(n,s){return xr.walkTokens(n,s)};qe.parseInline=xr.parseInline;qe.Parser=_s;qe.parser=_s.parse;qe.Renderer=ta;qe.TextRenderer=pd;qe.Lexer=Es;qe.lexer=Es.lex;qe.Tokenizer=ea;qe.Hooks=Ol;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;_s.parse;Es.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 Lh(n,s){(s==null||s>n.length)&&(s=n.length);for(var r=0,o=Array(s);r<s;r++)o[r]=n[r];return o}function rk(n){if(Array.isArray(n))return n}function ik(n,s){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,a,u,f,h=[],m=!0,g=!1;try{if(u=(r=r.call(n)).next,s!==0)for(;!(m=(o=u.call(r)).done)&&(h.push(o.value),h.length!==s);m=!0);}catch(x){g=!0,a=x}finally{try{if(!m&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function ok(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
419
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lk(n,s){return rk(n)||ik(n,s)||ak(n,s)||ok()}function ak(n,s){if(n){if(typeof n=="string")return Lh(n,s);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lh(n,s):void 0}}const Cg=Object.entries,Ph=Object.setPrototypeOf,ck=Object.isFrozen,uk=Object.getPrototypeOf,dk=Object.getOwnPropertyDescriptor;let en=Object.freeze,nn=Object.seal,Zr=Object.create,Eg=typeof Reflect<"u"&&Reflect,Au=Eg.apply,Iu=Eg.construct;en||(en=function(s){return s});nn||(nn=function(s){return s});Au||(Au=function(s,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return s.apply(r,a)});Iu||(Iu=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new s(...o)});const Xr=Ot(Array.prototype.forEach),fk=Ot(Array.prototype.lastIndexOf),Oh=Ot(Array.prototype.pop),Yr=Ot(Array.prototype.push),pk=Ot(Array.prototype.splice),Qs=Array.isArray,Qi=Ot(String.prototype.toLowerCase),cu=Ot(String.prototype.toString),zh=Ot(String.prototype.match),Ki=Ot(String.prototype.replace),$h=Ot(String.prototype.indexOf),hk=Ot(String.prototype.trim),mk=Ot(Number.prototype.toString),gk=Ot(Boolean.prototype.toString),Fh=typeof BigInt>"u"?null:Ot(BigInt.prototype.toString),Uh=typeof Symbol>"u"?null:Ot(Symbol.prototype.toString),Kt=Ot(Object.prototype.hasOwnProperty),Xi=Ot(Object.prototype.toString),qt=Ot(RegExp.prototype.test),vr=vk(TypeError);function Ot(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Au(n,s,o)}}function vk(n){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return Iu(n,r)}}function Ge(n,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qi;if(Ph&&Ph(n,null),!Qs(s))return n;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(ck(s)||(s[o]=u),a=u)}n[a]=!0}return n}function yk(n){for(let s=0;s<n.length;s++)Kt(n,s)||(n[s]=null);return n}function cn(n){const s=Zr(null);for(const o of Cg(n)){var r=lk(o,2);const a=r[0],u=r[1];Kt(n,a)&&(Qs(u)?s[a]=yk(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=cn(u):s[a]=u)}return s}function xk(n){switch(typeof n){case"string":return n;case"number":return mk(n);case"boolean":return gk(n);case"bigint":return Fh?Fh(n):"0";case"symbol":return Uh?Uh(n):"Symbol()";case"undefined":return Xi(n);case"function":case"object":{if(n===null)return Xi(n);const s=n,r=ts(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:Xi(o)}return Xi(n)}default:return Xi(n)}}function ts(n,s){for(;n!==null;){const o=dk(n,s);if(o){if(o.get)return Ot(o.get);if(typeof o.value=="function")return Ot(o.value)}n=uk(n)}function r(){return null}return r}function wk(n){try{return qt(n,""),!0}catch{return!1}}const Bh=en(["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"]),uu=en(["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"]),du=en(["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"]),kk=en(["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"]),fu=en(["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"]),Sk=en(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wh=en(["#text"]),Hh=en(["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"]),pu=en(["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"]),Vh=en(["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"]),Rl=en(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Tk=nn(/{{[\w\W]*|^[\w\W]*}}/g),bk=nn(/<%[\w\W]*|^[\w\W]*%>/g),Nk=nn(/\${[\w\W]*/g),Ck=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ek=nn(/^aria-[\-\w]+$/),Gh=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_k=nn(/^(?:\w+script|data):/i),jk=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rk=nn(/^html$/i),Ak=nn(/^[a-z][.\w]*(-[.\w]+)+$/i),qh=nn(/<[/\w!]/g),Kh=nn(/<[/\w]/g),Ik=nn(/<\/no(script|embed|frames)/i),Dk=nn(/\/>/i),An={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Mk=function(){return typeof window>"u"?null:window},Lk=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Xh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Xs=function(s,r,o,a){return Kt(s,r)&&Qs(s[r])?Ge(a.base?cn(a.base):{},s[r],a.transform):o};function _g(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Mk();const s=se=>_g(se);if(s.version="3.4.13",s.removed=[],!n||!n.document||n.document.nodeType!==An.document||!n.Element)return s.isSupported=!1,s;let r=n.document;const o=r,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,k=n.trustedTypes,y=h.prototype,N=ts(y,"cloneNode"),_=ts(y,"remove"),E=ts(y,"nextSibling"),T=ts(y,"childNodes"),L=ts(y,"parentNode"),A=ts(y,"shadowRoot"),B=ts(y,"attributes"),M=f&&f.prototype?ts(f.prototype,"nodeType"):null,W=f&&f.prototype?ts(f.prototype,"nodeName"):null,q=f&&f.prototype?ts(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const se=r.createElement("template");se.content&&se.content.ownerDocument&&(r=se.content.ownerDocument)}let K,G="",oe,ue=!1,ie=0;const we=function(){if(ie>0)throw vr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ce=function(S){we(),ie++;try{return K.createHTML(S)}finally{ie--}},Fe=function(S){we(),ie++;try{return K.createScriptURL(S)}finally{ie--}},Q=function(){return ue||(oe=Lk(k,a),ue=!0),oe},ne=r,ae=ne.implementation,O=ne.createNodeIterator,J=ne.createDocumentFragment,H=ne.getElementsByTagName,b=o.importNode;let R=Xh();s.isSupported=typeof Cg=="function"&&typeof L=="function"&&ae&&ae.createHTMLDocument!==void 0;const te=Tk,ce=bk,ge=Nk,ye=Ck,Oe=Ek,Re=_k,je=jk,be=Ak;let mt=Gh,Me=null;const jt=Ge({},[...Bh,...uu,...du,...fu,...Wh]);let ze=null;const zt=Ge({},[...Hh,...pu,...Vh,...Rl]);let We=Object.seal(Zr(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}})),Wt=null,Rt=null;const gt=Object.seal(Zr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let At=!0,$t=!0,V=!1,he=!0,Ue=!1,Ze=!0,vt=!1,yt=!1,dt=null,Yt=null,sn=!1,xt=!1,un=!1,yn=!1,Gn=!0,Mn=!1;const Ln="user-content-";let Pn=!0,D=!1,_e={},le=null;const xe=Ge({},["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 ke=null;const Le=Ge({},["audio","video","img","source","image","track"]);let Se=null;const Ve=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let It=nt,st=!1,wt=null;const kt=Ge({},[ot,tt,nt],cu),Be=en(["mi","mo","mn","ms","mtext"]);let Ke=Ge({},Be);const Lt=en(["annotation-xml"]);let Qt=Ge({},Lt);const qn=Ge({},["title","style","font","a","script"]);let Kn=null;const ma=["application/xhtml+xml","text/html"],ga="text/html";let rt=null,ms=null;const go=r.createElement("form"),vo=function(S){return S instanceof RegExp||S instanceof Function},Sr=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ms&&ms===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),Kn=ma.indexOf(S.PARSER_MEDIA_TYPE)===-1?ga:S.PARSER_MEDIA_TYPE,rt=Kn==="application/xhtml+xml"?cu:Qi,Me=Xs(S,"ALLOWED_TAGS",jt,{transform:rt}),ze=Xs(S,"ALLOWED_ATTR",zt,{transform:rt}),wt=Xs(S,"ALLOWED_NAMESPACES",kt,{transform:cu}),Se=Xs(S,"ADD_URI_SAFE_ATTR",Ve,{transform:rt,base:Ve}),ke=Xs(S,"ADD_DATA_URI_TAGS",Le,{transform:rt,base:Le}),le=Xs(S,"FORBID_CONTENTS",xe,{transform:rt}),Wt=Xs(S,"FORBID_TAGS",cn({}),{transform:rt}),Rt=Xs(S,"FORBID_ATTR",cn({}),{transform:rt}),_e=Kt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,At=S.ALLOW_ARIA_ATTR!==!1,$t=S.ALLOW_DATA_ATTR!==!1,V=S.ALLOW_UNKNOWN_PROTOCOLS||!1,he=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=S.SAFE_FOR_TEMPLATES||!1,Ze=S.SAFE_FOR_XML!==!1,vt=S.WHOLE_DOCUMENT||!1,xt=S.RETURN_DOM||!1,un=S.RETURN_DOM_FRAGMENT||!1,yn=S.RETURN_TRUSTED_TYPE||!1,sn=S.FORCE_BODY||!1,Gn=S.SANITIZE_DOM!==!1,Mn=S.SANITIZE_NAMED_PROPS||!1,Pn=S.KEEP_CONTENT!==!1,D=S.IN_PLACE||!1,mt=wk(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:Gh,It=typeof S.NAMESPACE=="string"?S.NAMESPACE:nt,Ke=Kt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ge({},Be),Qt=Kt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ge({},Lt);const z=Kt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):Zr(null);if(We=Zr(null),Kt(z,"tagNameCheck")&&vo(z.tagNameCheck)&&(We.tagNameCheck=z.tagNameCheck),Kt(z,"attributeNameCheck")&&vo(z.attributeNameCheck)&&(We.attributeNameCheck=z.attributeNameCheck),Kt(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),nn(We),Ue&&($t=!1),un&&(xt=!0),_e&&(Me=Ge({},Wh),ze=Zr(null),_e.html===!0&&(Ge(Me,Bh),Ge(ze,Hh)),_e.svg===!0&&(Ge(Me,uu),Ge(ze,pu),Ge(ze,Rl)),_e.svgFilters===!0&&(Ge(Me,du),Ge(ze,pu),Ge(ze,Rl)),_e.mathMl===!0&&(Ge(Me,fu),Ge(ze,Vh),Ge(ze,Rl))),gt.tagCheck=null,gt.attributeCheck=null,Kt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?gt.tagCheck=S.ADD_TAGS:Qs(S.ADD_TAGS)&&(Me===jt&&(Me=cn(Me)),Ge(Me,S.ADD_TAGS,rt))),Kt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?gt.attributeCheck=S.ADD_ATTR:Qs(S.ADD_ATTR)&&(ze===zt&&(ze=cn(ze)),Ge(ze,S.ADD_ATTR,rt))),Kt(S,"ADD_URI_SAFE_ATTR")&&Qs(S.ADD_URI_SAFE_ATTR)&&Ge(Se,S.ADD_URI_SAFE_ATTR,rt),Kt(S,"FORBID_CONTENTS")&&Qs(S.FORBID_CONTENTS)&&(le===xe&&(le=cn(le)),Ge(le,S.FORBID_CONTENTS,rt)),Kt(S,"ADD_FORBID_CONTENTS")&&Qs(S.ADD_FORBID_CONTENTS)&&(le===xe&&(le=cn(le)),Ge(le,S.ADD_FORBID_CONTENTS,rt)),Pn&&(Me["#text"]=!0),vt&&Ge(Me,["html","head","body"]),Me.table&&(Ge(Me,["tbody"]),delete Wt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=K;K=S.TRUSTED_TYPES_POLICY;try{G=Ce("")}catch(me){throw K=X,me}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,G=""):(K===void 0&&(K=Q()),K&&typeof G=="string"&&(G=Ce("")));en&&en(S),ms=S},di=Ge({},[...uu,...du,...kk]),fi=Ge({},[...fu,...Sk]),yo=function(S,z,X){return z.namespaceURI===nt?S==="svg":z.namespaceURI===ot?S==="svg"&&(X==="annotation-xml"||Ke[X]):!!di[S]},va=function(S,z,X){return z.namespaceURI===nt?S==="math":z.namespaceURI===tt?S==="math"&&Qt[X]:!!fi[S]},ya=function(S,z,X){return z.namespaceURI===tt&&!Qt[X]||z.namespaceURI===ot&&!Ke[X]?!1:!fi[S]&&(qn[S]||!di[S])},St=function(S){let z=L(S);(!z||!z.tagName)&&(z={namespaceURI:It,tagName:"template"});const X=Qi(S.tagName),me=Qi(z.tagName);return wt[S.namespaceURI]?S.namespaceURI===tt?yo(X,z,me):S.namespaceURI===ot?va(X,z,me):S.namespaceURI===nt?ya(X,z,me):!!(Kn==="application/xhtml+xml"&&wt[S.namespaceURI]):!1},is=function(S){Yr(s.removed,{element:S});try{L(S).removeChild(S)}catch{if(_(S),!L(S))throw vr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rs=function(S){Js(S);const z=T(S);if(z){const me=[];Xr(z,Ee=>{Yr(me,Ee)}),Xr(me,Ee=>{try{_(Ee)}catch{}})}const X=B(S);if(X)for(let me=X.length-1;me>=0;--me){const Ee=X[me],$e=Ee&&Ee.name;if(typeof $e=="string")try{S.removeAttribute($e)}catch{}}},os=function(S,z){try{Yr(s.removed,{attribute:z.getAttributeNode(S),from:z})}catch{Yr(s.removed,{attribute:null,from:z})}if(z.removeAttribute(S),S==="is")if(xt||un)try{is(z)}catch{}else try{z.setAttribute(S,"")}catch{}},Tr=function(S){const z=B(S);if(z)for(let X=z.length-1;X>=0;--X){const me=z[X],Ee=me&&me.name;if(!(typeof Ee!="string"||ze[rt(Ee)]))try{S.removeAttribute(Ee)}catch{}}},Js=function(S){const z=[S];for(;z.length>0;){const X=z.pop();(M?M(X):X.nodeType)===An.element&&Tr(X);const Ee=T(X);if(Ee)for(let $e=Ee.length-1;$e>=0;--$e)z.push(Ee[$e])}},xo=function(S){if(!Ze)return;const z=[S];for(;z.length>0;){const X=z.pop(),me=M?M(X):X.nodeType;if(me===An.processingInstruction||me===An.comment&&qt(Kh,X.data)){try{_(X)}catch{}continue}if(me===An.element){const $e=X,Ye=rt(W?W(X):X.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&$e.removeAttribute("for")}catch{}}const Ee=T(X);if(Ee)for(let $e=Ee.length-1;$e>=0;--$e)z.push(Ee[$e])}},er=function(S){let z=null,X=null;if(sn)S="<remove></remove>"+S;else{const $e=zh(S,/^[\r\n\t ]+/);X=$e&&$e[0]}Kn==="application/xhtml+xml"&&It===nt&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const me=K?Ce(S):S;if(It===nt)try{z=new x().parseFromString(me,Kn)}catch{}if(!z||!z.documentElement){z=ae.createDocument(It,"template",null);try{z.documentElement.innerHTML=st?G:me}catch{}}const Ee=z.body||z.documentElement;return S&&X&&Ee.insertBefore(r.createTextNode(X),Ee.childNodes[0]||null),It===nt?H.call(z,vt?"html":"body")[0]:vt?z.documentElement:Ee},Cn=function(S){const z=q?q(S):S.ownerDocument;return O.call(z||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},br=function(S){return S=Ki(S,te," "),S=Ki(S,ce," "),S=Ki(S,ge," "),S},dn=function(S){var z;S.normalize();const X=q?q(S):S.ownerDocument,me=O.call(X||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ee=me.nextNode();for(;Ee;)Ee.data=br(Ee.data),Ee=me.nextNode();const $e=(z=S.querySelectorAll)===null||z===void 0?void 0:z.call(S,"template");$e&&Xr($e,Ye=>{As(Ye.content)&&dn(Ye.content)})},Nr=function(S){const z=W?W(S):null;return typeof z!="string"||rt(z)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==B(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==M(S)||S.childNodes!==T(S)},As=function(S){if(!M||typeof S!="object"||S===null)return!1;try{return M(S)===An.documentFragment}catch{return!1}},tr=function(S){if(!M||typeof S!="object"||S===null)return!1;try{return typeof M(S)=="number"}catch{return!1}};function fn(se,S,z){se.length!==0&&Xr(se,X=>{X.call(s,S,z,ms)})}const Cr=function(S,z){return!!(Ze&&S.hasChildNodes()&&!tr(S.firstElementChild)&&qt(qh,S.textContent)&&qt(qh,S.innerHTML)||Ze&&S.namespaceURI===nt&&z==="style"&&tr(S.firstElementChild)||S.nodeType===An.processingInstruction||Ze&&S.nodeType===An.comment&&qt(Kh,S.data))},nr=function(S,z,X){if(!Wt[z]&&hi(z)&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,z)||We.tagNameCheck instanceof Function&&We.tagNameCheck(z)))return!1;if(Pn&&!le[z]){const me=L(S),Ee=T(S);if(Ee&&me){const $e=Ee.length;for(let Ye=$e-1;Ye>=0;--Ye){const Je=S===X?N(Ee[Ye],!0):Ee[Ye];me.insertBefore(Je,E(S))}}}return is(S),!0},sr=function(S,z,X,me){return S.length===0?z:z===X||z===me?cn(z):z},wo=function(S,z){if(fn(R.beforeSanitizeElements,S,null),S!==z&&L(S)===null)return D&&Js(S),!0;if(Nr(S))return is(S),!0;const X=rt(W?W(S):S.nodeName);if(Me=sr(R.uponSanitizeElement,Me,jt,dt),fn(R.uponSanitizeElement,S,{tagName:X,allowedTags:Me}),S!==z&&L(S)===null)return D&&Js(S),!0;if(Cr(S,X))return is(S),!0;if(Wt[X]||!(gt.tagCheck instanceof Function&>.tagCheck(X))&&!Me[X]){const Ee=nr(S,X,z);return Ee===!1&&fn(R.afterSanitizeElements,S,null),Ee}if((M?M(S):S.nodeType)===An.element&&!St(S)||(X==="noscript"||X==="noembed"||X==="noframes")&&qt(Ik,S.innerHTML))return is(S),!0;if(Ue&&S.nodeType===An.text){const Ee=br(S.textContent);S.textContent!==Ee&&(Yr(s.removed,{element:S.cloneNode()}),S.textContent=Ee)}return fn(R.afterSanitizeElements,S,null),!1},ko=function(S,z,X){if(Rt[z]||Ze&&z==="patchsrc"||Ze&&z==="for"&&S!=="label"&&S!=="output"||Gn&&(z==="id"||z==="name")&&(X in r||X in go))return!1;const me=ze[z]||gt.attributeCheck instanceof Function&>.attributeCheck(z,S);if(!($t&&qt(ye,z))){if(!(At&&qt(Oe,z))){if(me){if(!Se[z]){if(!qt(mt,Ki(X,je,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&S!=="script"&&$h(X,"data:")===0&&ke[S])){if(!(V&&!qt(Re,Ki(X,je,"")))){if(X)return!1}}}}}else if(!(hi(S)&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,S)||We.tagNameCheck instanceof Function&&We.tagNameCheck(S))&&(We.attributeNameCheck instanceof RegExp&&qt(We.attributeNameCheck,z)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(z,S))||z==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,X)||We.tagNameCheck instanceof Function&&We.tagNameCheck(X))))return!1}}return!0},pi=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),hi=function(S){return!pi[Qi(S)]&&qt(be,S)},mi=function(S,z,X,me){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!X)switch(k.getAttributeType(S,z)){case"TrustedHTML":return Ce(me);case"TrustedScriptURL":return Fe(me)}return me},rr=function(S,z,X,me){try{X?S.setAttributeNS(X,z,me):S.setAttribute(z,me),Nr(S)?is(S):Oh(s.removed)}catch{os(z,S)}},So=function(S){fn(R.beforeSanitizeAttributes,S,null);const z=S.attributes;if(!z||Nr(S))return;ze=sr(R.uponSanitizeAttribute,ze,zt,Yt);const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let me=z.length;const Ee=rt(S.nodeName);for(;me--;){const $e=z[me],Ye=$e.name,Je=$e.namespaceURI,Tt=$e.value,bt=rt(Ye),gs=Tt;let Dt=Ye==="value"?gs:hk(gs);if(X.attrName=bt,X.attrValue=Dt,X.keepAttr=!0,X.forceKeepAttr=void 0,fn(R.uponSanitizeAttribute,S,X),Dt=X.attrValue,Mn&&(bt==="id"||bt==="name")&&$h(Dt,Ln)!==0&&(os(Ye,S),Dt=Ln+Dt),Ze&&qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Dt)){os(Ye,S);continue}if(bt==="attributename"&&zh(Dt,"href")){os(Ye,S);continue}if(!X.forceKeepAttr){if(!X.keepAttr){os(Ye,S);continue}if(!he&&qt(Dk,Dt)){os(Ye,S);continue}if(Ue&&(Dt=br(Dt)),!ko(Ee,bt,Dt)){os(Ye,S);continue}Dt=mi(Ee,bt,Je,Dt),Dt!==gs&&rr(S,Ye,Je,Dt)}}fn(R.afterSanitizeAttributes,S,null)},Is=function(S){let z=null;const X=Cn(S);for(fn(R.beforeSanitizeShadowDOM,S,null);z=X.nextNode();)if(fn(R.uponSanitizeShadowNode,z,null),wo(z,S),So(z),As(z.content)&&Is(z.content),(M?M(z):z.nodeType)===An.element){const Ee=A(z);As(Ee)&&(Xe(Ee),Is(Ee))}fn(R.afterSanitizeShadowDOM,S,null)},Xe=function(S){const z=[{node:S,shadow:null}];for(;z.length>0;){const X=z.pop();if(X.shadow){Is(X.shadow);continue}const me=X.node,$e=(M?M(me):me.nodeType)===An.element,Ye=T(me);if(Ye)for(let Je=Ye.length-1;Je>=0;--Je)z.push({node:Ye[Je],shadow:null});if($e){const Je=W?W(me):null;if(typeof Je=="string"&&rt(Je)==="template"){const Tt=me.content;As(Tt)&&z.push({node:Tt,shadow:null})}}if($e){const Je=A(me);As(Je)&&z.push({node:null,shadow:Je},{node:Je,shadow:null})}}};return s.sanitize=function(se){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,X=null,me=null,Ee=null;if(st=!se,st&&(se="<!-->"),typeof se!="string"&&!tr(se)&&(se=xk(se),typeof se!="string"))throw vr("dirty is not a string, aborting");if(!s.isSupported)return se;yt?(Me=dt,ze=Yt):Sr(S),(R.uponSanitizeElement.length>0||R.uponSanitizeAttribute.length>0)&&(Me=cn(Me)),R.uponSanitizeAttribute.length>0&&(ze=cn(ze)),s.removed=[];const $e=D&&typeof se!="string"&&tr(se);if($e){xo(se);const Tt=W?W(se):se.nodeName;if(typeof Tt=="string"){const bt=rt(Tt);if(!Me[bt]||Wt[bt])throw Rs(se),vr("root node is forbidden and cannot be sanitized in-place")}if(Nr(se))throw Rs(se),vr("root node is clobbered and cannot be sanitized in-place");try{Xe(se)}catch(bt){throw Rs(se),bt}}else if(tr(se))z=er("<!---->"),X=z.ownerDocument.importNode(se,!0),X.nodeType===An.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?z=X:z.appendChild(X),Xe(X);else{if(!xt&&!Ue&&!vt&&se.indexOf("<")===-1)return K&&yn?Ce(se):se;if(z=er(se),!z)return xt?null:yn?G:""}z&&sn&&is(z.firstChild);const Ye=$e?se:z;try{const Tt=Cn(Ye);for(;me=Tt.nextNode();)wo(me,Ye),So(me),As(me.content)&&Is(me.content)}catch(Tt){throw $e&&(Rs(se),Xr(s.removed,bt=>{bt.element&&Js(bt.element)})),Tt}if($e)return Xr(s.removed,Tt=>{Tt.element&&Js(Tt.element)}),Ue&&dn(se),se;if(xt){if(Ue&&dn(z),un)for(Ee=J.call(z.ownerDocument);z.firstChild;)Ee.appendChild(z.firstChild);else Ee=z;return(ze.shadowroot||ze.shadowrootmode)&&(Ee=b.call(o,Ee,!0)),Ee}let Je=vt?z.outerHTML:z.innerHTML;return vt&&Me["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&qt(Rk,z.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
420
|
+
`+Je),Ue&&(Je=br(Je)),K&&yn?Ce(Je):Je},s.setConfig=function(){let se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(se),yt=!0,dt=Me,Yt=ze},s.clearConfig=function(){ms=null,yt=!1,dt=null,Yt=null,K=oe,G=""},s.isValidAttribute=function(se,S,z){ms||Sr({});const X=rt(se),me=rt(S);return ko(X,me,z)},s.addHook=function(se,S){typeof S=="function"&&Kt(R,se)&&Yr(R[se],S)},s.removeHook=function(se,S){if(Kt(R,se)){if(S!==void 0){const z=fk(R[se],S);return z===-1?void 0:pk(R[se],z,1)[0]}return Oh(R[se])}},s.removeHooks=function(se){Kt(R,se)&&(R[se]=[])},s.removeAllHooks=function(){R=Xh()},s}var hd=_g();const Pk=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Yh(n){return Pk.has(n.type)}function Ok({items:n,runtimeType:s,turn:r,threads:o=[]}){const[a,u]=w.useState(!1);if(n.length===0)return null;const f=n.length;return c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>u(h=>!h),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(T0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(Yu,{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(Cs,{item:h,runtimeType:s,turn:r,threads:o},h.id))})]})}qe.setOptions({breaks:!0,gfm:!0});function zk(n){const s=qe.parse(n);return hd.sanitize(s)}function Qh(n,s){var a;const r=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>s)return{node:u,offset:s-o};o+=f}return null}function $k(n,s,r){const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const f=document.createRange();f.selectNodeContents(u),!(f.compareBoundaryPoints(Range.START_TO_END,s)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,s)>=0||a.push(u))}for(const u of a){const f=u.length;let h=0,m=f;if(u===s.startContainer&&(h=Math.min(s.startOffset,f)),u===s.endContainer&&(m=Math.min(s.endOffset,f)),h>=m)continue;m<f&&u.splitText(m);const g=h>0?u.splitText(h):u,x=r(),k=g.parentNode;k&&(k.insertBefore(x,g),x.appendChild(g))}}function Fk(n,s){n.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const a=document.createTextNode(r.textContent||"");o.replaceChild(a,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Qh(n,r.start_offset),a=Qh(n,r.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),$k(n,u,()=>{const f=document.createElement("mark");return f.setAttribute("data-thread-id",r.id),r.status==="resolved"&&f.classList.add("thread-mark-resolved"),f})}}function Uk(n){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.getRangeAt(0);if(r.collapsed||!n.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(r.startContainer,r.startOffset);const a=o.toString().length,u=r.toString();return{start:a,end:a+u.length,text:u}}function Bk({itemId:n,turnId:s,sessionId:r,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),h=w.useRef(null),m=w.useRef(""),g=w.useRef(0),[x,k]=w.useState(!1),[y,N]=w.useState({x:0,y:0}),[_,E]=w.useState(!1),[T,L]=w.useState({x:0,y:0}),[A,B]=w.useState(""),[M,W]=w.useState(null),[q,K]=w.useState(!1),G=P(H=>H.createThread),oe=P(H=>H.switchRightTab),ue=P(H=>ra(H.sessionDetails[r])),ie=w.useCallback(async()=>{await Eu(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),we=w.useCallback(()=>{var b;if(!M)return;const H=`
|
|
421
421
|
\`\`\`QUOTE
|
|
422
422
|
${M.text}
|
|
423
423
|
\`\`\`
|
|
424
424
|
|
|
425
|
-
`;P.setState({quotedText:H}),k(!1),W(null),(b=window.getSelection())==null||b.removeAllRanges()},[M]),Ce=w.useMemo(()
|
|
425
|
+
`;P.setState({quotedText:H}),k(!1),W(null),(b=window.getSelection())==null||b.removeAllRanges()},[M]),Ce=w.useMemo(()=>zk(o||"…"),[o]),Fe=w.useMemo(()=>a.filter(H=>H.item_id===n),[a,n]);w.useEffect(()=>{u.current&&Fk(u.current,Fe)},[Ce,Fe]),w.useEffect(()=>{m.current=A},[A]),w.useEffect(()=>{function H(b){f.current&&!f.current.contains(b.target)&&(k(!1),m.current.trim()||E(!1))}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const Q=w.useCallback(()=>{k(!1),m.current.trim()||E(!1)},[]),ne=w.useCallback(()=>{const H=u.current;if(!H)return;const b=Uk(H);if(b&&b.text.trim().length>0){const R=window.getSelection();if(R&&R.rangeCount>0&&R.anchorNode&&R.focusNode){const ce=R.getRangeAt(0).getBoundingClientRect(),ge=28,ye=6,Oe=170;let Re=!1;try{const mt=document.createRange();mt.setStart(R.focusNode,R.focusOffset),mt.setEnd(R.focusNode,R.focusOffset);const Me=document.createRange();Me.setStart(R.anchorNode,R.anchorOffset),Me.setEnd(R.anchorNode,R.anchorOffset),Re=Me.compareBoundaryPoints(Range.START_TO_START,mt)>0}catch{Re=!1}let je=ce.top-ge-ye;je<8&&(je=ce.bottom+ye);let be=Re?ce.left-Oe:ce.right;be=Math.max(8,Math.min(be,window.innerWidth-Oe-8)),N({x:be,y:je}),k(!0),W(b)}}else k(!1)},[]);w.useEffect(()=>{function H(b){const R=b.target;R&&(R.closest(".selection-actions")||R.closest(".thread-create-popover"))||ne()}return document.addEventListener("mouseup",H),()=>document.removeEventListener("mouseup",H)},[ne]);const ae=w.useCallback(()=>{k(!1),E(!0),L({x:y.x,y:y.y})},[y]);w.useLayoutEffect(()=>{if(!_)return;const H=h.current;if(!H)return;const b=H.offsetWidth,R=H.offsetHeight,te=8;let ce=y.x,ge=y.y;ce-b<te&&(ce=b+te),ce>window.innerWidth-te&&(ce=window.innerWidth-te),ge<te&&(ge=te),ge+R>window.innerHeight-te&&(ge=window.innerHeight-R-te),L({x:ce,y:ge})},[_,y]);const O=w.useCallback(async()=>{var H;ue||!M||!A.trim()||(await G(r,{itemId:n,turnId:s,startOffset:M.start,endOffset:M.end,selectedText:M.text,message:A.trim()}),B(""),E(!1),W(null),(H=window.getSelection())==null||H.removeAllRanges(),oe("threads"))},[M,A,G,r,n,s,oe,ue]),J=w.useCallback(H=>{const b=H.target;if(b.tagName==="MARK"&&b.hasAttribute("data-thread-id")){H.preventDefault(),oe("threads");const R=b.getAttribute("data-thread-id");setTimeout(()=>{const te=document.getElementById(`thread-${R}`);te&&(te.scrollIntoView({behavior:"smooth",block:"center"}),te.classList.add("thread-card-highlighted"),setTimeout(()=>te.classList.remove("thread-card-highlighted"),1500))},100)}},[oe]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:Ce},onMouseDown:Q,onClick:J}),c.jsx("button",{className:`copy-text-btn${q?" copied":""}`,onClick:ie,title:q?"Copied":"Copy message","aria-label":"Copy message text",children:q?c.jsx(Zs,{size:14}):c.jsx(Su,{size:14})}),x&&!_&&c.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!ue&&c.jsxs("button",{className:"discuss-button",onClick:ae,title:"Start a discussion about this text",children:[c.jsx(c0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:we,title:"Quote this text in your message",children:[c.jsx($m,{size:14}),c.jsx("span",{children:"Quote"})]})]}),_&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:T.x,top:T.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',M==null?void 0:M.text.slice(0,80),M&&M.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{E(!1),W(null)},children:c.jsx(Vn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:A,onChange:H=>B(H.target.value),autoFocus:!0,rows:2,onKeyDown:H=>{if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),O()),H.key==="Escape")if(m.current.trim()){const b=Date.now();g.current&&b-g.current<400?(g.current=0,E(!1),W(null)):g.current=b}else E(!1),W(null)}}),c.jsxs("div",{className:"thread-create-footer",children:[c.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),c.jsxs("button",{className:"thread-create-send",onClick:O,disabled:!A.trim()||ue,title:ue?"Wait for the running turn to finish first":void 0,children:[c.jsx(la,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const Zh=w.memo(Bk),na=new Map,jg=new Set,Du=new Set,Jh=new Map;function Rg(){Du.forEach(n=>n())}function Ag(n,s){return`${n}:${s}`}function Wk(n,s,r,o,a){var m;const u=Ag(s,r),f=na.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:s,groupIndex:r,question:o,answer:a}),na.set(n,h),Rg()}function Hk(n){na.delete(n),Rg()}function Vk(n){jg.add(n),Hk(n)}function Gk(n){const s=w.useCallback(r=>(Du.add(r),()=>{Du.delete(r)}),[]);return w.useSyncExternalStore(s,()=>na.get(n)??Jh,()=>Jh)}function qk(n){return[...n].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
|
|
426
426
|
${s.answer}`).join(`
|
|
427
427
|
|
|
428
|
-
`)}function
|
|
429
|
-
… (truncated, click to expand)`:L;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(Um,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),B&&c.jsx("span",{className:"turn-header-meta",children:B})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),L&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),M&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(q=>!q),children:u?"Show less":`Show full output (${(L.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,T=Array.isArray(C)?C:[],L=`${T.length} file${T.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(n0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:L})]}),c.jsx("div",{className:"file-change-list",children:T.map((A,B)=>{const M=A.kind==="add"?"A":A.kind==="delete"?"D":"M",W=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:M}),c.jsx("span",{className:"fc-name",children:A.path})]},B)})})]})}case"mcp_tool_call":{const C=n.data||{},T=C.tool||"mcp";if(T==="Agent"){const G=C.arguments,oe=(G==null?void 0:G.description)||(G==null?void 0:G.prompt)||"Subagent",ue=n.status==="failed",ie=a?"running…":ue?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(Su,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:oe}),c.jsx("span",{className:`agent-call-status ${a?"running":ue?"failed":"done"}`,children:ie})]})}const L=C.server||"",A=C.arguments,B=C.result,M=C.error,W=n.status==="failed"||!!M,q=a?"running…":W?"failed":"done",K=((m=B==null?void 0:B.content)==null?void 0:m.filter(G=>G.type==="text").map(G=>G.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(g0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),L&&c.jsx("span",{className:"turn-header-meta",children:L}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:q})]}),A&&Object.keys(A).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(A).map(([G,oe])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:G}),G==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(oe)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof oe=="string"?oe:JSON.stringify(oe,null,2)})]},G))}),K.length>0&&K.map((G,oe)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:G})},oe)),M&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:M})})]})}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(y0,{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(l0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((T,L)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(Zs,{size:14}):c.jsx(li,{size:14})," ",T.text]},L))})]})}case"ask_user":return c.jsx(tm,{item:n,turn:r});case"final_result":{const C=n.data??{},T=C.text||"",L=C.html||null,A=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:B,iconText:M}=ku(s??"codex");return c.jsxs(c.Fragment,{children:[(T||L)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${B}`,children:M}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(Jh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:T,threads:o,runtimeType:s}),L&&c.jsx(Jk,{html:L})]}),A.length>0&&c.jsx(tm,{item:n,turn:r})]})}case"background_task":{const C=n.data||{},T=C.task_type||"unknown",L=C.subagent_type||null,A=C.description||"",B=C.status||"running",M=C.last_tool_name||null,W=C.token_count||null,q=T==="local_agent",K=T==="local_bash",G=q?Su:K?Fm:Om,oe=q?`Subagent${L?`: ${L}`:""}`:K?"Monitor":"Background Task",ue=B==="running"?"running…":B==="completed"?"done":B==="failed"?"failed":B==="stopped"?"stopped":B,ie=n.status==="failed"||B==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(G,{size:14})}),c.jsx("span",{className:"turn-header-title",children:oe}),c.jsx("span",{className:"turn-header-meta",style:ie?{color:"var(--red)"}:void 0,children:ue})]}),A&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:A}),M&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",M,W!=null&&` · ${W.toLocaleString()} tokens`]}),c.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const C=((k=n.data)==null?void 0:k.trigger)??"auto",T=((y=n.data)==null?void 0:y.pre_tokens)??0,L=((E=n.data)==null?void 0:E.post_tokens)??0,A=T>0?Math.round((1-L/T)*100):0,B=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(f0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:B})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",L.toLocaleString()," tokens (",A,"% reduction)"]})]})}case"error":{const C=((_=n.data)==null?void 0:_.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(Zu,{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 Cs=w.memo(eS,(n,s)=>n.item===s.item&&n.runtimeType===s.runtimeType&&n.threads===s.threads&&n.turn.id===s.turn.id);function tS({turn:n,runtimeType:s,threads:r=[]}){tn.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const T=n.items.some(L=>L.type==="background_task"&&L.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!T&&a(!1)},[n.status,n.items]);let u=-1;for(let T=n.items.length-1;T>=0;T--)if(n.items[T].type==="agent_message"){u=T;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,m=n.items.some(T=>T.type==="final_result"||T.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=h.filter(T=>{var L;return!(T.type==="reasoning"&&(!((L=T.data)!=null&&L.text)||T.data.text===""))}).filter(T=>!(T.type==="background_task"||T.type==="ask_user"||T.type==="final_result")),y=[];let E=null;for(const T of k)T.type==="agent_message"?(E&&y.push(E),E={agentMessage:T,toolItems:[],otherItems:[]}):(E||(E={agentMessage:null,toolItems:[],otherItems:[]}),Qh(T)?E.toolItems.push(T):E.otherItems.push(T));E&&y.push(E);const _=k.filter(T=>Qh(T)).length,C=_>0||k.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(Xk,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(T=>!T),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(i0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:_>0?`${_} tool call${_>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((T,L)=>c.jsxs("div",{className:"intermediate-segment",children:[T.agentMessage&&c.jsx(Cs,{item:T.agentMessage,runtimeType:s,turn:n,threads:r}),T.otherItems.map(A=>c.jsx(Cs,{item:A,runtimeType:s,turn:n,threads:r},A.id)),T.toolItems.length>0&&c.jsx(zk,{items:T.toolItems,runtimeType:s,turn:n,threads:r})]},L))})]}),n.items.filter(T=>T.type==="background_task").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`task-${T.id}`)),f&&c.jsx(Cs,{item:n.items[u],runtimeType:s,turn:n,threads:r},n.items[u].id),g&&c.jsx(Cs,{item:g,runtimeType:s,turn:n,threads:r},g.id),f&&n.items.slice(u+1).filter(T=>T.type!=="ask_user"&&T.type!=="background_task"&&T.type!=="final_result").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},T.id)),n.items.filter(T=>T.type==="final_result").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`final-${T.id}`)),n.items.filter(T=>T.type==="ask_user").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`ask-${T.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})})}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(li,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const nS=w.memo(tS);function Ig(n,s="session",r=0){const o=[];if(s==="session")n.forEach((u,f)=>im(u,f,o));else{const u=n[r];u&&im(u,r,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function im(n,s,r){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)r.push({path:f.path,kind:f.kind,turnIdx:s})}}const sS=[],Al=50;function rS(){tn.trackRender("RenderArea");const n=P(L=>L.activeSessionId),s=P(L=>L.activeSessionId?L.sessionDetails[L.activeSessionId]:null),r=P(L=>L.activeTurnIndex),o=P(L=>L.activeRightTab),a=P(L=>L.changesScope),u=P(L=>L.submittingPrompt),f=P(L=>L.loading),h=P(L=>L.selectedChangePath),m=P(L=>L.setSelectedChangePath),g=(s==null?void 0:s.turns)??[],x=(s==null?void 0:s.threads)??sS,k=w.useRef(null),[y,E]=w.useState(Al);w.useEffect(()=>{E(Al)},[n]);const _=g.filter(L=>!L.thread_id),C=Math.max(0,_.length-y),T=_.slice(C);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,g.length]),w.useEffect(()=>{if(!h||o!=="changes")return;const L=setTimeout(()=>{const A=h.replace(/[^a-zA-Z0-9]/g,"-"),B=document.getElementById(`diff-${A}`);B&&(B.scrollIntoView({behavior:"smooth",block:"start"}),B.classList.add("diff-highlight"),setTimeout(()=>B.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(L)},[h,o,m]),o==="changes"){if(!s)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const L=Ig(g,a,r);return L.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:k,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:[L.length," file",L.length>1?"s":""]})]}),L.map(A=>{const B=A.path.split("/").pop()||A.path,M=A.path.replace("/"+B,""),W=A.kind==="add"?"Added":A.kind==="delete"?"Deleted":"Modified",q=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod",K=A.kind==="add"?"A":A.kind==="delete"?"D":"M",G=A.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${G}`,children:[c.jsx("span",{className:`diff-file-status ${q}`,children:K}),c.jsxs("span",{className:"diff-file-name",children:[M&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[M,"/"]}),B]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${q}`,children:W})})]}),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&&!s?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"})]})}):s?c.jsxs("div",{className:"render-scroll",ref:k,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:()=>E(L=>L+Al),children:["Show ",Math.min(Al,C)," earlier turns (",C," hidden)"]})}),T.map((L,A)=>c.jsx("div",{id:`turn-${C+A}`,className:"turn-block",children:c.jsx(nS,{turn:L,runtimeType:s.runtime_type,threads:x})},L.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const iS=w.memo(rS),oS=[{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 lS(n){return n.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function aS(n,s,r=[]){const o=[...oS,...lS(r)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!s[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function cS({commands:n,selectedIndex:s,onSelect:r,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===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(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 mu({title:n,options:s,currentValue:r,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})]}),s.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===r?"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===r&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function uS(n){return gn("/skills")}function dS({filter:n,onSelect:s,onClose:r}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{uS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const x=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{m(0)},[n]),w.useEffect(()=>{function k(y){y.key==="ArrowDown"?(y.preventDefault(),m(E=>Math.min(E+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),m(E=>Math.max(E-1,0))):y.key==="Enter"?(y.preventDefault(),x[h]&&s(x[h])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[x,h,s,r]),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:r,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((k,y)=>c.jsxs("div",{className:`slash-popup-item ${y===h?"selected":""}`,onMouseEnter:()=>m(y),onClick:()=>s(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function fS(){return gn("/providers")}function pS(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return gn(`/providers/${n}/commands${r}`)}const hS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function mS(n){const[s,r]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{fS().then(r).catch(()=>r([])).finally(()=>a(!1))},[]);const u=s.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??hS,loading:o}}const Qr=32,gu=200;function om(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function lm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let am=0;function gS(){return am+=1,`att-${Date.now()}-${am}`}function vS(){tn.trackRender("CommandInputBar");const[n,s]=w.useState(""),r=w.useRef(null),o=w.useRef(Qr),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=P(),g=P(V=>V.activeSessionId),x=P(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),k=P(V=>V.quotedText),y=jm(x),E=!g,{capabilities:_}=mS(x==null?void 0:x.runtime_type),C=(x==null?void 0:x.runtime_type)??null,T=_.imageAttachments,[L,A]=w.useState([]),[B,M]=w.useState(!1),[W,q]=w.useState(null),[K,G]=w.useState([]);w.useEffect(()=>{if(!C){G([]);return}let V=!1;return pS(C,(x==null?void 0:x.cwd)??void 0).then(he=>{V||G(he)}).catch(()=>{V||G([])}),()=>{V=!0}},[C,x==null?void 0:x.cwd]);const[oe,ue]=w.useState(!1),[ie,we]=w.useState(""),[Ce,Fe]=w.useState(0),[Q,ne]=w.useState(void 0),[ae,O]=w.useState(!1),[J,H]=w.useState(""),[b,R]=w.useState([]),te=oe?aS(ie,_,K):[];w.useEffect(()=>{k!==null&&(s(V=>V+k),setTimeout(()=>{if(r.current){mt(),r.current.focus();const V=r.current.value.length;r.current.setSelectionRange(V,V)}},0),P.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!y)return;function V(he){he.key==="Escape"&&(he.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[y,f]),w.useEffect(()=>{ue(!1),ne(void 0),O(!1),R([]),A(V=>{for(const he of V)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[g]),w.useEffect(()=>{if(!W)return;function V(he){he.key==="Escape"&&(he.preventDefault(),q(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[W]);const ce=w.useCallback(V=>{if(!V)return;const he=Array.from(V);for(const Ue of he){const Ze=new FileReader;Ze.onload=()=>{const yt=Ze.result.split(",")[1]??"",dt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;A(Yt=>[...Yt,{id:gS(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:yt,previewUrl:dt,size:Ue.size}])},Ze.readAsDataURL(Ue)}},[]),ge=w.useCallback(V=>{A(he=>{const Ue=he.find(Ze=>Ze.id===V);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(Ze=>Ze.id!==V)})},[]),ye=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!T||y)&&M(!0)},[T,y]),Oe=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),M(!1)},[]),Re=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),M(!1),!(!T||y)&&ce(V.dataTransfer.files)},[T,y,ce]),je=w.useCallback(V=>{var Ze;if(!T)return;const he=(Ze=V.clipboardData)==null?void 0:Ze.items;if(!he)return;const Ue=[];for(let vt=0;vt<he.length;vt++){const yt=he[vt];if(yt.type.startsWith("image/")){const dt=yt.getAsFile();dt&&Ue.push(dt)}}Ue.length>0&&(V.preventDefault(),ce(Ue))},[T,ce]);function be(V){const he=r.current;he&&(he.style.height=`${V}px`,o.current=V)}function mt(){const V=r.current;if(V){if(V.scrollHeight>V.clientHeight){const he=Math.min(V.scrollHeight,gu);he!==o.current&&be(he);return}o.current>Qr&&(V.style.height="auto",be(Math.min(V.scrollHeight,gu)))}}function Me(){const V=n.trim();if(!V||y)return;let he=V;b.length>0&&(he=`${b.map(vt=>`$${vt.name}`).join(" ")}
|
|
428
|
+
`)}function em({item:n,turn:s}){var N;const r=n.data??{},o=w.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(_=>!!_&&Array.isArray(_.selections)&&_.selections.length>0):[],[r.groups]),a=Gk(s.id),u=P(_=>s.session_id?_.sessionDetails[s.session_id]:null),f=P(_=>_.activeSessionId),h=s.items.findIndex(_=>_.id===n.id),m=u?((N=u.turns[u.turns.length-1])==null?void 0:N.id)===s.id:!0,g=jg.has(s.id),x=g||jm(u)||!m||s.session_id!==f,k=(_,E,T)=>{x||Wk(s.id,h,_,E,T)},y=()=>{const _=[...a.values()];if(_.length===0)return;const E=qk(_);Vk(s.id),P.getState().submitPrompt(E)};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(Xx,{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((_,E)=>c.jsxs("div",{className:"ask-user-group",children:[_.question&&c.jsx("div",{className:"ask-user-question",children:_.question}),c.jsx("div",{className:"ask-user-options",children:_.selections.map(T=>{var A;const L=((A=a.get(Ag(h,E)))==null?void 0:A.answer)===T;return c.jsx("button",{type:"button",className:`ask-user-option ${L?"selected":""}`,disabled:x,onClick:()=>k(E,_.question,T),children:T},T)})})]},E)),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(la,{size:12}),"Send"]})]}):r.question?c.jsx("p",{className:"user-message",children:r.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}qe.setOptions({breaks:!0,gfm:!0});function Kk({attachments:n}){const[s,r]=w.useState(null);return w.useEffect(()=>{if(!s)return;function o(a){a.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!Array.isArray(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?()=>r(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(zm,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),s&&c.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:s,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:c.jsx(Vn,{size:20})})]})})]})}function Xk(n){const s=qe.parse(n);return hd.sanitize(s)}function tm(n){var s;return(s=n.data)!=null&&s.text?n.data.text:""}function Yk(n){const s=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:n}const nm='<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 Qk(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${nm}</body>`):n+nm}function Zk({html:n}){const[s,r]=w.useState(480),o=w.useRef(null);return w.useEffect(()=>{function a(u){var f;u.source===((f=o.current)==null?void 0:f.contentWindow)&&typeof u.data=="number"&&u.data>0&&r(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:Qk(n),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const sm=1e4;function Jk({item:n,runtimeType:s,turn:r,threads:o}){var h,m,g,x,k,y,N,_;const a=n.status==="in_progress",[u,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:E,iconText:T}=wu(s??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${E}`,children:T}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(Zh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:tm(n)||"…",threads:o,runtimeType:s})]})}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(qx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:Xk(tm(n))}})]});case"command_execution":{const E=n.data||{},T=Yk(E.command||""),L=E.aggregated_output||"",A=E.exit_code,B=a?"running…":A!==null?`exit ${A}`:"",M=L.length>sm,W=M&&!u?L.slice(0,sm)+`
|
|
429
|
+
… (truncated, click to expand)`:L;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(Um,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),B&&c.jsx("span",{className:"turn-header-meta",children:B})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),L&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),M&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(q=>!q),children:u?"Show less":`Show full output (${(L.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const E=(h=n.data)==null?void 0:h.changes,T=Array.isArray(E)?E:[],L=`${T.length} file${T.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(t0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:L})]}),c.jsx("div",{className:"file-change-list",children:T.map((A,B)=>{const M=A.kind==="add"?"A":A.kind==="delete"?"D":"M",W=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:M}),c.jsx("span",{className:"fc-name",children:A.path})]},B)})})]})}case"mcp_tool_call":{const E=n.data||{},T=E.tool||"mcp";if(T==="Agent"){const G=E.arguments,oe=(G==null?void 0:G.description)||(G==null?void 0:G.prompt)||"Subagent",ue=n.status==="failed",ie=a?"running…":ue?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ku,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:oe}),c.jsx("span",{className:`agent-call-status ${a?"running":ue?"failed":"done"}`,children:ie})]})}const L=E.server||"",A=E.arguments,B=E.result,M=E.error,W=n.status==="failed"||!!M,q=a?"running…":W?"failed":"done",K=((m=B==null?void 0:B.content)==null?void 0:m.filter(G=>G.type==="text").map(G=>G.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(m0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),L&&c.jsx("span",{className:"turn-header-meta",children:L}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:q})]}),A&&Object.keys(A).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(A).map(([G,oe])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:G}),G==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(oe)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof oe=="string"?oe:JSON.stringify(oe,null,2)})]},G))}),K.length>0&&K.map((G,oe)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:G})},oe)),M&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:M})})]})}case"web_search":{const E=((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(v0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:E})]})}case"todo_list":{const E=((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(o0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:E.map((T,L)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(Zs,{size:14}):c.jsx(li,{size:14})," ",T.text]},L))})]})}case"ask_user":return c.jsx(em,{item:n,turn:r});case"final_result":{const E=n.data??{},T=E.text||"",L=E.html||null,A=Array.isArray(E.groups)?E.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:B,iconText:M}=wu(s??"codex");return c.jsxs(c.Fragment,{children:[(T||L)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${B}`,children:M}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(Zh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:T,threads:o,runtimeType:s}),L&&c.jsx(Zk,{html:L})]}),A.length>0&&c.jsx(em,{item:n,turn:r})]})}case"background_task":{const E=n.data||{},T=E.task_type||"unknown",L=E.subagent_type||null,A=E.description||"",B=E.status||"running",M=E.last_tool_name||null,W=E.token_count||null,q=T==="local_agent",K=T==="local_bash",G=q?ku:K?Fm:Om,oe=q?`Subagent${L?`: ${L}`:""}`:K?"Monitor":"Background Task",ue=B==="running"?"running…":B==="completed"?"done":B==="failed"?"failed":B==="stopped"?"stopped":B,ie=n.status==="failed"||B==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(G,{size:14})}),c.jsx("span",{className:"turn-header-title",children:oe}),c.jsx("span",{className:"turn-header-meta",style:ie?{color:"var(--red)"}:void 0,children:ue})]}),A&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:A}),M&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",M,W!=null&&` · ${W.toLocaleString()} tokens`]}),c.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const E=((k=n.data)==null?void 0:k.trigger)??"auto",T=((y=n.data)==null?void 0:y.pre_tokens)??0,L=((N=n.data)==null?void 0:N.post_tokens)??0,A=T>0?Math.round((1-L/T)*100):0,B=E==="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(d0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:B})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",L.toLocaleString()," tokens (",A,"% reduction)"]})]})}case"error":{const E=((_=n.data)==null?void 0:_.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(Qu,{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:E})})]})}default:return null}}const Cs=w.memo(Jk,(n,s)=>n.item===s.item&&n.runtimeType===s.runtimeType&&n.threads===s.threads&&n.turn.id===s.turn.id);function eS({turn:n,runtimeType:s,threads:r=[]}){tn.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const T=n.items.some(L=>L.type==="background_task"&&L.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!T&&a(!1)},[n.status,n.items]);let u=-1;for(let T=n.items.length-1;T>=0;T--)if(n.items[T].type==="agent_message"){u=T;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,m=n.items.some(T=>T.type==="final_result"||T.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=h.filter(T=>{var L;return!(T.type==="reasoning"&&(!((L=T.data)!=null&&L.text)||T.data.text===""))}).filter(T=>!(T.type==="background_task"||T.type==="ask_user"||T.type==="final_result")),y=[];let N=null;for(const T of k)T.type==="agent_message"?(N&&y.push(N),N={agentMessage:T,toolItems:[],otherItems:[]}):(N||(N={agentMessage:null,toolItems:[],otherItems:[]}),Yh(T)?N.toolItems.push(T):N.otherItems.push(T));N&&y.push(N);const _=k.filter(T=>Yh(T)).length,E=_>0||k.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(Kk,{attachments:n.attachments})]}),E&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(T=>!T),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(r0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:_>0?`${_} tool call${_>1?"s":""}`:"thinking…"}),c.jsx(Yu,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:y.map((T,L)=>c.jsxs("div",{className:"intermediate-segment",children:[T.agentMessage&&c.jsx(Cs,{item:T.agentMessage,runtimeType:s,turn:n,threads:r}),T.otherItems.map(A=>c.jsx(Cs,{item:A,runtimeType:s,turn:n,threads:r},A.id)),T.toolItems.length>0&&c.jsx(Ok,{items:T.toolItems,runtimeType:s,turn:n,threads:r})]},L))})]}),n.items.filter(T=>T.type==="background_task").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`task-${T.id}`)),f&&c.jsx(Cs,{item:n.items[u],runtimeType:s,turn:n,threads:r},n.items[u].id),g&&c.jsx(Cs,{item:g,runtimeType:s,turn:n,threads:r},g.id),f&&n.items.slice(u+1).filter(T=>T.type!=="ask_user"&&T.type!=="background_task"&&T.type!=="final_result").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},T.id)),n.items.filter(T=>T.type==="final_result").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`final-${T.id}`)),n.items.filter(T=>T.type==="ask_user").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`ask-${T.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})})}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(li,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const tS=w.memo(eS);function Ig(n,s="session",r=0){const o=[];if(s==="session")n.forEach((u,f)=>rm(u,f,o));else{const u=n[r];u&&rm(u,r,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function rm(n,s,r){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)r.push({path:f.path,kind:f.kind,turnIdx:s})}}const nS=[],Al=50;function sS(){tn.trackRender("RenderArea");const n=P(L=>L.activeSessionId),s=P(L=>L.activeSessionId?L.sessionDetails[L.activeSessionId]:null),r=P(L=>L.activeTurnIndex),o=P(L=>L.activeRightTab),a=P(L=>L.changesScope),u=P(L=>L.submittingPrompt),f=P(L=>L.loading),h=P(L=>L.selectedChangePath),m=P(L=>L.setSelectedChangePath),g=(s==null?void 0:s.turns)??[],x=(s==null?void 0:s.threads)??nS,k=w.useRef(null),[y,N]=w.useState(Al);w.useEffect(()=>{N(Al)},[n]);const _=g.filter(L=>!L.thread_id),E=Math.max(0,_.length-y),T=_.slice(E);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,g.length]),w.useEffect(()=>{if(!h||o!=="changes")return;const L=setTimeout(()=>{const A=h.replace(/[^a-zA-Z0-9]/g,"-"),B=document.getElementById(`diff-${A}`);B&&(B.scrollIntoView({behavior:"smooth",block:"start"}),B.classList.add("diff-highlight"),setTimeout(()=>B.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(L)},[h,o,m]),o==="changes"){if(!s)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const L=Ig(g,a,r);return L.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:k,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:[L.length," file",L.length>1?"s":""]})]}),L.map(A=>{const B=A.path.split("/").pop()||A.path,M=A.path.replace("/"+B,""),W=A.kind==="add"?"Added":A.kind==="delete"?"Deleted":"Modified",q=A.kind==="add"?"fc-add":A.kind==="delete"?"fc-del":"fc-mod",K=A.kind==="add"?"A":A.kind==="delete"?"D":"M",G=A.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${G}`,children:[c.jsx("span",{className:`diff-file-status ${q}`,children:K}),c.jsxs("span",{className:"diff-file-name",children:[M&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[M,"/"]}),B]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${q}`,children:W})})]}),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&&!s?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"})]})}):s?c.jsxs("div",{className:"render-scroll",ref:k,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."}),E>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>N(L=>L+Al),children:["Show ",Math.min(Al,E)," earlier turns (",E," hidden)"]})}),T.map((L,A)=>c.jsx("div",{id:`turn-${E+A}`,className:"turn-block",children:c.jsx(tS,{turn:L,runtimeType:s.runtime_type,threads:x})},L.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const rS=w.memo(sS),iS=[{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 oS(n){return n.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function lS(n,s,r=[]){const o=[...iS,...oS(r)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!s[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function aS({commands:n,selectedIndex:s,onSelect:r,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===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(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 hu({title:n,options:s,currentValue:r,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})]}),s.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===r?"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===r&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function cS(n){return gn("/skills")}function uS({filter:n,onSelect:s,onClose:r}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{cS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const x=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{m(0)},[n]),w.useEffect(()=>{function k(y){y.key==="ArrowDown"?(y.preventDefault(),m(N=>Math.min(N+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),m(N=>Math.max(N-1,0))):y.key==="Enter"?(y.preventDefault(),x[h]&&s(x[h])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[x,h,s,r]),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:r,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((k,y)=>c.jsxs("div",{className:`slash-popup-item ${y===h?"selected":""}`,onMouseEnter:()=>m(y),onClick:()=>s(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function dS(){return gn("/providers")}function fS(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return gn(`/providers/${n}/commands${r}`)}const pS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function hS(n){const[s,r]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{dS().then(r).catch(()=>r([])).finally(()=>a(!1))},[]);const u=s.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??pS,loading:o}}const Qr=32,mu=200;function im(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function om(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let lm=0;function mS(){return lm+=1,`att-${Date.now()}-${lm}`}function gS(){tn.trackRender("CommandInputBar");const[n,s]=w.useState(""),r=w.useRef(null),o=w.useRef(Qr),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=P(),g=P(V=>V.activeSessionId),x=P(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),k=P(V=>V.quotedText),y=jm(x),N=!g,{capabilities:_}=hS(x==null?void 0:x.runtime_type),E=(x==null?void 0:x.runtime_type)??null,T=_.imageAttachments,[L,A]=w.useState([]),[B,M]=w.useState(!1),[W,q]=w.useState(null),[K,G]=w.useState([]);w.useEffect(()=>{if(!E){G([]);return}let V=!1;return fS(E,(x==null?void 0:x.cwd)??void 0).then(he=>{V||G(he)}).catch(()=>{V||G([])}),()=>{V=!0}},[E,x==null?void 0:x.cwd]);const[oe,ue]=w.useState(!1),[ie,we]=w.useState(""),[Ce,Fe]=w.useState(0),[Q,ne]=w.useState(void 0),[ae,O]=w.useState(!1),[J,H]=w.useState(""),[b,R]=w.useState([]),te=oe?lS(ie,_,K):[];w.useEffect(()=>{k!==null&&(s(V=>V+k),setTimeout(()=>{if(r.current){mt(),r.current.focus();const V=r.current.value.length;r.current.setSelectionRange(V,V)}},0),P.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!y)return;function V(he){he.key==="Escape"&&(he.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[y,f]),w.useEffect(()=>{ue(!1),ne(void 0),O(!1),R([]),A(V=>{for(const he of V)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[g]),w.useEffect(()=>{if(!W)return;function V(he){he.key==="Escape"&&(he.preventDefault(),q(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[W]);const ce=w.useCallback(V=>{if(!V)return;const he=Array.from(V);for(const Ue of he){const Ze=new FileReader;Ze.onload=()=>{const yt=Ze.result.split(",")[1]??"",dt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;A(Yt=>[...Yt,{id:mS(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:yt,previewUrl:dt,size:Ue.size}])},Ze.readAsDataURL(Ue)}},[]),ge=w.useCallback(V=>{A(he=>{const Ue=he.find(Ze=>Ze.id===V);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(Ze=>Ze.id!==V)})},[]),ye=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!T||y)&&M(!0)},[T,y]),Oe=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),M(!1)},[]),Re=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),M(!1),!(!T||y)&&ce(V.dataTransfer.files)},[T,y,ce]),je=w.useCallback(V=>{var Ze;if(!T)return;const he=(Ze=V.clipboardData)==null?void 0:Ze.items;if(!he)return;const Ue=[];for(let vt=0;vt<he.length;vt++){const yt=he[vt];if(yt.type.startsWith("image/")){const dt=yt.getAsFile();dt&&Ue.push(dt)}}Ue.length>0&&(V.preventDefault(),ce(Ue))},[T,ce]);function be(V){const he=r.current;he&&(he.style.height=`${V}px`,o.current=V)}function mt(){const V=r.current;if(V){if(V.scrollHeight>V.clientHeight){const he=Math.min(V.scrollHeight,mu);he!==o.current&&be(he);return}o.current>Qr&&(V.style.height="auto",be(Math.min(V.scrollHeight,mu)))}}function Me(){const V=n.trim();if(!V||y)return;let he=V;b.length>0&&(he=`${b.map(vt=>`$${vt.name}`).join(" ")}
|
|
430
430
|
|
|
431
|
-
${V}`);const Ue=L.map(({id:Ze,previewUrl:vt,size:yt,...dt})=>dt);s(""),R([]),be(Qr),ue(!1),ne(void 0),O(!1);for(const Ze of L)Ze.previewUrl&&URL.revokeObjectURL(Ze.previewUrl);A([]),u(he,Ue.length>0?Ue:void 0)}function jt(V){if(V.insertAsText){const he=`/${V.id} `;s(he),ue(!1),ne(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=he.length;r.current.setSelectionRange(Ue,Ue),mt()}});return}V.subPopup?ne(V.subPopup):V.id==="skills"?(O(!0),H(""),ue(!1),s("")):V.id==="model"?(m(!0),ue(!1),s("")):(ue(!1),s(""))}function ze(V){R(he=>[...he,V]),O(!1),s(""),be(Qr)}function zt(V){const he=
|
|
432
|
-
… (truncated, click to expand)`:y,ie=
|
|
431
|
+
${V}`);const Ue=L.map(({id:Ze,previewUrl:vt,size:yt,...dt})=>dt);s(""),R([]),be(Qr),ue(!1),ne(void 0),O(!1);for(const Ze of L)Ze.previewUrl&&URL.revokeObjectURL(Ze.previewUrl);A([]),u(he,Ue.length>0?Ue:void 0)}function jt(V){if(V.insertAsText){const he=`/${V.id} `;s(he),ue(!1),ne(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=he.length;r.current.setSelectionRange(Ue,Ue),mt()}});return}V.subPopup?ne(V.subPopup):V.id==="skills"?(O(!0),H(""),ue(!1),s("")):V.id==="model"?(m(!0),ue(!1),s("")):(ue(!1),s(""))}function ze(V){R(he=>[...he,V]),O(!1),s(""),be(Qr)}function zt(V){const he=im(x==null?void 0:x.runtime_config);Q==="sandbox"?he.sandboxMode=V:Q==="websearch"?he.webSearchMode=V:Q==="network"&&(he.networkAccessEnabled=V==="true"),h(he),ne(void 0),ue(!1),s(""),be(Qr)}function We(V){if(tn.markKeystroke(),oe&&!Q){if(V.key==="ArrowDown"){V.preventDefault(),Fe(he=>Math.min(he+1,te.length-1));return}if(V.key==="ArrowUp"){V.preventDefault(),Fe(he=>Math.max(he-1,0));return}if(V.key==="Enter"){V.preventDefault(),te[Ce]&&jt(te[Ce]);return}if(V.key==="Escape"){V.preventDefault(),ue(!1),s("");return}}if(Q&&V.key==="Escape"){V.preventDefault(),ne(void 0);return}if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&!y){V.preventDefault(),Me();return}V.key==="Escape"&&y&&(V.preventDefault(),f())}function Wt(V){tn.markInputChange();const he=V.target.value;s(he),mt(),he.startsWith("/")&&!he.includes(" ")&&!y?(ue(!0),we(he.slice(1)),Fe(0)):(ue(!1),ne(void 0)),he.startsWith("$")&&!y?(O(!0),H(he.slice(1))):he.startsWith("$")||O(!1)}const Rt=im(x==null?void 0:x.runtime_config),gt=[{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"}],At=[{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"}],$t=[{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${B?" drag-over":""}`,onDragOver:ye,onDragLeave:Oe,onDrop:Re,children:[oe&&!Q&&c.jsx(aS,{commands:te,selectedIndex:Ce,onSelect:jt,onHover:Fe}),oe&&Q==="sandbox"&&c.jsx(hu,{title:"Sandbox Mode",options:gt,currentValue:Rt.sandboxMode,onSelect:zt,onClose:()=>ne(void 0)}),oe&&Q==="websearch"&&c.jsx(hu,{title:"Web Search",options:At,currentValue:Rt.webSearchMode,onSelect:zt,onClose:()=>ne(void 0)}),oe&&Q==="network"&&c.jsx(hu,{title:"Network Access",options:$t,currentValue:Rt.networkAccessEnabled===!0?"true":"false",onSelect:zt,onClose:()=>ne(void 0)}),ae&&c.jsx(uS,{filter:J,onSelect:ze,onClose:()=>{O(!1),s("")}}),b.length>0&&c.jsx("div",{className:"skill-badges",children:b.map(V=>c.jsxs("span",{className:"skill-badge",children:["$",V.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>R(he=>he.filter(Ue=>Ue.id!==V.id)),children:"×"})]},V.id))}),L.length>0&&c.jsx("div",{className:"attachment-preview-area",children:L.map(V=>c.jsxs("div",{className:"attachment-chip",title:V.name,children:[V.previewUrl?c.jsx("img",{src:V.previewUrl,alt:V.name,className:"attachment-thumb",onClick:()=>q(V),style:{cursor:"pointer"}}):c.jsx(zm,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:V.name}),c.jsx("span",{className:"attachment-size",children:om(V.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>ge(V.id),title:"Remove attachment",children:c.jsx(Vn,{size:14})})]},V.id))}),T&&!y&&!N&&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:V=>{ce(V.target.files),V.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[T&&!y&&!N&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var V;return(V=a.current)==null?void 0:V.click()},title:"Attach files",disabled:y,children:c.jsx(p0,{size:16})}),c.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:N?"Select or create a session…":y?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:y||N,rows:1,style:{minHeight:Qr,maxHeight:mu},onChange:Wt,onKeyDown:We,onPaste:je}),y?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(li,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:Me,disabled:!n.trim()||N,title:"Send (⌘↵)",children:c.jsx(Gx,{size:16})})]}),W&&c.jsx("div",{className:"image-preview-modal",onClick:()=>q(null),children:c.jsxs("div",{className:"image-preview-content",onClick:V=>V.stopPropagation(),children:[c.jsx("img",{src:W.previewUrl,alt:W.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:W.name}),c.jsx("span",{children:om(W.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>q(null),children:c.jsx(Vn,{size:20})})]})})]})}function vS(){const n=P(T=>T.activeSessionId),s=P(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),r=P(T=>T.activeTurnIndex),o=P(T=>T.setActiveTurnIndex),a=P(T=>T.rewindToTurn),u=P(T=>T.restoreSession),f=P(T=>T.branchFromTurn),h=(s==null?void 0:s.turns)??[],m=ra(s),g=!!(s!=null&&s.rewound_at_turn_id),x=(s==null?void 0:s.runtime_type)==="repoburg",k=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,N]=w.useState(null),_=w.useRef(null);if(oa(_,()=>N(null),!!y),qu(()=>N(null),!!y),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function E(T){o(T),requestAnimationFrame(()=>{var L;(L=document.getElementById(`turn-${T}`))==null||L.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((T,L)=>{const A=L===r,B=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,M=T.status==="running"||T.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${A?"active":""}`,onClick:()=>E(L),onContextMenu:W=>{W.preventDefault(),N({x:W.clientX,y:W.clientY,turnId:T.id,turnIndex:L,isLast:L===h.length-1,isSlashCommand:T.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(S0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:B}),M&&c.jsx("span",{className:"turn-item-status",children:"running…"})]})},T.id)}),y&&c.jsxs("div",{ref:_,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(k)&&a(n,y.turnId),N(null))},children:[c.jsx(g0,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),g&&!x&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),N(null)},children:[c.jsx(oo,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,y.turnId),N(null)},children:[c.jsx(n0,{size:12})," Branch from Here"]})]})]})}function yS(){const n=P(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),s=P(h=>h.changesScope),r=P(h=>h.setChangesScope),o=P(h=>h.activeTurnIndex),a=P(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Ig(u,s,o);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changes-scope-toggle",children:[c.jsx("button",{className:`scope-btn ${s==="session"?"active":""}`,onClick:()=>r("session"),children:"Session"}),c.jsx("button",{className:`scope-btn ${s==="turngroup"?"active":""}`,onClick:()=>r("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,k=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:[k&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[k,"/"]}),x]})]},h.path)})]})]})}const am=2e4;function xS(n){const s=[];return n.forEach((r,o)=>{var a;for(const u of r.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function wS({entry:n}){const{item:s,turnIndex:r,turnPrompt:o}=n,a=s.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,k=a.token_count||null,y=a.output||"",N=s.status==="in_progress",_=u==="local_agent",E=u==="local_bash",T=_?ku:E?Fm:Om,L=_?`Subagent${f?`: ${f}`:""}`:E?"Monitor":"Background Task",A=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,B=s.status==="failed"||m==="failed",[M,W]=w.useState(N),[q,K]=w.useState(!1),G=w.useRef(null);w.useEffect(()=>{N&&W(!0)},[N]),w.useEffect(()=>{M&&N&&G.current&&(G.current.scrollTop=G.current.scrollHeight)},[M,N,y]);const oe=y.length>am,ue=oe&&!q?y.slice(0,am)+`
|
|
432
|
+
… (truncated, click to expand)`:y,ie=N?null:m==="completed"?c.jsx(Zs,{size:12}):B?c.jsx(Qu,{size:12}):c.jsx(li,{size:12});return c.jsxs("div",{className:`task-card ${N?"task-running":""} ${B?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(we=>!we),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(T,{size:14})}),c.jsx("span",{className:"task-card-type",children:L}),c.jsxs("span",{className:`task-card-status ${B?"task-status-failed":N?"task-status-running":"task-status-done"}`,children:[ie," ",A]}),c.jsx(Yu,{size:14,className:"task-card-chevron",style:{transform:M?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),N&&x&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",x,k!=null&&` · ${k.toLocaleString()} tokens`]}),M&&c.jsxs("div",{className:"task-card-body",children:[y?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:G,children:c.jsx("code",{children:ue})}),oe&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(we=>!we),children:q?"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})}):N?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 ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const kS=w.memo(wS);function SS(){var h,m;const n=P(g=>g.activeSessionId?g.sessionDetails[g.activeSessionId]:null),s=(n==null?void 0:n.turns)??[],r=(n==null?void 0:n.backgroundTasks)??[],o=xS(s),a=[...o].sort((g,x)=>{const k=g.item.status==="in_progress",y=x.item.status==="in_progress";return k&&!y?-1:!k&&y?1:x.turnIndex-g.turnIndex}),u=new Map;for(const g of r)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,k=((m=g.item.data)==null?void 0:m.task_type)??"unknown";u.set(x,k)}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(kS,{entry:g},g.item.id))]})}const TS=w.memo(SS);function bS({thread:n,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:a}=P(),[u,f]=w.useState(""),[h,m]=w.useState(!1),[g,x]=w.useState(!1);async function k(){if(!r||h)return;m(!0),await a(r,n.id,u)?s():m(!1)}async function y(){!r||g||(x(!0),await o(r,n.id),s())}const N=h||g;return c.jsx("div",{className:"dialog-overlay",onClick:N?void 0:s,children:c.jsxs("div",{className:"dialog",onClick:_=>_.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:s,disabled:N,children:c.jsx(Vn,{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:_=>f(_.target.value),rows:3,disabled:N,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:N,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:N,title:"Resolve without sharing",children:[g?c.jsx(ns,{size:13,className:"spin"}):c.jsx(Hl,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:N,children:[h?c.jsx(ns,{size:13,className:"spin"}):c.jsx(y0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const cm=[];qe.setOptions({breaks:!0,gfm:!0});function NS(n){const s=qe.parse(n);return hd.sanitize(s)}function CS(n){var s,r,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(s=n.data)==null?void 0:s.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((r=n.data)==null?void 0:r.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(`
|
|
433
433
|
|
|
434
|
-
`):null}return null}function
|
|
434
|
+
`):null}return null}function ES(n){const s=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:n}function _S({turn:n}){const s=ES(n.user_prompt),r=n.items.map(CS).filter(o=>o!==null);return r.length===0&&n.status==="completed"&&n.agent_response&&r.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:s}),r.map((o,a)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:NS(o)}},a)),r.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 jS({thread:n,threadTurns:s,onStop:r,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var Ce,Fe,Q;const[m,g]=w.useState(""),[x,k]=w.useState(!0),y=w.useRef(null),N=w.useRef(null),[_,E]=w.useState(!1),[T,L]=w.useState({x:0,y:0}),[A,B]=w.useState(""),M=s.some(oi),W=28,q=120,K=w.useRef(W);w.useEffect(()=>{const ne=N.current;ne&&(ne.scrollTop=ne.scrollHeight)},[s.length,x]);function G(ne){const ae=y.current;ae&&(ae.style.height=`${ne}px`,K.current=ne)}function oe(){const ne=y.current;if(ne){if(ne.scrollHeight>ne.clientHeight){const ae=Math.min(ne.scrollHeight,q);ae!==K.current&&G(ae);return}K.current>W&&(ne.style.height="auto",G(Math.min(ne.scrollHeight,q)))}}const ue=w.useCallback(()=>{E(!1)},[]),ie=w.useCallback(()=>{const ne=N.current;if(!ne)return;const ae=window.getSelection();if(!ae||ae.rangeCount===0||ae.isCollapsed){E(!1);return}const O=ae.getRangeAt(0);if(!ne.contains(O.commonAncestorContainer)){E(!1);return}const J=O.commonAncestorContainer.nodeType===Node.TEXT_NODE?O.commonAncestorContainer.parentElement:O.commonAncestorContainer;if(!(J!=null&&J.closest(".thread-card-ai-response"))){E(!1);return}const H=ae.toString();if(!H.trim()){E(!1);return}const b=O.getBoundingClientRect(),R=28,te=6,ce=170;let ge=!1;if(ae.anchorNode&&ae.focusNode)try{const Re=document.createRange();Re.setStart(ae.focusNode,ae.focusOffset),Re.setEnd(ae.focusNode,ae.focusOffset);const je=document.createRange();je.setStart(ae.anchorNode,ae.anchorOffset),je.setEnd(ae.anchorNode,ae.anchorOffset),ge=je.compareBoundaryPoints(Range.START_TO_START,Re)>0}catch{ge=!1}let ye=b.top-R-te;ye<8&&(ye=b.bottom+te);let Oe=ge?b.left-ce:b.right;Oe=Math.max(8,Math.min(Oe,window.innerWidth-ce-8)),L({x:Oe,y:ye}),B(H),E(!0)},[]);w.useEffect(()=>{function ne(ae){const O=ae.target;O&&O.closest(".selection-actions")||ie()}return document.addEventListener("mouseup",ne),()=>document.removeEventListener("mouseup",ne)},[ie]);const we=w.useCallback(()=>{var ae;const ne=`
|
|
435
435
|
\`\`\`QUOTE
|
|
436
436
|
${A}
|
|
437
437
|
\`\`\`
|
|
438
438
|
|
|
439
|
-
`;g(O=>O+ne),C(!1),B(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(y.current){oe(),y.current.focus();const O=y.current.value.length;y.current.setSelectionRange(O,O)}},0)},[A]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(ne=>!ne),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Fe=(Ce=n.turns)==null?void 0:Ce[0])==null?void 0:Fe.user_prompt)==null?void 0:Q.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:ne=>{ne.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(p0,{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:E,onMouseDown:ue,children:[s.map(ne=>c.jsx(jS,{turn:ne},ne.id)),s.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),_&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:we,title:"Quote this text in your follow-up",children:[c.jsx($m,{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:M?"Agent is running…":"Type a follow-up…",value:m,onChange:ne=>{tn.markInputChange(),g(ne.target.value),oe()},disabled:M,rows:1,style:{minHeight:W,maxHeight:q},onKeyDown:ne=>{tn.markKeystroke(),ne.key==="Enter"&&(ne.metaKey||ne.ctrlKey)&&!M&&m.trim()&&(ne.preventDefault(),f(m.trim()),g(""),G(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:M||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(aa,{size:13})}),M&&c.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:c.jsx(li,{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(Hl,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(oo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(fs,{size:13})," Delete"]})]})]})]})}function AS(){tn.trackRender("ThreadsPanel");const n=P(A=>A.activeSessionId),s=P(A=>{var B;return A.activeSessionId?((B=A.sessionDetails[A.activeSessionId])==null?void 0:B.threads)??um:um}),r=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,k]=w.useState("open"),[y,E]=w.useState(null);w.useEffect(()=>{if(!m)return;const A=m;g(null),k(M=>s.some(W=>W.id===A&&W.status==="open")?M:"all");const B=setTimeout(()=>{const M=document.getElementById(`thread-${A}`);M&&(M.scrollIntoView({behavior:"smooth",block:"center"}),M.classList.add("thread-card-highlighted"),setTimeout(()=>M.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(B)},[m,g,s]);const _=s.filter(A=>x==="open"?A.status==="open":x==="resolved"?A.status==="resolved":!0),C=s.filter(A=>A.status==="open").length,T=s.filter(A=>A.status==="resolved").length;function L(A){f==="changes"&&h("turns"),setTimeout(()=>{const B=document.querySelector(`mark[data-thread-id="${A}"]`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("thread-mark-flash"),setTimeout(()=>B.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(d0,{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:()=>k("open"),children:["Open (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",T,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",s.length,")"]})]}),_.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",x," threads."]}):_.map(A=>c.jsx(RS,{thread:A,threadTurns:A.turns??[],onStop:()=>o(n,A.id),onResolve:()=>E(A),onReopen:()=>a(n,A.id),onDelete:()=>u(n,A.id),onFollowup:B=>r(n,A.id,B),onLocate:()=>L(A.id)},A.id)),y&&c.jsx(NS,{thread:y,onClose:()=>E(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function IS(){const n=P(f=>f.apps),s=P(f=>f.activeAppTabId),r=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${s===f.id?" active":""}`,onClick:()=>r(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(Ll,{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(Vl,{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(fs,{size:12})})]},f.id))})}function DS(){var f,h;tn.trackRender("RightPanel");const n=P(m=>m.activeRightTab),s=P(m=>m.switchRightTab),r=P(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),o=((f=r==null?void 0:r.backgroundTasks)==null?void 0:f.length)??0,a=((h=r==null?void 0:r.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:()=>s(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(yS,{}),n==="changes"&&c.jsx(xS,{}),n==="tasks"&&c.jsx(bS,{}),n==="threads"&&c.jsx(AS,{}),n==="apps"&&c.jsx(IS,{})]})]})}const Ae={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"}},Lu=[{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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]}]}];function MS(n){return Lu.find(s=>s.id===n)}function gd(n){const s=MS(n);return(s==null?void 0:s.models)??[]}function Dg(n,s){return gd(n).find(r=>r.slug===s)}function Pu(n,s){var r;return((r=Dg(n,s))==null?void 0:r.reasoningLevels)??[]}function Ou(n,s){var r;return(r=Dg(n,s))==null?void 0:r.defaultReasoning}function LS(){const{activeSessionId:n,sessions:s,updateModelConfig:r}=P(),o=P(Q=>Q.showModelSelector),a=P(Q=>Q.setShowModelSelector),u=s.find(Q=>Q.id===n),f=P(Q=>Q.models),h=P(Q=>Q.modelsLoading),m=P(Q=>Q.loadModels),[g,x]=w.useState(!1),k=w.useRef(null);if(oa(k,()=>x(!1),g),Xu(()=>x(!1),g),w.useEffect(()=>{o&&(x(!0),a(!1))},[o,a]),w.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,E=u.model??"",_=u.model_reasoning_effort??"",C=f.length>0?f:[],T=gd(y),A=[...C.length>0?C:T];if(E&&!A.some(Q=>Q.slug===E)){const Q=T[0];A.unshift({slug:E,displayName:E,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function B(Q){return A.find(ne=>ne.slug===Q)}function M(Q){var ne;return C.length>0?((ne=B(Q))==null?void 0:ne.reasoningLevels)??[]:Pu(y,Q)}function W(Q){var ne;return C.length>0?(ne=B(Q))==null?void 0:ne.defaultReasoning:Ou(y,Q)}const q=Lu.find(Q=>Q.id===y),K=B(E),G=E?M(E):[],oe=(q==null?void 0:q.label)??y,ue=(K==null?void 0:K.displayName)??(E||"Default"),ie=G.find(Q=>Q.effort===_),we=(ie==null?void 0:ie.label)??(_||"Default");function Ce(Q){var J;const ne=M(Q),O=ne.some(H=>H.effort===_)?_:W(Q)??((J=ne[0])==null?void 0:J.effort)??"";r(Q,O),x(!1)}function Fe(Q){r(E,Q),x(!1)}return c.jsxs("div",{className:"model-selector",ref:k,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:oe}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:ue}),we!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:we})]}),c.jsx(si,{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"}),Lu.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.id===y?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===y){x(!1);return}r("","",Q.id)}},children:[c.jsx("span",{children:Q.label}),!Q.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(c0,{size:10})," Soon"]}),Q.id===y&&c.jsx(Zs,{size:12})]},Q.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(Q=>c.jsxs("div",{className:`model-selector-item ${Q.slug===E?"selected":""}`,onClick:()=>Ce(Q.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===E&&c.jsx(Zs,{size:12})]},Q.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),G.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),G.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.effort===_?"selected":""}`,onClick:()=>Fe(Q.effort),children:[c.jsx("span",{children:Q.label}),Q.effort===_&&c.jsx(Zs,{size:12})]},Q.effort))]})]})]})}function PS(n,s){if(!n||n.turns.length===0)return"—";const r=n.turns[0],o=n.turns[n.turns.length-1],a=s?null:o.updated_at;return Ux(r.created_at,a)}function Il(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function dm(){const n=P(r=>r.setShowRemoteModal),s=Fu(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(N0,{size:14})," Repoburg",s?` · ${s}`:""]})}function fm(){const n=P(r=>r.vscodeViewOpen),s=P(r=>r.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:s,children:[c.jsx(Zx,{size:14})," VS Code"]})}function OS(){var y,E;tn.trackRender("StatusBar");const n=P(_=>_.activeSessionId),s=P(_=>n?_.sessions.find(C=>C.id===n)??null:null),r=P(_=>n?_.sessionDetails[n]??null:null),o=P(_=>_.wsConnected),a=P(_=>_.switchRightTab),u=(r==null?void 0:r.contextUsage)??null;if(!s)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(fm,{}),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(uh,{size:14})," K"]})]});const f=ia(s),h=PS(r,f.isRunning),m=(r==null?void 0:r.backgroundTasks)??[],g=new Set,x=new Map;for(const _ of m)g.add(_.task_id),x.set(_.task_id,_.task_type);for(const _ of(r==null?void 0:r.turns)??[])for(const C of _.items)if(C.type==="background_task"&&C.status==="in_progress"){const T=((y=C.data)==null?void 0:y.task_id)??C.external_item_id,L=((E=C.data)==null?void 0:E.task_type)??"unknown";g.add(T),x.set(T,L)}const k=[...x.values()].filter(_=>_==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(fm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(LS,{}),k>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[c.jsx(Um,{size:14})," ",k]})]}),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:s.status==="failed"?{color:"var(--red)"}:void 0,children:[c.jsx(la,{status:f.dot})," ",f.label]}),u&&c.jsx(zS,{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(uh,{size:14})," K"]})]})}function zS({usage:n}){const s=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",r=`${Il(n.totalTokens)} / ${Il(n.contextWindow)} tokens`;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:r,children:c.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(n.percentage),"% / ",Il(n.totalTokens)," / ",Il(n.contextWindow)]})})]})}function pm(n){return gn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function $S(n){return _t("/vscode-web/start",{folder:n})}function FS(n){return _t("/vscode-web/heartbeat",{id:n})}const US=1e3,BS=5*6e4;function WS(){const n=P(_=>_.vscodeState),s=P(_=>_.vscodeId),r=P(_=>_.vscodeToken),o=P(_=>_.setVscodeView),a=P(_=>{var T;const C=_.activeSessionId?_.sessions.find(L=>L.id===_.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((T=_.workspaces.find(L=>L.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null),x=ps(),k=x===""||x===window.location.origin,y=`${x}/vscode/${s??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let _=!1;function C(){g.current&&(clearInterval(g.current),g.current=null)}async function T(){try{let A=await pm(a);if((A.state==="stopped"||A.state==="error")&&(A=await $S(a)),_||(o(A.state,A.id,A.token),A.state==="running"||A.state==="error"))return;g.current=setInterval(async()=>{const B=await pm(a);_||(o(B.state,B.id,B.token),(B.state==="running"||B.state==="error"||B.state==="stopped")&&C())},US)}catch{_||o("error",null,null)}}T();const L=setInterval(()=>{const A=P.getState().vscodeId;A&&FS(A).catch(()=>{})},BS);return()=>{_=!0,C(),clearInterval(L)}},[h,a,o]);function E(){f(!1),o("starting",null,null),m(_=>_+1)}return n!=="running"||!r||!s?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:E,children:[c.jsx(oo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(ns,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(ns,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},s)]}):c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(y,"_blank","noopener"),children:[c.jsx(e0,{size:14})," Open VS Code in a new tab"]})]})}const HS=`(function () {
|
|
439
|
+
`;g(O=>O+ne),E(!1),B(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(y.current){oe(),y.current.focus();const O=y.current.value.length;y.current.setSelectionRange(O,O)}},0)},[A]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(ne=>!ne),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Fe=(Ce=n.turns)==null?void 0:Ce[0])==null?void 0:Fe.user_prompt)==null?void 0:Q.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:ne=>{ne.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(f0,{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:N,onMouseDown:ue,children:[s.map(ne=>c.jsx(_S,{turn:ne},ne.id)),s.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),_&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:we,title:"Quote this text in your follow-up",children:[c.jsx($m,{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:M?"Agent is running…":"Type a follow-up…",value:m,onChange:ne=>{tn.markInputChange(),g(ne.target.value),oe()},disabled:M,rows:1,style:{minHeight:W,maxHeight:q},onKeyDown:ne=>{tn.markKeystroke(),ne.key==="Enter"&&(ne.metaKey||ne.ctrlKey)&&!M&&m.trim()&&(ne.preventDefault(),f(m.trim()),g(""),G(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:M||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(la,{size:13})}),M&&c.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:c.jsx(li,{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(Hl,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(oo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(fs,{size:13})," Delete"]})]})]})]})}function RS(){tn.trackRender("ThreadsPanel");const n=P(A=>A.activeSessionId),s=P(A=>{var B;return A.activeSessionId?((B=A.sessionDetails[A.activeSessionId])==null?void 0:B.threads)??cm:cm}),r=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,k]=w.useState("open"),[y,N]=w.useState(null);w.useEffect(()=>{if(!m)return;const A=m;g(null),k(M=>s.some(W=>W.id===A&&W.status==="open")?M:"all");const B=setTimeout(()=>{const M=document.getElementById(`thread-${A}`);M&&(M.scrollIntoView({behavior:"smooth",block:"center"}),M.classList.add("thread-card-highlighted"),setTimeout(()=>M.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(B)},[m,g,s]);const _=s.filter(A=>x==="open"?A.status==="open":x==="resolved"?A.status==="resolved":!0),E=s.filter(A=>A.status==="open").length,T=s.filter(A=>A.status==="resolved").length;function L(A){f==="changes"&&h("turns"),setTimeout(()=>{const B=document.querySelector(`mark[data-thread-id="${A}"]`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("thread-mark-flash"),setTimeout(()=>B.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(u0,{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:()=>k("open"),children:["Open (",E,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",T,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",s.length,")"]})]}),_.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",x," threads."]}):_.map(A=>c.jsx(jS,{thread:A,threadTurns:A.turns??[],onStop:()=>o(n,A.id),onResolve:()=>N(A),onReopen:()=>a(n,A.id),onDelete:()=>u(n,A.id),onFollowup:B=>r(n,A.id,B),onLocate:()=>L(A.id)},A.id)),y&&c.jsx(bS,{thread:y,onClose:()=>N(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function AS(){const n=P(f=>f.apps),s=P(f=>f.activeAppTabId),r=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${s===f.id?" active":""}`,onClick:()=>r(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(Ll,{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(Vl,{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(fs,{size:12})})]},f.id))})}function IS(){var f,h;tn.trackRender("RightPanel");const n=P(m=>m.activeRightTab),s=P(m=>m.switchRightTab),r=P(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),o=((f=r==null?void 0:r.backgroundTasks)==null?void 0:f.length)??0,a=((h=r==null?void 0:r.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:()=>s(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(vS,{}),n==="changes"&&c.jsx(yS,{}),n==="tasks"&&c.jsx(TS,{}),n==="threads"&&c.jsx(RS,{}),n==="apps"&&c.jsx(AS,{})]})]})}const Ae={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"}},Mu=[{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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]}]}];function DS(n){return Mu.find(s=>s.id===n)}function md(n){const s=DS(n);return(s==null?void 0:s.models)??[]}function Dg(n,s){return md(n).find(r=>r.slug===s)}function Lu(n,s){var r;return((r=Dg(n,s))==null?void 0:r.reasoningLevels)??[]}function Pu(n,s){var r;return(r=Dg(n,s))==null?void 0:r.defaultReasoning}function MS(){const{activeSessionId:n,sessions:s,updateModelConfig:r}=P(),o=P(Q=>Q.showModelSelector),a=P(Q=>Q.setShowModelSelector),u=s.find(Q=>Q.id===n),f=P(Q=>Q.models),h=P(Q=>Q.modelsLoading),m=P(Q=>Q.loadModels),[g,x]=w.useState(!1),k=w.useRef(null);if(oa(k,()=>x(!1),g),qu(()=>x(!1),g),w.useEffect(()=>{o&&(x(!0),a(!1))},[o,a]),w.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,N=u.model??"",_=u.model_reasoning_effort??"",E=f.length>0?f:[],T=md(y),A=[...E.length>0?E:T];if(N&&!A.some(Q=>Q.slug===N)){const Q=T[0];A.unshift({slug:N,displayName:N,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function B(Q){return A.find(ne=>ne.slug===Q)}function M(Q){var ne;return E.length>0?((ne=B(Q))==null?void 0:ne.reasoningLevels)??[]:Lu(y,Q)}function W(Q){var ne;return E.length>0?(ne=B(Q))==null?void 0:ne.defaultReasoning:Pu(y,Q)}const q=Mu.find(Q=>Q.id===y),K=B(N),G=N?M(N):[],oe=(q==null?void 0:q.label)??y,ue=(K==null?void 0:K.displayName)??(N||"Default"),ie=G.find(Q=>Q.effort===_),we=(ie==null?void 0:ie.label)??(_||"Default");function Ce(Q){var J;const ne=M(Q),O=ne.some(H=>H.effort===_)?_:W(Q)??((J=ne[0])==null?void 0:J.effort)??"";r(Q,O),x(!1)}function Fe(Q){r(N,Q),x(!1)}return c.jsxs("div",{className:"model-selector",ref:k,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:oe}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:ue}),we!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:we})]}),c.jsx(si,{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"}),Mu.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.id===y?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===y){x(!1);return}r("","",Q.id)}},children:[c.jsx("span",{children:Q.label}),!Q.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(a0,{size:10})," Soon"]}),Q.id===y&&c.jsx(Zs,{size:12})]},Q.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(Q=>c.jsxs("div",{className:`model-selector-item ${Q.slug===N?"selected":""}`,onClick:()=>Ce(Q.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===N&&c.jsx(Zs,{size:12})]},Q.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),G.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),G.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.effort===_?"selected":""}`,onClick:()=>Fe(Q.effort),children:[c.jsx("span",{children:Q.label}),Q.effort===_&&c.jsx(Zs,{size:12})]},Q.effort))]})]})]})}function Il(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function um(){const n=P(s=>s.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(b0,{size:14})," Repoburg"]})}function dm(){const n=P(r=>r.vscodeViewOpen),s=P(r=>r.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:s,children:[c.jsx(Qx,{size:14})," Code"]})}function LS(){var k,y;tn.trackRender("StatusBar");const n=P(N=>N.activeSessionId),s=P(N=>n?N.sessions.find(_=>_.id===n)??null:null),r=P(N=>n?N.sessionDetails[n]??null:null),o=P(N=>N.wsConnected),a=P(N=>N.switchRightTab),u=(r==null?void 0:r.contextUsage)??null;if(!s)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(um,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:o?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(ch,{size:14})," K"]})]});const f=ia(s),h=(r==null?void 0:r.backgroundTasks)??[],m=new Set,g=new Map;for(const N of h)m.add(N.task_id),g.set(N.task_id,N.task_type);for(const N of(r==null?void 0:r.turns)??[])for(const _ of N.items)if(_.type==="background_task"&&_.status==="in_progress"){const E=((k=_.data)==null?void 0:k.task_id)??_.external_item_id,T=((y=_.data)==null?void 0:y.task_type)??"unknown";m.add(E),g.set(E,T)}const x=[...g.values()].filter(N=>N==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(um,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(MS,{}),x>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:`${x} Monitor task${x>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[c.jsx(Um,{size:14})," ",x]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:o?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:s.status==="failed"?{color:"var(--red)"}:void 0,children:f.label}),u&&c.jsx(PS,{usage:u}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(ch,{size:14})," K"]})]})}function PS({usage:n}){const s=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",r=`${Il(n.totalTokens)} / ${Il(n.contextWindow)} tokens`;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:r,children:c.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(n.percentage),"% / ",Il(n.totalTokens)," / ",Il(n.contextWindow)]})})]})}function fm(n){return gn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function OS(n){return _t("/vscode-web/start",{folder:n})}function zS(n){return _t("/vscode-web/heartbeat",{id:n})}const $S=1e3,FS=5*6e4;function US(){const n=P(_=>_.vscodeState),s=P(_=>_.vscodeId),r=P(_=>_.vscodeToken),o=P(_=>_.setVscodeView),a=P(_=>{var T;const E=_.activeSessionId?_.sessions.find(L=>L.id===_.activeSessionId):null;return E!=null&&E.cwd?E.cwd:((T=_.workspaces.find(L=>L.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null),x=ps(),k=x===""||x===window.location.origin,y=`${x}/vscode/${s??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let _=!1;function E(){g.current&&(clearInterval(g.current),g.current=null)}async function T(){try{let A=await fm(a);if((A.state==="stopped"||A.state==="error")&&(A=await OS(a)),_||(o(A.state,A.id,A.token),A.state==="running"||A.state==="error"))return;g.current=setInterval(async()=>{const B=await fm(a);_||(o(B.state,B.id,B.token),(B.state==="running"||B.state==="error"||B.state==="stopped")&&E())},$S)}catch{_||o("error",null,null)}}T();const L=setInterval(()=>{const A=P.getState().vscodeId;A&&zS(A).catch(()=>{})},FS);return()=>{_=!0,E(),clearInterval(L)}},[h,a,o]);function N(){f(!1),o("starting",null,null),m(_=>_+1)}return n!=="running"||!r||!s?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:N,children:[c.jsx(oo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(ns,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(ns,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},s)]}):c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(y,"_blank","noopener"),children:[c.jsx(Jx,{size:14})," Open VS Code in a new tab"]})]})}const BS=`(function () {
|
|
440
440
|
var nextId = 1;
|
|
441
441
|
var pending = new Map();
|
|
442
442
|
var listeners = [];
|
|
@@ -490,9 +490,9 @@ ${A}
|
|
|
490
490
|
stack: (r && r.stack) || '', line: 0, col: 0
|
|
491
491
|
}, '*');
|
|
492
492
|
});
|
|
493
|
-
})();`;function hm(n){return n.replace(/<\/script/gi,"<\\/script")}function VS(n,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function mm(n,s,r){const o=VS(n,s);return o===-1?n+r:n.slice(0,o)+r+n.slice(o)}function GS(n,s,r){let o=n;const a=`<script>${hm(s)}<\/script>`;if(/<\/head>/i.test(o)?o=mm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${hm(r)}<\/script>`;o=mm(o,"</body>",u)}return o}function qS({appId:n,workspace:s=""}){const r=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[m,g]=w.useState([]);w.useEffect(()=>{let y=!0;ex(n,_=>{var C,T;return(T=(C=r.current)==null?void 0:C.contentWindow)==null?void 0:T.postMessage(_,"*")});const E=async _=>{var B,M,W,q,K,G,oe,ue;if(_.source!==((B=r.current)==null?void 0:B.contentWindow))return;const C=_.data;if(!C||C.source!=="agentpane-app")return;if(C.report==="error"){const ie={message:String(C.message??"Unknown error"),stack:String(C.stack??"")};g(we=>{const Ce=we[we.length-1];return Ce&&Ce.message===ie.message?we:[...we,ie].slice(-20)});return}if(typeof C.method!="string")return;let T=!0,L,A;try{switch(C.method){case"getApp":L={id:n};break;case"getState":L=o.current;break;case"setState":{const ie=((M=C.params)==null?void 0:M.data)??null,we=await Rm(n,{data:ie},s);o.current=we,L=we;break}case"createSession":{const ie=C.params??{},we=await Uu({title:typeof ie.title=="string"?ie.title:void 0,runtime_type:typeof ie.runtime_type=="string"?ie.runtime_type:void 0,model:typeof ie.model=="string"?ie.model:void 0,cwd:typeof ie.cwd=="string"?ie.cwd:void 0,origin_app_id:n});Jc(we.id,n),P.getState().addSession(we),L=we;break}case"submitTurn":{const ie=String(((W=C.params)==null?void 0:W.sessionId)??""),we=String(((q=C.params)==null?void 0:q.prompt)??""),Ce=await Cm(ie,we);Jc(ie,n),L=Ce;break}case"resolveToolCall":{const ie=String(((K=C.params)==null?void 0:K.callId)??""),we=(G=C.params)==null?void 0:G.result;await Cx(ie,we),L={ok:!0};break}default:throw new Error(`Unknown bridge method: ${C.method}`)}}catch(ie){T=!1,A=ie instanceof Error?ie.message:String(ie)}(ue=(oe=r.current)==null?void 0:oe.contentWindow)==null||ue.postMessage({source:"agentpane-host",id:C.id,ok:T,result:L,error:A},"*")};return window.addEventListener("message",E),ox(n,()=>{oh(n,s).then(_=>{y&&(o.current=_)}).catch(()=>{})}),rx(n,()=>{ih(n).then(_=>{y&&(u(_),g([]))}).catch(()=>{})}),(async()=>{try{const[_,C,T]=await Promise.all([ih(n),oh(n,s),kx(n).catch(()=>[])]);if(!y)return;o.current=C,T.forEach(L=>Jc(L.id,n)),u(_)}catch(_){y&&h(_ instanceof Error?_.message:String(_))}})(),()=>{y=!1,tx(n),ix(n),lx(n),window.removeEventListener("message",E)}},[n,s]);const x=w.useMemo(()=>a?GS(a.html,HS,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!x)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),k.map((y,E)=>c.jsxs("div",{className:"miniapp-diag",children:[y.file,":",y.line,":",y.column," — ",y.message]},E))]}),c.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts",title:`Mini app: ${n}`,srcDoc:x}),m.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:m.map((y,E)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:y.message}),y.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:y.stack})]},E))})]})}function KS({appId:n,active:s}){const r=P(y=>y.apps),o=P(y=>y.workspaces),a=P(y=>y.appWorkspaces),u=P(y=>y.setAppWorkspace),f=P(y=>y.setActiveAppTab),h=P(y=>y.startAppEdit),m=r.find(y=>y.id===n),g=a[n]??"",x=o.filter(y=>y.deleted!==1),k=g!==""&&!x.some(y=>y.path===g)?g:null;return c.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(m==null?void 0:m.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(m==null?void 0:m.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:g,onChange:y=>u(n,y.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),x.map(y=>c.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(n),children:[c.jsx(m0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Vn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(qS,{appId:n,workspace:g},`${n}:${g}`)})]})}function XS({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(y=>{const E=y.clientX-h.current,_=n==="left"?m.current+E:m.current-E,C=Math.min(r,Math.max(s,_));a(C)},[n,s,r,a]),x=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",x),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(y=>{var E,_;y.preventDefault(),y.stopPropagation();try{(_=(E=y.currentTarget)==null?void 0:E.setPointerCapture)==null||_.call(E,y.pointerId)}catch{}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 gm({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=XS({side:n,minWidth:s,maxWidth:r,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 YS(){tn.trackRender("IdeWorkspace");const n=P(m=>m.sidebarWidth),s=P(m=>m.rightPanelWidth),r=P(m=>m.setSidebarWidth),o=P(m=>m.setRightPanelWidth),a=P(m=>m.vscodeViewOpen),u=P(m=>m.activeAppTabId),f=P(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const g=$l(),{rightPanelWidth:x,setRightPanelWidth:k}=P.getState();x>g&&k(g)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const h=`${n}px 6px 1fr 6px ${s}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:h},children:[c.jsx(k1,{}),c.jsx(gm,{side:"left",minWidth:yu,maxWidth:xu,getWidth:()=>P.getState().sidebarWidth,setWidth:r}),c.jsxs("div",{className:"ide-center",children:[c.jsx(S1,{}),c.jsxs("div",{className:"ide-render",children:[f.map(m=>c.jsx(KS,{appId:m,active:u===m},m)),u==null&&c.jsx(iS,{})]}),c.jsx(vS,{})]}),c.jsx(gm,{side:"right",minWidth:zl,maxWidth:$l(),getWidth:()=>P.getState().rightPanelWidth,setWidth:o}),c.jsx(DS,{})]}),a&&c.jsx(WS,{}),c.jsx(OS,{})]})}function QS(){const{showNewSessionDialog:n,setShowNewSessionDialog:s,createSession:r,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]=w.useState(""),[g,x]=w.useState(u),[k,y]=w.useState(f),[E,_]=w.useState("");if(!n)return null;const C=gd(a),T=g?Pu(a,g):[];function L(){r({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:E.trim()||void 0,runtime_type:a}),m(""),_("")}function A(M){M.key==="Escape"&&s(!1)}function B(M){var K;x(M);const W=Pu(a,M);W.some(G=>G.effort===k)||y(Ou(a,M)??((K=W[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:M=>M.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:()=>s(!1),children:c.jsx(Vn,{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:M=>m(M.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:M=>B(M.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map(M=>c.jsxs("option",{value:M.slug,children:[M.displayName," — ",M.description]},M.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:M=>y(M.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Ou(a,g),")"]}),T.map(M=>c.jsx("option",{value:M.effort,children:M.label},M.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:E,onChange:M=>_(M.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:()=>s(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:L,children:"Create"})]})]})})}const ZS=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,JS=512*1024;function eT(n){const s=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function tT(){const{appCatalogOpen:n,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=P(),[f,h]=w.useState("examples"),[m,g]=w.useState(null),[x,k]=w.useState(null),[y,E]=w.useState(!1),[_,C]=w.useState(""),[T,L]=w.useState(""),[A,B]=w.useState(""),[M,W]=w.useState(""),[q,K]=w.useState(null),[G,oe]=w.useState(""),ue=w.useRef(null);if(w.useEffect(()=>{n&&(g(null),Sx().then(g).catch(()=>g([])))},[n]),w.useEffect(()=>{ue.current&&(ue.current.webkitdirectory=!0)},[f]),!n)return null;const ie=new Set(r.map(O=>O.id));async function we(O){k(O);try{await o(O)&&s()}finally{k(null)}}async function Ce(){if(y)return;const O=_.trim(),J=T.trim();if(!(!O||!J)){E(!0);try{await a({id:O,title:J,description:A.trim()||void 0,icon:M.trim()||void 0})&&(C(""),L(""),B(""),W(""),s())}finally{E(!1)}}}async function Fe(O){const J=Array.from(O.target.files??[]),H={};let b="";for(const R of J){const ce=(R.webkitRelativePath??"").split("/");!b&&ce.length>1&&(b=ce[0]);const ge=ce[ce.length-1];if(!(!ge||!ZS.test(ge))&&!(R.size>JS))try{H[ge]=await R.text()}catch{}}K(Object.keys(H).length>0?H:null),oe(eT(b))}async function Q(){if(!(y||!q||!G.trim())){E(!0);try{await u(G.trim(),q)&&(K(null),oe(""),s())}finally{E(!1)}}}function ne(O){O.key==="Escape"&&s()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:s,children:c.jsxs("div",{className:"dialog app-catalog",onClick:O=>O.stopPropagation(),onKeyDown:ne,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:s,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ae.map(O=>c.jsx("button",{className:`catalog-tab${f===O.key?" active":""}`,onClick:()=>h(O.key),children:O.label},O.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(O=>{const J=ie.has(O.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:O.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:O.title}),O.description&&c.jsx("span",{className:"example-desc",children:O.description})]}),c.jsx("button",{className:"example-install",disabled:J||x===O.id,onClick:()=>we(O.id),title:J?"Already installed":"Install this example",children:J?"Installed":x===O.id?"Installing…":"Install"})]},O.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:_,onChange:O=>C(O.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:O=>L(O.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:O=>B(O.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:M,onChange:O=>W(O.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!_.trim()||!T.trim(),onClick:Ce,children:[c.jsx(yr,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:ue,type:"file",multiple:!0,onChange:Fe}),q&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:G,onChange:O=>oe(O.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(q).length," file(s):"," ",Object.keys(q).slice(0,6).join(", "),Object.keys(q).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!q||!G.trim(),onClick:Q,children:[c.jsx(S0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function nT(){const n=P(k=>k.showCommandPalette),s=P(k=>k.setShowCommandPalette),r=P(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=ra(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:yr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:fs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:aa,action:()=>{const E=document.querySelector(".cmd-input");E==null||E.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:li,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:a0,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:t0,action:()=>r.switchRightTab("changes"),available:!!r.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Vn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),g=w.useMemo(()=>{const k=o.toLowerCase().trim(),y=m.filter(E=>E.available);return k?y.filter(E=>E.label.toLowerCase().includes(k)||E.hint.toLowerCase().includes(k)):y},[m,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function x(k){if(k.key==="ArrowDown")k.preventDefault(),f(y=>Math.min(y+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(y=>Math.max(y-1,0));else if(k.key==="Enter"){k.preventDefault();const y=g[u];y&&(y.action(),s(!1))}else k.key==="Escape"&&s(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown: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((k,y)=>{const E=k.icon;return c.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>f(y),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(E,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),y===u&&c.jsx(Jx,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const vm=/^[a-z][a-z0-9-]{1,30}$/,sT=2e3;function rT(){const{showRemoteModal:n,setShowRemoteModal:s,selectSession:r}=P(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,m]=w.useState(!1),[g,x]=w.useState(!1),[k,y]=w.useState(!1),[E,_]=w.useState(!1),[C,T]=w.useState("main"),[L,A]=w.useState(""),[B,M]=w.useState(!1),[W,q]=w.useState(null),K=w.useRef(null);oa(K,()=>_(!1),E);const G=g||k,oe=w.useCallback(async()=>{m(!0),f(null);try{const O=await fetch(`${ps()}/remote/status`,{headers:{Accept:"application/json"}});if(!O.ok)throw new Error(`status ${O.status}`);a(await O.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(T("main"),q(null),oe())},[n,oe]);const ue=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!ue)return;const O=setInterval(async()=>{try{const J=await fetch(`${ps()}/remote/enable`,{headers:{Accept:"application/json"}});J.ok&&q(await J.json())}catch{}},sT);return()=>clearInterval(O)},[ue]),!n)return null;const ie=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function we(O){O.key==="Escape"&&s(!1)}async function Ce(O){if(vm.test(O)){M(!0);try{const J=await fetch(`${ps()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:O})});if(!J.ok)throw new Error(`enable ${J.status}`);q(await J.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{M(!1)}}}function Fe(){W!=null&&W.troubleshootingSessionId&&(r(W.troubleshootingSessionId),s(!1))}async function Q(){x(!0);try{await fetch(`${ps()}/remote/disable`,{method:"POST"}),await oe()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{x(!1)}}async function ne(){if(_(!1),!!window.confirm(`Remove the tunnel completely?
|
|
493
|
+
})();`;function pm(n){return n.replace(/<\/script/gi,"<\\/script")}function WS(n,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function hm(n,s,r){const o=WS(n,s);return o===-1?n+r:n.slice(0,o)+r+n.slice(o)}function HS(n,s,r){let o=n;const a=`<script>${pm(s)}<\/script>`;if(/<\/head>/i.test(o)?o=hm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${pm(r)}<\/script>`;o=hm(o,"</body>",u)}return o}function VS({appId:n,workspace:s=""}){const r=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[m,g]=w.useState([]);w.useEffect(()=>{let y=!0;ex(n,_=>{var E,T;return(T=(E=r.current)==null?void 0:E.contentWindow)==null?void 0:T.postMessage(_,"*")});const N=async _=>{var B,M,W,q,K,G,oe,ue;if(_.source!==((B=r.current)==null?void 0:B.contentWindow))return;const E=_.data;if(!E||E.source!=="agentpane-app")return;if(E.report==="error"){const ie={message:String(E.message??"Unknown error"),stack:String(E.stack??"")};g(we=>{const Ce=we[we.length-1];return Ce&&Ce.message===ie.message?we:[...we,ie].slice(-20)});return}if(typeof E.method!="string")return;let T=!0,L,A;try{switch(E.method){case"getApp":L={id:n};break;case"getState":L=o.current;break;case"setState":{const ie=((M=E.params)==null?void 0:M.data)??null,we=await Rm(n,{data:ie},s);o.current=we,L=we;break}case"createSession":{const ie=E.params??{},we=await $u({title:typeof ie.title=="string"?ie.title:void 0,runtime_type:typeof ie.runtime_type=="string"?ie.runtime_type:void 0,model:typeof ie.model=="string"?ie.model:void 0,cwd:typeof ie.cwd=="string"?ie.cwd:void 0,origin_app_id:n});Zc(we.id,n),P.getState().addSession(we),L=we;break}case"submitTurn":{const ie=String(((W=E.params)==null?void 0:W.sessionId)??""),we=String(((q=E.params)==null?void 0:q.prompt)??""),Ce=await Cm(ie,we);Zc(ie,n),L=Ce;break}case"resolveToolCall":{const ie=String(((K=E.params)==null?void 0:K.callId)??""),we=(G=E.params)==null?void 0:G.result;await Cx(ie,we),L={ok:!0};break}default:throw new Error(`Unknown bridge method: ${E.method}`)}}catch(ie){T=!1,A=ie instanceof Error?ie.message:String(ie)}(ue=(oe=r.current)==null?void 0:oe.contentWindow)==null||ue.postMessage({source:"agentpane-host",id:E.id,ok:T,result:L,error:A},"*")};return window.addEventListener("message",N),ox(n,()=>{ih(n,s).then(_=>{y&&(o.current=_)}).catch(()=>{})}),rx(n,()=>{rh(n).then(_=>{y&&(u(_),g([]))}).catch(()=>{})}),(async()=>{try{const[_,E,T]=await Promise.all([rh(n),ih(n,s),kx(n).catch(()=>[])]);if(!y)return;o.current=E,T.forEach(L=>Zc(L.id,n)),u(_)}catch(_){y&&h(_ instanceof Error?_.message:String(_))}})(),()=>{y=!1,tx(n),ix(n),lx(n),window.removeEventListener("message",N)}},[n,s]);const x=w.useMemo(()=>a?HS(a.html,BS,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!x)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),k.map((y,N)=>c.jsxs("div",{className:"miniapp-diag",children:[y.file,":",y.line,":",y.column," — ",y.message]},N))]}),c.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts",title:`Mini app: ${n}`,srcDoc:x}),m.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:m.map((y,N)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:y.message}),y.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:y.stack})]},N))})]})}function GS({appId:n,active:s}){const r=P(y=>y.apps),o=P(y=>y.workspaces),a=P(y=>y.appWorkspaces),u=P(y=>y.setAppWorkspace),f=P(y=>y.setActiveAppTab),h=P(y=>y.startAppEdit),m=r.find(y=>y.id===n),g=a[n]??"",x=o.filter(y=>y.deleted!==1),k=g!==""&&!x.some(y=>y.path===g)?g:null;return c.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(m==null?void 0:m.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(m==null?void 0:m.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:g,onChange:y=>u(n,y.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),x.map(y=>c.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(n),children:[c.jsx(h0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Vn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(VS,{appId:n,workspace:g},`${n}:${g}`)})]})}function qS({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(y=>{const N=y.clientX-h.current,_=n==="left"?m.current+N:m.current-N,E=Math.min(r,Math.max(s,_));a(E)},[n,s,r,a]),x=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",x),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(y=>{var N,_;y.preventDefault(),y.stopPropagation();try{(_=(N=y.currentTarget)==null?void 0:N.setPointerCapture)==null||_.call(N,y.pointerId)}catch{}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 mm({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=qS({side:n,minWidth:s,maxWidth:r,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 KS(){tn.trackRender("IdeWorkspace");const n=P(m=>m.sidebarWidth),s=P(m=>m.rightPanelWidth),r=P(m=>m.setSidebarWidth),o=P(m=>m.setRightPanelWidth),a=P(m=>m.vscodeViewOpen),u=P(m=>m.activeAppTabId),f=P(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const g=$l(),{rightPanelWidth:x,setRightPanelWidth:k}=P.getState();x>g&&k(g)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const h=`${n}px 6px 1fr 6px ${s}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:h},children:[c.jsx(w1,{}),c.jsx(mm,{side:"left",minWidth:vu,maxWidth:yu,getWidth:()=>P.getState().sidebarWidth,setWidth:r}),c.jsxs("div",{className:"ide-center",children:[c.jsx(k1,{}),c.jsxs("div",{className:"ide-render",children:[f.map(m=>c.jsx(GS,{appId:m,active:u===m},m)),u==null&&c.jsx(rS,{})]}),c.jsx(gS,{})]}),c.jsx(mm,{side:"right",minWidth:zl,maxWidth:$l(),getWidth:()=>P.getState().rightPanelWidth,setWidth:o}),c.jsx(IS,{})]}),a&&c.jsx(US,{}),c.jsx(LS,{})]})}function XS(){const{showNewSessionDialog:n,setShowNewSessionDialog:s,createSession:r,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]=w.useState(""),[g,x]=w.useState(u),[k,y]=w.useState(f),[N,_]=w.useState("");if(!n)return null;const E=md(a),T=g?Lu(a,g):[];function L(){r({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:N.trim()||void 0,runtime_type:a}),m(""),_("")}function A(M){M.key==="Escape"&&s(!1)}function B(M){var K;x(M);const W=Lu(a,M);W.some(G=>G.effort===k)||y(Pu(a,M)??((K=W[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:M=>M.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:()=>s(!1),children:c.jsx(Vn,{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:M=>m(M.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:M=>B(M.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(M=>c.jsxs("option",{value:M.slug,children:[M.displayName," — ",M.description]},M.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:M=>y(M.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Pu(a,g),")"]}),T.map(M=>c.jsx("option",{value:M.effort,children:M.label},M.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:M=>_(M.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:()=>s(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:L,children:"Create"})]})]})})}const YS=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,QS=512*1024;function ZS(n){const s=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function JS(){const{appCatalogOpen:n,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=P(),[f,h]=w.useState("examples"),[m,g]=w.useState(null),[x,k]=w.useState(null),[y,N]=w.useState(!1),[_,E]=w.useState(""),[T,L]=w.useState(""),[A,B]=w.useState(""),[M,W]=w.useState(""),[q,K]=w.useState(null),[G,oe]=w.useState(""),ue=w.useRef(null);if(w.useEffect(()=>{n&&(g(null),Sx().then(g).catch(()=>g([])))},[n]),w.useEffect(()=>{ue.current&&(ue.current.webkitdirectory=!0)},[f]),!n)return null;const ie=new Set(r.map(O=>O.id));async function we(O){k(O);try{await o(O)&&s()}finally{k(null)}}async function Ce(){if(y)return;const O=_.trim(),J=T.trim();if(!(!O||!J)){N(!0);try{await a({id:O,title:J,description:A.trim()||void 0,icon:M.trim()||void 0})&&(E(""),L(""),B(""),W(""),s())}finally{N(!1)}}}async function Fe(O){const J=Array.from(O.target.files??[]),H={};let b="";for(const R of J){const ce=(R.webkitRelativePath??"").split("/");!b&&ce.length>1&&(b=ce[0]);const ge=ce[ce.length-1];if(!(!ge||!YS.test(ge))&&!(R.size>QS))try{H[ge]=await R.text()}catch{}}K(Object.keys(H).length>0?H:null),oe(ZS(b))}async function Q(){if(!(y||!q||!G.trim())){N(!0);try{await u(G.trim(),q)&&(K(null),oe(""),s())}finally{N(!1)}}}function ne(O){O.key==="Escape"&&s()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:s,children:c.jsxs("div",{className:"dialog app-catalog",onClick:O=>O.stopPropagation(),onKeyDown:ne,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:s,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ae.map(O=>c.jsx("button",{className:`catalog-tab${f===O.key?" active":""}`,onClick:()=>h(O.key),children:O.label},O.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(O=>{const J=ie.has(O.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:O.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:O.title}),O.description&&c.jsx("span",{className:"example-desc",children:O.description})]}),c.jsx("button",{className:"example-install",disabled:J||x===O.id,onClick:()=>we(O.id),title:J?"Already installed":"Install this example",children:J?"Installed":x===O.id?"Installing…":"Install"})]},O.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:_,onChange:O=>E(O.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:O=>L(O.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:O=>B(O.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:M,onChange:O=>W(O.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!_.trim()||!T.trim(),onClick:Ce,children:[c.jsx(yr,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:ue,type:"file",multiple:!0,onChange:Fe}),q&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:G,onChange:O=>oe(O.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(q).length," file(s):"," ",Object.keys(q).slice(0,6).join(", "),Object.keys(q).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!q||!G.trim(),onClick:Q,children:[c.jsx(k0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function eT(){const n=P(k=>k.showCommandPalette),s=P(k=>k.setShowCommandPalette),r=P(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=ra(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:yr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:fs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:la,action:()=>{const N=document.querySelector(".cmd-input");N==null||N.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:li,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:l0,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:e0,action:()=>r.switchRightTab("changes"),available:!!r.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Vn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),g=w.useMemo(()=>{const k=o.toLowerCase().trim(),y=m.filter(N=>N.available);return k?y.filter(N=>N.label.toLowerCase().includes(k)||N.hint.toLowerCase().includes(k)):y},[m,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function x(k){if(k.key==="ArrowDown")k.preventDefault(),f(y=>Math.min(y+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(y=>Math.max(y-1,0));else if(k.key==="Enter"){k.preventDefault();const y=g[u];y&&(y.action(),s(!1))}else k.key==="Escape"&&s(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown: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((k,y)=>{const N=k.icon;return c.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>f(y),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(N,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),y===u&&c.jsx(Zx,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const gm=/^[a-z][a-z0-9-]{1,30}$/,tT=2e3;function nT(){const{showRemoteModal:n,setShowRemoteModal:s,selectSession:r}=P(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,m]=w.useState(!1),[g,x]=w.useState(!1),[k,y]=w.useState(!1),[N,_]=w.useState(!1),[E,T]=w.useState("main"),[L,A]=w.useState(""),[B,M]=w.useState(!1),[W,q]=w.useState(null),K=w.useRef(null);oa(K,()=>_(!1),N);const G=g||k,oe=w.useCallback(async()=>{m(!0),f(null);try{const O=await fetch(`${ps()}/remote/status`,{headers:{Accept:"application/json"}});if(!O.ok)throw new Error(`status ${O.status}`);a(await O.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(T("main"),q(null),oe())},[n,oe]);const ue=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!ue)return;const O=setInterval(async()=>{try{const J=await fetch(`${ps()}/remote/enable`,{headers:{Accept:"application/json"}});J.ok&&q(await J.json())}catch{}},tT);return()=>clearInterval(O)},[ue]),!n)return null;const ie=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function we(O){O.key==="Escape"&&s(!1)}async function Ce(O){if(gm.test(O)){M(!0);try{const J=await fetch(`${ps()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:O})});if(!J.ok)throw new Error(`enable ${J.status}`);q(await J.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{M(!1)}}}function Fe(){W!=null&&W.troubleshootingSessionId&&(r(W.troubleshootingSessionId),s(!1))}async function Q(){x(!0);try{await fetch(`${ps()}/remote/disable`,{method:"POST"}),await oe()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{x(!1)}}async function ne(){if(_(!1),!!window.confirm(`Remove the tunnel completely?
|
|
494
494
|
|
|
495
495
|
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
496
496
|
|
|
497
|
-
This cannot be undone.`)){y(!0);try{const J=await fetch(`${ps()}/remote/uninstall`,{method:"DELETE"});if(!J.ok)throw new Error(`uninstall ${J.status}`);await oe()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ae(){if(!W)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:L,onChange:b=>A(b.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>T("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!
|
|
498
|
-
`)}),W.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Fe,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void oe(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:O=>O.stopPropagation(),onKeyDown:we,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:c.jsx(Vn,{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(ns,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),
|
|
497
|
+
This cannot be undone.`)){y(!0);try{const J=await fetch(`${ps()}/remote/uninstall`,{method:"DELETE"});if(!J.ok)throw new Error(`uninstall ${J.status}`);await oe()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ae(){if(!W)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:L,onChange:b=>A(b.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>T("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!gm.test(L)||B,onClick:()=>void Ce(L),children:[B?c.jsx(ns,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const O=["detect","provision","install","verify","ready"],J=O.indexOf(W.step),H=W.state==="ready";return c.jsxs(c.Fragment,{children:[W.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(ns,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),W.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(Zs,{size:14})," Setup complete — you can close this window."]}),W.state==="ready"&&W.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${W.hostname}`,target:"_blank",rel:"noreferrer",children:W.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:O.map((b,R)=>{const te=H||J>-1&&R<J,ce=!H&&R===J&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:te||ce?1:.4,color:te?"var(--green)":void 0},children:[te?c.jsx(Zs,{size:13}):ce?c.jsx(ns,{size:13,className:"spin"}):c.jsx(Yx,{size:9,style:{marginLeft:2,marginRight:2}}),b]},b)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(b=>b.message).join(`
|
|
498
|
+
`)}),W.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Fe,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void oe(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:O=>O.stopPropagation(),onKeyDown:we,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:c.jsx(Vn,{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(ns,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),E==="setup"?ae():c.jsxs(c.Fragment,{children:[ie&&(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 Q(),disabled:G,children:[g?c.jsx(ns,{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:()=>_(O=>!O),disabled:G,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":N,children:k?c.jsx(ns,{size:14,className:"spin"}):c.jsx(si,{size:14})}),N&&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 ne(),children:[c.jsx(fs,{size:12})," Remove tunnel"]})})]})]}),!ie&&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 Ce(o.tunnel.mahlas),disabled:B,children:[B?c.jsx(ns,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(uh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>T("setup"),children:[c.jsx(uh,{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 sT={success:Kx,error:Qu,info:s0,warn:x0},rT=4e3;function iT({toast:n}){const s=P(f=>f.removeToast),r=sT[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>s(n.id),rT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,s]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(r,{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),s(n.id)},children:[c.jsx(w0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>s(n.id),children:c.jsx(Vn,{size:14})})]})}function oT(){const n=P(s=>s.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(s=>c.jsx(iT,{toast:s},s.id))})}let Wn=null,ii=null,so=1e3;const lT=1e4;function aT(){const n=ps();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Ou(){Wn&&(Wn.readyState===WebSocket.OPEN||Wn.readyState===WebSocket.CONNECTING)||(Wn=new WebSocket(aT()),Wn.onopen=()=>{const n=so>1e3;if(so=1e3,P.getState().setWsConnected(!0),P.getState().addLogEntry("INFO","WebSocket connected"),n){const s=P.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Wn.onclose=()=>{P.getState().setWsConnected(!1),P.getState().addLogEntry("WARN","WebSocket disconnected"),P.getState().addToast("warn","WebSocket disconnected — reconnecting…"),uT()},Wn.onerror=()=>{},Wn.onmessage=n=>{try{const s=JSON.parse(n.data);tn.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof n.data=="string"?n.data.length:0);const r=dT[s.event];r&&r(s.data)}catch{}})}function cT(){ii&&(clearTimeout(ii),ii=null),Wn&&(Wn.onclose=null,Wn.close(),Wn=null),P.getState().setWsConnected(!1)}function uT(){ii||(ii=window.setTimeout(()=>{ii=null,Ou()},so),so=Math.min(so*2,lT))}const dT={"turn:started":n=>{const s=n;tn.note(`turn:started — ${s.turnId.slice(0,8)}`),P.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":n=>{const s=n;P.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":n=>{const s=n;P.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":n=>{const s=n;P.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":n=>{const s=n;P.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":n=>{const s=n;tn.note(`turn:completed — ${s.turnId.slice(0,8)}`),P.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":n=>{const s=n;P.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":n=>{const s=n,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage};P.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":n=>{const s=n;P.getState().onTurnFailed(s.sessionId,s.turnId,s.error)},"turn:cancelled":n=>{const s=n;P.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":n=>{const s=n;P.getState().onSessionTitle(s.sessionId,s.title)},background_tasks:n=>{const s=n;tn.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),P.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"thread:created":n=>{const s=n;P.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":n=>{const s=n;P.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":n=>{const s=n;P.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":n=>{const s=n;P.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":n=>{const s=n;nx(s.appId,s.callId,s.tool,s.args??{})},"app:source:updated":n=>{cx(n.appId)},"app:state_changed":n=>{ax(n.appId)}};function fT(){const n=P(s=>s.init);return w.useEffect(()=>{Iy(),n(),P.getState().loadApps(),Ou();function s(){if(document.visibilityState!=="visible")return;const r=P.getState(),o=r.activeSessionId;if(!o)return;const a=r.sessionDetails[o];r.wsConnected||Ou(),a&&a.is_running===1&&(r.refreshActiveSession(),r.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",s),()=>{cT(),document.removeEventListener("visibilitychange",s)}},[n]),null}function pT(){const n=P(a=>a.loading),s=P(a=>a.error),r=P(a=>a.sessions),o=P(a=>a.setShowCommandPalette);return w.useEffect(()=>tn.start(),[]),w.useEffect(()=>{function a(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]),c.jsxs(c.Fragment,{children:[c.jsx(fT,{}),n&&r.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",s]}):c.jsxs(c.Fragment,{children:[c.jsx(KS,{}),c.jsx(XS,{}),c.jsx(JS,{}),c.jsx(nT,{}),c.jsx(eT,{}),c.jsx(oT,{})]})]})}Sy.createRoot(document.getElementById("root")).render(c.jsx(at.StrictMode,{children:c.jsx(pT,{})}));
|