(function(){const g=document.createElement("link").relList;if(g&&g.supports&&g.supports("modulepreload"))return;for(const O of document.querySelectorAll('link[rel="modulepreload"]'))f(O);new MutationObserver(O=>{for(const D of O)if(D.type==="childList")for(const x of D.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&f(x)}).observe(document,{childList:!0,subtree:!0});function j(O){const D={};return O.integrity&&(D.integrity=O.integrity),O.referrerPolicy&&(D.referrerPolicy=O.referrerPolicy),O.crossOrigin==="use-credentials"?D.credentials="include":O.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function f(O){if(O.ep)return;O.ep=!0;const D=j(O);fetch(O.href,D)}})();var ys={exports:{}},Cn={};var zr;function oy(){if(zr)return Cn;zr=1;var o=Symbol.for("react.transitional.element"),g=Symbol.for("react.fragment");function j(f,O,D){var x=null;if(D!==void 0&&(x=""+D),O.key!==void 0&&(x=""+O.key),"key"in O){D={};for(var L in O)L!=="key"&&(D[L]=O[L])}else D=O;return O=D.ref,{$$typeof:o,type:f,key:x,ref:O!==void 0?O:null,props:D}}return Cn.Fragment=g,Cn.jsx=j,Cn.jsxs=j,Cn}var Nr;function dy(){return Nr||(Nr=1,ys.exports=oy()),ys.exports}var c=dy(),vs={exports:{}},F={};var Ar;function ry(){if(Ar)return F;Ar=1;var o=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),x=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),C=Symbol.iterator;function I(h){return h===null||typeof h!="object"?null:(h=C&&h[C]||h["@@iterator"],typeof h=="function"?h:null)}var Q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ct=Object.assign,Dt={};function bt(h,A,B){this.props=h,this.context=A,this.refs=Dt,this.updater=B||Q}bt.prototype.isReactComponent={},bt.prototype.setState=function(h,A){if(typeof h!="object"&&typeof h!="function"&&h!=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,h,A,"setState")},bt.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function _t(){}_t.prototype=bt.prototype;function ht(h,A,B){this.props=h,this.context=A,this.refs=Dt,this.updater=B||Q}var at=ht.prototype=new _t;at.constructor=ht,ct(at,bt.prototype),at.isPureReactComponent=!0;var St=Array.isArray;function At(){}var H={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function Y(h,A,B){var G=B.ref;return{$$typeof:o,type:h,key:A,ref:G!==void 0?G:null,props:B}}function P(h,A){return Y(h.type,A,h.props)}function mt(h){return typeof h=="object"&&h!==null&&h.$$typeof===o}function st(h){var A={"=":"=0",":":"=2"};return"$"+h.replace(/[=:]/g,function(B){return A[B]})}var $t=/\/+/g;function il(h,A){return typeof h=="object"&&h!==null&&h.key!=null?st(""+h.key):A.toString(36)}function ll(h){switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:switch(typeof h.status=="string"?h.then(At,At):(h.status="pending",h.then(function(A){h.status==="pending"&&(h.status="fulfilled",h.value=A)},function(A){h.status==="pending"&&(h.status="rejected",h.reason=A)})),h.status){case"fulfilled":return h.value;case"rejected":throw h.reason}}throw h}function T(h,A,B,G,$){var tt=typeof h;(tt==="undefined"||tt==="boolean")&&(h=null);var yt=!1;if(h===null)yt=!0;else switch(tt){case"bigint":case"string":case"number":yt=!0;break;case"object":switch(h.$$typeof){case o:case g:yt=!0;break;case V:return yt=h._init,T(yt(h._payload),A,B,G,$)}}if(yt)return $=$(h),yt=G===""?"."+il(h,0):G,St($)?(B="",yt!=null&&(B=yt.replace($t,"$&/")+"/"),T($,A,B,"",function(se){return se})):$!=null&&(mt($)&&($=P($,B+($.key==null||h&&h.key===$.key?"":(""+$.key).replace($t,"$&/")+"/")+yt)),A.push($)),1;yt=0;var Kt=G===""?".":G+":";if(St(h))for(var Ut=0;Ut>>1,nt=T[J];if(0>>1;JO(B,M))GO($,B)?(T[J]=$,T[G]=M,J=G):(T[J]=B,T[A]=M,J=A);else if(GO($,M))T[J]=$,T[G]=M,J=G;else break t}}return R}function O(T,R){var M=T.sortIndex-R.sortIndex;return M!==0?M:T.id-R.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var D=performance;o.unstable_now=function(){return D.now()}}else{var x=Date,L=x.now();o.unstable_now=function(){return x.now()-L}}var U=[],p=[],V=1,E=null,C=3,I=!1,Q=!1,ct=!1,Dt=!1,bt=typeof setTimeout=="function"?setTimeout:null,_t=typeof clearTimeout=="function"?clearTimeout:null,ht=typeof setImmediate<"u"?setImmediate:null;function at(T){for(var R=j(p);R!==null;){if(R.callback===null)f(p);else if(R.startTime<=T)f(p),R.sortIndex=R.expirationTime,g(U,R);else break;R=j(p)}}function St(T){if(ct=!1,at(T),!Q)if(j(U)!==null)Q=!0,At||(At=!0,st());else{var R=j(p);R!==null&&ll(St,R.startTime-T)}}var At=!1,H=-1,K=5,Y=-1;function P(){return Dt?!0:!(o.unstable_now()-YT&&P());){var J=E.callback;if(typeof J=="function"){E.callback=null,C=E.priorityLevel;var nt=J(E.expirationTime<=T);if(T=o.unstable_now(),typeof nt=="function"){E.callback=nt,at(T),R=!0;break l}E===j(U)&&f(U),at(T)}else f(U);E=j(U)}if(E!==null)R=!0;else{var h=j(p);h!==null&&ll(St,h.startTime-T),R=!1}}break t}finally{E=null,C=M,I=!1}R=void 0}}finally{R?st():At=!1}}}var st;if(typeof ht=="function")st=function(){ht(mt)};else if(typeof MessageChannel<"u"){var $t=new MessageChannel,il=$t.port2;$t.port1.onmessage=mt,st=function(){il.postMessage(null)}}else st=function(){bt(mt,0)};function ll(T,R){H=bt(function(){T(o.unstable_now())},R)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(T){T.callback=null},o.unstable_forceFrameRate=function(T){0>T||125J?(T.sortIndex=M,g(p,T),j(U)===null&&T===j(p)&&(ct?(_t(H),H=-1):ct=!0,ll(St,M-J))):(T.sortIndex=nt,g(U,T),Q||I||(Q=!0,At||(At=!0,st()))),T},o.unstable_shouldYield=P,o.unstable_wrapCallback=function(T){var R=C;return function(){var M=C;C=R;try{return T.apply(this,arguments)}finally{C=M}}}})(ps)),ps}var Mr;function my(){return Mr||(Mr=1,bs.exports=hy()),bs.exports}var Ss={exports:{}},al={};var Dr;function yy(){if(Dr)return al;Dr=1;var o=js();function g(U){var p="https://react.dev/errors/"+U;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(g){console.error(g)}}return o(),Ss.exports=yy(),Ss.exports}var Ur;function gy(){if(Ur)return Un;Ur=1;var o=my(),g=js(),j=vy();function f(t){var l="https://react.dev/errors/"+t;if(1nt||(t.current=J[nt],J[nt]=null,nt--)}function B(t,l){nt++,J[nt]=t.current,t.current=l}var G=h(null),$=h(null),tt=h(null),yt=h(null);function Kt(t,l){switch(B(tt,l),B($,t),B(G,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?Jd(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=Jd(l),t=$d(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}A(G),B(G,t)}function Ut(){A(G),A($),A(tt)}function se(t){t.memoizedState!==null&&B(yt,t);var l=G.current,e=$d(l,t.type);l!==e&&(B($,t),B(G,e))}function Pe(t){$.current===t&&(A(G),A($)),yt.current===t&&(A(yt),_n._currentValue=M)}var W,el;function zl(t){if(W===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);W=l&&l[1]||"",el=-1)":-1n||d[a]!==v[n]){var z=` `+d[a].replace(" at new "," at ");return t.displayName&&z.includes("")&&(z=z.replace("",t.displayName)),z}while(1<=a&&0<=n);break}}}finally{He=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?zl(e):""}function Qr(t,l){switch(t.tag){case 26:case 27:case 5:return zl(t.type);case 16:return zl("Lazy");case 13:return t.child!==l&&l!==null?zl("Suspense Fallback"):zl("Suspense");case 19:return zl("SuspenseList");case 0:case 15:return Pu(t.type,!1);case 11:return Pu(t.type.render,!1);case 1:return Pu(t.type,!0);case 31:return zl("Activity");default:return""}}function Es(t){try{var l="",e=null;do l+=Qr(t,e),e=t,t=t.return;while(t);return l}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var ti=Object.prototype.hasOwnProperty,li=o.unstable_scheduleCallback,ei=o.unstable_cancelCallback,Zr=o.unstable_shouldYield,Lr=o.unstable_requestPaint,yl=o.unstable_now,Vr=o.unstable_getCurrentPriorityLevel,Ts=o.unstable_ImmediatePriority,zs=o.unstable_UserBlockingPriority,Rn=o.unstable_NormalPriority,Kr=o.unstable_LowPriority,Ns=o.unstable_IdlePriority,wr=o.log,kr=o.unstable_setDisableYieldValue,Ga=null,vl=null;function fe(t){if(typeof wr=="function"&&kr(t),vl&&typeof vl.setStrictMode=="function")try{vl.setStrictMode(Ga,t)}catch{}}var gl=Math.clz32?Math.clz32:Wr,Jr=Math.log,$r=Math.LN2;function Wr(t){return t>>>=0,t===0?32:31-(Jr(t)/$r|0)|0}var qn=256,Bn=262144,Yn=4194304;function Re(t){var l=t&42;if(l!==0)return l;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Gn(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=a&134217727;return s!==0?(a=s&~u,a!==0?n=Re(a):(i&=s,i!==0?n=Re(i):e||(e=s&~t,e!==0&&(n=Re(e))))):(s=a&~u,s!==0?n=Re(s):i!==0?n=Re(i):e||(e=a&~t,e!==0&&(n=Re(e)))),n===0?0:l!==0&&l!==n&&(l&u)===0&&(u=n&-n,e=l&-l,u>=e||u===32&&(e&4194048)!==0)?l:n}function Xa(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function Fr(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+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 l+5e3;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 As(){var t=Yn;return Yn<<=1,(Yn&62914560)===0&&(Yn=4194304),t}function ai(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Qa(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ir(t,l,e,a,n,u){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var s=t.entanglements,d=t.expirationTimes,v=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var nh=/[\n"\\]/g;function Al(t){return t.replace(nh,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function fi(t,l,e,a,n,u,i,s){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Nl(l)):t.value!==""+Nl(l)&&(t.value=""+Nl(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?oi(t,i,Nl(l)):e!=null?oi(t,i,Nl(e)):a!=null&&t.removeAttribute("value"),n==null&&u!=null&&(t.defaultChecked=!!u),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Nl(s):t.removeAttribute("name")}function Xs(t,l,e,a,n,u,i,s){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),l!=null||e!=null){if(!(u!=="submit"&&u!=="reset"||l!=null)){si(t);return}e=e!=null?""+Nl(e):"",l=l!=null?""+Nl(l):e,s||l===t.value||(t.value=l),t.defaultValue=l}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=s?t.checked:!!a,t.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),si(t)}function oi(t,l,e){l==="number"&&Zn(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function ua(t,l,e,a){if(t=t.options,l){l={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yi=!1;if(Kl)try{var Ka={};Object.defineProperty(Ka,"passive",{get:function(){yi=!0}}),window.addEventListener("test",Ka,Ka),window.removeEventListener("test",Ka,Ka)}catch{yi=!1}var de=null,vi=null,Vn=null;function ks(){if(Vn)return Vn;var t,l=vi,e=l.length,a,n="value"in de?de.value:de.textContent,u=n.length;for(t=0;t=Ja),Ps=" ",tf=!1;function lf(t,l){switch(t){case"keyup":return Ch.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ef(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fa=!1;function Hh(t,l){switch(t){case"compositionend":return ef(l);case"keypress":return l.which!==32?null:(tf=!0,Ps);case"textInput":return t=l.data,t===Ps&&tf?null:t;default:return null}}function Rh(t,l){if(fa)return t==="compositionend"||!xi&&lf(t,l)?(t=ks(),Vn=vi=de=null,fa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=df(e)}}function hf(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?hf(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function mf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Zn(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Zn(t.document)}return l}function Ti(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var Lh=Kl&&"documentMode"in document&&11>=document.documentMode,oa=null,zi=null,Ia=null,Ni=!1;function yf(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Ni||oa==null||oa!==Zn(a)||(a=oa,"selectionStart"in a&&Ti(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}),Ia&&Fa(Ia,a)||(Ia=a,a=Bu(zi,"onSelect"),0>=i,n-=i,Gl=1<<32-gl(l)+n|e<et?(ot=Z,Z=null):ot=Z.sibling;var gt=b(m,Z,y[et],N);if(gt===null){Z===null&&(Z=ot);break}t&&Z&>.alternate===null&&l(m,Z),r=u(gt,r,et),vt===null?w=gt:vt.sibling=gt,vt=gt,Z=ot}if(et===y.length)return e(m,Z),dt&&kl(m,et),w;if(Z===null){for(;etet?(ot=Z,Z=null):ot=Z.sibling;var Ue=b(m,Z,gt.value,N);if(Ue===null){Z===null&&(Z=ot);break}t&&Z&&Ue.alternate===null&&l(m,Z),r=u(Ue,r,et),vt===null?w=Ue:vt.sibling=Ue,vt=Ue,Z=ot}if(gt.done)return e(m,Z),dt&&kl(m,et),w;if(Z===null){for(;!gt.done;et++,gt=y.next())gt=_(m,gt.value,N),gt!==null&&(r=u(gt,r,et),vt===null?w=gt:vt.sibling=gt,vt=gt);return dt&&kl(m,et),w}for(Z=a(Z);!gt.done;et++,gt=y.next())gt=S(Z,m,et,gt.value,N),gt!==null&&(t&>.alternate!==null&&Z.delete(gt.key===null?et:gt.key),r=u(gt,r,et),vt===null?w=gt:vt.sibling=gt,vt=gt);return t&&Z.forEach(function(fy){return l(m,fy)}),dt&&kl(m,et),w}function zt(m,r,y,N){if(typeof y=="object"&&y!==null&&y.type===ct&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case I:t:{for(var w=y.key;r!==null;){if(r.key===w){if(w=y.type,w===ct){if(r.tag===7){e(m,r.sibling),N=n(r,y.props.children),N.return=m,m=N;break t}}else if(r.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===K&&we(w)===r.type){e(m,r.sibling),N=n(r,y.props),nn(N,y),N.return=m,m=N;break t}e(m,r);break}else l(m,r);r=r.sibling}y.type===ct?(N=Qe(y.props.children,m.mode,N,y.key),N.return=m,m=N):(N=tu(y.type,y.key,y.props,null,m.mode,N),nn(N,y),N.return=m,m=N)}return i(m);case Q:t:{for(w=y.key;r!==null;){if(r.key===w)if(r.tag===4&&r.stateNode.containerInfo===y.containerInfo&&r.stateNode.implementation===y.implementation){e(m,r.sibling),N=n(r,y.children||[]),N.return=m,m=N;break t}else{e(m,r);break}else l(m,r);r=r.sibling}N=Ui(y,m.mode,N),N.return=m,m=N}return i(m);case K:return y=we(y),zt(m,r,y,N)}if(ll(y))return X(m,r,y,N);if(st(y)){if(w=st(y),typeof w!="function")throw Error(f(150));return y=w.call(y),k(m,r,y,N)}if(typeof y.then=="function")return zt(m,r,cu(y),N);if(y.$$typeof===ht)return zt(m,r,au(m,y),N);su(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,r!==null&&r.tag===6?(e(m,r.sibling),N=n(r,y),N.return=m,m=N):(e(m,r),N=Ci(y,m.mode,N),N.return=m,m=N),i(m)):e(m,r)}return function(m,r,y,N){try{an=0;var w=zt(m,r,y,N);return xa=null,w}catch(Z){if(Z===Sa||Z===uu)throw Z;var vt=pl(29,Z,null,m.mode);return vt.lanes=N,vt.return=m,vt}}}var Je=Yf(!0),Gf=Yf(!1),ve=!1;function Ki(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wi(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ge(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function be(t,l,e){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(pt&2)!==0){var n=a.pending;return n===null?l.next=l:(l.next=n.next,n.next=l),a.pending=l,l=Pn(t),jf(t,null,e),l}return In(t,a,l,e),Pn(t)}function un(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Os(t,e)}}function ki(t,l){var e=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var n=null,u=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};u===null?n=u=i:u=u.next=i,e=e.next}while(e!==null);u===null?n=u=l:u=u.next=l}else n=u=l;e={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var Ji=!1;function cn(){if(Ji){var t=pa;if(t!==null)throw t}}function sn(t,l,e,a){Ji=!1;var n=t.updateQueue;ve=!1;var u=n.firstBaseUpdate,i=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var d=s,v=d.next;d.next=null,i===null?u=v:i.next=v,i=d;var z=t.alternate;z!==null&&(z=z.updateQueue,s=z.lastBaseUpdate,s!==i&&(s===null?z.firstBaseUpdate=v:s.next=v,z.lastBaseUpdate=d))}if(u!==null){var _=n.baseState;i=0,z=v=d=null,s=u;do{var b=s.lane&-536870913,S=b!==s.lane;if(S?(ft&b)===b:(a&b)===b){b!==0&&b===ba&&(Ji=!0),z!==null&&(z=z.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});t:{var X=t,k=s;b=l;var zt=e;switch(k.tag){case 1:if(X=k.payload,typeof X=="function"){_=X.call(zt,_,b);break t}_=X;break t;case 3:X.flags=X.flags&-65537|128;case 0:if(X=k.payload,b=typeof X=="function"?X.call(zt,_,b):X,b==null)break t;_=E({},_,b);break t;case 2:ve=!0}}b=s.callback,b!==null&&(t.flags|=64,S&&(t.flags|=8192),S=n.callbacks,S===null?n.callbacks=[b]:S.push(b))}else S={lane:b,tag:s.tag,payload:s.payload,callback:s.callback,next:null},z===null?(v=z=S,d=_):z=z.next=S,i|=b;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;S=s,s=S.next,S.next=null,n.lastBaseUpdate=S,n.shared.pending=null}}while(!0);z===null&&(d=_),n.baseState=d,n.firstBaseUpdate=v,n.lastBaseUpdate=z,u===null&&(n.shared.lanes=0),Ee|=i,t.lanes=i,t.memoizedState=_}}function Xf(t,l){if(typeof t!="function")throw Error(f(191,t));t.call(l)}function Qf(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tu?u:8;var i=T.T,s={};T.T=s,hc(t,!1,l,e);try{var d=n(),v=T.S;if(v!==null&&v(s,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var z=Ih(d,a);dn(t,l,z,Tl(t))}else dn(t,l,a,Tl(t))}catch(_){dn(t,l,{then:function(){},status:"rejected",reason:_},Tl())}finally{R.p=u,i!==null&&s.types!==null&&(i.types=s.types),T.T=i}}function nm(){}function dc(t,l,e,a){if(t.tag!==5)throw Error(f(476));var n=So(t).queue;po(t,n,l,M,e===null?nm:function(){return xo(t),e(a)})}function So(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:M,baseState:M,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fl,lastRenderedState:M},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function xo(t){var l=So(t);l.next===null&&(l=t.alternate.memoizedState),dn(t,l.next.queue,{},Tl())}function rc(){return It(_n)}function jo(){return Bt().memoizedState}function Eo(){return Bt().memoizedState}function um(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Tl();t=ge(e);var a=be(l,t,e);a!==null&&(hl(a,l,e),un(a,l,e)),l={cache:Qi()},t.payload=l;return}l=l.return}}function im(t,l,e){var a=Tl();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},bu(t)?zo(l,e):(e=Mi(t,l,e,a),e!==null&&(hl(e,t,a),No(e,l,a)))}function To(t,l,e){var a=Tl();dn(t,l,e,a)}function dn(t,l,e,a){var n={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(bu(t))zo(l,n);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=l.lastRenderedReducer,u!==null))try{var i=l.lastRenderedState,s=u(i,e);if(n.hasEagerState=!0,n.eagerState=s,bl(s,i))return In(t,l,n,0),Nt===null&&Fn(),!1}catch{}if(e=Mi(t,l,n,a),e!==null)return hl(e,t,a),No(e,l,a),!0}return!1}function hc(t,l,e,a){if(a={lane:2,revertLane:Kc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bu(t)){if(l)throw Error(f(479))}else l=Mi(t,e,a,2),l!==null&&hl(l,t,2)}function bu(t){var l=t.alternate;return t===lt||l!==null&&l===lt}function zo(t,l){Ea=du=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function No(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Os(t,e)}}var rn={readContext:It,use:mu,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};rn.useEffectEvent=Ht;var Ao={readContext:It,use:mu,useCallback:function(t,l){return ul().memoizedState=[t,l===void 0?null:l],t},useContext:It,useEffect:fo,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,vu(4194308,4,mo.bind(null,l,t),e)},useLayoutEffect:function(t,l){return vu(4194308,4,t,l)},useInsertionEffect:function(t,l){vu(4,2,t,l)},useMemo:function(t,l){var e=ul();l=l===void 0?null:l;var a=t();if($e){fe(!0);try{t()}finally{fe(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=ul();if(e!==void 0){var n=e(l);if($e){fe(!0);try{e(l)}finally{fe(!1)}}}else n=l;return a.memoizedState=a.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},a.queue=t,t=t.dispatch=im.bind(null,lt,t),[a.memoizedState,t]},useRef:function(t){var l=ul();return t={current:t},l.memoizedState=t},useState:function(t){t=ic(t);var l=t.queue,e=To.bind(null,lt,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:fc,useDeferredValue:function(t,l){var e=ul();return oc(e,t,l)},useTransition:function(){var t=ic(!1);return t=po.bind(null,lt,t.queue,!0,!1),ul().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=lt,n=ul();if(dt){if(e===void 0)throw Error(f(407));e=e()}else{if(e=l(),Nt===null)throw Error(f(349));(ft&127)!==0||kf(a,l,e)}n.memoizedState=e;var u={value:e,getSnapshot:l};return n.queue=u,fo($f.bind(null,a,u,t),[t]),a.flags|=2048,za(9,{destroy:void 0},Jf.bind(null,a,u,e,l),null),e},useId:function(){var t=ul(),l=Nt.identifierPrefix;if(dt){var e=Xl,a=Gl;e=(a&~(1<<32-gl(a)-1)).toString(32)+e,l="_"+l+"R_"+e,e=ru++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?i.createElement(n,{is:a.is}):i.createElement(n)}}u[Wt]=l,u[cl]=a;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=u;t:switch(tl(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&Pl(l)}}return Mt(l),Ac(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==a&&Pl(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(f(166));if(t=tt.current,va(l)){if(t=l.stateNode,e=l.memoizedProps,a=null,n=Ft,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}t[Wt]=l,t=!!(t.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||wd(t.nodeValue,e)),t||me(l,!0)}else t=Yu(t).createTextNode(a),t[Wt]=l,l.stateNode=t}return Mt(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(a=va(l),e!==null){if(t===null){if(!a)throw Error(f(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(557));t[Wt]=l}else Ze(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),t=!1}else e=Bi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(xl(l),l):(xl(l),null);if((l.flags&128)!==0)throw Error(f(558))}return Mt(l),null;case 13:if(a=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=va(l),a!==null&&a.dehydrated!==null){if(t===null){if(!n)throw Error(f(318));if(n=l.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(f(317));n[Wt]=l}else Ze(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),n=!1}else n=Bi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return l.flags&256?(xl(l),l):(xl(l),null)}return xl(l),(l.flags&128)!==0?(l.lanes=e,l):(e=a!==null,t=t!==null&&t.memoizedState!==null,e&&(a=l.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),Eu(l,l.updateQueue),Mt(l),null);case 4:return Ut(),t===null&&$c(l.stateNode.containerInfo),Mt(l),null;case 10:return $l(l.type),Mt(l),null;case 19:if(A(qt),a=l.memoizedState,a===null)return Mt(l),null;if(n=(l.flags&128)!==0,u=a.rendering,u===null)if(n)mn(a,!1);else{if(Rt!==0||t!==null&&(t.flags&128)!==0)for(t=l.child;t!==null;){if(u=ou(t),u!==null){for(l.flags|=128,mn(a,!1),t=u.updateQueue,l.updateQueue=t,Eu(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)Ef(e,t),e=e.sibling;return B(qt,qt.current&1|2),dt&&kl(l,a.treeForkCount),l.child}t=t.sibling}a.tail!==null&&yl()>_u&&(l.flags|=128,n=!0,mn(a,!1),l.lanes=4194304)}else{if(!n)if(t=ou(u),t!==null){if(l.flags|=128,n=!0,t=t.updateQueue,l.updateQueue=t,Eu(l,t),mn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!dt)return Mt(l),null}else 2*yl()-a.renderingStartTime>_u&&e!==536870912&&(l.flags|=128,n=!0,mn(a,!1),l.lanes=4194304);a.isBackwards?(u.sibling=l.child,l.child=u):(t=a.last,t!==null?t.sibling=u:l.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=yl(),t.sibling=null,e=qt.current,B(qt,n?e&1|2:e&1),dt&&kl(l,a.treeForkCount),t):(Mt(l),null);case 22:case 23:return xl(l),Wi(),a=l.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(e&536870912)!==0&&(l.flags&128)===0&&(Mt(l),l.subtreeFlags&6&&(l.flags|=8192)):Mt(l),e=l.updateQueue,e!==null&&Eu(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==e&&(l.flags|=2048),t!==null&&A(Ke),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),$l(Yt),Mt(l),null;case 25:return null;case 30:return null}throw Error(f(156,l.tag))}function dm(t,l){switch(Ri(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return $l(Yt),Ut(),t=l.flags,(t&65536)!==0&&(t&128)===0?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Pe(l),null;case 31:if(l.memoizedState!==null){if(xl(l),l.alternate===null)throw Error(f(340));Ze()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(xl(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(f(340));Ze()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return A(qt),null;case 4:return Ut(),null;case 10:return $l(l.type),null;case 22:case 23:return xl(l),Wi(),t!==null&&A(Ke),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return $l(Yt),null;case 25:return null;default:return null}}function Fo(t,l){switch(Ri(l),l.tag){case 3:$l(Yt),Ut();break;case 26:case 27:case 5:Pe(l);break;case 4:Ut();break;case 31:l.memoizedState!==null&&xl(l);break;case 13:xl(l);break;case 19:A(qt);break;case 10:$l(l.type);break;case 22:case 23:xl(l),Wi(),t!==null&&A(Ke);break;case 24:$l(Yt)}}function yn(t,l){try{var e=l.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var n=a.next;e=n;do{if((e.tag&t)===t){a=void 0;var u=e.create,i=e.inst;a=u(),i.destroy=a}e=e.next}while(e!==n)}}catch(s){jt(l,l.return,s)}}function xe(t,l,e){try{var a=l.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&t)===t){var i=a.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,n=l;var d=e,v=s;try{v()}catch(z){jt(n,d,z)}}}a=a.next}while(a!==u)}}catch(z){jt(l,l.return,z)}}function Io(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Qf(l,e)}catch(a){jt(t,t.return,a)}}}function Po(t,l,e){e.props=We(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(a){jt(t,l,a)}}function vn(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof e=="function"?t.refCleanup=e(a):e.current=a}}catch(n){jt(t,l,n)}}function Ql(t,l){var e=t.ref,a=t.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(n){jt(t,l,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(n){jt(t,l,n)}else e.current=null}function td(t){var l=t.type,e=t.memoizedProps,a=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break t;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(n){jt(t,t.return,n)}}function _c(t,l,e){try{var a=t.stateNode;Um(a,t.type,e,l),a[cl]=l}catch(n){jt(t,t.return,n)}}function ld(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&_e(t.type)||t.tag===4}function Oc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||ld(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&_e(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Mc(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=Vl));else if(a!==4&&(a===27&&_e(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Mc(t,l,e),t=t.sibling;t!==null;)Mc(t,l,e),t=t.sibling}function Tu(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(a!==4&&(a===27&&_e(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(Tu(t,l,e),t=t.sibling;t!==null;)Tu(t,l,e),t=t.sibling}function ed(t){var l=t.stateNode,e=t.memoizedProps;try{for(var a=t.type,n=l.attributes;n.length;)l.removeAttributeNode(n[0]);tl(l,a,e),l[Wt]=t,l[cl]=e}catch(u){jt(t,t.return,u)}}var te=!1,Qt=!1,Dc=!1,ad=typeof WeakSet=="function"?WeakSet:Set,kt=null;function rm(t,l){if(t=t.containerInfo,Ic=Ku,t=mf(t),Ti(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{e.nodeType,u.nodeType}catch{e=null;break t}var i=0,s=-1,d=-1,v=0,z=0,_=t,b=null;l:for(;;){for(var S;_!==e||n!==0&&_.nodeType!==3||(s=i+n),_!==u||a!==0&&_.nodeType!==3||(d=i+a),_.nodeType===3&&(i+=_.nodeValue.length),(S=_.firstChild)!==null;)b=_,_=S;for(;;){if(_===t)break l;if(b===e&&++v===n&&(s=i),b===u&&++z===a&&(d=i),(S=_.nextSibling)!==null)break;_=b,b=_.parentNode}_=S}e=s===-1||d===-1?null:{start:s,end:d}}else e=null}e=e||{start:0,end:0}}else e=null;for(Pc={focusedElem:t,selectionRange:e},Ku=!1,kt=l;kt!==null;)if(l=kt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,kt=t;else for(;kt!==null;){switch(l=kt,u=l.alternate,t=l.flags,l.tag){case 0:if((t&4)!==0&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),tl(u,a,e),u[Wt]=t,wt(u),a=u;break t;case"link":var i=fr("link","href",n).get(a+(e.href||""));if(i){for(var s=0;szt&&(i=zt,zt=k,k=i);var m=rf(s,k),r=rf(s,zt);if(m&&r&&(S.rangeCount!==1||S.anchorNode!==m.node||S.anchorOffset!==m.offset||S.focusNode!==r.node||S.focusOffset!==r.offset)){var y=_.createRange();y.setStart(m.node,m.offset),S.removeAllRanges(),k>zt?(S.addRange(y),S.extend(r.node,r.offset)):(y.setEnd(r.node,r.offset),S.addRange(y))}}}}for(_=[],S=s;S=S.parentNode;)S.nodeType===1&&_.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<_.length;s++){var N=_[s];N.element.scrollLeft=N.left,N.element.scrollTop=N.top}}Ku=!!Ic,Pc=Ic=null}finally{pt=n,R.p=a,T.T=e}}t.current=l,Vt=2}}function Md(){if(Vt===2){Vt=0;var t=ze,l=Ma,e=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||e){e=T.T,T.T=null;var a=R.p;R.p=2;var n=pt;pt|=4;try{nd(t,l.alternate,l)}finally{pt=n,R.p=a,T.T=e}}Vt=3}}function Dd(){if(Vt===4||Vt===3){Vt=0,Lr();var t=ze,l=Ma,e=ue,a=gd;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Vt=5:(Vt=0,Ma=ze=null,Cd(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(Te=null),ui(e),l=l.stateNode,vl&&typeof vl.onCommitFiberRoot=="function")try{vl.onCommitFiberRoot(Ga,l,void 0,(l.current.flags&128)===128)}catch{}if(a!==null){l=T.T,n=R.p,R.p=2,T.T=null;try{for(var u=t.onRecoverableError,i=0;ie?32:e,T.T=null,e=Yc,Yc=null;var u=ze,i=ue;if(Vt=0,Ma=ze=null,ue=0,(pt&6)!==0)throw Error(f(331));var s=pt;if(pt|=4,md(u.current),dd(u,u.current,i,e),pt=s,jn(0,!1),vl&&typeof vl.onPostCommitFiberRoot=="function")try{vl.onPostCommitFiberRoot(Ga,u)}catch{}return!0}finally{R.p=n,T.T=a,Cd(t,l)}}function Hd(t,l,e){l=Ol(e,l),l=gc(t.stateNode,l,2),t=be(t,l,2),t!==null&&(Qa(t,2),Zl(t))}function jt(t,l,e){if(t.tag===3)Hd(t,t,e);else for(;l!==null;){if(l.tag===3){Hd(l,t,e);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Te===null||!Te.has(a))){t=Ol(e,t),e=Ro(2),a=be(l,e,2),a!==null&&(qo(e,a,l,t),Qa(a,2),Zl(a));break}}l=l.return}}function Zc(t,l,e){var a=t.pingCache;if(a===null){a=t.pingCache=new ym;var n=new Set;a.set(l,n)}else n=a.get(l),n===void 0&&(n=new Set,a.set(l,n));n.has(e)||(Hc=!0,n.add(e),t=Sm.bind(null,t,l,e),l.then(t,t))}function Sm(t,l,e){var a=t.pingCache;a!==null&&a.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,Nt===t&&(ft&e)===e&&(Rt===4||Rt===3&&(ft&62914560)===ft&&300>yl()-Au?(pt&2)===0&&Da(t,0):Rc|=e,Oa===ft&&(Oa=0)),Zl(t)}function Rd(t,l){l===0&&(l=As()),t=Xe(t,l),t!==null&&(Qa(t,l),Zl(t))}function xm(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),Rd(t,e)}function jm(t,l){var e=0;switch(t.tag){case 31:case 13:var a=t.stateNode,n=t.memoizedState;n!==null&&(e=n.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(f(314))}a!==null&&a.delete(l),Rd(t,e)}function Em(t,l){return li(t,l)}var Hu=null,Ua=null,Lc=!1,Ru=!1,Vc=!1,Ae=0;function Zl(t){t!==Ua&&t.next===null&&(Ua===null?Hu=Ua=t:Ua=Ua.next=t),Ru=!0,Lc||(Lc=!0,zm())}function jn(t,l){if(!Vc&&Ru){Vc=!0;do for(var e=!1,a=Hu;a!==null;){if(t!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var i=a.suspendedLanes,s=a.pingedLanes;u=(1<<31-gl(42|t)+1)-1,u&=n&~(i&~s),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(e=!0,Gd(a,u))}else u=ft,u=Gn(a,a===Nt?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Xa(a,u)||(e=!0,Gd(a,u));a=a.next}while(e);Vc=!1}}function Tm(){qd()}function qd(){Ru=Lc=!1;var t=0;Ae!==0&&Rm()&&(t=Ae);for(var l=yl(),e=null,a=Hu;a!==null;){var n=a.next,u=Bd(a,l);u===0?(a.next=null,e===null?Hu=n:e.next=n,n===null&&(Ua=e)):(e=a,(t!==0||(u&3)!==0)&&(Ru=!0)),a=n}Vt!==0&&Vt!==5||jn(t),Ae!==0&&(Ae=0)}function Bd(t,l){for(var e=t.suspendedLanes,a=t.pingedLanes,n=t.expirationTimes,u=t.pendingLanes&-62914561;0s)break;var z=d.transferSize,_=d.initiatorType;z&&kd(_)&&(d=d.responseEnd,i+=z*(d"u"?null:document;function ur(t,l,e){var a=Ha;if(a&&typeof l=="string"&&l){var n=Al(l);n='link[rel="'+t+'"][href="'+n+'"]',typeof e=="string"&&(n+='[crossorigin="'+e+'"]'),nr.has(n)||(nr.add(n),t={rel:t,crossOrigin:e,href:l},a.querySelector(n)===null&&(l=a.createElement("link"),tl(l,"link",t),wt(l),a.head.appendChild(l)))}}function Vm(t){ie.D(t),ur("dns-prefetch",t,null)}function Km(t,l){ie.C(t,l),ur("preconnect",t,l)}function wm(t,l,e){ie.L(t,l,e);var a=Ha;if(a&&t&&l){var n='link[rel="preload"][as="'+Al(l)+'"]';l==="image"&&e&&e.imageSrcSet?(n+='[imagesrcset="'+Al(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(n+='[imagesizes="'+Al(e.imageSizes)+'"]')):n+='[href="'+Al(t)+'"]';var u=n;switch(l){case"style":u=Ra(t);break;case"script":u=qa(t)}Rl.has(u)||(t=E({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),Rl.set(u,t),a.querySelector(n)!==null||l==="style"&&a.querySelector(Nn(u))||l==="script"&&a.querySelector(An(u))||(l=a.createElement("link"),tl(l,"link",t),wt(l),a.head.appendChild(l)))}}function km(t,l){ie.m(t,l);var e=Ha;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",n='link[rel="modulepreload"][as="'+Al(a)+'"][href="'+Al(t)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=qa(t)}if(!Rl.has(u)&&(t=E({rel:"modulepreload",href:t},l),Rl.set(u,t),e.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(An(u)))return}a=e.createElement("link"),tl(a,"link",t),wt(a),e.head.appendChild(a)}}}function Jm(t,l,e){ie.S(t,l,e);var a=Ha;if(a&&t){var n=aa(a).hoistableStyles,u=Ra(t);l=l||"default";var i=n.get(u);if(!i){var s={loading:0,preload:null};if(i=a.querySelector(Nn(u)))s.loading=5;else{t=E({rel:"stylesheet",href:t,"data-precedence":l},e),(e=Rl.get(u))&&is(t,e);var d=i=a.createElement("link");wt(d),tl(d,"link",t),d._p=new Promise(function(v,z){d.onload=v,d.onerror=z}),d.addEventListener("load",function(){s.loading|=1}),d.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Xu(i,l,a)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(u,i)}}}function $m(t,l){ie.X(t,l);var e=Ha;if(e&&t){var a=aa(e).hoistableScripts,n=qa(t),u=a.get(n);u||(u=e.querySelector(An(n)),u||(t=E({src:t,async:!0},l),(l=Rl.get(n))&&cs(t,l),u=e.createElement("script"),wt(u),tl(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Wm(t,l){ie.M(t,l);var e=Ha;if(e&&t){var a=aa(e).hoistableScripts,n=qa(t),u=a.get(n);u||(u=e.querySelector(An(n)),u||(t=E({src:t,async:!0,type:"module"},l),(l=Rl.get(n))&&cs(t,l),u=e.createElement("script"),wt(u),tl(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function ir(t,l,e,a){var n=(n=tt.current)?Gu(n):null;if(!n)throw Error(f(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=Ra(e.href),e=aa(n).hoistableStyles,a=e.get(l),a||(a={type:"style",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=Ra(e.href);var u=aa(n).hoistableStyles,i=u.get(t);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,i),(u=n.querySelector(Nn(t)))&&!u._p&&(i.instance=u,i.state.loading=5),Rl.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},Rl.set(t,e),u||Fm(n,t,e,i.state))),l&&a===null)throw Error(f(528,""));return i}if(l&&a!==null)throw Error(f(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=qa(e),e=aa(n).hoistableScripts,a=e.get(l),a||(a={type:"script",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,t))}}function Ra(t){return'href="'+Al(t)+'"'}function Nn(t){return'link[rel="stylesheet"]['+t+"]"}function cr(t){return E({},t,{"data-precedence":t.precedence,precedence:null})}function Fm(t,l,e,a){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=t.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),tl(l,"link",e),wt(l),t.head.appendChild(l))}function qa(t){return'[src="'+Al(t)+'"]'}function An(t){return"script[async]"+t}function sr(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+Al(e.href)+'"]');if(a)return l.instance=a,wt(a),a;var n=E({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),wt(a),tl(a,"style",n),Xu(a,e.precedence,t),l.instance=a;case"stylesheet":n=Ra(e.href);var u=t.querySelector(Nn(n));if(u)return l.state.loading|=4,l.instance=u,wt(u),u;a=cr(e),(n=Rl.get(n))&&is(a,n),u=(t.ownerDocument||t).createElement("link"),wt(u);var i=u;return i._p=new Promise(function(s,d){i.onload=s,i.onerror=d}),tl(u,"link",a),l.state.loading|=4,Xu(u,e.precedence,t),l.instance=u;case"script":return u=qa(e.src),(n=t.querySelector(An(u)))?(l.instance=n,wt(n),n):(a=e,(n=Rl.get(u))&&(a=E({},e),cs(a,n)),t=t.ownerDocument||t,n=t.createElement("script"),wt(n),tl(n,"link",a),t.head.appendChild(n),l.instance=n);case"void":return null;default:throw Error(f(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Xu(a,e.precedence,t));return l.instance}function Xu(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,i=0;i title"):null)}function Im(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(t=l.disabled,typeof l.precedence=="string"&&t==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function dr(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Pm(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var n=Ra(a.href),u=l.querySelector(Nn(n));if(u){l=u._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Zu.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=u,wt(u);return}u=l.ownerDocument||l,a=cr(a),(n=Rl.get(n))&&is(a,n),u=u.createElement("link"),wt(u);var i=u;i._p=new Promise(function(s,d){i.onload=s,i.onerror=d}),tl(u,"link",a),e.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=Zu.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var ss=0;function ty(t,l){return t.stylesheets&&t.count===0&&Vu(t,t.stylesheets),0ss?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Zu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Lu=null;function Vu(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lu=new Map,l.forEach(ly,t),Lu=null,Zu.call(t))}function ly(t,l){if(!(l.state.loading&4)){var e=Lu.get(t);if(e)var a=e.get(null);else{e=new Map,Lu.set(t,e);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(g){console.error(g)}}return o(),gs.exports=gy(),gs.exports}var py=by();class Ya extends Error{status;body;constructor(g,j,f={}){super(j),this.status=g,this.body=f}get needsTrust(){return this.body.needsTrust===!0}}const Sy=new Set(["/api/me","/api/login","/api/setup"]);let qr=null;function Rr(o){qr=o}async function Zt(o,g){const j={...g?.headers};g?.body&&(j["Content-Type"]="application/json");const f=await fetch(o,{...g,headers:j,credentials:"same-origin"});if(f.status===401&&!Sy.has(o)&&qr?.(),f.status===204)return;const O=await f.text();let D={};if(O)try{D=JSON.parse(O)}catch{if(!f.ok)throw new Ya(f.status,O.slice(0,400))}if(!f.ok){const x=typeof D.error=="string"?D.error:`request failed (${f.status})`;throw new Ya(f.status,x,D)}return D}const nl=(o,g)=>Zt(o,{method:"POST",body:g===void 0?void 0:JSON.stringify(g)}),rt={health:()=>Zt("/api/health"),source:()=>Zt("/api/source"),volumeSizes:()=>Zt("/api/source/sizes"),me:()=>Zt("/api/me"),setup:(o,g)=>nl("/api/setup",{username:o,password:g}),login:(o,g)=>nl("/api/login",{username:o,password:g}),logout:()=>Zt("/api/logout",{method:"POST"}),users:()=>Zt("/api/users"),createUser:(o,g)=>nl("/api/users",{username:o,password:g}),deleteUser:o=>Zt(`/api/users/${o}`,{method:"DELETE"}),tokens:()=>Zt("/api/tokens"),createToken:o=>nl("/api/tokens",{name:o}),revokeToken:o=>Zt(`/api/tokens/${o}`,{method:"DELETE"}),sources:()=>Zt("/api/sources"),saveSource:o=>nl("/api/sources",o),deleteSource:o=>Zt(`/api/sources/${o}`,{method:"DELETE"}),selectSource:o=>nl(`/api/sources/${o}/select`),probeSource:o=>nl(`/api/sources/${o}/probe`),trustSource:(o,g)=>nl(`/api/sources/${o}/trust`,{fingerprint:g}),connections:()=>Zt("/api/connections"),saveConnection:o=>nl("/api/connections",o),deleteConnection:o=>Zt(`/api/connections/${o}`,{method:"DELETE"}),probe:o=>nl(`/api/connections/${o}/probe`),trust:(o,g)=>nl(`/api/connections/${o}/trust`,{fingerprint:g}),testConnection:o=>nl(`/api/connections/${o}/test`),targetInventory:o=>Zt(`/api/connections/${o}/inventory`),preview:o=>nl("/api/plan/preview",o),migrateSSH:(o,g)=>nl("/api/migrate/ssh",{connectionId:o,plan:g}),buildPackage:(o,g)=>nl("/api/migrate/package",{plan:o,format:g}),jobs:()=>Zt("/api/jobs"),job:o=>Zt(`/api/jobs/${o}`),cancelJob:o=>nl(`/api/jobs/${o}/cancel`),deleteJob:o=>Zt(`/api/jobs/${o}`,{method:"DELETE"}),packages:()=>Zt("/api/packages"),deletePackage:o=>Zt(`/api/packages/${encodeURIComponent(o)}`,{method:"DELETE"}),downloadUrl:o=>`/api/packages/${encodeURIComponent(o)}/download`,jobEvents:o=>new EventSource(`/api/jobs/${o}/events`)};function ce(o){if(o==null||o<0)return"–";if(o===0)return"0 B";const g=["B","KiB","MiB","GiB","TiB","PiB"];let j=o,f=0;for(;j>=1024&&fg(D.target.checked)}),c.jsx("span",{children:j})]})}function Lt({label:o,children:g}){return c.jsxs("label",{className:"field",children:[c.jsx("span",{children:o}),g]})}function Iu({title:o,onClose:g,children:j,footer:f,wide:O}){return q.useEffect(()=>{const D=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[g]),c.jsx("div",{className:"modal-backdrop",onMouseDown:D=>D.target===D.currentTarget&&g(),children:c.jsxs("div",{className:"modal",style:O?{width:"min(1000px, 100%)"}:void 0,children:[c.jsxs("header",{children:[o,c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"btn ghost tiny",onClick:g,children:"close"})]}),c.jsx("div",{className:"content",children:j}),f&&c.jsx("footer",{children:f})]})})}function Jt({kind:o,children:g}){return c.jsx("div",{className:`notice ${o==="info"?"":o}`,children:g})}function xs({done:o,total:g,state:j}){const f=g>0?Math.min(100,o/g*100):j==="succeeded"?100:0,O=j==="succeeded"?"done":j==="failed"?"failed":"";return c.jsx("div",{className:`progress ${O}`,children:c.jsx("div",{style:{width:`${f}%`}})})}function Yr(o,g){return o.kind==="tmpfs"?0:o.sizeBytes>=0?o.sizeBytes:o.name&&g[o.name]!==void 0?g[o.name]:-1}function xy({source:o,sel:g,setSel:j,targetInv:f,loading:O,sizes:D}){const[x,L]=q.useState(""),[U,p]=q.useState(new Set),[V,E]=q.useState(!1),C=o?.inventory.containers??[],I=q.useMemo(()=>new Set((f?.containers??[]).map(H=>H.name)),[f]),Q=q.useMemo(()=>{const H=x.trim().toLowerCase();return C.filter(K=>V&&K.state!=="running"?!1:H?K.name.toLowerCase().includes(H)||K.image.toLowerCase().includes(H)||(K.composeProject??"").toLowerCase().includes(H)||(K.mounts??[]).some(Y=>Y.destination.toLowerCase().includes(H)||(Y.name??"").toLowerCase().includes(H)):!0)},[C,x,V]),ct=q.useMemo(()=>{const H=new Map;for(const K of Q){const Y=K.composeProject||"",P=H.get(Y);P?P.push(K):H.set(Y,[K])}return[...H.entries()].sort((K,Y)=>K[0]===""?1:Y[0]===""?-1:K[0].localeCompare(Y[0]))},[Q]);function Dt(H,K){j(Y=>({...Y,[H]:{...Y[H],...K}}))}function bt(H,K){j(Y=>{const P={...Y};for(const mt of H)P[mt]&&(P[mt]={...P[mt],include:K});return P})}function _t(H){j(K=>{const Y={...K};for(const P of C){const mt=Y[P.id];mt?.include&&(Y[P.id]=H(mt,P))}return Y})}function ht(H,K){_t((Y,P)=>{const mt={...Y.mounts};for(const st of P.mounts??[])st.kind!=="tmpfs"&&K.includes(st.kind)&&(mt[st.destination]={...mt[st.destination],action:H});return{...Y,mounts:mt}})}const at=Q.map(H=>H.id),St=Q.filter(H=>g[H.id]?.include).length,At=Object.values(g).some(H=>H.include);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"toolbar",children:[c.jsx("input",{className:"search",type:"text",placeholder:"filter by name, image, mount…",value:x,onChange:H=>L(H.target.value)}),c.jsx("button",{className:"btn tiny",onClick:()=>bt(at,!0),children:"select all"}),c.jsx("button",{className:"btn tiny",onClick:()=>bt(at,!1),children:"clear"}),c.jsx("button",{className:"btn tiny",onClick:()=>bt(Q.filter(H=>H.state==="running").map(H=>H.id),!0),children:"select running"}),c.jsx(ml,{checked:V,onChange:E,label:c.jsx("span",{className:"small muted",children:"running only"})}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"small faint nowrap",children:["apply to ",St?`${St} selected`:"selection",":"]}),c.jsx("button",{className:"btn tiny",disabled:!At,onClick:()=>ht("copy",["volume","anonymous","bind"]),children:"copy all data"}),c.jsx("button",{className:"btn tiny",disabled:!At,onClick:()=>ht("skip",["bind"]),children:"skip binds"}),c.jsx("button",{className:"btn tiny",disabled:!At,onClick:()=>ht("structure",["volume","anonymous","bind"]),children:"structure only"}),c.jsxs("select",{className:"btn tiny",style:{width:"auto"},disabled:!At,value:"",onChange:H=>{const K=H.target.value;if(K){if(K==="start"&&_t(Y=>({...Y,startAfter:!0})),K==="nostart"&&_t(Y=>({...Y,startAfter:!1})),K==="live"&&_t(Y=>({...Y,stopSourceDuringCopy:!1})),K==="quiesce"&&_t(Y=>({...Y,stopSourceDuringCopy:!0})),K==="keepsource"&&_t(Y=>({...Y,stopSourceAfter:!1})),K==="stopsource"&&_t(Y=>({...Y,stopSourceAfter:!0})),K.startsWith("img:")){const Y=K.slice(4);_t(P=>({...P,migrateImage:Y!=="skip",imageMode:Y}))}H.target.value=""}},children:[c.jsx("option",{value:"",children:"more…"}),c.jsx("option",{value:"start",children:"start after migration"}),c.jsx("option",{value:"nostart",children:"leave stopped on target"}),c.jsx("option",{value:"quiesce",children:"stop source while copying"}),c.jsx("option",{value:"live",children:"copy while running (hot)"}),c.jsx("option",{value:"stopsource",children:"stop source after migration"}),c.jsx("option",{value:"keepsource",children:"leave source running"}),c.jsx("option",{value:"img:auto",children:"image: auto"}),c.jsx("option",{value:"img:pull",children:"image: pull on target"}),c.jsx("option",{value:"img:stream",children:"image: transfer layers"}),c.jsx("option",{value:"img:skip",children:"image: already on target"})]})]}),O&&C.length===0&&c.jsx("div",{className:"empty",children:"reading the source daemon…"}),!O&&C.length===0&&c.jsx("div",{className:"empty",children:"no containers on this host"}),!O&&C.length>0&&Q.length===0&&c.jsx("div",{className:"empty",children:"nothing matches the filter"}),c.jsx("div",{className:"clist",children:ct.map(([H,K])=>c.jsxs("div",{children:[ct.length>1&&c.jsxs("div",{className:"group-head",children:[c.jsx(ml,{checked:K.every(Y=>g[Y.id]?.include),onChange:Y=>bt(K.map(P=>P.id),Y),label:H?`compose: ${H}`:"standalone"}),c.jsx("span",{className:"line"}),c.jsx("span",{children:K.length})]}),K.map(Y=>c.jsx(jy,{c:Y,s:g[Y.id],onChange:P=>Dt(Y.id,P),expanded:U.has(Y.id),toggleExpanded:()=>p(P=>{const mt=new Set(P);return mt.has(Y.id)?mt.delete(Y.id):mt.add(Y.id),mt}),conflicts:I.has(g[Y.id]?.nameOverride||Y.name),sizes:D},Y.id))]},H||"__none"))})]})}function jy({c:o,s:g,onChange:j,expanded:f,toggleExpanded:O,conflicts:D,sizes:x}){if(!g)return null;const U=(o.mounts??[]).filter(E=>E.kind!=="tmpfs"),p=U.filter(E=>(g.mounts[E.destination]?.action??"copy")==="copy"),V=p.reduce((E,C)=>{const I=Yr(C,x);return E+(I>0?I:0)},0);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`crow${g.include?" selected":""}`,children:[c.jsx(ml,{checked:g.include,onChange:E=>j({include:E}),label:""}),c.jsx("button",{className:"expander",onClick:O,title:"per-item options",children:f?"▾":"▸"}),c.jsxs("div",{style:{minWidth:0},children:[c.jsx("div",{className:"name truncate",title:o.name,children:o.name}),c.jsxs("div",{className:"sub row",style:{gap:6},children:[c.jsx(Hn,{state:o.state}),o.composeService&&c.jsxs("span",{className:"faint",children:["· ",o.composeService]}),D&&c.jsx("span",{className:"badge",style:{borderColor:"#5c4520",color:"#e0b556"},children:"on target"})]})]}),c.jsx("div",{className:"image truncate",title:o.image,children:o.image}),c.jsxs("div",{className:"tags",children:[U.map(E=>c.jsx("span",{className:`badge ${E.kind==="bind"?"bind":E.kind==="anonymous"?"anon":"vol"}`,title:`${E.kind} → ${E.destination}${E.readOnly?" (read-only)":""}`,style:{opacity:(g.mounts[E.destination]?.action??"copy")==="skip"?.35:1},children:E.kind==="bind"?(E.source??"").split("/").pop()||"/":E.kind==="anonymous"?"anon":E.name},E.destination)),(o.endpoints??[]).filter(E=>!["bridge","host","none"].includes(E.network)).map(E=>c.jsx("span",{className:"badge net",title:`network ${E.network}`,children:E.network},E.network)),(o.ports??[]).slice(0,3).map((E,C)=>c.jsxs("span",{className:"badge port",children:[E.hostPort,":",E.containerPort.split("/")[0]]},C)),(o.ports??[]).length>3&&c.jsxs("span",{className:"badge port",children:["+",(o.ports??[]).length-3]})]}),c.jsxs("div",{className:"small faint nowrap",style:{textAlign:"right"},children:[p.length>0?`${p.length} to copy`:"no data",V>0&&c.jsxs(c.Fragment,{children:[" · ",ce(V)]})]})]}),f&&c.jsx(Ey,{c:o,s:g,onChange:j,sizes:x})]})}function Ey({c:o,s:g,onChange:j,sizes:f}){const O=o.mounts??[];function D(x,L){j({mounts:{...g.mounts,[x]:{...g.mounts[x],...L}}})}return c.jsxs("div",{className:"detail",children:[(o.warnings??[]).map((x,L)=>c.jsx("div",{className:"notice warn",children:x},L)),c.jsxs("div",{className:"grid2",children:[c.jsx(Lt,{label:"name on target",children:c.jsx("input",{type:"text",placeholder:o.name,value:g.nameOverride??"",onChange:x=>j({nameOverride:x.target.value})})}),c.jsx(Lt,{label:"image",children:c.jsxs("select",{value:g.migrateImage?g.imageMode:"skip",onChange:x=>{const L=x.target.value;j({migrateImage:L!=="skip",imageMode:L})},children:[c.jsx("option",{value:"auto",children:"auto — reuse, pull, or transfer"}),c.jsx("option",{value:"pull",children:"pull on the target"}),c.jsx("option",{value:"stream",children:"transfer the layers"}),c.jsx("option",{value:"skip",children:"already on the target"})]})}),c.jsxs("div",{className:"stack",style:{gap:6},children:[c.jsx(ml,{checked:g.migrateNetworks,onChange:x=>j({migrateNetworks:x}),label:"recreate networks and reattach"}),c.jsx(ml,{checked:g.keepStaticIps,onChange:x=>j({keepStaticIps:x}),disabled:!g.migrateNetworks,label:"keep static IP addresses",title:"Only works when the target networks use the same subnets"}),c.jsx(ml,{checked:g.migratePorts,onChange:x=>j({migratePorts:x}),label:"publish the same host ports"})]}),c.jsxs("div",{className:"stack",style:{gap:6},children:[c.jsx(ml,{checked:g.startAfter,onChange:x=>j({startAfter:x}),label:"start on the target"}),c.jsx(ml,{checked:g.stopSourceDuringCopy,onChange:x=>j({stopSourceDuringCopy:x}),label:"stop the source while copying",title:"Recommended: databases and other writers produce inconsistent copies while running"}),c.jsx(ml,{checked:g.stopSourceAfter,onChange:x=>j({stopSourceAfter:x}),label:"leave the source stopped afterwards"})]})]}),O.length===0?c.jsx("div",{className:"small faint",children:"this container has no mounts"}):c.jsxs("table",{className:"mount-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{style:{width:74},children:"kind"}),c.jsx("th",{children:"in the container"}),c.jsx("th",{children:"on the source"}),c.jsx("th",{style:{width:130},children:"action"}),c.jsx("th",{children:"on the target"}),c.jsx("th",{style:{width:70,textAlign:"right"},children:"size"})]})}),c.jsx("tbody",{children:O.map(x=>{const L=g.mounts[x.destination]??{action:"copy"},U=x.kind==="tmpfs";return c.jsxs("tr",{children:[c.jsx("td",{children:c.jsx("span",{className:`badge ${x.kind==="bind"?"bind":x.kind==="anonymous"?"anon":x.kind==="tmpfs"?"tmpfs":"vol"}`,children:x.kind})}),c.jsxs("td",{className:"mono truncate",title:x.destination,children:[x.destination,x.readOnly&&c.jsx("span",{className:"faint",children:" :ro"})]}),c.jsx("td",{className:"mono truncate faint",title:x.source||x.name,children:x.kind==="bind"?x.source:x.kind==="anonymous"?"(generated)":x.name}),c.jsx("td",{children:c.jsxs("select",{value:L.action,disabled:U,onChange:p=>D(x.destination,{action:p.target.value}),children:[c.jsx("option",{value:"copy",children:"copy data"}),c.jsx("option",{value:"structure",children:"create empty"}),c.jsx("option",{value:"skip",children:"do not mount"})]})}),c.jsxs("td",{children:[x.kind==="bind"&&L.action!=="skip"&&c.jsx("input",{type:"text",placeholder:x.source,value:L.targetSource??"",onChange:p=>D(x.destination,{targetSource:p.target.value})}),x.kind==="volume"&&L.action!=="skip"&&c.jsx("input",{type:"text",placeholder:x.name,value:L.targetName??"",onChange:p=>D(x.destination,{targetName:p.target.value})}),x.kind==="anonymous"&&c.jsx("span",{className:"small faint",children:"a fresh volume is created"}),U&&c.jsx("span",{className:"small faint",children:"in memory, nothing to copy"})]}),c.jsx("td",{className:"small faint nowrap",style:{textAlign:"right"},children:U?"–":ce(Yr(x,f))})]},x.destination)})})]})]})}function Gr({value:o,set:g,where:j}){return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"row",style:{gap:12},children:[c.jsx(Lt,{label:"host",children:c.jsx("input",{type:"text",value:o.host??"",onChange:f=>g("host",f.target.value)})}),c.jsx("div",{style:{width:90},children:c.jsx(Lt,{label:"port",children:c.jsx("input",{type:"number",value:o.port??22,onChange:f=>g("port",Number(f.target.value))})})})]}),c.jsxs("div",{className:"row",style:{gap:12},children:[c.jsx(Lt,{label:"user",children:c.jsx("input",{type:"text",value:o.user??"",onChange:f=>g("user",f.target.value)})}),c.jsx(Lt,{label:"authentication",children:c.jsxs("select",{value:o.auth??"password",onChange:f=>g("auth",f.target.value),children:[c.jsx("option",{value:"password",children:"password"}),c.jsx("option",{value:"key",children:"private key"}),c.jsx("option",{value:"agent",children:"ssh agent"})]})})]}),o.auth==="password"&&c.jsx(Lt,{label:"password",children:c.jsx("input",{type:"password",value:o.password??"",onChange:f=>g("password",f.target.value)})}),o.auth==="key"&&c.jsxs(c.Fragment,{children:[c.jsx(Lt,{label:"private key path on this machine (leave empty to paste the key below)",children:c.jsx("input",{type:"text",placeholder:"/root/.ssh/id_ed25519",value:o.privateKeyPath??"",onChange:f=>g("privateKeyPath",f.target.value)})}),c.jsx(Lt,{label:"or paste the private key",children:c.jsx("textarea",{rows:5,value:o.privateKey??"",onChange:f=>g("privateKey",f.target.value),placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"})}),c.jsx(Lt,{label:"passphrase (if the key is encrypted)",children:c.jsx("input",{type:"password",value:o.passphrase??"",onChange:f=>g("passphrase",f.target.value)})})]}),o.auth==="agent"&&c.jsxs("div",{className:"small muted",children:["Uses the agent at ",c.jsx("span",{className:"mono",children:"$SSH_AUTH_SOCK"})," of the process running dockmv."]}),c.jsx(ml,{checked:o.sudo??!1,onChange:f=>g("sudo",f),label:`run docker through sudo -n on the ${j}`,title:"Needed when the login user is not in the docker group. sudo must not ask for a password."}),c.jsx(Lt,{label:`docker command on the ${j} (optional)`,children:c.jsx("input",{type:"text",placeholder:"docker",value:o.dockerCmd??"",onChange:f=>g("dockerCmd",f.target.value)})}),c.jsx(ml,{checked:o.saveSecrets??!1,onChange:f=>g("saveSecrets",f),label:"remember the password / key on disk"}),o.saveSecrets?c.jsx(Jt,{kind:"warn",children:"Credentials are stored in plain text in dockmv's data directory, readable only by this user. Leave this off to keep them in memory for this session only."}):c.jsx("div",{className:"small faint",children:"Credentials stay in memory and are lost when dockmv restarts."})]})}function Xr({info:o,onClose:g,onTrust:j}){return c.jsx(Iu,{title:"SSH host key",onClose:g,footer:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:g,children:"cancel"}),c.jsx("button",{className:"btn primary",onClick:j,children:o.changed?"replace the stored key and trust":"trust this host"})]}),children:c.jsxs("div",{className:"stack",children:[o.changed&&c.jsxs(Jt,{kind:"err",children:["The key presented by this host is ",c.jsx("b",{children:"different"})," from the one recorded earlier. This happens after a reinstall — but it is also what a machine-in-the-middle looks like. Only continue if you know why it changed."]}),o.trusted&&!o.changed&&c.jsx(Jt,{kind:"ok",children:"This host key is already trusted."}),c.jsxs("div",{className:"small muted",children:["Compare this with the output of ",c.jsxs("span",{className:"mono",children:["ssh-keyscan -t ",o.keyType," ",o.host]})," ","run on the host itself, or with ",c.jsx("span",{className:"mono",children:"ssh-keygen -lf /etc/ssh/ssh_host_*_key.pub"}),"."]}),c.jsxs("div",{className:"fingerprint",children:[o.keyType,c.jsx("br",{}),o.fingerprint]})]})})}function Ty({sources:o,selected:g,status:j,selectSource:f,reload:O,onError:D}){const[x,L]=q.useState(null),[U,p]=q.useState(null),[V,E]=q.useState(""),[C,I]=q.useState(""),Q=o.find(at=>at.id===g),ct=!Q||Q.kind==="local",Dt=Q?.kind==="ssh";async function bt(at,St,At){E(at);try{await At()}catch(H){H instanceof Ya&&H.needsTrust?(I(St),await _t(St)):D(H instanceof Error?H.message:String(H))}finally{E("")}}async function _t(at){try{p(await rt.probeSource(at))}catch(St){D(St instanceof Error?St.message:String(St))}}async function ht(){const at=C||g;U&&await bt("trust",at,async()=>{await rt.trustSource(at,U.fingerprint),p(null),await f(at)})}return c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"source host"}),c.jsxs("div",{className:"stack",children:[c.jsxs("div",{className:"row",children:[c.jsx("select",{value:g,disabled:!!V,onChange:at=>{const St=at.target.value;bt("select",St,()=>f(St))},children:o.map(at=>c.jsx("option",{value:at.id,children:zy(at)},at.id))}),c.jsx("button",{className:"btn tiny",onClick:()=>L({kind:"ssh",ssh:{port:22,auth:"password",saveSecrets:!1,sudo:!1}}),children:"new"})]}),c.jsxs("div",{className:"row wrap",style:{gap:6},children:[c.jsx("button",{className:"btn tiny",disabled:!!V,onClick:()=>{bt("select",g,()=>f(g))},children:V==="select"?"connecting…":"reconnect"}),!ct&&c.jsx("button",{className:"btn tiny",onClick:()=>L(Q),children:"edit"}),Dt&&c.jsx("button",{className:"btn tiny",onClick:()=>{I(g),_t(g)},children:"host key"}),!ct&&c.jsx("button",{className:"btn tiny danger",onClick:()=>{!Q||!confirm(`Delete source "${Q.name}"?`)||bt("del",Q.id,async()=>{await rt.deleteSource(Q.id),await O(),g===Q.id&&await f("local")})},children:"delete"})]}),j?.error&&c.jsx(Jt,{kind:"err",children:j.error}),j&&!j.error&&c.jsxs("dl",{className:"kv",children:[c.jsx("dt",{children:"reached by"}),c.jsx("dd",{className:"mono",children:j.endpoint}),j.dockerVersion&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"docker"}),c.jsx("dd",{children:j.dockerVersion})]})]}),Dt&&c.jsx("div",{className:"small faint",children:"Data is streamed through dockmv: source → this host → target. A local source moves it in one hop."})]}),x&&c.jsx(Ny,{initial:x,onClose:()=>L(null),onSaved:async at=>{L(null),await O(),await bt("select",at.id,()=>f(at.id))},onError:D}),U&&c.jsx(Xr,{info:U,onClose:()=>p(null),onTrust:ht})]})}function zy(o){switch(o.kind){case"local":return`${o.name} (local docker)`;case"docker":return`${o.name} (${o.dockerHost})`;default:return`${o.name} (ssh ${o.ssh?.user}@${o.ssh?.host})`}}function Ny({initial:o,onClose:g,onSaved:j,onError:f}){const[O,D]=q.useState(o),[x,L]=q.useState(!1),U=O.kind??"ssh",p=O.ssh??{};function V(C,I){D(Q=>({...Q,ssh:{...Q.ssh,[C]:I}}))}const E=U==="ssh"?!!p.host&&!!p.user:!!O.dockerHost;return c.jsx(Iu,{title:o.id?`Edit ${o.name}`:"New source host",onClose:g,footer:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:g,children:"cancel"}),c.jsx("button",{className:"btn primary",disabled:x||!E,onClick:async()=>{L(!0);try{await j(await rt.saveSource(Ay(O,U)))}catch(C){f(C instanceof Error?C.message:String(C))}finally{L(!1)}},children:x?"saving…":"save"})]}),children:c.jsxs("div",{className:"stack",style:{gap:12},children:[c.jsxs("div",{className:"row",style:{gap:12},children:[c.jsx(Lt,{label:"label",children:c.jsx("input",{type:"text",value:O.name??"",onChange:C=>D(I=>({...I,name:C.target.value}))})}),c.jsx(Lt,{label:"reached by",children:c.jsxs("select",{value:U,onChange:C=>D(I=>({...I,kind:C.target.value})),children:[c.jsx("option",{value:"ssh",children:"ssh — remote host, driven through its docker CLI"}),c.jsx("option",{value:"docker",children:"docker address — a daemon this host can reach"})]})})]}),U==="docker"?c.jsxs(c.Fragment,{children:[c.jsx(Lt,{label:"docker address",children:c.jsx("input",{type:"text",placeholder:"tcp://10.0.0.5:2375",value:O.dockerHost??"",onChange:C=>D(I=>({...I,dockerHost:C.target.value}))})}),c.jsxs("div",{className:"small muted",children:["Any address the docker CLI accepts: ",c.jsx("span",{className:"mono",children:"tcp://host:2375"}),", or another socket with"," ",c.jsx("span",{className:"mono",children:"unix:///path/docker.sock"}),". A TLS-protected daemon uses the certificates from"," ",c.jsx("span",{className:"mono",children:"DOCKER_CERT_PATH"})," in dockmv's own environment."]}),c.jsxs(Jt,{kind:"warn",children:["A plain ",c.jsx("span",{className:"mono",children:"tcp://"})," daemon is unauthenticated: anyone who can reach that port is root on that host. Prefer an ssh source unless the port is already protected."]})]}):c.jsxs(c.Fragment,{children:[c.jsx(Gr,{value:p,set:V,where:"source host"}),c.jsxs("div",{className:"small muted",children:["Needs ",c.jsx("span",{className:"mono",children:"sshd"})," and a docker CLI of 18.09 or newer on that host — the API is tunnelled through ",c.jsx("span",{className:"mono",children:"docker system dial-stdio"}),". Nothing is installed."]})]})]})})}function Ay(o,g){const j={id:o.id,name:o.name,kind:g};if(g==="docker")return j.dockerHost=o.dockerHost,j;const f=o.ssh??{};return j.ssh={host:f.host??"",port:f.port??22,user:f.user??"",auth:f.auth??"password",password:f.password,privateKey:f.privateKey,privateKeyPath:f.privateKeyPath,passphrase:f.passphrase,sudo:f.sudo??!1,dockerCmd:f.dockerCmd,saveSecrets:f.saveSecrets??!1},j}function _y({source:o,plan:g,includedCount:j,options:f,setOptions:O,connections:D,activeConn:x,setActiveConn:L,reloadConnections:U,targetInv:p,connectTarget:V,onJobStarted:E,onError:C}){const[I,Q]=q.useState(null),[ct,Dt]=q.useState(null),[bt,_t]=q.useState(null),[ht,at]=q.useState(""),[St,At]=q.useState(""),[H,K]=q.useState("tar"),Y=D.find(M=>M.id===x),P=p?.preflight,mt=!!P?.serverVersion;async function st(M,J){at(M);try{await J()}catch(nt){nt instanceof Ya&&nt.needsTrust?await il():C(nt instanceof Error?nt.message:String(nt))}finally{at("")}}const $t=q.useCallback(()=>{x&&st("test",()=>V(x))},[x]);q.useEffect(()=>{$t()},[$t]);async function il(){if(x)try{Dt(await rt.probe(x))}catch(M){C(M instanceof Error?M.message:String(M))}}async function ll(){!x||!ct||await st("trust",async()=>{await rt.trust(x,ct.fingerprint),Dt(null),await V(x)})}const T=j>0&&mt&&!ht,R=j>0&&!ht;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"target host"}),c.jsxs("div",{className:"stack",children:[c.jsxs("div",{className:"row",children:[c.jsxs("select",{value:x,onChange:M=>L(M.target.value),children:[c.jsx("option",{value:"",children:"— no target selected —"}),D.map(M=>c.jsxs("option",{value:M.id,children:[M.name," (",M.user,"@",M.host,")"]},M.id))]}),c.jsx("button",{className:"btn tiny",onClick:()=>Q({port:22,auth:"password",saveSecrets:!1,sudo:!1}),children:"new"})]}),Y&&c.jsxs("div",{className:"row wrap",style:{gap:6},children:[c.jsx("button",{className:"btn tiny",disabled:!!ht,onClick:$t,children:ht==="test"?"connecting…":"connect"}),c.jsx("button",{className:"btn tiny",onClick:()=>Q(Y),children:"edit"}),c.jsx("button",{className:"btn tiny",onClick:il,children:"host key"}),c.jsx("button",{className:"btn tiny danger",onClick:()=>{confirm(`Delete connection "${Y.name}"?`)&&st("del",async()=>{await rt.deleteConnection(Y.id),U()})},children:"delete"})]}),Y&&!p&&c.jsx("div",{className:"small faint",children:"not connected yet"}),P&&c.jsxs(c.Fragment,{children:[(P.problems??[]).map((M,J)=>c.jsx(Jt,{kind:"warn",children:M},J)),mt&&c.jsxs("dl",{className:"kv",children:[c.jsx("dt",{children:"host"}),c.jsx("dd",{children:p?.host||Y?.host}),c.jsx("dt",{children:"docker"}),c.jsxs("dd",{children:[P.serverVersion," · ",P.os,"/",P.arch]}),c.jsx("dt",{children:"free space"}),c.jsxs("dd",{children:[ce(P.diskFreeBytes)," on ",P.dockerRoot]}),c.jsx("dt",{children:"existing"}),c.jsxs("dd",{children:[(p?.containers??[]).length," containers ·"," ",(p?.volumes??[]).length," volumes"]}),c.jsx("dt",{children:"gzip"}),c.jsx("dd",{children:P.hasGzip?"yes":"missing"})]})]})]})]}),c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"options"}),c.jsxs("div",{className:"stack",children:[c.jsx(Lt,{label:"if the name already exists on the target",children:c.jsxs("select",{value:f.conflict,onChange:M=>O(J=>({...J,conflict:M.target.value})),children:[c.jsx("option",{value:"fail",children:"stop with an error"}),c.jsx("option",{value:"skip",children:"skip that container"}),c.jsx("option",{value:"rename",children:"create it under a new name"}),c.jsx("option",{value:"replace",children:"remove the target's container first"})]})}),f.conflict==="rename"&&c.jsx(Lt,{label:"suffix",children:c.jsx("input",{type:"text",value:f.renameSuffix??"",onChange:M=>O(J=>({...J,renameSuffix:M.target.value}))})}),f.conflict==="replace"&&c.jsx(Jt,{kind:"warn",children:"Existing containers and volumes with the same name are deleted on the target before the copy."}),c.jsx(ml,{checked:f.compress,onChange:M=>O(J=>({...J,compress:M})),label:"compress transfers (gzip)"}),c.jsx(ml,{checked:f.verifyAfter,onChange:M=>O(J=>({...J,verifyAfter:M})),label:"verify each container after migrating"}),c.jsx(ml,{checked:f.dryRun,onChange:M=>O(J=>({...J,dryRun:M})),label:"dry run — show every command, change nothing"}),c.jsx(Lt,{label:`containers at a time: ${f.parallelism}`,children:c.jsx("input",{type:"range",min:1,max:6,value:f.parallelism,onChange:M=>O(J=>({...J,parallelism:Number(M.target.value)})),style:{width:"100%"}})})]})]}),c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"migrate over ssh"}),c.jsxs("div",{className:"stack",children:[c.jsx("button",{className:"btn primary",disabled:!T,onClick:()=>st("ssh",async()=>{const M=await rt.migrateSSH(x,g);E(M)}),children:ht==="ssh"?"starting…":`migrate ${j} container${j===1?"":"s"} to target`}),c.jsx("button",{className:"btn",disabled:j===0||!!ht,onClick:()=>st("preview",async()=>{_t(await rt.preview(g))}),children:"preview the commands"}),j===0&&c.jsx("div",{className:"small faint",children:"select at least one container"}),j>0&&!mt&&c.jsx("div",{className:"small faint",children:"connect to a target first"})]})]}),c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"migration package"}),c.jsxs("div",{className:"stack",children:[c.jsxs("div",{className:"small muted",children:["Builds a self-contained folder with the data, the images and an ",c.jsx("span",{className:"mono",children:"install.sh"})," to run on the target. No network between the hosts required."]}),c.jsx(Lt,{label:"package name",children:c.jsx("input",{type:"text",placeholder:"auto (timestamped)",value:St,onChange:M=>At(M.target.value)})}),c.jsx(Lt,{label:"format",children:c.jsxs("select",{value:H,onChange:M=>K(M.target.value),children:[c.jsx("option",{value:"tar",children:"single .tar file (downloadable)"}),c.jsx("option",{value:"dir",children:"directory on this host"})]})}),c.jsx("button",{className:"btn",disabled:!R,onClick:()=>st("pkg",async()=>{const M=await rt.buildPackage({...g,packageName:St},H);E(M)}),children:ht==="pkg"?"starting…":"build package"})]})]}),o?.inventory.warnings?.length?c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"source warnings"}),c.jsx("div",{className:"stack",children:o.inventory.warnings.map((M,J)=>c.jsx(Jt,{kind:"warn",children:M},J))})]}):null,I&&c.jsx(Oy,{initial:I,onClose:()=>Q(null),onSaved:M=>{Q(null),U(),L(M.id)},onError:C}),ct&&c.jsx(Xr,{info:ct,onClose:()=>Dt(null),onTrust:ll}),bt&&c.jsx(My,{data:bt,onClose:()=>_t(null)})]})}function Oy({initial:o,onClose:g,onSaved:j,onError:f}){const[O,D]=q.useState(o),[x,L]=q.useState(!1);function U(p,V){D(E=>({...E,[p]:V}))}return c.jsx(Iu,{title:o.id?`Edit ${o.name}`:"New target host",onClose:g,footer:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:g,children:"cancel"}),c.jsx("button",{className:"btn primary",disabled:x||!O.host||!O.user,onClick:async()=>{L(!0);try{j(await rt.saveConnection(O))}catch(p){f(p instanceof Error?p.message:String(p))}finally{L(!1)}},children:x?"saving…":"save"})]}),children:c.jsxs("div",{className:"stack",style:{gap:12},children:[c.jsx(Lt,{label:"label",children:c.jsx("input",{type:"text",value:O.name??"",onChange:p=>U("name",p.target.value)})}),c.jsx(Gr,{value:O,set:U,where:"target"})]})})}function My({data:o,onClose:g}){const j=o.items.reduce((f,O)=>f+O.totalBytes,0);return c.jsx(Iu,{title:"What this migration will run",wide:!0,onClose:g,footer:c.jsx("button",{className:"btn",onClick:g,children:"close"}),children:c.jsxs("div",{className:"stack",style:{gap:16},children:[c.jsxs("div",{className:"small muted",children:[o.items.length," container(s)",j>0&&c.jsxs(c.Fragment,{children:[" · about ",ce(j)," of known volume data"]}),". These are the commands that run on the target; data is streamed into ",c.jsx("span",{className:"mono",children:"docker cp"})," rather than written to a file."]}),(o.networkCommands??[]).length>0&&c.jsxs("div",{children:[c.jsx("h3",{style:{margin:"0 0 6px",fontSize:12},children:"shared networks"}),c.jsx("pre",{className:"cmdblock",children:(o.networkCommands??[]).join(` `)})]}),o.items.map(f=>c.jsxs("div",{children:[c.jsxs("h3",{style:{margin:"0 0 6px",fontSize:12},children:[f.name,f.targetName!==f.name&&c.jsxs("span",{className:"faint",children:[" → ",f.targetName]})]}),(f.warnings??[]).map((O,D)=>c.jsx(Jt,{kind:"warn",children:O},`w${D}`)),(f.notes??[]).map((O,D)=>c.jsxs("div",{className:"small faint",children:["· ",O]},`n${D}`)),c.jsx("pre",{className:"cmdblock",children:(f.commands??[]).join(` `)})]},f.containerId))]})})}function Dy({jobs:o,activeJob:g,setActiveJob:j,reload:f,reloadPackages:O}){const D=g||o[0]?.id||"";return o.length===0?c.jsx("div",{className:"empty",children:"no migrations yet — select containers and start one"}):c.jsxs("div",{style:{display:"flex",minHeight:0,height:"100%"},children:[c.jsx("div",{className:"joblist",style:{width:320,flex:"0 0 320px",overflow:"auto"},children:o.map(x=>c.jsxs("div",{className:`jobcard${x.id===D?" active":""}`,onClick:()=>j(x.id),children:[c.jsxs("div",{className:"row",children:[c.jsx(Hn,{state:x.state}),c.jsx("span",{className:"spacer"}),c.jsx("span",{className:"small faint",children:x.kind==="ssh"?"ssh":"package"})]}),c.jsx("div",{className:"truncate",style:{marginTop:2},children:x.title}),c.jsxs("div",{className:"small faint",children:[new Date(x.createdAt).toLocaleTimeString()," · ",Br(x.startedAt,x.endedAt),x.dryRun&&" · dry run"]}),c.jsx("div",{style:{marginTop:6},children:c.jsx(xs,{done:x.bytesDone,total:x.bytesTotal,state:x.state})})]},x.id))}),c.jsx("div",{style:{flex:1,minWidth:0,overflow:"auto",borderLeft:"1px solid var(--border)"},children:D&&c.jsx(Cy,{id:D,reload:f,reloadPackages:O})})]})}function Cy({id:o,reload:g,reloadPackages:j}){const[f,O]=q.useState(null),[D,x]=q.useState(!0),L=q.useRef(null),U=q.useRef(!0);q.useEffect(()=>{O(null);let E=!1;rt.job(o).then(I=>!E&&O(I)).catch(()=>{});const C=rt.jobEvents(o);return C.onmessage=I=>{try{O(JSON.parse(I.data))}catch{}},C.addEventListener("done",()=>{C.close(),g(),j()}),C.onerror=()=>C.close(),()=>{E=!0,C.close()}},[o,g,j]);const p=q.useMemo(()=>(f?.log??[]).filter(E=>D||E.level!=="cmd"),[f,D]);if(q.useEffect(()=>{const E=L.current;E&&U.current&&(E.scrollTop=E.scrollHeight)},[p]),!f)return c.jsx("div",{className:"empty",children:"loading…"});const V=f.state==="running"||f.state==="pending";return c.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:14},children:[c.jsxs("div",{className:"row",children:[c.jsx(Hn,{state:f.state}),c.jsx("b",{children:f.title}),f.dryRun&&c.jsx("span",{className:"badge",children:"dry run"}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"small faint",children:[ce(f.bytesDone),f.bytesTotal>0&&c.jsxs(c.Fragment,{children:[" of ",ce(f.bytesTotal)]})," · ",Br(f.startedAt,f.endedAt)]}),V?c.jsx("button",{className:"btn tiny danger",onClick:()=>rt.cancelJob(f.id).then(g),children:"cancel"}):c.jsx("button",{className:"btn tiny ghost",onClick:()=>rt.deleteJob(f.id).then(g),children:"remove"})]}),c.jsx(xs,{done:f.bytesDone,total:f.bytesTotal,state:f.state}),f.error&&c.jsx(Jt,{kind:"err",children:f.error}),f.state==="succeeded"&&f.artifact&&c.jsxs(Jt,{kind:"ok",children:["Package ready at ",c.jsx("span",{className:"mono",children:f.artifact})," (",ce(f.artifactBytes??0),")."," ","Open the Packages tab to download it."]}),f.items.map(E=>c.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:6,padding:"8px 10px"},children:[c.jsxs("div",{className:"row",children:[c.jsx(Hn,{state:E.state}),c.jsx("b",{children:E.name}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"small faint",children:[E.steps.filter(C=>C.state==="succeeded").length,"/",E.steps.length," steps"]})]}),E.error&&c.jsx("div",{className:"small",style:{color:"var(--err)"},children:E.error}),(E.warnings??[]).map((C,I)=>c.jsxs("div",{className:"small",style:{color:"var(--warn)"},children:["! ",C]},I)),c.jsx("div",{className:"steps",children:E.steps.map(C=>c.jsxs("div",{className:`step ${C.state}`,children:[c.jsx(Hn,{state:C.state,label:""}),c.jsx("span",{className:"label truncate",title:C.error||C.label,children:C.label}),c.jsx("span",{children:C.bytesTotal>0||C.bytesDone>0?c.jsx(xs,{done:C.bytesDone,total:C.bytesTotal,state:C.state}):null}),c.jsx("span",{className:"faint nowrap",style:{textAlign:"right"},children:C.bytesDone>0?ce(C.bytesDone):C.state==="skipped"?"skipped":""})]},C.id))})]},E.id)),c.jsxs("div",{className:"row",children:[c.jsx("h3",{style:{margin:0,fontSize:12},children:"log"}),c.jsx("span",{className:"spacer"}),c.jsxs("label",{className:"check small",children:[c.jsx("input",{type:"checkbox",checked:D,onChange:E=>x(E.target.checked)}),c.jsx("span",{children:"show commands"})]})]}),c.jsxs("div",{className:"log",ref:L,onScroll:E=>{const C=E.currentTarget;U.current=C.scrollHeight-C.scrollTop-C.clientHeight<24},children:[p.map(E=>c.jsxs("div",{className:`l-${E.level}`,children:[c.jsxs("span",{className:"ts",children:[new Date(E.at).toLocaleTimeString()," "]}),E.message]},E.seq)),p.length===0&&c.jsx("span",{className:"faint",children:"nothing logged yet"})]})]})}function Uy({packages:o,reload:g}){return o.length===0?c.jsx("div",{className:"empty",children:"no packages built yet"}):c.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12},children:[c.jsxs(Jt,{kind:"info",children:["Copy a package to the target host, then run ",c.jsx("span",{className:"mono",children:"./install.sh --dry-run"})," to review it and"," ",c.jsx("span",{className:"mono",children:"./install.sh"})," to restore. The target needs only bash, gzip and docker."]}),c.jsxs("table",{className:"mount-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"name"}),c.jsx("th",{style:{width:110},children:"kind"}),c.jsx("th",{style:{width:110,textAlign:"right"},children:"size"}),c.jsx("th",{style:{width:170},children:"built"}),c.jsx("th",{style:{width:190}})]})}),c.jsx("tbody",{children:o.map(j=>c.jsxs("tr",{children:[c.jsx("td",{className:"mono truncate",title:j.path,children:j.name}),c.jsx("td",{children:c.jsx("span",{className:"badge",children:j.isDir?"directory":"tar"})}),c.jsx("td",{className:"nowrap",style:{textAlign:"right"},children:ce(j.bytes)}),c.jsx("td",{className:"small faint",children:new Date(j.createdAt).toLocaleString()}),c.jsx("td",{children:c.jsxs("div",{className:"row",style:{justifyContent:"flex-end",gap:6},children:[j.isDir?c.jsx("span",{className:"small faint",title:j.path,children:"copy it from disk"}):c.jsx("a",{className:"btn tiny",href:rt.downloadUrl(j.name),download:!0,children:"download"}),c.jsx("button",{className:"btn tiny danger",onClick:()=>{confirm(`Delete package "${j.name}"? This cannot be undone.`)&&rt.deletePackage(j.name).then(g)},children:"delete"})]})})]},j.name))})]})]})}function Hy({me:o}){const[g,j]=q.useState([]),[f,O]=q.useState(""),[D,x]=q.useState(""),[L,U]=q.useState(!1),[p,V]=q.useState(null),E=q.useCallback(async()=>{try{j(await rt.tokens())}catch(Q){x(Q instanceof Error?Q.message:String(Q))}},[]);q.useEffect(()=>{E()},[E]);const C=async()=>{const Q=f.trim();if(Q){U(!0),x("");try{const ct=await rt.createToken(Q);V({name:ct.name,token:ct.token}),O(""),await E()}catch(ct){x(ct instanceof Ya?ct.message:String(ct))}finally{U(!1)}}},I=async Q=>{confirm("Revoke this token? Anything using it stops working immediately.")&&(await rt.revokeToken(Q),await E())};return c.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,maxWidth:720},children:[c.jsxs("div",{className:"section",style:{padding:0,border:"none"},children:[c.jsx("h3",{children:"signed in as"}),c.jsx("div",{className:"mono",children:o.username})]}),c.jsxs("div",{className:"section",style:{padding:0,border:"none"},children:[c.jsx("h3",{children:"personal API tokens"}),c.jsxs("div",{className:"small faint",children:["For scripted access: pass a token as ",c.jsx("span",{className:"mono",children:"X-Auth-Token"})," or"," ",c.jsx("span",{className:"mono",children:"Authorization: Bearer …"}),"."]})]}),D&&c.jsx(Jt,{kind:"err",children:D}),p&&c.jsxs(Jt,{kind:"warn",children:["Token ",c.jsx("b",{children:p.name})," — copy it now, it will not be shown again:",c.jsx("div",{className:"fingerprint",style:{marginTop:6},children:p.token}),c.jsx("button",{className:"btn tiny",style:{marginTop:6},onClick:()=>V(null),children:"done"})]}),c.jsxs("div",{className:"row",style:{gap:8},children:[c.jsx("input",{type:"text",placeholder:"token name, e.g. ci-backup",value:f,onChange:Q=>O(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&C()}),c.jsx("button",{className:"btn primary",onClick:C,disabled:L||!f.trim(),children:"create token"})]}),g.length===0?c.jsx("div",{className:"empty",children:"no personal tokens yet"}):c.jsxs("table",{className:"mount-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"name"}),c.jsx("th",{style:{width:90},children:"ends in"}),c.jsx("th",{style:{width:170},children:"created"}),c.jsx("th",{style:{width:170},children:"last used"}),c.jsx("th",{style:{width:80}})]})}),c.jsx("tbody",{children:g.map(Q=>c.jsxs("tr",{children:[c.jsx("td",{children:Q.name}),c.jsxs("td",{className:"mono",children:["…",Q.hint]}),c.jsx("td",{className:"small faint",children:new Date(Q.createdAt).toLocaleString()}),c.jsx("td",{className:"small faint",children:Q.lastUsedAt?new Date(Q.lastUsedAt).toLocaleString():"never"}),c.jsx("td",{children:c.jsx("button",{className:"btn tiny danger",onClick:()=>I(Q.id),children:"revoke"})})]},Q.id))})]})]})}function Ry({me:o,logout:g}){const[j,f]=q.useState(null),[O,D]=q.useState(null),[x,L]=q.useState({}),[U,p]=q.useState({conflict:"fail",renameSuffix:"-migrated",compress:!0,compressLevel:1,dryRun:!1,parallelism:1,verifyAfter:!0}),[V,E]=q.useState({}),[C,I]=q.useState([]),[Q,ct]=q.useState("local"),[Dt,bt]=q.useState(null),[_t,ht]=q.useState([]),[at,St]=q.useState(""),[At,H]=q.useState(null),[K,Y]=q.useState([]),[P,mt]=q.useState([]),[st,$t]=q.useState("containers"),[il,ll]=q.useState(""),[T,R]=q.useState(""),[M,J]=q.useState(!0),nt=q.useCallback(async()=>{J(!0);try{const W=await rt.source();D(W),L(el=>{const zl={};for(const He of W.inventory.containers)zl[He.id]=el[He.id]??W.defaults[He.id];return zl}),R(""),rt.volumeSizes().then(el=>E(el.volumes??{})).catch(()=>{})}catch(W){R(W instanceof Error?W.message:String(W))}finally{J(!1)}},[]),h=q.useCallback(async()=>{try{const W=await rt.health();f(W),W.source&&bt(W.source)}catch{}},[]),A=q.useCallback(async()=>{try{const W=await rt.sources();I(W.sources),ct(W.selected),W.current&&bt(W.current)}catch(W){R(W instanceof Error?W.message:String(W))}},[]),B=q.useCallback(async W=>{const el=await rt.selectSource(W);ct(W),bt(el),L({}),E({}),R(""),await nt(),await h()},[nt,h]),G=q.useCallback(async()=>{try{const W=await rt.connections();ht(W),St(el=>el&&W.some(zl=>zl.id===el)?el:W[0]?.id??"")}catch(W){R(W instanceof Error?W.message:String(W))}},[]),$=q.useCallback(async()=>{try{Y(await rt.jobs())}catch{}},[]),tt=q.useCallback(async()=>{try{mt(await rt.packages())}catch{}},[]);q.useEffect(()=>{h(),A(),nt(),G(),$(),tt()},[h,A,nt,G,$,tt]),q.useEffect(()=>{const W=setInterval($,4e3);return()=>clearInterval(W)},[$]);const yt=q.useCallback(async W=>{if(H(null),!W)return;const el=await rt.targetInventory(W);H(el),R("")},[]),Kt=q.useMemo(()=>Object.values(x).filter(W=>W.include),[x]),Ut=q.useMemo(()=>({items:Object.values(x),options:U}),[x,U]),se=K.filter(W=>W.state==="running"||W.state==="pending").length,Pe=q.useCallback(W=>{Y(el=>[W,...el]),ll(W.id),$t("jobs")},[]);return c.jsxs("div",{className:"app",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{src:"/logo-icon.png",alt:"",className:"brand-logo"}),"DockMV"]}),c.jsxs("nav",{className:"tabs",children:[c.jsxs("button",{className:`tab${st==="containers"?" active":""}`,onClick:()=>$t("containers"),children:["Containers",c.jsxs("span",{className:"count",children:[Kt.length,"/",O?.inventory.containers.length??0]})]}),c.jsxs("button",{className:`tab${st==="jobs"?" active":""}`,onClick:()=>$t("jobs"),children:["Jobs",se>0&&c.jsxs("span",{className:"count",children:[se," running"]})]}),c.jsxs("button",{className:`tab${st==="packages"?" active":""}`,onClick:()=>$t("packages"),children:["Packages",P.length>0&&c.jsx("span",{className:"count",children:P.length})]}),c.jsx("button",{className:`tab${st==="account"?" active":""}`,onClick:()=>$t("account"),children:"Account"})]}),c.jsxs("div",{className:"topbar-right",children:[j&&c.jsxs("span",{className:"hostinfo",children:["source ",c.jsx("b",{children:O?.inventory.host||Dt?.name||j.dockerHost}),Dt?.kind==="ssh"&&c.jsx(c.Fragment,{children:" · over ssh"}),Dt?.kind==="docker"&&c.jsxs(c.Fragment,{children:[" · ",Dt.endpoint]}),j.dockerVersion&&c.jsxs(c.Fragment,{children:[" · docker ",j.dockerVersion]})]}),c.jsx("button",{className:"btn tiny",onClick:nt,disabled:M,children:M?"loading…":"refresh"}),c.jsx("span",{className:"small faint",children:o.username}),c.jsx("button",{className:"btn tiny ghost",onClick:g,children:"sign out"})]})]}),T&&c.jsx("div",{style:{padding:"10px 16px"},children:c.jsxs(Jt,{kind:"err",children:[T,c.jsx("button",{className:"btn tiny ghost",style:{marginLeft:8},onClick:()=>R(""),children:"dismiss"})]})}),j&&!j.ok&&c.jsx("div",{style:{padding:"10px 16px"},children:c.jsxs(Jt,{kind:"err",children:["Cannot reach the source ",c.jsx("b",{children:j.source?.name??"docker daemon"}),j.dockerHost&&c.jsxs(c.Fragment,{children:[" at ",c.jsx("span",{className:"mono",children:j.dockerHost})]}),j.dockerError&&c.jsxs(c.Fragment,{children:[" — ",j.dockerError]}),c.jsx("div",{className:"small",children:"Pick another source in the panel on the right."})]})}),c.jsxs("div",{className:"body",children:[c.jsxs("main",{className:"main",children:[st==="containers"&&c.jsx(xy,{source:O,sel:x,setSel:L,targetInv:At,loading:M,sizes:V}),st==="jobs"&&c.jsx(Dy,{jobs:K,activeJob:il,setActiveJob:ll,reload:$,reloadPackages:tt}),st==="packages"&&c.jsx(Uy,{packages:P,reload:tt}),st==="account"&&c.jsx(Hy,{me:o})]}),st==="containers"&&c.jsxs("aside",{className:"sidebar",children:[c.jsx(Ty,{sources:C,selected:Q,status:Dt,selectSource:B,reload:A,onError:R}),c.jsx(_y,{source:O,plan:Ut,includedCount:Kt.length,options:U,setOptions:p,connections:_t,activeConn:at,setActiveConn:St,reloadConnections:G,targetInv:At,connectTarget:yt,onJobStarted:Pe,onError:R})]})]})]})}function qy({needsSetup:o,onDone:g}){const[j,f]=q.useState(""),[O,D]=q.useState(""),[x,L]=q.useState(""),[U,p]=q.useState(!1),V=async E=>{E.preventDefault(),p(!0),L("");try{o?await rt.setup(j,O):await rt.login(j,O),g()}catch(C){L(C instanceof Ya?C.message:String(C))}finally{p(!1)}};return c.jsx("div",{className:"login",children:c.jsxs("form",{className:"login-box",onSubmit:V,children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{src:"/logo-icon.png",alt:"",className:"brand-logo"}),"DockMV"]}),c.jsx("h1",{children:o?"Create your account":"Sign in"}),o&&c.jsx(Jt,{kind:"info",children:"No account exists yet. Create the first one to finish setup — every account can manage every other one, there are no separate roles yet."}),c.jsxs("label",{className:"field",children:[c.jsx("span",{children:"username"}),c.jsx("input",{type:"text",autoFocus:!0,autoComplete:"username",value:j,onChange:E=>f(E.target.value),required:!0})]}),c.jsxs("label",{className:"field",children:[c.jsx("span",{children:"password"}),c.jsx("input",{type:"password",autoComplete:o?"new-password":"current-password",value:O,onChange:E=>D(E.target.value),required:!0})]}),x&&c.jsx(Jt,{kind:"err",children:x}),c.jsx("button",{className:"btn primary",type:"submit",disabled:U,children:U?"please wait…":o?"create account":"sign in"})]})})}function By(){const[o,g]=q.useState(null),[j,f]=q.useState(""),O=q.useCallback(async()=>{try{g(await rt.me()),f("")}catch(x){f(x instanceof Error?x.message:String(x))}},[]);q.useEffect(()=>{O()},[O]),q.useEffect(()=>(Rr(()=>g(x=>x&&{...x,authenticated:!1})),()=>Rr(null)),[]);const D=q.useCallback(async()=>{await rt.logout().catch(()=>{}),await O()},[O]);return o?o.authenticated?c.jsx(Ry,{me:o,logout:D}):c.jsx(qy,{needsSetup:!!o.needsSetup,onDone:O}):c.jsx("div",{className:"empty",children:j||"loading…"})}py.createRoot(document.getElementById("root")).render(c.jsx(q.StrictMode,{children:c.jsx(By,{})}));