@ra3orblade/swarm 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web/dashboard.js CHANGED
@@ -1,23 +1,28 @@
1
- (()=>{var G0=Object.create;var{getPrototypeOf:Y0,defineProperty:Hf,getOwnPropertyNames:V0}=Object;var X0=Object.prototype.hasOwnProperty;function Q0(e){return this[e]}var Z0,J0,S=(e,t,n)=>{var a=e!=null&&typeof e==="object";if(a){var l=t?Z0??=new WeakMap:J0??=new WeakMap,o=l.get(e);if(o)return o}n=e!=null?G0(Y0(e)):{};let i=t||!e||!e.__esModule?Hf(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let r of V0(e))if(!X0.call(i,r))Hf(i,r,{get:Q0.bind(e,r),enumerable:!0})}if(a)l.set(e,i);return i};var Kn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pf=Kn(function(Q){var Sc=Symbol.for("react.transitional.element"),W0=Symbol.for("react.portal"),P0=Symbol.for("react.fragment"),I0=Symbol.for("react.strict_mode"),F0=Symbol.for("react.profiler"),eS=Symbol.for("react.consumer"),tS=Symbol.for("react.context"),nS=Symbol.for("react.forward_ref"),aS=Symbol.for("react.suspense"),lS=Symbol.for("react.memo"),Vf=Symbol.for("react.lazy"),oS=Symbol.for("react.activity"),$f=Symbol.iterator;function iS(e){if(e===null||typeof e!=="object")return null;return e=$f&&e[$f]||e["@@iterator"],typeof e==="function"?e:null}var Xf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qf=Object.assign,Zf={};function Vl(e,t,n){this.props=e,this.context=t,this.refs=Zf,this.updater=n||Xf}Vl.prototype.isReactComponent={};Vl.prototype.setState=function(e,t){if(typeof e!=="object"&&typeof e!=="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Vl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jf(){}Jf.prototype=Vl.prototype;function wc(e,t,n){this.props=e,this.context=t,this.refs=Zf,this.updater=n||Xf}var Mc=wc.prototype=new Jf;Mc.constructor=wc;Qf(Mc,Vl.prototype);Mc.isPureReactComponent=!0;var qf=Array.isArray;function yc(){}var _e={H:null,A:null,T:null,S:null},Wf=Object.prototype.hasOwnProperty;function xc(e,t,n){var a=n.ref;return{$$typeof:Sc,type:e,key:t,ref:a!==void 0?a:null,props:n}}function rS(e,t){return xc(e.type,t,e.props)}function kc(e){return typeof e==="object"&&e!==null&&e.$$typeof===Sc}function sS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Gf=/\/+/g;function bc(e,t){return typeof e==="object"&&e!==null&&e.key!=null?sS(""+e.key):t.toString(36)}function cS(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status==="string"?e.then(yc,yc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Yl(e,t,n,a,l){var o=typeof e;if(o==="undefined"||o==="boolean")e=null;var i=!1;if(e===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Sc:case W0:i=!0;break;case Vf:return i=e._init,Yl(i(e._payload),t,n,a,l)}}if(i)return l=l(e),i=a===""?"."+bc(e,0):a,qf(l)?(n="",i!=null&&(n=i.replace(Gf,"$&/")+"/"),Yl(l,t,n,"",function(c){return c})):l!=null&&(kc(l)&&(l=rS(l,n+(l.key==null||e&&e.key===l.key?"":(""+l.key).replace(Gf,"$&/")+"/")+i)),t.push(l)),1;i=0;var r=a===""?".":a+":";if(qf(e))for(var s=0;s<e.length;s++)a=e[s],o=r+bc(a,s),i+=Yl(a,t,n,o,l);else if(s=iS(e),typeof s==="function")for(e=s.call(e),s=0;!(a=e.next()).done;)a=a.value,o=r+bc(a,s++),i+=Yl(a,t,n,o,l);else if(o==="object"){if(typeof e.then==="function")return Yl(cS(e),t,n,a,l);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function mr(e,t,n){if(e==null)return e;var a=[],l=0;return Yl(e,a,"","",function(o){return t.call(n,o,l++)}),a}function uS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){if(e._status===0||e._status===-1)e._status=1,e._result=n},function(n){if(e._status===0||e._status===-1)e._status=2,e._result=n}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Yf=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},dS={map:mr,forEach:function(e,t,n){mr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return mr(e,function(){t++}),t},toArray:function(e){return mr(e,function(t){return t})||[]},only:function(e){if(!kc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Q.Activity=oS;Q.Children=dS;Q.Component=Vl;Q.Fragment=P0;Q.Profiler=F0;Q.PureComponent=wc;Q.StrictMode=I0;Q.Suspense=aS;Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_e;Q.__COMPILER_RUNTIME={__proto__:null,c:function(e){return _e.H.useMemoCache(e)}};Q.cache=function(e){return function(){return e.apply(null,arguments)}};Q.cacheSignal=function(){return null};Q.cloneElement=function(e,t,n){if(e===null||e===void 0)throw Error("The argument must be a React element, but you passed "+e+".");var a=Qf({},e.props),l=e.key;if(t!=null)for(o in t.key!==void 0&&(l=""+t.key),t)!Wf.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(a[o]=t[o]);var o=arguments.length-2;if(o===1)a.children=n;else if(1<o){for(var i=Array(o),r=0;r<o;r++)i[r]=arguments[r+2];a.children=i}return xc(e.type,l,a)};Q.createContext=function(e){return e={$$typeof:tS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:eS,_context:e},e};Q.createElement=function(e,t,n){var a,l={},o=null;if(t!=null)for(a in t.key!==void 0&&(o=""+t.key),t)Wf.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(l[a]=t[a]);var i=arguments.length-2;if(i===1)l.children=n;else if(1<i){for(var r=Array(i),s=0;s<i;s++)r[s]=arguments[s+2];l.children=r}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)l[a]===void 0&&(l[a]=i[a]);return xc(e,o,l)};Q.createRef=function(){return{current:null}};Q.forwardRef=function(e){return{$$typeof:nS,render:e}};Q.isValidElement=kc;Q.lazy=function(e){return{$$typeof:Vf,_payload:{_status:-1,_result:e},_init:uS}};Q.memo=function(e,t){return{$$typeof:lS,type:e,compare:t===void 0?null:t}};Q.startTransition=function(e){var t=_e.T,n={};_e.T=n;try{var a=e(),l=_e.S;l!==null&&l(n,a),typeof a==="object"&&a!==null&&typeof a.then==="function"&&a.then(yc,Yf)}catch(o){Yf(o)}finally{t!==null&&n.types!==null&&(t.types=n.types),_e.T=t}};Q.unstable_useCacheRefresh=function(){return _e.H.useCacheRefresh()};Q.use=function(e){return _e.H.use(e)};Q.useActionState=function(e,t,n){return _e.H.useActionState(e,t,n)};Q.useCallback=function(e,t){return _e.H.useCallback(e,t)};Q.useContext=function(e){return _e.H.useContext(e)};Q.useDebugValue=function(){};Q.useDeferredValue=function(e,t){return _e.H.useDeferredValue(e,t)};Q.useEffect=function(e,t){return _e.H.useEffect(e,t)};Q.useEffectEvent=function(e){return _e.H.useEffectEvent(e)};Q.useId=function(){return _e.H.useId()};Q.useImperativeHandle=function(e,t,n){return _e.H.useImperativeHandle(e,t,n)};Q.useInsertionEffect=function(e,t){return _e.H.useInsertionEffect(e,t)};Q.useLayoutEffect=function(e,t){return _e.H.useLayoutEffect(e,t)};Q.useMemo=function(e,t){return _e.H.useMemo(e,t)};Q.useOptimistic=function(e,t){return _e.H.useOptimistic(e,t)};Q.useReducer=function(e,t,n){return _e.H.useReducer(e,t,n)};Q.useRef=function(e){return _e.H.useRef(e)};Q.useState=function(e){return _e.H.useState(e)};Q.useSyncExternalStore=function(e,t,n){return _e.H.useSyncExternalStore(e,t,n)};Q.useTransition=function(){return _e.H.useTransition()};Q.version="19.2.8"});var B=Kn(function(qk,If){If.exports=Pf()});var op=Kn(function(Ue){function Oc(e,t){var n=e.length;e.push(t);e:for(;0<n;){var a=n-1>>>1,l=e[a];if(0<hr(l,t))e[a]=t,e[n]=l,n=a;else break e}}function jn(e){return e.length===0?null:e[0]}function yr(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var a=0,l=e.length,o=l>>>1;a<o;){var i=2*(a+1)-1,r=e[i],s=i+1,c=e[s];if(0>hr(r,n))s<l&&0>hr(c,r)?(e[a]=c,e[s]=n,a=s):(e[a]=r,e[i]=n,a=i);else if(s<l&&0>hr(c,n))e[a]=c,e[s]=n,a=s;else break e}}return t}function hr(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}Ue.unstable_now=void 0;if(typeof performance==="object"&&typeof performance.now==="function")Ec=performance,Ue.unstable_now=function(){return Ec.now()};else gr=Date,Nc=gr.now(),Ue.unstable_now=function(){return gr.now()-Nc};var Ec,gr,Nc,Zn=[],Ma=[],fS=1,rn=null,kt=3,Tc=!1,Wo=!1,Po=!1,Cc=!1,ep=typeof setTimeout==="function"?setTimeout:null,tp=typeof clearTimeout==="function"?clearTimeout:null,Ff=typeof setImmediate<"u"?setImmediate:null;function vr(e){for(var t=jn(Ma);t!==null;){if(t.callback===null)yr(Ma);else if(t.startTime<=e)yr(Ma),t.sortIndex=t.expirationTime,Oc(Zn,t);else break;t=jn(Ma)}}function Ac(e){if(Po=!1,vr(e),!Wo)if(jn(Zn)!==null)Wo=!0,Ql||(Ql=!0,Xl());else{var t=jn(Ma);t!==null&&zc(Ac,t.startTime-e)}}var Ql=!1,Io=-1,np=5,ap=-1;function lp(){return Cc?!0:Ue.unstable_now()-ap<np?!1:!0}function Dc(){if(Cc=!1,Ql){var e=Ue.unstable_now();ap=e;var t=!0;try{e:{Wo=!1,Po&&(Po=!1,tp(Io),Io=-1),Tc=!0;var n=kt;try{t:{vr(e);for(rn=jn(Zn);rn!==null&&!(rn.expirationTime>e&&lp());){var a=rn.callback;if(typeof a==="function"){rn.callback=null,kt=rn.priorityLevel;var l=a(rn.expirationTime<=e);if(e=Ue.unstable_now(),typeof l==="function"){rn.callback=l,vr(e),t=!0;break t}rn===jn(Zn)&&yr(Zn),vr(e)}else yr(Zn);rn=jn(Zn)}if(rn!==null)t=!0;else{var o=jn(Ma);o!==null&&zc(Ac,o.startTime-e),t=!1}}break e}finally{rn=null,kt=n,Tc=!1}t=void 0}}finally{t?Xl():Ql=!1}}}var Xl;if(typeof Ff==="function")Xl=function(){Ff(Dc)};else if(typeof MessageChannel<"u")br=new MessageChannel,Rc=br.port2,br.port1.onmessage=Dc,Xl=function(){Rc.postMessage(null)};else Xl=function(){ep(Dc,0)};var br,Rc;function zc(e,t){Io=ep(function(){e(Ue.unstable_now())},t)}Ue.unstable_IdlePriority=5;Ue.unstable_ImmediatePriority=1;Ue.unstable_LowPriority=4;Ue.unstable_NormalPriority=3;Ue.unstable_Profiling=null;Ue.unstable_UserBlockingPriority=2;Ue.unstable_cancelCallback=function(e){e.callback=null};Ue.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):np=0<e?Math.floor(1000/e):5};Ue.unstable_getCurrentPriorityLevel=function(){return kt};Ue.unstable_next=function(e){switch(kt){case 1:case 2:case 3:var t=3;break;default:t=kt}var n=kt;kt=t;try{return e()}finally{kt=n}};Ue.unstable_requestPaint=function(){Cc=!0};Ue.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=kt;kt=e;try{return t()}finally{kt=n}};Ue.unstable_scheduleCallback=function(e,t,n){var a=Ue.unstable_now();switch(typeof n==="object"&&n!==null?(n=n.delay,n=typeof n==="number"&&0<n?a+n:a):n=a,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5000}return l=n+l,e={id:fS++,callback:t,priorityLevel:e,startTime:n,expirationTime:l,sortIndex:-1},n>a?(e.sortIndex=n,Oc(Ma,e),jn(Zn)===null&&e===jn(Ma)&&(Po?(tp(Io),Io=-1):Po=!0,zc(Ac,n-a))):(e.sortIndex=l,Oc(Zn,e),Wo||Tc||(Wo=!0,Ql||(Ql=!0,Xl()))),e};Ue.unstable_shouldYield=lp;Ue.unstable_wrapCallback=function(e){var t=kt;return function(){var n=kt;kt=t;try{return e.apply(this,arguments)}finally{kt=n}}}});var rp=Kn(function(Yk,ip){ip.exports=op()});var cp=Kn(function(Rt){var pS=B();function sp(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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."}function xa(){}var Tt={d:{f:xa,r:function(){throw Error(sp(522))},D:xa,C:xa,L:xa,m:xa,X:xa,S:xa,M:xa},p:0,findDOMNode:null},mS=Symbol.for("react.portal");function hS(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mS,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var Fo=pS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Sr(e,t){if(e==="font")return"";if(typeof t==="string")return t==="use-credentials"?t:""}Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Tt;Rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(sp(299));return hS(e,t,null,n)};Rt.flushSync=function(e){var t=Fo.T,n=Tt.p;try{if(Fo.T=null,Tt.p=2,e)return e()}finally{Fo.T=t,Tt.p=n,Tt.d.f()}};Rt.preconnect=function(e,t){typeof e==="string"&&(t?(t=t.crossOrigin,t=typeof t==="string"?t==="use-credentials"?t:"":void 0):t=null,Tt.d.C(e,t))};Rt.prefetchDNS=function(e){typeof e==="string"&&Tt.d.D(e)};Rt.preinit=function(e,t){if(typeof e==="string"&&t&&typeof t.as==="string"){var n=t.as,a=Sr(n,t.crossOrigin),l=typeof t.integrity==="string"?t.integrity:void 0,o=typeof t.fetchPriority==="string"?t.fetchPriority:void 0;n==="style"?Tt.d.S(e,typeof t.precedence==="string"?t.precedence:void 0,{crossOrigin:a,integrity:l,fetchPriority:o}):n==="script"&&Tt.d.X(e,{crossOrigin:a,integrity:l,fetchPriority:o,nonce:typeof t.nonce==="string"?t.nonce:void 0})}};Rt.preinitModule=function(e,t){if(typeof e==="string")if(typeof t==="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Sr(t.as,t.crossOrigin);Tt.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0})}}else t==null&&Tt.d.M(e)};Rt.preload=function(e,t){if(typeof e==="string"&&typeof t==="object"&&t!==null&&typeof t.as==="string"){var n=t.as,a=Sr(n,t.crossOrigin);Tt.d.L(e,n,{crossOrigin:a,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0,type:typeof t.type==="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority==="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==="string"?t.imageSizes:void 0,media:typeof t.media==="string"?t.media:void 0})}};Rt.preloadModule=function(e,t){if(typeof e==="string")if(t){var n=Sr(t.as,t.crossOrigin);Tt.d.m(e,{as:typeof t.as==="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==="string"?t.integrity:void 0})}else Tt.d.m(e)};Rt.requestFormReset=function(e){Tt.d.r(e)};Rt.unstable_batchedUpdates=function(e,t){return e(t)};Rt.useFormState=function(e,t,n){return Fo.H.useFormState(e,t,n)};Rt.useFormStatus=function(){return Fo.H.useHostTransitionStatus()};Rt.version="19.2.8"});var wr=Kn(function(Xk,dp){function up(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(up)}catch(e){console.error(e)}}up(),dp.exports=cp()});var wv=Kn(function(Gs){var st=rp(),Lm=B(),gS=wr();function x(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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."}function Km(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function jm(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 Bm(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function fp(e){if(qi(e)!==e)throw Error(x(188))}function vS(e){var t=e.alternate;if(!t){if(t=qi(e),t===null)throw Error(x(188));return t!==e?null:e}for(var n=e,a=t;;){var l=n.return;if(l===null)break;var o=l.alternate;if(o===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===o.child){for(o=l.child;o;){if(o===n)return fp(l),e;if(o===a)return fp(l),t;o=o.sibling}throw Error(x(188))}if(n.return!==a.return)n=l,a=o;else{for(var i=!1,r=l.child;r;){if(r===n){i=!0,n=l,a=o;break}if(r===a){i=!0,a=l,n=o;break}r=r.sibling}if(!i){for(r=o.child;r;){if(r===n){i=!0,n=o,a=l;break}if(r===a){i=!0,a=o,n=l;break}r=r.sibling}if(!i)throw Error(x(189))}}if(n.alternate!==a)throw Error(x(190))}if(n.tag!==3)throw Error(x(188));return n.stateNode.current===n?e:t}function Um(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Um(e),t!==null)return t;e=e.sibling}return null}var je=Object.assign,bS=Symbol.for("react.element"),Mr=Symbol.for("react.transitional.element"),ii=Symbol.for("react.portal"),Fl=Symbol.for("react.fragment"),Hm=Symbol.for("react.strict_mode"),fu=Symbol.for("react.profiler"),$m=Symbol.for("react.consumer"),na=Symbol.for("react.context"),cd=Symbol.for("react.forward_ref"),pu=Symbol.for("react.suspense"),mu=Symbol.for("react.suspense_list"),ud=Symbol.for("react.memo"),ka=Symbol.for("react.lazy"),hu=Symbol.for("react.activity"),yS=Symbol.for("react.memo_cache_sentinel"),pp=Symbol.iterator;function ei(e){if(e===null||typeof e!=="object")return null;return e=pp&&e[pp]||e["@@iterator"],typeof e==="function"?e:null}var SS=Symbol.for("react.client.reference");function gu(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===SS?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case Fl:return"Fragment";case fu:return"Profiler";case Hm:return"StrictMode";case pu:return"Suspense";case mu:return"SuspenseList";case hu:return"Activity"}if(typeof e==="object")switch(e.$$typeof){case ii:return"Portal";case na:return e.displayName||"Context";case $m:return(e._context.displayName||"Context")+".Consumer";case cd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ud:return t=e.displayName||null,t!==null?t:gu(e.type)||"Memo";case ka:t=e._payload,e=e._init;try{return gu(e(t))}catch(n){}}return null}var ri=Array.isArray,U=Lm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=gS.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,vl={pending:!1,data:null,method:null,action:null},vu=[],eo=-1;function qn(e){return{current:e}}function gt(e){0>eo||(e.current=vu[eo],vu[eo]=null,eo--)}function Ce(e,t){eo++,vu[eo]=e.current,e.current=t}var $n=qn(null),Ni=qn(null),La=qn(null),Ir=qn(null);function Fr(e,t){switch(Ce(La,t),Ce(Ni,e),Ce($n,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)?(e=e.namespaceURI)?bm(e):0:0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bm(t),e=rv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}gt($n),Ce($n,e)}function yo(){gt($n),gt(Ni),gt(La)}function bu(e){e.memoizedState!==null&&Ce(Ir,e);var t=$n.current,n=rv(t,e.type);t!==n&&(Ce(Ni,e),Ce($n,n))}function es(e){Ni.current===e&&(gt($n),gt(Ni)),Ir.current===e&&(gt(Ir),Ui._currentValue=vl)}var _c,mp;function fl(e){if(_c===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_c=t&&t[1]||"",mp=-1<n.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+_c+e+mp}var Lc=!1;function Kc(e,t){if(!e||Lc)return"";Lc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(p){var u=p}Reflect.construct(e,[],h)}else{try{h.call()}catch(p){u=p}e.call(h.prototype)}}else{try{throw Error()}catch(p){u=p}(h=e())&&typeof h.catch==="function"&&h.catch(function(){})}}catch(p){if(p&&u&&typeof p.stack==="string")return[p.stack,u.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),i=o[0],r=o[1];if(i&&r){var s=i.split(`
4
- `),c=r.split(`
5
- `);for(l=a=0;a<s.length&&!s[a].includes("DetermineComponentFrameRoot");)a++;for(;l<c.length&&!c[l].includes("DetermineComponentFrameRoot");)l++;if(a===s.length||l===c.length)for(a=s.length-1,l=c.length-1;1<=a&&0<=l&&s[a]!==c[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==c[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==c[l]){var d=`
6
- `+s[a].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=a&&0<=l);break}}}finally{Lc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?fl(n):""}function wS(e,t){switch(e.tag){case 26:case 27:case 5:return fl(e.type);case 16:return fl("Lazy");case 13:return e.child!==t&&t!==null?fl("Suspense Fallback"):fl("Suspense");case 19:return fl("SuspenseList");case 0:case 15:return Kc(e.type,!1);case 11:return Kc(e.type.render,!1);case 1:return Kc(e.type,!0);case 31:return fl("Activity");default:return""}}function hp(e){try{var t="",n=null;do t+=wS(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
1
+ (()=>{var Wq=Object.create;var{getPrototypeOf:Zq,defineProperty:y0,getOwnPropertyNames:Yq}=Object;var w0=Object.prototype.hasOwnProperty;function Xq(e){return this[e]}var Qq,Jq,x=(e,t,o)=>{var a=e!=null&&typeof e==="object";if(a){var n=t?Qq??=new WeakMap:Jq??=new WeakMap,r=n.get(e);if(r)return r}o=e!=null?Wq(Zq(e)):{};let s=t||!e||!e.__esModule||!w0.call(e,"default")?y0(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let l of Yq(e))if(!w0.call(s,l))y0(s,l,{get:Xq.bind(e,l),enumerable:!0})}if(a)n.set(e,s);return s};var $a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var i=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var N0=$a(function(ae){var pf=Symbol.for("react.transitional.element"),e$=Symbol.for("react.portal"),t$=Symbol.for("react.fragment"),o$=Symbol.for("react.strict_mode"),a$=Symbol.for("react.profiler"),n$=Symbol.for("react.consumer"),r$=Symbol.for("react.context"),s$=Symbol.for("react.forward_ref"),i$=Symbol.for("react.suspense"),l$=Symbol.for("react.memo"),k0=Symbol.for("react.lazy"),c$=Symbol.for("react.activity"),I0=Symbol.iterator;function u$(e){if(e===null||typeof e!=="object")return null;return e=I0&&e[I0]||e["@@iterator"],typeof e==="function"?e:null}var D0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T0=Object.assign,A0={};function Ws(e,t,o){this.props=e,this.context=t,this.refs=A0,this.updater=o||D0}Ws.prototype.isReactComponent={};Ws.prototype.setState=function(e,t){if(typeof e!=="object"&&typeof e!=="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ws.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function E0(){}E0.prototype=Ws.prototype;function hf(e,t,o){this.props=e,this.context=t,this.refs=A0,this.updater=o||D0}var gf=hf.prototype=new E0;gf.constructor=hf;T0(gf,Ws.prototype);gf.isPureReactComponent=!0;var x0=Array.isArray;function ff(){}var et={H:null,A:null,T:null,S:null},O0=Object.prototype.hasOwnProperty;function bf(e,t,o){var a=o.ref;return{$$typeof:pf,type:e,key:t,ref:a!==void 0?a:null,props:o}}function d$(e,t){return bf(e.type,t,e.props)}function vf(e){return typeof e==="object"&&e!==null&&e.$$typeof===pf}function m$(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return t[o]})}var C0=/\/+/g;function mf(e,t){return typeof e==="object"&&e!==null&&e.key!=null?m$(""+e.key):t.toString(36)}function f$(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status==="string"?e.then(ff,ff):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function $s(e,t,o,a,n){var r=typeof e;if(r==="undefined"||r==="boolean")e=null;var s=!1;if(e===null)s=!0;else switch(r){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case pf:case e$:s=!0;break;case k0:return s=e._init,$s(s(e._payload),t,o,a,n)}}if(s)return n=n(e),s=a===""?"."+mf(e,0):a,x0(n)?(o="",s!=null&&(o=s.replace(C0,"$&/")+"/"),$s(n,t,o,"",function(u){return u})):n!=null&&(vf(n)&&(n=d$(n,o+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(C0,"$&/")+"/")+s)),t.push(n)),1;s=0;var l=a===""?".":a+":";if(x0(e))for(var c=0;c<e.length;c++)a=e[c],r=l+mf(a,c),s+=$s(a,t,o,r,n);else if(c=u$(e),typeof c==="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,r=l+mf(a,c++),s+=$s(a,t,o,r,n);else if(r==="object"){if(typeof e.then==="function")return $s(f$(e),t,o,a,n);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function su(e,t,o){if(e==null)return e;var a=[],n=0;return $s(e,a,"","",function(r){return t.call(o,r,n++)}),a}function p$(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(o){if(e._status===0||e._status===-1)e._status=1,e._result=o},function(o){if(e._status===0||e._status===-1)e._status=2,e._result=o}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M0=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},h$={map:su,forEach:function(e,t,o){su(e,function(){t.apply(this,arguments)},o)},count:function(e){var t=0;return su(e,function(){t++}),t},toArray:function(e){return su(e,function(t){return t})||[]},only:function(e){if(!vf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Activity=c$;ae.Children=h$;ae.Component=Ws;ae.Fragment=t$;ae.Profiler=a$;ae.PureComponent=hf;ae.StrictMode=o$;ae.Suspense=i$;ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=et;ae.__COMPILER_RUNTIME={__proto__:null,c:function(e){return et.H.useMemoCache(e)}};ae.cache=function(e){return function(){return e.apply(null,arguments)}};ae.cacheSignal=function(){return null};ae.cloneElement=function(e,t,o){if(e===null||e===void 0)throw Error("The argument must be a React element, but you passed "+e+".");var a=T0({},e.props),n=e.key;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)!O0.call(t,r)||r==="key"||r==="__self"||r==="__source"||r==="ref"&&t.ref===void 0||(a[r]=t[r]);var r=arguments.length-2;if(r===1)a.children=o;else if(1<r){for(var s=Array(r),l=0;l<r;l++)s[l]=arguments[l+2];a.children=s}return bf(e.type,n,a)};ae.createContext=function(e){return e={$$typeof:r$,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:n$,_context:e},e};ae.createElement=function(e,t,o){var a,n={},r=null;if(t!=null)for(a in t.key!==void 0&&(r=""+t.key),t)O0.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(n[a]=t[a]);var s=arguments.length-2;if(s===1)n.children=o;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];n.children=l}if(e&&e.defaultProps)for(a in s=e.defaultProps,s)n[a]===void 0&&(n[a]=s[a]);return bf(e,r,n)};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:s$,render:e}};ae.isValidElement=vf;ae.lazy=function(e){return{$$typeof:k0,_payload:{_status:-1,_result:e},_init:p$}};ae.memo=function(e,t){return{$$typeof:l$,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=et.T,o={};et.T=o;try{var a=e(),n=et.S;n!==null&&n(o,a),typeof a==="object"&&a!==null&&typeof a.then==="function"&&a.then(ff,M0)}catch(r){M0(r)}finally{t!==null&&o.types!==null&&(t.types=o.types),et.T=t}};ae.unstable_useCacheRefresh=function(){return et.H.useCacheRefresh()};ae.use=function(e){return et.H.use(e)};ae.useActionState=function(e,t,o){return et.H.useActionState(e,t,o)};ae.useCallback=function(e,t){return et.H.useCallback(e,t)};ae.useContext=function(e){return et.H.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e,t){return et.H.useDeferredValue(e,t)};ae.useEffect=function(e,t){return et.H.useEffect(e,t)};ae.useEffectEvent=function(e){return et.H.useEffectEvent(e)};ae.useId=function(){return et.H.useId()};ae.useImperativeHandle=function(e,t,o){return et.H.useImperativeHandle(e,t,o)};ae.useInsertionEffect=function(e,t){return et.H.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return et.H.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return et.H.useMemo(e,t)};ae.useOptimistic=function(e,t){return et.H.useOptimistic(e,t)};ae.useReducer=function(e,t,o){return et.H.useReducer(e,t,o)};ae.useRef=function(e){return et.H.useRef(e)};ae.useState=function(e){return et.H.useState(e)};ae.useSyncExternalStore=function(e,t,o){return et.H.useSyncExternalStore(e,t,o)};ae.useTransition=function(){return et.H.useTransition()};ae.version="19.2.8"});var R=$a(function(g$,L0){L0.exports=N0()});var F0=$a(function(it){function yf(e,t){var o=e.length;e.push(t);e:for(;0<o;){var a=o-1>>>1,n=e[a];if(0<iu(n,t))e[a]=t,e[o]=n,o=a;else break e}}function Wa(e){return e.length===0?null:e[0]}function du(e){if(e.length===0)return null;var t=e[0],o=e.pop();if(o!==t){e[0]=o;e:for(var a=0,n=e.length,r=n>>>1;a<r;){var s=2*(a+1)-1,l=e[s],c=s+1,u=e[c];if(0>iu(l,o))c<n&&0>iu(u,l)?(e[a]=u,e[c]=o,a=c):(e[a]=l,e[s]=o,a=s);else if(c<n&&0>iu(u,o))e[a]=u,e[c]=o,a=c;else break e}}return t}function iu(e,t){var o=e.sortIndex-t.sortIndex;return o!==0?o:e.id-t.id}it.unstable_now=void 0;if(typeof performance==="object"&&typeof performance.now==="function")wf=performance,it.unstable_now=function(){return wf.now()};else lu=Date,If=lu.now(),it.unstable_now=function(){return lu.now()-If};var wf,lu,If,hn=[],Wn=[],b$=1,ia=null,yo=3,xf=!1,hl=!1,gl=!1,Mf=!1,B0=typeof setTimeout==="function"?setTimeout:null,H0=typeof clearTimeout==="function"?clearTimeout:null,R0=typeof setImmediate<"u"?setImmediate:null;function cu(e){for(var t=Wa(Wn);t!==null;){if(t.callback===null)du(Wn);else if(t.startTime<=e)du(Wn),t.sortIndex=t.expirationTime,yf(hn,t);else break;t=Wa(Wn)}}function kf(e){if(gl=!1,cu(e),!hl)if(Wa(hn)!==null)hl=!0,Ys||(Ys=!0,Zs());else{var t=Wa(Wn);t!==null&&Df(kf,t.startTime-e)}}var Ys=!1,bl=-1,P0=5,z0=-1;function U0(){return Mf?!0:it.unstable_now()-z0<P0?!1:!0}function Sf(){if(Mf=!1,Ys){var e=it.unstable_now();z0=e;var t=!0;try{e:{hl=!1,gl&&(gl=!1,H0(bl),bl=-1),xf=!0;var o=yo;try{t:{cu(e);for(ia=Wa(hn);ia!==null&&!(ia.expirationTime>e&&U0());){var a=ia.callback;if(typeof a==="function"){ia.callback=null,yo=ia.priorityLevel;var n=a(ia.expirationTime<=e);if(e=it.unstable_now(),typeof n==="function"){ia.callback=n,cu(e),t=!0;break t}ia===Wa(hn)&&du(hn),cu(e)}else du(hn);ia=Wa(hn)}if(ia!==null)t=!0;else{var r=Wa(Wn);r!==null&&Df(kf,r.startTime-e),t=!1}}break e}finally{ia=null,yo=o,xf=!1}t=void 0}}finally{t?Zs():Ys=!1}}}var Zs;if(typeof R0==="function")Zs=function(){R0(Sf)};else if(typeof MessageChannel<"u")uu=new MessageChannel,Cf=uu.port2,uu.port1.onmessage=Sf,Zs=function(){Cf.postMessage(null)};else Zs=function(){B0(Sf,0)};var uu,Cf;function Df(e,t){bl=B0(function(){e(it.unstable_now())},t)}it.unstable_IdlePriority=5;it.unstable_ImmediatePriority=1;it.unstable_LowPriority=4;it.unstable_NormalPriority=3;it.unstable_Profiling=null;it.unstable_UserBlockingPriority=2;it.unstable_cancelCallback=function(e){e.callback=null};it.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P0=0<e?Math.floor(1000/e):5};it.unstable_getCurrentPriorityLevel=function(){return yo};it.unstable_next=function(e){switch(yo){case 1:case 2:case 3:var t=3;break;default:t=yo}var o=yo;yo=t;try{return e()}finally{yo=o}};it.unstable_requestPaint=function(){Mf=!0};it.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var o=yo;yo=e;try{return t()}finally{yo=o}};it.unstable_scheduleCallback=function(e,t,o){var a=it.unstable_now();switch(typeof o==="object"&&o!==null?(o=o.delay,o=typeof o==="number"&&0<o?a+o:a):o=a,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5000}return n=o+n,e={id:b$++,callback:t,priorityLevel:e,startTime:o,expirationTime:n,sortIndex:-1},o>a?(e.sortIndex=o,yf(Wn,e),Wa(hn)===null&&e===Wa(Wn)&&(gl?(H0(bl),bl=-1):gl=!0,Df(kf,o-a))):(e.sortIndex=n,yf(hn,e),hl||xf||(hl=!0,Ys||(Ys=!0,Zs()))),e};it.unstable_shouldYield=U0;it.unstable_wrapCallback=function(e){var t=yo;return function(){var o=yo;yo=t;try{return e.apply(this,arguments)}finally{yo=o}}}});var j0=$a(function(v$,_0){_0.exports=F0()});var V0=$a(function(ko){var S$=R();function G0(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o])}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."}function Zn(){}var Mo={d:{f:Zn,r:function(){throw Error(G0(522))},D:Zn,C:Zn,L:Zn,m:Zn,X:Zn,S:Zn,M:Zn},p:0,findDOMNode:null},y$=Symbol.for("react.portal");function w$(e,t,o){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:y$,key:a==null?null:""+a,children:e,containerInfo:t,implementation:o}}var vl=S$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function mu(e,t){if(e==="font")return"";if(typeof t==="string")return t==="use-credentials"?t:""}ko.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mo;ko.createPortal=function(e,t){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(G0(299));return w$(e,t,null,o)};ko.flushSync=function(e){var t=vl.T,o=Mo.p;try{if(vl.T=null,Mo.p=2,e)return e()}finally{vl.T=t,Mo.p=o,Mo.d.f()}};ko.preconnect=function(e,t){typeof e==="string"&&(t?(t=t.crossOrigin,t=typeof t==="string"?t==="use-credentials"?t:"":void 0):t=null,Mo.d.C(e,t))};ko.prefetchDNS=function(e){typeof e==="string"&&Mo.d.D(e)};ko.preinit=function(e,t){if(typeof e==="string"&&t&&typeof t.as==="string"){var o=t.as,a=mu(o,t.crossOrigin),n=typeof t.integrity==="string"?t.integrity:void 0,r=typeof t.fetchPriority==="string"?t.fetchPriority:void 0;o==="style"?Mo.d.S(e,typeof t.precedence==="string"?t.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:r}):o==="script"&&Mo.d.X(e,{crossOrigin:a,integrity:n,fetchPriority:r,nonce:typeof t.nonce==="string"?t.nonce:void 0})}};ko.preinitModule=function(e,t){if(typeof e==="string")if(typeof t==="object"&&t!==null){if(t.as==null||t.as==="script"){var o=mu(t.as,t.crossOrigin);Mo.d.M(e,{crossOrigin:o,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0})}}else t==null&&Mo.d.M(e)};ko.preload=function(e,t){if(typeof e==="string"&&typeof t==="object"&&t!==null&&typeof t.as==="string"){var o=t.as,a=mu(o,t.crossOrigin);Mo.d.L(e,o,{crossOrigin:a,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0,type:typeof t.type==="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority==="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==="string"?t.imageSizes:void 0,media:typeof t.media==="string"?t.media:void 0})}};ko.preloadModule=function(e,t){if(typeof e==="string")if(t){var o=mu(t.as,t.crossOrigin);Mo.d.m(e,{as:typeof t.as==="string"&&t.as!=="script"?t.as:void 0,crossOrigin:o,integrity:typeof t.integrity==="string"?t.integrity:void 0})}else Mo.d.m(e)};ko.requestFormReset=function(e){Mo.d.r(e)};ko.unstable_batchedUpdates=function(e,t){return e(t)};ko.useFormState=function(e,t,o){return vl.H.useFormState(e,t,o)};ko.useFormStatus=function(){return vl.H.useHostTransitionStatus()};ko.version="19.2.8"});var gn=$a(function(I$,q0){function K0(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(K0)}catch(e){console.error(e)}}K0(),q0.exports=V0()});var ow=$a(function(Rd){var Kt=j0(),gS=R(),x$=gn();function N(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o])}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."}function bS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ic(e){var t=e,o=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(o=t.return),e=t.return;while(e)}return t.tag===3?o:null}function vS(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 SS(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function $0(e){if(ic(e)!==e)throw Error(N(188))}function C$(e){var t=e.alternate;if(!t){if(t=ic(e),t===null)throw Error(N(188));return t!==e?null:e}for(var o=e,a=t;;){var n=o.return;if(n===null)break;var r=n.alternate;if(r===null){if(a=n.return,a!==null){o=a;continue}break}if(n.child===r.child){for(r=n.child;r;){if(r===o)return $0(n),e;if(r===a)return $0(n),t;r=r.sibling}throw Error(N(188))}if(o.return!==a.return)o=n,a=r;else{for(var s=!1,l=n.child;l;){if(l===o){s=!0,o=n,a=r;break}if(l===a){s=!0,a=n,o=r;break}l=l.sibling}if(!s){for(l=r.child;l;){if(l===o){s=!0,o=r,a=n;break}if(l===a){s=!0,a=r,o=n;break}l=l.sibling}if(!s)throw Error(N(189))}}if(o.alternate!==a)throw Error(N(190))}if(o.tag!==3)throw Error(N(188));return o.stateNode.current===o?e:t}function yS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=yS(e),t!==null)return t;e=e.sibling}return null}var at=Object.assign,M$=Symbol.for("react.element"),fu=Symbol.for("react.transitional.element"),Ml=Symbol.for("react.portal"),oi=Symbol.for("react.fragment"),wS=Symbol.for("react.strict_mode"),sp=Symbol.for("react.profiler"),IS=Symbol.for("react.consumer"),Cn=Symbol.for("react.context"),ah=Symbol.for("react.forward_ref"),ip=Symbol.for("react.suspense"),lp=Symbol.for("react.suspense_list"),nh=Symbol.for("react.memo"),Yn=Symbol.for("react.lazy"),cp=Symbol.for("react.activity"),k$=Symbol.for("react.memo_cache_sentinel"),W0=Symbol.iterator;function Sl(e){if(e===null||typeof e!=="object")return null;return e=W0&&e[W0]||e["@@iterator"],typeof e==="function"?e:null}var D$=Symbol.for("react.client.reference");function up(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===D$?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case oi:return"Fragment";case sp:return"Profiler";case wS:return"StrictMode";case ip:return"Suspense";case lp:return"SuspenseList";case cp:return"Activity"}if(typeof e==="object")switch(e.$$typeof){case Ml:return"Portal";case Cn:return e.displayName||"Context";case IS:return(e._context.displayName||"Context")+".Consumer";case ah:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case nh:return t=e.displayName||null,t!==null?t:up(e.type)||"Memo";case Yn:t=e._payload,e=e._init;try{return up(e(t))}catch(o){}}return null}var kl=Array.isArray,W=gS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=x$.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Zr={pending:!1,data:null,method:null,action:null},dp=[],ai=-1;function Ja(e){return{current:e}}function no(e){0>ai||(e.current=dp[ai],dp[ai]=null,ai--)}function Xe(e,t){ai++,dp[ai]=e.current,e.current=t}var Qa=Ja(null),$l=Ja(null),ir=Ja(null),Gu=Ja(null);function Vu(e,t){switch(Xe(ir,t),Xe($l,e),Xe(Qa,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)?(e=e.namespaceURI)?Jv(e):0:0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jv(t),e=jy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}no(Qa),Xe(Qa,e)}function wi(){no(Qa),no($l),no(ir)}function mp(e){e.memoizedState!==null&&Xe(Gu,e);var t=Qa.current,o=jy(t,e.type);t!==o&&(Xe($l,e),Xe(Qa,o))}function Ku(e){$l.current===e&&(no(Qa),no($l)),Gu.current===e&&(no(Gu),nc._currentValue=Zr)}var Tf,Z0;function Vr(e){if(Tf===void 0)try{throw Error()}catch(o){var t=o.stack.trim().match(/\n( *(at )?)/);Tf=t&&t[1]||"",Z0=-1<o.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Tf+e+Z0}var Af=!1;function Ef(e,t){if(!e||Af)return"";Af=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(p){var f=p}Reflect.construct(e,[],m)}else{try{m.call()}catch(p){f=p}e.call(m.prototype)}}else{try{throw Error()}catch(p){f=p}(m=e())&&typeof m.catch==="function"&&m.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack==="string")return[p.stack,f.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),s=r[0],l=r[1];if(s&&l){var c=s.split(`
4
+ `),u=l.split(`
5
+ `);for(n=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;if(a===c.length||n===u.length)for(a=c.length-1,n=u.length-1;1<=a&&0<=n&&c[a]!==u[n];)n--;for(;1<=a&&0<=n;a--,n--)if(c[a]!==u[n]){if(a!==1||n!==1)do if(a--,n--,0>n||c[a]!==u[n]){var d=`
6
+ `+c[a].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=a&&0<=n);break}}}finally{Af=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?Vr(o):""}function T$(e,t){switch(e.tag){case 26:case 27:case 5:return Vr(e.type);case 16:return Vr("Lazy");case 13:return e.child!==t&&t!==null?Vr("Suspense Fallback"):Vr("Suspense");case 19:return Vr("SuspenseList");case 0:case 15:return Ef(e.type,!1);case 11:return Ef(e.type.render,!1);case 1:return Ef(e.type,!0);case 31:return Vr("Activity");default:return""}}function Y0(e){try{var t="",o=null;do t+=T$(e,o),o=e,e=e.return;while(e);return t}catch(a){return`
7
7
  Error generating stack: `+a.message+`
8
- `+a.stack}}var yu=Object.prototype.hasOwnProperty,dd=st.unstable_scheduleCallback,jc=st.unstable_cancelCallback,MS=st.unstable_shouldYield,xS=st.unstable_requestPaint,Pt=st.unstable_now,kS=st.unstable_getCurrentPriorityLevel,qm=st.unstable_ImmediatePriority,Gm=st.unstable_UserBlockingPriority,ts=st.unstable_NormalPriority,DS=st.unstable_LowPriority,Ym=st.unstable_IdlePriority,OS=st.log,ES=st.unstable_setDisableYieldValue,Gi=null,It=null;function Ra(e){if(typeof OS==="function"&&ES(e),It&&typeof It.setStrictMode==="function")try{It.setStrictMode(Gi,e)}catch(t){}}var Ft=Math.clz32?Math.clz32:RS,NS=Math.log,TS=Math.LN2;function RS(e){return e>>>=0,e===0?32:31-(NS(e)/TS|0)|0}var xr=256,kr=262144,Dr=4194304;function pl(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Es(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var r=a&134217727;return r!==0?(a=r&~o,a!==0?l=pl(a):(i&=r,i!==0?l=pl(i):n||(n=r&~e,n!==0&&(l=pl(n))))):(r=a&~o,r!==0?l=pl(r):i!==0?l=pl(i):n||(n=a&~e,n!==0&&(l=pl(n)))),l===0?0:t!==0&&t!==l&&(t&o)===0&&(o=l&-l,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:l}function Yi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function CS(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vm(){var e=Dr;return Dr<<=1,(Dr&62914560)===0&&(Dr=4194304),e}function Bc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function AS(e,t,n,a,l,o){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var{entanglements:r,expirationTimes:s,hiddenUpdates:c}=e;for(n=i&~n;0<n;){var d=31-Ft(n),h=1<<d;r[d]=0,s[d]=-1;var u=c[d];if(u!==null)for(c[d]=null,d=0;d<u.length;d++){var p=u[d];p!==null&&(p.lane&=-536870913)}n&=~h}a!==0&&Xm(e,a,0),o!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function Xm(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ft(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Qm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Ft(n),l=1<<a;l&t|e[a]&t&&(e[a]|=t),n&=~l}}function Zm(e,t){var n=t&-t;return n=(n&42)!==0?1:fd(n),(n&(e.suspendedLanes|t))!==0?0:n}function fd(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pd(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jm(){var e=pe.p;if(e!==0)return e;return e=window.event,e===void 0?32:bv(e.type)}function gp(e,t){var n=pe.p;try{return pe.p=e,t()}finally{pe.p=n}}var Za=Math.random().toString(36).slice(2),yt="__reactFiber$"+Za,$t="__reactProps$"+Za,Ro="__reactContainer$"+Za,Su="__reactEvents$"+Za,zS="__reactListeners$"+Za,_S="__reactHandles$"+Za,vp="__reactResources$"+Za,Xi="__reactMarker$"+Za;function md(e){delete e[yt],delete e[$t],delete e[Su],delete e[zS],delete e[_S]}function to(e){var t=e[yt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ro]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xm(e);e!==null;){if(n=e[yt])return n;e=xm(e)}return t}e=n,n=e.parentNode}return null}function Co(e){if(e=e[yt]||e[Ro]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function si(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(x(33))}function fo(e){var t=e[vp];return t||(t=e[vp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ht(e){e[Xi]=!0}var Wm=new Set,Pm={};function El(e,t){So(e,t),So(e+"Capture",t)}function So(e,t){Pm[e]=t;for(e=0;e<t.length;e++)Wm.add(t[e])}var LS=RegExp("^[: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]*$"),bp={},yp={};function KS(e){if(yu.call(yp,e))return!0;if(yu.call(bp,e))return!1;if(LS.test(e))return yp[e]=!0;return bp[e]=!0,!1}function Kr(e,t,n){if(KS(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Or(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Jn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Im(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jS(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get==="function"&&typeof a.set==="function"){var{get:l,set:o}=a;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wu(e){if(!e._valueTracker){var t=Im(e)?"checked":"value";e._valueTracker=jS(e,t,""+e[t])}}function Fm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Im(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function ns(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}var BS=/[\n"\\]/g;function fn(e){return e.replace(BS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mu(e,t,n,a,l,o,i,r){if(e.name="",i!=null&&typeof i!=="function"&&typeof i!=="symbol"&&typeof i!=="boolean"?e.type=i:e.removeAttribute("type"),t!=null)if(i==="number"){if(t===0&&e.value===""||e.value!=t)e.value=""+cn(t)}else e.value!==""+cn(t)&&(e.value=""+cn(t));else i!=="submit"&&i!=="reset"||e.removeAttribute("value");t!=null?xu(e,i,cn(t)):n!=null?xu(e,i,cn(n)):a!=null&&e.removeAttribute("value"),l==null&&o!=null&&(e.defaultChecked=!!o),l!=null&&(e.checked=l&&typeof l!=="function"&&typeof l!=="symbol"),r!=null&&typeof r!=="function"&&typeof r!=="symbol"&&typeof r!=="boolean"?e.name=""+cn(r):e.removeAttribute("name")}function eh(e,t,n,a,l,o,i,r){if(o!=null&&typeof o!=="function"&&typeof o!=="symbol"&&typeof o!=="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!==void 0&&t!==null)){wu(e);return}n=n!=null?""+cn(n):"",t=t!=null?""+cn(t):n,r||t===e.value||(e.value=t),e.defaultValue=t}a=a!=null?a:l,a=typeof a!=="function"&&typeof a!=="symbol"&&!!a,e.checked=r?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!=="function"&&typeof i!=="symbol"&&typeof i!=="boolean"&&(e.name=i),wu(e)}function xu(e,t,n){t==="number"&&ns(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function po(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&a&&(e[n].defaultSelected=!0)}else{n=""+cn(n),t=null;for(l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,a&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function th(e,t,n){if(t!=null&&(t=""+cn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+cn(n):""}function nh(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(x(92));if(ri(a)){if(1<a.length)throw Error(x(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=cn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),wu(e)}function wo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var US=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Sp(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n==="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!=="number"||n===0||US.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ah(e,t,n){if(t!=null&&typeof t!=="object")throw Error(x(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var l in t)a=t[l],t.hasOwnProperty(l)&&n[l]!==a&&Sp(e,l,a)}else for(var o in t)t.hasOwnProperty(o)&&Sp(e,o,t[o])}function hd(e){if(e.indexOf("-")===-1)return!1;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 HS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$S=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function jr(e){return $S.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function aa(){}var ku=null;function gd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var no=null,mo=null;function wp(e){var t=Co(e);if(t&&(e=t.stateNode)){var n=e[$t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;n=n.querySelectorAll('input[name="'+fn(""+t)+'"][type="radio"]');for(t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var l=a[$t]||null;if(!l)throw Error(x(90));Mu(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Fm(a)}break e;case"textarea":th(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&po(e,!!n.multiple,t,!1)}}}var Uc=!1;function lh(e,t,n){if(Uc)return e(t,n);Uc=!0;try{var a=e(t);return a}finally{if(Uc=!1,no!==null||mo!==null){if(Us(),no&&(t=no,e=mo,mo=no=null,wp(t),e))for(t=0;t<e.length;t++)wp(e[t])}}}function Ti(e,t){var n=e.stateNode;if(n===null)return null;var a=n[$t]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!=="function")throw Error(x(231,t,typeof n));return n}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Du=!1;if(sa)try{ml={},Object.defineProperty(ml,"passive",{get:function(){Du=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch(e){Du=!1}var ml,Ca=null,vd=null,Br=null;function oh(){if(Br)return Br;var e,t=vd,n=t.length,a,l="value"in Ca?Ca.value:Ca.textContent,o=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===l[o-a];a++);return Br=l.slice(e,1<a?1-a:void 0)}function Ur(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 Er(){return!0}function Mp(){return!1}function qt(e){function t(n,a,l,o,i){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var r in e)e.hasOwnProperty(r)&&(n=e[r],this[r]=n?n(o):o[r]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Er:Mp,this.isPropagationStopped=Mp,this}return je(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!=="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Er)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!=="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Er)},persist:function(){},isPersistent:Er}),t}var Nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ns=qt(Nl),Qi=je({},Nl,{view:0,detail:0}),qS=qt(Qi),Hc,$c,ti,Ts=je({},Qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bd,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){if("movementX"in e)return e.movementX;return e!==ti&&(ti&&e.type==="mousemove"?(Hc=e.screenX-ti.screenX,$c=e.screenY-ti.screenY):$c=Hc=0,ti=e),Hc},movementY:function(e){return"movementY"in e?e.movementY:$c}}),xp=qt(Ts),GS=je({},Ts,{dataTransfer:0}),YS=qt(GS),VS=je({},Qi,{relatedTarget:0}),qc=qt(VS),XS=je({},Nl,{animationName:0,elapsedTime:0,pseudoElement:0}),QS=qt(XS),ZS=je({},Nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JS=qt(ZS),WS=je({},Nl,{data:0}),kp=qt(WS),PS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IS={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"},FS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=FS[e])?!!t[e]:!1}function bd(){return e1}var t1=je({},Qi,{key:function(e){if(e.key){var t=PS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ur(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?IS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bd,charCode:function(e){return e.type==="keypress"?Ur(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ur(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),n1=qt(t1),a1=je({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dp=qt(a1),l1=je({},Qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bd}),o1=qt(l1),i1=je({},Nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),r1=qt(i1),s1=je({},Ts,{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}),c1=qt(s1),u1=je({},Nl,{newState:0,oldState:0}),d1=qt(u1),f1=[9,13,27,32],yd=sa&&"CompositionEvent"in window,hi=null;sa&&"documentMode"in document&&(hi=document.documentMode);var p1=sa&&"TextEvent"in window&&!hi,ih=sa&&(!yd||hi&&8<hi&&11>=hi),Op=String.fromCharCode(32),Ep=!1;function rh(e,t){switch(e){case"keyup":return f1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sh(e){return e=e.detail,typeof e==="object"&&"data"in e?e.data:null}var ao=!1;function m1(e,t){switch(e){case"compositionend":return sh(t);case"keypress":if(t.which!==32)return null;return Ep=!0,Op;case"textInput":return e=t.data,e===Op&&Ep?null:e;default:return null}}function h1(e,t){if(ao)return e==="compositionend"||!yd&&rh(e,t)?(e=oh(),Br=vd=Ca=null,ao=!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 ih&&t.locale!=="ko"?null:t.data;default:return null}}var g1={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 Np(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!g1[e.type]:t==="textarea"?!0:!1}function ch(e,t,n,a){no?mo?mo.push(a):mo=[a]:no=a,t=Ss(t,"onChange"),0<t.length&&(n=new Ns("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var gi=null,Ri=null;function v1(e){lv(e,0)}function Rs(e){var t=si(e);if(Fm(t))return e}function Tp(e,t){if(e==="change")return t}var uh=!1;if(sa){if(sa){if(ui="oninput"in document,!ui)Hr=document.createElement("div"),Hr.setAttribute("oninput","return;"),ui=typeof Hr.oninput==="function";ci=ui}else ci=!1;uh=ci&&(!document.documentMode||9<document.documentMode)}var ci,ui,Hr;function Rp(){gi&&(gi.detachEvent("onpropertychange",dh),Ri=gi=null)}function dh(e){if(e.propertyName==="value"&&Rs(Ri)){var t=[];ch(t,Ri,e,gd(e)),lh(v1,t)}}function b1(e,t,n){e==="focusin"?(Rp(),gi=t,Ri=n,gi.attachEvent("onpropertychange",dh)):e==="focusout"&&Rp()}function y1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rs(Ri)}function S1(e,t){if(e==="click")return Rs(t)}function w1(e,t){if(e==="input"||e==="change")return Rs(t)}function M1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is==="function"?Object.is:M1;function Ci(e,t){if(tn(e,t))return!0;if(typeof e!=="object"||e===null||typeof t!=="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var l=n[a];if(!yu.call(t,l)||!tn(e[l],t[l]))return!1}return!0}function Cp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ap(e,t){var n=Cp(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cp(n)}}function fh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fh(e,t.parentNode):("contains"in e)?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ph(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ns(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==="string"}catch(a){n=!1}if(n)e=t.contentWindow;else break;t=ns(e.document)}return t}function Sd(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")}var x1=sa&&"documentMode"in document&&11>=document.documentMode,lo=null,Ou=null,vi=null,Eu=!1;function zp(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eu||lo==null||lo!==ns(a)||(a=lo,("selectionStart"in a)&&Sd(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),vi&&Ci(vi,a)||(vi=a,a=Ss(Ou,"onSelect"),0<a.length&&(t=new Ns("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=lo)))}function dl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var oo={animationend:dl("Animation","AnimationEnd"),animationiteration:dl("Animation","AnimationIteration"),animationstart:dl("Animation","AnimationStart"),transitionrun:dl("Transition","TransitionRun"),transitionstart:dl("Transition","TransitionStart"),transitioncancel:dl("Transition","TransitionCancel"),transitionend:dl("Transition","TransitionEnd")},Gc={},mh={};sa&&(mh=document.createElement("div").style,("AnimationEvent"in window)||(delete oo.animationend.animation,delete oo.animationiteration.animation,delete oo.animationstart.animation),("TransitionEvent"in window)||delete oo.transitionend.transition);function Tl(e){if(Gc[e])return Gc[e];if(!oo[e])return e;var t=oo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in mh)return Gc[e]=t[n];return e}var hh=Tl("animationend"),gh=Tl("animationiteration"),vh=Tl("animationstart"),k1=Tl("transitionrun"),D1=Tl("transitionstart"),O1=Tl("transitioncancel"),bh=Tl("transitionend"),yh=new Map,Nu="abort auxClick beforeToggle 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(" ");Nu.push("scrollEnd");function En(e,t){yh.set(e,t),El(t,[e])}var as=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},sn=[],io=0,wd=0;function Cs(){for(var e=io,t=wd=io=0;t<e;){var n=sn[t];sn[t++]=null;var a=sn[t];sn[t++]=null;var l=sn[t];sn[t++]=null;var o=sn[t];if(sn[t++]=null,a!==null&&l!==null){var i=a.pending;i===null?l.next=l:(l.next=i.next,i.next=l),a.pending=l}o!==0&&Sh(n,l,o)}}function As(e,t,n,a){sn[io++]=e,sn[io++]=t,sn[io++]=n,sn[io++]=a,wd|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Md(e,t,n,a){return As(e,t,n,a),ls(e)}function Rl(e,t){return As(e,null,null,t),ls(e)}function Sh(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var l=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(l=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,l&&t!==null&&(l=31-Ft(n),e=o.hiddenUpdates,a=e[l],a===null?e[l]=[t]:a.push(t),t.lane=n|536870912),o):null}function ls(e){if(50<Oi)throw Oi=0,Ju=null,Error(x(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ro={};function E1(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,t,n,a){return new E1(e,t,n,a)}function xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oa(e,t){var n=e.alternate;return n===null?(n=Jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function wh(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function $r(e,t,n,a,l,o){var i=0;if(a=e,typeof e==="function")xd(e)&&(i=1);else if(typeof e==="string")i=Rw(e,n,$n.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case hu:return e=Jt(31,n,t,l),e.elementType=hu,e.lanes=o,e;case Fl:return bl(n.children,l,o,t);case Hm:i=8,l|=24;break;case fu:return e=Jt(12,n,t,l|2),e.elementType=fu,e.lanes=o,e;case pu:return e=Jt(13,n,t,l),e.elementType=pu,e.lanes=o,e;case mu:return e=Jt(19,n,t,l),e.elementType=mu,e.lanes=o,e;default:if(typeof e==="object"&&e!==null)switch(e.$$typeof){case na:i=10;break e;case $m:i=9;break e;case cd:i=11;break e;case ud:i=14;break e;case ka:i=16,a=null;break e}i=29,n=Error(x(130,e===null?"null":typeof e,"")),a=null}return t=Jt(i,n,t,l),t.elementType=e,t.type=a,t.lanes=o,t}function bl(e,t,n,a){return e=Jt(7,e,a,t),e.lanes=n,e}function Yc(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function Mh(e){var t=Jt(18,null,null,0);return t.stateNode=e,t}function Vc(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _p=new WeakMap;function pn(e,t){if(typeof e==="object"&&e!==null){var n=_p.get(e);if(n!==void 0)return n;return t={value:e,source:t,stack:hp(t)},_p.set(e,t),t}return{value:e,source:t,stack:hp(t)}}var so=[],co=0,os=null,Ai=0,un=[],dn=0,Ya=null,Bn=1,Un="";function ea(e,t){so[co++]=Ai,so[co++]=os,os=e,Ai=t}function xh(e,t,n){un[dn++]=Bn,un[dn++]=Un,un[dn++]=Ya,Ya=e;var a=Bn;e=Un;var l=32-Ft(a)-1;a&=~(1<<l),n+=1;var o=32-Ft(t)+l;if(30<o){var i=l-l%5;o=(a&(1<<i)-1).toString(32),a>>=i,l-=i,Bn=1<<32-Ft(t)+l|n<<l|a,Un=o+e}else Bn=1<<o|n<<l|a,Un=e}function kd(e){e.return!==null&&(ea(e,1),xh(e,1,0))}function Dd(e){for(;e===os;)os=so[--co],so[co]=null,Ai=so[--co],so[co]=null;for(;e===Ya;)Ya=un[--dn],un[dn]=null,Un=un[--dn],un[dn]=null,Bn=un[--dn],un[dn]=null}function kh(e,t){un[dn++]=Bn,un[dn++]=Un,un[dn++]=Ya,Bn=t.id,Un=t.overflow,Ya=e}var St=null,Ke=null,re=!1,Ka=null,mn=!1,Tu=Error(x(519));function Va(e){var t=Error(x(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zi(pn(t,e)),Tu}function Lp(e){var{stateNode:t,type:n,memoizedProps:a}=e;switch(t[yt]=e,t[$t]=a,n){case"dialog":ae("cancel",t),ae("close",t);break;case"iframe":case"object":case"embed":ae("load",t);break;case"video":case"audio":for(n=0;n<ji.length;n++)ae(ji[n],t);break;case"source":ae("error",t);break;case"img":case"image":case"link":ae("error",t),ae("load",t);break;case"details":ae("toggle",t);break;case"input":ae("invalid",t),eh(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ae("invalid",t);break;case"textarea":ae("invalid",t),nh(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!=="string"&&typeof n!=="number"&&typeof n!=="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||iv(t.textContent,n)?(a.popover!=null&&(ae("beforetoggle",t),ae("toggle",t)),a.onScroll!=null&&ae("scroll",t),a.onScrollEnd!=null&&ae("scrollend",t),a.onClick!=null&&(t.onclick=aa),t=!0):t=!1,t||Va(e,!0)}function Kp(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:St=St.return}}function Zl(e){if(e!==St)return!1;if(!re)return Kp(e),re=!0,!1;var t=e.tag,n;if(n=t!==3&&t!==27){if(n=t===5)n=e.type,n=!(n!=="form"&&n!=="button")||nd(e.type,e.memoizedProps);n=!n}if(n&&Ke&&Va(e),Kp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));Ke=Mm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));Ke=Mm(e)}else t===27?(t=Ke,Ja(e.type)?(e=id,id=null,Ke=e):Ke=t):Ke=St?gn(e.stateNode.nextSibling):null;return!0}function Ml(){Ke=St=null,re=!1}function Xc(){var e=Ka;return e!==null&&(Ut===null?Ut=e:Ut.push.apply(Ut,e),Ka=null),e}function zi(e){Ka===null?Ka=[e]:Ka.push(e)}var Ru=qn(null),Cl=null,la=null;function Oa(e,t,n){Ce(Ru,t._currentValue),t._currentValue=n}function ia(e){e._currentValue=Ru.current,gt(Ru)}function Cu(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Au(e,t,n,a){var l=e.child;l!==null&&(l.return=e);for(;l!==null;){var o=l.dependencies;if(o!==null){var i=l.child;o=o.firstContext;e:for(;o!==null;){var r=o;o=l;for(var s=0;s<t.length;s++)if(r.context===t[s]){o.lanes|=n,r=o.alternate,r!==null&&(r.lanes|=n),Cu(o.return,n,e),a||(i=null);break e}o=r.next}}else if(l.tag===18){if(i=l.return,i===null)throw Error(x(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Cu(i,n,e),i=null}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===e){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}}function Ao(e,t,n,a){e=null;for(var l=t,o=!1;l!==null;){if(!o){if((l.flags&524288)!==0)o=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var i=l.alternate;if(i===null)throw Error(x(387));if(i=i.memoizedProps,i!==null){var r=l.type;tn(l.pendingProps.value,i.value)||(e!==null?e.push(r):e=[r])}}else if(l===Ir.current){if(i=l.alternate,i===null)throw Error(x(387));i.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Ui):e=[Ui])}l=l.return}e!==null&&Au(t,e,n,a),t.flags|=262144}function is(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xl(e){Cl=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wt(e){return Dh(Cl,e)}function Nr(e,t){return Cl===null&&xl(e),Dh(e,t)}function Dh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},la===null){if(e===null)throw Error(x(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return n}var N1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},T1=st.unstable_scheduleCallback,R1=st.unstable_NormalPriority,nt={$$typeof:na,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Od(){return{controller:new N1,data:new Map,refCount:0}}function Zi(e){e.refCount--,e.refCount===0&&T1(R1,function(){e.controller.abort()})}var bi=null,zu=0,Mo=0,ho=null;function C1(e,t){if(bi===null){var n=bi=[];zu=0,Mo=Pd(),ho={status:"pending",value:void 0,then:function(a){n.push(a)}}}return zu++,t.then(jp,jp),t}function jp(){if(--zu===0&&bi!==null){ho!==null&&(ho.status="fulfilled");var e=bi;bi=null,Mo=0,ho=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function A1(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){a.status="rejected",a.reason=l;for(l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var Bp=U.S;U.S=function(e,t){Ug=Pt(),typeof t==="object"&&t!==null&&typeof t.then==="function"&&C1(e,t),Bp!==null&&Bp(e,t)};var yl=qn(null);function Ed(){var e=yl.current;return e!==null?e:Ee.pooledCache}function qr(e,t){t===null?Ce(yl,yl.current):Ce(yl,t.pool)}function Oh(){var e=Ed();return e===null?null:{parent:nt._currentValue,pool:e}}var zo=Error(x(460)),Nd=Error(x(474)),zs=Error(x(542)),rs={then:function(){}};function Up(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Eh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(aa,aa),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$p(e),e;default:if(typeof t.status==="string")t.then(aa,aa);else{if(e=Ee,e!==null&&100<e.shellSuspendCounter)throw Error(x(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=a}},function(a){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$p(e),e}throw Sl=t,zo}}function hl(e){try{var t=e._init;return t(e._payload)}catch(n){if(n!==null&&typeof n==="object"&&typeof n.then==="function")throw Sl=n,zo;throw n}}var Sl=null;function Hp(){if(Sl===null)throw Error(x(459));var e=Sl;return Sl=null,e}function $p(e){if(e===zo||e===zs)throw Error(x(483))}var go=null,_i=0;function Tr(e){var t=_i;return _i+=1,go===null&&(go=[]),Eh(go,e,t)}function ni(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rr(e,t){if(t.$$typeof===bS)throw Error(x(525));throw e=Object.prototype.toString.call(t),Error(x(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Nh(e){function t(m,f){if(e){var v=m.deletions;v===null?(m.deletions=[f],m.flags|=16):v.push(f)}}function n(m,f){if(!e)return null;for(;f!==null;)t(m,f),f=f.sibling;return null}function a(m){for(var f=new Map;m!==null;)m.key!==null?f.set(m.key,m):f.set(m.index,m),m=m.sibling;return f}function l(m,f){return m=oa(m,f),m.index=0,m.sibling=null,m}function o(m,f,v){if(m.index=v,!e)return m.flags|=1048576,f;if(v=m.alternate,v!==null)return v=v.index,v<f?(m.flags|=67108866,f):v;return m.flags|=67108866,f}function i(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function r(m,f,v,w){if(f===null||f.tag!==6)return f=Yc(v,m.mode,w),f.return=m,f;return f=l(f,v),f.return=m,f}function s(m,f,v,w){var D=v.type;if(D===Fl)return d(m,f,v.props.children,w,v.key);if(f!==null&&(f.elementType===D||typeof D==="object"&&D!==null&&D.$$typeof===ka&&hl(D)===f.type))return f=l(f,v.props),ni(f,v),f.return=m,f;return f=$r(v.type,v.key,v.props,null,m.mode,w),ni(f,v),f.return=m,f}function c(m,f,v,w){if(f===null||f.tag!==4||f.stateNode.containerInfo!==v.containerInfo||f.stateNode.implementation!==v.implementation)return f=Vc(v,m.mode,w),f.return=m,f;return f=l(f,v.children||[]),f.return=m,f}function d(m,f,v,w,D){if(f===null||f.tag!==7)return f=bl(v,m.mode,w,D),f.return=m,f;return f=l(f,v),f.return=m,f}function h(m,f,v){if(typeof f==="string"&&f!==""||typeof f==="number"||typeof f==="bigint")return f=Yc(""+f,m.mode,v),f.return=m,f;if(typeof f==="object"&&f!==null){switch(f.$$typeof){case Mr:return v=$r(f.type,f.key,f.props,null,m.mode,v),ni(v,f),v.return=m,v;case ii:return f=Vc(f,m.mode,v),f.return=m,f;case ka:return f=hl(f),h(m,f,v)}if(ri(f)||ei(f))return f=bl(f,m.mode,v,null),f.return=m,f;if(typeof f.then==="function")return h(m,Tr(f),v);if(f.$$typeof===na)return h(m,Nr(m,f),v);Rr(m,f)}return null}function u(m,f,v,w){var D=f!==null?f.key:null;if(typeof v==="string"&&v!==""||typeof v==="number"||typeof v==="bigint")return D!==null?null:r(m,f,""+v,w);if(typeof v==="object"&&v!==null){switch(v.$$typeof){case Mr:return v.key===D?s(m,f,v,w):null;case ii:return v.key===D?c(m,f,v,w):null;case ka:return v=hl(v),u(m,f,v,w)}if(ri(v)||ei(v))return D!==null?null:d(m,f,v,w,null);if(typeof v.then==="function")return u(m,f,Tr(v),w);if(v.$$typeof===na)return u(m,f,Nr(m,v),w);Rr(m,v)}return null}function p(m,f,v,w,D){if(typeof w==="string"&&w!==""||typeof w==="number"||typeof w==="bigint")return m=m.get(v)||null,r(f,m,""+w,D);if(typeof w==="object"&&w!==null){switch(w.$$typeof){case Mr:return m=m.get(w.key===null?v:w.key)||null,s(f,m,w,D);case ii:return m=m.get(w.key===null?v:w.key)||null,c(f,m,w,D);case ka:return w=hl(w),p(m,f,v,w,D)}if(ri(w)||ei(w))return m=m.get(v)||null,d(f,m,w,D,null);if(typeof w.then==="function")return p(m,f,v,Tr(w),D);if(w.$$typeof===na)return p(m,f,v,Nr(f,w),D);Rr(f,w)}return null}function g(m,f,v,w){for(var D=null,z=null,E=f,O=f=0,A=null;E!==null&&O<v.length;O++){E.index>O?(A=E,E=null):A=E.sibling;var j=u(m,E,v[O],w);if(j===null){E===null&&(E=A);break}e&&E&&j.alternate===null&&t(m,E),f=o(j,f,O),z===null?D=j:z.sibling=j,z=j,E=A}if(O===v.length)return n(m,E),re&&ea(m,O),D;if(E===null){for(;O<v.length;O++)E=h(m,v[O],w),E!==null&&(f=o(E,f,O),z===null?D=E:z.sibling=E,z=E);return re&&ea(m,O),D}for(E=a(E);O<v.length;O++)A=p(E,m,O,v[O],w),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?O:A.key),f=o(A,f,O),z===null?D=A:z.sibling=A,z=A);return e&&E.forEach(function(pt){return t(m,pt)}),re&&ea(m,O),D}function b(m,f,v,w){if(v==null)throw Error(x(151));for(var D=null,z=null,E=f,O=f=0,A=null,j=v.next();E!==null&&!j.done;O++,j=v.next()){E.index>O?(A=E,E=null):A=E.sibling;var pt=u(m,E,j.value,w);if(pt===null){E===null&&(E=A);break}e&&E&&pt.alternate===null&&t(m,E),f=o(pt,f,O),z===null?D=pt:z.sibling=pt,z=pt,E=A}if(j.done)return n(m,E),re&&ea(m,O),D;if(E===null){for(;!j.done;O++,j=v.next())j=h(m,j.value,w),j!==null&&(f=o(j,f,O),z===null?D=j:z.sibling=j,z=j);return re&&ea(m,O),D}for(E=a(E);!j.done;O++,j=v.next())j=p(E,m,O,j.value,w),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?O:j.key),f=o(j,f,O),z===null?D=j:z.sibling=j,z=j);return e&&E.forEach(function(Xt){return t(m,Xt)}),re&&ea(m,O),D}function y(m,f,v,w){if(typeof v==="object"&&v!==null&&v.type===Fl&&v.key===null&&(v=v.props.children),typeof v==="object"&&v!==null){switch(v.$$typeof){case Mr:e:{for(var D=v.key;f!==null;){if(f.key===D){if(D=v.type,D===Fl){if(f.tag===7){n(m,f.sibling),w=l(f,v.props.children),w.return=m,m=w;break e}}else if(f.elementType===D||typeof D==="object"&&D!==null&&D.$$typeof===ka&&hl(D)===f.type){n(m,f.sibling),w=l(f,v.props),ni(w,v),w.return=m,m=w;break e}n(m,f);break}else t(m,f);f=f.sibling}v.type===Fl?(w=bl(v.props.children,m.mode,w,v.key),w.return=m,m=w):(w=$r(v.type,v.key,v.props,null,m.mode,w),ni(w,v),w.return=m,m=w)}return i(m);case ii:e:{for(D=v.key;f!==null;){if(f.key===D)if(f.tag===4&&f.stateNode.containerInfo===v.containerInfo&&f.stateNode.implementation===v.implementation){n(m,f.sibling),w=l(f,v.children||[]),w.return=m,m=w;break e}else{n(m,f);break}else t(m,f);f=f.sibling}w=Vc(v,m.mode,w),w.return=m,m=w}return i(m);case ka:return v=hl(v),y(m,f,v,w)}if(ri(v))return g(m,f,v,w);if(ei(v)){if(D=ei(v),typeof D!=="function")throw Error(x(150));return v=D.call(v),b(m,f,v,w)}if(typeof v.then==="function")return y(m,f,Tr(v),w);if(v.$$typeof===na)return y(m,f,Nr(m,v),w);Rr(m,v)}return typeof v==="string"&&v!==""||typeof v==="number"||typeof v==="bigint"?(v=""+v,f!==null&&f.tag===6?(n(m,f.sibling),w=l(f,v),w.return=m,m=w):(n(m,f),w=Yc(v,m.mode,w),w.return=m,m=w),i(m)):n(m,f)}return function(m,f,v,w){try{_i=0;var D=y(m,f,v,w);return go=null,D}catch(E){if(E===zo||E===zs)throw E;var z=Jt(29,E,null,m.mode);return z.lanes=w,z.return=m,z}finally{}}}var kl=Nh(!0),Th=Nh(!1),Da=!1;function Td(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _u(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(fe&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=ls(e),Sh(e,null,n),t}return As(e,a,t,n),ls(e)}function yi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Qm(e,n)}}function Qc(e,t){var{updateQueue:n,alternate:a}=e;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Lu=!1;function Si(){if(Lu){var e=ho;if(e!==null)throw e}}function wi(e,t,n,a){Lu=!1;var l=e.updateQueue;Da=!1;var{firstBaseUpdate:o,lastBaseUpdate:i}=l,r=l.shared.pending;if(r!==null){l.shared.pending=null;var s=r,c=s.next;s.next=null,i===null?o=c:i.next=c,i=s;var d=e.alternate;d!==null&&(d=d.updateQueue,r=d.lastBaseUpdate,r!==i&&(r===null?d.firstBaseUpdate=c:r.next=c,d.lastBaseUpdate=s))}if(o!==null){var h=l.baseState;i=0,d=c=s=null,r=o;do{var u=r.lane&-536870913,p=u!==r.lane;if(p?(oe&u)===u:(a&u)===u){u!==0&&u===Mo&&(Lu=!0),d!==null&&(d=d.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});e:{var g=e,b=r;u=t;var y=n;switch(b.tag){case 1:if(g=b.payload,typeof g==="function"){h=g.call(y,h,u);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,u=typeof g==="function"?g.call(y,h,u):g,u===null||u===void 0)break e;h=je({},h,u);break e;case 2:Da=!0}}u=r.callback,u!==null&&(e.flags|=64,p&&(e.flags|=8192),p=l.callbacks,p===null?l.callbacks=[u]:p.push(u))}else p={lane:u,tag:r.tag,payload:r.payload,callback:r.callback,next:null},d===null?(c=d=p,s=h):d=d.next=p,i|=u;if(r=r.next,r===null)if(r=l.shared.pending,r===null)break;else p=r,r=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}while(1);d===null&&(s=h),l.baseState=s,l.firstBaseUpdate=c,l.lastBaseUpdate=d,o===null&&(l.shared.lanes=0),Qa|=i,e.lanes=i,e.memoizedState=h}}function Rh(e,t){if(typeof e!=="function")throw Error(x(191,e));e.call(t)}function Ch(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Rh(n[e],t)}var xo=qn(null),ss=qn(0);function qp(e,t){e=fa,Ce(ss,e),Ce(xo,t),fa=e|t.baseLanes}function Ku(){Ce(ss,fa),Ce(xo,xo.current)}function Rd(){fa=ss.current,gt(xo),gt(ss)}var nn=qn(null),hn=null;function Ea(e){var t=e.alternate;Ce(Je,Je.current&1),Ce(nn,e),hn===null&&(t===null||xo.current!==null?hn=e:t.memoizedState!==null&&(hn=e))}function ju(e){Ce(Je,Je.current),Ce(nn,e),hn===null&&(hn=e)}function Ah(e){e.tag===22?(Ce(Je,Je.current),Ce(nn,e),hn===null&&(hn=e)):Na(e)}function Na(){Ce(Je,Je.current),Ce(nn,nn.current)}function Zt(e){gt(nn),hn===e&&(hn=null),gt(Je)}var Je=qn(0);function cs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ld(n)||od(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 ca=0,J=null,we=null,et=null,us=!1,vo=!1,Dl=!1,ds=0,Li=0,bo=null,z1=0;function Ve(){throw Error(x(321))}function Cd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!tn(e[n],t[n]))return!1;return!0}function Ad(e,t,n,a,l,o){return ca=o,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?cg:Gd,Dl=!1,o=n(a,l),Dl=!1,vo&&(o=_h(t,n,a,l)),zh(e),o}function zh(e){U.H=Ki;var t=we!==null&&we.next!==null;if(ca=0,et=we=J=null,us=!1,Li=0,bo=null,t)throw Error(x(300));e===null||at||(e=e.dependencies,e!==null&&is(e)&&(at=!0))}function _h(e,t,n,a){J=e;var l=0;do{if(vo&&(bo=null),Li=0,vo=!1,25<=l)throw Error(x(301));if(l+=1,et=we=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=ug,o=t(n,a)}while(vo);return o}function _1(){var e=U.H,t=e.useState()[0];return t=typeof t.then==="function"?Ji(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(J.flags|=1024),t}function zd(){var e=ds!==0;return ds=0,e}function _d(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ld(e){if(us){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}us=!1}ca=0,et=we=J=null,vo=!1,Li=ds=0,bo=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?J.memoizedState=et=e:et=et.next=e,et}function We(){if(we===null){var e=J.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=et===null?J.memoizedState:et.next;if(t!==null)et=t,we=e;else{if(e===null){if(J.alternate===null)throw Error(x(467));throw Error(x(310))}we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},et===null?J.memoizedState=et=e:et=et.next=e}return et}function _s(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ji(e){var t=Li;return Li+=1,bo===null&&(bo=[]),e=Eh(bo,e,t),t=J,(et===null?t.memoizedState:et.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?cg:Gd),e}function Ls(e){if(e!==null&&typeof e==="object"){if(typeof e.then==="function")return Ji(e);if(e.$$typeof===na)return wt(e)}throw Error(x(438,String(e)))}function Kd(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=J.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=_s(),J.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=yS;return t.index++,n}function ua(e,t){return typeof t==="function"?t(e):t}function Gr(e){var t=We();return jd(t,we,e)}function jd(e,t,n){var a=e.queue;if(a===null)throw Error(x(311));a.lastRenderedReducer=n;var l=e.baseQueue,o=a.pending;if(o!==null){if(l!==null){var i=l.next;l.next=o.next,o.next=i}t.baseQueue=l=o,a.pending=null}if(o=e.baseState,l===null)e.memoizedState=o;else{t=l.next;var r=i=null,s=null,c=t,d=!1;do{var h=c.lane&-536870913;if(h!==c.lane?(oe&h)===h:(ca&h)===h){var u=c.revertLane;if(u===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),h===Mo&&(d=!0);else if((ca&u)===u){c=c.next,u===Mo&&(d=!0);continue}else h={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},s===null?(r=s=h,i=o):s=s.next=h,J.lanes|=u,Qa|=u;h=c.action,Dl&&n(o,h),o=c.hasEagerState?c.eagerState:n(o,h)}else u={lane:h,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},s===null?(r=s=u,i=o):s=s.next=u,J.lanes|=h,Qa|=h;c=c.next}while(c!==null&&c!==t);if(s===null?i=o:s.next=r,!tn(o,e.memoizedState)&&(at=!0,d&&(n=ho,n!==null)))throw n;e.memoizedState=o,e.baseState=i,e.baseQueue=s,a.lastRenderedState=o}return l===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Zc(e){var t=We(),n=t.queue;if(n===null)throw Error(x(311));n.lastRenderedReducer=e;var{dispatch:a,pending:l}=n,o=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do o=e(o,i.action),i=i.next;while(i!==l);tn(o,t.memoizedState)||(at=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function Lh(e,t,n){var a=J,l=We(),o=re;if(o){if(n===void 0)throw Error(x(407));n=n()}else n=t();var i=!tn((we||l).memoizedState,n);if(i&&(l.memoizedState=n,at=!0),l=l.queue,Bd(Bh.bind(null,a,l,e),[e]),l.getSnapshot!==t||i||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,ko(9,{destroy:void 0},jh.bind(null,a,l,n,t),null),Ee===null)throw Error(x(349));o||(ca&127)!==0||Kh(a,t,n)}return n}function Kh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=_s(),J.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jh(e,t,n,a){t.value=n,t.getSnapshot=a,Uh(t)&&Hh(e)}function Bh(e,t,n){return n(function(){Uh(t)&&Hh(e)})}function Uh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tn(e,n)}catch(a){return!0}}function Hh(e){var t=Rl(e,2);t!==null&&Ht(t,e,2)}function Bu(e){var t=Ct();if(typeof e==="function"){var n=e;if(e=n(),Dl){Ra(!0);try{n()}finally{Ra(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e},t}function $h(e,t,n,a){return e.baseState=n,jd(e,we,typeof a==="function"?a:ua)}function L1(e,t,n,a,l){if(js(e))throw Error(x(485));if(e=t.action,e!==null){var o={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};U.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,qh(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qh(e,t){var{action:n,payload:a}=t,l=e.state;if(t.isTransition){var o=U.T,i={};U.T=i;try{var r=n(l,a),s=U.S;s!==null&&s(i,r),Gp(e,t,r)}catch(c){Uu(e,t,c)}finally{o!==null&&i.types!==null&&(o.types=i.types),U.T=o}}else try{o=n(l,a),Gp(e,t,o)}catch(c){Uu(e,t,c)}}function Gp(e,t,n){n!==null&&typeof n==="object"&&typeof n.then==="function"?n.then(function(a){Yp(e,t,a)},function(a){return Uu(e,t,a)}):Yp(e,t,n)}function Yp(e,t,n){t.status="fulfilled",t.value=n,Gh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qh(e,n)))}function Uu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Gh(t),t=t.next;while(t!==a)}e.action=null}function Gh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yh(e,t){return t}function Vp(e,t){if(re){var n=Ee.formState;if(n!==null){e:{var a=J;if(re){if(Ke){t:{var l=Ke;for(var o=mn;l.nodeType!==8;){if(!o){l=null;break t}if(l=gn(l.nextSibling),l===null){l=null;break t}}o=l.data,l=o==="F!"||o==="F"?l:null}if(l){Ke=gn(l.nextSibling),a=l.data==="F!";break e}}Va(a)}a=!1}a&&(t=n[0])}}return n=Ct(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yh,lastRenderedState:t},n.queue=a,n=ig.bind(null,J,a),a.dispatch=n,a=Bu(!1),o=qd.bind(null,J,!1,a.queue),a=Ct(),l={state:t,dispatch:null,action:e,pending:null},a.queue=l,n=L1.bind(null,J,l,o,n),l.dispatch=n,a.memoizedState=e,[t,n,!1]}function Xp(e){var t=We();return Vh(t,we,e)}function Vh(e,t,n){if(t=jd(e,t,Yh)[0],e=Gr(ua)[0],typeof t==="object"&&t!==null&&typeof t.then==="function")try{var a=Ji(t)}catch(i){if(i===zo)throw zs;throw i}else a=t;t=We();var l=t.queue,o=l.dispatch;return n!==t.memoizedState&&(J.flags|=2048,ko(9,{destroy:void 0},K1.bind(null,l,n),null)),[a,o,e]}function K1(e,t){e.action=t}function Qp(e){var t=We(),n=we;if(n!==null)return Vh(t,n,e);We(),t=t.memoizedState,n=We();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function ko(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=J.updateQueue,t===null&&(t=_s(),J.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Xh(){return We().memoizedState}function Yr(e,t,n,a){var l=Ct();J.flags|=e,l.memoizedState=ko(1|t,{destroy:void 0},n,a===void 0?null:a)}function Ks(e,t,n,a){var l=We();a=a===void 0?null:a;var o=l.memoizedState.inst;we!==null&&a!==null&&Cd(a,we.memoizedState.deps)?l.memoizedState=ko(t,o,n,a):(J.flags|=e,l.memoizedState=ko(1|t,o,n,a))}function Zp(e,t){Yr(8390656,8,e,t)}function Bd(e,t){Ks(2048,8,e,t)}function j1(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=_s(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Qh(e){var t=We().memoizedState;return j1({ref:t,nextImpl:e}),function(){if((fe&2)!==0)throw Error(x(440));return t.impl.apply(void 0,arguments)}}function Zh(e,t){return Ks(4,2,e,t)}function Jh(e,t){return Ks(4,4,e,t)}function Wh(e,t){if(typeof t==="function"){e=e();var n=t(e);return function(){typeof n==="function"?n():t(null)}}if(t!==null&&t!==void 0)return e=e(),t.current=e,function(){t.current=null}}function Ph(e,t,n){n=n!==null&&n!==void 0?n.concat([e]):null,Ks(4,4,Wh.bind(null,t,e),n)}function Ud(){}function Ih(e,t){var n=We();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Cd(t,a[1]))return a[0];return n.memoizedState=[e,t],e}function Fh(e,t){var n=We();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Cd(t,a[1]))return a[0];if(a=e(),Dl){Ra(!0);try{e()}finally{Ra(!1)}}return n.memoizedState=[a,t],a}function Hd(e,t,n){if(n===void 0||(ca&1073741824)!==0&&(oe&261930)===0)return e.memoizedState=t;return e.memoizedState=n,e=$g(),J.lanes|=e,Qa|=e,n}function eg(e,t,n,a){if(tn(n,t))return n;if(xo.current!==null)return e=Hd(e,n,a),tn(e,t)||(at=!0),e;if((ca&42)===0||(ca&1073741824)!==0&&(oe&261930)===0)return at=!0,e.memoizedState=n;return e=$g(),J.lanes|=e,Qa|=e,t}function tg(e,t,n,a,l){var o=pe.p;pe.p=o!==0&&8>o?o:8;var i=U.T,r={};U.T=r,qd(e,!1,t,n);try{var s=l(),c=U.S;if(c!==null&&c(r,s),s!==null&&typeof s==="object"&&typeof s.then==="function"){var d=A1(s,a);Mi(e,t,d,en(e))}else Mi(e,t,a,en(e))}catch(h){Mi(e,t,{then:function(){},status:"rejected",reason:h},en())}finally{pe.p=o,i!==null&&r.types!==null&&(i.types=r.types),U.T=i}}function B1(){}function Hu(e,t,n,a){if(e.tag!==5)throw Error(x(476));var l=ng(e).queue;tg(e,l,t,vl,n===null?B1:function(){return ag(e),n(a)})}function ng(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:vl,baseState:vl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:vl},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ag(e){var t=ng(e);t.next===null&&(t=e.alternate.memoizedState),Mi(e,t.next.queue,{},en())}function $d(){return wt(Ui)}function lg(){return We().memoizedState}function og(){return We().memoizedState}function U1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=en();e=ja(n);var a=Ba(t,e,n);a!==null&&(Ht(a,t,n),yi(a,t,n)),t={cache:Od()},e.payload=t;return}t=t.return}}function H1(e,t,n){var a=en();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?rg(t,n):(n=Md(e,t,n,a),n!==null&&(Ht(n,e,a),sg(n,t,a)))}function ig(e,t,n){var a=en();Mi(e,t,n,a)}function Mi(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))rg(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,r=o(i,n);if(l.hasEagerState=!0,l.eagerState=r,tn(r,i))return As(e,t,l,0),Ee===null&&Cs(),!1}catch(s){}finally{}if(n=Md(e,t,l,a),n!==null)return Ht(n,e,a),sg(n,t,a),!0}return!1}function qd(e,t,n,a){if(a={lane:2,revertLane:Pd(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(x(479))}else t=Md(e,n,a,2),t!==null&&Ht(t,e,2)}function js(e){var t=e.alternate;return e===J||t!==null&&t===J}function rg(e,t){vo=us=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sg(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Qm(e,n)}}var Ki={readContext:wt,use:Ls,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};Ki.useEffectEvent=Ve;var cg={readContext:wt,use:Ls,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:wt,useEffect:Zp,useImperativeHandle:function(e,t,n){n=n!==null&&n!==void 0?n.concat([e]):null,Yr(4194308,4,Wh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yr(4194308,4,e,t)},useInsertionEffect:function(e,t){Yr(4,2,e,t)},useMemo:function(e,t){var n=Ct();t=t===void 0?null:t;var a=e();if(Dl){Ra(!0);try{e()}finally{Ra(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Ct();if(n!==void 0){var l=n(t);if(Dl){Ra(!0);try{n(t)}finally{Ra(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=H1.bind(null,J,e),[a.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:function(e){e=Bu(e);var t=e.queue,n=ig.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ud,useDeferredValue:function(e,t){var n=Ct();return Hd(n,e,t)},useTransition:function(){var e=Bu(!1);return e=tg.bind(null,J,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=J,l=Ct();if(re){if(n===void 0)throw Error(x(407));n=n()}else{if(n=t(),Ee===null)throw Error(x(349));(oe&127)!==0||Kh(a,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Zp(Bh.bind(null,a,o,e),[e]),a.flags|=2048,ko(9,{destroy:void 0},jh.bind(null,a,o,n,t),null),n},useId:function(){var e=Ct(),t=Ee.identifierPrefix;if(re){var n=Un,a=Bn;n=(a&~(1<<32-Ft(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ds++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=z1++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$d,useFormState:Vp,useActionState:Vp,useOptimistic:function(e){var t=Ct();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=qd.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:Kd,useCacheRefresh:function(){return Ct().memoizedState=U1.bind(null,J)},useEffectEvent:function(e){var t=Ct(),n={impl:e};return t.memoizedState=n,function(){if((fe&2)!==0)throw Error(x(440));return n.impl.apply(void 0,arguments)}}},Gd={readContext:wt,use:Ls,useCallback:Ih,useContext:wt,useEffect:Bd,useImperativeHandle:Ph,useInsertionEffect:Zh,useLayoutEffect:Jh,useMemo:Fh,useReducer:Gr,useRef:Xh,useState:function(){return Gr(ua)},useDebugValue:Ud,useDeferredValue:function(e,t){var n=We();return eg(n,we.memoizedState,e,t)},useTransition:function(){var e=Gr(ua)[0],t=We().memoizedState;return[typeof e==="boolean"?e:Ji(e),t]},useSyncExternalStore:Lh,useId:lg,useHostTransitionStatus:$d,useFormState:Xp,useActionState:Xp,useOptimistic:function(e,t){var n=We();return $h(n,we,e,t)},useMemoCache:Kd,useCacheRefresh:og};Gd.useEffectEvent=Qh;var ug={readContext:wt,use:Ls,useCallback:Ih,useContext:wt,useEffect:Bd,useImperativeHandle:Ph,useInsertionEffect:Zh,useLayoutEffect:Jh,useMemo:Fh,useReducer:Zc,useRef:Xh,useState:function(){return Zc(ua)},useDebugValue:Ud,useDeferredValue:function(e,t){var n=We();return we===null?Hd(n,e,t):eg(n,we.memoizedState,e,t)},useTransition:function(){var e=Zc(ua)[0],t=We().memoizedState;return[typeof e==="boolean"?e:Ji(e),t]},useSyncExternalStore:Lh,useId:lg,useHostTransitionStatus:$d,useFormState:Qp,useActionState:Qp,useOptimistic:function(e,t){var n=We();if(we!==null)return $h(n,we,e,t);return n.baseState=e,[e,n.queue.dispatch]},useMemoCache:Kd,useCacheRefresh:og};ug.useEffectEvent=Qh;function Jc(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n===null||n===void 0?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $u={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=en(),l=ja(a);l.payload=t,n!==void 0&&n!==null&&(l.callback=n),t=Ba(e,l,a),t!==null&&(Ht(t,e,a),yi(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=en(),l=ja(a);l.tag=1,l.payload=t,n!==void 0&&n!==null&&(l.callback=n),t=Ba(e,l,a),t!==null&&(Ht(t,e,a),yi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=en(),a=ja(n);a.tag=2,t!==void 0&&t!==null&&(a.callback=t),t=Ba(e,a,n),t!==null&&(Ht(t,e,n),yi(t,e,n))}};function Jp(e,t,n,a,l,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate==="function"?e.shouldComponentUpdate(a,o,i):t.prototype&&t.prototype.isPureReactComponent?!Ci(n,a)||!Ci(l,o):!0}function Wp(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps==="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps==="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&$u.enqueueReplaceState(t,t.state,null)}function Ol(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=je({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}function dg(e){as(e)}function fg(e){console.error(e)}function pg(e){as(e)}function fs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Pp(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function qu(e,t,n){return n=ja(n),n.tag=3,n.payload={element:null},n.callback=function(){fs(e,t)},n}function mg(e){return e=ja(e),e.tag=3,e}function hg(e,t,n,a){var l=n.type.getDerivedStateFromError;if(typeof l==="function"){var o=a.value;e.payload=function(){return l(o)},e.callback=function(){Pp(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch==="function"&&(e.callback=function(){Pp(t,n,a),typeof l!=="function"&&(Ua===null?Ua=new Set([this]):Ua.add(this));var r=a.stack;this.componentDidCatch(a.value,{componentStack:r!==null?r:""})})}function $1(e,t,n,a,l){if(n.flags|=32768,a!==null&&typeof a==="object"&&typeof a.then==="function"){if(t=n.alternate,t!==null&&Ao(t,n,l,!0),n=nn.current,n!==null){switch(n.tag){case 31:case 13:return hn===null?vs():n.alternate===null&&Xe===0&&(Xe=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===rs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),iu(e,a,l)),!1;case 22:return n.flags|=65536,a===rs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),iu(e,a,l)),!1}throw Error(x(435,n.tag))}return iu(e,a,l),vs(),!1}if(re)return t=nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,a!==Tu&&(e=Error(x(422),{cause:a}),zi(pn(e,n)))):(a!==Tu&&(t=Error(x(423),{cause:a}),zi(pn(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,a=pn(a,n),l=qu(e.stateNode,a,l),Qc(e,l),Xe!==4&&(Xe=2)),!1;var o=Error(x(520),{cause:a});if(o=pn(o,n),Di===null?Di=[o]:Di.push(o),Xe!==4&&(Xe=2),t===null)return!0;a=pn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=qu(n.stateNode,a,e),Qc(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError==="function"||o!==null&&typeof o.componentDidCatch==="function"&&(Ua===null||!Ua.has(o))))return n.flags|=65536,l&=-l,n.lanes|=l,l=mg(l),hg(l,e,n,a),Qc(n,l),!1}n=n.return}while(n!==null);return!1}var Yd=Error(x(461)),at=!1;function bt(e,t,n,a){t.child=e===null?Th(t,null,n,a):kl(t,e.child,n,a)}function Ip(e,t,n,a,l){n=n.render;var o=t.ref;if("ref"in a){var i={};for(var r in a)r!=="ref"&&(i[r]=a[r])}else i=a;if(xl(t),a=Ad(e,t,n,i,o,l),r=zd(),e!==null&&!at)return _d(e,t,l),da(e,t,l);return re&&r&&kd(t),t.flags|=1,bt(e,t,a,l),t.child}function Fp(e,t,n,a,l){if(e===null){var o=n.type;if(typeof o==="function"&&!xd(o)&&o.defaultProps===void 0&&n.compare===null)return t.tag=15,t.type=o,gg(e,t,o,a,l);return e=$r(n.type,null,a,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e}if(o=e.child,!Vd(e,l)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ci,n(i,a)&&e.ref===t.ref)return da(e,t,l)}return t.flags|=1,e=oa(o,a),e.ref=t.ref,e.return=t,t.child=e}function gg(e,t,n,a,l){if(e!==null){var o=e.memoizedProps;if(Ci(o,a)&&e.ref===t.ref)if(at=!1,t.pendingProps=a=o,Vd(e,l))(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,da(e,t,l)}return Gu(e,t,n,a,l)}function vg(e,t,n,a){var l=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){a=t.child=e.child;for(l=0;a!==null;)l=l|a.lanes|a.childLanes,a=a.sibling;a=l&~o}else a=0,t.child=null;return em(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qr(t,o!==null?o.cachePool:null),o!==null?qp(t,o):Ku(),Ah(t);else return a=t.lanes=536870912,em(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(qr(t,o.cachePool),qp(t,o),Na(t),t.memoizedState=null):(e!==null&&qr(t,null),Ku(),Na(t));return bt(e,t,l,n),t.child}function di(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function em(e,t,n,a,l){var o=Ed();return o=o===null?null:{parent:nt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&qr(t,null),Ku(),Ah(t),e!==null&&Ao(e,t,a,!0),t.childLanes=l,null}function Vr(e,t){return t=ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function tm(e,t,n){return kl(t,e.child,null,n),e=Vr(t,t.pendingProps),e.flags|=2,Zt(t),t.memoizedState=null,e}function q1(e,t,n){var a=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(re){if(a.mode==="hidden")return e=Vr(t,a),t.lanes=536870912,di(null,e);if(ju(t),(e=Ke)?(e=cv(e,mn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ya!==null?{id:Bn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},n=Mh(e),n.return=t,t.child=n,St=t,Ke=null)):e=null,e===null)throw Va(t);return t.lanes=536870912,null}return Vr(t,a)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(ju(t),l)if(t.flags&256)t.flags&=-257,t=tm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(x(558));else if(at||Ao(e,t,n,!1),l=(n&e.childLanes)!==0,at||l){if(a=Ee,a!==null&&(i=Zm(a,n),i!==0&&i!==o.retryLane))throw o.retryLane=i,Rl(e,i),Ht(a,e,i),Yd;vs(),t=tm(e,t,n)}else e=o.treeContext,Ke=gn(i.nextSibling),St=t,re=!0,Ka=null,mn=!1,e!==null&&kh(t,e),t=Vr(t,a),t.flags|=4096;return t}return e=oa(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xr(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=="function"&&typeof n!=="object")throw Error(x(284));if(e===null||e.ref!==n)t.flags|=4194816}}function Gu(e,t,n,a,l){if(xl(t),n=Ad(e,t,n,a,void 0,l),a=zd(),e!==null&&!at)return _d(e,t,l),da(e,t,l);return re&&a&&kd(t),t.flags|=1,bt(e,t,n,l),t.child}function nm(e,t,n,a,l,o){if(xl(t),t.updateQueue=null,n=_h(t,a,n,l),zh(e),a=zd(),e!==null&&!at)return _d(e,t,o),da(e,t,o);return re&&a&&kd(t),t.flags|=1,bt(e,t,n,o),t.child}function am(e,t,n,a,l){if(xl(t),t.stateNode===null){var o=ro,i=n.contextType;typeof i==="object"&&i!==null&&(o=wt(i)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=$u,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},Td(t),i=n.contextType,o.context=typeof i==="object"&&i!==null?wt(i):ro,o.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i==="function"&&(Jc(t,n,i,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps==="function"||typeof o.getSnapshotBeforeUpdate==="function"||typeof o.UNSAFE_componentWillMount!=="function"&&typeof o.componentWillMount!=="function"||(i=o.state,typeof o.componentWillMount==="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&$u.enqueueReplaceState(o,o.state,null),wi(t,a,o,l),Si(),o.state=t.memoizedState),typeof o.componentDidMount==="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var r=t.memoizedProps,s=Ol(n,r);o.props=s;var c=o.context,d=n.contextType;i=ro,typeof d==="object"&&d!==null&&(i=wt(d));var h=n.getDerivedStateFromProps;d=typeof h==="function"||typeof o.getSnapshotBeforeUpdate==="function",r=t.pendingProps!==r,d||typeof o.UNSAFE_componentWillReceiveProps!=="function"&&typeof o.componentWillReceiveProps!=="function"||(r||c!==i)&&Wp(t,o,a,i),Da=!1;var u=t.memoizedState;o.state=u,wi(t,a,o,l),Si(),c=t.memoizedState,r||u!==c||Da?(typeof h==="function"&&(Jc(t,n,h,a),c=t.memoizedState),(s=Da||Jp(t,n,s,a,u,c,i))?(d||typeof o.UNSAFE_componentWillMount!=="function"&&typeof o.componentWillMount!=="function"||(typeof o.componentWillMount==="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==="function"&&(t.flags|=4194308)):(typeof o.componentDidMount==="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=c),o.props=a,o.state=c,o.context=i,a=s):(typeof o.componentDidMount==="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,_u(e,t),i=t.memoizedProps,d=Ol(n,i),o.props=d,h=t.pendingProps,u=o.context,c=n.contextType,s=ro,typeof c==="object"&&c!==null&&(s=wt(c)),r=n.getDerivedStateFromProps,(c=typeof r==="function"||typeof o.getSnapshotBeforeUpdate==="function")||typeof o.UNSAFE_componentWillReceiveProps!=="function"&&typeof o.componentWillReceiveProps!=="function"||(i!==h||u!==s)&&Wp(t,o,a,s),Da=!1,u=t.memoizedState,o.state=u,wi(t,a,o,l),Si();var p=t.memoizedState;i!==h||u!==p||Da||e!==null&&e.dependencies!==null&&is(e.dependencies)?(typeof r==="function"&&(Jc(t,n,r,a),p=t.memoizedState),(d=Da||Jp(t,n,d,a,u,p,s)||e!==null&&e.dependencies!==null&&is(e.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!=="function"&&typeof o.componentWillUpdate!=="function"||(typeof o.componentWillUpdate==="function"&&o.componentWillUpdate(a,p,s),typeof o.UNSAFE_componentWillUpdate==="function"&&o.UNSAFE_componentWillUpdate(a,p,s)),typeof o.componentDidUpdate==="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!=="function"||i===e.memoizedProps&&u===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=="function"||i===e.memoizedProps&&u===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=p),o.props=a,o.state=p,o.context=s,a=d):(typeof o.componentDidUpdate!=="function"||i===e.memoizedProps&&u===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=="function"||i===e.memoizedProps&&u===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,Xr(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!=="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=kl(t,e.child,null,l),t.child=kl(t,null,n,l)):bt(e,t,n,l),t.memoizedState=o.state,e=t.child):e=da(e,t,l),e}function lm(e,t,n,a){return Ml(),t.flags|=256,bt(e,t,n,a),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pc(e){return{baseLanes:e,cachePool:Oh()}}function Ic(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Wt),e}function bg(e,t,n){var a=t.pendingProps,l=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(Je.current&2)!==0),i&&(l=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(re){if(l?Ea(t):Na(t),(e=Ke)?(e=cv(e,mn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ya!==null?{id:Bn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},n=Mh(e),n.return=t,t.child=n,St=t,Ke=null)):e=null,e===null)throw Va(t);return od(e)?t.lanes=32:t.lanes=536870912,null}var r=a.children;if(a=a.fallback,l)return Na(t),l=t.mode,r=ps({mode:"hidden",children:r},l),a=bl(a,l,n,null),r.return=t,a.return=t,r.sibling=a,t.child=r,a=t.child,a.memoizedState=Pc(n),a.childLanes=Ic(e,i,n),t.memoizedState=Wc,di(null,a);return Ea(t),Yu(t,r)}var s=e.memoizedState;if(s!==null&&(r=s.dehydrated,r!==null)){if(o)t.flags&256?(Ea(t),t.flags&=-257,t=Fc(e,t,n)):t.memoizedState!==null?(Na(t),t.child=e.child,t.flags|=128,t=null):(Na(t),r=a.fallback,l=t.mode,a=ps({mode:"visible",children:a.children},l),r=bl(r,l,n,null),r.flags|=2,a.return=t,r.return=t,a.sibling=r,t.child=a,kl(t,e.child,null,n),a=t.child,a.memoizedState=Pc(n),a.childLanes=Ic(e,i,n),t.memoizedState=Wc,t=di(null,a));else if(Ea(t),od(r)){if(i=r.nextSibling&&r.nextSibling.dataset,i)var c=i.dgst;i=c,a=Error(x(419)),a.stack="",a.digest=i,zi({value:a,source:null,stack:null}),t=Fc(e,t,n)}else if(at||Ao(e,t,n,!1),i=(n&e.childLanes)!==0,at||i){if(i=Ee,i!==null&&(a=Zm(i,n),a!==0&&a!==s.retryLane))throw s.retryLane=a,Rl(e,a),Ht(i,e,a),Yd;ld(r)||vs(),t=Fc(e,t,n)}else ld(r)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,Ke=gn(r.nextSibling),St=t,re=!0,Ka=null,mn=!1,e!==null&&kh(t,e),t=Yu(t,a.children),t.flags|=4096);return t}if(l)return Na(t),r=a.fallback,l=t.mode,s=e.child,c=s.sibling,a=oa(s,{mode:"hidden",children:a.children}),a.subtreeFlags=s.subtreeFlags&65011712,c!==null?r=oa(c,r):(r=bl(r,l,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,di(null,a),a=t.child,r=e.child.memoizedState,r===null?r=Pc(n):(l=r.cachePool,l!==null?(s=nt._currentValue,l=l.parent!==s?{parent:s,pool:s}:l):l=Oh(),r={baseLanes:r.baseLanes|n,cachePool:l}),a.memoizedState=r,a.childLanes=Ic(e,i,n),t.memoizedState=Wc,di(e.child,a);return Ea(t),n=e.child,e=n.sibling,n=oa(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n}function Yu(e,t){return t=ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ps(e,t){return e=Jt(22,e,null,t),e.lanes=0,e}function Fc(e,t,n){return kl(t,e.child,null,n),e=Yu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function om(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Cu(e.return,t,n)}function eu(e,t,n,a,l,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l,treeForkCount:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=a,i.tail=n,i.tailMode=l,i.treeForkCount=o)}function yg(e,t,n){var a=t.pendingProps,l=a.revealOrder,o=a.tail;a=a.children;var i=Je.current,r=(i&2)!==0;if(r?(i=i&1|2,t.flags|=128):i&=1,Ce(Je,i),bt(e,t,a,n),a=re?Ai:0,!r&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&om(e,n,t);else if(e.tag===19)om(e,n,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}switch(l){case"forwards":n=t.child;for(l=null;n!==null;)e=n.alternate,e!==null&&cs(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),eu(t,!1,l,n,o,a);break;case"backwards":case"unstable_legacy-backwards":n=null,l=t.child;for(t.child=null;l!==null;){if(e=l.alternate,e!==null&&cs(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}eu(t,!0,n,null,o,a);break;case"together":eu(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function da(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ao(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(x(153));if(t.child!==null){e=t.child,n=oa(e,e.pendingProps),t.child=n;for(n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Vd(e,t){if((e.lanes&t)!==0)return!0;return e=e.dependencies,e!==null&&is(e)?!0:!1}function G1(e,t,n){switch(t.tag){case 3:Fr(t,t.stateNode.containerInfo),Oa(t,nt,e.memoizedState.cache),Ml();break;case 27:case 5:bu(t);break;case 4:Fr(t,t.stateNode.containerInfo);break;case 10:Oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ju(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return Ea(t),t.flags|=128,null;if((n&t.child.childLanes)!==0)return bg(e,t,n);return Ea(t),e=da(e,t,n),e!==null?e.sibling:null}Ea(t);break;case 19:var l=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ao(e,t,n,!1),a=(n&t.childLanes)!==0),l){if(a)return yg(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Ce(Je,Je.current),a)break;else return null;case 22:return t.lanes=0,vg(e,t,n,t.pendingProps);case 24:Oa(t,nt,e.memoizedState.cache)}return da(e,t,n)}function Sg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)at=!0;else{if(!Vd(e,n)&&(t.flags&128)===0)return at=!1,G1(e,t,n);at=(e.flags&131072)!==0?!0:!1}else at=!1,re&&(t.flags&1048576)!==0&&xh(t,Ai,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=hl(t.elementType),t.type=e,typeof e==="function")xd(e)?(a=Ol(e,a),t.tag=1,t=am(null,t,e,a,n)):(t.tag=0,t=Gu(null,t,e,a,n));else{if(e!==void 0&&e!==null){var l=e.$$typeof;if(l===cd){t.tag=11,t=Ip(null,t,e,a,n);break e}else if(l===ud){t.tag=14,t=Fp(null,t,e,a,n);break e}}throw t=gu(e)||e,Error(x(306,t,""))}}return t;case 0:return Gu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,l=Ol(a,t.pendingProps),am(e,t,a,l,n);case 3:e:{if(Fr(t,t.stateNode.containerInfo),e===null)throw Error(x(387));a=t.pendingProps;var o=t.memoizedState;l=o.element,_u(e,t),wi(t,a,null,n);var i=t.memoizedState;if(a=i.cache,Oa(t,nt,a),a!==o.cache&&Au(t,[nt],n,!0),Si(),a=i.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=lm(e,t,a,n);break e}else if(a!==l){l=pn(Error(x(424)),t),zi(l),t=lm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}Ke=gn(e.firstChild),St=t,re=!0,Ka=null,mn=!0,n=Th(t,null,a,n);for(t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ml(),a===l){t=da(e,t,n);break e}bt(e,t,a,n)}t=t.child}return t;case 26:return Xr(e,t),e===null?(n=Dm(t.type,null,t.pendingProps,null))?t.memoizedState=n:re||(n=t.type,e=t.pendingProps,a=ws(La.current).createElement(n),a[yt]=t,a[$t]=e,Mt(a,n,e),ht(a),t.stateNode=a):t.memoizedState=Dm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return bu(t),e===null&&re&&(a=t.stateNode=uv(t.type,t.pendingProps,La.current),St=t,mn=!0,l=Ke,Ja(t.type)?(id=l,Ke=gn(a.firstChild)):Ke=l),bt(e,t,t.pendingProps.children,n),Xr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:if(e===null&&re){if(l=a=Ke)a=vw(a,t.type,t.pendingProps,mn),a!==null?(t.stateNode=a,St=t,Ke=gn(a.firstChild),mn=!1,l=!0):l=!1;l||Va(t)}return bu(t),l=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,nd(l,o)?a=null:i!==null&&nd(l,i)&&(t.flags|=32),t.memoizedState!==null&&(l=Ad(e,t,_1,null,null,n),Ui._currentValue=l),Xr(e,t),bt(e,t,a,n),t.child;case 6:if(e===null&&re){if(e=n=Ke)n=bw(n,t.pendingProps,mn),n!==null?(t.stateNode=n,St=t,Ke=null,e=!0):e=!1;e||Va(t)}return null;case 13:return bg(e,t,n);case 4:return Fr(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=kl(t,null,a,n):bt(e,t,a,n),t.child;case 11:return Ip(e,t,t.type,t.pendingProps,n);case 7:return bt(e,t,t.pendingProps,n),t.child;case 8:return bt(e,t,t.pendingProps.children,n),t.child;case 12:return bt(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Oa(t,t.type,a.value),bt(e,t,a.children,n),t.child;case 9:return l=t.type._context,a=t.pendingProps.children,xl(t),l=wt(l),a=a(l),t.flags|=1,bt(e,t,a,n),t.child;case 14:return Fp(e,t,t.type,t.pendingProps,n);case 15:return gg(e,t,t.type,t.pendingProps,n);case 19:return yg(e,t,n);case 31:return q1(e,t,n);case 22:return vg(e,t,n,t.pendingProps);case 24:return xl(t),a=wt(nt),e===null?(l=Ed(),l===null&&(l=Ee,o=Od(),l.pooledCache=o,o.refCount++,o!==null&&(l.pooledCacheLanes|=n),l=o),t.memoizedState={parent:a,cache:l},Td(t),Oa(t,nt,l)):((e.lanes&n)!==0&&(_u(e,t),wi(t,null,null,n),Si()),l=e.memoizedState,o=t.memoizedState,l.parent!==a?(l={parent:a,cache:a},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Oa(t,nt,a)):(a=o.cache,Oa(t,nt,a),a!==l.cache&&Au(t,[nt],n,!0))),bt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(x(156,t.tag))}function Wn(e){e.flags|=4}function tu(e,t,n,a,l){if(t=(e.mode&32)!==0)t=!1;if(t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Yg())e.flags|=8192;else throw Sl=rs,Nd}else e.flags&=-16777217}function im(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!pv(t))if(Yg())e.flags|=8192;else throw Sl=rs,Nd}function Cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vm():536870912,e.lanes|=t,Do|=t)}function ai(e,t){if(!re)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&65011712,a|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Y1(e,t,n){var a=t.pendingProps;switch(Dd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return Le(t),null;case 3:if(n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ia(nt),yo(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),e===null||e.child===null)Zl(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xc());return Le(t),null;case 26:var{type:l,memoizedState:o}=t;return e===null?(Wn(t),o!==null?(Le(t),im(t,o)):(Le(t),tu(t,l,null,a,n))):o?o!==e.memoizedState?(Wn(t),Le(t),im(t,o)):(Le(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Wn(t),Le(t),tu(t,l,e,a,n)),null;case 27:if(es(t),n=La.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Wn(t);else{if(!a){if(t.stateNode===null)throw Error(x(166));return Le(t),null}e=$n.current,Zl(t)?Lp(t,e):(e=uv(l,a,n),t.stateNode=e,Wn(t))}return Le(t),null;case 5:if(es(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Wn(t);else{if(!a){if(t.stateNode===null)throw Error(x(166));return Le(t),null}if(o=$n.current,Zl(t))Lp(t,o);else{var i=ws(La.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":o=i.createElement("div"),o.innerHTML="<script></script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is==="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is==="string"?i.createElement(l,{is:a.is}):i.createElement(l)}}o[yt]=t,o[$t]=a;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(Mt(o,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Wn(t)}}return Le(t),tu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Wn(t);else{if(typeof a!=="string"&&t.stateNode===null)throw Error(x(166));if(e=La.current,Zl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=St,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[yt]=t,e=e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||iv(e.nodeValue,n)?!0:!1,e||Va(t,!0)}else e=ws(e).createTextNode(a),e[yt]=t,t.stateNode=e}return Le(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Zl(t),n!==null){if(e===null){if(!a)throw Error(x(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(557));e[yt]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),e=!1}else n=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e){if(t.flags&256)return Zt(t),t;return Zt(t),null}if((t.flags&128)!==0)throw Error(x(558))}return Le(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Zl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(x(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(x(317));l[yt]=t}else Ml(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),l=!1}else l=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l){if(t.flags&256)return Zt(t),t;return Zt(t),null}}if(Zt(t),(t.flags&128)!==0)return t.lanes=n,t;return n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Cr(t,t.updateQueue),Le(t),null;case 4:return yo(),e===null&&Id(t.stateNode.containerInfo),Le(t),null;case 10:return ia(t.type),Le(t),null;case 19:if(gt(Je),a=t.memoizedState,a===null)return Le(t),null;if(l=(t.flags&128)!==0,o=a.rendering,o===null)if(l)ai(a,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=cs(e),o!==null){t.flags|=128,ai(a,!1),e=o.updateQueue,t.updateQueue=e,Cr(t,e),t.subtreeFlags=0,e=n;for(n=t.child;n!==null;)wh(n,e),n=n.sibling;return Ce(Je,Je.current&1|2),re&&ea(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Pt()>hs&&(t.flags|=128,l=!0,ai(a,!1),t.lanes=4194304)}else{if(!l)if(e=cs(o),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Cr(t,e),ai(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!re)return Le(t),null}else 2*Pt()-a.renderingStartTime>hs&&n!==536870912&&(t.flags|=128,l=!0,ai(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}if(a.tail!==null)return e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Pt(),e.sibling=null,n=Je.current,Ce(Je,l?n&1|2:n&1),re&&ea(t,a.treeForkCount),e;return Le(t),null;case 22:case 23:return Zt(t),Rd(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),n=t.updateQueue,n!==null&&Cr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&gt(yl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ia(nt),Le(t),null;case 25:return null;case 30:return null}throw Error(x(156,t.tag))}function V1(e,t){switch(Dd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ia(nt),yo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return es(t),null;case 31:if(t.memoizedState!==null){if(Zt(t),t.alternate===null)throw Error(x(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Zt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(x(340));Ml()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gt(Je),null;case 4:return yo(),null;case 10:return ia(t.type),null;case 22:case 23:return Zt(t),Rd(),e!==null&&gt(yl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ia(nt),null;case 25:return null;default:return null}}function wg(e,t){switch(Dd(t),t.tag){case 3:ia(nt),yo();break;case 26:case 27:case 5:es(t);break;case 4:yo();break;case 31:t.memoizedState!==null&&Zt(t);break;case 13:Zt(t);break;case 19:gt(Je);break;case 10:ia(t.type);break;case 22:case 23:Zt(t),Rd(),e!==null&&gt(yl);break;case 24:ia(nt)}}function Wi(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var{create:o,inst:i}=n;a=o(),i.destroy=a}n=n.next}while(n!==l)}}catch(r){be(t,t.return,r)}}function Xa(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var o=l.next;a=o;do{if((a.tag&e)===e){var i=a.inst,r=i.destroy;if(r!==void 0){i.destroy=void 0,l=t;var s=n,c=r;try{c()}catch(d){be(l,s,d)}}}a=a.next}while(a!==o)}}catch(d){be(t,t.return,d)}}function Mg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ch(t,n)}catch(a){be(e,e.return,a)}}}function xg(e,t,n){n.props=Ol(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){be(e,t,a)}}function xi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n==="function"?e.refCleanup=n(a):n.current=a}}catch(l){be(e,t,l)}}function Hn(e,t){var{ref:n,refCleanup:a}=e;if(n!==null)if(typeof a==="function")try{a()}catch(l){be(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==="function")try{n(null)}catch(l){be(e,t,l)}else n.current=null}function kg(e){var{type:t,memoizedProps:n,stateNode:a}=e;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){be(e,e.return,l)}}function nu(e,t,n){try{var a=e.stateNode;dw(a,e.type,n,t),a[$t]=t}catch(l){be(e,e.return,l)}}function Dg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ja(e.type)||e.tag===4}function au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dg(e.return))return null;e=e.return}e.sibling.return=e.return;for(e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ja(e.type))continue e;if(e.flags&2)continue e;if(e.child===null||e.tag===4)continue e;else e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!==null&&n!==void 0||t.onclick!==null||(t.onclick=aa));else if(a!==4&&(a===27&&Ja(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Vu(e,t,n),e=e.sibling;e!==null;)Vu(e,t,n),e=e.sibling}function ms(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Ja(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ms(e,t,n),e=e.sibling;e!==null;)ms(e,t,n),e=e.sibling}function Og(e){var{stateNode:t,memoizedProps:n}=e;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Mt(t,a,n),t[yt]=e,t[$t]=n}catch(o){be(e,e.return,o)}}var ta=!1,tt=!1,lu=!1,rm=typeof WeakSet==="function"?WeakSet:Set,mt=null;function X1(e,t){if(e=e.containerInfo,ed=Ds,e=ph(e),Sd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var{anchorOffset:l,focusNode:o}=a;a=a.focusOffset;try{n.nodeType,o.nodeType}catch(b){n=null;break e}var i=0,r=-1,s=-1,c=0,d=0,h=e,u=null;t:for(;;){for(var p;;){if(h!==n||l!==0&&h.nodeType!==3||(r=i+l),h!==o||a!==0&&h.nodeType!==3||(s=i+a),h.nodeType===3&&(i+=h.nodeValue.length),(p=h.firstChild)===null)break;u=h,h=p}for(;;){if(h===e)break t;if(u===n&&++c===l&&(r=i),u===o&&++d===a&&(s=i),(p=h.nextSibling)!==null)break;h=u,u=h.parentNode}h=p}n=r===-1||s===-1?null:{start:r,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;td={focusedElem:e,selectionRange:n},Ds=!1;for(mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)l=e[n],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,l=o.memoizedProps,o=o.memoizedState,a=n.stateNode;try{var g=Ol(n.type,l);e=a.getSnapshotBeforeUpdate(g,o),a.__reactInternalSnapshotBeforeUpdate=e}catch(b){be(n,n.return,b)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ad(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ad(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(x(163))}if(e=t.sibling,e!==null){e.return=t.return,mt=e;break}mt=t.return}}function Eg(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:In(e,n),a&4&&Wi(5,n);break;case 1:if(In(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){be(n,n.return,i)}else{var l=Ol(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){be(n,n.return,i)}}a&64&&Mg(n),a&512&&xi(n,n.return);break;case 3:if(In(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ch(e,t)}catch(i){be(n,n.return,i)}}break;case 27:t===null&&a&4&&Og(n);case 26:case 5:In(e,n),t===null&&a&4&&kg(n),a&512&&xi(n,n.return);break;case 12:In(e,n);break;case 31:In(e,n),a&4&&Rg(e,n);break;case 13:In(e,n),a&4&&Cg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=tw.bind(null,n),yw(e,n))));break;case 22:if(a=n.memoizedState!==null||ta,!a){t=t!==null&&t.memoizedState!==null||tt,l=ta;var o=tt;ta=a,(tt=t)&&!o?Fn(e,n,(n.subtreeFlags&8772)!==0):In(e,n),ta=l,tt=o}break;case 30:break;default:In(e,n)}}function Ng(e){var t=e.alternate;t!==null&&(e.alternate=null,Ng(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&md(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var He=null,Bt=!1;function Pn(e,t,n){for(n=n.child;n!==null;)Tg(e,t,n),n=n.sibling}function Tg(e,t,n){if(It&&typeof It.onCommitFiberUnmount==="function")try{It.onCommitFiberUnmount(Gi,n)}catch(o){}switch(n.tag){case 26:tt||Hn(n,t),Pn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tt||Hn(n,t);var a=He,l=Bt;Ja(n.type)&&(He=n.stateNode,Bt=!1),Pn(e,t,n),Ei(n.stateNode),He=a,Bt=l;break;case 5:tt||Hn(n,t);case 6:if(a=He,l=Bt,He=null,Pn(e,t,n),He=a,Bt=l,He!==null)if(Bt)try{(He.nodeType===9?He.body:He.nodeName==="HTML"?He.ownerDocument.body:He).removeChild(n.stateNode)}catch(o){be(n,t,o)}else try{He.removeChild(n.stateNode)}catch(o){be(n,t,o)}break;case 18:He!==null&&(Bt?(e=He,Sm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),To(e)):Sm(He,n.stateNode));break;case 4:a=He,l=Bt,He=n.stateNode.containerInfo,Bt=!0,Pn(e,t,n),He=a,Bt=l;break;case 0:case 11:case 14:case 15:Xa(2,n,t),tt||Xa(4,n,t),Pn(e,t,n);break;case 1:tt||(Hn(n,t),a=n.stateNode,typeof a.componentWillUnmount==="function"&&xg(n,t,a)),Pn(e,t,n);break;case 21:Pn(e,t,n);break;case 22:tt=(a=tt)||n.memoizedState!==null,Pn(e,t,n),tt=a;break;default:Pn(e,t,n)}}function Rg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{To(e)}catch(n){be(t,t.return,n)}}}function Cg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{To(e)}catch(n){be(t,t.return,n)}}function Q1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rm),t;default:throw Error(x(435,e.tag))}}function Ar(e,t){var n=Q1(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var l=nw.bind(null,e,a);a.then(l,l)}})}function Kt(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a],o=e,i=t,r=i;e:for(;r!==null;){switch(r.tag){case 27:if(Ja(r.type)){He=r.stateNode,Bt=!1;break e}break;case 5:He=r.stateNode,Bt=!1;break e;case 3:case 4:He=r.stateNode.containerInfo,Bt=!0;break e}r=r.return}if(He===null)throw Error(x(160));Tg(o,i,l),He=null,Bt=!1,o=l.alternate,o!==null&&(o.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ag(t,e),t=t.sibling}var On=null;function Ag(e,t){var{alternate:n,flags:a}=e;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),jt(e),a&4&&(Xa(3,e,e.return),Wi(3,e),Xa(5,e,e.return));break;case 1:Kt(t,e),jt(e),a&512&&(tt||n===null||Hn(n,n.return)),a&64&&ta&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var l=On;if(Kt(t,e),jt(e),a&512&&(tt||n===null||Hn(n,n.return)),a&4){var o=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,l=l.ownerDocument||l;t:switch(a){case"title":if(o=l.getElementsByTagName("title")[0],!o||o[Xi]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))o=l.createElement(a),l.head.insertBefore(o,l.querySelector("head > title"));Mt(o,a,n),o[yt]=e,ht(o),a=o;break e;case"link":var i=Em("link","href",l).get(a+(n.href||""));if(i){for(var r=0;r<i.length;r++)if(o=i[r],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(r,1);break t}}o=l.createElement(a),Mt(o,a,n),l.head.appendChild(o);break;case"meta":if(i=Em("meta","content",l).get(a+(n.content||""))){for(r=0;r<i.length;r++)if(o=i[r],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(r,1);break t}}o=l.createElement(a),Mt(o,a,n),l.head.appendChild(o);break;default:throw Error(x(468,a))}o[yt]=e,ht(o),a=o}e.stateNode=a}else Nm(l,e.type,e.stateNode);else e.stateNode=Om(l,a,e.memoizedProps);else o!==a?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,a===null?Nm(l,e.type,e.stateNode):Om(l,a,e.memoizedProps)):a===null&&e.stateNode!==null&&nu(e,e.memoizedProps,n.memoizedProps)}break;case 27:Kt(t,e),jt(e),a&512&&(tt||n===null||Hn(n,n.return)),n!==null&&a&4&&nu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Kt(t,e),jt(e),a&512&&(tt||n===null||Hn(n,n.return)),e.flags&32){l=e.stateNode;try{wo(l,"")}catch(g){be(e,e.return,g)}}a&4&&e.stateNode!=null&&(l=e.memoizedProps,nu(e,l,n!==null?n.memoizedProps:l)),a&1024&&(lu=!0);break;case 6:if(Kt(t,e),jt(e),a&4){if(e.stateNode===null)throw Error(x(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(g){be(e,e.return,g)}}break;case 3:if(Jr=null,l=On,On=Ms(t.containerInfo),Kt(t,e),On=l,jt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{To(t.containerInfo)}catch(g){be(e,e.return,g)}lu&&(lu=!1,zg(e));break;case 4:a=On,On=Ms(e.stateNode.containerInfo),Kt(t,e),jt(e),On=a;break;case 12:Kt(t,e),jt(e);break;case 31:Kt(t,e),jt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ar(e,a)));break;case 13:Kt(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!==(n!==null&&n.memoizedState!==null)&&(Bs=Pt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ar(e,a)));break;case 22:l=e.memoizedState!==null;var s=n!==null&&n.memoizedState!==null,c=ta,d=tt;if(ta=c||l,tt=d||s,Kt(t,e),tt=d,ta=c,jt(e),a&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||s||ta||tt||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){s=n=t;try{if(o=s.stateNode,l)i=o.style,typeof i.setProperty==="function"?i.setProperty("display","none","important"):i.display="none";else{r=s.stateNode;var h=s.memoizedProps.style,u=h!==void 0&&h!==null&&h.hasOwnProperty("display")?h.display:null;r.style.display=u==null||typeof u==="boolean"?"":(""+u).trim()}}catch(g){be(s,s.return,g)}}}else if(t.tag===6){if(n===null){s=t;try{s.stateNode.nodeValue=l?"":s.memoizedProps}catch(g){be(s,s.return,g)}}}else if(t.tag===18){if(n===null){s=t;try{var p=s.stateNode;l?wm(p,!0):wm(s.stateNode,!1)}catch(g){be(s,s.return,g)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Ar(e,n))));break;case 19:Kt(t,e),jt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ar(e,a)));break;case 30:break;case 21:break;default:Kt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Dg(a)){n=a;break}a=a.return}if(n==null)throw Error(x(160));switch(n.tag){case 27:var l=n.stateNode,o=au(e);ms(e,o,l);break;case 5:var i=n.stateNode;n.flags&32&&(wo(i,""),n.flags&=-33);var r=au(e);ms(e,r,i);break;case 3:case 4:var s=n.stateNode.containerInfo,c=au(e);Vu(e,c,s);break;default:throw Error(x(161))}}catch(d){be(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function In(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eg(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xa(4,t,t.return),gl(t);break;case 1:Hn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==="function"&&xg(t,t.return,n),gl(t);break;case 27:Ei(t.stateNode);case 26:case 5:Hn(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function Fn(e,t,n){n=n&&(t.subtreeFlags&8772)!==0;for(t=t.child;t!==null;){var a=t.alternate,l=e,o=t,i=o.flags;switch(o.tag){case 0:case 11:case 15:Fn(l,o,n),Wi(4,o);break;case 1:if(Fn(l,o,n),a=o,l=a.stateNode,typeof l.componentDidMount==="function")try{l.componentDidMount()}catch(c){be(a,a.return,c)}if(a=o,l=a.updateQueue,l!==null){var r=a.stateNode;try{var s=l.shared.hiddenCallbacks;if(s!==null)for(l.shared.hiddenCallbacks=null,l=0;l<s.length;l++)Rh(s[l],r)}catch(c){be(a,a.return,c)}}n&&i&64&&Mg(o),xi(o,o.return);break;case 27:Og(o);case 26:case 5:Fn(l,o,n),n&&a===null&&i&4&&kg(o),xi(o,o.return);break;case 12:Fn(l,o,n);break;case 31:Fn(l,o,n),n&&i&4&&Rg(l,o);break;case 13:Fn(l,o,n),n&&i&4&&Cg(l,o);break;case 22:o.memoizedState===null&&Fn(l,o,n),xi(o,o.return);break;case 30:break;default:Fn(l,o,n)}t=t.sibling}}function Xd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Zi(n))}function Qd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e))}function Dn(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_g(e,t,n,a),t=t.sibling}function _g(e,t,n,a){var l=t.flags;switch(t.tag){case 0:case 11:case 15:Dn(e,t,n,a),l&2048&&Wi(9,t);break;case 1:Dn(e,t,n,a);break;case 3:Dn(e,t,n,a),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e)));break;case 12:if(l&2048){Dn(e,t,n,a),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,r=o.onPostCommit;typeof r==="function"&&r(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){be(t,t.return,s)}}else Dn(e,t,n,a);break;case 31:Dn(e,t,n,a);break;case 13:Dn(e,t,n,a);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?Dn(e,t,n,a):ki(e,t):o._visibility&2?Dn(e,t,n,a):(o._visibility|=2,Wl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),l&2048&&Xd(i,t);break;case 24:Dn(e,t,n,a),l&2048&&Qd(t.alternate,t);break;default:Dn(e,t,n,a)}}function Wl(e,t,n,a,l){l=l&&((t.subtreeFlags&10256)!==0||!1);for(t=t.child;t!==null;){var o=e,i=t,r=n,s=a,c=i.flags;switch(i.tag){case 0:case 11:case 15:Wl(o,i,r,s,l),Wi(8,i);break;case 23:break;case 22:var d=i.stateNode;i.memoizedState!==null?d._visibility&2?Wl(o,i,r,s,l):ki(o,i):(d._visibility|=2,Wl(o,i,r,s,l)),l&&c&2048&&Xd(i.alternate,i);break;case 24:Wl(o,i,r,s,l),l&&c&2048&&Qd(i.alternate,i);break;default:Wl(o,i,r,s,l)}t=t.sibling}}function ki(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,l=a.flags;switch(a.tag){case 22:ki(n,a),l&2048&&Xd(a.alternate,a);break;case 24:ki(n,a),l&2048&&Qd(a.alternate,a);break;default:ki(n,a)}t=t.sibling}}var fi=8192;function Jl(e,t,n){if(e.subtreeFlags&fi)for(e=e.child;e!==null;)Lg(e,t,n),e=e.sibling}function Lg(e,t,n){switch(e.tag){case 26:Jl(e,t,n),e.flags&fi&&e.memoizedState!==null&&Cw(n,On,e.memoizedState,e.memoizedProps);break;case 5:Jl(e,t,n);break;case 3:case 4:var a=On;On=Ms(e.stateNode.containerInfo),Jl(e,t,n),On=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fi,fi=16777216,Jl(e,t,n),fi=a):Jl(e,t,n));break;default:Jl(e,t,n)}}function Kg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];mt=a,Bg(a,e)}Kg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jg(e),e=e.sibling}function jg(e){switch(e.tag){case 0:case 11:case 15:li(e),e.flags&2048&&Xa(9,e,e.return);break;case 3:li(e);break;case 12:li(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qr(e)):li(e);break;default:li(e)}}function Qr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];mt=a,Bg(a,e)}Kg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xa(8,t,t.return),Qr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qr(t));break;default:Qr(t)}e=e.sibling}}function Bg(e,t){for(;mt!==null;){var n=mt;switch(n.tag){case 0:case 11:case 15:Xa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Zi(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,mt=a;else e:for(n=e;mt!==null;){a=mt;var{sibling:l,return:o}=a;if(Ng(a),a===n){mt=null;break e}if(l!==null){l.return=o,mt=l;break e}mt=o}}}var Z1={getCacheForType:function(e){var t=wt(nt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wt(nt).controller.signal}},J1=typeof WeakMap==="function"?WeakMap:Map,fe=0,Ee=null,le=null,oe=0,ve=0,Qt=null,Aa=!1,_o=!1,Zd=!1,fa=0,Xe=0,Qa=0,wl=0,Jd=0,Wt=0,Do=0,Di=null,Ut=null,Xu=!1,Bs=0,Ug=0,hs=1/0,gs=null,Ua=null,rt=0,Ha=null,Oo=null,ra=0,Qu=0,Zu=null,Hg=null,Oi=0,Ju=null;function en(){return(fe&2)!==0&&oe!==0?oe&-oe:U.T!==null?Pd():Jm()}function $g(){if(Wt===0)if((oe&536870912)===0||re){var e=kr;kr<<=1,(kr&3932160)===0&&(kr=262144),Wt=e}else Wt=536870912;return e=nn.current,e!==null&&(e.flags|=32),Wt}function Ht(e,t,n){if(e===Ee&&(ve===2||ve===9)||e.cancelPendingCommit!==null)Eo(e,0),za(e,oe,Wt,!1);if(Vi(e,n),(fe&2)===0||e!==Ee)e===Ee&&((fe&2)===0&&(wl|=n),Xe===4&&za(e,oe,Wt,!1)),Gn(e)}function qg(e,t,n){if((fe&6)!==0)throw Error(x(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Yi(e,t),l=a?I1(e,t):ou(e,t,!0),o=a;do{if(l===0){_o&&!a&&za(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!W1(n)){l=ou(e,t,!1),o=!1;continue}if(l===2){if(o=t,e.errorRecoveryDisabledLanes&o)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var r=e;l=Di;var s=r.current.memoizedState.isDehydrated;if(s&&(Eo(r,i).flags|=256),i=ou(r,i,!1),i!==2){if(Zd&&!s){r.errorRecoveryDisabledLanes|=o,wl|=o,l=4;break e}o=Ut,Ut=l,o!==null&&(Ut===null?Ut=o:Ut.push.apply(Ut,o))}l=i}if(o=!1,l!==2)continue}}if(l===1){Eo(e,0),za(e,t,0,!0);break}e:{switch(a=e,o=l,o){case 0:case 1:throw Error(x(345));case 4:if((t&4194048)!==t)break;case 6:za(a,t,Wt,!Aa);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(x(329))}if((t&62914560)===t&&(l=Bs+300-Pt(),10<l)){if(za(a,t,Wt,!Aa),Es(a,0,!0)!==0)break e;ra=t,a.timeoutHandle=sv(sm.bind(null,a,n,Ut,gs,Xu,t,Wt,wl,Do,Aa,o,"Throttled",-0,0),l);break e}sm(a,n,Ut,gs,Xu,t,Wt,wl,Do,Aa,o,null,-0,0)}}break}while(1);Gn(e)}function sm(e,t,n,a,l,o,i,r,s,c,d,h,u,p){if(e.timeoutHandle=-1,h=t.subtreeFlags,h&8192||(h&16785408)===16785408){h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:aa},Lg(t,o,h);var g=(o&62914560)===o?Bs-Pt():(o&4194048)===o?Ug-Pt():0;if(g=Aw(h,g),g!==null){ra=o,e.cancelPendingCommit=g(um.bind(null,e,t,o,n,a,l,i,r,s,d,h,null,u,p)),za(e,o,i,!c);return}}um(e,t,o,n,a,l,i,r,s)}function W1(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var l=n[a],o=l.getSnapshot;l=l.value;try{if(!tn(o(),l))return!1}catch(i){return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 za(e,t,n,a){t&=~Jd,t&=~wl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var l=t;0<l;){var o=31-Ft(l),i=1<<o;a[o]=-1,l&=~i}n!==0&&Xm(e,n,t)}function Us(){return(fe&6)===0?(Pi(0,!1),!1):!0}function Wd(){if(le!==null){if(ve===0)var e=le.return;else e=le,la=Cl=null,Ld(e),go=null,_i=0,e=le;for(;e!==null;)wg(e.alternate,e),e=e.return;le=null}}function Eo(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,mw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ra=0,Wd(),Ee=e,le=n=oa(e.current,null),oe=t,ve=0,Qt=null,Aa=!1,_o=Yi(e,t),Zd=!1,Do=Wt=Jd=wl=Qa=Xe=0,Ut=Di=null,Xu=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-Ft(a),o=1<<l;t|=e[l],a&=~o}return fa=t,Cs(),n}function Gg(e,t){J=null,U.H=Ki,t===zo||t===zs?(t=Hp(),ve=3):t===Nd?(t=Hp(),ve=4):ve=t===Yd?8:t!==null&&typeof t==="object"&&typeof t.then==="function"?6:1,Qt=t,le===null&&(Xe=1,fs(e,pn(t,e.current)))}function Yg(){var e=nn.current;return e===null?!0:(oe&4194048)===oe?hn===null?!0:!1:(oe&62914560)===oe||(oe&536870912)!==0?e===hn:!1}function Vg(){var e=U.H;return U.H=Ki,e===null?Ki:e}function Xg(){var e=U.A;return U.A=Z1,e}function vs(){Xe=4,Aa||(oe&4194048)!==oe&&nn.current!==null||(_o=!0),(Qa&134217727)===0&&(wl&134217727)===0||Ee===null||za(Ee,oe,Wt,!1)}function ou(e,t,n){var a=fe;fe|=2;var l=Vg(),o=Xg();if(Ee!==e||oe!==t)gs=null,Eo(e,t);t=!1;var i=Xe;e:do try{if(ve!==0&&le!==null){var r=le,s=Qt;switch(ve){case 8:Wd(),i=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(t=!0);var c=ve;if(ve=0,Qt=null,uo(e,r,s,c),n&&_o){i=0;break e}break;default:c=ve,ve=0,Qt=null,uo(e,r,s,c)}}P1(),i=Xe;break}catch(d){Gg(e,d)}while(1);return t&&e.shellSuspendCounter++,la=Cl=null,fe=a,U.H=l,U.A=o,le===null&&(Ee=null,oe=0,Cs()),i}function P1(){for(;le!==null;)Qg(le)}function I1(e,t){var n=fe;fe|=2;var a=Vg(),l=Xg();Ee!==e||oe!==t?(gs=null,hs=Pt()+500,Eo(e,t)):_o=Yi(e,t);e:do try{if(ve!==0&&le!==null){t=le;var o=Qt;t:switch(ve){case 1:ve=0,Qt=null,uo(e,t,o,1);break;case 2:case 9:if(Up(o)){ve=0,Qt=null,cm(t);break}t=function(){ve!==2&&ve!==9||Ee!==e||(ve=7),Gn(e)},o.then(t,t);break e;case 3:ve=7;break e;case 4:ve=5;break e;case 7:Up(o)?(ve=0,Qt=null,cm(t)):(ve=0,Qt=null,uo(e,t,o,7));break;case 5:var i=null;switch(le.tag){case 26:i=le.memoizedState;case 5:case 27:var r=le;if(i?pv(i):r.stateNode.complete){ve=0,Qt=null;var s=r.sibling;if(s!==null)le=s;else{var c=r.return;c!==null?(le=c,Hs(c)):le=null}break t}}ve=0,Qt=null,uo(e,t,o,5);break;case 6:ve=0,Qt=null,uo(e,t,o,6);break;case 8:Wd(),Xe=6;break e;default:throw Error(x(462))}}F1();break}catch(d){Gg(e,d)}while(1);if(la=Cl=null,U.H=a,U.A=l,fe=n,le!==null)return 0;return Ee=null,oe=0,Cs(),Xe}function F1(){for(;le!==null&&!MS();)Qg(le)}function Qg(e){var t=Sg(e.alternate,e,fa);e.memoizedProps=e.pendingProps,t===null?Hs(e):le=t}function cm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=nm(n,t,t.pendingProps,t.type,void 0,oe);break;case 11:t=nm(n,t,t.pendingProps,t.type.render,t.ref,oe);break;case 5:Ld(t);default:wg(n,t),t=le=wh(t,fa),t=Sg(n,t,fa)}e.memoizedProps=e.pendingProps,t===null?Hs(e):le=t}function uo(e,t,n,a){la=Cl=null,Ld(t),go=null,_i=0;var l=t.return;try{if($1(e,l,t,n,oe)){Xe=1,fs(e,pn(n,e.current)),le=null;return}}catch(o){if(l!==null)throw le=l,o;Xe=1,fs(e,pn(n,e.current)),le=null;return}if(t.flags&32768){if(re||a===1)e=!0;else if(_o||(oe&536870912)!==0)e=!1;else if(Aa=e=!0,a===2||a===9||a===3||a===6)a=nn.current,a!==null&&a.tag===13&&(a.flags|=16384);Zg(t,e)}else Hs(t)}function Hs(e){var t=e;do{if((t.flags&32768)!==0){Zg(t,Aa);return}e=t.return;var n=Y1(t.alternate,t,fa);if(n!==null){le=n;return}if(t=t.sibling,t!==null){le=t;return}le=t=e}while(t!==null);Xe===0&&(Xe=5)}function Zg(e,t){do{var n=V1(e.alternate,e);if(n!==null){n.flags&=32767,le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){le=e;return}le=e=n}while(e!==null);Xe=6,le=null}function um(e,t,n,a,l,o,i,r,s){e.cancelPendingCommit=null;do $s();while(rt!==0);if((fe&6)!==0)throw Error(x(327));if(t!==null){if(t===e.current)throw Error(x(177));if(o=t.lanes|t.childLanes,o|=wd,AS(e,n,o,i,r,s),e===Ee&&(le=Ee=null,oe=0),Oo=t,Ha=e,ra=n,Qu=o,Zu=l,Hg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,aw(ts,function(){return Fg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null,l=pe.p,pe.p=2,i=fe,fe|=4;try{X1(e,t,n)}finally{fe=i,pe.p=l,U.T=a}}rt=1,Jg(),Wg(),Pg()}}function Jg(){if(rt===1){rt=0;var e=Ha,t=Oo,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var a=pe.p;pe.p=2;var l=fe;fe|=4;try{Ag(t,e);var o=td,i=ph(e.containerInfo),r=o.focusedElem,s=o.selectionRange;if(i!==r&&r&&r.ownerDocument&&fh(r.ownerDocument.documentElement,r)){if(s!==null&&Sd(r)){var{start:c,end:d}=s;if(d===void 0&&(d=c),"selectionStart"in r)r.selectionStart=c,r.selectionEnd=Math.min(d,r.value.length);else{var h=r.ownerDocument||document,u=h&&h.defaultView||window;if(u.getSelection){var p=u.getSelection(),g=r.textContent.length,b=Math.min(s.start,g),y=s.end===void 0?b:Math.min(s.end,g);!p.extend&&b>y&&(i=y,y=b,b=i);var m=Ap(r,b),f=Ap(r,y);if(m&&f&&(p.rangeCount!==1||p.anchorNode!==m.node||p.anchorOffset!==m.offset||p.focusNode!==f.node||p.focusOffset!==f.offset)){var v=h.createRange();v.setStart(m.node,m.offset),p.removeAllRanges(),b>y?(p.addRange(v),p.extend(f.node,f.offset)):(v.setEnd(f.node,f.offset),p.addRange(v))}}}}h=[];for(p=r;p=p.parentNode;)p.nodeType===1&&h.push({element:p,left:p.scrollLeft,top:p.scrollTop});typeof r.focus==="function"&&r.focus();for(r=0;r<h.length;r++){var w=h[r];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Ds=!!ed,td=ed=null}finally{fe=l,pe.p=a,U.T=n}}e.current=t,rt=2}}function Wg(){if(rt===2){rt=0;var e=Ha,t=Oo,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var a=pe.p;pe.p=2;var l=fe;fe|=4;try{Eg(e,t.alternate,t)}finally{fe=l,pe.p=a,U.T=n}}rt=3}}function Pg(){if(rt===4||rt===3){rt=0,xS();var e=Ha,t=Oo,n=ra,a=Hg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?rt=5:(rt=0,Oo=Ha=null,Ig(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Ua=null),pd(n),t=t.stateNode,It&&typeof It.onCommitFiberRoot==="function")try{It.onCommitFiberRoot(Gi,t,void 0,(t.current.flags&128)===128)}catch(s){}if(a!==null){t=U.T,l=pe.p,pe.p=2,U.T=null;try{for(var o=e.onRecoverableError,i=0;i<a.length;i++){var r=a[i];o(r.value,{componentStack:r.stack})}}finally{U.T=t,pe.p=l}}(ra&3)!==0&&$s(),Gn(e),l=e.pendingLanes,(n&261930)!==0&&(l&42)!==0?e===Ju?Oi++:(Oi=0,Ju=e):Oi=0,Pi(0,!1)}}function Ig(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Zi(t)))}function $s(){return Jg(),Wg(),Pg(),Fg()}function Fg(){if(rt!==5)return!1;var e=Ha,t=Qu;Qu=0;var n=pd(ra),a=U.T,l=pe.p;try{pe.p=32>n?32:n,U.T=null,n=Zu,Zu=null;var o=Ha,i=ra;if(rt=0,Oo=Ha=null,ra=0,(fe&6)!==0)throw Error(x(331));var r=fe;if(fe|=4,jg(o.current),_g(o,o.current,i,n),fe=r,Pi(0,!1),It&&typeof It.onPostCommitFiberRoot==="function")try{It.onPostCommitFiberRoot(Gi,o)}catch(s){}return!0}finally{pe.p=l,U.T=a,Ig(e,t)}}function dm(e,t,n){t=pn(n,t),t=qu(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Vi(e,2),Gn(e))}function be(e,t,n){if(e.tag===3)dm(e,e,n);else for(;t!==null;){if(t.tag===3){dm(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError==="function"||typeof a.componentDidCatch==="function"&&(Ua===null||!Ua.has(a))){e=pn(n,e),n=mg(2),a=Ba(t,n,2),a!==null&&(hg(n,a,t,e),Vi(a,2),Gn(a));break}}t=t.return}}function iu(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new J1;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(Zd=!0,l.add(n),e=ew.bind(null,e,t,n),t.then(e,e))}function ew(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ee===e&&(oe&n)===n&&(Xe===4||Xe===3&&(oe&62914560)===oe&&300>Pt()-Bs?(fe&2)===0&&Eo(e,0):Jd|=n,Do===oe&&(Do=0)),Gn(e)}function ev(e,t){t===0&&(t=Vm()),e=Rl(e,t),e!==null&&(Vi(e,t),Gn(e))}function tw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ev(e,n)}function nw(e,t){var n=0;switch(e.tag){case 31:case 13:var{stateNode:a,memoizedState:l}=e;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(x(314))}a!==null&&a.delete(t),ev(e,n)}function aw(e,t){return dd(e,t)}var bs=null,Pl=null,Wu=!1,ys=!1,ru=!1,_a=0;function Gn(e){e!==Pl&&e.next===null&&(Pl===null?bs=Pl=e:Pl=Pl.next=e),ys=!0,Wu||(Wu=!0,ow())}function Pi(e,t){if(!ru&&ys){ru=!0;do{var n=!1;for(var a=bs;a!==null;){if(!t)if(e!==0){var l=a.pendingLanes;if(l===0)var o=0;else{var{suspendedLanes:i,pingedLanes:r}=a;o=(1<<31-Ft(42|e)+1)-1,o&=l&~(i&~r),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,fm(a,o))}else o=oe,o=Es(a,a===Ee?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||Yi(a,o)||(n=!0,fm(a,o));a=a.next}}while(n);ru=!1}}function lw(){tv()}function tv(){ys=Wu=!1;var e=0;_a!==0&&pw()&&(e=_a);for(var t=Pt(),n=null,a=bs;a!==null;){var l=a.next,o=nv(a,t);if(o===0)a.next=null,n===null?bs=l:n.next=l,l===null&&(Pl=n);else if(n=a,e!==0||(o&3)!==0)ys=!0;a=l}rt!==0&&rt!==5||Pi(e,!1),_a!==0&&(_a=0)}function nv(e,t){for(var{suspendedLanes:n,pingedLanes:a,expirationTimes:l}=e,o=e.pendingLanes&-62914561;0<o;){var i=31-Ft(o),r=1<<i,s=l[i];if(s===-1){if((r&n)===0||(r&a)!==0)l[i]=CS(r,t)}else s<=t&&(e.expiredLanes|=r);o&=~r}if(t=Ee,n=oe,n=Es(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(ve===2||ve===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&jc(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Yi(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&jc(a),pd(n)){case 2:case 8:n=Gm;break;case 32:n=ts;break;case 268435456:n=Ym;break;default:n=ts}return a=av.bind(null,e),n=dd(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&jc(a),e.callbackPriority=2,e.callbackNode=null,2}function av(e,t){if(rt!==0&&rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($s()&&e.callbackNode!==n)return null;var a=oe;if(a=Es(e,e===Ee?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0)return null;return qg(e,a,t),nv(e,Pt()),e.callbackNode!=null&&e.callbackNode===n?av.bind(null,e):null}function fm(e,t){if($s())return null;qg(e,t,!0)}function ow(){hw(function(){(fe&6)!==0?dd(qm,lw):tv()})}function Pd(){if(_a===0){var e=Mo;e===0&&(e=xr,xr<<=1,(xr&261888)===0&&(xr=256)),_a=e}return _a}function pm(e){return e==null||typeof e==="symbol"||typeof e==="boolean"?null:typeof e==="function"?e:jr(""+e)}function mm(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function iw(e,t,n,a,l){if(t==="submit"&&n&&n.stateNode===l){var o=pm((l[$t]||null).action),i=a.submitter;i&&(t=(t=i[$t]||null)?pm(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var r=new Ns("action","action",null,a,l);e.push({event:r,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(_a!==0){var s=i?mm(l,i):new FormData(l);Hu(n,{pending:!0,data:s,method:l.method,action:o},null,s)}}else typeof o==="function"&&(r.preventDefault(),s=i?mm(l,i):new FormData(l),Hu(n,{pending:!0,data:s,method:l.method,action:o},o,s))},currentTarget:l}]})}}for(pi=0;pi<Nu.length;pi++)mi=Nu[pi],Pu=mi.toLowerCase(),Iu=mi[0].toUpperCase()+mi.slice(1),En(Pu,"on"+Iu);var mi,Pu,Iu,pi;En(hh,"onAnimationEnd");En(gh,"onAnimationIteration");En(vh,"onAnimationStart");En("dblclick","onDoubleClick");En("focusin","onFocus");En("focusout","onBlur");En(k1,"onTransitionRun");En(D1,"onTransitionStart");En(O1,"onTransitionCancel");En(bh,"onTransitionEnd");So("onMouseEnter",["mouseout","mouseover"]);So("onMouseLeave",["mouseout","mouseover"]);So("onPointerEnter",["pointerout","pointerover"]);So("onPointerLeave",["pointerout","pointerover"]);El("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));El("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));El("onBeforeInput",["compositionend","keypress","textInput","paste"]);El("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));El("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));El("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ji="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(" "),rw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ji));function lv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],l=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var i=a.length-1;0<=i;i--){var r=a[i],s=r.instance,c=r.currentTarget;if(r=r.listener,s!==o&&l.isPropagationStopped())break e;o=r,l.currentTarget=c;try{o(l)}catch(d){as(d)}l.currentTarget=null,o=s}else for(i=0;i<a.length;i++){if(r=a[i],s=r.instance,c=r.currentTarget,r=r.listener,s!==o&&l.isPropagationStopped())break e;o=r,l.currentTarget=c;try{o(l)}catch(d){as(d)}l.currentTarget=null,o=s}}}}function ae(e,t){var n=t[Su];n===void 0&&(n=t[Su]=new Set);var a=e+"__bubble";n.has(a)||(ov(t,e,2,!1),n.add(a))}function su(e,t,n){var a=0;t&&(a|=4),ov(n,e,a,t)}var zr="_reactListening"+Math.random().toString(36).slice(2);function Id(e){if(!e[zr]){e[zr]=!0,Wm.forEach(function(n){n!=="selectionchange"&&(rw.has(n)||su(n,!1,e),su(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zr]||(t[zr]=!0,su("selectionchange",!1,t))}}function ov(e,t,n,a){switch(bv(t)){case 2:var l=Lw;break;case 8:l=Kw;break;default:l=nf}n=l.bind(null,t,n,e),l=void 0,!Du||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),a?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function cu(e,t,n,a,l){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var r=a.stateNode.containerInfo;if(r===l)break;if(i===4)for(i=a.return;i!==null;){var s=i.tag;if((s===3||s===4)&&i.stateNode.containerInfo===l)return;i=i.return}for(;r!==null;){if(i=to(r),i===null)return;if(s=i.tag,s===5||s===6||s===26||s===27){a=o=i;continue e}r=r.parentNode}}a=a.return}lh(function(){var c=o,d=gd(n),h=[];e:{var u=yh.get(e);if(u!==void 0){var p=Ns,g=e;switch(e){case"keypress":if(Ur(n)===0)break e;case"keydown":case"keyup":p=n1;break;case"focusin":g="focus",p=qc;break;case"focusout":g="blur",p=qc;break;case"beforeblur":case"afterblur":p=qc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=xp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=YS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=o1;break;case hh:case gh:case vh:p=QS;break;case bh:p=r1;break;case"scroll":case"scrollend":p=qS;break;case"wheel":p=c1;break;case"copy":case"cut":case"paste":p=JS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Dp;break;case"toggle":case"beforetoggle":p=d1}var b=(t&4)!==0,y=!b&&(e==="scroll"||e==="scrollend"),m=b?u!==null?u+"Capture":null:u;b=[];for(var f=c,v;f!==null;){var w=f;if(v=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||v===null||m===null||(w=Ti(f,m),w!=null&&b.push(Bi(f,w,v))),y)break;f=f.return}0<b.length&&(u=new p(u,g,null,n,d),h.push({event:u,listeners:b}))}}if((t&7)===0){e:{if(u=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",u&&n!==ku&&(g=n.relatedTarget||n.fromElement)&&(to(g)||g[Ro]))break e;if(p||u){if(u=d.window===d?d:(u=d.ownerDocument)?u.defaultView||u.parentWindow:window,p){if(g=n.relatedTarget||n.toElement,p=c,g=g?to(g):null,g!==null&&(y=qi(g),b=g.tag,g!==y||b!==5&&b!==27&&b!==6))g=null}else p=null,g=c;if(p!==g){if(b=xp,w="onMouseLeave",m="onMouseEnter",f="mouse",e==="pointerout"||e==="pointerover")b=Dp,w="onPointerLeave",m="onPointerEnter",f="pointer";if(y=p==null?u:si(p),v=g==null?u:si(g),u=new b(w,f+"leave",p,n,d),u.target=y,u.relatedTarget=v,w=null,to(d)===c&&(b=new b(m,f+"enter",g,n,d),b.target=v,b.relatedTarget=y,w=b),y=w,p&&g)t:{b=sw,m=p,f=g,v=0;for(w=m;w;w=b(w))v++;w=0;for(var D=f;D;D=b(D))w++;for(;0<v-w;)m=b(m),v--;for(;0<w-v;)f=b(f),w--;for(;v--;){if(m===f||f!==null&&m===f.alternate){b=m;break t}m=b(m),f=b(f)}b=null}else b=null;p!==null&&hm(h,u,p,b,!1),g!==null&&y!==null&&hm(h,y,g,b,!0)}}}e:{if(u=c?si(c):window,p=u.nodeName&&u.nodeName.toLowerCase(),p==="select"||p==="input"&&u.type==="file")var z=Tp;else if(Np(u))if(uh)z=w1;else{z=y1;var E=b1}else p=u.nodeName,!p||p.toLowerCase()!=="input"||u.type!=="checkbox"&&u.type!=="radio"?c&&hd(c.elementType)&&(z=Tp):z=S1;if(z&&(z=z(e,c))){ch(h,z,n,d);break e}E&&E(e,u,c),e==="focusout"&&c&&u.type==="number"&&c.memoizedProps.value!=null&&xu(u,"number",u.value)}switch(E=c?si(c):window,e){case"focusin":if(Np(E)||E.contentEditable==="true")lo=E,Ou=c,vi=null;break;case"focusout":vi=Ou=lo=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,zp(h,n,d);break;case"selectionchange":if(x1)break;case"keydown":case"keyup":zp(h,n,d)}var O;if(yd)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else ao?rh(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");if(A&&(ih&&n.locale!=="ko"&&(ao||A!=="onCompositionStart"?A==="onCompositionEnd"&&ao&&(O=oh()):(Ca=d,vd=("value"in Ca)?Ca.value:Ca.textContent,ao=!0)),E=Ss(c,A),0<E.length&&(A=new kp(A,e,null,n,d),h.push({event:A,listeners:E}),O?A.data=O:(O=sh(n),O!==null&&(A.data=O)))),O=p1?m1(e,n):h1(e,n))A=Ss(c,"onBeforeInput"),0<A.length&&(E=new kp("onBeforeInput","beforeinput",null,n,d),h.push({event:E,listeners:A}),E.data=O);iw(h,e,c,n,d)}lv(h,t)})}function Bi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ss(e,t){for(var n=t+"Capture",a=[];e!==null;){var l=e,o=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||o===null||(l=Ti(e,n),l!=null&&a.unshift(Bi(e,l,o)),l=Ti(e,t),l!=null&&a.push(Bi(e,l,o))),e.tag===3)return a;e=e.return}return[]}function sw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e?e:null}function hm(e,t,n,a,l){for(var o=t._reactName,i=[];n!==null&&n!==a;){var r=n,s=r.alternate,c=r.stateNode;if(r=r.tag,s!==null&&s===a)break;r!==5&&r!==26&&r!==27||c===null||(s=c,l?(c=Ti(n,o),c!=null&&i.unshift(Bi(n,c,s))):l||(c=Ti(n,o),c!=null&&i.push(Bi(n,c,s)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var cw=/\r\n?/g,uw=/\u0000|\uFFFD/g;function gm(e){return(typeof e==="string"?e:""+e).replace(cw,`
9
- `).replace(uw,"")}function iv(e,t){return t=gm(t),gm(e)===t?!0:!1}function Se(e,t,n,a,l,o){switch(n){case"children":typeof a==="string"?t==="body"||t==="textarea"&&a===""||wo(e,a):(typeof a==="number"||typeof a==="bigint")&&t!=="body"&&wo(e,""+a);break;case"className":Or(e,"class",a);break;case"tabIndex":Or(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Or(e,n,a);break;case"style":ah(e,a,o);break;case"data":if(t!=="object"){Or(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a==="function"||typeof a==="symbol"||typeof a==="boolean"){e.removeAttribute(n);break}a=jr(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a==="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o==="function"&&(n==="formAction"?(t!=="input"&&Se(e,t,"name",l.name,l,null),Se(e,t,"formEncType",l.formEncType,l,null),Se(e,t,"formMethod",l.formMethod,l,null),Se(e,t,"formTarget",l.formTarget,l,null)):(Se(e,t,"encType",l.encType,l,null),Se(e,t,"method",l.method,l,null),Se(e,t,"target",l.target,l,null)));if(a==null||typeof a==="symbol"||typeof a==="boolean"){e.removeAttribute(n);break}a=jr(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=aa);break;case"onScroll":a!=null&&ae("scroll",e);break;case"onScrollEnd":a!=null&&ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!=="object"||!("__html"in a))throw Error(x(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(x(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!=="function"&&typeof a!=="symbol";break;case"muted":e.muted=a&&typeof a!=="function"&&typeof a!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a==="function"||typeof a==="boolean"||typeof a==="symbol"){e.removeAttribute("xlink:href");break}n=jr(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!=="function"&&typeof a!=="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!=="function"&&typeof a!=="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!=="function"&&typeof a!=="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!=="function"&&typeof a!=="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a==="function"||typeof a==="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":ae("beforetoggle",e),ae("toggle",e),Kr(e,"popover",a);break;case"xlinkActuate":Jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Jn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Jn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Jn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Jn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Kr(e,"is",a);break;case"innerText":case"textContent":break;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=HS.get(n)||n,Kr(e,n,a)}}function Fu(e,t,n,a,l,o){switch(n){case"style":ah(e,a,o);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!=="object"||!("__html"in a))throw Error(x(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(x(60));e.innerHTML=n}}break;case"children":typeof a==="string"?wo(e,a):(typeof a==="number"||typeof a==="bigint")&&wo(e,""+a);break;case"onScroll":a!=null&&ae("scroll",e);break;case"onScrollEnd":a!=null&&ae("scrollend",e);break;case"onClick":a!=null&&(e.onclick=aa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),o=e[$t]||null,o=o!=null?o[n]:null,typeof o==="function"&&e.removeEventListener(t,o,l),typeof a==="function")){typeof o!=="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,l);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Kr(e,n,a)}}}function Mt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ae("error",e),ae("load",e);var a=!1,l=!1,o;for(o in n)if(n.hasOwnProperty(o)){var i=n[o];if(i!=null)switch(o){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(x(137,t));default:Se(e,t,o,i,n,null)}}l&&Se(e,t,"srcSet",n.srcSet,n,null),a&&Se(e,t,"src",n.src,n,null);return;case"input":ae("invalid",e);var r=o=i=l=null,s=null,c=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(d!=null)switch(a){case"name":l=d;break;case"type":i=d;break;case"checked":s=d;break;case"defaultChecked":c=d;break;case"value":o=d;break;case"defaultValue":r=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(x(137,t));break;default:Se(e,t,a,d,n,null)}}eh(e,o,r,s,c,i,l,!1);return;case"select":ae("invalid",e),a=i=o=null;for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"value":o=r;break;case"defaultValue":i=r;break;case"multiple":a=r;default:Se(e,t,l,r,n,null)}t=o,n=i,e.multiple=!!a,t!=null?po(e,!!a,t,!1):n!=null&&po(e,!!a,n,!0);return;case"textarea":ae("invalid",e),o=l=a=null;for(i in n)if(n.hasOwnProperty(i)&&(r=n[i],r!=null))switch(i){case"value":a=r;break;case"defaultValue":l=r;break;case"children":o=r;break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(x(91));break;default:Se(e,t,i,r,n,null)}nh(e,a,l,o);return;case"option":for(s in n)if(n.hasOwnProperty(s)&&(a=n[s],a!=null))switch(s){case"selected":e.selected=a&&typeof a!=="function"&&typeof a!=="symbol";break;default:Se(e,t,s,a,n,null)}return;case"dialog":ae("beforetoggle",e),ae("toggle",e),ae("cancel",e),ae("close",e);break;case"iframe":case"object":ae("load",e);break;case"video":case"audio":for(a=0;a<ji.length;a++)ae(ji[a],e);break;case"image":ae("error",e),ae("load",e);break;case"details":ae("toggle",e);break;case"embed":case"source":case"link":ae("error",e),ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(a=n[c],a!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(x(137,t));default:Se(e,t,c,a,n,null)}return;default:if(hd(t)){for(d in n)n.hasOwnProperty(d)&&(a=n[d],a!==void 0&&Fu(e,t,d,a,n,void 0));return}}for(r in n)n.hasOwnProperty(r)&&(a=n[r],a!=null&&Se(e,t,r,a,n,null))}function dw(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,o=null,i=null,r=null,s=null,c=null,d=null;for(p in n){var h=n[p];if(n.hasOwnProperty(p)&&h!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":s=h;default:a.hasOwnProperty(p)||Se(e,t,p,null,a,h)}}for(var u in a){var p=a[u];if(h=n[u],a.hasOwnProperty(u)&&(p!=null||h!=null))switch(u){case"type":o=p;break;case"name":l=p;break;case"checked":c=p;break;case"defaultChecked":d=p;break;case"value":i=p;break;case"defaultValue":r=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(x(137,t));break;default:p!==h&&Se(e,t,u,p,a,h)}}Mu(e,i,r,s,c,d,o,l);return;case"select":p=i=r=u=null;for(o in n)if(s=n[o],n.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":p=s;default:a.hasOwnProperty(o)||Se(e,t,o,null,a,s)}for(l in a)if(o=a[l],s=n[l],a.hasOwnProperty(l)&&(o!=null||s!=null))switch(l){case"value":u=o;break;case"defaultValue":r=o;break;case"multiple":i=o;default:o!==s&&Se(e,t,l,o,a,s)}t=r,n=i,a=p,u!=null?po(e,!!n,u,!1):!!a!==!!n&&(t!=null?po(e,!!n,t,!0):po(e,!!n,n?[]:"",!1));return;case"textarea":p=u=null;for(r in n)if(l=n[r],n.hasOwnProperty(r)&&l!=null&&!a.hasOwnProperty(r))switch(r){case"value":break;case"children":break;default:Se(e,t,r,null,a,l)}for(i in a)if(l=a[i],o=n[i],a.hasOwnProperty(i)&&(l!=null||o!=null))switch(i){case"value":u=l;break;case"defaultValue":p=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(x(91));break;default:l!==o&&Se(e,t,i,l,a,o)}th(e,u,p);return;case"option":for(var g in n)if(u=n[g],n.hasOwnProperty(g)&&u!=null&&!a.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:Se(e,t,g,null,a,u)}for(s in a)if(u=a[s],p=n[s],a.hasOwnProperty(s)&&u!==p&&(u!=null||p!=null))switch(s){case"selected":e.selected=u&&typeof u!=="function"&&typeof u!=="symbol";break;default:Se(e,t,s,u,a,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)u=n[b],n.hasOwnProperty(b)&&u!=null&&!a.hasOwnProperty(b)&&Se(e,t,b,null,a,u);for(c in a)if(u=a[c],p=n[c],a.hasOwnProperty(c)&&u!==p&&(u!=null||p!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(x(137,t));break;default:Se(e,t,c,u,a,p)}return;default:if(hd(t)){for(var y in n)u=n[y],n.hasOwnProperty(y)&&u!==void 0&&!a.hasOwnProperty(y)&&Fu(e,t,y,void 0,a,u);for(d in a)u=a[d],p=n[d],!a.hasOwnProperty(d)||u===p||u===void 0&&p===void 0||Fu(e,t,d,u,a,p);return}}for(var m in n)u=n[m],n.hasOwnProperty(m)&&u!=null&&!a.hasOwnProperty(m)&&Se(e,t,m,null,a,u);for(h in a)u=a[h],p=n[h],!a.hasOwnProperty(h)||u===p||u==null&&p==null||Se(e,t,h,u,a,p)}function vm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fw(){if(typeof performance.getEntriesByType==="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var l=n[a],o=l.transferSize,i=l.initiatorType,r=l.duration;if(o&&r&&vm(i)){i=0,r=l.responseEnd;for(a+=1;a<n.length;a++){var s=n[a],c=s.startTime;if(c>r)break;var{transferSize:d,initiatorType:h}=s;d&&vm(h)&&(s=s.responseEnd,i+=d*(s<r?1:(r-c)/(s-c)))}if(--a,t+=8*(o+i)/(l.duration/1000),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==="number")?e:5}var ed=null,td=null;function ws(e){return e.nodeType===9?e:e.ownerDocument}function bm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function nd(e,t){return e==="textarea"||e==="noscript"||typeof t.children==="string"||typeof t.children==="number"||typeof t.children==="bigint"||typeof t.dangerouslySetInnerHTML==="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var uu=null;function pw(){var e=window.event;if(e&&e.type==="popstate"){if(e===uu)return!1;return uu=e,!0}return uu=null,!1}var sv=typeof setTimeout==="function"?setTimeout:void 0,mw=typeof clearTimeout==="function"?clearTimeout:void 0,ym=typeof Promise==="function"?Promise:void 0,hw=typeof queueMicrotask==="function"?queueMicrotask:typeof ym<"u"?function(e){return ym.resolve(null).then(e).catch(gw)}:sv;function gw(e){setTimeout(function(){throw e})}function Ja(e){return e==="head"}function Sm(e,t){var n=t,a=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(l),To(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Ei(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ei(n);for(var o=n.firstChild;o;){var{nextSibling:i,nodeName:r}=o;o[Xi]||r==="SCRIPT"||r==="STYLE"||r==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=i}}else n==="body"&&Ei(e.ownerDocument.body);n=l}while(n);To(t)}function wm(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$")if(e===0)break;else e--;else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function ad(e){var t=e.firstChild;t&&t.nodeType===10&&(t=t.nextSibling);for(;t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ad(n),md(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function vw(e,t,n,a){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(!a)if(t==="input"&&e.type==="hidden"){var o=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;else if(!e[Xi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;else if(o!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}if(e=gn(e.nextSibling),e===null)break}return null}function bw(e,t,n){if(t==="")return null;for(;e.nodeType!==3;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n)return null;if(e=gn(e.nextSibling),e===null)return null}return e}function cv(e,t){for(;e.nodeType!==8;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t)return null;if(e=gn(e.nextSibling),e===null)return null}return e}function ld(e){return e.data==="$?"||e.data==="$~"}function od(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yw(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function gn(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var id=null;function Mm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return gn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function xm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function uv(e,t,n){switch(t=ws(n),e){case"html":if(e=t.documentElement,!e)throw Error(x(452));return e;case"head":if(e=t.head,!e)throw Error(x(453));return e;case"body":if(e=t.body,!e)throw Error(x(454));return e;default:throw Error(x(451))}}function Ei(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);md(e)}var vn=new Map,km=new Set;function Ms(e){return typeof e.getRootNode==="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pa=pe.d;pe.d={f:Sw,r:ww,D:Mw,C:xw,L:kw,m:Dw,X:Ew,S:Ow,M:Nw};function Sw(){var e=pa.f(),t=Us();return e||t}function ww(e){var t=Co(e);t!==null&&t.tag===5&&t.type==="form"?ag(t):pa.r(e)}var Lo=typeof document>"u"?null:document;function dv(e,t,n){var a=Lo;if(a&&typeof t==="string"&&t){var l=fn(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n==="string"&&(l+='[crossorigin="'+n+'"]'),km.has(l)||(km.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),Mt(t,"link",e),ht(t),a.head.appendChild(t)))}}function Mw(e){pa.D(e),dv("dns-prefetch",e,null)}function xw(e,t){pa.C(e,t),dv("preconnect",e,t)}function kw(e,t,n){pa.L(e,t,n);var a=Lo;if(a&&e&&t){var l='link[rel="preload"][as="'+fn(t)+'"]';t==="image"?n&&n.imageSrcSet?(l+='[imagesrcset="'+fn(n.imageSrcSet)+'"]',typeof n.imageSizes==="string"&&(l+='[imagesizes="'+fn(n.imageSizes)+'"]')):l+='[href="'+fn(e)+'"]':l+='[href="'+fn(e)+'"]';var o=l;switch(t){case"style":o=No(e);break;case"script":o=Ko(e)}vn.has(o)||(e=je({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),vn.set(o,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(Ii(o))||t==="script"&&a.querySelector(Fi(o))||(t=a.createElement("link"),Mt(t,"link",e),ht(t),a.head.appendChild(t)))}}function Dw(e,t){pa.m(e,t);var n=Lo;if(n&&e){var a=t&&typeof t.as==="string"?t.as:"script",l='link[rel="modulepreload"][as="'+fn(a)+'"][href="'+fn(e)+'"]',o=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ko(e)}if(!vn.has(o)&&(e=je({rel:"modulepreload",href:e},t),vn.set(o,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Fi(o)))return}a=n.createElement("link"),Mt(a,"link",e),ht(a),n.head.appendChild(a)}}}function Ow(e,t,n){pa.S(e,t,n);var a=Lo;if(a&&e){var l=fo(a).hoistableStyles,o=No(e);t=t||"default";var i=l.get(o);if(!i){var r={loading:0,preload:null};if(i=a.querySelector(Ii(o)))r.loading=5;else{e=je({rel:"stylesheet",href:e,"data-precedence":t},n),(n=vn.get(o))&&Fd(e,n);var s=i=a.createElement("link");ht(s),Mt(s,"link",e),s._p=new Promise(function(c,d){s.onload=c,s.onerror=d}),s.addEventListener("load",function(){r.loading|=1}),s.addEventListener("error",function(){r.loading|=2}),r.loading|=4,Zr(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:r},l.set(o,i)}}}function Ew(e,t){pa.X(e,t);var n=Lo;if(n&&e){var a=fo(n).hoistableScripts,l=Ko(e),o=a.get(l);o||(o=n.querySelector(Fi(l)),o||(e=je({src:e,async:!0},t),(t=vn.get(l))&&ef(e,t),o=n.createElement("script"),ht(o),Mt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function Nw(e,t){pa.M(e,t);var n=Lo;if(n&&e){var a=fo(n).hoistableScripts,l=Ko(e),o=a.get(l);o||(o=n.querySelector(Fi(l)),o||(e=je({src:e,async:!0,type:"module"},t),(t=vn.get(l))&&ef(e,t),o=n.createElement("script"),ht(o),Mt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function Dm(e,t,n,a){var l=(l=La.current)?Ms(l):null;if(!l)throw Error(x(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence==="string"&&typeof n.href==="string"?(t=No(n.href),n=fo(l).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href==="string"&&typeof n.precedence==="string"){e=No(n.href);var o=fo(l).hoistableStyles,i=o.get(e);if(i||(l=l.ownerDocument||l,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=l.querySelector(Ii(e)))&&!o._p&&(i.instance=o,i.state.loading=5),vn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vn.set(e,n),o||Tw(l,e,n,i.state))),t&&a===null)throw Error(x(528,""));return i}if(t&&a!==null)throw Error(x(529,""));return null;case"script":return t=n.async,n=n.src,typeof n==="string"&&t&&typeof t!=="function"&&typeof t!=="symbol"?(t=Ko(n),n=fo(l).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(x(444,e))}}function No(e){return'href="'+fn(e)+'"'}function Ii(e){return'link[rel="stylesheet"]['+e+"]"}function fv(e){return je({},e,{"data-precedence":e.precedence,precedence:null})}function Tw(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Mt(t,"link",n),ht(t),e.head.appendChild(t))}function Ko(e){return'[src="'+fn(e)+'"]'}function Fi(e){return"script[async]"+e}function Om(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+fn(n.href)+'"]');if(a)return t.instance=a,ht(a),a;var l=je({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ht(a),Mt(a,"style",l),Zr(a,n.precedence,e),t.instance=a;case"stylesheet":l=No(n.href);var o=e.querySelector(Ii(l));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;a=fv(n),(l=vn.get(l))&&Fd(a,l),o=(e.ownerDocument||e).createElement("link"),ht(o);var i=o;return i._p=new Promise(function(r,s){i.onload=r,i.onerror=s}),Mt(o,"link",a),t.state.loading|=4,Zr(o,n.precedence,e),t.instance=o;case"script":if(o=Ko(n.src),l=e.querySelector(Fi(o)))return t.instance=l,ht(l),l;if(a=n,l=vn.get(o))a=je({},n),ef(a,l);return e=e.ownerDocument||e,l=e.createElement("script"),ht(l),Mt(l,"link",a),e.head.appendChild(l),t.instance=l;case"void":return null;default:throw Error(x(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Zr(a,n.precedence,e));return t.instance}function Zr(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,o=l,i=0;i<a.length;i++){var r=a[i];if(r.dataset.precedence===t)o=r;else if(o!==l)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ef(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jr=null;function Em(e,t,n){if(Jr===null){var a=new Map,l=Jr=new Map;l.set(n,a)}else l=Jr,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(e))return a;a.set(e,null),n=n.getElementsByTagName(e);for(l=0;l<n.length;l++){var o=n[l];if(!(o[Xi]||o[yt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var r=a.get(i);r?r.push(o):a.set(i,[o])}}return a}function Nm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Rw(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!=="string"||typeof t.href!=="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!=="string"||typeof t.href!=="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence==="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!=="function"&&typeof t.async!=="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==="string")return!0}return!1}function pv(e){return e.type==="stylesheet"&&(e.state.loading&3)===0?!1:!0}function Cw(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!=="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=No(a.href),o=t.querySelector(Ii(l));if(o){t=o._p,t!==null&&typeof t==="object"&&typeof t.then==="function"&&(e.count++,e=xs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,ht(o);return}o=t.ownerDocument||t,a=fv(a),(l=vn.get(l))&&Fd(a,l),o=o.createElement("link"),ht(o);var i=o;i._p=new Promise(function(r,s){i.onload=r,i.onerror=s}),Mt(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=xs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var du=0;function Aw(e,t){return e.stylesheets&&e.count===0&&Wr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Wr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},60000+t);0<e.imgBytes&&du===0&&(du=62500*fw());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Wr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>du?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function xs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ks=null;function Wr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ks=new Map,t.forEach(zw,e),ks=null,xs.call(e))}function zw(e,t){if(!(t.state.loading&4)){var n=ks.get(e);if(n)var a=n.get(null);else{n=new Map,ks.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<l.length;o++){var i=l[o];if(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")n.set(i.dataset.precedence,i),a=i}a&&n.set(null,a)}l=t.instance,i=l.getAttribute("data-precedence"),o=n.get(i)||a,o===a&&n.set(null,l),n.set(i,l),this.count++,a=xs.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),o?o.parentNode.insertBefore(l,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Ui={$$typeof:na,Provider:null,Consumer:null,_currentValue:vl,_currentValue2:vl,_threadCount:0};function _w(e,t,n,a,l,o,i,r,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bc(0),this.hiddenUpdates=Bc(null),this.identifierPrefix=a,this.onUncaughtError=l,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function mv(e,t,n,a,l,o,i,r,s,c,d,h){return e=new _w(e,t,n,i,s,c,d,h,r),t=1,o===!0&&(t|=24),o=Jt(3,null,null,t),e.current=o,o.stateNode=e,t=Od(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},Td(o),e}function hv(e){if(!e)return ro;return e=ro,e}function gv(e,t,n,a,l,o){l=hv(l),a.context===null?a.context=l:a.pendingContext=l,a=ja(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=Ba(e,a,t),n!==null&&(Ht(n,e,t),yi(n,e,t))}function Tm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tf(e,t){Tm(e,t),(e=e.alternate)&&Tm(e,t)}function vv(e){if(e.tag===13||e.tag===31){var t=Rl(e,67108864);t!==null&&Ht(t,e,67108864),tf(e,67108864)}}function Rm(e){if(e.tag===13||e.tag===31){var t=en();t=fd(t);var n=Rl(e,t);n!==null&&Ht(n,e,t),tf(e,t)}}var Ds=!0;function Lw(e,t,n,a){var l=U.T;U.T=null;var o=pe.p;try{pe.p=2,nf(e,t,n,a)}finally{pe.p=o,U.T=l}}function Kw(e,t,n,a){var l=U.T;U.T=null;var o=pe.p;try{pe.p=8,nf(e,t,n,a)}finally{pe.p=o,U.T=l}}function nf(e,t,n,a){if(Ds){var l=rd(a);if(l===null)cu(e,t,a,Os,n),Cm(e,a);else if(Bw(l,e,t,n,a))a.stopPropagation();else if(Cm(e,a),t&4&&-1<jw.indexOf(e)){for(;l!==null;){var o=Co(l);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=pl(o.pendingLanes);if(i!==0){var r=o;r.pendingLanes|=2;for(r.entangledLanes|=2;i;){var s=1<<31-Ft(i);r.entanglements[1]|=s,i&=~s}Gn(o),(fe&6)===0&&(hs=Pt()+500,Pi(0,!1))}}break;case 31:case 13:r=Rl(o,2),r!==null&&Ht(r,o,2),Us(),tf(o,2)}if(o=rd(a),o===null&&cu(e,t,a,Os,n),o===l)break;l=o}l!==null&&a.stopPropagation()}else cu(e,t,a,null,n)}}function rd(e){return e=gd(e),af(e)}var Os=null;function af(e){if(Os=null,e=to(e),e!==null){var t=qi(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=jm(t),e!==null)return e;e=null}else if(n===31){if(e=Bm(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Os=e,null}function bv(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(kS()){case qm:return 2;case Gm:return 8;case ts:case DS:return 32;case Ym:return 268435456;default:return 32}default:return 32}}var sd=!1,$a=null,qa=null,Ga=null,Hi=new Map,$i=new Map,Ta=[],jw="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".split(" ");function Cm(e,t){switch(e){case"focusin":case"focusout":$a=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":Hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(t.pointerId)}}function oi(e,t,n,a,l,o){if(e===null||e.nativeEvent!==o)return e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[l]},t!==null&&(t=Co(t),t!==null&&vv(t)),e;return e.eventSystemFlags|=a,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e}function Bw(e,t,n,a,l){switch(t){case"focusin":return $a=oi($a,e,t,n,a,l),!0;case"dragenter":return qa=oi(qa,e,t,n,a,l),!0;case"mouseover":return Ga=oi(Ga,e,t,n,a,l),!0;case"pointerover":var o=l.pointerId;return Hi.set(o,oi(Hi.get(o)||null,e,t,n,a,l)),!0;case"gotpointercapture":return o=l.pointerId,$i.set(o,oi($i.get(o)||null,e,t,n,a,l)),!0}return!1}function yv(e){var t=to(e.target);if(t!==null){var n=qi(t);if(n!==null){if(t=n.tag,t===13){if(t=jm(n),t!==null){e.blockedOn=t,gp(e.priority,function(){Rm(n)});return}}else if(t===31){if(t=Bm(n),t!==null){e.blockedOn=t,gp(e.priority,function(){Rm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=rd(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);ku=a,n.target.dispatchEvent(a),ku=null}else return t=Co(n),t!==null&&vv(t),e.blockedOn=n,!1;t.shift()}return!0}function Am(e,t,n){Pr(e)&&n.delete(t)}function Uw(){sd=!1,$a!==null&&Pr($a)&&($a=null),qa!==null&&Pr(qa)&&(qa=null),Ga!==null&&Pr(Ga)&&(Ga=null),Hi.forEach(Am),$i.forEach(Am)}function _r(e,t){e.blockedOn===t&&(e.blockedOn=null,sd||(sd=!0,st.unstable_scheduleCallback(st.unstable_NormalPriority,Uw)))}var Lr=null;function zm(e){Lr!==e&&(Lr=e,st.unstable_scheduleCallback(st.unstable_NormalPriority,function(){Lr===e&&(Lr=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],l=e[t+2];if(typeof a!=="function")if(af(a||n)===null)continue;else break;var o=Co(n);o!==null&&(e.splice(t,3),t-=3,Hu(o,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function To(e){function t(s){return _r(s,e)}$a!==null&&_r($a,e),qa!==null&&_r(qa,e),Ga!==null&&_r(Ga,e),Hi.forEach(t),$i.forEach(t);for(var n=0;n<Ta.length;n++){var a=Ta[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ta.length&&(n=Ta[0],n.blockedOn===null);)yv(n),n.blockedOn===null&&Ta.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],o=n[a+1],i=l[$t]||null;if(typeof o==="function")i||zm(n);else if(i){var r=null;if(o&&o.hasAttribute("formAction")){if(l=o,i=o[$t]||null)r=i.formAction;else if(af(l)!==null)continue}else r=i.action;typeof r==="function"?n[a+1]=r:(n.splice(a,3),a-=3),zm(n)}}}function Sv(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return l=i})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var a=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function lf(e){this._internalRoot=e}qs.prototype.render=lf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(x(409));var n=t.current,a=en();gv(n,a,e,t,null,null)};qs.prototype.unmount=lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gv(e.current,2,null,e,null,null),Us(),t[Ro]=null}};function qs(e){this._internalRoot=e}qs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ta.length&&t!==0&&t<Ta[n].priority;n++);Ta.splice(n,0,e),n===0&&yv(e)}};var _m=Lm.version;if(_m!=="19.2.8")throw Error(x(527,_m,"19.2.8"));pe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0){if(typeof e.render==="function")throw Error(x(188));throw e=Object.keys(e).join(","),Error(x(268,e))}return e=vS(t),e=e!==null?Um(e):null,e=e===null?null:e.stateNode,e};var Hw={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){if(Il=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Il.isDisabled&&Il.supportsFiber)try{Gi=Il.inject(Hw),It=Il}catch(e){}}var Il;Gs.createRoot=function(e,t){if(!Km(e))throw Error(x(299));var n=!1,a="",l=dg,o=fg,i=pg;return t!==null&&t!==void 0&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=mv(e,1,!1,null,null,n,a,null,l,o,i,Sv),e[Ro]=t.current,Id(e),new lf(t)};Gs.hydrateRoot=function(e,t,n){if(!Km(e))throw Error(x(299));var a=!1,l="",o=dg,i=fg,r=pg,s=null;return n!==null&&n!==void 0&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(r=n.onRecoverableError),n.formState!==void 0&&(s=n.formState)),t=mv(e,1,!0,t,n!=null?n:null,a,l,s,o,i,r,Sv),t.context=hv(null),n=t.current,a=en(),a=fd(a),l=ja(a),l.callback=null,Ba(n,l,a),n=a,t.current.lanes=n,Vi(t,n),Gn(t),e[Ro]=t.current,Id(e),new qs(t)};Gs.version="19.2.8"});var kv=Kn(function(Zk,xv){function Mv(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mv)}catch(e){console.error(e)}}Mv(),xv.exports=wv()});var ib=Kn(function(Ws){var eM=Symbol.for("react.transitional.element"),tM=Symbol.for("react.fragment");function ob(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var l in t)l!=="key"&&(n[l]=t[l])}else n=t;return t=n.ref,{$$typeof:eM,type:e,key:a,ref:t!==void 0?t:null,props:n}}Ws.Fragment=tM;Ws.jsx=ob;Ws.jsxs=ob});var M=Kn(function(xD,rb){rb.exports=ib()});var U0=S(B(),1),H0=S(kv(),1);var kn=S(B(),1),j0=S(wr(),1);class Ys extends Error{path;constructor(e){super("swarmd is not responding — it may be restarting");this.path=e;this.name="OfflineError"}}class Al extends Error{status;path;constructor(e,t){super(`${t}: ${e}`);this.status=e;this.path=t;this.name="ApiError"}}function $w(){let e=new URLSearchParams(location.search),t=e.get("token");if(t){try{sessionStorage.setItem(Dv,t)}catch{}e.delete("token");let n=e.size>0?`?${e}`:"";return history.replaceState(null,"",`${location.pathname}${n}${location.hash}`),t}try{return sessionStorage.getItem(Dv)}catch{return null}}var Dv="swarm.token",of=$w();function Ov(e){let t=new Headers(e);if(of)t.set("authorization",`Bearer ${of}`);return t}async function ct(e,t){let n={headers:Ov()};if(t)n.signal=t;let a=await Ev(e,n);if(!a.ok)throw new Al(a.status,e);return await a.json()}async function Ev(e,t){try{return await fetch(e,t)}catch(n){if(n instanceof DOMException&&n.name==="AbortError")throw n;throw new Ys(e)}}async function Ne(e,t,n){let a={method:t,headers:Ov()};if(n!==void 0)a.body=JSON.stringify(n),a.headers.set("content-type","application/json");let l=await Ev(e,a),o=l.status===409||l.status===400;if(!l.ok&&!o)throw new Al(l.status,e);return await l.json()}function Ae(e){let t=new URLSearchParams;for(let[a,l]of Object.entries(e))if(l!==null&&l!==void 0&&l!=="")t.set(a,String(l));let n=t.toString();return n?`?${n}`:""}function Nv(e){return new EventSource(`/v1/events${Ae({since:e,token:of})}`)}var Rv=S(B(),1);function Tv(e){return Boolean(e?.closest?.("a,button,input,select,textarea"))}function Cv(){Rv.useEffect(()=>{if(new URLSearchParams(location.search).get("chrome")!=="inset")return;document.documentElement.classList.add("chrome-inset");let e=document.querySelector("header");if(!e)return;let t=()=>window.__TAURI__?.window?.getCurrentWindow?.(),n=(l)=>{let o=l;if(o.button===0&&!Tv(o.target))t()?.startDragging?.()},a=(l)=>{if(!Tv(l.target))t()?.toggleMaximize?.()};return e.addEventListener("mousedown",n),e.addEventListener("dblclick",a),()=>{e.removeEventListener("mousedown",n),e.removeEventListener("dblclick",a)}},[])}var Av=S(B(),1);var rf="https://github.com/ra3orblade/swarm",zv="https://getswarm.vercel.app/docs/",_v="https://getswarm.vercel.app/changelog";function sf(){return Boolean(window.__TAURI__||window.__TAURI_INTERNALS__)}function Wa(e){let t=window.__TAURI__?.shell;if(t?.open){t.open(e).catch(()=>window.open(e,"_blank"));return}window.open(e,"_blank")}function Lv(){Av.useEffect(()=>{let e=(t)=>{let a=t.target?.closest?.('a[href^="http"]');if(!a)return;t.preventDefault(),Wa(a.href)};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[])}function Vs(e){let t=navigator.userAgent,n=/Mac/.test(t)?"macOS":/Windows/.test(t)?"Windows":/Linux/.test(t)?"Linux":"unknown OS",a=`swarm ${e??"?"} · ${n} · ${sf()?"desktop":"browser"}`,l=new URLSearchParams({template:"feedback.yml",environment:a});return`${rf}/issues/new?${l}`}function Xs(e,t=!1){let n=window.RELEASE_NOTES??{},a=e?n[e]:void 0;if(e&&a)return{version:e,...a};if(t)return null;let l=Object.keys(n)[0],o=l?n[l]:void 0;return l&&o?{version:l,...o}:null}var Kv="swarm.seenVersion";function cf(e){try{localStorage.setItem(Kv,e)}catch{}}function jv(e){if(!e||!window.RELEASE_NOTES)return null;let t=null;try{t=localStorage.getItem(Kv)}catch{return null}if(t===e)return null;if(!t)return cf(e),null;return Xs(e,!0)}var Hv=S(B(),1);var uf=[0.7,0.8,0.9,1,1.1,1.25,1.5,1.75,2],qw=3,$v="swarm.zoom",Gw=80,Bv=0;function Yw(e){if(e==="="||e==="+")return 1;if(e==="-"||e==="_")return-1;return e==="0"?0:null}function qv(){return Number(localStorage.getItem($v))||1}function Gv(e){document.documentElement.style.setProperty("--ui-zoom",String(e)),document.documentElement.classList.toggle("zoomed",e!==1)}function Uv(e,t=performance.now()){if(t-Bv<Gw)return;Bv=t;let n=1;if(e!==0){let a=uf.findIndex((o)=>Math.abs(o-qv())<0.01),l=a<0?qw:a;n=uf[Math.max(0,Math.min(uf.length-1,l+e))]??1}localStorage.setItem($v,String(n)),Gv(n)}function Yv(){Hv.useEffect(()=>{let e=qv();if(e!==1)Gv(e);if(window.swarmZoom=(n)=>Uv(n),!sf())return;let t=(n)=>{if(!(n.metaKey||n.ctrlKey)||n.altKey)return;let a=Yw(n.key);if(a===null)return;n.preventDefault(),Uv(a)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[])}var Zs=S(B(),1),Vw=30000,Qs=new Set,er;function Xw(){if(er!==void 0)return;er=setInterval(()=>{if(document.hidden)return;for(let e of Qs)e()},Vw)}function Vv(){let[e,t]=Zs.useState(0);return Zs.useEffect(()=>{let n=()=>t((a)=>a+1);return Qs.add(n),Xw(),()=>{if(Qs.delete(n),Qs.size===0&&er!==void 0)clearInterval(er),er=void 0}},[]),e}var Xv=["session.started","session.ended","prompt.submitted","tool.requested","tool.allowed","tool.denied","tool.completed","agent.text","agent.delta","subagent.started","subagent.stopped","claim.acquired","claim.renewed","claim.released","claim.expired","claim.orphaned","claim.denied","rules.changed","worktree.reclaimed","worktree.bootstrapped","worktree.created","worktree.removed","pr.opened","question.asked","question.answered","dispatch.queued","dispatch.started","dispatch.finished","resource.acquired","resource.released","resource.reaped","process.started","process.exited","gate.recorded","handoff.recorded","permission.requested","permission.resolved","session.notification","session.stuck","workflow.started","workflow.step","workflow.finished","message.sent","incident.opened","incident.acked","run.result"];var Qv=(e)=>{let t,n=new Set,a=(c,d)=>{let h=typeof c==="function"?c(t):c;if(!Object.is(h,t)){let u=t;t=(d!=null?d:typeof h!=="object"||h===null)?h:Object.assign({},t,h),n.forEach((p)=>p(t,u))}},l=()=>t,r={setState:a,getState:l,getInitialState:()=>s,subscribe:(c)=>(n.add(c),()=>n.delete(c))},s=t=e(a,l,r);return r},Zv=(e)=>e?Qv(e):Qv;var tr=S(B(),1);var Qw=(e)=>e;function Zw(e,t=Qw){let n=tr.default.useSyncExternalStore(e.subscribe,tr.default.useCallback(()=>t(e.getState()),[e,t]),tr.default.useCallback(()=>t(e.getInitialState()),[e,t]));return tr.default.useDebugValue(n),n}var Jv=(e)=>{let t=Zv(e),n=(a)=>Zw(t,a);return Object.assign(n,t),n},jo=(e)=>e?Jv(e):Jv;var bn=S(B(),1);var df=5000;function Jw(e){return e instanceof DOMException&&e.name==="AbortError"}async function Ww(e,t){try{let n=await ct(e,t);return t.aborted?{kind:"dropped"}:{kind:"value",value:n}}catch(n){if(t.aborted||Jw(n))return{kind:"dropped"};return{kind:"error",error:n instanceof Error?n:Error(String(n))}}}function te(e,t=df){let[n,a]=bn.useState(null),[l,o]=bn.useState(null),[i,r]=bn.useState(e!==null),s=bn.useRef(null),c=bn.useCallback(async(u)=>{if(e===null)return;let p=await Ww(e,u);if(p.kind==="dropped")return;if(p.kind==="value")s.current=e,a(p.value),o(null);else o(p.error);r(!1)},[e]),d=bn.useRef(()=>{}),h=bn.useCallback(()=>d.current(),[]);return bn.useEffect(()=>{if(e===null){a(null),r(!1);return}if(s.current!==e)r(!0);let u=new AbortController,p,g=async()=>{if(await c(u.signal),!u.signal.aborted&&t>0)p=setTimeout(()=>void g(),t)};return d.current=()=>void c(u.signal),g(),()=>{if(u.abort(),p!==void 0)clearTimeout(p)}},[e,t,c]),{data:n,loading:i,error:l,reload:h}}var Wv="",ma=jo((e)=>({data:null,offline:!1,refresh:async()=>{try{let t=await ct("/v1/state"),n=JSON.stringify(t);e((a)=>{if(n===Wv)return a.offline?{offline:!1}:a;return Wv=n,{data:t,offline:!1}})}catch{e({offline:!0})}}}));function G(e){return ma((t)=>e(t.data))}function lt(){return ma.getState().refresh()}function Pv(){let{refresh:e}=ma.getState(),t=setInterval(()=>{if(!document.hidden)e()},df);e();let n=null,a,l,o=1500,i=!1,r=()=>{if(l!==void 0)return;l=setTimeout(()=>{l=void 0,e()},400)},s=()=>{if(i)return;let h=Nv(ma.getState().data?.seq??0);n=h,h.addEventListener("ping",()=>c());for(let u of Xv)h.addEventListener(u,()=>{c(),r()});h.onerror=()=>{h.close(),n=null,ma.setState({offline:!0}),a=setTimeout(s,o),o=Math.min(30000,o*2)}},c=()=>{if(o=1500,ma.getState().offline)ma.setState({offline:!1})};s();let d=()=>{if(!document.hidden)e()};return document.addEventListener("visibilitychange",d),()=>{if(i=!0,clearInterval(t),a!==void 0)clearTimeout(a);if(l!==void 0)clearTimeout(l);n?.close(),document.removeEventListener("visibilitychange",d)}}function Pw(e,t){let n;try{n=e()}catch(l){return}return{getItem:(l)=>{var o;let i=(s)=>{if(s===null)return null;return JSON.parse(s,t==null?void 0:t.reviver)},r=(o=n.getItem(l))!=null?o:null;if(r instanceof Promise)return r.then(i);return i(r)},setItem:(l,o)=>n.setItem(l,JSON.stringify(o,t==null?void 0:t.replacer)),removeItem:(l)=>n.removeItem(l)}}var ff=(e)=>(t)=>{try{let n=e(t);if(n instanceof Promise)return n;return{then(a){return ff(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return ff(a)(n)}}}},Iw=(e,t)=>(n,a,l)=>{let o={storage:Pw(()=>window.localStorage),partialize:(y)=>y,version:0,merge:(y,m)=>({...m,...y}),...t},i=!1,r=0,s=new Set,c=new Set,d=o.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},a,l);let h=()=>{let y=o.partialize({...a()});return d.setItem(o.name,{state:y,version:o.version})},u=l.setState;l.setState=(y,m)=>(u(y,m),h());let p=e((...y)=>(n(...y),h()),a,l);l.getInitialState=()=>p;let g,b=()=>{var y,m;if(!d)return;let f=++r;i=!1,s.forEach((w)=>{var D;return w((D=a())!=null?D:p)});let v=((m=o.onRehydrateStorage)==null?void 0:m.call(o,(y=a())!=null?y:p))||void 0;return ff(d.getItem.bind(d))(o.name).then((w)=>{if(w)if(typeof w.version==="number"&&w.version!==o.version){if(o.migrate){let D=o.migrate(w.state,w.version);if(D instanceof Promise)return D.then((z)=>[!0,z]);return[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then((w)=>{var D;if(f!==r)return;let[z,E]=w;if(g=o.merge(E,(D=a())!=null?D:p),n(g,!0),z)return h()}).then(()=>{if(f!==r)return;v==null||v(a(),void 0),g=a(),i=!0,c.forEach((w)=>w(g))}).catch((w)=>{if(f!==r)return;v==null||v(void 0,w)})};if(l.persist={setOptions:(y)=>{if(o={...o,...y},y.storage)d=y.storage},clearStorage:()=>{++r,d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>i,onHydrate:(y)=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:(y)=>(c.add(y),()=>{c.delete(y)})},!o.skipHydration)b();return g||p},Js=Iw;var Iv=["Observe","Work","Insight","Guard"],nr=[{id:"fleet",label:"Fleet",icon:"squares-four",group:"Observe"},{id:"timeline",label:"Timeline",icon:"clock-counter-clockwise",group:"Observe"},{id:"graphs",label:"Graphs",icon:"tree-structure",group:"Observe"},{id:"board",label:"Board",icon:"stack",group:"Work"},{id:"prs",label:"PRs",icon:"git-pull-request",group:"Work"},{id:"trials",label:"Trials",icon:"robot",group:"Work"},{id:"hygiene",label:"Hygiene",icon:"trash",group:"Work"},{id:"outcomes",label:"Outcomes",icon:"git-branch",group:"Insight"},{id:"gates",label:"Gates",icon:"shield",group:"Insight"},{id:"mcp",label:"MCP",icon:"plugs-connected",group:"Insight"},{id:"context",label:"Context",icon:"brain",group:"Insight"},{id:"heat",label:"Files",icon:"file-text",group:"Insight"},{id:"spend",label:"Spend",icon:"coins",group:"Insight"},{id:"stats",label:"Stats",icon:"chart-bar",group:"Insight"},{id:"search",label:"Search",icon:"magnifying-glass",group:"Insight"},{id:"security",label:"Security",icon:"shield",group:"Guard"},{id:"provenance",label:"Provenance",icon:"git-commit",group:"Guard"},{id:"incidents",label:"Incidents",icon:"warning",group:"Guard"},{id:"rules",label:"Rules",icon:"shield",group:"Guard"}],Fv="fleet",Fw=new Set(nr.map((e)=>e.id));function eb(e){return Fw.has(e)}function tb(e){let t=nr.find((n)=>n.id===e);if(!t)throw Error(`unknown view: ${e}`);return t}function nb(e){return nr.filter((t)=>t.group===e)}var T=jo()(Js((e)=>({view:Fv,project:null,session:null,sidebarCollapsed:!1,graphTab:"collisions",search:"",openView:(t)=>e({view:t,session:null}),selectProject:(t)=>e({project:t}),openSession:(t)=>e({session:t}),toggleSidebar:()=>e((t)=>({sidebarCollapsed:!t.sidebarCollapsed})),setGraphTab:(t)=>e({graphTab:t}),setSearch:(t)=>e({search:t,view:"search",session:null})}),{name:"swarm.ui",partialize:(e)=>({view:e.view,project:e.project,sidebarCollapsed:e.sidebarCollapsed,graphTab:e.graphTab})}));function ab(){let e=new URLSearchParams(location.search),t=e.get("view"),n={};if(t!==null&&eb(t))n.view=t;if(e.has("project"))n.project=e.get("project")||null;let a=e.get("session");if(a)n.session=a;if(Object.keys(n).length>0)T.setState(n)}var Ho=S(B(),1);var lb=S(B(),1);function Pa(e,t){let n=T((o)=>o.openSession),a=T((o)=>o.selectProject),l=T((o)=>o.openView);return lb.useMemo(()=>({openSession:n,selectProject:a,openView:l,...e?{reload:e}:{},...t?{showDiff:t}:{}}),[n,a,l,e,t])}var sb=S(M(),1);function _(e,t=16,n){let a=window.ICON_PATHS?.[e];if(!a)return null;return sb.jsx("svg",{className:n?`ph ${n}`:"ph",width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",dangerouslySetInnerHTML:{__html:a}})}var Me=S(M(),1);function C({title:e,hint:t,actions:n,children:a,spaced:l}){return Me.jsxs(Me.Fragment,{children:[Me.jsxs("h2",{className:l?"mt-sec":void 0,children:[e,t!==void 0&&Me.jsx("span",{children:t}),n!==void 0&&Me.jsx("span",{className:"h2-actions",children:n})]}),a]})}function N({tone:e="plain",children:t}){return Me.jsx("span",{className:e==="plain"?"badge":`badge ${e}`,children:t})}function H(){return Me.jsx("span",{className:"dim",children:"—"})}function Y({art:e,children:t}){return Me.jsxs("div",{className:"empty",children:[e,t]})}function K({label:e,value:t,detail:n,tone:a}){return Me.jsxs("div",{className:a?`kpi ${a}`:"kpi",children:[Me.jsx("div",{className:"l",children:e}),Me.jsx("div",{className:"v",children:t}),n!==void 0&&Me.jsx("div",{className:"d",children:n})]})}function ut({children:e,wide:t}){return Me.jsx("div",{className:t?"kpis kpis-5":"kpis",children:e})}function ue({art:e}){return Me.jsxs("div",{className:"empty",children:[e,"Loading…"]})}function xe({error:e,onRetry:t}){let n=e.name==="OfflineError";return Me.jsxs("div",{className:"empty",children:[n?Me.jsxs(Me.Fragment,{children:[Me.jsx("b",{children:"swarmd is not responding."}),Me.jsx("br",{}),"It may be restarting — this clears itself once it answers again."]}):Me.jsxs(Me.Fragment,{children:["Could not load this view — ",e.message,"."]}),t&&Me.jsxs(Me.Fragment,{children:[Me.jsx("br",{}),Me.jsx("button",{type:"button",className:"link",onClick:t,children:"Try again"})]})]})}var Ia=S(B(),1);var ar=S(B(),1),cb=S(wr(),1);var Nn=S(M(),1);function ha({title:e,glyph:t="squares-four",subtitle:n,size:a,children:l,footer:o,onClose:i}){let r=document.getElementById("picker"),s=ar.useRef(null),c=ar.useRef(null);if(ar.useEffect(()=>{c.current=document.activeElement,s.current?.querySelector("textarea, input, button")?.focus();let d=(u)=>{if(u.key==="Escape")i()},h=(u)=>{if(u.target===r)i()};return document.addEventListener("keydown",d),r?.addEventListener("click",h),()=>{document.removeEventListener("keydown",d),r?.removeEventListener("click",h),c.current?.focus?.()}},[i,r]),!r)return null;return cb.createPortal(Nn.jsxs("div",{className:a?`pk ${a}`:"pk",role:"dialog","aria-modal":"true","aria-label":e,ref:s,children:[Nn.jsxs("div",{className:"pk-h",children:[_(t,15),Nn.jsx("b",{children:e}),n!==void 0&&Nn.jsx("span",{className:"dim now pk-sub",children:n}),Nn.jsx("span",{className:"grow"}),Nn.jsx("button",{type:"button",title:"Close","aria-label":"Close",onClick:i,children:_("x",14)})]}),Nn.jsx("div",{className:"pk-b",children:l}),o!==void 0&&Nn.jsxs("div",{className:"pk-f",children:[Nn.jsx("span",{className:"grow"}),o]})]}),r)}function Pe(e){let t=(Date.now()-new Date(e).getTime())/1000;if(t<60)return`${Math.floor(t)}s`;if(t<3600)return`${Math.floor(t/60)}m`;if(t<86400)return`${Math.floor(t/3600)}h`;return`${Math.floor(t/86400)}d`}var pf=(e)=>String(e).padStart(2,"0");function ga(e){let t=new Date(e);return`${pf(t.getHours())}:${pf(t.getMinutes())}:${pf(t.getSeconds())}`}function ub(e,t,n){let a=e/t,l=a>=100?0:a>=10?1:2;return`${a.toFixed(l)}${n}`}function Dt(e){if(e>=1e9)return ub(e,1e9,"B");if(e>=1e6)return ub(e,1e6,"M");if(e>=1000)return`${(e/1000).toFixed(0)}k`;return String(Math.floor(e))}function F(e){if(e===null||e===void 0)return null;return`$${e<10?e.toFixed(2):e.toFixed(0)}`}function Ot(e){if(!e)return"";return e.replace(/^claude-/,"").replace(/-\d{8}$/,"")}function $e(e){return String(e??"").replace(/^\/Users\/[^/]+/,"~")}function Ps(e){let t=(new Date(e).getTime()-Date.now())/1000;if(t<=0)return"expired";if(t<3600)return`${Math.floor(t/60)}m left`;return`${(t/3600).toFixed(1)}h left`}function mf(e){if(e===null||e===void 0||e<0)return"—";if(e<1)return`${Math.round(e*60)}m`;if(e<48)return`${e.toFixed(1)}h`;return`${(e/24).toFixed(1)}d`}function db(e){if(e===null||e===void 0)return"—";return`${Math.round(e*100)}%`}function Tn(e,t){return e.reduce((n,a)=>n+(t(a)??0),0)}function an(e){if(e<3600000)return`${Math.round(e/60000)}m`;if(e<86400000)return`${(e/3600000).toFixed(1)}h`;return`${(e/86400000).toFixed(1)}d`}function Is(e){if(e===null)return null;if(e<1000)return`${e}ms`;if(e<60000)return`${(e/1000).toFixed(1)}s`;return an(e)}function Rn(e){if(e===null||e===void 0)return null;if(e>=1048576)return`${(e/1024/1024).toFixed(1)} GB`;return`${Math.round(e/1024)} MB`}function fb(e){if(e<1)return`${Math.round(e*60)}m`;if(e<48)return`${e.toFixed(e<10?1:0)}h`;let t=e/24;return t<100?`${t.toFixed(t<10?1:0)}d`:`${Math.round(t/7)}w`}function At(e){if(e>=1e9)return`${(e/1e9).toFixed(2)}B`;if(e>=1e6)return`${(e/1e6).toFixed(1)}M`;if(e>=1000)return`${(e/1000).toFixed(1)}k`;return String(Math.round(e))}function lr(e,t){return t?`${(100*e/t).toFixed(0)}%`:"—"}function pb(e){return String(e).replace(/^mcp__([^_]+(?:_[^_]+)*)__/,"$1 · ").replace(/^plugin_/,"")}var W=S(M(),1);function nM(e){if(e.startsWith("+++")||e.startsWith("---")||e.startsWith("diff "))return"m";if(e.startsWith("@@"))return"h";if(e.startsWith("+"))return"a";if(e.startsWith("-"))return"d";return""}function aM({text:e}){return W.jsx(W.Fragment,{children:e.split(`
10
- `).map((t,n)=>{let a=nM(t);return W.jsxs("span",{className:a||void 0,children:[t,`
11
- `]},n)})})}function lM({commits:e}){if(e.length===0)return null;return W.jsxs("div",{className:"dim df-commits",children:[e.slice(0,8).map((t)=>W.jsx("div",{children:t},t)),e.length>8&&W.jsxs("div",{children:["… ",e.length-8," more"]})]})}function oM({files:e,selected:t,onSelect:n}){return W.jsx("div",{className:"df-files",children:e.map((a)=>W.jsxs("button",{type:"button",className:t===a.path?"on":void 0,onClick:()=>n(a.path),children:[W.jsx("span",{className:"st",children:a.status}),W.jsx("span",{className:"pa",title:a.path,children:a.path}),a.added>=0?W.jsxs(W.Fragment,{children:[W.jsxs("span",{className:"pl",children:["+",a.added]}),W.jsxs("span",{className:"mi",children:["−",a.deleted]})]}):W.jsx("span",{className:"dim",children:"bin"})]},a.path))})}function iM({file:e,patch:t}){if(e===null)return W.jsx("span",{className:"m",children:"select a file — or view everything below"});if(t===null)return W.jsx("span",{className:"m",children:"loading…"});return t?W.jsx(aM,{text:t}):W.jsx("span",{className:"m",children:"(empty)"})}function Fs({projectId:e,worktree:t,onClose:n}){let[a,l]=Ia.useState(null),[o,i]=Ia.useState(null),[r,s]=Ia.useState(null),[c,d]=Ia.useState(null);Ia.useEffect(()=>{let u=new AbortController;return ct(`/v1/worktrees/diff${Ae({project:e,worktree:t})}`,u.signal).then((p)=>p.error?i(p.error):l(p)).catch((p)=>i(p.message)),()=>u.abort()},[e,t]),Ia.useEffect(()=>{if(r===null)return;let u=new AbortController;return d(null),ct(`/v1/worktrees/diff${Ae({project:e,worktree:t,file:r||null,patch:r?null:1})}`,u.signal).then((p)=>d(p.patch??"")).catch(()=>d("")),()=>u.abort()},[r,e,t]);let h=a?W.jsxs(W.Fragment,{children:[$e(a.worktree)," · vs ",a.baseRef??"HEAD"," · ",a.commits.length," commit",a.commits.length===1?"":"s"," · ",a.files.length," file",a.files.length===1?"":"s",a.dirty&&W.jsxs(W.Fragment,{children:[" · ",W.jsx(N,{tone:"warn",children:"dirty"})]})]}):$e(t);return W.jsx(ha,{title:"Diff",glyph:"folders",size:"wide",subtitle:h,onClose:n,footer:a&&a.files.length>0?W.jsxs("button",{type:"button",className:"nav",onClick:()=>s(""),children:[_("folders",12)," Whole diff"]}):void 0,children:o?W.jsx("div",{className:"empty",children:o}):a?W.jsxs(W.Fragment,{children:[W.jsx(lM,{commits:a.commits}),a.files.length===0?W.jsx("div",{className:"empty",children:"Nothing changed."}):W.jsxs(W.Fragment,{children:[W.jsx(oM,{files:a.files,selected:r,onSelect:s}),W.jsx("pre",{className:"df-patch",children:W.jsx(iM,{file:r,patch:c})})]})]}):W.jsx("div",{className:"empty",children:"Loading…"})})}var va=S(M(),1);function rM(e,t){if(t)return`${t} waiting on you`;return e?"sessions working":"no sessions"}function sM(e,t){if(t)return`${t} orphaned`;return e?"claims with a lease":"nothing claimed"}function cM(e,t){let n=[e?`${e} dirty`:"",t?`${t} merged`:""].filter(Boolean);return n.length?n.join(" · "):"all clean"}function mb({data:e,tasks:t}){return va.jsxs(ut,{wide:!0,children:[va.jsx(K,{label:"Live",value:e.live.length,detail:rM(e.live.length,e.waiting),tone:e.waiting?"hot":void 0}),va.jsx(K,{label:"Held",value:e.heldClaims.length,detail:sM(e.heldClaims.length,e.orphaned),tone:e.orphaned?"hot":void 0}),va.jsx(K,{label:"Worktrees",value:e.worktrees.length,detail:cM(e.dirty,e.merged),tone:e.dirty?"warm":void 0}),t?va.jsx(K,{label:"Ready",value:t.ready,detail:`${t.open} open`}):va.jsx(K,{label:"Projects",value:e.projectCount,detail:"on the board"}),va.jsx(K,{label:"Incidents",value:e.openIncidents,detail:e.openIncidents?"need a look":"all acknowledged",tone:e.openIncidents?"hot":void 0})]})}function zl(e){if(typeof e!=="object"||e===null)return{ok:!0};let t=e,n=typeof t.error==="string"?t.error:void 0;return{ok:t.ok===void 0?n===void 0:t.ok===!0,...n===void 0?{}:{error:n},...typeof t.refused==="string"?{refused:t.refused}:{}}}async function ec(e,t){let n=zl(await Ne(`/v1/processes/${e}${Ae({project:t})}`,"DELETE"));return await lt(),n}async function Bo(e,t,n=!1){let a=zl(await Ne("/v1/worktrees/remove","POST",{projectId:e,worktree:t,force:n}));return await lt(),a}async function hb(e){let t=await Ne("/v1/hygiene/reclaim","POST",{path:e});return await lt(),t}async function gb(e){await Ne(`/v1/incidents/${e}/ack`,"POST"),await lt()}async function vb(e){await Ne(`/v1/incidents/ack${Ae({project:e})}`,"POST"),await lt()}async function hf(e,t,n=!1){let a=zl(await Ne("/v1/claims/release","POST",{projectId:e,task:t,force:n}));return await lt(),a}async function bb(e,t){await Ne(`/v1/resources/${encodeURIComponent(e)}${Ae({force:1,project:t})}`,"DELETE"),await lt()}async function yb(e){try{let t=zl(await Ne("/v1/projects","POST",{path:e}));if(t.ok)await lt();return t}catch(t){if(t instanceof Al||t instanceof Ys)return{ok:!1,error:t.message};throw t}}async function gf(e,t){await Ne(`/v1/projects/${e}`,"PATCH",{pinned:t}),await lt()}async function Sb(e){await Ne(`/v1/projects/${e}`,"DELETE"),await lt()}async function vf(e,t){return zl(await Ne("/v1/worktrees/open","POST",{projectId:e,worktree:t}))}async function wb(e,t){let n=zl(await Ne("/v1/prs/merge","POST",{projectId:e,number:t}));return await lt(),n}async function Mb(e,t){let n=zl(await Ne("/v1/claims","POST",{projectId:e,task:t,owner:"dashboard"}));return await lt(),n}async function xb(e,t){let n=await Ne("/v1/gates/run","POST",{projectId:e,task:t});return await lt(),n}async function xt(e){let t=String(e??"");try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}try{let n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.cssText="position:fixed;top:-1000px;left:0;opacity:0",document.body.appendChild(n),n.select(),n.setSelectionRange(0,t.length);let a=document.execCommand("copy");return n.remove(),a}catch{return!1}}function zt(e,t,n){window.menus?.open(e,{...n,items:t})}function _l(e){return{label:e,section:e}}var Ll=(e,t)=>e.length<=t?e:`…${e.slice(-t)}`,Yn={label:"",divider:!0};function kb(e,t,n,a){let l=(o)=>()=>{a.selectProject(t.id),a.openView(o)};zt(e,[{label:"Show sessions",icon:"squares-four",...n?{caption:`${n} live`}:{},run:l("fleet")},{label:"Show in Timeline",icon:"clock-counter-clockwise",run:l("timeline")},{label:"Spend",icon:"coins",run:l("spend")},{label:"Stats",icon:"chart-bar",run:l("stats")},Yn,t.discovered?{label:"Pin project",icon:"push-pin",run:()=>void gf(t.id,!0)}:{label:"Unpin project",icon:"push-pin-slash",run:()=>void gf(t.id,!1)},{label:"Copy path",icon:"copy",caption:Ll(t.root,16),run:()=>void xt(t.root)},Yn,{label:"Remove from Swarm",icon:"trash",danger:!0,caption:"history is kept",run:()=>{if(confirm(`Stop tracking ${t.name}?`))Sb(t.id)}}],{title:t.name})}function Db(e,t,n){zt(e,[{label:"Open session",icon:"terminal-window",run:()=>n.openSession(t.id)},{label:"Show in Timeline",icon:"clock-counter-clockwise",run:()=>{n.selectProject(t.projectId),n.openView("timeline")}},Yn,_l("Copy"),{label:"Session id",icon:"copy",caption:t.id.slice(0,8),run:()=>void xt(t.id)},{label:"Working directory",icon:"folder-simple",caption:Ll($e(t.cwd),16),run:()=>void xt(t.cwd)},...t.transcriptPath?[{label:"Transcript path",icon:"file-text",run:()=>void xt(t.transcriptPath)}]:[],...t.branch?[{label:"Branch",icon:"git-branch",caption:Ll(t.branch,16),run:()=>void xt(t.branch)}]:[]],{title:t.title??t.id.slice(0,8)})}function Ob(e,t,n,a){let{held:l,sessions:o}=n;zt(e,[{label:"Open",icon:"arrow-square-out",caption:"editor",run:async()=>{let i=await vf(t.projectId,t.path);if(!i.ok&&i.error)alert(i.error)}},...a.showDiff&&!t.main?[{label:"Diff",icon:"folders",caption:"vs main",run:()=>a.showDiff?.(t.projectId,t.path)}]:[],...o.length>0?[Yn,_l("Sessions"),...o.map((i)=>({label:i.title??i.id.slice(0,8),icon:"terminal-window",run:()=>a.openSession(i.id)}))]:[],Yn,{label:"Copy path",icon:"copy",caption:Ll($e(t.path),14),run:()=>void xt(t.path)},...t.branch?[{label:"Copy branch",icon:"git-branch",caption:Ll(t.branch,14),run:()=>void xt(t.branch)}]:[],...t.main||l?[]:[Yn,{label:"Remove",icon:"trash",danger:!0,...t.dirty>0?{caption:"dirty"}:t.ahead>0?{caption:"unpushed"}:{},run:()=>void uM(t.projectId,t.path,a)}]],{title:t.branch??"(detached)"})}async function uM(e,t,n){if(!confirm(`Remove worktree ${$e(t)}?`))return;let a=await Bo(e,t);if(!a.ok&&(a.refused==="dirty"||a.refused==="unpushed")){if(confirm(`${a.error}
8
+ `+a.stack}}var fp=Object.prototype.hasOwnProperty,{unstable_scheduleCallback:rh,unstable_cancelCallback:Of,unstable_shouldYield:A$,unstable_requestPaint:E$,unstable_now:Yo,unstable_getCurrentPriorityLevel:O$,unstable_ImmediatePriority:xS,unstable_UserBlockingPriority:CS,unstable_NormalPriority:qu,unstable_LowPriority:N$,unstable_IdlePriority:MS,log:L$,unstable_setDisableYieldValue:R$}=Kt,lc=null,Xo=null;function or(e){if(typeof L$==="function"&&R$(e),Xo&&typeof Xo.setStrictMode==="function")try{Xo.setStrictMode(lc,e)}catch(t){}}var Qo=Math.clz32?Math.clz32:P$,{log:B$,LN2:H$}=Math;function P$(e){return e>>>=0,e===0?32:31-(B$(e)/H$|0)|0}var pu=256,hu=262144,gu=4194304;function Kr(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function vd(e,t,o){var a=e.pendingLanes;if(a===0)return 0;var n=0,r=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var l=a&134217727;return l!==0?(a=l&~r,a!==0?n=Kr(a):(s&=l,s!==0?n=Kr(s):o||(o=l&~e,o!==0&&(n=Kr(o))))):(l=a&~r,l!==0?n=Kr(l):s!==0?n=Kr(s):o||(o=a&~e,o!==0&&(n=Kr(o)))),n===0?0:t!==0&&t!==n&&(t&r)===0&&(r=n&-n,o=t&-t,r>=o||r===32&&(o&4194048)!==0)?t:n}function cc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function z$(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kS(){var e=gu;return gu<<=1,(gu&62914560)===0&&(gu=4194304),e}function Nf(e){for(var t=[],o=0;31>o;o++)t.push(e);return t}function uc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function U$(e,t,o,a,n,r){var s=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var{entanglements:l,expirationTimes:c,hiddenUpdates:u}=e;for(o=s&~o;0<o;){var d=31-Qo(o),m=1<<d;l[d]=0,c[d]=-1;var f=u[d];if(f!==null)for(u[d]=null,d=0;d<f.length;d++){var p=f[d];p!==null&&(p.lane&=-536870913)}o&=~m}a!==0&&DS(e,a,0),r!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=r&~(s&~t))}function DS(e,t,o){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Qo(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|o&261930}function TS(e,t){var o=e.entangledLanes|=t;for(e=e.entanglements;o;){var a=31-Qo(o),n=1<<a;n&t|e[a]&t&&(e[a]|=t),o&=~n}}function AS(e,t){var o=t&-t;return o=(o&42)!==0?1:sh(o),(o&(e.suspendedLanes|t))!==0?0:o}function sh(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ih(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ES(){var e=Ae.p;if(e!==0)return e;return e=window.event,e===void 0?32:Jy(e.type)}function X0(e,t){var o=Ae.p;try{return Ae.p=e,t()}finally{Ae.p=o}}var yr=Math.random().toString(36).slice(2),fo="__reactFiber$"+yr,zo="__reactProps$"+yr,Ni="__reactContainer$"+yr,pp="__reactEvents$"+yr,F$="__reactListeners$"+yr,_$="__reactHandles$"+yr,Q0="__reactResources$"+yr,dc="__reactMarker$"+yr;function lh(e){delete e[fo],delete e[zo],delete e[pp],delete e[F$],delete e[_$]}function ni(e){var t=e[fo];if(t)return t;for(var o=e.parentNode;o;){if(t=o[Ni]||o[fo]){if(o=t.alternate,t.child!==null||o!==null&&o.child!==null)for(e=nS(e);e!==null;){if(o=e[fo])return o;e=nS(e)}return t}e=o,o=e.parentNode}return null}function Li(e){if(e=e[fo]||e[Ni]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(N(33))}function pi(e){var t=e[Q0];return t||(t=e[Q0]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ao(e){e[dc]=!0}var OS=new Set,NS={};function rs(e,t){Ii(e,t),Ii(e+"Capture",t)}function Ii(e,t){NS[e]=t;for(e=0;e<t.length;e++)OS.add(t[e])}var j$=RegExp("^[: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]*$"),J0={},ev={};function G$(e){if(fp.call(ev,e))return!0;if(fp.call(J0,e))return!1;if(j$.test(e))return ev[e]=!0;return J0[e]=!0,!1}function Du(e,t,o){if(G$(t))if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+o)}}function bu(e,t,o){if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+o)}}function bn(e,t,o,a){if(a===null)e.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(t,o,""+a)}}function ca(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function LS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function V$(e,t,o){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get==="function"&&typeof a.set==="function"){var{get:n,set:r}=a;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(s){o=""+s,r.call(this,s)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return o},setValue:function(s){o=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hp(e){if(!e._valueTracker){var t=LS(e)?"checked":"value";e._valueTracker=V$(e,t,""+e[t])}}function RS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),a="";return e&&(a=LS(e)?e.checked?"true":"false":e.value),e=a,e!==o?(t.setValue(e),!0):!1}function $u(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}var K$=/[\n"\\]/g;function ma(e){return e.replace(K$,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gp(e,t,o,a,n,r,s,l){if(e.name="",s!=null&&typeof s!=="function"&&typeof s!=="symbol"&&typeof s!=="boolean"?e.type=s:e.removeAttribute("type"),t!=null)if(s==="number"){if(t===0&&e.value===""||e.value!=t)e.value=""+ca(t)}else e.value!==""+ca(t)&&(e.value=""+ca(t));else s!=="submit"&&s!=="reset"||e.removeAttribute("value");t!=null?bp(e,s,ca(t)):o!=null?bp(e,s,ca(o)):a!=null&&e.removeAttribute("value"),n==null&&r!=null&&(e.defaultChecked=!!r),n!=null&&(e.checked=n&&typeof n!=="function"&&typeof n!=="symbol"),l!=null&&typeof l!=="function"&&typeof l!=="symbol"&&typeof l!=="boolean"?e.name=""+ca(l):e.removeAttribute("name")}function BS(e,t,o,a,n,r,s,l){if(r!=null&&typeof r!=="function"&&typeof r!=="symbol"&&typeof r!=="boolean"&&(e.type=r),t!=null||o!=null){if(!(r!=="submit"&&r!=="reset"||t!==void 0&&t!==null)){hp(e);return}o=o!=null?""+ca(o):"",t=t!=null?""+ca(t):o,l||t===e.value||(e.value=t),e.defaultValue=t}a=a!=null?a:n,a=typeof a!=="function"&&typeof a!=="symbol"&&!!a,e.checked=l?e.checked:!!a,e.defaultChecked=!!a,s!=null&&typeof s!=="function"&&typeof s!=="symbol"&&typeof s!=="boolean"&&(e.name=s),hp(e)}function bp(e,t,o){t==="number"&&$u(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function hi(e,t,o,a){if(e=e.options,t){t={};for(var n=0;n<o.length;n++)t["$"+o[n]]=!0;for(o=0;o<e.length;o++)n=t.hasOwnProperty("$"+e[o].value),e[o].selected!==n&&(e[o].selected=n),n&&a&&(e[o].defaultSelected=!0)}else{o=""+ca(o),t=null;for(n=0;n<e.length;n++){if(e[n].value===o){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function HS(e,t,o){if(t!=null&&(t=""+ca(t),t!==e.value&&(e.value=t),o==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=o!=null?""+ca(o):""}function PS(e,t,o,a){if(t==null){if(a!=null){if(o!=null)throw Error(N(92));if(kl(a)){if(1<a.length)throw Error(N(93));a=a[0]}o=a}o==null&&(o=""),t=o}o=ca(t),e.defaultValue=o,a=e.textContent,a===o&&a!==""&&a!==null&&(e.value=a),hp(e)}function xi(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var q$=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tv(e,t,o){var a=t.indexOf("--")===0;o==null||typeof o==="boolean"||o===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,o):typeof o!=="number"||o===0||q$.has(t)?t==="float"?e.cssFloat=o:e[t]=(""+o).trim():e[t]=o+"px"}function zS(e,t,o){if(t!=null&&typeof t!=="object")throw Error(N(62));if(e=e.style,o!=null){for(var a in o)!o.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&o[n]!==a&&tv(e,n,a)}else for(var r in t)t.hasOwnProperty(r)&&tv(e,r,t[r])}function ch(e){if(e.indexOf("-")===-1)return!1;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 $$=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),W$=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tu(e){return W$.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Mn(){}var vp=null;function uh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ri=null,gi=null;function ov(e){var t=Li(e);if(t&&(e=t.stateNode)){var o=e[zo]||null;e:switch(e=t.stateNode,t.type){case"input":if(gp(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),t=o.name,o.type==="radio"&&t!=null){for(o=e;o.parentNode;)o=o.parentNode;o=o.querySelectorAll('input[name="'+ma(""+t)+'"][type="radio"]');for(t=0;t<o.length;t++){var a=o[t];if(a!==e&&a.form===e.form){var n=a[zo]||null;if(!n)throw Error(N(90));gp(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<o.length;t++)a=o[t],a.form===e.form&&RS(a)}break e;case"textarea":HS(e,o.value,o.defaultValue);break e;case"select":t=o.value,t!=null&&hi(e,!!o.multiple,t,!1)}}}var Lf=!1;function US(e,t,o){if(Lf)return e(t,o);Lf=!0;try{var a=e(t);return a}finally{if(Lf=!1,ri!==null||gi!==null){if(Ed(),ri&&(t=ri,e=gi,gi=ri=null,ov(t),e))for(t=0;t<e.length;t++)ov(e[t])}}}function Wl(e,t){var o=e.stateNode;if(o===null)return null;var a=o[zo]||null;if(a===null)return null;o=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(o&&typeof o!=="function")throw Error(N(231,t,typeof o));return o}var En=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sp=!1;if(En)try{qr={},Object.defineProperty(qr,"passive",{get:function(){Sp=!0}}),window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch(e){Sp=!1}var qr,ar=null,dh=null,Au=null;function FS(){if(Au)return Au;var e,t=dh,o=t.length,a,n="value"in ar?ar.value:ar.textContent,r=n.length;for(e=0;e<o&&t[e]===n[e];e++);var s=o-e;for(a=1;a<=s&&t[o-a]===n[r-a];a++);return Au=n.slice(e,1<a?1-a:void 0)}function Eu(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 vu(){return!0}function av(){return!1}function Uo(e){function t(o,a,n,r,s){this._reactName=o,this._targetInst=n,this.type=a,this.nativeEvent=r,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(o=e[l],this[l]=o?o(r):r[l]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?vu:av,this.isPropagationStopped=av,this}return at(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!=="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=vu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!=="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=vu)},persist:function(){},isPersistent:vu}),t}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=Uo(ss),mc=at({},ss,{view:0,detail:0}),Z$=Uo(mc),Rf,Bf,yl,yd=at({},mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mh,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){if("movementX"in e)return e.movementX;return e!==yl&&(yl&&e.type==="mousemove"?(Rf=e.screenX-yl.screenX,Bf=e.screenY-yl.screenY):Bf=Rf=0,yl=e),Rf},movementY:function(e){return"movementY"in e?e.movementY:Bf}}),nv=Uo(yd),Y$=at({},yd,{dataTransfer:0}),X$=Uo(Y$),Q$=at({},mc,{relatedTarget:0}),Hf=Uo(Q$),J$=at({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),eW=Uo(J$),tW=at({},ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oW=Uo(tW),aW=at({},ss,{data:0}),rv=Uo(aW),nW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rW={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"},sW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sW[e])?!!t[e]:!1}function mh(){return iW}var lW=at({},mc,{key:function(e){if(e.key){var t=nW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Eu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mh,charCode:function(e){return e.type==="keypress"?Eu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Eu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),cW=Uo(lW),uW=at({},yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sv=Uo(uW),dW=at({},mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mh}),mW=Uo(dW),fW=at({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),pW=Uo(fW),hW=at({},yd,{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}),gW=Uo(hW),bW=at({},ss,{newState:0,oldState:0}),vW=Uo(bW),SW=[9,13,27,32],fh=En&&"CompositionEvent"in window,Rl=null;En&&"documentMode"in document&&(Rl=document.documentMode);var yW=En&&"TextEvent"in window&&!Rl,_S=En&&(!fh||Rl&&8<Rl&&11>=Rl),iv=String.fromCharCode(32),lv=!1;function jS(e,t){switch(e){case"keyup":return SW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GS(e){return e=e.detail,typeof e==="object"&&"data"in e?e.data:null}var si=!1;function wW(e,t){switch(e){case"compositionend":return GS(t);case"keypress":if(t.which!==32)return null;return lv=!0,iv;case"textInput":return e=t.data,e===iv&&lv?null:e;default:return null}}function IW(e,t){if(si)return e==="compositionend"||!fh&&jS(e,t)?(e=FS(),Au=dh=ar=null,si=!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 _S&&t.locale!=="ko"?null:t.data;default:return null}}var xW={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 cv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xW[e.type]:t==="textarea"?!0:!1}function VS(e,t,o,a){ri?gi?gi.push(a):gi=[a]:ri=a,t=dd(t,"onChange"),0<t.length&&(o=new Sd("onChange","change",null,o,a),e.push({event:o,listeners:t}))}var Bl=null,Zl=null;function CW(e){Uy(e,0)}function wd(e){var t=Dl(e);if(RS(t))return e}function uv(e,t){if(e==="change")return t}var KS=!1;if(En){if(En){if(Al="oninput"in document,!Al)Ou=document.createElement("div"),Ou.setAttribute("oninput","return;"),Al=typeof Ou.oninput==="function";Tl=Al}else Tl=!1;KS=Tl&&(!document.documentMode||9<document.documentMode)}var Tl,Al,Ou;function dv(){Bl&&(Bl.detachEvent("onpropertychange",qS),Zl=Bl=null)}function qS(e){if(e.propertyName==="value"&&wd(Zl)){var t=[];VS(t,Zl,e,uh(e)),US(CW,t)}}function MW(e,t,o){e==="focusin"?(dv(),Bl=t,Zl=o,Bl.attachEvent("onpropertychange",qS)):e==="focusout"&&dv()}function kW(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wd(Zl)}function DW(e,t){if(e==="click")return wd(t)}function TW(e,t){if(e==="input"||e==="change")return wd(t)}function AW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ea=typeof Object.is==="function"?Object.is:AW;function Yl(e,t){if(ea(e,t))return!0;if(typeof e!=="object"||e===null||typeof t!=="object"||t===null)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(a=0;a<o.length;a++){var n=o[a];if(!fp.call(t,n)||!ea(e[n],t[n]))return!1}return!0}function mv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fv(e,t){var o=mv(e);e=0;for(var a;o;){if(o.nodeType===3){if(a=e+o.textContent.length,e<=t&&a>=t)return{node:o,offset:t-e};e=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=mv(o)}}function $S(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$S(e,t.parentNode):("contains"in e)?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function WS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$u(e.document);t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href==="string"}catch(a){o=!1}if(o)e=t.contentWindow;else break;t=$u(e.document)}return t}function ph(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")}var EW=En&&"documentMode"in document&&11>=document.documentMode,ii=null,yp=null,Hl=null,wp=!1;function pv(e,t,o){var a=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;wp||ii==null||ii!==$u(a)||(a=ii,("selectionStart"in a)&&ph(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Hl&&Yl(Hl,a)||(Hl=a,a=dd(yp,"onSelect"),0<a.length&&(t=new Sd("onSelect","select",null,t,o),e.push({event:t,listeners:a}),t.target=ii)))}function Gr(e,t){var o={};return o[e.toLowerCase()]=t.toLowerCase(),o["Webkit"+e]="webkit"+t,o["Moz"+e]="moz"+t,o}var li={animationend:Gr("Animation","AnimationEnd"),animationiteration:Gr("Animation","AnimationIteration"),animationstart:Gr("Animation","AnimationStart"),transitionrun:Gr("Transition","TransitionRun"),transitionstart:Gr("Transition","TransitionStart"),transitioncancel:Gr("Transition","TransitionCancel"),transitionend:Gr("Transition","TransitionEnd")},Pf={},ZS={};En&&(ZS=document.createElement("div").style,("AnimationEvent"in window)||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),("TransitionEvent"in window)||delete li.transitionend.transition);function is(e){if(Pf[e])return Pf[e];if(!li[e])return e;var t=li[e],o;for(o in t)if(t.hasOwnProperty(o)&&o in ZS)return Pf[e]=t[o];return e}var YS=is("animationend"),XS=is("animationiteration"),QS=is("animationstart"),OW=is("transitionrun"),NW=is("transitionstart"),LW=is("transitioncancel"),JS=is("transitionend"),e1=new Map,Ip="abort auxClick beforeToggle 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(" ");Ip.push("scrollEnd");function Ta(e,t){e1.set(e,t),rs(t,[e])}var Wu=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},la=[],ci=0,hh=0;function Id(){for(var e=ci,t=hh=ci=0;t<e;){var o=la[t];la[t++]=null;var a=la[t];la[t++]=null;var n=la[t];la[t++]=null;var r=la[t];if(la[t++]=null,a!==null&&n!==null){var s=a.pending;s===null?n.next=n:(n.next=s.next,s.next=n),a.pending=n}r!==0&&t1(o,n,r)}}function xd(e,t,o,a){la[ci++]=e,la[ci++]=t,la[ci++]=o,la[ci++]=a,hh|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function gh(e,t,o,a){return xd(e,t,o,a),Zu(e)}function ls(e,t){return xd(e,null,null,t),Zu(e)}function t1(e,t,o){e.lanes|=o;var a=e.alternate;a!==null&&(a.lanes|=o);for(var n=!1,r=e.return;r!==null;)r.childLanes|=o,a=r.alternate,a!==null&&(a.childLanes|=o),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(n=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,n&&t!==null&&(n=31-Qo(o),e=r.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=o|536870912),r):null}function Zu(e){if(50<Kl)throw Kl=0,Gp=null,Error(N(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ui={};function RW(e,t,o,a){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wo(e,t,o,a){return new RW(e,t,o,a)}function bh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dn(e,t){var o=e.alternate;return o===null?(o=Wo(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function o1(e,t){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,t=o.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Nu(e,t,o,a,n,r){var s=0;if(a=e,typeof e==="function")bh(e)&&(s=1);else if(typeof e==="string")s=PZ(e,o,Qa.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case cp:return e=Wo(31,o,t,n),e.elementType=cp,e.lanes=r,e;case oi:return Yr(o.children,n,r,t);case wS:s=8,n|=24;break;case sp:return e=Wo(12,o,t,n|2),e.elementType=sp,e.lanes=r,e;case ip:return e=Wo(13,o,t,n),e.elementType=ip,e.lanes=r,e;case lp:return e=Wo(19,o,t,n),e.elementType=lp,e.lanes=r,e;default:if(typeof e==="object"&&e!==null)switch(e.$$typeof){case Cn:s=10;break e;case IS:s=9;break e;case ah:s=11;break e;case nh:s=14;break e;case Yn:s=16,a=null;break e}s=29,o=Error(N(130,e===null?"null":typeof e,"")),a=null}return t=Wo(s,o,t,n),t.elementType=e,t.type=a,t.lanes=r,t}function Yr(e,t,o,a){return e=Wo(7,e,a,t),e.lanes=o,e}function zf(e,t,o){return e=Wo(6,e,null,t),e.lanes=o,e}function a1(e){var t=Wo(18,null,null,0);return t.stateNode=e,t}function Uf(e,t,o){return t=Wo(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hv=new WeakMap;function fa(e,t){if(typeof e==="object"&&e!==null){var o=hv.get(e);if(o!==void 0)return o;return t={value:e,source:t,stack:Y0(t)},hv.set(e,t),t}return{value:e,source:t,stack:Y0(t)}}var di=[],mi=0,Yu=null,Xl=0,ua=[],da=0,gr=null,Za=1,Ya="";function In(e,t){di[mi++]=Xl,di[mi++]=Yu,Yu=e,Xl=t}function n1(e,t,o){ua[da++]=Za,ua[da++]=Ya,ua[da++]=gr,gr=e;var a=Za;e=Ya;var n=32-Qo(a)-1;a&=~(1<<n),o+=1;var r=32-Qo(t)+n;if(30<r){var s=n-n%5;r=(a&(1<<s)-1).toString(32),a>>=s,n-=s,Za=1<<32-Qo(t)+n|o<<n|a,Ya=r+e}else Za=1<<r|o<<n|a,Ya=e}function vh(e){e.return!==null&&(In(e,1),n1(e,1,0))}function Sh(e){for(;e===Yu;)Yu=di[--mi],di[mi]=null,Xl=di[--mi],di[mi]=null;for(;e===gr;)gr=ua[--da],ua[da]=null,Ya=ua[--da],ua[da]=null,Za=ua[--da],ua[da]=null}function r1(e,t){ua[da++]=Za,ua[da++]=Ya,ua[da++]=gr,Za=t.id,Ya=t.overflow,gr=e}var po=null,ot=null,xe=!1,lr=null,pa=!1,xp=Error(N(519));function br(e){var t=Error(N(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ql(fa(t,e)),xp}function gv(e){var{stateNode:t,type:o,memoizedProps:a}=e;switch(t[fo]=e,t[zo]=a,o){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(o=0;o<oc.length;o++)be(oc[o],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),BS(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),PS(t,a.value,a.defaultValue,a.children)}o=a.children,typeof o!=="string"&&typeof o!=="number"&&typeof o!=="bigint"||t.textContent===""+o||a.suppressHydrationWarning===!0||_y(t.textContent,o)?(a.popover!=null&&(be("beforetoggle",t),be("toggle",t)),a.onScroll!=null&&be("scroll",t),a.onScrollEnd!=null&&be("scrollend",t),a.onClick!=null&&(t.onclick=Mn),t=!0):t=!1,t||br(e,!0)}function bv(e){for(po=e.return;po;)switch(po.tag){case 5:case 31:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:po=po.return}}function Xs(e){if(e!==po)return!1;if(!xe)return bv(e),xe=!0,!1;var t=e.tag,o;if(o=t!==3&&t!==27){if(o=t===5)o=e.type,o=!(o!=="form"&&o!=="button")||Yp(e.type,e.memoizedProps);o=!o}if(o&&ot&&br(e),bv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));ot=aS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));ot=aS(e)}else t===27?(t=ot,wr(e.type)?(e=eh,eh=null,ot=e):ot=t):ot=po?ga(e.stateNode.nextSibling):null;return!0}function es(){ot=po=null,xe=!1}function Ff(){var e=lr;return e!==null&&(Ho===null?Ho=e:Ho.push.apply(Ho,e),lr=null),e}function Ql(e){lr===null?lr=[e]:lr.push(e)}var Cp=Ja(null),cs=null,kn=null;function Qn(e,t,o){Xe(Cp,t._currentValue),t._currentValue=o}function Tn(e){e._currentValue=Cp.current,no(Cp)}function Mp(e,t,o){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===o)break;e=e.return}}function kp(e,t,o,a){var n=e.child;n!==null&&(n.return=e);for(;n!==null;){var r=n.dependencies;if(r!==null){var s=n.child;r=r.firstContext;e:for(;r!==null;){var l=r;r=n;for(var c=0;c<t.length;c++)if(l.context===t[c]){r.lanes|=o,l=r.alternate,l!==null&&(l.lanes|=o),Mp(r.return,o,e),a||(s=null);break e}r=l.next}}else if(n.tag===18){if(s=n.return,s===null)throw Error(N(341));s.lanes|=o,r=s.alternate,r!==null&&(r.lanes|=o),Mp(s,o,e),s=null}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===e){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}}function Ri(e,t,o,a){e=null;for(var n=t,r=!1;n!==null;){if(!r){if((n.flags&524288)!==0)r=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var s=n.alternate;if(s===null)throw Error(N(387));if(s=s.memoizedProps,s!==null){var l=n.type;ea(n.pendingProps.value,s.value)||(e!==null?e.push(l):e=[l])}}else if(n===Gu.current){if(s=n.alternate,s===null)throw Error(N(387));s.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(nc):e=[nc])}n=n.return}e!==null&&kp(t,e,o,a),t.flags|=262144}function Xu(e){for(e=e.firstContext;e!==null;){if(!ea(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ts(e){cs=e,kn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ho(e){return s1(cs,e)}function Su(e,t){return cs===null&&ts(e),s1(e,t)}function s1(e,t){var o=t._currentValue;if(t={context:t,memoizedValue:o,next:null},kn===null){if(e===null)throw Error(N(308));kn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else kn=kn.next=t;return o}var BW=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(o,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(o){return o()})}},{unstable_scheduleCallback:HW,unstable_NormalPriority:PW}=Kt,Ft={$$typeof:Cn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yh(){return{controller:new BW,data:new Map,refCount:0}}function fc(e){e.refCount--,e.refCount===0&&HW(PW,function(){e.controller.abort()})}var Pl=null,Dp=0,Ci=0,bi=null;function zW(e,t){if(Pl===null){var o=Pl=[];Dp=0,Ci=Kh(),bi={status:"pending",value:void 0,then:function(a){o.push(a)}}}return Dp++,t.then(vv,vv),t}function vv(){if(--Dp===0&&Pl!==null){bi!==null&&(bi.status="fulfilled");var e=Pl;Pl=null,Ci=0,bi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function UW(e,t){var o=[],a={status:"pending",value:null,reason:null,then:function(n){o.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<o.length;n++)(0,o[n])(t)},function(n){a.status="rejected",a.reason=n;for(n=0;n<o.length;n++)(0,o[n])(void 0)}),a}var Sv=W.S;W.S=function(e,t){yy=Yo(),typeof t==="object"&&t!==null&&typeof t.then==="function"&&zW(e,t),Sv!==null&&Sv(e,t)};var Xr=Ja(null);function wh(){var e=Xr.current;return e!==null?e:Ze.pooledCache}function Lu(e,t){t===null?Xe(Xr,Xr.current):Xe(Xr,t.pool)}function i1(){var e=wh();return e===null?null:{parent:Ft._currentValue,pool:e}}var Bi=Error(N(460)),Ih=Error(N(474)),Cd=Error(N(542)),Qu={then:function(){}};function yv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function l1(e,t,o){switch(o=e[o],o===void 0?e.push(t):o!==t&&(t.then(Mn,Mn),t=o),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Iv(e),e;default:if(typeof t.status==="string")t.then(Mn,Mn);else{if(e=Ze,e!==null&&100<e.shellSuspendCounter)throw Error(N(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Iv(e),e}throw Qr=t,Bi}}function $r(e){try{var t=e._init;return t(e._payload)}catch(o){if(o!==null&&typeof o==="object"&&typeof o.then==="function")throw Qr=o,Bi;throw o}}var Qr=null;function wv(){if(Qr===null)throw Error(N(459));var e=Qr;return Qr=null,e}function Iv(e){if(e===Bi||e===Cd)throw Error(N(483))}var vi=null,Jl=0;function yu(e){var t=Jl;return Jl+=1,vi===null&&(vi=[]),l1(vi,e,t)}function wl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wu(e,t){if(t.$$typeof===M$)throw Error(N(525));throw e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function c1(e){function t(h,g){if(e){var y=h.deletions;y===null?(h.deletions=[g],h.flags|=16):y.push(g)}}function o(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function a(h){for(var g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function n(h,g){return h=Dn(h,g),h.index=0,h.sibling=null,h}function r(h,g,y){if(h.index=y,!e)return h.flags|=1048576,g;if(y=h.alternate,y!==null)return y=y.index,y<g?(h.flags|=67108866,g):y;return h.flags|=67108866,g}function s(h){return e&&h.alternate===null&&(h.flags|=67108866),h}function l(h,g,y,I){if(g===null||g.tag!==6)return g=zf(y,h.mode,I),g.return=h,g;return g=n(g,y),g.return=h,g}function c(h,g,y,I){var k=y.type;if(k===oi)return d(h,g,y.props.children,I,y.key);if(g!==null&&(g.elementType===k||typeof k==="object"&&k!==null&&k.$$typeof===Yn&&$r(k)===g.type))return g=n(g,y.props),wl(g,y),g.return=h,g;return g=Nu(y.type,y.key,y.props,null,h.mode,I),wl(g,y),g.return=h,g}function u(h,g,y,I){if(g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation)return g=Uf(y,h.mode,I),g.return=h,g;return g=n(g,y.children||[]),g.return=h,g}function d(h,g,y,I,k){if(g===null||g.tag!==7)return g=Yr(y,h.mode,I,k),g.return=h,g;return g=n(g,y),g.return=h,g}function m(h,g,y){if(typeof g==="string"&&g!==""||typeof g==="number"||typeof g==="bigint")return g=zf(""+g,h.mode,y),g.return=h,g;if(typeof g==="object"&&g!==null){switch(g.$$typeof){case fu:return y=Nu(g.type,g.key,g.props,null,h.mode,y),wl(y,g),y.return=h,y;case Ml:return g=Uf(g,h.mode,y),g.return=h,g;case Yn:return g=$r(g),m(h,g,y)}if(kl(g)||Sl(g))return g=Yr(g,h.mode,y,null),g.return=h,g;if(typeof g.then==="function")return m(h,yu(g),y);if(g.$$typeof===Cn)return m(h,Su(h,g),y);wu(h,g)}return null}function f(h,g,y,I){var k=g!==null?g.key:null;if(typeof y==="string"&&y!==""||typeof y==="number"||typeof y==="bigint")return k!==null?null:l(h,g,""+y,I);if(typeof y==="object"&&y!==null){switch(y.$$typeof){case fu:return y.key===k?c(h,g,y,I):null;case Ml:return y.key===k?u(h,g,y,I):null;case Yn:return y=$r(y),f(h,g,y,I)}if(kl(y)||Sl(y))return k!==null?null:d(h,g,y,I,null);if(typeof y.then==="function")return f(h,g,yu(y),I);if(y.$$typeof===Cn)return f(h,g,Su(h,y),I);wu(h,y)}return null}function p(h,g,y,I,k){if(typeof I==="string"&&I!==""||typeof I==="number"||typeof I==="bigint")return h=h.get(y)||null,l(g,h,""+I,k);if(typeof I==="object"&&I!==null){switch(I.$$typeof){case fu:return h=h.get(I.key===null?y:I.key)||null,c(g,h,I,k);case Ml:return h=h.get(I.key===null?y:I.key)||null,u(g,h,I,k);case Yn:return I=$r(I),p(h,g,y,I,k)}if(kl(I)||Sl(I))return h=h.get(y)||null,d(g,h,I,k,null);if(typeof I.then==="function")return p(h,g,y,yu(I),k);if(I.$$typeof===Cn)return p(h,g,y,Su(g,I),k);wu(g,I)}return null}function b(h,g,y,I){for(var k=null,C=null,D=g,M=g=0,A=null;D!==null&&M<y.length;M++){D.index>M?(A=D,D=null):A=D.sibling;var E=f(h,D,y[M],I);if(E===null){D===null&&(D=A);break}e&&D&&E.alternate===null&&t(h,D),g=r(E,g,M),C===null?k=E:C.sibling=E,C=E,D=A}if(M===y.length)return o(h,D),xe&&In(h,M),k;if(D===null){for(;M<y.length;M++)D=m(h,y[M],I),D!==null&&(g=r(D,g,M),C===null?k=D:C.sibling=D,C=D);return xe&&In(h,M),k}for(D=a(D);M<y.length;M++)A=p(D,h,M,y[M],I),A!==null&&(e&&A.alternate!==null&&D.delete(A.key===null?M:A.key),g=r(A,g,M),C===null?k=A:C.sibling=A,C=A);return e&&D.forEach(function(j){return t(h,j)}),xe&&In(h,M),k}function v(h,g,y,I){if(y==null)throw Error(N(151));for(var k=null,C=null,D=g,M=g=0,A=null,E=y.next();D!==null&&!E.done;M++,E=y.next()){D.index>M?(A=D,D=null):A=D.sibling;var j=f(h,D,E.value,I);if(j===null){D===null&&(D=A);break}e&&D&&j.alternate===null&&t(h,D),g=r(j,g,M),C===null?k=j:C.sibling=j,C=j,D=A}if(E.done)return o(h,D),xe&&In(h,M),k;if(D===null){for(;!E.done;M++,E=y.next())E=m(h,E.value,I),E!==null&&(g=r(E,g,M),C===null?k=E:C.sibling=E,C=E);return xe&&In(h,M),k}for(D=a(D);!E.done;M++,E=y.next())E=p(D,h,M,E.value,I),E!==null&&(e&&E.alternate!==null&&D.delete(E.key===null?M:E.key),g=r(E,g,M),C===null?k=E:C.sibling=E,C=E);return e&&D.forEach(function(de){return t(h,de)}),xe&&In(h,M),k}function S(h,g,y,I){if(typeof y==="object"&&y!==null&&y.type===oi&&y.key===null&&(y=y.props.children),typeof y==="object"&&y!==null){switch(y.$$typeof){case fu:e:{for(var k=y.key;g!==null;){if(g.key===k){if(k=y.type,k===oi){if(g.tag===7){o(h,g.sibling),I=n(g,y.props.children),I.return=h,h=I;break e}}else if(g.elementType===k||typeof k==="object"&&k!==null&&k.$$typeof===Yn&&$r(k)===g.type){o(h,g.sibling),I=n(g,y.props),wl(I,y),I.return=h,h=I;break e}o(h,g);break}else t(h,g);g=g.sibling}y.type===oi?(I=Yr(y.props.children,h.mode,I,y.key),I.return=h,h=I):(I=Nu(y.type,y.key,y.props,null,h.mode,I),wl(I,y),I.return=h,h=I)}return s(h);case Ml:e:{for(k=y.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){o(h,g.sibling),I=n(g,y.children||[]),I.return=h,h=I;break e}else{o(h,g);break}else t(h,g);g=g.sibling}I=Uf(y,h.mode,I),I.return=h,h=I}return s(h);case Yn:return y=$r(y),S(h,g,y,I)}if(kl(y))return b(h,g,y,I);if(Sl(y)){if(k=Sl(y),typeof k!=="function")throw Error(N(150));return y=k.call(y),v(h,g,y,I)}if(typeof y.then==="function")return S(h,g,yu(y),I);if(y.$$typeof===Cn)return S(h,g,Su(h,y),I);wu(h,y)}return typeof y==="string"&&y!==""||typeof y==="number"||typeof y==="bigint"?(y=""+y,g!==null&&g.tag===6?(o(h,g.sibling),I=n(g,y),I.return=h,h=I):(o(h,g),I=zf(y,h.mode,I),I.return=h,h=I),s(h)):o(h,g)}return function(h,g,y,I){try{Jl=0;var k=S(h,g,y,I);return vi=null,k}catch(D){if(D===Bi||D===Cd)throw D;var C=Wo(29,D,null,h.mode);return C.lanes=I,C.return=h,C}finally{}}}var os=c1(!0),u1=c1(!1),Xn=!1;function xh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function cr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ur(e,t,o){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Te&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Zu(e),t1(e,null,o),t}return xd(e,a,t,o),Zu(e)}function zl(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,TS(e,o)}}function _f(e,t){var o=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,o===a)){var n=null,r=null;if(o=o.firstBaseUpdate,o!==null){do{var s={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};r===null?n=r=s:r=r.next=s,o=o.next}while(o!==null);r===null?n=r=t:r=r.next=t}else n=r=t;o={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}var Ap=!1;function Ul(){if(Ap){var e=bi;if(e!==null)throw e}}function Fl(e,t,o,a){Ap=!1;var n=e.updateQueue;Xn=!1;var{firstBaseUpdate:r,lastBaseUpdate:s}=n,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?r=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(r!==null){var m=n.baseState;s=0,d=u=c=null,l=r;do{var f=l.lane&-536870913,p=f!==l.lane;if(p?(ye&f)===f:(a&f)===f){f!==0&&f===Ci&&(Ap=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var b=e,v=l;f=t;var S=o;switch(v.tag){case 1:if(b=v.payload,typeof b==="function"){m=b.call(S,m,f);break e}m=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=v.payload,f=typeof b==="function"?b.call(S,m,f):b,f===null||f===void 0)break e;m=at({},m,f);break e;case 2:Xn=!0}}f=l.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=n.callbacks,p===null?n.callbacks=[f]:p.push(f))}else p={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=m):d=d.next=p,s|=f;if(l=l.next,l===null)if(l=n.shared.pending,l===null)break;else p=l,l=p.next,p.next=null,n.lastBaseUpdate=p,n.shared.pending=null}while(1);d===null&&(c=m),n.baseState=c,n.firstBaseUpdate=u,n.lastBaseUpdate=d,r===null&&(n.shared.lanes=0),Sr|=s,e.lanes=s,e.memoizedState=m}}function d1(e,t){if(typeof e!=="function")throw Error(N(191,e));e.call(t)}function m1(e,t){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)d1(o[e],t)}var Mi=Ja(null),Ju=Ja(0);function xv(e,t){e=Rn,Xe(Ju,e),Xe(Mi,t),Rn=e|t.baseLanes}function Ep(){Xe(Ju,Rn),Xe(Mi,Mi.current)}function Ch(){Rn=Ju.current,no(Mi),no(Ju)}var ta=Ja(null),ha=null;function Jn(e){var t=e.alternate;Xe(gt,gt.current&1),Xe(ta,e),ha===null&&(t===null||Mi.current!==null?ha=e:t.memoizedState!==null&&(ha=e))}function Op(e){Xe(gt,gt.current),Xe(ta,e),ha===null&&(ha=e)}function f1(e){e.tag===22?(Xe(gt,gt.current),Xe(ta,e),ha===null&&(ha=e)):er(e)}function er(){Xe(gt,gt.current),Xe(ta,ta.current)}function $o(e){no(ta),ha===e&&(ha=null),no(gt)}var gt=Ja(0);function ed(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Qp(o)||Jp(o)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 On=0,re=null,Ve=null,zt=null,td=!1,Si=!1,as=!1,od=0,ec=0,yi=null,FW=0;function mt(){throw Error(N(321))}function Mh(e,t){if(t===null)return!1;for(var o=0;o<t.length&&o<e.length;o++)if(!ea(e[o],t[o]))return!1;return!0}function kh(e,t,o,a,n,r){return On=r,re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?V1:Ph,as=!1,r=o(a,n),as=!1,Si&&(r=h1(t,o,a,n)),p1(e),r}function p1(e){W.H=tc;var t=Ve!==null&&Ve.next!==null;if(On=0,zt=Ve=re=null,td=!1,ec=0,yi=null,t)throw Error(N(300));e===null||_t||(e=e.dependencies,e!==null&&Xu(e)&&(_t=!0))}function h1(e,t,o,a){re=e;var n=0;do{if(Si&&(yi=null),ec=0,Si=!1,25<=n)throw Error(N(301));if(n+=1,zt=Ve=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}W.H=K1,r=t(o,a)}while(Si);return r}function _W(){var e=W.H,t=e.useState()[0];return t=typeof t.then==="function"?pc(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(re.flags|=1024),t}function Dh(){var e=od!==0;return od=0,e}function Th(e,t,o){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o}function Ah(e){if(td){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}td=!1}On=0,zt=Ve=re=null,Si=!1,ec=od=0,yi=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?re.memoizedState=zt=e:zt=zt.next=e,zt}function bt(){if(Ve===null){var e=re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=zt===null?re.memoizedState:zt.next;if(t!==null)zt=t,Ve=e;else{if(e===null){if(re.alternate===null)throw Error(N(467));throw Error(N(310))}Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},zt===null?re.memoizedState=zt=e:zt=zt.next=e}return zt}function Md(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pc(e){var t=ec;return ec+=1,yi===null&&(yi=[]),e=l1(yi,e,t),t=re,(zt===null?t.memoizedState:zt.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?V1:Ph),e}function kd(e){if(e!==null&&typeof e==="object"){if(typeof e.then==="function")return pc(e);if(e.$$typeof===Cn)return ho(e)}throw Error(N(438,String(e)))}function Eh(e){var t=null,o=re.updateQueue;if(o!==null&&(t=o.memoCache),t==null){var a=re.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),o===null&&(o=Md(),re.updateQueue=o),o.memoCache=t,o=t.data[t.index],o===void 0)for(o=t.data[t.index]=Array(e),a=0;a<e;a++)o[a]=k$;return t.index++,o}function Nn(e,t){return typeof t==="function"?t(e):t}function Ru(e){var t=bt();return Oh(t,Ve,e)}function Oh(e,t,o){var a=e.queue;if(a===null)throw Error(N(311));a.lastRenderedReducer=o;var n=e.baseQueue,r=a.pending;if(r!==null){if(n!==null){var s=n.next;n.next=r.next,r.next=s}t.baseQueue=n=r,a.pending=null}if(r=e.baseState,n===null)e.memoizedState=r;else{t=n.next;var l=s=null,c=null,u=t,d=!1;do{var m=u.lane&-536870913;if(m!==u.lane?(ye&m)===m:(On&m)===m){var f=u.revertLane;if(f===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),m===Ci&&(d=!0);else if((On&f)===f){u=u.next,f===Ci&&(d=!0);continue}else m={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=m,s=r):c=c.next=m,re.lanes|=f,Sr|=f;m=u.action,as&&o(r,m),r=u.hasEagerState?u.eagerState:o(r,m)}else f={lane:m,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,s=r):c=c.next=f,re.lanes|=m,Sr|=m;u=u.next}while(u!==null&&u!==t);if(c===null?s=r:c.next=l,!ea(r,e.memoizedState)&&(_t=!0,d&&(o=bi,o!==null)))throw o;e.memoizedState=r,e.baseState=s,e.baseQueue=c,a.lastRenderedState=r}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function jf(e){var t=bt(),o=t.queue;if(o===null)throw Error(N(311));o.lastRenderedReducer=e;var{dispatch:a,pending:n}=o,r=t.memoizedState;if(n!==null){o.pending=null;var s=n=n.next;do r=e(r,s.action),s=s.next;while(s!==n);ea(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),o.lastRenderedState=r}return[r,a]}function g1(e,t,o){var a=re,n=bt(),r=xe;if(r){if(o===void 0)throw Error(N(407));o=o()}else o=t();var s=!ea((Ve||n).memoizedState,o);if(s&&(n.memoizedState=o,_t=!0),n=n.queue,Nh(S1.bind(null,a,n,e),[e]),n.getSnapshot!==t||s||zt!==null&&zt.memoizedState.tag&1){if(a.flags|=2048,ki(9,{destroy:void 0},v1.bind(null,a,n,o,t),null),Ze===null)throw Error(N(349));r||(On&127)!==0||b1(a,t,o)}return o}function b1(e,t,o){e.flags|=16384,e={getSnapshot:t,value:o},t=re.updateQueue,t===null?(t=Md(),re.updateQueue=t,t.stores=[e]):(o=t.stores,o===null?t.stores=[e]:o.push(e))}function v1(e,t,o,a){t.value=o,t.getSnapshot=a,y1(t)&&w1(e)}function S1(e,t,o){return o(function(){y1(t)&&w1(e)})}function y1(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!ea(e,o)}catch(a){return!0}}function w1(e){var t=ls(e,2);t!==null&&Po(t,e,2)}function Np(e){var t=Do();if(typeof e==="function"){var o=e;if(e=o(),as){or(!0);try{o()}finally{or(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:e},t}function I1(e,t,o,a){return e.baseState=o,Oh(e,Ve,typeof a==="function"?a:Nn)}function jW(e,t,o,a,n){if(Td(e))throw Error(N(485));if(e=t.action,e!==null){var r={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){r.listeners.push(s)}};W.T!==null?o(!0):r.isTransition=!1,a(r),o=t.pending,o===null?(r.next=t.pending=r,x1(t,r)):(r.next=o.next,t.pending=o.next=r)}}function x1(e,t){var{action:o,payload:a}=t,n=e.state;if(t.isTransition){var r=W.T,s={};W.T=s;try{var l=o(n,a),c=W.S;c!==null&&c(s,l),Cv(e,t,l)}catch(u){Lp(e,t,u)}finally{r!==null&&s.types!==null&&(r.types=s.types),W.T=r}}else try{r=o(n,a),Cv(e,t,r)}catch(u){Lp(e,t,u)}}function Cv(e,t,o){o!==null&&typeof o==="object"&&typeof o.then==="function"?o.then(function(a){Mv(e,t,a)},function(a){return Lp(e,t,a)}):Mv(e,t,o)}function Mv(e,t,o){t.status="fulfilled",t.value=o,C1(t),e.state=o,t=e.pending,t!==null&&(o=t.next,o===t?e.pending=null:(o=o.next,t.next=o,x1(e,o)))}function Lp(e,t,o){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=o,C1(t),t=t.next;while(t!==a)}e.action=null}function C1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function M1(e,t){return t}function kv(e,t){if(xe){var o=Ze.formState;if(o!==null){e:{var a=re;if(xe){if(ot){t:{var n=ot;for(var r=pa;n.nodeType!==8;){if(!r){n=null;break t}if(n=ga(n.nextSibling),n===null){n=null;break t}}r=n.data,n=r==="F!"||r==="F"?n:null}if(n){ot=ga(n.nextSibling),a=n.data==="F!";break e}}br(a)}a=!1}a&&(t=o[0])}}return o=Do(),o.memoizedState=o.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:M1,lastRenderedState:t},o.queue=a,o=_1.bind(null,re,a),a.dispatch=o,a=Np(!1),r=Hh.bind(null,re,!1,a.queue),a=Do(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,o=jW.bind(null,re,n,r,o),n.dispatch=o,a.memoizedState=e,[t,o,!1]}function Dv(e){var t=bt();return k1(t,Ve,e)}function k1(e,t,o){if(t=Oh(e,t,M1)[0],e=Ru(Nn)[0],typeof t==="object"&&t!==null&&typeof t.then==="function")try{var a=pc(t)}catch(s){if(s===Bi)throw Cd;throw s}else a=t;t=bt();var n=t.queue,r=n.dispatch;return o!==t.memoizedState&&(re.flags|=2048,ki(9,{destroy:void 0},GW.bind(null,n,o),null)),[a,r,e]}function GW(e,t){e.action=t}function Tv(e){var t=bt(),o=Ve;if(o!==null)return k1(t,o,e);bt(),t=t.memoizedState,o=bt();var a=o.queue.dispatch;return o.memoizedState=e,[t,a,!1]}function ki(e,t,o,a){return e={tag:e,create:o,deps:a,inst:t,next:null},t=re.updateQueue,t===null&&(t=Md(),re.updateQueue=t),o=t.lastEffect,o===null?t.lastEffect=e.next=e:(a=o.next,o.next=e,e.next=a,t.lastEffect=e),e}function D1(){return bt().memoizedState}function Bu(e,t,o,a){var n=Do();re.flags|=e,n.memoizedState=ki(1|t,{destroy:void 0},o,a===void 0?null:a)}function Dd(e,t,o,a){var n=bt();a=a===void 0?null:a;var r=n.memoizedState.inst;Ve!==null&&a!==null&&Mh(a,Ve.memoizedState.deps)?n.memoizedState=ki(t,r,o,a):(re.flags|=e,n.memoizedState=ki(1|t,r,o,a))}function Av(e,t){Bu(8390656,8,e,t)}function Nh(e,t){Dd(2048,8,e,t)}function VW(e){re.flags|=4;var t=re.updateQueue;if(t===null)t=Md(),re.updateQueue=t,t.events=[e];else{var o=t.events;o===null?t.events=[e]:o.push(e)}}function T1(e){var t=bt().memoizedState;return VW({ref:t,nextImpl:e}),function(){if((Te&2)!==0)throw Error(N(440));return t.impl.apply(void 0,arguments)}}function A1(e,t){return Dd(4,2,e,t)}function E1(e,t){return Dd(4,4,e,t)}function O1(e,t){if(typeof t==="function"){e=e();var o=t(e);return function(){typeof o==="function"?o():t(null)}}if(t!==null&&t!==void 0)return e=e(),t.current=e,function(){t.current=null}}function N1(e,t,o){o=o!==null&&o!==void 0?o.concat([e]):null,Dd(4,4,O1.bind(null,t,e),o)}function Lh(){}function L1(e,t){var o=bt();t=t===void 0?null:t;var a=o.memoizedState;if(t!==null&&Mh(t,a[1]))return a[0];return o.memoizedState=[e,t],e}function R1(e,t){var o=bt();t=t===void 0?null:t;var a=o.memoizedState;if(t!==null&&Mh(t,a[1]))return a[0];if(a=e(),as){or(!0);try{e()}finally{or(!1)}}return o.memoizedState=[a,t],a}function Rh(e,t,o){if(o===void 0||(On&1073741824)!==0&&(ye&261930)===0)return e.memoizedState=t;return e.memoizedState=o,e=Iy(),re.lanes|=e,Sr|=e,o}function B1(e,t,o,a){if(ea(o,t))return o;if(Mi.current!==null)return e=Rh(e,o,a),ea(e,t)||(_t=!0),e;if((On&42)===0||(On&1073741824)!==0&&(ye&261930)===0)return _t=!0,e.memoizedState=o;return e=Iy(),re.lanes|=e,Sr|=e,t}function H1(e,t,o,a,n){var r=Ae.p;Ae.p=r!==0&&8>r?r:8;var s=W.T,l={};W.T=l,Hh(e,!1,t,o);try{var c=n(),u=W.S;if(u!==null&&u(l,c),c!==null&&typeof c==="object"&&typeof c.then==="function"){var d=UW(c,a);_l(e,t,d,Jo(e))}else _l(e,t,a,Jo(e))}catch(m){_l(e,t,{then:function(){},status:"rejected",reason:m},Jo())}finally{Ae.p=r,s!==null&&l.types!==null&&(s.types=l.types),W.T=s}}function KW(){}function Rp(e,t,o,a){if(e.tag!==5)throw Error(N(476));var n=P1(e).queue;H1(e,n,t,Zr,o===null?KW:function(){return z1(e),o(a)})}function P1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Zr,baseState:Zr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:Zr},next:null};var o={};return t.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:o},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function z1(e){var t=P1(e);t.next===null&&(t=e.alternate.memoizedState),_l(e,t.next.queue,{},Jo())}function Bh(){return ho(nc)}function U1(){return bt().memoizedState}function F1(){return bt().memoizedState}function qW(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var o=Jo();e=cr(o);var a=ur(t,e,o);a!==null&&(Po(a,t,o),zl(a,t,o)),t={cache:yh()},e.payload=t;return}t=t.return}}function $W(e,t,o){var a=Jo();o={lane:a,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Td(e)?j1(t,o):(o=gh(e,t,o,a),o!==null&&(Po(o,e,a),G1(o,t,a)))}function _1(e,t,o){var a=Jo();_l(e,t,o,a)}function _l(e,t,o,a){var n={lane:a,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Td(e))j1(t,n);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var s=t.lastRenderedState,l=r(s,o);if(n.hasEagerState=!0,n.eagerState=l,ea(l,s))return xd(e,t,n,0),Ze===null&&Id(),!1}catch(c){}finally{}if(o=gh(e,t,n,a),o!==null)return Po(o,e,a),G1(o,t,a),!0}return!1}function Hh(e,t,o,a){if(a={lane:2,revertLane:Kh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Td(e)){if(t)throw Error(N(479))}else t=gh(e,o,a,2),t!==null&&Po(t,e,2)}function Td(e){var t=e.alternate;return e===re||t!==null&&t===re}function j1(e,t){Si=td=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function G1(e,t,o){if((o&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,TS(e,o)}}var tc={readContext:ho,use:kd,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt};tc.useEffectEvent=mt;var V1={readContext:ho,use:kd,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:ho,useEffect:Av,useImperativeHandle:function(e,t,o){o=o!==null&&o!==void 0?o.concat([e]):null,Bu(4194308,4,O1.bind(null,t,e),o)},useLayoutEffect:function(e,t){return Bu(4194308,4,e,t)},useInsertionEffect:function(e,t){Bu(4,2,e,t)},useMemo:function(e,t){var o=Do();t=t===void 0?null:t;var a=e();if(as){or(!0);try{e()}finally{or(!1)}}return o.memoizedState=[a,t],a},useReducer:function(e,t,o){var a=Do();if(o!==void 0){var n=o(t);if(as){or(!0);try{o(t)}finally{or(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=$W.bind(null,re,e),[a.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Np(e);var t=e.queue,o=_1.bind(null,re,t);return t.dispatch=o,[e.memoizedState,o]},useDebugValue:Lh,useDeferredValue:function(e,t){var o=Do();return Rh(o,e,t)},useTransition:function(){var e=Np(!1);return e=H1.bind(null,re,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,o){var a=re,n=Do();if(xe){if(o===void 0)throw Error(N(407));o=o()}else{if(o=t(),Ze===null)throw Error(N(349));(ye&127)!==0||b1(a,t,o)}n.memoizedState=o;var r={value:o,getSnapshot:t};return n.queue=r,Av(S1.bind(null,a,r,e),[e]),a.flags|=2048,ki(9,{destroy:void 0},v1.bind(null,a,r,o,t),null),o},useId:function(){var e=Do(),t=Ze.identifierPrefix;if(xe){var o=Ya,a=Za;o=(a&~(1<<32-Qo(a)-1)).toString(32)+o,t="_"+t+"R_"+o,o=od++,0<o&&(t+="H"+o.toString(32)),t+="_"}else o=FW++,t="_"+t+"r_"+o.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bh,useFormState:kv,useActionState:kv,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=o,t=Hh.bind(null,re,!0,o),o.dispatch=t,[e,t]},useMemoCache:Eh,useCacheRefresh:function(){return Do().memoizedState=qW.bind(null,re)},useEffectEvent:function(e){var t=Do(),o={impl:e};return t.memoizedState=o,function(){if((Te&2)!==0)throw Error(N(440));return o.impl.apply(void 0,arguments)}}},Ph={readContext:ho,use:kd,useCallback:L1,useContext:ho,useEffect:Nh,useImperativeHandle:N1,useInsertionEffect:A1,useLayoutEffect:E1,useMemo:R1,useReducer:Ru,useRef:D1,useState:function(){return Ru(Nn)},useDebugValue:Lh,useDeferredValue:function(e,t){var o=bt();return B1(o,Ve.memoizedState,e,t)},useTransition:function(){var e=Ru(Nn)[0],t=bt().memoizedState;return[typeof e==="boolean"?e:pc(e),t]},useSyncExternalStore:g1,useId:U1,useHostTransitionStatus:Bh,useFormState:Dv,useActionState:Dv,useOptimistic:function(e,t){var o=bt();return I1(o,Ve,e,t)},useMemoCache:Eh,useCacheRefresh:F1};Ph.useEffectEvent=T1;var K1={readContext:ho,use:kd,useCallback:L1,useContext:ho,useEffect:Nh,useImperativeHandle:N1,useInsertionEffect:A1,useLayoutEffect:E1,useMemo:R1,useReducer:jf,useRef:D1,useState:function(){return jf(Nn)},useDebugValue:Lh,useDeferredValue:function(e,t){var o=bt();return Ve===null?Rh(o,e,t):B1(o,Ve.memoizedState,e,t)},useTransition:function(){var e=jf(Nn)[0],t=bt().memoizedState;return[typeof e==="boolean"?e:pc(e),t]},useSyncExternalStore:g1,useId:U1,useHostTransitionStatus:Bh,useFormState:Tv,useActionState:Tv,useOptimistic:function(e,t){var o=bt();if(Ve!==null)return I1(o,Ve,e,t);return o.baseState=e,[e,o.queue.dispatch]},useMemoCache:Eh,useCacheRefresh:F1};K1.useEffectEvent=T1;function Gf(e,t,o,a){t=e.memoizedState,o=o(a,t),o=o===null||o===void 0?t:at({},t,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Bp={enqueueSetState:function(e,t,o){e=e._reactInternals;var a=Jo(),n=cr(a);n.payload=t,o!==void 0&&o!==null&&(n.callback=o),t=ur(e,n,a),t!==null&&(Po(t,e,a),zl(t,e,a))},enqueueReplaceState:function(e,t,o){e=e._reactInternals;var a=Jo(),n=cr(a);n.tag=1,n.payload=t,o!==void 0&&o!==null&&(n.callback=o),t=ur(e,n,a),t!==null&&(Po(t,e,a),zl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var o=Jo(),a=cr(o);a.tag=2,t!==void 0&&t!==null&&(a.callback=t),t=ur(e,a,o),t!==null&&(Po(t,e,o),zl(t,e,o))}};function Ev(e,t,o,a,n,r,s){return e=e.stateNode,typeof e.shouldComponentUpdate==="function"?e.shouldComponentUpdate(a,r,s):t.prototype&&t.prototype.isPureReactComponent?!Yl(o,a)||!Yl(n,r):!0}function Ov(e,t,o,a){e=t.state,typeof t.componentWillReceiveProps==="function"&&t.componentWillReceiveProps(o,a),typeof t.UNSAFE_componentWillReceiveProps==="function"&&t.UNSAFE_componentWillReceiveProps(o,a),t.state!==e&&Bp.enqueueReplaceState(t,t.state,null)}function ns(e,t){var o=t;if("ref"in t){o={};for(var a in t)a!=="ref"&&(o[a]=t[a])}if(e=e.defaultProps){o===t&&(o=at({},o));for(var n in e)o[n]===void 0&&(o[n]=e[n])}return o}function q1(e){Wu(e)}function $1(e){console.error(e)}function W1(e){Wu(e)}function ad(e,t){try{var o=e.onUncaughtError;o(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Nv(e,t,o){try{var a=e.onCaughtError;a(o.value,{componentStack:o.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Hp(e,t,o){return o=cr(o),o.tag=3,o.payload={element:null},o.callback=function(){ad(e,t)},o}function Z1(e){return e=cr(e),e.tag=3,e}function Y1(e,t,o,a){var n=o.type.getDerivedStateFromError;if(typeof n==="function"){var r=a.value;e.payload=function(){return n(r)},e.callback=function(){Nv(t,o,a)}}var s=o.stateNode;s!==null&&typeof s.componentDidCatch==="function"&&(e.callback=function(){Nv(t,o,a),typeof n!=="function"&&(dr===null?dr=new Set([this]):dr.add(this));var l=a.stack;this.componentDidCatch(a.value,{componentStack:l!==null?l:""})})}function WW(e,t,o,a,n){if(o.flags|=32768,a!==null&&typeof a==="object"&&typeof a.then==="function"){if(t=o.alternate,t!==null&&Ri(t,o,n,!0),o=ta.current,o!==null){switch(o.tag){case 31:case 13:return ha===null?ld():o.alternate===null&&ft===0&&(ft=3),o.flags&=-257,o.flags|=65536,o.lanes=n,a===Qu?o.flags|=16384:(t=o.updateQueue,t===null?o.updateQueue=new Set([a]):t.add(a),ep(e,a,n)),!1;case 22:return o.flags|=65536,a===Qu?o.flags|=16384:(t=o.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},o.updateQueue=t):(o=t.retryQueue,o===null?t.retryQueue=new Set([a]):o.add(a)),ep(e,a,n)),!1}throw Error(N(435,o.tag))}return ep(e,a,n),ld(),!1}if(xe)return t=ta.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==xp&&(e=Error(N(422),{cause:a}),Ql(fa(e,o)))):(a!==xp&&(t=Error(N(423),{cause:a}),Ql(fa(t,o))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=fa(a,o),n=Hp(e.stateNode,a,n),_f(e,n),ft!==4&&(ft=2)),!1;var r=Error(N(520),{cause:a});if(r=fa(r,o),Vl===null?Vl=[r]:Vl.push(r),ft!==4&&(ft=2),t===null)return!0;a=fa(a,o),o=t;do{switch(o.tag){case 3:return o.flags|=65536,e=n&-n,o.lanes|=e,e=Hp(o.stateNode,a,e),_f(o,e),!1;case 1:if(t=o.type,r=o.stateNode,(o.flags&128)===0&&(typeof t.getDerivedStateFromError==="function"||r!==null&&typeof r.componentDidCatch==="function"&&(dr===null||!dr.has(r))))return o.flags|=65536,n&=-n,o.lanes|=n,n=Z1(n),Y1(n,e,o,a),_f(o,n),!1}o=o.return}while(o!==null);return!1}var zh=Error(N(461)),_t=!1;function mo(e,t,o,a){t.child=e===null?u1(t,null,o,a):os(t,e.child,o,a)}function Lv(e,t,o,a,n){o=o.render;var r=t.ref;if("ref"in a){var s={};for(var l in a)l!=="ref"&&(s[l]=a[l])}else s=a;if(ts(t),a=kh(e,t,o,s,r,n),l=Dh(),e!==null&&!_t)return Th(e,t,n),Ln(e,t,n);return xe&&l&&vh(t),t.flags|=1,mo(e,t,a,n),t.child}function Rv(e,t,o,a,n){if(e===null){var r=o.type;if(typeof r==="function"&&!bh(r)&&r.defaultProps===void 0&&o.compare===null)return t.tag=15,t.type=r,X1(e,t,r,a,n);return e=Nu(o.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e}if(r=e.child,!Uh(e,n)){var s=r.memoizedProps;if(o=o.compare,o=o!==null?o:Yl,o(s,a)&&e.ref===t.ref)return Ln(e,t,n)}return t.flags|=1,e=Dn(r,a),e.ref=t.ref,e.return=t,t.child=e}function X1(e,t,o,a,n){if(e!==null){var r=e.memoizedProps;if(Yl(r,a)&&e.ref===t.ref)if(_t=!1,t.pendingProps=a=r,Uh(e,n))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,Ln(e,t,n)}return Pp(e,t,o,a,n)}function Q1(e,t,o,a){var n=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|o:o,e!==null){a=t.child=e.child;for(n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~r}else a=0,t.child=null;return Bv(e,t,r,o,a)}if((o&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Lu(t,r!==null?r.cachePool:null),r!==null?xv(t,r):Ep(),f1(t);else return a=t.lanes=536870912,Bv(e,t,r!==null?r.baseLanes|o:o,o,a)}else r!==null?(Lu(t,r.cachePool),xv(t,r),er(t),t.memoizedState=null):(e!==null&&Lu(t,null),Ep(),er(t));return mo(e,t,n,o),t.child}function El(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bv(e,t,o,a,n){var r=wh();return r=r===null?null:{parent:Ft._currentValue,pool:r},t.memoizedState={baseLanes:o,cachePool:r},e!==null&&Lu(t,null),Ep(),f1(t),e!==null&&Ri(e,t,a,!0),t.childLanes=n,null}function Hu(e,t){return t=nd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hv(e,t,o){return os(t,e.child,null,o),e=Hu(t,t.pendingProps),e.flags|=2,$o(t),t.memoizedState=null,e}function ZW(e,t,o){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(xe){if(a.mode==="hidden")return e=Hu(t,a),t.lanes=536870912,El(null,e);if(Op(t),(e=ot)?(e=Vy(e,pa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gr!==null?{id:Za,overflow:Ya}:null,retryLane:536870912,hydrationErrors:null},o=a1(e),o.return=t,t.child=o,po=t,ot=null)):e=null,e===null)throw br(t);return t.lanes=536870912,null}return Hu(t,a)}var r=e.memoizedState;if(r!==null){var s=r.dehydrated;if(Op(t),n)if(t.flags&256)t.flags&=-257,t=Hv(e,t,o);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(N(558));else if(_t||Ri(e,t,o,!1),n=(o&e.childLanes)!==0,_t||n){if(a=Ze,a!==null&&(s=AS(a,o),s!==0&&s!==r.retryLane))throw r.retryLane=s,ls(e,s),Po(a,e,s),zh;ld(),t=Hv(e,t,o)}else e=r.treeContext,ot=ga(s.nextSibling),po=t,xe=!0,lr=null,pa=!1,e!==null&&r1(t,e),t=Hu(t,a),t.flags|=4096;return t}return e=Dn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pu(e,t){var o=t.ref;if(o===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof o!=="function"&&typeof o!=="object")throw Error(N(284));if(e===null||e.ref!==o)t.flags|=4194816}}function Pp(e,t,o,a,n){if(ts(t),o=kh(e,t,o,a,void 0,n),a=Dh(),e!==null&&!_t)return Th(e,t,n),Ln(e,t,n);return xe&&a&&vh(t),t.flags|=1,mo(e,t,o,n),t.child}function Pv(e,t,o,a,n,r){if(ts(t),t.updateQueue=null,o=h1(t,a,o,n),p1(e),a=Dh(),e!==null&&!_t)return Th(e,t,r),Ln(e,t,r);return xe&&a&&vh(t),t.flags|=1,mo(e,t,o,r),t.child}function zv(e,t,o,a,n){if(ts(t),t.stateNode===null){var r=ui,s=o.contextType;typeof s==="object"&&s!==null&&(r=ho(s)),r=new o(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Bp,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},xh(t),s=o.contextType,r.context=typeof s==="object"&&s!==null?ho(s):ui,r.state=t.memoizedState,s=o.getDerivedStateFromProps,typeof s==="function"&&(Gf(t,o,s,a),r.state=t.memoizedState),typeof o.getDerivedStateFromProps==="function"||typeof r.getSnapshotBeforeUpdate==="function"||typeof r.UNSAFE_componentWillMount!=="function"&&typeof r.componentWillMount!=="function"||(s=r.state,typeof r.componentWillMount==="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==="function"&&r.UNSAFE_componentWillMount(),s!==r.state&&Bp.enqueueReplaceState(r,r.state,null),Fl(t,a,r,n),Ul(),r.state=t.memoizedState),typeof r.componentDidMount==="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var l=t.memoizedProps,c=ns(o,l);r.props=c;var u=r.context,d=o.contextType;s=ui,typeof d==="object"&&d!==null&&(s=ho(d));var m=o.getDerivedStateFromProps;d=typeof m==="function"||typeof r.getSnapshotBeforeUpdate==="function",l=t.pendingProps!==l,d||typeof r.UNSAFE_componentWillReceiveProps!=="function"&&typeof r.componentWillReceiveProps!=="function"||(l||u!==s)&&Ov(t,r,a,s),Xn=!1;var f=t.memoizedState;r.state=f,Fl(t,a,r,n),Ul(),u=t.memoizedState,l||f!==u||Xn?(typeof m==="function"&&(Gf(t,o,m,a),u=t.memoizedState),(c=Xn||Ev(t,o,c,a,f,u,s))?(d||typeof r.UNSAFE_componentWillMount!=="function"&&typeof r.componentWillMount!=="function"||(typeof r.componentWillMount==="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount==="function"&&(t.flags|=4194308)):(typeof r.componentDidMount==="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=u),r.props=a,r.state=u,r.context=s,a=c):(typeof r.componentDidMount==="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,Tp(e,t),s=t.memoizedProps,d=ns(o,s),r.props=d,m=t.pendingProps,f=r.context,u=o.contextType,c=ui,typeof u==="object"&&u!==null&&(c=ho(u)),l=o.getDerivedStateFromProps,(u=typeof l==="function"||typeof r.getSnapshotBeforeUpdate==="function")||typeof r.UNSAFE_componentWillReceiveProps!=="function"&&typeof r.componentWillReceiveProps!=="function"||(s!==m||f!==c)&&Ov(t,r,a,c),Xn=!1,f=t.memoizedState,r.state=f,Fl(t,a,r,n),Ul();var p=t.memoizedState;s!==m||f!==p||Xn||e!==null&&e.dependencies!==null&&Xu(e.dependencies)?(typeof l==="function"&&(Gf(t,o,l,a),p=t.memoizedState),(d=Xn||Ev(t,o,d,a,f,p,c)||e!==null&&e.dependencies!==null&&Xu(e.dependencies))?(u||typeof r.UNSAFE_componentWillUpdate!=="function"&&typeof r.componentWillUpdate!=="function"||(typeof r.componentWillUpdate==="function"&&r.componentWillUpdate(a,p,c),typeof r.UNSAFE_componentWillUpdate==="function"&&r.UNSAFE_componentWillUpdate(a,p,c)),typeof r.componentDidUpdate==="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate==="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!=="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=p),r.props=a,r.state=p,r.context=c,a=d):(typeof r.componentDidUpdate!=="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Pu(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,o=a&&typeof o.getDerivedStateFromError!=="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=os(t,e.child,null,n),t.child=os(t,null,o,n)):mo(e,t,o,n),t.memoizedState=r.state,e=t.child):e=Ln(e,t,n),e}function Uv(e,t,o,a){return es(),t.flags|=256,mo(e,t,o,a),t.child}var Vf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kf(e){return{baseLanes:e,cachePool:i1()}}function qf(e,t,o){return e=e!==null?e.childLanes&~o:0,t&&(e|=Zo),e}function J1(e,t,o){var a=t.pendingProps,n=!1,r=(t.flags&128)!==0,s;if((s=r)||(s=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),s&&(n=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(xe){if(n?Jn(t):er(t),(e=ot)?(e=Vy(e,pa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gr!==null?{id:Za,overflow:Ya}:null,retryLane:536870912,hydrationErrors:null},o=a1(e),o.return=t,t.child=o,po=t,ot=null)):e=null,e===null)throw br(t);return Jp(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;if(a=a.fallback,n)return er(t),n=t.mode,l=nd({mode:"hidden",children:l},n),a=Yr(a,n,o,null),l.return=t,a.return=t,l.sibling=a,t.child=l,a=t.child,a.memoizedState=Kf(o),a.childLanes=qf(e,s,o),t.memoizedState=Vf,El(null,a);return Jn(t),zp(t,l)}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(r)t.flags&256?(Jn(t),t.flags&=-257,t=$f(e,t,o)):t.memoizedState!==null?(er(t),t.child=e.child,t.flags|=128,t=null):(er(t),l=a.fallback,n=t.mode,a=nd({mode:"visible",children:a.children},n),l=Yr(l,n,o,null),l.flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,os(t,e.child,null,o),a=t.child,a.memoizedState=Kf(o),a.childLanes=qf(e,s,o),t.memoizedState=Vf,t=El(null,a));else if(Jn(t),Jp(l)){if(s=l.nextSibling&&l.nextSibling.dataset,s)var u=s.dgst;s=u,a=Error(N(419)),a.stack="",a.digest=s,Ql({value:a,source:null,stack:null}),t=$f(e,t,o)}else if(_t||Ri(e,t,o,!1),s=(o&e.childLanes)!==0,_t||s){if(s=Ze,s!==null&&(a=AS(s,o),a!==0&&a!==c.retryLane))throw c.retryLane=a,ls(e,a),Po(s,e,a),zh;Qp(l)||ld(),t=$f(e,t,o)}else Qp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,ot=ga(l.nextSibling),po=t,xe=!0,lr=null,pa=!1,e!==null&&r1(t,e),t=zp(t,a.children),t.flags|=4096);return t}if(n)return er(t),l=a.fallback,n=t.mode,c=e.child,u=c.sibling,a=Dn(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,u!==null?l=Dn(u,l):(l=Yr(l,n,o,null),l.flags|=2),l.return=t,a.return=t,a.sibling=l,t.child=a,El(null,a),a=t.child,l=e.child.memoizedState,l===null?l=Kf(o):(n=l.cachePool,n!==null?(c=Ft._currentValue,n=n.parent!==c?{parent:c,pool:c}:n):n=i1(),l={baseLanes:l.baseLanes|o,cachePool:n}),a.memoizedState=l,a.childLanes=qf(e,s,o),t.memoizedState=Vf,El(e.child,a);return Jn(t),o=e.child,e=o.sibling,o=Dn(o,{mode:"visible",children:a.children}),o.return=t,o.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=o,t.memoizedState=null,o}function zp(e,t){return t=nd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function nd(e,t){return e=Wo(22,e,null,t),e.lanes=0,e}function $f(e,t,o){return os(t,e.child,null,o),e=zp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fv(e,t,o){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Mp(e.return,t,o)}function Wf(e,t,o,a,n,r){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:o,tailMode:n,treeForkCount:r}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=a,s.tail=o,s.tailMode=n,s.treeForkCount=r)}function ey(e,t,o){var a=t.pendingProps,n=a.revealOrder,r=a.tail;a=a.children;var s=gt.current,l=(s&2)!==0;if(l?(s=s&1|2,t.flags|=128):s&=1,Xe(gt,s),mo(e,t,a,o),a=xe?Xl:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fv(e,o,t);else if(e.tag===19)Fv(e,o,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}switch(n){case"forwards":o=t.child;for(n=null;o!==null;)e=o.alternate,e!==null&&ed(e)===null&&(n=o),o=o.sibling;o=n,o===null?(n=t.child,t.child=null):(n=o.sibling,o.sibling=null),Wf(t,!1,n,o,r,a);break;case"backwards":case"unstable_legacy-backwards":o=null,n=t.child;for(t.child=null;n!==null;){if(e=n.alternate,e!==null&&ed(e)===null){t.child=n;break}e=n.sibling,n.sibling=o,o=n,n=e}Wf(t,!0,o,null,r,a);break;case"together":Wf(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ln(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),Sr|=t.lanes,(o&t.childLanes)===0)if(e!==null){if(Ri(e,t,o,!1),(o&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){e=t.child,o=Dn(e,e.pendingProps),t.child=o;for(o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=Dn(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function Uh(e,t){if((e.lanes&t)!==0)return!0;return e=e.dependencies,e!==null&&Xu(e)?!0:!1}function YW(e,t,o){switch(t.tag){case 3:Vu(t,t.stateNode.containerInfo),Qn(t,Ft,e.memoizedState.cache),es();break;case 27:case 5:mp(t);break;case 4:Vu(t,t.stateNode.containerInfo);break;case 10:Qn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Op(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return Jn(t),t.flags|=128,null;if((o&t.child.childLanes)!==0)return J1(e,t,o);return Jn(t),e=Ln(e,t,o),e!==null?e.sibling:null}Jn(t);break;case 19:var n=(e.flags&128)!==0;if(a=(o&t.childLanes)!==0,a||(Ri(e,t,o,!1),a=(o&t.childLanes)!==0),n){if(a)return ey(e,t,o);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Xe(gt,gt.current),a)break;else return null;case 22:return t.lanes=0,Q1(e,t,o,t.pendingProps);case 24:Qn(t,Ft,e.memoizedState.cache)}return Ln(e,t,o)}function ty(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Uh(e,o)&&(t.flags&128)===0)return _t=!1,YW(e,t,o);_t=(e.flags&131072)!==0?!0:!1}else _t=!1,xe&&(t.flags&1048576)!==0&&n1(t,Xl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=$r(t.elementType),t.type=e,typeof e==="function")bh(e)?(a=ns(e,a),t.tag=1,t=zv(null,t,e,a,o)):(t.tag=0,t=Pp(null,t,e,a,o));else{if(e!==void 0&&e!==null){var n=e.$$typeof;if(n===ah){t.tag=11,t=Lv(null,t,e,a,o);break e}else if(n===nh){t.tag=14,t=Rv(null,t,e,a,o);break e}}throw t=up(e)||e,Error(N(306,t,""))}}return t;case 0:return Pp(e,t,t.type,t.pendingProps,o);case 1:return a=t.type,n=ns(a,t.pendingProps),zv(e,t,a,n,o);case 3:e:{if(Vu(t,t.stateNode.containerInfo),e===null)throw Error(N(387));a=t.pendingProps;var r=t.memoizedState;n=r.element,Tp(e,t),Fl(t,a,null,o);var s=t.memoizedState;if(a=s.cache,Qn(t,Ft,a),a!==r.cache&&kp(t,[Ft],o,!0),Ul(),a=s.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Uv(e,t,a,o);break e}else if(a!==n){n=fa(Error(N(424)),t),Ql(n),t=Uv(e,t,a,o);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}ot=ga(e.firstChild),po=t,xe=!0,lr=null,pa=!0,o=u1(t,null,a,o);for(t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(es(),a===n){t=Ln(e,t,o);break e}mo(e,t,a,o)}t=t.child}return t;case 26:return Pu(e,t),e===null?(o=sS(t.type,null,t.pendingProps,null))?t.memoizedState=o:xe||(o=t.type,e=t.pendingProps,a=md(ir.current).createElement(o),a[fo]=t,a[zo]=e,go(a,o,e),ao(a),t.stateNode=a):t.memoizedState=sS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return mp(t),e===null&&xe&&(a=t.stateNode=Ky(t.type,t.pendingProps,ir.current),po=t,pa=!0,n=ot,wr(t.type)?(eh=n,ot=ga(a.firstChild)):ot=n),mo(e,t,t.pendingProps.children,o),Pu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:if(e===null&&xe){if(n=a=ot)a=CZ(a,t.type,t.pendingProps,pa),a!==null?(t.stateNode=a,po=t,ot=ga(a.firstChild),pa=!1,n=!0):n=!1;n||br(t)}return mp(t),n=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,a=r.children,Yp(n,r)?a=null:s!==null&&Yp(n,s)&&(t.flags|=32),t.memoizedState!==null&&(n=kh(e,t,_W,null,null,o),nc._currentValue=n),Pu(e,t),mo(e,t,a,o),t.child;case 6:if(e===null&&xe){if(e=o=ot)o=MZ(o,t.pendingProps,pa),o!==null?(t.stateNode=o,po=t,ot=null,e=!0):e=!1;e||br(t)}return null;case 13:return J1(e,t,o);case 4:return Vu(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=os(t,null,a,o):mo(e,t,a,o),t.child;case 11:return Lv(e,t,t.type,t.pendingProps,o);case 7:return mo(e,t,t.pendingProps,o),t.child;case 8:return mo(e,t,t.pendingProps.children,o),t.child;case 12:return mo(e,t,t.pendingProps.children,o),t.child;case 10:return a=t.pendingProps,Qn(t,t.type,a.value),mo(e,t,a.children,o),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ts(t),n=ho(n),a=a(n),t.flags|=1,mo(e,t,a,o),t.child;case 14:return Rv(e,t,t.type,t.pendingProps,o);case 15:return X1(e,t,t.type,t.pendingProps,o);case 19:return ey(e,t,o);case 31:return ZW(e,t,o);case 22:return Q1(e,t,o,t.pendingProps);case 24:return ts(t),a=ho(Ft),e===null?(n=wh(),n===null&&(n=Ze,r=yh(),n.pooledCache=r,r.refCount++,r!==null&&(n.pooledCacheLanes|=o),n=r),t.memoizedState={parent:a,cache:n},xh(t),Qn(t,Ft,n)):((e.lanes&o)!==0&&(Tp(e,t),Fl(t,null,null,o),Ul()),n=e.memoizedState,r=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),Qn(t,Ft,a)):(a=r.cache,Qn(t,Ft,a),a!==n.cache&&kp(t,[Ft],o,!0))),mo(e,t,t.pendingProps.children,o),t.child;case 29:throw t.pendingProps}throw Error(N(156,t.tag))}function vn(e){e.flags|=4}function Zf(e,t,o,a,n){if(t=(e.mode&32)!==0)t=!1;if(t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(My())e.flags|=8192;else throw Qr=Qu,Ih}else e.flags&=-16777217}function _v(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wy(t))if(My())e.flags|=8192;else throw Qr=Qu,Ih}function Iu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?kS():536870912,e.lanes|=t,Di|=t)}function Il(e,t){if(!xe)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,a=0;if(t)for(var n=e.child;n!==null;)o|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)o|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=o,t}function XW(e,t,o){var a=t.pendingProps;switch(Sh(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:if(o=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Tn(Ft),wi(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),e===null||e.child===null)Xs(t)?vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ff());return tt(t),null;case 26:var{type:n,memoizedState:r}=t;return e===null?(vn(t),r!==null?(tt(t),_v(t,r)):(tt(t),Zf(t,n,null,a,o))):r?r!==e.memoizedState?(vn(t),tt(t),_v(t,r)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&vn(t),tt(t),Zf(t,n,e,a,o)),null;case 27:if(Ku(t),o=ir.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&vn(t);else{if(!a){if(t.stateNode===null)throw Error(N(166));return tt(t),null}e=Qa.current,Xs(t)?gv(t,e):(e=Ky(n,a,o),t.stateNode=e,vn(t))}return tt(t),null;case 5:if(Ku(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&vn(t);else{if(!a){if(t.stateNode===null)throw Error(N(166));return tt(t),null}if(r=Qa.current,Xs(t))gv(t,r);else{var s=md(ir.current);switch(r){case 1:r=s.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:r=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":r=s.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":r=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":r=s.createElement("div"),r.innerHTML="<script></script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is==="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is==="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}r[fo]=t,r[zo]=a;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)r.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=r;e:switch(go(r,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&vn(t)}}return tt(t),Zf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,o),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&vn(t);else{if(typeof a!=="string"&&t.stateNode===null)throw Error(N(166));if(e=ir.current,Xs(t)){if(e=t.stateNode,o=t.memoizedProps,a=null,n=po,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[fo]=t,e=e.nodeValue===o||a!==null&&a.suppressHydrationWarning===!0||_y(e.nodeValue,o)?!0:!1,e||br(t,!0)}else e=md(e).createTextNode(a),e[fo]=t,t.stateNode=e}return tt(t),null;case 31:if(o=t.memoizedState,e===null||e.memoizedState!==null){if(a=Xs(t),o!==null){if(e===null){if(!a)throw Error(N(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(557));e[fo]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else o=Ff(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),e=!0;if(!e){if(t.flags&256)return $o(t),t;return $o(t),null}if((t.flags&128)!==0)throw Error(N(558))}return tt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Xs(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(N(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(N(317));n[fo]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),n=!1}else n=Ff(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n){if(t.flags&256)return $o(t),t;return $o(t),null}}if($o(t),(t.flags&128)!==0)return t.lanes=o,t;return o=a!==null,e=e!==null&&e.memoizedState!==null,o&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==n&&(a.flags|=2048)),o!==e&&o&&(t.child.flags|=8192),Iu(t,t.updateQueue),tt(t),null;case 4:return wi(),e===null&&qh(t.stateNode.containerInfo),tt(t),null;case 10:return Tn(t.type),tt(t),null;case 19:if(no(gt),a=t.memoizedState,a===null)return tt(t),null;if(n=(t.flags&128)!==0,r=a.rendering,r===null)if(n)Il(a,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=ed(e),r!==null){t.flags|=128,Il(a,!1),e=r.updateQueue,t.updateQueue=e,Iu(t,e),t.subtreeFlags=0,e=o;for(o=t.child;o!==null;)o1(o,e),o=o.sibling;return Xe(gt,gt.current&1|2),xe&&In(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Yo()>sd&&(t.flags|=128,n=!0,Il(a,!1),t.lanes=4194304)}else{if(!n)if(e=ed(r),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Iu(t,e),Il(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!xe)return tt(t),null}else 2*Yo()-a.renderingStartTime>sd&&o!==536870912&&(t.flags|=128,n=!0,Il(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}if(a.tail!==null)return e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Yo(),e.sibling=null,o=gt.current,Xe(gt,n?o&1|2:o&1),xe&&In(t,a.treeForkCount),e;return tt(t),null;case 22:case 23:return $o(t),Ch(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(o&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),o=t.updateQueue,o!==null&&Iu(t,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==o&&(t.flags|=2048),e!==null&&no(Xr),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Tn(Ft),tt(t),null;case 25:return null;case 30:return null}throw Error(N(156,t.tag))}function QW(e,t){switch(Sh(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tn(Ft),wi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ku(t),null;case 31:if(t.memoizedState!==null){if($o(t),t.alternate===null)throw Error(N(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($o(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return no(gt),null;case 4:return wi(),null;case 10:return Tn(t.type),null;case 22:case 23:return $o(t),Ch(),e!==null&&no(Xr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Tn(Ft),null;case 25:return null;default:return null}}function oy(e,t){switch(Sh(t),t.tag){case 3:Tn(Ft),wi();break;case 26:case 27:case 5:Ku(t);break;case 4:wi();break;case 31:t.memoizedState!==null&&$o(t);break;case 13:$o(t);break;case 19:no(gt);break;case 10:Tn(t.type);break;case 22:case 23:$o(t),Ch(),e!==null&&no(Xr);break;case 24:Tn(Ft)}}function hc(e,t){try{var o=t.updateQueue,a=o!==null?o.lastEffect:null;if(a!==null){var n=a.next;o=n;do{if((o.tag&e)===e){a=void 0;var r=o.create,s=o.inst;a=r(),s.destroy=a}o=o.next}while(o!==n)}}catch(l){Pe(t,t.return,l)}}function vr(e,t,o){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){var s=a.inst,l=s.destroy;if(l!==void 0){s.destroy=void 0,n=t;var c=o,u=l;try{u()}catch(d){Pe(n,c,d)}}}a=a.next}while(a!==r)}}catch(d){Pe(t,t.return,d)}}function ay(e){var t=e.updateQueue;if(t!==null){var o=e.stateNode;try{m1(t,o)}catch(a){Pe(e,e.return,a)}}}function ny(e,t,o){o.props=ns(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(a){Pe(e,t,a)}}function jl(e,t){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof o==="function"?e.refCleanup=o(a):o.current=a}}catch(n){Pe(e,t,n)}}function Xa(e,t){var o=e.ref,a=e.refCleanup;if(o!==null)if(typeof a==="function")try{a()}catch(n){Pe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o==="function")try{o(null)}catch(n){Pe(e,t,n)}else o.current=null}function ry(e){var{type:t,memoizedProps:o,stateNode:a}=e;try{e:switch(t){case"button":case"input":case"select":case"textarea":o.autoFocus&&a.focus();break e;case"img":o.src?a.src=o.src:o.srcSet&&(a.srcset=o.srcSet)}}catch(n){Pe(e,e.return,n)}}function Yf(e,t,o){try{var a=e.stateNode;vZ(a,e.type,o,t),a[zo]=t}catch(n){Pe(e,e.return,n)}}function sy(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wr(e.type)||e.tag===4}function Xf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sy(e.return))return null;e=e.return}e.sibling.return=e.return;for(e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wr(e.type))continue e;if(e.flags&2)continue e;if(e.child===null||e.tag===4)continue e;else e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Up(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,t):(t=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,t.appendChild(e),o=o._reactRootContainer,o!==null&&o!==void 0||t.onclick!==null||(t.onclick=Mn));else if(a!==4&&(a===27&&wr(e.type)&&(o=e.stateNode,t=null),e=e.child,e!==null))for(Up(e,t,o),e=e.sibling;e!==null;)Up(e,t,o),e=e.sibling}function rd(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(a!==4&&(a===27&&wr(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(rd(e,t,o),e=e.sibling;e!==null;)rd(e,t,o),e=e.sibling}function iy(e){var{stateNode:t,memoizedProps:o}=e;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);go(t,a,o),t[fo]=e,t[zo]=o}catch(r){Pe(e,e.return,r)}}var xn=!1,Ut=!1,Qf=!1,jv=typeof WeakSet==="function"?WeakSet:Set,oo=null;function JW(e,t){if(e=e.containerInfo,Wp=gd,e=WS(e),ph(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var a=o.getSelection&&o.getSelection();if(a&&a.rangeCount!==0){o=a.anchorNode;var n=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{o.nodeType,r.nodeType}catch(v){o=null;break e}var s=0,l=-1,c=-1,u=0,d=0,m=e,f=null;t:for(;;){for(var p;;){if(m!==o||n!==0&&m.nodeType!==3||(l=s+n),m!==r||a!==0&&m.nodeType!==3||(c=s+a),m.nodeType===3&&(s+=m.nodeValue.length),(p=m.firstChild)===null)break;f=m,m=p}for(;;){if(m===e)break t;if(f===o&&++u===n&&(l=s),f===r&&++d===a&&(c=s),(p=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=p}o=l===-1||c===-1?null:{start:l,end:c}}else o=null}o=o||{start:0,end:0}}else o=null;Zp={focusedElem:e,selectionRange:o},gd=!1;for(oo=t;oo!==null;)if(t=oo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oo=e;else for(;oo!==null;){switch(t=oo,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(o=0;o<e.length;o++)n=e[o],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,o=t,n=r.memoizedProps,r=r.memoizedState,a=o.stateNode;try{var b=ns(o.type,n);e=a.getSnapshotBeforeUpdate(b,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(v){Pe(o,o.return,v)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,o=e.nodeType,o===9)Xp(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Xp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(N(163))}if(e=t.sibling,e!==null){e.return=t.return,oo=e;break}oo=t.return}}function ly(e,t,o){var a=o.flags;switch(o.tag){case 0:case 11:case 15:yn(e,o),a&4&&hc(5,o);break;case 1:if(yn(e,o),a&4)if(e=o.stateNode,t===null)try{e.componentDidMount()}catch(s){Pe(o,o.return,s)}else{var n=ns(o.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Pe(o,o.return,s)}}a&64&&ay(o),a&512&&jl(o,o.return);break;case 3:if(yn(e,o),a&64&&(e=o.updateQueue,e!==null)){if(t=null,o.child!==null)switch(o.child.tag){case 27:case 5:t=o.child.stateNode;break;case 1:t=o.child.stateNode}try{m1(e,t)}catch(s){Pe(o,o.return,s)}}break;case 27:t===null&&a&4&&iy(o);case 26:case 5:yn(e,o),t===null&&a&4&&ry(o),a&512&&jl(o,o.return);break;case 12:yn(e,o);break;case 31:yn(e,o),a&4&&dy(e,o);break;case 13:yn(e,o),a&4&&my(e,o),a&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=lZ.bind(null,o),kZ(e,o))));break;case 22:if(a=o.memoizedState!==null||xn,!a){t=t!==null&&t.memoizedState!==null||Ut,n=xn;var r=Ut;xn=a,(Ut=t)&&!r?wn(e,o,(o.subtreeFlags&8772)!==0):yn(e,o),xn=n,Ut=r}break;case 30:break;default:yn(e,o)}}function cy(e){var t=e.alternate;t!==null&&(e.alternate=null,cy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lh(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var lt=null,Bo=!1;function Sn(e,t,o){for(o=o.child;o!==null;)uy(e,t,o),o=o.sibling}function uy(e,t,o){if(Xo&&typeof Xo.onCommitFiberUnmount==="function")try{Xo.onCommitFiberUnmount(lc,o)}catch(r){}switch(o.tag){case 26:Ut||Xa(o,t),Sn(e,t,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Ut||Xa(o,t);var a=lt,n=Bo;wr(o.type)&&(lt=o.stateNode,Bo=!1),Sn(e,t,o),ql(o.stateNode),lt=a,Bo=n;break;case 5:Ut||Xa(o,t);case 6:if(a=lt,n=Bo,lt=null,Sn(e,t,o),lt=a,Bo=n,lt!==null)if(Bo)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(o.stateNode)}catch(r){Pe(o,t,r)}else try{lt.removeChild(o.stateNode)}catch(r){Pe(o,t,r)}break;case 18:lt!==null&&(Bo?(e=lt,tS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),Oi(e)):tS(lt,o.stateNode));break;case 4:a=lt,n=Bo,lt=o.stateNode.containerInfo,Bo=!0,Sn(e,t,o),lt=a,Bo=n;break;case 0:case 11:case 14:case 15:vr(2,o,t),Ut||vr(4,o,t),Sn(e,t,o);break;case 1:Ut||(Xa(o,t),a=o.stateNode,typeof a.componentWillUnmount==="function"&&ny(o,t,a)),Sn(e,t,o);break;case 21:Sn(e,t,o);break;case 22:Ut=(a=Ut)||o.memoizedState!==null,Sn(e,t,o),Ut=a;break;default:Sn(e,t,o)}}function dy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Oi(e)}catch(o){Pe(t,t.return,o)}}}function my(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Oi(e)}catch(o){Pe(t,t.return,o)}}function eZ(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new jv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new jv),t;default:throw Error(N(435,e.tag))}}function xu(e,t){var o=eZ(e);t.forEach(function(a){if(!o.has(a)){o.add(a);var n=cZ.bind(null,e,a);a.then(n,n)}})}function Lo(e,t){var o=t.deletions;if(o!==null)for(var a=0;a<o.length;a++){var n=o[a],r=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 27:if(wr(l.type)){lt=l.stateNode,Bo=!1;break e}break;case 5:lt=l.stateNode,Bo=!1;break e;case 3:case 4:lt=l.stateNode.containerInfo,Bo=!0;break e}l=l.return}if(lt===null)throw Error(N(160));uy(r,s,n),lt=null,Bo=!1,r=n.alternate,r!==null&&(r.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fy(t,e),t=t.sibling}var Da=null;function fy(e,t){var o=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lo(t,e),Ro(e),a&4&&(vr(3,e,e.return),hc(3,e),vr(5,e,e.return));break;case 1:Lo(t,e),Ro(e),a&512&&(Ut||o===null||Xa(o,o.return)),a&64&&xn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?a:o.concat(a))));break;case 26:var n=Da;if(Lo(t,e),Ro(e),a&512&&(Ut||o===null||Xa(o,o.return)),a&4){var r=o!==null?o.memoizedState:null;if(a=e.memoizedState,o===null)if(a===null)if(e.stateNode===null){e:{a=e.type,o=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":if(r=n.getElementsByTagName("title")[0],!r||r[dc]||r[fo]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))r=n.createElement(a),n.head.insertBefore(r,n.querySelector("head > title"));go(r,a,o),r[fo]=e,ao(r),a=r;break e;case"link":var s=lS("link","href",n).get(a+(o.href||""));if(s){for(var l=0;l<s.length;l++)if(r=s[l],r.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&r.getAttribute("rel")===(o.rel==null?null:o.rel)&&r.getAttribute("title")===(o.title==null?null:o.title)&&r.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){s.splice(l,1);break t}}r=n.createElement(a),go(r,a,o),n.head.appendChild(r);break;case"meta":if(s=lS("meta","content",n).get(a+(o.content||""))){for(l=0;l<s.length;l++)if(r=s[l],r.getAttribute("content")===(o.content==null?null:""+o.content)&&r.getAttribute("name")===(o.name==null?null:o.name)&&r.getAttribute("property")===(o.property==null?null:o.property)&&r.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&r.getAttribute("charset")===(o.charSet==null?null:o.charSet)){s.splice(l,1);break t}}r=n.createElement(a),go(r,a,o),n.head.appendChild(r);break;default:throw Error(N(468,a))}r[fo]=e,ao(r),a=r}e.stateNode=a}else cS(n,e.type,e.stateNode);else e.stateNode=iS(n,a,e.memoizedProps);else r!==a?(r===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):r.count--,a===null?cS(n,e.type,e.stateNode):iS(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Yf(e,e.memoizedProps,o.memoizedProps)}break;case 27:Lo(t,e),Ro(e),a&512&&(Ut||o===null||Xa(o,o.return)),o!==null&&a&4&&Yf(e,e.memoizedProps,o.memoizedProps);break;case 5:if(Lo(t,e),Ro(e),a&512&&(Ut||o===null||Xa(o,o.return)),e.flags&32){n=e.stateNode;try{xi(n,"")}catch(b){Pe(e,e.return,b)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Yf(e,n,o!==null?o.memoizedProps:n)),a&1024&&(Qf=!0);break;case 6:if(Lo(t,e),Ro(e),a&4){if(e.stateNode===null)throw Error(N(162));a=e.memoizedProps,o=e.stateNode;try{o.nodeValue=a}catch(b){Pe(e,e.return,b)}}break;case 3:if(Fu=null,n=Da,Da=fd(t.containerInfo),Lo(t,e),Da=n,Ro(e),a&4&&o!==null&&o.memoizedState.isDehydrated)try{Oi(t.containerInfo)}catch(b){Pe(e,e.return,b)}Qf&&(Qf=!1,py(e));break;case 4:a=Da,Da=fd(e.stateNode.containerInfo),Lo(t,e),Ro(e),Da=a;break;case 12:Lo(t,e),Ro(e);break;case 31:Lo(t,e),Ro(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,xu(e,a)));break;case 13:Lo(t,e),Ro(e),e.child.flags&8192&&e.memoizedState!==null!==(o!==null&&o.memoizedState!==null)&&(Ad=Yo()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,xu(e,a)));break;case 22:n=e.memoizedState!==null;var c=o!==null&&o.memoizedState!==null,u=xn,d=Ut;if(xn=u||n,Ut=d||c,Lo(t,e),Ut=d,xn=u,Ro(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(o===null||c||xn||Ut||Wr(e)),o=null,t=e;;){if(t.tag===5||t.tag===26){if(o===null){c=o=t;try{if(r=c.stateNode,n)s=r.style,typeof s.setProperty==="function"?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var m=c.memoizedProps.style,f=m!==void 0&&m!==null&&m.hasOwnProperty("display")?m.display:null;l.style.display=f==null||typeof f==="boolean"?"":(""+f).trim()}}catch(b){Pe(c,c.return,b)}}}else if(t.tag===6){if(o===null){c=t;try{c.stateNode.nodeValue=n?"":c.memoizedProps}catch(b){Pe(c,c.return,b)}}}else if(t.tag===18){if(o===null){c=t;try{var p=c.stateNode;n?oS(p,!0):oS(c.stateNode,!1)}catch(b){Pe(c,c.return,b)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;o===t&&(o=null),t=t.return}o===t&&(o=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(o=a.retryQueue,o!==null&&(a.retryQueue=null,xu(e,o))));break;case 19:Lo(t,e),Ro(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,xu(e,a)));break;case 30:break;case 21:break;default:Lo(t,e),Ro(e)}}function Ro(e){var t=e.flags;if(t&2){try{for(var o,a=e.return;a!==null;){if(sy(a)){o=a;break}a=a.return}if(o==null)throw Error(N(160));switch(o.tag){case 27:var n=o.stateNode,r=Xf(e);rd(e,r,n);break;case 5:var s=o.stateNode;o.flags&32&&(xi(s,""),o.flags&=-33);var l=Xf(e);rd(e,l,s);break;case 3:case 4:var c=o.stateNode.containerInfo,u=Xf(e);Up(e,u,c);break;default:throw Error(N(161))}}catch(d){Pe(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function py(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;py(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ly(e,t.alternate,t),t=t.sibling}function Wr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vr(4,t,t.return),Wr(t);break;case 1:Xa(t,t.return);var o=t.stateNode;typeof o.componentWillUnmount==="function"&&ny(t,t.return,o),Wr(t);break;case 27:ql(t.stateNode);case 26:case 5:Xa(t,t.return),Wr(t);break;case 22:t.memoizedState===null&&Wr(t);break;case 30:Wr(t);break;default:Wr(t)}e=e.sibling}}function wn(e,t,o){o=o&&(t.subtreeFlags&8772)!==0;for(t=t.child;t!==null;){var a=t.alternate,n=e,r=t,s=r.flags;switch(r.tag){case 0:case 11:case 15:wn(n,r,o),hc(4,r);break;case 1:if(wn(n,r,o),a=r,n=a.stateNode,typeof n.componentDidMount==="function")try{n.componentDidMount()}catch(u){Pe(a,a.return,u)}if(a=r,n=a.updateQueue,n!==null){var l=a.stateNode;try{var c=n.shared.hiddenCallbacks;if(c!==null)for(n.shared.hiddenCallbacks=null,n=0;n<c.length;n++)d1(c[n],l)}catch(u){Pe(a,a.return,u)}}o&&s&64&&ay(r),jl(r,r.return);break;case 27:iy(r);case 26:case 5:wn(n,r,o),o&&a===null&&s&4&&ry(r),jl(r,r.return);break;case 12:wn(n,r,o);break;case 31:wn(n,r,o),o&&s&4&&dy(n,r);break;case 13:wn(n,r,o),o&&s&4&&my(n,r);break;case 22:r.memoizedState===null&&wn(n,r,o),jl(r,r.return);break;case 30:break;default:wn(n,r,o)}t=t.sibling}}function Fh(e,t){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&fc(o))}function _h(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fc(e))}function ka(e,t,o,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hy(e,t,o,a),t=t.sibling}function hy(e,t,o,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:ka(e,t,o,a),n&2048&&hc(9,t);break;case 1:ka(e,t,o,a);break;case 3:ka(e,t,o,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fc(e)));break;case 12:if(n&2048){ka(e,t,o,a),e=t.stateNode;try{var r=t.memoizedProps,s=r.id,l=r.onPostCommit;typeof l==="function"&&l(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Pe(t,t.return,c)}}else ka(e,t,o,a);break;case 31:ka(e,t,o,a);break;case 13:ka(e,t,o,a);break;case 23:break;case 22:r=t.stateNode,s=t.alternate,t.memoizedState!==null?r._visibility&2?ka(e,t,o,a):Gl(e,t):r._visibility&2?ka(e,t,o,a):(r._visibility|=2,Js(e,t,o,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Fh(s,t);break;case 24:ka(e,t,o,a),n&2048&&_h(t.alternate,t);break;default:ka(e,t,o,a)}}function Js(e,t,o,a,n){n=n&&((t.subtreeFlags&10256)!==0||!1);for(t=t.child;t!==null;){var r=e,s=t,l=o,c=a,u=s.flags;switch(s.tag){case 0:case 11:case 15:Js(r,s,l,c,n),hc(8,s);break;case 23:break;case 22:var d=s.stateNode;s.memoizedState!==null?d._visibility&2?Js(r,s,l,c,n):Gl(r,s):(d._visibility|=2,Js(r,s,l,c,n)),n&&u&2048&&Fh(s.alternate,s);break;case 24:Js(r,s,l,c,n),n&&u&2048&&_h(s.alternate,s);break;default:Js(r,s,l,c,n)}t=t.sibling}}function Gl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var o=e,a=t,n=a.flags;switch(a.tag){case 22:Gl(o,a),n&2048&&Fh(a.alternate,a);break;case 24:Gl(o,a),n&2048&&_h(a.alternate,a);break;default:Gl(o,a)}t=t.sibling}}var Ol=8192;function Qs(e,t,o){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)gy(e,t,o),e=e.sibling}function gy(e,t,o){switch(e.tag){case 26:Qs(e,t,o),e.flags&Ol&&e.memoizedState!==null&&zZ(o,Da,e.memoizedState,e.memoizedProps);break;case 5:Qs(e,t,o);break;case 3:case 4:var a=Da;Da=fd(e.stateNode.containerInfo),Qs(e,t,o),Da=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Ol,Ol=16777216,Qs(e,t,o),Ol=a):Qs(e,t,o));break;default:Qs(e,t,o)}}function by(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function xl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var o=0;o<t.length;o++){var a=t[o];oo=a,Sy(a,e)}by(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vy(e),e=e.sibling}function vy(e){switch(e.tag){case 0:case 11:case 15:xl(e),e.flags&2048&&vr(9,e,e.return);break;case 3:xl(e);break;case 12:xl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zu(e)):xl(e);break;default:xl(e)}}function zu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var o=0;o<t.length;o++){var a=t[o];oo=a,Sy(a,e)}by(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vr(8,t,t.return),zu(t);break;case 22:o=t.stateNode,o._visibility&2&&(o._visibility&=-3,zu(t));break;default:zu(t)}e=e.sibling}}function Sy(e,t){for(;oo!==null;){var o=oo;switch(o.tag){case 0:case 11:case 15:vr(8,o,t);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var a=o.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:fc(o.memoizedState.cache)}if(a=o.child,a!==null)a.return=o,oo=a;else e:for(o=e;oo!==null;){a=oo;var n=a.sibling,r=a.return;if(cy(a),a===o){oo=null;break e}if(n!==null){n.return=r,oo=n;break e}oo=r}}}var tZ={getCacheForType:function(e){var t=ho(Ft),o=t.data.get(e);return o===void 0&&(o=e(),t.data.set(e,o)),o},cacheSignal:function(){return ho(Ft).controller.signal}},oZ=typeof WeakMap==="function"?WeakMap:Map,Te=0,Ze=null,ve=null,ye=0,He=0,qo=null,nr=!1,Hi=!1,jh=!1,Rn=0,ft=0,Sr=0,Jr=0,Gh=0,Zo=0,Di=0,Vl=null,Ho=null,Fp=!1,Ad=0,yy=0,sd=1/0,id=null,dr=null,Vt=0,mr=null,Ti=null,An=0,_p=0,jp=null,wy=null,Kl=0,Gp=null;function Jo(){return(Te&2)!==0&&ye!==0?ye&-ye:W.T!==null?Kh():ES()}function Iy(){if(Zo===0)if((ye&536870912)===0||xe){var e=hu;hu<<=1,(hu&3932160)===0&&(hu=262144),Zo=e}else Zo=536870912;return e=ta.current,e!==null&&(e.flags|=32),Zo}function Po(e,t,o){if(e===Ze&&(He===2||He===9)||e.cancelPendingCommit!==null)Ai(e,0),rr(e,ye,Zo,!1);if(uc(e,o),(Te&2)===0||e!==Ze)e===Ze&&((Te&2)===0&&(Jr|=o),ft===4&&rr(e,ye,Zo,!1)),en(e)}function xy(e,t,o){if((Te&6)!==0)throw Error(N(327));var a=!o&&(t&127)===0&&(t&e.expiredLanes)===0||cc(e,t),n=a?rZ(e,t):Jf(e,t,!0),r=a;do{if(n===0){Hi&&!a&&rr(e,t,0,!1);break}else{if(o=e.current.alternate,r&&!aZ(o)){n=Jf(e,t,!1),r=!1;continue}if(n===2){if(r=t,e.errorRecoveryDisabledLanes&r)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var l=e;n=Vl;var c=l.current.memoizedState.isDehydrated;if(c&&(Ai(l,s).flags|=256),s=Jf(l,s,!1),s!==2){if(jh&&!c){l.errorRecoveryDisabledLanes|=r,Jr|=r,n=4;break e}r=Ho,Ho=n,r!==null&&(Ho===null?Ho=r:Ho.push.apply(Ho,r))}n=s}if(r=!1,n!==2)continue}}if(n===1){Ai(e,0),rr(e,t,0,!0);break}e:{switch(a=e,r=n,r){case 0:case 1:throw Error(N(345));case 4:if((t&4194048)!==t)break;case 6:rr(a,t,Zo,!nr);break e;case 2:Ho=null;break;case 3:case 5:break;default:throw Error(N(329))}if((t&62914560)===t&&(n=Ad+300-Yo(),10<n)){if(rr(a,t,Zo,!nr),vd(a,0,!0)!==0)break e;An=t,a.timeoutHandle=Gy(Gv.bind(null,a,o,Ho,id,Fp,t,Zo,Jr,Di,nr,r,"Throttled",-0,0),n);break e}Gv(a,o,Ho,id,Fp,t,Zo,Jr,Di,nr,r,null,-0,0)}}break}while(1);en(e)}function Gv(e,t,o,a,n,r,s,l,c,u,d,m,f,p){if(e.timeoutHandle=-1,m=t.subtreeFlags,m&8192||(m&16785408)===16785408){m={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mn},gy(t,r,m);var b=(r&62914560)===r?Ad-Yo():(r&4194048)===r?yy-Yo():0;if(b=UZ(m,b),b!==null){An=r,e.cancelPendingCommit=b(Kv.bind(null,e,t,r,o,a,n,s,l,c,d,m,null,f,p)),rr(e,r,s,!u);return}}Kv(e,t,r,o,a,n,s,l,c)}function aZ(e){for(var t=e;;){var o=t.tag;if((o===0||o===11||o===15)&&t.flags&16384&&(o=t.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var a=0;a<o.length;a++){var n=o[a],r=n.getSnapshot;n=n.value;try{if(!ea(r(),n))return!1}catch(s){return!1}}if(o=t.child,t.subtreeFlags&16384&&o!==null)o.return=t,t=o;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 rr(e,t,o,a){t&=~Gh,t&=~Jr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var r=31-Qo(n),s=1<<r;a[r]=-1,n&=~s}o!==0&&DS(e,o,t)}function Ed(){return(Te&6)===0?(gc(0,!1),!1):!0}function Vh(){if(ve!==null){if(He===0)var e=ve.return;else e=ve,kn=cs=null,Ah(e),vi=null,Jl=0,e=ve;for(;e!==null;)oy(e.alternate,e),e=e.return;ve=null}}function Ai(e,t){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,wZ(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),An=0,Vh(),Ze=e,ve=o=Dn(e.current,null),ye=t,He=0,qo=null,nr=!1,Hi=cc(e,t),jh=!1,Di=Zo=Gh=Jr=Sr=ft=0,Ho=Vl=null,Fp=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-Qo(a),r=1<<n;t|=e[n],a&=~r}return Rn=t,Id(),o}function Cy(e,t){re=null,W.H=tc,t===Bi||t===Cd?(t=wv(),He=3):t===Ih?(t=wv(),He=4):He=t===zh?8:t!==null&&typeof t==="object"&&typeof t.then==="function"?6:1,qo=t,ve===null&&(ft=1,ad(e,fa(t,e.current)))}function My(){var e=ta.current;return e===null?!0:(ye&4194048)===ye?ha===null?!0:!1:(ye&62914560)===ye||(ye&536870912)!==0?e===ha:!1}function ky(){var e=W.H;return W.H=tc,e===null?tc:e}function Dy(){var e=W.A;return W.A=tZ,e}function ld(){ft=4,nr||(ye&4194048)!==ye&&ta.current!==null||(Hi=!0),(Sr&134217727)===0&&(Jr&134217727)===0||Ze===null||rr(Ze,ye,Zo,!1)}function Jf(e,t,o){var a=Te;Te|=2;var n=ky(),r=Dy();if(Ze!==e||ye!==t)id=null,Ai(e,t);t=!1;var s=ft;e:do try{if(He!==0&&ve!==null){var l=ve,c=qo;switch(He){case 8:Vh(),s=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(t=!0);var u=He;if(He=0,qo=null,fi(e,l,c,u),o&&Hi){s=0;break e}break;default:u=He,He=0,qo=null,fi(e,l,c,u)}}nZ(),s=ft;break}catch(d){Cy(e,d)}while(1);return t&&e.shellSuspendCounter++,kn=cs=null,Te=a,W.H=n,W.A=r,ve===null&&(Ze=null,ye=0,Id()),s}function nZ(){for(;ve!==null;)Ty(ve)}function rZ(e,t){var o=Te;Te|=2;var a=ky(),n=Dy();Ze!==e||ye!==t?(id=null,sd=Yo()+500,Ai(e,t)):Hi=cc(e,t);e:do try{if(He!==0&&ve!==null){t=ve;var r=qo;t:switch(He){case 1:He=0,qo=null,fi(e,t,r,1);break;case 2:case 9:if(yv(r)){He=0,qo=null,Vv(t);break}t=function(){He!==2&&He!==9||Ze!==e||(He=7),en(e)},r.then(t,t);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:yv(r)?(He=0,qo=null,Vv(t)):(He=0,qo=null,fi(e,t,r,7));break;case 5:var s=null;switch(ve.tag){case 26:s=ve.memoizedState;case 5:case 27:var l=ve;if(s?Wy(s):l.stateNode.complete){He=0,qo=null;var c=l.sibling;if(c!==null)ve=c;else{var u=l.return;u!==null?(ve=u,Od(u)):ve=null}break t}}He=0,qo=null,fi(e,t,r,5);break;case 6:He=0,qo=null,fi(e,t,r,6);break;case 8:Vh(),ft=6;break e;default:throw Error(N(462))}}sZ();break}catch(d){Cy(e,d)}while(1);if(kn=cs=null,W.H=a,W.A=n,Te=o,ve!==null)return 0;return Ze=null,ye=0,Id(),ft}function sZ(){for(;ve!==null&&!A$();)Ty(ve)}function Ty(e){var t=ty(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?Od(e):ve=t}function Vv(e){var t=e,o=t.alternate;switch(t.tag){case 15:case 0:t=Pv(o,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=Pv(o,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:Ah(t);default:oy(o,t),t=ve=o1(t,Rn),t=ty(o,t,Rn)}e.memoizedProps=e.pendingProps,t===null?Od(e):ve=t}function fi(e,t,o,a){kn=cs=null,Ah(t),vi=null,Jl=0;var n=t.return;try{if(WW(e,n,t,o,ye)){ft=1,ad(e,fa(o,e.current)),ve=null;return}}catch(r){if(n!==null)throw ve=n,r;ft=1,ad(e,fa(o,e.current)),ve=null;return}if(t.flags&32768){if(xe||a===1)e=!0;else if(Hi||(ye&536870912)!==0)e=!1;else if(nr=e=!0,a===2||a===9||a===3||a===6)a=ta.current,a!==null&&a.tag===13&&(a.flags|=16384);Ay(t,e)}else Od(t)}function Od(e){var t=e;do{if((t.flags&32768)!==0){Ay(t,nr);return}e=t.return;var o=XW(t.alternate,t,Rn);if(o!==null){ve=o;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);ft===0&&(ft=5)}function Ay(e,t){do{var o=QW(e.alternate,e);if(o!==null){o.flags&=32767,ve=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!t&&(e=e.sibling,e!==null)){ve=e;return}ve=e=o}while(e!==null);ft=6,ve=null}function Kv(e,t,o,a,n,r,s,l,c){e.cancelPendingCommit=null;do Nd();while(Vt!==0);if((Te&6)!==0)throw Error(N(327));if(t!==null){if(t===e.current)throw Error(N(177));if(r=t.lanes|t.childLanes,r|=hh,U$(e,o,r,s,l,c),e===Ze&&(ve=Ze=null,ye=0),Ti=t,mr=e,An=o,_p=r,jp=n,wy=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,uZ(qu,function(){return Ry(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=W.T,W.T=null,n=Ae.p,Ae.p=2,s=Te,Te|=4;try{JW(e,t,o)}finally{Te=s,Ae.p=n,W.T=a}}Vt=1,Ey(),Oy(),Ny()}}function Ey(){if(Vt===1){Vt=0;var e=mr,t=Ti,o=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||o){o=W.T,W.T=null;var a=Ae.p;Ae.p=2;var n=Te;Te|=4;try{fy(t,e);var r=Zp,s=WS(e.containerInfo),{focusedElem:l,selectionRange:c}=r;if(s!==l&&l&&l.ownerDocument&&$S(l.ownerDocument.documentElement,l)){if(c!==null&&ph(l)){var{start:u,end:d}=c;if(d===void 0&&(d=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(d,l.value.length);else{var m=l.ownerDocument||document,f=m&&m.defaultView||window;if(f.getSelection){var p=f.getSelection(),b=l.textContent.length,v=Math.min(c.start,b),S=c.end===void 0?v:Math.min(c.end,b);!p.extend&&v>S&&(s=S,S=v,v=s);var h=fv(l,v),g=fv(l,S);if(h&&g&&(p.rangeCount!==1||p.anchorNode!==h.node||p.anchorOffset!==h.offset||p.focusNode!==g.node||p.focusOffset!==g.offset)){var y=m.createRange();y.setStart(h.node,h.offset),p.removeAllRanges(),v>S?(p.addRange(y),p.extend(g.node,g.offset)):(y.setEnd(g.node,g.offset),p.addRange(y))}}}}m=[];for(p=l;p=p.parentNode;)p.nodeType===1&&m.push({element:p,left:p.scrollLeft,top:p.scrollTop});typeof l.focus==="function"&&l.focus();for(l=0;l<m.length;l++){var I=m[l];I.element.scrollLeft=I.left,I.element.scrollTop=I.top}}gd=!!Wp,Zp=Wp=null}finally{Te=n,Ae.p=a,W.T=o}}e.current=t,Vt=2}}function Oy(){if(Vt===2){Vt=0;var e=mr,t=Ti,o=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||o){o=W.T,W.T=null;var a=Ae.p;Ae.p=2;var n=Te;Te|=4;try{ly(e,t.alternate,t)}finally{Te=n,Ae.p=a,W.T=o}}Vt=3}}function Ny(){if(Vt===4||Vt===3){Vt=0,E$();var e=mr,t=Ti,o=An,a=wy;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Vt=5:(Vt=0,Ti=mr=null,Ly(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(dr=null),ih(o),t=t.stateNode,Xo&&typeof Xo.onCommitFiberRoot==="function")try{Xo.onCommitFiberRoot(lc,t,void 0,(t.current.flags&128)===128)}catch(c){}if(a!==null){t=W.T,n=Ae.p,Ae.p=2,W.T=null;try{for(var r=e.onRecoverableError,s=0;s<a.length;s++){var l=a[s];r(l.value,{componentStack:l.stack})}}finally{W.T=t,Ae.p=n}}(An&3)!==0&&Nd(),en(e),n=e.pendingLanes,(o&261930)!==0&&(n&42)!==0?e===Gp?Kl++:(Kl=0,Gp=e):Kl=0,gc(0,!1)}}function Ly(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fc(t)))}function Nd(){return Ey(),Oy(),Ny(),Ry()}function Ry(){if(Vt!==5)return!1;var e=mr,t=_p;_p=0;var o=ih(An),a=W.T,n=Ae.p;try{Ae.p=32>o?32:o,W.T=null,o=jp,jp=null;var r=mr,s=An;if(Vt=0,Ti=mr=null,An=0,(Te&6)!==0)throw Error(N(331));var l=Te;if(Te|=4,vy(r.current),hy(r,r.current,s,o),Te=l,gc(0,!1),Xo&&typeof Xo.onPostCommitFiberRoot==="function")try{Xo.onPostCommitFiberRoot(lc,r)}catch(c){}return!0}finally{Ae.p=n,W.T=a,Ly(e,t)}}function qv(e,t,o){t=fa(o,t),t=Hp(e.stateNode,t,2),e=ur(e,t,2),e!==null&&(uc(e,2),en(e))}function Pe(e,t,o){if(e.tag===3)qv(e,e,o);else for(;t!==null;){if(t.tag===3){qv(t,e,o);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError==="function"||typeof a.componentDidCatch==="function"&&(dr===null||!dr.has(a))){e=fa(o,e),o=Z1(2),a=ur(t,o,2),a!==null&&(Y1(o,a,t,e),uc(a,2),en(a));break}}t=t.return}}function ep(e,t,o){var a=e.pingCache;if(a===null){a=e.pingCache=new oZ;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(o)||(jh=!0,n.add(o),e=iZ.bind(null,e,t,o),t.then(e,e))}function iZ(e,t,o){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,Ze===e&&(ye&o)===o&&(ft===4||ft===3&&(ye&62914560)===ye&&300>Yo()-Ad?(Te&2)===0&&Ai(e,0):Gh|=o,Di===ye&&(Di=0)),en(e)}function By(e,t){t===0&&(t=kS()),e=ls(e,t),e!==null&&(uc(e,t),en(e))}function lZ(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),By(e,o)}function cZ(e,t){var o=0;switch(e.tag){case 31:case 13:var{stateNode:a,memoizedState:n}=e;n!==null&&(o=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(N(314))}a!==null&&a.delete(t),By(e,o)}function uZ(e,t){return rh(e,t)}var cd=null,ei=null,Vp=!1,ud=!1,tp=!1,sr=0;function en(e){e!==ei&&e.next===null&&(ei===null?cd=ei=e:ei=ei.next=e),ud=!0,Vp||(Vp=!0,mZ())}function gc(e,t){if(!tp&&ud){tp=!0;do{var o=!1;for(var a=cd;a!==null;){if(!t)if(e!==0){var n=a.pendingLanes;if(n===0)var r=0;else{var s=a.suspendedLanes,l=a.pingedLanes;r=(1<<31-Qo(42|e)+1)-1,r&=n&~(s&~l),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(o=!0,$v(a,r))}else r=ye,r=vd(a,a===Ze?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||cc(a,r)||(o=!0,$v(a,r));a=a.next}}while(o);tp=!1}}function dZ(){Hy()}function Hy(){ud=Vp=!1;var e=0;sr!==0&&yZ()&&(e=sr);for(var t=Yo(),o=null,a=cd;a!==null;){var n=a.next,r=Py(a,t);if(r===0)a.next=null,o===null?cd=n:o.next=n,n===null&&(ei=o);else if(o=a,e!==0||(r&3)!==0)ud=!0;a=n}Vt!==0&&Vt!==5||gc(e,!1),sr!==0&&(sr=0)}function Py(e,t){for(var{suspendedLanes:o,pingedLanes:a,expirationTimes:n}=e,r=e.pendingLanes&-62914561;0<r;){var s=31-Qo(r),l=1<<s,c=n[s];if(c===-1){if((l&o)===0||(l&a)!==0)n[s]=z$(l,t)}else c<=t&&(e.expiredLanes|=l);r&=~l}if(t=Ze,o=ye,o=vd(e,e===t?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,o===0||e===t&&(He===2||He===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Of(a),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||cc(e,o)){if(t=o&-o,t===e.callbackPriority)return t;switch(a!==null&&Of(a),ih(o)){case 2:case 8:o=CS;break;case 32:o=qu;break;case 268435456:o=MS;break;default:o=qu}return a=zy.bind(null,e),o=rh(o,a),e.callbackPriority=t,e.callbackNode=o,t}return a!==null&&a!==null&&Of(a),e.callbackPriority=2,e.callbackNode=null,2}function zy(e,t){if(Vt!==0&&Vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(Nd()&&e.callbackNode!==o)return null;var a=ye;if(a=vd(e,e===Ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0)return null;return xy(e,a,t),Py(e,Yo()),e.callbackNode!=null&&e.callbackNode===o?zy.bind(null,e):null}function $v(e,t){if(Nd())return null;xy(e,t,!0)}function mZ(){IZ(function(){(Te&6)!==0?rh(xS,dZ):Hy()})}function Kh(){if(sr===0){var e=Ci;e===0&&(e=pu,pu<<=1,(pu&261888)===0&&(pu=256)),sr=e}return sr}function Wv(e){return e==null||typeof e==="symbol"||typeof e==="boolean"?null:typeof e==="function"?e:Tu(""+e)}function Zv(e,t){var o=t.ownerDocument.createElement("input");return o.name=t.name,o.value=t.value,e.id&&o.setAttribute("form",e.id),t.parentNode.insertBefore(o,t),e=new FormData(e),o.parentNode.removeChild(o),e}function fZ(e,t,o,a,n){if(t==="submit"&&o&&o.stateNode===n){var r=Wv((n[zo]||null).action),s=a.submitter;s&&(t=(t=s[zo]||null)?Wv(t.formAction):s.getAttribute("formAction"),t!==null&&(r=t,s=null));var l=new Sd("action","action",null,a,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(sr!==0){var c=s?Zv(n,s):new FormData(n);Rp(o,{pending:!0,data:c,method:n.method,action:r},null,c)}}else typeof r==="function"&&(l.preventDefault(),c=s?Zv(n,s):new FormData(n),Rp(o,{pending:!0,data:c,method:n.method,action:r},r,c))},currentTarget:n}]})}}for(Nl=0;Nl<Ip.length;Nl++)Ll=Ip[Nl],Kp=Ll.toLowerCase(),qp=Ll[0].toUpperCase()+Ll.slice(1),Ta(Kp,"on"+qp);var Ll,Kp,qp,Nl;Ta(YS,"onAnimationEnd");Ta(XS,"onAnimationIteration");Ta(QS,"onAnimationStart");Ta("dblclick","onDoubleClick");Ta("focusin","onFocus");Ta("focusout","onBlur");Ta(OW,"onTransitionRun");Ta(NW,"onTransitionStart");Ta(LW,"onTransitionCancel");Ta(JS,"onTransitionEnd");Ii("onMouseEnter",["mouseout","mouseover"]);Ii("onMouseLeave",["mouseout","mouseover"]);Ii("onPointerEnter",["pointerout","pointerover"]);Ii("onPointerLeave",["pointerout","pointerover"]);rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));rs("onBeforeInput",["compositionend","keypress","textInput","paste"]);rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="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(" "),pZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oc));function Uy(e,t){t=(t&4)!==0;for(var o=0;o<e.length;o++){var a=e[o],n=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var s=a.length-1;0<=s;s--){var l=a[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==r&&n.isPropagationStopped())break e;r=l,n.currentTarget=u;try{r(n)}catch(d){Wu(d)}n.currentTarget=null,r=c}else for(s=0;s<a.length;s++){if(l=a[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==r&&n.isPropagationStopped())break e;r=l,n.currentTarget=u;try{r(n)}catch(d){Wu(d)}n.currentTarget=null,r=c}}}}function be(e,t){var o=t[pp];o===void 0&&(o=t[pp]=new Set);var a=e+"__bubble";o.has(a)||(Fy(t,e,2,!1),o.add(a))}function op(e,t,o){var a=0;t&&(a|=4),Fy(o,e,a,t)}var Cu="_reactListening"+Math.random().toString(36).slice(2);function qh(e){if(!e[Cu]){e[Cu]=!0,OS.forEach(function(o){o!=="selectionchange"&&(pZ.has(o)||op(o,!1,e),op(o,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cu]||(t[Cu]=!0,op("selectionchange",!1,t))}}function Fy(e,t,o,a){switch(Jy(t)){case 2:var n=jZ;break;case 8:n=GZ;break;default:n=Yh}o=n.bind(null,t,o,e),n=void 0,!Sp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,o,{capture:!0,passive:n}):e.addEventListener(t,o,!0):n!==void 0?e.addEventListener(t,o,{passive:n}):e.addEventListener(t,o,!1)}function ap(e,t,o,a,n){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var s=a.tag;if(s===3||s===4){var l=a.stateNode.containerInfo;if(l===n)break;if(s===4)for(s=a.return;s!==null;){var c=s.tag;if((c===3||c===4)&&s.stateNode.containerInfo===n)return;s=s.return}for(;l!==null;){if(s=ni(l),s===null)return;if(c=s.tag,c===5||c===6||c===26||c===27){a=r=s;continue e}l=l.parentNode}}a=a.return}US(function(){var u=r,d=uh(o),m=[];e:{var f=e1.get(e);if(f!==void 0){var p=Sd,b=e;switch(e){case"keypress":if(Eu(o)===0)break e;case"keydown":case"keyup":p=cW;break;case"focusin":b="focus",p=Hf;break;case"focusout":b="blur",p=Hf;break;case"beforeblur":case"afterblur":p=Hf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=nv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=X$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=mW;break;case YS:case XS:case QS:p=eW;break;case JS:p=pW;break;case"scroll":case"scrollend":p=Z$;break;case"wheel":p=gW;break;case"copy":case"cut":case"paste":p=oW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=sv;break;case"toggle":case"beforetoggle":p=vW}var v=(t&4)!==0,S=!v&&(e==="scroll"||e==="scrollend"),h=v?f!==null?f+"Capture":null:f;v=[];for(var g=u,y;g!==null;){var I=g;if(y=I.stateNode,I=I.tag,I!==5&&I!==26&&I!==27||y===null||h===null||(I=Wl(g,h),I!=null&&v.push(ac(g,I,y))),S)break;g=g.return}0<v.length&&(f=new p(f,b,null,o,d),m.push({event:f,listeners:v}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&o!==vp&&(b=o.relatedTarget||o.fromElement)&&(ni(b)||b[Ni]))break e;if(p||f){if(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p){if(b=o.relatedTarget||o.toElement,p=u,b=b?ni(b):null,b!==null&&(S=ic(b),v=b.tag,b!==S||v!==5&&v!==27&&v!==6))b=null}else p=null,b=u;if(p!==b){if(v=nv,I="onMouseLeave",h="onMouseEnter",g="mouse",e==="pointerout"||e==="pointerover")v=sv,I="onPointerLeave",h="onPointerEnter",g="pointer";if(S=p==null?f:Dl(p),y=b==null?f:Dl(b),f=new v(I,g+"leave",p,o,d),f.target=S,f.relatedTarget=y,I=null,ni(d)===u&&(v=new v(h,g+"enter",b,o,d),v.target=y,v.relatedTarget=S,I=v),S=I,p&&b)t:{v=hZ,h=p,g=b,y=0;for(I=h;I;I=v(I))y++;I=0;for(var k=g;k;k=v(k))I++;for(;0<y-I;)h=v(h),y--;for(;0<I-y;)g=v(g),I--;for(;y--;){if(h===g||g!==null&&h===g.alternate){v=h;break t}h=v(h),g=v(g)}v=null}else v=null;p!==null&&Yv(m,f,p,v,!1),b!==null&&S!==null&&Yv(m,S,b,v,!0)}}}e:{if(f=u?Dl(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=uv;else if(cv(f))if(KS)C=TW;else{C=kW;var D=MW}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&ch(u.elementType)&&(C=uv):C=DW;if(C&&(C=C(e,u))){VS(m,C,o,d);break e}D&&D(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&bp(f,"number",f.value)}switch(D=u?Dl(u):window,e){case"focusin":if(cv(D)||D.contentEditable==="true")ii=D,yp=u,Hl=null;break;case"focusout":Hl=yp=ii=null;break;case"mousedown":wp=!0;break;case"contextmenu":case"mouseup":case"dragend":wp=!1,pv(m,o,d);break;case"selectionchange":if(EW)break;case"keydown":case"keyup":pv(m,o,d)}var M;if(fh)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else si?jS(e,o)&&(A="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(A="onCompositionStart");if(A&&(_S&&o.locale!=="ko"&&(si||A!=="onCompositionStart"?A==="onCompositionEnd"&&si&&(M=FS()):(ar=d,dh=("value"in ar)?ar.value:ar.textContent,si=!0)),D=dd(u,A),0<D.length&&(A=new rv(A,e,null,o,d),m.push({event:A,listeners:D}),M?A.data=M:(M=GS(o),M!==null&&(A.data=M)))),M=yW?wW(e,o):IW(e,o))A=dd(u,"onBeforeInput"),0<A.length&&(D=new rv("onBeforeInput","beforeinput",null,o,d),m.push({event:D,listeners:A}),D.data=M);fZ(m,e,u,o,d)}Uy(m,t)})}function ac(e,t,o){return{instance:e,listener:t,currentTarget:o}}function dd(e,t){for(var o=t+"Capture",a=[];e!==null;){var n=e,r=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||r===null||(n=Wl(e,o),n!=null&&a.unshift(ac(e,n,r)),n=Wl(e,t),n!=null&&a.push(ac(e,n,r))),e.tag===3)return a;e=e.return}return[]}function hZ(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e?e:null}function Yv(e,t,o,a,n){for(var r=t._reactName,s=[];o!==null&&o!==a;){var l=o,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===a)break;l!==5&&l!==26&&l!==27||u===null||(c=u,n?(u=Wl(o,r),u!=null&&s.unshift(ac(o,u,c))):n||(u=Wl(o,r),u!=null&&s.push(ac(o,u,c)))),o=o.return}s.length!==0&&e.push({event:t,listeners:s})}var gZ=/\r\n?/g,bZ=/\u0000|\uFFFD/g;function Xv(e){return(typeof e==="string"?e:""+e).replace(gZ,`
9
+ `).replace(bZ,"")}function _y(e,t){return t=Xv(t),Xv(e)===t?!0:!1}function Ge(e,t,o,a,n,r){switch(o){case"children":typeof a==="string"?t==="body"||t==="textarea"&&a===""||xi(e,a):(typeof a==="number"||typeof a==="bigint")&&t!=="body"&&xi(e,""+a);break;case"className":bu(e,"class",a);break;case"tabIndex":bu(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":bu(e,o,a);break;case"style":zS(e,a,r);break;case"data":if(t!=="object"){bu(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||o!=="href")){e.removeAttribute(o);break}if(a==null||typeof a==="function"||typeof a==="symbol"||typeof a==="boolean"){e.removeAttribute(o);break}a=Tu(""+a),e.setAttribute(o,a);break;case"action":case"formAction":if(typeof a==="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r==="function"&&(o==="formAction"?(t!=="input"&&Ge(e,t,"name",n.name,n,null),Ge(e,t,"formEncType",n.formEncType,n,null),Ge(e,t,"formMethod",n.formMethod,n,null),Ge(e,t,"formTarget",n.formTarget,n,null)):(Ge(e,t,"encType",n.encType,n,null),Ge(e,t,"method",n.method,n,null),Ge(e,t,"target",n.target,n,null)));if(a==null||typeof a==="symbol"||typeof a==="boolean"){e.removeAttribute(o);break}a=Tu(""+a),e.setAttribute(o,a);break;case"onClick":a!=null&&(e.onclick=Mn);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!=="object"||!("__html"in a))throw Error(N(61));if(o=a.__html,o!=null){if(n.children!=null)throw Error(N(60));e.innerHTML=o}}break;case"multiple":e.multiple=a&&typeof a!=="function"&&typeof a!=="symbol";break;case"muted":e.muted=a&&typeof a!=="function"&&typeof a!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a==="function"||typeof a==="boolean"||typeof a==="symbol"){e.removeAttribute("xlink:href");break}o=Tu(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!=="function"&&typeof a!=="symbol"?e.setAttribute(o,""+a):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!=="function"&&typeof a!=="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":a===!0?e.setAttribute(o,""):a!==!1&&a!=null&&typeof a!=="function"&&typeof a!=="symbol"?e.setAttribute(o,a):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!=="function"&&typeof a!=="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(o,a):e.removeAttribute(o);break;case"rowSpan":case"start":a==null||typeof a==="function"||typeof a==="symbol"||isNaN(a)?e.removeAttribute(o):e.setAttribute(o,a);break;case"popover":be("beforetoggle",e),be("toggle",e),Du(e,"popover",a);break;case"xlinkActuate":bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":bn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":bn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":bn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":bn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Du(e,"is",a);break;case"innerText":case"textContent":break;default:if(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")o=$$.get(o)||o,Du(e,o,a)}}function $p(e,t,o,a,n,r){switch(o){case"style":zS(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!=="object"||!("__html"in a))throw Error(N(61));if(o=a.__html,o!=null){if(n.children!=null)throw Error(N(60));e.innerHTML=o}}break;case"children":typeof a==="string"?xi(e,a):(typeof a==="number"||typeof a==="bigint")&&xi(e,""+a);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Mn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!NS.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(n=o.endsWith("Capture"),t=o.slice(2,n?o.length-7:void 0),r=e[zo]||null,r=r!=null?r[o]:null,typeof r==="function"&&e.removeEventListener(t,r,n),typeof a==="function")){typeof r!=="function"&&r!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(t,a,n);break e}o in e?e[o]=a:a===!0?e.setAttribute(o,""):Du(e,o,a)}}}function go(e,t,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var a=!1,n=!1,r;for(r in o)if(o.hasOwnProperty(r)){var s=o[r];if(s!=null)switch(r){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ge(e,t,r,s,o,null)}}n&&Ge(e,t,"srcSet",o.srcSet,o,null),a&&Ge(e,t,"src",o.src,o,null);return;case"input":be("invalid",e);var l=r=s=n=null,c=null,u=null;for(a in o)if(o.hasOwnProperty(a)){var d=o[a];if(d!=null)switch(a){case"name":n=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(N(137,t));break;default:Ge(e,t,a,d,o,null)}}BS(e,r,l,c,u,s,n,!1);return;case"select":be("invalid",e),a=s=r=null;for(n in o)if(o.hasOwnProperty(n)&&(l=o[n],l!=null))switch(n){case"value":r=l;break;case"defaultValue":s=l;break;case"multiple":a=l;default:Ge(e,t,n,l,o,null)}t=r,o=s,e.multiple=!!a,t!=null?hi(e,!!a,t,!1):o!=null&&hi(e,!!a,o,!0);return;case"textarea":be("invalid",e),r=n=a=null;for(s in o)if(o.hasOwnProperty(s)&&(l=o[s],l!=null))switch(s){case"value":a=l;break;case"defaultValue":n=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(N(91));break;default:Ge(e,t,s,l,o,null)}PS(e,a,n,r);return;case"option":for(c in o)if(o.hasOwnProperty(c)&&(a=o[c],a!=null))switch(c){case"selected":e.selected=a&&typeof a!=="function"&&typeof a!=="symbol";break;default:Ge(e,t,c,a,o,null)}return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(a=0;a<oc.length;a++)be(oc[a],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in o)if(o.hasOwnProperty(u)&&(a=o[u],a!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(N(137,t));default:Ge(e,t,u,a,o,null)}return;default:if(ch(t)){for(d in o)o.hasOwnProperty(d)&&(a=o[d],a!==void 0&&$p(e,t,d,a,o,void 0));return}}for(l in o)o.hasOwnProperty(l)&&(a=o[l],a!=null&&Ge(e,t,l,a,o,null))}function vZ(e,t,o,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,r=null,s=null,l=null,c=null,u=null,d=null;for(p in o){var m=o[p];if(o.hasOwnProperty(p)&&m!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=m;default:a.hasOwnProperty(p)||Ge(e,t,p,null,a,m)}}for(var f in a){var p=a[f];if(m=o[f],a.hasOwnProperty(f)&&(p!=null||m!=null))switch(f){case"type":r=p;break;case"name":n=p;break;case"checked":u=p;break;case"defaultChecked":d=p;break;case"value":s=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(N(137,t));break;default:p!==m&&Ge(e,t,f,p,a,m)}}gp(e,s,l,c,u,d,r,n);return;case"select":p=s=l=f=null;for(r in o)if(c=o[r],o.hasOwnProperty(r)&&c!=null)switch(r){case"value":break;case"multiple":p=c;default:a.hasOwnProperty(r)||Ge(e,t,r,null,a,c)}for(n in a)if(r=a[n],c=o[n],a.hasOwnProperty(n)&&(r!=null||c!=null))switch(n){case"value":f=r;break;case"defaultValue":l=r;break;case"multiple":s=r;default:r!==c&&Ge(e,t,n,r,a,c)}t=l,o=s,a=p,f!=null?hi(e,!!o,f,!1):!!a!==!!o&&(t!=null?hi(e,!!o,t,!0):hi(e,!!o,o?[]:"",!1));return;case"textarea":p=f=null;for(l in o)if(n=o[l],o.hasOwnProperty(l)&&n!=null&&!a.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Ge(e,t,l,null,a,n)}for(s in a)if(n=a[s],r=o[s],a.hasOwnProperty(s)&&(n!=null||r!=null))switch(s){case"value":f=n;break;case"defaultValue":p=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(N(91));break;default:n!==r&&Ge(e,t,s,n,a,r)}HS(e,f,p);return;case"option":for(var b in o)if(f=o[b],o.hasOwnProperty(b)&&f!=null&&!a.hasOwnProperty(b))switch(b){case"selected":e.selected=!1;break;default:Ge(e,t,b,null,a,f)}for(c in a)if(f=a[c],p=o[c],a.hasOwnProperty(c)&&f!==p&&(f!=null||p!=null))switch(c){case"selected":e.selected=f&&typeof f!=="function"&&typeof f!=="symbol";break;default:Ge(e,t,c,f,a,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var v in o)f=o[v],o.hasOwnProperty(v)&&f!=null&&!a.hasOwnProperty(v)&&Ge(e,t,v,null,a,f);for(u in a)if(f=a[u],p=o[u],a.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(N(137,t));break;default:Ge(e,t,u,f,a,p)}return;default:if(ch(t)){for(var S in o)f=o[S],o.hasOwnProperty(S)&&f!==void 0&&!a.hasOwnProperty(S)&&$p(e,t,S,void 0,a,f);for(d in a)f=a[d],p=o[d],!a.hasOwnProperty(d)||f===p||f===void 0&&p===void 0||$p(e,t,d,f,a,p);return}}for(var h in o)f=o[h],o.hasOwnProperty(h)&&f!=null&&!a.hasOwnProperty(h)&&Ge(e,t,h,null,a,f);for(m in a)f=a[m],p=o[m],!a.hasOwnProperty(m)||f===p||f==null&&p==null||Ge(e,t,m,f,a,p)}function Qv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SZ(){if(typeof performance.getEntriesByType==="function"){for(var e=0,t=0,o=performance.getEntriesByType("resource"),a=0;a<o.length;a++){var n=o[a],{transferSize:r,initiatorType:s,duration:l}=n;if(r&&l&&Qv(s)){s=0,l=n.responseEnd;for(a+=1;a<o.length;a++){var c=o[a],u=c.startTime;if(u>l)break;var d=c.transferSize,m=c.initiatorType;d&&Qv(m)&&(c=c.responseEnd,s+=d*(c<l?1:(l-u)/(c-u)))}if(--a,t+=8*(r+s)/(n.duration/1000),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==="number")?e:5}var Wp=null,Zp=null;function md(e){return e.nodeType===9?e:e.ownerDocument}function Jv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Yp(e,t){return e==="textarea"||e==="noscript"||typeof t.children==="string"||typeof t.children==="number"||typeof t.children==="bigint"||typeof t.dangerouslySetInnerHTML==="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var np=null;function yZ(){var e=window.event;if(e&&e.type==="popstate"){if(e===np)return!1;return np=e,!0}return np=null,!1}var Gy=typeof setTimeout==="function"?setTimeout:void 0,wZ=typeof clearTimeout==="function"?clearTimeout:void 0,eS=typeof Promise==="function"?Promise:void 0,IZ=typeof queueMicrotask==="function"?queueMicrotask:typeof eS<"u"?function(e){return eS.resolve(null).then(e).catch(xZ)}:Gy;function xZ(e){setTimeout(function(){throw e})}function wr(e){return e==="head"}function tS(e,t){var o=t,a=0;do{var n=o.nextSibling;if(e.removeChild(o),n&&n.nodeType===8)if(o=n.data,o==="/$"||o==="/&"){if(a===0){e.removeChild(n),Oi(t);return}a--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")a++;else if(o==="html")ql(e.ownerDocument.documentElement);else if(o==="head"){o=e.ownerDocument.head,ql(o);for(var r=o.firstChild;r;){var s=r.nextSibling,l=r.nodeName;r[dc]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&r.rel.toLowerCase()==="stylesheet"||o.removeChild(r),r=s}}else o==="body"&&ql(e.ownerDocument.body);o=n}while(o);Oi(t)}function oS(e,t){var o=e;e=0;do{var a=o.nextSibling;if(o.nodeType===1?t?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(t?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),a&&a.nodeType===8)if(o=a.data,o==="/$")if(e===0)break;else e--;else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||e++;o=a}while(o)}function Xp(e){var t=e.firstChild;t&&t.nodeType===10&&(t=t.nextSibling);for(;t;){var o=t;switch(t=t.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Xp(o),lh(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function CZ(e,t,o,a){for(;e.nodeType===1;){var n=o;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(!a)if(t==="input"&&e.type==="hidden"){var r=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;else if(!e[dc])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;else if(r!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}if(e=ga(e.nextSibling),e===null)break}return null}function MZ(e,t,o){if(t==="")return null;for(;e.nodeType!==3;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o)return null;if(e=ga(e.nextSibling),e===null)return null}return e}function Vy(e,t){for(;e.nodeType!==8;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t)return null;if(e=ga(e.nextSibling),e===null)return null}return e}function Qp(e){return e.data==="$?"||e.data==="$~"}function Jp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function kZ(e,t){var o=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||o.readyState!=="loading")t();else{var a=function(){t(),o.removeEventListener("DOMContentLoaded",a)};o.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function ga(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var eh=null;function aS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"||o==="/&"){if(t===0)return ga(e.nextSibling);t--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||t++}e=e.nextSibling}return null}function nS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(t===0)return e;t--}else o!=="/$"&&o!=="/&"||t++}e=e.previousSibling}return null}function Ky(e,t,o){switch(t=md(o),e){case"html":if(e=t.documentElement,!e)throw Error(N(452));return e;case"head":if(e=t.head,!e)throw Error(N(453));return e;case"body":if(e=t.body,!e)throw Error(N(454));return e;default:throw Error(N(451))}}function ql(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lh(e)}var ba=new Map,rS=new Set;function fd(e){return typeof e.getRootNode==="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Bn=Ae.d;Ae.d={f:DZ,r:TZ,D:AZ,C:EZ,L:OZ,m:NZ,X:RZ,S:LZ,M:BZ};function DZ(){var e=Bn.f(),t=Ed();return e||t}function TZ(e){var t=Li(e);t!==null&&t.tag===5&&t.type==="form"?z1(t):Bn.r(e)}var Pi=typeof document>"u"?null:document;function qy(e,t,o){var a=Pi;if(a&&typeof t==="string"&&t){var n=ma(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof o==="string"&&(n+='[crossorigin="'+o+'"]'),rS.has(n)||(rS.add(n),e={rel:e,crossOrigin:o,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),go(t,"link",e),ao(t),a.head.appendChild(t)))}}function AZ(e){Bn.D(e),qy("dns-prefetch",e,null)}function EZ(e,t){Bn.C(e,t),qy("preconnect",e,t)}function OZ(e,t,o){Bn.L(e,t,o);var a=Pi;if(a&&e&&t){var n='link[rel="preload"][as="'+ma(t)+'"]';t==="image"?o&&o.imageSrcSet?(n+='[imagesrcset="'+ma(o.imageSrcSet)+'"]',typeof o.imageSizes==="string"&&(n+='[imagesizes="'+ma(o.imageSizes)+'"]')):n+='[href="'+ma(e)+'"]':n+='[href="'+ma(e)+'"]';var r=n;switch(t){case"style":r=Ei(e);break;case"script":r=zi(e)}ba.has(r)||(e=at({rel:"preload",href:t==="image"&&o&&o.imageSrcSet?void 0:e,as:t},o),ba.set(r,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(bc(r))||t==="script"&&a.querySelector(vc(r))||(t=a.createElement("link"),go(t,"link",e),ao(t),a.head.appendChild(t)))}}function NZ(e,t){Bn.m(e,t);var o=Pi;if(o&&e){var a=t&&typeof t.as==="string"?t.as:"script",n='link[rel="modulepreload"][as="'+ma(a)+'"][href="'+ma(e)+'"]',r=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=zi(e)}if(!ba.has(r)&&(e=at({rel:"modulepreload",href:e},t),ba.set(r,e),o.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(vc(r)))return}a=o.createElement("link"),go(a,"link",e),ao(a),o.head.appendChild(a)}}}function LZ(e,t,o){Bn.S(e,t,o);var a=Pi;if(a&&e){var n=pi(a).hoistableStyles,r=Ei(e);t=t||"default";var s=n.get(r);if(!s){var l={loading:0,preload:null};if(s=a.querySelector(bc(r)))l.loading=5;else{e=at({rel:"stylesheet",href:e,"data-precedence":t},o),(o=ba.get(r))&&$h(e,o);var c=s=a.createElement("link");ao(c),go(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Uu(s,t,a)}s={type:"stylesheet",instance:s,count:1,state:l},n.set(r,s)}}}function RZ(e,t){Bn.X(e,t);var o=Pi;if(o&&e){var a=pi(o).hoistableScripts,n=zi(e),r=a.get(n);r||(r=o.querySelector(vc(n)),r||(e=at({src:e,async:!0},t),(t=ba.get(n))&&Wh(e,t),r=o.createElement("script"),ao(r),go(r,"link",e),o.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(n,r))}}function BZ(e,t){Bn.M(e,t);var o=Pi;if(o&&e){var a=pi(o).hoistableScripts,n=zi(e),r=a.get(n);r||(r=o.querySelector(vc(n)),r||(e=at({src:e,async:!0,type:"module"},t),(t=ba.get(n))&&Wh(e,t),r=o.createElement("script"),ao(r),go(r,"link",e),o.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(n,r))}}function sS(e,t,o,a){var n=(n=ir.current)?fd(n):null;if(!n)throw Error(N(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence==="string"&&typeof o.href==="string"?(t=Ei(o.href),o=pi(n).hoistableStyles,a=o.get(t),a||(a={type:"style",instance:null,count:0,state:null},o.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href==="string"&&typeof o.precedence==="string"){e=Ei(o.href);var r=pi(n).hoistableStyles,s=r.get(e);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,s),(r=n.querySelector(bc(e)))&&!r._p&&(s.instance=r,s.state.loading=5),ba.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ba.set(e,o),r||HZ(n,e,o,s.state))),t&&a===null)throw Error(N(528,""));return s}if(t&&a!==null)throw Error(N(529,""));return null;case"script":return t=o.async,o=o.src,typeof o==="string"&&t&&typeof t!=="function"&&typeof t!=="symbol"?(t=zi(o),o=pi(n).hoistableScripts,a=o.get(t),a||(a={type:"script",instance:null,count:0,state:null},o.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(N(444,e))}}function Ei(e){return'href="'+ma(e)+'"'}function bc(e){return'link[rel="stylesheet"]['+e+"]"}function $y(e){return at({},e,{"data-precedence":e.precedence,precedence:null})}function HZ(e,t,o,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),go(t,"link",o),ao(t),e.head.appendChild(t))}function zi(e){return'[src="'+ma(e)+'"]'}function vc(e){return"script[async]"+e}function iS(e,t,o){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+ma(o.href)+'"]');if(a)return t.instance=a,ao(a),a;var n=at({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ao(a),go(a,"style",n),Uu(a,o.precedence,e),t.instance=a;case"stylesheet":n=Ei(o.href);var r=e.querySelector(bc(n));if(r)return t.state.loading|=4,t.instance=r,ao(r),r;a=$y(o),(n=ba.get(n))&&$h(a,n),r=(e.ownerDocument||e).createElement("link"),ao(r);var s=r;return s._p=new Promise(function(l,c){s.onload=l,s.onerror=c}),go(r,"link",a),t.state.loading|=4,Uu(r,o.precedence,e),t.instance=r;case"script":if(r=zi(o.src),n=e.querySelector(vc(r)))return t.instance=n,ao(n),n;if(a=o,n=ba.get(r))a=at({},o),Wh(a,n);return e=e.ownerDocument||e,n=e.createElement("script"),ao(n),go(n,"link",a),e.head.appendChild(n),t.instance=n;case"void":return null;default:throw Error(N(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Uu(a,o.precedence,e));return t.instance}function Uu(e,t,o){for(var a=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,r=n,s=0;s<a.length;s++){var l=a[s];if(l.dataset.precedence===t)r=l;else if(r!==n)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=o.nodeType===9?o.head:o,t.insertBefore(e,t.firstChild))}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fu=null;function lS(e,t,o){if(Fu===null){var a=new Map,n=Fu=new Map;n.set(o,a)}else n=Fu,a=n.get(o),a||(a=new Map,n.set(o,a));if(a.has(e))return a;a.set(e,null),o=o.getElementsByTagName(e);for(n=0;n<o.length;n++){var r=o[n];if(!(r[dc]||r[fo]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var s=r.getAttribute(t)||"";s=e+s;var l=a.get(s);l?l.push(r):a.set(s,[r])}}return a}function cS(e,t,o){e=e.ownerDocument||e,e.head.insertBefore(o,t==="title"?e.querySelector("head > title"):null)}function PZ(e,t,o){if(o===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!=="string"||typeof t.href!=="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!=="string"||typeof t.href!=="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence==="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!=="function"&&typeof t.async!=="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==="string")return!0}return!1}function Wy(e){return e.type==="stylesheet"&&(e.state.loading&3)===0?!1:!0}function zZ(e,t,o,a){if(o.type==="stylesheet"&&(typeof a.media!=="string"||matchMedia(a.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var n=Ei(a.href),r=t.querySelector(bc(n));if(r){t=r._p,t!==null&&typeof t==="object"&&typeof t.then==="function"&&(e.count++,e=pd.bind(e),t.then(e,e)),o.state.loading|=4,o.instance=r,ao(r);return}r=t.ownerDocument||t,a=$y(a),(n=ba.get(n))&&$h(a,n),r=r.createElement("link"),ao(r);var s=r;s._p=new Promise(function(l,c){s.onload=l,s.onerror=c}),go(r,"link",a),o.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(o,t),(t=o.state.preload)&&(o.state.loading&3)===0&&(e.count++,o=pd.bind(e),t.addEventListener("load",o),t.addEventListener("error",o))}}var rp=0;function UZ(e,t){return e.stylesheets&&e.count===0&&_u(e,e.stylesheets),0<e.count||0<e.imgCount?function(o){var a=setTimeout(function(){if(e.stylesheets&&_u(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},60000+t);0<e.imgBytes&&rp===0&&(rp=62500*SZ());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_u(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>rp?50:800)+t);return e.unsuspend=o,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function pd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_u(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hd=null;function _u(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hd=new Map,t.forEach(FZ,e),hd=null,pd.call(e))}function FZ(e,t){if(!(t.state.loading&4)){var o=hd.get(e);if(o)var a=o.get(null);else{o=new Map,hd.set(e,o);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<n.length;r++){var s=n[r];if(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")o.set(s.dataset.precedence,s),a=s}a&&o.set(null,a)}n=t.instance,s=n.getAttribute("data-precedence"),r=o.get(s)||a,r===a&&o.set(null,n),o.set(s,n),this.count++,a=pd.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),r?r.parentNode.insertBefore(n,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var nc={$$typeof:Cn,Provider:null,Consumer:null,_currentValue:Zr,_currentValue2:Zr,_threadCount:0};function _Z(e,t,o,a,n,r,s,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nf(0),this.hiddenUpdates=Nf(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=r,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Zy(e,t,o,a,n,r,s,l,c,u,d,m){return e=new _Z(e,t,o,s,c,u,d,m,l),t=1,r===!0&&(t|=24),r=Wo(3,null,null,t),e.current=r,r.stateNode=e,t=yh(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:o,cache:t},xh(r),e}function Yy(e){if(!e)return ui;return e=ui,e}function Xy(e,t,o,a,n,r){n=Yy(n),a.context===null?a.context=n:a.pendingContext=n,a=cr(t),a.payload={element:o},r=r===void 0?null:r,r!==null&&(a.callback=r),o=ur(e,a,t),o!==null&&(Po(o,e,t),zl(o,e,t))}function uS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<t?o:t}}function Zh(e,t){uS(e,t),(e=e.alternate)&&uS(e,t)}function Qy(e){if(e.tag===13||e.tag===31){var t=ls(e,67108864);t!==null&&Po(t,e,67108864),Zh(e,67108864)}}function dS(e){if(e.tag===13||e.tag===31){var t=Jo();t=sh(t);var o=ls(e,t);o!==null&&Po(o,e,t),Zh(e,t)}}var gd=!0;function jZ(e,t,o,a){var n=W.T;W.T=null;var r=Ae.p;try{Ae.p=2,Yh(e,t,o,a)}finally{Ae.p=r,W.T=n}}function GZ(e,t,o,a){var n=W.T;W.T=null;var r=Ae.p;try{Ae.p=8,Yh(e,t,o,a)}finally{Ae.p=r,W.T=n}}function Yh(e,t,o,a){if(gd){var n=th(a);if(n===null)ap(e,t,a,bd,o),mS(e,a);else if(KZ(n,e,t,o,a))a.stopPropagation();else if(mS(e,a),t&4&&-1<VZ.indexOf(e)){for(;n!==null;){var r=Li(n);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var s=Kr(r.pendingLanes);if(s!==0){var l=r;l.pendingLanes|=2;for(l.entangledLanes|=2;s;){var c=1<<31-Qo(s);l.entanglements[1]|=c,s&=~c}en(r),(Te&6)===0&&(sd=Yo()+500,gc(0,!1))}}break;case 31:case 13:l=ls(r,2),l!==null&&Po(l,r,2),Ed(),Zh(r,2)}if(r=th(a),r===null&&ap(e,t,a,bd,o),r===n)break;n=r}n!==null&&a.stopPropagation()}else ap(e,t,a,null,o)}}function th(e){return e=uh(e),Xh(e)}var bd=null;function Xh(e){if(bd=null,e=ni(e),e!==null){var t=ic(e);if(t===null)e=null;else{var o=t.tag;if(o===13){if(e=vS(t),e!==null)return e;e=null}else if(o===31){if(e=SS(t),e!==null)return e;e=null}else if(o===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bd=e,null}function Jy(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(O$()){case xS:return 2;case CS:return 8;case qu:case N$:return 32;case MS:return 268435456;default:return 32}default:return 32}}var oh=!1,fr=null,pr=null,hr=null,rc=new Map,sc=new Map,tr=[],VZ="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".split(" ");function mS(e,t){switch(e){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":pr=null;break;case"mouseover":case"mouseout":hr=null;break;case"pointerover":case"pointerout":rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":sc.delete(t.pointerId)}}function Cl(e,t,o,a,n,r){if(e===null||e.nativeEvent!==r)return e={blockedOn:t,domEventName:o,eventSystemFlags:a,nativeEvent:r,targetContainers:[n]},t!==null&&(t=Li(t),t!==null&&Qy(t)),e;return e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e}function KZ(e,t,o,a,n){switch(t){case"focusin":return fr=Cl(fr,e,t,o,a,n),!0;case"dragenter":return pr=Cl(pr,e,t,o,a,n),!0;case"mouseover":return hr=Cl(hr,e,t,o,a,n),!0;case"pointerover":var r=n.pointerId;return rc.set(r,Cl(rc.get(r)||null,e,t,o,a,n)),!0;case"gotpointercapture":return r=n.pointerId,sc.set(r,Cl(sc.get(r)||null,e,t,o,a,n)),!0}return!1}function ew(e){var t=ni(e.target);if(t!==null){var o=ic(t);if(o!==null){if(t=o.tag,t===13){if(t=vS(o),t!==null){e.blockedOn=t,X0(e.priority,function(){dS(o)});return}}else if(t===31){if(t=SS(o),t!==null){e.blockedOn=t,X0(e.priority,function(){dS(o)});return}}else if(t===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ju(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var o=th(e.nativeEvent);if(o===null){o=e.nativeEvent;var a=new o.constructor(o.type,o);vp=a,o.target.dispatchEvent(a),vp=null}else return t=Li(o),t!==null&&Qy(t),e.blockedOn=o,!1;t.shift()}return!0}function fS(e,t,o){ju(e)&&o.delete(t)}function qZ(){oh=!1,fr!==null&&ju(fr)&&(fr=null),pr!==null&&ju(pr)&&(pr=null),hr!==null&&ju(hr)&&(hr=null),rc.forEach(fS),sc.forEach(fS)}function Mu(e,t){e.blockedOn===t&&(e.blockedOn=null,oh||(oh=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,qZ)))}var ku=null;function pS(e){ku!==e&&(ku=e,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,function(){ku===e&&(ku=null);for(var t=0;t<e.length;t+=3){var o=e[t],a=e[t+1],n=e[t+2];if(typeof a!=="function")if(Xh(a||o)===null)continue;else break;var r=Li(o);r!==null&&(e.splice(t,3),t-=3,Rp(r,{pending:!0,data:n,method:o.method,action:a},a,n))}}))}function Oi(e){function t(c){return Mu(c,e)}fr!==null&&Mu(fr,e),pr!==null&&Mu(pr,e),hr!==null&&Mu(hr,e),rc.forEach(t),sc.forEach(t);for(var o=0;o<tr.length;o++){var a=tr[o];a.blockedOn===e&&(a.blockedOn=null)}for(;0<tr.length&&(o=tr[0],o.blockedOn===null);)ew(o),o.blockedOn===null&&tr.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(a=0;a<o.length;a+=3){var n=o[a],r=o[a+1],s=n[zo]||null;if(typeof r==="function")s||pS(o);else if(s){var l=null;if(r&&r.hasAttribute("formAction")){if(n=r,s=r[zo]||null)l=s.formAction;else if(Xh(n)!==null)continue}else l=s.action;typeof l==="function"?o[a+1]=l:(o.splice(a,3),a-=3),pS(o)}}}function tw(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(s){return n=s})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(o,20)}function o(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(o,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function Qh(e){this._internalRoot=e}Ld.prototype.render=Qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));var o=t.current,a=Jo();Xy(o,a,e,t,null,null)};Ld.prototype.unmount=Qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xy(e.current,2,null,e,null,null),Ed(),t[Ni]=null}};function Ld(e){this._internalRoot=e}Ld.prototype.unstable_scheduleHydration=function(e){if(e){var t=ES();e={blockedOn:null,target:e,priority:t};for(var o=0;o<tr.length&&t!==0&&t<tr[o].priority;o++);tr.splice(o,0,e),o===0&&ew(e)}};var hS=gS.version;if(hS!=="19.2.8")throw Error(N(527,hS,"19.2.8"));Ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0){if(typeof e.render==="function")throw Error(N(188));throw e=Object.keys(e).join(","),Error(N(268,e))}return e=C$(t),e=e!==null?yS(e):null,e=e===null?null:e.stateNode,e};var $Z={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){if(ti=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ti.isDisabled&&ti.supportsFiber)try{lc=ti.inject($Z),Xo=ti}catch(e){}}var ti;Rd.createRoot=function(e,t){if(!bS(e))throw Error(N(299));var o=!1,a="",n=q1,r=$1,s=W1;return t!==null&&t!==void 0&&(t.unstable_strictMode===!0&&(o=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Zy(e,1,!1,null,null,o,a,null,n,r,s,tw),e[Ni]=t.current,qh(e),new Qh(t)};Rd.hydrateRoot=function(e,t,o){if(!bS(e))throw Error(N(299));var a=!1,n="",r=q1,s=$1,l=W1,c=null;return o!==null&&o!==void 0&&(o.unstable_strictMode===!0&&(a=!0),o.identifierPrefix!==void 0&&(n=o.identifierPrefix),o.onUncaughtError!==void 0&&(r=o.onUncaughtError),o.onCaughtError!==void 0&&(s=o.onCaughtError),o.onRecoverableError!==void 0&&(l=o.onRecoverableError),o.formState!==void 0&&(c=o.formState)),t=Zy(e,1,!0,t,o!=null?o:null,a,n,c,r,s,l,tw),t.context=Yy(null),o=t.current,a=Jo(),a=sh(a),n=cr(a),n.callback=null,ur(o,n,a),o=a,t.current.lanes=o,uc(t,o),en(t),e[Ni]=t.current,qh(e),new Ld(t)};Rd.version="19.2.8"});var Jh=$a(function(WZ,nw){function aw(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aw)}catch(e){console.error(e)}}aw(),nw.exports=ow()});var Gw=$a(function(_d){var lY=Symbol.for("react.transitional.element"),cY=Symbol.for("react.fragment");function jw(e,t,o){var a=null;if(o!==void 0&&(a=""+o),t.key!==void 0&&(a=""+t.key),"key"in t){o={};for(var n in t)n!=="key"&&(o[n]=t[n])}else o=t;return t=o.ref,{$$typeof:lY,type:e,key:a,ref:t!==void 0?t:null,props:o}}_d.Fragment=cY;_d.jsx=jw;_d.jsxs=jw});var T=$a(function(uY,Vw){Vw.exports=Gw()});var Pq=x(R(),1),zq=x(Jh(),1);var Ma=x(R(),1),EM=x(gn(),1);class Bd extends Error{path;constructor(e){super("swarmd is not responding — it may be restarting");this.path=e;this.name="OfflineError"}}class tn extends Error{status;path;constructor(e,t){super(`${t}: ${e}`);this.status=e;this.path=t;this.name="ApiError"}}function ZZ(){let e=new URLSearchParams(location.search),t=e.get("token");if(t){try{sessionStorage.setItem(rw,t)}catch{}e.delete("token");let o=e.size>0?`?${e}`:"";return history.replaceState(null,"",`${location.pathname}${o}${location.hash}`),t}try{return sessionStorage.getItem(rw)}catch{return null}}var rw="swarm.token",eg=ZZ();function tg(e){let t=new Headers(e);if(eg)t.set("authorization",`Bearer ${eg}`);return t}async function qt(e,t){let o={headers:tg()};if(t)o.signal=t;let a=await og(e,o);if(!a.ok)throw new tn(a.status,e);return await a.json()}async function sw(e,t,o){let a={headers:tg(t?{"if-none-match":t}:void 0)};if(o)a.signal=o;let n=await og(e,a);if(n.status===304)return{changed:!1};if(!n.ok)throw new tn(n.status,e);return{changed:!0,data:await n.json(),etag:n.headers.get("etag")}}async function og(e,t){try{return await fetch(e,t)}catch(o){if(o instanceof DOMException&&o.name==="AbortError")throw o;throw new Bd(e)}}async function De(e,t,o){let a={method:t,headers:tg()};if(o!==void 0)a.body=JSON.stringify(o),a.headers.set("content-type","application/json");let n=await og(e,a),r=n.status===409||n.status===400;if(!n.ok&&!r)throw new tn(n.status,e);return await n.json()}function ze(e){let t=new URLSearchParams;for(let[a,n]of Object.entries(e))if(n!==null&&n!==void 0&&n!=="")t.set(a,String(n));let o=t.toString();return o?`?${o}`:""}function iw(e){return new EventSource(`/v1/events${ze({since:e,token:eg})}`)}var cw=x(R(),1);function lw(e){return Boolean(e?.closest?.("a,button,input,select,textarea"))}function uw(){cw.useEffect(()=>{if(new URLSearchParams(location.search).get("chrome")!=="inset")return;document.documentElement.classList.add("chrome-inset");let e=document.querySelector("header");if(!e)return;let t=()=>window.__TAURI__?.window?.getCurrentWindow?.(),o=(n)=>{let r=n;if(r.button===0&&!lw(r.target))t()?.startDragging?.()},a=(n)=>{if(!lw(n.target))t()?.toggleMaximize?.()};return e.addEventListener("mousedown",o),e.addEventListener("dblclick",a),()=>{e.removeEventListener("mousedown",o),e.removeEventListener("dblclick",a)}},[])}var dw=x(R(),1);var ag="https://github.com/ra3orblade/swarm",mw="https://getswarm.vercel.app/docs/",fw="https://getswarm.vercel.app/changelog";function ng(){return Boolean(window.__TAURI__||window.__TAURI_INTERNALS__)}function on(e){let t=window.__TAURI__?.shell;if(t?.open){t.open(e).catch(()=>window.open(e,"_blank"));return}window.open(e,"_blank")}function pw(){dw.useEffect(()=>{let e=(t)=>{let a=t.target?.closest?.('a[href^="http"]');if(!a)return;t.preventDefault(),on(a.href)};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[])}function Hd(e){let t=navigator.userAgent,o=/Mac/.test(t)?"macOS":/Windows/.test(t)?"Windows":/Linux/.test(t)?"Linux":"unknown OS",a=`swarm ${e??"?"} · ${o} · ${ng()?"desktop":"browser"}`,n=new URLSearchParams({template:"feedback.yml",environment:a});return`${ag}/issues/new?${n}`}function Pd(e,t=!1){let o=window.RELEASE_NOTES??{},a=e?o[e]:void 0;if(e&&a)return{version:e,...a};if(t)return null;let n=Object.keys(o)[0],r=n?o[n]:void 0;return n&&r?{version:n,...r}:null}var hw="swarm.seenVersion";function rg(e){try{localStorage.setItem(hw,e)}catch{}}function gw(e){if(!e||!window.RELEASE_NOTES)return null;let t=null;try{t=localStorage.getItem(hw)}catch{return null}if(t===e)return null;if(!t)return rg(e),null;return Pd(e,!0)}var Sw=x(R(),1);var sg=[0.7,0.8,0.9,1,1.1,1.25,1.5,1.75,2],YZ=3,yw="swarm.zoom",XZ=80,bw=0;function QZ(e){if(e==="="||e==="+")return 1;if(e==="-"||e==="_")return-1;return e==="0"?0:null}function ww(){return Number(localStorage.getItem(yw))||1}function Iw(e){document.documentElement.style.setProperty("--ui-zoom",String(e)),document.documentElement.classList.toggle("zoomed",e!==1)}function vw(e,t=performance.now()){if(t-bw<XZ)return;bw=t;let o=1;if(e!==0){let a=sg.findIndex((r)=>Math.abs(r-ww())<0.01),n=a<0?YZ:a;o=sg[Math.max(0,Math.min(sg.length-1,n+e))]??1}localStorage.setItem(yw,String(o)),Iw(o)}function xw(){Sw.useEffect(()=>{let e=ww();if(e!==1)Iw(e);if(window.swarmZoom=(o)=>vw(o),!ng())return;let t=(o)=>{if(!(o.metaKey||o.ctrlKey)||o.altKey)return;let a=QZ(o.key);if(a===null)return;o.preventDefault(),vw(a)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[])}var Ud=x(R(),1),JZ=30000,zd=new Set,Sc;function eY(){if(Sc!==void 0)return;Sc=setInterval(()=>{if(document.hidden)return;for(let e of zd)e()},JZ)}function Cw(){let[e,t]=Ud.useState(0);return Ud.useEffect(()=>{let o=()=>t((a)=>a+1);return zd.add(o),eY(),()=>{if(zd.delete(o),zd.size===0&&Sc!==void 0)clearInterval(Sc),Sc=void 0}},[]),e}var Mw=["session.started","session.ended","prompt.submitted","tool.requested","tool.allowed","tool.denied","tool.completed","agent.text","agent.delta","subagent.started","subagent.stopped","claim.acquired","claim.renewed","claim.released","claim.expired","claim.orphaned","claim.denied","rules.changed","worktree.reclaimed","worktree.bootstrapped","worktree.created","worktree.removed","pr.opened","question.asked","question.answered","dispatch.queued","dispatch.started","dispatch.finished","resource.acquired","resource.released","resource.reaped","process.started","process.exited","gate.recorded","handoff.recorded","permission.requested","permission.resolved","session.notification","session.stuck","workflow.started","workflow.step","workflow.finished","message.sent","incident.opened","incident.acked","run.result"];var kw=(e)=>{let t,o=new Set,a=(u,d)=>{let m=typeof u==="function"?u(t):u;if(!Object.is(m,t)){let f=t;t=(d!=null?d:typeof m!=="object"||m===null)?m:Object.assign({},t,m),o.forEach((p)=>p(t,f))}},n=()=>t,l={setState:a,getState:n,getInitialState:()=>c,subscribe:(u)=>(o.add(u),()=>o.delete(u))},c=t=e(a,n,l);return l},Dw=(e)=>e?kw(e):kw;var yc=x(R(),1);var tY=(e)=>e;function oY(e,t=tY){let o=yc.default.useSyncExternalStore(e.subscribe,yc.default.useCallback(()=>t(e.getState()),[e,t]),yc.default.useCallback(()=>t(e.getInitialState()),[e,t]));return yc.default.useDebugValue(o),o}var Tw=(e)=>{let t=Dw(e),o=(a)=>oY(t,a);return Object.assign(o,t),o},Ui=(e)=>e?Tw(e):Tw;var va=x(R(),1);var ig=5000;function aY(e){return e instanceof DOMException&&e.name==="AbortError"}async function nY(e,t){try{let o=await qt(e,t);return t.aborted?{kind:"dropped"}:{kind:"value",value:o}}catch(o){if(t.aborted||aY(o))return{kind:"dropped"};return{kind:"error",error:o instanceof Error?o:Error(String(o))}}}function ie(e,t=ig){let[o,a]=va.useState(null),[n,r]=va.useState(null),[s,l]=va.useState(e!==null),c=va.useRef(null),u=va.useCallback(async(f)=>{if(e===null)return;let p=await nY(e,f);if(p.kind==="dropped")return;if(p.kind==="value")c.current=e,a(p.value),r(null);else r(p.error);l(!1)},[e]),d=va.useRef(()=>{}),m=va.useCallback(()=>d.current(),[]);return va.useEffect(()=>{if(e===null){a(null),l(!1);return}if(c.current!==e)l(!0);let f=new AbortController,p,b=async()=>{if(await u(f.signal),!f.signal.aborted&&t>0)p=setTimeout(()=>void b(),t)};return d.current=()=>void u(f.signal),b(),()=>{if(f.abort(),p!==void 0)clearTimeout(p)}},[e,t,u]),{data:o,loading:s,error:n,reload:m}}var Aw=null,Hn=Ui((e)=>({data:null,offline:!1,refresh:async()=>{try{let t=await sw("/v1/state",Aw);e((o)=>{if(!t.changed)return o.offline?{offline:!1}:o;return Aw=t.etag,{data:t.data,offline:!1}})}catch{e({offline:!0})}}}));function q(e){return Hn((t)=>e(t.data))}function ct(){return Hn.getState().refresh()}function Ew(){let{refresh:e}=Hn.getState(),t=setInterval(()=>{if(!document.hidden)e()},ig);e();let o=null,a,n,r=1500,s=!1,l=()=>{if(n!==void 0)return;n=setTimeout(()=>{n=void 0,e()},400)},c=()=>{if(s)return;let m=iw(Hn.getState().data?.seq??0);o=m,m.addEventListener("ping",()=>u());for(let f of Mw)m.addEventListener(f,()=>{u(),l()});m.onerror=()=>{m.close(),o=null,Hn.setState({offline:!0}),a=setTimeout(c,r),r=Math.min(30000,r*2)}},u=()=>{if(r=1500,Hn.getState().offline)Hn.setState({offline:!1})};c();let d=()=>{if(!document.hidden)e()};return document.addEventListener("visibilitychange",d),()=>{if(s=!0,clearInterval(t),a!==void 0)clearTimeout(a);if(n!==void 0)clearTimeout(n);o?.close(),document.removeEventListener("visibilitychange",d)}}function rY(e,t){let o;try{o=e()}catch(n){return}return{getItem:(n)=>{var r;let s=(c)=>{if(c===null)return null;return JSON.parse(c,t==null?void 0:t.reviver)},l=(r=o.getItem(n))!=null?r:null;if(l instanceof Promise)return l.then(s);return s(l)},setItem:(n,r)=>o.setItem(n,JSON.stringify(r,t==null?void 0:t.replacer)),removeItem:(n)=>o.removeItem(n)}}var lg=(e)=>(t)=>{try{let o=e(t);if(o instanceof Promise)return o;return{then(a){return lg(a)(o)},catch(a){return this}}}catch(o){return{then(a){return this},catch(a){return lg(a)(o)}}}},sY=(e,t)=>(o,a,n)=>{let r={storage:rY(()=>window.localStorage),partialize:(S)=>S,version:0,merge:(S,h)=>({...h,...S}),...t},s=!1,l=0,c=new Set,u=new Set,d=r.storage;if(!d)return e((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),o(...S)},a,n);let m=()=>{let S=r.partialize({...a()});return d.setItem(r.name,{state:S,version:r.version})},f=n.setState;n.setState=(S,h)=>(f(S,h),m());let p=e((...S)=>(o(...S),m()),a,n);n.getInitialState=()=>p;let b,v=()=>{var S,h;if(!d)return;let g=++l;s=!1,c.forEach((I)=>{var k;return I((k=a())!=null?k:p)});let y=((h=r.onRehydrateStorage)==null?void 0:h.call(r,(S=a())!=null?S:p))||void 0;return lg(d.getItem.bind(d))(r.name).then((I)=>{if(I)if(typeof I.version==="number"&&I.version!==r.version){if(r.migrate){let k=r.migrate(I.state,I.version);if(k instanceof Promise)return k.then((C)=>[!0,C]);return[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,I.state];return[!1,void 0]}).then((I)=>{var k;if(g!==l)return;let[C,D]=I;if(b=r.merge(D,(k=a())!=null?k:p),o(b,!0),C)return m()}).then(()=>{if(g!==l)return;y==null||y(a(),void 0),b=a(),s=!0,u.forEach((I)=>I(b))}).catch((I)=>{if(g!==l)return;y==null||y(void 0,I)})};if(n.persist={setOptions:(S)=>{if(r={...r,...S},S.storage)d=S.storage},clearStorage:()=>{++l,d==null||d.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:(S)=>(c.add(S),()=>{c.delete(S)}),onFinishHydration:(S)=>(u.add(S),()=>{u.delete(S)})},!r.skipHydration)v();return b||p},Fd=sY;var Ow=["Observe","Work","Insight","Guard"],wc=[{id:"fleet",label:"Fleet",icon:"squares-four",group:"Observe"},{id:"timeline",label:"Timeline",icon:"clock-counter-clockwise",group:"Observe"},{id:"graphs",label:"Graphs",icon:"tree-structure",group:"Observe"},{id:"board",label:"Board",icon:"stack",group:"Work"},{id:"prs",label:"PRs",icon:"git-pull-request",group:"Work"},{id:"trials",label:"Trials",icon:"robot",group:"Work"},{id:"hygiene",label:"Hygiene",icon:"trash",group:"Work"},{id:"outcomes",label:"Outcomes",icon:"git-branch",group:"Insight"},{id:"gates",label:"Gates",icon:"shield",group:"Insight"},{id:"mcp",label:"MCP",icon:"plugs-connected",group:"Insight"},{id:"context",label:"Context",icon:"brain",group:"Insight"},{id:"heat",label:"Files",icon:"file-text",group:"Insight"},{id:"spend",label:"Spend",icon:"coins",group:"Insight"},{id:"stats",label:"Stats",icon:"chart-bar",group:"Insight"},{id:"search",label:"Search",icon:"magnifying-glass",group:"Insight"},{id:"security",label:"Security",icon:"shield",group:"Guard"},{id:"provenance",label:"Provenance",icon:"git-commit",group:"Guard"},{id:"incidents",label:"Incidents",icon:"warning",group:"Guard"},{id:"rules",label:"Rules",icon:"shield",group:"Guard"}],Nw="fleet",iY=new Set(wc.map((e)=>e.id));function Lw(e){return iY.has(e)}function Rw(e){let t=wc.find((o)=>o.id===e);if(!t)throw Error(`unknown view: ${e}`);return t}function Bw(e){return wc.filter((t)=>t.group===e)}var Fi={min:180,default:240,max:520},cg=(e)=>Number.isFinite(e)?Math.round(Math.min(Fi.max,Math.max(Fi.min,e))):Fi.default,B=Ui()(Fd((e)=>({view:Nw,project:null,session:null,sidebarCollapsed:!1,sidebarWidth:Fi.default,graphTab:"collisions",search:"",boardWorktrees:"map",boardTasks:"table",openView:(t)=>e({view:t,session:null}),selectProject:(t)=>e({project:t,session:null}),openSession:(t)=>e({session:t}),toggleSidebar:()=>e((t)=>({sidebarCollapsed:!t.sidebarCollapsed})),setSidebarWidth:(t)=>e({sidebarWidth:cg(t)}),setGraphTab:(t)=>e({graphTab:t}),setSearch:(t)=>e({search:t,view:"search",session:null}),setBoardWorktrees:(t)=>e({boardWorktrees:t}),setBoardTasks:(t)=>e({boardTasks:t})}),{name:"swarm.ui",partialize:(e)=>({view:e.view,project:e.project,sidebarCollapsed:e.sidebarCollapsed,sidebarWidth:e.sidebarWidth,graphTab:e.graphTab,boardWorktrees:e.boardWorktrees,boardTasks:e.boardTasks})}));function Hw(){let e=new URLSearchParams(location.search),t=e.get("view"),o={};if(t!==null&&Lw(t))o.view=t;if(e.has("project"))o.project=e.get("project")||null;let a=e.get("session");if(a)o.session=a;if(Object.keys(o).length>0)B.setState(o)}var ms=x(R(),1);var Pw=x(R(),1);function Ir(e,t,o){let a=B((s)=>s.openSession),n=B((s)=>s.selectProject),r=B((s)=>s.openView);return Pw.useMemo(()=>({openSession:a,selectProject:n,openView:r,...e?{reload:e}:{},...t?{showDiff:t}:{},...o?{editProject:o}:{}}),[a,n,r,e,t,o])}var ug=[" MM MM "," LL LL "," LL LL "," LM MM "," MD MS "," LE LE "," ME ME "," MS MS "," KK KK "," SSDDDSDDDDDDDDDDDDDDDDDDDDDDDDDDDDS "," SSDSDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS "," SSDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOKSS "," SSOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOSS "," DDKMMLLLMLLMMMMMMMMMMMMMMMMMMMMMODD "," DDOMMLMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," SSSSODDOMMLMMMMMMMMMMMMMMMMMMMMMMMMMMODDOSSSS "," SSSSODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOSSSS "," SMMMMODDOMMLMMMMMMMMMMMMMMMMMMMMMMMMMMODDOSMMMS "," DMSSSODDOMMMMOOOOOOMMMMMMMMMOOOOOOMMMMODDOSSSED "," DSSSSODDOMMMMODDDDDMMMMMMMMMODDDDDMMMMODDOSSSSK "," DSMMSODDOMMMMDDDDDDMMMMMMMMMKDDDDDMMMMODDOSMMSK "," DSSSSODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDOSSSSK "," DSSSSODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDODSSSK "," DSSSSODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDODSSSK "," DSSSKODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDODSSSD "," OKKKKODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOKKKKO "," KKKKODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOOKKK "," KKKOODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOOKKK "," DDOMMMMDDDDDDDDDDDDDDDDDDDDDMMMMODD "," DDOMMMMDDDDDDDDDDDDDDDDDDDDDMMMMODD "," DDOMMMMDDDDDDDDDDDDDDDDDDDDDMMMMODD "," DDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," DDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," DDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," DDDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOKDD "," DDDDDDDDDDDDDDDDDDDDDDDDDDDDDKDDDDD "," DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD "," OOOOOOOOOOO "," OODDDDDKKOO "," DSMMMMMMSDD "," OOOOOOOOOOO "," KDSMMMMMESSKK "," MMMMMMSSKOOKDSMMMMMSSSDKOODSEMMMMMM "," SSSSDO MMMMMMSSKKOOOOOOOOOOOOOOOOOKSSSMMMMMM ODSSSS "," EEESSSSOOLLLLMMMMMESSSSSSSSSSSSSSSSSSSSMMMMMLLLLOOSSSSMME "," SMMSSSSKOEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEEOOSSSSEMS "," DSSSSSSSOOSEEKSMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSOEEDOOSSSSSSSK "," DSSSSSSDOOSEOSKEMMMMMMMMMMMMMMMMMMMMMMMMMMMMMEOSDEDOODSSSSSSK "," KSSSSSSKOODSSOSEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESOEEDOOKSSSSSSK "," DKSSSSKKOODSMEEMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMSEMSDOOKKSSSSDK "," OKDDKDKKOOKSMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSKOOKKKKKKKO "," OOOOOKKKOOKSMMMMESSSSSSSSSSSSSMMMMEEEEEESSSSEMMMMSKOOKKKOOOOO "," OOOOOOKKOOKSMMMSSKKKKKKKKKKKKKKMMMDKOOOOOOOODDMMMSKOOKKOOOOOO "," OKSSKOOOOOKSMMMKKMLLLLLLLLLLLMKMMMDDSSSSSSSSDDMMMSKOOOOODSSKO "," SDOKKK KSMMMKDLLLLLLLLLLLLLKMMMKDKKKDDKKKDKMMMSK KKKKDS "," DMLLMKO KSMMMKDLLLLLLLLLLLLLKMMMDDDDDDDDDSKDMMMSK ODMLLMD "," DELLMSD KSMMMKKMLLLLLLLLLLLLKMMMDKKKKKKKKKDDMMMSK DSMLLEO "," KSKKKKDO KSMMMEDDDDKKDDDKKKDKSMMMDDDDDDDDDSDDMMMSK ODDKKKSK "," EMLLMDO KSMMMMLLLLLLLLLLLLLLLMMMDOOOOOOOOODDMMMSK ODMLLME "," KMLLMSD KSMMMMMMMMMMMMMMMMMMMMMMDDSSDDSSSSDDMMMSK SSMLLEK "," KSKKKKSO KSMMMMMOOMMOOMKOEMOOMMMMDOOOOOOOOODDMMMSK OSKKKKSO "," SMLLMDO KSMMMMMKKMMKKMDKEMKKMMMMKDDDDSSSSDDDMMMSK ODMLLMS "," SMMMMSD KSMMMMMEEMMEEMEEMMEEMMMMDSOOOOOOOODDMMSSK DSMMMMD "," OOOOOOO KSSMMMMMMMMMMMMMMMMMMMMMDDDDDDDDDDDDMSSSK OOOOOOO "," KSMLLLMMSKO KSSSSMMMMMMMMMMMMMMMMMMMSOOOOOOOOOOSSSSSK OKSMLLLLMSO "," DSMMMEEESKK KSSKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSOSSK KDSMMMMMESD "," DSMMMMMESKK KSOOKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSOOKSK KKSMMMMMMSD "," DSMMMMMESKK OKSKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSDSKO KDSMMMMMMSD "," KDDDDDDDDKK KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKDDDDDDDDO "," OOOOOOOOOOO OOOOOOOOO OOOOOOOOO OOOOOOOOOOO ","DSDO OSSO ODKKKKKKK OKKKKKKKO KEDO ODEK","SMDO OSMD KDSSSSSSK KDSSSSSKO SMDO ODMS","DEKO OOED OOKKKOOO OOOKKOOO SSOO OKMS","DEKO OOED SEMMMMSK OSMMMMED SSKO OKES","DSSO OESK SEMMMMSK OSMMMMED KSSO OSSK","KSMS EEDO OOKKKKKO OOKKKKKO OSEE EMSO"," DSS SSK OSEEESDO ODSEEESO KSS SSD "," OOO OO SEMMMMSK OSMMMMED OO OOO "," KSSSSSDO OKSSESSK "," DKKDDDDDDKKDK KDKDDDDDDDKDK "," SSMLLMMMMMMLMSK DSSMMMMMMMLLMSS "," SMLMMMMMMMMLLED SEMMMMMMMMMMLMS "," DMMMMMMMMMMMMMMD SMMMMMMMMMMMMMSK "," ODSSSSSSSSSSSSSSDO ODSSSSSSSSSSSSSSKO "," OOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOO "," OKSSSSSSSSSSSSSSK KSSSSSSSSSSSSSSKO "," OKDDDDDDDDDDDDDDK KDDDDDDDDDDDDDDOO "],iae=ug.slice(0,37),zw=[" L L "," M M "," OOOOOOOOOO "," OMMMMMMMMO "," OELLLLLLEO "," OEMMMMMMEO ","DOESSMMSSEOD","DOESSMMSSEOD","DOEMMMMMMEOD"," OEMSSSSMEO "," ODDDDDDDDO "," OOOOOOOOOO "],Uw={O:"color-mix(in srgb, var(--acc) 40%, black)",K:"color-mix(in srgb, var(--acc) 51%, black)",D:"color-mix(in srgb, var(--acc) 58%, black)",S:"color-mix(in srgb, var(--acc) 71%, black)",E:"color-mix(in srgb, var(--acc) 84%, black)",M:"var(--acc)",L:"color-mix(in srgb, var(--acc) 52%, white)"};function Fw(e){let t=Math.max(...e.map((c)=>c.length)),o=e.map((c)=>c.padEnd(t," ")),a=(c)=>o.some((u)=>u[c]!==" "),n=0,r=t-1;while(n<t&&!a(n))n++;while(r>n&&!a(r))r--;let s=0,l=o.length-1;while(s<o.length&&o[s].trim().length===0)s++;while(l>s&&o[l].trim().length===0)l--;return o.slice(s,l+1).map((c)=>c.slice(n,r+1))}function _w(e,t,o={}){let a=o.cell??6,n=Math.max(...e.map((b)=>b.length)),r=o.tile?o.tile.pad??2:0,s=Math.max(n,e.length)+r*2,l=(o.tile?s:n)*a,c=(o.tile?s:e.length)*a,u=o.tile?Math.round((s-n)/2)*a:0,d=o.tile?Math.round((s-e.length)/2)*a:0,m=o.tile?`<rect width="${l}" height="${c}" rx="${o.tile.radius??Math.round(l*0.2)}" fill="${o.tile.fill}"/>`:"";e.forEach((b,v)=>{let S=0;while(S<b.length){let h=b[S],g=t[h];if(!g){S++;continue}let y=o.classOf?.(h,S,v),I=o.styleOf?.(h,S,v),k=1;while(S+k<b.length&&b[S+k]===h&&o.classOf?.(h,S+k,v)===y&&o.styleOf?.(h,S+k,v)===I)k++;m+=`<rect${y?` class="${y}"`:""}${I?` style="${I}"`:""} x="${u+S*a}" y="${d+v*a}" width="${k*a}" height="${a}" fill="${g}"/>`,S+=k}});let f=o.className?` class="${o.className}"`:"",p=o.title?`<title>${o.title}</title>`:"";return`<svg${f} viewBox="0 0 ${l} ${c}" shape-rendering="crispEdges" xmlns="http://www.w3.org/2000/svg"${o.title?"":' aria-hidden="true"'}>${p}${m}</svg>`}var Kw=x(T(),1);function z(e,t=16,o){let a=window.ICON_PATHS?.[e];if(!a)return null;return Kw.jsx("svg",{className:o?`ph ${o}`:"ph",width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",dangerouslySetInnerHTML:{__html:a}})}var qw=x(R(),1),$w=x(T(),1);function dY(e){let t=/viewBox="([^"]+)"/.exec(e)?.[1]??"0 0 12 12",o=e.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"");return{viewBox:t,body:o}}function jd({art:e=zw,cell:t=2,className:o,title:a}){let{viewBox:n,body:r}=qw.useMemo(()=>dY(_w(Fw(e),Uw,{cell:t})),[e,t]),s=a?`<title>${a}</title>${r}`:r,[,,l,c]=n.split(" ");return $w.jsx("svg",{className:o||void 0,viewBox:n,width:l,height:c,shapeRendering:"crispEdges",xmlns:"http://www.w3.org/2000/svg",...a?{role:"img"}:{"aria-hidden":!0},dangerouslySetInnerHTML:{__html:s}})}var Ue=x(T(),1);function F({title:e,hint:t,actions:o,children:a,spaced:n}){return Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("h2",{className:n?"mt-sec":void 0,children:[e,t!==void 0&&Ue.jsx("span",{children:t}),o!==void 0&&Ue.jsx("span",{className:"h2-actions",children:o})]}),a]})}function H({tone:e="plain",children:t}){return Ue.jsx("span",{className:e==="plain"?"badge":`badge ${e}`,children:t})}function Z(){return Ue.jsx("span",{className:"dim",children:"—"})}function ee({art:e=Ue.jsx(jd,{art:ug,cell:1,className:"px"}),children:t}){return Ue.jsxs("div",{className:"empty",children:[e,t]})}function K({label:e,value:t,detail:o,tone:a}){return Ue.jsxs("div",{className:a?`kpi ${a}`:"kpi",children:[Ue.jsx("div",{className:"l",children:e}),Ue.jsx("div",{className:"v",children:t}),o!==void 0&&Ue.jsx("div",{className:"d",children:o})]})}function $t({children:e,wide:t}){return Ue.jsx("div",{className:t?"kpis kpis-5":"kpis",children:e})}function Me({art:e}){return Ue.jsxs("div",{className:"empty",children:[e,"Loading…"]})}function Ke({error:e,onRetry:t}){let o=e.name==="OfflineError";return Ue.jsxs("div",{className:"empty",children:[o?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("b",{children:"swarmd is not responding."}),Ue.jsx("br",{}),"It may be restarting — this clears itself once it answers again."]}):Ue.jsxs(Ue.Fragment,{children:["Could not load this view — ",e.message,"."]}),t&&Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("br",{}),Ue.jsx("button",{type:"button",className:"link",onClick:t,children:"Try again"})]})]})}var xr=x(R(),1);var Ic=x(R(),1),Ww=x(gn(),1);var Aa=x(T(),1);function dg(e,t,o){let a=Ic.useRef(t);a.current=t,Ic.useEffect(()=>{let n=document.activeElement;e.current?.querySelector("textarea, input, button")?.focus();let r=(l)=>{if(l.key==="Escape")a.current()},s=(l)=>{if(l.target===o)a.current()};return document.addEventListener("keydown",r),o?.addEventListener("click",s),()=>{document.removeEventListener("keydown",r),o?.removeEventListener("click",s),n?.focus?.()}},[e,o])}function Ea({title:e,glyph:t="squares-four",subtitle:o,size:a,children:n,footer:r,onClose:s}){let l=document.getElementById("picker"),c=Ic.useRef(null);if(dg(c,s,l),!l)return null;return Ww.createPortal(Aa.jsxs("div",{className:a?`pk ${a}`:"pk",role:"dialog","aria-modal":"true","aria-label":e,ref:c,children:[Aa.jsxs("div",{className:"pk-h",children:[z(t,15),Aa.jsx("b",{children:e}),o!==void 0&&Aa.jsx("span",{className:"dim now pk-sub",children:o}),Aa.jsx("span",{className:"grow"}),Aa.jsx("button",{type:"button",title:"Close","aria-label":"Close",onClick:s,children:z("x",14)})]}),Aa.jsx("div",{className:"pk-b",children:n}),r!==void 0&&Aa.jsxs("div",{className:"pk-f",children:[Aa.jsx("span",{className:"grow"}),r]})]}),l)}function vt(e){let t=(Date.now()-new Date(e).getTime())/1000;if(t<60)return`${Math.floor(t)}s`;if(t<3600)return`${Math.floor(t/60)}m`;if(t<86400)return`${Math.floor(t/3600)}h`;return`${Math.floor(t/86400)}d`}var mg=(e)=>String(e).padStart(2,"0");function Oa(e){let t=new Date(e);return`${mg(t.getHours())}:${mg(t.getMinutes())}:${mg(t.getSeconds())}`}function Zw(e,t,o){let a=e/t,n=a>=100?0:a>=10?1:2;return`${a.toFixed(n)}${o}`}function Wt(e){if(e>=1e9)return Zw(e,1e9,"B");if(e>=1e6)return Zw(e,1e6,"M");if(e>=1000)return`${(e/1000).toFixed(0)}k`;return String(Math.floor(e))}function se(e){if(e===null||e===void 0)return null;return`$${e<10?e.toFixed(2):e.toFixed(0)}`}function wo(e){if(!e)return"";return e.replace(/^claude-/,"").replace(/-\d{8}$/,"")}function Qe(e){return String(e??"").replace(/^\/Users\/[^/]+/,"~")}function Gd(e){let t=(new Date(e).getTime()-Date.now())/1000;if(t<=0)return"expired";if(t<3600)return`${Math.floor(t/60)}m left`;return`${(t/3600).toFixed(1)}h left`}function fg(e){if(e===null||e===void 0||e<0)return"—";if(e<1)return`${Math.round(e*60)}m`;if(e<48)return`${e.toFixed(1)}h`;return`${(e/24).toFixed(1)}d`}function Yw(e){if(e===null||e===void 0)return"—";return`${Math.round(e*100)}%`}function Na(e,t){return e.reduce((o,a)=>o+(t(a)??0),0)}function oa(e){if(e<3600000)return`${Math.round(e/60000)}m`;if(e<86400000)return`${(e/3600000).toFixed(1)}h`;return`${(e/86400000).toFixed(1)}d`}function Vd(e){if(e===null)return null;if(e<1000)return`${e}ms`;if(e<60000)return`${(e/1000).toFixed(1)}s`;return oa(e)}function La(e){if(e===null||e===void 0)return null;if(e>=1048576)return`${(e/1024/1024).toFixed(1)} GB`;return`${Math.round(e/1024)} MB`}function Xw(e){if(e<1)return`${Math.round(e*60)}m`;if(e<48)return`${e.toFixed(e<10?1:0)}h`;let t=e/24;return t<100?`${t.toFixed(t<10?1:0)}d`:`${Math.round(t/7)}w`}function To(e){if(e>=1e9)return`${(e/1e9).toFixed(2)}B`;if(e>=1e6)return`${(e/1e6).toFixed(1)}M`;if(e>=1000)return`${(e/1000).toFixed(1)}k`;return String(Math.round(e))}function xc(e,t){return t?`${(100*e/t).toFixed(0)}%`:"—"}function Qw(e){return String(e).replace(/^mcp__([^_]+(?:_[^_]+)*)__/,"$1 · ").replace(/^plugin_/,"")}var le=x(T(),1);function mY(e){if(e.startsWith("+++")||e.startsWith("---")||e.startsWith("diff "))return"m";if(e.startsWith("@@"))return"h";if(e.startsWith("+"))return"a";if(e.startsWith("-"))return"d";return""}function fY({text:e}){return le.jsx(le.Fragment,{children:e.split(`
10
+ `).map((t,o)=>{let a=mY(t);return le.jsxs("span",{className:a||void 0,children:[t,`
11
+ `]},o)})})}function pY({commits:e}){if(e.length===0)return null;return le.jsxs("div",{className:"dim df-commits",children:[e.slice(0,8).map((t)=>le.jsx("div",{children:t},t)),e.length>8&&le.jsxs("div",{children:["… ",e.length-8," more"]})]})}function hY({files:e,selected:t,onSelect:o}){return le.jsx("div",{className:"df-files",children:e.map((a)=>le.jsxs("button",{type:"button",className:t===a.path?"on":void 0,onClick:()=>o(a.path),children:[le.jsx("span",{className:"st",children:a.status}),le.jsx("span",{className:"pa",title:a.path,children:a.path}),a.added>=0?le.jsxs(le.Fragment,{children:[le.jsxs("span",{className:"pl",children:["+",a.added]}),le.jsxs("span",{className:"mi",children:["−",a.deleted]})]}):le.jsx("span",{className:"dim",children:"bin"})]},a.path))})}function gY({file:e,patch:t}){if(e===null)return le.jsx("span",{className:"m",children:"select a file — or view everything below"});if(t===null)return le.jsx("span",{className:"m",children:"loading…"});return t?le.jsx(fY,{text:t}):le.jsx("span",{className:"m",children:"(empty)"})}function Kd({projectId:e,worktree:t,onClose:o}){let[a,n]=xr.useState(null),[r,s]=xr.useState(null),[l,c]=xr.useState(null),[u,d]=xr.useState(null);xr.useEffect(()=>{let f=new AbortController;return qt(`/v1/worktrees/diff${ze({project:e,worktree:t})}`,f.signal).then((p)=>p.error?s(p.error):n(p)).catch((p)=>s(p.message)),()=>f.abort()},[e,t]),xr.useEffect(()=>{if(l===null)return;let f=new AbortController;return d(null),qt(`/v1/worktrees/diff${ze({project:e,worktree:t,file:l||null,patch:l?null:1})}`,f.signal).then((p)=>d(p.patch??"")).catch(()=>d("")),()=>f.abort()},[l,e,t]);let m=a?le.jsxs(le.Fragment,{children:[Qe(a.worktree)," · vs ",a.baseRef??"HEAD"," · ",a.commits.length," commit",a.commits.length===1?"":"s"," · ",a.files.length," file",a.files.length===1?"":"s",a.dirty&&le.jsxs(le.Fragment,{children:[" · ",le.jsx(H,{tone:"warn",children:"dirty"})]})]}):Qe(t);return le.jsx(Ea,{title:"Diff",glyph:"folders",size:"wide",subtitle:m,onClose:o,footer:a&&a.files.length>0?le.jsxs("button",{type:"button",className:"nav",onClick:()=>c(""),children:[z("folders",12)," Whole diff"]}):void 0,children:r?le.jsx("div",{className:"empty",children:r}):a?le.jsxs(le.Fragment,{children:[le.jsx(pY,{commits:a.commits}),a.files.length===0?le.jsx("div",{className:"empty",children:"Nothing changed."}):le.jsxs(le.Fragment,{children:[le.jsx(hY,{files:a.files,selected:l,onSelect:c}),le.jsx("pre",{className:"df-patch",children:le.jsx(gY,{file:l,patch:u})})]})]}):le.jsx("div",{className:"empty",children:"Loading…"})})}var Pn=x(T(),1);function bY(e,t){if(t)return`${t} waiting on you`;return e?"sessions working":"no sessions"}function vY(e,t){if(t)return`${t} orphaned`;return e?"claims with a lease":"nothing claimed"}function SY(e,t){let o=[e?`${e} dirty`:"",t?`${t} merged`:""].filter(Boolean);return o.length?o.join(" · "):"all clean"}function Jw({data:e,tasks:t}){return Pn.jsxs($t,{wide:!0,children:[Pn.jsx(K,{label:"Live",value:e.live.length,detail:bY(e.live.length,e.waiting),tone:e.waiting?"hot":void 0}),Pn.jsx(K,{label:"Held",value:e.heldClaims.length,detail:vY(e.heldClaims.length,e.orphaned),tone:e.orphaned?"hot":void 0}),Pn.jsx(K,{label:"Worktrees",value:e.worktrees.length,detail:SY(e.dirty,e.merged),tone:e.dirty?"warm":void 0}),t?Pn.jsx(K,{label:"Ready",value:t.ready,detail:`${t.open} open`}):Pn.jsx(K,{label:"Projects",value:e.projectCount,detail:"on the board"}),Pn.jsx(K,{label:"Incidents",value:e.openIncidents,detail:e.openIncidents?"need a look":"all acknowledged",tone:e.openIncidents?"hot":void 0})]})}function Cr(e){if(typeof e!=="object"||e===null)return{ok:!0};let t=e,o=typeof t.error==="string"?t.error:void 0;return{ok:t.ok===void 0?o===void 0:t.ok===!0,...o===void 0?{}:{error:o},...typeof t.refused==="string"?{refused:t.refused}:{}}}async function qd(e,t){let o=Cr(await De(`/v1/processes/${e}${ze({project:t})}`,"DELETE"));return await ct(),o}async function _i(e,t,o=!1){let a=Cr(await De("/v1/worktrees/remove","POST",{projectId:e,worktree:t,force:o}));return await ct(),a}async function eI(e){let t=await De("/v1/hygiene/reclaim","POST",{path:e});return await ct(),t}async function tI(e){await De(`/v1/incidents/${e}/ack`,"POST"),await ct()}async function oI(e){await De(`/v1/incidents/ack${ze({project:e})}`,"POST"),await ct()}async function pg(e,t,o=!1){let a=Cr(await De("/v1/claims/release","POST",{projectId:e,task:t,force:o}));return await ct(),a}async function aI(e,t){await De(`/v1/resources/${encodeURIComponent(e)}${ze({force:1,project:t})}`,"DELETE"),await ct()}async function nI(e){try{let t=Cr(await De("/v1/projects","POST",{path:e}));if(t.ok)await ct();return t}catch(t){if(t instanceof tn||t instanceof Bd)return{ok:!1,error:t.message};throw t}}async function rI(e){await De("/v1/projects/order","PUT",{ids:e}),await ct()}async function hg(e,t){await De(`/v1/projects/${e}`,"PATCH",{pinned:t}),await ct()}async function sI(e,t){let o=await De(`/v1/projects/${e}`,"PATCH",t),a=Cr(o);if(a.ok)await ct();return a}async function iI(e){await De(`/v1/projects/${e}`,"DELETE"),await ct()}async function gg(e,t){return Cr(await De("/v1/worktrees/open","POST",{projectId:e,worktree:t}))}async function lI(e,t){let o=Cr(await De("/v1/prs/merge","POST",{projectId:e,number:t}));return await ct(),o}async function cI(e,t){let o=Cr(await De("/v1/claims","POST",{projectId:e,task:t,owner:"dashboard"}));return await ct(),o}async function uI(e,t){let o=await De("/v1/gates/run","POST",{projectId:e,task:t});return await ct(),o}async function Zt(e){let t=String(e??"");try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}try{let o=document.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.cssText="position:fixed;top:-1000px;left:0;opacity:0",document.body.appendChild(o),o.select(),o.setSelectionRange(0,t.length);let a=document.execCommand("copy");return o.remove(),a}catch{return!1}}function bo(e,t,o){window.menus?.open(e,{...o,items:t})}function us(e){return{label:e,section:e}}var ds=(e,t)=>e.length<=t?e:`…${e.slice(-t)}`,an={label:"",divider:!0};function dI(e,t,o,a){let n=(r)=>()=>{a.selectProject(t.id),a.openView(r)};bo(e,[{label:"Show sessions",icon:"squares-four",...o?{caption:`${o} live`}:{},run:n("fleet")},{label:"Show in Timeline",icon:"clock-counter-clockwise",run:n("timeline")},{label:"Spend",icon:"coins",run:n("spend")},{label:"Stats",icon:"chart-bar",run:n("stats")},an,t.discovered?{label:"Pin project",icon:"push-pin",run:()=>void hg(t.id,!0)}:{label:"Unpin project",icon:"push-pin-slash",run:()=>void hg(t.id,!1)},{label:"Copy path",icon:"copy",caption:ds(t.root,16),run:()=>void Zt(t.root)},...a.editProject?[{label:"Settings…",icon:"sliders",caption:"name · icon · color",run:()=>a.editProject?.(t)}]:[],an,{label:"Remove from Swarm",icon:"trash",danger:!0,caption:"history is kept",run:()=>{if(confirm(`Stop tracking ${t.name}?`))iI(t.id)}}],{title:t.name})}function mI(e,t,o){bo(e,[{label:"Open session",icon:"terminal-window",run:()=>o.openSession(t.id)},{label:"Show in Timeline",icon:"clock-counter-clockwise",run:()=>{o.selectProject(t.projectId),o.openView("timeline")}},an,us("Copy"),{label:"Session id",icon:"copy",caption:t.id.slice(0,8),run:()=>void Zt(t.id)},{label:"Working directory",icon:"folder-simple",caption:ds(Qe(t.cwd),16),run:()=>void Zt(t.cwd)},...t.transcriptPath?[{label:"Transcript path",icon:"file-text",run:()=>void Zt(t.transcriptPath)}]:[],...t.branch?[{label:"Branch",icon:"git-branch",caption:ds(t.branch,16),run:()=>void Zt(t.branch)}]:[]],{title:t.title??t.id.slice(0,8)})}function bg(e,t,o,a){let{held:n,sessions:r}=o;bo(e,[{label:"Open",icon:"arrow-square-out",caption:"editor",run:async()=>{let s=await gg(t.projectId,t.path);if(!s.ok&&s.error)alert(s.error)}},...a.showDiff&&!t.main?[{label:"Diff",icon:"folders",caption:"vs main",run:()=>a.showDiff?.(t.projectId,t.path)}]:[],...r.length>0?[an,us("Sessions"),...r.map((s)=>({label:s.title??s.id.slice(0,8),icon:"terminal-window",run:()=>a.openSession(s.id)}))]:[],an,{label:"Copy path",icon:"copy",caption:ds(Qe(t.path),14),run:()=>void Zt(t.path)},...t.branch?[{label:"Copy branch",icon:"git-branch",caption:ds(t.branch,14),run:()=>void Zt(t.branch)}]:[],...t.main||n?[]:[an,{label:"Remove",icon:"trash",danger:!0,...t.dirty>0?{caption:"dirty"}:t.ahead>0?{caption:"unpushed"}:{},run:()=>void yY(t.projectId,t.path,a)}]],{title:t.branch??"(detached)"})}async function yY(e,t,o){if(!confirm(`Remove worktree ${Qe(t)}?`))return;let a=await _i(e,t);if(!a.ok&&(a.refused==="dirty"||a.refused==="unpushed")){if(confirm(`${a.error}
12
12
 
13
- Remove anyway (discards the work)?`))await Bo(e,t,!0)}else if(!a.ok&&a.error)alert(a.error);n.reload?.()}function Eb(e,t,n){zt(e,[{label:"Open worktree",icon:"arrow-square-out",run:async()=>{let a=await vf(t.projectId,t.worktree);if(!a.ok&&a.error)alert(a.error)}},{label:"Copy path",icon:"copy",caption:Ll($e(t.worktree),14),run:()=>void xt(t.worktree)},Yn,t.state==="orphaned"?{label:"Force release",icon:"trash",danger:!0,caption:"discards work",run:()=>{if(confirm(`Force-release ${t.task}? This permanently discards its worktree and any uncommitted work.`))hf(t.projectId,t.task,!0).then(()=>n.reload?.())}}:{label:"Release claim",icon:"x",run:()=>void hf(t.projectId,t.task).then(()=>n.reload?.())}],{title:t.task})}function Nb(e,t,n){zt(e,[{label:"Copy pid",icon:"copy",caption:String(t.pid),run:()=>void xt(String(t.pid))},...t.cwd?[{label:"Copy working directory",icon:"folder-simple",caption:Ll($e(t.cwd),16),run:()=>void xt(t.cwd)}]:[],Yn,{label:"Stop",icon:"stop",danger:!0,caption:"SIGTERM → SIGKILL",run:async()=>{if(!confirm(`Stop pid ${t.pid}?`))return;let a=await ec(t.pid,t.projectId);if(!a.ok&&a.error)alert(a.error);n.reload?.()}}])}function Tb(e,t,n){zt(e,[{label:"Copy name",icon:"copy",run:()=>void xt(t.name)},Yn,{label:"Release",icon:"x",danger:!0,caption:"force",run:()=>{if(confirm(`Force-release ${t.name}?`))bb(t.name,t.projectId??null).then(()=>n.reload?.())}}],{title:t.name})}function Rb(e,t,n){let a=t.forge==="gitlab"?"GitLab":"GitHub",l=t.checks!=="fail"&&t.mergeable&&!t.draft,o=t.draft?"draft":t.checks==="fail"?"checks failing":"not mergeable";zt(e,[{label:`Open on ${a}`,icon:"arrow-square-out",run:()=>{window.open(t.url,"_blank","noopener")}},{label:"Copy URL",icon:"copy",run:()=>void xt(t.url)},Yn,{label:"Squash-merge",icon:"git-pull-request",disabled:!l,caption:l?t.forge==="gitlab"?"glab":"gh":o,run:async()=>{if(!confirm(`Squash-merge #${t.number}?`))return;let i=await wb(t.projectId,t.number);if(!i.ok&&i.error)alert(i.error);n.reload?.()}}],{title:`#${t.number}`})}var Cn=S(B(),1);var Uo=jo()(Js((e)=>({tables:{},update:(t,n)=>e((a)=>({tables:{...a.tables,[t]:n(a.tables[t]??{})}})),reset:(t)=>e((n)=>{let{[t]:a,...l}=n.tables;return{tables:l}})}),{name:"swarm.grids"}));var Et=S(M(),1),Cb=[25,50,100,0];function Ab({total:e,page:t,pageSize:n,onPage:a,onPageSize:l}){let o=n>0?Math.ceil(e/n):1,i=Cb[0];if(e<=i&&o<=1)return null;let r=e===0?0:t*n+1,s=n>0?Math.min((t+1)*n,e):e;return Et.jsxs("div",{className:"gpager",children:[Et.jsx("span",{className:"dim",children:n>0?Et.jsxs(Et.Fragment,{children:[r,"–",s," of ",e]}):Et.jsxs(Et.Fragment,{children:[e," rows"]})}),o>1&&Et.jsxs(Et.Fragment,{children:[Et.jsx("button",{type:"button",className:"gp-btn",title:"Previous page","aria-label":"Previous page",disabled:t===0,onClick:()=>a(t-1),children:_("arrow-left",12)}),Et.jsxs("span",{className:"dim",children:[t+1," / ",o]}),Et.jsx("button",{type:"button",className:"gp-btn",title:"Next page","aria-label":"Next page",disabled:t+1>=o,onClick:()=>a(t+1),children:_("arrow-right",12)})]}),Et.jsx("span",{className:"seg gp-size",children:Cb.map((c)=>Et.jsx("button",{type:"button",className:n===c?"on":"",title:c===0?"Show every row":`${c} rows per page`,onClick:()=>l(c),children:c===0?"All":c},c))})]})}var ke=S(M(),1),dM=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function fM(e,t){let n=new Map(e.map((i)=>[i.key,i])),a=t.order?.filter((i)=>n.has(i))??[],l=e.filter((i)=>!a.includes(i.key)).map((i)=>i.key),o=new Set(t.hidden??[]);return[...a,...l].map((i)=>n.get(i)).filter((i)=>i!==void 0&&!o.has(i.key))}function pM(e,t){if(e==null&&t==null)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e==="number"&&typeof t==="number")return e-t;return dM.compare(String(e),String(t))}function de({id:e,columns:t,rows:n,leading:a,trailing:l,rowKey:o,onRowClick:i,empty:r,defaultPageSize:s=mM}){let c=Uo((O)=>O.tables[e])??{},d=Uo((O)=>O.update),h=Uo((O)=>O.reset),u=Cn.useMemo(()=>fM(t,c),[t,c]),p=Cn.useMemo(()=>{let O=Object.entries(c.filters??{}).map(([Xt,Ln])=>[t.find((on)=>on.key===Xt),Ln.trim().toLowerCase()]).filter(([Xt,Ln])=>Xt!==void 0&&Ln!==""),A=n;if(O.length>0)A=A.filter((Xt)=>O.every(([Ln,on])=>String(Ln?.get?.(Xt)??"").toLowerCase().includes(on)));let j=c.sort,pt=j?t.find((Xt)=>Xt.key===j.key):void 0;if(j&&pt?.get){let Xt=j.dir==="desc"?-1:1,Ln=A.map((on)=>({row:on,key:pt.get?.(on)}));Ln.sort((on,q0)=>pM(on.key,q0.key)*Xt),A=Ln.map((on)=>on.row)}return A},[n,t,c.filters,c.sort]),g=(O)=>d(e,(A)=>{let j=A.sort;if(!j||j.key!==O)return{...A,sort:{key:O,dir:"asc"}};if(j.dir==="asc")return{...A,sort:{key:O,dir:"desc"}};return{...A,sort:null}}),b=(O,A)=>d(e,(j)=>{let pt={...j.filters??{}};if(A)pt[O]=A;else delete pt[O];return{...j,filters:pt}}),y=c.pageSize??s,[m,f]=Cn.useState(0);Cn.useEffect(()=>f(0),[c.filters,c.sort,n.length]);let v=y>0?Math.max(1,Math.ceil(p.length/y)):1,w=Math.min(m,v-1),D=Cn.useMemo(()=>y>0?p.slice(w*y,(w+1)*y):p,[p,w,y]),z=u.length+(a?1:0)+(l?1:0),E=Object.values(c.filters??{}).some(Boolean);return ke.jsxs("div",{className:"card grid","data-tid":e,children:[ke.jsxs("table",{className:"dt",children:[ke.jsxs("thead",{children:[ke.jsxs("tr",{children:[a&&ke.jsx("th",{style:{width:a.width}}),u.map((O)=>ke.jsx(hM,{id:e,column:O,sort:c.sort??null,width:c.widths?.[O.key]??(O.flex?void 0:O.width??100),onSort:g},O.key)),l&&ke.jsx("th",{style:{width:l.width},className:"th-tools",children:ke.jsx(bM,{id:e,columns:t,layout:c,onReset:()=>h(e)})})]}),c.showFilters&&ke.jsxs("tr",{className:"filters",children:[a&&ke.jsx("th",{}),u.map((O)=>ke.jsx("th",{children:O.filterable!==!1&&ke.jsx("input",{value:c.filters?.[O.key]??"",placeholder:O.label,onChange:(A)=>b(O.key,A.target.value)})},O.key)),l&&ke.jsx("th",{})]})]}),ke.jsxs("tbody",{children:[D.map((O)=>ke.jsxs("tr",{onClick:i?()=>i(O):void 0,style:i?{cursor:"pointer"}:void 0,children:[a&&ke.jsx("td",{className:"td-lead",children:a.cell(O)}),u.map((A)=>ke.jsx("td",{className:[A.num?"num":"",A.cls??""].filter(Boolean).join(" "),children:A.cell(O)},A.key)),l&&ke.jsx("td",{className:"td-tools",children:l.cell(O)})]},o(O))),D.length===0&&ke.jsx("tr",{className:"tbl-empty",children:ke.jsx("td",{colSpan:z,children:r??`No rows${E?" match the filters":""}.`})})]})]}),ke.jsx(Ab,{total:p.length,page:w,pageSize:y,onPage:f,onPageSize:(O)=>{f(0),d(e,(A)=>({...A,pageSize:O}))}})]})}var mM=50;function hM({id:e,column:t,sort:n,width:a,onSort:l}){let o=Uo((u)=>u.update),i=Cn.useRef(null),[r,s]=Cn.useState(!1),c=t.sortable!==!1&&t.get!==void 0,d=(u)=>{u.preventDefault(),u.stopPropagation();let p=i.current;if(!p)return;let g=u.clientX,b=p.offsetWidth,y=b;document.body.classList.add("col-resizing");let m=(v)=>{y=Math.max(gM,b+(v.clientX-g)),p.style.width=`${y}px`},f=()=>{document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",f),document.body.classList.remove("col-resizing"),o(e,(v)=>({...v,widths:{...v.widths??{},[t.key]:y}}))};document.addEventListener("pointermove",m),document.addEventListener("pointerup",f)},h=(u)=>{u.preventDefault();let p=u.dataTransfer.getData("text/grid-column");if(!p||p===t.key)return;o(e,(g)=>{let b=[...g.order??[]];if(!b.includes(p)||!b.includes(t.key))return g;return b.splice(b.indexOf(p),1),b.splice(b.indexOf(t.key),0,p),{...g,order:b}})};return ke.jsxs("th",{ref:i,className:[t.num?"num":"",r?"dragging":""].filter(Boolean).join(" "),style:a===void 0?void 0:{width:a},"data-col":t.key,draggable:!0,title:`${t.label} — click to sort, drag to reorder, drag the edge to resize`,...c?{role:"button",tabIndex:0,"aria-sort":vM(n,t.key),onKeyDown:(u)=>{if(u.key!=="Enter"&&u.key!==" ")return;u.preventDefault(),l(t.key)}}:{},onClick:c?()=>l(t.key):void 0,onDragStart:(u)=>{u.dataTransfer.effectAllowed="move",u.dataTransfer.setData("text/grid-column",t.key),s(!0)},onDragEnd:()=>s(!1),onDragOver:(u)=>u.preventDefault(),onDrop:h,children:[ke.jsxs("span",{className:"th-l",children:[t.label,n?.key===t.key&&ke.jsx("i",{className:`sort ${n.dir}`})]}),ke.jsx("span",{className:"th-grip",onPointerDown:d})]})}var gM=40;function vM(e,t){if(e?.key!==t)return"none";return e.dir==="asc"?"ascending":"descending"}function bM({id:e,columns:t,layout:n,onReset:a}){let l=Uo((r)=>r.update),o=new Set(n.hidden??[]);return ke.jsx("button",{type:"button",className:"th-cols",title:"Columns","aria-label":"Columns",onClick:(r)=>zt(r.currentTarget,[{label:n.showFilters?"Hide filters":"Show filters",icon:"magnifying-glass",run:()=>l(e,(s)=>({...s,showFilters:!s.showFilters}))},{label:"Reset layout",icon:"arrows-clockwise",run:a},_l("Columns"),...t.map((s)=>({label:s.label.charAt(0).toUpperCase()+s.label.slice(1),...o.has(s.key)?{}:{icon:"check"},run:()=>l(e,(c)=>{let d=new Set(c.hidden??[]);if(d.has(s.key))d.delete(s.key);else d.add(s.key);return{...c,hidden:[...d]}})}))]),children:_("sliders",14)})}var zb=S(M(),1);function Gt({onOpen:e,title:t}){return zb.jsx("button",{type:"button",className:"more",title:t,"aria-label":t,"aria-haspopup":"menu",onClick:(n)=>{n.stopPropagation(),e(n.currentTarget)},children:_("dots-three",15)})}var yn=S(M(),1);function _b(e){if(e==="orphaned")return 0;if(e==="expired")return 1;return e==="held"?2:3}function yM({state:e}){if(e==="orphaned")return yn.jsx(N,{tone:"warn",children:"Orphaned · holds work"});if(e==="expired")return yn.jsx(N,{tone:"acc",children:"Expired"});return yn.jsx(N,{tone:"ok",children:"Held"})}var SM=(e)=>[{key:"project",label:"project",width:104,get:(t)=>e(t.projectId),cell:(t)=>e(t.projectId)},{key:"task",label:"task",width:140,get:(t)=>t.task,cell:(t)=>yn.jsx("b",{children:t.task})},{key:"owner",label:"owner",width:120,get:(t)=>t.owner,cell:(t)=>t.owner||"—"},{key:"lease",label:"lease",width:130,get:(t)=>t.state==="held"?new Date(t.expiresAt).getTime():0,cell:(t)=>yn.jsx("span",{className:"dim",children:t.state==="held"?Ps(t.expiresAt):"—"})},{key:"worktree",label:"worktree",flex:!0,get:(t)=>t.worktree,cell:(t)=>yn.jsx("span",{className:"now",title:t.worktree,children:$e(t.worktree)})},{key:"state",label:"state",width:150,get:(t)=>t.state,cell:(t)=>yn.jsx(yM,{state:t.state})}];function Lb({claims:e,orphaned:t,projectName:n,showProject:a,menu:l}){if(e.length===0)return null;let o=SM(n).filter((i)=>a||i.key!=="project");return yn.jsx(C,{title:"Claims",hint:`${e.length}${t?` · ${t} orphaned`:""}`,spaced:!0,children:yn.jsx(de,{id:"claims",columns:o,rows:[...e].sort((i,r)=>_b(i.state)-_b(r.state)),rowKey:(i)=>`${i.projectId}:${i.task}`,leading:{width:24,cell:(i)=>yn.jsx("span",{className:`s ${i.state==="orphaned"?"waiting":i.state==="expired"?"idle":"active"}`})},trailing:{width:34,cell:(i)=>yn.jsx(Gt,{title:"Claim actions",onOpen:(r)=>Eb(r,i,l)})}})})}var Sn=S(M(),1),wM=(e)=>[{key:"name",label:"process",width:150,get:(t)=>t.name,cell:(t)=>Sn.jsx("b",{children:t.name})},{key:"kind",label:"kind",width:80,get:(t)=>t.kind,cell:(t)=>Sn.jsx(N,{children:t.kind})},{key:"project",label:"project",width:104,get:(t)=>e(t.projectId),cell:(t)=>e(t.projectId)},{key:"pid",label:"pid",width:76,num:!0,get:(t)=>t.pid,cell:(t)=>t.pid},{key:"port",label:"port",width:70,num:!0,get:(t)=>t.port??0,cell:(t)=>t.port==null?Sn.jsx(H,{}):Sn.jsxs("a",{href:`http://127.0.0.1:${t.port}/`,target:"_blank",rel:"noopener noreferrer",children:[":",t.port]})},{key:"cwd",label:"working directory",flex:!0,get:(t)=>t.cwd,cell:(t)=>Sn.jsx("span",{className:"now",title:t.cwd,children:$e(t.cwd)})},{key:"up",label:"up",width:64,get:(t)=>t.startedAt,cell:(t)=>Sn.jsx("span",{className:"dim",children:Pe(t.startedAt)})}];function Kb({processes:e,projectName:t,showProject:n,menu:a}){if(e.length===0)return null;let l=wM(t).filter((o)=>n||o.key!=="project");return Sn.jsx(C,{title:"Processes",hint:`${e.length} · started through swarm serve / proc`,spaced:!0,children:Sn.jsx(de,{id:"processes",columns:l,rows:e,rowKey:(o)=>`${o.projectId}:${o.pid}`,leading:{width:24,cell:()=>Sn.jsx("span",{className:"s active"})},trailing:{width:34,cell:(o)=>Sn.jsx(Gt,{title:"Process actions",onOpen:(i)=>Nb(i,o,a)})}})})}var wn=S(M(),1),MM=(e)=>[{key:"name",label:"resource",width:170,get:(t)=>t.name,cell:(t)=>wn.jsx("b",{children:t.name})},{key:"kind",label:"kind",width:90,get:(t)=>t.kind,cell:(t)=>wn.jsx(N,{children:t.kind})},{key:"project",label:"project",width:104,get:(t)=>t.projectId?e(t.projectId):"global",cell:(t)=>t.projectId?e(t.projectId):wn.jsx("span",{className:"dim",children:"global"})},{key:"owner",label:"owner",width:130,get:(t)=>t.owner,cell:(t)=>t.owner},{key:"pid",label:"pid",width:76,num:!0,get:(t)=>t.pid??0,cell:(t)=>t.pid??wn.jsx(H,{})},{key:"port",label:"port",width:76,num:!0,get:(t)=>t.port??0,cell:(t)=>t.port??wn.jsx(H,{})},{key:"held",label:"held",flex:!0,get:(t)=>t.acquiredAt,cell:(t)=>wn.jsxs("span",{className:"dim",children:[Pe(t.acquiredAt),t.expiresAt?` · lease ${Ps(t.expiresAt)}`:t.pid?" · pid-tracked":""]})}];function jb({resources:e,projectName:t,showProject:n,menu:a}){if(e.length===0)return null;let l=MM(t).filter((o)=>n||o.key!=="project");return wn.jsx(C,{title:"Resources",hint:`${e.length} held · ports auto-protected`,spaced:!0,children:wn.jsx(de,{id:"resources",columns:l,rows:e,rowKey:(o)=>`${o.projectId??"global"}:${o.name}`,leading:{width:24,cell:()=>wn.jsx("span",{className:"s active"})},trailing:{width:34,cell:(o)=>wn.jsx(Gt,{title:"Resource actions",onOpen:(i)=>Tb(i,o,a)})}})})}var bf=S(B(),1);var or=S(B(),1);var Be=S(M(),1),xM=["acceptEdits","auto","plan","dontAsk","manual","bypassPermissions"],kM=["full","no-edits","read-only"],Bb="swarm.runOpts";function DM(){try{let e=JSON.parse(localStorage.getItem(Bb)||"{}");return{mode:e.mode??"acceptEdits",model:e.model??"",turns:e.turns??"",profile:e.profile??"full"}}catch{return{mode:"acceptEdits",model:"",turns:"",profile:"full"}}}function OM(e,t,n,a){return{projectId:e,task:t,prompt:n.trim(),owner:"dashboard",permissionMode:a.mode,model:a.model.trim()||void 0,maxTurns:a.turns?Number(a.turns):void 0,profile:a.profile==="full"?void 0:a.profile}}async function EM(e){try{let t=await Ne("/v1/runs","POST",e);if(!t.ok||!t.run)return{kind:"failed",error:t.error??"the run did not start"};return{kind:"started",sessionId:t.run.sessionId}}catch(t){return{kind:"failed",error:t instanceof Error?t.message:String(t)}}}function Ub({projectId:e,task:t,onClose:n,onStarted:a}){let[l,o]=or.useState(DM),[i,r]=or.useState(t.title?`Task ${t.id}: ${t.title}
13
+ Remove anyway (discards the work)?`))await _i(e,t,!0)}else if(!a.ok&&a.error)alert(a.error);o.reload?.()}function fI(e,t,o){bo(e,[{label:"Open worktree",icon:"arrow-square-out",run:async()=>{let a=await gg(t.projectId,t.worktree);if(!a.ok&&a.error)alert(a.error)}},{label:"Copy path",icon:"copy",caption:ds(Qe(t.worktree),14),run:()=>void Zt(t.worktree)},an,t.state==="orphaned"?{label:"Force release",icon:"trash",danger:!0,caption:"discards work",run:()=>{if(confirm(`Force-release ${t.task}? This permanently discards its worktree and any uncommitted work.`))pg(t.projectId,t.task,!0).then(()=>o.reload?.())}}:{label:"Release claim",icon:"x",run:()=>void pg(t.projectId,t.task).then(()=>o.reload?.())}],{title:t.task})}function pI(e,t,o){bo(e,[{label:"Copy pid",icon:"copy",caption:String(t.pid),run:()=>void Zt(String(t.pid))},...t.cwd?[{label:"Copy working directory",icon:"folder-simple",caption:ds(Qe(t.cwd),16),run:()=>void Zt(t.cwd)}]:[],an,{label:"Stop",icon:"stop",danger:!0,caption:"SIGTERM → SIGKILL",run:async()=>{if(!confirm(`Stop pid ${t.pid}?`))return;let a=await qd(t.pid,t.projectId);if(!a.ok&&a.error)alert(a.error);o.reload?.()}}])}function hI(e,t,o){bo(e,[{label:"Copy name",icon:"copy",run:()=>void Zt(t.name)},an,{label:"Release",icon:"x",danger:!0,caption:"force",run:()=>{if(confirm(`Force-release ${t.name}?`))aI(t.name,t.projectId??null).then(()=>o.reload?.())}}],{title:t.name})}function gI(e,t,o){let a=t.forge==="gitlab"?"GitLab":"GitHub",n=t.checks!=="fail"&&t.mergeable&&!t.draft,r=t.draft?"draft":t.checks==="fail"?"checks failing":"not mergeable";bo(e,[{label:`Open on ${a}`,icon:"arrow-square-out",run:()=>on(t.url)},{label:"Copy URL",icon:"copy",run:()=>void Zt(t.url)},an,{label:"Squash-merge",icon:"git-pull-request",disabled:!n,caption:n?t.forge==="gitlab"?"glab":"gh":r,run:async()=>{if(!confirm(`Squash-merge #${t.number}?`))return;let s=await lI(t.projectId,t.number);if(!s.ok&&s.error)alert(s.error);o.reload?.()}}],{title:`#${t.number}`})}var Ra=x(R(),1);var ji=Ui()(Fd((e)=>({tables:{},update:(t,o)=>e((a)=>({tables:{...a.tables,[t]:o(a.tables[t]??{})}})),reset:(t)=>e((o)=>{let{[t]:a,...n}=o.tables;return{tables:n}})}),{name:"swarm.grids"}));var Io=x(T(),1),bI=[25,50,100,0];function vI({total:e,page:t,pageSize:o,onPage:a,onPageSize:n}){let r=o>0?Math.ceil(e/o):1,s=bI[0];if(e<=s&&r<=1)return null;let l=e===0?0:t*o+1,c=o>0?Math.min((t+1)*o,e):e;return Io.jsxs("div",{className:"gpager",children:[Io.jsx("span",{className:"dim",children:o>0?Io.jsxs(Io.Fragment,{children:[l,"–",c," of ",e]}):Io.jsxs(Io.Fragment,{children:[e," rows"]})}),r>1&&Io.jsxs(Io.Fragment,{children:[Io.jsx("button",{type:"button",className:"gp-btn",title:"Previous page","aria-label":"Previous page",disabled:t===0,onClick:()=>a(t-1),children:z("arrow-left",12)}),Io.jsxs("span",{className:"dim",children:[t+1," / ",r]}),Io.jsx("button",{type:"button",className:"gp-btn",title:"Next page","aria-label":"Next page",disabled:t+1>=r,onClick:()=>a(t+1),children:z("arrow-right",12)})]}),Io.jsx("span",{className:"seg gp-size",children:bI.map((u)=>Io.jsx("button",{type:"button",className:o===u?"on":"",title:u===0?"Show every row":`${u} rows per page`,onClick:()=>n(u),children:u===0?"All":u},u))})]})}var qe=x(T(),1),wY=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function IY(e,t){let o=new Map(e.map((s)=>[s.key,s])),a=t.order?.filter((s)=>o.has(s))??[],n=e.filter((s)=>!a.includes(s.key)).map((s)=>s.key),r=new Set(t.hidden??[]);return[...a,...n].map((s)=>o.get(s)).filter((s)=>s!==void 0&&!r.has(s.key))}function xY(e,t){if(e==null&&t==null)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e==="number"&&typeof t==="number")return e-t;return wY.compare(String(e),String(t))}function ke({id:e,columns:t,rows:o,leading:a,trailing:n,rowKey:r,onRowClick:s,empty:l,defaultPageSize:c=CY}){let u=ji((M)=>M.tables[e])??{},d=ji((M)=>M.update),m=ji((M)=>M.reset),f=Ra.useMemo(()=>IY(t,u),[t,u]),p=Ra.useMemo(()=>{let M=Object.entries(u.filters??{}).map(([de,fe])=>[t.find((pe)=>pe.key===de),fe.trim().toLowerCase()]).filter(([de,fe])=>de!==void 0&&fe!==""),A=o;if(M.length>0)A=A.filter((de)=>M.every(([fe,pe])=>String(fe?.get?.(de)??"").toLowerCase().includes(pe)));let E=u.sort,j=E?t.find((de)=>de.key===E.key):void 0;if(E&&j?.get){let de=E.dir==="desc"?-1:1,fe=A.map((pe)=>({row:pe,key:j.get?.(pe)}));fe.sort((pe,Ye)=>xY(pe.key,Ye.key)*de),A=fe.map((pe)=>pe.row)}return A},[o,t,u.filters,u.sort]),b=(M)=>d(e,(A)=>{let E=A.sort;if(!E||E.key!==M)return{...A,sort:{key:M,dir:"asc"}};if(E.dir==="asc")return{...A,sort:{key:M,dir:"desc"}};return{...A,sort:null}}),v=(M,A)=>d(e,(E)=>{let j={...E.filters??{}};if(A)j[M]=A;else delete j[M];return{...E,filters:j}}),S=u.pageSize??c,[h,g]=Ra.useState(0);Ra.useEffect(()=>g(0),[u.filters,u.sort,o.length]);let y=S>0?Math.max(1,Math.ceil(p.length/S)):1,I=Math.min(h,y-1),k=Ra.useMemo(()=>S>0?p.slice(I*S,(I+1)*S):p,[p,I,S]),C=f.length+(a?1:0)+(n?1:0),D=Object.values(u.filters??{}).some(Boolean);return qe.jsxs("div",{className:"card grid","data-tid":e,children:[qe.jsxs("table",{className:"dt",children:[qe.jsxs("thead",{children:[qe.jsxs("tr",{children:[a&&qe.jsx("th",{style:{width:a.width}}),f.map((M)=>qe.jsx(MY,{id:e,column:M,sort:u.sort??null,width:u.widths?.[M.key]??(M.flex?void 0:M.width??100),onSort:b},M.key)),n&&qe.jsx("th",{style:{width:n.width},className:"th-tools",children:qe.jsx(TY,{id:e,columns:t,layout:u,onReset:()=>m(e)})})]}),u.showFilters&&qe.jsxs("tr",{className:"filters",children:[a&&qe.jsx("th",{}),f.map((M)=>qe.jsx("th",{children:M.filterable!==!1&&qe.jsx("input",{value:u.filters?.[M.key]??"",placeholder:M.label,onChange:(A)=>v(M.key,A.target.value)})},M.key)),n&&qe.jsx("th",{})]})]}),qe.jsxs("tbody",{children:[k.map((M)=>qe.jsxs("tr",{onClick:s?()=>s(M):void 0,style:s?{cursor:"pointer"}:void 0,children:[a&&qe.jsx("td",{className:"td-lead",children:a.cell(M)}),f.map((A)=>qe.jsx("td",{className:[A.num?"num":"",A.cls??""].filter(Boolean).join(" "),children:A.cell(M)},A.key)),n&&qe.jsx("td",{className:"td-tools",children:n.cell(M)})]},r(M))),k.length===0&&qe.jsx("tr",{className:"tbl-empty",children:qe.jsx("td",{colSpan:C,children:l??`No rows${D?" match the filters":""}.`})})]})]}),qe.jsx(vI,{total:p.length,page:I,pageSize:S,onPage:g,onPageSize:(M)=>{g(0),d(e,(A)=>({...A,pageSize:M}))}})]})}var CY=50;function MY({id:e,column:t,sort:o,width:a,onSort:n}){let r=ji((f)=>f.update),s=Ra.useRef(null),[l,c]=Ra.useState(!1),u=t.sortable!==!1&&t.get!==void 0,d=(f)=>{f.preventDefault(),f.stopPropagation();let p=s.current;if(!p)return;let b=f.clientX,v=p.offsetWidth,S=v;document.body.classList.add("col-resizing");let h=(y)=>{S=Math.max(kY,v+(y.clientX-b)),p.style.width=`${S}px`},g=()=>{document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",g),document.body.classList.remove("col-resizing"),r(e,(y)=>({...y,widths:{...y.widths??{},[t.key]:S}}))};document.addEventListener("pointermove",h),document.addEventListener("pointerup",g)},m=(f)=>{f.preventDefault();let p=f.dataTransfer.getData("text/grid-column");if(!p||p===t.key)return;r(e,(b)=>{let v=[...b.order??[]];if(!v.includes(p)||!v.includes(t.key))return b;return v.splice(v.indexOf(p),1),v.splice(v.indexOf(t.key),0,p),{...b,order:v}})};return qe.jsxs("th",{ref:s,className:[t.num?"num":"",l?"dragging":""].filter(Boolean).join(" "),style:a===void 0?void 0:{width:a},"data-col":t.key,draggable:!0,title:`${t.label} — click to sort, drag to reorder, drag the edge to resize`,...u?{role:"button",tabIndex:0,"aria-sort":DY(o,t.key),onKeyDown:(f)=>{if(f.key!=="Enter"&&f.key!==" ")return;f.preventDefault(),n(t.key)}}:{},onClick:u?()=>n(t.key):void 0,onDragStart:(f)=>{f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/grid-column",t.key),c(!0)},onDragEnd:()=>c(!1),onDragOver:(f)=>f.preventDefault(),onDrop:m,children:[qe.jsxs("span",{className:"th-l",children:[t.label,o?.key===t.key&&qe.jsx("i",{className:`sort ${o.dir}`})]}),qe.jsx("span",{className:"th-grip",onPointerDown:d})]})}var kY=40;function DY(e,t){if(e?.key!==t)return"none";return e.dir==="asc"?"ascending":"descending"}function TY({id:e,columns:t,layout:o,onReset:a}){let n=ji((l)=>l.update),r=new Set(o.hidden??[]);return qe.jsx("button",{type:"button",className:"th-cols",title:"Columns","aria-label":"Columns",onClick:(l)=>bo(l.currentTarget,[{label:o.showFilters?"Hide filters":"Show filters",icon:"magnifying-glass",run:()=>n(e,(c)=>({...c,showFilters:!c.showFilters}))},{label:"Reset layout",icon:"arrows-clockwise",run:a},us("Columns"),...t.map((c)=>({label:c.label.charAt(0).toUpperCase()+c.label.slice(1),...r.has(c.key)?{}:{icon:"check"},run:()=>n(e,(u)=>{let d=new Set(u.hidden??[]);if(d.has(c.key))d.delete(c.key);else d.add(c.key);return{...u,hidden:[...d]}})}))]),children:z("sliders",14)})}var SI=x(T(),1);function Fo({onOpen:e,title:t}){return SI.jsx("button",{type:"button",className:"more",title:t,"aria-label":t,"aria-haspopup":"menu",onClick:(o)=>{o.stopPropagation(),e(o.currentTarget)},children:z("dots-three",15)})}var Sa=x(T(),1);function yI(e){if(e==="orphaned")return 0;if(e==="expired")return 1;return e==="held"?2:3}function AY({state:e}){if(e==="orphaned")return Sa.jsx(H,{tone:"warn",children:"Orphaned · holds work"});if(e==="expired")return Sa.jsx(H,{tone:"acc",children:"Expired"});return Sa.jsx(H,{tone:"ok",children:"Held"})}var EY=(e)=>[{key:"project",label:"project",width:104,get:(t)=>e(t.projectId),cell:(t)=>e(t.projectId)},{key:"task",label:"task",width:140,get:(t)=>t.task,cell:(t)=>Sa.jsx("b",{children:t.task})},{key:"owner",label:"owner",width:120,get:(t)=>t.owner,cell:(t)=>t.owner||"—"},{key:"lease",label:"lease",width:130,get:(t)=>t.state==="held"?new Date(t.expiresAt).getTime():0,cell:(t)=>Sa.jsx("span",{className:"dim",children:t.state==="held"?Gd(t.expiresAt):"—"})},{key:"worktree",label:"worktree",flex:!0,get:(t)=>t.worktree,cell:(t)=>Sa.jsx("span",{className:"now",title:t.worktree,children:Qe(t.worktree)})},{key:"state",label:"state",width:150,get:(t)=>t.state,cell:(t)=>Sa.jsx(AY,{state:t.state})}];function wI({claims:e,orphaned:t,projectName:o,showProject:a,menu:n}){if(e.length===0)return null;let r=EY(o).filter((s)=>a||s.key!=="project");return Sa.jsx(F,{title:"Claims",hint:`${e.length}${t?` · ${t} orphaned`:""}`,spaced:!0,children:Sa.jsx(ke,{id:"claims",columns:r,rows:[...e].sort((s,l)=>yI(s.state)-yI(l.state)),rowKey:(s)=>`${s.projectId}:${s.task}`,leading:{width:24,cell:(s)=>Sa.jsx("span",{className:`s ${s.state==="orphaned"?"waiting":s.state==="expired"?"idle":"active"}`})},trailing:{width:34,cell:(s)=>Sa.jsx(Fo,{title:"Claim actions",onOpen:(l)=>fI(l,s,n)})}})})}var ya=x(T(),1),OY=(e)=>[{key:"name",label:"process",width:150,get:(t)=>t.name,cell:(t)=>ya.jsx("b",{children:t.name})},{key:"kind",label:"kind",width:80,get:(t)=>t.kind,cell:(t)=>ya.jsx(H,{children:t.kind})},{key:"project",label:"project",width:104,get:(t)=>e(t.projectId),cell:(t)=>e(t.projectId)},{key:"pid",label:"pid",width:76,num:!0,get:(t)=>t.pid,cell:(t)=>t.pid},{key:"port",label:"port",width:70,num:!0,get:(t)=>t.port??0,cell:(t)=>t.port==null?ya.jsx(Z,{}):ya.jsxs("a",{href:`http://127.0.0.1:${t.port}/`,target:"_blank",rel:"noopener noreferrer",children:[":",t.port]})},{key:"cwd",label:"working directory",flex:!0,get:(t)=>t.cwd,cell:(t)=>ya.jsx("span",{className:"now",title:t.cwd,children:Qe(t.cwd)})},{key:"up",label:"up",width:64,get:(t)=>t.startedAt,cell:(t)=>ya.jsx("span",{className:"dim",children:vt(t.startedAt)})}];function II({processes:e,projectName:t,showProject:o,menu:a}){if(e.length===0)return null;let n=OY(t).filter((r)=>o||r.key!=="project");return ya.jsx(F,{title:"Processes",hint:`${e.length} · started through swarm serve / proc`,spaced:!0,children:ya.jsx(ke,{id:"processes",columns:n,rows:e,rowKey:(r)=>`${r.projectId}:${r.pid}`,leading:{width:24,cell:()=>ya.jsx("span",{className:"s active"})},trailing:{width:34,cell:(r)=>ya.jsx(Fo,{title:"Process actions",onOpen:(s)=>pI(s,r,a)})}})})}var wa=x(T(),1),NY=(e)=>[{key:"name",label:"resource",width:170,get:(t)=>t.name,cell:(t)=>wa.jsx("b",{children:t.name})},{key:"kind",label:"kind",width:90,get:(t)=>t.kind,cell:(t)=>wa.jsx(H,{children:t.kind})},{key:"project",label:"project",width:104,get:(t)=>t.projectId?e(t.projectId):"global",cell:(t)=>t.projectId?e(t.projectId):wa.jsx("span",{className:"dim",children:"global"})},{key:"owner",label:"owner",width:130,get:(t)=>t.owner,cell:(t)=>t.owner},{key:"pid",label:"pid",width:76,num:!0,get:(t)=>t.pid??0,cell:(t)=>t.pid??wa.jsx(Z,{})},{key:"port",label:"port",width:76,num:!0,get:(t)=>t.port??0,cell:(t)=>t.port??wa.jsx(Z,{})},{key:"held",label:"held",flex:!0,get:(t)=>t.acquiredAt,cell:(t)=>wa.jsxs("span",{className:"dim",children:[vt(t.acquiredAt),t.expiresAt?` · lease ${Gd(t.expiresAt)}`:t.pid?" · pid-tracked":""]})}];function xI({resources:e,projectName:t,showProject:o,menu:a}){if(e.length===0)return null;let n=NY(t).filter((r)=>o||r.key!=="project");return wa.jsx(F,{title:"Resources",hint:`${e.length} held · ports auto-protected`,spaced:!0,children:wa.jsx(ke,{id:"resources",columns:n,rows:e,rowKey:(r)=>`${r.projectId??"global"}:${r.name}`,leading:{width:24,cell:()=>wa.jsx("span",{className:"s active"})},trailing:{width:34,cell:(r)=>wa.jsx(Fo,{title:"Resource actions",onOpen:(s)=>hI(s,r,a)})}})})}var vg=x(R(),1);var Cc=x(R(),1);var nt=x(T(),1),LY=["acceptEdits","auto","plan","dontAsk","manual","bypassPermissions"],RY=["full","no-edits","read-only"],CI="swarm.runOpts";function BY(){try{let e=JSON.parse(localStorage.getItem(CI)||"{}");return{mode:e.mode??"acceptEdits",model:e.model??"",turns:e.turns??"",profile:e.profile??"full"}}catch{return{mode:"acceptEdits",model:"",turns:"",profile:"full"}}}function HY(e,t,o,a){return{projectId:e,task:t,prompt:o.trim(),owner:"dashboard",permissionMode:a.mode,model:a.model.trim()||void 0,maxTurns:a.turns?Number(a.turns):void 0,profile:a.profile==="full"?void 0:a.profile}}async function PY(e){try{let t=await De("/v1/runs","POST",e);if(!t.ok||!t.run)return{kind:"failed",error:t.error??"the run did not start"};return{kind:"started",sessionId:t.run.sessionId}}catch(t){return{kind:"failed",error:t instanceof Error?t.message:String(t)}}}function MI({projectId:e,task:t,onClose:o,onStarted:a}){let[n,r]=Cc.useState(BY),[s,l]=Cc.useState(t.title?`Task ${t.id}: ${t.title}
14
14
 
15
- Work only inside this worktree. When done: commit, push, then call swarm_handoff with what was done and what remains, and record the required gates with swarm_gate_record.`:""),[s,c]=or.useState(!1),[d,h]=or.useState(null),u=async()=>{if(!i.trim()){h("A prompt is required.");return}c(!0),h(null),localStorage.setItem(Bb,JSON.stringify(l));let g=await EM(OM(e,t.id,i,l));if(g.kind==="started"){a(g.sessionId);return}h(g.error),c(!1)},p=(g)=>o((b)=>({...b,...g}));return Be.jsxs(ha,{title:"Run",glyph:"play",subtitle:t.title?`${t.id} — ${t.title}`:t.id,onClose:n,footer:Be.jsxs(Be.Fragment,{children:[Be.jsx("button",{type:"button",onClick:n,children:"Cancel"}),Be.jsxs("button",{type:"button",className:"primary",disabled:s,onClick:()=>void u(),children:[_("play",13)," ",s?"starting…":"Run"]})]}),children:[Be.jsxs("label",{children:["prompt",Be.jsx("textarea",{spellCheck:!1,value:i,onChange:(g)=>r(g.target.value),onKeyDown:(g)=>{if(g.key==="Enter"&&(g.metaKey||g.ctrlKey))u()}})]}),Be.jsxs("div",{className:"row",children:[Be.jsxs("label",{children:["permission mode",Be.jsx("select",{value:l.mode,onChange:(g)=>p({mode:g.target.value}),children:xM.map((g)=>Be.jsx("option",{value:g,children:g},g))})]}),Be.jsxs("label",{children:["model",Be.jsx("input",{placeholder:"default",value:l.model,onChange:(g)=>p({model:g.target.value})})]}),Be.jsxs("label",{children:["max turns",Be.jsx("input",{type:"number",min:1,placeholder:"∞",value:l.turns,onChange:(g)=>p({turns:g.target.value})})]})]}),Be.jsxs("label",{title:"full: every tool · no-edits: commands but no file edits · read-only: read and search only",children:["profile",Be.jsx("select",{value:l.profile,onChange:(g)=>p({profile:g.target.value}),children:kM.map((g)=>Be.jsx("option",{value:g,children:g},g))})]}),d&&Be.jsx("div",{className:"addproj-err",children:d}),Be.jsxs("div",{className:"dim note",children:["Claims ",Be.jsx("b",{children:t.id})," (or reuses your held worktree) and spawns ",Be.jsx("code",{children:"claude -p"})," ","there. The session appears in Fleet; steer it from its page."]})]})}var me=S(M(),1);function NM({task:e}){if(e.claimedBy)return me.jsxs(N,{tone:"ok",children:["Held · ",e.claimedBy]});if(e.status==="done")return me.jsx(N,{children:"Done"});if(e.status==="active")return me.jsx(N,{tone:"acc",children:"In progress"});return e.ready?me.jsx(N,{tone:"ok",children:"Ready"}):me.jsx(N,{children:"Blocked"})}function TM(e){if(e.claimedBy)return 0;if(e.ready)return 1;if(e.status==="active")return 2;return e.status==="done"?4:3}var RM=[{key:"id",label:"id",width:70,get:(e)=>e.id,cell:(e)=>me.jsx("b",{children:e.id})},{key:"title",label:"task",flex:!0,get:(e)=>e.title,cell:(e)=>me.jsx("span",{className:"now",title:e.statusText,children:e.title})},{key:"milestone",label:"milestone",width:160,get:(e)=>e.milestone??"",cell:(e)=>me.jsx("span",{className:"dim now",children:(e.milestone??"").split(" — ")[0]})},{key:"depends",label:"depends",width:130,get:(e)=>e.depends.join(" "),cell:(e)=>me.jsx("span",{className:"br",children:e.depends.join(" ")||"—"})},{key:"state",label:"state",width:150,get:TM,cell:(e)=>me.jsx(NM,{task:e})}];function Hb({source:e,tasks:t,loading:n=!1,error:a=null,projectId:l,onOpenSession:o}){let[i,r]=bf.useState("ready"),[s,c]=bf.useState(null);if(!e)return null;if(t.length===0)return me.jsx(C,{title:"Tasks",hint:e,children:me.jsx(Y,{children:a?me.jsxs(me.Fragment,{children:[me.jsxs("b",{children:["Could not read tasks from ",e,"."]}),me.jsx("br",{}),a]}):n?me.jsxs(me.Fragment,{children:["Fetching tasks from ",e,"…"]}):me.jsxs(me.Fragment,{children:["No tasks in ",e,"."]})})});let d=t.filter((g)=>g.ready),h=t.filter((g)=>g.status!=="done"),u=i==="ready"?d:i==="open"?h:t,p=[["ready","Ready",d.length],["open","Open",h.length],["all","All",t.length]];return me.jsxs(C,{title:"Tasks",hint:e,children:[me.jsx("div",{className:"chips",children:p.map(([g,b,y])=>me.jsxs("button",{type:"button",className:i===g?"chip on":"chip",onClick:()=>r(g),children:[b," ",me.jsx("b",{children:y})]},g))}),me.jsx(de,{id:"tasks",columns:RM,rows:u,rowKey:(g)=>g.id,trailing:{width:34,cell:(g)=>me.jsx(Gt,{title:"Task actions",onOpen:(b)=>CM(b,g,l,c)})}}),s&&me.jsx(Ub,{projectId:l,task:{id:s.id,title:s.title},onClose:()=>c(null),onStarted:(g)=>{c(null),o(g)}})]})}function CM(e,t,n,a){let l=(i)=>()=>void xt(i),o=t.ready||t.claimedBy?[{label:t.claimedBy?"Run in worktree":"Run",icon:"play",...t.claimedBy?{}:{caption:"claim + claude -p"},run:()=>a(t)},...t.ready?[{label:"Claim",icon:"folders",caption:"fresh worktree",run:async()=>{let i=await Mb(n,t.id);if(!i.ok&&i.error)alert(i.error)}}]:[{label:"Run gates",icon:"check",run:async()=>{let i=await xb(n,t.id),r=(i.runs??[]).map((s)=>`${s.verdict==="pass"?"✓":"✗"} ${s.gate} — ${s.rubric}`).join(`
16
- `);alert(r||i.error||i.skipped?.[0]?.reason||"nothing ran")}}]]:[{label:t.status==="done"?"Done":"Blocked",disabled:!0}];zt(e,[...o,{label:"",divider:!0},_l("Copy"),{label:"Task id",icon:"copy",caption:t.id,run:l(t.id)},{label:"Title",icon:"file-text",run:l(`${t.id} — ${t.title}`)}],{title:t.id})}var ir=S(B(),1);function $b(e){let t=G((p)=>p?.projects??yf),n=G((p)=>p?.sessions??yf),a=G((p)=>p?.claims??yf),l=G((p)=>p?.worktrees??AM),o=G((p)=>p?.openIncidents??0),i=G((p)=>p?.openIncidentsByProject??zM),r=ir.useMemo(()=>{let p=new Map(t.map((g)=>[g.id,g.name]));return(g)=>p.get(g)??"(removed)"},[t]),s=ir.useMemo(()=>(p)=>!e||p===e,[e]),c=ir.useMemo(()=>(e?[e]:t.map((g)=>g.id)).flatMap((g)=>(l[g]??[]).map((b)=>({...b,projectId:g}))),[e,t,l]),d=ir.useMemo(()=>{let p=new Map(c.map((g)=>[g.path,[]]));for(let g of n){if(g.state==="ended")continue;for(let b of p.keys())if(g.cwd===b||g.cwd.startsWith(`${b}/`))p.get(b)?.push(g)}return p},[c,n]),h=n.filter((p)=>s(p.projectId)&&(p.state==="active"||p.state==="waiting")),u=a.filter((p)=>p.state!=="released"&&s(p.projectId));return{worktrees:c,sessionsInside:d,live:h,waiting:h.filter((p)=>p.state==="waiting").length,heldClaims:u,orphaned:u.filter((p)=>p.state==="orphaned").length,dirty:c.filter((p)=>p.dirty>0).length,merged:c.filter((p)=>!p.main&&p.merged).length,openIncidents:e?i[e]??0:o,projectCount:e?1:t.length,projectName:r,inScope:s}}var yf=[],AM={},zM={};var Te=S(M(),1);function _M({worktree:e}){if(e.main)return null;if(e.merged)return Te.jsx("span",{title:"This branch is already in the main checkout's branch",children:Te.jsx(N,{children:"Merged"})});if(e.behind>0)return Te.jsx("span",{title:"Commits on the main checkout's branch this worktree lacks",children:Te.jsxs(N,{tone:"warn",children:[e.behind," behind"]})});return e.behind===0?Te.jsx(N,{children:"Up to date"}):Te.jsx(H,{})}var LM=({projectName:e,sessionsInside:t,onOpenSession:n})=>[{key:"project",label:"project",width:104,get:(a)=>e(a.projectId),cell:(a)=>e(a.projectId)},{key:"branch",label:"branch",width:240,get:(a)=>a.branch??"",cell:(a)=>Te.jsxs(Te.Fragment,{children:[Te.jsx("span",{className:"br",children:a.branch??"(detached)"}),a.main&&Te.jsx(N,{children:"Main tree"})]})},{key:"head",label:"head",width:90,get:(a)=>a.head,cell:(a)=>Te.jsx("span",{className:"br",children:a.head})},{key:"path",label:"path",flex:!0,get:(a)=>a.path,cell:(a)=>Te.jsx("span",{className:"now",title:a.path,children:$e(a.path)})},{key:"state",label:"state",width:170,get:(a)=>a.dirty*1000+a.ahead,cell:(a)=>Te.jsxs(Te.Fragment,{children:[a.dirty>0&&Te.jsxs(N,{tone:"warn",children:[a.dirty," Dirty"]}),a.ahead>0&&Te.jsxs(N,{tone:"acc",children:[a.ahead," Unpushed"]}),a.dirty===0&&a.ahead<=0&&Te.jsx(N,{children:"Clean"})]})},{key:"drift",label:"drift",width:120,get:(a)=>a.main?-1:a.behind,cell:(a)=>Te.jsx(_M,{worktree:a})},{key:"sessions",label:"sessions",width:160,get:(a)=>t.get(a.path)?.length??0,cell:(a)=>{let l=t.get(a.path)??[];if(l.length===0)return Te.jsx(H,{});return l.map((o)=>Te.jsx("button",{type:"button",className:"link",onClick:()=>n(o.id),children:o.title??o.id.slice(0,8)},o.id))}}];function qb({worktrees:e,showProject:t,menu:n,heldPaths:a,...l}){if(e.length===0)return null;let o=LM(l).filter((i)=>t||i.key!=="project");return Te.jsx(C,{title:"Worktrees",hint:String(e.length),spaced:!0,children:Te.jsx(de,{id:"worktrees",columns:o,rows:e,rowKey:(i)=>i.path,leading:{width:24,cell:(i)=>{let r=(l.sessionsInside.get(i.path)?.length??0)>0;return Te.jsx("span",{className:`s ${r?"active":i.dirty>0?"waiting":"ended"}`})}},trailing:{width:34,cell:(i)=>Te.jsx(Gt,{title:"Worktree actions",onOpen:(r)=>Ob(r,i,{held:a?.has(i.path)??!1,sessions:l.sessionsInside.get(i.path)??[]},n)})}})})}var Yt=S(M(),1);function Yb(){let e=T((g)=>g.project),t=T((g)=>g.openSession),n=$b(e),a=G((g)=>g?.processes??Gb),l=G((g)=>g?.resources??Gb),[o,i]=Ho.useState(null),r=Ho.useCallback((g,b)=>i({projectId:g,worktree:b}),[]),s=Pa(void 0,r),c=Ho.useMemo(()=>new Set(n.heldClaims.filter((g)=>g.state==="held").map((g)=>g.worktree)),[n.heldClaims]),{data:d}=te(e?`/v1/tasks${Ae({project:e})}`:null),h=d?.tasks??[];if(n.live.length===0&&n.heldClaims.length===0&&n.worktrees.length===0&&n.openIncidents===0&&h.length===0)return Yt.jsxs(Y,{children:["Nothing on the board.",Yt.jsx("br",{}),"Tasks, processes, claims, worktrees, and incidents appear here."]});let p=!e;return Yt.jsxs(Yt.Fragment,{children:[Yt.jsx(mb,{data:n,tasks:d?.source?{ready:h.filter((g)=>g.ready).length,open:h.filter((g)=>g.status!=="done").length}:null}),e&&Yt.jsx(Hb,{source:d?.source??null,tasks:h,loading:d?.loading??!1,error:d?.error??null,projectId:e,onOpenSession:t}),Yt.jsx(Kb,{processes:a.filter((g)=>n.inScope(g.projectId)),projectName:n.projectName,showProject:p,menu:s}),Yt.jsx(jb,{resources:l.filter((g)=>n.inScope(g.projectId)),projectName:n.projectName,showProject:p,menu:s}),Yt.jsx(Lb,{claims:n.heldClaims,orphaned:n.orphaned,projectName:n.projectName,showProject:p,menu:s}),Yt.jsx(qb,{worktrees:n.worktrees,sessionsInside:n.sessionsInside,projectName:n.projectName,onOpenSession:t,showProject:p,menu:s,heldPaths:c}),o&&Yt.jsx(Fs,{projectId:o.projectId,worktree:o.worktree,onClose:()=>i(null)})]})}var Gb=[];var Vb=S(B(),1);var An=(e,t)=>`${e}${Ae({project:t})}`,Re={outcomes:(e)=>An("/v1/outcomes",e),hygiene:(e)=>An("/v1/hygiene",e),gateHealth:(e)=>An("/v1/gates/health",e),mcpHealth:(e)=>An("/v1/mcp/health",e),context:(e)=>An("/v1/context",e),heat:(e)=>An("/v1/heat",e),security:(e)=>An("/v1/security",e),provenance:(e)=>An("/v1/provenance",e),ruleEffect:(e)=>An("/v1/rules/effect",e),prs:()=>"/v1/prs",incidents:(e,t)=>`/v1/incidents${Ae({project:e,limit:500,open:t?1:null})}`,trials:(e)=>An("/v1/ab",e),stats:(e)=>An("/v1/stats",e)};var Fa=S(M(),1);function $o({bars:e,color:t="var(--acc-fill)"}){let n=Math.max(1,...e.map((a)=>a.value));return Fa.jsx("div",{className:"hbars",children:e.map((a)=>Fa.jsxs("div",{className:"hb",title:a.detail===void 0?a.label:`${a.label} — ${a.detail}`,children:[Fa.jsx("span",{className:"k",children:a.label}),Fa.jsx("span",{className:"t",children:Fa.jsx("i",{style:{width:`${100*a.value/n}%`,background:t}})}),Fa.jsx("span",{className:"n",children:a.detail??a.value})]},a.label))})}var Kl=S(M(),1);function qe({title:e,hint:t,children:n}){return Kl.jsxs("div",{className:"chart-card flush",children:[Kl.jsxs("h3",{children:[e,t!==void 0&&Kl.jsx("span",{children:t})]}),n]})}function el({children:e}){return Kl.jsx("div",{className:"cols",children:e})}function tc({children:e}){return Kl.jsx("div",{className:"stack",children:e})}var V=S(M(),1);function tl(e){if(e>=1e6)return`${(e/1e6).toFixed(1)}M`;if(e>=1000)return`${Math.round(e/1000)}k`;return String(e)}function nc(e){let t=/^mcp__([^_]+(?:_[^_]+)*?)__(.+)$/.exec(e);if(!t)return e;let n=(t[1]??"").replace(/[-_]/g," ").split(" ").map((a)=>a[0]).join("").toLowerCase();return`${t[2]} · ${n}`}function Xb(){let e=T((c)=>c.project),t=T((c)=>c.openSession),{data:n,error:a,reload:l}=te(Re.context(e)),o=G((c)=>c?.sessions??KM),i=Vb.useMemo(()=>{let c=new Map(o.map((d)=>[d.id,d.title]));return(d)=>c.get(d)??null},[o]);if(a&&!n)return V.jsx(xe,{error:a,onRetry:l});if(!n)return V.jsx(ue,{});let r=n.totals;if(!r.sessions)return V.jsx(C,{title:"Context",hint:"where the window goes",children:V.jsxs(Y,{children:["No tool results in the last 7 days",e?" in this project":"","."]})});let s=n.sessions.filter((c)=>c.wastedChars>0).slice(0,10);return V.jsxs(V.Fragment,{children:[V.jsx(C,{title:"Context",hint:`last 7 days · ${tl(r.toolChars)} characters returned by tools`}),V.jsxs(ut,{children:[V.jsx(K,{label:"Returned by tools",value:tl(r.toolChars),detail:`characters · ≈${tl(r.toolTokens)} tokens`}),V.jsx(K,{label:"Spent re-reading",value:tl(r.wastedChars),detail:r.wasteShare?`${Math.round(r.wasteShare*100)}% of it · ${r.rereadFiles} file${r.rereadFiles===1?"":"s"}`:"nothing re-read",tone:r.wasteShare>0.1?"hot":r.wasteShare>0.03?"warm":void 0}),V.jsx(K,{label:"Cache hit",value:`${Math.round(r.cacheHit*100)}%`,detail:"of the window came back free"}),V.jsx(K,{label:"Sessions",value:r.sessions,detail:"with tool activity"})]}),V.jsxs(el,{children:[V.jsx(qe,{title:"What fills the window",hint:"by tool · characters returned",children:V.jsx($o,{bars:n.byTool.map((c)=>({label:nc(c.tool),value:c.chars,detail:`${tl(c.chars)} · ${c.calls}`}))})}),V.jsx(qe,{title:"Re-read waste",hint:"the same file, read again",children:s.length>0?V.jsxs("table",{className:"mini",children:[V.jsxs("colgroup",{children:[V.jsx("col",{style:{width:"31%"}}),V.jsx("col",{style:{width:"15%"}}),V.jsx("col",{style:{width:"14%"}}),V.jsx("col",{style:{width:"11%"}}),V.jsx("col",{style:{width:"29%"}})]}),V.jsx("thead",{children:V.jsxs("tr",{children:[V.jsx("th",{children:"session"}),V.jsx("th",{className:"num",children:"returned"}),V.jsx("th",{className:"num",children:"wasted"}),V.jsx("th",{className:"num",children:"share"}),V.jsx("th",{children:"worst files"})]})}),V.jsx("tbody",{children:s.map((c)=>V.jsxs("tr",{onClick:()=>t(c.sessionId),className:"clickable",children:[V.jsx("td",{children:i(c.sessionId)??c.sessionId.slice(0,8)}),V.jsx("td",{className:"num",children:tl(c.toolChars)}),V.jsx("td",{className:"num",children:V.jsx("b",{children:tl(c.wastedChars)})}),V.jsxs("td",{className:"num",children:[Math.round(c.wasteShare*100),"%"]}),V.jsx("td",{className:"clip",children:c.worst.slice(0,2).map((d)=>V.jsxs("span",{className:"br",title:`${d.path} — read ${d.reads}× · ${tl(d.wastedChars)} chars re-read`,children:[d.path.split("/").at(-1)," ",V.jsxs("b",{children:[d.reads,"×"]})]},d.path))})]},c.sessionId))})]}):V.jsx("div",{className:"dim",children:"Nothing was read twice — no waste to report."})})]}),V.jsxs("p",{className:"dim note",children:["Character counts are exact — every tool response is stored. Token figures are a flat 4:1 estimate. ",V.jsx("b",{children:"MCP tool schemas and the system prompt are not included"}),": Swarm sees tool calls, never the schemas or the prompt preamble, so they are left out rather than guessed at."]})]})}var KM=[];var Bl=S(B(),1);function Sf(e){let t=$e(e);return t.split("/").pop()||t}function ac(e,t=2){let n=$e(e).split("/");if(n.pop(),n.length<=t)return n.join("/");return`…/${n.slice(-t).join("/")}`}function lc(e){let t=new Map;for(let n of e){let a=2,l=(o,i)=>`${Sf(o)}|${ac(o,i)}`;while(a<6&&e.some((o)=>o!==n&&l(o,a)===l(n,a)))a++;t.set(n,ac(n,a))}return t}var jl=S(M(),1);function oc({path:e,hint:t}){return jl.jsxs(jl.Fragment,{children:[jl.jsx("b",{children:Sf(e)})," ",jl.jsx("span",{className:"dim",children:t??ac(e)})]})}var R=S(M(),1);function Qb(){let e=T((u)=>u.project),{data:t,error:n,reload:a}=te(Re.heat(e)),l=Bl.useMemo(()=>t?.files.slice(0,14)??[],[t]),o=Bl.useMemo(()=>t?.dirs.slice(0,10)??[],[t]),i=Bl.useMemo(()=>t?.candidates.slice(0,10)??[],[t]),r=Bl.useMemo(()=>lc(l.map((u)=>u.path)),[l]),s=Bl.useMemo(()=>lc(o.map((u)=>u.dir)),[o]),c=Bl.useMemo(()=>lc(i.map((u)=>u.path)),[i]);if(n&&!t)return R.jsx(xe,{error:n,onRetry:a});if(!t)return R.jsx(ue,{});if(t.files.length===0)return R.jsx(C,{title:"Files",hint:"file-touch heat",children:R.jsxs(Y,{children:["No file was touched more than once",e?" in this project":""," in the last 14 days."]})});let d=t.totals,h=o[0]?.touches||1;return R.jsxs(R.Fragment,{children:[R.jsx(C,{title:"Files",hint:`${d.files.toLocaleString()} files · ${d.touches.toLocaleString()} touches · ${d.sessions} sessions · last 14 days`}),R.jsxs(ut,{children:[R.jsx(K,{label:"Files touched",value:d.files.toLocaleString(),detail:`${d.touches.toLocaleString()} touches · last 14 days`}),R.jsx(K,{label:"Re-reads",value:d.rereads.toLocaleString(),detail:d.touches?`${Math.round(d.rereads/d.touches*100)}% of every touch`:"none"}),R.jsx(K,{label:"Touched once",value:d.cold.toLocaleString(),detail:"cold — read and never returned to"}),R.jsx(K,{label:"CLAUDE.md candidates",value:t.candidates.length,detail:t.candidates.length?"re-read by several sessions":"nothing worth writing down",tone:t.candidates.length?"warm":void 0})]}),R.jsxs(el,{children:[R.jsx(qe,{title:"Hottest files",hint:"every touch, across sessions",children:R.jsxs("table",{className:"mini",children:[R.jsxs("colgroup",{children:[R.jsx("col",{style:{width:"46%"}}),R.jsx("col",{style:{width:"15%"}}),R.jsx("col",{style:{width:"13%"}}),R.jsx("col",{style:{width:"13%"}}),R.jsx("col",{style:{width:"13%"}})]}),R.jsx("thead",{children:R.jsxs("tr",{children:[R.jsx("th",{children:"path"}),R.jsx("th",{className:"num",children:"touches"}),R.jsx("th",{className:"num",children:"sessions"}),R.jsx("th",{className:"num",children:"re-reads"}),R.jsx("th",{className:"num",children:"writes"})]})}),R.jsx("tbody",{children:l.map((u)=>R.jsxs("tr",{children:[R.jsx("td",{className:"clip path",title:$e(u.path),children:R.jsx(oc,{path:u.path,hint:r.get(u.path)})}),R.jsx("td",{className:"num",children:R.jsx("b",{children:u.touches.toLocaleString()})}),R.jsx("td",{className:"num",children:u.sessions}),R.jsx("td",{className:"num",children:u.rereads.toLocaleString()}),R.jsx("td",{className:"num",children:u.writes.toLocaleString()})]},u.path))})]})}),R.jsxs(tc,{children:[R.jsx(qe,{title:"Worth writing down",hint:"read again and again, rarely written",children:i.length>0?R.jsxs(R.Fragment,{children:[R.jsxs("table",{className:"mini",children:[R.jsxs("colgroup",{children:[R.jsx("col",{style:{width:"58%"}}),R.jsx("col",{style:{width:"22%"}}),R.jsx("col",{style:{width:"20%"}})]}),R.jsx("thead",{children:R.jsxs("tr",{children:[R.jsx("th",{children:"path"}),R.jsx("th",{className:"num",children:"re-reads"}),R.jsx("th",{className:"num",children:"sessions"})]})}),R.jsx("tbody",{children:i.map((u)=>R.jsxs("tr",{children:[R.jsx("td",{className:"clip path",title:$e(u.path),children:R.jsx(oc,{path:u.path,hint:c.get(u.path)})}),R.jsx("td",{className:"num",children:R.jsx("b",{children:u.rereads.toLocaleString()})}),R.jsx("td",{className:"num",children:u.sessions})]},u.path))})]}),R.jsxs("p",{className:"dim note",children:["Several sessions keep reading these and rarely change them — the conclusion is being re-derived every time. Put it in ",R.jsx("code",{children:"CLAUDE.md"})," once instead."]})]}):R.jsx("div",{className:"dim",children:"Nothing here is worth extracting. Every file several sessions re-read is also one they edit — that is where the work is, not a reference being re-learned."})}),R.jsx(qe,{title:"By directory",hint:"where the work sits",children:R.jsx("ul",{className:"heatlist",children:o.map((u)=>R.jsxs("li",{children:[R.jsx("span",{className:"bar",style:{"--w":`${Math.max(2,Math.round(u.touches/h*100))}%`}}),R.jsx("span",{className:"clip path",title:$e(u.dir),children:R.jsx(oc,{path:u.dir,hint:s.get(u.dir)})}),R.jsx("b",{children:u.touches.toLocaleString()}),R.jsxs("span",{className:"dim",children:[u.files," file",u.files===1?"":"s"," · ",u.sessions," session",u.sessions===1?"":"s"]})]},u.dir))})})]})]}),R.jsxs("p",{className:"dim note",children:[R.jsx("b",{children:"Incidents are not correlated here."})," An incident records the rule, the action and the command — not a path — so tying a rule that fired on a shell command to a file would mean parsing paths out of command strings and guessing."]})]})}var ya=S(B(),1);var Mf=S(B(),1);var Zb=S(B(),1),nl=S(M(),1),wf=88,jM=20,BM=18,UM=16;function qo({points:e,color:t="var(--acc-fill)",className:n="spark"}){let a=Zb.useMemo(()=>{if(e.length<2)return null;let l=Math.max(0.000000001,...e),o=wf/(e.length-1),i=(s)=>BM-s/l*UM;return{d:e.map((s,c)=>`${c?"L":"M"}${(c*o).toFixed(1)},${i(s).toFixed(1)}`).join(""),lastY:i(e[e.length-1]??0)}},[e]);return nl.jsx("svg",{viewBox:`0 0 ${wf} ${jM}`,className:n,preserveAspectRatio:"none","aria-hidden":"true",children:a&&nl.jsxs(nl.Fragment,{children:[nl.jsx("path",{d:a.d,stroke:t}),nl.jsx("circle",{cx:wf,cy:a.lastY.toFixed(1),r:2,fill:t})]})})}var ba=S(B(),1);var Vn=S(M(),1);function Jb(){let[e,t]=ba.useState(!1),[n,a]=ba.useState(""),[l,o]=ba.useState(null),[i,r]=ba.useState(!1),s=ba.useRef(null);ba.useEffect(()=>{if(e)s.current?.focus()},[e]);let c=async()=>{let d=n.trim();if(!d||i)return;r(!0);let h=await yb(d);if(r(!1),h.ok)a(""),o(null),t(!1);else o(h.error??"could not add that folder")};return Vn.jsxs(Vn.Fragment,{children:[Vn.jsxs("h4",{children:["Projects",Vn.jsx("button",{type:"button",className:"h4-act",title:"Add a project by path","aria-label":"Add a project","aria-expanded":e,onClick:()=>t((d)=>!d),children:_("plus",14)})]}),e&&Vn.jsxs("div",{className:"addproj",children:[Vn.jsx("input",{ref:s,type:"text",value:n,placeholder:"~/code/my-repo",spellCheck:!1,autoComplete:"off",onChange:(d)=>a(d.target.value),onKeyDown:(d)=>{if(d.key==="Enter")c();if(d.key==="Escape")t(!1)}}),l&&Vn.jsx("div",{className:"addproj-err",children:l})]})]})}var ye=S(M(),1);function Wb(){let e=T((u)=>u.project),t=T((u)=>u.selectProject),n=G((u)=>u?.projects??$M),a=G((u)=>u?.sessions??qM),l=G((u)=>u?.spendSparks??GM),o=Pa(),i=Mf.useMemo(()=>{let u={};for(let p of a)if(p.state==="active"||p.state==="waiting")u[p.projectId]=(u[p.projectId]??0)+1;return u},[a]),r=Mf.useMemo(()=>{let u=new Map;for(let p of n)u.set(p.name,(u.get(p.name)??0)+1);return u},[n]),s=n.filter((u)=>!u.discovered),c=n.filter((u)=>u.discovered),d=Object.values(i).reduce((u,p)=>u+p,0),h=(u)=>ye.jsx(HM,{project:u,selected:e===u.id,live:i[u.id]??0,spark:l[u.id]??YM,ambiguous:(r.get(u.name)??0)>1,onSelect:t,onMenu:(p)=>kb(p,u,i[u.id]??0,o)},u.id);return ye.jsx("aside",{children:ye.jsxs("div",{id:"projects",children:[ye.jsx(Jb,{}),ye.jsxs("button",{type:"button",className:e===null?"proj sel":"proj",onClick:()=>t(null),children:[ye.jsx("span",{className:d>0?"st live":"st"}),_("folders",14),ye.jsx("span",{className:"nm",children:"All projects"}),ye.jsx("small",{children:d||""})]}),ye.jsx("div",{id:"pinned",children:s.map(h)}),c.length>0&&ye.jsxs(ye.Fragment,{children:[ye.jsxs("h4",{children:["Unpinned ",ye.jsx("span",{className:"faint h4-note",children:"· seen, not pinned"})]}),c.map(h)]})]})})}function HM({project:e,selected:t,live:n,spark:a,ambiguous:l,onSelect:o,onMenu:i}){let r=Tn(a,(c)=>c),s=l?e.root.split("/").filter(Boolean).at(-2):void 0;return ye.jsxs("div",{className:t?"proj sel":"proj",role:"button",tabIndex:0,onClick:()=>o(e.id),onKeyDown:(c)=>{if(c.key==="Enter"||c.key===" ")o(e.id)},title:e.root,children:[ye.jsx("span",{className:n>0?"st live":"st"}),ye.jsx(xf,{project:e}),ye.jsxs("span",{className:"nm",children:[s&&ye.jsxs("span",{className:"pdir",children:[s,"/"]}),e.name]}),r>=0.5&&ye.jsx("span",{className:"proj-spark",title:`last 14 days · $${r.toFixed(0)}`,children:ye.jsx(qo,{points:a,color:"var(--c1)"})}),ye.jsx("small",{children:n||""}),ye.jsx("button",{type:"button",className:"act more",title:"Project actions","aria-label":"Project actions","aria-haspopup":"menu",onClick:(c)=>{c.stopPropagation(),i(c.currentTarget)},children:_("dots-three",15)})]})}function xf({project:e,size:t=14}){let n=e.color?`pg pg-${e.color}`:"pg";if(!e.icon)return ye.jsx("span",{className:n,children:_("folder-simple",t)});if(e.icon.startsWith("data:image/"))return ye.jsx("span",{className:n,children:ye.jsx("img",{className:"pg-img",src:e.icon,alt:""})});return ye.jsx("span",{className:n,children:e.icon})}var $M=[],qM=[],GM={},YM=[];var ic={"claude-code":1,codex:2,gemini:3,grok:4,aider:5,cline:6,opencode:7},VM={"claude-code":"Claude",codex:"Codex",gemini:"Gemini",grok:"Grok",aider:"Aider",cline:"Cline",opencode:"opencode"};function vt(e){return`var(--c${ic[e]??0})`}function Ie(e){return VM[e]??e}var GO=Object.keys(ic);function Xn(e,t){return(ic[e]??99)-(ic[t]??99)}var Pb=S(M(),1);function Go({agent:e}){if(!e)return null;let t=vt(e);return Pb.jsx("span",{className:"badge agent",style:{color:t,background:`color-mix(in srgb, ${t} 14%, transparent)`},children:Ie(e)})}var ne=S(M(),1),XM=(e)=>e.state==="active"||e.state==="waiting",QM=(e)=>_(e.kind==="subagent"?"tree-structure":e.kind==="spawned"?"play":"keyboard",13,"kind");function Fb(){let e=T((m)=>m.project),t=T((m)=>m.openSession),n=G((m)=>m?.sessions??JM),a=G((m)=>m?.projects??PM),l=G((m)=>m?.questions??WM),o=ya.useMemo(()=>new Set(l.map((m)=>m.sessionId).filter((m)=>Boolean(m))),[l]),[i,r]=ya.useState(null),s=Pa(),c=ya.useMemo(()=>n.filter((m)=>!e||m.projectId===e),[n,e]),d=ya.useMemo(()=>{let m=new Map;for(let f of c)m.set(f.agent,(m.get(f.agent)??0)+1);return m},[c]),{live:h,earlier:u}=ya.useMemo(()=>{let m=[],f=[];for(let v of c){if(i&&v.agent!==i)continue;(XM(v)?m:f).push(v)}return{live:m,earlier:f}},[c,i]),p=ya.useMemo(()=>{let m=new Map(a.map((f)=>[f.id,f]));return(f)=>m.get(f)},[a]),g=ya.useMemo(()=>{let m=[{key:"project",label:"project",width:112,get:(f)=>p(f.projectId)?.name??"",cell:(f)=>{let v=p(f.projectId);if(!v)return ne.jsx("span",{className:"dim",children:"(removed)"});return ne.jsxs(ne.Fragment,{children:[ne.jsx(xf,{project:v,size:12})," ",v.name]})}},{key:"agent",label:"agent",width:78,cls:"td-badge",get:(f)=>Ie(f.agent),cell:(f)=>ne.jsx(Go,{agent:f.agent})},{key:"session",label:"session",width:210,get:(f)=>f.title??f.id,cell:(f)=>ne.jsxs(ne.Fragment,{children:[QM(f),ne.jsx("b",{children:f.title??f.id.slice(0,8)}),f.subagents>0&&ne.jsxs(N,{tone:"acc",children:[f.subagents," Sub"]}),o.has(f.id)&&ne.jsx("span",{title:"This agent asked a question only a human can answer — open the session",children:ne.jsx(N,{tone:"warn",children:"Asking"})}),f.stuck&&ne.jsx("span",{title:`${f.stuck} — heuristic, nothing was interrupted; open the session to judge`,children:ne.jsx(N,{tone:"bad",children:"Stuck"})})]})},{key:"branch",label:"branch",width:116,get:(f)=>f.branch??"",cell:(f)=>ne.jsx("span",{className:"br",children:f.branch??""})},{key:"now",label:"now",flex:!0,get:(f)=>f.last,cell:(f)=>ne.jsx(ZM,{session:f})},{key:"model",label:"model",width:84,get:(f)=>Ot(f.model),cell:(f)=>ne.jsxs("span",{className:"br",children:[Ot(f.model),f.models>1&&ne.jsxs("span",{className:"faint",children:[" +",f.models-1]})]})},{key:"trend",label:"trend",width:84,sortable:!1,filterable:!1,cell:(f)=>ne.jsx(qo,{points:f.spark.map((v)=>v[0]),color:vt(f.agent)})},{key:"out",label:"out",width:66,num:!0,get:(f)=>f.tokens.output,cell:(f)=>Dt(f.tokens.output)},{key:"ctx",label:"ctx",width:72,num:!0,get:(f)=>Ib(f),cell:(f)=>Dt(Ib(f))},{key:"cost",label:"cost",width:64,num:!0,get:(f)=>f.costUsd??0,cell:(f)=>F(f.costUsd)??ne.jsx(H,{})},{key:"age",label:"age",width:56,num:!0,get:(f)=>new Date(f.lastSeenAt).getTime(),cell:(f)=>ne.jsx("span",{className:"dim",children:Pe(f.lastSeenAt)})}];return e?m.filter((f)=>f.key!=="project"):m},[e,p,o]),b=(m,f)=>ne.jsx(de,{id:m,columns:g,rows:f,rowKey:(v)=>v.id,onRowClick:(v)=>t(v.id),leading:{width:24,cell:(v)=>ne.jsx("span",{className:`s ${v.state}`})},trailing:{width:34,cell:(v)=>ne.jsx(Gt,{title:"Session actions",onOpen:(w)=>Db(w,v,s)})}}),y=[...d.keys()].sort(Xn);return ne.jsxs(ne.Fragment,{children:[y.length>1&&ne.jsxs("div",{className:"chips",children:[ne.jsx("button",{type:"button",className:i===null?"chip on":"chip",onClick:()=>r(null),children:"All"}),y.map((m)=>ne.jsxs("button",{type:"button",className:i===m?"chip on":"chip",onClick:()=>r(m),children:[Ie(m)," ",ne.jsx("b",{children:d.get(m)})]},m))]}),ne.jsx(C,{title:"Live",hint:`${h.length} sessions · ${F(Tn(h,(m)=>m.costUsd))??"$0.00"}`,children:h.length>0?b("fleet-live",h):ne.jsx(Y,{children:"Nothing running."})}),u.length>0&&ne.jsx(C,{title:"Earlier",hint:String(u.length),spaced:!0,children:b("fleet-earlier",u)})]})}function ZM({session:e}){let t=e.lastText?.split(`
17
- `).find((a)=>a.trim())??"";if(e.state==="ended")return t?ne.jsx("span",{className:"now dim",title:t,children:t}):ne.jsx("span",{className:"dim",children:"ended"});let n=e.state==="waiting"&&t?t:e.last;return ne.jsx("span",{className:"now",title:e.last,children:n})}var Ib=(e)=>e.tokens.cacheRead+e.tokens.input+e.tokens.cacheWrite,JM=[],WM=[],PM=[];var he=S(M(),1),kf=(e)=>Is(e)??he.jsx(H,{});function IM({gate:e}){let t=[...e.history].reverse();return he.jsx("span",{className:"gh",title:`last ${t.length} run${t.length===1?"":"s"}, oldest first`,children:t.map((n)=>he.jsx("i",{className:n.verdict==="pass"?"ok":"bad",title:`${n.task} · ${n.at}${n.durationMs===null?"":` · ${(n.durationMs/1000).toFixed(1)}s`}`},`${n.at}-${n.task}-${n.verdict}`))})}var FM=[{key:"gate",label:"gate",width:150,get:(e)=>e.gate,cell:(e)=>he.jsxs(he.Fragment,{children:[he.jsx("b",{children:e.gate}),e.flaky&&he.jsx("span",{title:"This gate returned both a pass and a fail on the same task",children:he.jsx(N,{tone:"bad",children:"Flaky"})})]})},{key:"history",label:"history",width:150,sortable:!1,filterable:!1,cell:(e)=>he.jsx(IM,{gate:e})},{key:"runs",label:"runs",width:60,num:!0,get:(e)=>e.runs,cell:(e)=>e.runs},{key:"pass",label:"pass rate",width:84,num:!0,get:(e)=>e.passRate,cell:(e)=>`${Math.round(e.passRate*100)}%`},{key:"flips",label:"flips",width:64,num:!0,get:(e)=>e.flips,cell:(e)=>e.flips>0?he.jsx("b",{className:"bad",children:e.flips}):he.jsx("span",{className:"dim",children:"0"})},{key:"p50",label:"p50",width:66,num:!0,get:(e)=>e.p50Ms??-1,cell:(e)=>kf(e.p50Ms)},{key:"p95",label:"p95",width:66,num:!0,get:(e)=>e.p95Ms??-1,cell:(e)=>kf(e.p95Ms)},{key:"max",label:"slowest",width:74,num:!0,get:(e)=>e.maxMs??-1,cell:(e)=>kf(e.maxMs)},{key:"total",label:"total",width:74,num:!0,get:(e)=>e.totalMs,cell:(e)=>e.timedRuns>0?an(e.totalMs):he.jsx(H,{})},{key:"last",label:"last",flex:!0,get:(e)=>e.lastAt??"",cell:(e)=>e.lastAt?he.jsxs(he.Fragment,{children:[e.lastVerdict==="pass"?he.jsx(N,{tone:"ok",children:"Pass"}):he.jsx(N,{tone:"warn",children:"Fail"})," ",he.jsx("span",{className:"dim",children:Pe(e.lastAt)})]}):he.jsx(H,{})}];function ey(){let e=T((i)=>i.project),{data:t,error:n,reload:a}=te(Re.gateHealth(e));if(n&&!t)return he.jsx(xe,{error:n,onRetry:a});if(!t)return he.jsx(ue,{});if(t.gates.length===0)return he.jsx(C,{title:"Gates",hint:"flakiness and wall-clock",children:he.jsxs(Y,{children:["No gate runs in the last 30 days",e?" in this project":"",".",he.jsx("br",{}),"Gates appear here once ",he.jsx("code",{children:"swarm_gate_run"})," or a workflow's gate step records one."]})});let l=t.totals,o=[`${l.gates} gate${l.gates===1?"":"s"}`,`${l.runs} run${l.runs===1?"":"s"}`,"last 30 days",l.flakyGates?`${l.flakyGates} flaky`:"none flaky",...l.totalMs?[`${an(l.totalMs)} of wall-clock`]:[]].join(" · ");return he.jsxs(C,{title:"Gates",hint:o,children:[he.jsx(de,{id:"gate-health",columns:FM,rows:t.gates,rowKey:(i)=>i.gate,defaultPageSize:0}),he.jsx("p",{className:"dim note",children:"Flaky = the same gate returned both a pass and a fail on one task. A gate that fails on one task and passes on another is doing its job, and is not counted. Durations cover executed gates only — a gate an agent simply recorded has no wall-clock."})]})}var pc=S(B(),1);var Ul=S(B(),1);var q=S(M(),1),rc=(e)=>F(e)??"—";function ny(e,t){let n=e/t,a=10**Math.floor(Math.log10(n)),l=[1,2,2.5,5,10].map((i)=>i*a).find((i)=>i>=n)??a*10,o=[];for(let i=l;i<=e;i+=l)o.push(i);return o}function ex(e,t,n,a,l){if(a<=0)return"";let o=Math.min(l,n/2,a);return`M${e},${t+a}V${t+o}Q${e},${t} ${e+o},${t}H${e+n-o}Q${e+n},${t} ${e+n},${t+o}V${t+a}Z`}function Hl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Yo({days:e,series:t,height:n=150,format:a=rc,colorOf:l=vt,nameOf:o=Ie,sortKeys:i=Xn,labelOf:r=(s)=>s.slice(5)}){let s=Ul.useMemo(()=>Object.keys(t).sort(i),[t,i]),c=Ul.useMemo(()=>e.map((v,w)=>s.reduce((D,z)=>D+(t[z]?.[w]??0),0)),[e,s,t]),d=1000,h=18,u=6,p=n-18-6,g=Math.max(0.000000001,...c),b=1000/e.length,y=Math.min(26,b*0.6),m=(v)=>6+p-v/g*p,f=Math.ceil(e.length/16);return q.jsxs("svg",{viewBox:`0 0 1000 ${n}`,preserveAspectRatio:"none",className:"chart",style:{height:n},role:"img","aria-label":"Daily cost, stacked by agent",children:[ny(g,3).map((v)=>q.jsxs("g",{children:[q.jsx("line",{x1:0,x2:1000,y1:m(v),y2:m(v),className:"grid"}),q.jsx("text",{x:0,y:m(v)-3,className:"ax",children:a(v)})]},v)),q.jsx("line",{x1:0,x2:1000,y1:m(0),y2:m(0),className:"base"}),e.map((v,w)=>{let D=w*b+(b-y)/2,z=0,E=s.map((A)=>{let j=t[A]?.[w]??0;if(!j)return null;let pt=m(z+j),Xt=m(z),Ln=z===0;z+=j;let on=Math.max(0,Xt-pt-(Ln?0:2));return q.jsx("path",{d:ex(D,pt,y,on,z===c[w]?3:0),fill:l(A)},A)}),O=[`<b>${v}</b>`,...s.filter((A)=>t[A]?.[w]).map((A)=>`<i style="background:${l(A)}"></i>${o(A)} ${a(t[A]?.[w]??0)}`),...s.length>1?[`<span>total ${a(c[w]??0)}</span>`]:[]].join("<br>");return q.jsxs("g",{className:"col","data-tip":O,children:[q.jsx("rect",{x:w*b,y:0,width:b,height:n,fill:"transparent"}),E,(e.length<=16||w%f===0)&&q.jsx("text",{x:D+y/2,y:n-4,className:"ax mid",children:r(v)})]},v)})]})}var ty=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tx=[1,2,3,4,5,6,0];function ay({cells:e,label:t="cost"}){let n=Ul.useMemo(()=>{let o=Array.from({length:7},()=>Array(24).fill(0));for(let i of e){let r=o[i.dow];if(r)r[i.hour]=(r[i.hour]??0)+(i.v??0)}return o},[e]),a=Math.max(0.000000001,...n.flat()),l=4.166666666666667;return q.jsxs("div",{className:"hm",children:[tx.map((o)=>q.jsxs(Ul.Fragment,{children:[q.jsx("div",{className:"hm-lbl",children:ty[o]}),q.jsx("div",{className:"hm-row",children:(n[o]??[]).map((i,r)=>q.jsx("i",{"data-tip":`<b>${ty[o]} ${String(r).padStart(2,"0")}:00</b><br>${t} ${rc(i)}`,style:{opacity:i?0.15+0.85*Math.sqrt(i/a):0}},`${o}-${r}`))})]},o)),q.jsx("div",{}),q.jsx("div",{className:"hm-hours",children:Array.from({length:24},(o,i)=>i%3===0?q.jsx("span",{style:{left:`${i*4.166666666666667}%`},children:String(i).padStart(2,"0")},i):null)})]})}function al({keys:e,colorOf:t=vt,nameOf:n=Ie}){return q.jsx("div",{className:"legend",children:e.map((a)=>q.jsxs("span",{children:[q.jsx("i",{style:{background:t(a)}}),n(a)]},a))})}function ly({byDay:e,weeks:t=52,label:n="cost"}){let{columns:a,months:l}=Ul.useMemo(()=>{let i=new Date;i.setHours(0,0,0,0);let r=new Date(i);r.setDate(i.getDate()-(t*7-1)-i.getDay());let s=Math.max(0.000000001,...Object.values(e).filter((p)=>p>0)),c=[],d=[],h=-1,u=new Date(r);for(let p=0;u<=i;p++){let g=[];for(let b=0;b<7&&u<=i;b++){if(b===0&&u.getMonth()!==h)h=u.getMonth(),d.push([p,u.toLocaleString(void 0,{month:"short"})]);let y=Hl(u);g.push({key:y,value:e[y]??0}),u.setDate(u.getDate()+1)}c.push(g)}return{columns:c,months:d,max:s}},[e,t]),o=Math.max(0.000000001,...Object.values(e).filter((i)=>i>0));return q.jsxs("div",{className:"cal",children:[q.jsx("div",{className:"cal-months",children:l.filter(([i],r)=>r===0?i<a.length-2:!0).map(([i,r])=>q.jsx("span",{style:{left:`${100*i/a.length}%`},children:r},`${i}-${r}`))}),q.jsx("div",{className:"cal-grid",style:{gridTemplateColumns:`repeat(${a.length},1fr)`},children:a.map((i)=>q.jsx("div",{className:"cal-col",children:i.map((r)=>q.jsx("i",{"data-tip":`<b>${r.key}</b><br>${r.value?`${n} ${rc(r.value)}`:"no activity"}`,style:{opacity:r.value?0.18+0.82*Math.sqrt(r.value/o):0}},r.key))},i[0]?.key??""))})]})}function oy({days:e,values:t,height:n=150,format:a=rc,color:l="var(--acc-fill)"}){if(e.length===0)return null;let o=1000,i=18,r=6,s=n-i-r,c=Math.max(0.000000001,...t),d=o/e.length,h=(y)=>y*d+d/2,u=(y)=>r+s-y/c*s,p=t.map((y,m)=>`${m?"L":"M"}${h(m).toFixed(1)},${u(y).toFixed(1)}`).join(""),g=`${p}L${h(e.length-1).toFixed(1)},${u(0)}L${h(0).toFixed(1)},${u(0)}Z`,b=Math.ceil(e.length/16);return q.jsxs("svg",{viewBox:`0 0 ${o} ${n}`,preserveAspectRatio:"none",className:"chart line",style:{height:n},role:"img","aria-label":"Cumulative spend",children:[ny(c,3).map((y)=>q.jsxs("g",{children:[q.jsx("line",{x1:0,x2:o,y1:u(y),y2:u(y),className:"grid"}),q.jsx("text",{x:0,y:u(y)-3,className:"ax",children:a(y)})]},y)),q.jsx("line",{x1:0,x2:o,y1:u(0),y2:u(0),className:"base"}),q.jsx("path",{d:g,fill:l,opacity:0.12}),q.jsx("path",{d:p,fill:"none",stroke:l,strokeWidth:2,vectorEffect:"non-scaling-stroke"}),e.map((y,m)=>{let f=t[m]??0,v=m?f-(t[m-1]??0):f,w=`<b>${y}</b><br>${a(f)}<br><span>${v>=0?"+":""}${a(v)} that day</span>`;return q.jsxs("g",{className:"pt","data-tip":w,children:[q.jsx("rect",{x:m*d,y:0,width:d,height:n,fill:"transparent"}),q.jsx("circle",{cx:h(m),cy:u(f),r:3,fill:l}),(e.length<=16||m%b===0)&&q.jsx("text",{x:h(m),y:n-4,className:"ax mid",children:y.slice(5)})]},y)})]})}function rr({parts:e,format:t=(n)=>String(Math.round(n))}){let n=e.reduce((i,r)=>i+r.v,0)||1,a=["var(--acc-1)","var(--acc-2)","var(--acc-3)","var(--acc-4)","var(--acc-5)"],l=e.filter((i)=>i.v>0),o=(i)=>a[e.findIndex((r)=>r.label===i.label)]??a.at(-1);return q.jsxs(q.Fragment,{children:[q.jsx("div",{className:"comp",children:l.map((i)=>q.jsx("i",{"data-tip":`<b>${i.label}</b><br>${t(i.v)} · ${(100*i.v/n).toFixed(1)}%`,style:{flex:i.v,background:o(i)}},i.label))}),q.jsx("div",{className:"legend small",children:l.map((i)=>{let r=100*i.v/n;return q.jsxs("span",{children:[q.jsx("i",{style:{background:o(i)}}),i.label," ",q.jsxs("em",{children:[r<1?"<1":r.toFixed(0),"%"]})]},i.label)})})]})}function iy(e){let t=new Set(e),n=0,a=0,l=null;for(let r of[...t].sort()){let s=Date.parse(`${r}T00:00:00Z`);a=l!==null&&s-l===86400000?a+1:1,l=s,n=Math.max(n,a)}let o=0,i=new Date;if(i.setHours(0,0,0,0),!t.has(Hl(i)))i.setDate(i.getDate()-1);while(t.has(Hl(i)))o++,i.setDate(i.getDate()-1);return{current:o,longest:n}}var Vt=S(M(),1),sc={subagent:{color:"var(--acc)",dash:""},dispatch:{color:"var(--c3,#5a9e6f)",dash:""},message:{color:"var(--warn)",dash:"3 3"},handoff:{color:"var(--dim)",dash:"6 3"}},ry=[["subagent","spawned a subagent"],["dispatch","dispatched a run"],["message","sent a message"],["handoff","handed the task on"]],nx={merged:"var(--ok)",reverted:"var(--bad)",open:"var(--warn)"},ax=190,sy=34,cc=20,Df=6.6,lx=(e,t=22)=>e.length<=t?e:`${e.slice(0,t-1)}…`,Of=(e)=>lx(e.title??e.id.slice(0,8)),cy=(e)=>e.degree>3?8:e.degree>1?6.5:5;function uy({graph:e,onOpenSession:t,onExpand:n}){if(e.nodes.length===0)return null;let a=e.width+ax+cc*2,l=e.height+sy+cc*2,o=new Map(e.nodes.map((i)=>[i.id,i]));return Vt.jsxs("svg",{viewBox:`0 0 ${a} ${l}`,width:a,height:l,role:"img","aria-label":"Session lineage graph",children:[e.edges.map((i)=>{let r=o.get(i.from),s=o.get(i.to);if(!r||!s)return null;let c=sc[i.kind]??sc.handoff,d=ox(r),h=ol(r),u=ll(s)-8,p=ol(s),g=i.back?-Math.max(24,Math.abs(p-h)*0.6):0,b=(d+u)/2,y=i.back?`M ${d} ${h} C ${b} ${h+g}, ${b} ${p+g}, ${u} ${p}`:`M ${d} ${h} C ${b} ${h}, ${b} ${p}, ${u} ${p}`;return Vt.jsx("path",{d:y,fill:"none",stroke:c?.color,strokeWidth:i.back?1:1.6,strokeDasharray:c?.dash||void 0,opacity:i.back?0.5:0.8,"data-tip":`${i.kind}${i.label?` · ${i.label}`:""}`},`${i.from}->${i.to}:${i.kind}:${i.at}`)}),e.nodes.map((i)=>i.groupSize?Vt.jsx(ix,{node:i,onExpand:n},i.id):Vt.jsx(sx,{node:i,onOpen:t},i.id))]})}function ll(e){return cc+e.x+7}function ol(e){return cc+e.y+sy/2}function ox(e){let t=Of(e),n=e.groupSize?t.length*Df+26:cy(e)+6+t.length*Df;return ll(e)+n+6}function ix({node:e,onExpand:t}){let n=Of(e),a=n.length*Df+26,l=()=>e.groupOf&&t(e.groupOf);return Vt.jsxs("g",{"data-tip":`${n} — click to expand`,className:"dag-node",role:"button",tabIndex:0,"aria-label":`Expand ${n}`,onClick:l,onKeyDown:(o)=>{if(o.key==="Enter"||o.key===" ")l()},children:[Vt.jsx("rect",{x:ll(e)-7,y:ol(e)-10,width:a,height:20,rx:10,fill:"var(--acc-soft)",stroke:vt(e.agent??""),strokeWidth:1,opacity:0.95}),Vt.jsx("text",{x:ll(e)+6,y:ol(e)+4,fontSize:11.5,fontWeight:600,fill:"var(--acc)",children:n}),Vt.jsx("text",{x:ll(e)+a-16,y:ol(e)+4,fontSize:11,fill:"var(--acc)",children:"+"})]})}function rx(e){let t=e.costUsd?` · $${e.costUsd.toFixed(2)}`:"",n=`${e.degree} link${e.degree===1?"":"s"}`,a=`${Ie(e.agent??"")} · ${e.kind}${t} · ${n}`;return`${e.title??e.id.slice(0,8)}<br><span class='dim'>${a}</span>`}function sx({node:e,onOpen:t}){let n=Of(e),a=e.state==="active"||e.state==="waiting",l=cy(e),o=e.outcome?nx[e.outcome]:null;return Vt.jsxs("g",{className:"dag-node","data-tip":rx(e),role:"button",tabIndex:0,"aria-label":`Open ${n}`,onClick:()=>t(e.id),onKeyDown:(i)=>{if(i.key==="Enter"||i.key===" ")t(e.id)},children:[o&&Vt.jsx("circle",{cx:ll(e),cy:ol(e),r:l+3,fill:"none",stroke:o,strokeWidth:1.5,opacity:0.8}),Vt.jsx("circle",{cx:ll(e),cy:ol(e),r:l,fill:vt(e.agent??""),stroke:a?"var(--fg)":void 0,strokeWidth:a?1:void 0}),Vt.jsx("text",{x:ll(e)+l+6,y:ol(e)+4,fontSize:11.5,fill:"var(--fg-2)",stroke:"var(--panel)",strokeWidth:3,paintOrder:"stroke",strokeLinejoin:"round",children:n})]})}var dt=S(M(),1),sr=30,cx=40,uc=250,cr=640,ux=(e,t=46)=>e.length<=t?e:`…${e.slice(-t)}`,dx=(e,t=30)=>e.length<=t?e:`${e.slice(0,t-1)}…`;function Ef({holders:e,held:t}){let n=t.slice(0,cx),l=Math.max(e.length,n.length,1)*sr+16,o=(c)=>(l-c*sr)/2+sr/2+4,i=new Map(e.map((c,d)=>[c.id,o(e.length)+d*sr])),r=new Map(n.map((c,d)=>[c.path,o(n.length)+d*sr])),s=n.flatMap((c)=>[...c.writers.map((d)=>({id:d,item:c,writing:!0})),...c.readers.map((d)=>({id:d,item:c,writing:!1}))].map(({id:d,item:h,writing:u})=>{let p=i.get(d),g=r.get(h.path);if(p==null||g==null)return null;let b=e.find((y)=>y.id===d);return dt.jsx("path",{d:`M ${uc+14} ${p} C ${uc+170} ${p}, ${cr-170} ${g}, ${cr-10} ${g}`,fill:"none",stroke:u?vt(b?.agent??""):"var(--faint)",strokeWidth:u?2:1,opacity:u?0.85:0.35},`${d}->${h.path}:${u}`)}).filter(Boolean));return dt.jsxs("svg",{viewBox:`0 0 1000 ${l}`,width:"100%",className:"bipartite",role:"img","aria-label":"Who holds what",children:[s,e.map((c)=>dt.jsxs("g",{"data-tip":`${c.label}<br><span class='dim'>${Ie(c.agent)} · ${c.files} file${c.files===1?"":"s"} · ${c.writes} write${c.writes===1?"":"s"}</span>`,children:[dt.jsx("circle",{cx:uc+8,cy:i.get(c.id),r:5,fill:vt(c.agent)}),dt.jsx("text",{x:uc-4,y:(i.get(c.id)??0)+4,textAnchor:"end",fontSize:12,fill:"var(--fg-2)",children:dx(c.label)})]},c.id)),n.map((c)=>{let d=c.writers.length+c.readers.length,h=`${c.path}<br><span class='dim'>${c.writers.length} writing · ${c.readers.length} reading</span>`+(c.contested?"<br><b>contested — a merge conflict waiting to happen</b>":"");return dt.jsxs("g",{"data-tip":h,children:[dt.jsx("circle",{cx:cr,cy:r.get(c.path),r:c.contested?6:4,fill:c.contested?"var(--bad)":d>1?"var(--warn)":"var(--faint)"}),dt.jsx("text",{x:cr+12,y:(r.get(c.path)??0)+4,fontSize:11,fontFamily:"var(--mono)",fill:c.contested?"var(--bad)":"var(--dim)",fontWeight:c.contested?600:void 0,children:ux(c.path)})]},c.path)}),t.length>n.length&&dt.jsxs("text",{x:cr+12,y:l-2,fontSize:11,fill:"var(--faint)",children:["… ",t.length-n.length," more"]})]})}var Qn=26,dc=150,fc=96;function dy({tools:e,edges:t,label:n=(a)=>a}){if(e.length===0)return null;let a=new Map(t.map((r)=>[`${r.from} ${r.to}`,r])),l=t.reduce((r,s)=>Math.max(r,s.weight),0),o=dc+e.length*Qn+8,i=fc+e.length*Qn+8;return dt.jsx("div",{className:"matrix-scroll",children:dt.jsxs("svg",{viewBox:`0 0 ${o} ${i}`,width:o,height:i,role:"img","aria-label":"Tool transition matrix",children:[e.map((r,s)=>dt.jsx("text",{transform:`translate(${dc+s*Qn+Qn/2} ${fc-6}) rotate(-55)`,fontSize:10.5,fill:"var(--dim)",textAnchor:"start",children:n(r)},r)),e.map((r,s)=>dt.jsxs("g",{children:[dt.jsx("text",{x:dc-8,y:fc+s*Qn+Qn/2+3.5,fontSize:11,fill:"var(--fg-2)",textAnchor:"end",children:n(r)}),e.map((c,d)=>dt.jsx(px,{x:dc+d*Qn,y:fc+s*Qn,edge:a.get(`${r} ${c}`),heaviest:l,diagonal:r===c,tip:`${n(r)} → ${n(c)}`},c))]},r))]})})}function fx(e,t){let n=Math.min(1,Math.log1p(e)/Math.log1p(t||1));if(n>0.8)return 5;if(n>0.6)return 4;if(n>0.4)return 3;if(n>0.2)return 2;return 1}function px({x:e,y:t,edge:n,heaviest:a,diagonal:l,tip:o}){let i={x:e,y:t,width:Qn-2,height:Qn-2,rx:2};if(!n)return dt.jsx("rect",{...i,fill:"var(--panel-2)",opacity:l?0.9:0.45});let r=`${n.sessions} session${n.sessions===1?"":"s"}`;return dt.jsx("rect",{...i,fill:`var(--acc-${fx(n.weight,a)})`,stroke:l?"var(--acc-fill)":void 0,strokeWidth:l?1:void 0,"data-tip":`${o} · ${n.weight.toLocaleString()}× · ${r}`})}var k=S(M(),1);function fy(){let e=T((h)=>h.project),t=T((h)=>h.graphTab),n=T((h)=>h.setGraphTab),a=T((h)=>h.openSession),[l,o]=pc.useState([]),i=te(t==="collisions"?`/v1/graphs/collisions${Ae({project:e})}`:null),r=te(t==="lineage"?`/v1/graphs/lineage${Ae({project:e})}${l.map((h)=>`&expand=${encodeURIComponent(h)}`).join("")}`:null),s=te(t==="tools"?`/v1/graphs/transitions${Ae({project:e})}`:null),c=te(t==="resources"?`/v1/graphs/resources${Ae({project:e})}`:null),d=[["collisions","Collisions",i.data?.contested??0],["lineage","Lineage",r.data?.edges.length??0],["tools","Tools",s.data?.loops.length??0],["resources","Resources",c.data?.totals.orphaned??0]];return k.jsxs(k.Fragment,{children:[k.jsx(C,{title:"Graphs",hint:mx[t]}),k.jsx("div",{className:"chips",children:d.map(([h,u,p])=>k.jsxs("button",{type:"button",className:t===h?"chip on":"chip",onClick:()=>n(h),children:[u,p>0&&k.jsxs("b",{children:[" ",p]})]},h))}),t==="collisions"&&k.jsx(hx,{graph:i.data,scoped:Boolean(e)}),t==="lineage"&&k.jsx(gx,{graph:r.data,scoped:Boolean(e),onOpenSession:a,onExpand:(h)=>o((u)=>u.includes(h)?u:[...u,h])}),t==="tools"&&k.jsx(vx,{graph:s.data,scoped:Boolean(e)}),t==="resources"&&k.jsx(bx,{graph:c.data,scoped:Boolean(e)})]})}var mx={collisions:"live file collisions",lineage:"session lineage",tools:"tool transitions",resources:"who holds what"};function hx({graph:e,scoped:t}){let n=pc.useMemo(()=>[...new Set((e?.sessions??[]).map((l)=>l.agent))].sort(Xn),[e]);if(!e)return k.jsx(ue,{});if(e.sessions.length===0)return k.jsxs(Y,{children:["No live sessions",t?" in this project":"",".",k.jsx("br",{}),"The collision graph shows who is touching what, the moment two agents run at once."]});if(e.files.length===0)return k.jsx(Y,{children:"No file touches recorded yet — the graph fills in as agents read and edit."});let a=e.sessions.map((l)=>({id:l.id,label:l.title??l.id.slice(0,8),agent:l.agent,files:l.files,writes:l.writes}));return k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"card card-pad",children:k.jsx(Ef,{holders:a,held:e.files})}),k.jsxs("div",{className:"graph-key",children:[k.jsx(al,{keys:n}),k.jsxs("span",{className:"dim",children:["solid edge = writing · faint edge = reading · ",k.jsx("span",{className:"bad",children:"red file"})," = two sessions on it, at least one writing"]})]})]})}function gx({graph:e,scoped:t,onOpenSession:n,onExpand:a}){if(!e)return k.jsx(ue,{});if(e.nodes.length===0)return k.jsxs(Y,{children:["No relationships between sessions",t?" in this project":""," in the last 14 days.",k.jsx("br",{}),"Edges appear when a session spawns a subagent, dispatches a run, messages another agent, or hands a task on."]});return k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"card card-scroll",children:k.jsx(uy,{graph:e,onOpenSession:n,onExpand:a})}),k.jsxs("div",{className:"graph-key",children:[ry.filter(([l])=>e.byKind[l]).map(([l,o])=>{let i=sc[l];return k.jsxs("span",{className:"edge-key",children:[k.jsx("svg",{width:22,height:8,"aria-hidden":"true",children:k.jsx("line",{x1:0,y1:4,x2:22,y2:4,stroke:i?.color,strokeWidth:2,strokeDasharray:i?.dash||void 0})}),k.jsxs("span",{className:"dim",children:[o," ",k.jsx("b",{children:e.byKind[l]})]})]},l)}),k.jsx("span",{className:"dim",children:"a green pill is a collapsed group — click to open it · ring = outcome · thicker dot = more links · a bowed edge closed a loop"})]})]})}function vx({graph:e,scoped:t}){if(!e)return k.jsx(ue,{});if(e.nodes.length===0)return k.jsxs(Y,{children:["No tool calls recorded",t?" in this project":""," in the last 7 days.",k.jsx("br",{}),"The matrix fills in as agents work — it counts what each tool call was followed by."]});let n=e.nodes.slice(0,18).map((o)=>o.tool),a=new Set(n),l=e.loops.slice(0,9);return k.jsxs("div",{className:"cols",children:[k.jsx(qe,{title:"What follows what",hint:"row ran, then column · darker = more often",children:k.jsx(dy,{tools:n,edges:e.edges.filter((o)=>a.has(o.from)&&a.has(o.to)),label:nc})}),k.jsx(qe,{title:"Round trips",hint:"a tool pair that keeps handing back",children:l.length>0?k.jsxs(k.Fragment,{children:[k.jsxs("table",{className:"mini",children:[k.jsxs("colgroup",{children:[k.jsx("col",{style:{width:"52%"}}),k.jsx("col",{style:{width:"26%"}}),k.jsx("col",{style:{width:"22%"}})]}),k.jsx("thead",{children:k.jsxs("tr",{children:[k.jsx("th",{children:"loop"}),k.jsx("th",{className:"num",children:"round trips"}),k.jsx("th",{className:"num",children:"sessions"})]})}),k.jsx("tbody",{children:l.map((o)=>k.jsxs("tr",{children:[k.jsxs("td",{className:"clip",children:[o.tools.map((i,r)=>k.jsxs("span",{children:[r>0&&k.jsx("span",{className:"dim",children:" → "}),k.jsx("span",{className:"br",children:nc(i)})]},i)),o.tools.length===1&&k.jsx("span",{className:"dim",children:" itself"})]}),k.jsx("td",{className:"num",children:k.jsx("b",{children:o.weight.toLocaleString()})}),k.jsx("td",{className:"num",children:o.sessions})]},o.tools.join(">")))})]}),k.jsxs("p",{className:"dim note",children:["A loop is ordinary work — ",k.jsx("code",{children:"Read → Edit"})," is what writing code looks like. It only counts as stuck when the calls inside it are ",k.jsx("em",{children:"failing"}),", which is what the"," ",k.jsx("b",{children:"Stuck"})," badge on Fleet judges."]})]}):k.jsx("div",{className:"dim",children:"No tool pair hands back to the other — every move is one-way."})})]})}function bx({graph:e,scoped:t}){if(!e)return k.jsx(ue,{});if(e.resources.length===0)return k.jsxs(Y,{children:["Nothing is held",t?" in this project":"",".",k.jsx("br",{}),"Claims, ports, leases and tracked processes appear here with whoever took them."]});let n=e.holders.map((o)=>({id:o.id,label:o.gone?`${o.id} (gone)`:o.id,agent:"claude-code",files:o.holds,writes:o.holds})),a=e.resources.map((o)=>({path:`${o.kind==="claim"?"":`${o.kind} `}${o.name}`,readers:o.wanted,writers:o.holder?[o.holder]:[],contested:o.wanted.length>0||o.orphaned})),l=e.resources.filter((o)=>o.orphaned);return k.jsxs(k.Fragment,{children:[e.contention.length>0&&k.jsxs("div",{className:"card err-card ring-card",children:[k.jsxs("b",{children:[e.contention.length," contention ring",e.contention.length===1?"":"s"]})," ","— each agent wants something the next one holds. Nothing is blocked (claims refuse rather than queue), but they are working against each other.",k.jsx("ul",{className:"ring-list",children:e.contention.map((o)=>k.jsxs("li",{children:[o.owners.map((i,r)=>k.jsxs("span",{children:[r>0&&k.jsx("span",{className:"dim",children:" wants what "}),k.jsx("span",{className:"br",children:i})]},i))," ",k.jsx("span",{className:"dim",children:"holds — via"})," ",o.resources.map((i)=>k.jsx("code",{children:i},i))]},o.owners.join(">")))})]}),k.jsx("div",{className:"card card-pad",children:k.jsx(Ef,{holders:n,held:a})}),k.jsx("div",{className:"graph-key",children:k.jsxs("span",{className:"dim",children:["solid edge = holds · faint edge = was refused it · ",k.jsx("span",{className:"bad",children:"red"})," = orphaned or contested"]})}),l.length>0&&k.jsx(qe,{title:"Orphaned",hint:"the session that took it has ended",children:k.jsx("ul",{className:"plainlist",children:l.map((o)=>k.jsxs("li",{children:[k.jsx(N,{children:o.kind}),k.jsx("b",{children:o.name}),k.jsxs("span",{className:"dim",children:["held by ",o.holder??"nobody"]})]},`${o.kind}:${o.name}`))})})]})}var Sy=S(B(),1);var Nf=S(B(),1);var il=S(M(),1);function py({pid:e,projectId:t,onDone:n}){let[a,l]=Nf.useState(!1);return il.jsx("button",{type:"button",className:"mini-act",title:"Stop this process",disabled:a,onClick:async()=>{if(!confirm(`Stop pid ${e}?`))return;l(!0);let o=await ec(e,t);if(l(!1),!o.ok&&o.error)alert(o.error);n()},children:a?"stopping…":"Stop"})}function my({worktree:e,onDone:t}){let[n,a]=Nf.useState(null),l=e.buildKb??0,o=!e.main&&!e.heldByClaim&&e.liveSessions===0&&l>0,i=async()=>{a("clearing…");let s=await hb(e.path);a(s.ok?`freed ${Rn(s.freedKb??0)}`:s.error??"failed"),setTimeout(()=>{a(null),t()},1600)},r=async()=>{if(!confirm(`Remove worktree ${e.path}?`))return;let s=await Bo(e.projectId,e.path);if(!s.ok&&(s.refused==="dirty"||s.refused==="unpushed")){if(confirm(`${s.error}
15
+ Work only inside this worktree. When done: commit, push, then call swarm_handoff with what was done and what remains, and record the required gates with swarm_gate_record.`:""),[c,u]=Cc.useState(!1),[d,m]=Cc.useState(null),f=async()=>{if(!s.trim()){m("A prompt is required.");return}u(!0),m(null),localStorage.setItem(CI,JSON.stringify(n));let b=await PY(HY(e,t.id,s,n));if(b.kind==="started"){a(b.sessionId);return}m(b.error),u(!1)},p=(b)=>r((v)=>({...v,...b}));return nt.jsxs(Ea,{title:"Run",glyph:"play",subtitle:t.title?`${t.id} — ${t.title}`:t.id,onClose:o,footer:nt.jsxs(nt.Fragment,{children:[nt.jsx("button",{type:"button",onClick:o,children:"Cancel"}),nt.jsxs("button",{type:"button",className:"primary",disabled:c,onClick:()=>void f(),children:[z("play",13)," ",c?"starting…":"Run"]})]}),children:[nt.jsxs("label",{children:["prompt",nt.jsx("textarea",{spellCheck:!1,value:s,onChange:(b)=>l(b.target.value),onKeyDown:(b)=>{if(b.key==="Enter"&&(b.metaKey||b.ctrlKey))f()}})]}),nt.jsxs("div",{className:"row",children:[nt.jsxs("label",{children:["permission mode",nt.jsx("select",{value:n.mode,onChange:(b)=>p({mode:b.target.value}),children:LY.map((b)=>nt.jsx("option",{value:b,children:b},b))})]}),nt.jsxs("label",{children:["model",nt.jsx("input",{placeholder:"default",value:n.model,onChange:(b)=>p({model:b.target.value})})]}),nt.jsxs("label",{children:["max turns",nt.jsx("input",{type:"number",min:1,placeholder:"∞",value:n.turns,onChange:(b)=>p({turns:b.target.value})})]})]}),nt.jsxs("label",{title:"full: every tool · no-edits: commands but no file edits · read-only: read and search only",children:["profile",nt.jsx("select",{value:n.profile,onChange:(b)=>p({profile:b.target.value}),children:RY.map((b)=>nt.jsx("option",{value:b,children:b},b))})]}),d&&nt.jsx("div",{className:"pk-err",children:d}),nt.jsxs("div",{className:"dim note",children:["Claims ",nt.jsx("b",{children:t.id})," (or reuses your held worktree) and spawns ",nt.jsx("code",{children:"claude -p"})," ","there. The session appears in Fleet; steer it from its page."]})]})}var Y=x(T(),1);function zY({task:e}){if(e.claimedBy)return Y.jsxs(H,{tone:"ok",children:["Held · ",e.claimedBy]});if(e.status==="done")return Y.jsx(H,{children:"Done"});if(e.status==="active")return Y.jsx(H,{tone:"acc",children:"In progress"});return e.ready?Y.jsx(H,{tone:"ok",children:"Ready"}):Y.jsx(H,{children:"Blocked"})}var UY=[["ready","Ready"],["held","In progress"],["blocked","Blocked"],["done","Done"]],FY=6;function _Y(e){if(e.claimedBy)return"held";if(e.status==="done")return"done";if(e.ready)return"ready";return e.status==="active"?"held":"blocked"}function jY({tasks:e,onMenu:t}){let o={ready:[],held:[],blocked:[],done:[]};for(let a of e)o[_Y(a)].push(a);return o.done.reverse(),Y.jsx("div",{className:"kanban",children:UY.map(([a,n])=>{let r=o[a],s=a==="done"?r.slice(0,FY):r;return Y.jsxs("div",{className:`lane ${a}`,children:[Y.jsxs("div",{className:"lane-h",children:[n," ",Y.jsx("span",{children:r.length})]}),s.length===0&&Y.jsx("div",{className:"lane-empty",children:"—"}),s.map((l)=>Y.jsxs("button",{type:"button",className:`tcard ${a}`,title:l.statusText,onClick:(c)=>t(c.currentTarget,l),children:[Y.jsxs("div",{className:"tc-h",children:[Y.jsx("b",{children:l.id}),l.claimedBy&&Y.jsx(H,{tone:"ok",children:l.claimedBy}),l.depends.length>0&&a==="blocked"&&Y.jsxs("span",{className:"dim",children:["← ",l.depends.join(" ")]})]}),Y.jsx("div",{className:"tc-t",children:l.title}),l.milestone&&Y.jsx("div",{className:"tc-m",children:l.milestone.split(" — ")[0]})]},l.id)),r.length>s.length&&Y.jsxs("div",{className:"lane-more dim",children:["+",r.length-s.length," more in the table"]})]},a)})})}function GY(e){if(e.claimedBy)return 0;if(e.ready)return 1;if(e.status==="active")return 2;return e.status==="done"?4:3}var VY=[{key:"id",label:"id",width:70,get:(e)=>e.id,cell:(e)=>Y.jsx("b",{children:e.id})},{key:"title",label:"task",flex:!0,get:(e)=>e.title,cell:(e)=>Y.jsx("span",{className:"now",title:e.statusText,children:e.title})},{key:"milestone",label:"milestone",width:160,get:(e)=>e.milestone??"",cell:(e)=>Y.jsx("span",{className:"dim now",children:(e.milestone??"").split(" — ")[0]})},{key:"depends",label:"depends",width:130,get:(e)=>e.depends.join(" "),cell:(e)=>Y.jsx("span",{className:"br",children:e.depends.join(" ")||"—"})},{key:"state",label:"state",width:150,get:GY,cell:(e)=>Y.jsx(zY,{task:e})}];function DI({source:e,tasks:t,loading:o=!1,error:a=null,projectId:n,onOpenSession:r}){let[s,l]=vg.useState("ready"),c=B((S)=>S.boardTasks),u=B((S)=>S.setBoardTasks),[d,m]=vg.useState(null);if(!e)return null;if(t.length===0)return Y.jsx(F,{title:"Tasks",hint:e,children:Y.jsx(ee,{children:a?Y.jsxs(Y.Fragment,{children:[Y.jsxs("b",{children:["Could not read tasks from ",e,"."]}),Y.jsx("br",{}),a]}):o?Y.jsxs(Y.Fragment,{children:["Fetching tasks from ",e,"…"]}):Y.jsxs(Y.Fragment,{children:["No tasks in ",e,"."]})})});let f=t.filter((S)=>S.ready),p=t.filter((S)=>S.status!=="done"),b=s==="ready"?f:s==="open"?p:t,v=[["ready","Ready",f.length],["open","Open",p.length],["all","All",t.length]];return Y.jsxs(F,{title:"Tasks",hint:e,children:[Y.jsxs("div",{className:"chips",children:[c==="table"&&v.map(([S,h,g])=>Y.jsxs("button",{type:"button",className:s===S?"chip on":"chip",onClick:()=>l(S),children:[h," ",Y.jsx("b",{children:g})]},S)),Y.jsx("span",{className:"grow"}),Y.jsxs("span",{className:"seg",children:[Y.jsx("button",{type:"button",className:c==="cards"?"on":"",onClick:()=>u("cards"),children:"Cards"}),Y.jsx("button",{type:"button",className:c==="table"?"on":"",onClick:()=>u("table"),children:"Table"})]})]}),c==="cards"?Y.jsx(jY,{tasks:t,onMenu:(S,h)=>kI(S,h,n,m)}):Y.jsx(ke,{id:"tasks",columns:VY,rows:b,rowKey:(S)=>S.id,trailing:{width:34,cell:(S)=>Y.jsx(Fo,{title:"Task actions",onOpen:(h)=>kI(h,S,n,m)})}}),d&&Y.jsx(MI,{projectId:n,task:{id:d.id,title:d.title},onClose:()=>m(null),onStarted:(S)=>{m(null),r(S)}})]})}function kI(e,t,o,a){let n=(s)=>()=>void Zt(s),r=t.ready||t.claimedBy?[{label:t.claimedBy?"Run in worktree":"Run",icon:"play",...t.claimedBy?{}:{caption:"claim + claude -p"},run:()=>a(t)},...t.ready?[{label:"Claim",icon:"folders",caption:"fresh worktree",run:async()=>{let s=await cI(o,t.id);if(!s.ok&&s.error)alert(s.error)}}]:[{label:"Run gates",icon:"check",run:async()=>{let s=await uI(o,t.id),l=(s.runs??[]).map((c)=>`${c.verdict==="pass"?"✓":"✗"} ${c.gate} — ${c.rubric}`).join(`
16
+ `);alert(l||s.error||s.skipped?.[0]?.reason||"nothing ran")}}]]:[{label:t.status==="done"?"Done":"Blocked",disabled:!0}];bo(e,[...r,{label:"",divider:!0},us("Copy"),{label:"Task id",icon:"copy",caption:t.id,run:n(t.id)},{label:"Title",icon:"file-text",run:n(`${t.id} — ${t.title}`)}],{title:t.id})}var Mc=x(R(),1);function TI(e){let t=q((p)=>p?.projects??Sg),o=q((p)=>p?.sessions??Sg),a=q((p)=>p?.claims??Sg),n=q((p)=>p?.worktrees??KY),r=q((p)=>p?.openIncidents??0),s=q((p)=>p?.openIncidentsByProject??qY),l=Mc.useMemo(()=>{let p=new Map(t.map((b)=>[b.id,b.name]));return(b)=>p.get(b)??"(removed)"},[t]),c=Mc.useMemo(()=>(p)=>!e||p===e,[e]),u=Mc.useMemo(()=>(e?[e]:t.map((b)=>b.id)).flatMap((b)=>(n[b]??[]).map((v)=>({...v,projectId:b}))),[e,t,n]),d=Mc.useMemo(()=>{let p=new Map(u.map((b)=>[b.path,[]]));for(let b of o){if(b.state==="ended")continue;for(let v of p.keys())if(b.cwd===v||b.cwd.startsWith(`${v}/`))p.get(v)?.push(b)}return p},[u,o]),m=o.filter((p)=>c(p.projectId)&&(p.state==="active"||p.state==="waiting")),f=a.filter((p)=>p.state!=="released"&&c(p.projectId));return{worktrees:u,sessionsInside:d,live:m,waiting:m.filter((p)=>p.state==="waiting").length,heldClaims:f,orphaned:f.filter((p)=>p.state==="orphaned").length,dirty:u.filter((p)=>p.dirty>0).length,merged:u.filter((p)=>!p.main&&p.merged).length,openIncidents:e?s[e]??0:r,projectCount:e?1:t.length,projectName:l,inScope:c}}var Sg=[],KY={},qY={};var X=x(T(),1);function $Y({worktree:e}){if(e.main)return null;if(e.merged)return X.jsx("span",{title:"This branch is already in the main checkout's branch",children:X.jsx(H,{children:"Merged"})});if(e.behind>0)return X.jsx("span",{title:"Commits on the main checkout's branch this worktree lacks",children:X.jsxs(H,{tone:"warn",children:[e.behind," behind"]})});return e.behind===0?X.jsx(H,{children:"Up to date"}):X.jsx(Z,{})}var WY=({projectName:e,sessionsInside:t,onOpenSession:o})=>[{key:"project",label:"project",width:104,get:(a)=>e(a.projectId),cell:(a)=>e(a.projectId)},{key:"branch",label:"branch",width:240,get:(a)=>a.branch??"",cell:(a)=>X.jsxs(X.Fragment,{children:[X.jsx("span",{className:"br",children:a.branch??"(detached)"}),a.main&&X.jsx(H,{children:"Main tree"})]})},{key:"head",label:"head",width:90,get:(a)=>a.head,cell:(a)=>X.jsx("span",{className:"br",children:a.head})},{key:"path",label:"path",flex:!0,get:(a)=>a.path,cell:(a)=>X.jsx("span",{className:"now",title:a.path,children:Qe(a.path)})},{key:"state",label:"state",width:170,get:(a)=>a.dirty*1000+a.ahead,cell:(a)=>X.jsxs(X.Fragment,{children:[a.dirty>0&&X.jsxs(H,{tone:"warn",children:[a.dirty," Dirty"]}),a.ahead>0&&X.jsxs(H,{tone:"acc",children:[a.ahead," Unpushed"]}),a.dirty===0&&a.ahead<=0&&X.jsx(H,{children:"Clean"})]})},{key:"drift",label:"drift",width:120,get:(a)=>a.main?-1:a.behind,cell:(a)=>X.jsx($Y,{worktree:a})},{key:"sessions",label:"sessions",width:160,get:(a)=>t.get(a.path)?.length??0,cell:(a)=>{let n=t.get(a.path)??[];if(n.length===0)return X.jsx(Z,{});return n.map((r)=>X.jsx("button",{type:"button",className:"link",onClick:()=>o(r.id),children:r.title??r.id.slice(0,8)},r.id))}}],AI={live:0,dirty:1,ahead:2,clean:3,merged:4};function yg(e,t){if(t>0)return"live";if(e.dirty>0)return"dirty";if(e.ahead>0)return"ahead";return e.merged?"merged":"clean"}function ZY(e){if(e.main)return"main tree";if(e.merged)return"merged";if(e.behind>0)return`${e.behind} behind`;return e.behind===0?"up to date":""}function YY({worktree:e,inside:t,held:o,menu:a}){let n=yg(e,t.length);return X.jsxs("button",{type:"button",className:`wt ${n}${e.main?" main":""}${o?" held":""}`,title:e.path,onClick:(r)=>bg(r.currentTarget,e,{held:o!==void 0,sessions:t},a),children:[X.jsxs("div",{className:"wt-b",children:[X.jsx("span",{className:`s ${t.length?"active":e.dirty>0?"waiting":"ended"}`}),X.jsx("span",{className:"br",children:e.branch??"(detached)"})]}),X.jsxs("div",{className:"wt-m",children:[ZY(e),e.dirty>0&&X.jsxs(X.Fragment,{children:[" · ",X.jsxs("i",{className:"warn",children:[e.dirty," dirty"]})]}),e.ahead>0&&X.jsxs(X.Fragment,{children:[" · ",X.jsxs("i",{className:"acc",children:[e.ahead," unpushed"]})]}),o&&` · held: ${o}`,t.length>0&&` · ${t.map((r)=>r.title??r.id.slice(0,8)).join(", ")}`]})]})}function XY({worktrees:e,menu:t,heldBy:o,projectName:a,sessionsInside:n}){let r=new Map;for(let s of e){let l=r.get(s.projectId);if(l)l.push(s);else r.set(s.projectId,[s])}return X.jsx("div",{className:"wtmap",children:[...r].map(([s,l])=>X.jsxs("div",{className:"wt-group",children:[X.jsxs("div",{className:"wt-proj",children:[a(s)," ",X.jsx("span",{children:l.length})]}),X.jsx("div",{className:"wt-tiles",children:l.slice().sort((c,u)=>Number(u.main)-Number(c.main)||AI[yg(c,n.get(c.path)?.length??0)]-AI[yg(u,n.get(u.path)?.length??0)]).map((c)=>X.jsx(YY,{worktree:c,inside:n.get(c.path)??[],held:o.get(c.path),menu:t},c.path))})]},s))})}function EI({worktrees:e,showProject:t,menu:o,heldPaths:a,heldBy:n=QY,...r}){let s=B((d)=>d.boardWorktrees),l=B((d)=>d.setBoardWorktrees);if(e.length===0)return null;let c=WY(r).filter((d)=>t||d.key!=="project"),u=X.jsxs("span",{className:"seg",children:[X.jsx("button",{type:"button",className:s==="map"?"on":"",onClick:()=>l("map"),children:"Map"}),X.jsx("button",{type:"button",className:s==="table"?"on":"",onClick:()=>l("table"),children:"Table"})]});return X.jsx(F,{title:"Worktrees",hint:String(e.length),actions:u,spaced:!0,children:s==="map"?X.jsx(XY,{worktrees:e,menu:o,heldBy:n,projectName:r.projectName,sessionsInside:r.sessionsInside}):X.jsx(ke,{id:"worktrees",columns:c,rows:e,rowKey:(d)=>d.path,leading:{width:24,cell:(d)=>{let m=(r.sessionsInside.get(d.path)?.length??0)>0;return X.jsx("span",{className:`s ${m?"active":d.dirty>0?"waiting":"ended"}`})}},trailing:{width:34,cell:(d)=>X.jsx(Fo,{title:"Worktree actions",onOpen:(m)=>bg(m,d,{held:a?.has(d.path)??!1,sessions:r.sessionsInside.get(d.path)??[]},o)})}})})}var QY=new Map;var _o=x(T(),1);function NI(){let e=B((v)=>v.project),t=B((v)=>v.openSession),o=TI(e),a=q((v)=>v?.processes??OI),n=q((v)=>v?.resources??OI),[r,s]=ms.useState(null),l=ms.useCallback((v,S)=>s({projectId:v,worktree:S}),[]),c=Ir(void 0,l),u=ms.useMemo(()=>new Set(o.heldClaims.filter((v)=>v.state==="held").map((v)=>v.worktree)),[o.heldClaims]),d=ms.useMemo(()=>new Map(o.heldClaims.filter((v)=>v.state==="held").map((v)=>[v.worktree,v.task])),[o.heldClaims]),{data:m}=ie(e?`/v1/tasks${ze({project:e})}`:null),f=m?.tasks??[];if(o.live.length===0&&o.heldClaims.length===0&&o.worktrees.length===0&&o.openIncidents===0&&f.length===0)return _o.jsxs(ee,{children:["Nothing on the board.",_o.jsx("br",{}),"Tasks, processes, claims, worktrees, and incidents appear here."]});let b=!e;return _o.jsxs(_o.Fragment,{children:[_o.jsx(Jw,{data:o,tasks:m?.source?{ready:f.filter((v)=>v.ready).length,open:f.filter((v)=>v.status!=="done").length}:null}),e&&_o.jsx(DI,{source:m?.source??null,tasks:f,loading:m?.loading??!1,error:m?.error??null,projectId:e,onOpenSession:t}),_o.jsx(II,{processes:a.filter((v)=>o.inScope(v.projectId)),projectName:o.projectName,showProject:b,menu:c}),_o.jsx(xI,{resources:n.filter((v)=>o.inScope(v.projectId)),projectName:o.projectName,showProject:b,menu:c}),_o.jsx(wI,{claims:o.heldClaims,orphaned:o.orphaned,projectName:o.projectName,showProject:b,menu:c}),_o.jsx(EI,{worktrees:o.worktrees,sessionsInside:o.sessionsInside,projectName:o.projectName,onOpenSession:t,showProject:b,menu:c,heldPaths:u,heldBy:d}),r&&_o.jsx(Kd,{projectId:r.projectId,worktree:r.worktree,onClose:()=>s(null)})]})}var OI=[];var LI=x(R(),1);var Ba=(e,t)=>`${e}${ze({project:t})}`,Fe={fsList:(e)=>`/v1/fs/ls${ze({path:e})}`,outcomes:(e)=>Ba("/v1/outcomes",e),hygiene:(e)=>Ba("/v1/hygiene",e),gateHealth:(e)=>Ba("/v1/gates/health",e),mcpHealth:(e)=>Ba("/v1/mcp/health",e),context:(e)=>Ba("/v1/context",e),heat:(e)=>Ba("/v1/heat",e),security:(e)=>Ba("/v1/security",e),provenance:(e)=>Ba("/v1/provenance",e),ruleEffect:(e)=>Ba("/v1/rules/effect",e),prs:()=>"/v1/prs",incidents:(e,t)=>`/v1/incidents${ze({project:e,limit:500,open:t?1:null})}`,trials:(e)=>Ba("/v1/ab",e),stats:(e)=>Ba("/v1/stats",e)};var Mr=x(T(),1);function Gi({bars:e,color:t="var(--acc-fill)"}){let o=Math.max(1,...e.map((a)=>a.value));return Mr.jsx("div",{className:"hbars",children:e.map((a)=>Mr.jsxs("div",{className:"hb",title:a.detail===void 0?a.label:`${a.label} — ${a.detail}`,children:[Mr.jsx("span",{className:"k",children:a.label}),Mr.jsx("span",{className:"t",children:Mr.jsx("i",{style:{width:`${100*a.value/o}%`,background:t}})}),Mr.jsx("span",{className:"n",children:a.detail??a.value})]},a.label))})}var fs=x(T(),1);function ut({title:e,hint:t,children:o}){return fs.jsxs("div",{className:"chart-card flush",children:[fs.jsxs("h3",{children:[e,t!==void 0&&fs.jsx("span",{children:t})]}),o]})}function kr({children:e}){return fs.jsx("div",{className:"cols",children:e})}function $d({children:e}){return fs.jsx("div",{className:"stack",children:e})}var te=x(T(),1);function Dr(e){if(e>=1e6)return`${(e/1e6).toFixed(1)}M`;if(e>=1000)return`${Math.round(e/1000)}k`;return String(e)}function Wd(e){let t=/^mcp__([^_]+(?:_[^_]+)*?)__(.+)$/.exec(e);if(!t)return e;let o=(t[1]??"").replace(/[-_]/g," ").split(" ").map((a)=>a[0]).join("").toLowerCase();return`${t[2]} · ${o}`}function RI(){let e=B((u)=>u.project),t=B((u)=>u.openSession),{data:o,error:a,reload:n}=ie(Fe.context(e)),r=q((u)=>u?.sessions??JY),s=LI.useMemo(()=>{let u=new Map(r.map((d)=>[d.id,d.title]));return(d)=>u.get(d)??null},[r]);if(a&&!o)return te.jsx(Ke,{error:a,onRetry:n});if(!o)return te.jsx(Me,{});let l=o.totals;if(!l.sessions)return te.jsx(F,{title:"Context",hint:"where the window goes",children:te.jsxs(ee,{children:["No tool results in the last 7 days",e?" in this project":"","."]})});let c=o.sessions.filter((u)=>u.wastedChars>0).slice(0,10);return te.jsxs(te.Fragment,{children:[te.jsx(F,{title:"Context",hint:`last 7 days · ${Dr(l.toolChars)} characters returned by tools`}),te.jsxs($t,{children:[te.jsx(K,{label:"Returned by tools",value:Dr(l.toolChars),detail:`characters · ≈${Dr(l.toolTokens)} tokens`}),te.jsx(K,{label:"Spent re-reading",value:Dr(l.wastedChars),detail:l.wasteShare?`${Math.round(l.wasteShare*100)}% of it · ${l.rereadFiles} file${l.rereadFiles===1?"":"s"}`:"nothing re-read",tone:l.wasteShare>0.1?"hot":l.wasteShare>0.03?"warm":void 0}),te.jsx(K,{label:"Cache hit",value:`${Math.round(l.cacheHit*100)}%`,detail:"of the window came back free"}),te.jsx(K,{label:"Sessions",value:l.sessions,detail:"with tool activity"})]}),te.jsxs(kr,{children:[te.jsx(ut,{title:"What fills the window",hint:"by tool · characters returned",children:te.jsx(Gi,{bars:o.byTool.map((u)=>({label:Wd(u.tool),value:u.chars,detail:`${Dr(u.chars)} · ${u.calls}`}))})}),te.jsx(ut,{title:"Re-read waste",hint:"the same file, read again",children:c.length>0?te.jsxs("table",{className:"mini",children:[te.jsxs("colgroup",{children:[te.jsx("col",{style:{width:"31%"}}),te.jsx("col",{style:{width:"15%"}}),te.jsx("col",{style:{width:"14%"}}),te.jsx("col",{style:{width:"11%"}}),te.jsx("col",{style:{width:"29%"}})]}),te.jsx("thead",{children:te.jsxs("tr",{children:[te.jsx("th",{children:"session"}),te.jsx("th",{className:"num",children:"returned"}),te.jsx("th",{className:"num",children:"wasted"}),te.jsx("th",{className:"num",children:"share"}),te.jsx("th",{children:"worst files"})]})}),te.jsx("tbody",{children:c.map((u)=>te.jsxs("tr",{onClick:()=>t(u.sessionId),className:"clickable",children:[te.jsx("td",{children:s(u.sessionId)??u.sessionId.slice(0,8)}),te.jsx("td",{className:"num",children:Dr(u.toolChars)}),te.jsx("td",{className:"num",children:te.jsx("b",{children:Dr(u.wastedChars)})}),te.jsxs("td",{className:"num",children:[Math.round(u.wasteShare*100),"%"]}),te.jsx("td",{className:"clip",children:u.worst.slice(0,2).map((d)=>te.jsxs("span",{className:"br",title:`${d.path} — read ${d.reads}× · ${Dr(d.wastedChars)} chars re-read`,children:[d.path.split("/").at(-1)," ",te.jsxs("b",{children:[d.reads,"×"]})]},d.path))})]},u.sessionId))})]}):te.jsx("div",{className:"dim",children:"Nothing was read twice — no waste to report."})})]}),te.jsxs("p",{className:"dim note",children:["Character counts are exact — every tool response is stored. Token figures are a flat 4:1 estimate. ",te.jsx("b",{children:"MCP tool schemas and the system prompt are not included"}),": Swarm sees tool calls, never the schemas or the prompt preamble, so they are left out rather than guessed at."]})]})}var JY=[];var hs=x(R(),1);function wg(e){let t=Qe(e);return t.split("/").pop()||t}function Zd(e,t=2){let o=Qe(e).split("/");if(o.pop(),o.length<=t)return o.join("/");return`…/${o.slice(-t).join("/")}`}function Yd(e){let t=new Map;for(let o of e){let a=2,n=(r,s)=>`${wg(r)}|${Zd(r,s)}`;while(a<6&&e.some((r)=>r!==o&&n(r,a)===n(o,a)))a++;t.set(o,Zd(o,a))}return t}var ps=x(T(),1);function Xd({path:e,hint:t}){return ps.jsxs(ps.Fragment,{children:[ps.jsx("b",{children:wg(e)})," ",ps.jsx("span",{className:"dim",children:t??Zd(e)})]})}var U=x(T(),1);function BI(){let e=B((f)=>f.project),{data:t,error:o,reload:a}=ie(Fe.heat(e)),n=hs.useMemo(()=>t?.files.slice(0,14)??[],[t]),r=hs.useMemo(()=>t?.dirs.slice(0,10)??[],[t]),s=hs.useMemo(()=>t?.candidates.slice(0,10)??[],[t]),l=hs.useMemo(()=>Yd(n.map((f)=>f.path)),[n]),c=hs.useMemo(()=>Yd(r.map((f)=>f.dir)),[r]),u=hs.useMemo(()=>Yd(s.map((f)=>f.path)),[s]);if(o&&!t)return U.jsx(Ke,{error:o,onRetry:a});if(!t)return U.jsx(Me,{});if(t.files.length===0)return U.jsx(F,{title:"Files",hint:"file-touch heat",children:U.jsxs(ee,{children:["No file was touched more than once",e?" in this project":""," in the last 14 days."]})});let d=t.totals,m=r[0]?.touches||1;return U.jsxs(U.Fragment,{children:[U.jsx(F,{title:"Files",hint:`${d.files.toLocaleString()} files · ${d.touches.toLocaleString()} touches · ${d.sessions} sessions · last 14 days`}),U.jsxs($t,{children:[U.jsx(K,{label:"Files touched",value:d.files.toLocaleString(),detail:`${d.touches.toLocaleString()} touches · last 14 days`}),U.jsx(K,{label:"Re-reads",value:d.rereads.toLocaleString(),detail:d.touches?`${Math.round(d.rereads/d.touches*100)}% of every touch`:"none"}),U.jsx(K,{label:"Touched once",value:d.cold.toLocaleString(),detail:"cold — read and never returned to"}),U.jsx(K,{label:"CLAUDE.md candidates",value:t.candidates.length,detail:t.candidates.length?"re-read by several sessions":"nothing worth writing down",tone:t.candidates.length?"warm":void 0})]}),U.jsxs(kr,{children:[U.jsx(ut,{title:"Hottest files",hint:"every touch, across sessions",children:U.jsxs("table",{className:"mini",children:[U.jsxs("colgroup",{children:[U.jsx("col",{style:{width:"46%"}}),U.jsx("col",{style:{width:"15%"}}),U.jsx("col",{style:{width:"13%"}}),U.jsx("col",{style:{width:"13%"}}),U.jsx("col",{style:{width:"13%"}})]}),U.jsx("thead",{children:U.jsxs("tr",{children:[U.jsx("th",{children:"path"}),U.jsx("th",{className:"num",children:"touches"}),U.jsx("th",{className:"num",children:"sessions"}),U.jsx("th",{className:"num",children:"re-reads"}),U.jsx("th",{className:"num",children:"writes"})]})}),U.jsx("tbody",{children:n.map((f)=>U.jsxs("tr",{children:[U.jsx("td",{className:"clip path",title:Qe(f.path),children:U.jsx(Xd,{path:f.path,hint:l.get(f.path)})}),U.jsx("td",{className:"num",children:U.jsx("b",{children:f.touches.toLocaleString()})}),U.jsx("td",{className:"num",children:f.sessions}),U.jsx("td",{className:"num",children:f.rereads.toLocaleString()}),U.jsx("td",{className:"num",children:f.writes.toLocaleString()})]},f.path))})]})}),U.jsxs($d,{children:[U.jsx(ut,{title:"Worth writing down",hint:"read again and again, rarely written",children:s.length>0?U.jsxs(U.Fragment,{children:[U.jsxs("table",{className:"mini",children:[U.jsxs("colgroup",{children:[U.jsx("col",{style:{width:"58%"}}),U.jsx("col",{style:{width:"22%"}}),U.jsx("col",{style:{width:"20%"}})]}),U.jsx("thead",{children:U.jsxs("tr",{children:[U.jsx("th",{children:"path"}),U.jsx("th",{className:"num",children:"re-reads"}),U.jsx("th",{className:"num",children:"sessions"})]})}),U.jsx("tbody",{children:s.map((f)=>U.jsxs("tr",{children:[U.jsx("td",{className:"clip path",title:Qe(f.path),children:U.jsx(Xd,{path:f.path,hint:u.get(f.path)})}),U.jsx("td",{className:"num",children:U.jsx("b",{children:f.rereads.toLocaleString()})}),U.jsx("td",{className:"num",children:f.sessions})]},f.path))})]}),U.jsxs("p",{className:"dim note",children:["Several sessions keep reading these and rarely change them — the conclusion is being re-derived every time. Put it in ",U.jsx("code",{children:"CLAUDE.md"})," once instead."]})]}):U.jsx("div",{className:"dim",children:"Nothing here is worth extracting. Every file several sessions re-read is also one they edit — that is where the work is, not a reference being re-learned."})}),U.jsx(ut,{title:"By directory",hint:"where the work sits",children:U.jsx("ul",{className:"heatlist",children:r.map((f)=>U.jsxs("li",{children:[U.jsx("span",{className:"bar",style:{"--w":`${Math.max(2,Math.round(f.touches/m*100))}%`}}),U.jsx("span",{className:"clip path",title:Qe(f.dir),children:U.jsx(Xd,{path:f.dir,hint:c.get(f.dir)})}),U.jsx("b",{children:f.touches.toLocaleString()}),U.jsxs("span",{className:"dim",children:[f.files," file",f.files===1?"":"s"," · ",f.sessions," session",f.sessions===1?"":"s"]})]},f.dir))})})]})]}),U.jsxs("p",{className:"dim note",children:[U.jsx("b",{children:"Incidents are not correlated here."})," An incident records the rule, the action and the command — not a path — so tying a rule that fired on a shell command to a file would mean parsing paths out of command strings and guessing."]})]})}var zn=x(R(),1);var Qd={"claude-code":1,codex:2,gemini:3,grok:4,aider:5,cline:6,opencode:7},eX={"claude-code":"Claude",codex:"Codex",gemini:"Gemini",grok:"Grok",aider:"Aider",cline:"Cline",opencode:"opencode"};function ro(e){return`var(--c${Qd[e]??0})`}function St(e){return eX[e]??e}var xre=Object.keys(Qd);function nn(e,t){return(Qd[e]??99)-(Qd[t]??99)}var HI=x(T(),1);function Vi({agent:e}){if(!e)return null;let t=ro(e);return HI.jsx("span",{className:"badge agent",style:{color:t,background:`color-mix(in srgb, ${t} 14%, transparent)`},children:St(e)})}var kc=x(T(),1);function Ki({project:e,size:t=14,large:o=!1}){let a=["pg"];if(o)a.push("pg-lg");if(e.color)a.push(`pg-${e.color}`);let n=a.join(" ");if(!e.icon)return kc.jsx("span",{className:n,children:z("folder-simple",t)});if(e.icon.startsWith("data:image/"))return kc.jsx("span",{className:n,children:kc.jsx("img",{className:"pg-img",src:e.icon,alt:""})});return kc.jsx("span",{className:n,children:e.icon})}var PI=x(R(),1),Tr=x(T(),1),Ig=88,tX=20,oX=18,aX=16;function qi({points:e,color:t="var(--acc-fill)",className:o="spark"}){let a=PI.useMemo(()=>{if(e.length<2)return null;let n=Math.max(0.000000001,...e),r=Ig/(e.length-1),s=(c)=>oX-c/n*aX;return{d:e.map((c,u)=>`${u?"L":"M"}${(u*r).toFixed(1)},${s(c).toFixed(1)}`).join(""),lastY:s(e[e.length-1]??0)}},[e]);return Tr.jsx("svg",{viewBox:`0 0 ${Ig} ${tX}`,className:o,preserveAspectRatio:"none","aria-hidden":"true",children:a&&Tr.jsxs(Tr.Fragment,{children:[Tr.jsx("path",{d:a.d,stroke:t}),Tr.jsx("circle",{cx:Ig,cy:a.lastY.toFixed(1),r:2,fill:t})]})})}var he=x(T(),1),nX=(e)=>e.state==="active"||e.state==="waiting",rX=(e)=>z(e.kind==="subagent"?"tree-structure":e.kind==="spawned"?"play":"keyboard",13,"kind");function UI(){let e=B((h)=>h.project),t=B((h)=>h.openSession),o=q((h)=>h?.sessions??iX),a=q((h)=>h?.projects??cX),n=q((h)=>h?.questions??lX),r=zn.useMemo(()=>new Set(n.map((h)=>h.sessionId).filter((h)=>Boolean(h))),[n]),[s,l]=zn.useState(null),c=Ir(),u=zn.useMemo(()=>o.filter((h)=>!e||h.projectId===e),[o,e]),d=zn.useMemo(()=>{let h=new Map;for(let g of u)h.set(g.agent,(h.get(g.agent)??0)+1);return h},[u]),{live:m,earlier:f}=zn.useMemo(()=>{let h=[],g=[];for(let y of u){if(s&&y.agent!==s)continue;(nX(y)?h:g).push(y)}return{live:h,earlier:g}},[u,s]),p=zn.useMemo(()=>{let h=new Map(a.map((g)=>[g.id,g]));return(g)=>h.get(g)},[a]),b=zn.useMemo(()=>{let h=[{key:"project",label:"project",width:112,get:(g)=>p(g.projectId)?.name??"",cell:(g)=>{let y=p(g.projectId);if(!y)return he.jsx("span",{className:"dim",children:"(removed)"});return he.jsxs(he.Fragment,{children:[he.jsx(Ki,{project:y,size:12})," ",y.name]})}},{key:"agent",label:"agent",width:78,cls:"td-badge",get:(g)=>St(g.agent),cell:(g)=>he.jsx(Vi,{agent:g.agent})},{key:"session",label:"session",width:210,get:(g)=>g.title??g.id,cell:(g)=>he.jsxs(he.Fragment,{children:[rX(g),he.jsx("b",{children:g.title??g.id.slice(0,8)}),g.subagents>0&&he.jsxs(H,{tone:"acc",children:[g.subagents," Sub"]}),r.has(g.id)&&he.jsx("span",{title:"This agent asked a question only a human can answer — open the session",children:he.jsx(H,{tone:"warn",children:"Asking"})}),g.stuck&&he.jsx("span",{title:`${g.stuck} — heuristic, nothing was interrupted; open the session to judge`,children:he.jsx(H,{tone:"bad",children:"Stuck"})})]})},{key:"branch",label:"branch",width:116,get:(g)=>g.branch??"",cell:(g)=>he.jsx("span",{className:"br",children:g.branch??""})},{key:"now",label:"now",flex:!0,get:(g)=>g.last,cell:(g)=>he.jsx(sX,{session:g})},{key:"model",label:"model",width:84,get:(g)=>wo(g.model),cell:(g)=>he.jsxs("span",{className:"br",children:[wo(g.model),g.models>1&&he.jsxs("span",{className:"faint",children:[" +",g.models-1]})]})},{key:"trend",label:"trend",width:84,sortable:!1,filterable:!1,cell:(g)=>he.jsx(qi,{points:g.spark.map((y)=>y[0]),color:ro(g.agent)})},{key:"out",label:"out",width:66,num:!0,get:(g)=>g.tokens.output,cell:(g)=>Wt(g.tokens.output)},{key:"ctx",label:"ctx",width:72,num:!0,get:(g)=>zI(g),cell:(g)=>Wt(zI(g))},{key:"cost",label:"cost",width:64,num:!0,get:(g)=>g.costUsd??0,cell:(g)=>se(g.costUsd)??he.jsx(Z,{})},{key:"age",label:"age",width:56,num:!0,get:(g)=>new Date(g.lastSeenAt).getTime(),cell:(g)=>he.jsx("span",{className:"dim",children:vt(g.lastSeenAt)})}];return e?h.filter((g)=>g.key!=="project"):h},[e,p,r]),v=(h,g)=>he.jsx(ke,{id:h,columns:b,rows:g,rowKey:(y)=>y.id,onRowClick:(y)=>t(y.id),leading:{width:24,cell:(y)=>he.jsx("span",{className:`s ${y.state}`})},trailing:{width:34,cell:(y)=>he.jsx(Fo,{title:"Session actions",onOpen:(I)=>mI(I,y,c)})}}),S=[...d.keys()].sort(nn);return he.jsxs(he.Fragment,{children:[S.length>1&&he.jsxs("div",{className:"chips",children:[he.jsx("button",{type:"button",className:s===null?"chip on":"chip",onClick:()=>l(null),children:"All"}),S.map((h)=>he.jsxs("button",{type:"button",className:s===h?"chip on":"chip",onClick:()=>l(h),children:[St(h)," ",he.jsx("b",{children:d.get(h)})]},h))]}),he.jsx(F,{title:"Live",hint:`${m.length} sessions · ${se(Na(m,(h)=>h.costUsd))??"$0.00"}`,children:m.length>0?v("fleet-live",m):he.jsx(ee,{children:"Nothing running."})}),f.length>0&&he.jsx(F,{title:"Earlier",hint:String(f.length),spaced:!0,children:v("fleet-earlier",f)})]})}function sX({session:e}){let t=e.lastText?.split(`
17
+ `).find((a)=>a.trim())??"";if(e.state==="ended")return t?he.jsx("span",{className:"now dim",title:t,children:t}):he.jsx("span",{className:"dim",children:"ended"});let o=e.state==="waiting"&&t?t:e.last;return he.jsx("span",{className:"now",title:e.last,children:o})}var zI=(e)=>e.tokens.cacheRead+e.tokens.input+e.tokens.cacheWrite,iX=[],lX=[],cX=[];var Oe=x(T(),1),xg=(e)=>Vd(e)??Oe.jsx(Z,{});function uX({gate:e}){let t=[...e.history].reverse();return Oe.jsx("span",{className:"gh",title:`last ${t.length} run${t.length===1?"":"s"}, oldest first`,children:t.map((o)=>Oe.jsx("i",{className:o.verdict==="pass"?"ok":"bad",title:`${o.task} · ${o.at}${o.durationMs===null?"":` · ${(o.durationMs/1000).toFixed(1)}s`}`},`${o.at}-${o.task}-${o.verdict}`))})}var dX=[{key:"gate",label:"gate",width:150,get:(e)=>e.gate,cell:(e)=>Oe.jsxs(Oe.Fragment,{children:[Oe.jsx("b",{children:e.gate}),e.flaky&&Oe.jsx("span",{title:"This gate returned both a pass and a fail on the same task",children:Oe.jsx(H,{tone:"bad",children:"Flaky"})})]})},{key:"history",label:"history",width:150,sortable:!1,filterable:!1,cell:(e)=>Oe.jsx(uX,{gate:e})},{key:"runs",label:"runs",width:60,num:!0,get:(e)=>e.runs,cell:(e)=>e.runs},{key:"pass",label:"pass rate",width:84,num:!0,get:(e)=>e.passRate,cell:(e)=>`${Math.round(e.passRate*100)}%`},{key:"flips",label:"flips",width:64,num:!0,get:(e)=>e.flips,cell:(e)=>e.flips>0?Oe.jsx("b",{className:"bad",children:e.flips}):Oe.jsx("span",{className:"dim",children:"0"})},{key:"p50",label:"p50",width:66,num:!0,get:(e)=>e.p50Ms??-1,cell:(e)=>xg(e.p50Ms)},{key:"p95",label:"p95",width:66,num:!0,get:(e)=>e.p95Ms??-1,cell:(e)=>xg(e.p95Ms)},{key:"max",label:"slowest",width:74,num:!0,get:(e)=>e.maxMs??-1,cell:(e)=>xg(e.maxMs)},{key:"total",label:"total",width:74,num:!0,get:(e)=>e.totalMs,cell:(e)=>e.timedRuns>0?oa(e.totalMs):Oe.jsx(Z,{})},{key:"last",label:"last",flex:!0,get:(e)=>e.lastAt??"",cell:(e)=>e.lastAt?Oe.jsxs(Oe.Fragment,{children:[e.lastVerdict==="pass"?Oe.jsx(H,{tone:"ok",children:"Pass"}):Oe.jsx(H,{tone:"warn",children:"Fail"})," ",Oe.jsx("span",{className:"dim",children:vt(e.lastAt)})]}):Oe.jsx(Z,{})}];function FI(){let e=B((s)=>s.project),{data:t,error:o,reload:a}=ie(Fe.gateHealth(e));if(o&&!t)return Oe.jsx(Ke,{error:o,onRetry:a});if(!t)return Oe.jsx(Me,{});if(t.gates.length===0)return Oe.jsx(F,{title:"Gates",hint:"flakiness and wall-clock",children:Oe.jsxs(ee,{children:["No gate runs in the last 30 days",e?" in this project":"",".",Oe.jsx("br",{}),"Gates appear here once ",Oe.jsx("code",{children:"swarm_gate_run"})," or a workflow's gate step records one."]})});let n=t.totals,r=[`${n.gates} gate${n.gates===1?"":"s"}`,`${n.runs} run${n.runs===1?"":"s"}`,"last 30 days",n.flakyGates?`${n.flakyGates} flaky`:"none flaky",...n.totalMs?[`${oa(n.totalMs)} of wall-clock`]:[]].join(" · ");return Oe.jsxs(F,{title:"Gates",hint:r,children:[Oe.jsx(ke,{id:"gate-health",columns:dX,rows:t.gates,rowKey:(s)=>s.gate,defaultPageSize:0}),Oe.jsx("p",{className:"dim note",children:"Flaky = the same gate returned both a pass and a fail on one task. A gate that fails on one task and passes on another is doing its job, and is not counted. Durations cover executed gates only — a gate an agent simply recorded has no wall-clock."})]})}var rm=x(R(),1);var gs=x(R(),1);var Q=x(T(),1),Jd=(e)=>se(e)??"—";function jI(e,t){let o=e/t,a=10**Math.floor(Math.log10(o)),n=[1,2,2.5,5,10].map((s)=>s*a).find((s)=>s>=o)??a*10,r=[];for(let s=n;s<=e;s+=n)r.push(s);return r}function Cg(e,t,o,a,n){if(a<=0)return"";let r=Math.min(n,o/2,a);return`M${e},${t+a}V${t+r}Q${e},${t} ${e+r},${t}H${e+o-r}Q${e+o},${t} ${e+o},${t+r}V${t+a}Z`}function bs(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function $i({days:e,series:t,height:o=150,format:a=Jd,colorOf:n=ro,nameOf:r=St,sortKeys:s=nn,labelOf:l=(c)=>c.slice(5)}){let c=gs.useMemo(()=>Object.keys(t).sort(s),[t,s]),u=gs.useMemo(()=>e.map((y,I)=>c.reduce((k,C)=>k+(t[C]?.[I]??0),0)),[e,c,t]),d=1000,m=18,f=6,p=o-18-6,b=Math.max(0.000000001,...u),v=1000/e.length,S=Math.min(26,v*0.6),h=(y)=>6+p-y/b*p,g=Math.ceil(e.length/16);return Q.jsxs("svg",{viewBox:`0 0 1000 ${o}`,preserveAspectRatio:"none",className:"chart",style:{height:o},role:"img","aria-label":"Daily cost, stacked by agent",children:[jI(b,3).map((y)=>Q.jsxs("g",{children:[Q.jsx("line",{x1:0,x2:1000,y1:h(y),y2:h(y),className:"grid"}),Q.jsx("text",{x:0,y:h(y)-3,className:"ax",children:a(y)})]},y)),Q.jsx("line",{x1:0,x2:1000,y1:h(0),y2:h(0),className:"base"}),e.map((y,I)=>{let k=I*v+(v-S)/2,C=0,D=c.map((A)=>{let E=t[A]?.[I]??0;if(!E)return null;let j=h(C+E),de=h(C),fe=C===0;C+=E;let pe=Math.max(0,de-j-(fe?0:2));return Q.jsx("path",{d:Cg(k,j,S,pe,C===u[I]?3:0),fill:n(A)},A)}),M=[`<b>${y}</b>`,...c.filter((A)=>t[A]?.[I]).map((A)=>`<i style="background:${n(A)}"></i>${r(A)} ${a(t[A]?.[I]??0)}`),...c.length>1?[`<span>total ${a(u[I]??0)}</span>`]:[]].join("<br>");return Q.jsxs("g",{className:"col","data-tip":M,children:[Q.jsx("rect",{x:I*v,y:0,width:v,height:o,fill:"transparent"}),D,(e.length<=16||I%g===0)&&Q.jsx("text",{x:k+S/2,y:o-4,className:"ax mid",children:l(y)})]},y)})]})}var _I=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mX=[1,2,3,4,5,6,0];function GI({cells:e,label:t="cost"}){let o=gs.useMemo(()=>{let r=Array.from({length:7},()=>Array(24).fill(0));for(let s of e){let l=r[s.dow];if(l)l[s.hour]=(l[s.hour]??0)+(s.v??0)}return r},[e]),a=Math.max(0.000000001,...o.flat()),n=4.166666666666667;return Q.jsxs("div",{className:"hm",children:[mX.map((r)=>Q.jsxs(gs.Fragment,{children:[Q.jsx("div",{className:"hm-lbl",children:_I[r]}),Q.jsx("div",{className:"hm-row",children:(o[r]??[]).map((s,l)=>Q.jsx("i",{"data-tip":`<b>${_I[r]} ${String(l).padStart(2,"0")}:00</b><br>${t} ${Jd(s)}`,style:{opacity:s?0.15+0.85*Math.sqrt(s/a):0}},`${r}-${l}`))})]},r)),Q.jsx("div",{}),Q.jsx("div",{className:"hm-hours",children:Array.from({length:24},(r,s)=>s%3===0?Q.jsx("span",{style:{left:`${s*4.166666666666667}%`},children:String(s).padStart(2,"0")},s):null)})]})}function Ar({keys:e,colorOf:t=ro,nameOf:o=St}){return Q.jsx("div",{className:"legend",children:e.map((a)=>Q.jsxs("span",{children:[Q.jsx("i",{style:{background:t(a)}}),o(a)]},a))})}function VI({byDay:e,weeks:t=52,label:o="cost"}){let{columns:a,months:n}=gs.useMemo(()=>{let s=new Date;s.setHours(0,0,0,0);let l=new Date(s);l.setDate(s.getDate()-(t*7-1)-s.getDay());let c=Math.max(0.000000001,...Object.values(e).filter((p)=>p>0)),u=[],d=[],m=-1,f=new Date(l);for(let p=0;f<=s;p++){let b=[];for(let v=0;v<7&&f<=s;v++){if(v===0&&f.getMonth()!==m)m=f.getMonth(),d.push([p,f.toLocaleString(void 0,{month:"short"})]);let S=bs(f);b.push({key:S,value:e[S]??0}),f.setDate(f.getDate()+1)}u.push(b)}return{columns:u,months:d,max:c}},[e,t]),r=Math.max(0.000000001,...Object.values(e).filter((s)=>s>0));return Q.jsxs("div",{className:"cal",children:[Q.jsx("div",{className:"cal-months",children:n.filter(([s],l)=>l===0?s<a.length-2:!0).map(([s,l])=>Q.jsx("span",{style:{left:`${100*s/a.length}%`},children:l},`${s}-${l}`))}),Q.jsx("div",{className:"cal-grid",style:{gridTemplateColumns:`repeat(${a.length},1fr)`},children:a.map((s)=>Q.jsx("div",{className:"cal-col",children:s.map((l)=>Q.jsx("i",{"data-tip":`<b>${l.key}</b><br>${l.value?`${o} ${Jd(l.value)}`:"no activity"}`,style:{opacity:l.value?0.18+0.82*Math.sqrt(l.value/r):0}},l.key))},s[0]?.key??""))})]})}function KI({days:e,values:t,height:o=150,format:a=Jd,color:n="var(--acc-fill)"}){if(e.length===0)return null;let r=1000,s=18,l=6,c=o-s-l,u=Math.max(0.000000001,...t),d=r/e.length,m=(S)=>S*d+d/2,f=(S)=>l+c-S/u*c,p=t.map((S,h)=>`${h?"L":"M"}${m(h).toFixed(1)},${f(S).toFixed(1)}`).join(""),b=`${p}L${m(e.length-1).toFixed(1)},${f(0)}L${m(0).toFixed(1)},${f(0)}Z`,v=Math.ceil(e.length/16);return Q.jsxs("svg",{viewBox:`0 0 ${r} ${o}`,preserveAspectRatio:"none",className:"chart line",style:{height:o},role:"img","aria-label":"Cumulative spend",children:[jI(u,3).map((S)=>Q.jsxs("g",{children:[Q.jsx("line",{x1:0,x2:r,y1:f(S),y2:f(S),className:"grid"}),Q.jsx("text",{x:0,y:f(S)-3,className:"ax",children:a(S)})]},S)),Q.jsx("line",{x1:0,x2:r,y1:f(0),y2:f(0),className:"base"}),Q.jsx("path",{d:b,fill:n,opacity:0.12}),Q.jsx("path",{d:p,fill:"none",stroke:n,strokeWidth:2,vectorEffect:"non-scaling-stroke"}),e.map((S,h)=>{let g=t[h]??0,y=h?g-(t[h-1]??0):g,I=`<b>${S}</b><br>${a(g)}<br><span>${y>=0?"+":""}${a(y)} that day</span>`;return Q.jsxs("g",{className:"pt","data-tip":I,children:[Q.jsx("rect",{x:h*d,y:0,width:d,height:o,fill:"transparent"}),Q.jsx("circle",{cx:m(h),cy:f(g),r:3,fill:n}),(e.length<=16||h%v===0)&&Q.jsx("text",{x:m(h),y:o-4,className:"ax mid",children:S.slice(5)})]},S)})]})}function Dc({parts:e,format:t=(o)=>String(Math.round(o))}){let o=e.reduce((s,l)=>s+l.v,0)||1,a=["var(--acc-1)","var(--acc-2)","var(--acc-3)","var(--acc-4)","var(--acc-5)"],n=e.filter((s)=>s.v>0),r=(s)=>a[e.findIndex((l)=>l.label===s.label)]??a.at(-1);return Q.jsxs(Q.Fragment,{children:[Q.jsx("div",{className:"comp",children:n.map((s)=>Q.jsx("i",{"data-tip":`<b>${s.label}</b><br>${t(s.v)} · ${(100*s.v/o).toFixed(1)}%`,style:{flex:s.v,background:r(s)}},s.label))}),Q.jsx("div",{className:"legend small",children:n.map((s)=>{let l=100*s.v/o;return Q.jsxs("span",{children:[Q.jsx("i",{style:{background:r(s)}}),s.label," ",Q.jsxs("em",{children:[l<1?"<1":l.toFixed(0),"%"]})]},s.label)})})]})}function qI(e){let t=new Set(e),o=0,a=0,n=null;for(let l of[...t].sort()){let c=Date.parse(`${l}T00:00:00Z`);a=n!==null&&c-n===86400000?a+1:1,n=c,o=Math.max(o,a)}let r=0,s=new Date;if(s.setHours(0,0,0,0),!t.has(bs(s)))s.setDate(s.getDate()-1);while(t.has(bs(s)))r++,s.setDate(s.getDate()-1);return{current:r,longest:o}}var jo=x(T(),1),em={subagent:{color:"var(--acc)",dash:""},dispatch:{color:"var(--c3,#5a9e6f)",dash:""},message:{color:"var(--warn)",dash:"3 3"},handoff:{color:"var(--dim)",dash:"6 3"}},$I=[["subagent","spawned a subagent"],["dispatch","dispatched a run"],["message","sent a message"],["handoff","handed the task on"]],fX={merged:"var(--ok)",reverted:"var(--bad)",open:"var(--warn)"},pX=190,WI=34,tm=20,Mg=6.6,hX=(e,t=22)=>e.length<=t?e:`${e.slice(0,t-1)}…`,kg=(e)=>hX(e.title??e.id.slice(0,8)),ZI=(e)=>e.degree>3?8:e.degree>1?6.5:5;function YI({graph:e,onOpenSession:t,onExpand:o}){if(e.nodes.length===0)return null;let a=e.width+pX+tm*2,n=e.height+WI+tm*2,r=new Map(e.nodes.map((s)=>[s.id,s]));return jo.jsxs("svg",{viewBox:`0 0 ${a} ${n}`,width:a,height:n,role:"img","aria-label":"Session lineage graph",children:[e.edges.map((s)=>{let l=r.get(s.from),c=r.get(s.to);if(!l||!c)return null;let u=em[s.kind]??em.handoff,d=gX(l),m=Or(l),f=Er(c)-8,p=Or(c),b=s.back?-Math.max(24,Math.abs(p-m)*0.6):0,v=(d+f)/2,S=s.back?`M ${d} ${m} C ${v} ${m+b}, ${v} ${p+b}, ${f} ${p}`:`M ${d} ${m} C ${v} ${m}, ${v} ${p}, ${f} ${p}`;return jo.jsx("path",{d:S,fill:"none",stroke:u?.color,strokeWidth:s.back?1:1.6,strokeDasharray:u?.dash||void 0,opacity:s.back?0.5:0.8,"data-tip":`${s.kind}${s.label?` · ${s.label}`:""}`},`${s.from}->${s.to}:${s.kind}:${s.at}`)}),e.nodes.map((s)=>s.groupSize?jo.jsx(bX,{node:s,onExpand:o},s.id):jo.jsx(SX,{node:s,onOpen:t},s.id))]})}function Er(e){return tm+e.x+7}function Or(e){return tm+e.y+WI/2}function gX(e){let t=kg(e),o=e.groupSize?t.length*Mg+26:ZI(e)+6+t.length*Mg;return Er(e)+o+6}function bX({node:e,onExpand:t}){let o=kg(e),a=o.length*Mg+26,n=()=>e.groupOf&&t(e.groupOf);return jo.jsxs("g",{"data-tip":`${o} — click to expand`,className:"dag-node",role:"button",tabIndex:0,"aria-label":`Expand ${o}`,onClick:n,onKeyDown:(r)=>{if(r.key==="Enter"||r.key===" ")n()},children:[jo.jsx("rect",{x:Er(e)-7,y:Or(e)-10,width:a,height:20,rx:10,fill:"var(--acc-soft)",stroke:ro(e.agent??""),strokeWidth:1,opacity:0.95}),jo.jsx("text",{x:Er(e)+6,y:Or(e)+4,fontSize:11.5,fontWeight:600,fill:"var(--acc)",children:o}),jo.jsx("text",{x:Er(e)+a-16,y:Or(e)+4,fontSize:11,fill:"var(--acc)",children:"+"})]})}function vX(e){let t=e.costUsd?` · $${e.costUsd.toFixed(2)}`:"",o=`${e.degree} link${e.degree===1?"":"s"}`,a=`${St(e.agent??"")} · ${e.kind}${t} · ${o}`;return`${e.title??e.id.slice(0,8)}<br><span class='dim'>${a}</span>`}function SX({node:e,onOpen:t}){let o=kg(e),a=e.state==="active"||e.state==="waiting",n=ZI(e),r=e.outcome?fX[e.outcome]:null;return jo.jsxs("g",{className:"dag-node","data-tip":vX(e),role:"button",tabIndex:0,"aria-label":`Open ${o}`,onClick:()=>t(e.id),onKeyDown:(s)=>{if(s.key==="Enter"||s.key===" ")t(e.id)},children:[r&&jo.jsx("circle",{cx:Er(e),cy:Or(e),r:n+3,fill:"none",stroke:r,strokeWidth:1.5,opacity:0.8}),jo.jsx("circle",{cx:Er(e),cy:Or(e),r:n,fill:ro(e.agent??""),stroke:a?"var(--fg)":void 0,strokeWidth:a?1:void 0}),jo.jsx("text",{x:Er(e)+n+6,y:Or(e)+4,fontSize:11.5,fill:"var(--fg-2)",stroke:"var(--panel)",strokeWidth:3,paintOrder:"stroke",strokeLinejoin:"round",children:o})]})}var Yt=x(T(),1),Tc=30,yX=40,om=250,Ac=640,wX=(e,t=46)=>e.length<=t?e:`…${e.slice(-t)}`,IX=(e,t=30)=>e.length<=t?e:`${e.slice(0,t-1)}…`;function Dg({holders:e,held:t}){let o=t.slice(0,yX),n=Math.max(e.length,o.length,1)*Tc+16,r=(u)=>(n-u*Tc)/2+Tc/2+4,s=new Map(e.map((u,d)=>[u.id,r(e.length)+d*Tc])),l=new Map(o.map((u,d)=>[u.path,r(o.length)+d*Tc])),c=o.flatMap((u)=>[...u.writers.map((d)=>({id:d,item:u,writing:!0})),...u.readers.map((d)=>({id:d,item:u,writing:!1}))].map(({id:d,item:m,writing:f})=>{let p=s.get(d),b=l.get(m.path);if(p==null||b==null)return null;let v=e.find((S)=>S.id===d);return Yt.jsx("path",{d:`M ${om+14} ${p} C ${om+170} ${p}, ${Ac-170} ${b}, ${Ac-10} ${b}`,fill:"none",stroke:f?ro(v?.agent??""):"var(--faint)",strokeWidth:f?2:1,opacity:f?0.85:0.35},`${d}->${m.path}:${f}`)}).filter(Boolean));return Yt.jsxs("svg",{viewBox:`0 0 1000 ${n}`,width:"100%",className:"bipartite",role:"img","aria-label":"Who holds what",children:[c,e.map((u)=>Yt.jsxs("g",{"data-tip":`${u.label}<br><span class='dim'>${St(u.agent)} · ${u.files} file${u.files===1?"":"s"} · ${u.writes} write${u.writes===1?"":"s"}</span>`,children:[Yt.jsx("circle",{cx:om+8,cy:s.get(u.id),r:5,fill:ro(u.agent)}),Yt.jsx("text",{x:om-4,y:(s.get(u.id)??0)+4,textAnchor:"end",fontSize:12,fill:"var(--fg-2)",children:IX(u.label)})]},u.id)),o.map((u)=>{let d=u.writers.length+u.readers.length,m=`${u.path}<br><span class='dim'>${u.writers.length} writing · ${u.readers.length} reading</span>`+(u.contested?"<br><b>contested — a merge conflict waiting to happen</b>":"");return Yt.jsxs("g",{"data-tip":m,children:[Yt.jsx("circle",{cx:Ac,cy:l.get(u.path),r:u.contested?6:4,fill:u.contested?"var(--bad)":d>1?"var(--warn)":"var(--faint)"}),Yt.jsx("text",{x:Ac+12,y:(l.get(u.path)??0)+4,fontSize:11,fontFamily:"var(--mono)",fill:u.contested?"var(--bad)":"var(--dim)",fontWeight:u.contested?600:void 0,children:wX(u.path)})]},u.path)}),t.length>o.length&&Yt.jsxs("text",{x:Ac+12,y:n-2,fontSize:11,fill:"var(--faint)",children:["… ",t.length-o.length," more"]})]})}var rn=26,am=150,nm=96;function XI({tools:e,edges:t,label:o=(a)=>a}){if(e.length===0)return null;let a=new Map(t.map((l)=>[`${l.from} ${l.to}`,l])),n=t.reduce((l,c)=>Math.max(l,c.weight),0),r=am+e.length*rn+8,s=nm+e.length*rn+8;return Yt.jsx("div",{className:"matrix-scroll",children:Yt.jsxs("svg",{viewBox:`0 0 ${r} ${s}`,width:r,height:s,role:"img","aria-label":"Tool transition matrix",children:[e.map((l,c)=>Yt.jsx("text",{transform:`translate(${am+c*rn+rn/2} ${nm-6}) rotate(-55)`,fontSize:10.5,fill:"var(--dim)",textAnchor:"start",children:o(l)},l)),e.map((l,c)=>Yt.jsxs("g",{children:[Yt.jsx("text",{x:am-8,y:nm+c*rn+rn/2+3.5,fontSize:11,fill:"var(--fg-2)",textAnchor:"end",children:o(l)}),e.map((u,d)=>Yt.jsx(CX,{x:am+d*rn,y:nm+c*rn,edge:a.get(`${l} ${u}`),heaviest:n,diagonal:l===u,tip:`${o(l)} → ${o(u)}`},u))]},l))]})})}function xX(e,t){let o=Math.min(1,Math.log1p(e)/Math.log1p(t||1));if(o>0.8)return 5;if(o>0.6)return 4;if(o>0.4)return 3;if(o>0.2)return 2;return 1}function CX({x:e,y:t,edge:o,heaviest:a,diagonal:n,tip:r}){let s={x:e,y:t,width:rn-2,height:rn-2,rx:2};if(!o)return Yt.jsx("rect",{...s,fill:"var(--panel-2)",opacity:n?0.9:0.45});let l=`${o.sessions} session${o.sessions===1?"":"s"}`;return Yt.jsx("rect",{...s,fill:`var(--acc-${xX(o.weight,a)})`,stroke:n?"var(--acc-fill)":void 0,strokeWidth:n?1:void 0,"data-tip":`${r} · ${o.weight.toLocaleString()}× · ${l}`})}var L=x(T(),1);function QI(){let e=B((m)=>m.project),t=B((m)=>m.graphTab),o=B((m)=>m.setGraphTab),a=B((m)=>m.openSession),[n,r]=rm.useState([]),s=ie(t==="collisions"?`/v1/graphs/collisions${ze({project:e})}`:null),l=ie(t==="lineage"?`/v1/graphs/lineage${ze({project:e})}${n.map((m)=>`&expand=${encodeURIComponent(m)}`).join("")}`:null),c=ie(t==="tools"?`/v1/graphs/transitions${ze({project:e})}`:null),u=ie(t==="resources"?`/v1/graphs/resources${ze({project:e})}`:null),d=[["collisions","Collisions",s.data?.contested??0],["lineage","Lineage",l.data?.edges.length??0],["tools","Tools",c.data?.loops.length??0],["resources","Resources",u.data?.totals.orphaned??0]];return L.jsxs(L.Fragment,{children:[L.jsx(F,{title:"Graphs",hint:t==="collisions"?L.jsx(MX,{graph:s.data}):JI[t]}),L.jsx("div",{className:"chips",children:d.map(([m,f,p])=>L.jsxs("button",{type:"button",className:t===m?"chip on":"chip",onClick:()=>o(m),children:[f,p>0&&L.jsxs("b",{children:[" ",p]})]},m))}),t==="collisions"&&L.jsx(kX,{graph:s.data,scoped:Boolean(e)}),t==="lineage"&&L.jsx(DX,{graph:l.data,scoped:Boolean(e),onOpenSession:a,onExpand:(m)=>r((f)=>f.includes(m)?f:[...f,m])}),t==="tools"&&L.jsx(TX,{graph:c.data,scoped:Boolean(e)}),t==="resources"&&L.jsx(AX,{graph:u.data,scoped:Boolean(e)})]})}var JI={collisions:"live file collisions",lineage:"session lineage",tools:"tool transitions",resources:"who holds what"};function MX({graph:e}){if(!e||e.sessions.length===0)return JI.collisions;let t=e.sessions.length,o=e.files.length;return L.jsxs(L.Fragment,{children:[t," live session",t===1?"":"s",o>0&&L.jsxs(L.Fragment,{children:[" ","· ",o," file",o===1?"":"s"," ·"," ",e.contested>0?L.jsxs("b",{className:"navcount",children:[e.contested," contested"]}):"no collisions"]})]})}function kX({graph:e,scoped:t}){let o=rm.useMemo(()=>[...new Set((e?.sessions??[]).map((n)=>n.agent))].sort(nn),[e]);if(!e)return L.jsx(Me,{});if(e.sessions.length===0)return L.jsxs(ee,{children:["No live sessions",t?" in this project":"",".",L.jsx("br",{}),"The collision graph shows who is touching what, the moment two agents run at once."]});if(e.files.length===0)return L.jsx(ee,{children:"No file touches recorded yet — the graph fills in as agents read and edit."});let a=e.sessions.map((n)=>({id:n.id,label:n.title??n.id.slice(0,8),agent:n.agent,files:n.files,writes:n.writes}));return L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"card card-pad",children:L.jsx(Dg,{holders:a,held:e.files})}),L.jsxs("div",{className:"graph-key",children:[L.jsx(Ar,{keys:o}),L.jsxs("span",{className:"dim",children:["solid edge = writing · faint edge = reading · ",L.jsx("span",{className:"bad",children:"red file"})," = two sessions on it, at least one writing"]})]})]})}function DX({graph:e,scoped:t,onOpenSession:o,onExpand:a}){if(!e)return L.jsx(Me,{});if(e.nodes.length===0)return L.jsxs(ee,{children:["No relationships between sessions",t?" in this project":""," in the last 14 days.",L.jsx("br",{}),"Edges appear when a session spawns a subagent, dispatches a run, messages another agent, or hands a task on."]});return L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"card card-scroll",children:L.jsx(YI,{graph:e,onOpenSession:o,onExpand:a})}),L.jsxs("div",{className:"graph-key",children:[$I.filter(([n])=>e.byKind[n]).map(([n,r])=>{let s=em[n];return L.jsxs("span",{className:"edge-key",children:[L.jsx("svg",{width:22,height:8,"aria-hidden":"true",children:L.jsx("line",{x1:0,y1:4,x2:22,y2:4,stroke:s?.color,strokeWidth:2,strokeDasharray:s?.dash||void 0})}),L.jsxs("span",{className:"dim",children:[r," ",L.jsx("b",{children:e.byKind[n]})]})]},n)}),L.jsx("span",{className:"dim",children:"a green pill is a collapsed group — click to open it · ring = outcome · thicker dot = more links · a bowed edge closed a loop"})]})]})}function TX({graph:e,scoped:t}){if(!e)return L.jsx(Me,{});if(e.nodes.length===0)return L.jsxs(ee,{children:["No tool calls recorded",t?" in this project":""," in the last 7 days.",L.jsx("br",{}),"The matrix fills in as agents work — it counts what each tool call was followed by."]});let o=e.nodes.slice(0,18).map((r)=>r.tool),a=new Set(o),n=e.loops.slice(0,9);return L.jsxs("div",{className:"cols",children:[L.jsx(ut,{title:"What follows what",hint:"row ran, then column · darker = more often",children:L.jsx(XI,{tools:o,edges:e.edges.filter((r)=>a.has(r.from)&&a.has(r.to)),label:Wd})}),L.jsx(ut,{title:"Round trips",hint:"a tool pair that keeps handing back",children:n.length>0?L.jsxs(L.Fragment,{children:[L.jsxs("table",{className:"mini",children:[L.jsxs("colgroup",{children:[L.jsx("col",{style:{width:"52%"}}),L.jsx("col",{style:{width:"26%"}}),L.jsx("col",{style:{width:"22%"}})]}),L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"loop"}),L.jsx("th",{className:"num",children:"round trips"}),L.jsx("th",{className:"num",children:"sessions"})]})}),L.jsx("tbody",{children:n.map((r)=>L.jsxs("tr",{children:[L.jsxs("td",{className:"clip",children:[r.tools.map((s,l)=>L.jsxs("span",{children:[l>0&&L.jsx("span",{className:"dim",children:" → "}),L.jsx("span",{className:"br",children:Wd(s)})]},s)),r.tools.length===1&&L.jsx("span",{className:"dim",children:" itself"})]}),L.jsx("td",{className:"num",children:L.jsx("b",{children:r.weight.toLocaleString()})}),L.jsx("td",{className:"num",children:r.sessions})]},r.tools.join(">")))})]}),L.jsxs("p",{className:"dim note",children:["A loop is ordinary work — ",L.jsx("code",{children:"Read → Edit"})," is what writing code looks like. It only counts as stuck when the calls inside it are ",L.jsx("em",{children:"failing"}),", which is what the"," ",L.jsx("b",{children:"Stuck"})," badge on Fleet judges."]})]}):L.jsx("div",{className:"dim",children:"No tool pair hands back to the other — every move is one-way."})})]})}function AX({graph:e,scoped:t}){if(!e)return L.jsx(Me,{});if(e.resources.length===0)return L.jsxs(ee,{children:["Nothing is held",t?" in this project":"",".",L.jsx("br",{}),"Claims, ports, leases and tracked processes appear here with whoever took them."]});let o=e.holders.map((r)=>({id:r.id,label:r.gone?`${r.id} (gone)`:r.id,agent:"claude-code",files:r.holds,writes:r.holds})),a=e.resources.map((r)=>({path:`${r.kind==="claim"?"":`${r.kind} `}${r.name}`,readers:r.wanted,writers:r.holder?[r.holder]:[],contested:r.wanted.length>0||r.orphaned})),n=e.resources.filter((r)=>r.orphaned);return L.jsxs(L.Fragment,{children:[e.contention.length>0&&L.jsxs("div",{className:"card err-card ring-card",children:[L.jsxs("b",{children:[e.contention.length," contention ring",e.contention.length===1?"":"s"]})," ","— each agent wants something the next one holds. Nothing is blocked (claims refuse rather than queue), but they are working against each other.",L.jsx("ul",{className:"ring-list",children:e.contention.map((r)=>L.jsxs("li",{children:[r.owners.map((s,l)=>L.jsxs("span",{children:[l>0&&L.jsx("span",{className:"dim",children:" wants what "}),L.jsx("span",{className:"br",children:s})]},s))," ",L.jsx("span",{className:"dim",children:"holds — via"})," ",r.resources.map((s)=>L.jsx("code",{children:s},s))]},r.owners.join(">")))})]}),L.jsx("div",{className:"card card-pad",children:L.jsx(Dg,{holders:o,held:a})}),L.jsx("div",{className:"graph-key",children:L.jsxs("span",{className:"dim",children:["solid edge = holds · faint edge = was refused it · ",L.jsx("span",{className:"bad",children:"red"})," = orphaned or contested"]})}),n.length>0&&L.jsx(ut,{title:"Orphaned",hint:"the session that took it has ended",children:L.jsx("ul",{className:"plainlist",children:n.map((r)=>L.jsxs("li",{children:[L.jsx(H,{children:r.kind}),L.jsx("b",{children:r.name}),L.jsxs("span",{className:"dim",children:["held by ",r.holder??"nobody"]})]},`${r.kind}:${r.name}`))})})]})}var ix=x(R(),1);var Tg=x(R(),1);var Nr=x(T(),1);function ex({pid:e,projectId:t,onDone:o}){let[a,n]=Tg.useState(!1);return Nr.jsx("button",{type:"button",className:"mini-act",title:"Stop this process",disabled:a,onClick:async()=>{if(!confirm(`Stop pid ${e}?`))return;n(!0);let r=await qd(e,t);if(n(!1),!r.ok&&r.error)alert(r.error);o()},children:a?"stopping…":"Stop"})}function tx({worktree:e,onDone:t}){let[o,a]=Tg.useState(null),n=e.buildKb??0,r=!e.main&&!e.heldByClaim&&e.liveSessions===0&&n>0,s=async()=>{a("clearing…");let c=await eI(e.path);a(c.ok?`freed ${La(c.freedKb??0)}`:c.error??"failed"),setTimeout(()=>{a(null),t()},1600)},l=async()=>{if(!confirm(`Remove worktree ${e.path}?`))return;let c=await _i(e.projectId,e.path);if(!c.ok&&(c.refused==="dirty"||c.refused==="unpushed")){if(confirm(`${c.error}
18
18
 
19
- Remove anyway (discards the work)?`))await Bo(e.projectId,e.path,!0)}else if(!s.ok&&s.error)alert(s.error);t()};return il.jsxs(il.Fragment,{children:[o&&il.jsx("button",{type:"button",className:"mini-act",title:"Delete node_modules, target and dist here — a rebuild recreates them; the branch and any uncommitted work are untouched",onClick:i,children:n??`Clear ${Rn(l)}`}),e.reclaimable&&il.jsx("button",{type:"button",className:"mini-act bad",title:"Remove this worktree",onClick:r,children:"Remove"})]})}var se=S(M(),1),yx={dead:["bad","Dead"],orphaned:["bad","Orphaned"],hungry:["warn","Hungry"],stale:["warn","Stale"],abandoned:["warn","Abandoned"],heavy:["plain","Heavy"]};function hy({issue:e}){let t=e?yx[e]:void 0;if(!t)return se.jsx("span",{className:"dim",children:"ok"});return se.jsx(N,{tone:t[0],children:t[1]})}var Tf=(e)=>Rn(e)??se.jsx(H,{});function gy(e){return[{key:"issue",label:"state",width:96,get:(t)=>t.issue??"",cell:(t)=>se.jsx(hy,{issue:t.issue})},{key:"name",label:"name",width:130,get:(t)=>t.name,cell:(t)=>se.jsx("b",{children:t.name})},{key:"kind",label:"kind",width:64,get:(t)=>t.kind,cell:(t)=>se.jsx("span",{className:"br",children:t.kind})},{key:"pid",label:"pid",width:64,num:!0,get:(t)=>t.pid,cell:(t)=>t.pid},{key:"port",label:"port",width:60,num:!0,get:(t)=>t.port??0,cell:(t)=>t.port??se.jsx(H,{})},{key:"cpu",label:"cpu",width:60,num:!0,get:(t)=>t.cpuPct??-1,cell:(t)=>t.cpuPct===null?se.jsx(H,{}):`${t.cpuPct.toFixed(0)}%`},{key:"rss",label:"memory",width:78,num:!0,get:(t)=>t.rssKb??-1,cell:(t)=>Tf(t.rssKb)},{key:"note",label:"why",flex:!0,get:(t)=>t.note??"",cell:(t)=>t.note?se.jsx("span",{className:"now",title:t.note,children:t.note}):se.jsx(H,{})},{key:"act",label:"",width:70,sortable:!1,filterable:!1,cell:(t)=>t.reclaimable?se.jsx(py,{pid:t.pid,projectId:t.projectId,onDone:e}):null}]}function vy(e,t){return[{key:"issue",label:"state",width:106,get:(n)=>n.issue??"",cell:(n)=>se.jsx(hy,{issue:n.issue})},{key:"project",label:"project",width:122,get:(n)=>e(n.projectId),cell:(n)=>se.jsx("span",{className:"clip",children:e(n.projectId)})},{key:"branch",label:"branch",width:190,get:(n)=>n.branch??n.path,cell:(n)=>se.jsxs(se.Fragment,{children:[se.jsx("b",{children:n.branch??"(detached)"}),n.main&&se.jsx(N,{children:"main"})]})},{key:"disk",label:"disk",width:78,num:!0,get:(n)=>n.diskKb??-1,cell:(n)=>Tf(n.diskKb)},{key:"build",label:"build output",width:100,num:!0,get:(n)=>n.buildKb??-1,cell:(n)=>n.buildKb===null||n.buildKb===void 0?se.jsx(H,{}):se.jsx("span",{title:"node_modules, target, dist — a rebuild recreates these",children:Tf(n.buildKb)})},{key:"idle",label:"untouched",width:88,num:!0,get:(n)=>n.idleMs??-1,cell:(n)=>n.idleMs===null?se.jsx(H,{}):an(n.idleMs)},{key:"work",label:"work",width:130,get:(n)=>n.dirty*1000+n.ahead,cell:(n)=>se.jsxs(se.Fragment,{children:[n.dirty>0&&se.jsxs(N,{tone:"warn",children:[n.dirty," Dirty"]}),n.ahead>0&&se.jsxs(N,{tone:"acc",children:[n.ahead," Unpushed"]}),n.dirty===0&&n.ahead<=0&&(n.merged?se.jsx(N,{tone:"ok",children:"Merged"}):se.jsx(N,{children:"Clean"}))]})},{key:"held",label:"in use",width:110,get:(n)=>n.heldByClaim??"",cell:(n)=>n.heldByClaim?se.jsx("span",{className:"br",title:"Claimed",children:n.heldByClaim}):n.liveSessions>0?se.jsxs(N,{tone:"acc",children:[n.liveSessions," live"]}):se.jsx(H,{})},{key:"note",label:"why",flex:!0,get:(n)=>n.note??"",cell:(n)=>n.note?se.jsx("span",{className:"now",title:n.note,children:n.note}):se.jsx(H,{})},{key:"act",label:"",width:196,sortable:!1,filterable:!1,cell:(n)=>se.jsx(my,{worktree:n,onDone:t})}]}var zn=S(M(),1),by=(e)=>Rn(e)??zn.jsx(H,{});function yy({report:e}){let t=e.totals,n=e.worktrees.filter((i)=>i.diskKb!==null).length,a=e.worktrees.length>0&&n===0,l=e.worktrees.reduce((i,r)=>i+(r.buildKb??0),0),o=e.worktrees.filter((i)=>!i.main&&!i.heldByClaim&&i.liveSessions===0).reduce((i,r)=>i+(r.buildKb??0),0);return zn.jsxs(ut,{wide:!0,children:[zn.jsx(K,{label:"Needs a look",value:t.issues,detail:t.issues?"processes + worktrees":"all clean",tone:t.issues?"hot":void 0}),zn.jsx(K,{label:"Processes",value:t.processes,detail:Sx(t.orphanedProcesses,t.deadProcesses),tone:t.orphanedProcesses||t.deadProcesses?"hot":void 0}),zn.jsx(K,{label:"Worktrees",value:t.worktrees,detail:t.staleWorktrees?`${t.staleWorktrees} stale`:"none stale",tone:t.staleWorktrees?"warm":void 0}),zn.jsx(K,{label:"Reclaimable",value:a?zn.jsx(H,{}):by(t.reclaimableKb),detail:a?`measuring ${e.worktrees.length} worktrees…`:`of ${Rn(t.diskKb)} on disk`,tone:!a&&t.reclaimableKb?"warm":void 0}),zn.jsx(K,{label:"Build output",value:a?zn.jsx(H,{}):by(l),detail:o?`${Rn(o)} clearable now`:"nothing to clear",tone:o?"warm":void 0})]})}function Sx(e,t){if(!e&&!t)return"all healthy";return`${e} orphaned · ${t} dead`}var Qe=S(M(),1);function wy(){let e=T((r)=>r.project),{data:t,error:n,reload:a}=te(Re.hygiene(e)),l=G((r)=>r?.projects??xx),o=Sy.useMemo(()=>{let r=new Map(l.map((s)=>[s.id,s.name]));return(s)=>r.get(s)??"(removed)"},[l]);if(n&&!t)return Qe.jsx(xe,{error:n,onRetry:a});if(!t)return Qe.jsx(ue,{});if(t.processes.length===0&&t.worktrees.length===0)return Qe.jsx(wx,{scoped:e!==null});let i=t.totals;return Qe.jsxs(Qe.Fragment,{children:[Qe.jsx(C,{title:"Hygiene",hint:i.issues?`${i.issues} need${i.issues===1?"s":""} a look`:"nothing to clean up"}),Qe.jsx(yy,{report:t}),Qe.jsx(C,{title:"Processes",hint:`${t.processes.length} tracked · started through swarm, never matched by command pattern`,spaced:!0,children:t.processes.length>0?Qe.jsx(de,{id:"hyg-procs",columns:gy(a),rows:t.processes,rowKey:(r)=>`${r.projectId}:${r.pid}`}):Qe.jsx(Y,{children:"No tracked processes."})}),Qe.jsxs(C,{title:"Worktrees",hint:Mx(t.worktrees,i.diskKb),spaced:!0,children:[t.worktrees.length>0?Qe.jsx(de,{id:"hyg-trees",columns:vy(o,a),rows:t.worktrees,rowKey:(r)=>r.path}):Qe.jsx(Y,{children:"No worktrees."}),Qe.jsx("p",{className:"dim note",children:"Only merged worktrees with nothing uncommitted, nothing unpushed and nobody working in them are offered for removal. Anything unmerged is listed but never called safe. Disk is sampled in the background, so sizes fill in a moment after the view opens."})]})]})}function wx({scoped:e}){return Qe.jsx(C,{title:"Hygiene",hint:"what the fleet left behind",children:Qe.jsxs(Y,{children:["Nothing tracked",e?" in this project":"",".",Qe.jsx("br",{}),"Processes started through ",Qe.jsx("code",{children:"swarm serve"})," / ",Qe.jsx("code",{children:"proc"})," and this machine's worktrees appear here."]})})}function Mx(e,t){let n=e.filter((o)=>o.diskKb!==null).length,a=e.length>0&&n===0?"measuring…":`${Rn(t)} on disk`,l=n>0&&n<e.length;return`${e.length} on this machine · ${a}${l?` · ${n}/${e.length} measured`:""}`}var xx=[];var rl=S(B(),1);var P=S(M(),1);function kx(e){return e.replace(/^\s*cd\s+\S+\s*(&&|;)\s*/,"").replace(/\s+/g," ").trim()||e}var _t=(e,t)=>{let n=e[t];return typeof n==="string"?n:""};function Dx({action:e}){if(e==="deny")return P.jsx(N,{tone:"warn",children:"Denied"});if(e==="orphaned")return P.jsx(N,{tone:"warn",children:"Orphaned"});if(e==="failed")return P.jsx(N,{tone:"warn",children:"Failed"});return P.jsx(N,{tone:"acc",children:"Asked"})}function My(){let e=T((b)=>b.project),t=T((b)=>b.openSession),[n,a]=rl.useState(!0),{data:l,error:o,reload:i}=te(Re.incidents(e,n)),r=G((b)=>b?.sessions??Ox),s=G((b)=>b?.projects??Ex),c=rl.useMemo(()=>{let b=new Map(r.map((y)=>[y.id,y.title]));return(y)=>b.get(y)??null},[r]),d=rl.useMemo(()=>{let b=new Map(s.map((y)=>[y.id,y.name]));return(y)=>y?b.get(y)??"(removed)":""},[s]),h=rl.useMemo(()=>(l??[]).filter((b)=>!e||b.projectId===e),[l,e]),u=h.filter((b)=>!b.acked).length,p=rl.useMemo(()=>{let b=new Map;for(let y of h)b.set(_t(y,"rule"),(b.get(_t(y,"rule"))??0)+1);return[...b.entries()].sort((y,m)=>m[1]-y[1])},[h]),g=rl.useMemo(()=>{let b=[{key:"ts",label:"when",width:76,get:(y)=>y.ts,cell:(y)=>P.jsx("span",{className:"dim",title:y.ts,children:Pe(y.ts)})},{key:"project",label:"project",width:104,get:(y)=>d(y.projectId),cell:(y)=>d(y.projectId)},{key:"session",label:"session",width:150,get:(y)=>y.sessionId?c(y.sessionId)??y.sessionId:"",cell:(y)=>y.sessionId?P.jsx("button",{type:"button",className:"link",onClick:()=>t(y.sessionId),children:c(y.sessionId)??y.sessionId.slice(0,8)}):P.jsx(H,{})},{key:"rule",label:"rule",width:150,get:(y)=>_t(y,"rule"),cell:(y)=>P.jsx("span",{className:"br",children:_t(y,"rule")})},{key:"action",label:"action",width:80,get:(y)=>_t(y,"action"),cell:(y)=>P.jsx(Dx,{action:_t(y,"action")})},{key:"command",label:"command",flex:!0,get:(y)=>_t(y,"command"),cell:(y)=>P.jsx("span",{className:"now",title:`${_t(y,"command")}${_t(y,"reason")?`
19
+ Remove anyway (discards the work)?`))await _i(e.projectId,e.path,!0)}else if(!c.ok&&c.error)alert(c.error);t()};return Nr.jsxs(Nr.Fragment,{children:[r&&Nr.jsx("button",{type:"button",className:"mini-act",title:"Delete node_modules, target and dist here — a rebuild recreates them; the branch and any uncommitted work are untouched",onClick:s,children:o??`Clear ${La(n)}`}),e.reclaimable&&Nr.jsx("button",{type:"button",className:"mini-act bad",title:"Remove this worktree",onClick:l,children:"Remove"})]})}var Ce=x(T(),1),EX={dead:["bad","Dead"],orphaned:["bad","Orphaned"],hungry:["warn","Hungry"],stale:["warn","Stale"],abandoned:["warn","Abandoned"],heavy:["plain","Heavy"]};function ox({issue:e}){let t=e?EX[e]:void 0;if(!t)return Ce.jsx("span",{className:"dim",children:"ok"});return Ce.jsx(H,{tone:t[0],children:t[1]})}var Ag=(e)=>La(e)??Ce.jsx(Z,{});function ax(e){return[{key:"issue",label:"state",width:96,get:(t)=>t.issue??"",cell:(t)=>Ce.jsx(ox,{issue:t.issue})},{key:"name",label:"name",width:130,get:(t)=>t.name,cell:(t)=>Ce.jsx("b",{children:t.name})},{key:"kind",label:"kind",width:64,get:(t)=>t.kind,cell:(t)=>Ce.jsx("span",{className:"br",children:t.kind})},{key:"pid",label:"pid",width:64,num:!0,get:(t)=>t.pid,cell:(t)=>t.pid},{key:"port",label:"port",width:60,num:!0,get:(t)=>t.port??0,cell:(t)=>t.port??Ce.jsx(Z,{})},{key:"cpu",label:"cpu",width:60,num:!0,get:(t)=>t.cpuPct??-1,cell:(t)=>t.cpuPct===null?Ce.jsx(Z,{}):`${t.cpuPct.toFixed(0)}%`},{key:"rss",label:"memory",width:78,num:!0,get:(t)=>t.rssKb??-1,cell:(t)=>Ag(t.rssKb)},{key:"note",label:"why",flex:!0,get:(t)=>t.note??"",cell:(t)=>t.note?Ce.jsx("span",{className:"now",title:t.note,children:t.note}):Ce.jsx(Z,{})},{key:"act",label:"",width:70,sortable:!1,filterable:!1,cell:(t)=>t.reclaimable?Ce.jsx(ex,{pid:t.pid,projectId:t.projectId,onDone:e}):null}]}function nx(e,t){return[{key:"issue",label:"state",width:106,get:(o)=>o.issue??"",cell:(o)=>Ce.jsx(ox,{issue:o.issue})},{key:"project",label:"project",width:122,get:(o)=>e(o.projectId),cell:(o)=>Ce.jsx("span",{className:"clip",children:e(o.projectId)})},{key:"branch",label:"branch",width:190,get:(o)=>o.branch??o.path,cell:(o)=>Ce.jsxs(Ce.Fragment,{children:[Ce.jsx("b",{children:o.branch??"(detached)"}),o.main&&Ce.jsx(H,{children:"main"})]})},{key:"disk",label:"disk",width:78,num:!0,get:(o)=>o.diskKb??-1,cell:(o)=>Ag(o.diskKb)},{key:"build",label:"build output",width:100,num:!0,get:(o)=>o.buildKb??-1,cell:(o)=>o.buildKb===null||o.buildKb===void 0?Ce.jsx(Z,{}):Ce.jsx("span",{title:"node_modules, target, dist — a rebuild recreates these",children:Ag(o.buildKb)})},{key:"idle",label:"untouched",width:88,num:!0,get:(o)=>o.idleMs??-1,cell:(o)=>o.idleMs===null?Ce.jsx(Z,{}):oa(o.idleMs)},{key:"work",label:"work",width:130,get:(o)=>o.dirty*1000+o.ahead,cell:(o)=>Ce.jsxs(Ce.Fragment,{children:[o.dirty>0&&Ce.jsxs(H,{tone:"warn",children:[o.dirty," Dirty"]}),o.ahead>0&&Ce.jsxs(H,{tone:"acc",children:[o.ahead," Unpushed"]}),o.dirty===0&&o.ahead<=0&&(o.merged?Ce.jsx(H,{tone:"ok",children:"Merged"}):Ce.jsx(H,{children:"Clean"}))]})},{key:"held",label:"in use",width:110,get:(o)=>o.heldByClaim??"",cell:(o)=>o.heldByClaim?Ce.jsx("span",{className:"br",title:"Claimed",children:o.heldByClaim}):o.liveSessions>0?Ce.jsxs(H,{tone:"acc",children:[o.liveSessions," live"]}):Ce.jsx(Z,{})},{key:"note",label:"why",flex:!0,get:(o)=>o.note??"",cell:(o)=>o.note?Ce.jsx("span",{className:"now",title:o.note,children:o.note}):Ce.jsx(Z,{})},{key:"act",label:"",width:196,sortable:!1,filterable:!1,cell:(o)=>Ce.jsx(tx,{worktree:o,onDone:t})}]}var Ha=x(T(),1),rx=(e)=>La(e)??Ha.jsx(Z,{});function sx({report:e}){let t=e.totals,o=e.worktrees.filter((s)=>s.diskKb!==null).length,a=e.worktrees.length>0&&o===0,n=e.worktrees.reduce((s,l)=>s+(l.buildKb??0),0),r=e.worktrees.filter((s)=>!s.main&&!s.heldByClaim&&s.liveSessions===0).reduce((s,l)=>s+(l.buildKb??0),0);return Ha.jsxs($t,{wide:!0,children:[Ha.jsx(K,{label:"Needs a look",value:t.issues,detail:t.issues?"processes + worktrees":"all clean",tone:t.issues?"hot":void 0}),Ha.jsx(K,{label:"Processes",value:t.processes,detail:OX(t.orphanedProcesses,t.deadProcesses),tone:t.orphanedProcesses||t.deadProcesses?"hot":void 0}),Ha.jsx(K,{label:"Worktrees",value:t.worktrees,detail:t.staleWorktrees?`${t.staleWorktrees} stale`:"none stale",tone:t.staleWorktrees?"warm":void 0}),Ha.jsx(K,{label:"Reclaimable",value:a?Ha.jsx(Z,{}):rx(t.reclaimableKb),detail:a?`measuring ${e.worktrees.length} worktrees…`:`of ${La(t.diskKb)} on disk`,tone:!a&&t.reclaimableKb?"warm":void 0}),Ha.jsx(K,{label:"Build output",value:a?Ha.jsx(Z,{}):rx(n),detail:r?`${La(r)} clearable now`:"nothing to clear",tone:r?"warm":void 0})]})}function OX(e,t){if(!e&&!t)return"all healthy";return`${e} orphaned · ${t} dead`}var pt=x(T(),1);function lx(){let e=B((l)=>l.project),{data:t,error:o,reload:a}=ie(Fe.hygiene(e)),n=q((l)=>l?.projects??RX),r=ix.useMemo(()=>{let l=new Map(n.map((c)=>[c.id,c.name]));return(c)=>l.get(c)??"(removed)"},[n]);if(o&&!t)return pt.jsx(Ke,{error:o,onRetry:a});if(!t)return pt.jsx(Me,{});if(t.processes.length===0&&t.worktrees.length===0)return pt.jsx(NX,{scoped:e!==null});let s=t.totals;return pt.jsxs(pt.Fragment,{children:[pt.jsx(F,{title:"Hygiene",hint:s.issues?`${s.issues} need${s.issues===1?"s":""} a look`:"nothing to clean up"}),pt.jsx(sx,{report:t}),pt.jsx(F,{title:"Processes",hint:`${t.processes.length} tracked · started through swarm, never matched by command pattern`,spaced:!0,children:t.processes.length>0?pt.jsx(ke,{id:"hyg-procs",columns:ax(a),rows:t.processes,rowKey:(l)=>`${l.projectId}:${l.pid}`}):pt.jsx(ee,{children:"No tracked processes."})}),pt.jsxs(F,{title:"Worktrees",hint:LX(t.worktrees,s.diskKb),spaced:!0,children:[t.worktrees.length>0?pt.jsx(ke,{id:"hyg-trees",columns:nx(r,a),rows:t.worktrees,rowKey:(l)=>l.path}):pt.jsx(ee,{children:"No worktrees."}),pt.jsx("p",{className:"dim note",children:"Only merged worktrees with nothing uncommitted, nothing unpushed and nobody working in them are offered for removal. Anything unmerged is listed but never called safe. Disk is sampled in the background, so sizes fill in a moment after the view opens."})]})]})}function NX({scoped:e}){return pt.jsx(F,{title:"Hygiene",hint:"what the fleet left behind",children:pt.jsxs(ee,{children:["Nothing tracked",e?" in this project":"",".",pt.jsx("br",{}),"Processes started through ",pt.jsx("code",{children:"swarm serve"})," / ",pt.jsx("code",{children:"proc"})," and this machine's worktrees appear here."]})})}function LX(e,t){let o=e.filter((r)=>r.diskKb!==null).length,a=e.length>0&&o===0?"measuring…":`${La(t)} on disk`,n=o>0&&o<e.length;return`${e.length} on this machine · ${a}${n?` · ${o}/${e.length} measured`:""}`}var RX=[];var Lr=x(R(),1);var ce=x(T(),1);function BX(e){return e.replace(/^\s*cd\s+\S+\s*(&&|;)\s*/,"").replace(/\s+/g," ").trim()||e}var Ao=(e,t)=>{let o=e[t];return typeof o==="string"?o:""};function HX({action:e}){if(e==="deny")return ce.jsx(H,{tone:"warn",children:"Denied"});if(e==="orphaned")return ce.jsx(H,{tone:"warn",children:"Orphaned"});if(e==="failed")return ce.jsx(H,{tone:"warn",children:"Failed"});return ce.jsx(H,{tone:"acc",children:"Asked"})}function cx(){let e=B((v)=>v.project),t=B((v)=>v.openSession),[o,a]=Lr.useState(!0),{data:n,error:r,reload:s}=ie(Fe.incidents(e,o)),l=q((v)=>v?.sessions??PX),c=q((v)=>v?.projects??zX),u=Lr.useMemo(()=>{let v=new Map(l.map((S)=>[S.id,S.title]));return(S)=>v.get(S)??null},[l]),d=Lr.useMemo(()=>{let v=new Map(c.map((S)=>[S.id,S.name]));return(S)=>S?v.get(S)??"(removed)":""},[c]),m=Lr.useMemo(()=>(n??[]).filter((v)=>!e||v.projectId===e),[n,e]),f=m.filter((v)=>!v.acked).length,p=Lr.useMemo(()=>{let v=new Map;for(let S of m)v.set(Ao(S,"rule"),(v.get(Ao(S,"rule"))??0)+1);return[...v.entries()].sort((S,h)=>h[1]-S[1])},[m]),b=Lr.useMemo(()=>{let v=[{key:"ts",label:"when",width:76,get:(S)=>S.ts,cell:(S)=>ce.jsx("span",{className:"dim",title:S.ts,children:vt(S.ts)})},{key:"project",label:"project",width:104,get:(S)=>d(S.projectId),cell:(S)=>d(S.projectId)},{key:"session",label:"session",width:150,get:(S)=>S.sessionId?u(S.sessionId)??S.sessionId:"",cell:(S)=>S.sessionId?ce.jsx("button",{type:"button",className:"link",onClick:()=>t(S.sessionId),children:u(S.sessionId)??S.sessionId.slice(0,8)}):ce.jsx(Z,{})},{key:"rule",label:"rule",width:150,get:(S)=>Ao(S,"rule"),cell:(S)=>ce.jsx("span",{className:"br",children:Ao(S,"rule")})},{key:"action",label:"action",width:80,get:(S)=>Ao(S,"action"),cell:(S)=>ce.jsx(HX,{action:Ao(S,"action")})},{key:"command",label:"command",flex:!0,get:(S)=>Ao(S,"command"),cell:(S)=>ce.jsx("span",{className:"now",title:`${Ao(S,"command")}${Ao(S,"reason")?`
20
20
 
21
- ${_t(y,"reason")}`:""}`,children:kx(_t(y,"command"))})},{key:"reason",label:"reason",width:260,get:(y)=>_t(y,"reason"),cell:(y)=>P.jsx("span",{className:"dim now",title:_t(y,"reason"),children:_t(y,"reason")})},{key:"acked",label:"acked",width:80,get:(y)=>y.acked??"",cell:(y)=>y.acked?P.jsx("span",{className:"dim",title:y.acked,children:Pe(y.acked)}):P.jsx(N,{tone:"warn",children:"Open"})}];return e?b.filter((y)=>y.key!=="project"):b},[e,d,c,t]);if(o&&!l)return P.jsx(xe,{error:o,onRetry:i});if(!l)return P.jsx(ue,{});return P.jsxs(P.Fragment,{children:[P.jsx(C,{title:"Incidents",hint:P.jsxs(P.Fragment,{children:[u," open · ",h.length," shown · every ask/deny the rules made",p.length>0&&P.jsxs(P.Fragment,{children:[" · ",p.map(([b,y])=>P.jsxs("span",{children:[P.jsx("span",{className:"br",children:b})," ",P.jsx("b",{children:y})," "]},b))]})]})}),P.jsxs("div",{className:"chips",children:[P.jsx("button",{type:"button",className:n?"chip on":"chip",onClick:()=>a(!0),children:"Open"}),P.jsx("button",{type:"button",className:n?"chip":"chip on",onClick:()=>a(!1),children:"All"}),u>0&&P.jsxs("button",{type:"button",className:"chip",title:`Mark every open incident${e?" in this project":""} as seen`,onClick:async()=>{await vb(e),i()},children:["Ack all ",P.jsx("b",{children:u})]})]}),h.length>0?P.jsx(de,{id:"incidents-feed",columns:g,rows:h,rowKey:(b)=>String(b.seq),leading:{width:24,cell:(b)=>P.jsx("span",{className:`s ${b.acked?"ended":["deny","orphaned","failed"].includes(_t(b,"action"))?"waiting":"idle"}`})},trailing:{width:70,cell:(b)=>b.acked?null:P.jsx("button",{type:"button",className:"mini-act",onClick:async()=>{await gb(b.seq),i()},children:"Ack"})}}):P.jsxs(Y,{children:[n?"No open incidents.":"No incidents yet.",P.jsx("br",{}),"Every ",P.jsx("code",{children:"ask"})," or ",P.jsx("code",{children:"deny"})," a rule makes lands here; ack it once you have seen it."]})]})}var Ox=[],Ex=[];var ze=S(M(),1),Rf=(e)=>Is(e)??ze.jsx(H,{}),Nx=[{key:"server",label:"server",width:170,get:(e)=>e.server,cell:(e)=>ze.jsxs(ze.Fragment,{children:[ze.jsx("b",{children:e.server}),!e.mcp&&ze.jsx(N,{children:"built-in"})]})},{key:"calls",label:"calls",width:74,num:!0,get:(e)=>e.calls,cell:(e)=>e.calls.toLocaleString()},{key:"sessions",label:"sessions",width:78,num:!0,get:(e)=>e.sessions,cell:(e)=>e.sessions},{key:"p50",label:"p50",width:68,num:!0,get:(e)=>e.p50Ms??-1,cell:(e)=>Rf(e.p50Ms)},{key:"p95",label:"p95",width:68,num:!0,get:(e)=>e.p95Ms??-1,cell:(e)=>Rf(e.p95Ms)},{key:"max",label:"slowest",width:78,num:!0,get:(e)=>e.maxMs??-1,cell:(e)=>ze.jsx("span",{className:"dim",title:"Includes any time the call spent waiting on a person",children:Rf(e.maxMs)})},{key:"wait",label:"waited",width:82,num:!0,get:(e)=>e.totalMs,cell:(e)=>an(e.totalMs)},{key:"unans",label:"no reply",width:78,num:!0,get:(e)=>e.unanswered,cell:(e)=>e.unanswered>0?ze.jsx("b",{className:"bad",children:e.unanswered}):ze.jsx("span",{className:"dim",children:"0"})},{key:"err",label:"errors",width:74,num:!0,get:(e)=>e.errorRate,cell:(e)=>e.errors>0?ze.jsxs("b",{className:"bad",children:[Math.round(e.errorRate*100),"%"]}):ze.jsx("span",{className:"dim",children:"0"})},{key:"tools",label:"busiest tools",flex:!0,sortable:!1,filterable:!1,cell:(e)=>ze.jsx(ze.Fragment,{children:e.tools.map((t)=>ze.jsxs("span",{className:"br",title:`${t.tool} · ${t.calls} calls${t.p50Ms===null?"":` · p50 ${t.p50Ms}ms`}`,children:[t.tool," ",ze.jsx("b",{children:t.calls})]},t.tool))})}];function xy(){let e=T((i)=>i.project),{data:t,error:n,reload:a}=te(Re.mcpHealth(e));if(n&&!t)return ze.jsx(xe,{error:n,onRetry:a});if(!t)return ze.jsx(ue,{});if(t.servers.length===0)return ze.jsx(C,{title:"MCP",hint:"server health",children:ze.jsxs(Y,{children:["No tool calls in the last 7 days",e?" in this project":"","."]})});let l=t.totals,o=l.totalMs?Math.round(l.mcpMs/l.totalMs*100):0;return ze.jsxs(C,{title:"MCP",hint:`${l.servers} MCP server${l.servers===1?"":"s"} · ${l.calls.toLocaleString()} call${l.calls===1?"":"s"} · last 7 days · ${an(l.mcpMs)} waiting on MCP (${o}% of all tool time)`,children:[ze.jsx(de,{id:"mcp-health",columns:Nx,rows:t.servers,rowKey:(i)=>i.server,defaultPageSize:0}),ze.jsxs("p",{className:"dim note",children:["Latency is measured hook to hook, so it is the wall-clock an agent actually waited — a call held behind a permission prompt carries that wait too, which is why ",ze.jsx("b",{children:"slowest"})," can be hours and p50/p95 are the numbers to read. ",ze.jsx("b",{children:"errors"})," counts only unambiguous failures: a command that merely prints the word “error” is not one."]})]})}var Dy=S(B(),1);var ie=S(M(),1);function Tx(e){if(e==="merged")return ie.jsx(N,{tone:"ok",children:"merged"});if(e==="reverted")return ie.jsx(N,{tone:"bad",children:"reverted"});if(e==="open")return ie.jsx(N,{tone:"acc",children:"open"});return ie.jsx(N,{children:"no PR"})}function ky(e){return[{key:"key",label:e,width:150,get:(t)=>t.key,cell:(t)=>ie.jsx("b",{children:e==="model"?Ot(t.key):Ie(t.key)})},{key:"branches",label:"branches",width:80,num:!0,get:(t)=>t.branches,cell:(t)=>t.branches},{key:"merged",label:"merged",width:72,num:!0,get:(t)=>t.merged,cell:(t)=>t.merged},{key:"reverted",label:"reverted",width:78,num:!0,get:(t)=>t.reverted,cell:(t)=>t.reverted>0?ie.jsx("b",{style:{color:"var(--bad)"},children:t.reverted}):"0"},{key:"open",label:"open",width:60,num:!0,get:(t)=>t.open,cell:(t)=>t.open},{key:"nopr",label:"no PR",width:64,num:!0,get:(t)=>t.noPr,cell:(t)=>t.noPr},{key:"rate",label:"merge rate",width:92,num:!0,get:(t)=>t.mergeRate??-1,cell:(t)=>db(t.mergeRate)},{key:"lead",label:"median lead",width:98,num:!0,get:(t)=>t.medianLeadHours??-1,cell:(t)=>mf(t.medianLeadHours)},{key:"cpm",label:"$ / merge",width:84,num:!0,get:(t)=>t.costPerMerge??-1,cell:(t)=>F(t.costPerMerge)??ie.jsx(H,{})}]}var Rx=[{key:"branch",label:"branch",width:190,get:(e)=>e.branch,cell:(e)=>ie.jsx("span",{className:"br",children:e.branch})},{key:"outcome",label:"outcome",width:92,cls:"td-badge",get:(e)=>e.outcome,cell:(e)=>Tx(e.outcome)},{key:"pr",label:"PR",flex:!0,get:(e)=>e.title??"",cell:(e)=>e.prNumber?ie.jsxs(ie.Fragment,{children:[ie.jsxs("a",{href:e.url??"#",target:"_blank",rel:"noopener noreferrer",children:["#",e.prNumber]})," ",ie.jsx("span",{className:"dim",children:e.title??""})]}):ie.jsx("span",{className:"faint",children:"—"})},{key:"model",label:"model",width:92,get:(e)=>Ot(e.model),cell:(e)=>ie.jsx("span",{className:"br",children:Ot(e.model)})},{key:"agent",label:"agent",width:78,cls:"td-badge",get:(e)=>Ie(e.agent),cell:(e)=>ie.jsx(Go,{agent:e.agent})},{key:"sessions",label:"sessions",width:76,num:!0,get:(e)=>e.sessions.length,cell:(e)=>e.sessions.length},{key:"cost",label:"cost",width:64,num:!0,get:(e)=>e.costUsd,cell:(e)=>F(e.costUsd)??ie.jsx(H,{})},{key:"lead",label:"lead",width:64,num:!0,get:(e)=>e.leadHours??-1,cell:(e)=>mf(e.leadHours)}];function Oy(){let e=T((o)=>o.project),{data:t,error:n,reload:a}=te(Re.outcomes(e)),l=Dy.useMemo(()=>{let o=t?.branches??[],i=(r)=>o.filter((s)=>s.outcome===r).length;return{total:o.length,merged:i("merged"),reverted:i("reverted"),open:i("open")}},[t]);if(n&&!t)return ie.jsx(xe,{error:n,onRetry:a});if(!t)return ie.jsx(ue,{});if(t.branches.length===0)return ie.jsx(C,{title:"Outcomes",hint:"did the work survive?",children:ie.jsxs(Y,{children:["No agent branches yet",e?" in this project":"",".",ie.jsx("br",{}),"Outcomes fill in as sessions work on branches and their PRs merge — or get reverted."]})});return ie.jsxs(ie.Fragment,{children:[ie.jsx(C,{title:"Outcomes",hint:ie.jsxs(ie.Fragment,{children:[l.total," branch",l.total===1?"":"es"," · ",l.merged," merged ·"," ",l.reverted>0?ie.jsxs("b",{style:{color:"var(--bad)"},children:[l.reverted," reverted"]}):"0 reverted"," ","· ",l.open," open"]})}),ie.jsx(C,{title:"By model",hint:"who ships work that survives",spaced:!0,children:ie.jsx(de,{id:"outcomes-model",defaultPageSize:0,columns:ky("model"),rows:t.byModel,rowKey:(o)=>o.key})}),t.byAgent.length>1&&ie.jsx(C,{title:"By agent",spaced:!0,children:ie.jsx(de,{id:"outcomes-agent",defaultPageSize:0,columns:ky("agent"),rows:t.byAgent,rowKey:(o)=>o.key})}),ie.jsx(C,{title:"Branches",hint:"latest first",spaced:!0,children:ie.jsx(de,{id:"outcomes-branches",columns:Rx,rows:t.branches,rowKey:(o)=>o.branch})})]})}var Ey=S(B(),1);var De=S(M(),1);function Cx(e){if(e==="pass")return De.jsx(N,{tone:"ok",children:"Checks ✓"});if(e==="fail")return De.jsx(N,{tone:"warn",children:"Checks ✗"});if(e==="pending")return De.jsx(N,{children:"Running…"});return De.jsx(H,{})}function Ax(e){if(e==="approved")return De.jsx(N,{tone:"ok",children:"Approved"});if(e==="changes")return De.jsx(N,{tone:"warn",children:"Changes"});return De.jsx(H,{})}var zx=[{key:"repo",label:"repo",width:170,get:(e)=>e.repo,cell:(e)=>De.jsxs(De.Fragment,{children:[_(e.forge==="gitlab"?"git-merge":"git-pull-request",13)," ",De.jsx("span",{className:"br",children:e.repo.split("/").pop()})]})},{key:"title",label:"title",flex:!0,get:(e)=>e.title,cell:(e)=>De.jsxs(De.Fragment,{children:[De.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:[De.jsxs("b",{children:["#",e.number]})," ",e.title]}),e.draft&&De.jsx(N,{children:"Draft"})]})},{key:"branch",label:"branch",width:170,get:(e)=>e.branch,cell:(e)=>De.jsx("span",{className:"br",children:e.branch})},{key:"author",label:"author",width:110,get:(e)=>e.author,cell:(e)=>e.author},{key:"checks",label:"checks",width:100,get:(e)=>e.checks,cell:(e)=>Cx(e.checks)},{key:"review",label:"review",width:100,get:(e)=>e.review,cell:(e)=>Ax(e.review)},{key:"age",label:"age",width:56,num:!0,get:(e)=>new Date(e.createdAt).getTime(),cell:(e)=>De.jsx("span",{className:"dim",children:Pe(e.createdAt)})}],_x=(e)=>e.checks==="fail"?"waiting":e.checks==="pass"?"active":"idle";function Ny(){let{data:e,loading:t,error:n,reload:a}=te(Re.prs()),l=Ey.useMemo(()=>e??[],[e]),o=Pa(a);if(n&&!e)return De.jsx(xe,{error:n,onRetry:a});if(t&&!e)return De.jsx(ue,{});return De.jsx(C,{title:"Pull requests",hint:`${l.length} open · GitHub + GitLab, merged from here`,children:l.length>0?De.jsx(de,{id:"prs",columns:zx,rows:l,rowKey:(i)=>`${i.repo}#${i.number}`,leading:{width:24,cell:(i)=>De.jsx("span",{className:`s ${_x(i)}`})},trailing:{width:34,cell:(i)=>De.jsx(Gt,{title:"Pull request actions",onOpen:(r)=>Rb(r,i,o)})}}):De.jsxs(Y,{children:["No open pull requests.",De.jsx("br",{}),"Agent branches land here the moment they are pushed."]})})}var zy=S(B(),1);var ur=S(M(),1);function Ty({page:e,onGo:t}){if(e.total<=e.limit)return null;let n=e.total?e.offset+1:0,a=Math.min(e.offset+e.limit,e.total),l=e.offset===0,o=a>=e.total;return ur.jsxs("div",{className:"chips pager",children:[ur.jsxs("button",{type:"button",className:l?"chip off":"chip",disabled:l,onClick:()=>t(Math.max(0,e.offset-e.limit)),children:[_("arrow-left",12)," Newer"]}),ur.jsxs("span",{className:"dim",children:[n,"–",a," of ",e.total]}),ur.jsxs("button",{type:"button",className:o?"chip off":"chip",disabled:o,onClick:()=>t(e.offset+e.limit),children:["Older ",_("arrow-right",12)]})]})}var $l=S(M(),1);function Ry({totals:e}){return $l.jsxs(ut,{children:[$l.jsx(K,{label:"Traced",value:`${e.complete}/${e.tasks}`,detail:"reach a merged PR",tone:e.complete?void 0:"warm"}),$l.jsx(K,{label:"Untracked",value:e.untracked,detail:e.untracked?"landed with no task":"all work has a task",tone:e.untracked?"hot":void 0}),$l.jsx(K,{label:"Unclaimed",value:e.unclaimed,detail:"tasks nobody claimed",tone:e.unclaimed?"warm":void 0}),$l.jsx(K,{label:"Traced spend",value:F(e.costUsd)??"$0.00",detail:"across every chain"})]})}var ce=S(M(),1),Cy=["task","claim","session","branch","pr","merged"],Lx={"no-task":["bad","No task","landed with no task behind it"],unclaimed:["warn","Unclaimed","no claim was ever taken for this task"],"no-session":["warn","No session","claimed, but no session did the work"],"no-branch":["warn","No branch","worked on, but never reached a branch"],"no-pr":["warn","No PR","a branch exists but no pull request"],"open-pr":["acc","Open PR","the pull request has not merged yet"]};function Kx({chain:e}){return ce.jsx("span",{className:"track",title:Cy.map((t)=>`${t}: ${e.links[t]?"yes":"no"}`).join(" · "),children:Cy.map((t)=>ce.jsx("i",{className:e.links[t]?"on":""},t))})}var Ay=50;function jx(e){return[{key:"what",label:"task / branch",width:190,get:(t)=>t.task,cell:(t)=>ce.jsxs(ce.Fragment,{children:[ce.jsx("b",{title:`${t.task}${t.fromTask?"":" — a branch with no task behind it"}`,children:t.task}),!t.fromTask&&ce.jsx(N,{children:"branch"})]})},{key:"track",label:"chain",width:92,sortable:!1,filterable:!1,get:(t)=>t.depth,cell:(t)=>ce.jsx(Kx,{chain:t})},{key:"gap",label:"trail ends at",width:118,get:(t)=>t.brokenAt??"",cell:(t)=>{let n=t.brokenAt?Lx[t.brokenAt]:void 0;if(!n)return ce.jsx(N,{tone:"ok",children:"Merged"});return ce.jsx("span",{title:n[2],children:ce.jsx(N,{tone:n[0],children:n[1]})})}},{key:"title",label:"what it was",flex:!0,get:(t)=>t.title,cell:(t)=>ce.jsx("span",{className:"now",title:t.title,children:t.title})},{key:"who",label:"held by",width:120,get:(t)=>t.holders.join(","),cell:(t)=>t.holders.length>0?t.holders.join(", "):ce.jsx(H,{})},{key:"sess",label:"sessions",width:78,num:!0,get:(t)=>t.sessions.length,cell:(t)=>{let n=t.sessions[0];if(!n)return ce.jsx("span",{className:"dim",children:"0"});return ce.jsx("button",{type:"button",className:"link",title:t.sessions.map((a)=>a.title??a.id).join(" · "),onClick:()=>e(n.id),children:t.sessions.length})}},{key:"pr",label:"PR",width:74,num:!0,get:(t)=>t.prNumber??0,cell:(t)=>t.prNumber?ce.jsxs("a",{href:t.prUrl??"#",target:"_blank",rel:"noopener noreferrer",children:["#",t.prNumber]}):ce.jsx(H,{})},{key:"cost",label:"cost",width:74,num:!0,get:(t)=>t.costUsd,cell:(t)=>F(t.costUsd)??ce.jsx(H,{})},{key:"lead",label:"lead",width:68,num:!0,get:(t)=>t.leadHours??-1,cell:(t)=>t.leadHours===null?ce.jsx(H,{}):fb(t.leadHours)}]}function _y(){let e=T((h)=>h.project),t=T((h)=>h.openSession),[n,a]=zy.useState(0),{data:l,error:o,reload:i}=te(`${Re.provenance(e)}${Re.provenance(e).includes("?")?"&":"?"}${Ae({limit:Ay,offset:n}).slice(1)}`);if(o&&!l)return ce.jsx(xe,{error:o,onRetry:i});if(!l)return ce.jsx(ue,{});if(l.chains.length===0&&n===0)return ce.jsx(C,{title:"Provenance",hint:"follow the work back",children:ce.jsxs(Y,{children:["Nothing to trace",e?" in this project":"",".",ce.jsx("br",{}),"Chains appear once a task source is configured or a branch reaches a pull request."]})});let r=l.totals,s=l.page??{limit:Ay,offset:n,total:l.chains.length},c=s.total?s.offset+1:0,d=Math.min(s.offset+s.limit,s.total);return ce.jsxs(ce.Fragment,{children:[ce.jsx(C,{title:"Provenance",hint:`${s.total} chain${s.total===1?"":"s"} · ${r.untracked?`${r.untracked} untracked`:"every branch has a task"}`}),ce.jsx(Ry,{totals:r}),ce.jsx(de,{id:"provenance",columns:jx(t),rows:l.chains,rowKey:(h)=>h.task}),ce.jsx(Ty,{page:s,onGo:a}),l.stale&&ce.jsxs("p",{className:"dim note",children:[_("arrows-clockwise",12)," Pull request state is still loading from the forge — it fills in on the next refresh."]}),ce.jsxs("p",{className:"dim note",children:["The six dots are task · claim · session · branch · PR · merged — a filled run that stops is where the trail goes cold. Chains are walked from both ends: from tasks forward, and from branches back, so ",ce.jsx("b",{children:"work that landed with no task behind it"})," shows up too. Task rows carry no issue link because the task source records ids and titles, not URLs."]})]})}var I=S(M(),1),Bx={rising:["bad","rising"],falling:["ok","falling"],steady:["","steady"]};function Ux({rule:e}){let[t,n]=Bx[e.trend],a=e.clusters[0];return I.jsxs(qe,{title:e.rule,hint:I.jsxs(I.Fragment,{children:[I.jsx("b",{className:t,children:n})," · ",e.total," incident",e.total===1?"":"s"," ·"," ",e.acked," acked"]}),children:[I.jsxs("div",{className:"rule-spark",children:[I.jsx(qo,{points:e.perDay.map((l)=>l.n)}),I.jsxs("span",{className:"dim",children:[Pe(e.lastAt)," since the last one"]})]}),a&&e.total>1?I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"rule-shape",children:[Math.round(e.concentration*100),"% of these are the same shape:"," ",I.jsx("code",{children:a.signature})]}),I.jsx("ul",{className:"clusters",children:e.clusters.map((l)=>I.jsxs("li",{children:[I.jsx("b",{title:l.signature,children:l.signature}),I.jsxs("span",{className:"n",children:[l.hits,"×"]}),I.jsx("span",{title:l.example,children:l.example})]},l.signature))})]}):I.jsx("p",{className:"dim rule-shape",children:"Fired once. Whatever it was, it has not come back."}),e.landed&&I.jsxs("p",{className:"dim note",children:["Since it landed ",Pe(e.landed.at)," ago: ",I.jsxs("b",{children:[e.landed.afterPerDay.toFixed(1),"/day"]}),", against ",e.landed.beforePerDay.toFixed(1),"/day before."]})]})}function Ly(){let e=T((o)=>o.project),{data:t,error:n,reload:a}=te(Re.ruleEffect(e));if(n&&!t)return I.jsx(xe,{error:n,onRetry:a});if(!t)return I.jsx(ue,{});if(t.rules.length===0)return I.jsx(C,{title:"Rules",hint:"is a rule teaching anyone anything?",children:I.jsxs(Y,{children:["No rule has fired",e?" in this project":""," in the last 30 days.",I.jsx("br",{}),"That is the good outcome: rules exist to be learned and then never hit again."]})});let l=t.totals;return I.jsxs(I.Fragment,{children:[I.jsx(C,{title:"Rules",hint:`${l.incidents} incidents · ${l.rules} rule${l.rules===1?"":"s"} · last 30 days`}),I.jsxs(ut,{children:[I.jsx(K,{label:"Incidents",value:l.incidents,detail:"last 30 days"}),I.jsx(K,{label:"Rules firing",value:l.rules,detail:`${l.acked} incident${l.acked===1?"":"s"} acknowledged`}),I.jsx(K,{label:"Not settling",value:l.unchanged,detail:l.unchanged?"firing as much as ever, or more":"every rule is quieting down",tone:l.unchanged?"hot":void 0}),I.jsx(K,{label:"Change history",value:t.noChangeHistory?"none":"yes",detail:t.noChangeHistory?"no before/after yet":"before/after available"})]}),I.jsx(el,{children:t.rules.map((o)=>I.jsx(Ux,{rule:o},o.rule))}),t.noChangeHistory&&I.jsxs("p",{className:"dim note",children:[I.jsx("b",{children:"No before-and-after yet."})," Comparing a rule's rate before and after it landed needs to know when it landed, and nothing recorded that until now — the daemon writes"," ",I.jsx("code",{children:"rules.changed"})," from this version on, so the comparison fills in for edits made from here."]})]})}var sl=S(B(),1);var Oe=S(M(),1),Hx=[["","All"],["handoff","Handoffs"],["incident","Incidents"],["gate","Gates"],["session","Sessions"]],$x="\x01",qx="\x02";function Gx(e){let t=[],n=e;while(n.length>0){let a=n.indexOf($x);if(a===-1){t.push({text:n,mark:!1});break}if(a>0)t.push({text:n.slice(0,a),mark:!1});let l=n.indexOf(qx,a);if(l===-1){t.push({text:n.slice(a+1),mark:!0});break}t.push({text:n.slice(a+1,l),mark:!0}),n=n.slice(l+1)}return t}function Yx({text:e}){let t=sl.useMemo(()=>Gx(e),[e]);return Oe.jsx("div",{className:"hs",children:t.map((n,a)=>n.mark?Oe.jsx("mark",{children:n.text},a):Oe.jsx("span",{children:n.text},a))})}function Ky(){let e=T((d)=>d.project),t=T((d)=>d.openSession),n=G((d)=>d?.projects??Vx),a=sl.useMemo(()=>{let d=new Map(n.map((h)=>[h.id,h.name]));return(h)=>d.get(h)??"(removed)"},[n]),l=T((d)=>d.search),o=T((d)=>d.setSearch),[i,r]=sl.useState(""),[s,c]=sl.useState(null);return sl.useEffect(()=>{if(!l.trim()){c(null);return}let d=new AbortController,h=setTimeout(()=>{ct(`/v1/memory${Ae({q:l,limit:50,project:e,kind:i||null})}`,d.signal).then((u)=>c(u.hits??[])).catch(()=>{})},150);return()=>{clearTimeout(h),d.abort()}},[l,i,e]),Oe.jsxs(Oe.Fragment,{children:[Oe.jsx(C,{title:"Search",hint:`Swarm's own memory${e?` · ${a(e)}`:" · all projects"} — handoffs, incidents, gates, what sessions said. Never your code.`}),Oe.jsx("div",{className:"srch",children:Oe.jsx("input",{type:"search",placeholder:"pkill, login form, kind:incident git reset, task:M1.2 …",value:l,autoComplete:"off",onChange:(d)=>o(d.target.value)})}),Oe.jsx("div",{className:"chips",children:Hx.map(([d,h])=>Oe.jsx("button",{type:"button",className:i===d?"chip on":"chip",onClick:()=>r(d),children:h},d||"all"))}),s===null?Oe.jsxs(Y,{children:["Type to search. Words are AND-ed, the last one is a prefix; quote a phrase;"," ",Oe.jsx("code",{children:"kind:"})," and ",Oe.jsx("code",{children:"task:"})," filter."]}):s.length===0?Oe.jsxs(Y,{children:["Nothing in memory matches ",Oe.jsx("b",{children:l}),"."]}):s.map((d)=>{let h=d.kind==="session"?d.ref:d.sessionId;return Oe.jsxs("div",{className:"hit",children:[Oe.jsxs("div",{className:"ht",children:[Oe.jsx(N,{children:d.kind}),Oe.jsx("b",{children:d.title}),d.task&&Oe.jsx("span",{className:"br",children:d.task}),Oe.jsx("span",{className:"grow"}),!e&&Oe.jsxs("span",{className:"dim",children:[a(d.projectId)," · "]}),Oe.jsx("span",{className:"dim",children:Pe(d.ts)}),h&&Oe.jsx("button",{type:"button",className:"link",title:"Open the session",onClick:()=>t(h),children:_("arrow-right",12)})]}),Oe.jsx(Yx,{text:d.snippet})]},`${d.kind}:${d.ref}:${d.ts}`)})]})}var Vx=[];var L=S(M(),1);function jy(){let e=T((r)=>r.project),{data:t,error:n,reload:a}=te(Re.security(e));if(n&&!t)return L.jsx(xe,{error:n,onRetry:a});if(!t)return L.jsx(ue,{});let l=t.totals;if(!l.scanned)return L.jsx(C,{title:"Security",hint:"what agents reached for",children:L.jsxs(Y,{children:["No commands recorded",e?" in this project":""," in the last 14 days."]})});let o=t.egress.filter((r)=>!r.local),i=new Set(t.installs.map((r)=>r.ecosystem)).size;return L.jsxs(L.Fragment,{children:[L.jsx(C,{title:"Security",hint:`${l.scanned.toLocaleString()} commands · last 14 days`}),L.jsxs(ut,{children:[L.jsx(K,{label:"Hosts reached",value:l.remoteHosts,detail:`${t.egress.length-l.remoteHosts} more were local`}),L.jsx(K,{label:"Packages installed",value:l.installs,detail:`${i} ecosystem${i===1?"":"s"}`}),L.jsx(K,{label:"Credential files opened",value:l.secrets,detail:l.secrets?"by name — contents are never read":"none",tone:l.secrets?"hot":void 0}),L.jsx(K,{label:"Commands scanned",value:l.scanned.toLocaleString(),detail:"last 14 days"})]}),L.jsxs(el,{children:[L.jsxs(qe,{title:"Hosts reached",hint:"named in a command or a fetch",children:[o.length>0?L.jsxs("table",{className:"mini",children:[L.jsxs("colgroup",{children:[L.jsx("col",{style:{width:"60%"}}),L.jsx("col",{style:{width:"20%"}}),L.jsx("col",{style:{width:"20%"}})]}),L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"host"}),L.jsx("th",{className:"num",children:"times"}),L.jsx("th",{className:"num",children:"sessions"})]})}),L.jsx("tbody",{children:o.slice(0,14).map((r)=>L.jsxs("tr",{children:[L.jsx("td",{className:"clip path",children:L.jsx("b",{children:r.host})}),L.jsx("td",{className:"num",children:r.hits}),L.jsx("td",{className:"num",children:r.sessions})]},r.host))})]}):L.jsx("div",{className:"dim",children:"Nothing but localhost."}),L.jsxs("p",{className:"dim note",children:["A host here means an agent ",L.jsx("em",{children:"named"})," it. Whether bytes left is not something Swarm can see without running the command, so it over-reports rather than under-reports."]})]}),L.jsxs(tc,{children:[L.jsx(qe,{title:"Credential files",hint:"opened by name",children:t.secrets.length>0?L.jsxs(L.Fragment,{children:[L.jsx("ul",{className:"plainlist",children:t.secrets.map((r)=>L.jsxs("li",{children:[L.jsx(N,{tone:"warn",children:r.what}),L.jsxs("b",{children:[r.hits,"×"]}),L.jsxs("span",{className:"dim",children:[r.sessions," session",r.sessions===1?"":"s"]})]},r.what))}),L.jsxs("p",{className:"dim note",children:["Swarm reads the ",L.jsx("em",{children:"path"}),", never the contents — this says something opened the file and nothing about what was in it."]})]}):L.jsx("div",{className:"dim",children:"No credential file was opened by name."})}),L.jsx(qe,{title:"Packages installed",hint:"what the machine will run later",children:t.installs.length>0?L.jsx("ul",{className:"plainlist",children:t.installs.slice(0,12).map((r)=>L.jsxs("li",{children:[L.jsx(N,{children:r.ecosystem}),L.jsx("b",{children:r.pkg}),L.jsxs("span",{className:"dim",children:[r.hits,"×"]})]},`${r.ecosystem}:${r.pkg}`))}):L.jsx("div",{className:"dim",children:"Nothing was installed."})})]})]}),L.jsxs("p",{className:"dim note",children:[L.jsx("b",{children:"This is a lint, not a sandbox."})," Everything here is matched against the recorded command text, so an obfuscated command will not match and a comment mentioning"," ",L.jsx("code",{children:".env"})," will. It is here to tell you what your fleet does, so you can decide what to write an ",L.jsx("code",{children:"ask"})," rule about."]})]})}var Vo=S(B(),1);var Mn=S(B(),1);var ft=S(M(),1);function By(e){if(e==null)return"";return typeof e==="string"?e:JSON.stringify(e,null,2)}var Xx=4000;function Uy({events:e,onClose:t}){let n=Mn.useMemo(()=>e.filter((h)=>h.type==="tool.requested").map((h)=>{let u=h.payload;return{seq:h.seq??0,tool:u?.tool??"tool",summary:u?.summary??""}}),[e]),[a,l]=Mn.useState(0),[o,i]=Mn.useState(null),r=Mn.useRef(new Map),s=n[a],c=Mn.useCallback((h)=>l((u)=>Math.max(0,Math.min(n.length-1,u+h))),[n.length]);if(Mn.useEffect(()=>{let h=(u)=>{if(u.key==="ArrowLeft")c(-1);if(u.key==="ArrowRight")c(1)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[c]),Mn.useEffect(()=>{if(!s)return;let h=r.current.get(s.seq);if(h){i(h);return}i(null);let u=new AbortController;return(async()=>{let p=await ct(`/v1/events/${s.seq}`,u.signal).catch(()=>null),g=e.find((m)=>m.type==="tool.completed"&&(m.seq??0)>s.seq&&m.payload?.summary===s.summary),b=g?.seq?await ct(`/v1/events/${g.seq}`,u.signal).catch(()=>null):null;if(u.signal.aborted)return;let y={input:p?.payload?.toolInput??null,output:b?.payload?.toolResponse??null,ts:p?.ts??null};r.current.set(s.seq,y),i(y)})(),()=>u.abort()},[s,e]),!s)return ft.jsx(ha,{title:"Replay",glyph:"play",onClose:t,children:ft.jsx("div",{className:"empty",children:"No tool calls in this session yet."})});let d=By(o?.output);return ft.jsxs(ha,{title:"Replay",glyph:"play",size:"wn rp",subtitle:ft.jsxs(ft.Fragment,{children:[s.tool,ft.jsx("span",{className:"grow"}),a+1," / ",n.length,o?.ts?` · ${ga(o.ts)}`:""]}),onClose:t,footer:ft.jsxs(ft.Fragment,{children:[ft.jsxs("button",{type:"button",disabled:a===0,onClick:()=>c(-1),children:[_("arrow-left",12)," Prev"]}),ft.jsx("input",{type:"range",className:"rp-range",min:0,max:n.length-1,value:a,"aria-label":"Step",onChange:(h)=>l(Number(h.target.value))}),ft.jsxs("button",{type:"button",className:"primary",disabled:a>=n.length-1,onClick:()=>c(1),children:["Next ",_("arrow-right",12)]})]}),children:[ft.jsx("div",{className:"dim now rp-summary",children:s.summary}),ft.jsx("h4",{children:"input"}),ft.jsx("pre",{className:"snip",children:By(o?.input)||"—"}),ft.jsx("h4",{children:"output"}),ft.jsx("pre",{className:"snip",children:o===null?"loading…":o.output==null?"(no result captured)":d.slice(0,Xx)})]})}var mc=S(B(),1);var Fe=S(M(),1);async function Qx(e,t,n){await Ne(`/v1/runs/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,"POST",{allow:n}),await lt()}function Zx({run:e,ask:t}){let[n,a]=mc.useState(!1),l=async(o)=>{a(!0),await Qx(e.id,t.requestId,o),a(!1)};return Fe.jsxs("div",{className:"perm",children:[Fe.jsxs("div",{className:"perm-t",children:[_("warning",13)," ",Fe.jsx("b",{children:t.tool})," needs approval",Fe.jsxs("span",{className:"dim now",title:t.reason,children:[" ","— ",t.reason]})]}),Fe.jsx("div",{className:"perm-c",children:t.display}),Fe.jsxs("div",{className:"perm-b",children:[Fe.jsx("button",{type:"button",className:"ok",disabled:n,onClick:()=>void l(!0),children:"Allow"}),Fe.jsx("button",{type:"button",className:"danger",disabled:n,onClick:()=>void l(!1),children:"Deny"})]})]})}function Hy({sessionId:e,kind:t,runs:n}){let[a,l]=mc.useState(""),[o,i]=mc.useState(!1),r=n.find((d)=>d.sessionId===e);if(t!=="spawned")return null;if(!r)return Fe.jsx("div",{className:"stdin",children:Fe.jsxs("span",{className:"hint",children:[_("play",12)," spawned by swarm run · no longer live"]})});let s=async()=>{let d=a.trim();if(!d||o)return;i(!0),await Ne(`/v1/runs/${encodeURIComponent(r.id)}/send`,"POST",{text:d}),l(""),i(!1),await lt()},c=async()=>{if(!confirm(`Stop run ${r.id}?`))return;await Ne(`/v1/runs/${encodeURIComponent(r.id)}`,"DELETE"),await lt()};return Fe.jsxs(Fe.Fragment,{children:[r.pending.map((d)=>Fe.jsx(Zx,{run:r,ask:d},d.requestId)),Fe.jsxs("div",{className:"stdin",children:[Fe.jsx("input",{placeholder:"Send a message to this run… (Enter)",autoComplete:"off",spellCheck:!1,value:a,onChange:(d)=>l(d.target.value),onKeyDown:(d)=>{if(d.key==="Enter")s()}}),Fe.jsxs("button",{type:"button",disabled:o||!a.trim(),onClick:()=>void s(),children:[_("arrow-right",13)," Send"]}),Fe.jsx("button",{type:"button",className:"danger",onClick:()=>void c(),children:"Stop"}),Fe.jsxs("span",{className:"hint",children:["run ",r.id," · pid ",r.pid,r.result?` · ${F(r.result.costUsd)} so far`:""]})]})]})}var $y=900;async function qy(e,t){let n=`/v1/sessions/${encodeURIComponent(e)}/resume`,a=await ct(n);if(!a.ok)return t(a.error??"nothing to resume from"),null;let l=a.prompt??"",o=l.slice(0,$y)+(l.length>$y?"…":""),i=a.owner?` as ${a.owner}`:"";if(!confirm(`Resume ${a.task}${i}?
21
+ ${Ao(S,"reason")}`:""}`,children:BX(Ao(S,"command"))})},{key:"reason",label:"reason",width:260,get:(S)=>Ao(S,"reason"),cell:(S)=>ce.jsx("span",{className:"dim now",title:Ao(S,"reason"),children:Ao(S,"reason")})},{key:"acked",label:"acked",width:80,get:(S)=>S.acked??"",cell:(S)=>S.acked?ce.jsx("span",{className:"dim",title:S.acked,children:vt(S.acked)}):ce.jsx(H,{tone:"warn",children:"Open"})}];return e?v.filter((S)=>S.key!=="project"):v},[e,d,u,t]);if(r&&!n)return ce.jsx(Ke,{error:r,onRetry:s});if(!n)return ce.jsx(Me,{});return ce.jsxs(ce.Fragment,{children:[ce.jsx(F,{title:"Incidents",hint:ce.jsxs(ce.Fragment,{children:[f," open · ",m.length," shown · every ask/deny the rules made",p.length>0&&ce.jsxs(ce.Fragment,{children:[" · ",p.map(([v,S])=>ce.jsxs("span",{children:[ce.jsx("span",{className:"br",children:v})," ",ce.jsx("b",{children:S})," "]},v))]})]})}),ce.jsxs("div",{className:"chips",children:[ce.jsx("button",{type:"button",className:o?"chip on":"chip",onClick:()=>a(!0),children:"Open"}),ce.jsx("button",{type:"button",className:o?"chip":"chip on",onClick:()=>a(!1),children:"All"}),f>0&&ce.jsxs("button",{type:"button",className:"chip",title:`Mark every open incident${e?" in this project":""} as seen`,onClick:async()=>{await oI(e),s()},children:["Ack all ",ce.jsx("b",{children:f})]})]}),m.length>0?ce.jsx(ke,{id:"incidents-feed",columns:b,rows:m,rowKey:(v)=>String(v.seq),leading:{width:24,cell:(v)=>ce.jsx("span",{className:`s ${v.acked?"ended":["deny","orphaned","failed"].includes(Ao(v,"action"))?"waiting":"idle"}`})},trailing:{width:70,cell:(v)=>v.acked?null:ce.jsx("button",{type:"button",className:"mini-act",onClick:async()=>{await tI(v.seq),s()},children:"Ack"})}}):ce.jsxs(ee,{children:[o?"No open incidents.":"No incidents yet.",ce.jsx("br",{}),"Every ",ce.jsx("code",{children:"ask"})," or ",ce.jsx("code",{children:"deny"})," a rule makes lands here; ack it once you have seen it."]})]})}var PX=[],zX=[];var Je=x(T(),1),Eg=(e)=>Vd(e)??Je.jsx(Z,{}),UX=[{key:"server",label:"server",width:170,get:(e)=>e.server,cell:(e)=>Je.jsxs(Je.Fragment,{children:[Je.jsx("b",{children:e.server}),!e.mcp&&Je.jsx(H,{children:"built-in"})]})},{key:"calls",label:"calls",width:74,num:!0,get:(e)=>e.calls,cell:(e)=>e.calls.toLocaleString()},{key:"sessions",label:"sessions",width:78,num:!0,get:(e)=>e.sessions,cell:(e)=>e.sessions},{key:"p50",label:"p50",width:68,num:!0,get:(e)=>e.p50Ms??-1,cell:(e)=>Eg(e.p50Ms)},{key:"p95",label:"p95",width:68,num:!0,get:(e)=>e.p95Ms??-1,cell:(e)=>Eg(e.p95Ms)},{key:"max",label:"slowest",width:78,num:!0,get:(e)=>e.maxMs??-1,cell:(e)=>Je.jsx("span",{className:"dim",title:"Includes any time the call spent waiting on a person",children:Eg(e.maxMs)})},{key:"wait",label:"waited",width:82,num:!0,get:(e)=>e.totalMs,cell:(e)=>oa(e.totalMs)},{key:"unans",label:"no reply",width:78,num:!0,get:(e)=>e.unanswered,cell:(e)=>e.unanswered>0?Je.jsx("b",{className:"bad",children:e.unanswered}):Je.jsx("span",{className:"dim",children:"0"})},{key:"err",label:"errors",width:74,num:!0,get:(e)=>e.errorRate,cell:(e)=>e.errors>0?Je.jsxs("b",{className:"bad",children:[Math.round(e.errorRate*100),"%"]}):Je.jsx("span",{className:"dim",children:"0"})},{key:"tools",label:"busiest tools",flex:!0,sortable:!1,filterable:!1,cell:(e)=>Je.jsx(Je.Fragment,{children:e.tools.map((t)=>Je.jsxs("span",{className:"br",title:`${t.tool} · ${t.calls} calls${t.p50Ms===null?"":` · p50 ${t.p50Ms}ms`}`,children:[t.tool," ",Je.jsx("b",{children:t.calls})]},t.tool))})}];function ux(){let e=B((s)=>s.project),{data:t,error:o,reload:a}=ie(Fe.mcpHealth(e));if(o&&!t)return Je.jsx(Ke,{error:o,onRetry:a});if(!t)return Je.jsx(Me,{});if(t.servers.length===0)return Je.jsx(F,{title:"MCP",hint:"server health",children:Je.jsxs(ee,{children:["No tool calls in the last 7 days",e?" in this project":"","."]})});let n=t.totals,r=n.totalMs?Math.round(n.mcpMs/n.totalMs*100):0;return Je.jsxs(F,{title:"MCP",hint:`${n.servers} MCP server${n.servers===1?"":"s"} · ${n.calls.toLocaleString()} call${n.calls===1?"":"s"} · last 7 days · ${oa(n.mcpMs)} waiting on MCP (${r}% of all tool time)`,children:[Je.jsx(ke,{id:"mcp-health",columns:UX,rows:t.servers,rowKey:(s)=>s.server,defaultPageSize:0}),Je.jsxs("p",{className:"dim note",children:["Latency is measured hook to hook, so it is the wall-clock an agent actually waited — a call held behind a permission prompt carries that wait too, which is why ",Je.jsx("b",{children:"slowest"})," can be hours and p50/p95 are the numbers to read. ",Je.jsx("b",{children:"errors"})," counts only unambiguous failures: a command that merely prints the word “error” is not one."]})]})}var mx=x(R(),1);var we=x(T(),1);function FX(e){if(e==="merged")return we.jsx(H,{tone:"ok",children:"merged"});if(e==="reverted")return we.jsx(H,{tone:"bad",children:"reverted"});if(e==="open")return we.jsx(H,{tone:"acc",children:"open"});return we.jsx(H,{children:"no PR"})}function dx(e){return[{key:"key",label:e,width:150,get:(t)=>t.key,cell:(t)=>we.jsx("b",{children:e==="model"?wo(t.key):St(t.key)})},{key:"branches",label:"branches",width:80,num:!0,get:(t)=>t.branches,cell:(t)=>t.branches},{key:"merged",label:"merged",width:72,num:!0,get:(t)=>t.merged,cell:(t)=>t.merged},{key:"reverted",label:"reverted",width:78,num:!0,get:(t)=>t.reverted,cell:(t)=>t.reverted>0?we.jsx("b",{style:{color:"var(--bad)"},children:t.reverted}):"0"},{key:"open",label:"open",width:60,num:!0,get:(t)=>t.open,cell:(t)=>t.open},{key:"nopr",label:"no PR",width:64,num:!0,get:(t)=>t.noPr,cell:(t)=>t.noPr},{key:"rate",label:"merge rate",width:92,num:!0,get:(t)=>t.mergeRate??-1,cell:(t)=>Yw(t.mergeRate)},{key:"lead",label:"median lead",width:98,num:!0,get:(t)=>t.medianLeadHours??-1,cell:(t)=>fg(t.medianLeadHours)},{key:"cpm",label:"$ / merge",width:84,num:!0,get:(t)=>t.costPerMerge??-1,cell:(t)=>se(t.costPerMerge)??we.jsx(Z,{})}]}var _X=[{key:"branch",label:"branch",width:190,get:(e)=>e.branch,cell:(e)=>we.jsx("span",{className:"br",children:e.branch})},{key:"outcome",label:"outcome",width:92,cls:"td-badge",get:(e)=>e.outcome,cell:(e)=>FX(e.outcome)},{key:"pr",label:"PR",flex:!0,get:(e)=>e.title??"",cell:(e)=>e.prNumber?we.jsxs(we.Fragment,{children:[we.jsxs("a",{href:e.url??"#",target:"_blank",rel:"noopener noreferrer",children:["#",e.prNumber]})," ",we.jsx("span",{className:"dim",children:e.title??""})]}):we.jsx("span",{className:"faint",children:"—"})},{key:"model",label:"model",width:92,get:(e)=>wo(e.model),cell:(e)=>we.jsx("span",{className:"br",children:wo(e.model)})},{key:"agent",label:"agent",width:78,cls:"td-badge",get:(e)=>St(e.agent),cell:(e)=>we.jsx(Vi,{agent:e.agent})},{key:"sessions",label:"sessions",width:76,num:!0,get:(e)=>e.sessions.length,cell:(e)=>e.sessions.length},{key:"cost",label:"cost",width:64,num:!0,get:(e)=>e.costUsd,cell:(e)=>se(e.costUsd)??we.jsx(Z,{})},{key:"lead",label:"lead",width:64,num:!0,get:(e)=>e.leadHours??-1,cell:(e)=>fg(e.leadHours)}];function fx(){let e=B((r)=>r.project),{data:t,error:o,reload:a}=ie(Fe.outcomes(e)),n=mx.useMemo(()=>{let r=t?.branches??[],s=(l)=>r.filter((c)=>c.outcome===l).length;return{total:r.length,merged:s("merged"),reverted:s("reverted"),open:s("open")}},[t]);if(o&&!t)return we.jsx(Ke,{error:o,onRetry:a});if(!t)return we.jsx(Me,{});if(t.branches.length===0)return we.jsx(F,{title:"Outcomes",hint:"did the work survive?",children:we.jsxs(ee,{children:["No agent branches yet",e?" in this project":"",".",we.jsx("br",{}),"Outcomes fill in as sessions work on branches and their PRs merge — or get reverted."]})});return we.jsxs(we.Fragment,{children:[we.jsx(F,{title:"Outcomes",hint:we.jsxs(we.Fragment,{children:[n.total," branch",n.total===1?"":"es"," · ",n.merged," merged ·"," ",n.reverted>0?we.jsxs("b",{style:{color:"var(--bad)"},children:[n.reverted," reverted"]}):"0 reverted"," ","· ",n.open," open"]})}),we.jsx(F,{title:"By model",hint:"who ships work that survives",spaced:!0,children:we.jsx(ke,{id:"outcomes-model",defaultPageSize:0,columns:dx("model"),rows:t.byModel,rowKey:(r)=>r.key})}),t.byAgent.length>1&&we.jsx(F,{title:"By agent",spaced:!0,children:we.jsx(ke,{id:"outcomes-agent",defaultPageSize:0,columns:dx("agent"),rows:t.byAgent,rowKey:(r)=>r.key})}),we.jsx(F,{title:"Branches",hint:"latest first",spaced:!0,children:we.jsx(ke,{id:"outcomes-branches",columns:_X,rows:t.branches,rowKey:(r)=>r.branch})})]})}var px=x(R(),1);var $e=x(T(),1);function jX(e){if(e==="pass")return $e.jsx(H,{tone:"ok",children:"Checks ✓"});if(e==="fail")return $e.jsx(H,{tone:"warn",children:"Checks ✗"});if(e==="pending")return $e.jsx(H,{children:"Running…"});return $e.jsx(Z,{})}function GX(e){if(e==="approved")return $e.jsx(H,{tone:"ok",children:"Approved"});if(e==="changes")return $e.jsx(H,{tone:"warn",children:"Changes"});return $e.jsx(Z,{})}var VX=[{key:"repo",label:"repo",width:170,get:(e)=>e.repo,cell:(e)=>$e.jsxs($e.Fragment,{children:[z(e.forge==="gitlab"?"git-merge":"git-pull-request",13)," ",$e.jsx("span",{className:"br",children:e.repo.split("/").pop()})]})},{key:"title",label:"title",flex:!0,get:(e)=>e.title,cell:(e)=>$e.jsxs($e.Fragment,{children:[$e.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:[$e.jsxs("b",{children:["#",e.number]})," ",e.title]}),e.draft&&$e.jsx(H,{children:"Draft"})]})},{key:"branch",label:"branch",width:170,get:(e)=>e.branch,cell:(e)=>$e.jsx("span",{className:"br",children:e.branch})},{key:"author",label:"author",width:110,get:(e)=>e.author,cell:(e)=>e.author},{key:"checks",label:"checks",width:100,get:(e)=>e.checks,cell:(e)=>jX(e.checks)},{key:"review",label:"review",width:100,get:(e)=>e.review,cell:(e)=>GX(e.review)},{key:"age",label:"age",width:56,num:!0,get:(e)=>new Date(e.createdAt).getTime(),cell:(e)=>$e.jsx("span",{className:"dim",children:vt(e.createdAt)})}],KX=(e)=>e.checks==="fail"?"waiting":e.checks==="pass"?"active":"idle";function hx(){let{data:e,loading:t,error:o,reload:a}=ie(Fe.prs()),n=px.useMemo(()=>e??[],[e]),r=Ir(a);if(o&&!e)return $e.jsx(Ke,{error:o,onRetry:a});if(t&&!e)return $e.jsx(Me,{});return $e.jsx(F,{title:"Pull requests",hint:`${n.length} open · GitHub + GitLab, merged from here`,children:n.length>0?$e.jsx(ke,{id:"prs",columns:VX,rows:n,rowKey:(s)=>`${s.repo}#${s.number}`,leading:{width:24,cell:(s)=>$e.jsx("span",{className:`s ${KX(s)}`})},trailing:{width:34,cell:(s)=>$e.jsx(Fo,{title:"Pull request actions",onOpen:(l)=>gI(l,s,r)})}}):$e.jsxs(ee,{children:["No open pull requests.",$e.jsx("br",{}),"Agent branches land here the moment they are pushed."]})})}var yx=x(R(),1);var Ec=x(T(),1);function gx({page:e,onGo:t}){if(e.total<=e.limit)return null;let o=e.total?e.offset+1:0,a=Math.min(e.offset+e.limit,e.total),n=e.offset===0,r=a>=e.total;return Ec.jsxs("div",{className:"chips pager",children:[Ec.jsxs("button",{type:"button",className:n?"chip off":"chip",disabled:n,onClick:()=>t(Math.max(0,e.offset-e.limit)),children:[z("arrow-left",12)," Newer"]}),Ec.jsxs("span",{className:"dim",children:[o,"–",a," of ",e.total]}),Ec.jsxs("button",{type:"button",className:r?"chip off":"chip",disabled:r,onClick:()=>t(e.offset+e.limit),children:["Older ",z("arrow-right",12)]})]})}var vs=x(T(),1);function bx({totals:e}){return vs.jsxs($t,{children:[vs.jsx(K,{label:"Traced",value:`${e.complete}/${e.tasks}`,detail:"reach a merged PR",tone:e.complete?void 0:"warm"}),vs.jsx(K,{label:"Untracked",value:e.untracked,detail:e.untracked?"landed with no task":"all work has a task",tone:e.untracked?"hot":void 0}),vs.jsx(K,{label:"Unclaimed",value:e.unclaimed,detail:"tasks nobody claimed",tone:e.unclaimed?"warm":void 0}),vs.jsx(K,{label:"Traced spend",value:se(e.costUsd)??"$0.00",detail:"across every chain"})]})}var ge=x(T(),1),vx=["task","claim","session","branch","pr","merged"],qX={"no-task":["bad","No task","landed with no task behind it"],unclaimed:["warn","Unclaimed","no claim was ever taken for this task"],"no-session":["warn","No session","claimed, but no session did the work"],"no-branch":["warn","No branch","worked on, but never reached a branch"],"no-pr":["warn","No PR","a branch exists but no pull request"],"open-pr":["acc","Open PR","the pull request has not merged yet"]};function $X({chain:e}){return ge.jsx("span",{className:"track",title:vx.map((t)=>`${t}: ${e.links[t]?"yes":"no"}`).join(" · "),children:vx.map((t)=>ge.jsx("i",{className:e.links[t]?"on":""},t))})}var Sx=50;function WX(e){return[{key:"what",label:"task / branch",width:190,get:(t)=>t.task,cell:(t)=>ge.jsxs(ge.Fragment,{children:[ge.jsx("b",{title:`${t.task}${t.fromTask?"":" — a branch with no task behind it"}`,children:t.task}),!t.fromTask&&ge.jsx(H,{children:"branch"})]})},{key:"track",label:"chain",width:92,sortable:!1,filterable:!1,get:(t)=>t.depth,cell:(t)=>ge.jsx($X,{chain:t})},{key:"gap",label:"trail ends at",width:118,get:(t)=>t.brokenAt??"",cell:(t)=>{let o=t.brokenAt?qX[t.brokenAt]:void 0;if(!o)return ge.jsx(H,{tone:"ok",children:"Merged"});return ge.jsx("span",{title:o[2],children:ge.jsx(H,{tone:o[0],children:o[1]})})}},{key:"title",label:"what it was",flex:!0,get:(t)=>t.title,cell:(t)=>ge.jsx("span",{className:"now",title:t.title,children:t.title})},{key:"who",label:"held by",width:120,get:(t)=>t.holders.join(","),cell:(t)=>t.holders.length>0?t.holders.join(", "):ge.jsx(Z,{})},{key:"sess",label:"sessions",width:78,num:!0,get:(t)=>t.sessions.length,cell:(t)=>{let o=t.sessions[0];if(!o)return ge.jsx("span",{className:"dim",children:"0"});return ge.jsx("button",{type:"button",className:"link",title:t.sessions.map((a)=>a.title??a.id).join(" · "),onClick:()=>e(o.id),children:t.sessions.length})}},{key:"pr",label:"PR",width:74,num:!0,get:(t)=>t.prNumber??0,cell:(t)=>t.prNumber?ge.jsxs("a",{href:t.prUrl??"#",target:"_blank",rel:"noopener noreferrer",children:["#",t.prNumber]}):ge.jsx(Z,{})},{key:"cost",label:"cost",width:74,num:!0,get:(t)=>t.costUsd,cell:(t)=>se(t.costUsd)??ge.jsx(Z,{})},{key:"lead",label:"lead",width:68,num:!0,get:(t)=>t.leadHours??-1,cell:(t)=>t.leadHours===null?ge.jsx(Z,{}):Xw(t.leadHours)}]}function wx(){let e=B((m)=>m.project),t=B((m)=>m.openSession),[o,a]=yx.useState(0),{data:n,error:r,reload:s}=ie(`${Fe.provenance(e)}${Fe.provenance(e).includes("?")?"&":"?"}${ze({limit:Sx,offset:o}).slice(1)}`);if(r&&!n)return ge.jsx(Ke,{error:r,onRetry:s});if(!n)return ge.jsx(Me,{});if(n.chains.length===0&&o===0)return ge.jsx(F,{title:"Provenance",hint:"follow the work back",children:ge.jsxs(ee,{children:["Nothing to trace",e?" in this project":"",".",ge.jsx("br",{}),"Chains appear once a task source is configured or a branch reaches a pull request."]})});let l=n.totals,c=n.page??{limit:Sx,offset:o,total:n.chains.length},u=c.total?c.offset+1:0,d=Math.min(c.offset+c.limit,c.total);return ge.jsxs(ge.Fragment,{children:[ge.jsx(F,{title:"Provenance",hint:ge.jsxs(ge.Fragment,{children:[c.total," chain",c.total===1?"":"s"," ·"," ",l.untracked?ge.jsxs("b",{className:"navcount",children:[l.untracked," untracked"]}):"every branch has a task"]})}),ge.jsx(bx,{totals:l}),ge.jsx(ke,{id:"provenance",columns:WX(t),rows:n.chains,rowKey:(m)=>m.task}),ge.jsx(gx,{page:c,onGo:a}),n.stale&&ge.jsxs("p",{className:"dim note",children:[z("arrows-clockwise",12)," Pull request state is still loading from the forge — it fills in on the next refresh."]}),ge.jsxs("p",{className:"dim note",children:["The six dots are task · claim · session · branch · PR · merged — a filled run that stops is where the trail goes cold. Chains are walked from both ends: from tasks forward, and from branches back, so ",ge.jsx("b",{children:"work that landed with no task behind it"})," shows up too. Task rows carry no issue link because the task source records ids and titles, not URLs."]})]})}var ue=x(T(),1),ZX={rising:["bad","rising"],falling:["ok","falling"],steady:["","steady"]};function YX({rule:e}){let[t,o]=ZX[e.trend],a=e.clusters[0];return ue.jsxs(ut,{title:e.rule,hint:ue.jsxs(ue.Fragment,{children:[ue.jsx("b",{className:t,children:o})," · ",e.total," incident",e.total===1?"":"s"," ·"," ",e.acked," acked"]}),children:[ue.jsxs("div",{className:"rule-spark",children:[ue.jsx(qi,{points:e.perDay.map((n)=>n.n)}),ue.jsxs("span",{className:"dim",children:[vt(e.lastAt)," since the last one"]})]}),a&&e.total>1?ue.jsxs(ue.Fragment,{children:[ue.jsxs("p",{className:"rule-shape",children:[Math.round(e.concentration*100),"% of these are the same shape:"," ",ue.jsx("code",{children:a.signature})]}),ue.jsx("ul",{className:"clusters",children:e.clusters.map((n)=>ue.jsxs("li",{children:[ue.jsx("b",{title:n.signature,children:n.signature}),ue.jsxs("span",{className:"n",children:[n.hits,"×"]}),ue.jsx("span",{title:n.example,children:n.example})]},n.signature))})]}):ue.jsx("p",{className:"dim rule-shape",children:"Fired once. Whatever it was, it has not come back."}),e.landed&&ue.jsxs("p",{className:"dim note",children:["Since it landed ",vt(e.landed.at)," ago: ",ue.jsxs("b",{children:[e.landed.afterPerDay.toFixed(1),"/day"]}),", against ",e.landed.beforePerDay.toFixed(1),"/day before."]})]})}function Ix(){let e=B((r)=>r.project),{data:t,error:o,reload:a}=ie(Fe.ruleEffect(e));if(o&&!t)return ue.jsx(Ke,{error:o,onRetry:a});if(!t)return ue.jsx(Me,{});if(t.rules.length===0)return ue.jsx(F,{title:"Rules",hint:"is a rule teaching anyone anything?",children:ue.jsxs(ee,{children:["No rule has fired",e?" in this project":""," in the last 30 days.",ue.jsx("br",{}),"That is the good outcome: rules exist to be learned and then never hit again."]})});let n=t.totals;return ue.jsxs(ue.Fragment,{children:[ue.jsx(F,{title:"Rules",hint:`${n.incidents} incidents · ${n.rules} rule${n.rules===1?"":"s"} · last 30 days`}),ue.jsxs($t,{children:[ue.jsx(K,{label:"Incidents",value:n.incidents,detail:"last 30 days"}),ue.jsx(K,{label:"Rules firing",value:n.rules,detail:`${n.acked} incident${n.acked===1?"":"s"} acknowledged`}),ue.jsx(K,{label:"Not settling",value:n.unchanged,detail:n.unchanged?"firing as much as ever, or more":"every rule is quieting down",tone:n.unchanged?"hot":void 0}),ue.jsx(K,{label:"Change history",value:t.noChangeHistory?"none":"yes",detail:t.noChangeHistory?"no before/after yet":"before/after available"})]}),ue.jsx(kr,{children:t.rules.map((r)=>ue.jsx(YX,{rule:r},r.rule))}),t.noChangeHistory&&ue.jsxs("p",{className:"dim note",children:[ue.jsx("b",{children:"No before-and-after yet."})," Comparing a rule's rate before and after it landed needs to know when it landed, and nothing recorded that until now — the daemon writes"," ",ue.jsx("code",{children:"rules.changed"})," from this version on, so the comparison fills in for edits made from here."]})]})}var Rr=x(R(),1);var We=x(T(),1),XX=[["","All"],["handoff","Handoffs"],["incident","Incidents"],["gate","Gates"],["session","Sessions"]],QX="\x01",JX="\x02";function eQ(e){let t=[],o=e;while(o.length>0){let a=o.indexOf(QX);if(a===-1){t.push({text:o,mark:!1});break}if(a>0)t.push({text:o.slice(0,a),mark:!1});let n=o.indexOf(JX,a);if(n===-1){t.push({text:o.slice(a+1),mark:!0});break}t.push({text:o.slice(a+1,n),mark:!0}),o=o.slice(n+1)}return t}function tQ({text:e}){let t=Rr.useMemo(()=>eQ(e),[e]);return We.jsx("div",{className:"hs",children:t.map((o,a)=>o.mark?We.jsx("mark",{children:o.text},a):We.jsx("span",{children:o.text},a))})}function xx(){let e=B((d)=>d.project),t=B((d)=>d.openSession),o=q((d)=>d?.projects??oQ),a=Rr.useMemo(()=>{let d=new Map(o.map((m)=>[m.id,m.name]));return(m)=>d.get(m)??"(removed)"},[o]),n=B((d)=>d.search),r=B((d)=>d.setSearch),[s,l]=Rr.useState(""),[c,u]=Rr.useState(null);return Rr.useEffect(()=>{if(!n.trim()){u(null);return}let d=new AbortController,m=setTimeout(()=>{qt(`/v1/memory${ze({q:n,limit:50,project:e,kind:s||null})}`,d.signal).then((f)=>u(f.hits??[])).catch(()=>{})},150);return()=>{clearTimeout(m),d.abort()}},[n,s,e]),We.jsxs(We.Fragment,{children:[We.jsx(F,{title:"Search",hint:`Swarm's own memory${e?` · ${a(e)}`:" · all projects"} — handoffs, incidents, gates, what sessions said. Never your code.`}),We.jsx("div",{className:"srch",children:We.jsx("input",{type:"search",placeholder:"pkill, login form, kind:incident git reset, task:M1.2 …",value:n,autoComplete:"off",onChange:(d)=>r(d.target.value)})}),We.jsx("div",{className:"chips",children:XX.map(([d,m])=>We.jsx("button",{type:"button",className:s===d?"chip on":"chip",onClick:()=>l(d),children:m},d||"all"))}),c===null?We.jsxs(ee,{children:["Type to search. Words are AND-ed, the last one is a prefix; quote a phrase;"," ",We.jsx("code",{children:"kind:"})," and ",We.jsx("code",{children:"task:"})," filter."]}):c.length===0?We.jsxs(ee,{children:["Nothing in memory matches ",We.jsx("b",{children:n}),"."]}):c.map((d)=>{let m=d.kind==="session"?d.ref:d.sessionId;return We.jsxs("div",{className:"hit",children:[We.jsxs("div",{className:"ht",children:[We.jsx(H,{children:d.kind}),We.jsx("b",{children:d.title}),d.task&&We.jsx("span",{className:"br",children:d.task}),We.jsx("span",{className:"grow"}),!e&&We.jsxs("span",{className:"dim",children:[a(d.projectId)," · "]}),We.jsx("span",{className:"dim",children:vt(d.ts)}),m&&We.jsx("button",{type:"button",className:"link",title:"Open the session",onClick:()=>t(m),children:z("arrow-right",12)})]}),We.jsx(tQ,{text:d.snippet})]},`${d.kind}:${d.ref}:${d.ts}`)})]})}var oQ=[];var V=x(T(),1);function Cx(){let e=B((l)=>l.project),{data:t,error:o,reload:a}=ie(Fe.security(e));if(o&&!t)return V.jsx(Ke,{error:o,onRetry:a});if(!t)return V.jsx(Me,{});let n=t.totals;if(!n.scanned)return V.jsx(F,{title:"Security",hint:"what agents reached for",children:V.jsxs(ee,{children:["No commands recorded",e?" in this project":""," in the last 14 days."]})});let r=t.egress.filter((l)=>!l.local),s=new Set(t.installs.map((l)=>l.ecosystem)).size;return V.jsxs(V.Fragment,{children:[V.jsx(F,{title:"Security",hint:`${n.scanned.toLocaleString()} commands · last 14 days`}),V.jsxs($t,{children:[V.jsx(K,{label:"Hosts reached",value:n.remoteHosts,detail:`${t.egress.length-n.remoteHosts} more were local`}),V.jsx(K,{label:"Packages installed",value:n.installs,detail:`${s} ecosystem${s===1?"":"s"}`}),V.jsx(K,{label:"Credential files opened",value:n.secrets,detail:n.secrets?"by name — contents are never read":"none",tone:n.secrets?"hot":void 0}),V.jsx(K,{label:"Commands scanned",value:n.scanned.toLocaleString(),detail:"last 14 days"})]}),V.jsxs(kr,{children:[V.jsxs(ut,{title:"Hosts reached",hint:"named in a command or a fetch",children:[r.length>0?V.jsxs("table",{className:"mini",children:[V.jsxs("colgroup",{children:[V.jsx("col",{style:{width:"60%"}}),V.jsx("col",{style:{width:"20%"}}),V.jsx("col",{style:{width:"20%"}})]}),V.jsx("thead",{children:V.jsxs("tr",{children:[V.jsx("th",{children:"host"}),V.jsx("th",{className:"num",children:"times"}),V.jsx("th",{className:"num",children:"sessions"})]})}),V.jsx("tbody",{children:r.slice(0,14).map((l)=>V.jsxs("tr",{children:[V.jsx("td",{className:"clip path",children:V.jsx("b",{children:l.host})}),V.jsx("td",{className:"num",children:l.hits}),V.jsx("td",{className:"num",children:l.sessions})]},l.host))})]}):V.jsx("div",{className:"dim",children:"Nothing but localhost."}),V.jsxs("p",{className:"dim note",children:["A host here means an agent ",V.jsx("em",{children:"named"})," it. Whether bytes left is not something Swarm can see without running the command, so it over-reports rather than under-reports."]})]}),V.jsxs($d,{children:[V.jsx(ut,{title:"Credential files",hint:"opened by name",children:t.secrets.length>0?V.jsxs(V.Fragment,{children:[V.jsx("ul",{className:"plainlist",children:t.secrets.map((l)=>V.jsxs("li",{children:[V.jsx(H,{tone:"warn",children:l.what}),V.jsxs("b",{children:[l.hits,"×"]}),V.jsxs("span",{className:"dim",children:[l.sessions," session",l.sessions===1?"":"s"]})]},l.what))}),V.jsxs("p",{className:"dim note",children:["Swarm reads the ",V.jsx("em",{children:"path"}),", never the contents — this says something opened the file and nothing about what was in it."]})]}):V.jsx("div",{className:"dim",children:"No credential file was opened by name."})}),V.jsx(ut,{title:"Packages installed",hint:"what the machine will run later",children:t.installs.length>0?V.jsx("ul",{className:"plainlist",children:t.installs.slice(0,12).map((l)=>V.jsxs("li",{children:[V.jsx(H,{children:l.ecosystem}),V.jsx("b",{children:l.pkg}),V.jsxs("span",{className:"dim",children:[l.hits,"×"]})]},`${l.ecosystem}:${l.pkg}`))}):V.jsx("div",{className:"dim",children:"Nothing was installed."})})]})]}),V.jsxs("p",{className:"dim note",children:[V.jsx("b",{children:"This is a lint, not a sandbox."})," Everything here is matched against the recorded command text, so an obfuscated command will not match and a comment mentioning"," ",V.jsx("code",{children:".env"})," will. It is here to tell you what your fleet does, so you can decide what to write an ",V.jsx("code",{children:"ask"})," rule about."]})]})}var Wi=x(R(),1);var Ia=x(R(),1);var Xt=x(T(),1);function Mx(e){if(e==null)return"";return typeof e==="string"?e:JSON.stringify(e,null,2)}var aQ=4000;function kx({events:e,onClose:t}){let o=Ia.useMemo(()=>e.filter((m)=>m.type==="tool.requested").map((m)=>{let f=m.payload;return{seq:m.seq??0,tool:f?.tool??"tool",summary:f?.summary??""}}),[e]),[a,n]=Ia.useState(0),[r,s]=Ia.useState(null),l=Ia.useRef(new Map),c=o[a],u=Ia.useCallback((m)=>n((f)=>Math.max(0,Math.min(o.length-1,f+m))),[o.length]);if(Ia.useEffect(()=>{let m=(f)=>{if(f.key==="ArrowLeft")u(-1);if(f.key==="ArrowRight")u(1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[u]),Ia.useEffect(()=>{if(!c)return;let m=l.current.get(c.seq);if(m){s(m);return}s(null);let f=new AbortController;return(async()=>{let p=await qt(`/v1/events/${c.seq}`,f.signal).catch(()=>null),b=e.find((h)=>h.type==="tool.completed"&&(h.seq??0)>c.seq&&h.payload?.summary===c.summary),v=b?.seq?await qt(`/v1/events/${b.seq}`,f.signal).catch(()=>null):null;if(f.signal.aborted)return;let S={input:p?.payload?.toolInput??null,output:v?.payload?.toolResponse??null,ts:p?.ts??null};l.current.set(c.seq,S),s(S)})(),()=>f.abort()},[c,e]),!c)return Xt.jsx(Ea,{title:"Replay",glyph:"play",onClose:t,children:Xt.jsx("div",{className:"empty",children:"No tool calls in this session yet."})});let d=Mx(r?.output);return Xt.jsxs(Ea,{title:"Replay",glyph:"play",size:"wn rp",subtitle:Xt.jsxs(Xt.Fragment,{children:[c.tool,Xt.jsx("span",{className:"grow"}),a+1," / ",o.length,r?.ts?` · ${Oa(r.ts)}`:""]}),onClose:t,footer:Xt.jsxs(Xt.Fragment,{children:[Xt.jsxs("button",{type:"button",disabled:a===0,onClick:()=>u(-1),children:[z("arrow-left",12)," Prev"]}),Xt.jsx("input",{type:"range",className:"rp-range",min:0,max:o.length-1,value:a,"aria-label":"Step",onChange:(m)=>n(Number(m.target.value))}),Xt.jsxs("button",{type:"button",className:"primary",disabled:a>=o.length-1,onClick:()=>u(1),children:["Next ",z("arrow-right",12)]})]}),children:[Xt.jsx("div",{className:"dim now rp-summary",children:c.summary}),Xt.jsx("h4",{children:"input"}),Xt.jsx("pre",{className:"snip",children:Mx(r?.input)||"—"}),Xt.jsx("h4",{children:"output"}),Xt.jsx("pre",{className:"snip",children:r===null?"loading…":r.output==null?"(no result captured)":d.slice(0,aQ)})]})}var sm=x(R(),1);var yt=x(T(),1);async function nQ(e,t,o){await De(`/v1/runs/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,"POST",{allow:o}),await ct()}function rQ({run:e,ask:t}){let[o,a]=sm.useState(!1),n=async(r)=>{a(!0),await nQ(e.id,t.requestId,r),a(!1)};return yt.jsxs("div",{className:"perm",children:[yt.jsxs("div",{className:"perm-t",children:[z("warning",13)," ",yt.jsx("b",{children:t.tool})," needs approval",yt.jsxs("span",{className:"dim now",title:t.reason,children:[" ","— ",t.reason]})]}),yt.jsx("div",{className:"perm-c",children:t.display}),yt.jsxs("div",{className:"perm-b",children:[yt.jsx("button",{type:"button",className:"ok",disabled:o,onClick:()=>void n(!0),children:"Allow"}),yt.jsx("button",{type:"button",className:"danger",disabled:o,onClick:()=>void n(!1),children:"Deny"})]})]})}function Dx({sessionId:e,kind:t,runs:o}){let[a,n]=sm.useState(""),[r,s]=sm.useState(!1),l=o.find((d)=>d.sessionId===e);if(t!=="spawned")return null;if(!l)return yt.jsx("div",{className:"stdin",children:yt.jsxs("span",{className:"hint",children:[z("play",12)," spawned by swarm run · no longer live"]})});let c=async()=>{let d=a.trim();if(!d||r)return;s(!0),await De(`/v1/runs/${encodeURIComponent(l.id)}/send`,"POST",{text:d}),n(""),s(!1),await ct()},u=async()=>{if(!confirm(`Stop run ${l.id}?`))return;await De(`/v1/runs/${encodeURIComponent(l.id)}`,"DELETE"),await ct()};return yt.jsxs(yt.Fragment,{children:[l.pending.map((d)=>yt.jsx(rQ,{run:l,ask:d},d.requestId)),yt.jsxs("div",{className:"stdin",children:[yt.jsx("input",{placeholder:"Send a message to this run… (Enter)",autoComplete:"off",spellCheck:!1,value:a,onChange:(d)=>n(d.target.value),onKeyDown:(d)=>{if(d.key==="Enter")c()}}),yt.jsxs("button",{type:"button",disabled:r||!a.trim(),onClick:()=>void c(),children:[z("arrow-right",13)," Send"]}),yt.jsx("button",{type:"button",className:"danger",onClick:()=>void u(),children:"Stop"}),yt.jsxs("span",{className:"hint",children:["run ",l.id," · pid ",l.pid,l.result?` · ${se(l.result.costUsd)} so far`:""]})]})]})}var Tx=900;async function Ax(e,t){let o=`/v1/sessions/${encodeURIComponent(e)}/resume`,a=await qt(o);if(!a.ok)return t(a.error??"nothing to resume from"),null;let n=a.prompt??"",r=n.slice(0,Tx)+(n.length>Tx?"…":""),s=a.owner?` as ${a.owner}`:"";if(!confirm(`Resume ${a.task}${s}?
22
22
 
23
- ${o}`))return null;let r=await Ne(n,"POST",{});if(!r.ok||!r.run)return t(r.error??"the run did not start"),null;return r.run.sessionId}var Sa=S(B(),1);var cl=S(M(),1),Jx={PreToolUse:"tool",PostToolUse:"result",UserPromptSubmit:"you",Stop:"stop",SubagentStart:"sub →",SubagentStop:"sub ←",Notification:"note",SessionStart:"start",SessionEnd:"end",PreCompact:"compact",assistant:"agent",subagent:"sub","incident.opened":"rule","question.asked":"asks","question.answered":"answer","message.sent":"msg","gate.recorded":"gate","session.stuck":"stuck","permission.requested":"perm?","permission.resolved":"perm","claim.acquired":"claim","claim.released":"release","pr.opened":"pr"},Wx=(e)=>Jx[e]??String(e).split(".").at(-1)??String(e),Px=(e)=>e.payload?.hook==="PostToolUse",Ix=(e)=>!e.text;function Gy(e){let t=e.payload;return{key:`e${e.seq}`,ts:e.ts,kind:t?.hook??e.type,text:t?.summary??"",className:e.type}}function Yy(e){return{key:`t${e.id}`,ts:e.ts,kind:e.sidechain?"subagent":"assistant",text:e.text??"",className:"assistant",output:e.output,cost:e.costUsd}}function Fx(e,t){let n=[],a=0,l=0;while(a<e.length||l<t.length)if(a<e.length&&Px(e[a]))a++;else if(l<t.length&&Ix(t[l]))l++;else if(l>=t.length)n.push(Gy(e[a++]));else if(a>=e.length)n.push(Yy(t[l++]));else if(e[a].ts<t[l].ts)n.push(Gy(e[a++]));else n.push(Yy(t[l++]));return n}function Vy({events:e,turns:t}){let n=Sa.useMemo(()=>Fx(e,t),[e,t]),a=Sa.useRef(null),l=Sa.useRef(!0);return Sa.useLayoutEffect(()=>{let o=a.current;if(!o)return;l.current=o.scrollTop+o.clientHeight>=o.scrollHeight-ek}),Sa.useEffect(()=>{let o=a.current;if(!o||!l.current||n.length===0)return;o.scrollTop=o.scrollHeight},[n]),cl.jsx("div",{id:"log",ref:a,children:n.map((o)=>cl.jsxs("div",{className:`ev ${o.className}`,children:[cl.jsx("span",{className:"t",children:ga(o.ts)}),cl.jsx("span",{className:"k",title:o.kind,children:Wx(o.kind)}),cl.jsxs("span",{className:"m",children:[o.text,o.output?cl.jsxs("span",{className:"dim",children:[" ","· ",Dt(o.output)," out",o.cost!=null&&` · $${o.cost.toFixed(3)}`]}):null]})]},o.key))})}var ek=40;var Ge=S(M(),1),tk={cost:"coin",model:"robot",turns:"arrows-clockwise","tool calls":"wrench",output:"chart-bar",processed:"rows",started:"clock","last seen":"eye","subagent turns":"tree-structure"};function wa({label:e,children:t}){return Ge.jsxs("div",{className:"stat",children:[Ge.jsxs("span",{children:[_(tk[e]??"list-bullets",13),e]}),Ge.jsx("b",{children:t})]})}function Xy({session:e,turns:t}){let n=e.tokens,a=n.input+n.cacheRead+n.cacheWrite,l=a?(100*n.cacheRead/a).toFixed(0):"0",o=t.filter((r)=>r.sidechain||r.agentId).length,i=Object.entries(e.toolCounts).sort((r,s)=>s[1]-r[1]);return Ge.jsxs("aside",{className:"side",children:[Ge.jsxs("div",{className:"stats",children:[Ge.jsx(wa,{label:"cost",children:F(e.costUsd)??"—"}),Ge.jsx(wa,{label:"model",children:Ot(e.model)||"—"}),Ge.jsx(wa,{label:"turns",children:e.turns}),Ge.jsx(wa,{label:"tool calls",children:e.toolCalls}),Ge.jsxs(wa,{label:"output",children:[Dt(n.output),n.thinking>0&&Ge.jsxs("small",{children:[" · ",Dt(n.thinking)," thinking"]})]}),Ge.jsxs(wa,{label:"processed",children:[Dt(a),Ge.jsxs("small",{children:[" · ",l,"% cached"]})]}),Ge.jsxs(wa,{label:"started",children:[Pe(e.startedAt)," ago"]}),Ge.jsxs(wa,{label:"last seen",children:[Pe(e.lastSeenAt)," ago"]}),o>0&&Ge.jsx(wa,{label:"subagent turns",children:o})]}),Ge.jsx("h4",{children:"tokens"}),Ge.jsx(rr,{format:At,parts:[{label:"cache read",v:n.cacheRead},{label:"cache write",v:n.cacheWrite},{label:"input",v:n.input},{label:"thinking",v:n.thinking},{label:"output",v:n.output}]}),Ge.jsx("h4",{children:"tools"}),i.length>0?Ge.jsx($o,{bars:i.slice(0,8).map(([r,s])=>({label:r.replace(/^mcp__[a-z0-9-]+__/i,""),value:s}))}):Ge.jsx("span",{className:"dim",children:"None yet"})]})}var ge=S(M(),1),nk=(e)=>_(e==="subagent"?"tree-structure":e==="spawned"?"play":"keyboard",13,"kind");function Qy({id:e}){let t=T((b)=>b.openSession),n=G((b)=>b?.sessions??ak),a=G((b)=>b?.projects??lk),l=G((b)=>b?.worktrees??ik),[o,i]=Vo.useState(null),r=Vo.useMemo(()=>n.find((b)=>b.id===e),[n,e]),s=Vo.useMemo(()=>a.find((b)=>b.id===r?.projectId)?.name??"",[a,r]),c=Vo.useMemo(()=>{if(!r)return null;return(l[r.projectId]??[]).find((y)=>!y.main&&(r.cwd===y.path||r.cwd.startsWith(`${y.path}/`)))??null},[r,l]),{data:d,error:h,reload:u}=te(`/v1/sessions/${encodeURIComponent(e)}/events`),{data:p}=te(r?.kind==="spawned"?`/v1/runs${Ae({project:r.projectId})}`:null),g=ge.jsxs("button",{type:"button",className:"back",onClick:()=>t(null),children:[_("arrow-left",13),"back"]});if(!r)return ge.jsxs(ge.Fragment,{children:[ge.jsx("h2",{className:"hrow",children:g}),ge.jsxs(Y,{children:["That session is not in the current snapshot.",ge.jsx("br",{}),"It may belong to a project that is no longer tracked."]})]});return ge.jsxs(ge.Fragment,{children:[ge.jsxs("h2",{className:"hrow",children:[g," ",s," · ",ge.jsx("span",{className:`s ${r.state}`})," ",nk(r.kind),ge.jsx(Go,{agent:r.agent}),ge.jsx("b",{children:r.title??r.id.slice(0,8)})," ",ge.jsxs("span",{children:[$e(r.cwd),r.branch?` · ${r.branch}`:""," · ",r.state]}),ge.jsx("span",{className:"grow"}),ge.jsxs("button",{type:"button",className:"nav",title:"Step through this session's tool calls",onClick:()=>i("replay"),children:[_("play",13)," Replay"]}),c&&ge.jsxs("button",{type:"button",className:"nav",title:"What this session's worktree changed",onClick:()=>i("diff"),children:[_("folders",13)," Diff"]}),r.state==="ended"&&ge.jsxs("button",{type:"button",className:"nav",title:"Spawn a run that picks up this session's task from its handoff and last actions",onClick:()=>void qy(e,alert).then((b)=>b&&t(b)),children:[_("arrows-clockwise",13)," Resume where it died"]})]}),h&&!d?ge.jsx(xe,{error:h,onRetry:u}):d?ge.jsxs(ge.Fragment,{children:[ge.jsxs("div",{className:"sess",children:[ge.jsx(Vy,{events:d.events,turns:d.turns}),ge.jsx(Xy,{session:r,turns:d.turns})]}),ge.jsx(Hy,{sessionId:r.id,kind:r.kind,runs:p??ok})]}):ge.jsx(ue,{}),o==="replay"&&d&&ge.jsx(Uy,{events:d.events,onClose:()=>i(null)}),o==="diff"&&c&&ge.jsx(Fs,{projectId:r.projectId,worktree:c.path,onClose:()=>i(null)})]})}var ak=[],lk=[],ok=[],ik={};var dr=S(B(),1);var Cf=S(B(),1);function rk(e){let t=[];for(let n=e-1;n>=0;n--){let a=new Date;a.setDate(a.getDate()-n),t.push(Hl(a))}return t}function sk(e,t,n){let a=t[0]??"",l=new Map,o=new Set,i=new Set,r=0;for(let s of e){if(n&&s.projectId!==n)continue;if(s.day<a)continue;let c=s.cost??0,d=`${s.day}|${s.agent}`;if(l.set(d,(l.get(d)??0)+c),o.add(s.agent),r+=c,c)i.add(s.day)}return{cells:l,agents:o,active:i,total:r}}function ck(e,t,n){let a=0,l=0;for(let o of e){if(n&&o.projectId!==n)continue;if(o.day!==t)continue;a+=o.cost??0,l+=o.turns??0}return{cost:a,turns:l}}function Zy(e,t,n){let a=Cf.useMemo(()=>rk(t),[t]);return Cf.useMemo(()=>{let l=e?.daily??[],o=a.at(-1)??"",{cells:i,agents:r,active:s,total:c}=sk(l,a,n),{cost:d,turns:h}=ck(l,o,n),u=[...r].sort(Xn),p={};for(let y of u)p[y]=a.map((m)=>i.get(`${m}|${y}`)??0);let g=s.size,b=g-(s.has(o)?1:0);return{days:a,series:p,agents:u,total:c,todayCost:d,todayTurns:h,activeDays:g,earlier:b,average:b?(c-d)/b:0}},[e,a,n])}var X=S(M(),1),uk=[7,14,30,90];function Jy(){let e=T((d)=>d.project),t=G((d)=>d?.spend??null),n=G((d)=>d?.projects??dk),[a,l]=dr.useState(14),o=dr.useMemo(()=>{let d=new Map(n.map((h)=>[h.id,h.name]));return(h)=>d.get(h)??"(removed)"},[n]),i=Zy(t,a,e),r=dr.useMemo(()=>(t?.hourly??[]).filter((d)=>!e||d.projectId===e).map((d)=>({dow:d.dow,hour:d.hour,v:d.cost??0})),[t,e]),s=(d)=>e?d.filter((h)=>h.key===e):d;if(!t)return null;let c=i.earlier?`${i.todayCost>=i.average?"+":""}${((i.todayCost-i.average)/i.average*100).toFixed(0)}%`:"—";return X.jsxs(X.Fragment,{children:[X.jsx(C,{title:"Spend",hint:e?o(e):"all projects",actions:X.jsx("span",{className:"seg",children:uk.map((d)=>X.jsxs("button",{type:"button",className:a===d?"on":"",onClick:()=>l(d),children:[d,"d"]},d))})}),X.jsxs(ut,{children:[X.jsx(K,{label:"today",value:F(i.todayCost)??"$0.00",detail:`${i.todayTurns} turns`}),X.jsx(K,{label:`${a}-day total`,value:F(i.total)??"$0.00",detail:`${i.activeDays} active day${i.activeDays===1?"":"s"}`}),X.jsx(K,{label:"today vs avg",value:c,detail:i.earlier?`vs ${F(i.average)} / active day`:"no earlier days to compare"}),X.jsx(K,{label:"agents",value:i.agents.length,detail:i.agents.map(Ie).join(" · ")||"—"})]}),X.jsxs("div",{className:"chart-card",children:[X.jsxs("h3",{children:["Daily cost · last ",a," days ",X.jsx("span",{children:"stacked by agent"})]}),X.jsx(Yo,{days:i.days,series:i.series}),i.agents.length>1&&X.jsx(al,{keys:i.agents})]}),X.jsxs("div",{className:"cols",children:[X.jsxs("div",{children:[X.jsxs("div",{className:"chart-card flush",children:[X.jsxs("h3",{children:["When the agents work ",X.jsx("span",{children:"cost by weekday × hour · last 4 weeks · local time"})]}),X.jsx(ay,{cells:r})]}),X.jsx(C,{title:"By project · today",hint:F(Tn(s(t.byProjectToday),(d)=>d.cost))??"$0.00",spaced:!0,children:X.jsx(Xo,{id:"project",label:"project",rows:s(t.byProjectToday),name:o})}),X.jsx(C,{title:"By project · all time",spaced:!0,children:X.jsx(Xo,{id:"project-all",label:"project",rows:s(t.byProjectAll),name:o})})]}),X.jsxs("div",{children:[!e&&X.jsxs(X.Fragment,{children:[X.jsx(C,{title:"By agent · today",hint:F(Tn(t.byAgentToday,(d)=>d.cost))??"$0.00",children:X.jsx(Xo,{id:"agent",label:"agent",rows:t.byAgentToday,name:Ie,color:vt})}),X.jsx(C,{title:"By agent · all time",spaced:!0,children:X.jsx(Xo,{id:"agent-all",label:"agent",rows:t.byAgentAll,name:Ie,color:vt})})]}),X.jsx(C,{title:"By model · today",spaced:!e,children:X.jsx(Xo,{id:"model",label:"model",rows:t.byModelToday,name:Ot})}),X.jsx(C,{title:"By model · all time",spaced:!0,children:X.jsx(Xo,{id:"model-all",label:"model",rows:t.byModelAll,name:Ot})})]})]}),X.jsxs("p",{className:"dim note",children:["Costs use list prices (static table, refreshed from LiteLLM when online; override in"," ",X.jsx("code",{children:"~/.swarm/pricing.json"}),"). Cache reads are the bulk of “ctx”. Sessions on a subscription plan still show what the tokens would cost at API rates."]})]})}function Xo({id:e,label:t,rows:n,name:a,color:l}){let o=[{key:"key",label:t,flex:!0,get:(r)=>a(r.key),cell:(r)=>X.jsxs(X.Fragment,{children:[l&&X.jsx("i",{className:"sw",style:{background:l(r.key)}}),a(r.key)]})},{key:"cost",label:"cost",width:88,num:!0,get:(r)=>r.cost??0,cell:(r)=>F(r.cost)??X.jsx(H,{})},{key:"input",label:"in+cache",width:88,num:!0,get:(r)=>r.input??0,cell:(r)=>Dt(r.input??0)},{key:"output",label:"out",width:84,num:!0,get:(r)=>r.output??0,cell:(r)=>Dt(r.output??0)},{key:"turns",label:"turns",width:64,num:!0,get:(r)=>r.turns??0,cell:(r)=>r.turns}],i=[...n].sort((r,s)=>(s.cost??0)-(r.cost??0));return X.jsx(de,{id:`spend-${e}`,columns:o,rows:i,rowKey:(r)=>r.key,defaultPageSize:0})}var dk=[];var fr=S(B(),1);var Ye=S(M(),1);function hc({session:e,onOpen:t}){if(!e)return Ye.jsx(Ye.Fragment,{children:"—"});return Ye.jsx("button",{type:"button",className:"link",onClick:()=>t(e.id),children:e.title||e.id.slice(0,8)})}function Qo({label:e,value:t,detail:n}){return Ye.jsxs("div",{className:"rec",children:[Ye.jsx("div",{className:"l",children:e}),Ye.jsx("div",{className:"v",children:t}),Ye.jsx("div",{className:"d",children:n})]})}function fk(e){if(!e)return 0;return new Date(e.lastSeenAt).getTime()-new Date(e.startedAt).getTime()}function Wy({records:e,peak:t,onOpenSession:n}){let a=fk(e.longestWallSession),l=e.biggestTurn;return Ye.jsxs("div",{className:"records",children:[Ye.jsx(Qo,{label:"costliest session",value:F(e.costliestSession?.cost??null)??"—",detail:Ye.jsx(hc,{session:e.costliestSession,onOpen:n})}),Ye.jsx(Qo,{label:"most turns in a session",value:e.longestSession?.turns??"—",detail:Ye.jsx(hc,{session:e.longestSession,onOpen:n})}),Ye.jsx(Qo,{label:"longest session",value:a>0?an(a):"—",detail:Ye.jsx(hc,{session:e.longestWallSession,onOpen:n})}),Ye.jsx(Qo,{label:"biggest single turn",value:l?`${Dt(l.output)} out`:"—",detail:l?Ye.jsxs(Ye.Fragment,{children:[Ot(l.model)," ·"," ",Ye.jsx(hc,{session:{id:l.sessionId,title:l.title},onOpen:n})]}):"—"}),Ye.jsx(Qo,{label:"busiest day",value:e.busiestDay?F(e.busiestDay.cost)??"—":"—",detail:e.busiestDay?`${e.busiestDay.day} · ${e.busiestDay.turns} turns`:"—"}),Ye.jsx(Qo,{label:"favourite hour",value:`${String(t.hour).padStart(2,"0")}:00`,detail:`${t.turns} turns in that hour, all time`})]})}var Lt=S(M(),1),Py=0.75,pk=90000,mk=587000,Iy=5,Fy=300;function e0({report:e}){let t=e.totals,n=t.firstTs?new Date(t.firstTs):null,a=n?Math.max(1,Math.round((Date.now()-n.getTime())/86400000)):1,l=e.daily.filter((u)=>u.turns).map((u)=>u.day),o=iy(l),i=t.input+t.cacheWrite+t.cacheRead+t.output,r=t.output*Py,s=r/pk,c=(t.input+t.cacheRead+t.cacheWrite)*Py,d=c/mk,h=(t.cost??0)/Iy;return Lt.jsxs(Lt.Fragment,{children:[Lt.jsxs(ut,{children:[Lt.jsx(K,{label:"all-time spend",value:F(t.cost)??"—",detail:`since ${n?n.toISOString().slice(0,10):"—"} · ${F((t.cost??0)/a)}/day`}),Lt.jsx(K,{label:"tokens processed",value:At(i),detail:`${At(t.output)} out · ${At(t.cacheRead)} cache read`}),Lt.jsx(K,{label:"turns",value:At(t.turns),detail:`${t.sessions} sessions · ${At(t.toolCalls)} tool calls`}),Lt.jsx(K,{label:"streak",value:`${o.current}d`,detail:`longest ${o.longest}d · ${l.length} active day${l.length===1?"":"s"} this year`})]}),Lt.jsxs(ut,{children:[Lt.jsx(K,{label:"words written",value:At(r),detail:s>=1?`≈ ${s.toFixed(s<10?1:0)} novels`:`≈ ${(r/Fy).toFixed(0)} pages`}),Lt.jsx(K,{label:"context re-read",value:`${At(c)} words`,detail:d>=1?`≈ ${d.toFixed(d<10?1:0)}× War and Peace`:`≈ ${(c/Fy).toFixed(0)} pages`}),Lt.jsx(K,{label:"thinking share",value:lr(t.thinking,t.output),detail:`${Dt(t.thinking)} reasoning tokens · cache hit ${lr(t.cacheRead,t.input+t.cacheRead+t.cacheWrite)}`}),Lt.jsx(K,{label:"in coffee",value:`${h>=100?h.toFixed(0):h.toFixed(1)} ☕`,detail:`at $${Iy} a cup · ${t.subagents} subagents spawned`})]})]})}var Z=S(M(),1),hk=[30,90,365],zf=["output","input","cacheWrite","cacheRead"],Af={output:"var(--acc-5)",input:"var(--acc-3)",cacheWrite:"var(--acc-2)",cacheRead:"var(--acc-1)"},t0={output:"output",input:"input",cacheWrite:"cache write",cacheRead:"cache read"},n0=(e)=>zf.indexOf(e),a0=Array.from({length:24},(e,t)=>String(t).padStart(2,"0"));function l0(){let e=T((g)=>g.project),t=T((g)=>g.openSession),n=G((g)=>g?.projects??gk),[a,l]=fr.useState(90),{data:o,error:i,reload:r}=te(Re.stats(e),120000),s=e?n.find((g)=>g.id===e)?.name??"(removed)":"all projects",c=fr.useMemo(()=>{let g=[];for(let b=a-1;b>=0;b--){let y=new Date;y.setDate(y.getDate()-b),g.push(Hl(y))}return g},[a]),d=fr.useMemo(()=>{let g=new Map(o?.daily.map((z)=>[z.day,z])??[]),b=(z)=>c.map((E)=>g.get(E)?.[z]??0),y={};for(let z of zf)y[z]=b(z);let m=0,f=c.map((z)=>(m+=g.get(z)?.cost??0,m)),v={};for(let z of o?.daily??[])v[z.day]=z.cost??0;let w=a0.map((z,E)=>o?.byHour.find((O)=>O.hour===E)?.turns??0),D=w.indexOf(Math.max(...w));return{tokenSeries:y,outputSeries:{output:b("output")},cumulative:f,costByDay:v,hourSeries:{turns:w},peak:{hour:D,turns:w[D]??0}}},[o,c]);if(i&&!o)return Z.jsx(xe,{error:i,onRetry:r});if(!o)return Z.jsx(ue,{});if(!o.totals.turns)return Z.jsx(C,{title:"Stats",hint:s,children:Z.jsx(Y,{children:"No turns recorded yet. Numbers appear once a session is transcribed."})});let h=o.totals,u=o.byModel.filter((g)=>g.model).map((g)=>({label:`${Ot(g.model)} · ${g.turns} turns`,v:g.output})),p=[{label:"cache read",v:h.cacheRead},{label:"cache write",v:h.cacheWrite},{label:"input",v:h.input},{label:"output",v:h.output}];return Z.jsxs(Z.Fragment,{children:[Z.jsx(C,{title:"Stats",hint:s,actions:Z.jsx("span",{className:"seg",children:hk.map((g)=>Z.jsxs("button",{type:"button",className:a===g?"on":"",onClick:()=>l(g),children:[g,"d"]},g))})}),Z.jsx(e0,{report:o}),Z.jsxs("div",{className:"chart-card",children:[Z.jsxs("h3",{children:["Activity ",Z.jsx("span",{children:"cost per day · last 52 weeks"})]}),Z.jsx(ly,{byDay:d.costByDay})]}),Z.jsxs("div",{className:"chart-card",children:[Z.jsxs("h3",{children:["Tokens per day ",Z.jsxs("span",{children:["last ",a," days · by class"]})]}),Z.jsx(Yo,{days:c,series:d.tokenSeries,format:At,colorOf:(g)=>Af[g]??"var(--acc)",nameOf:(g)=>t0[g]??g,sortKeys:(g,b)=>n0(g)-n0(b)}),Z.jsx(al,{keys:[...zf],colorOf:(g)=>Af[g]??"var(--acc)",nameOf:(g)=>t0[g]??g})]}),Z.jsxs("div",{className:"cols",children:[Z.jsx(qe,{title:"Output tokens per day",hint:`last ${a} days`,children:Z.jsx(Yo,{days:c,series:d.outputSeries,format:At,colorOf:()=>Af.output??"var(--acc)",nameOf:()=>"output",sortKeys:()=>0})}),Z.jsx(qe,{title:"Cumulative spend",hint:`last ${a} days`,children:Z.jsx(oy,{days:c,values:d.cumulative})})]}),Z.jsxs("div",{className:"cols mt-sec",children:[Z.jsx(qe,{title:"Turns by hour of day",hint:"all time · local",children:Z.jsx(Yo,{days:a0,series:d.hourSeries,format:(g)=>String(Math.round(g)),colorOf:()=>"var(--acc)",nameOf:()=>"turns",sortKeys:()=>0,labelOf:(g)=>Number(g)%3?"":g})}),Z.jsxs(qe,{title:"Model mix",hint:"by output tokens · all time",children:[Z.jsx(rr,{parts:u,format:At}),Z.jsxs("h3",{className:"mt-panel",children:["Token composition ",Z.jsx("span",{children:"all time"})]}),Z.jsx(rr,{parts:p,format:At})]})]}),Z.jsxs("div",{className:"cols mt-sec",children:[Z.jsx(qe,{title:"Tool leaderboard",hint:"calls · all time",children:o.tools.length>0?Z.jsx($o,{bars:o.tools.map(([g,b])=>({label:pb(g),value:b}))}):Z.jsx("div",{className:"dim",children:"no tool calls yet"})}),Z.jsx("div",{children:Z.jsx(C,{title:"Records",children:Z.jsx(Wy,{records:o.records,peak:d.peak,onOpenSession:t})})})]}),Z.jsxs("p",{className:"dim note",children:["Word counts assume ~0.75 words per token; a novel is 90k words. Costs use list prices, as on Spend. ",lr(h.sidechainTurns,h.turns)," of turns came from subagents."]})]})}var gk=[];var Zo=S(B(),1);var Lf=S(B(),1);var Ze=S(M(),1),_f=3600000,o0=0.4;function i0({sessions:e,from:t,to:n,detail:a,projectName:l,onOpenSession:o}){let i=Math.max(1,n-t),r=(p)=>Math.min(100,Math.max(0,100*(p-t)/i)),s=Lf.useMemo(()=>{let p=[];for(let g=Math.ceil(t/_f)*_f;g<=n;g+=_f)p.push(g);return p},[t,n]),c=Math.max(1,Math.round(s.length/12)),d=Lf.useMemo(()=>{let p=new Map;for(let g of e){let b=p.get(g.projectId)??[];b.push(g),p.set(g.projectId,b)}return[...p.entries()].map(([g,b])=>({projectId:g,sessions:[...b].sort((y,m)=>y.startedAt<m.startedAt?-1:1)}))},[e]),h=s.map((p)=>Ze.jsx("i",{style:{left:`${r(p)}%`}},p)),u=Date.now();return Ze.jsxs("div",{className:"tl",children:[Ze.jsxs("div",{className:"tl-row head",children:[Ze.jsx("span",{className:"tl-name"}),Ze.jsxs("span",{className:"tl-track",children:[Ze.jsx("div",{className:"tl-axis",children:s.map((p,g)=>g%c?null:Ze.jsxs("span",{style:{left:`${r(p)}%`},children:[String(new Date(p).getHours()).padStart(2,"0"),":00"]},p))}),u>=t&&u<=n&&Ze.jsx("b",{className:"tl-now",style:{left:`${r(u)}%`}})]})]}),d.map((p)=>{let g=(a?.claims??[]).filter((b)=>b.projectId===p.projectId&&new Date(b.expiresAt).getTime()>=t&&new Date(b.acquiredAt).getTime()<=n);return Ze.jsxs("div",{className:"tl-group",children:[Ze.jsxs("div",{className:"tl-proj",children:[l(p.projectId),Ze.jsx("small",{children:p.sessions.length})]}),g.length>0&&Ze.jsxs("div",{className:"tl-row claimlane",children:[Ze.jsx("span",{className:"tl-name dim",children:"claims"}),Ze.jsxs("span",{className:"tl-track",children:[h,g.map((b)=>{let y=Math.max(t,new Date(b.acquiredAt).getTime()),m=Math.min(n,new Date(b.expiresAt).getTime()),f=`<b>${b.task}</b><br>${b.state} · ${b.owner||"?"}<br>lease ${ga(b.acquiredAt)} → ${ga(b.expiresAt)}`;return Ze.jsx("i",{"data-tip":f,className:`claim ${b.state}`,style:{left:`${r(y)}%`,width:`${Math.max(o0,r(m)-r(y))}%`}},`${b.task}-${b.acquiredAt}`)})]})]}),p.sessions.map((b)=>{let y=Math.max(t,new Date(b.startedAt).getTime()),m=Math.min(n,new Date(b.lastSeenAt).getTime()),f=b.state==="active"||b.state==="waiting",v=(a?.turns[b.id]??[]).filter((E)=>E>=y&&E<=m),w=vt(b.agent),D=b.title??b.id.slice(0,8),z=`<b>${D}</b><br><i style="background:${w}"></i>${Ie(b.agent)} · ${b.state}<br>${ga(b.startedAt)} → ${ga(b.lastSeenAt)} · ${F(b.costUsd)??"—"} · ${b.turns} turns`;return Ze.jsxs("div",{className:"tl-row",onClick:()=>o(b.id),onKeyDown:(E)=>{if(E.key==="Enter"||E.key===" ")o(b.id)},role:"button",tabIndex:0,children:[Ze.jsx("span",{className:"tl-name",children:D}),Ze.jsxs("span",{className:"tl-track",children:[h,Ze.jsx("i",{"data-tip":z,className:`${f?"live":""}${v.length?" thin":""}`,style:{left:`${r(y)}%`,width:`${Math.max(o0,r(m)-r(y))}%`,background:w,color:w}}),v.map((E)=>Ze.jsx("u",{style:{left:`${r(E)}%`,background:w}},E))]})]},b.id)})]},p.projectId)})]})}var ln=S(M(),1),vk=[3,6,12,24,72],r0=3600000;function c0(){let e=T((u)=>u.project),t=T((u)=>u.openSession),n=G((u)=>u?.sessions??s0),a=G((u)=>u?.projects??s0),[l,o]=Zo.useState(12),{data:i}=te(`/v1/timeline${Ae({hours:l,project:e})}`,15000),r=Zo.useMemo(()=>{let u=new Map(a.map((p)=>[p.id,p.name]));return(p)=>u.get(p)??"(removed)"},[a]),s=Date.now()+0.25*r0,c=Date.now()-l*r0,d=Zo.useMemo(()=>n.filter((u)=>(!e||u.projectId===e)&&new Date(u.lastSeenAt).getTime()>=c&&u.kind!=="subagent"),[n,e,c]),h=Zo.useMemo(()=>[...new Set(d.map((u)=>u.agent))].sort(Xn),[d]);return ln.jsxs(ln.Fragment,{children:[ln.jsx(C,{title:"Timeline",hint:`${d.length} sessions · last ${l}h · ${F(Tn(d,(u)=>u.costUsd))??"$0.00"}`,actions:ln.jsx("span",{className:"seg",children:vk.map((u)=>ln.jsxs("button",{type:"button",className:l===u?"on":"",onClick:()=>o(u),children:[u,"h"]},u))})}),d.length>0?ln.jsxs(ln.Fragment,{children:[ln.jsx(i0,{sessions:d,from:c,to:s,detail:i,projectName:r,onOpenSession:t}),h.length>0&&ln.jsx(al,{keys:h})]}):ln.jsxs(Y,{children:["No sessions in the last ",l,"h."]})]})}var s0=[];var ee=S(M(),1),bk={winner:["ok","Decided"],undecided:["acc","Running"],"all-failed":["bad","No winner"]};function u0(){let e=T((s)=>s.project),t=T((s)=>s.openSession),{data:n,error:a,reload:l}=te(Re.trials(e)),o=[{key:"arm",label:"arm",width:130,get:(s)=>s.label,cell:(s)=>ee.jsxs(ee.Fragment,{children:[ee.jsx("b",{children:s.label}),s.winner&&ee.jsx(N,{tone:"ok",children:"Winner"})]})},{key:"state",label:"state",width:116,get:(s)=>s.ineligibleFor??"",cell:(s)=>s.eligible?ee.jsx(N,{tone:"ok",children:"Passed"}):ee.jsx("span",{title:`This arm cannot win: ${s.ineligibleFor??""}`,children:ee.jsx(N,{tone:s.state==="running"?"acc":"warn",children:s.ineligibleFor??"—"})})},{key:"cost",label:"cost",width:74,num:!0,get:(s)=>s.costUsd,cell:(s)=>F(s.costUsd)??ee.jsx(H,{})},{key:"wall",label:"wall",width:74,num:!0,get:(s)=>s.wallMs??-1,cell:(s)=>s.wallMs===null?ee.jsx(H,{}):an(s.wallMs)},{key:"turns",label:"turns",width:64,num:!0,get:(s)=>s.turns,cell:(s)=>s.turns},{key:"gates",label:"gates",width:84,num:!0,get:(s)=>s.gatesPassed-s.gatesFailed,cell:(s)=>ee.jsxs(ee.Fragment,{children:[s.gatesPassed>0&&ee.jsx(N,{tone:"ok",children:s.gatesPassed}),s.gatesFailed>0&&ee.jsx(N,{tone:"bad",children:s.gatesFailed}),!s.gatesPassed&&!s.gatesFailed&&ee.jsx("span",{className:"dim",children:"none"})]})},{key:"diff",label:"diff",width:108,num:!0,get:(s)=>s.churn??-1,cell:(s)=>s.churn===null?ee.jsx("span",{className:"dim",children:"measuring…"}):ee.jsxs("span",{title:`${s.filesChanged} file${s.filesChanged===1?"":"s"} · +${s.insertions} −${s.deletions}`,children:[s.churn," lines"]})},{key:"sess",label:"session",flex:!0,get:(s)=>s.sessionId??"",cell:(s)=>s.sessionId?ee.jsx("button",{type:"button",className:"link",onClick:()=>t(s.sessionId),children:s.model??s.sessionId.slice(0,8)}):ee.jsx(H,{})}];if(a&&!n)return ee.jsx(xe,{error:a,onRetry:l});if(!n)return ee.jsx(ue,{});let i=n.trials;if(i.length===0)return ee.jsx(C,{title:"Trials",hint:"same task, different models",children:ee.jsxs(Y,{children:["No trials yet",e?"":" — pick a project to start one",".",ee.jsx("br",{}),"A trial runs one task on several models at once and compares what each produced: cost, wall time, gates, diff size."]})});let r=i.filter((s)=>s.verdict==="undecided").length;return ee.jsxs(ee.Fragment,{children:[ee.jsx(C,{title:"Trials",hint:`${i.length} trial${i.length===1?"":"s"}${r?` · ${r} still running`:""}`}),i.map((s)=>{let[c,d]=bk[s.verdict],h=s.totals;return ee.jsx(C,{title:s.task,spaced:!0,hint:ee.jsxs(ee.Fragment,{children:[ee.jsx(N,{tone:c,children:d})," ",h.arms," arm",h.arms===1?"":"s"," ·"," ",h.finished," finished · ",F(h.costUsd)," spent",s.winner&&ee.jsxs(ee.Fragment,{children:[" · ",ee.jsx("b",{children:s.winner})," won",h.savedUsd>0.005&&`, ${F(h.savedUsd)} cheaper than the dearest`]})]}),children:ee.jsx(de,{id:`ab-${s.task}`,columns:o,rows:s.arms,rowKey:(u)=>u.label,defaultPageSize:0})},s.task)}),ee.jsxs("p",{className:"dim note",children:["An arm wins only if it finished and passed every gate it ran; among those, the cheapest wins and wall time breaks ties. A cheap arm that failed a gate never wins — the cheap wrong answer is not the answer. Each arm claims ",ee.jsx("code",{children:"task#arm"}),", so it gets its own worktree and the one-holder claim is never bent."]})]})}var d0=S(B(),1);var ql=S(M(),1);class Kf extends d0.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e){if(e.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}componentDidCatch(e,t){console.error("view failed",e,t.componentStack)}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=e instanceof Al&&e.status===404;return ql.jsxs("div",{className:"empty",children:[ql.jsx("b",{children:"This view stopped."}),ql.jsx("br",{}),t?"The daemon is older than this page — it is mid-upgrade. Reload once it has restarted.":e.message,ql.jsx("br",{}),ql.jsx("button",{type:"button",className:"link",onClick:()=>this.setState({error:null}),children:"Try again"})]})}}var O0=S(B(),1);var yk=[" MM MM "," LL LL "," LL LL "," LM MM "," MD MS "," LE LE "," ME ME "," MS MS "," KK KK "," SSDDDSDDDDDDDDDDDDDDDDDDDDDDDDDDDDS "," SSDSDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS "," SSDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOKSS "," SSOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOSS "," DDKMMLLLMLLMMMMMMMMMMMMMMMMMMMMMODD "," DDOMMLMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," SSSSODDOMMLMMMMMMMMMMMMMMMMMMMMMMMMMMODDOSSSS "," SSSSODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOSSSS "," SMMMMODDOMMLMMMMMMMMMMMMMMMMMMMMMMMMMMODDOSMMMS "," DMSSSODDOMMMMOOOOOOMMMMMMMMMOOOOOOMMMMODDOSSSED "," DSSSSODDOMMMMODDDDDMMMMMMMMMODDDDDMMMMODDOSSSSK "," DSMMSODDOMMMMDDDDDDMMMMMMMMMKDDDDDMMMMODDOSMMSK "," DSSSSODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDOSSSSK "," DSSSSODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDODSSSK "," DSSSSODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDODSSSK "," DSSSKODDOMMMMDDDDDDMMMMMMMMMDDDDDDMMMMODDODSSSD "," OKKKKODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOKKKKO "," KKKKODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOOKKK "," KKKOODDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODDOOKKK "," DDOMMMMDDDDDDDDDDDDDDDDDDDDDMMMMODD "," DDOMMMMDDDDDDDDDDDDDDDDDDDDDMMMMODD "," DDOMMMMDDDDDDDDDDDDDDDDDDDDDMMMMODD "," DDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," DDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," DDOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMODD "," DDDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOKDD "," DDDDDDDDDDDDDDDDDDDDDDDDDDDDDKDDDDD "," DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD "," OOOOOOOOOOO "," OODDDDDKKOO "," DSMMMMMMSDD "," OOOOOOOOOOO "," KDSMMMMMESSKK "," MMMMMMSSKOOKDSMMMMMSSSDKOODSEMMMMMM "," SSSSDO MMMMMMSSKKOOOOOOOOOOOOOOOOOKSSSMMMMMM ODSSSS "," EEESSSSOOLLLLMMMMMESSSSSSSSSSSSSSSSSSSSMMMMMLLLLOOSSSSMME "," SMMSSSSKOEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEEOOSSSSEMS "," DSSSSSSSOOSEEKSMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSOEEDOOSSSSSSSK "," DSSSSSSDOOSEOSKEMMMMMMMMMMMMMMMMMMMMMMMMMMMMMEOSDEDOODSSSSSSK "," KSSSSSSKOODSSOSEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESOEEDOOKSSSSSSK "," DKSSSSKKOODSMEEMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMSEMSDOOKKSSSSDK "," OKDDKDKKOOKSMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSKOOKKKKKKKO "," OOOOOKKKOOKSMMMMESSSSSSSSSSSSSMMMMEEEEEESSSSEMMMMSKOOKKKOOOOO "," OOOOOOKKOOKSMMMSSKKKKKKKKKKKKKKMMMDKOOOOOOOODDMMMSKOOKKOOOOOO "," OKSSKOOOOOKSMMMKKMLLLLLLLLLLLMKMMMDDSSSSSSSSDDMMMSKOOOOODSSKO "," SDOKKK KSMMMKDLLLLLLLLLLLLLKMMMKDKKKDDKKKDKMMMSK KKKKDS "," DMLLMKO KSMMMKDLLLLLLLLLLLLLKMMMDDDDDDDDDSKDMMMSK ODMLLMD "," DELLMSD KSMMMKKMLLLLLLLLLLLLKMMMDKKKKKKKKKDDMMMSK DSMLLEO "," KSKKKKDO KSMMMEDDDDKKDDDKKKDKSMMMDDDDDDDDDSDDMMMSK ODDKKKSK "," EMLLMDO KSMMMMLLLLLLLLLLLLLLLMMMDOOOOOOOOODDMMMSK ODMLLME "," KMLLMSD KSMMMMMMMMMMMMMMMMMMMMMMDDSSDDSSSSDDMMMSK SSMLLEK "," KSKKKKSO KSMMMMMOOMMOOMKOEMOOMMMMDOOOOOOOOODDMMMSK OSKKKKSO "," SMLLMDO KSMMMMMKKMMKKMDKEMKKMMMMKDDDDSSSSDDDMMMSK ODMLLMS "," SMMMMSD KSMMMMMEEMMEEMEEMMEEMMMMDSOOOOOOOODDMMSSK DSMMMMD "," OOOOOOO KSSMMMMMMMMMMMMMMMMMMMMMDDDDDDDDDDDDMSSSK OOOOOOO "," KSMLLLMMSKO KSSSSMMMMMMMMMMMMMMMMMMMSOOOOOOOOOOSSSSSK OKSMLLLLMSO "," DSMMMEEESKK KSSKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSOSSK KDSMMMMMESD "," DSMMMMMESKK KSOOKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSOOKSK KKSMMMMMMSD "," DSMMMMMESKK OKSKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSDSKO KDSMMMMMMSD "," KDDDDDDDDKK KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKDDDDDDDDO "," OOOOOOOOOOO OOOOOOOOO OOOOOOOOO OOOOOOOOOOO ","DSDO OSSO ODKKKKKKK OKKKKKKKO KEDO ODEK","SMDO OSMD KDSSSSSSK KDSSSSSKO SMDO ODMS","DEKO OOED OOKKKOOO OOOKKOOO SSOO OKMS","DEKO OOED SEMMMMSK OSMMMMED SSKO OKES","DSSO OESK SEMMMMSK OSMMMMED KSSO OSSK","KSMS EEDO OOKKKKKO OOKKKKKO OSEE EMSO"," DSS SSK OSEEESDO ODSEEESO KSS SSD "," OOO OO SEMMMMSK OSMMMMED OO OOO "," KSSSSSDO OKSSESSK "," DKKDDDDDDKKDK KDKDDDDDDDKDK "," SSMLLMMMMMMLMSK DSSMMMMMMMLLMSS "," SMLMMMMMMMMLLED SEMMMMMMMMMMLMS "," DMMMMMMMMMMMMMMD SMMMMMMMMMMMMMSK "," ODSSSSSSSSSSSSSSDO ODSSSSSSSSSSSSSSKO "," OOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOO "," OKSSSSSSSSSSSSSSK KSSSSSSSSSSSSSSKO "," OKDDDDDDDDDDDDDDK KDDDDDDDDDDDDDDOO "],ZR=yk.slice(0,37),f0=[" L L "," M M "," OOOOOOOOOO "," OMMMMMMMMO "," OELLLLLLEO "," OEMMMMMMEO ","DOESSMMSSEOD","DOESSMMSSEOD","DOEMMMMMMEOD"," OEMSSSSMEO "," ODDDDDDDDO "," OOOOOOOOOO "],p0={O:"color-mix(in srgb, var(--acc) 40%, black)",K:"color-mix(in srgb, var(--acc) 51%, black)",D:"color-mix(in srgb, var(--acc) 58%, black)",S:"color-mix(in srgb, var(--acc) 71%, black)",E:"color-mix(in srgb, var(--acc) 84%, black)",M:"var(--acc)",L:"color-mix(in srgb, var(--acc) 52%, white)"};function m0(e,t,n={}){let a=n.cell??6,l=Math.max(...e.map((g)=>g.length)),o=n.tile?n.tile.pad??2:0,i=Math.max(l,e.length)+o*2,r=(n.tile?i:l)*a,s=(n.tile?i:e.length)*a,c=n.tile?Math.round((i-l)/2)*a:0,d=n.tile?Math.round((i-e.length)/2)*a:0,h=n.tile?`<rect width="${r}" height="${s}" rx="${n.tile.radius??Math.round(r*0.2)}" fill="${n.tile.fill}"/>`:"";e.forEach((g,b)=>{let y=0;while(y<g.length){let m=g[y],f=t[m];if(!f){y++;continue}let v=n.classOf?.(m,y,b),w=n.styleOf?.(m,y,b),D=1;while(y+D<g.length&&g[y+D]===m&&n.classOf?.(m,y+D,b)===v&&n.styleOf?.(m,y+D,b)===w)D++;h+=`<rect${v?` class="${v}"`:""}${w?` style="${w}"`:""} x="${c+y*a}" y="${d+b*a}" width="${D*a}" height="${a}" fill="${f}"/>`,y+=D}});let u=n.className?` class="${n.className}"`:"",p=n.title?`<title>${n.title}</title>`:"";return`<svg${u} viewBox="0 0 ${r} ${s}" shape-rendering="crispEdges" xmlns="http://www.w3.org/2000/svg"${n.title?"":' aria-hidden="true"'}>${p}${h}</svg>`}var h0=S(B(),1),v0=S(M(),1);function Sk(e){let t=/viewBox="([^"]+)"/.exec(e)?.[1]??"0 0 12 12",n=e.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"");return{viewBox:t,body:n}}function g0({cell:e=2,className:t,title:n}){let{viewBox:a,body:l}=h0.useMemo(()=>Sk(m0(f0,p0,{cell:e})),[e]),o=n?`<title>${n}</title>${l}`:l;return v0.jsx("svg",{className:t||void 0,viewBox:a,shapeRendering:"crispEdges",xmlns:"http://www.w3.org/2000/svg",...n?{role:"img"}:{"aria-hidden":!0},dangerouslySetInnerHTML:{__html:o}})}function b0(){let e=G((n)=>n?.openIncidents??0),t=G((n)=>n?.questions.length??0);return{incidents:e,board:t}}var jf="swarm.notify";function y0(){try{return localStorage.getItem(jf)==="on"}catch{return!1}}var gc=()=>window.__TAURI__?.notification??null;function wk(){if(gc())return"desktop";return"Notification"in window?"web":null}async function Mk(){let e=gc();if(e)return e.isPermissionGranted();return"Notification"in window&&Notification.permission==="granted"}async function xk(){let e=gc();if(e)return await e.requestPermission()==="granted";if(!("Notification"in window))return!1;return await Notification.requestPermission()==="granted"}function kk(e,t,n,a){let l=gc();if(l){l.sendNotification({title:e,body:t});return}let o=new Notification(e,a?{body:t,tag:a}:{body:t});if(n)o.onclick=()=>{n(),o.close()}}var pr=null;function S0(){return pr}async function w0(){let e=wk();if(!e)return pr="not available here",!1;if(!await Mk()&&!await xk())return pr=e==="desktop"?"blocked in System Settings":"blocked by the browser",!1;pr=null;try{localStorage.setItem(jf,"on")}catch{}return kk("Swarm notifications on","You'll be pinged when a run needs a permission or a claim is orphaned."),!0}function M0(){pr=null;try{localStorage.setItem(jf,"off")}catch{}}function Bf(){let e=localStorage.getItem("swarm.theme");return e==="light"||e==="dark"?e:"system"}function x0(e){if(localStorage.setItem("swarm.theme",e),e==="system")delete document.documentElement.dataset.theme;else document.documentElement.dataset.theme=e}function k0(){let e=Bf();if(e!=="system")document.documentElement.dataset.theme=e}var Dk=[["system","System","monitor"],["light","Light","sun"],["dark","Dark","moon"]],Ok={system:"monitor",light:"sun",dark:"moon"};function D0(e){let t=Bf(),n=y0();return[{label:"Theme",icon:Ok[t],caption:t,children:Dk.map(([a,l,o])=>({label:l,icon:o,pressed:t===a,run:()=>{x0(a),e.refresh()}}))},{label:"",divider:!0},{label:"Refresh pricing",icon:"arrows-clockwise",caption:"LiteLLM",run:e.refreshPricing},{label:"Copy dashboard URL",icon:"copy",run:()=>void xt(location.origin)},{label:"",divider:!0},{label:"Desktop notifications",icon:"bell",pressed:n,caption:n?"on":S0()??"off",run:()=>{if(n){M0(),e.refresh();return}w0().then(e.refresh)}},{label:"What's New",icon:"star",caption:`v${e.version??"?"}`,run:e.whatsNew},{label:"Documentation",icon:"book-open",caption:"getswarm",run:()=>Wa(zv)},{label:"Send feedback",icon:"comment-text",caption:"GitHub issue",run:()=>Wa(Vs(e.version))}]}var ot=S(M(),1);function E0({version:e,onOpenPalette:t,onOpenWhatsNew:n}){let a=T((s)=>s.toggleSidebar),l=T((s)=>s.sidebarCollapsed),o=G((s)=>s?Tn(s.spend.byProjectToday,(c)=>c.cost):0),i=ma((s)=>s.offline),[,r]=O0.useReducer((s)=>s+1,0);return ot.jsxs("header",{children:[ot.jsx("button",{type:"button",className:"icon-btn",title:"Toggle sidebar","aria-label":"Toggle sidebar",onClick:a,children:_(l?"arrow-bar-right":"arrow-bar-left",16)}),ot.jsxs("span",{className:"logo",children:[ot.jsx(g0,{}),"Swarm"]}),ot.jsx(Ek,{}),ot.jsx("span",{className:"sp"}),ot.jsxs("span",{id:"today",children:["Today ",ot.jsx("b",{children:F(o)??"$0.00"})]}),ot.jsx("button",{type:"button",className:"icon-btn",title:"Jump to view, project or session (⌘K)","aria-label":"Open command palette",onClick:t,children:_("magnifying-glass",16)}),ot.jsx("button",{type:"button",className:"icon-btn",title:"Send feedback (opens a GitHub issue)","aria-label":"Send feedback",onClick:()=>Wa(Vs(e)),children:_("comment-text",16)}),ot.jsx("button",{type:"button",className:"icon-btn",title:"Settings","aria-label":"Settings","aria-haspopup":"menu",onClick:(s)=>zt(s.currentTarget,D0({version:e,refresh:r,whatsNew:n,refreshPricing:()=>{Ne("/v1/pricing/refresh","POST").then(lt)}})),children:_("sliders",16)}),ot.jsxs("span",{id:"daemon",title:i?"Daemon unreachable":"Daemon connected",children:[ot.jsx("span",{className:i?"dot":"dot on"}),ot.jsx("span",{className:"lbl",children:"Daemon"})]})]})}function Ek(){let e=T((l)=>l.view),t=T((l)=>l.session),n=T((l)=>l.openView),a=b0();return ot.jsx("nav",{id:"viewnav",children:Iv.map((l)=>{let o=nb(l),i=o.reduce((c,d)=>c+(a[d.id]??0),0),r=!t&&o.some((c)=>c.id===e),s=r?o.find((c)=>c.id===e):void 0;return ot.jsxs("button",{type:"button",className:r?"navgrp on":"navgrp","aria-haspopup":"menu",...r?{"aria-current":"page"}:{},onClick:(c)=>zt(c.currentTarget,o.map((d)=>{let h=a[d.id]??0;return{label:d.label,icon:d.icon,...h?{caption:String(h)}:{},pressed:!t&&e===d.id,run:()=>n(d.id)}})),children:[l,s&&ot.jsx("span",{className:"navview",children:s.label}),i>0&&ot.jsx("b",{className:"navcount",children:i>99?"99+":i}),_("chevron-down",12,"chev")]},l)})})}var Jo=S(M(),1);function N0({view:e}){let t=tb(e);return Jo.jsxs("div",{className:"empty",children:[Jo.jsx("b",{children:t.label})," has not been ported yet.",Jo.jsx("br",{}),"It is still on the original dashboard at"," ",Jo.jsx("a",{href:"/",className:"link",children:"/"}),"."]})}var ul=S(B(),1);var it=S(M(),1),T0=86400000,Nk=300000;function R0(){return it.jsxs(it.Fragment,{children:[it.jsx(Tk,{}),it.jsx(_k,{})]})}function Tk(){let[e,t]=ul.useState(null),[n,a]=ul.useState(!1),[l,o]=ul.useState(!1);if(ul.useEffect(()=>{let s=()=>void ct("/v1/health").then(t).catch(()=>{});s();let c=setInterval(s,Nk);return()=>clearInterval(c)},[]),!(e?.disk&&e.version&&e.disk!==e.version)||n)return null;let r=async()=>{o(!0),await Ne("/v1/daemon/restart","POST").catch(()=>{});let s=Date.now()+30000,c=setInterval(async()=>{if((await ct("/v1/health").catch(()=>null))?.version===e.disk)clearInterval(c),location.reload();else if(Date.now()>s)clearInterval(c),a(!0)},800)};return it.jsxs("div",{className:"nudge",children:[_("arrows-clockwise",18,"ic"),it.jsxs("div",{children:[it.jsxs("b",{children:["Swarm ",e.disk," is installed"]}),"The daemon is still running ",e.version," — restart it to switch. Sessions and history are unaffected.",it.jsxs("div",{className:"row",children:[it.jsxs("button",{type:"button",className:"pri",disabled:l,onClick:()=>void r(),children:[_("arrows-clockwise",13)," ",l?"restarting…":"Restart daemon"]}),it.jsx("button",{type:"button",onClick:()=>a(!0),children:"Later"})]})]})]})}var C0="swarm.star",Rk=2*T0,Ck=30*T0,Ak=4000;function A0(){try{return JSON.parse(localStorage.getItem(C0)||"{}")}catch{return{}}}function vc(e){try{localStorage.setItem(C0,JSON.stringify({...A0(),...e}))}catch{}}function zk(e){let t=A0();if(!t.since)return vc({since:e}),!1;if(t.done||t.never)return!1;if(e-t.since<Rk)return!1;if(t.last&&e-t.last<Ck)return!1;return!0}function _k(){let[e,t]=ul.useState(!1);if(ul.useEffect(()=>{let n=setTimeout(()=>{let a=Date.now();if(!zk(a)||document.querySelector(".nudge"))return;vc({last:a}),t(!0)},Ak);return()=>clearTimeout(n)},[]),!e)return null;return it.jsxs("div",{className:"nudge",children:[_("star",18,"ic"),it.jsxs("div",{children:[it.jsx("b",{children:"Enjoying Swarm?"}),"A star on GitHub helps other people find it — and tells us it's worth the evenings.",it.jsxs("div",{className:"row",children:[it.jsxs("button",{type:"button",className:"pri",onClick:()=>{vc({done:Date.now()}),t(!1),Wa(rf)},children:[_("star",13)," Star on GitHub"]}),it.jsx("button",{type:"button",onClick:()=>t(!1),children:"Later"}),it.jsx("button",{type:"button",className:"dim linkish",onClick:()=>{vc({never:Date.now()}),t(!1)},children:"Don't ask again"})]})]})]})}var xn=S(B(),1);var _n=S(M(),1),Lk=16,Kk=12,_0=Number.POSITIVE_INFINITY;function jk(e,t){return Math.min(...[e.label,e.sub??""].map((n)=>{let a=n.toLowerCase().indexOf(t);return a<0?_0:a}))}function L0({onClose:e}){let t=T((m)=>m.openView),n=T((m)=>m.selectProject),a=T((m)=>m.openSession),l=T((m)=>m.setSearch),o=G((m)=>m?.projects??z0),i=G((m)=>m?.sessions??z0),[r,s]=xn.useState(""),[c,d]=xn.useState(0),h=xn.useRef(null),u=xn.useRef(null),p=xn.useMemo(()=>{let m=(f)=>o.find((v)=>v.id===f)?.name??"";return[...nr.map((f)=>({icon:f.icon,label:f.label,group:f.group.toLowerCase(),run:()=>t(f.id)})),...o.map((f)=>({icon:"folder-simple",label:f.name,group:"project",run:()=>{n(f.id),a(null)}})),...i.map((f)=>({icon:"terminal-window",label:f.title??f.id.slice(0,8),sub:m(f.projectId),live:f.state==="active"||f.state==="waiting",group:"session",run:()=>a(f.id)}))]},[o,i,t,n,a]),g=xn.useMemo(()=>{let m=r.trim().toLowerCase();if(!m)return p.filter((v)=>v.group!=="session"||v.live).slice(0,Lk);let f=p.map((v)=>({entry:v,r:jk(v,m)})).filter((v)=>v.r!==_0).sort((v,w)=>v.r-w.r).slice(0,Kk).map((v)=>v.entry);return f.push({icon:"magnifying-glass",label:`Search Swarm for “${r.trim()}”`,group:"search",run:()=>l(r.trim())}),f},[p,r,l]),b=Math.min(c,Math.max(0,g.length-1));xn.useEffect(()=>{u.current?.focus()},[]),xn.useEffect(()=>{h.current?.querySelector(".on")?.scrollIntoView({block:"nearest"})});let y=(m)=>{if(!m)return;e(),m.run()};return _n.jsxs("div",{className:"pk pal",role:"dialog","aria-modal":"true","aria-label":"Command palette",children:[_n.jsxs("div",{className:"pk-h",children:[_("magnifying-glass",15),_n.jsx("input",{ref:u,placeholder:"Jump to view, project or session…",spellCheck:!1,autoComplete:"off",value:r,onChange:(m)=>{s(m.target.value),d(0)},onKeyDown:(m)=>{if(m.key==="ArrowDown"||m.key==="ArrowUp"){m.preventDefault();let f=m.key==="ArrowDown"?1:-1;d(Math.max(0,Math.min(g.length-1,b+f)))}else if(m.key==="Enter")m.preventDefault(),y(g[b])}})]}),_n.jsx("div",{className:"pk-list",ref:h,children:g.length===0?_n.jsx("div",{className:"empty pal-empty",children:"No matches."}):g.map((m,f)=>_n.jsxs("button",{type:"button",className:f===b?"pk-row on":"pk-row",onMouseEnter:()=>d(f),onClick:()=>y(m),children:[_(m.icon,14),_n.jsxs("span",{className:"nm",children:[m.label,m.sub&&_n.jsxs("span",{className:"dim",children:[" · ",m.sub]})]}),_n.jsx("span",{className:"grp",children:m.group})]},`${m.group}:${m.label}`))})]})}var z0=[];var Gl=S(M(),1);function K0({note:e,onClose:t}){return cf(e.version),Gl.jsxs(ha,{title:"What's New",glyph:"star",size:"wn",onClose:t,footer:Gl.jsx("a",{className:"wn-full",href:_v,target:"_blank",rel:"noopener",children:"Full changelog →"}),children:[Gl.jsxs("h3",{children:["Swarm ",e.version]}),e.date&&Gl.jsx("div",{className:"date",children:e.date}),Gl.jsx("div",{dangerouslySetInnerHTML:{__html:e.html}})]})}var Nt=S(M(),1),Bk={fleet:Fb,prs:Ny,hygiene:wy,outcomes:Oy,gates:ey,mcp:xy,context:Xb,heat:Qb,security:jy,provenance:_y,rules:Ly,incidents:My,trials:u0,board:Yb,spend:Jy,search:Ky,stats:l0,timeline:c0,graphs:fy};function B0(){let e=T((h)=>h.view),t=T((h)=>h.session),n=T((h)=>h.sidebarCollapsed),[a,l]=kn.useState(null),[o,i]=kn.useState(!1),[r,s]=kn.useState(null);Vv(),Lv(),Cv(),Yv(),kn.useEffect(()=>(ab(),Pv()),[]),kn.useEffect(()=>{ct("/v1/health").then((h)=>{let u=h.version??null;l(u),s(jv(u))}).catch(()=>{})},[]);let c=kn.useCallback(()=>s(Xs(a)),[a]);kn.useEffect(()=>(window.swarmWhatsNew=(h)=>s(Xs(h??a)),()=>{window.swarmWhatsNew=void 0}),[a]),kn.useEffect(()=>{let h=(u)=>{if((u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="k")u.preventDefault(),i((p)=>!p);else if(u.key==="Escape")i(!1)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[]),kn.useEffect(()=>{document.body.classList.toggle("nosb",n)},[n]);let d=Bk[e];return Nt.jsxs(Nt.Fragment,{children:[Nt.jsx(E0,{version:a,onOpenPalette:()=>i(!0),onOpenWhatsNew:c}),Nt.jsx(Wb,{}),Nt.jsx("main",{id:"main",children:Nt.jsx(Kf,{resetKey:t??e,children:t?Nt.jsx(Qy,{id:t}):d?Nt.jsx(d,{}):Nt.jsx(N0,{view:e})})}),o&&Nt.jsx(Uk,{onClose:()=>i(!1)}),r&&Nt.jsx(K0,{note:r,onClose:()=>s(null)}),Nt.jsx(R0,{})]})}function Uk({onClose:e}){let t=document.getElementById("picker");if(!t)return null;return j0.createPortal(Nt.jsx(L0,{onClose:e}),t)}var Uf=S(M(),1);k0();var $0=document.getElementById("root");if(!$0)throw Error("dashboard: #root is missing from index.html");H0.createRoot($0).render(Uf.jsx(U0.StrictMode,{children:Uf.jsx(B0,{})}));})();
23
+ ${r}`))return null;let l=await De(o,"POST",{});if(!l.ok||!l.run)return t(l.error??"the run did not start"),null;return l.run.sessionId}var Ss=x(R(),1);var Br=x(T(),1),sQ={PreToolUse:"tool",PostToolUse:"result",UserPromptSubmit:"you",Stop:"stop",SubagentStart:"sub →",SubagentStop:"sub ←",Notification:"note",SessionStart:"start",SessionEnd:"end",PreCompact:"compact",assistant:"agent",subagent:"sub","incident.opened":"rule","question.asked":"asks","question.answered":"answer","message.sent":"msg","gate.recorded":"gate","session.stuck":"stuck","permission.requested":"perm?","permission.resolved":"perm","claim.acquired":"claim","claim.released":"release","pr.opened":"pr"},iQ=(e)=>sQ[e]??String(e).split(".").at(-1)??String(e),lQ=(e)=>e.payload?.hook==="PostToolUse",cQ=(e)=>!e.text;function Ex(e){let t=e.payload;return{key:`e${e.seq}`,ts:e.ts,kind:t?.hook??e.type,text:t?.summary??"",className:e.type}}function Ox(e){return{key:`t${e.id}`,ts:e.ts,kind:e.sidechain?"subagent":"assistant",text:e.text??"",className:"assistant",output:e.output,cost:e.costUsd}}function uQ(e,t){let o=[],a=0,n=0;while(a<e.length||n<t.length)if(a<e.length&&lQ(e[a]))a++;else if(n<t.length&&cQ(t[n]))n++;else if(n>=t.length)o.push(Ex(e[a++]));else if(a>=e.length)o.push(Ox(t[n++]));else if(e[a].ts<t[n].ts)o.push(Ex(e[a++]));else o.push(Ox(t[n++]));return o.reverse()}function Nx({events:e,turns:t}){let o=Ss.useMemo(()=>uQ(e,t),[e,t]),a=Ss.useRef(null),n=Ss.useRef(0);return Ss.useLayoutEffect(()=>{let r=a.current;if(!r)return;let s=r.scrollHeight-n.current;if(n.current=r.scrollHeight,s<=0)return;if(r.scrollTop<=dQ)r.scrollTop=0;else r.scrollTop+=s}),Br.jsx("div",{id:"log",ref:a,children:o.map((r)=>Br.jsxs("div",{className:`ev ${r.className}`,children:[Br.jsx("span",{className:"t",children:Oa(r.ts)}),Br.jsx("span",{className:"k",title:r.kind,children:iQ(r.kind)}),Br.jsxs("span",{className:"m",children:[r.text,r.output?Br.jsxs("span",{className:"dim",children:[" ","· ",Wt(r.output)," out",r.cost!=null&&` · $${r.cost.toFixed(3)}`]}):null]})]},r.key))})}var dQ=40;var Ng=x(R(),1);var ys=x(T(),1),Og=1000;function Lx({turns:e,height:t=54}){let o=e.filter((s)=>!s.sidechain&&!s.agentId);if(o.length===0)return null;let a=Math.max(0.000000001,...o.map((s)=>s.costUsd??0)),n=Og/o.length,r=Math.max(1.5,Math.min(10,n*0.7));return ys.jsxs("svg",{viewBox:`0 0 ${Og} ${t}`,preserveAspectRatio:"none",className:"chart",style:{height:t},"aria-hidden":"true",children:[ys.jsx("line",{x1:0,x2:Og,y1:t-2,y2:t-2,className:"base"}),o.map((s,l)=>{let c=(s.costUsd??0)/a*(t-8),u=l*n+(n-r)/2,d=`<b>turn ${l+1}</b> · ${Oa(s.ts)}<br>${se(s.costUsd)??"—"} · ${Wt(s.output)} out${s.thinking?` · ${Wt(s.thinking)} thinking`:""}<br><span>${s.model??""}</span>`;return ys.jsxs("g",{"data-tip":d,children:[ys.jsx("rect",{x:l*n,y:0,width:n,height:t,fill:"transparent"}),ys.jsx("path",{d:Cg(u,t-2-c,r,c,2),fill:"var(--acc-fill)"})]},s.id)})]})}var _=x(T(),1),mQ={cost:"coin",model:"robot",turns:"arrows-clockwise","tool calls":"wrench",output:"chart-bar",processed:"rows",started:"clock","last seen":"eye","subagent turns":"tree-structure"};function Un({label:e,children:t}){return _.jsxs("div",{className:"stat",children:[_.jsxs("span",{children:[z(mQ[e]??"list-bullets",13),e]}),_.jsx("b",{children:t})]})}function Rx({session:e,turns:t}){let o=e.tokens,a=o.input+o.cacheRead+o.cacheWrite,n=a?(100*o.cacheRead/a).toFixed(0):"0",r=t.filter((l)=>l.sidechain||l.agentId).length,s=Object.entries(e.toolCounts).sort((l,c)=>c[1]-l[1]);return _.jsxs("aside",{className:"side",children:[_.jsxs("div",{className:"stats",children:[_.jsx(Un,{label:"cost",children:se(e.costUsd)??"—"}),_.jsx(Un,{label:"model",children:wo(e.model)||"—"}),_.jsx(Un,{label:"turns",children:e.turns}),_.jsx(Un,{label:"tool calls",children:e.toolCalls}),_.jsxs(Un,{label:"output",children:[Wt(o.output),o.thinking>0&&_.jsxs("small",{children:[" · ",Wt(o.thinking)," thinking"]})]}),_.jsxs(Un,{label:"processed",children:[Wt(a),_.jsxs("small",{children:[" · ",n,"% cached"]})]}),_.jsxs(Un,{label:"started",children:[vt(e.startedAt)," ago"]}),_.jsxs(Un,{label:"last seen",children:[vt(e.lastSeenAt)," ago"]}),r>0&&_.jsx(Un,{label:"subagent turns",children:r})]}),_.jsx("h4",{children:"tokens"}),_.jsx(Dc,{format:To,parts:[{label:"cache read",v:o.cacheRead},{label:"cache write",v:o.cacheWrite},{label:"input",v:o.input},{label:"thinking",v:o.thinking},{label:"output",v:o.output}]}),t.length>1&&_.jsxs(_.Fragment,{children:[_.jsx("h4",{children:"cost per turn"}),_.jsx(Lx,{turns:t})]}),_.jsx("h4",{children:"tools"}),s.length>0?_.jsx(Gi,{bars:s.slice(0,8).map(([l,c])=>({label:l.replace(/^mcp__[a-z0-9-]+__/i,""),value:c}))}):_.jsx("span",{className:"dim",children:"None yet"}),_.jsx(fQ,{session:e}),_.jsx(pQ,{sessionId:e.id}),_.jsx(hQ,{path:e.transcriptPath})]})}function fQ({session:e}){let t=e.state==="ended",{data:o,reload:a}=ie(`/v1/messages${ze({session:e.id,limit:50})}`),[n,r]=Ng.useState(""),[s,l]=Ng.useState(!1),c=(o??gQ).filter((m)=>m.sessionId===e.id||m.fromSession===e.id).slice().reverse(),u=c.filter((m)=>m.fromSession!==e.id&&!m.deliveredAt).length,d=async()=>{let m=n.trim();if(!m||s)return;l(!0);let f=await De("/v1/messages","POST",{projectId:e.projectId,to:e.id,text:m,from:"dashboard"});if(l(!1),!f.ok){alert(f.error??"could not send");return}r(""),a()};return _.jsxs(_.Fragment,{children:[_.jsxs("h4",{children:["messages",c.length>0&&_.jsx("span",{className:"badge",children:c.length})]}),c.length>0&&_.jsx("div",{className:"msgs",children:c.map((m)=>{let f=m.fromSession===e.id;return _.jsxs("div",{className:f?"msg out":"msg",title:`${m.createdAt}${m.deliveredAt?"":" · not delivered yet"}`,children:[_.jsxs("span",{className:"msg-f",children:[f?`→ ${m.task??m.toKind}`:m.from??"?",!m.deliveredAt&&_.jsx("i",{className:"dim",children:" ·queued"})]}),m.text]},m.id)})}),_.jsxs("div",{className:"msg-compose",children:[_.jsx("input",{placeholder:"Message this agent…","aria-label":"Message this agent",autoComplete:"off",disabled:t,value:n,onChange:(m)=>r(m.target.value),onKeyDown:(m)=>{if(m.key==="Enter")d()}}),_.jsxs("button",{type:"button",title:"Send (Enter)",disabled:t||s||!n.trim(),onClick:()=>void d(),children:[z("arrow-right",12),"Send"]})]}),_.jsx("p",{className:"msg-hint",children:t?_.jsxs(_.Fragment,{children:[z("warning",12)," Session ended — there is nothing left to deliver to."]}):u>0?_.jsxs(_.Fragment,{children:[z("clock",12)," ",_.jsxs("b",{children:[u," queued"]})," · delivered the next time this agent calls a tool."]}):_.jsxs(_.Fragment,{children:[z("comment-text",12)," Delivered as context on this agent's next tool call — never an interrupt."]})})]})}function pQ({sessionId:e}){let o=q((n)=>n?.questions??bQ).filter((n)=>n.sessionId===e);if(o.length===0)return null;let a=async(n,r)=>{let s=r??prompt(`Answer to question #${n.id}:`);if(!s)return;let l=await De(`/v1/questions/${encodeURIComponent(String(n.id))}/answer`,"POST",{text:s,by:"dashboard"});if(!l.ok)alert(l.error??"could not answer");await ct()};return _.jsxs(_.Fragment,{children:[_.jsx("h4",{children:"waiting on you"}),o.map((n)=>_.jsxs("div",{className:"perm",children:[_.jsxs("div",{className:"perm-t",children:[z("warning",13)," ",_.jsxs("b",{children:["Question #",n.id]}),n.task&&_.jsxs("span",{className:"dim",children:[" · ",n.task]})]}),_.jsx("div",{className:"perm-c",children:n.text}),_.jsxs("div",{className:"perm-b",children:[n.options.map((r)=>_.jsx("button",{type:"button",className:"ok",onClick:()=>void a(n,r),children:r},r)),_.jsx("button",{type:"button",onClick:()=>void a(n),children:"Answer…"})]})]},n.id))]})}function hQ({path:e}){if(!e)return null;let t=Qe(e),o=t.lastIndexOf("/");return _.jsxs(_.Fragment,{children:[_.jsx("h4",{children:"transcript"}),_.jsxs("button",{type:"button",className:"pathrow",title:`Copy path · ${t}`,onClick:()=>void Zt(e),children:[z("file-text",12),_.jsx("span",{className:"dir",children:o<0?"":t.slice(0,o+1)}),_.jsx("b",{children:o<0?t:t.slice(o+1)}),z("copy",12,"cp")]})]})}var gQ=[],bQ=[];var Ne=x(T(),1),vQ=(e)=>z(e==="subagent"?"tree-structure":e==="spawned"?"play":"keyboard",13,"kind");function Bx({id:e}){let t=B((v)=>v.openSession),o=q((v)=>v?.sessions??SQ),a=q((v)=>v?.projects??yQ),n=q((v)=>v?.worktrees??IQ),[r,s]=Wi.useState(null),l=Wi.useMemo(()=>o.find((v)=>v.id===e),[o,e]),c=Wi.useMemo(()=>a.find((v)=>v.id===l?.projectId)?.name??"",[a,l]),u=Wi.useMemo(()=>{if(!l)return null;return(n[l.projectId]??[]).find((S)=>!S.main&&(l.cwd===S.path||l.cwd.startsWith(`${S.path}/`)))??null},[l,n]),{data:d,error:m,reload:f}=ie(`/v1/sessions/${encodeURIComponent(e)}/events`),{data:p}=ie(l?.kind==="spawned"?`/v1/runs${ze({project:l.projectId})}`:null),b=Ne.jsxs("button",{type:"button",className:"back",onClick:()=>t(null),children:[z("arrow-left",13),"back"]});if(!l)return Ne.jsxs(Ne.Fragment,{children:[Ne.jsx("h2",{className:"hrow",children:b}),Ne.jsxs(ee,{children:["That session is not in the current snapshot.",Ne.jsx("br",{}),"It may belong to a project that is no longer tracked."]})]});return Ne.jsxs(Ne.Fragment,{children:[Ne.jsxs("h2",{className:"hrow",children:[b," ",c," · ",Ne.jsx("span",{className:`s ${l.state}`})," ",vQ(l.kind),Ne.jsx(Vi,{agent:l.agent}),Ne.jsx("b",{children:l.title??l.id.slice(0,8)})," ",Ne.jsxs("span",{children:[Qe(l.cwd),l.branch?` · ${l.branch}`:""," · ",l.state]}),Ne.jsx("span",{className:"grow"}),Ne.jsxs("button",{type:"button",className:"nav",title:"Step through this session's tool calls",onClick:()=>s("replay"),children:[z("play",13)," Replay"]}),u&&Ne.jsxs("button",{type:"button",className:"nav",title:"What this session's worktree changed",onClick:()=>s("diff"),children:[z("folders",13)," Diff"]}),l.state==="ended"&&Ne.jsxs("button",{type:"button",className:"nav",title:"Spawn a run that picks up this session's task from its handoff and last actions",onClick:()=>void Ax(e,alert).then((v)=>v&&t(v)),children:[z("arrows-clockwise",13)," Resume where it died"]})]}),m&&!d?Ne.jsx(Ke,{error:m,onRetry:f}):d?Ne.jsxs(Ne.Fragment,{children:[Ne.jsxs("div",{className:"sess",children:[Ne.jsx(Nx,{events:d.events,turns:d.turns}),Ne.jsx(Rx,{session:l,turns:d.turns})]}),Ne.jsx(Dx,{sessionId:l.id,kind:l.kind,runs:p??wQ})]}):Ne.jsx(Me,{}),r==="replay"&&d&&Ne.jsx(kx,{events:d.events,onClose:()=>s(null)}),r==="diff"&&u&&Ne.jsx(Kd,{projectId:l.projectId,worktree:u.path,onClose:()=>s(null)})]})}var SQ=[],yQ=[],wQ=[],IQ={};var Oc=x(R(),1);var Lg=x(R(),1);function xQ(e){let t=[];for(let o=e-1;o>=0;o--){let a=new Date;a.setDate(a.getDate()-o),t.push(bs(a))}return t}function CQ(e,t,o){let a=t[0]??"",n=new Map,r=new Set,s=new Set,l=0;for(let c of e){if(o&&c.projectId!==o)continue;if(c.day<a)continue;let u=c.cost??0,d=`${c.day}|${c.agent}`;if(n.set(d,(n.get(d)??0)+u),r.add(c.agent),l+=u,u)s.add(c.day)}return{cells:n,agents:r,active:s,total:l}}function MQ(e,t,o){let a=0,n=0;for(let r of e){if(o&&r.projectId!==o)continue;if(r.day!==t)continue;a+=r.cost??0,n+=r.turns??0}return{cost:a,turns:n}}function Hx(e,t,o){let a=Lg.useMemo(()=>xQ(t),[t]);return Lg.useMemo(()=>{let n=e?.daily??[],r=a.at(-1)??"",{cells:s,agents:l,active:c,total:u}=CQ(n,a,o),{cost:d,turns:m}=MQ(n,r,o),f=[...l].sort(nn),p={};for(let S of f)p[S]=a.map((h)=>s.get(`${h}|${S}`)??0);let b=c.size,v=b-(c.has(r)?1:0);return{days:a,series:p,agents:f,total:u,todayCost:d,todayTurns:m,activeDays:b,earlier:v,average:v?(u-d)/v:0}},[e,a,o])}var oe=x(T(),1),kQ=[7,14,30,90];function Px(){let e=B((d)=>d.project),t=q((d)=>d?.spend??null),o=q((d)=>d?.projects??DQ),[a,n]=Oc.useState(14),r=Oc.useMemo(()=>{let d=new Map(o.map((m)=>[m.id,m.name]));return(m)=>d.get(m)??"(removed)"},[o]),s=Hx(t,a,e),l=Oc.useMemo(()=>(t?.hourly??[]).filter((d)=>!e||d.projectId===e).map((d)=>({dow:d.dow,hour:d.hour,v:d.cost??0})),[t,e]),c=(d)=>e?d.filter((m)=>m.key===e):d;if(!t)return null;let u=s.earlier?`${s.todayCost>=s.average?"+":""}${((s.todayCost-s.average)/s.average*100).toFixed(0)}%`:"—";return oe.jsxs(oe.Fragment,{children:[oe.jsx(F,{title:"Spend",hint:e?r(e):"all projects",actions:oe.jsx("span",{className:"seg",children:kQ.map((d)=>oe.jsxs("button",{type:"button",className:a===d?"on":"",onClick:()=>n(d),children:[d,"d"]},d))})}),oe.jsxs($t,{children:[oe.jsx(K,{label:"today",value:se(s.todayCost)??"$0.00",detail:`${s.todayTurns} turns`}),oe.jsx(K,{label:`${a}-day total`,value:se(s.total)??"$0.00",detail:`${s.activeDays} active day${s.activeDays===1?"":"s"}`}),oe.jsx(K,{label:"today vs avg",value:u,detail:s.earlier?`vs ${se(s.average)} / active day`:"no earlier days to compare"}),oe.jsx(K,{label:"agents",value:s.agents.length,detail:s.agents.map(St).join(" · ")||"—"})]}),oe.jsxs("div",{className:"chart-card",children:[oe.jsxs("h3",{children:["Daily cost · last ",a," days ",oe.jsx("span",{children:"stacked by agent"})]}),oe.jsx($i,{days:s.days,series:s.series}),s.agents.length>1&&oe.jsx(Ar,{keys:s.agents})]}),oe.jsxs("div",{className:"cols",children:[oe.jsxs("div",{children:[oe.jsxs("div",{className:"chart-card flush",children:[oe.jsxs("h3",{children:["When the agents work ",oe.jsx("span",{children:"cost by weekday × hour · last 4 weeks · local time"})]}),oe.jsx(GI,{cells:l})]}),oe.jsx(F,{title:"By project · today",hint:se(Na(c(t.byProjectToday),(d)=>d.cost))??"$0.00",spaced:!0,children:oe.jsx(Zi,{id:"project",label:"project",rows:c(t.byProjectToday),name:r})}),oe.jsx(F,{title:"By project · all time",spaced:!0,children:oe.jsx(Zi,{id:"project-all",label:"project",rows:c(t.byProjectAll),name:r})})]}),oe.jsxs("div",{children:[!e&&oe.jsxs(oe.Fragment,{children:[oe.jsx(F,{title:"By agent · today",hint:se(Na(t.byAgentToday,(d)=>d.cost))??"$0.00",children:oe.jsx(Zi,{id:"agent",label:"agent",rows:t.byAgentToday,name:St,color:ro})}),oe.jsx(F,{title:"By agent · all time",spaced:!0,children:oe.jsx(Zi,{id:"agent-all",label:"agent",rows:t.byAgentAll,name:St,color:ro})})]}),oe.jsx(F,{title:"By model · today",spaced:!e,children:oe.jsx(Zi,{id:"model",label:"model",rows:t.byModelToday,name:wo})}),oe.jsx(F,{title:"By model · all time",spaced:!0,children:oe.jsx(Zi,{id:"model-all",label:"model",rows:t.byModelAll,name:wo})})]})]}),oe.jsxs("p",{className:"dim note",children:["Costs use list prices (static table, refreshed from LiteLLM when online; override in"," ",oe.jsx("code",{children:"~/.swarm/pricing.json"}),"). Cache reads are the bulk of “ctx”. Sessions on a subscription plan still show what the tokens would cost at API rates."]})]})}function Zi({id:e,label:t,rows:o,name:a,color:n}){let r=[{key:"key",label:t,flex:!0,get:(l)=>a(l.key),cell:(l)=>oe.jsxs(oe.Fragment,{children:[n&&oe.jsx("i",{className:"sw",style:{background:n(l.key)}}),a(l.key)]})},{key:"cost",label:"cost",width:88,num:!0,get:(l)=>l.cost??0,cell:(l)=>se(l.cost)??oe.jsx(Z,{})},{key:"input",label:"in+cache",width:88,num:!0,get:(l)=>l.input??0,cell:(l)=>Wt(l.input??0)},{key:"output",label:"out",width:84,num:!0,get:(l)=>l.output??0,cell:(l)=>Wt(l.output??0)},{key:"turns",label:"turns",width:64,num:!0,get:(l)=>l.turns??0,cell:(l)=>l.turns}],s=[...o].sort((l,c)=>(c.cost??0)-(l.cost??0));return oe.jsx(ke,{id:`spend-${e}`,columns:r,rows:s,rowKey:(l)=>l.key,trailing:{width:34,cell:()=>null},defaultPageSize:0})}var DQ=[];var Nc=x(R(),1);var dt=x(T(),1);function im({session:e,onOpen:t}){if(!e)return dt.jsx(dt.Fragment,{children:"—"});return dt.jsx("button",{type:"button",className:"link",onClick:()=>t(e.id),children:e.title||e.id.slice(0,8)})}function Yi({label:e,value:t,detail:o}){return dt.jsxs("div",{className:"rec",children:[dt.jsx("div",{className:"l",children:e}),dt.jsx("div",{className:"v",children:t}),dt.jsx("div",{className:"d",children:o})]})}function TQ(e){if(!e)return 0;return new Date(e.lastSeenAt).getTime()-new Date(e.startedAt).getTime()}function zx({records:e,peak:t,onOpenSession:o}){let a=TQ(e.longestWallSession),n=e.biggestTurn;return dt.jsxs("div",{className:"records",children:[dt.jsx(Yi,{label:"costliest session",value:se(e.costliestSession?.cost??null)??"—",detail:dt.jsx(im,{session:e.costliestSession,onOpen:o})}),dt.jsx(Yi,{label:"most turns in a session",value:e.longestSession?.turns??"—",detail:dt.jsx(im,{session:e.longestSession,onOpen:o})}),dt.jsx(Yi,{label:"longest session",value:a>0?oa(a):"—",detail:dt.jsx(im,{session:e.longestWallSession,onOpen:o})}),dt.jsx(Yi,{label:"biggest single turn",value:n?`${Wt(n.output)} out`:"—",detail:n?dt.jsxs(dt.Fragment,{children:[wo(n.model)," ·"," ",dt.jsx(im,{session:{id:n.sessionId,title:n.title},onOpen:o})]}):"—"}),dt.jsx(Yi,{label:"busiest day",value:e.busiestDay?se(e.busiestDay.cost)??"—":"—",detail:e.busiestDay?`${e.busiestDay.day} · ${e.busiestDay.turns} turns`:"—"}),dt.jsx(Yi,{label:"favourite hour",value:`${String(t.hour).padStart(2,"0")}:00`,detail:`${t.turns} turns in that hour, all time`})]})}var Eo=x(T(),1),Ux=0.75,AQ=90000,EQ=587000,Fx=5,_x=300;function jx({report:e}){let t=e.totals,o=t.firstTs?new Date(t.firstTs):null,a=o?Math.max(1,Math.round((Date.now()-o.getTime())/86400000)):1,n=e.daily.filter((f)=>f.turns).map((f)=>f.day),r=qI(n),s=t.input+t.cacheWrite+t.cacheRead+t.output,l=t.output*Ux,c=l/AQ,u=(t.input+t.cacheRead+t.cacheWrite)*Ux,d=u/EQ,m=(t.cost??0)/Fx;return Eo.jsxs(Eo.Fragment,{children:[Eo.jsxs($t,{children:[Eo.jsx(K,{label:"all-time spend",value:se(t.cost)??"—",detail:`since ${o?o.toISOString().slice(0,10):"—"} · ${se((t.cost??0)/a)}/day`}),Eo.jsx(K,{label:"tokens processed",value:To(s),detail:`${To(t.output)} out · ${To(t.cacheRead)} cache read`}),Eo.jsx(K,{label:"turns",value:To(t.turns),detail:`${t.sessions} sessions · ${To(t.toolCalls)} tool calls`}),Eo.jsx(K,{label:"streak",value:`${r.current}d`,detail:`longest ${r.longest}d · ${n.length} active day${n.length===1?"":"s"} this year`})]}),Eo.jsxs($t,{children:[Eo.jsx(K,{label:"words written",value:To(l),detail:c>=1?`≈ ${c.toFixed(c<10?1:0)} novels`:`≈ ${(l/_x).toFixed(0)} pages`}),Eo.jsx(K,{label:"context re-read",value:`${To(u)} words`,detail:d>=1?`≈ ${d.toFixed(d<10?1:0)}× War and Peace`:`≈ ${(u/_x).toFixed(0)} pages`}),Eo.jsx(K,{label:"thinking share",value:xc(t.thinking,t.output),detail:`${Wt(t.thinking)} reasoning tokens · cache hit ${xc(t.cacheRead,t.input+t.cacheRead+t.cacheWrite)}`}),Eo.jsx(K,{label:"in coffee",value:`${m>=100?m.toFixed(0):m.toFixed(1)} ☕`,detail:`at $${Fx} a cup · ${t.subagents} subagents spawned`})]})]})}var ne=x(T(),1),OQ=[30,90,365],Bg=["output","input","cacheWrite","cacheRead"],Rg={output:"var(--acc-5)",input:"var(--acc-3)",cacheWrite:"var(--acc-2)",cacheRead:"var(--acc-1)"},Gx={output:"output",input:"input",cacheWrite:"cache write",cacheRead:"cache read"},Vx=(e)=>Bg.indexOf(e),Kx=Array.from({length:24},(e,t)=>String(t).padStart(2,"0"));function qx(){let e=B((b)=>b.project),t=B((b)=>b.openSession),o=q((b)=>b?.projects??NQ),[a,n]=Nc.useState(90),{data:r,error:s,reload:l}=ie(Fe.stats(e),120000),c=e?o.find((b)=>b.id===e)?.name??"(removed)":"all projects",u=Nc.useMemo(()=>{let b=[];for(let v=a-1;v>=0;v--){let S=new Date;S.setDate(S.getDate()-v),b.push(bs(S))}return b},[a]),d=Nc.useMemo(()=>{let b=new Map(r?.daily.map((C)=>[C.day,C])??[]),v=(C)=>u.map((D)=>b.get(D)?.[C]??0),S={};for(let C of Bg)S[C]=v(C);let h=0,g=u.map((C)=>(h+=b.get(C)?.cost??0,h)),y={};for(let C of r?.daily??[])y[C.day]=C.cost??0;let I=Kx.map((C,D)=>r?.byHour.find((M)=>M.hour===D)?.turns??0),k=I.indexOf(Math.max(...I));return{tokenSeries:S,outputSeries:{output:v("output")},cumulative:g,costByDay:y,hourSeries:{turns:I},peak:{hour:k,turns:I[k]??0}}},[r,u]);if(s&&!r)return ne.jsx(Ke,{error:s,onRetry:l});if(!r)return ne.jsx(Me,{});if(!r.totals.turns)return ne.jsx(F,{title:"Stats",hint:c,children:ne.jsx(ee,{children:"No turns recorded yet. Numbers appear once a session is transcribed."})});let m=r.totals,f=r.byModel.filter((b)=>b.model).map((b)=>({label:`${wo(b.model)} · ${b.turns} turns`,v:b.output})),p=[{label:"cache read",v:m.cacheRead},{label:"cache write",v:m.cacheWrite},{label:"input",v:m.input},{label:"output",v:m.output}];return ne.jsxs(ne.Fragment,{children:[ne.jsx(F,{title:"Stats",hint:c,actions:ne.jsx("span",{className:"seg",children:OQ.map((b)=>ne.jsxs("button",{type:"button",className:a===b?"on":"",onClick:()=>n(b),children:[b,"d"]},b))})}),ne.jsx(jx,{report:r}),ne.jsxs("div",{className:"chart-card",children:[ne.jsxs("h3",{children:["Activity ",ne.jsx("span",{children:"cost per day · last 52 weeks"})]}),ne.jsx(VI,{byDay:d.costByDay})]}),ne.jsxs("div",{className:"chart-card",children:[ne.jsxs("h3",{children:["Tokens per day ",ne.jsxs("span",{children:["last ",a," days · by class"]})]}),ne.jsx($i,{days:u,series:d.tokenSeries,format:To,colorOf:(b)=>Rg[b]??"var(--acc)",nameOf:(b)=>Gx[b]??b,sortKeys:(b,v)=>Vx(b)-Vx(v)}),ne.jsx(Ar,{keys:[...Bg],colorOf:(b)=>Rg[b]??"var(--acc)",nameOf:(b)=>Gx[b]??b})]}),ne.jsxs("div",{className:"cols",children:[ne.jsx(ut,{title:"Output tokens per day",hint:`last ${a} days`,children:ne.jsx($i,{days:u,series:d.outputSeries,format:To,colorOf:()=>Rg.output??"var(--acc)",nameOf:()=>"output",sortKeys:()=>0})}),ne.jsx(ut,{title:"Cumulative spend",hint:`last ${a} days`,children:ne.jsx(KI,{days:u,values:d.cumulative})})]}),ne.jsxs("div",{className:"cols mt-sec",children:[ne.jsx(ut,{title:"Turns by hour of day",hint:"all time · local",children:ne.jsx($i,{days:Kx,series:d.hourSeries,format:(b)=>String(Math.round(b)),colorOf:()=>"var(--acc)",nameOf:()=>"turns",sortKeys:()=>0,labelOf:(b)=>Number(b)%3?"":b})}),ne.jsxs(ut,{title:"Model mix",hint:"by output tokens · all time",children:[ne.jsx(Dc,{parts:f,format:To}),ne.jsxs("h3",{className:"mt-panel",children:["Token composition ",ne.jsx("span",{children:"all time"})]}),ne.jsx(Dc,{parts:p,format:To})]})]}),ne.jsxs("div",{className:"cols mt-sec",children:[ne.jsx(ut,{title:"Tool leaderboard",hint:"calls · all time",children:r.tools.length>0?ne.jsx(Gi,{bars:r.tools.map(([b,v])=>({label:Qw(b),value:v}))}):ne.jsx("div",{className:"dim",children:"no tool calls yet"})}),ne.jsx("div",{children:ne.jsx(F,{title:"Records",children:ne.jsx(zx,{records:r.records,peak:d.peak,onOpenSession:t})})})]}),ne.jsxs("p",{className:"dim note",children:["Word counts assume ~0.75 words per token; a novel is 90k words. Costs use list prices, as on Spend. ",xc(m.sidechainTurns,m.turns)," of turns came from subagents."]})]})}var NQ=[];var Xi=x(R(),1);var Pg=x(R(),1);var ht=x(T(),1),Hg=3600000,$x=0.4;function Wx({sessions:e,from:t,to:o,detail:a,projectName:n,onOpenSession:r}){let s=Math.max(1,o-t),l=(p)=>Math.min(100,Math.max(0,100*(p-t)/s)),c=Pg.useMemo(()=>{let p=[];for(let b=Math.ceil(t/Hg)*Hg;b<=o;b+=Hg)p.push(b);return p},[t,o]),u=Math.max(1,Math.round(c.length/12)),d=Pg.useMemo(()=>{let p=new Map;for(let b of e){let v=p.get(b.projectId)??[];v.push(b),p.set(b.projectId,v)}return[...p.entries()].map(([b,v])=>({projectId:b,sessions:[...v].sort((S,h)=>S.startedAt<h.startedAt?-1:1)}))},[e]),m=c.map((p)=>ht.jsx("i",{style:{left:`${l(p)}%`}},p)),f=Date.now();return ht.jsxs("div",{className:"tl",children:[ht.jsxs("div",{className:"tl-row head",children:[ht.jsx("span",{className:"tl-name"}),ht.jsxs("span",{className:"tl-track",children:[ht.jsx("div",{className:"tl-axis",children:c.map((p,b)=>b%u?null:ht.jsxs("span",{style:{left:`${l(p)}%`},children:[String(new Date(p).getHours()).padStart(2,"0"),":00"]},p))}),f>=t&&f<=o&&ht.jsx("b",{className:"tl-now",style:{left:`${l(f)}%`}})]})]}),d.map((p)=>{let b=(a?.claims??[]).filter((v)=>v.projectId===p.projectId&&new Date(v.expiresAt).getTime()>=t&&new Date(v.acquiredAt).getTime()<=o);return ht.jsxs("div",{className:"tl-group",children:[ht.jsxs("div",{className:"tl-proj",children:[n(p.projectId),ht.jsx("small",{children:p.sessions.length})]}),b.length>0&&ht.jsxs("div",{className:"tl-row claimlane",children:[ht.jsx("span",{className:"tl-name dim",children:"claims"}),ht.jsxs("span",{className:"tl-track",children:[m,b.map((v)=>{let S=Math.max(t,new Date(v.acquiredAt).getTime()),h=Math.min(o,new Date(v.expiresAt).getTime()),g=`<b>${v.task}</b><br>${v.state} · ${v.owner||"?"}<br>lease ${Oa(v.acquiredAt)} → ${Oa(v.expiresAt)}`;return ht.jsx("i",{"data-tip":g,className:`claim ${v.state}`,style:{left:`${l(S)}%`,width:`${Math.max($x,l(h)-l(S))}%`}},`${v.task}-${v.acquiredAt}`)})]})]}),p.sessions.map((v)=>{let S=Math.max(t,new Date(v.startedAt).getTime()),h=Math.min(o,new Date(v.lastSeenAt).getTime()),g=v.state==="active"||v.state==="waiting",y=(a?.turns[v.id]??[]).filter((D)=>D>=S&&D<=h),I=ro(v.agent),k=v.title??v.id.slice(0,8),C=`<b>${k}</b><br><i style="background:${I}"></i>${St(v.agent)} · ${v.state}<br>${Oa(v.startedAt)} → ${Oa(v.lastSeenAt)} · ${se(v.costUsd)??"—"} · ${v.turns} turns`;return ht.jsxs("div",{className:"tl-row",onClick:()=>r(v.id),onKeyDown:(D)=>{if(D.key==="Enter"||D.key===" ")r(v.id)},role:"button",tabIndex:0,children:[ht.jsx("span",{className:"tl-name",children:k}),ht.jsxs("span",{className:"tl-track",children:[m,ht.jsx("i",{"data-tip":C,className:`${g?"live":""}${y.length?" thin":""}`,style:{left:`${l(S)}%`,width:`${Math.max($x,l(h)-l(S))}%`,background:I,color:I}}),y.map((D)=>ht.jsx("u",{style:{left:`${l(D)}%`,background:I}},D))]})]},v.id)})]},p.projectId)})]})}var aa=x(T(),1),LQ=[3,6,12,24,72],Zx=3600000;function Xx(){let e=B((f)=>f.project),t=B((f)=>f.openSession),o=q((f)=>f?.sessions??Yx),a=q((f)=>f?.projects??Yx),[n,r]=Xi.useState(12),{data:s}=ie(`/v1/timeline${ze({hours:n,project:e})}`,15000),l=Xi.useMemo(()=>{let f=new Map(a.map((p)=>[p.id,p.name]));return(p)=>f.get(p)??"(removed)"},[a]),c=Date.now()+0.25*Zx,u=Date.now()-n*Zx,d=Xi.useMemo(()=>o.filter((f)=>(!e||f.projectId===e)&&new Date(f.lastSeenAt).getTime()>=u&&f.kind!=="subagent"),[o,e,u]),m=Xi.useMemo(()=>[...new Set(d.map((f)=>f.agent))].sort(nn),[d]);return aa.jsxs(aa.Fragment,{children:[aa.jsx(F,{title:"Timeline",hint:`${d.length} sessions · last ${n}h · ${se(Na(d,(f)=>f.costUsd))??"$0.00"}`,actions:aa.jsx("span",{className:"seg",children:LQ.map((f)=>aa.jsxs("button",{type:"button",className:n===f?"on":"",onClick:()=>r(f),children:[f,"h"]},f))})}),d.length>0?aa.jsxs(aa.Fragment,{children:[aa.jsx(Wx,{sessions:d,from:u,to:c,detail:s,projectName:l,onOpenSession:t}),m.length>0&&aa.jsx(Ar,{keys:m})]}):aa.jsxs(ee,{children:["No sessions in the last ",n,"h."]})]})}var Yx=[];var me=x(T(),1),RQ={winner:["ok","Decided"],undecided:["acc","Running"],"all-failed":["bad","No winner"]};function Qx(){let e=B((c)=>c.project),t=B((c)=>c.openSession),{data:o,error:a,reload:n}=ie(Fe.trials(e)),r=[{key:"arm",label:"arm",width:130,get:(c)=>c.label,cell:(c)=>me.jsxs(me.Fragment,{children:[me.jsx("b",{children:c.label}),c.winner&&me.jsx(H,{tone:"ok",children:"Winner"})]})},{key:"state",label:"state",width:116,get:(c)=>c.ineligibleFor??"",cell:(c)=>c.eligible?me.jsx(H,{tone:"ok",children:"Passed"}):me.jsx("span",{title:`This arm cannot win: ${c.ineligibleFor??""}`,children:me.jsx(H,{tone:c.state==="running"?"acc":"warn",children:c.ineligibleFor??"—"})})},{key:"cost",label:"cost",width:74,num:!0,get:(c)=>c.costUsd,cell:(c)=>se(c.costUsd)??me.jsx(Z,{})},{key:"wall",label:"wall",width:74,num:!0,get:(c)=>c.wallMs??-1,cell:(c)=>c.wallMs===null?me.jsx(Z,{}):oa(c.wallMs)},{key:"turns",label:"turns",width:64,num:!0,get:(c)=>c.turns,cell:(c)=>c.turns},{key:"gates",label:"gates",width:84,num:!0,get:(c)=>c.gatesPassed-c.gatesFailed,cell:(c)=>me.jsxs(me.Fragment,{children:[c.gatesPassed>0&&me.jsx(H,{tone:"ok",children:c.gatesPassed}),c.gatesFailed>0&&me.jsx(H,{tone:"bad",children:c.gatesFailed}),!c.gatesPassed&&!c.gatesFailed&&me.jsx("span",{className:"dim",children:"none"})]})},{key:"diff",label:"diff",width:108,num:!0,get:(c)=>c.churn??-1,cell:(c)=>c.churn===null?me.jsx("span",{className:"dim",children:"measuring…"}):me.jsxs("span",{title:`${c.filesChanged} file${c.filesChanged===1?"":"s"} · +${c.insertions} −${c.deletions}`,children:[c.churn," lines"]})},{key:"sess",label:"session",flex:!0,get:(c)=>c.sessionId??"",cell:(c)=>c.sessionId?me.jsx("button",{type:"button",className:"link",onClick:()=>t(c.sessionId),children:c.model??c.sessionId.slice(0,8)}):me.jsx(Z,{})}];if(a&&!o)return me.jsx(Ke,{error:a,onRetry:n});if(!o)return me.jsx(Me,{});let s=o.trials;if(s.length===0)return me.jsx(F,{title:"Trials",hint:"same task, different models",children:me.jsxs(ee,{children:["No trials yet",e?"":" — pick a project to start one",".",me.jsx("br",{}),"A trial runs one task on several models at once and compares what each produced: cost, wall time, gates, diff size."]})});let l=s.filter((c)=>c.verdict==="undecided").length;return me.jsxs(me.Fragment,{children:[me.jsx(F,{title:"Trials",hint:`${s.length} trial${s.length===1?"":"s"}${l?` · ${l} still running`:""}`}),s.map((c)=>{let[u,d]=RQ[c.verdict],m=c.totals;return me.jsx(F,{title:c.task,spaced:!0,hint:me.jsxs(me.Fragment,{children:[me.jsx(H,{tone:u,children:d})," ",m.arms," arm",m.arms===1?"":"s"," ·"," ",m.finished," finished · ",se(m.costUsd)," spent",c.winner&&me.jsxs(me.Fragment,{children:[" · ",me.jsx("b",{children:c.winner})," won",m.savedUsd>0.005&&`, ${se(m.savedUsd)} cheaper than the dearest`]})]}),children:me.jsx(ke,{id:`ab-${c.task}`,columns:r,rows:c.arms,rowKey:(f)=>f.label,defaultPageSize:0})},c.task)}),me.jsxs("p",{className:"dim note",children:["An arm wins only if it finished and passed every gate it ran; among those, the cheapest wins and wall time breaks ties. A cheap arm that failed a gate never wins — the cheap wrong answer is not the answer. Each arm claims ",me.jsx("code",{children:"task#arm"}),", so it gets its own worktree and the one-holder claim is never bent."]})]})}var Jx=x(R(),1);var ws=x(T(),1);class zg extends Jx.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e){if(e.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}componentDidCatch(e,t){console.error("view failed",e,t.componentStack)}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=e instanceof tn&&e.status===404;return ws.jsxs("div",{className:"empty",children:[ws.jsx("b",{children:"This view stopped."}),ws.jsx("br",{}),t?"The daemon is older than this page — it is mid-upgrade. Reload once it has restarted.":e.message,ws.jsx("br",{}),ws.jsx("button",{type:"button",className:"link",onClick:()=>this.setState({error:null}),children:"Try again"})]})}}var lC=x(R(),1);function eC(){let e=q((o)=>o?.openIncidents??0),t=q((o)=>o?.questions.length??0);return{incidents:e,board:t}}var Ug="swarm.notify";function tC(){try{return localStorage.getItem(Ug)==="on"}catch{return!1}}var lm=()=>window.__TAURI__?.notification??null;function BQ(){if(lm())return"desktop";return"Notification"in window?"web":null}async function HQ(){let e=lm();if(e)return e.isPermissionGranted();return"Notification"in window&&Notification.permission==="granted"}async function PQ(){let e=lm();if(e)return await e.requestPermission()==="granted";if(!("Notification"in window))return!1;return await Notification.requestPermission()==="granted"}function zQ(e,t,o,a){let n=lm();if(n){n.sendNotification({title:e,body:t});return}let r=new Notification(e,a?{body:t,tag:a}:{body:t});if(o)r.onclick=()=>{o(),r.close()}}var Lc=null;function oC(){return Lc}async function aC(){let e=BQ();if(!e)return Lc="not available here",!1;if(!await HQ()&&!await PQ())return Lc=e==="desktop"?"blocked in System Settings":"blocked by the browser",!1;Lc=null;try{localStorage.setItem(Ug,"on")}catch{}return zQ("Swarm notifications on","You'll be pinged when a run needs a permission or a claim is orphaned."),!0}function nC(){Lc=null;try{localStorage.setItem(Ug,"off")}catch{}}function Fg(){let e=localStorage.getItem("swarm.theme");return e==="light"||e==="dark"?e:"system"}function rC(e){if(localStorage.setItem("swarm.theme",e),e==="system")delete document.documentElement.dataset.theme;else document.documentElement.dataset.theme=e}function sC(){let e=Fg();if(e!=="system")document.documentElement.dataset.theme=e}var UQ=[["system","System","monitor"],["light","Light","sun"],["dark","Dark","moon"]],FQ={system:"monitor",light:"sun",dark:"moon"};function iC(e){let t=Fg(),o=tC();return[{label:"Theme",icon:FQ[t],caption:t,children:UQ.map(([a,n,r])=>({label:n,icon:r,pressed:t===a,run:()=>{rC(a),e.refresh()}}))},{label:"",divider:!0},{label:"Refresh pricing",icon:"arrows-clockwise",caption:"LiteLLM",run:e.refreshPricing},{label:"Copy dashboard URL",icon:"copy",run:()=>void Zt(location.origin)},{label:"",divider:!0},{label:"Desktop notifications",icon:"bell",pressed:o,caption:o?"on":oC()??"off",run:()=>{if(o){nC(),e.refresh();return}aC().then(e.refresh)}},{label:"What's New",icon:"star",caption:`v${e.version??"?"}`,run:e.whatsNew},{label:"Documentation",icon:"book-open",caption:"getswarm",run:()=>on(mw)},{label:"Send feedback",icon:"comment-text",caption:"GitHub issue",run:()=>on(Hd(e.version))}]}var jt=x(T(),1);function cC({version:e,onOpenPalette:t,onOpenWhatsNew:o}){let a=B((c)=>c.toggleSidebar),n=B((c)=>c.sidebarCollapsed),r=q((c)=>c?Na(c.spend.byProjectToday,(u)=>u.cost):0),s=Hn((c)=>c.offline),[,l]=lC.useReducer((c)=>c+1,0);return jt.jsxs("header",{children:[jt.jsx("button",{type:"button",className:"icon-btn",title:"Toggle sidebar","aria-label":"Toggle sidebar",onClick:a,children:z(n?"arrow-bar-right":"arrow-bar-left",16)}),jt.jsxs("span",{className:"logo",children:[jt.jsx(jd,{}),"Swarm"]}),jt.jsx(_Q,{}),jt.jsx("span",{className:"sp"}),jt.jsxs("span",{id:"today",children:["Today ",jt.jsx("b",{children:se(r)??"$0.00"})]}),jt.jsx("button",{type:"button",className:"icon-btn",title:"Jump to view, project or session (⌘K)","aria-label":"Open command palette",onClick:t,children:z("magnifying-glass",16)}),jt.jsx("button",{type:"button",className:"icon-btn",title:"Send feedback (opens a GitHub issue)","aria-label":"Send feedback",onClick:()=>on(Hd(e)),children:z("comment-text",16)}),jt.jsx("button",{type:"button",className:"icon-btn",title:"Settings","aria-label":"Settings","aria-haspopup":"menu",onClick:(c)=>bo(c.currentTarget,iC({version:e,refresh:l,whatsNew:o,refreshPricing:()=>{De("/v1/pricing/refresh","POST").then(ct)}})),children:z("sliders",16)}),jt.jsxs("span",{id:"daemon",title:s?"Daemon unreachable":"Daemon connected",children:[jt.jsx("span",{className:s?"dot":"dot on"}),jt.jsx("span",{className:"lbl",children:"Daemon"})]})]})}function _Q(){let e=B((n)=>n.view),t=B((n)=>n.session),o=B((n)=>n.openView),a=eC();return jt.jsx("nav",{id:"viewnav",children:Ow.map((n)=>{let r=Bw(n),s=r.reduce((u,d)=>u+(a[d.id]??0),0),l=!t&&r.some((u)=>u.id===e),c=l?r.find((u)=>u.id===e):void 0;return jt.jsxs("button",{type:"button",className:l?"navgrp on":"navgrp","aria-haspopup":"menu",...l?{"aria-current":"page"}:{},onClick:(u)=>bo(u.currentTarget,r.map((d)=>{let m=a[d.id]??0;return{label:d.label,icon:d.icon,...m?{caption:String(m)}:{},pressed:!t&&e===d.id,run:()=>o(d.id)}})),children:[n,c&&jt.jsx("span",{className:"navview",children:c.label}),s>0&&jt.jsx("b",{className:"navcount",children:s>99?"99+":s}),z("chevron-down",12,"chev")]},n)})})}var Qi=x(T(),1);function uC({view:e}){let t=Rw(e);return Qi.jsxs("div",{className:"empty",children:[Qi.jsx("b",{children:t.label})," has not been ported yet.",Qi.jsx("br",{}),"It is still on the original dashboard at"," ",Qi.jsx("a",{href:"/",className:"link",children:"/"}),"."]})}var Hr=x(R(),1);var Gt=x(T(),1),dC=86400000,jQ=300000;function mC(){return Gt.jsxs(Gt.Fragment,{children:[Gt.jsx(GQ,{}),Gt.jsx(WQ,{})]})}function GQ(){let[e,t]=Hr.useState(null),[o,a]=Hr.useState(!1),[n,r]=Hr.useState(!1);if(Hr.useEffect(()=>{let c=()=>void qt("/v1/health").then(t).catch(()=>{});c();let u=setInterval(c,jQ);return()=>clearInterval(u)},[]),!(e?.disk&&e.version&&e.disk!==e.version)||o)return null;let l=async()=>{r(!0),await De("/v1/daemon/restart","POST").catch(()=>{});let c=Date.now()+30000,u=setInterval(async()=>{if((await qt("/v1/health").catch(()=>null))?.version===e.disk)clearInterval(u),location.reload();else if(Date.now()>c)clearInterval(u),a(!0)},800)};return Gt.jsxs("div",{className:"nudge",children:[z("arrows-clockwise",18,"ic"),Gt.jsxs("div",{children:[Gt.jsxs("b",{children:["Swarm ",e.disk," is installed"]}),"The daemon is still running ",e.version," — restart it to switch. Sessions and history are unaffected.",Gt.jsxs("div",{className:"row",children:[Gt.jsxs("button",{type:"button",className:"pri",disabled:n,onClick:()=>void l(),children:[z("arrows-clockwise",13)," ",n?"restarting…":"Restart daemon"]}),Gt.jsx("button",{type:"button",onClick:()=>a(!0),children:"Later"})]})]})]})}var fC="swarm.star",VQ=2*dC,KQ=30*dC,qQ=4000;function pC(){try{return JSON.parse(localStorage.getItem(fC)||"{}")}catch{return{}}}function cm(e){try{localStorage.setItem(fC,JSON.stringify({...pC(),...e}))}catch{}}function $Q(e){let t=pC();if(!t.since)return cm({since:e}),!1;if(t.done||t.never)return!1;if(e-t.since<VQ)return!1;if(t.last&&e-t.last<KQ)return!1;return!0}function WQ(){let[e,t]=Hr.useState(!1);if(Hr.useEffect(()=>{let o=setTimeout(()=>{let a=Date.now();if(!$Q(a)||document.querySelector(".nudge"))return;cm({last:a}),t(!0)},qQ);return()=>clearTimeout(o)},[]),!e)return null;return Gt.jsxs("div",{className:"nudge",children:[z("star",18,"ic"),Gt.jsxs("div",{children:[Gt.jsx("b",{children:"Enjoying Swarm?"}),"A star on GitHub helps other people find it — and tells us it's worth the evenings.",Gt.jsxs("div",{className:"row",children:[Gt.jsxs("button",{type:"button",className:"pri",onClick:()=>{cm({done:Date.now()}),t(!1),on(ag)},children:[z("star",13)," Star on GitHub"]}),Gt.jsx("button",{type:"button",onClick:()=>t(!1),children:"Later"}),Gt.jsx("button",{type:"button",className:"dim linkish",onClick:()=>{cm({never:Date.now()}),t(!1)},children:"Don't ask again"})]})]})]})}var xa=x(R(),1);var Pa=x(T(),1),ZQ=16,YQ=12,gC=Number.POSITIVE_INFINITY;function XQ(e,t){return Math.min(...[e.label,e.sub??""].map((o)=>{let a=o.toLowerCase().indexOf(t);return a<0?gC:a}))}function bC({onClose:e}){let t=B((h)=>h.openView),o=B((h)=>h.selectProject),a=B((h)=>h.openSession),n=B((h)=>h.setSearch),r=q((h)=>h?.projects??hC),s=q((h)=>h?.sessions??hC),[l,c]=xa.useState(""),[u,d]=xa.useState(0),m=xa.useRef(null),f=xa.useRef(null),p=xa.useMemo(()=>{let h=(g)=>r.find((y)=>y.id===g)?.name??"";return[...wc.map((g)=>({icon:g.icon,label:g.label,group:g.group.toLowerCase(),run:()=>t(g.id)})),...r.map((g)=>({icon:"folder-simple",label:g.name,group:"project",run:()=>o(g.id)})),...s.map((g)=>({icon:"terminal-window",label:g.title??g.id.slice(0,8),sub:h(g.projectId),live:g.state==="active"||g.state==="waiting",group:"session",run:()=>a(g.id)}))]},[r,s,t,o,a]),b=xa.useMemo(()=>{let h=l.trim().toLowerCase();if(!h)return p.filter((y)=>y.group!=="session"||y.live).slice(0,ZQ);let g=p.map((y)=>({entry:y,r:XQ(y,h)})).filter((y)=>y.r!==gC).sort((y,I)=>y.r-I.r).slice(0,YQ).map((y)=>y.entry);return g.push({icon:"magnifying-glass",label:`Search Swarm for “${l.trim()}”`,group:"search",run:()=>n(l.trim())}),g},[p,l,n]),v=Math.min(u,Math.max(0,b.length-1));xa.useEffect(()=>{f.current?.focus()},[]),xa.useEffect(()=>{m.current?.querySelector(".on")?.scrollIntoView({block:"nearest"})});let S=(h)=>{if(!h)return;e(),h.run()};return Pa.jsxs("div",{className:"pk pal",role:"dialog","aria-modal":"true","aria-label":"Command palette",children:[Pa.jsxs("div",{className:"pk-h",children:[z("magnifying-glass",15),Pa.jsx("input",{ref:f,placeholder:"Jump to view, project or session…",spellCheck:!1,autoComplete:"off",value:l,onChange:(h)=>{c(h.target.value),d(0)},onKeyDown:(h)=>{if(h.key==="ArrowDown"||h.key==="ArrowUp"){h.preventDefault();let g=h.key==="ArrowDown"?1:-1;d(Math.max(0,Math.min(b.length-1,v+g)))}else if(h.key==="Enter")h.preventDefault(),S(b[v])}})]}),Pa.jsx("div",{className:"pk-list",ref:m,children:b.length===0?Pa.jsx("div",{className:"empty pal-empty",children:"No matches."}):b.map((h,g)=>Pa.jsxs("button",{type:"button",className:g===v?"pk-row on":"pk-row",onMouseEnter:()=>d(g),onClick:()=>S(h),children:[z(h.icon,14),Pa.jsxs("span",{className:"nm",children:[h.label,h.sub&&Pa.jsxs("span",{className:"dim",children:[" · ",h.sub]})]}),Pa.jsx("span",{className:"grp",children:h.group})]},`${h.group}:${h.label}`))})]})}var hC=[];var O=x(R()),Ts=x(gn());var wt=x(R());function SC(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return wt.useMemo(()=>(a)=>{t.forEach((n)=>n(a))},t)}var Rc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Is(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function um(e){return"nodeType"in e}function xo(e){var t,o;if(!e)return window;if(Is(e))return e;if(!um(e))return window;return(t=(o=e.ownerDocument)==null?void 0:o.defaultView)!=null?t:window}function dm(e){let{Document:t}=xo(e);return e instanceof t}function Ji(e){if(Is(e))return!1;return e instanceof xo(e).HTMLElement}function jg(e){return e instanceof xo(e).SVGElement}function xs(e){if(!e)return document;if(Is(e))return e.document;if(!um(e))return document;if(dm(e))return e;if(Ji(e)||jg(e))return e.ownerDocument;return document}var ra=Rc?wt.useLayoutEffect:wt.useEffect;function Bc(e){let t=wt.useRef(e);return ra(()=>{t.current=e}),wt.useCallback(function(){for(var o=arguments.length,a=Array(o),n=0;n<o;n++)a[n]=arguments[n];return t.current==null?void 0:t.current(...a)},[])}function yC(){let e=wt.useRef(null),t=wt.useCallback((a,n)=>{e.current=setInterval(a,n)},[]),o=wt.useCallback(()=>{if(e.current!==null)clearInterval(e.current),e.current=null},[]);return[t,o]}function el(e,t){if(t===void 0)t=[e];let o=wt.useRef(e);return ra(()=>{if(o.current!==e)o.current=e},t),o}function tl(e,t){let o=wt.useRef();return wt.useMemo(()=>{let a=e(o.current);return o.current=a,a},[...t])}function Hc(e){let t=Bc(e),o=wt.useRef(null),a=wt.useCallback((n)=>{if(n!==o.current)t==null||t(n,o.current);o.current=n},[]);return[o,a]}function Pc(e){let t=wt.useRef();return wt.useEffect(()=>{t.current=e},[e]),t.current}var _g={};function Cs(e,t){return wt.useMemo(()=>{if(t)return t;let o=_g[e]==null?0:_g[e]+1;return _g[e]=o,e+"-"+o},[e,t])}function wC(e){return function(t){for(var o=arguments.length,a=Array(o>1?o-1:0),n=1;n<o;n++)a[n-1]=arguments[n];return a.reduce((r,s)=>{let l=Object.entries(s);for(let[c,u]of l){let d=r[c];if(d!=null)r[c]=d+e*u}return r},{...t})}}var Ms=wC(1),ks=wC(-1);function QQ(e){return"clientX"in e&&"clientY"in e}function ol(e){if(!e)return!1;let{KeyboardEvent:t}=xo(e.target);return t&&e instanceof t}function JQ(e){if(!e)return!1;let{TouchEvent:t}=xo(e.target);return t&&e instanceof t}function al(e){if(JQ(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:o}=e.touches[0];return{x:t,y:o}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:o}=e.changedTouches[0];return{x:t,y:o}}}if(QQ(e))return{x:e.clientX,y:e.clientY};return null}var na=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return"scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(!e)return;return[na.Translate.toString(e),na.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:a}=e;return t+" "+o+"ms "+a}}}),vC="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function IC(e){if(e.matches(vC))return e;return e.querySelector(vC)}var Ds=x(R()),eJ={display:"none"};function xC(e){let{id:t,value:o}=e;return Ds.default.createElement("div",{id:t,style:eJ},o)}function CC(e){let{id:t,announcement:o,ariaLiveType:a="assertive"}=e,n={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 Ds.default.createElement("div",{id:t,style:n,role:"status","aria-live":a,"aria-atomic":!0},o)}function MC(){let[e,t]=Ds.useState("");return{announce:Ds.useCallback((a)=>{if(a!=null)t(a)},[]),announcement:e}}var zC=O.createContext(null);function tJ(e){let t=O.useContext(zC);O.useEffect(()=>{if(!t)throw Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function oJ(){let[e]=O.useState(()=>new Set),t=O.useCallback((a)=>(e.add(a),()=>e.delete(a)),[e]);return[O.useCallback((a)=>{let{type:n,event:r}=a;e.forEach((s)=>{var l;return(l=s[n])==null?void 0:l.call(s,r)})},[e]),t]}var aJ={draggable:`
24
+ To pick up a draggable item, press the space bar.
25
+ While dragging, use the arrow keys to move the item.
26
+ Press space again to drop the item in its new position, or press escape to cancel.
27
+ `},nJ={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:o}=e;if(o)return"Draggable item "+t.id+" was moved over droppable area "+o.id+".";return"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:o}=e;if(o)return"Draggable item "+t.id+" was dropped over droppable area "+o.id;return"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function rJ(e){let{announcements:t=nJ,container:o,hiddenTextDescribedById:a,screenReaderInstructions:n=aJ}=e,{announce:r,announcement:s}=MC(),l=Cs("DndLiveRegion"),[c,u]=O.useState(!1);if(O.useEffect(()=>{u(!0)},[]),tJ(O.useMemo(()=>({onDragStart(m){let{active:f}=m;r(t.onDragStart({active:f}))},onDragMove(m){let{active:f,over:p}=m;if(t.onDragMove)r(t.onDragMove({active:f,over:p}))},onDragOver(m){let{active:f,over:p}=m;r(t.onDragOver({active:f,over:p}))},onDragEnd(m){let{active:f,over:p}=m;r(t.onDragEnd({active:f,over:p}))},onDragCancel(m){let{active:f,over:p}=m;r(t.onDragCancel({active:f,over:p}))}}),[r,t])),!c)return null;let d=O.default.createElement(O.default.Fragment,null,O.default.createElement(xC,{id:a,value:n.draggable}),O.default.createElement(CC,{id:l,announcement:s}));return o?Ts.createPortal(d,o):d}var Qt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Qt||(Qt={}));function fm(){}function Fc(e,t){return O.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function hm(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return O.useMemo(()=>[...t].filter((a)=>a!=null),[...t])}var za=Object.freeze({x:0,y:0});function Yg(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function sJ(e,t){let o=al(e);if(!o)return"0 0";let a={x:(o.x-t.left)/t.width*100,y:(o.y-t.top)/t.height*100};return a.x+"% "+a.y+"%"}function Xg(e,t){let{data:{value:o}}=e,{data:{value:a}}=t;return o-a}function iJ(e,t){let{data:{value:o}}=e,{data:{value:a}}=t;return a-o}function qg(e){let{left:t,top:o,height:a,width:n}=e;return[{x:t,y:o},{x:t+n,y:o},{x:t,y:o+a},{x:t+n,y:o+a}]}function Qg(e,t){if(!e||e.length===0)return null;let[o]=e;return t?o[t]:o}function kC(e,t,o){if(t===void 0)t=e.left;if(o===void 0)o=e.top;return{x:t+e.width*0.5,y:o+e.height*0.5}}var UC=(e)=>{let{collisionRect:t,droppableRects:o,droppableContainers:a}=e,n=kC(t,t.left,t.top),r=[];for(let s of a){let{id:l}=s,c=o.get(l);if(c){let u=Yg(kC(c),n);r.push({id:l,data:{droppableContainer:s,value:u}})}}return r.sort(Xg)},FC=(e)=>{let{collisionRect:t,droppableRects:o,droppableContainers:a}=e,n=qg(t),r=[];for(let s of a){let{id:l}=s,c=o.get(l);if(c){let u=qg(c),d=n.reduce((f,p,b)=>f+Yg(u[b],p),0),m=Number((d/4).toFixed(4));r.push({id:l,data:{droppableContainer:s,value:m}})}}return r.sort(Xg)};function lJ(e,t){let o=Math.max(t.top,e.top),a=Math.max(t.left,e.left),n=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),s=n-a,l=r-o;if(a<n&&o<r){let c=t.width*t.height,u=e.width*e.height,d=s*l,m=d/(c+u-d);return Number(m.toFixed(4))}return 0}var Jg=(e)=>{let{collisionRect:t,droppableRects:o,droppableContainers:a}=e,n=[];for(let r of a){let{id:s}=r,l=o.get(s);if(l){let c=lJ(l,t);if(c>0)n.push({id:s,data:{droppableContainer:r,value:c}})}}return n.sort(iJ)};function cJ(e,t){let{top:o,left:a,bottom:n,right:r}=t;return o<=e.y&&e.y<=n&&a<=e.x&&e.x<=r}var _C=(e)=>{let{droppableContainers:t,droppableRects:o,pointerCoordinates:a}=e;if(!a)return[];let n=[];for(let r of t){let{id:s}=r,l=o.get(s);if(l&&cJ(a,l)){let u=qg(l).reduce((m,f)=>m+Yg(a,f),0),d=Number((u/4).toFixed(4));n.push({id:s,data:{droppableContainer:r,value:d}})}}return n.sort(Xg)};function uJ(e,t,o){return{...e,scaleX:t&&o?t.width/o.width:1,scaleY:t&&o?t.height/o.height:1}}function jC(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:za}function dJ(e){return function(o){for(var a=arguments.length,n=Array(a>1?a-1:0),r=1;r<a;r++)n[r-1]=arguments[r];return n.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...o})}}var mJ=dJ(1);function GC(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function fJ(e,t,o){let a=GC(t);if(!a)return e;let{scaleX:n,scaleY:r,x:s,y:l}=a,c=e.left-s-(1-n)*parseFloat(o),u=e.top-l-(1-r)*parseFloat(o.slice(o.indexOf(" ")+1)),d=n?e.width/n:e.width,m=r?e.height/r:e.height;return{width:d,height:m,top:u,right:c+d,bottom:u+m,left:c}}var pJ={ignoreTransform:!1};function As(e,t){if(t===void 0)t=pJ;let o=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:u,transformOrigin:d}=xo(e).getComputedStyle(e);if(u)o=fJ(o,u,d)}let{top:a,left:n,width:r,height:s,bottom:l,right:c}=o;return{top:a,left:n,width:r,height:s,bottom:l,right:c}}function DC(e){return As(e,{ignoreTransform:!0})}function hJ(e){let{innerWidth:t,innerHeight:o}=e;return{top:0,left:0,right:t,bottom:o,width:t,height:o}}function gJ(e,t){if(t===void 0)t=xo(e).getComputedStyle(e);return t.position==="fixed"}function bJ(e,t){if(t===void 0)t=xo(e).getComputedStyle(e);let o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((n)=>{let r=t[n];return typeof r==="string"?o.test(r):!1})}function _c(e,t){let o=[];function a(n){if(t!=null&&o.length>=t)return o;if(!n)return o;if(dm(n)&&n.scrollingElement!=null&&!o.includes(n.scrollingElement))return o.push(n.scrollingElement),o;if(!Ji(n)||jg(n))return o;if(o.includes(n))return o;let r=xo(e).getComputedStyle(n);if(n!==e){if(bJ(n,r))o.push(n)}if(gJ(n,r))return o;return a(n.parentNode)}if(!e)return o;return a(e)}function VC(e){let[t]=_c(e,1);return t!=null?t:null}function Gg(e){if(!Rc||!e)return null;if(Is(e))return e;if(!um(e))return null;if(dm(e)||e===xs(e).scrollingElement)return window;if(Ji(e))return e;return null}function KC(e){if(Is(e))return e.scrollX;return e.scrollLeft}function qC(e){if(Is(e))return e.scrollY;return e.scrollTop}function $g(e){return{x:KC(e),y:qC(e)}}var so;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(so||(so={}));function $C(e){if(!Rc||!e)return!1;return e===document.scrollingElement}function WC(e){let t={x:0,y:0},o=$C(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-o.width,y:e.scrollHeight-o.height},n=e.scrollTop<=t.y,r=e.scrollLeft<=t.x,s=e.scrollTop>=a.y,l=e.scrollLeft>=a.x;return{isTop:n,isLeft:r,isBottom:s,isRight:l,maxScroll:a,minScroll:t}}var vJ={x:0.2,y:0.2};function SJ(e,t,o,a,n){let{top:r,left:s,right:l,bottom:c}=o;if(a===void 0)a=10;if(n===void 0)n=vJ;let{isTop:u,isBottom:d,isLeft:m,isRight:f}=WC(e),p={x:0,y:0},b={x:0,y:0},v={height:t.height*n.y,width:t.width*n.x};if(!u&&r<=t.top+v.height)p.y=so.Backward,b.y=a*Math.abs((t.top+v.height-r)/v.height);else if(!d&&c>=t.bottom-v.height)p.y=so.Forward,b.y=a*Math.abs((t.bottom-v.height-c)/v.height);if(!f&&l>=t.right-v.width)p.x=so.Forward,b.x=a*Math.abs((t.right-v.width-l)/v.width);else if(!m&&s<=t.left+v.width)p.x=so.Backward,b.x=a*Math.abs((t.left+v.width-s)/v.width);return{direction:p,speed:b}}function yJ(e){if(e===document.scrollingElement){let{innerWidth:r,innerHeight:s}=window;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}let{top:t,left:o,right:a,bottom:n}=e.getBoundingClientRect();return{top:t,left:o,right:a,bottom:n,width:e.clientWidth,height:e.clientHeight}}function ZC(e){return e.reduce((t,o)=>Ms(t,$g(o)),za)}function wJ(e){return e.reduce((t,o)=>t+KC(o),0)}function IJ(e){return e.reduce((t,o)=>t+qC(o),0)}function YC(e,t){if(t===void 0)t=As;if(!e)return;let{top:o,left:a,bottom:n,right:r}=t(e);if(!VC(e))return;if(n<=0||r<=0||o>=window.innerHeight||a>=window.innerWidth)e.scrollIntoView({block:"center",inline:"center"})}var xJ=[["x",["left","right"],wJ],["y",["top","bottom"],IJ]];class gm{constructor(e,t){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;let o=_c(t),a=ZC(o);this.rect={...e},this.width=e.width,this.height=e.height;for(let[n,r,s]of xJ)for(let l of r)Object.defineProperty(this,l,{get:()=>{let c=s(o),u=a[n]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class nl{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((t)=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...t)})},this.target=e}add(e,t,o){var a;(a=this.target)==null||a.addEventListener(e,t,o),this.listeners.push([e,t,o])}}function CJ(e){let{EventTarget:t}=xo(e);return e instanceof t?e:xs(e)}function Vg(e,t){let o=Math.abs(e.x),a=Math.abs(e.y);if(typeof t==="number")return Math.sqrt(o**2+a**2)>t;if("x"in t&&"y"in t)return o>t.x&&a>t.y;if("x"in t)return o>t.x;if("y"in t)return a>t.y;return!1}var Ca;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ca||(Ca={}));function TC(e){e.preventDefault()}function MJ(e){e.stopPropagation()}var Ie;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ie||(Ie={}));var XC={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter,Ie.Tab]},kJ=(e,t)=>{let{currentCoordinates:o}=t;switch(e.code){case Ie.Right:return{...o,x:o.x+25};case Ie.Left:return{...o,x:o.x-25};case Ie.Down:return{...o,y:o.y+25};case Ie.Up:return{...o,y:o.y-25}}return};class jc{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new nl(xs(t)),this.windowListeners=new nl(xo(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ca.Resize,this.handleCancel),this.windowListeners.add(Ca.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ca.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,o=e.node.current;if(o)YC(o);t(za)}handleKeyDown(e){if(ol(e)){let{active:t,context:o,options:a}=this.props,{keyboardCodes:n=XC,coordinateGetter:r=kJ,scrollBehavior:s="smooth"}=a,{code:l}=e;if(n.end.includes(l)){this.handleEnd(e);return}if(n.cancel.includes(l)){this.handleCancel(e);return}let{collisionRect:c}=o.current,u=c?{x:c.left,y:c.top}:za;if(!this.referenceCoordinates)this.referenceCoordinates=u;let d=r(e,{active:t,context:o.current,currentCoordinates:u});if(d){let m=ks(d,u),f={x:0,y:0},{scrollableAncestors:p}=o.current;for(let b of p){let v=e.code,{isTop:S,isRight:h,isLeft:g,isBottom:y,maxScroll:I,minScroll:k}=WC(b),C=yJ(b),D={x:Math.min(v===Ie.Right?C.right-C.width/2:C.right,Math.max(v===Ie.Right?C.left:C.left+C.width/2,d.x)),y:Math.min(v===Ie.Down?C.bottom-C.height/2:C.bottom,Math.max(v===Ie.Down?C.top:C.top+C.height/2,d.y))},M=v===Ie.Right&&!h||v===Ie.Left&&!g,A=v===Ie.Down&&!y||v===Ie.Up&&!S;if(M&&D.x!==d.x){let E=b.scrollLeft+m.x,j=v===Ie.Right&&E<=I.x||v===Ie.Left&&E>=k.x;if(j&&!m.y){b.scrollTo({left:E,behavior:s});return}if(j)f.x=b.scrollLeft-E;else f.x=v===Ie.Right?b.scrollLeft-I.x:b.scrollLeft-k.x;if(f.x)b.scrollBy({left:-f.x,behavior:s});break}else if(A&&D.y!==d.y){let E=b.scrollTop+m.y,j=v===Ie.Down&&E<=I.y||v===Ie.Up&&E>=k.y;if(j&&!m.x){b.scrollTo({top:E,behavior:s});return}if(j)f.y=b.scrollTop-E;else f.y=v===Ie.Down?b.scrollTop-I.y:b.scrollTop-k.y;if(f.y)b.scrollBy({top:-f.y,behavior:s});break}}this.handleMove(e,Ms(ks(d,this.referenceCoordinates),f))}}}handleMove(e,t){let{onMove:o}=this.props;e.preventDefault(),o(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}jc.activators=[{eventName:"onKeyDown",handler:(e,t,o)=>{let{keyboardCodes:a=XC,onActivation:n}=t,{active:r}=o,{code:s}=e.nativeEvent;if(a.start.includes(s)){let l=r.activatorNode.current;if(l&&e.target!==l)return!1;return e.preventDefault(),n==null||n({event:e.nativeEvent}),!0}return!1}}];function AC(e){return Boolean(e&&"distance"in e)}function EC(e){return Boolean(e&&"delay"in e)}class bm{constructor(e,t,o){var a;if(o===void 0)o=CJ(e.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=e,this.events=t;let{event:n}=e,{target:r}=n;this.props=e,this.events=t,this.document=xs(r),this.documentListeners=new nl(this.document),this.listeners=new nl(o),this.windowListeners=new nl(xo(r)),this.initialCoordinates=(a=al(n))!=null?a:za,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(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel)this.listeners.add(e.cancel.name,this.handleCancel);if(this.windowListeners.add(Ca.Resize,this.handleCancel),this.windowListeners.add(Ca.DragStart,TC),this.windowListeners.add(Ca.VisibilityChange,this.handleCancel),this.windowListeners.add(Ca.ContextMenu,TC),this.documentListeners.add(Ca.Keydown,this.handleKeydown),t){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(EC(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(AC(t)){this.handlePending(t);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending(e,t){let{active:o,onPending:a}=this.props;a(o,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;if(e)this.activated=!0,this.documentListeners.add(Ca.Click,MJ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ca.SelectionChange,this.removeTextSelection),t(e)}handleMove(e){var t;let{activated:o,initialCoordinates:a,props:n}=this,{onMove:r,options:{activationConstraint:s}}=n;if(!a)return;let l=(t=al(e))!=null?t:za,c=ks(a,l);if(!o&&s){if(AC(s)){if(s.tolerance!=null&&Vg(c,s.tolerance))return this.handleCancel();if(Vg(c,s.distance))return this.handleStart()}if(EC(s)){if(Vg(c,s.tolerance))return this.handleCancel()}this.handlePending(s,c);return}if(e.cancelable)e.preventDefault();r(l)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;if(this.detach(),!this.activated)e(this.props.active);t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;if(this.detach(),!this.activated)e(this.props.active);t()}handleKeydown(e){if(e.code===Ie.Esc)this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}var DJ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Es extends bm{constructor(e){let{event:t}=e,o=xs(t.target);super(e,DJ,o)}}Es.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:a}=t;if(!o.isPrimary||o.button!==0)return!1;return a==null||a({event:o}),!0}}];var TJ={move:{name:"mousemove"},end:{name:"mouseup"}},Wg;(function(e){e[e.RightClick=2]="RightClick"})(Wg||(Wg={}));class QC extends bm{constructor(e){super(e,TJ,xs(e.event.target))}}QC.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:a}=t;if(o.button===Wg.RightClick)return!1;return a==null||a({event:o}),!0}}];var Kg={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class JC extends bm{constructor(e){super(e,Kg)}static setup(){return window.addEventListener(Kg.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Kg.move.name,e)};function e(){}}}JC.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:a}=t,{touches:n}=o;if(n.length>1)return!1;return a==null||a({event:o}),!0}}];var zc;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(zc||(zc={}));var pm;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(pm||(pm={}));function AJ(e){let{acceleration:t,activator:o=zc.Pointer,canScroll:a,draggingRect:n,enabled:r,interval:s=5,order:l=pm.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:m,threshold:f}=e,p=OJ({delta:m,disabled:!r}),[b,v]=yC(),S=O.useRef({x:0,y:0}),h=O.useRef({x:0,y:0}),g=O.useMemo(()=>{switch(o){case zc.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case zc.DraggableRect:return n}},[o,n,c]),y=O.useRef(null),I=O.useCallback(()=>{let C=y.current;if(!C)return;let D=S.current.x*h.current.x,M=S.current.y*h.current.y;C.scrollBy(D,M)},[]),k=O.useMemo(()=>l===pm.TreeOrder?[...u].reverse():u,[l,u]);O.useEffect(()=>{if(!r||!u.length||!g){v();return}for(let C of k){if((a==null?void 0:a(C))===!1)continue;let D=u.indexOf(C),M=d[D];if(!M)continue;let{direction:A,speed:E}=SJ(C,M,g,t,f);for(let j of["x","y"])if(!p[j][A[j]])E[j]=0,A[j]=0;if(E.x>0||E.y>0){v(),y.current=C,b(I,s),S.current=E,h.current=A;return}}S.current={x:0,y:0},h.current={x:0,y:0},v()},[t,I,a,v,r,s,JSON.stringify(g),JSON.stringify(p),b,u,k,d,JSON.stringify(f)])}var EJ={x:{[so.Backward]:!1,[so.Forward]:!1},y:{[so.Backward]:!1,[so.Forward]:!1}};function OJ(e){let{delta:t,disabled:o}=e,a=Pc(t);return tl((n)=>{if(o||!a||!n)return EJ;let r={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return{x:{[so.Backward]:n.x[so.Backward]||r.x===-1,[so.Forward]:n.x[so.Forward]||r.x===1},y:{[so.Backward]:n.y[so.Backward]||r.y===-1,[so.Forward]:n.y[so.Forward]||r.y===1}}},[o,t,a])}function NJ(e,t){let o=t!=null?e.get(t):void 0,a=o?o.node.current:null;return tl((n)=>{var r;if(t==null)return null;return(r=a!=null?a:n)!=null?r:null},[a,t])}function LJ(e,t){return O.useMemo(()=>e.reduce((o,a)=>{let{sensor:n}=a,r=n.activators.map((s)=>({eventName:s.eventName,handler:t(s.handler,a)}));return[...o,...r]},[]),[e,t])}var Uc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Uc||(Uc={}));var Zg;(function(e){e.Optimized="optimized"})(Zg||(Zg={}));var OC=new Map;function RJ(e,t){let{dragging:o,dependencies:a,config:n}=t,[r,s]=O.useState(null),{frequency:l,measure:c,strategy:u}=n,d=O.useRef(e),m=S(),f=el(m),p=O.useCallback(function(h){if(h===void 0)h=[];if(f.current)return;s((g)=>{if(g===null)return h;return g.concat(h.filter((y)=>!g.includes(y)))})},[f]),b=O.useRef(null),v=tl((h)=>{if(m&&!o)return OC;if(!h||h===OC||d.current!==e||r!=null){let g=new Map;for(let y of e){if(!y)continue;if(r&&r.length>0&&!r.includes(y.id)&&y.rect.current){g.set(y.id,y.rect.current);continue}let I=y.node.current,k=I?new gm(c(I),I):null;if(y.rect.current=k,k)g.set(y.id,k)}return g}return h},[e,r,o,m,c]);return O.useEffect(()=>{d.current=e},[e]),O.useEffect(()=>{if(m)return;p()},[o,m]),O.useEffect(()=>{if(r&&r.length>0)s(null)},[JSON.stringify(r)]),O.useEffect(()=>{if(m||typeof l!=="number"||b.current!==null)return;b.current=setTimeout(()=>{p(),b.current=null},l)},[l,m,p,...a]),{droppableRects:v,measureDroppableContainers:p,measuringScheduled:r!=null};function S(){switch(u){case Uc.Always:return!1;case Uc.BeforeDragging:return o;default:return!o}}}function eb(e,t){return tl((o)=>{if(!e)return null;if(o)return o;return typeof t==="function"?t(e):e},[t,e])}function BJ(e,t){return eb(e,t)}function HJ(e){let{callback:t,disabled:o}=e,a=Bc(t),n=O.useMemo(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:r}=window;return new r(a)},[a,o]);return O.useEffect(()=>()=>n==null?void 0:n.disconnect(),[n]),n}function vm(e){let{callback:t,disabled:o}=e,a=Bc(t),n=O.useMemo(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:r}=window;return new r(a)},[o]);return O.useEffect(()=>()=>n==null?void 0:n.disconnect(),[n]),n}function PJ(e){return new gm(As(e),e)}function NC(e,t,o){if(t===void 0)t=PJ;let[a,n]=O.useState(null);function r(){n((c)=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c!=null?c:o)!=null?u:null}let d=t(e);if(JSON.stringify(c)===JSON.stringify(d))return c;return d})}let s=HJ({callback(c){if(!e)return;for(let u of c){let{type:d,target:m}=u;if(d==="childList"&&m instanceof HTMLElement&&m.contains(e)){r();break}}}}),l=vm({callback:r});return ra(()=>{if(r(),e)l==null||l.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0});else l==null||l.disconnect(),s==null||s.disconnect()},[e]),a}function zJ(e){let t=eb(e);return jC(e,t)}var LC=[];function UJ(e){let t=O.useRef(e),o=tl((a)=>{if(!e)return LC;if(a&&a!==LC&&e&&t.current&&e.parentNode===t.current.parentNode)return a;return _c(e)},[e]);return O.useEffect(()=>{t.current=e},[e]),o}function FJ(e){let[t,o]=O.useState(null),a=O.useRef(e),n=O.useCallback((r)=>{let s=Gg(r.target);if(!s)return;o((l)=>{if(!l)return null;return l.set(s,$g(s)),new Map(l)})},[]);return O.useEffect(()=>{let r=a.current;if(e!==r){s(r);let l=e.map((c)=>{let u=Gg(c);if(u)return u.addEventListener("scroll",n,{passive:!0}),[u,$g(u)];return null}).filter((c)=>c!=null);o(l.length?new Map(l):null),a.current=e}return()=>{s(e),s(r)};function s(l){l.forEach((c)=>{let u=Gg(c);u==null||u.removeEventListener("scroll",n)})}},[n,e]),O.useMemo(()=>{if(e.length)return t?Array.from(t.values()).reduce((r,s)=>Ms(r,s),za):ZC(e);return za},[e,t])}function RC(e,t){if(t===void 0)t=[];let o=O.useRef(null);return O.useEffect(()=>{o.current=null},t),O.useEffect(()=>{let a=e!==za;if(a&&!o.current)o.current=e;if(!a&&o.current)o.current=null},[e]),o.current?ks(e,o.current):za}function _J(e){O.useEffect(()=>{if(!Rc)return;let t=e.map((o)=>{let{sensor:a}=o;return a.setup==null?void 0:a.setup()});return()=>{for(let o of t)o==null||o()}},e.map((t)=>{let{sensor:o}=t;return o}))}function jJ(e,t){return O.useMemo(()=>e.reduce((o,a)=>{let{eventName:n,handler:r}=a;return o[n]=(s)=>{r(s,t)},o},{}),[e,t])}function eM(e){return O.useMemo(()=>e?hJ(e):null,[e])}var BC=[];function GJ(e,t){if(t===void 0)t=As;let[o]=e,a=eM(o?xo(o):null),[n,r]=O.useState(BC);function s(){r(()=>{if(!e.length)return BC;return e.map((c)=>$C(c)?a:new gm(t(c),c))})}let l=vm({callback:s});return ra(()=>{l==null||l.disconnect(),s(),e.forEach((c)=>l==null?void 0:l.observe(c))},[e]),n}function tM(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Ji(t)?t:e}function VJ(e){let{measure:t}=e,[o,a]=O.useState(null),n=O.useCallback((u)=>{for(let{target:d}of u)if(Ji(d)){a((m)=>{let f=t(d);return m?{...m,width:f.width,height:f.height}:f});break}},[t]),r=vm({callback:n}),s=O.useCallback((u)=>{let d=tM(u);if(r==null||r.disconnect(),d)r==null||r.observe(d);a(d?t(d):null)},[t,r]),[l,c]=Hc(s);return O.useMemo(()=>({nodeRef:l,rect:o,setRef:c}),[o,l,c])}var KJ=[{sensor:Es,options:{}},{sensor:jc,options:{}}],qJ={current:{}},mm={draggable:{measure:DC},droppable:{measure:DC,strategy:Uc.WhileDragging,frequency:Zg.Optimized},dragOverlay:{measure:As}};class rl extends Map{get(e){var t;return e!=null?(t=super.get(e))!=null?t:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e)=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,o;return(t=(o=this.get(e))==null?void 0:o.node.current)!=null?t:void 0}}var $J={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mm,measureDroppableContainers:fm,windowRect:null,measuringScheduled:!1},oM={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fm,draggableNodes:new Map,over:null,measureDroppableContainers:fm},Gc=O.createContext(oM),aM=O.createContext($J);function WJ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rl}}}function ZJ(e,t){switch(t.type){case Qt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Qt.DragMove:if(e.draggable.active==null)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Qt.DragEnd:case Qt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{let{element:o}=t,{id:a}=o,n=new rl(e.droppable.containers);return n.set(a,o),{...e,droppable:{...e.droppable,containers:n}}}case Qt.SetDroppableDisabled:{let{id:o,key:a,disabled:n}=t,r=e.droppable.containers.get(o);if(!r||a!==r.key)return e;let s=new rl(e.droppable.containers);return s.set(o,{...r,disabled:n}),{...e,droppable:{...e.droppable,containers:s}}}case Qt.UnregisterDroppable:{let{id:o,key:a}=t,n=e.droppable.containers.get(o);if(!n||a!==n.key)return e;let r=new rl(e.droppable.containers);return r.delete(o),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function YJ(e){let{disabled:t}=e,{active:o,activatorEvent:a,draggableNodes:n}=O.useContext(Gc),r=Pc(a),s=Pc(o==null?void 0:o.id);return O.useEffect(()=>{if(t)return;if(!a&&r&&s!=null){if(!ol(r))return;if(document.activeElement===r.target)return;let l=n.get(s);if(!l)return;let{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(let d of[c.current,u.current]){if(!d)continue;let m=IC(d);if(m){m.focus();break}}})}},[a,t,n,s,r]),null}function nM(e,t){let{transform:o,...a}=t;return e!=null&&e.length?e.reduce((n,r)=>r({transform:n,...a}),o):o}function XJ(e){return O.useMemo(()=>({draggable:{...mm.draggable,...e==null?void 0:e.draggable},droppable:{...mm.droppable,...e==null?void 0:e.droppable},dragOverlay:{...mm.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function QJ(e){let{activeNode:t,measure:o,initialRect:a,config:n=!0}=e,r=O.useRef(!1),{x:s,y:l}=typeof n==="boolean"?{x:n,y:n}:n;ra(()=>{if(!s&&!l||!t){r.current=!1;return}if(r.current||!a)return;let u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;let d=o(u),m=jC(d,a);if(!s)m.x=0;if(!l)m.y=0;if(r.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){let f=VC(u);if(f)f.scrollBy({top:m.y,left:m.x})}},[t,s,l,a,o])}var Sm=O.createContext({...za,scaleX:1,scaleY:1}),Pr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pr||(Pr={}));var ym=O.memo(function(t){var o,a,n,r;let{id:s,accessibility:l,autoScroll:c=!0,children:u,sensors:d=KJ,collisionDetection:m=Jg,measuring:f,modifiers:p,...b}=t,v=O.useReducer(ZJ,void 0,WJ),[S,h]=v,[g,y]=oJ(),[I,k]=O.useState(Pr.Uninitialized),C=I===Pr.Initialized,{draggable:{active:D,nodes:M,translate:A},droppable:{containers:E}}=S,j=D!=null?M.get(D):null,de=O.useRef({initial:null,translated:null}),fe=O.useMemo(()=>{var So;return D!=null?{id:D,data:(So=j==null?void 0:j.data)!=null?So:qJ,rect:de}:null},[D,j]),pe=O.useRef(null),[Ye,eo]=O.useState(null),[st,to]=O.useState(null),G=el(b,Object.values(b)),J=Cs("DndDescribedBy",s),Se=O.useMemo(()=>E.getEnabled(),[E]),Be=XJ(f),{droppableRects:lo,measureDroppableContainers:Co,measuringScheduled:dn}=RJ(Se,{dragging:C,dependencies:[A.x,A.y],config:Be.droppable}),co=NJ(M,D),Fs=O.useMemo(()=>st?al(st):null,[st]),jn=$q(),mn=BJ(co,Be.draggable.measure);QJ({activeNode:D!=null?M.get(D):null,config:jn.layoutShiftCompensation,initialRect:mn,measure:Be.draggable.measure});let je=NC(co,Be.draggable.measure,mn),ul=NC(co?co.parentElement:null),Va=O.useRef({activatorEvent:null,active:null,activeNode:co,collisionRect:null,collisions:null,droppableRects:lo,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_s=E.getNodeFor((o=Va.current.over)==null?void 0:o.id),fn=VJ({measure:Be.dragOverlay.measure}),js=(a=fn.nodeRef.current)!=null?a:co,Gs=C?(n=fn.rect)!=null?n:je:null,m0=Boolean(fn.nodeRef.current&&fn.rect),f0=zJ(m0?null:je),cf=eM(js?xo(js):null),Gn=UJ(C?_s!=null?_s:co:null),nu=GJ(Gn),ru=nM(p,{transform:{x:A.x-f0.x,y:A.y-f0.y,scaleX:1,scaleY:1},activatorEvent:st,active:fe,activeNodeRect:je,containerNodeRect:ul,draggingNodeRect:Gs,over:Va.current.over,overlayNodeRect:fn.rect,scrollableAncestors:Gn,scrollableAncestorRects:nu,windowRect:cf}),p0=Fs?Ms(Fs,A):null,h0=FJ(Gn),Fq=RC(h0),_q=RC(h0,[je]),Vs=Ms(ru,Fq),Ks=Gs?mJ(Gs,ru):null,dl=fe&&Ks?m({active:fe,collisionRect:Ks,droppableRects:lo,droppableContainers:Se,pointerCoordinates:p0}):null,g0=Qg(dl,"id"),[Vn,b0]=O.useState(null),jq=m0?ru:Ms(ru,_q),Gq=uJ(jq,(r=Vn==null?void 0:Vn.rect)!=null?r:null,je),uf=O.useRef(null),v0=O.useCallback((So,Go)=>{let{sensor:Vo,options:Kn}=Go;if(pe.current==null)return;let sa=M.get(pe.current);if(!sa)return;let Ko=So.nativeEvent,Ka=new Vo({active:pe.current,activeNode:sa,event:Ko,options:Kn,context:Va,onAbort(uo){if(!M.get(uo))return;let{onDragAbort:qa}=G.current,pn={id:uo};qa==null||qa(pn),g({type:"onDragAbort",event:pn})},onPending(uo,qn,qa,pn){if(!M.get(uo))return;let{onDragPending:fl}=G.current,$n={id:uo,constraint:qn,initialCoordinates:qa,offset:pn};fl==null||fl($n),g({type:"onDragPending",event:$n})},onStart(uo){let qn=pe.current;if(qn==null)return;let qa=M.get(qn);if(!qa)return;let{onDragStart:pn}=G.current,ml={activatorEvent:Ko,active:{id:qn,data:qa.data,rect:de}};Ts.unstable_batchedUpdates(()=>{pn==null||pn(ml),k(Pr.Initializing),h({type:Qt.DragStart,initialCoordinates:uo,active:qn}),g({type:"onDragStart",event:ml}),eo(uf.current),to(Ko)})},onMove(uo){h({type:Qt.DragMove,coordinates:uo})},onEnd:qs(Qt.DragEnd),onCancel:qs(Qt.DragCancel)});uf.current=Ka;function qs(uo){return async function(){let{active:qa,collisions:pn,over:ml,scrollAdjustedTranslate:fl}=Va.current,$n=null;if(qa&&fl){let{cancelDrop:pl}=G.current;if($n={activatorEvent:Ko,active:qa,collisions:pn,delta:fl,over:ml},uo===Qt.DragEnd&&typeof pl==="function"){if(await Promise.resolve(pl($n)))uo=Qt.DragCancel}}pe.current=null,Ts.unstable_batchedUpdates(()=>{h({type:uo}),k(Pr.Uninitialized),b0(null),eo(null),to(null),uf.current=null;let pl=uo===Qt.DragEnd?"onDragEnd":"onDragCancel";if($n){let df=G.current[pl];df==null||df($n),g({type:pl,event:$n})}})}}},[M]),Vq=O.useCallback((So,Go)=>(Vo,Kn)=>{let sa=Vo.nativeEvent,Ko=M.get(Kn);if(pe.current!==null||!Ko||sa.dndKit||sa.defaultPrevented)return;let Ka={active:Ko};if(So(Vo,Go.options,Ka)===!0)sa.dndKit={capturedBy:Go.sensor},pe.current=Kn,v0(Vo,Go)},[M,v0]),S0=LJ(d,Vq);_J(d),ra(()=>{if(je&&I===Pr.Initializing)k(Pr.Initialized)},[je,I]),O.useEffect(()=>{let{onDragMove:So}=G.current,{active:Go,activatorEvent:Vo,collisions:Kn,over:sa}=Va.current;if(!Go||!Vo)return;let Ko={active:Go,activatorEvent:Vo,collisions:Kn,delta:{x:Vs.x,y:Vs.y},over:sa};Ts.unstable_batchedUpdates(()=>{So==null||So(Ko),g({type:"onDragMove",event:Ko})})},[Vs.x,Vs.y]),O.useEffect(()=>{let{active:So,activatorEvent:Go,collisions:Vo,droppableContainers:Kn,scrollAdjustedTranslate:sa}=Va.current;if(!So||pe.current==null||!Go||!sa)return;let{onDragOver:Ko}=G.current,Ka=Kn.get(g0),qs=Ka&&Ka.rect.current?{id:Ka.id,rect:Ka.rect.current,data:Ka.data,disabled:Ka.disabled}:null,uo={active:So,activatorEvent:Go,collisions:Vo,delta:{x:sa.x,y:sa.y},over:qs};Ts.unstable_batchedUpdates(()=>{b0(qs),Ko==null||Ko(uo),g({type:"onDragOver",event:uo})})},[g0]),ra(()=>{Va.current={activatorEvent:st,active:fe,activeNode:co,collisionRect:Ks,collisions:dl,droppableRects:lo,draggableNodes:M,draggingNode:js,draggingNodeRect:Gs,droppableContainers:E,over:Vn,scrollableAncestors:Gn,scrollAdjustedTranslate:Vs},de.current={initial:Gs,translated:Ks}},[fe,co,dl,Ks,M,js,Gs,lo,E,Vn,Gn,Vs]),AJ({...jn,delta:A,draggingRect:Ks,pointerCoordinates:p0,scrollableAncestors:Gn,scrollableAncestorRects:nu});let Kq=O.useMemo(()=>({active:fe,activeNode:co,activeNodeRect:je,activatorEvent:st,collisions:dl,containerNodeRect:ul,dragOverlay:fn,draggableNodes:M,droppableContainers:E,droppableRects:lo,over:Vn,measureDroppableContainers:Co,scrollableAncestors:Gn,scrollableAncestorRects:nu,measuringConfiguration:Be,measuringScheduled:dn,windowRect:cf}),[fe,co,je,st,dl,ul,fn,M,E,lo,Vn,Co,Gn,nu,Be,dn,cf]),qq=O.useMemo(()=>({activatorEvent:st,activators:S0,active:fe,activeNodeRect:je,ariaDescribedById:{draggable:J},dispatch:h,draggableNodes:M,over:Vn,measureDroppableContainers:Co}),[st,S0,fe,je,h,J,M,Vn,Co]);return O.default.createElement(zC.Provider,{value:y},O.default.createElement(Gc.Provider,{value:qq},O.default.createElement(aM.Provider,{value:Kq},O.default.createElement(Sm.Provider,{value:Gq},u)),O.default.createElement(YJ,{disabled:(l==null?void 0:l.restoreFocus)===!1})),O.default.createElement(rJ,{...l,hiddenTextDescribedById:J}));function $q(){let So=(Ye==null?void 0:Ye.autoScrollEnabled)===!1,Go=typeof c==="object"?c.enabled===!1:c===!1,Vo=C&&!So&&!Go;if(typeof c==="object")return{...c,enabled:Vo};return{enabled:Vo}}}),JJ=O.createContext(null),HC="button",eee="Draggable";function rM(e){let{id:t,data:o,disabled:a=!1,attributes:n}=e,r=Cs(eee),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:m,over:f}=O.useContext(Gc),{role:p=HC,roleDescription:b="draggable",tabIndex:v=0}=n!=null?n:{},S=(c==null?void 0:c.id)===t,h=O.useContext(S?Sm:JJ),[g,y]=Hc(),[I,k]=Hc(),C=jJ(s,t),D=el(o);ra(()=>(m.set(t,{id:t,key:r,node:g,activatorNode:I,data:D}),()=>{let A=m.get(t);if(A&&A.key===r)m.delete(t)}),[m,t]);let M=O.useMemo(()=>({role:p,tabIndex:v,"aria-disabled":a,"aria-pressed":S&&p===HC?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[a,p,v,S,b,d.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:M,isDragging:S,listeners:a?void 0:C,node:g,over:f,setNodeRef:y,setActivatorNodeRef:k,transform:h}}function tb(){return O.useContext(aM)}var tee="Droppable",oee={timeout:25};function sM(e){let{data:t,disabled:o=!1,id:a,resizeObserverConfig:n}=e,r=Cs(tee),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=O.useContext(Gc),d=O.useRef({disabled:o}),m=O.useRef(!1),f=O.useRef(null),p=O.useRef(null),{disabled:b,updateMeasurementsFor:v,timeout:S}={...oee,...n},h=el(v!=null?v:a),g=O.useCallback(()=>{if(!m.current){m.current=!0;return}if(p.current!=null)clearTimeout(p.current);p.current=setTimeout(()=>{u(Array.isArray(h.current)?h.current:[h.current]),p.current=null},S)},[S]),y=vm({callback:g,disabled:b||!s}),I=O.useCallback((M,A)=>{if(!y)return;if(A)y.unobserve(A),m.current=!1;if(M)y.observe(M)},[y]),[k,C]=Hc(I),D=el(t);return O.useEffect(()=>{if(!y||!k.current)return;y.disconnect(),m.current=!1,y.observe(k.current)},[k,y]),O.useEffect(()=>(l({type:Qt.RegisterDroppable,element:{id:a,key:r,disabled:o,node:k,rect:f,data:D}}),()=>l({type:Qt.UnregisterDroppable,key:r,id:a})),[a]),O.useEffect(()=>{if(o!==d.current.disabled)l({type:Qt.SetDroppableDisabled,id:a,key:r,disabled:o}),d.current.disabled=o},[a,r,o,l]),{active:s,rect:f,isOver:(c==null?void 0:c.id)===a,node:k,over:c,setNodeRef:C}}function aee(e){let{animation:t,children:o}=e,[a,n]=O.useState(null),[r,s]=O.useState(null),l=Pc(o);if(!o&&!a&&l)n(l);return ra(()=>{if(!r)return;let c=a==null?void 0:a.key,u=a==null?void 0:a.props.id;if(c==null||u==null){n(null);return}Promise.resolve(t(u,r)).then(()=>{n(null)})},[t,a,r]),O.default.createElement(O.default.Fragment,null,o,a?O.cloneElement(a,{ref:s}):null)}var nee={x:0,y:0,scaleX:1,scaleY:1};function ree(e){let{children:t}=e;return O.default.createElement(Gc.Provider,{value:oM},O.default.createElement(Sm.Provider,{value:nee},t))}var see={position:"fixed",touchAction:"none"},iee=(e)=>ol(e)?"transform 250ms ease":void 0,lee=O.forwardRef((e,t)=>{let{as:o,activatorEvent:a,adjustScale:n,children:r,className:s,rect:l,style:c,transform:u,transition:d=iee}=e;if(!l)return null;let m=n?u:{...u,scaleX:1,scaleY:1},f={...see,width:l.width,height:l.height,top:l.top,left:l.left,transform:na.Transform.toString(m),transformOrigin:n&&a?sJ(a,l):void 0,transition:typeof d==="function"?d(a):d,...c};return O.default.createElement(o,{className:s,style:f,ref:t},r)}),cee=(e)=>(t)=>{let{active:o,dragOverlay:a}=t,n={},{styles:r,className:s}=e;if(r!=null&&r.active)for(let[l,c]of Object.entries(r.active)){if(c===void 0)continue;n[l]=o.node.style.getPropertyValue(l),o.node.style.setProperty(l,c)}if(r!=null&&r.dragOverlay)for(let[l,c]of Object.entries(r.dragOverlay)){if(c===void 0)continue;a.node.style.setProperty(l,c)}if(s!=null&&s.active)o.node.classList.add(s.active);if(s!=null&&s.dragOverlay)a.node.classList.add(s.dragOverlay);return function(){for(let[c,u]of Object.entries(n))o.node.style.setProperty(c,u);if(s!=null&&s.active)o.node.classList.remove(s.active)}},uee=(e)=>{let{transform:{initial:t,final:o}}=e;return[{transform:na.Transform.toString(t)},{transform:na.Transform.toString(o)}]},dee={duration:250,easing:"ease",keyframes:uee,sideEffects:cee({styles:{active:{opacity:"0"}}})};function mee(e){let{config:t,draggableNodes:o,droppableContainers:a,measuringConfiguration:n}=e;return Bc((r,s)=>{if(t===null)return;let l=o.get(r);if(!l)return;let c=l.node.current;if(!c)return;let u=tM(s);if(!u)return;let{transform:d}=xo(s).getComputedStyle(s),m=GC(d);if(!m)return;let f=typeof t==="function"?t:fee(t);return YC(c,n.draggable.measure),f({active:{id:r,data:l.data,node:c,rect:n.draggable.measure(c)},draggableNodes:o,dragOverlay:{node:s,rect:n.dragOverlay.measure(u)},droppableContainers:a,measuringConfiguration:n,transform:m})})}function fee(e){let{duration:t,easing:o,sideEffects:a,keyframes:n}={...dee,...e};return(r)=>{let{active:s,dragOverlay:l,transform:c,...u}=r;if(!t)return;let d={x:l.rect.left-s.rect.left,y:l.rect.top-s.rect.top},m={scaleX:c.scaleX!==1?s.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?s.rect.height*c.scaleY/l.rect.height:1},f={x:c.x-d.x,y:c.y-d.y,...m},p=n({...u,active:s,dragOverlay:l,transform:{initial:c,final:f}}),[b]=p,v=p[p.length-1];if(JSON.stringify(b)===JSON.stringify(v))return;let S=a==null?void 0:a({active:s,dragOverlay:l,...u}),h=l.node.animate(p,{duration:t,easing:o,fill:"forwards"});return new Promise((g)=>{h.onfinish=()=>{S==null||S(),g()}})}}var PC=0;function pee(e){return O.useMemo(()=>{if(e==null)return;return PC++,PC},[e])}var iM=O.default.memo((e)=>{let{adjustScale:t=!1,children:o,dropAnimation:a,style:n,transition:r,modifiers:s,wrapperElement:l="div",className:c,zIndex:u=999}=e,{activatorEvent:d,active:m,activeNodeRect:f,containerNodeRect:p,draggableNodes:b,droppableContainers:v,dragOverlay:S,over:h,measuringConfiguration:g,scrollableAncestors:y,scrollableAncestorRects:I,windowRect:k}=tb(),C=O.useContext(Sm),D=pee(m==null?void 0:m.id),M=nM(s,{activatorEvent:d,active:m,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:S.rect,over:h,overlayNodeRect:S.rect,scrollableAncestors:y,scrollableAncestorRects:I,transform:C,windowRect:k}),A=eb(f),E=mee({config:a,draggableNodes:b,droppableContainers:v,measuringConfiguration:g}),j=A?S.setRef:void 0;return O.default.createElement(ree,null,O.default.createElement(aee,{animation:E},m&&D?O.default.createElement(lee,{key:D,id:m.id,ref:j,as:l,activatorEvent:d,adjustScale:t,className:c,transition:r,rect:A,style:{zIndex:u,...n},transform:M},o):null))});function hee(e,t,o){let a={...e};if(t.top+e.y<=o.top)a.y=o.top-t.top;else if(t.bottom+e.y>=o.top+o.height)a.y=o.top+o.height-t.bottom;if(t.left+e.x<=o.left)a.x=o.left-t.left;else if(t.right+e.x>=o.left+o.width)a.x=o.left+o.width-t.right;return a}var wm=(e)=>{let{containerNodeRect:t,draggingNodeRect:o,transform:a}=e;if(!o||!t)return a;return hee(a,o,t)};var Im=(e)=>{let{transform:t}=e;return{...t,x:0}};var It=x(R());function km(e,t,o){let a=e.slice();return a.splice(o<0?a.length+o:o,0,a.splice(t,1)[0]),a}function gee(e,t){return e.reduce((o,a,n)=>{let r=t.get(a);if(r)o[n]=r;return o},Array(e.length))}function xm(e){return e!==null&&e>=0}function bee(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function vee(e){if(typeof e==="boolean")return{draggable:e,droppable:e};return e}var lM=(e)=>{let{rects:t,activeIndex:o,overIndex:a,index:n}=e,r=km(t,a,o),s=t[n],l=r[n];if(!l||!s)return null;return{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}};var Cm={scaleX:1,scaleY:1},Dm=(e)=>{var t;let{activeIndex:o,activeNodeRect:a,index:n,rects:r,overIndex:s}=e,l=(t=r[o])!=null?t:a;if(!l)return null;if(n===o){let u=r[s];if(!u)return null;return{x:0,y:o<s?u.top+u.height-(l.top+l.height):u.top-l.top,...Cm}}let c=See(r,n,o);if(n>o&&n<=s)return{x:0,y:-l.height-c,...Cm};if(n<o&&n>=s)return{x:0,y:l.height+c,...Cm};return{x:0,y:0,...Cm}};function See(e,t,o){let a=e[t],n=e[t-1],r=e[t+1];if(!a)return 0;if(o<t)return n?a.top-(n.top+n.height):r?r.top-(a.top+a.height):0;return r?r.top-(a.top+a.height):n?a.top-(n.top+n.height):0}var cM="Sortable",uM=It.default.createContext({activeIndex:-1,containerId:cM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:lM,disabled:{draggable:!1,droppable:!1}});function Tm(e){let{children:t,id:o,items:a,strategy:n=lM,disabled:r=!1}=e,{active:s,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:d}=tb(),m=Cs(cM,o),f=Boolean(l.rect!==null),p=It.useMemo(()=>a.map((C)=>typeof C==="object"&&("id"in C)?C.id:C),[a]),b=s!=null,v=s?p.indexOf(s.id):-1,S=u?p.indexOf(u.id):-1,h=It.useRef(p),g=!bee(p,h.current),y=S!==-1&&v===-1||g,I=vee(r);ra(()=>{if(g&&b)d(p)},[g,p,b,d]),It.useEffect(()=>{h.current=p},[p]);let k=It.useMemo(()=>({activeIndex:v,containerId:m,disabled:I,disableTransforms:y,items:p,overIndex:S,useDragOverlay:f,sortedRects:gee(p,c),strategy:n}),[v,m,I.draggable,I.droppable,y,p,S,c,f,n]);return It.default.createElement(uM.Provider,{value:k},t)}var yee=(e)=>{let{id:t,items:o,activeIndex:a,overIndex:n}=e;return km(o,a,n).indexOf(t)},wee=(e)=>{let{containerId:t,isSorting:o,wasDragging:a,index:n,items:r,newIndex:s,previousItems:l,previousContainerId:c,transition:u}=e;if(!u||!a)return!1;if(l!==r&&n===s)return!1;if(o)return!0;return s!==n&&t===c},Iee={duration:200,easing:"ease"},dM="transform",xee=na.Transition.toString({property:dM,duration:0,easing:"linear"}),Cee={roleDescription:"sortable"};function Mee(e){let{disabled:t,index:o,node:a,rect:n}=e,[r,s]=It.useState(null),l=It.useRef(o);return ra(()=>{if(!t&&o!==l.current&&a.current){let c=n.current;if(c){let u=As(a.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};if(d.x||d.y)s(d)}}if(o!==l.current)l.current=o},[t,o,a,n]),It.useEffect(()=>{if(r)s(null)},[r]),r}function Am(e){let{animateLayoutChanges:t=wee,attributes:o,disabled:a,data:n,getNewIndex:r=yee,id:s,strategy:l,resizeObserverConfig:c,transition:u=Iee}=e,{items:d,containerId:m,activeIndex:f,disabled:p,disableTransforms:b,sortedRects:v,overIndex:S,useDragOverlay:h,strategy:g}=It.useContext(uM),y=kee(a,p),I=d.indexOf(s),k=It.useMemo(()=>({sortable:{containerId:m,index:I,items:d},...n}),[m,n,I,d]),C=It.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:D,node:M,isOver:A,setNodeRef:E}=sM({id:s,data:k,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:j,activatorEvent:de,activeNodeRect:fe,attributes:pe,setNodeRef:Ye,listeners:eo,isDragging:st,over:to,setActivatorNodeRef:G,transform:J}=rM({id:s,data:k,attributes:{...Cee,...o},disabled:y.draggable}),Se=SC(E,Ye),Be=Boolean(j),lo=Be&&!b&&xm(f)&&xm(S),Co=!h&&st,dn=Co&&lo?J:null,co=l!=null?l:g,Fs=lo?dn!=null?dn:co({rects:v,activeNodeRect:fe,activeIndex:f,overIndex:S,index:I}):null,jn=xm(f)&&xm(S)?r({id:s,items:d,activeIndex:f,overIndex:S}):I,mn=j==null?void 0:j.id,je=It.useRef({activeId:mn,items:d,newIndex:jn,containerId:m}),ul=d!==je.current.items,Va=t({active:j,containerId:m,isDragging:st,isSorting:Be,id:s,index:I,items:d,newIndex:je.current.newIndex,previousItems:je.current.items,previousContainerId:je.current.containerId,transition:u,wasDragging:je.current.activeId!=null}),_s=Mee({disabled:!Va,index:I,node:M,rect:D});return It.useEffect(()=>{if(Be&&je.current.newIndex!==jn)je.current.newIndex=jn;if(m!==je.current.containerId)je.current.containerId=m;if(d!==je.current.items)je.current.items=d},[Be,jn,m,d]),It.useEffect(()=>{if(mn===je.current.activeId)return;if(mn!=null&&je.current.activeId==null){je.current.activeId=mn;return}let js=setTimeout(()=>{je.current.activeId=mn},50);return()=>clearTimeout(js)},[mn]),{active:j,activeIndex:f,attributes:pe,data:k,rect:D,index:I,newIndex:jn,items:d,isOver:A,isSorting:Be,isDragging:st,listeners:eo,node:M,overIndex:S,over:to,setNodeRef:Se,setActivatorNodeRef:G,setDroppableNodeRef:E,setDraggableNodeRef:Ye,transform:_s!=null?_s:Fs,transition:fn()};function fn(){if(_s||ul&&je.current.newIndex===I)return xee;if(Co&&!ol(de)||!u)return;if(Be||Va)return na.Transition.toString({...u,property:dM});return}}function kee(e,t){var o,a;if(typeof e==="boolean")return{draggable:e,droppable:!1};return{draggable:(o=e==null?void 0:e.draggable)!=null?o:t.draggable,droppable:(a=e==null?void 0:e.droppable)!=null?a:t.droppable}}function Mm(e){if(!e)return!1;let t=e.data.current;if(t&&"sortable"in t&&typeof t.sortable==="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)return!0;return!1}var Dee=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],mM=(e,t)=>{let{context:{active:o,collisionRect:a,droppableRects:n,droppableContainers:r,over:s,scrollableAncestors:l}}=t;if(Dee.includes(e.code)){if(e.preventDefault(),!o||!a)return;let c=[];r.getEnabled().forEach((m)=>{if(!m||m!=null&&m.disabled)return;let f=n.get(m.id);if(!f)return;switch(e.code){case Ie.Down:if(a.top<f.top)c.push(m);break;case Ie.Up:if(a.top>f.top)c.push(m);break;case Ie.Left:if(a.left>f.left)c.push(m);break;case Ie.Right:if(a.left<f.left)c.push(m);break}});let u=FC({active:o,collisionRect:a,droppableRects:n,droppableContainers:c,pointerCoordinates:null}),d=Qg(u,"id");if(d===(s==null?void 0:s.id)&&u.length>1)d=u[1].id;if(d!=null){let m=r.get(o.id),f=r.get(d),p=f?n.get(f.id):null,b=f==null?void 0:f.node.current;if(b&&p&&m&&f){let S=_c(b).some((C,D)=>l[D]!==C),h=fM(m,f),g=Tee(m,f),y=S||!h?{x:0,y:0}:{x:g?a.width-p.width:0,y:g?a.height-p.height:0},I={x:p.left,y:p.top};return y.x&&y.y?I:ks(I,y)}}}return};function fM(e,t){if(!Mm(e)||!Mm(t))return!1;return e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Tee(e,t){if(!Mm(e)||!Mm(t))return!1;if(!fM(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}var sn=x(R(),1);var Em=x(R(),1);var Oo=x(R(),1),pM=x(gn(),1);var xt=x(T(),1);function Aee(e){if(e instanceof tn)return e.status===404?"no such folder":"cannot read that folder";return e instanceof Error?e.message:"cannot read that folder"}function hM({focusPath:e,onClose:t}){let o=document.getElementById("picker"),a=Oo.useRef(null),n=Oo.useRef(null),r=Oo.useRef(null),[s,l]=Oo.useState(null),[c,u]=Oo.useState(""),[d,m]=Oo.useState(null),[f,p]=Oo.useState(!1);dg(a,t,o);let b=Oo.useCallback(async(g,y=!1)=>{r.current?.abort();let I=new AbortController;r.current=I;try{let k=await qt(Fe.fsList(g),I.signal);if(l(k),!y||!n.current?.value)u(k.path);m(null)}catch(k){if(I.signal.aborted)return;m(Aee(k))}},[]);Oo.useEffect(()=>(b("",!0),()=>r.current?.abort()),[b]);let v=Oo.useRef(!1);Oo.useEffect(()=>{if(!e||!s||v.current)return;if(v.current=!0,n.current?.value===s.path)n.current.select()},[e,s]);let S=async()=>{let g=c.trim()||s?.path;if(!g||f)return;p(!0);let y=await nI(g);if(p(!1),y.ok)t();else m(y.error??"could not add that folder")};if(!o)return null;let h=s?.path.replace(/\/$/,"")??"";return pM.createPortal(xt.jsxs("div",{className:"pk",role:"dialog","aria-modal":"true","aria-label":"Add a project",ref:a,children:[xt.jsxs("div",{className:"pk-h",children:[z("folders",15),xt.jsx("input",{ref:n,value:c,title:"Type a path and press Enter","aria-label":"Folder path",spellCheck:!1,autoComplete:"off",onChange:(g)=>u(g.target.value),onKeyDown:(g)=>{if(g.key==="Enter")g.preventDefault(),b(c.trim())}})]}),xt.jsx("div",{className:"pk-list",children:s===null?xt.jsx("div",{className:"empty pal-empty",children:"Loading…"}):xt.jsxs(xt.Fragment,{children:[s.parent!==null&&xt.jsxs("button",{type:"button",className:"pk-row up",onClick:()=>void b(s.parent??""),children:[z("arrow-left",14),xt.jsx("span",{className:"nm",children:".."})]}),s.entries.length===0&&xt.jsx("div",{className:"empty pal-empty",children:"No sub-folders."}),s.entries.map((g)=>xt.jsxs("button",{type:"button",className:"pk-row",onClick:()=>void b(`${h}/${g.name}`),children:[z(g.repo?"git-branch":"folder-simple",14),xt.jsx("span",{className:"nm",children:g.name}),g.repo&&xt.jsx("span",{className:"badge acc",children:"git"})]},g.name))]})}),xt.jsxs("div",{className:"pk-f",children:[d&&xt.jsx("span",{className:"pk-err",children:d}),xt.jsx("span",{className:"grow"}),xt.jsx("button",{type:"button",onClick:t,children:"Cancel"}),xt.jsx("button",{type:"button",className:"primary",disabled:f,onClick:()=>void S(),children:"Add this folder"})]})]}),o)}var zr=x(T(),1);function gM(){let[e,t]=Em.useState(null),o=Em.useCallback(()=>t(null),[]);return zr.jsxs(zr.Fragment,{children:[zr.jsxs("h4",{children:["Projects",zr.jsx("button",{type:"button",className:"h4-act",title:"Add a project","aria-label":"Add a project","aria-haspopup":"menu",onClick:(a)=>bo(a.currentTarget,[{label:"Browse folders…",icon:"folder-simple",run:()=>t("browse")},{label:"Add by path…",icon:"terminal-window",run:()=>t("path")}]),children:z("plus",14)})]}),e!==null&&zr.jsx(hM,{focusPath:e==="path",onClose:o})]})}var Ua=x(R(),1);var bM=["\uD83D\uDC1D","\uD83D\uDE80","\uD83E\uDDEA","\uD83D\uDCE6","\uD83D\uDEE0️","\uD83C\uDF10","\uD83D\uDCCA","\uD83E\uDD16","\uD83E\uDDE0","\uD83C\uDFA8","\uD83D\uDD12","\uD83D\uDCDA","\uD83D\uDCAC","\uD83C\uDFD7️","\uD83E\uDDE9","⚡"],ob=[["Smileys & people",128512,128591],["Gestures & body",128064,128255],["Animals & nature",128000,128063],["Food",127789,127871],["Activity & travel",128640,128767],["Objects",128160,128255],["Symbols",127744,127788],["More",129280,129535],["Extended",129648,129791],["Misc",9728,9983],["Dingbats",9984,10175]];var Om=null;function Eee(e,t){let n=t-e+1,r=Math.ceil(n/32),s=document.createElement("canvas");s.width=640,s.height=r*20;let l=s.getContext("2d",{willReadFrequently:!0});if(!l)return[];l.font="16px system-ui",l.textBaseline="top";for(let d=0;d<n;d++)l.fillText(String.fromCodePoint(e+d),d%32*20,Math.floor(d/32)*20);let c=l.getImageData(0,0,s.width,s.height).data,u=[];for(let d=0;d<n;d++){let m=d%32*20,f=Math.floor(d/32)*20;if(Oee(c,s.width,m,f,20))u.push(String.fromCodePoint(e+d))}return u}function Oee(e,t,o,a,n){for(let r=a;r<a+n;r++)for(let s=o;s<o+n;s++){let l=(r*t+s)*4,c=e[l]??0,u=e[l+1]??0,d=e[l+2]??0;if((e[l+3]??0)>40&&(Math.abs(c-u)>24||Math.abs(u-d)>24))return!0}return!1}function vM(){if(Om)return Om;let e=`${navigator.userAgent}|${ob.map((a)=>a.join(":")).join(",")}`,t=null;try{let a=JSON.parse(localStorage.getItem("swarm.emoji.v1")??"null");if(a?.sig===e&&Array.isArray(a.blocks))t=a.blocks}catch{}if(!t){let a=new Set;t=ob.map(([,n,r])=>Eee(n,r).filter((s)=>!a.has(s)&&a.add(s)));try{localStorage.setItem("swarm.emoji.v1",JSON.stringify({sig:e,blocks:t}))}catch{}}let o=t;return Om=ob.map(([a],n)=>({name:a,emoji:o[n]??[]})).filter((a)=>a.emoji.length>0),Om}function SM(e){return new Promise((t,o)=>{let a=URL.createObjectURL(e),n=new Image;n.onload=()=>{let s=document.createElement("canvas");s.width=64,s.height=64;let l=Math.min(n.width,n.height),c=(n.width-l)/2,u=(n.height-l)/2;s.getContext("2d")?.drawImage(n,c,u,l,l,0,0,64,64),URL.revokeObjectURL(a),t(s.toDataURL("image/png"))},n.onerror=()=>{URL.revokeObjectURL(a),o(Error("not an image the browser can decode"))},n.src=a})}var Ee=x(T(),1),Nee=["","c1","c2","c3","c4","c5","c6","c7"],yM=(e)=>typeof e==="string"&&e.startsWith("data:image/");function wM({project:e,onClose:t}){let[o,a]=Ua.useState(e.name),[n,r]=Ua.useState(yM(e.icon)?"":e.icon??""),[s,l]=Ua.useState(yM(e.icon)?e.icon:""),[c,u]=Ua.useState(e.color??""),[d,m]=Ua.useState(!e.discovered),[f,p]=Ua.useState(!1),[b,v]=Ua.useState(null),[S,h]=Ua.useState(!1),g=Ua.useRef(null),y=s||n.trim(),I=(M)=>{r(M),l("")},k=async(M)=>{if(!M)return;try{l(await SM(M)),r(""),v(null)}catch(A){v(A instanceof Error?A.message:String(A))}},C=async()=>{h(!0);let M=await sI(e.id,{...o.trim()?{name:o.trim()}:{},icon:y,color:c,pinned:d});if(h(!1),!M.ok){v(M.error??"could not save");return}t()},D=navigator.platform.startsWith("Mac");return Ee.jsxs(Ea,{title:"Project settings",glyph:"sliders",subtitle:e.root,onClose:t,footer:Ee.jsxs(Ee.Fragment,{children:[b&&Ee.jsx("span",{className:"pk-err",children:b}),Ee.jsx("button",{type:"button",onClick:t,children:"Cancel"}),Ee.jsx("button",{type:"button",className:"primary",disabled:S,onClick:()=>void C(),children:"Save"})]}),children:[Ee.jsxs("label",{children:["name",Ee.jsx("input",{value:o,maxLength:60,spellCheck:!1,onChange:(M)=>a(M.target.value),onKeyDown:(M)=>{if(M.key==="Enter")C()}})]}),Ee.jsxs("label",{children:["icon",Ee.jsxs("div",{className:"icon-row",children:[Ee.jsx(Ki,{project:{icon:y||null,color:c||null},size:16,large:!0}),Ee.jsx("input",{value:n,maxLength:4,placeholder:`emoji or 1–2 letters · ${D?"⌃⌘Space":"Win+."} opens the OS emoji picker`,spellCheck:!1,autoComplete:"off",onChange:(M)=>{r(M.target.value),l("")}}),Ee.jsxs("button",{type:"button",className:"btn",title:"PNG / JPEG / SVG / WebP — downsized to 64px and stored with the project",onClick:()=>g.current?.click(),children:[z("file-text",13)," Image…"]}),Ee.jsx("input",{ref:g,type:"file",accept:"image/*",hidden:!0,onChange:(M)=>{k(M.target.files?.[0]),M.target.value=""}})]})]}),Ee.jsxs("div",{className:"emoji-row",children:[bM.map((M)=>Ee.jsx("button",{type:"button",className:y===M?"emoji on":"emoji","aria-pressed":y===M,onClick:()=>I(M),children:M},M)),Ee.jsx("button",{type:"button",className:y?"emoji":"emoji on","aria-pressed":!y,title:"No icon",onClick:()=>I(""),children:z("folder-simple",14)}),Ee.jsx("button",{type:"button",className:"emoji more-emoji",title:"Browse every emoji","aria-expanded":f,onClick:()=>p((M)=>!M),children:"…"})]}),f&&Ee.jsx("div",{className:"emoji-all",children:vM().map((M)=>Ee.jsxs("div",{children:[Ee.jsx("div",{className:"emoji-sec",children:M.name}),Ee.jsx("div",{className:"emoji-row",children:M.emoji.map((A)=>Ee.jsx("button",{type:"button",className:y===A?"emoji on":"emoji",onClick:()=>I(A),children:A},A))})]},M.name))}),Ee.jsxs("div",{className:"pk-lbl",children:["color",Ee.jsx("div",{className:"swatches",children:Nee.map((M)=>{let A=["swatch",M?`pg-${M}`:"none"];if(c===M)A.push("on");return Ee.jsx("button",{type:"button",className:A.join(" "),title:M||"none","aria-label":M?`colour ${M}`:"no colour","aria-pressed":c===M,onClick:()=>u(M)},M||"none")})})]}),Ee.jsxs("label",{className:"chk",children:[Ee.jsx("input",{type:"checkbox",checked:d,onChange:(M)=>m(M.target.checked)}),"pinned — always in the sidebar, drag to reorder"]})]})}var Le=x(T(),1);function IM(){let e=B((C)=>C.project),t=B((C)=>C.selectProject),o=q((C)=>C?.projects??Ree),a=q((C)=>C?.sessions??Bee),n=q((C)=>C?.spendSparks??Hee),[r,s]=sn.useState(null),l=Ir(void 0,void 0,s),c=sn.useMemo(()=>{let C={};for(let D of a)if(D.state==="active"||D.state==="waiting")C[D.projectId]=(C[D.projectId]??0)+1;return C},[a]),u=sn.useMemo(()=>{let C=new Map;for(let D of o)C.set(D.name,(C.get(D.name)??0)+1);return C},[o]),d=sn.useMemo(()=>o.filter((C)=>!C.discovered),[o]),m=sn.useMemo(()=>o.filter((C)=>C.discovered),[o]),f=Object.values(c).reduce((C,D)=>C+D,0),[p,b]=sn.useState(null),[v,S]=sn.useState(null),h=sn.useMemo(()=>{if(!v)return d;let C=new Map(d.map((M)=>[M.id,M])),D=new Set(v);return[...v.flatMap((M)=>C.get(M)??[]),...d.filter((M)=>!D.has(M.id))]},[v,d]),g=hm(Fc(Es,{activationConstraint:{distance:4}})),y=(C)=>b(String(C.active.id)),I=({active:C,over:D})=>{if(b(null),!D||C.id===D.id)return;let M=h.map((E)=>E.id),A=km(M,M.indexOf(String(C.id)),M.indexOf(String(D.id)));S(A),rI(A).finally(()=>S(null))},k=(C)=>({project:C,selected:e===C.id,live:c[C.id]??0,spark:n[C.id]??Pee,ambiguous:(u.get(C.name)??0)>1,onSelect:t,onMenu:(D)=>dI(D,C,c[C.id]??0,l)});return Le.jsxs("aside",{id:"sidebar",children:[Le.jsxs("div",{id:"projects",children:[Le.jsx(gM,{}),Le.jsxs("button",{type:"button",className:e===null?"proj sel":"proj",onClick:()=>t(null),children:[Le.jsx("span",{className:f>0?"st live":"st"}),z("folders",14),Le.jsx("span",{className:"nm",children:"All projects"}),Le.jsx("small",{children:f||""})]}),Le.jsx(ym,{sensors:g,collisionDetection:UC,modifiers:[Im,wm],onDragStart:y,onDragEnd:I,onDragCancel:()=>b(null),children:Le.jsx(Tm,{items:h.map((C)=>C.id),strategy:Dm,children:Le.jsx("div",{id:"pinned",children:h.map((C)=>Le.jsx(Lee,{...k(C),dragging:p===C.id},C.id))})})}),m.length>0&&Le.jsxs(Le.Fragment,{children:[Le.jsxs("h4",{children:["Unpinned ",Le.jsx("span",{className:"faint h4-note",children:"· seen, not pinned"})]}),m.map((C)=>Le.jsx(xM,{...k(C)},C.id))]})]}),r&&Le.jsx(wM,{project:r,onClose:()=>s(null)})]})}function Lee(e){let{setNodeRef:t,listeners:o,transform:a,transition:n,isDragging:r}=Am({id:e.project.id}),s={transform:na.Transform.toString(a),transition:n};return Le.jsx(xM,{...e,dragging:r||e.dragging===!0,sortable:{ref:t,style:s,listeners:o??{}}})}function xM({project:e,selected:t,live:o,spark:a,ambiguous:n,onSelect:r,onMenu:s,sortable:l,dragging:c=!1}){let u=Na(a,(f)=>f),d=n?e.root.split("/").filter(Boolean).at(-2):void 0,m=["proj",t&&"sel",l&&"sortable",c&&"dragging"].filter(Boolean).join(" ");return Le.jsxs("div",{className:m,role:"button",tabIndex:0,onClick:()=>r(e.id),onKeyDown:(f)=>{if(f.key==="Enter"||f.key===" ")r(e.id)},title:e.root,ref:l?.ref,style:l?.style,...l?.listeners,children:[Le.jsx("span",{className:o>0?"st live":"st"}),Le.jsx(Ki,{project:e}),Le.jsxs("span",{className:"nm",children:[d&&Le.jsxs("span",{className:"pdir",children:[d,"/"]}),e.name]}),u>=0.5&&Le.jsx("span",{className:"proj-spark",title:`last 14 days · $${u.toFixed(0)}`,children:Le.jsx(qi,{points:a,color:"var(--c1)"})}),Le.jsx("small",{children:o||""}),Le.jsx("button",{type:"button",className:"act more",title:"Project actions","aria-label":"Project actions","aria-haspopup":"menu",onClick:(f)=>{f.stopPropagation(),s(f.currentTarget)},children:z("dots-three",15)})]})}var Ree=[],Bee=[],Hee={},Pee=[];var kM=x(R(),1);var TM=x(T(),1),CM=16,MM=(e)=>document.documentElement.style.setProperty("--sb-w",`${e}px`);function DM(){let e=B((n)=>n.sidebarWidth),t=B((n)=>n.sidebarCollapsed),o=B((n)=>n.setSidebarWidth);if(kM.useEffect(()=>{MM(e)},[e]),t)return null;return TM.jsx("button",{type:"button",className:"sb-grip",title:"Drag to resize the sidebar · double-click to reset","aria-label":"Resize sidebar",onPointerDown:(n)=>{if(n.button!==0)return;n.preventDefault();let r=n.currentTarget;r.setPointerCapture(n.pointerId),document.body.classList.add("col-resizing");let s=e,l=(u)=>{s=cg(u.clientX),MM(s)},c=()=>{r.removeEventListener("pointermove",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointercancel",c),document.body.classList.remove("col-resizing"),o(s)};r.addEventListener("pointermove",l),r.addEventListener("pointerup",c),r.addEventListener("pointercancel",c)},onDoubleClick:()=>o(Fi.default),onKeyDown:(n)=>{if(n.key==="ArrowLeft")o(e-CM);else if(n.key==="ArrowRight")o(e+CM)}})}var Os=x(T(),1);function AM({note:e,onClose:t}){return rg(e.version),Os.jsxs(Ea,{title:"What's New",glyph:"star",size:"wn",onClose:t,footer:Os.jsx("a",{className:"wn-full",href:fw,target:"_blank",rel:"noopener",children:"Full changelog →"}),children:[Os.jsxs("h3",{children:["Swarm ",e.version]}),e.date&&Os.jsx("div",{className:"date",children:e.date}),Os.jsx("div",{dangerouslySetInnerHTML:{__html:e.html}})]})}var vo=x(T(),1),zee={fleet:UI,prs:hx,hygiene:lx,outcomes:fx,gates:FI,mcp:ux,context:RI,heat:BI,security:Cx,provenance:wx,rules:Ix,incidents:cx,trials:Qx,board:NI,spend:Px,search:xx,stats:qx,timeline:Xx,graphs:QI};function OM(){let e=B((m)=>m.view),t=B((m)=>m.session),o=B((m)=>m.sidebarCollapsed),[a,n]=Ma.useState(null),[r,s]=Ma.useState(!1),[l,c]=Ma.useState(null);Cw(),pw(),uw(),xw(),Ma.useEffect(()=>(Hw(),Ew()),[]),Ma.useEffect(()=>{qt("/v1/health").then((m)=>{let f=m.version??null;n(f),c(gw(f))}).catch(()=>{})},[]);let u=Ma.useCallback(()=>c(Pd(a)),[a]);Ma.useEffect(()=>(window.swarmWhatsNew=(m)=>c(Pd(m??a)),()=>{window.swarmWhatsNew=void 0}),[a]),Ma.useEffect(()=>{let m=(f)=>{if((f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k")f.preventDefault(),s((p)=>!p);else if(f.key==="Escape")s(!1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]),Ma.useEffect(()=>{document.body.classList.toggle("nosb",o)},[o]);let d=zee[e];return vo.jsxs(vo.Fragment,{children:[vo.jsx(cC,{version:a,onOpenPalette:()=>s(!0),onOpenWhatsNew:u}),vo.jsx(IM,{}),vo.jsx(DM,{}),vo.jsx("main",{id:"main",children:vo.jsx(zg,{resetKey:t??e,children:t?vo.jsx(Bx,{id:t}):d?vo.jsx(d,{}):vo.jsx(uC,{view:e})})}),r&&vo.jsx(Uee,{onClose:()=>s(!1)}),l&&vo.jsx(AM,{note:l,onClose:()=>c(null)}),vo.jsx(mC,{})]})}function Uee({onClose:e}){let t=document.getElementById("picker");if(!t)return null;return EM.createPortal(vo.jsx(bC,{onClose:e}),t)}function ab(e){return e}var P=x(R(),1);var Nm=x(R(),1);var Ns=x(R(),1);var NM=x(R(),1),LM=NM.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var _e=Ns.forwardRef((e,t)=>{let{alt:o,color:a,size:n,weight:r,mirrored:s,children:l,weights:c,...u}=e,{color:d="currentColor",size:m,weight:f="regular",mirrored:p=!1,...b}=Ns.useContext(LM);return Ns.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:a!=null?a:d,viewBox:"0 0 256 256",transform:s||p?"scale(-1, 1)":void 0,...b,...u},!!o&&Ns.createElement("title",null,o),l,c.get(r!=null?r:f))});_e.displayName="IconBase";var Ct=x(R(),1),RM=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Ct.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var nb=Nm.forwardRef((e,t)=>Nm.createElement(_e,{ref:t,...e,weights:RM}));nb.displayName="ArrowDownIcon";var rb=nb;var Lm=x(R(),1);var Mt=x(R(),1),BM=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),Mt.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]);var sb=Lm.forwardRef((e,t)=>Lm.createElement(_e,{ref:t,...e,weights:BM}));sb.displayName="ArrowLeftIcon";var ib=sb;var Rm=x(R(),1);var kt=x(R(),1),HM=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),kt.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var lb=Rm.forwardRef((e,t)=>Rm.createElement(_e,{ref:t,...e,weights:HM}));lb.displayName="ArrowUpIcon";var cb=lb;var Bm=x(R(),1);var Dt=x(R(),1),PM=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),Dt.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var ub=Bm.forwardRef((e,t)=>Bm.createElement(_e,{ref:t,...e,weights:PM}));ub.displayName="CaretLeftIcon";var db=ub;var Hm=x(R(),1);var Tt=x(R(),1),zM=new Map([["bold",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),Tt.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var mb=Hm.forwardRef((e,t)=>Hm.createElement(_e,{ref:t,...e,weights:zM}));mb.displayName="CaretRightIcon";var Vc=mb;var Pm=x(R(),1);var At=x(R(),1),UM=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),At.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]);var fb=Pm.forwardRef((e,t)=>Pm.createElement(_e,{ref:t,...e,weights:UM}));fb.displayName="CheckIcon";var Kc=fb;var zm=x(R(),1);var Et=x(R(),1),FM=new Map([["bold",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Et.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var pb=zm.forwardRef((e,t)=>zm.createElement(_e,{ref:t,...e,weights:FM}));pb.displayName="CircleNotchIcon";var hb=pb;var Um=x(R(),1);var Ot=x(R(),1),_M=new Map([["bold",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"}))],["duotone",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z",opacity:"0.2"}),Ot.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["fill",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z"}))],["light",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z"}))],["regular",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["thin",Ot.createElement(Ot.Fragment,null,Ot.createElement("path",{d:"M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z"}))]]);var gb=Um.forwardRef((e,t)=>Um.createElement(_e,{ref:t,...e,weights:_M}));gb.displayName="DotsSixVerticalIcon";var bb=gb;var Fm=x(R(),1);var Nt=x(R(),1),jM=new Map([["bold",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),Nt.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",Nt.createElement(Nt.Fragment,null,Nt.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]);var vb=Fm.forwardRef((e,t)=>Fm.createElement(_e,{ref:t,...e,weights:jM}));vb.displayName="DotsThreeIcon";var qc=vb;var _m=x(R(),1);var Lt=x(R(),1),GM=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),Lt.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]);var Sb=_m.forwardRef((e,t)=>_m.createElement(_e,{ref:t,...e,weights:GM}));Sb.displayName="MagnifyingGlassIcon";var $c=Sb;var jm=x(R(),1);var Rt=x(R(),1),VM=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Rt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var yb=jm.forwardRef((e,t)=>jm.createElement(_e,{ref:t,...e,weights:VM}));yb.displayName="PlusIcon";var wb=yb;var Gm=x(R(),1);var Bt=x(R(),1),KM=new Map([["bold",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M188,184a16,16,0,1,1,16-16A16,16,0,0,1,188,184Zm36-68H180a12,12,0,0,0,0,24h40v56H36V140H76a12,12,0,0,0,0-24H32a20,20,0,0,0-20,20v64a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V136A20,20,0,0,0,224,116ZM88.49,80.49,116,53v75a12,12,0,0,0,24,0V53l27.51,27.52a12,12,0,1,0,17-17l-48-48a12,12,0,0,0-17,0l-48,48a12,12,0,1,0,17,17Z"}))],["duotone",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M232,136v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H224A8,8,0,0,1,232,136Z",opacity:"0.2"}),Bt.createElement("path",{d:"M240,136v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V136a16,16,0,0,1,16-16H80a8,8,0,0,1,0,16H32v64H224V136H176a8,8,0,0,1,0-16h48A16,16,0,0,1,240,136ZM85.66,77.66,120,43.31V128a8,8,0,0,0,16,0V43.31l34.34,34.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,77.66ZM200,168a12,12,0,1,0-12,12A12,12,0,0,0,200,168Z"}))],["fill",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M74.34,77.66a8,8,0,0,1,0-11.32l48-48a8,8,0,0,1,11.32,0l48,48a8,8,0,0,1-11.32,11.32L136,43.31V128a8,8,0,0,1-16,0V43.31L85.66,77.66A8,8,0,0,1,74.34,77.66ZM240,136v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V136a16,16,0,0,1,16-16h68a4,4,0,0,1,4,4v3.46c0,13.45,11,24.79,24.46,24.54A24,24,0,0,0,152,128v-4a4,4,0,0,1,4-4h68A16,16,0,0,1,240,136Zm-40,32a12,12,0,1,0-12,12A12,12,0,0,0,200,168Z"}))],["light",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M238,136v64a14,14,0,0,1-14,14H32a14,14,0,0,1-14-14V136a14,14,0,0,1,14-14H80a6,6,0,0,1,0,12H32a2,2,0,0,0-2,2v64a2,2,0,0,0,2,2H224a2,2,0,0,0,2-2V136a2,2,0,0,0-2-2H176a6,6,0,0,1,0-12h48A14,14,0,0,1,238,136ZM84.24,76.24,122,38.49V128a6,6,0,0,0,12,0V38.49l37.76,37.75a6,6,0,0,0,8.48-8.48l-48-48a6,6,0,0,0-8.48,0l-48,48a6,6,0,0,0,8.48,8.48ZM198,168a10,10,0,1,0-10,10A10,10,0,0,0,198,168Z"}))],["regular",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M240,136v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V136a16,16,0,0,1,16-16H80a8,8,0,0,1,0,16H32v64H224V136H176a8,8,0,0,1,0-16h48A16,16,0,0,1,240,136ZM85.66,77.66,120,43.31V128a8,8,0,0,0,16,0V43.31l34.34,34.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,77.66ZM200,168a12,12,0,1,0-12,12A12,12,0,0,0,200,168Z"}))],["thin",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M236,136v64a12,12,0,0,1-12,12H32a12,12,0,0,1-12-12V136a12,12,0,0,1,12-12H80a4,4,0,0,1,0,8H32a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4H224a4,4,0,0,0,4-4V136a4,4,0,0,0-4-4H176a4,4,0,0,1,0-8h48A12,12,0,0,1,236,136ZM82.83,74.83,124,33.66V128a4,4,0,0,0,8,0V33.66l41.17,41.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66ZM196,168a8,8,0,1,0-8,8A8,8,0,0,0,196,168Z"}))]]);var Ib=Gm.forwardRef((e,t)=>Gm.createElement(_e,{ref:t,...e,weights:KM}));Ib.displayName="UploadIcon";var xb=Ib;var Vm=x(R(),1);var Ht=x(R(),1),qM=new Map([["bold",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ht.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]);var Cb=Vm.forwardRef((e,t)=>Vm.createElement(_e,{ref:t,...e,weights:qM}));Cb.displayName="WarningCircleIcon";var Mb=Cb;var Km=x(R(),1);var Pt=x(R(),1),$M=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Pt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var kb=Km.forwardRef((e,t)=>Km.createElement(_e,{ref:t,...e,weights:$M}));kb.displayName="XIcon";var Ls=kb;function gK(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=gK(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function jee(){for(var e,t,o=0,a="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=gK(e))&&(a&&(a+=" "),a+=t);return a}var Re=jee;var n0=x(gn(),1),w=x(T(),1);var ln=x(R(),1),MK=x(gn(),1);function bK(e,t,o){let a=Array(e);return new Proxy(a,{get(n,r,s){if(typeof r==="string"){let l=r.charCodeAt(0);if(l>=48&&l<=57){let c=+r;if(Number.isInteger(c)&&c>=0&&c<e){let u=n[c];if(!u){let d=t[c*2];u=n[c]={index:c,key:o(c),start:d,size:t[c*2+1],end:d+t[c*2+1],lane:0}}return u}}if(r==="length")return e}return Reflect.get(n,r,s)}})}function Rs(e,t,o){let a=o.initialDeps??[],n,r=!0;function s(){var l;let c=!1,u=0,d=e();if(!(d.length!==a.length||d.some((p,b)=>a[b]!==p)))return n;a=d;let f=0;if(n=t(...d),(o==null?void 0:o.onChange)&&!(r&&o.skipInitialOnChange))o.onChange(n);return r=!1,n}return s.updateDeps=(l)=>{a=l},s}function Kb(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:""}`);else return e}var vK=(e,t)=>Math.abs(e-t)<1.01,SK=(e,t,o)=>{let a;return Object.assign(function(...n){e.clearTimeout(a),a=e.setTimeout(()=>t.apply(this,n),o)},{cancel:()=>{e.clearTimeout(a)}})};var Wc,qb=()=>{if(Wc!==void 0)return Wc;if(typeof navigator>"u")return Wc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Wc=!0;let e=navigator.maxTouchPoints;return Wc=navigator.platform==="MacIntel"&&e!==void 0&&e>0};var yK=(e)=>{let{offsetWidth:t,offsetHeight:o}=e;return{width:t,height:o}},Gee=(e)=>e,Vee=(e)=>{let t=Math.max(e.startIndex-e.overscan,0),a=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,n=Array(a);for(let r=0;r<a;r++)n[r]=t+r;return n},wK=(e,t)=>{let o=e.scrollElement;if(!o)return;let a=e.targetWindow;if(!a)return;let n=(s)=>{let{width:l,height:c}=s;t({width:Math.round(l),height:Math.round(c)})};if(n(yK(o)),!a.ResizeObserver)return()=>{};let r=new a.ResizeObserver((s)=>{let l=()=>{let c=s[0];if(c==null?void 0:c.borderBoxSize){let u=c.borderBoxSize[0];if(u){n({width:u.inlineSize,height:u.blockSize});return}}n(yK(o))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return r.observe(o,{box:"border-box"}),()=>{r.unobserve(o)}},qm={passive:!0};var Kee=typeof window>"u"?!0:("onscrollend"in window),qee=(e,t,o)=>{let a=e.scrollElement;if(!a)return;let n=e.targetWindow;if(!n)return;let r=e.options.useScrollendEvent&&Kee,s=0,l=r?null:SK(n,()=>t(s,!1),e.options.isScrollingResetDelay),c=(m)=>()=>{s=o(a),l==null||l(),t(s,m)},u=c(!0),d=c(!1);if(a.addEventListener("scroll",u,qm),r)a.addEventListener("scrollend",d,qm);return()=>{if(a.removeEventListener("scroll",u),r)a.removeEventListener("scrollend",d);l==null||l.cancel()}},IK=(e,t)=>qee(e,t,(o)=>{let{horizontal:a,isRtl:n}=e.options;return a?o.scrollLeft*(n&&-1||1):o.scrollTop});var $ee=(e,t,o)=>{if(o.options.useCachedMeasurements){let a=o.indexFromElement(e),n=o.options.getItemKey(a);return o.itemSizeCache.get(n)??o.options.estimateSize(a)}if(t==null?void 0:t.borderBoxSize){let a=t.borderBoxSize[0];if(a)return Math.round(a[o.options.horizontal?"inlineSize":"blockSize"])}if(!t){let a=o.indexFromElement(e),n=o.options.getItemKey(a),r=o.itemSizeCache.get(n);if(r!==void 0)return r}return e[o.options.horizontal?"offsetWidth":"offsetHeight"]},Wee=(e,{adjustments:t=0,behavior:o},a)=>{var n,r;(r=(n=a.scrollElement)==null?void 0:n.scrollTo)==null||r.call(n,{[a.options.horizontal?"left":"top"]:e+t,behavior:o})};var xK=Wee;class $b{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,o,a;return((a=(o=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:o.now)==null?void 0:a.call(o))??Date.now()},this.observer=(()=>{let t=null,o=()=>{if(t)return t;if(!this.targetWindow||!this.targetWindow.ResizeObserver)return null;return t=new this.targetWindow.ResizeObserver((a)=>{a.forEach((n)=>{let r=()=>{let s=n.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);for(let[c,u]of this.elementsCache)if(u===s){this.elementsCache.delete(c);break}return}if(!this.isIndexInRange(l))return;if(this.shouldMeasureDuringScroll(l))this.resizeItem(l,this.options.measureElement(s,n,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})})};return{disconnect:()=>{var a;(a=o())==null||a.disconnect(),t=null},observe:(a)=>{var n;return(n=o())==null?void 0:n.observe(a,{box:"border-box"})},unobserve:(a)=>{var n;return(n=o())==null?void 0:n.unobserve(a)}}})(),this.range=null,this.setOptions=(t)=>{var o,a;let n={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Gee,rangeExtractor:Vee,onChange:()=>{},measureElement:$ee,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let m in t){let f=t[m];if(f!==void 0)n[m]=f}let r=this.options,s=null,l=null,c=!1;if(r!==void 0&&r.enabled&&n.enabled&&n.anchorTo==="end"&&this.scrollElement!==null){let m=r.count,f=n.count,p=this.getMeasurements(),b=m>0?((o=p[0])==null?void 0:o.key)??r.getItemKey(0):null,v=m>0?((a=p[m-1])==null?void 0:a.key)??r.getItemKey(m-1):null;if(f!==m||m>0&&f>0&&(n.getItemKey(0)!==b||n.getItemKey(f-1)!==v)){c=!0;let g=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;if(g)s=[g.key,this.getScrollOffset()-g.start];let y=n.followOnAppend===!0?"auto":n.followOnAppend||null;if(y&&f>m&&this.isAtEnd(r.scrollEndThreshold)&&(m===0||n.getItemKey(f-1)!==v))l=y}}if(this.options=n,c)this.pendingMin=0,this.itemSizeCacheVersion++;let u=!1,d=0;if(s&&this.scrollOffset!==null){let[m,f]=s,p=this.getMeasurements(),{count:b,getItemKey:v}=this.options,S=0;while(S<b&&v(S)!==m)S++;if(S<b){let h=p[S];if(h){let g=Math.max(0,h.start+f);if(g!==this.scrollOffset)d=g-this.scrollOffset,this.scrollOffset=g,u=!0}}}if(u||l)this.pendingScrollAnchor=[u?s[0]:null,u?s[1]:0,l,d]},this.notify=(t)=>{var o,a;(a=(o=this.options).onChange)==null||a.call(o,this,t)},this.maybeNotify=Rs(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),(t)=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{if(this.unsubs.filter(Boolean).forEach((t)=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow)this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null;this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;let o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement)this.targetWindow=this.scrollElement.ownerDocument.defaultView;else this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null;if(this.elementsCache.forEach((n)=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,(n)=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,r)=>{if(r&&this._intendedScrollOffset===null&&n===this.scrollOffset)return;if(this._intendedScrollOffset!==null&&Math.abs(n-this._intendedScrollOffset)<1.5)n=this._intendedScrollOffset;this._intendedScrollOffset=null,this.scrollAdjustments=0;let s=this.getScrollOffset();if(this.scrollDirection=r?s===n?this.scrollDirection:s<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=r,this._flushIosDeferredIfReady(),this.scrollState)this.scheduleScrollReconcile();this.maybeNotify()})),"addEventListener"in this.scrollElement){let n=this.scrollElement,r=()=>{if(this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null)this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null},s=()=>{if(this._iosTouching=!1,!qb()||this.targetWindow==null)return;this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150)};n.addEventListener("touchstart",r,qm),n.addEventListener("touchend",s,qm),this.unsubs.push(()=>{if(n.removeEventListener("touchstart",r),n.removeEventListener("touchend",s),this._iosTouchEndTimerId!==null&&this.targetWindow!=null)this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let a=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,a&&this.scrollElement&&this.options.enabled){let[n,r,s,l]=a;if(n!==null&&!s)if(qb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)){if(l!==0)this._iosDeferredAdjustment+=l}else this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0});if(s)this.scrollToEnd({behavior:s})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0)return;if(this.isScrolling)return;if(this._iosTouching)return;if(this._iosJustTouchEnded)return;let t=this.getScrollOffset(),o=this.getMaxScrollOffset();if(t<0||t>o)return;if(this._iosDeferredAdjustment<0&&t>=o-1){this._iosDeferredAdjustment=0;return}let a=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=a,behavior:void 0})},this.rafId=null,this.getSize=()=>{if(!this.options.enabled)return this.scrollRect=null,0;return this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]},this.getScrollOffset=()=>{if(!this.options.enabled)return this.scrollOffset=null,0;return this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset},this.getMeasurementOptions=Rs(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,o,a,n,r,s,l,c)=>{if(this.prevLanes!==void 0&&this.prevLanes!==s)this.lanesChangedFlag=!0;return this.prevLanes=s,this.pendingMin=null,{count:t,paddingStart:o,scrollMargin:a,getItemKey:n,enabled:r,lanes:s,laneAssignmentMode:l,gap:c}},{key:!1}),this.isIndexInRange=(t)=>t>=0&&t<this.options.count,this.getMeasurements=Rs(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:o,scrollMargin:a,getItemKey:n,enabled:r,lanes:s,laneAssignmentMode:l,gap:c},u)=>{let d=this.itemSizeCache;if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t){for(let S of this.laneAssignments.keys())if(S>=t)this.laneAssignments.delete(S)}if(this.lanesChangedFlag)this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null;if(this.measurementsCache.length===0&&!this.lanesSettling)this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((S)=>{this.itemSizeCache.set(S.key,S.size)});let m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t)this.lanesSettling=!1;if(s===1){let S=t*2,h=this._flatMeasurements;if(!h||h.length<S){let I=new Float64Array(S);if(h&&m>0)I.set(h.subarray(0,m*2));h=I,this._flatMeasurements=h}let g;if(m===0)g=o+a;else{let I=m-1;g=h[I*2]+h[I*2+1]+c}for(let I=m;I<t;I++){let k=n(I),C=d.get(k),D=typeof C==="number"?C:this.options.estimateSize(I);h[I*2]=g,h[I*2+1]=D,g+=D+c}let y=bK(t,h,n);return this.measurementsCache=y,y}let f=this.measurementsCache.slice(0,m),p=Array(s).fill(void 0),b=new Float64Array(s),v=0;for(let S=0;S<m;S++){let h=f[S];if(h){if(p[h.lane]===void 0)v++;p[h.lane]=S,b[h.lane]=h.end}}for(let S=m;S<t;S++){let h=n(S),g=this.laneAssignments.get(S),y,I,k=l==="estimate"||d.has(h);if(g!==void 0&&this.options.lanes>1){y=g;let A=p[y],E=A!==void 0?f[A]:void 0;I=E?E.end+c:o+a}else if(v===s){let A=0,E=b[0],j=p[0];for(let de=1;de<s;de++){let fe=b[de];if(fe<E||fe===E&&p[de]<j)A=de,E=fe,j=p[de]}if(y=A,I=E+c,k)this.laneAssignments.set(S,y)}else if(y=S%this.options.lanes,I=o+a,k)this.laneAssignments.set(S,y);let C=d.get(h),D=typeof C==="number"?C:this.options.estimateSize(S),M=I+D;if(f[S]={index:S,start:I,size:D,end:M,key:h,lane:y},p[y]===void 0)v++;p[y]=S,b[y]=M}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Rs(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,a,n)=>{if(t.length===0||o===0)return this.range=null,null;return this.range=Yee(t,o,a,n,n===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Rs(()=>{let t=null,o=null,a=this.calculateRange();if(a)t=a.startIndex,o=a.endIndex;return this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,a,n,r)=>n===null||r===null?[]:t({startIndex:n,endIndex:r,overscan:o,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=(t)=>{let o=this.options.indexAttribute,a=t.getAttribute(o);if(!a)return console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1;return parseInt(a,10)},this.shouldMeasureDuringScroll=(t)=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let a=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(a!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,a-n),s=Math.min(this.options.count-1,a+n);return t>=r&&t<=s}return!0},this.measureElement=(t)=>{if(!t){this.elementsCache.forEach((r,s)=>{if(!r.isConnected)this.observer.unobserve(r),this.elementsCache.delete(s)});return}let o=this.indexFromElement(t);if(!this.isIndexInRange(o))return;let a=this.options.getItemKey(o),n=this.elementsCache.get(a);if(n!==t){if(n)this.observer.unobserve(n);this.observer.observe(t),this.elementsCache.set(a,t)}if((!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o))this.resizeItem(o,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,o)=>{var a,n;if(!this.isIndexInRange(t))return;let r,s,l,c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(t),s=c[t*2],r=c[t*2+1];else{let m=this.measurementsCache[t];if(!m)return;l=m.key,s=m.start,r=m.size}let u=this.itemSizeCache.get(l)??r,d=o-u;if(d!==0){let m=this.options.anchorTo==="end"&&((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,f=m?this.getTotalSize():0,p=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?s<p:s+u<=p&&this.scrollDirection!=="backward",S=((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:l,start:s,size:r,end:s+r,lane:0},d,this):v);if(this.pendingMin===null||t<this.pendingMin)this.pendingMin=t;this.itemSizeCache.set(l,o),this.itemSizeCacheVersion++;let h=!1;if(m)h=this.applyScrollAdjustment(this.getTotalSize()-f);else if(S)h=this.applyScrollAdjustment(d);this.notify(h)}},this.getVirtualItems=Rs(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{let a=[];for(let n=0,r=t.length;n<r;n++){let s=t[n],l=o[s];a.push(l)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=(t)=>{let o=this.getMeasurements();if(o.length===0)return;let a=this._flatMeasurements,n=this.options.lanes===1&&a!=null,r=CK(0,o.length-1,n?(s)=>a[s*2]:(s)=>Kb(o[s]).start,t);return Kb(o[r])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;else{let t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,o,a=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),r=this.getScrollOffset();if(o==="auto")o=t>=r+n?"end":"start";if(o==="center")t+=(a-n)/2;else if(o==="end")t-=n;let s=this.getMaxScrollOffset();return Math.max(Math.min(s,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));let a=this.getSize(),n=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(o==="auto")if(r.end>=n+a-this.options.scrollPaddingEnd)o="end";else if(r.start<=n+this.options.scrollPaddingStart)o="start";else return[n,o];if(o==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),o];let s=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,o,r.size),o]},this.scrollToOffset=(t,{align:o="start",behavior:a="auto"}={})=>{this._iosDeferredAdjustment=0;let n=this.getOffsetForAlignment(t,o),r=this.now();this.scrollState={index:null,align:o,behavior:a,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:o="auto",behavior:a="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));let n=this.getOffsetForIndex(t,o);if(!n)return;let[r,s]=n,l=this.now();this.scrollState={index:t,align:s,behavior:a,startedAt:l,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:o="auto"}={})=>{let a=this.getScrollOffset()+t,n=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:n,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;let o=this.getMeasurements(),a;if(o.length===0)a=this.options.paddingStart;else if(this.options.lanes===1){let n=o.length-1,r=this._flatMeasurements;if(r!=null)a=r[n*2]+r[n*2+1];else a=((t=o[n])==null?void 0:t.end)??0}else{let n=Array(this.options.lanes).fill(null),r=o.length-1;while(r>=0&&n.some((s)=>s===null)){let s=o[r];if(n[s.lane]===null)n[s.lane]=s.end;r--}a=Math.max(...n.filter((s)=>s!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let t=[];if(this.itemSizeCache.size===0)return t;let o=this.getMeasurements();for(let a of o)if(a&&this.itemSizeCache.has(a.key))t.push({index:a.index,key:a.key,start:a.start,size:a.size,end:a.end,lane:a.lane});return t},this._scrollToOffset=(t,{adjustments:o,behavior:a})=>{this._intendedScrollOffset=t+(o??0),this.options.scrollToFn(t,{behavior:a,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(qb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;else{if(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null){if(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0)this.scrollOffset=0;this.scrollAdjustments=0}return!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}if(this.rafId!=null)return;this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;let t=5000;if(this.now()-this.scrollState.startedAt>t){this.scrollState=null;return}let o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,a=o?o[0]:this.scrollState.lastTargetOffset,n=1,r=a!==this.scrollState.lastTargetOffset;if(!r&&vK(a,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){if(this.getScrollOffset()!==a)this._scrollToOffset(a,{adjustments:void 0,behavior:"auto"});this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,r){let s=this.getSize()||600,l=Math.abs(a-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>s;if(this.scrollState.lastTargetOffset=a,!c)this.scrollState.behavior="auto";this._scrollToOffset(a,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}var CK=(e,t,o,a)=>{while(e<=t){let n=(e+t)/2|0,r=o(n);if(r<a)e=n+1;else if(r>a)t=n-1;else return n}if(e>0)return e-1;else return 0};function Zee(e,t,o){let a=0;while(a<=t){let n=(a+t)/2|0,r=e[n*2];if(r<o)a=n+1;else if(r>o)t=n-1;else return n}return a>0?a-1:0}function Yee(e,t,o,a,n){let r=e.length-1;if(e.length<=a)return{startIndex:0,endIndex:r};if(a===1&&n!==null){let u=Zee(n,r,o),d=u,m=o+t;while(d<r&&n[d*2]+n[d*2+1]<m)d++;return{startIndex:u,endIndex:d}}let l=CK(0,r,(u)=>e[u].start,o),c=l;if(a===1)while(c<r&&e[c].end<o+t)c++;else if(a>1){let u=Array(a).fill(0);while(c<r&&u.some((m)=>m<o+t)){let m=e[c];u[m.lane]=m.end,c++}let d=Array(a).fill(o+t);while(l>=0&&d.some((m)=>m>=o)){let m=e[l];d[m.lane]=m.start,l--}l=Math.max(0,l-l%a),c=Math.min(r,c+(a-1-c%a))}return{startIndex:l,endIndex:c}}var Wb=typeof document<"u"?ln.useLayoutEffect:ln.useEffect;function Xee({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:o="transform",...a}){let n=ln.useReducer((d)=>d+1,0)[1],r=ln.useRef({enabled:t,mode:o,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});r.current.enabled=t,r.current.mode=o;let s=(d)=>{let m=r.current;if(!m.enabled||!m.container)return;let f=d.getTotalSize();if(f!==m.lastSize){m.lastSize=f;let p=d.options.horizontal?"width":"height";m.container.style[p]=`${f}px`}},l=(d)=>{let m=r.current;if(!m.enabled||!m.container)return;s(d);let f=!!d.options.horizontal,p=m.mode==="transform",b=f?"left":"top",v=d.options.scrollMargin,S=d.getVirtualItems();for(let h of S){let g=h.start-v,y=d.elementsCache.get(h.key);if(!y)continue;if(m.lastPositions.get(y)===g)continue;if(m.lastPositions.set(y,g),p)y.style.transform=f?`translate3d(${g}px, 0, 0)`:`translate3d(0, ${g}px, 0)`;else y.style[b]=`${g}px`}},c={...a,onChange:(d,m)=>{var f;let p=r.current,b=!0;if(p.enabled){l(d);let v=d.range,S=p.prevRange;if(b=!S||S.isScrolling!==d.isScrolling||S.startIndex!==(v==null?void 0:v.startIndex)||S.endIndex!==(v==null?void 0:v.endIndex),b)p.prevRange=v?{startIndex:v.startIndex,endIndex:v.endIndex,isScrolling:d.isScrolling}:null}if(b)if(e&&m)MK.flushSync(n);else n();(f=a.onChange)==null||f.call(a,d,m)}},[u]=ln.useState(()=>{let d=new $b(c);return Object.assign(d,{containerRef:(m)=>{let f=r.current;if(f.container=m,f.lastSize=null,m&&f.enabled){let p=d.getTotalSize();f.lastSize=p;let b=d.options.horizontal?"width":"height";m.style[b]=`${p}px`}}})});return u.setOptions(c),Wb(()=>u._didMount(),[]),Wb(()=>(s(u),u._willUpdate())),Wb(()=>{l(u)}),u}function Zb(e){return Xee({observeElementRect:wK,observeElementOffset:IK,scrollToFn:xK,...e})}var{min:Ur,max:Fa,round:Yc,floor:Xc}=Math,cn=(e)=>({x:e,y:e}),Qee={left:"right",right:"left",bottom:"top",top:"bottom"};function TK(e,t,o){return Fa(e,Ur(t,o))}function Fr(e,t){return typeof e==="function"?e(t):e}function Fn(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function Wm(e){return e==="x"?"y":"x"}function Yb(e){return e==="y"?"height":"width"}function _a(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Xb(e){return Wm(_a(e))}function AK(e,t,o){if(o===void 0)o=!1;let a=sl(e),n=Xb(e),r=Yb(n),s=n==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";if(t.reference[r]>t.floating[r])s=Zc(s);return[s,Zc(s)]}function EK(e){let t=Zc(e);return[$m(e),t,$m(t)]}function $m(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var kK=["left","right"],DK=["right","left"],Jee=["top","bottom"],ete=["bottom","top"];function tte(e,t,o){switch(e){case"top":case"bottom":if(o)return t?DK:kK;return t?kK:DK;case"left":case"right":return t?Jee:ete;default:return[]}}function OK(e,t,o,a){let n=sl(e),r=tte(Fn(e),o==="start",a);if(n){if(r=r.map((s)=>s+"-"+n),t)r=r.concat(r.map($m))}return r}function Zc(e){let t=Fn(e);return Qee[t]+e.slice(t.length)}function ote(e){var t,o,a,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(a=e.bottom)!=null?a:0,left:(n=e.left)!=null?n:0}}function NK(e){return typeof e!=="number"?ote(e):{top:e,right:e,bottom:e,left:e}}function Bs(e){let{x:t,y:o,width:a,height:n}=e;return{width:a,height:n,top:o,left:t,right:t+a,bottom:o+n,x:t,y:o}}function LK(e,t,o){let{reference:a,floating:n}=e,r=_a(t),s=Xb(t),l=Yb(s),c=Fn(t),u=r==="y",d=a.x+a.width/2-n.width/2,m=a.y+a.height/2-n.height/2,f=a[l]/2-n[l]/2,p;switch(c){case"top":p={x:d,y:a.y-n.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:m};break;case"left":p={x:a.x-n.width,y:m};break;default:p={x:a.x,y:a.y}}let b=sl(t);if(b)p[s]+=f*(b==="end"?1:-1)*(o&&u?-1:1);return p}async function RK(e,t){var o;if(t===void 0)t={};let{x:a,y:n,platform:r,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:m="floating",altBoundary:f=!1,padding:p=0}=Fr(t,e),b=NK(p),S=l[f?m==="floating"?"reference":"floating":m],h=Bs(await r.getClippingRect({element:((o=await(r.isElement==null?void 0:r.isElement(S)))!=null?o:!0)?S:S.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),g=m==="floating"?{x:a,y:n,width:s.floating.width,height:s.floating.height}:s.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),I=await(r.isElement==null?void 0:r.isElement(y))&&await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1},k=Bs(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(h.top-k.top+b.top)/I.y,bottom:(k.bottom-h.bottom+b.bottom)/I.y,left:(h.left-k.left+b.left)/I.x,right:(k.right-h.right+b.right)/I.x}}var ate=50,BK=async(e,t,o)=>{let{placement:a="bottom",strategy:n="absolute",middleware:r=[],platform:s}=o,l=s.detectOverflow?s:{...s,detectOverflow:RK},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:m}=LK(u,a,c),f=a,p=0,b={};for(let v=0;v<r.length;v++){let S=r[v];if(!S)continue;let{name:h,fn:g}=S,{x:y,y:I,data:k,reset:C}=await g({x:d,y:m,initialPlacement:a,placement:f,strategy:n,middlewareData:b,rects:u,platform:l,elements:{reference:e,floating:t}});if(d=y!=null?y:d,m=I!=null?I:m,b[h]={...b[h],...k},C&&p<ate){if(p++,typeof C==="object"){if(C.placement)f=C.placement;if(C.rects)u=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):C.rects;({x:d,y:m}=LK(u,f,c))}v=-1}}return{x:d,y:m,placement:f,strategy:n,middlewareData:b}};var HK=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,a;let{placement:n,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...S}=Fr(e,t);if((o=r.arrow)!=null&&o.alignmentOffset)return{};let h=Fn(n),g=_a(l),y=Fn(l)===l,I=await(c.isRTL==null?void 0:c.isRTL(u.floating)),k=f||(y||!v?[Zc(l)]:EK(l)),C=b!=="none";if(!f&&C)k.push(...OK(l,v,b,I));let D=[l,...k],M=await c.detectOverflow(t,S),A=[],E=((a=r.flip)==null?void 0:a.overflows)||[];if(d)A.push(M[h]);if(m){let pe=AK(n,s,I);A.push(M[pe[0]],M[pe[1]])}if(E=[...E,{placement:n,overflows:A}],!A.every((pe)=>pe<=0)){var j,de;let pe=(((j=r.flip)==null?void 0:j.index)||0)+1,Ye=D[pe];if(Ye){if(!(m==="alignment"?g!==_a(Ye):!1)||E.every((to)=>_a(to.placement)===g?to.overflows[0]>0:!0))return{data:{index:pe,overflows:E},reset:{placement:Ye}}}let eo=(de=E.filter((st)=>st.overflows[0]<=0).sort((st,to)=>st.overflows[1]-to.overflows[1])[0])==null?void 0:de.placement;if(!eo)switch(p){case"bestFit":{var fe;let st=(fe=E.filter((to)=>{if(C){let G=_a(to.placement);return G===g||G==="y"}return!0}).map((to)=>[to.placement,to.overflows.filter((G)=>G>0).reduce((G,J)=>G+J,0)]).sort((to,G)=>to[1]-G[1])[0])==null?void 0:fe[0];if(st)eo=st;break}case"initialPlacement":eo=l;break}if(n!==eo)return{reset:{placement:eo}}}return{}}}};var PK=new Set(["left","top"]);async function nte(e,t){let{placement:o,platform:a,elements:n}=e,r=await(a.isRTL==null?void 0:a.isRTL(n.floating)),s=Fn(o),l=sl(o),c=_a(o)==="y",u=PK.has(s)?-1:1,d=r&&c?-1:1,m=Fr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:b}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(l&&typeof b==="number")p=l==="end"?b*-1:b;return c?{x:p*d,y:f*u}:{x:f*u,y:p*d}}var zK=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,a;let{x:n,y:r,placement:s,middlewareData:l}=t,c=await nte(t,e);if(s===((o=l.offset)==null?void 0:o.placement)&&(a=l.arrow)!=null&&a.alignmentOffset)return{};return{x:n+c.x,y:r+c.y,data:{...c,placement:s}}}}},UK=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:a,placement:n,platform:r}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:(g)=>{let{x:y,y:I}=g;return{x:y,y:I}}},...u}=Fr(e,t),d={x:o,y:a},m=await r.detectOverflow(t,u),f=_a(n),p=Wm(f),b=d[p],v=d[f],S=(g,y)=>TK(y+m[g==="y"?"top":"left"],y,y-m[g==="y"?"bottom":"right"]);if(s)b=S(p,b);if(l)v=S(f,v);let h=c.fn({...t,[p]:b,[f]:v});return{...h,data:{x:h.x-o,y:h.y-a,enabled:{[p]:s,[f]:l}}}}}},FK=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,a;let{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:m=!0}=Fr(e,t),f={x:n,y:r},p=_a(s),b=Wm(p),v=f[b],S=f[p],h=Fr(u,t),g=typeof h==="number"?{mainAxis:h,crossAxis:0}:{mainAxis:(o=h.mainAxis)!=null?o:0,crossAxis:(a=h.crossAxis)!=null?a:0};if(d){let k=b==="y"?"height":"width",C=l.reference[b]-l.floating[k]+g.mainAxis,D=l.reference[b]+l.reference[k]-g.mainAxis;if(v<C)v=C;else if(v>D)v=D}if(m){var y,I;let k=b==="y"?"width":"height",C=PK.has(Fn(s)),D=l.reference[p]-l.floating[k]+(C?((y=c.offset)==null?void 0:y[p])||0:0)+(C?0:g.crossAxis),M=l.reference[p]+l.reference[k]+(C?0:((I=c.offset)==null?void 0:I[p])||0)-(C?g.crossAxis:0);if(S<D)S=D;else if(S>M)S=M}return{[b]:v,[p]:S}}}},_K=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:a,platform:n,elements:r}=t,{apply:s=()=>{},...l}=Fr(e,t),c=await n.detectOverflow(t,l),u=Fn(o),d=sl(o),m=_a(o)==="y",{width:f,height:p}=a.floating,b,v;if(u==="top"||u==="bottom")b=u,v=d===(await(n.isRTL==null?void 0:n.isRTL(r.floating))?"start":"end")?"left":"right";else v=u,b=d==="end"?"top":"bottom";let S=p-c.top-c.bottom,h=f-c.left-c.right,g=Ur(p-c[b],S),y=Ur(f-c[v],h),I=t.middlewareData.shift,k=!I,C=g,D=y;if(I!=null&&I.enabled.x)D=h;if(I!=null&&I.enabled.y)C=S;if(k&&!d)if(m)D=f-2*Fa(c.left,c.right);else C=p-2*Fa(c.top,c.bottom);await s({...t,availableWidth:D,availableHeight:C});let M=await n.getDimensions(r.floating);if(f!==M.width||p!==M.height)return{reset:{rects:!0}};return{}}}};function Zm(){return typeof window<"u"}function zs(e){if(GK(e))return(e.nodeName||"").toLowerCase();return"#document"}function No(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function un(e){var t;return(t=(GK(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GK(e){if(!Zm())return!1;return e instanceof Node||e instanceof No(e).Node}function ja(e){if(!Zm())return!1;return e instanceof Element||e instanceof No(e).Element}function _n(e){if(!Zm())return!1;return e instanceof HTMLElement||e instanceof No(e).HTMLElement}function jK(e){if(!Zm()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof No(e).ShadowRoot}function Qc(e){let{overflow:t,overflowX:o,overflowY:a,display:n}=Ga(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+o)&&n!=="inline"&&n!=="contents"}function VK(e){return/^(table|td|th)$/.test(zs(e))}function Jc(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var rte=/transform|translate|scale|rotate|perspective|filter/,ste=/paint|layout|strict|content/,Hs=(e)=>!!e&&e!=="none",Qb;function Ym(e){let t=ja(e)?Ga(e):e;return Hs(t.transform)||Hs(t.translate)||Hs(t.scale)||Hs(t.rotate)||Hs(t.perspective)||!Xm()&&(Hs(t.backdropFilter)||Hs(t.filter))||rte.test(t.willChange||"")||ste.test(t.contain||"")}function KK(e){let t=_r(e);while(_n(t)&&!il(t)){if(Ym(t))return t;else if(Jc(t))return null;t=_r(t)}return null}function Xm(){if(Qb==null)Qb=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Qb}function il(e){return/^(html|body|#document)$/.test(zs(e))}function Ga(e){return No(e).getComputedStyle(e)}function eu(e){if(ja(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _r(e){if(zs(e)==="html")return e;let t=e.assignedSlot||e.parentNode||jK(e)&&e.host||un(e);return jK(t)?t.host:t}function qK(e){let t=_r(e);if(il(t))return(e.ownerDocument||e).body;if(_n(t)&&Qc(t))return t;return qK(t)}function Ps(e,t,o){var a;if(t===void 0)t=[];if(o===void 0)o=!0;let n=qK(e),r=n===((a=e.ownerDocument)==null?void 0:a.body),s=No(n);if(r){let l=Qm(s);return t.concat(s,s.visualViewport||[],Qc(n)?n:[],l&&o?Ps(l):[])}else return t.concat(n,Ps(n,[],o))}function Qm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ZK(e){let t=Ga(e),o=parseFloat(t.width)||0,a=parseFloat(t.height)||0,n=_n(e),r=n?e.offsetWidth:o,s=n?e.offsetHeight:a,l=Yc(o)!==r||Yc(a)!==s;if(l)o=r,a=s;return{width:o,height:a,$:l}}function e0(e){return!ja(e)?e.contextElement:e}function ll(e){let t=e0(e);if(!_n(t))return cn(1);let o=t.getBoundingClientRect(),{width:a,height:n,$:r}=ZK(t),s=(r?Yc(o.width):o.width)/a,l=(r?Yc(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!l||!Number.isFinite(l))l=1;return{x:s,y:l}}var ite=cn(0);function YK(e){let t=No(e);if(!Xm()||!t.visualViewport)return ite;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lte(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===No(e)}function Us(e,t,o,a){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),r=e0(e),s=cn(1);if(t)if(a){if(ja(a))s=ll(a)}else s=ll(e);let l=lte(r,o,a)?YK(r):cn(0),c=(n.left+l.x)/s.x,u=(n.top+l.y)/s.y,d=n.width/s.x,m=n.height/s.y;if(r&&a){let f=No(r),p=ja(a)?No(a):a,b=f,v=Qm(b);while(v&&p!==b){let S=ll(v),h=v.getBoundingClientRect(),g=Ga(v),y=h.left+(v.clientLeft+parseFloat(g.paddingLeft))*S.x,I=h.top+(v.clientTop+parseFloat(g.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,m*=S.y,c+=y,u+=I,b=No(v),v=Qm(b)}}return Bs({width:d,height:m,x:c,y:u})}function Jm(e,t){let o=eu(e).scrollLeft;if(!t)return Us(un(e)).left+o;return t.left+o}function XK(e,t){let o=e.getBoundingClientRect(),a=o.left+t.scrollLeft-Jm(e,o),n=o.top+t.scrollTop;return{x:a,y:n}}function cte(e){let{elements:t,rect:o,offsetParent:a,strategy:n}=e,r=n==="fixed",s=un(a),l=t?Jc(t.floating):!1;if(a===s||l&&r)return o;let c={scrollLeft:0,scrollTop:0},u=cn(1),d=cn(0),m=_n(a);if(m||!r){if(zs(a)!=="body"||Qc(s))c=eu(a);if(m){let p=Us(a);u=ll(a),d.x=p.x+a.clientLeft,d.y=p.y+a.clientTop}}let f=s&&!m&&!r?XK(s,c):cn(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:o.y*u.y-c.scrollTop*u.y+d.y+f.y}}function ute(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dte(e){let t=eu(e),o=e.ownerDocument.body,a=Fa(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=Fa(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),r=-t.scrollLeft+Jm(e),s=-t.scrollTop;if(Ga(o).direction==="rtl")r+=Fa(e.clientWidth,o.clientWidth)-a;return{width:a,height:n,x:r,y:s}}var mte=25;function fte(e,t,o){if(o===void 0)o="viewport";let a=o==="layoutViewport",n=No(e),r=un(e),s=n.visualViewport,{clientWidth:l,clientHeight:c}=r,u=0,d=0;if(s){let f=!Xm()||t==="fixed";if(a){if(!f)u=-s.offsetLeft,d=-s.offsetTop}else if(l=s.width,c=s.height,f)u=s.offsetLeft,d=s.offsetTop}if(Jm(r)<=0){let f=r.ownerDocument,p=f.body,b=getComputedStyle(p),v=f.compatMode==="CSS1Compat"?parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0:0,S=Math.abs(r.clientWidth-p.clientWidth-v),h=getComputedStyle(r).scrollbarGutter==="stable both-edges"?S/2:S;if(h<=mte)l-=h}return{width:l,height:c,x:u,y:d}}function pte(e,t){let o=Us(e,!0,t==="fixed"),a=o.top+e.clientTop,n=o.left+e.clientLeft,r=ll(e),s=e.clientWidth*r.x,l=e.clientHeight*r.y,c=n*r.x,u=a*r.y;return{width:s,height:l,x:c,y:u}}function $K(e,t,o){let a;if(t==="viewport"||t==="layoutViewport")a=fte(e,o,t);else if(t==="document")a=dte(un(e));else if(ja(t))a=pte(t,o);else{let n=YK(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Bs(a)}function hte(e,t){let o=t.get(e);if(o)return o;let a=Ps(e,[],!1).filter((l)=>ja(l)&&zs(l)!=="body"),n=null,r=Ga(e).position==="fixed",s=r?_r(e):e;while(ja(s)&&!il(s)){let l=Ga(s),c=Ym(s),u=n?n.position:r?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&l.position==="static"))a=a.filter((m)=>m!==s);else n=l;s=_r(s)}return t.set(e,a),a}function gte(e){let{element:t,boundary:o,rootBoundary:a,strategy:n}=e,s=[...o==="clippingAncestors"?Jc(t)?[]:hte(t,this._c):[].concat(o),a],l=$K(t,s[0],n),{top:c,right:u,bottom:d,left:m}=l;for(let f=1;f<s.length;f++){let p=$K(t,s[f],n);c=Fa(p.top,c),u=Ur(p.right,u),d=Ur(p.bottom,d),m=Fa(p.left,m)}return{width:u-m,height:d-c,x:m,y:c}}function bte(e){let{width:t,height:o}=ZK(e);return{width:t,height:o}}function vte(e,t,o){let a=_n(t),n=un(t),r=o==="fixed",s=Us(e,!0,r,t),l={scrollLeft:0,scrollTop:0},c=cn(0);if(a||!r){if(zs(t)!=="body"||Qc(n))l=eu(t);if(a){let f=Us(t,!0,r,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}}if(!a&&n)c.x=Jm(n);let u=n&&!a&&!r?XK(n,l):cn(0),d=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:d,y:m,width:s.width,height:s.height}}function Jb(e){return Ga(e).position==="static"}function WK(e,t){if(!_n(e)||Ga(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(un(e)===o)o=o.ownerDocument.body;return o}function QK(e,t){let o=No(e);if(Jc(e))return o;if(!_n(e)){let n=_r(e);while(n&&!il(n)){if(ja(n)&&!Jb(n))return n;n=_r(n)}return o}let a=WK(e,t);while(a&&VK(a)&&Jb(a))a=WK(a,t);if(a&&il(a)&&Jb(a)&&!Ym(a))return o;return a||KK(e)||o}var Ste=async function(e){let t=this.getOffsetParent||QK,o=this.getDimensions,a=await o(e.floating);return{reference:vte(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function yte(e){return Ga(e).direction==="rtl"}var JK={convertOffsetParentRelativeRectToViewportRelativeRect:cte,getDocumentElement:un,getClippingRect:gte,getOffsetParent:QK,getElementRects:Ste,getClientRects:ute,getDimensions:bte,getScale:ll,isElement:ja,isRTL:yte};function eq(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wte(e,t,o){let a=null,n,r=un(e);function s(){var d;clearTimeout(n),(d=a)==null||d.disconnect(),a=null}function l(d,m){if(d===void 0)d=!1;if(m===void 0)m=1;s();let f=e.getBoundingClientRect(),{left:p,top:b,width:v,height:S}=f;if(!d)t();if(!v||!S)return;let h=Xc(b),g=Xc(r.clientWidth-(p+v)),y=Xc(r.clientHeight-(b+S)),I=Xc(p),C={rootMargin:-h+"px "+-g+"px "+-y+"px "+-I+"px",threshold:Fa(0,Ur(1,m))||1},D=!0;function M(A){let E=A[0].intersectionRatio;if(!eq(f,e.getBoundingClientRect()))return l();if(E!==m){if(!D)return l();if(!E)n=setTimeout(()=>{l(!1,0.0000001)},1000);else l(!1,E)}D=!1}try{a=new IntersectionObserver(M,{...C,root:r.ownerDocument})}catch(A){a=new IntersectionObserver(M,C)}a.observe(e)}let c=No(e),u=()=>l(o);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),s()}}function t0(e,t,o,a){if(a===void 0)a={};let{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:l=typeof IntersectionObserver==="function",animationFrame:c=!1}=a,u=e0(e),d=n||r?[...u?Ps(u):[],...t?Ps(t):[]]:[];d.forEach((h)=>{n&&h.addEventListener("scroll",o),r&&h.addEventListener("resize",o)});let m=u&&l?wte(u,o,r):null,f=-1,p=null;if(s){if(p=new ResizeObserver((h)=>{let[g]=h;if(g&&g.target===u&&p&&t)p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)});o()}),u&&!c)p.observe(u);if(t)p.observe(t)}let b,v=c?Us(e):null;if(c)S();function S(){let h=Us(e);if(v&&!eq(v,h))o();v=h,b=requestAnimationFrame(S)}return o(),()=>{var h;if(d.forEach((g)=>{n&&g.removeEventListener("scroll",o),r&&g.removeEventListener("resize",o)}),m==null||m(),(h=p)==null||h.disconnect(),p=null,c)cancelAnimationFrame(b)}}var tq=zK;var oq=UK,aq=HK,nq=_K;var rq=FK,ef=(e,t,o)=>{let a=new Map,n=o!=null?o:{},r={...JK,...n.platform,_c:a};return BK(e,t,{...n,platform:r})};var tf=x(R(),1),Ite=x(R(),1),xte=x(gn(),1);var sq=(e,t)=>{let o=tq(e);return{name:o.name,fn:o.fn,options:[e,t]}},iq=(e,t)=>{let o=oq(e);return{name:o.name,fn:o.fn,options:[e,t]}},lq=(e,t)=>({fn:rq(e).fn,options:[e,t]}),cq=(e,t)=>{let o=aq(e);return{name:o.name,fn:o.fn,options:[e,t]}},uq=(e,t)=>{let o=nq(e);return{name:o.name,fn:o.fn,options:[e,t]}};function Cte({body:e,ctx:t}){let[o,a]=P.useState(()=>{let s={...e.initialValues};for(let l of e.fields)if(l.kind!=="button"&&l.name&&s[l.name]===void 0&&"defaultValue"in l)s[l.name]=l.defaultValue;return s}),n=(s,l)=>a((c)=>({...c,[s]:l})),r=()=>e.onSubmit(o,t);return w.jsxs("form",{className:"fm-form flex flex-col gap-2 px-2 py-2",onSubmit:(s)=>{s.preventDefault(),r()},children:[e.fields.map((s,l)=>w.jsx(Mte,{field:s,values:o,setValue:n,ctx:t},s.name??l)),e.submit!==null&&w.jsx("button",{type:"submit",className:"mt-2 inline-flex h-8 items-center justify-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:e.submit?.label??"Save"})]})}function Mte({field:e,values:t,setValue:o,ctx:a}){if(e.kind==="button")return w.jsx("button",{type:"button",onClick:()=>e.onClick(t,a),className:"inline-flex h-8 items-center justify-center rounded-md bg-secondary px-3 text-sm font-medium hover:bg-secondary/80",children:typeof e.label==="function"?e.label():e.label});let n=e.name;if(!n)return null;if(typeof e.hidden==="function"?e.hidden(t):e.hidden)return null;let s=e.label!=null?w.jsx("label",{className:"text-xs text-muted-foreground",children:typeof e.label==="function"?e.label():e.label}):null;switch(e.kind){case"switch":{let l=!!t[n];return w.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md px-1 py-1.5",children:[w.jsx("span",{className:"text-sm",children:typeof e.label==="function"?e.label():e.label}),w.jsx("button",{type:"button",role:"switch","aria-checked":l,onClick:()=>o(n,!l),className:Re("inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors",l?"bg-primary":"bg-muted"),children:w.jsx("span",{className:Re("block h-3 w-3 rounded-full bg-background shadow transition-transform",l?"translate-x-3.5":"translate-x-0.5")})})]})}case"checkbox":{let l=!!t[n];return w.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[w.jsx("input",{type:"checkbox",checked:l,onChange:(c)=>o(n,c.target.checked),className:"size-4 rounded border-border"}),typeof e.label==="function"?e.label():e.label]})}case"text":case"textarea":{let l=t[n]??"",c=e.kind==="textarea"?"textarea":"input";return w.jsxs("div",{className:"flex flex-col gap-1",children:[s,w.jsx(c,{value:l,placeholder:e.placeholder,onChange:(u)=>o(n,u.target.value),className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm"})]})}case"select":{let l=t[n]??"",c=typeof e.options==="function"?e.options():e.options;return w.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md px-1 py-1.5",children:[w.jsx("span",{className:"text-sm",children:typeof e.label==="function"?e.label():e.label}),w.jsx("select",{value:l,onChange:(u)=>o(n,u.target.value),className:"h-7 rounded-md border border-input bg-transparent px-2 text-sm",children:c.map((u)=>w.jsx("option",{value:String(u.id),children:u.name},String(u.id)))})]})}case"custom":return e.render({value:t[n],setValue:(l)=>o(n,l),ctx:a});default:return w.jsxs("div",{className:"text-xs text-muted-foreground",children:["[",e.kind," field not yet rendered]"]})}}var dq=typeof navigator<"u"&&/Mac/i.test(navigator.platform||navigator.userAgent||"");function r0(e,t,o,a){P.useEffect(()=>{if(!e||t?.disabled)return;let n=t?.navigation??"1d";if(n==="none")return;let r=t?.defaults??{},s=r.closeOnEscape??!0,l=r.selectOnEnter??!0,c=r.selectOnTab??!1,u=r.cycleWrap??!0,d=(m)=>{if(t?.onKeyDown?.(m,a)===!0)return;if(t?.shortcuts){for(let A of t.shortcuts)if(kte(m,A.keys)){if(A.preventDefault!==!1)m.preventDefault();A.handler(m);return}}let{count:f,index:p,setIndex:b,onSelect:v,onClose:S,columns:h}=o,g=(A)=>{if(f===0)return-1;if(u)return(A%f+f)%f;return Math.max(0,Math.min(f-1,A))},y=m.key.toLowerCase(),I=y==="arrowup"||dq&&m.ctrlKey&&y==="p",k=y==="arrowdown"||dq&&m.ctrlKey&&y==="n",C=y==="arrowleft",D=y==="arrowright",M=(A)=>A===1?0:Math.max(0,f-1);if(I){m.preventDefault();let A=n==="2d-grid"?h??1:1;b(p<0?M(-1):g(p-A));return}if(k){m.preventDefault();let A=n==="2d-grid"?h??1:1;b(p<0?M(1):g(p+A));return}if(n==="2d-grid"&&(C||D)){m.preventDefault(),b(p<0?M(C?-1:1):g(p+(C?-1:1)));return}if(n!=="2d-grid"&&D){if(o.onSubmenuOpen?.(p)){m.preventDefault();return}}if(n!=="2d-grid"&&C&&o.closeOnArrowLeft){m.preventDefault(),S();return}if(y==="home"){m.preventDefault(),b(0);return}if(y==="end"){m.preventDefault(),b(Math.max(0,f-1));return}if(l&&y==="enter"){if(m.preventDefault(),p>=0)v(p);return}if(c&&y==="tab"){if(m.preventDefault(),p>=0)v(p);return}if(s&&y==="escape")m.preventDefault(),S()};return e.addEventListener("keydown",d),()=>e.removeEventListener("keydown",d)},[e,t,o,a])}function kte(e,t){return t.split(",").map((a)=>a.trim().toLowerCase()).some((a)=>{let n=a.split("+").map((m)=>m.trim()),r=new Set(n),s=n[n.length-1],l=r.has("shift"),c=r.has("alt"),u=r.has("ctrl"),d=r.has("cmd")||r.has("meta");return e.key.toLowerCase()===s&&e.shiftKey===l&&e.altKey===c&&e.ctrlKey===u&&e.metaKey===d})}function tu(e,t,o){let[a,n]=P.useState({items:[],loading:!1,hasMore:!1}),r=P.useRef(0),s=P.useRef(0);P.useEffect(()=>{if(e.kind==="static"){n({items:e.items,loading:!1,hasMore:!1});return}if(e.kind==="prop"){n({items:e.getItems(o.data),loading:!1,hasMore:!1});return}if(e.kind==="sections"){let d=e.getSections(o.data).flatMap((m)=>[...m.items]);n({items:d,loading:!1,hasMore:!1});return}if(e.kind==="async"){r.current=0,s.current+=1;let u=s.current;return n((d)=>({...d,loading:!0,items:[]})),e.fetch({offset:0,limit:e.pageSize,filter:t}).then((d)=>{if(u!==s.current)return;n({items:d.items,loading:!1,hasMore:d.hasMore??!1}),r.current=d.items.length}).catch(()=>{if(u!==s.current)return;n((d)=>({...d,loading:!1}))}),()=>{s.current+=1}}if(e.kind==="store"){n({items:e.selector()??[],loading:!1,hasMore:!1});return}if(e.kind==="composite"){let u=[];for(let f of e.sources)if(f.kind==="static")u.push(...f.items);else if(f.kind==="prop")u.push(...f.getItems(o.data));else if(f.kind==="sections")for(let p of f.getSections(o.data))u.push(...p.items);else if(f.kind==="store")u.push(...f.selector()??[]);let d=e.dedupeBy,m=d?Array.from(new Map(u.map((f)=>[d(f),f])).values()):u;n({items:m,loading:!1,hasMore:!1});return}},[e,t,o.data]);let l=P.useRef(!1);return P.useEffect(()=>{l.current=a.loading},[a.loading]),{...a,loadMore:()=>{if(e.kind!=="async"||!a.hasMore)return;if(l.current)return;l.current=!0;let u=s.current;n((d)=>({...d,loading:!0})),e.fetch({offset:r.current,limit:e.pageSize,filter:t}).then((d)=>{if(u!==s.current)return;n((m)=>({items:[...m.items,...d.items],loading:!1,hasMore:d.hasMore??!1})),r.current+=d.items.length,l.current=!1}).catch(()=>{if(u!==s.current)return;n((d)=>({...d,loading:!1})),l.current=!1})}}}function pq(e,t){if(!t)return e;let o=t.toLowerCase();return e.filter((a)=>{let n=a?.name;return(typeof n==="string"?n:JSON.stringify(a)).toLowerCase().includes(o)})}function Dte({body:e,ctx:t,filter:o,onCloseRequest:a}){let{items:n,loading:r}=tu(e.source,o,t),s=P.useRef(null),[l,c]=P.useState(0),[u,d]=P.useState(0);P.useEffect(()=>{let b=s.current;if(!b||e.columns!=="auto"||!e.responsive)return;let v=new ResizeObserver(()=>c(b.clientWidth));return v.observe(b),c(b.clientWidth),()=>v.disconnect()},[e.columns,e.responsive]);let m=P.useMemo(()=>{if(e.columns==="auto"){let b=e.responsive?.minCellWidth??64;return Math.max(1,Math.floor((l||240)/b))}return e.columns},[e.columns,e.responsive,l]),f=Math.ceil(n.length/m),p=Zb({count:f,getScrollElement:()=>s.current,estimateSize:()=>e.rowHeight+(e.gap??4),overscan:4});if(r0(s.current,{navigation:e.keyboardNav2D?"2d-grid":"1d"},{count:n.length,index:u,setIndex:(b)=>{d(b);let v=Math.floor(b/m);p.scrollToIndex(v,{align:"auto"})},onSelect:(b)=>{let v=n[b];if(v!=null)e.onCellClick?.(v,t)},onClose:a,columns:m},t),!r&&n.length===0&&e.emptyState)return w.jsx("div",{className:"flex flex-col items-center justify-center px-4 py-8 text-sm text-muted-foreground",children:typeof e.emptyState.message==="string"&&e.emptyState.message||"No items"});return w.jsxs("div",{ref:s,className:"fm-grid relative max-h-[60vh] min-h-[80px] overflow-y-auto outline-none",role:"grid",children:[w.jsx("div",{style:{height:p.getTotalSize(),position:"relative",width:"100%"},children:p.getVirtualItems().map((b)=>{let v=b.index*m,S=n.slice(v,v+m);return w.jsx("div",{role:"row",style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${b.start}px)`,display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,gap:e.gap??4,padding:e.gap??4},children:S.map((h,g)=>{let y=v+g;return w.jsx("div",{role:"gridcell","aria-selected":y===u,onMouseEnter:()=>d(y),onClick:()=>e.onCellClick?.(h,t),onContextMenu:(I)=>{if(!e.onCellContextMenu)return;I.preventDefault(),e.onCellContextMenu(h,t)},className:Re("flex items-center justify-center rounded-md border border-transparent transition-colors cursor-pointer",y===u&&"border-border bg-accent"),style:{height:e.rowHeight},children:e.renderCell(h,t)},y)})},b.key)})}),r&&w.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading…"})]})}function Jt({icon:e,defaultSize:t=16}){if(!e)return null;let o=e.icon,a={};if(e.color)a.color=e.color;return w.jsx(o,{size:e.size??t,weight:e.weight,className:e.className,style:a,"aria-label":e["aria-label"]})}function rt(e,t){if(e==null)return null;if(typeof e==="function")return e(t);return e}function io(e,t){if(typeof e==="function")return e(t);return e}function Tte({item:e,spec:t,active:o,ctx:a,onActivate:n,extra:r,prefix:s}){let l=t,c=r?.filter??"",u=l.useFilterAsName&&c?`Add "${c}"`:rt(l.name,e);return w.jsxs("div",{role:"option","aria-selected":o,"data-active":o||void 0,onMouseEnter:n,onClick:()=>l.onClick(c||void 0,a),className:"fm-row",children:[s,w.jsx("span",{className:"fm-row__icon",children:l.icon?w.jsx(Jt,{icon:l.icon,defaultSize:14}):w.jsx(wb,{className:"size-3.5"})}),w.jsx("span",{className:"fm-row__name",children:u})]})}function hq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=s.checked(e),c=io(s.disabled,e)??!1,u=io(s.readonly,e)??!1,d=typeof s.icon==="function"?s.icon(e):s.icon;return w.jsxs("div",{role:"option","aria-selected":o,"aria-checked":l,"aria-disabled":c||void 0,"data-active":o||void 0,"data-checked":l||void 0,"data-disabled":c||void 0,onMouseEnter:n,onClick:()=>{if(c||u)return;s.onToggle(e,!l,a)},className:Re("fm-row",u&&"fm-row--readonly"),children:[r,d&&w.jsx("span",{className:"fm-row__icon",children:w.jsx(Jt,{icon:d,defaultSize:16})}),w.jsx("span",{className:"fm-row__name",children:rt(s.name,e)}),w.jsx("span",{"aria-hidden":!0,"data-checked":l||void 0,className:"fm-checkbox",children:l&&w.jsx(Kc,{weight:"bold"})})]})}function gq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=io(s.disabled,e)??!1,c=typeof s.icon==="function"?s.icon(e):s.icon,u=typeof s.trailing?.icon==="function"?s.trailing.icon(e):s.trailing?.icon;return w.jsxs("div",{role:"option","aria-selected":o,"aria-disabled":l||void 0,"data-active":o||void 0,onMouseEnter:n,onClick:(d)=>!l&&s.onClick?.(e,d,a),className:Re("fm-row fm-row--chip"),children:[r,c&&w.jsx("span",{className:"fm-row__icon",children:w.jsx(Jt,{icon:c,defaultSize:14})}),w.jsx("span",{className:"fm-row__name",children:rt(s.name,e)}),s.trailing&&u&&w.jsx("button",{type:"button",onClick:(d)=>{d.stopPropagation(),s.trailing?.onClick?.(e,a)},className:"fm-row__chip-trailing","aria-label":typeof s.trailing.ariaLabel==="function"?s.trailing.ariaLabel(e):s.trailing.ariaLabel??"Toggle",children:w.jsx(Jt,{icon:u,defaultSize:12})}),s.onDelete&&w.jsx("button",{type:"button",onClick:(d)=>{d.stopPropagation(),s.onDelete?.(e,a)},className:"fm-row__chip-delete","aria-label":typeof s.deleteAriaLabel==="function"?s.deleteAriaLabel(e):s.deleteAriaLabel??"Remove",children:w.jsx(Ls,{weight:"bold"})})]})}var Ate={default:"text-foreground/80",red:"text-red-500",orange:"text-orange-500",amber:"text-amber-500",yellow:"text-yellow-500",green:"text-emerald-500",teal:"text-teal-500",blue:"text-blue-500",indigo:"text-indigo-500",purple:"text-purple-500",pink:"text-pink-500"},Ete={default:"bg-muted",red:"bg-red-500",orange:"bg-orange-500",amber:"bg-amber-500",yellow:"bg-yellow-500",green:"bg-emerald-500",teal:"bg-teal-500",blue:"bg-blue-500",indigo:"bg-indigo-500",purple:"bg-purple-500",pink:"bg-pink-500"};function Ote({item:e,spec:t,active:o,ctx:a,onActivate:n}){let r=t,s=String(r.value(e)),l=r.active?.(e)??!1,c=typeof r.scope==="function"?r.scope(e):r.scope,d=(c==="bg"?Ete:Ate)[s]??"bg-muted";return w.jsxs("div",{role:"option","aria-selected":o,"data-active":o||void 0,onMouseEnter:n,onClick:()=>r.onSelect(e,a),className:"fm-row",children:[w.jsx("span",{"aria-hidden":!0,className:Re("fm-swatch",c==="bg"&&d),children:c==="text"&&w.jsx("span",{className:Re("fm-swatch__letter",d),children:"A"})}),w.jsx("span",{className:"fm-row__name",children:rt(r.name,e)}),l&&w.jsx(Kc,{className:"size-3.5 text-[color:var(--fm-muted-fg)]"})]})}function Nte({spec:e}){let t=e;return w.jsx("div",{role:"separator",className:"fm-divider",style:t.height?{height:t.height}:void 0})}function bq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=io(s.disabled,e)??!1,c=s.icon(e),u=s.relationName(e),d=s.conditionLabel(e),m=s.valuePreview(e),f=s.withMore??Boolean(s.onMore);return w.jsxs("div",{role:"option","aria-selected":o,"aria-disabled":l||void 0,"data-active":o||void 0,onMouseEnter:n,onClick:()=>!l&&s.onClick?.(e,a),className:Re("fm-row fm-row--rule"),children:[r,w.jsx("span",{className:"fm-row__icon",children:w.jsx(Jt,{icon:c,defaultSize:14})}),w.jsxs("span",{className:"fm-row__name flex min-w-0 items-baseline gap-1.5",children:[w.jsx("span",{className:"truncate font-medium",children:u}),w.jsx("span",{className:"shrink-0 text-[color:var(--fm-muted-fg)]",children:d}),w.jsx("span",{className:"truncate text-[color:var(--fm-muted-fg)]",children:m})]}),f&&w.jsx("button",{type:"button","aria-label":"More",onClick:(p)=>{p.stopPropagation(),s.onMore?.(e,a)},className:"inline-flex size-6 items-center justify-center rounded-md text-[color:var(--fm-muted-fg)] hover:bg-[color:var(--fm-row-hover-bg)]",children:w.jsx(qc,{className:"size-4"})})]})}function vq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=io(s.disabled,e)??!1,c=io(s.readonly,e)??!1;if(io(s.hidden,e)??!1)return null;let d=io(s.arrow,e)??!1,m=io(s.withMore,e)??!1,f=io(s.isBig,e)??!1,p=io(s.pressed,e)??!1,b=typeof s.icon==="function"?s.icon(e):s.icon,v=io(s.className,e),S=typeof s.subMenuId==="function"?s.subMenuId(e):s.subMenuId,h=s.subMenuTrigger??"arrowHover",g=s.subMenuHoverMs??200,y=P.useRef(null),I=P.useRef(null),k=()=>{if(!S||l||c)return;let E=s.subMenuData?s.subMenuData(e,a):a.data,j=y.current?.getBoundingClientRect(),de=j&&j.width>0&&j.height>0?j:void 0;a.open(S,{element:y.current??void 0,data:E,triggerRect:de})},C=()=>{if(I.current!=null)window.clearTimeout(I.current),I.current=null};return P.useEffect(()=>()=>C(),[e]),w.jsxs("div",{ref:y,role:"option","aria-selected":o,"aria-pressed":p||void 0,"aria-disabled":l||void 0,"aria-haspopup":S?"menu":void 0,"data-active":o||void 0,"data-pressed":p||void 0,"data-disabled":l||void 0,"data-submenu-id":S,onMouseEnter:()=>{if(n(),!S||l||c){C(),a.closeChildren();return}if(h!=="arrowHover")return;C(),I.current=window.setTimeout(k,g)},onMouseLeave:()=>{C()},onClick:(E)=>{if(l||c)return;if(S&&(h==="arrowClick"||h==="replace")){C(),k();return}s.onClick?.(e,E,a)},className:Re("fm-row",f&&"fm-row--big",c&&"fm-row--readonly",v),children:[r,b&&w.jsx("span",{className:"fm-row__icon",children:w.jsx(Jt,{icon:b,defaultSize:s.iconSize??16})}),w.jsx("span",{className:"fm-row__name",children:rt(s.name,e)}),s.caption!=null&&w.jsx("span",{className:"fm-row__caption",children:rt(s.caption,e)}),(m||d)&&w.jsxs("span",{className:"fm-row__suffix",children:[m&&w.jsx("button",{type:"button","aria-label":"More",onClick:(E)=>{E.stopPropagation(),s.onMore?.(e,E,a)},className:"inline-flex size-6 items-center justify-center rounded-md text-[color:var(--fm-muted-fg)] hover:bg-[color:var(--fm-row-hover-bg)]",children:w.jsx(qc,{className:"size-4"})}),d&&w.jsx(Vc,{className:"size-4 text-[color:var(--fm-muted-fg)]"})]})]})}function Sq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=io(s.disabled,e)??!1;return w.jsxs("div",{role:"option","aria-selected":o,"data-active":o||void 0,"data-disabled":l||void 0,onMouseEnter:n,onClick:(c)=>!l&&s.onClick?.(e,c,a),onContextMenu:(c)=>{if(!s.onContextMenu)return;c.preventDefault(),s.onContextMenu(e,c,a)},className:Re("fm-row",s.withDescription&&"fm-row--big"),children:[r,w.jsx("span",{className:"fm-row__icon",children:s.iconRender(e)}),w.jsxs("div",{className:"fm-row__name flex flex-col leading-tight",children:[w.jsx("span",{className:"truncate",children:rt(s.name,e)}),s.caption!=null&&!s.withDescription&&w.jsx("span",{className:"truncate text-[length:var(--fm-font-size-caption)] text-[color:var(--fm-muted-fg)]",children:rt(s.caption,e)})]}),s.caption!=null&&s.withDescription&&w.jsx("span",{className:"fm-row__caption",children:rt(s.caption,e)}),s.onMore&&w.jsx("button",{type:"button",onClick:(c)=>{c.stopPropagation(),s.onMore?.(e,c,a)},"aria-label":"More",className:"inline-flex size-6 items-center justify-center rounded-md text-[color:var(--fm-muted-fg)] hover:bg-[color:var(--fm-row-hover-bg)]",children:w.jsx(qc,{className:"size-4"})})]})}function yq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=s.selected?.(e)??!1;return w.jsxs("div",{role:"option","aria-selected":o,"data-active":o||void 0,onMouseEnter:n,onClick:()=>s.onSelect(e,a),className:"fm-row fm-row--big",children:[r,w.jsx("span",{className:"fm-row__icon",children:s.iconRender(e)}),w.jsxs("div",{className:"fm-row__name flex flex-col leading-tight",children:[w.jsx("span",{className:"truncate",children:rt(s.name,e)}),s.identity!=null&&w.jsx("span",{className:"truncate text-[length:var(--fm-font-size-caption)] text-[color:var(--fm-muted-fg)]",children:rt(s.identity,e)})]}),l&&w.jsx(Kc,{className:"size-4 text-[color:var(--fm-accent)]"})]})}function Lte({item:e,spec:t}){let o=t;return w.jsx("div",{role:"presentation",className:Re("fm-section",o.className),children:rt(o.name,e)})}function Rte({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=io(s.disabled,e)??!1,c=io(s.readonly,e)??!1,u=typeof s.icon==="function"?s.icon(e):s.icon,d=P.useRef(null),m=()=>{if(!s.subMenuId||l||c)return;let f=d.current?.getBoundingClientRect(),p=f&&f.width>0&&f.height>0?f:void 0;a.open(s.subMenuId,{element:d.current??void 0,data:a.data,triggerRect:p})};return w.jsxs("div",{ref:d,role:"option","aria-haspopup":"menu","aria-selected":o,"aria-disabled":l||void 0,"data-active":o||void 0,"data-submenu-id":s.subMenuId,onMouseEnter:n,onClick:m,className:Re("fm-row",c&&"fm-row--readonly"),children:[r,u&&w.jsx("span",{className:"fm-row__icon",children:w.jsx(Jt,{icon:u,defaultSize:16})}),w.jsx("span",{className:"fm-row__name",children:rt(s.name,e)}),w.jsx("span",{className:"fm-row__caption",children:rt(s.caption,e)}),w.jsx(Vc,{className:"size-4 shrink-0 text-[color:var(--fm-muted-fg)]"})]})}function wq({item:e,spec:t,active:o,ctx:a,onActivate:n,prefix:r}){let s=t,l=io(s.disabled,e)??!1,c=io(s.readonly,e)??!1,u=s.switchValue(e),d=typeof s.icon==="function"?s.icon(e):s.icon,m=io(s.className,e);return w.jsxs("div",{role:"option","aria-selected":o,"data-active":o||void 0,"data-disabled":l||c||void 0,onMouseEnter:n,onPointerDown:(p)=>{if(l||c)return;if(p.button!==0)return;p.preventDefault(),s.onSwitch(e,!u,a)},className:Re("fm-row",(l||c)&&"fm-row--readonly",m),children:[r,d&&w.jsx("span",{className:"fm-row__icon",children:w.jsx(Jt,{icon:d,defaultSize:16})}),w.jsx("span",{className:"fm-row__name",children:rt(s.name,e)}),s.caption!=null&&w.jsx("span",{className:"fm-row__caption",children:rt(s.caption,e)}),w.jsx("span",{role:"switch","aria-checked":u,"aria-disabled":l||c||void 0,className:"fm-switch","data-on":u||void 0,children:w.jsx("span",{className:"fm-switch__thumb"})})]})}function Bte(e,t){if(e==null)return String(t);return String(e?.id??t)}function Hte(e){let t=e.spec,o=Bte(e.item,e.index),{attributes:a,listeners:n,setNodeRef:r,transform:s,transition:l,isDragging:c}=Am({id:o}),u={transform:na.Transform.toString(s),transition:l,opacity:c?0.55:1,zIndex:c?10:void 0,pointerEvents:c?"none":void 0},d={...e,spec:t.inner,prefix:w.jsx(Pte,{dragListeners:n,dragAttributes:a})},m=(()=>{switch(t.inner.kind){case"item":return w.jsx(vq,{...d});case"object":return w.jsx(Sq,{...d});case"switch":return w.jsx(wq,{...d});case"checkbox":return w.jsx(hq,{...d});case"chip":return w.jsx(gq,{...d});case"participant":return w.jsx(yq,{...d});case"filterRule":return w.jsx(bq,{...d});case"custom":return w.jsx(w.Fragment,{children:t.inner.render(e.item,e.ctx)});default:return null}})();return w.jsx("div",{ref:r,style:u,"data-fm-drag-source":c||void 0,children:m})}function Pte({dragListeners:e,dragAttributes:t}){let o=e?.onPointerDown,a=e?.onKeyDown;return w.jsx("span",{...t,...e,onPointerDown:(n)=>{n.stopPropagation(),o?.(n)},onKeyDown:(n)=>{n.stopPropagation(),a?.(n)},onClick:(n)=>n.stopPropagation(),"aria-label":"Drag to reorder",role:"button",tabIndex:0,className:Re("shrink-0 cursor-grab text-[color:var(--fm-muted-fg)] opacity-50 transition-opacity","hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none active:cursor-grabbing"),"data-fm-drag-handle":!0,children:w.jsx(bb,{className:"size-3.5"})})}function jr(e,t){for(let o of e)if(!o.match||o.match(t))return o;return}function o0(e){switch(e.spec.kind){case"item":return w.jsx(vq,{...e});case"section":return w.jsx(Lte,{...e});case"divider":return w.jsx(Nte,{...e});case"switch":return w.jsx(wq,{...e});case"checkbox":return w.jsx(hq,{...e});case"selectNav":return w.jsx(Rte,{...e});case"color":return w.jsx(Ote,{...e});case"add":return w.jsx(Tte,{...e});case"object":return w.jsx(Sq,{...e});case"participant":return w.jsx(yq,{...e});case"sortable":return w.jsx(Hte,{...e});case"chip":return w.jsx(gq,{...e});case"filterRule":return w.jsx(bq,{...e});case"custom":return e.spec.render(e.item,e.ctx);default:return w.jsxs("div",{"data-row-kind":e.spec.kind,className:"px-3 py-2 text-xs text-muted-foreground",children:["[",e.spec.kind," row not yet rendered]"]})}}var zte=32,mq=8;function Iq({body:e,ctx:t,filter:o,onCloseRequest:a,isSubMenu:n,keyboard:r,controlledActiveIndex:s}){let{items:l,loading:c,hasMore:u,loadMore:d}=tu(e.source,o,t),m=P.useMemo(()=>{let G=e.source?.kind;if(G==="async"||G==="composite")return l;return pq(l,o)},[l,o,e.source]),f=P.useRef(null),[p,b]=P.useState(0),v=s!=null,S=v?s:p;P.useEffect(()=>{if(e.orientation==="horizontal"){b(-1);return}b(m.length>0?Ute(m,e.rows):-1)},[m,e.rows,e.orientation]);let h=e.focusOnMount??!0;P.useEffect(()=>{if(!h)return;let G=requestAnimationFrame(()=>{let J=f.current;if(!J)return;let Se=document.activeElement;if(Se&&Se.tagName==="INPUT")return;if(J.contains(Se))return;J.focus({preventScroll:!0})});return()=>cancelAnimationFrame(G)},[n,h]);let g=P.useCallback((G)=>{let J=e.virtualized;if(typeof J==="object"&&J.rowHeight)return typeof J.rowHeight==="function"?J.rowHeight(m[G],G):J.rowHeight;let Se=jr(e.rows,m[G]);if(Se?.kind==="section")return 28;if(Se?.kind==="divider")return 9;return zte},[e.virtualized,e.rows,m]),y=Zb({count:m.length,getScrollElement:()=>f.current,estimateSize:g,overscan:typeof e.virtualized==="object"?e.virtualized.overscan??mq:mq});P.useEffect(()=>{if(!v||s==null||s<0)return;y.scrollToIndex(s,{align:"auto"})},[v,s,y]);let I=P.useMemo(()=>r?.navigation==="2d-grid"?{...r,navigation:"1d"}:r,[r]);r0(f.current,I,{count:m.length,index:p,setIndex:(G)=>{let J=Fte(G,m,e.rows,p);b(J),y.scrollToIndex(J,{align:"auto"})},onSelect:(G)=>{xq(m[G],e.rows,t)},onSubmenuOpen:(G)=>{let J=m[G],Se=jr(e.rows,J);if(!Se||Se.kind!=="item"&&Se.kind!=="selectNav")return!1;if(!Se.subMenuId)return!1;let Be=typeof Se.subMenuId==="function"?Se.subMenuId(J):Se.subMenuId;if(!Be)return!1;let lo=f.current?.querySelector(`[data-index="${G}"] [data-submenu-id]`),Co=lo?.getBoundingClientRect(),dn=Co&&Co.width>0&&Co.height>0?Co:void 0,co=Se.subMenuData?Se.subMenuData(J,t):t.data;return t.open(Be,{element:lo??void 0,data:co,triggerRect:dn}),!0},onClose:a,closeOnArrowLeft:n},t);let k=P.useRef(-1),C=y.getVirtualItems(),D=C.length?C[C.length-1].index:-1;P.useEffect(()=>{if(!e.infiniteScroll)return;if(D<0)return;if(!u||c)return;if(D>=m.length-5&&k.current!==m.length)k.current=m.length,d()},[D,m.length,u,c,e.infiniteScroll,d]);let M=e.sortable,A=P.useMemo(()=>{let G=[];for(let J=0;J<m.length;J++){let Se=m[J],Be=jr(e.rows,Se);if(!Be||Be.kind!=="sortable")continue;G.push(String(Se?.id??J))}return G},[m,e.rows]),E=hm(Fc(Es,{activationConstraint:{distance:4}}),Fc(jc,{coordinateGetter:mM})),[j,de]=P.useState(null),fe=P.useRef(null),pe=j==null?null:fe.current,Ye=P.useCallback((G)=>{document.body.setAttribute("data-fm-dragging","true");let J=String(G.active.id);de(J),fe.current=m.find((Se,Be)=>String(Se?.id??Be)===J)},[m]),eo=P.useCallback((G)=>{if(de(null),!M)return;let{active:J,over:Se}=G;if(!Se||J.id===Se.id)return;let Be=(dn)=>m.findIndex((co,Fs)=>String(co?.id??Fs)===dn),lo=Be(String(J.id)),Co=Be(String(Se.id));if(lo<0||Co<0)return;M.onReorder(lo,Co,t)},[M,m,t]);if(!c&&m.length===0&&e.emptyState){let G=typeof e.emptyState.title==="string"&&e.emptyState.title||typeof e.emptyState.message==="string"&&e.emptyState.message||"No results";return w.jsx("div",{className:"flex flex-col items-center justify-center px-4 py-8 text-sm text-muted-foreground",children:G})}if(e.orientation==="horizontal")return w.jsx("div",{tabIndex:0,className:"fm-list fm-list--horizontal",role:"listbox","aria-orientation":"horizontal",children:m.map((G,J)=>{let Se=jr(e.rows,G);if(!Se)return null;let Be=G?.id,lo=typeof Be==="string"||typeof Be==="number"?Be:J;return w.jsx("div",{"data-index":J,children:o0({item:G,spec:Se,index:J,active:J===S,ctx:t,onActivate:()=>b(J),extra:{filter:o}})},lo)})});let st=w.jsxs("div",{ref:f,tabIndex:0,className:"fm-list",role:"listbox","aria-orientation":"vertical",children:[w.jsx("div",{style:{height:y.getTotalSize(),position:"relative",width:"100%"},children:y.getVirtualItems().map((G)=>{let J=m[G.index],Se=jr(e.rows,J);if(!Se)return null;return w.jsx("div",{"data-index":G.index,ref:y.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${G.start}px)`},children:o0({item:J,spec:Se,index:G.index,active:G.index===S,ctx:t,onActivate:()=>b(G.index),extra:{filter:o}})},G.key)})}),c&&w.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading…"})]});if(!M)return st;let to=[wm,M.axis==="x"?null:Im].filter(Boolean);return w.jsxs(ym,{sensors:E,collisionDetection:(G)=>{let J=_C(G);return J.length?J:Jg(G)},modifiers:to,onDragStart:Ye,onDragEnd:(G)=>{document.body.removeAttribute("data-fm-dragging"),eo(G)},onDragCancel:()=>{document.body.removeAttribute("data-fm-dragging"),de(null)},children:[w.jsx(Tm,{items:A,strategy:Dm,children:st}),typeof document<"u"&&n0.createPortal(w.jsx(iM,{children:pe?w.jsx("div",{className:"fm-row-overlay","data-fm-drag-overlay":!0,children:(()=>{let G=jr(e.rows,pe);if(!G)return null;return o0({item:pe,spec:G,index:-1,active:!0,ctx:t,onActivate:()=>{},extra:{filter:o}})})()}):null}),document.body)]})}function xq(e,t,o){if(e==null)return;let a=jr(t,e);if(!a)return;let n=new MouseEvent("click",{detail:0});switch(a.kind){case"item":a.onClick?.(e,n,o);return;case"switch":a.onSwitch?.(e,!a.switchValue?.(e),o);return;case"checkbox":a.onToggle?.(e,!a.checked?.(e),o);return;case"color":a.onSelect?.(e,o);return;case"participant":a.onSelect?.(e,o);return;case"add":a.onClick?.(void 0,o);return;case"object":a.onClick?.(e,n,o);return;case"chip":a.onClick?.(e,n,o);return;case"filterRule":a.onClick?.(e,o);return;case"selectNav":{if(!a.subMenuId)return;o.open(a.subMenuId,{data:o.data});return}case"sortable":xq(e,[{...a.inner,match:a.match}],o);return;default:return}}function Cq(e,t){let o=jr(t,e);if(!o)return!1;return o.kind!=="section"&&o.kind!=="divider"&&o.kind!=="empty"}function Ute(e,t){for(let o=0;o<e.length;o++)if(Cq(e[o],t))return o;return-1}function Fte(e,t,o,a){let n=e>a?1:-1,r=e,s=t.length;while(s-- >0){if(r<0)r=t.length-1;if(r>=t.length)r=0;if(Cq(t[r],o))return r;r+=n}return a}function _te({spec:e,ctx:t}){switch(e.kind){case"custom":return w.jsx(w.Fragment,{children:e.render(t)});case"label":return w.jsx(jte,{spec:e,ctx:t});case"divider":return w.jsx("hr",{className:"mx-2 my-1 border-border"});case"searchInput":return w.jsx(Gte,{spec:e,ctx:t});case"recentStrip":return w.jsx(Vte,{spec:e,ctx:t});case"categoryJump":return w.jsx(Kte,{spec:e,ctx:t});case"fileDropZone":return w.jsx(qte,{spec:e,ctx:t});case"monthGrid":return w.jsx($te,{spec:e,ctx:t});case"emojiGrid":return w.jsx(Mq,{spec:e,ctx:t});case"tileGrid":return w.jsx(Wte,{spec:e,ctx:t});case"queryBuilder":return w.jsx(Zte,{spec:e,ctx:t});case"emptyState":return w.jsx(Yte,{spec:e,ctx:t});case"loader":return w.jsx(Xte,{spec:e});case"error":return w.jsx(Qte,{spec:e,ctx:t});case"banner":return w.jsx(Jte,{spec:e,ctx:t});case"linkPreview":return w.jsx(eoe,{spec:e});case"tabBar":return w.jsx(toe,{spec:e,ctx:t});case"slider":return w.jsx(ooe,{spec:e,ctx:t});case"markdownToolbar":return w.jsx(aoe,{spec:e,ctx:t});case"codeEditor":return w.jsx(noe,{spec:e,ctx:t});case"katexPreview":return w.jsx(roe,{spec:e});case"qrCode":return w.jsx(soe,{spec:e});default:return null}}function jte({spec:e}){return w.jsx("div",{className:Re("px-3 py-1 text-xs text-muted-foreground",e.className),children:rt(e.text,void 0)})}function Gte({spec:e,ctx:t}){let[o,a]=P.useState(""),n=P.useRef(void 0),r=P.useRef(t);return r.current=t,P.useEffect(()=>()=>window.clearTimeout(n.current),[]),w.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[w.jsx("span",{className:"text-muted-foreground",children:e.icon?w.jsx(Jt,{icon:e.icon,defaultSize:14}):w.jsx($c,{className:"size-3.5"})}),w.jsx("input",{value:o,placeholder:e.placeholder??"Search…",onChange:(s)=>{a(s.target.value),window.clearTimeout(n.current),n.current=window.setTimeout(()=>e.onChange(s.target.value,r.current),e.debounceMs??200)},className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),o&&w.jsx("button",{type:"button","aria-label":"Clear",onClick:()=>{a(""),e.onChange("",t),e.onClear?.(t)},className:"text-muted-foreground hover:text-foreground",children:w.jsx(Ls,{className:"size-3.5"})})]})}function Vte({spec:e,ctx:t}){let{items:o}=tu(e.source,"",t);if(!o.length)return e.emptyMessage?w.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:e.emptyMessage}):null;return w.jsx("div",{className:"flex items-center gap-1 overflow-x-auto px-2 py-1",children:o.map((a,n)=>w.jsx("button",{type:"button",onClick:()=>e.onSelect?.(a,t),className:"shrink-0 rounded-md p-1 hover:bg-accent",children:e.renderItem(a,t)},n))})}function Kte({spec:e,ctx:t}){return w.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-muted/30 px-1 py-1",children:[w.jsx("div",{className:"flex items-center gap-0.5",children:e.categories.map((o)=>{let a=o.id===e.activeId;return w.jsx("button",{type:"button",title:o.tooltip,onClick:()=>e.onJump(o.id,t),className:Re("inline-flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent",a&&"bg-accent text-foreground"),children:w.jsx(Jt,{icon:o.icon,defaultSize:14})},o.id)})}),e.trailing&&w.jsx("button",{type:"button",title:e.trailing.tooltip,onClick:()=>e.trailing.onClick(t),className:"inline-flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent",children:w.jsx(Jt,{icon:e.trailing.icon,defaultSize:14})})]})}function qte({spec:e,ctx:t}){let[o,a]=P.useState(!1),n=P.useRef(null);return P.useEffect(()=>{if(!e.pasteFromClipboard)return;let r=(s)=>{let l=Array.from(s.clipboardData?.files??[]);if(l.length)s.preventDefault(),e.onFiles(l,t)};return window.addEventListener("paste",r),()=>window.removeEventListener("paste",r)},[e,t]),w.jsxs("div",{onClick:()=>e.clickToOpen!==!1&&n.current?.click(),onDragOver:(r)=>{r.preventDefault(),a(!0)},onDragLeave:()=>a(!1),onDrop:(r)=>{r.preventDefault(),a(!1);let s=Array.from(r.dataTransfer.files);if(s.length)e.onFiles(s,t)},className:Re("m-2 flex h-32 flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-sm text-muted-foreground transition-colors cursor-pointer",o?"border-primary bg-accent/50 text-foreground":"border-border"),children:[e.icon?w.jsx(Jt,{icon:e.icon,defaultSize:20}):w.jsx(xb,{className:"size-5"}),w.jsx("span",{children:rt(e.label,void 0)??"Drop files here"}),w.jsx("input",{ref:n,type:"file",accept:e.accept,multiple:e.multiple,className:"hidden",onChange:(r)=>{let s=Array.from(r.target.files??[]);if(s.length)e.onFiles(s,t);r.target.value=""}})]})}var fq=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $te({spec:e,ctx:t}){let[o,a]=P.useState(()=>new Date(e.value??Date.now())),[n,r]=P.useState("days"),s=(()=>{let S=e.value?new Date(e.value):new Date;return{hh:S.getHours(),mm:S.getMinutes()}})(),[l,c]=P.useState(s),u=(S)=>{let h=new Date(S);if(e.withTime)h.setHours(l.hh,l.mm,0,0);e.onChange(h.getTime(),t)},d=new Date,m=(S,h)=>S.getFullYear()===h.getFullYear()&&S.getMonth()===h.getMonth()&&S.getDate()===h.getDate(),f=w.jsxs("header",{className:"flex items-center justify-between gap-1 px-1 pb-1.5",children:[w.jsx("button",{type:"button",onClick:()=>{if(n==="days")a(new Date(o.getFullYear(),o.getMonth()-1,1));else if(n==="months")a(new Date(o.getFullYear()-1,o.getMonth(),1));else a(new Date(o.getFullYear()-12,o.getMonth(),1))},className:"rounded-md p-1 text-[color:var(--fm-muted-fg)] hover:bg-[color:var(--fm-row-hover-bg)]","aria-label":"Previous",children:w.jsx(db,{className:"size-4"})}),w.jsxs("div",{className:"flex flex-1 items-center justify-center gap-1",children:[w.jsx("button",{type:"button",onClick:()=>r(n==="months"?"days":"months"),"aria-label":"Pick month",className:"rounded-md px-1.5 py-0.5 text-sm font-medium hover:bg-[color:var(--fm-row-hover-bg)]",children:fq[o.getMonth()]}),w.jsx("button",{type:"button",onClick:()=>r(n==="years"?"days":"years"),"aria-label":"Pick year",className:"rounded-md px-1.5 py-0.5 text-sm font-medium tabular-nums hover:bg-[color:var(--fm-row-hover-bg)]",children:o.getFullYear()})]}),w.jsx("button",{type:"button",onClick:()=>{if(n==="days")a(new Date(o.getFullYear(),o.getMonth()+1,1));else if(n==="months")a(new Date(o.getFullYear()+1,o.getMonth(),1));else a(new Date(o.getFullYear()+12,o.getMonth(),1))},className:"rounded-md p-1 text-[color:var(--fm-muted-fg)] hover:bg-[color:var(--fm-row-hover-bg)]","aria-label":"Next",children:w.jsx(Vc,{className:"size-4"})})]}),p;if(n==="months")p=w.jsx("div",{className:"grid grid-cols-3 gap-1 px-1",children:fq.map((S,h)=>{let g=h===o.getMonth();return w.jsx("button",{type:"button",onClick:()=>{a(new Date(o.getFullYear(),h,1)),r("days")},className:Re("rounded-md py-1.5 text-xs hover:bg-[color:var(--fm-row-hover-bg)]",g&&"bg-[color:var(--fm-accent)] text-[color:var(--fm-accent-fg)] hover:bg-[color:var(--fm-accent)]"),children:S},S)})});else if(n==="years"){let S=o.getFullYear(),h=e.yearRange?.from??S-50,g=e.yearRange?.to??S+50,y=Math.floor(S/12)*12,I=[];for(let k=0;k<12;k++)I.push(y+k);p=w.jsx("div",{className:"grid grid-cols-3 gap-1 px-1",children:I.map((k)=>{let C=k===S,D=k<h||k>g;return w.jsx("button",{type:"button",disabled:D,onClick:()=>{a(new Date(k,o.getMonth(),1)),r("days")},className:Re("rounded-md py-1.5 text-xs tabular-nums hover:bg-[color:var(--fm-row-hover-bg)]",C&&"bg-[color:var(--fm-accent)] text-[color:var(--fm-accent-fg)] hover:bg-[color:var(--fm-accent)]",D&&"opacity-30 pointer-events-none"),children:k},k)})})}else{let h=(new Date(o.getFullYear(),o.getMonth(),1).getDay()+6)%7,g=new Date(o.getFullYear(),o.getMonth()+1,0).getDate(),y=[];for(let I=0;I<h;I++)y.push(null);for(let I=1;I<=g;I++)y.push({day:I,date:new Date(o.getFullYear(),o.getMonth(),I)});while(y.length%7!==0)y.push(null);p=w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"grid grid-cols-7 gap-0.5 text-center text-[10px] text-[color:var(--fm-muted-fg)]",children:["M","T","W","T","F","S","S"].map((I,k)=>w.jsx("span",{className:"py-1",children:I},k))}),w.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:y.map((I,k)=>{if(!I)return w.jsx("span",{},k);let C=e.value&&m(new Date(e.value),I.date),D=m(d,I.date);return w.jsx("button",{type:"button",onClick:()=>u(I.date),onContextMenu:(M)=>{if(!e.onDayContextMenu)return;M.preventDefault(),e.onDayContextMenu(I.date.getTime(),t)},className:Re("flex h-7 items-center justify-center rounded-md text-xs hover:bg-[color:var(--fm-row-hover-bg)]",C&&"bg-[color:var(--fm-accent)] text-[color:var(--fm-accent-fg)] hover:bg-[color:var(--fm-accent)]",!C&&D&&"border border-[color:var(--fm-surface-border)]"),children:I.day},k)})})]})}let b=(S,h)=>{let g=e.value?new Date(e.value):new Date(new Date().setHours(0,0,0,0));g.setHours(S,h,0,0),e.onChange(g.getTime(),t)},v=e.withTime?w.jsxs("div",{className:"mt-2 flex items-center justify-center gap-1 border-t border-[color:var(--fm-surface-border)] pt-2",children:[w.jsx("input",{type:"number",min:0,max:23,value:String(l.hh).padStart(2,"0"),onChange:(S)=>{let h=Math.max(0,Math.min(23,Number(S.target.value)||0));c((g)=>({...g,hh:h})),b(h,l.mm)},className:"w-10 rounded-md border border-[color:var(--fm-surface-border)] bg-transparent px-1 py-0.5 text-center font-mono text-xs tabular-nums","aria-label":"Hours"}),w.jsx("span",{className:"text-[color:var(--fm-muted-fg)]",children:":"}),w.jsx("input",{type:"number",min:0,max:59,value:String(l.mm).padStart(2,"0"),onChange:(S)=>{let h=Math.max(0,Math.min(59,Number(S.target.value)||0));c((g)=>({...g,mm:h})),b(l.hh,h)},className:"w-10 rounded-md border border-[color:var(--fm-surface-border)] bg-transparent px-1 py-0.5 text-center font-mono text-xs tabular-nums","aria-label":"Minutes"})]}):null;return w.jsxs("div",{className:"px-2 py-2 text-sm",children:[f,p,v]})}function Mq({spec:e,ctx:t}){let{items:o}=tu(e.source,"",t),a=o,n=e.columns;return w.jsx("div",{className:"grid p-1",style:{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:e.gap??2},children:a.map((r,s)=>w.jsx("button",{type:"button",onClick:()=>e.onSelect?.(r,t),onContextMenu:(l)=>{if(!e.onLongPress)return;l.preventDefault(),e.onLongPress(r,t)},className:"flex items-center justify-center rounded-md hover:bg-accent",style:{height:e.rowHeight},children:e.renderTile(r,t)},s))})}function Wte({spec:e,ctx:t}){return w.jsx(Mq,{spec:e,ctx:t})}function Zte({spec:e,ctx:t}){let o=(a,n=0)=>{let r=e.getOperator(a);return w.jsxs("div",{className:Re("flex flex-col gap-1 rounded-md border border-border p-2",n>0&&"ml-4"),children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("select",{value:r,onChange:(s)=>e.onOperatorChange(a,s.target.value,t),className:"h-6 rounded-md border border-input bg-transparent px-1 text-xs",children:e.operatorOptions.map((s)=>w.jsx("option",{value:s.id,children:s.label},s.id))}),w.jsxs("div",{className:"flex items-center gap-1",children:[w.jsx("button",{type:"button",onClick:()=>e.onAddRule(a,t),className:"rounded-md px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-accent",children:"+ Rule"}),w.jsx("button",{type:"button",onClick:()=>e.onAddGroup(a,t),className:"rounded-md px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-accent",children:"+ Group"})]})]}),w.jsx("div",{className:"flex flex-col gap-1",children:e.getChildren(a).map((s,l)=>s.kind==="rule"?w.jsx("div",{children:e.renderRule(s.data,t)},l):w.jsx("div",{children:o(s.data,n+1)},l))})]})};return w.jsx("div",{className:"p-2",children:o(e.root)})}function Yte({spec:e}){return w.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center text-sm text-muted-foreground",children:[e.icon&&w.jsx(Jt,{icon:e.icon,defaultSize:20}),e.title&&w.jsx("div",{className:"text-foreground",children:rt(e.title,void 0)}),e.message&&w.jsx("div",{children:rt(e.message,void 0)}),e.action&&w.jsx("button",{type:"button",onClick:(t)=>e.action.onClick(t),className:"mt-1 inline-flex h-7 items-center rounded-md bg-primary px-2 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:e.action.label})]})}function Xte({spec:e}){return w.jsxs("div",{className:"flex items-center justify-center gap-2 px-3 py-3 text-xs text-muted-foreground",children:[w.jsx(hb,{className:"size-3.5 animate-spin"}),e.message?rt(e.message,void 0):"Loading…"]})}function Qte({spec:e,ctx:t}){return w.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-xs text-destructive",children:[w.jsx(Mb,{className:"size-3.5 shrink-0"}),w.jsx("div",{className:"flex-1",children:rt(e.message,void 0)}),e.retry&&w.jsx("button",{type:"button",onClick:()=>e.retry.onClick(t),className:"rounded-md bg-destructive/10 px-1.5 py-0.5 text-destructive hover:bg-destructive/20",children:e.retry.label??"Retry"})]})}function Jte({spec:e}){return w.jsxs("div",{className:"m-2 flex items-start gap-2 rounded-md border border-border bg-muted/30 p-2 text-xs",children:[e.icon&&w.jsx(Jt,{icon:e.icon,defaultSize:14}),w.jsxs("div",{className:"flex-1",children:[e.title&&w.jsx("div",{className:"font-medium",children:rt(e.title,void 0)}),e.message&&w.jsx("div",{className:"text-muted-foreground",children:rt(e.message,void 0)})]}),e.action&&w.jsx("button",{type:"button",onClick:(t)=>e.action.onClick(t),className:"rounded-md bg-primary px-1.5 py-0.5 text-primary-foreground",children:e.action.label})]})}function eoe({spec:e}){return w.jsxs("div",{className:"m-2 flex gap-3 rounded-md border border-border p-2",children:[e.image&&w.jsx("img",{src:e.image,alt:"",className:"size-12 shrink-0 rounded object-cover"}),w.jsxs("div",{className:"flex-1",children:[e.title&&w.jsx("div",{className:"text-sm font-medium",children:e.title}),e.description&&w.jsx("div",{className:"text-xs text-muted-foreground",children:e.description}),w.jsx("div",{className:"text-[10px] text-muted-foreground",children:e.url})]})]})}function toe({spec:e,ctx:t}){return w.jsxs("div",{className:"flex items-center justify-between border-b border-border px-1 pt-1",children:[w.jsx("div",{className:"flex items-center gap-0.5",role:"tablist",children:e.tabs.map((o)=>{let a=o.id===e.activeId;return w.jsxs("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>e.onChange(o.id,t),className:Re("inline-flex items-center gap-1 rounded-t-md px-2 py-1 text-xs font-medium",a?"border-b-2 border-primary text-foreground":"text-muted-foreground"),children:[o.icon&&w.jsx(Jt,{icon:o.icon,defaultSize:12}),o.label]},o.id)})}),e.rightSlot]})}function ooe({spec:e,ctx:t}){let o=(a)=>{let n=e.snaps;if(!n||n.length===0)return a;return n.reduce((r,s)=>Math.abs(s-a)<Math.abs(r-a)?s:r,n[0])};return w.jsxs("div",{className:"flex flex-col gap-1.5 px-3 py-2",children:[(e.label||e.showValue)&&w.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[w.jsx("span",{children:rt(e.label,void 0)}),e.showValue&&w.jsx("span",{className:"font-mono tabular-nums",children:e.value})]}),w.jsx("input",{type:"range",min:e.min,max:e.max,step:e.step??1,value:e.value,onChange:(a)=>e.onChange(Number(a.target.value),t),onPointerUp:(a)=>{let n=o(Number(a.target.value));if(n!==e.value)e.onChange(n,t)},className:"w-full accent-[color:var(--fm-accent)]","aria-label":typeof e.label==="string"?e.label:void 0})]})}function aoe({spec:e,ctx:t}){let o=new Set(e.activeMarks??[]);return w.jsxs("div",{className:"flex items-center gap-0.5 border-b border-border px-1 py-1",children:[e.styleSwitcher&&w.jsxs(w.Fragment,{children:[w.jsxs("button",{type:"button",onClick:()=>e.styleSwitcher.onClick(t),className:"inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground hover:bg-accent","aria-label":`Style: ${e.styleSwitcher.activeStyle}`,children:[w.jsx(Jt,{icon:e.styleSwitcher.icon,defaultSize:12}),w.jsx("span",{className:"font-medium",children:e.styleSwitcher.activeStyle})]}),w.jsx("span",{className:"mx-0.5 h-4 w-px bg-border","aria-hidden":!0})]}),e.buttons.map((a)=>{let n=a.mark?o.has(a.mark):!1;return w.jsx("button",{type:"button",onClick:()=>a.onClick(t),"aria-pressed":n||void 0,title:typeof a.tooltip?.text==="string"?a.tooltip.text:void 0,className:Re("inline-flex size-6 items-center justify-center rounded-md hover:bg-accent",n?"bg-accent text-foreground":"text-muted-foreground"),children:w.jsx(Jt,{icon:a.icon,defaultSize:14})},a.id)})]})}function noe({spec:e,ctx:t}){let o=P.useRef(t);o.current=t;let a=e.minRows??4,n=e.maxRows??16,r=Math.min(n,Math.max(a,(e.value?.split(`
28
+ `).length??0)||a));return w.jsxs("div",{className:"px-2 py-2",children:[e.language&&w.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:e.language}),w.jsx("textarea",{value:e.value??"",placeholder:e.placeholder,rows:r,spellCheck:!1,onChange:(s)=>e.onChange(s.target.value,o.current),onKeyDown:(s)=>{if(e.onSave&&(s.metaKey||s.ctrlKey)&&s.key==="Enter")s.preventDefault(),e.onSave?.(s.target.value,o.current)},className:"w-full resize-none rounded-md border border-border bg-transparent p-2 font-mono text-xs leading-relaxed outline-none"})]})}function roe({spec:e}){let t=e.displayMode??!0;return w.jsxs("div",{className:"px-3 py-2",children:[w.jsx("div",{className:Re("rounded-md border border-border bg-muted/30 px-3 py-2 font-mono text-xs",t?"text-center":"inline-block"),"aria-label":"LaTeX expression",children:e.expression}),e.caption&&w.jsx("div",{className:"mt-1 text-[10px] text-muted-foreground",children:e.caption})]})}function soe({spec:e}){let t=e.size??128,o=Array.from(e.value).reduce((a,n)=>(a+n.charCodeAt(0))%4096,0).toString(2).padStart(12,"0");return w.jsxs("div",{className:"flex flex-col items-center gap-2 px-3 py-3",children:[w.jsx("div",{role:"presentation",className:"grid place-items-center rounded-md border border-border bg-foreground/5",style:{width:t,height:t},children:w.jsx("div",{className:"grid grid-cols-6 gap-px font-mono text-[8px] text-muted-foreground",children:o.split("").map((a,n)=>w.jsx("span",{className:Re("size-3 rounded-sm",a==="1"?"bg-foreground":"bg-transparent")},n))})}),w.jsx("div",{className:"text-center text-[10px] uppercase tracking-wider text-muted-foreground",children:"Preview only — not scannable"}),w.jsx("code",{className:"max-w-full break-all text-center text-[10px] text-muted-foreground",children:e.value}),e.buttons&&w.jsx("div",{className:"flex items-center gap-1",children:e.buttons.map((a)=>w.jsxs("button",{type:"button",onClick:a.onClick,className:"inline-flex h-6 items-center rounded-md border border-border px-2 text-[11px] text-muted-foreground hover:bg-accent",children:[a.icon&&w.jsx(Jt,{icon:a.icon,defaultSize:10}),a.label]},a.id))})]})}function kq({body:e,ctx:t,filter:o,onCloseRequest:a,isSubMenu:n,keyboard:r,controlledActiveIndex:s}){switch(e.kind){case"list":return w.jsx(Iq,{body:e,ctx:t,filter:o,onCloseRequest:a,isSubMenu:n,keyboard:r,controlledActiveIndex:s});case"grid":return w.jsx(Dte,{body:e,ctx:t,filter:o,onCloseRequest:a});case"form":return w.jsx(Cte,{body:e,ctx:t});case"custom":return w.jsx(w.Fragment,{children:e.render(t)});case"composed":return w.jsx(ioe,{body:e,ctx:t,filter:o,onCloseRequest:a,isSubMenu:n})}}function ioe({body:e,ctx:t,filter:o,onCloseRequest:a,isSubMenu:n,keyboard:r,controlledActiveIndex:s}){let l=e;return w.jsx("div",{className:"fm-composed flex flex-col",style:{gap:l.gap??0},children:l.sections.map((c)=>{let u=c.id;if(c.kind==="list"||c.kind==="grid"||c.kind==="form"||c.kind==="custom")return w.jsx("div",{children:w.jsx(kq,{body:c,ctx:t,filter:o,onCloseRequest:a,isSubMenu:n,keyboard:r,controlledActiveIndex:s})},u);return w.jsx("div",{children:w.jsx(_te,{spec:c,ctx:t})},u)})})}function loe(e,t,o,a){let n=e.config.storage?.key??e.config.id,r=e.config.storage?.adapter??o.storage,s=()=>{if(!r)return{};try{return r.get(n)??{}}catch{return{}}},l={id:e.id,data:e.param.data,storage:{get(c){return s()[c]},set(c,u){if(!r)return;let d={...s(),[c]:u};r.set(n,d)}},open:async(c,u)=>{let d=e.config.subMenus?.[c];if(d){let m=d.getData?.(void 0,l),f={...u,data:u?.data??m,parentId:e.id};t.open(d.menuId,f);return}t.open(c,{...u,parentId:e.id})},close:()=>t.close(e.id),closeAll:(c)=>t.closeAll(c),closeChildren:()=>t.closeChildren(e.id),navigateTo:(c,u)=>t.navigateTo(e.id,c,u??{}),back:()=>t.back(e.id),canGoBack:()=>t.canGoBack(e.id),update:(c)=>t.update(e.id,c),updateData:(c)=>t.updateData(e.id,c),position:a.position,setActive:a.setActive,setHover:a.setHover,updateOther:(c,u)=>t.updateData(c,u),isOpen:(c)=>t.isOpen(c)};return l}function coe({config:e,onChange:t}){let[o,a]=P.useState(""),n=P.useRef(null),r=P.useRef(void 0);P.useEffect(()=>{if(e.focusOnMount!==!1)n.current?.focus()},[e.focusOnMount]),P.useEffect(()=>()=>window.clearTimeout(r.current),[]);let s=(l)=>{a(l),window.clearTimeout(r.current),r.current=window.setTimeout(()=>{t(l),e.onChange?.(l)},e.debounceMs??250)};return w.jsxs("div",{className:"fm-filter flex items-center gap-2 border-b border-border px-3 py-2",children:[w.jsx("span",{className:"text-muted-foreground",children:e.icon?w.jsx(Jt,{icon:e.icon,defaultSize:14}):w.jsx($c,{className:"size-3.5"})}),w.jsx("input",{ref:n,value:o,placeholder:e.placeholder??"Search…",onChange:(l)=>s(l.target.value),className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),o&&w.jsx("button",{type:"button",onClick:()=>s(""),"aria-label":"Clear",className:"text-muted-foreground hover:text-foreground",children:w.jsx(Ls,{className:"size-3.5"})})]})}function uoe(e){return e?.strategy??"fixed"}function doe(e,t){if(!t)return e;if(!e){let a={};for(let n of Object.keys(t))if(t[n]!==void 0)a[n]=t[n];return a}let o={...e};for(let a of Object.keys(t))if(t[a]!==void 0)o[a]=t[a];return o}function moe(e){let t=e?.vertical??"bottom",o=e?.horizontal??"left",a=e?.stickToElementEdge;if(a){if(a==="top"||a==="bottom"){let l=e?.horizontal==="right"?"end":e?.horizontal==="center"?"center":"start";return l==="center"?a:`${a}-${l}`}let s=e?.vertical==="bottom"?"end":e?.vertical==="center"?"center":"start";return s==="center"?a:`${a}-${s}`}let n,r;if(t==="top"||t==="bottom")n=t==="top"?"top":"bottom",r=o==="left"?"start":o==="right"?"end":"center";else n=o==="left"?"left":"right",r="center";return r==="center"?n:`${n}-${r}`}function Dq(e,t){if(typeof DOMRect<"u")return new DOMRect(e,t,0,0);return{x:e,y:t,width:0,height:0,top:t,bottom:t,left:e,right:e,toJSON(){return this}}}function foe(e,t){if(!(e?.fixedX!=null||e?.fixedY!=null))return t??null;let a=t==null?void 0:("getBoundingClientRect"in t)?t.getBoundingClientRect():t,n=e?.fixedX??a?.left??0,r=e?.fixedY??a?.top??0;return Dq(n,r)}async function of(e,t,o){let a=foe(o,e)??e,n="getBoundingClientRect"in a?a:{getBoundingClientRect:()=>a,contextElement:void 0},r=typeof o?.offsetX==="function"?o.offsetX():o?.offsetX??0,s=typeof o?.offsetY==="function"?o.offsetY():o?.offsetY??0,l=o?.border?.top??8,c=o?.border?.bottom??8,u=o?.border?.left??8,d=o?.border?.right??8,m=[sq({mainAxis:s,crossAxis:r}),!o?.noFlipX&&!o?.noFlipY?cq({fallbackStrategy:"initialPlacement",padding:{top:l,bottom:c,left:u,right:d}}):void 0,iq({padding:{top:l,bottom:c,left:u,right:d},limiter:lq({offset:16}),crossAxis:!o?.noBorderX||!o?.noBorderY}),o?.maxHeight||o?.fillViewport?uq({padding:{top:l,bottom:c},apply({availableHeight:p,elements:b}){let v=o?.maxHeight??Number.POSITIVE_INFINITY;b.floating.style.maxHeight=`${Math.min(v,p)}px`}}):void 0].filter(Boolean),f=await ef(n,t,{placement:moe(o),strategy:uoe(o),middleware:m});return{x:f.x,y:f.y,placement:f.placement}}function Tq(e,t,o,a){let n=!1,r=async()=>{let l=await of(e,t,o);if(!n)a(l)};if(o?.followAnchor===!1)return r(),()=>{n=!0};let s=t0(e,t,r);return()=>{n=!0,s()}}function poe({triggerEl:e,triggerRect:t,floatingEl:o}){let[a,n]=P.useState(null),r=P.useRef(null);if(P.useLayoutEffect(()=>{if(!t||!o)return;let s=()=>{let c=e?.getBoundingClientRect()??t,u=o.getBoundingClientRect(),d=c,m=u.left>=d.right-4,f,p,b,v,S;if(m){f=d.right,p=Math.min(d.top,u.top),b=Math.max(0,u.left-d.right),v=Math.max(d.bottom,u.bottom)-p;let h=d.top-p,g=d.bottom-p,y=u.top-p,I=u.bottom-p;S=`polygon(0 ${h}px, 0 ${g}px, 100% ${I}px, 100% ${y}px)`}else{f=u.right,p=Math.min(d.top,u.top),b=Math.max(0,d.left-u.right),v=Math.max(d.bottom,u.bottom)-p;let h=d.top-p,g=d.bottom-p,y=u.top-p,I=u.bottom-p;S=`polygon(100% ${h}px, 100% ${g}px, 0 ${I}px, 0 ${y}px)`}n({left:f,top:p,width:b,height:v,clipPath:S})};s();let l=()=>{if(r.current)cancelAnimationFrame(r.current);r.current=requestAnimationFrame(s)};return window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),()=>{if(window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0),r.current)cancelAnimationFrame(r.current)}},[e,t,o]),!a||a.width<=0||a.height<=0)return null;return w.jsx("div",{"data-fm-safe-polygon":!0,"aria-hidden":!0,style:{position:"fixed",left:a.left,top:a.top,width:a.width,height:a.height,clipPath:a.clipPath,zIndex:"var(--fm-z-menu)",pointerEvents:"auto",background:"transparent"}})}function Aq({open:e}){let t=Bq(),o=Rq(),[a,n]=P.useState(null),r=P.useCallback((E)=>n(E),[]),[s,l]=P.useState(""),[c,u]=P.useState(null),[d,m]=P.useState(e.config.chrome?.tabs?.initialTab??e.config.chrome?.tabs?.tabs?.[0]?.id),f=P.useMemo(()=>loe(e,t,o,{setActive:()=>{},setHover:()=>{},position:()=>{}}),[e,t,o]),p=P.useCallback(()=>t.close(e.id),[t,e.id]),b=P.useMemo(()=>doe(e.config.position,e.param.position),[e.config.position,e.param.position]),v=e.param.element,S=e.param.rect;P.useEffect(()=>{let E=a;if(!E)return;let j=v??S,de=b?.fixedX!=null||b?.fixedY!=null;if(!j&&!de){let{offsetWidth:Ye,offsetHeight:eo}=E;u({x:Math.max(8,(window.innerWidth-Ye)/2),y:Math.max(8,(window.innerHeight-eo)/2)});return}let fe=typeof j==="string"?document.querySelector(j):j;if(!fe&&de){let Ye=!1;return of(Dq(b?.fixedX??0,b?.fixedY??0),E,b).then((eo)=>{if(Ye)return;u({x:eo.x,y:eo.y,placement:eo.placement})}),()=>{Ye=!0}}if(!fe)return;if(fe instanceof Element)return Tq(fe,E,b,(Ye)=>u({x:Ye.x,y:Ye.y,placement:Ye.placement}));let pe=!1;return of(fe,E,b).then((Ye)=>{if(pe)return;u({x:Ye.x,y:Ye.y,placement:Ye.placement})}),()=>{pe=!0}},[a,b,v,S]),P.useEffect(()=>{let E=e.config.lifecycle?.onMount?.(f);e.config.lifecycle?.onOpen?.(f);let j=e.param.parentId;return()=>{if(typeof E==="function")E();if(e.config.lifecycle?.onClose?.(f),j)document.querySelector(`[data-fm-menu-id="${j}"] .fm-list`)?.focus({preventScroll:!0})}},[]),P.useEffect(()=>{if(e.config.chrome?.noClose)return;if(e.state==="closing")return;let E=(j)=>{if(j.key==="Escape")p()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[e.config.chrome?.noClose,e.state,p]);let h=e.config.chrome?.dimmer??(e.param.parentId?"none":"default"),g=h!=="none",y=h==="passThrough",I=h==="visible",k=e.config.chrome?.tabs,D=(k?k.tabs.find((E)=>E.id===d)?.body:void 0)??e.config.body,M=Boolean(e.param.parentId),A=w.jsxs(w.Fragment,{children:[M&&e.param.triggerRect&&w.jsx(poe,{triggerEl:e.param.element instanceof Element?e.param.element:void 0,triggerRect:e.param.triggerRect,floatingEl:a}),g&&w.jsx("div",{"aria-hidden":!0,"data-state":e.state,onClick:y?void 0:p,className:Re("fm-dimmer",e.state==="closing"&&"fm-dimmer--closing",y&&"fm-dimmer--passthrough",I&&"fm-dimmer--visible")}),w.jsxs("div",{ref:r,role:e.config.chrome?.role??"dialog","aria-label":hoe(e),"data-fm-menu-id":e.id,"data-placement":c?.placement,"data-state":e.state,className:Re("fm-menu",e.state==="closing"&&"fm-menu--closing",e.config.chrome?.classNameWrap,e.config.chrome?.className),style:{position:b?.strategy==="absolute"?"absolute":"fixed",left:c?.x,top:c?.y,width:b?.width,minWidth:b?.minWidth??220,opacity:c==null?0:1,pointerEvents:c==null?"none":"auto",...boe(c?.placement)},children:[w.jsx(voe,{open:e,onClose:p,filter:s,setFilter:l,onBack:()=>t.back(e.id),canBack:Boolean(e.history?.length),ctx:f}),k&&w.jsx(yoe,{tabs:k.tabs.map((E)=>({id:E.id,label:E.label,icon:E.icon})),activeId:d,onChange:m,rightSlot:typeof k.rightSlot==="function"?k.rightSlot():k.rightSlot}),e.config.chrome?.filter&&w.jsx(coe,{config:e.config.chrome.filter,onChange:l}),!goe(D,f)&&w.jsx("div",{className:"fm-body",children:w.jsx(kq,{body:D,ctx:f,filter:s,onCloseRequest:p,isSubMenu:Boolean(e.param.parentId),keyboard:e.config.keyboard,controlledActiveIndex:e.param.activeIndex})}),w.jsx(woe,{open:e,onClose:p})]})]});return n0.createPortal(A,document.body)}function hoe(e){if(e.param.ariaLabel!=null)return e.param.ariaLabel;let t=e.config.chrome?.title;if(typeof t==="string")return t;return e.config.chrome?.ariaLabel}function goe(e,t){if(e.kind!=="custom")return!1;let o=e.measureHeight;return typeof o==="function"&&o(t)===0}function boe(e){if(!e)return{};let[t,o]=e.split("-"),a,n;if(t==="top"||t==="bottom")n=t==="top"?"bottom":"top",a=o==="start"?"left":o==="end"?"right":"center";else a=t==="left"?"right":"left",n=o==="start"?"top":o==="end"?"bottom":"center";return{transformOrigin:`${a} ${n}`}}function voe({open:e,onClose:t,filter:o,setFilter:a,onBack:n,canBack:r,ctx:s}){let l=e.config.chrome,c=l?.header;if(c?.kind==="searchBar")return w.jsx(Soe,{spec:c,value:o,onChange:a,onClose:t});if(c?.kind==="custom")return w.jsx(w.Fragment,{children:c.render(s)});let u=l?.withBack||r;if(l?.title||u||l?.withClose)return w.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u&&w.jsx("button",{type:"button",onClick:l?.onBack??n,className:"text-muted-foreground hover:text-foreground","aria-label":"Back",children:w.jsx(ib,{className:"size-4"})}),w.jsx("h3",{className:"flex-1 text-sm font-medium",children:typeof l?.title==="function"?l.title(s):l?.title}),l?.withClose&&w.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground hover:text-foreground","aria-label":"Close",children:w.jsx(Ls,{className:"size-4"})})]});return null}function Soe({spec:e,value:t,onChange:o,onClose:a}){return w.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[w.jsx($c,{className:"size-3.5 text-muted-foreground"}),w.jsx("input",{value:t,onChange:(n)=>o(n.target.value),placeholder:e.placeholder??"Find",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e.counter&&w.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:"0 / 0"}),e.prevNext&&w.jsxs("div",{className:"flex items-center gap-0.5",children:[w.jsx("button",{type:"button","aria-label":"Previous",className:"rounded-md p-1 text-muted-foreground hover:bg-accent",children:w.jsx(cb,{className:"size-3"})}),w.jsx("button",{type:"button","aria-label":"Next",className:"rounded-md p-1 text-muted-foreground hover:bg-accent",children:w.jsx(rb,{className:"size-3"})})]}),w.jsx("button",{type:"button","aria-label":t?"Clear":"Close",onClick:()=>t?o(""):a(),className:"text-muted-foreground hover:text-foreground",children:w.jsx(Ls,{className:"size-3.5"})})]})}function yoe({tabs:e,activeId:t,onChange:o,rightSlot:a}){return w.jsxs("div",{className:"flex items-center justify-between border-b border-border px-1 pt-1",children:[w.jsx("div",{className:"flex items-center gap-0.5",role:"tablist",children:e.map((n)=>{let r=n.id===t;return w.jsx("button",{type:"button",role:"tab","aria-selected":r,onClick:()=>o(n.id),className:Re("inline-flex items-center gap-1 rounded-t-md px-2 py-1 text-xs font-medium",r?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"),children:n.label},n.id)})}),a]})}function woe({open:e,onClose:t}){let o=e.config.chrome?.footer;if(!o)return null;if(o.kind==="buttons")return w.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-border px-2 py-2",children:o.buttons.map((a)=>w.jsx("button",{type:"button",disabled:a.disabled,onClick:(n)=>{if(a.onClick(n),a.id==="done"||a.id==="close")t()},className:Re("inline-flex h-7 items-center rounded-md px-2.5 text-xs font-medium",a.color==="destructive"?"bg-destructive text-destructive-foreground":a.color==="accent"?"bg-primary text-primary-foreground":"border border-border text-foreground hover:bg-accent"),children:a.label},a.id))});if(o.kind==="add")return w.jsx("footer",{className:"border-t border-border",children:w.jsx("button",{type:"button",onClick:o.onClick,className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:bg-accent",children:o.label})});if(o.kind==="custom")return w.jsx("footer",{className:"border-t border-border",children:o.render()});return null}function Eq(){let e=l0();return w.jsx(w.Fragment,{children:e.map((t)=>w.jsx(Aq,{open:t},t.id))})}var Oq=class{constructor(e="fm:"){this.prefix=e}prefix;get(e){if(typeof localStorage>"u")return;try{let t=localStorage.getItem(this.prefix+e);return t==null?void 0:JSON.parse(t)}catch{return}}set(e,t){if(typeof localStorage>"u")return;try{localStorage.setItem(this.prefix+e,JSON.stringify(t))}catch{}}remove(e){if(typeof localStorage>"u")return;try{localStorage.removeItem(this.prefix+e)}catch{}}};var a0=120,Ioe=90,Nq=class{menus=[];listeners=new Set;registry=new Map;timers=new Map;register(e){this.registry.set(e.id,e)}registerMany(e){for(let t of e)this.register(t)}getConfig(e){return this.registry.get(e)}getAll(){return this.menus}getState(e){return this.menus.find((t)=>t.id===e)?.state??"closed"}isAnyTransitioning(){return this.menus.some((e)=>e.state!=="open")}isOpen(e){if(e==null)return this.menus.some((t)=>t.state!=="closing");return this.menus.some((t)=>t.id===e&&t.state!=="closing")}open(e,t={}){let o=this.registry.get(e);if(!o){console.warn(`[fancy-menus] No menu registered with id "${e}"`);return}let a=this.timers.get(`close:${e}`);if(a)window.clearTimeout(a),this.timers.delete(`close:${e}`);let n=this.menus.findIndex((l)=>l.id===e);if(n>=0){let l=this.menus[n],c={...l.param,...t};if((t.parentId??l.param.parentId)===l.param.parentId){let d=this.menus.slice();d[n]={...l,param:c,state:l.state==="closing"?"open":l.state},this.menus=d,this.emit();return}this.menus=this.menus.filter((d)=>d.id!==e)}let r=this.menus;if(t.parentId){let l=new Set;for(let c of r)if(c.param.parentId===t.parentId&&c.id!==e)l.add(c.id);if(l.size){let c=!0;while(c){c=!1;for(let u of r)if(u.param.parentId&&l.has(u.param.parentId)&&!l.has(u.id))l.add(u.id),c=!0}r=r.filter((u)=>!l.has(u.id));for(let u of l){let d=this.timers.get(`close:${u}`);if(d)window.clearTimeout(d),this.timers.delete(`close:${u}`)}}}this.menus=[...r,{id:e,config:o,param:t,depth:t.parentId?(r.find((l)=>l.id===t.parentId)?.depth??0)+1:r.length,state:"opening"}],this.emit();let s=window.setTimeout(()=>{this.timers.delete(`open:${e}`);let l=this.menus.findIndex((u)=>u.id===e);if(l<0)return;if(this.menus[l].state!=="opening")return;let c=this.menus.slice();c[l]={...c[l],state:"open"},this.menus=c,this.emit()},a0);this.timers.set(`open:${e}`,s)}close(e){let t=e??this.menus.at(-1)?.id;if(!t)return;let o=new Set([t]),a=!0;while(a){a=!1;for(let s of this.menus)if(s.param.parentId&&o.has(s.param.parentId)&&!o.has(s.id))o.add(s.id),a=!0}let n=this.menus.slice(),r=!1;for(let s=0;s<n.length;s++){if(!o.has(n[s].id))continue;if(n[s].state==="closing")continue;n[s]={...n[s],state:"closing"},r=!0;let l=n[s].id,c=this.timers.get(`open:${l}`);if(c)window.clearTimeout(c),this.timers.delete(`open:${l}`);let u=window.setTimeout(()=>{this.timers.delete(`close:${l}`),this.menus=this.menus.filter((d)=>d.id!==l),this.emit()},Ioe);this.timers.set(`close:${l}`,u)}if(!r)return;this.menus=n,this.emit()}closeChildren(e){let t=new Set,o=!0;while(o){o=!1;for(let a of this.menus){let n=a.param.parentId===e,r=a.param.parentId&&t.has(a.param.parentId);if((n||r)&&!t.has(a.id))t.add(a.id),o=!0}}if(t.size===0)return;for(let a of t)this.close(a)}closeAll(e){let t=e==null?this.menus.map((o)=>o.id):this.menus.filter((o)=>o.config.group===e).map((o)=>o.id);for(let o of t)this.close(o)}navigateTo(e,t,o={}){let a=this.menus.findIndex((d)=>d.id===e);if(a<0)return;let n=this.registry.get(t);if(!n){console.warn(`[fancy-menus] No menu registered with id "${t}"`);return}let r=this.menus[a],s=[...r.history??[],{id:r.id,config:r.config,param:r.param}],l=this.menus.slice();l[a]={id:t,config:n,param:{...r.param,...o,parentId:r.param.parentId},depth:r.depth,state:"opening",history:s},this.menus=l,this.emit();let c=this.timers.get(`open:${t}`);if(c)window.clearTimeout(c);let u=window.setTimeout(()=>{this.timers.delete(`open:${t}`);let d=this.menus.findIndex((f)=>f.id===t);if(d<0)return;if(this.menus[d].state!=="opening")return;let m=this.menus.slice();m[d]={...m[d],state:"open"},this.menus=m,this.emit()},a0);this.timers.set(`open:${t}`,u)}canGoBack(e){let t=this.menus.find((o)=>o.id===e);return Boolean(t?.history&&t.history.length>0)}back(e){let t=this.menus.findIndex((u)=>u.id===e);if(t<0)return;let o=this.menus[t],a=o.history??[];if(a.length===0)return;let n=a[a.length-1],r=a.slice(0,-1),s=this.menus.slice();s[t]={id:n.id,config:n.config,param:n.param,depth:o.depth,state:"opening",history:r.length?r:void 0},this.menus=s,this.emit();let l=this.timers.get(`open:${n.id}`);if(l)window.clearTimeout(l);let c=window.setTimeout(()=>{this.timers.delete(`open:${n.id}`);let u=this.menus.findIndex((m)=>m.id===n.id);if(u<0)return;if(this.menus[u].state!=="opening")return;let d=this.menus.slice();d[u]={...d[u],state:"open"},this.menus=d,this.emit()},a0);this.timers.set(`open:${n.id}`,c)}update(e,t){let o=this.menus.findIndex((n)=>n.id===e);if(o<0)return;let a=this.menus.slice();a[o]={...a[o],param:{...a[o].param,...t}},this.menus=a,this.emit()}updateData(e,t){let o=this.menus.findIndex((r)=>r.id===e);if(o<0)return;let a=this.menus.slice(),n=a[o];a[o]={...n,param:{...n.param,data:{...n.param.data??{},...t}}},this.menus=a,this.emit()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){for(let e of this.timers.values())window.clearTimeout(e);this.timers.clear(),this.listeners.clear()}emit(){for(let e of this.listeners)e()}},Lq=P.createContext(null);function s0({menus:e,options:t,store:o,children:a}){let n=P.useRef(null);if(n.current==null)n.current=o??new Nq;let r=n.current;P.useEffect(()=>{if(e?.length)r.registerMany([...e])},[e,r]);let s=P.useMemo(()=>({storage:t?.storage??new Oq,...t}),[t]),l=P.useMemo(()=>({store:r,options:s}),[r,s]);return w.jsxs(Lq.Provider,{value:l,children:[a,w.jsx(Eq,{})]})}function af(){let e=P.useContext(Lq);if(!e)throw Error("useMenu / useMenuStore must be used inside <MenuProvider>");return e}function i0(){let{store:e}=af();return P.useMemo(()=>({open:(t,o)=>e.open(t,o??{}),close:(t)=>e.close(t),closeAll:(t)=>e.closeAll(t),update:(t,o)=>e.update(t,o),updateData:(t,o)=>e.updateData(t,o),isOpen:(t)=>e.isOpen(t),register:(t)=>e.register(t)}),[e])}function l0(){let{store:e}=af();return P.useSyncExternalStore((t)=>e.subscribe(t),()=>e.getAll(),()=>e.getAll())}function c0(){let e=l0();for(let t of e)if(t.state!=="closing")return!0;return!1}function Rq(){return af().options}function Bq(){return af().store}var nf=((e)=>(e.Menu="menu",e.Tooltip="tooltip",e.Context="context",e.Inline="inline",e))(nf||{});var rf=((e)=>(e.List="list",e.Grid="grid",e.Form="form",e.Custom="custom",e.Composed="composed",e))(rf||{});var cl=((e)=>(e.Item="item",e.Section="section",e.Divider="divider",e.Switch="switch",e.Checkbox="checkbox",e.SelectNav="selectNav",e.Color="color",e.Object="object",e.Add="add",e.Sortable="sortable",e.Chip="chip",e.FilterRule="filterRule",e.Participant="participant",e.Empty="empty",e.Custom="custom",e))(cl||{});var sf=((e)=>(e.Static="static",e.Prop="prop",e.Store="store",e.Async="async",e.Sections="sections",e.Composite="composite",e))(sf||{});var lf=((e)=>(e.ArrowHover="arrowHover",e.ArrowClick="arrowClick",e.MoreIcon="moreIcon",e.RightClick="rightClick",e.LongPress="longPress",e.Replace="replace",e.Programmatic="programmatic",e))(lf||{});var au=x(R(),1),Hq=x(Jh(),1),ou=x(T(),1),xoe={},Coe=(e)=>xoe[e]??=()=>ou.jsx("span",{className:"fm-ico",dangerouslySetInnerHTML:{__html:window.icon?.(e,16)??""}}),Moe=(e)=>e?Coe(e):void 0,koe=(e)=>[{kind:cl.Section,match:(t)=>!!t.section,name:(t)=>t.section},{kind:cl.Divider,match:(t)=>!!t.divider},{kind:cl.Item,name:(t)=>t.label,caption:(t)=>t.caption,icon:(t)=>{let o=Moe(t.icon);return o?{icon:o,size:16,...t.danger?{color:"var(--bad)"}:{}}:void 0},pressed:(t)=>!!t.pressed,disabled:(t)=>!!t.disabled,arrow:(t)=>!!t.children?.length,className:(t)=>t.danger?"fm-row--danger":void 0,subMenuId:(t)=>t.children?.length?`swarm-actions-${e+1}`:void 0,subMenuTrigger:lf.ArrowClick,subMenuData:(t)=>({items:t.children??[]}),onClick:async(t,o,a)=>{if(t.children?.length)return;if(await t.run?.(),!a.data.stay)a.closeAll("swarm")}}],Doe=[0,1,2].map((e)=>ab({id:`swarm-actions-${e}`,kind:nf.Menu,group:"swarm",position:{minWidth:260,maxWidth:420},chrome:{role:"menu"},body:{kind:rf.List,source:{kind:sf.Prop,getItems:(t)=>t?.items??[]},rows:koe(e)},keyboard:{defaults:{closeOnEscape:!0,selectOnEnter:!0,arrowsToSubmenu:!0}}}));function Toe(){let e=i0(),t=c0();return au.useEffect(()=>{window.dispatchEvent(new CustomEvent("menus:openchange",{detail:{open:t}}))},[t]),au.useEffect(()=>{let o=(a,n)=>{e.closeAll("swarm");let s={rect:a instanceof Element?a.getBoundingClientRect():new DOMRect(a.x,a.y,0,0),data:n};e.open("swarm-actions-0",s)};window.menus={open:o,close:()=>e.closeAll("swarm"),isOpen:()=>e.isOpen()},window.dispatchEvent(new Event("menus:ready"))},[e]),null}var u0=document.createElement("div");u0.id="menus-root";document.body.appendChild(u0);Hq.createRoot(u0).render(ou.jsx(au.StrictMode,{children:ou.jsx(s0,{menus:Doe,children:ou.jsx(Toe,{})})}));var d0=x(T(),1);sC();var Uq=document.getElementById("root");if(!Uq)throw Error("dashboard: #root is missing from index.html");zq.createRoot(Uq).render(d0.jsx(Pq.StrictMode,{children:d0.jsx(OM,{})}));})();